From 7a6fb383156e8f99fbd50df2dd7aebe067e7c07f Mon Sep 17 00:00:00 2001 From: Asher Yan Date: Thu, 23 Jul 2026 09:14:47 -0400 Subject: [PATCH 1/7] Close Carlet Chapter 4 --- .agents/PLAN.md | 75 +- .agents/SPEC.md | 50 +- .agents/audit/dependency-dag.md | 317 +- .agents/audit/fidelity.md | 90 +- .agents/inventory/carlet-chapter02.yaml | 136 +- .agents/inventory/carlet-chapter03.yaml | 26 +- .agents/inventory/carlet-chapter04.yaml | 1613 + AGENTS.md | 32 +- CryptBoolean.lean | 1 + CryptBoolean/Carlet/Chapter03.lean | 3 + CryptBoolean/Carlet/Chapter03/ReedMuller.lean | 7 +- .../Carlet/Chapter03/ReedMullerDuality.lean | 34 + .../ReedMullerLowWeightAffineSpan.lean | 362 + .../ReedMullerLowWeightSpectrum.lean | 256 + .../Chapter03/ReedMullerMinimumWeight.lean | 1024 + .../ReedMullerWeightSixteenSelfDual.lean | 478 + CryptBoolean/Carlet/Chapter04.lean | 63 + .../Chapter04/AffineReindexResiliency.lean | 166 + .../Carlet/Chapter04/AlgebraicImmunity.lean | 245 + .../Chapter04/AlgebraicImmunityBounds.lean | 344 + .../Chapter04/AnnihilatorLinearSystem.lean | 84 + .../Chapter04/AutocorrelationBounds.lean | 219 + .../Chapter04/AutocorrelationIdentities.lean | 114 + .../Chapter04/AutocorrelationIndicators.lean | 114 + .../Chapter04/CodeGeneratorResiliency.lean | 275 + .../Carlet/Chapter04/DegreeCount.lean | 126 + .../Chapter04/DegreeRepairNonlinearity.lean | 289 + .../Chapter04/DerivativeNonlinearity.lean | 266 + .../Chapter04/DistanceToLinearStructures.lean | 455 + .../Carlet/Chapter04/FastAlgebraic.lean | 245 + .../FiveVariableMaximumNonlinearity.lean | 643 + .../GeneralizedLinearStructureDistance.lean | 181 + .../Chapter04/HigherOrderGeneralBounds.lean | 985 + .../Chapter04/HigherOrderJuntaDistance.lean | 125 + .../Chapter04/HigherOrderLowWeightFlats.lean | 422 + .../Chapter04/HigherOrderNonlinearity.lean | 347 + .../Carlet/Chapter04/HigherOrderOrderTwo.lean | 1034 + .../HigherOrderOrderTwoAsymptotics.lean | 496 + .../HigherOrderOrderTwoLowWeightSpectrum.lean | 50 + .../HigherOrderOrderTwoMomentDifference.lean | 397 + .../HigherOrderOrderTwoWeightEight.lean | 1116 + .../HigherOrderOrderTwoWeightFourteen.lean | 1099 + ...rOrderTwoWeightFourteenClassification.lean | 1233 + .../HigherOrderOrderTwoWeightSixteen.lean | 863 + ...rOrderOrderTwoWeightSixteenAffineMaps.lean | 240 + ...derTwoWeightSixteenCandidateSoundness.lean | 440 + ...SixteenCandidateSoundnessCertificates.lean | 361 + ...erOrderTwoWeightSixteenCharacterBound.lean | 37 + ...erOrderTwoWeightSixteenClassification.lean | 2065 ++ ...eightSixteenNormalizedCandidateDecode.lean | 79 + ...rTwoWeightSixteenNormalizedCandidates.lean | 24648 ++++++++++++++++ ...WeightSixteenNormalizedClassification.lean | 391 + ...rTwoWeightSixteenNormalizedClassifier.lean | 825 + ...OrderTwoWeightSixteenOrbitAggregation.lean | 1124 + ...rderTwoWeightSixteenOrbitDisjointness.lean | 404 + ...TwoWeightSixteenOrbitPairwiseDisjoint.lean | 55 + ...erOrderTwoWeightSixteenOrbitSoundness.lean | 203 + ...erOrderOrderTwoWeightSixteenOrbitSums.lean | 244 + ...OrderTwoWeightSixteenPatternOrbitSums.lean | 951 + ...oWeightSixteenRankSevenClassification.lean | 266 + ...rderTwoWeightSixteenRankSevenPatterns.lean | 248 + ...rTwoWeightSixteenSupportNormalization.lean | 894 + ...derTwoWeightSixteenSystematicEncoding.lean | 94 + ...HigherOrderOrderTwoWeightSixteenTypeA.lean | 750 + .../HigherOrderOrderTwoWeightTwelve.lean | 641 + ...derOrderTwoWeightTwelveClassification.lean | 2957 ++ .../HigherOrderSharpAsymptotics.lean | 77 + .../HigherOrderTupleCountDifferences.lean | 309 + .../Chapter04/HigherOrderTupleCounts.lean | 966 + .../Chapter04/IndicatorSpectralBounds.lean | 667 + .../Chapter04/KthNonhomomorphicity.lean | 748 + .../Chapter04/LinearKernelNonlinearity.lean | 208 + .../Chapter04/LinearStructureNormalForm.lean | 274 + .../Chapter04/LinearStructureSpectrum.lean | 442 + .../Carlet/Chapter04/LinearStructures.lean | 85 + .../Carlet/Chapter04/MaximumCorrelation.lean | 778 + .../Carlet/Chapter04/Nonlinearity.lean | 653 + .../OddDimensionBestNonlinearity.lean | 3077 ++ .../Chapter04/OddWeightingNonlinearity.lean | 279 + .../Carlet/Chapter04/OtherComplexity.lean | 117 + .../Carlet/Chapter04/PropagationCriteria.lean | 567 + .../Chapter04/PropagationNonlinearity.lean | 1011 + .../RandomNonlinearityAsymptotics.lean | 707 + .../Chapter04/ReedMullerCosetDistance.lean | 390 + CryptBoolean/Carlet/Chapter04/Resiliency.lean | 408 + .../Chapter04/RodierGaussianMainTerm.lean | 1070 + .../Carlet/Chapter04/RodierLowerTail.lean | 4010 +++ .../Chapter04/RodierSharpAsymptotics.lean | 988 + .../Carlet/Chapter04/RodierSharpInterval.lean | 321 + .../SevenVariableMaximumNonlinearity.lean | 389 + .../Carlet/Chapter04/SupportDualDistance.lean | 129 + README.md | 49 +- .../CryptBooleanBlueprint/BibTeX.lean | 340 + .../CryptBooleanBlueprint/Blueprint.lean | 25 +- .../Carlet/Chapter03.lean | 10 +- .../Carlet/Chapter03/ReedMuller.lean | 10 +- .../Carlet/Chapter04.lean | 48 + .../Carlet/Chapter04/AlgebraicImmunity.lean | 86 + .../Carlet/Chapter04/Autocorrelation.lean | 81 + .../Chapter04/HigherOrderNonlinearity.lean | 495 + .../Carlet/Chapter04/LinearStructures.lean | 88 + .../Carlet/Chapter04/MaximumCorrelation.lean | 57 + .../Carlet/Chapter04/Nonlinearity.lean | 370 + .../Carlet/Chapter04/OtherCriteria.lean | 59 + .../Carlet/Chapter04/Resiliency.lean | 83 + .../CryptBooleanBlueprint/Citations.lean | 107 + .../CryptBooleanBlueprint/References.lean | 90 + .../CryptBooleanBlueprint/Sources.lean | 12 + .../CryptBooleanBlueprint/references.bib | 128 + blueprint-verso/lakefile.lean | 20 + .../scripts/check_statement_style.py | 6 +- blueprint-verso/scripts/validate_manifest.py | 11 +- 112 files changed, 75066 insertions(+), 196 deletions(-) create mode 100644 .agents/inventory/carlet-chapter04.yaml create mode 100644 CryptBoolean/Carlet/Chapter03/ReedMullerLowWeightAffineSpan.lean create mode 100644 CryptBoolean/Carlet/Chapter03/ReedMullerLowWeightSpectrum.lean create mode 100644 CryptBoolean/Carlet/Chapter03/ReedMullerMinimumWeight.lean create mode 100644 CryptBoolean/Carlet/Chapter03/ReedMullerWeightSixteenSelfDual.lean create mode 100644 CryptBoolean/Carlet/Chapter04.lean create mode 100644 CryptBoolean/Carlet/Chapter04/AffineReindexResiliency.lean create mode 100644 CryptBoolean/Carlet/Chapter04/AlgebraicImmunity.lean create mode 100644 CryptBoolean/Carlet/Chapter04/AlgebraicImmunityBounds.lean create mode 100644 CryptBoolean/Carlet/Chapter04/AnnihilatorLinearSystem.lean create mode 100644 CryptBoolean/Carlet/Chapter04/AutocorrelationBounds.lean create mode 100644 CryptBoolean/Carlet/Chapter04/AutocorrelationIdentities.lean create mode 100644 CryptBoolean/Carlet/Chapter04/AutocorrelationIndicators.lean create mode 100644 CryptBoolean/Carlet/Chapter04/CodeGeneratorResiliency.lean create mode 100644 CryptBoolean/Carlet/Chapter04/DegreeCount.lean create mode 100644 CryptBoolean/Carlet/Chapter04/DegreeRepairNonlinearity.lean create mode 100644 CryptBoolean/Carlet/Chapter04/DerivativeNonlinearity.lean create mode 100644 CryptBoolean/Carlet/Chapter04/DistanceToLinearStructures.lean create mode 100644 CryptBoolean/Carlet/Chapter04/FastAlgebraic.lean create mode 100644 CryptBoolean/Carlet/Chapter04/FiveVariableMaximumNonlinearity.lean create mode 100644 CryptBoolean/Carlet/Chapter04/GeneralizedLinearStructureDistance.lean create mode 100644 CryptBoolean/Carlet/Chapter04/HigherOrderGeneralBounds.lean create mode 100644 CryptBoolean/Carlet/Chapter04/HigherOrderJuntaDistance.lean create mode 100644 CryptBoolean/Carlet/Chapter04/HigherOrderLowWeightFlats.lean create mode 100644 CryptBoolean/Carlet/Chapter04/HigherOrderNonlinearity.lean create mode 100644 CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwo.lean create mode 100644 CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoAsymptotics.lean create mode 100644 CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoLowWeightSpectrum.lean create mode 100644 CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoMomentDifference.lean create mode 100644 CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightEight.lean create mode 100644 CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightFourteen.lean create mode 100644 CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightFourteenClassification.lean create mode 100644 CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteen.lean create mode 100644 CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenAffineMaps.lean create mode 100644 CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenCandidateSoundness.lean create mode 100644 CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenCandidateSoundnessCertificates.lean create mode 100644 CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenCharacterBound.lean create mode 100644 CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenClassification.lean create mode 100644 CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenNormalizedCandidateDecode.lean create mode 100644 CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenNormalizedCandidates.lean create mode 100644 CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenNormalizedClassification.lean create mode 100644 CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenNormalizedClassifier.lean create mode 100644 CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenOrbitAggregation.lean create mode 100644 CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenOrbitDisjointness.lean create mode 100644 CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenOrbitPairwiseDisjoint.lean create mode 100644 CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenOrbitSoundness.lean create mode 100644 CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenOrbitSums.lean create mode 100644 CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenPatternOrbitSums.lean create mode 100644 CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenRankSevenClassification.lean create mode 100644 CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenRankSevenPatterns.lean create mode 100644 CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenSupportNormalization.lean create mode 100644 CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenSystematicEncoding.lean create mode 100644 CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenTypeA.lean create mode 100644 CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightTwelve.lean create mode 100644 CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightTwelveClassification.lean create mode 100644 CryptBoolean/Carlet/Chapter04/HigherOrderSharpAsymptotics.lean create mode 100644 CryptBoolean/Carlet/Chapter04/HigherOrderTupleCountDifferences.lean create mode 100644 CryptBoolean/Carlet/Chapter04/HigherOrderTupleCounts.lean create mode 100644 CryptBoolean/Carlet/Chapter04/IndicatorSpectralBounds.lean create mode 100644 CryptBoolean/Carlet/Chapter04/KthNonhomomorphicity.lean create mode 100644 CryptBoolean/Carlet/Chapter04/LinearKernelNonlinearity.lean create mode 100644 CryptBoolean/Carlet/Chapter04/LinearStructureNormalForm.lean create mode 100644 CryptBoolean/Carlet/Chapter04/LinearStructureSpectrum.lean create mode 100644 CryptBoolean/Carlet/Chapter04/LinearStructures.lean create mode 100644 CryptBoolean/Carlet/Chapter04/MaximumCorrelation.lean create mode 100644 CryptBoolean/Carlet/Chapter04/Nonlinearity.lean create mode 100644 CryptBoolean/Carlet/Chapter04/OddDimensionBestNonlinearity.lean create mode 100644 CryptBoolean/Carlet/Chapter04/OddWeightingNonlinearity.lean create mode 100644 CryptBoolean/Carlet/Chapter04/OtherComplexity.lean create mode 100644 CryptBoolean/Carlet/Chapter04/PropagationCriteria.lean create mode 100644 CryptBoolean/Carlet/Chapter04/PropagationNonlinearity.lean create mode 100644 CryptBoolean/Carlet/Chapter04/RandomNonlinearityAsymptotics.lean create mode 100644 CryptBoolean/Carlet/Chapter04/ReedMullerCosetDistance.lean create mode 100644 CryptBoolean/Carlet/Chapter04/Resiliency.lean create mode 100644 CryptBoolean/Carlet/Chapter04/RodierGaussianMainTerm.lean create mode 100644 CryptBoolean/Carlet/Chapter04/RodierLowerTail.lean create mode 100644 CryptBoolean/Carlet/Chapter04/RodierSharpAsymptotics.lean create mode 100644 CryptBoolean/Carlet/Chapter04/RodierSharpInterval.lean create mode 100644 CryptBoolean/Carlet/Chapter04/SevenVariableMaximumNonlinearity.lean create mode 100644 CryptBoolean/Carlet/Chapter04/SupportDualDistance.lean create mode 100644 blueprint-verso/CryptBooleanBlueprint/BibTeX.lean create mode 100644 blueprint-verso/CryptBooleanBlueprint/Carlet/Chapter04.lean create mode 100644 blueprint-verso/CryptBooleanBlueprint/Carlet/Chapter04/AlgebraicImmunity.lean create mode 100644 blueprint-verso/CryptBooleanBlueprint/Carlet/Chapter04/Autocorrelation.lean create mode 100644 blueprint-verso/CryptBooleanBlueprint/Carlet/Chapter04/HigherOrderNonlinearity.lean create mode 100644 blueprint-verso/CryptBooleanBlueprint/Carlet/Chapter04/LinearStructures.lean create mode 100644 blueprint-verso/CryptBooleanBlueprint/Carlet/Chapter04/MaximumCorrelation.lean create mode 100644 blueprint-verso/CryptBooleanBlueprint/Carlet/Chapter04/Nonlinearity.lean create mode 100644 blueprint-verso/CryptBooleanBlueprint/Carlet/Chapter04/OtherCriteria.lean create mode 100644 blueprint-verso/CryptBooleanBlueprint/Carlet/Chapter04/Resiliency.lean create mode 100644 blueprint-verso/CryptBooleanBlueprint/Citations.lean create mode 100644 blueprint-verso/CryptBooleanBlueprint/References.lean create mode 100644 blueprint-verso/CryptBooleanBlueprint/Sources.lean create mode 100644 blueprint-verso/CryptBooleanBlueprint/references.bib diff --git a/.agents/PLAN.md b/.agents/PLAN.md index 1639e16..3e62e72 100644 --- a/.agents/PLAN.md +++ b/.agents/PLAN.md @@ -2,16 +2,18 @@ ## Baseline and planning facts -CryptBoolean pins FABL at release `v0.5.6`. Its public root -exposes the binary cube, sign cube, dot product, representation equivalence, normalized Fourier -coefficients, Fourier expansion, Plancherel, relative Hamming distance, balancedness, restrictions, -and derivatives needed for the first CryptBooleanFunction layer. - -The current Blueprint baseline contains 43 source-facing statement nodes: 41 formalized nodes -associated with 180 proved Lean declarations and 2 visibly open nodes, connected by 64 reviewed +CryptBoolean pins FABL at release `v0.5.6`. Its public root exposes the binary cube, sign cube, dot +product, representation equivalence, normalized Fourier coefficients, Fourier expansion, +Plancherel, relative Hamming distance, balancedness, restrictions, ANF, algebraic degree, affine +functions, and derivatives needed by CryptBoolean. FABL is the canonical owner of those shared APIs; +this project imports them directly and adds only source-facing or representation bridges. + +The current Blueprint baseline contains 116 source-facing statement nodes: 115 formalized nodes +associated with 759 proved Lean declarations and 1 visibly open node, connected by 223 reviewed dependency edges. Chapter 2 contributes 36 nodes (35 formalized and 1 open), 159 declarations, and -45 incoming edges. Chapter 3 contributes 7 nodes (6 formalized and 1 open), 21 declarations, and 19 -incoming edges. These counts are a synchronized verification contract shared by the inventories, +45 incoming edges. Chapter 3 contributes 7 formalized nodes, 32 declarations, and 19 incoming +edges. Chapter 4 contributes 73 formalized nodes, 568 declarations, and 159 incoming edges. These +counts are a synchronized verification contract shared by the inventories, Verso sources, `blueprint-verso/scripts/validate_manifest.py`, and `AGENTS.md`. Automated PDF text extraction finds 93 numbered definition/theorem/proposition/lemma/corollary @@ -73,8 +75,9 @@ tooling pipeline runs, and no local filesystem path appears in package metadata. ## Phase 1 - Complete Carlet inventory -Status: in progress. Reviewed Chapter 2 and Chapter 3 items live under `.agents/inventory/`; later -chapters are not yet inventoried. +Status: in progress. Reviewed Chapter 2 and Chapter 3 items live under `.agents/inventory/`. +Chapter 4's 73-item inventory is source-reviewed and Blueprint-synchronized; Chapters 5--10 are not +yet inventoried. Read Chapters 2--10 in full and create one Blueprint node per in-scope item. Record full statements, source locations, representation decisions, and mathematical dependencies. Mark referenced results @@ -117,8 +120,8 @@ support, and the coefficients along the relevant cyclotomic orbit must be shown - algebraic support and algebraic degree; - affine invariance and restriction laws required downstream. -This work uses Carlet-facing names. Before FABL Chapter 6 exposes a stable overlapping API, perform -an ownership review and replace duplication with reuse or a narrow bridge. +Pinned FABL `v0.5.6` canonically owns the ANF and algebraic-degree APIs. CryptBoolean imports that +surface directly and keeps only the Carlet-facing statements and narrow representation bridges. ### 2C. Fourier and Walsh @@ -139,14 +142,14 @@ and restriction claims without introducing a second representation. ## Phase 3 - Chapter 3 coding -Status: 6 of 7 source-facing nodes are formalized. The production surface defines `reedMuller r n` -and proves the affine-weight theorem, the derived first-order distance result, Carlet's general-order -Theorem 1, the dimension and cardinality formulas, and Theorem 2 on duality. Only Proposition 12's -minimum-weight equality classification remains open. +Status: complete. All 7 source-facing nodes are formalized by 32 proved declarations. The +production surface defines `reedMuller r n` and proves the affine-weight theorem, the derived first- +order distance result, Carlet's general-order Theorem 1, Proposition 12's minimum-weight equality +classification, the dimension and cardinality formulas, and Theorem 2 on duality. -The precise Proposition 12 frontier is an arbitrary affine-flat normal form, the theorem that an -affine-flat indicator has algebraic degree equal to its codimension, and equality-case slice -infrastructure strengthening the general lower-bound induction. +Proposition 12 is closed by composing an arbitrary affine-flat indicator normal form, the theorem +that its algebraic degree equals its codimension, and equality-case slice rigidity for the converse +classification. - define Reed-Muller function families from bounded algebraic degree; - relate evaluation vectors, Hamming weight, and minimum distance; @@ -156,22 +159,26 @@ infrastructure strengthening the general lower-bound induction. Do not build a general coding framework in advance. Revisit the abstraction only when Kerdock codes or a second production use requires it. -Exit gate: Chapter 3 is source-complete and Chapter 4 can define nonlinearity by distance to the -first-order Reed-Muller family. +Exit gate: achieved. Chapter 3 is source-complete and its distance, classification, dimension, and +duality surface supports Chapter 4's nonlinearity definitions. ## Phase 4 - Chapter 4 cryptographic criteria -Close the criteria in dependency order: +Status: complete. All 73 source-facing nodes are formalized by 568 proved declarations with 159 +reviewed dependency edges. The compiled surface establishes the vocabulary used by all class and +construction chapters: degree, nonlinearity, higher-order distance, resiliency, propagation, +linear structures, algebraic immunity, autocorrelation, maximum correlation, and the remaining +explicit complexity criteria. -1. algebraic degree; -2. nonlinearity and its maximum-Walsh formula; -3. balancedness, correlation immunity, and resiliency; -4. strict avalanche and propagation criteria; -5. linear structures and derivative characterizations; -6. algebraic immunity and annihilators; -7. remaining explicitly mathematical criteria. +The last three closures are Rodier's sharp random-nonlinearity interval, the exact best +nonlinearity in dimension seven, and the sharp fixed-order higher-order asymptotic upper bound. The +last proof is factored through separate formal nodes for the moment ratio, dual-code weight +decomposition, low-weight terms, the weight-`16` rank-seven classification and character bound, +and finite Plotkin induction. -This phase establishes the vocabulary used by all class and construction chapters. +Maintain the corrected fidelity boundary while closing them: the Reed--Muller coset formula uses +distinct cosets, and the `k`th nonhomomorphicity node records Carlet's even-output naming separately +from reference [357]'s complementary convention. ## Phase 5 - Chapter 5 tractable classes @@ -207,9 +214,8 @@ API. Spectral characterizations do not wait for either. - primary and secondary constructions; - counting results. -The Siegenthaler-type degree tradeoff is a planned FABL Chapter 6 overlap. Keep the Carlet-facing -theorem canonical in this project until the cross-project ownership review determines the shared -implementation. +FABL `v0.5.6` already supplies the Siegenthaler-type degree tradeoff. Reuse the upstream theorem +through the required Carlet representation bridge rather than create a parallel implementation. ## Phase 8 - Chapter 8 propagation criteria @@ -283,7 +289,6 @@ be encoded as informal asymptotic prose or trusted runtime annotations. | Work item | Gate | Reason | |---|---|---| -| Stable shared ANF API | FABL Chapter 6 ownership review | Avoid two public `𝔽₂`-polynomial foundations | | Generalized Abelian/product Fourier refactor | FABL Chapter 8 or an immediate Carlet theorem | Current scalar `𝔽₂ⁿ` API is already sufficient | | Hypercontractive asymptotic bounds | FABL Chapters 9--10 when a proof needs them | Do not block finite algebraic foundations | | Kerdock-code layer | Minimal Reed-Muller/code API | Coding structure, not full FABL, is the prerequisite | diff --git a/.agents/SPEC.md b/.agents/SPEC.md index 3247da5..1dd3f00 100644 --- a/.agents/SPEC.md +++ b/.agents/SPEC.md @@ -32,22 +32,39 @@ PDFs, manifests, graphs, and caches are not sources of truth. ## Current verified baseline -The reviewed Blueprint contains 43 source-facing statements, of which 41 are associated with 180 -proved Lean declarations and 2 remain visibly open, connected by 64 mathematical dependency edges. -Chapter 2 contributes 36 statements (35 formalized and 1 open), 159 declarations, and 45 incoming -edges. Chapter 3 contributes 7 statements (6 formalized and 1 open), 21 declarations, and 19 -incoming edges. +The reviewed Blueprint contains 116 source-facing statements, of which 115 are associated with 759 +proved Lean declarations and 1 remains visibly open, connected by 223 mathematical dependency +edges. Chapter 2 contributes 36 statements (35 formalized and 1 open), 159 declarations, and 45 +incoming edges. Chapter 3 contributes 7 formalized statements, 32 declarations, and 19 incoming +edges. Chapter 4 contributes 73 formalized statements, 568 declarations, and 159 incoming edges. The completed Chapter 2 frontier includes Proposition 5's numerical-normal-form integrality criterion, the full raw Poisson formula, affine invariance, restriction recovery, and the spectral-support bounds. The completed Chapter 3 frontier includes the general Reed--Muller distance -theorem, dimension and cardinality formulas, and duality. +theorem, Proposition 12's minimum-weight affine-flat classification, dimension and cardinality +formulas, and duality. + +The Chapter 4 inventory is source-reviewed and Blueprint-synchronized. Its 73 formalized nodes +cover the reviewed finite theory of nonlinearity, higher-order nonlinearity, resiliency and +propagation, linear structures, algebraic immunity, autocorrelation, maximum correlation, and the +remaining complexity criteria. Rodier's sharp random-nonlinearity interval, the exact +dimension-seven maximum, and the sharp fixed-order higher-order asymptotic upper bound are now +closed as independent source-facing nodes. The higher-order proof exposes its moment-ratio, +dual-code, low-weight, weight-`16` rank-seven classification, character-sum, and finite Plotkin +components separately rather than hiding them inside the final asymptotic statement. The only open Chapter 2 item is Carlet Proposition 3. Its smallest missing layer is a finite-field coordinate theorem identifying ANF degree with the maximum binary weight in the univariate support, -together with noncancellation along the cyclotomic orbit of a trace monomial. The only open Chapter -3 item is Carlet Proposition 12. It requires arbitrary affine-flat normal form, the -codimension--degree theorem for affine-flat indicators, and equality-case slice infrastructure. +together with noncancellation along the cyclotomic orbit of a trace monomial. Chapter 3 has no open +node: the affine-flat normal form, codimension--degree theorem, and equality-case slice +infrastructure now compose into the exact Proposition 12 classification. + +Source-facing splits remain explicit in Chapter 4. Rodier's one-sided lower endpoint and sharp +interval have distinct nodes, as do the finite Hamming-ball and Plotkin bridges and the resulting +higher-order asymptotic estimate. The Reed--Muller coset-distance theorem +adds the mathematically necessary distinct-coset hypothesis omitted from the printed sentence. The +`k`th nonhomomorphicity declarations follow Carlet's name for the even-output tuple count while +recording that reference [357] uses that name for the complementary odd-output count. A bare theorem number is not a stable identifier because numbering can restart or be reused. Inventory identifiers include source, chapter or section, item kind, and printed number, for @@ -152,9 +169,10 @@ normalized coefficient as a Walsh value. ### Algebraic normal form -Algebraic normal form is represented by coefficients indexed by finite coordinate subsets, with -coefficients in `𝔽₂`. Evaluation is the finite sum of square-free monomials. The first public API -must include existence, uniqueness, evaluation, support, and algebraic degree. +Algebraic normal form reuses FABL's coefficients indexed by finite coordinate subsets, with +coefficients in `𝔽₂`, together with its evaluation, support, uniqueness, and algebraic-degree APIs. +CryptBoolean adds only the Carlet-facing statements and representation bridges that consume this +canonical surface. Algebraic degree and FABL's real Fourier degree remain distinct types of information with distinct names. Any inequality between them is a theorem, not a definitional equality. @@ -187,7 +205,8 @@ The first dependency layer must prove and then reuse: 5. weight to the Walsh value at zero; 6. balancedness to vanishing zero-frequency Walsh value; 7. affine characters to FABL's vector Walsh characters; -8. binary derivatives to FABL sign-cube restrictions or derivatives where their statements agree. +8. direct reuse of FABL's binary derivatives, with sign-cube or restriction bridges only where a + Carlet statement changes representation. These are bridges between domains, not duplicate proof stacks. @@ -200,12 +219,11 @@ Before adding a declaration, contributors search the pinned FABL public surface A stronger existing theorem is specialized or bridged. A new local declaration is permitted only for a genuine cryptographic concept or a demonstrated gap. -Future FABL chapters create targeted convergence gates: +Pinned FABL APIs and later FABL chapters create only targeted convergence gates: | FABL area | CryptBooleanFunction policy | |---|---| -| Chapters 1--3 | Required initial dependency; already sufficient to start | -| Chapter 6 `𝔽₂` polynomials | Reconcile ANF ownership before stable overlapping APIs are released | +| Pinned `v0.5.6` Boolean-function APIs | Canonical owner of ANF, degree, affine, and derivative operations; import directly and add only representation bridges | | Chapter 8 generalized domains | Reuse when generalized Abelian or product-domain results are needed | | Chapters 9--10 hypercontractivity | Wait only for nodes whose proofs genuinely require these bounds | | Chapter 11 Gaussian/invariance theory | No first-release dependency identified | diff --git a/.agents/audit/dependency-dag.md b/.agents/audit/dependency-dag.md index 0d9c99b..ceebdca 100644 --- a/.agents/audit/dependency-dag.md +++ b/.agents/audit/dependency-dag.md @@ -13,8 +13,9 @@ spine. The current baseline is: | Chapter | Nodes | Formalized | Open | Associated declarations | Incoming edges | |---|---:|---:|---:|---:|---:| | Carlet Chapter 2 | 36 | 35 | 1 | 159 | 45 | -| Carlet Chapter 3 | 7 | 6 | 1 | 21 | 19 | -| **Total** | **43** | **41** | **2** | **180** | **64** | +| Carlet Chapter 3 | 7 | 7 | 0 | 32 | 19 | +| Carlet Chapter 4 | 73 | 73 | 0 | 568 | 159 | +| **Total** | **116** | **115** | **1** | **759** | **223** | An item marked `[open]` has a complete mathematical statement but no Lean association. In the tables below, `consumer <- prerequisite-1, prerequisite-2` denotes one incoming edge from each @@ -163,7 +164,7 @@ carlet-3-theorem-1-order-one carlet-3-theorem-1 <- carlet-3-reed-muller-code, carlet-2-def-hamming-distance, carlet-2-anf-existence-uniqueness -carlet-3-prop-12 [open] +carlet-3-prop-12 <- carlet-3-theorem-1 carlet-3-reed-muller-dimension @@ -176,26 +177,314 @@ These are exactly 19 Chapter 3 incoming edges. The `carlet-3-theorem-1-order-one derived `r = 1` specialization, while Carlet's general Theorem 1 is now independently associated with its all-orders weight and distance declarations. The dimension theorem uses the ANF coefficient linear equivalence, and Theorem 2 composes the nondegenerate Boolean-function pairing, -orthogonal-complement containment, and the dimension calculation. +orthogonal-complement containment, and the dimension calculation. Proposition 12 composes the +affine-flat indicator normal form, its codimension--degree and weight laws, and equality-case slice +rigidity to classify every minimum-weight word. + +## Chapter 4: Boolean functions and cryptography + +Chapter 4 has 73 formalized nodes and no open node. Source-facing splits keep intermediate finite +or one-sided theorems distinct from the sharper conclusions they compose. + +### Degree and first-order nonlinearity + +```text +carlet-4-degree-count + <- carlet-2-anf-existence-uniqueness, carlet-2-def-algebraic-degree + +carlet-4-def-nonlinearity + <- carlet-2-def-hamming-distance, carlet-2-def-affine-functions +carlet-4-nonlinearity-affine-invariance + <- carlet-4-def-nonlinearity, carlet-2-affine-invariance +carlet-4-rel-35-nonlinearity-walsh + <- carlet-4-def-nonlinearity, carlet-2-def-walsh-transform +carlet-4-rel-36-covering-radius-bent + <- carlet-4-rel-35-nonlinearity-walsh, carlet-2-parseval, + carlet-2-balanced-zero-walsh + +carlet-4-random-nonlinearity-lower-bound + <- carlet-4-rel-35-nonlinearity-walsh +carlet-4-rodier-lower-endpoint + <- carlet-4-rel-35-nonlinearity-walsh +carlet-4-rodier-upper-endpoint-reduction + <- carlet-4-rel-35-nonlinearity-walsh +carlet-4-rodier-pair-characteristic-moments +carlet-4-rodier-sharp-random-nonlinearity-interval + <- carlet-4-rodier-lower-endpoint, + carlet-4-rodier-upper-endpoint-reduction, + carlet-4-rodier-pair-characteristic-moments +carlet-4-odd-dimension-exact-five + <- carlet-4-odd-dimension-quadratic-covering-bounds, carlet-3-affine-weight, + carlet-3-reed-muller-dimension, carlet-4-def-higher-order-nonlinearity +carlet-4-odd-dimension-quadratic-covering-bounds + <- carlet-4-rel-35-nonlinearity-walsh, carlet-4-rel-36-covering-radius-bent +carlet-4-odd-dimension-exact-one-three + <- carlet-4-odd-dimension-quadratic-covering-bounds +carlet-4-odd-dimension-best-nonlinearity + <- carlet-4-odd-dimension-quadratic-covering-bounds, + carlet-4-six-variable-covering-coset-coordinate, + carlet-4-six-variable-degree-four-coset-coordinate +carlet-4-six-variable-covering-coset-coordinate + <- carlet-4-rel-36-covering-radius-bent +carlet-4-six-variable-degree-four-coset-coordinate + <- carlet-4-rel-35-nonlinearity-walsh, carlet-2-parseval, + carlet-3-theorem-2 +carlet-4-odd-dimension-strict-above-quadratic + <- carlet-4-rel-35-nonlinearity-walsh +carlet-4-odd-dimension-balanced-above-quadratic + <- carlet-4-rel-35-nonlinearity-walsh, carlet-2-balanced-zero-walsh +carlet-4-odd-dimension-pc-one-above-quadratic + <- carlet-4-odd-dimension-balanced-above-quadratic, + carlet-4-def-propagation-criteria +carlet-4-odd-dimension-degree-pred-above-quadratic + <- carlet-4-odd-dimension-balanced-above-quadratic, carlet-3-prop-12, + carlet-4-def-nonlinearity +carlet-4-reed-muller-coset-distance + <- carlet-4-def-nonlinearity, carlet-3-reed-muller-code +carlet-4-derivative-nonlinearity-bounds + <- carlet-4-def-nonlinearity, carlet-4-hyperplane-walsh-autocorrelation, + carlet-2-def-2-derivative, carlet-2-def-autocorrelation +carlet-4-odd-weighting-nonlinearity + <- carlet-4-def-nonlinearity +``` + +This family has 46 incoming edges. Relation (35) is the scaling junction from raw Hamming distance +and raw Walsh sums to the normalized FABL quantities used by the implementation. The covering-radius +and bent characterization remains a separate consumer of Relation (35), Parseval, and balancedness. +The Olejar--Stanek bound, Rodier's exact lower endpoint, its upper-endpoint event reduction, and the +pair characteristic moments remain separate formalized ingredients of Rodier's two-sided +interval. The coset- +distance equality carries the necessary pairwise-distinct-coset hypothesis omitted from Carlet's +printed sentence; its two-coset corollary assumes that the representative is non-affine. +The quadratic construction and covering-radius bound give the general odd-dimensional interval; +integrality closes the exact maxima in dimensions one and three, while a residual-code Hamming +argument closes dimension five. The Kavut--Yücel nine-variable Walsh certificate and complete bent +extensions prove strict improvement above the quadratic bound in every odd dimension above seven. +The balanced Maitra--Kavut--Yücel family is verified from its published construction. Linear +reindexing along a certified zero-autocorrelation basis and complete bent extensions prove the +separately cited `PC(1)` family in the stronger range of every odd dimension at least thirteen. A +Proposition 12 affine-line repair enforces degree `n-1` with loss at most two. The two six-variable +coordinate-covering facts, together with the relative-covering reduction and degree-five normal +form, compose the exact dimension-seven value. + +### Higher-order nonlinearity + +```text +carlet-4-def-higher-order-nonlinearity + <- carlet-3-reed-muller-code, carlet-2-def-hamming-distance +carlet-4-higher-order-junta-distance + <- carlet-4-def-higher-order-nonlinearity, carlet-2-def-algebraic-degree +carlet-4-higher-order-counting-criterion + <- carlet-4-def-higher-order-nonlinearity, carlet-3-reed-muller-dimension +carlet-4-higher-order-asymptotic-lower-bound + <- carlet-4-higher-order-counting-criterion +carlet-4-higher-order-plotkin-induction + <- carlet-4-def-higher-order-nonlinearity +carlet-4-higher-order-order-two-moment-ratio + <- carlet-4-def-higher-order-nonlinearity, + carlet-4-rel-35-nonlinearity-walsh, carlet-2-parseval +carlet-4-higher-order-order-two-dual-moment-decomposition + <- carlet-4-higher-order-order-two-moment-ratio, carlet-3-theorem-2 +carlet-4-higher-order-order-two-weight-grouping + <- carlet-4-higher-order-order-two-dual-moment-decomposition +carlet-4-higher-order-order-two-low-weight-support + <- carlet-4-higher-order-order-two-weight-grouping, carlet-3-theorem-1 +carlet-4-higher-order-order-two-weight-eight-bound + <- carlet-4-higher-order-order-two-low-weight-support, carlet-3-prop-12 +carlet-4-higher-order-order-two-weight-twelve-bound + <- carlet-4-higher-order-order-two-low-weight-support, carlet-3-theorem-2 +carlet-4-higher-order-order-two-weight-fourteen-bound + <- carlet-4-higher-order-order-two-low-weight-support, carlet-3-theorem-2 +carlet-4-higher-order-order-two-weight-sixteen-rank-reduction + <- carlet-4-higher-order-order-two-low-weight-support, carlet-3-theorem-2 +carlet-4-higher-order-order-two-weight-sixteen-rank-seven-classification + <- carlet-4-higher-order-order-two-weight-sixteen-rank-reduction +carlet-4-higher-order-order-two-weight-sixteen-orbit-sos +carlet-4-higher-order-order-two-weight-sixteen-residual-cover + <- carlet-4-higher-order-order-two-weight-sixteen-rank-reduction +carlet-4-higher-order-order-two-weight-sixteen-character-bound + <- carlet-4-higher-order-order-two-weight-sixteen-rank-seven-classification, + carlet-4-higher-order-order-two-weight-sixteen-orbit-sos, + carlet-4-higher-order-order-two-weight-sixteen-residual-cover +carlet-4-higher-order-order-two-moment-difference + <- carlet-4-higher-order-order-two-weight-eight-bound, + carlet-4-higher-order-order-two-weight-twelve-bound, + carlet-4-higher-order-order-two-weight-fourteen-bound, + carlet-4-higher-order-order-two-weight-sixteen-character-bound +carlet-4-higher-order-order-two-asymptotic-upper + <- carlet-4-higher-order-order-two-moment-ratio, + carlet-4-higher-order-order-two-moment-difference +carlet-4-higher-order-general-r-propagation + <- carlet-4-higher-order-plotkin-induction, + carlet-4-higher-order-order-two-asymptotic-upper +carlet-4-higher-order-general-bounds + <- carlet-4-higher-order-general-r-propagation, + carlet-4-higher-order-order-two-weight-sixteen-character-bound +carlet-4-prop-13 + <- carlet-4-def-higher-order-nonlinearity, carlet-2-def-2-derivative +``` + +These are 41 incoming edges. The exact finite Hamming-ball counting criterion yields the cited +fixed-order asymptotic lower existence bound. The sharp upper bound is exposed as a mathematical +DAG. The +Plotkin recurrence propagates an order-two base. Consecutive moment ratios reduce that base to the +seventh/eighth moment difference; dual-code orthogonality and Krawtchouk inversion group the +difference by weights. The weights `8`, `12`, and `14` have separate affine-flat classifications +and character bounds. At weight `16`, affine-span rank is at most seven; the full-rank branch +produces a self-dual `[16,8,>=4]` code and splits into three canonical orbits, while the low-rank +branch has a coarse affine-mask cover. Independently of the classification, the three canonical +patterns satisfy their orbit sum-of-squares bounds. The classifier, orbit bounds, and residual +count meet only in the aggregate character bound, which feeds the moment difference, order-two +extraction, and general-order composition. The rank-seven classification supplies the common +hypothesis used by the aggregate character-bound consumer. Proposition 13 depends only on +the higher-order distance definition and the Boolean derivative; its two recursive lower bounds do +not require a separate source-facing autocorrelation node. + +### Resiliency and propagation criteria + +```text +carlet-4-def-resiliency-correlation-immunity + <- carlet-2-balanced-zero-walsh +carlet-4-theorem-3 + <- carlet-4-def-resiliency-correlation-immunity, carlet-2-cor-1-poisson-summation, + carlet-2-def-walsh-transform, carlet-2-balanced-zero-walsh +carlet-4-resiliency-support-dual-distance + <- carlet-4-theorem-3, carlet-2-def-support-weight +carlet-4-code-generator-resilient + <- carlet-4-def-resiliency-correlation-immunity +carlet-4-resiliency-translation-invariance + <- carlet-4-theorem-3, carlet-2-prop-6-fourier-shifts +carlet-4-def-propagation-criteria + <- carlet-2-def-2-derivative, carlet-2-def-autocorrelation, + carlet-2-balanced-zero-walsh, carlet-4-def-resiliency-correlation-immunity +``` + +This family has 14 incoming edges. Theorem 3 is the Walsh-zero characterization linking the +restriction definition to Poisson summation; propagation criteria then reuse both the derivative +and resiliency branches. + +### Linear structures and hyperplane spectra + +```text +carlet-4-def-linear-kernel + <- carlet-2-def-2-derivative +carlet-4-prop-14 + <- carlet-4-def-linear-kernel, carlet-2-def-affine-functions +carlet-4-linear-kernel-nonlinearity-bound + <- carlet-4-prop-14, carlet-4-rel-36-covering-radius-bent + +carlet-4-hyperplane-walsh-autocorrelation + <- carlet-2-cor-1-poisson-summation, carlet-2-rel-25-wiener-khinchin +carlet-4-prop-15 + <- carlet-4-hyperplane-walsh-autocorrelation, carlet-4-def-linear-kernel, + carlet-2-def-walsh-transform +carlet-4-distance-to-linear-structures + <- carlet-4-def-linear-kernel, carlet-2-def-hamming-distance, + carlet-2-def-autocorrelation, carlet-4-rel-36-covering-radius-bent +``` + +These nodes contribute 14 incoming edges. Proposition 14 supplies the affine-coordinate normal +form, whereas Proposition 15 passes through the hyperplane Walsh--autocorrelation identity; neither +edge is inferred merely from module proximity. + +### Algebraic immunity and fast algebraic attacks + +```text +carlet-4-def-annihilator-algebraic-immunity + <- carlet-2-anf-existence-uniqueness, carlet-2-def-algebraic-degree, + carlet-2-def-support-weight +carlet-4-low-degree-relation-equivalence + <- carlet-4-def-annihilator-algebraic-immunity +carlet-4-annihilator-linear-system + <- carlet-4-def-annihilator-algebraic-immunity, carlet-2-anf-existence-uniqueness, + carlet-2-def-support-weight +carlet-4-ai-upper-bound + <- carlet-4-low-degree-relation-equivalence, carlet-4-annihilator-linear-system, + carlet-4-prop-14 +carlet-4-fast-algebraic-optimality + <- carlet-4-def-annihilator-algebraic-immunity, + carlet-4-annihilator-linear-system +``` + +This branch has 12 incoming edges. The upper bound composes the low-degree relation equivalence, +the ANF evaluation system, and Proposition 14's coordinate separation rather than treating its +dimension count as an isolated root. + +### Autocorrelation indicators and fourth Walsh moments + +```text +carlet-4-def-autocorrelation-indicators + <- carlet-2-def-autocorrelation +carlet-4-autocorrelation-indicator-bounds + <- carlet-4-def-autocorrelation-indicators, carlet-4-def-linear-kernel, + carlet-2-balanced-zero-walsh +carlet-4-second-derivative-sum + <- carlet-4-def-autocorrelation-indicators, carlet-2-rel-26-total-autocorrelation +carlet-4-rel-39-fourth-walsh-moment + <- carlet-4-def-autocorrelation-indicators, carlet-2-rel-25-wiener-khinchin, + carlet-2-rel-22-plancherel +carlet-4-indicator-nonlinearity-spectral-support + <- carlet-4-def-nonlinearity, carlet-4-rel-39-fourth-walsh-moment, + carlet-2-parseval, carlet-2-spectral-support-bounds, + carlet-4-rel-36-covering-radius-bent +``` + +These are 14 incoming edges. Relation (39) depends on the indicator definition together with the +raw Wiener--Khinchin and Plancherel identities. Its nonlinearity and support consequences remain a +separate five-prerequisite node. + +### Maximum correlation and generalized linear-structure distance + +```text +carlet-4-def-maximum-correlation + <- carlet-4-def-higher-order-nonlinearity, + carlet-4-def-resiliency-correlation-immunity, carlet-2-balanced-zero-walsh +carlet-4-rel-40-maximum-correlation-bound + <- carlet-4-def-maximum-correlation, carlet-4-def-nonlinearity, + carlet-2-def-walsh-transform, carlet-2-cor-1-poisson-summation +carlet-4-generalized-linear-structure-distance + <- carlet-4-def-linear-kernel, carlet-2-def-hamming-distance +``` + +This family has 9 incoming edges. Maximum correlation connects higher-order approximation, +resiliency, and Walsh restriction formulas; generalized linear-structure distance is independent of +Relation (40) and depends only on the linear kernel and Hamming distance. + +### Other cryptographic complexity criteria + +```text +carlet-4-other-complexity-definitions + <- carlet-2-def-algebraic-degree, carlet-2-affine-invariance, + carlet-2-spectral-support-bounds +carlet-4-kth-nonhomomorphicity + <- carlet-2-def-walsh-transform, carlet-2-parseval, + carlet-4-rel-36-covering-radius-bent +carlet-4-affine-reindex-first-resilient + <- carlet-4-theorem-3, carlet-4-resiliency-translation-invariance, + carlet-2-def-affine-functions +``` + +These final nodes contribute 9 incoming edges. The `k`th nonhomomorphicity node follows Carlet's +name for the even-output tuple count and records that reference [357] instead calls that count +homomorphicity and reserves nonhomomorphicity for the complementary odd-output count. Across all +eight Chapter 4 families, the reviewed counts are +`46 + 41 + 14 + 14 + 12 + 14 + 9 + 9 = 159` incoming edges. ## Remaining proof frontier -Only two source nodes remain open. Their reviewed Blueprint prerequisites are formalized, but each -requires a genuine missing mathematical layer rather than another already inventoried node: +One source node remains open: the Chapter 2 trace-monomial proposition. Its Blueprint prerequisites +are formalized, but it requires a genuine missing mathematical layer rather than another already +inventoried node: - `carlet-2-trace-monomial-degree` (Carlet Proposition 3) lacks the bridge identifying coordinate ANF degree on `V_n` with the maximum binary exponent weight in the univariate finite-field representation. It also lacks cyclotomic-orbit noncancellation showing that nonzeroness forces an orbit coefficient of binary weight `w_2(k)` to survive. The pinned FABL and Mathlib surfaces do not expose either result. -- `carlet-3-prop-12` lacks a normal form for arbitrary affine flats, the theorem that an affine-flat - indicator has algebraic degree equal to its codimension, and the equality-case slice - infrastructure needed to classify every minimum-weight Reed--Muller word. The pinned FABL and - Mathlib surfaces do not supply this package. - -These blockers are independent. Closing either requires adding the smallest used bridge layer and -then associating the exact source proposition; no placeholder declaration or weakened statement is -part of the frontier. +Proposition 12 is closed: Chapter 3's affine-flat and equality-case slice layer proves the exact +source classification. Chapter 4 is closed: Rodier's interval, the exact dimension-seven maximum, +and the sharp higher-order upper bound are associated with their complete production proofs, while +their mathematical ingredients remain separately visible in the graph. ## Machine verification diff --git a/.agents/audit/fidelity.md b/.agents/audit/fidelity.md index 9ccb917..ee3ebd0 100644 --- a/.agents/audit/fidelity.md +++ b/.agents/audit/fidelity.md @@ -17,11 +17,12 @@ The generated manifest currently verifies the following baseline: | Chapter | Statements | Formalized | Open | Associated declarations | Incoming statement edges | |---|---:|---:|---:|---:|---:| | Carlet Chapter 2 | 36 | 35 | 1 | 159 | 45 | -| Carlet Chapter 3 | 7 | 6 | 1 | 21 | 19 | -| **Total** | **43** | **41** | **2** | **180** | **64** | +| Carlet Chapter 3 | 7 | 7 | 0 | 32 | 19 | +| Carlet Chapter 4 | 73 | 73 | 0 | 568 | 159 | +| **Total** | **116** | **115** | **1** | **759** | **223** | The manifest count is an association count, not a claim that every printed result in Carlet -Chapters 2--3 is complete. Coverage outside these 43 reviewed nodes remains governed by the +Chapters 2--4 is complete. Coverage outside these 116 reviewed nodes remains governed by the inventories under `.agents/inventory/`. ## Corrected source mappings @@ -40,12 +41,42 @@ inventories under `.agents/inventory/`. | `carlet-2-spectral-support-bounds` | Carlet Section 2.2.2, p. 32: Fourier-support cardinality does not increase under coordinate restriction, is at least `2^d` for a nonzero Boolean function of algebraic degree `d`, and is at most the low-weight binomial sum for a nonzero function of numerical degree `D`. | The 24 declarations reuse FABL's normalized Fourier support and restriction results through explicit raw-scaling bridges. Nonzero hypotheses are stated because the project assigns degree zero to the zero function; the Lean upper bound is deliberately stronger and also covers zero. | | `carlet-3-theorem-1-order-one` | The `r = 1` consequence of Carlet Theorem 1: nonzero degree-at-most-one functions have weight at least `2^(n-1)`, equivalently distinct words of `R(1,n)` have that distance lower bound. | This is explicitly tagged as a derived specialization and is formalized independently. | | `carlet-3-theorem-1` | Carlet Theorem 1, p. 36: for every `0 <= r <= n`, distinct degree-at-most-`r` functions have Hamming distance at least `2^(n-r)`. | The two all-orders declarations prove the equivalent nonzero-weight and code-distance forms. The separately retained `r = 1` node is only a derived specialization. | +| `carlet-3-prop-12` | Carlet Proposition 12, pp. 36--37: a degree-`r` Boolean function has minimum possible nonzero weight `2^(n-r)` exactly when it is the indicator of an `(n-r)`-dimensional affine flat. | Eleven declarations define arbitrary affine-flat indicators, prove their support, weight, and exact codimension degree, and prove the converse by equality-case slicing. The final equivalences retain both the exact degree and weight hypotheses and classify the support itself. | | `carlet-3-reed-muller-dimension` | Carlet p. 38: `dim R(r,n) = sum_(i=0)^r C(n,i)` and the code cardinality is the corresponding power of two. | The coefficient restriction is implemented as a linear equivalence; `reedMuller_finrank` proves the dimension formula and `reedMuller_card` derives cardinality from it. | | `carlet-3-theorem-2` | Carlet Theorem 2, pp. 38--39: for `r a dot x` and its complement are `2^(n-1)-W_f(a)/2` and `2^(n-1)+W_f(a)/2`, so `nl(f)=2^(n-1)-(1/2) max_a |W_f(a)|`. | The two distance declarations quantify over every dimension, function, and frequency and state the raw formulas over `R`. `maxWalshMagnitude` is the natural-number maximum of the absolute raw integer Walsh values. `two_mul_nonlinearity_add_maxWalshMagnitude` is the exact division-free natural-number identity, including dimension zero, and `nonlinearity_cast_eq_relation_35` recovers the printed half-factor formula over `R`. The bridges to FABL prove separately that raw distance and raw Walsh magnitude are `2^n` times `distanceToAffineSigns` and `spectralInfinityNorm`; no normalized coefficient is presented as Carlet's raw transform. | +| `carlet-4-random-nonlinearity-lower-bound` | Carlet p. 51: a uniformly random Boolean function has nonlinearity greater than `2^(n-1)-sqrt(n) 2^((n-1)/2)` with probability tending to one. | The associated declarations derive an explicit Fourier union-bound failure probability and prove that it tends to zero. This node remains distinct from Rodier's sharper two-sided interval. | +| `carlet-4-rodier-lower-endpoint` | The one-sided `+4 log(n)/n` consequence of Rodier's sharp interval quoted on Carlet p. 51. | Twelve declarations define the exact normalized threshold, prove a `2/n` Hoeffding--union-bound failure estimate, transport it through Relation (35), and prove that the probability of exceeding the displayed nonlinearity endpoint tends to one. The opposite `-5 log(n)/n` endpoint is not associated with this node. | +| `carlet-4-rodier-upper-endpoint-reduction` | Project bridge for the `-5 log(n)/n` side: convergence of the normalized spectral lower-tail event implies convergence of the displayed upper-nonlinearity event. | Eight declarations define both thresholds and probabilities, prove their exact normalization and deterministic inclusion through Relation (35), and transport an assumed spectral limit by measure monotonicity. They do not assume the missing lower-tail estimate. | +| `carlet-4-rodier-pair-characteristic-moments` | Project bridge for Rodier Lemma 6.4: the joint characteristic function of two distinct raw Walsh coefficients factors as a cosine product, with the stated exact quadratic and quartic phase sums. | Six declarations derive the product from independent signs and the two moments from Walsh-character orthogonality. The later smoothed cutoff and covariance estimates remain separate. | +| `carlet-4-odd-dimension-exact-five` | Carlet pp. 51--52: the maximum nonlinearity in dimension five is `12`. | The quadratic construction supplies the lower bound. A hypothetical weight-13 first-order Reed--Muller coset leader yields a self-complementary binary `[13,6,>=5]` code; residuation gives a `[7,5,>=3]` or `[8,5,>=3]` code, and the radius-one Hamming bound excludes both. | +| `carlet-4-six-variable-covering-coset-coordinate` | Project bridge for Hou's proof of the exact dimension-seven covering radius: a six-variable coset at nonlinearity `28` has a minimum affine representative whose error contains any prescribed coordinate. | The associated declaration proves the statement for every Boolean function and coordinate, without Hou's ambient degree-four restriction. Flat Walsh spectrum and inversion replace the cited orphan terminology and avoid a finite table certificate. | +| `carlet-4-six-variable-degree-four-coset-coordinate` | Project bridge for Hou's proof of the exact dimension-seven covering radius: a degree-at-most-four six-variable coset at nonlinearity `26` has a minimum affine representative whose error contains any prescribed coordinate. | Reed--Muller duality gives affine-coset weights modulo four; Relation (35), Parseval, and Walsh inversion force the coordinate-covering leader. The proof avoids both Hou's cited orphan terminology and a finite truth-table certificate. | +| `carlet-4-odd-dimension-quadratic-covering-bounds` | Carlet pp. 51--52: for odd `n`, the maximum nonlinearity lies between `2^(n-1)-2^((n-1)/2)` and `2^(n-1)-2^(n/2-1)`. | Ten declarations define the finite maximum, reuse FABL's complete inner-product bent function on `n-1` variables with one dummy coordinate for the lower witness, and apply Relation (36) to a maximizing function for the upper bound. | +| `carlet-4-odd-dimension-exact-one-three` | Carlet p. 52: the best nonlinearities in dimensions one and three are `0` and `2`. | The quadratic construction gives both lower bounds; the real covering-radius inequalities are strict enough that natural-number integrality forces equality. | +| `carlet-4-odd-dimension-strict-above-quadratic` | Carlet pp. 51--52 and footnote 22: for every odd `n>7`, some `n`-variable Boolean function has nonlinearity strictly above `2^(n-1)-2^((n-1)/2)`. | A kernel-checked exhaustive Walsh certificate proves nonlinearity `242` for the printed Kavut--Yücel nine-variable truth table. FABL's complete bent direct product extends it to every odd dimension above seven, with exact Walsh magnitude and nonlinearity formulas. | +| `carlet-4-odd-dimension-balanced-above-quadratic` | Carlet footnote 22: for every odd `n>=15`, a balanced function lies strictly above the quadratic bound. | Twenty-two declarations reconstruct Maitra--Kavut--Yücel's thirteen-variable function from its published seed, shift, bent component, and eight toggles; prove balance, maximum Walsh magnitude `120`, and nonlinearity `4036`; and extend it by complete bent blocks. The compiled dimension range `n>=13` is stronger than the source claim. | +| `carlet-4-odd-dimension-pc-one-above-quadratic` | Carlet footnote 22 and reference [264]: for every odd `n>=15`, a function satisfying `PC(1)` lies strictly above the quadratic bound. | Twelve declarations certify a basis of zero-autocorrelation directions for the thirteen-variable Maitra--Kavut--Yücel function, linearly reindex it to satisfy `PC(1)`, retain its exact nonlinearity, and extend it by complete bent blocks. The compiled dimension range `n>=13` is stronger than the source claim. | +| `carlet-4-odd-dimension-degree-pred-above-quadratic` | Carlet footnote 22: for every odd `n>=15`, a degree-`n-1` function lies strictly above the quadratic bound. | A generic two-point repair adds the affine-line indicator through a zero and a one. Proposition 12 gives degree `n-1` and weight two, while the Hamming triangle inequality bounds nonlinearity loss by two. Applied to the balanced family, this proves the source range with witnesses that are also balanced. | +| `carlet-4-reed-muller-coset-distance` | Carlet p. 52: the minimum distance of a union of first-order Reed--Muller cosets is the minimum pair nonlinearity. | The printed unrestricted family equality is false when two representatives determine the same coset. The formal theorem adds the necessary pairwise-distinct-coset hypothesis, and the two-coset corollary assumes its representative is non-affine. These corrected hypotheses are explicit rather than silently altering the source statement. | +| `carlet-4-higher-order-counting-criterion` | Project bridge for Carlet p. 54: if the Reed--Muller code cardinality times a radius-`t` Hamming-ball volume is smaller than the Boolean-function space, some function has higher-order nonlinearity greater than `t`. | The three declarations prove the exact finite sphere-counting implication and its dimension-form restatement. They do not claim the cited fixed-order asymptotic upper and lower estimates. | +| `carlet-4-higher-order-asymptotic-lower-bound` | Carlet pp. 53--54: for fixed `r` and all sufficiently large `n`, some function has `nl_r(f) > 2^(n-1)-sqrt(2^(n-1) sum_(i=0)^r C(n,i))`. | The three declarations combine the finite sphere-counting criterion with a one-sided subgaussian estimate and the eventual binomial-sum bound. They prove exactly the displayed lower existence estimate, independently of the sharper upper bound. | +| `carlet-4-higher-order-plotkin-induction` | Project bridge for the Carlet--Mesnager upper bound cited on Carlet p. 53: the Plotkin recurrence iterates the order-`r-1` covering radii and multiplies the leading square-root coefficient by `1+sqrt(2)`. | Eight declarations define the finite covering radius, prove attainment and the slice recurrence, iterate it from the zero self-radius, and evaluate the geometric sums in the exact finite `A -> A(1+sqrt(2))` propagation formula. They do not supply the missing order-two base. | +| `carlet-4-higher-order-order-two-moment-ratio` | Project bridge for Carlet--Mesnager Relations (9.7)--(9.10): consecutive even correlation moments give a lower bound on maximum order-two correlation and hence an upper bound on `rho(2,n)`. | Fifteen declarations prove the correlation--distance identity, attainment and absolute bound, positivity of the moments, the consecutive-moment inequality, and the resulting finite covering-radius bound. The low-weight dual-code estimate remains outside this bridge. | +| `carlet-4-higher-order-order-two-dual-moment-decomposition` | Project bridge for Carlet--Mesnager Lemma 9.2.2: the even correlation moment is a character sum over ordered tuples whose point-parity word lies in `R(n-3,n)`. | Seven declarations expand powers into tuples, prove character orthogonality over `R(2,n)`, and invoke Chapter 3 duality. The subsequent grouping and low-weight classification remain separate. | +| `carlet-4-prop-13` | Carlet Proposition 13, pp. 54--55: for `1 <= r < n`, `nl_r(f)` is at least one half of the maximum `nl_(r-1)(D_a f)` and at least `2^(n-1)-(1/2)sqrt(2^(2n)-2 sum_a nl_(r-1)(D_a f))`. | The source-facing second-bound declaration carries both hypotheses `1 <= r` and `r < n` and uses exactly the printed `2^(n-1)` and `2^(2n)` normalization. The first bound and the squared-gap inequality are proved in stronger assumption-free forms where their statements remain valid; they do not weaken the associated source result. The finite sum and maximum range over every `a in V_n`, including `a=0`, exactly as printed. | +| `carlet-4-kth-nonhomomorphicity` | Carlet p. 67: for even `k`, the displayed Walsh-moment formula counts tuples whose output sum is zero and gives the affine maximum and bent minimum characterizations. | The declarations follow Carlet's name `k`th nonhomomorphicity for this even-output count. Reference [357] calls that same count homomorphicity and reserves nonhomomorphicity for the complementary odd-output count; the inventory and Blueprint record the terminology discrepancy. | + +**Formalization note (Proposition 13).** Carlet refers the omitted proof to reference [72]. The +formal proof follows that source's two arguments: differentiating a closest order-`r` Reed--Muller +approximant lowers its degree and costs at most twice the original Hamming distance; then squaring +the zero-frequency correlation of a closest approximant and summing the derivative correlations +gives the second recursive bound. The production declarations expose the derivative, weight, +autocorrelation, and square-root steps used by this composition rather than assuming either bound. ## Reviewed formalized surface -The 41 formalized statement nodes are split by mathematical result rather than by implementation +The 115 formalized statement nodes are split by mathematical result rather than by implementation module summaries. The fidelity column records how the compiled declarations meet the displayed source mathematics. @@ -64,9 +95,18 @@ source mathematics. | Finite-field representation | `carlet-2-absolute-trace`, `carlet-2-univariate-representation` | Exact, with direct Mathlib trace reuse and interpolation provenance | 14 | | Reed--Muller foundations | `carlet-3-affine-weight`, `carlet-3-reed-muller-code`, `carlet-3-theorem-1-order-one` | Exact source items plus explicitly derived order-one specialization | 11 | | General Reed--Muller distance | `carlet-3-theorem-1` | Exact all-orders theorem | 2 | +| Minimum-weight Reed--Muller classification | `carlet-3-prop-12` | Exact affine-flat indicator equivalence | 11 | | Reed--Muller dimension | `carlet-3-reed-muller-dimension` | Exact | 2 | | Reed--Muller duality | `carlet-3-theorem-2` | Exact | 6 | -| **Total** | **41 items** | | **180** | +| Degree and first-order nonlinearity | 23 formalized Chapter 4 nodes from `carlet-4-degree-count` through `carlet-4-odd-weighting-nonlinearity` | Exact finite results, explicit Walsh normalization, Rodier's two-sided interval, general odd-dimensional bounds and exact maxima through dimension seven, the balanced and propagation families, the degree repair, and the corrected distinct-coset condition | 204 | +| Higher-order nonlinearity | 22 formalized Chapter 4 nodes from `carlet-4-def-higher-order-nonlinearity` through `carlet-4-higher-order-general-bounds`, together with `carlet-4-prop-13` | Exact distance profile, finite and asymptotic existence bounds, moment-ratio and dual-code decompositions, low-weight classifications, the rank-seven weight-`16` classification and character bound, finite Plotkin propagation, the sharp fixed-order upper bound, and both Proposition 13 bounds | 131 | +| Resiliency and propagation | 6 formalized nodes from `carlet-4-def-resiliency-correlation-immunity` through `carlet-4-def-propagation-criteria` | Exact definitions, Walsh characterization, support/code consequences, and affine translation laws | 44 | +| Linear structures | 6 formalized nodes from `carlet-4-def-linear-kernel` through `carlet-4-distance-to-linear-structures` | Exact kernel, normal-form, spectral, nonlinearity, and distance statements | 37 | +| Algebraic immunity | 5 formalized nodes from `carlet-4-def-annihilator-algebraic-immunity` through `carlet-4-fast-algebraic-optimality` | Exact annihilator definitions, linear systems, bounds, and fast-algebraic criterion | 42 | +| Autocorrelation indicators | 5 formalized nodes from `carlet-4-def-autocorrelation-indicators` through `carlet-4-indicator-nonlinearity-spectral-support` | Exact indicators, moment identities, and spectral/nonlinearity consequences | 36 | +| Maximum correlation and generalized distance | 3 formalized nodes from `carlet-4-def-maximum-correlation` through `carlet-4-generalized-linear-structure-distance` | Exact coordinate-restriction and linear-structure distances | 38 | +| Other complexity criteria | `carlet-4-other-complexity-definitions`, `carlet-4-kth-nonhomomorphicity`, `carlet-4-affine-reindex-first-resilient` | Exact criteria with the recorded tuple-count terminology discrepancy | 36 | +| **Total** | **115 items** | | **759** | The following distinctions are part of the fidelity boundary: @@ -87,18 +127,52 @@ The following distinctions are part of the fidelity boundary: - Carlet's general Reed--Muller distance theorem is associated independently of its derived order-one specialization. Dimension and orthogonal duality use linear structure rather than a set-cardinality surrogate. +- Proposition 12 retains exact degree and weight, not merely membership in `R(r,n)` and a lower- + bound equality. Its affine-flat indicator normal form and converse support classification are + both compiled. +- Carlet's raw nonlinearity and maximum Walsh magnitude remain natural-number quantities. Their + equality is proved without division before the printed real-valued half-factor form is derived; + FABL's normalized distance and spectral norm appear only in explicit bridge declarations. +- Higher-order nonlinearity is distance to the full finite Reed--Muller code. Proposition 13 sums + and maximizes over all directions, and its displayed source-form declaration retains + `1 <= r < n` even where intermediate lemmas prove stronger statements. +- The finite higher-order sphere-counting bridge, the derived lower existence estimate, and the + Plotkin induction, moment-ratio, dual-code decomposition, weight grouping, low-weight support, + weights `8`, `12`, and `14` character bounds, weight-sixteen rank reduction, moment-difference + estimate, conditional order-two extraction, and conditional general-order propagation are kept + distinct from Carlet--Mesnager's sharp fixed-order asymptotic upper bound. The weight-sixteen + branch is itself split into the rank-seven classifier, the three canonical orbit sums, the + rank-at-most-six residual cover, and their aggregate character bound. The orbit sum-of-squares + and residual-cover nodes have direct semantic associations; the rank-seven classification and + aggregate character bound are associated with their final declarations. Mechanical + finite-classifier cases are never source-facing + associations. +- The proved Olejar--Stanek lower bound and Rodier's exact `+4 log(n)/n` lower endpoint are not + relabelled as Rodier's sharper two-sided interval. The opposite event reduction, exact pair + moments, smoothed cutoff, and covariance analysis remain separate mathematical layers. +- The general odd-dimensional bounds and exact maxima in dimensions one, three, and five are + separate from the Kavut--Yücel strict-improvement family. The Maitra--Kavut--Yücel balanced + family, its linear-reindexing `PC(1)` construction, and the Proposition 12 degree repair have + their own nodes. The six-variable nonlinearity-28 and degree-at-most-four nonlinearity-26 + coordinate-covering bridges record Hou's two orphan subcases and compose with the remaining + reduction and normal-form lemmas to prove the dimension-seven equality. +- First-order Reed--Muller coset distance uses the necessary distinct-coset hypothesis, and `k`th + nonhomomorphicity retains Carlet's terminology while recording reference [357]'s convention. - Definitions, bridge laws, source propositions, and derived consequences have separate Blueprint nodes when their quantifiers or conclusions differ. ## Open source statements -Exactly two open nodes state the complete reviewed mathematics and intentionally have no Lean -declaration association. +One open node states the complete reviewed mathematics and intentionally has no Lean declaration +association. Chapter 2 contributes the sole foundational blocker: | Blueprint item | Source location | Exact blocker | |---|---|---| | `carlet-2-trace-monomial-degree` | Carlet Proposition 3, pp. 17--18 | Missing the bridge between coordinate ANF degree on `V_n` and maximum binary exponent weight in the univariate finite-field representation, together with cyclotomic-orbit noncancellation proving that a surviving nonzero orbit coefficient has weight `w_2(k)`. Pinned FABL and Mathlib expose neither result. | -| `carlet-3-prop-12` | Carlet Proposition 12, pp. 36--37 | Missing arbitrary affine-flat normal form, the codimension-equals-degree theorem for affine-flat indicators, and equality-case slice infrastructure for classifying all minimum-weight words. Pinned FABL and Mathlib do not supply this package. | + +Chapter 3 has no open node: Proposition 12's affine-flat and equality-case slice layer is +formalized. Chapter 4 has no open node: its three former frontier statements are associated with +complete declarations while their principal mathematical ingredients retain independent nodes. ## Verification perimeter diff --git a/.agents/inventory/carlet-chapter02.yaml b/.agents/inventory/carlet-chapter02.yaml index 757779c..650bbc2 100644 --- a/.agents/inventory/carlet-chapter02.yaml +++ b/.agents/inventory/carlet-chapter02.yaml @@ -252,13 +252,13 @@ items: - CryptBoolean.card_indexedRawFourierSupport_signRestriction_le - CryptBoolean.card_indexedRawFourierSupport_binaryFunctionOnSignCube - CryptBoolean.card_rawFourierSupport_coordinateRestriction_le - - CryptBoolean.booleanRealEmbedding + - FABL.booleanRealEmbedding - CryptBoolean.two_pow_functionAlgebraicDegree_le_card_rawFourierSupport_booleanRealEmbedding - - CryptBoolean.numericalSupport - - CryptBoolean.mem_numericalSupport - - CryptBoolean.numericalDegree - - CryptBoolean.numericalDegree_le_iff - - CryptBoolean.functionNumericalDegree + - FABL.numericalSupport + - FABL.mem_numericalSupport + - FABL.numericalDegree + - FABL.numericalDegree_le_iff + - FABL.functionNumericalDegree - CryptBoolean.numericalMonomial_eq_setIndicator_coordinateSubcube - CryptBoolean.f₂Support_subset_of_vectorFourierCoeff_numericalMonomial_ne_zero - CryptBoolean.vectorFourierCoeff_numericalEval @@ -278,7 +278,7 @@ items: (D_bf)_χ(x) = f_χ(x)f_χ(x+b). formal_status: formalized declarations: - - CryptBoolean.booleanDerivative + - FABL.booleanDerivative - CryptBoolean.realSignView_booleanDerivative dependencies: - carlet-2-def-boolean-function @@ -334,16 +334,16 @@ items: ANF_c + ANF_d and deg(c) ≤ n. formal_status: formalized declarations: - - CryptBoolean.ANFCoefficients - - CryptBoolean.anfMonomial - - CryptBoolean.anfEval - - CryptBoolean.anfSupport - - CryptBoolean.algebraicDegree - - CryptBoolean.mem_anfSupport - - CryptBoolean.anfMonomial_empty - - CryptBoolean.anfEval_zero - - CryptBoolean.anfEval_add - - CryptBoolean.algebraicDegree_le_dimension + - FABL.ANFCoefficients + - FABL.anfMonomial + - FABL.anfEval + - FABL.anfSupport + - FABL.algebraicDegree + - FABL.mem_anfSupport + - FABL.anfMonomial_empty + - FABL.anfEval_zero + - FABL.anfEval_add + - FABL.algebraicDegree_le_dimension dependencies: - carlet-2-def-boolean-function @@ -355,14 +355,14 @@ items: S ⊆ [n], c_S = ⊕_{supp(x) ⊆ S} f(x) = ⊕_{T ⊆ S} f(1_T). formal_status: formalized declarations: - - CryptBoolean.anfMonomial_f₂CubeOfFinset - - CryptBoolean.anfEval_f₂CubeOfFinset - - CryptBoolean.anfCoeff - - CryptBoolean.anfEval_anfCoeff_f₂CubeOfFinset - - CryptBoolean.anfEval_anfCoeff - - CryptBoolean.anfCoeff_unique_of_powerset_sum - - CryptBoolean.anfEval_injective - - CryptBoolean.existsUnique_anfEval + - FABL.anfMonomial_f₂CubeOfFinset + - FABL.anfEval_f₂CubeOfFinset + - FABL.anfCoeff + - FABL.anfEval_anfCoeff_f₂CubeOfFinset + - FABL.anfEval_anfCoeff + - FABL.anfCoeff_unique_of_powerset_sum + - FABL.anfEval_injective + - FABL.existsUnique_anfEval dependencies: - carlet-2-anf-skeleton @@ -376,16 +376,16 @@ items: λ_S = φ(1_S) - ∑_{T ⊂ S} λ_T. formal_status: formalized declarations: - - CryptBoolean.PseudoBooleanFunction - - CryptBoolean.NumericalCoefficients - - CryptBoolean.numericalMonomial - - CryptBoolean.numericalEval - - CryptBoolean.numericalEvalLinear - - CryptBoolean.numericalEval_injective - - CryptBoolean.existsUnique_numericalEval - - CryptBoolean.numericalCoeff - - CryptBoolean.numericalEval_numericalCoeff - - CryptBoolean.numericalCoeff_eq_value_sub_lower + - FABL.PseudoBooleanFunction + - FABL.NumericalCoefficients + - FABL.numericalMonomial + - FABL.numericalEval + - FABL.numericalEvalLinear + - FABL.numericalEval_injective + - FABL.existsUnique_numericalEval + - FABL.numericalCoeff + - FABL.numericalEval_numericalCoeff + - FABL.numericalCoeff_eq_value_sub_lower dependencies: - carlet-2-def-boolean-function @@ -398,11 +398,11 @@ items: ∑_{T ⊆ S} (-1)^(|S|-|T|)φ(1_T). formal_status: formalized declarations: - - CryptBoolean.sum_Icc_neg_one_pow_card_sub - - CryptBoolean.numericalMobiusCoeff - - CryptBoolean.numericalEval_numericalMobiusCoeff_f₂CubeOfFinset - - CryptBoolean.numericalMobiusCoeff_eq_numericalCoeff - - CryptBoolean.numericalCoeff_eq_mobius_sum + - FABL.sum_Icc_neg_one_pow_card_sub + - FABL.numericalMobiusCoeff + - FABL.numericalEval_numericalMobiusCoeff_f₂CubeOfFinset + - FABL.numericalMobiusCoeff_eq_numericalCoeff + - FABL.numericalCoeff_eq_mobius_sum dependencies: - carlet-2-nnf-existence-uniqueness @@ -490,12 +490,12 @@ items: for every S ⊆ [n]. formal_status: formalized declarations: - - CryptBoolean.functionAlgebraicDegree - - CryptBoolean.functionAlgebraicDegree_le_dimension - - CryptBoolean.algebraicDegree_le_iff - - CryptBoolean.anfCoeff_zero - - CryptBoolean.algebraicDegree_zero - - CryptBoolean.functionAlgebraicDegree_zero + - FABL.functionAlgebraicDegree + - FABL.functionAlgebraicDegree_le_dimension + - FABL.algebraicDegree_le_iff + - FABL.anfCoeff_zero + - FABL.algebraicDegree_zero + - FABL.functionAlgebraicDegree_zero dependencies: - carlet-2-anf-existence-uniqueness @@ -508,9 +508,9 @@ items: deg_alg(f+g) ≤ max(deg_alg(f), deg_alg(g)). formal_status: formalized declarations: - - CryptBoolean.anfCoeff_add - - CryptBoolean.algebraicDegree_add_le_max - - CryptBoolean.functionAlgebraicDegree_add_le_max + - FABL.anfCoeff_add + - FABL.algebraicDegree_add_le_max + - FABL.functionAlgebraicDegree_add_le_max dependencies: - carlet-2-def-algebraic-degree @@ -548,12 +548,12 @@ items: f satisfies deg_alg(f) ≤ 1 iff f = A_{a,b} for some a,b. formal_status: formalized declarations: - - CryptBoolean.affineFunction - - CryptBoolean.affineCoefficients - - CryptBoolean.anfEval_affineCoefficients - - CryptBoolean.anfCoeff_affineFunction - - CryptBoolean.functionAlgebraicDegree_affineFunction_le_one - - CryptBoolean.exists_affineFunction_of_functionAlgebraicDegree_le_one + - FABL.affineFunction + - FABL.affineCoefficients + - FABL.anfEval_affineCoefficients + - FABL.anfCoeff_affineFunction + - FABL.functionAlgebraicDegree_affineFunction_le_one + - FABL.exists_affineFunction_of_functionAlgebraicDegree_le_one dependencies: - carlet-2-def-algebraic-degree @@ -566,19 +566,19 @@ items: f : V_n → 𝔽₂. formal_status: formalized declarations: - - CryptBoolean.anfMonomial_mul - - CryptBoolean.anfMul - - CryptBoolean.anfEval_anfMul - - CryptBoolean.algebraicDegree_anfMul_le_add - - CryptBoolean.anfCoeff_mul - - CryptBoolean.functionAlgebraicDegree_mul_le_add - - CryptBoolean.functionAlgebraicDegree_one - - CryptBoolean.functionAlgebraicDegree_finset_prod_le - - CryptBoolean.functionAlgebraicDegree_finset_sum_le - - CryptBoolean.functionAlgebraicDegree_affineMap_coordinate_le_one - - CryptBoolean.functionAlgebraicDegree_anfMonomial_comp_affineMap_le_card - - CryptBoolean.functionAlgebraicDegree_comp_affineMap_le - - CryptBoolean.functionAlgebraicDegree_comp_affineEquiv + - FABL.anfMonomial_mul + - FABL.anfMul + - FABL.anfEval_anfMul + - FABL.algebraicDegree_anfMul_le_add + - FABL.anfCoeff_mul + - FABL.functionAlgebraicDegree_mul_le_add + - FABL.functionAlgebraicDegree_one + - FABL.functionAlgebraicDegree_finset_prod_le + - FABL.functionAlgebraicDegree_finset_sum_le + - FABL.functionAlgebraicDegree_affineMap_coordinate_le_one + - FABL.functionAlgebraicDegree_anfMonomial_comp_affineMap_le_card + - FABL.functionAlgebraicDegree_comp_affineMap_le + - FABL.functionAlgebraicDegree_comp_affineEquiv dependencies: - carlet-2-def-algebraic-degree - carlet-2-def-affine-functions diff --git a/.agents/inventory/carlet-chapter03.yaml b/.agents/inventory/carlet-chapter03.yaml index d214c94..7dd2663 100644 --- a/.agents/inventory/carlet-chapter03.yaml +++ b/.agents/inventory/carlet-chapter03.yaml @@ -3,9 +3,9 @@ chapter: 3 status: blueprint-synchronized summary: statements: 7 - formalized: 6 - open: 1 - declarations: 21 + formalized: 7 + open: 0 + declarations: 32 dependency_edges: 19 items: - id: carlet-3-affine-weight @@ -86,13 +86,19 @@ items: Let 0 ≤ r ≤ n. A Boolean function f has deg_alg(f) = r and w_H(f) = 2^(n-r) iff f is the indicator of an (n-r)-dimensional affine subspace of V_n. - formal_status: open - declarations: [] - blocker: >- - Missing arbitrary affine-flat normal-form infrastructure, the theorem that - an affine-flat indicator has algebraic degree equal to its codimension, - and the equality-case slice infrastructure required to classify every - minimum-weight word. These are not supplied by pinned FABL or Mathlib. + formal_status: formalized + declarations: + - CryptBoolean.affineFlatIndicator + - CryptBoolean.affineFlatIndicator_apply_eq_one_iff + - CryptBoolean.mem_support_affineFlatIndicator + - CryptBoolean.IsBinaryAffineSet + - CryptBoolean.hammingWeight_affineFlatIndicator + - CryptBoolean.functionAlgebraicDegree_affineFlatIndicator + - CryptBoolean.degree_eq_and_hammingWeight_eq_affineFlatIndicator + - CryptBoolean.eq_affineFlatIndicator_iff_support_eq + - CryptBoolean.exists_affineFlatIndicator_of_degree_eq_and_hammingWeight_eq + - CryptBoolean.degree_eq_and_hammingWeight_eq_iff_exists_affineFlatIndicator + - CryptBoolean.degree_eq_and_hammingWeight_eq_iff_support_is_affineFlat dependencies: - carlet-3-theorem-1 diff --git a/.agents/inventory/carlet-chapter04.yaml b/.agents/inventory/carlet-chapter04.yaml new file mode 100644 index 0000000..9745054 --- /dev/null +++ b/.agents/inventory/carlet-chapter04.yaml @@ -0,0 +1,1613 @@ +source: carlet-2010 +chapter: 4 +status: blueprint-synchronized +summary: + statements: 73 + formalized: 73 + open: 0 + declarations: 568 + dependency_edges: 159 +items: + - id: carlet-4-degree-count + kind: theorem + location: Carlet, Section 4.1.1, p. 49 + statement: >- + For n >= 2, the number of n-variable Boolean functions of algebraic + degree at most n-2 is 2^(sum_{i=0}^{n-2} C(n,i)) = + 2^(2^n-n-1). Hence a uniformly random n-variable Boolean function has + degree at least n-1 with probability tending to one. + formal_status: formalized + declarations: + - CryptBoolean.sum_choose_le_n_sub_two + - CryptBoolean.card_booleanFunctions_degree_le_n_sub_two + - CryptBoolean.card_booleanFunctions_degree_le_n_sub_two_eq + - CryptBoolean.natCard_booleanFunction + - CryptBoolean.highAlgebraicDegreeProbability + - CryptBoolean.highAlgebraicDegreeProbability_eq_card_ratio + - CryptBoolean.tendsto_highAlgebraicDegreeProbability + dependencies: + - carlet-2-anf-existence-uniqueness + - carlet-2-def-algebraic-degree + + - id: carlet-4-def-nonlinearity + kind: definition + location: Carlet, Section 4.1.2, pp. 49--51 + statement: >- + The nonlinearity nl(f) of f : V_n -> F_2 is the minimum Hamming + distance from f to the affine functions x |-> a dot x + b. + formal_status: formalized + declarations: + - CryptBoolean.nonlinearity + dependencies: + - carlet-2-def-hamming-distance + - carlet-2-def-affine-functions + + - id: carlet-4-nonlinearity-affine-invariance + kind: theorem + location: Carlet, p. 50 + statement: >- + For every affine automorphism L of V_n, nl(f composed with L) = nl(f). + formal_status: formalized + declarations: + - CryptBoolean.hammingDistance_comp_affineEquiv + - CryptBoolean.exists_affineFunction_comp_affineEquiv + - CryptBoolean.nonlinearity_comp_affineEquiv_le + - CryptBoolean.nonlinearity_comp_affineEquiv + dependencies: + - carlet-4-def-nonlinearity + - carlet-2-affine-invariance + + - id: carlet-4-rel-35-nonlinearity-walsh + kind: theorem + location: Carlet, Relation (35), p. 51 + statement: >- + For every a, d_H(f, a dot x) = 2^(n-1)-W_f(a)/2 and + d_H(f, a dot x+1) = 2^(n-1)+W_f(a)/2. Therefore + nl(f)=2^(n-1)-(1/2) max_a |W_f(a)|. + formal_status: formalized + declarations: + - CryptBoolean.maxWalshMagnitude + - CryptBoolean.hammingDistance_cast_affineFunction + - CryptBoolean.bitSignInt_cast + - CryptBoolean.hammingDistance_cast_affineFunction_eq + - CryptBoolean.hammingDistance_cast_linearFunction_eq + - CryptBoolean.hammingDistance_cast_complementLinearFunction_eq + - CryptBoolean.nonlinearity_cast_eq_distanceToAffineSigns + - CryptBoolean.maxWalshMagnitude_cast_eq_spectralInfinityNorm + - CryptBoolean.two_mul_nonlinearity_add_maxWalshMagnitude + - CryptBoolean.nonlinearity_cast_eq_relation_35 + dependencies: + - carlet-4-def-nonlinearity + - carlet-2-def-walsh-transform + + - id: carlet-4-rel-36-covering-radius-bent + kind: theorem + location: Carlet, Relation (36), p. 51 + statement: >- + Every f satisfies nl(f) <= 2^(n-1)-2^(n/2-1). Equality holds exactly + when |W_f(a)|=2^(n/2) for every a; these functions are bent. A bent + Boolean function can exist only in even dimension and is not balanced. + formal_status: formalized + declarations: + - CryptBoolean.exists_inv_sqrt_card_le_vectorFourierCoeff_abs + - CryptBoolean.spectralInfinityNorm_ge_inv_sqrt_card + - CryptBoolean.distanceToAffineSigns_le_coveringRadius + - CryptBoolean.two_pow_mul_inv_sqrt + - CryptBoolean.sqrt_two_pow_eq_rpow + - CryptBoolean.coveringRadius_eq_relation_36 + - CryptBoolean.nonlinearity_cast_le_coveringRadius + - CryptBoolean.nonlinearity_cast_le_relation_36 + - CryptBoolean.vectorFourierCoeff_abs_eq_inv_sqrt_of_spectralInfinityNorm_eq + - CryptBoolean.spectralInfinityNorm_eq_inv_sqrt_of_forall_abs + - CryptBoolean.distanceToAffineSigns_eq_coveringRadius_iff + - CryptBoolean.HasFlatWalshSpectrum + - CryptBoolean.hasFlatWalshSpectrum_iff_vectorFourierCoeff + - CryptBoolean.nonlinearity_eq_coveringRadius_iff_flatWalshSpectrum + - CryptBoolean.nonlinearity_cast_eq_relation_36_iff_flatWalshSpectrum + - CryptBoolean.even_of_hasFlatWalshSpectrum + - CryptBoolean.IsBent + - CryptBoolean.sqrt_two_pow_eq_pow_half + - CryptBoolean.even_of_isBent + - CryptBoolean.hasFlatWalshSpectrum_iff_isBent + - CryptBoolean.even_of_exists_isBent + - CryptBoolean.not_isBalanced_of_isBent + - CryptBoolean.isBent_iff_nonlinearity_cast_eq_relation_36_of_even + - CryptBoolean.nonlinearity_cast_eq_relation_36_iff_isBent + dependencies: + - carlet-4-rel-35-nonlinearity-walsh + - carlet-2-parseval + - carlet-2-balanced-zero-walsh + + - id: carlet-4-random-nonlinearity-lower-bound + kind: theorem + location: Carlet, p. 51 + statement: >- + As n tends to infinity, the uniform probability that a Boolean function + has nonlinearity greater than + 2^(n-1)-sqrt(n)*2^((n-1)/2) tends to one. + formal_status: formalized + declarations: + - CryptBoolean.carletRandomFourierThreshold + - CryptBoolean.carletRandomNonlinearityThreshold + - CryptBoolean.carletRandomNonlinearityThreshold_eq_displayed + - CryptBoolean.carletRandomFourierThreshold_nonneg + - CryptBoolean.card_mul_carletRandomFourierThreshold_sq_div_two + - CryptBoolean.measure_fourierInfinityNorm_ge_carletThreshold_le + - CryptBoolean.carletRandomNonlinearityFailureBound + - CryptBoolean.fourier_union_bound_eq_failureBound + - CryptBoolean.tendsto_carletRandomNonlinearityFailureBound + - CryptBoolean.spectralInfinityNorm_encoding_eq_fourierInfinityNorm + - CryptBoolean.nonlinearity_encoding_eq_fourierInfinityNorm + - CryptBoolean.carletRandomNonlinearityThreshold_lt_of_fourierInfinityNorm_lt + - CryptBoolean.carletRandomNonlinearityProbability + - CryptBoolean.one_sub_failureBound_le_carletRandomNonlinearityProbability + - CryptBoolean.tendsto_carletRandomNonlinearityProbability + references: [65, 286] + dependencies: + - carlet-4-rel-35-nonlinearity-walsh + + - id: carlet-4-rodier-sharp-random-nonlinearity-interval + kind: theorem + location: Carlet, p. 51 + statement: >- + As n tends to infinity, the uniform probability tends to one that the + nonlinearity lies between + 2^(n-1)-2^(n/2-1)*sqrt(n)*(sqrt(2*ln(2))+4*ln(n)/n) and + 2^(n-1)-2^(n/2-1)*sqrt(n)*(sqrt(2*ln(2))-5*ln(n)/n). + formal_status: formalized + declarations: + - CryptBoolean.exists_rodierAsymptoticOffDiagonalPairError_bound + - CryptBoolean.tendsto_rodierRandomFourierLowerProbability + - CryptBoolean.rodierSharpRandomNonlinearityIntervalProbability + - CryptBoolean.tendsto_rodierSharpRandomNonlinearityIntervalProbability + references: [306] + dependencies: + - carlet-4-rodier-lower-endpoint + - carlet-4-rodier-upper-endpoint-reduction + - carlet-4-rodier-pair-characteristic-moments + + - id: carlet-4-rodier-lower-endpoint + kind: theorem + location: Rodier Theorem 3.1, one-sided consequence; Carlet, p. 51 + statement: >- + As n tends to infinity, the uniform probability tends to one that the + nonlinearity is strictly greater than + 2^(n-1)-2^(n/2-1)*sqrt(n)*(sqrt(2*ln(2))+4*ln(n)/n). + formal_status: formalized + declarations: + - CryptBoolean.rodierRandomFourierUpperThreshold + - CryptBoolean.rodierRandomNonlinearityLowerThreshold + - CryptBoolean.rodierRandomNonlinearityLowerThreshold_eq_displayed + - CryptBoolean.rodierRandomFourierUpperThreshold_nonneg + - CryptBoolean.card_mul_rodierRandomFourierUpperThreshold_sq_div_two_ge + - CryptBoolean.measure_fourierInfinityNorm_ge_rodierUpperThreshold_le + - CryptBoolean.rodierRandomNonlinearityLowerFailureBound + - CryptBoolean.tendsto_rodierRandomNonlinearityLowerFailureBound + - CryptBoolean.rodierRandomNonlinearityLowerThreshold_lt_of_fourierInfinityNorm_lt + - CryptBoolean.rodierRandomNonlinearityLowerProbability + - CryptBoolean.one_sub_rodierLowerFailureBound_le_probability + - CryptBoolean.tendsto_rodierRandomNonlinearityLowerProbability + references: [306] + dependencies: + - carlet-4-rel-35-nonlinearity-walsh + + - id: carlet-4-rodier-upper-endpoint-reduction + kind: lemma + location: Project bridge for Rodier Theorem 3.1; Carlet, p. 51 + statement: >- + Let tau_n=sqrt(n)*(sqrt(2*ln(2))-5*ln(n)/n)*2^(-n/2). If the uniform + probability of tau_n being smaller than the normalized Fourier infinity + norm tends to one, then the probability that nonlinearity is below + Carlet's displayed upper endpoint tends to one. + formal_status: formalized + declarations: + - CryptBoolean.rodierRandomFourierLowerThreshold + - CryptBoolean.rodierRandomNonlinearityUpperThreshold + - CryptBoolean.rodierRandomNonlinearityUpperThreshold_eq_displayed + - CryptBoolean.nonlinearity_lt_rodierRandomNonlinearityUpperThreshold + - CryptBoolean.rodierRandomFourierLowerProbability + - CryptBoolean.rodierRandomNonlinearityUpperProbability + - CryptBoolean.rodierRandomFourierLowerProbability_le_nonlinearityUpperProbability + - CryptBoolean.tendsto_rodierRandomNonlinearityUpperProbability_of_fourierLower + references: [306] + dependencies: + - carlet-4-rel-35-nonlinearity-walsh + + - id: carlet-4-rodier-pair-characteristic-moments + kind: lemma + location: Project bridge for Rodier Lemma 6.4 + statement: >- + For distinct Walsh characters chi_S and chi_T and real t,r, the joint + characteristic function of the corresponding raw Walsh coefficients is + the product over x of cos(t*chi_S(x)+r*chi_T(x)). The sums of the squares + and fourth powers of these phases are respectively + 2^n*(t^2+r^2) and 2^n*(t^4+6*t^2*r^2+r^4). + formal_status: formalized + declarations: + - CryptBoolean.rodierPairPhase + - CryptBoolean.rodierPairCharacteristic + - CryptBoolean.rodierPairCharacteristic_eq_prod_cos + - CryptBoolean.sum_monomial_mul_eq_zero_of_ne + - CryptBoolean.sum_rodierPairPhase_sq + - CryptBoolean.sum_rodierPairPhase_fourth + references: [306] + dependencies: [] + + - id: carlet-4-odd-dimension-exact-five + kind: theorem + location: Carlet, pp. 51--52 + statement: >- + The maximum nonlinearity of a five-variable Boolean function is + 2^4-2^2=12. + formal_status: formalized + declarations: + - CryptBoolean.maximumNonlinearity_five + references: [175, 281] + dependencies: + - carlet-4-odd-dimension-quadratic-covering-bounds + - carlet-3-affine-weight + - carlet-3-reed-muller-dimension + - carlet-4-def-higher-order-nonlinearity + + - id: carlet-4-odd-dimension-best-nonlinearity + kind: theorem + location: Carlet, pp. 51--52 + statement: >- + For n=7, the maximum nonlinearity equals + 2^(n-1)-2^((n-1)/2)=56. + formal_status: formalized + declarations: + - CryptBoolean.firstCoordinateSliceSeven + - CryptBoolean.exists_linearEquiv_firstCoordinateSlices_degree_le_four + - CryptBoolean.nonlinearity_le_56_of_degree_le_five_seven + - CryptBoolean.exists_minimum_affine_error_one_at_of_degree_le_five_nonlinearity_eq_56_seven + - CryptBoolean.nonlinearity_le_fifty_six_of_degree_five_covering + - CryptBoolean.maximumNonlinearity_seven + references: [175, 281] + dependencies: + - carlet-4-odd-dimension-quadratic-covering-bounds + - carlet-4-six-variable-covering-coset-coordinate + - carlet-4-six-variable-degree-four-coset-coordinate + + - id: carlet-4-six-variable-covering-coset-coordinate + kind: lemma + location: Project bridge for Hou 1996, Theorem 2.3, Case 2a + statement: >- + If a six-variable Boolean function f has nonlinearity 28, then for + every x in V_6 there is an affine function ell at Hamming distance 28 + from f such that (f+ell)(x)=1. + formal_status: formalized + declarations: + - CryptBoolean.exists_minimum_affine_error_one_at_of_nonlinearity_eq_28 + references: [175] + dependencies: + - carlet-4-rel-36-covering-radius-bent + + - id: carlet-4-six-variable-degree-four-coset-coordinate + kind: lemma + location: Project bridge for Hou 1996, Theorem 2.3, Case 2b, and Hou 1997, Theorem 2.2 + statement: >- + If a six-variable Boolean function f has algebraic degree at most four + and nonlinearity 26, then for every x in V_6 there is an affine function + ell at Hamming distance 26 from f such that (f+ell)(x)=1. + formal_status: formalized + declarations: + - CryptBoolean.exists_minimum_affine_error_one_at_of_degree_le_four_nonlinearity_eq_26 + references: [175] + dependencies: + - carlet-4-rel-35-nonlinearity-walsh + - carlet-2-parseval + - carlet-3-theorem-2 + + - id: carlet-4-odd-dimension-quadratic-covering-bounds + kind: theorem + location: Carlet, pp. 51--52 + statement: >- + For every odd n, the maximum nonlinearity of an n-variable Boolean + function is at least 2^(n-1)-2^((n-1)/2) and at most the + covering-radius bound 2^(n-1)-2^(n/2-1). + formal_status: formalized + declarations: + - CryptBoolean.maximumNonlinearity + - CryptBoolean.nonlinearity_le_maximumNonlinearity + - CryptBoolean.exists_nonlinearity_eq_maximumNonlinearity + - CryptBoolean.oddQuadraticFunction + - CryptBoolean.walshTransform_oddQuadraticFunction + - CryptBoolean.maxWalshMagnitude_oddQuadraticFunction + - CryptBoolean.nonlinearity_oddQuadraticFunction + - CryptBoolean.quadraticBound_le_maximumNonlinearity_of_odd + - CryptBoolean.maximumNonlinearity_cast_le_relation_36 + - CryptBoolean.maximumNonlinearity_odd_bounds + dependencies: + - carlet-4-rel-35-nonlinearity-walsh + - carlet-4-rel-36-covering-radius-bent + + - id: carlet-4-odd-dimension-exact-one-three + kind: theorem + location: Carlet, p. 52 + statement: >- + The maximum nonlinearities of one-variable and three-variable Boolean + functions are respectively M(1)=0 and M(3)=2. + formal_status: formalized + declarations: + - CryptBoolean.maximumNonlinearity_one + - CryptBoolean.maximumNonlinearity_three + references: [175, 281] + dependencies: + - carlet-4-odd-dimension-quadratic-covering-bounds + + - id: carlet-4-odd-dimension-strict-above-quadratic + kind: theorem + location: Carlet, pp. 51--52 and footnote 22 + statement: >- + For every odd n>7, there exists an n-variable Boolean function whose + nonlinearity is strictly greater than + 2^(n-1)-2^((n-1)/2). + formal_status: formalized + declarations: + - CryptBoolean.f₂CubeNatIndex + - CryptBoolean.f₂CubeOfNat + - CryptBoolean.kavutYucelTruthTable + - CryptBoolean.kavutYucelFunction9 + - CryptBoolean.kavutYucelFunction9_walsh_bound + - CryptBoolean.kavutYucelFunction9_walsh_witness + - CryptBoolean.maxWalshMagnitude_kavutYucelFunction9 + - CryptBoolean.nonlinearity_kavutYucelFunction9 + - CryptBoolean.kavutYucelBentExtension + - CryptBoolean.realSignView_kavutYucelBentExtension + - CryptBoolean.walshTransform_kavutYucelBentExtension_append + - CryptBoolean.natAbs_walshTransform_innerProductModTwoBit + - CryptBoolean.natAbs_walshTransform_kavutYucelBentExtension_append + - CryptBoolean.maxWalshMagnitude_kavutYucelBentExtension + - CryptBoolean.nonlinearity_kavutYucelBentExtension + - CryptBoolean.quadraticBound_lt_nonlinearity_kavutYucelBentExtension + - CryptBoolean.exists_nonlinearity_gt_quadraticBound_of_odd + - CryptBoolean.quadraticBound_lt_maximumNonlinearity_of_odd + references: [208, 259] + dependencies: + - carlet-4-rel-35-nonlinearity-walsh + + - id: carlet-4-odd-dimension-balanced-above-quadratic + kind: theorem + location: Carlet, p. 52, footnote 22 + statement: >- + For every odd n>=15, there exists a balanced n-variable Boolean + function whose nonlinearity is strictly greater than + 2^(n-1)-2^((n-1)/2). + formal_status: formalized + declarations: + - CryptBoolean.flipOn + - CryptBoolean.MaitraKavutYucel.seedTruthTable + - CryptBoolean.MaitraKavutYucel.seedFunction9 + - CryptBoolean.MaitraKavutYucel.shiftFrequency9 + - CryptBoolean.MaitraKavutYucel.shiftedSeedFunction9 + - CryptBoolean.MaitraKavutYucel.bentTruthTable + - CryptBoolean.MaitraKavutYucel.bentFunction4 + - CryptBoolean.MaitraKavutYucel.initialFunction13 + - CryptBoolean.MaitraKavutYucel.flipPointList13 + - CryptBoolean.MaitraKavutYucel.flipPoints13 + - CryptBoolean.maitraKavutYucelFunction13 + - CryptBoolean.maitraKavutYucelFunction13_walsh_bound + - CryptBoolean.isBalanced_maitraKavutYucelFunction13 + - CryptBoolean.maitraKavutYucelFunction13_walsh_witness + - CryptBoolean.maxWalshMagnitude_maitraKavutYucelFunction13 + - CryptBoolean.nonlinearity_maitraKavutYucelFunction13 + - CryptBoolean.maitraKavutYucelBentExtension + - CryptBoolean.isBalanced_maitraKavutYucelBentExtension + - CryptBoolean.maxWalshMagnitude_maitraKavutYucelBentExtension + - CryptBoolean.nonlinearity_maitraKavutYucelBentExtension + - CryptBoolean.quadraticBound_lt_nonlinearity_maitraKavutYucelBentExtension + - CryptBoolean.exists_isBalanced_nonlinearity_gt_quadraticBound_of_odd + references: [139, 259] + fidelity_note: >- + The compiled family starts from the balanced thirteen-variable + Maitra--Kavut--Yucel function of nonlinearity 4036 and extends it by + complete bent direct sums. It therefore proves the stronger range of + every odd n>=13 while retaining the source claim for n>=15. + dependencies: + - carlet-4-rel-35-nonlinearity-walsh + - carlet-2-balanced-zero-walsh + + - id: carlet-4-odd-dimension-pc-one-above-quadratic + kind: theorem + location: Carlet, p. 52, footnote 22 + statement: >- + For every odd n>=15, there exists an n-variable Boolean function + satisfying PC(1) whose nonlinearity is strictly greater than + 2^(n-1)-2^((n-1)/2). + formal_status: formalized + declarations: + - CryptBoolean.maitraKavutYucelZeroAutocorrelationBasis + - CryptBoolean.maitraKavutYucelZeroAutocorrelationBasis_independent + - CryptBoolean.maitraKavutYucelPCOneReindex + - CryptBoolean.maitraKavutYucelPCOneFunction13 + - CryptBoolean.satisfiesPropagationCriterion_one_maitraKavutYucelPCOneFunction13 + - CryptBoolean.nonlinearity_maitraKavutYucelPCOneFunction13 + - CryptBoolean.maitraKavutYucelPCOneBentExtension + - CryptBoolean.satisfiesPropagationCriterion_one_maitraKavutYucelPCOneBentExtension + - CryptBoolean.maxWalshMagnitude_maitraKavutYucelPCOneBentExtension + - CryptBoolean.nonlinearity_maitraKavutYucelPCOneBentExtension + - CryptBoolean.quadraticBound_lt_nonlinearity_maitraKavutYucelPCOneBentExtension + - CryptBoolean.exists_pc_one_nonlinearity_gt_quadraticBound_of_odd + references: [264] + fidelity_note: >- + The compiled construction linearly reindexes the thirteen-variable + Maitra--Kavut--Yucel function along a certified basis of zero- + autocorrelation directions and then applies complete bent extensions. + It proves the stronger range of every odd n>=13 while retaining the + source claim for n>=15. + dependencies: + - carlet-4-odd-dimension-balanced-above-quadratic + - carlet-4-def-propagation-criteria + + - id: carlet-4-odd-dimension-degree-pred-above-quadratic + kind: theorem + location: Carlet, p. 52, footnote 22 + statement: >- + For every odd n>=15, there exists an n-variable Boolean function of + algebraic degree n-1 whose nonlinearity is strictly greater than + 2^(n-1)-2^((n-1)/2). + formal_status: formalized + declarations: + - CryptBoolean.nonlinearity_le_hammingDistance_add_nonlinearity + - CryptBoolean.exists_isBalanced_degree_pred_nonlinearity_ge_sub_two + - CryptBoolean.exists_isBalanced_degree_pred_nonlinearity_gt_quadraticBound_of_odd + references: [214, 264] + fidelity_note: >- + The compiled construction is stronger because its degree-(n-1) + witnesses are also balanced. A two-point affine-line repair loses at + most two units of nonlinearity, and the balanced family has enough + strict margin in every odd dimension at least fifteen. + dependencies: + - carlet-4-odd-dimension-balanced-above-quadratic + - carlet-3-prop-12 + - carlet-4-def-nonlinearity + + - id: carlet-4-reed-muller-coset-distance + kind: theorem + location: Carlet, p. 52 + statement: >- + The nonlinearity of f equals the minimum distance of + R(1,n) union (f+R(1,n)). More generally, for a family F, the minimum + distance of union_{f in F}(f+R(1,n)) is the minimum of nl(f+g) over + distinct f,g in F. + formal_status: formalized + declarations: + - CryptBoolean.minimumHammingDistance + - CryptBoolean.firstOrderCosetUnion + - CryptBoolean.firstOrderReedMullerCoset + - CryptBoolean.HasDistinctFirstOrderCosets + - CryptBoolean.minimumPairNonlinearity + - CryptBoolean.mem_firstOrderCosetUnion_iff + - CryptBoolean.mem_firstOrderReedMullerCoset_iff + - CryptBoolean.firstOrderCosetUnion_pair + - CryptBoolean.minimumHammingDistance_le + - CryptBoolean.le_minimumHammingDistance + - CryptBoolean.minimumPairNonlinearity_le + - CryptBoolean.le_minimumPairNonlinearity + - CryptBoolean.hammingDistance_add_right + - CryptBoolean.hammingDistance_eq_cosetDifference + - CryptBoolean.nonlinearity_le_hammingDistance_of_mem_cosets + - CryptBoolean.nonlinearity_le_two_pow_sub_one + - CryptBoolean.exists_pair_nonlinearity_eq_minimumPairNonlinearity + - CryptBoolean.firstOrderCosetUnion_offDiag_nonempty + - CryptBoolean.dimension_pos_of_hasDistinctFirstOrderCosets + - CryptBoolean.two_pow_sub_one_le_hammingDistance_of_mem_same_coset + - CryptBoolean.minimumPairNonlinearity_le_two_pow_sub_one + - CryptBoolean.minimumHammingDistance_firstOrderCosetUnion + - CryptBoolean.hasDistinctFirstOrderCosets_pair_zero + - CryptBoolean.minimumPairNonlinearity_pair_zero + - CryptBoolean.minimumHammingDistance_two_firstOrderReedMullerCosets + fidelity_note: >- + Carlet's printed equality is false when two listed representatives define + the same coset. The formal theorem states the necessary pairwise-distinct + coset hypothesis explicitly; the two-coset corollary assumes that f is + non-affine. Under those corrected hypotheses the source formulas are + proved exactly. + dependencies: + - carlet-4-def-nonlinearity + - carlet-3-reed-muller-code + + - id: carlet-4-derivative-nonlinearity-bounds + kind: theorem + location: Carlet, pp. 52--53, Relation (37) + statement: >- + The nonlinearity satisfies the stated autocorrelation upper bound and + nl(f) >= 2^(n-2)-(1/4) min_{e!=0}|Delta_f(e)|. + formal_status: formalized + declarations: + - CryptBoolean.minimumAutocorrelationMagnitude + - CryptBoolean.autocorrelation_add_of_isLinearStructure + - CryptBoolean.abs_autocorrelation_add_of_isLinearStructure + - CryptBoolean.exists_abs_autocorrelation_eq_absoluteIndicator + - CryptBoolean.nonlinearity_cast_le_autocorrelation_upper_bound + - CryptBoolean.relation_37_nonlinearity_lower_bound + references: [355, 358] + dependencies: + - carlet-4-def-nonlinearity + - carlet-4-hyperplane-walsh-autocorrelation + - carlet-2-def-2-derivative + - carlet-2-def-autocorrelation + + - id: carlet-4-odd-weighting-nonlinearity + kind: corollary + location: Carlet, p. 53 + statement: >- + If f admits a maximal odd-weighting subspace E of dimension d>=2, + then nl(f)>=2^(n-d). + formal_status: formalized + declarations: + - CryptBoolean.subspaceCosetWeight + - CryptBoolean.IsMaximalOddWeightingSubspace + - CryptBoolean.hammingWeight_lower_bound_of_isMaximalOddWeightingSubspace + - CryptBoolean.isMaximalOddWeightingSubspace_add_affineFunction + - CryptBoolean.hammingWeight_lower_bound_of_maximalOddWeightingSubspace + - CryptBoolean.nonlinearity_lower_bound_of_maximalOddWeightingSubspace + blocker: >- + Carlet Chapter 3 Remark 2 after Theorem 1 is not yet represented by a + reviewed production declaration. + dependencies: + - carlet-4-def-nonlinearity + + - id: carlet-4-def-higher-order-nonlinearity + kind: definition + location: Carlet, pp. 53--54 + statement: >- + For 0<=r- + If I has cardinality r, then nl_r(f) is at most the distance from f to + the functions depending only on the coordinates in I. + formal_status: formalized + declarations: + - CryptBoolean.anfCoeff_eq_zero_of_coordinate_invariant + - CryptBoolean.anfCoeff_eq_zero_of_dependsOn_of_not_subset + - CryptBoolean.functionAlgebraicDegree_le_card_of_dependsOn + - CryptBoolean.higherOrderNonlinearity_le_hammingDistance_of_dependsOn + dependencies: + - carlet-4-def-higher-order-nonlinearity + - carlet-2-def-algebraic-degree + + - id: carlet-4-higher-order-counting-criterion + kind: lemma + location: Project bridge for Carlet, p. 54 + statement: >- + Let V(N,t)=sum_{j=0}^t C(N,j). If + |R(r,n)| V(2^n,t) < 2^(2^n), then some n-variable Boolean function + has higher-order nonlinearity strictly greater than t. Equivalently, + it suffices that V(2^n,t) < 2^(2^n-D), where + D=sum_{j=0}^r C(n,j). + formal_status: formalized + declarations: + - CryptBoolean.hammingBallVolume + - CryptBoolean.exists_higherOrderNonlinearity_gt_of_counting + - CryptBoolean.exists_higherOrderNonlinearity_gt_of_hammingBallVolume_lt + dependencies: + - carlet-4-def-higher-order-nonlinearity + - carlet-3-reed-muller-dimension + + - id: carlet-4-higher-order-asymptotic-lower-bound + kind: theorem + location: Carlet, pp. 53--54 + statement: >- + For each fixed r and all sufficiently large n, there exists an + n-variable Boolean function f such that + nl_r(f) > 2^(n-1)-sqrt(2^(n-1) sum_{i=0}^r binom(n,i)). + formal_status: formalized + declarations: + - CryptBoolean.exists_higherOrderNonlinearity_gt_lower_bound_of_dimension + - CryptBoolean.eventually_twice_sum_choose_le_two_pow + - CryptBoolean.eventually_exists_higherOrderNonlinearity_gt_carlet_lower_bound + dependencies: + - carlet-4-higher-order-counting-criterion + + - id: carlet-4-higher-order-general-bounds + kind: theorem + location: Carlet, p. 53 + statement: >- + Let rho(r,n)=max_f nl_r(f). For each fixed r>=2, the cited upper bound is + rho(r,n) <= 2^(n-1) - (sqrt(15)/2)(1+sqrt(2))^(r-2)2^(n/2) + + O(n^(r-2)). + formal_status: formalized + declarations: + - CryptBoolean.exists_maximumHigherOrderNonlinearity_cast_le_sharp + references: [91] + dependencies: + - carlet-4-higher-order-general-r-propagation + - carlet-4-higher-order-order-two-weight-sixteen-character-bound + + - id: carlet-4-higher-order-plotkin-induction + kind: lemma + location: Project bridge for Carlet, p. 53 and reference [91] + statement: >- + Let rho(r,n)=max_f nl_r(f). For 1<=r<=n, + rho(r,n)<=sum_{j=r}^{n-1} rho(r-1,j). If on that range + rho(r-1,j)<=2^(j-1)-A*(sqrt(2))^j+e(j), then rho(r,n) is at most + (2^n-2^r)/2-A*(1+sqrt(2))*((sqrt(2))^n-(sqrt(2))^r) + +sum_{j=r}^{n-1}e(j). + formal_status: formalized + declarations: + - CryptBoolean.maximumHigherOrderNonlinearity + - CryptBoolean.higherOrderNonlinearity_le_maximum + - CryptBoolean.exists_higherOrderNonlinearity_eq_maximum + - CryptBoolean.maximumHigherOrderNonlinearity_succ_le + - CryptBoolean.maximumHigherOrderNonlinearity_self + - CryptBoolean.maximumHigherOrderNonlinearity_le_sum_Ico + - CryptBoolean.maximumHigherOrderNonlinearity_cast_le_sum_Ico_of_le + - CryptBoolean.maximumHigherOrderNonlinearity_cast_le_carlet_step + references: [91] + dependencies: + - carlet-4-def-higher-order-nonlinearity + + - id: carlet-4-higher-order-order-two-moment-ratio + kind: lemma + location: Project bridge for Carlet, p. 53 and reference [91], Relations (9.7)--(9.10) + statement: >- + For f : V_n -> F_2 and g in R(2,n), let + C_f(g)=2^n-2*d_H(f,g) and + S_k(f)=sum_{g in R(2,n)} C_f(g)^(2k). Then S_k(f)>0 and + sqrt(S_{k+1}(f)/S_k(f)) <= 2^n-2*nl_2(f). Hence rho(2,n) is at most + 2^(n-1) minus one half of the minimum of this ratio over f. + formal_status: formalized + declarations: + - CryptBoolean.orderTwoCorrelation + - CryptBoolean.orderTwoCorrelation_eq_two_pow_sub_two_hammingDistance + - CryptBoolean.maximumOrderTwoCorrelation + - CryptBoolean.maximumOrderTwoCorrelation_eq + - CryptBoolean.orderTwoCorrelation_le_maximum + - CryptBoolean.exists_orderTwoCorrelation_eq_maximum + - CryptBoolean.maximumOrderTwoCorrelation_nonneg + - CryptBoolean.abs_orderTwoCorrelation_le_maximum + - CryptBoolean.orderTwoCorrelationPowerSum + - CryptBoolean.orderTwoCorrelationPowerSum_nonneg + - CryptBoolean.orderTwoCorrelationPowerSum_pos + - CryptBoolean.orderTwoCorrelationPowerSum_succ_le + - CryptBoolean.sqrt_orderTwoCorrelationPowerSum_ratio_le + - CryptBoolean.minimumOrderTwoMomentRatio + - CryptBoolean.maximumHigherOrderNonlinearity_two_cast_le_momentRatio + references: [91] + dependencies: + - carlet-4-def-higher-order-nonlinearity + - carlet-4-rel-35-nonlinearity-walsh + - carlet-2-parseval + + - id: carlet-4-higher-order-order-two-dual-moment-decomposition + kind: lemma + location: Project bridge for Carlet, p. 53 and reference [91], Lemma 9.2.2 + statement: >- + For an ordered 2k-tuple x of points of V_n, let p_x record the parity of + the multiplicity of each point, and let U_{k,n} be the tuples for which + p_x belongs to R(n-3,n). If n>=3, then S_k(f) equals |R(2,n)| times + the sum over x in U_{k,n} of (-1) raised to the pairing of f and p_x. + formal_status: formalized + declarations: + - CryptBoolean.tuplePointParity + - CryptBoolean.booleanFunctionPairing_tuplePointParity + - CryptBoolean.orderTwoAdmissibleTuples + - CryptBoolean.reedMullerTwoPairingCharacterSum + - CryptBoolean.reedMullerTwoPairingCharacterSum_eq_card_of_mem_dual + - CryptBoolean.reedMullerTwoPairingCharacterSum_eq_zero_of_not_mem_dual + - CryptBoolean.orderTwoCorrelationPowerSum_eq_admissibleTupleCharacterSum + references: [91] + dependencies: + - carlet-4-higher-order-order-two-moment-ratio + - carlet-3-theorem-2 + + - id: carlet-4-higher-order-order-two-weight-grouping + kind: lemma + location: Project bridge for reference [91], Proposition 9.2.5 and Lemma 9.2.7 + statement: >- + The ordered 2k-tuple multiplicity of a point-parity word depends only + on its Hamming weight w and equals the inverse finite Fourier sum + 2^(-2^n) sum_j K_j^(2^n)(w)(2^n-2j)^(2k). Hence the order-two + correlation moment is an exact character sum grouped by dual-word + Hamming weight. + formal_status: formalized + declarations: + - CryptBoolean.orderTwoDualWords + - CryptBoolean.tuplePointParityFiber + - CryptBoolean.tuplePointParityMultiplicity + - CryptBoolean.tuplePointParityMultiplicity_comp_perm + - CryptBoolean.tuplePointParityMultiplicity_eq_of_hammingWeight_eq + - CryptBoolean.tuplePointParityMultiplicityByWeight + - CryptBoolean.tuplePointParityMultiplicity_eq_byWeight + - CryptBoolean.tuplePointParityMultiplicityByWeight_eq_fourierSum + - CryptBoolean.tuplePointParityKrawtchoukMultiplicity + - CryptBoolean.tuplePointParityMultiplicityByWeight_eq_krawtchoukSum + - CryptBoolean.orderTwoCorrelationPowerSum_eq_dualWeightGroupedCharacterSum + - CryptBoolean.orderTwoCorrelationPowerSum_eq_dualFourierMultiplicityCharacterSum + - CryptBoolean.orderTwoCorrelationPowerSum_eq_dualKrawtchoukMultiplicityCharacterSum + references: [91] + dependencies: + - carlet-4-higher-order-order-two-dual-moment-decomposition + + - id: carlet-4-higher-order-order-two-low-weight-support + kind: lemma + location: Project bridge for Carlet, p. 53 and reference [91] + statement: >- + For n>=7, the coefficient of a dual word in + S_8(f)-15*2^n*S_7(f) vanishes above weight sixteen, and the only even + dual weights at most sixteen are 0, 8, 12, 14, and 16. + formal_status: formalized + declarations: + - CryptBoolean.hasOrderTwoLowWeightSpectrum + - CryptBoolean.tuplePointParityMultiplicityByWeight_eq_zero_of_lt + - CryptBoolean.tuplePointParityMomentDifference_eq_zero_of_sixteen_lt + - CryptBoolean.orderTwoMomentDifferenceCharacterSum_eq_lowWeights + references: [91] + dependencies: + - carlet-4-higher-order-order-two-weight-grouping + - carlet-3-theorem-1 + + - id: carlet-4-higher-order-order-two-weight-eight-bound + kind: lemma + location: Project bridge for reference [91], Proposition 9.2.10(1) + statement: >- + Weight-eight words in R(n-3,n) are affine three-flat indicators, and + their character sum is at least + -2^n(2^n-1)(2^n-2)/336. + formal_status: formalized + declarations: + - CryptBoolean.orderTwoWeightEightDualWords_eq_affineFlatIndicators + - CryptBoolean.orderTwoWeightEightCharacterSum_eq_affineFlatCharacterSum + - CryptBoolean.card_binaryAffineFlats_two + - CryptBoolean.binaryAffineFlatCharacterSum_three_ge_neg_card + - CryptBoolean.binaryAffineFlatCharacterSum_three_ge + - CryptBoolean.orderTwoWeightEightCharacterSum_ge + references: [91] + dependencies: + - carlet-4-higher-order-order-two-low-weight-support + - carlet-3-prop-12 + + - id: carlet-4-higher-order-order-two-weight-twelve-bound + kind: lemma + location: Project bridge for Carlet, p. 53 and reference [91] + statement: >- + For n>=5, every weight-twelve word of R(n-3,n) has exactly twenty + ordered affine-three-flat representations meeting in an affine line, + and its character sum is at least -(2^n)^5/20. + formal_status: formalized + declarations: + - CryptBoolean.hasWeightTwelveFlatPairClassification + - CryptBoolean.weightTwelveRepresentationCharacterSum_ge + - CryptBoolean.orderTwoWeightTwelveCharacterSum_eq_representation + - CryptBoolean.orderTwoWeightTwelveCharacterSum_ge + references: [91] + dependencies: + - carlet-4-higher-order-order-two-low-weight-support + - carlet-3-theorem-2 + + - id: carlet-4-higher-order-order-two-weight-fourteen-bound + kind: lemma + location: Project bridge for Carlet, p. 53 and reference [91] + statement: >- + Every weight-fourteen word of R(n-3,n) is the sum of two affine + three-flat indicators meeting at one point, with exactly two ordered + representations, and its character sum is at least -(2^n)^6/2. + formal_status: formalized + declarations: + - CryptBoolean.hasWeightFourteenFlatPairClassification + - CryptBoolean.weightFourteenRepresentationCharacterSum_ge + - CryptBoolean.orderTwoWeightFourteenCharacterSum_eq_representation + - CryptBoolean.orderTwoWeightFourteenCharacterSum_ge + references: [91] + dependencies: + - carlet-4-higher-order-order-two-low-weight-support + - carlet-3-theorem-2 + + - id: carlet-4-higher-order-order-two-weight-sixteen-rank-reduction + kind: lemma + location: Project bridge for Carlet, p. 53 and reference [91] + statement: >- + A weight-sixteen word of R(n-3,n) has support-affine-span dimension at + most seven. In the rank-seven case its augmented affine-evaluation code + is a binary self-dual [16,8,>=4] code. + formal_status: formalized + declarations: + - CryptBoolean.finrank_supportDifferenceSpan_le_seven_of_weight_sixteen + - CryptBoolean.exists_supportDifferenceBasis_of_finrank_eq + - CryptBoolean.augmentedSupportDifferenceCode_le_perpendicular + - CryptBoolean.four_le_binaryVectorWeight_of_mem_augmentedSupportDifferenceCode + - CryptBoolean.finrank_augmentedSupportDifferenceCode_eq_eight + - CryptBoolean.augmentedSupportDifferenceCode_eq_perpendicular + references: [91] + dependencies: + - carlet-4-higher-order-order-two-low-weight-support + - carlet-3-theorem-2 + + - id: carlet-4-higher-order-order-two-weight-sixteen-rank-seven-classification + kind: lemma + location: Project bridge for Carlet, p. 53 and reference [91] + statement: >- + The rank-seven weight-sixteen dual words are exactly the pairwise + disjoint affine orbits of the canonical 2E8, D16+, and F16 patterns. + formal_status: formalized + declarations: + - CryptBoolean.rankSevenWeightSixteenPatternCertificate + - CryptBoolean.hasRankSevenWeightSixteenOrbitClassification + references: [91] + dependencies: + - carlet-4-higher-order-order-two-weight-sixteen-rank-reduction + + - id: carlet-4-higher-order-order-two-weight-sixteen-orbit-sos + kind: lemma + location: Project bridge for Carlet, p. 53 and reference [91] + statement: >- + Each of the 2E8, D16+, and F16 complete affine-map character sums is + nonnegative, and each distinct injective-image orbit character sum is + at least -127*(2^n)^7. + formal_status: formalized + declarations: + - CryptBoolean.rankSevenWeightSixteenPatternAffineProduct + - CryptBoolean.rankSevenWeightSixteenPatternCompleteAffineMapCharacterSum + - CryptBoolean.rankSevenWeightSixteenPatternCompleteAffineMapCharacterSum_nonneg + - CryptBoolean.rankSevenWeightSixteenInjectiveAffineMapData + - CryptBoolean.rankSevenWeightSixteenInjectiveAffineMapCharacterSum_ge + - CryptBoolean.rankSevenWeightSixteenPatternOrbitWords + - CryptBoolean.rankSevenWeightSixteenPatternOrbitCharacterSum + - CryptBoolean.rankSevenWeightSixteenPatternOrbitCharacterSum_ge + references: [91] + + - id: carlet-4-higher-order-order-two-weight-sixteen-residual-cover + kind: lemma + location: Project bridge for Carlet, p. 53 and reference [91] + statement: >- + Rank-at-most-six weight-sixteen dual words are covered by arbitrary + masks on V_7 under rank-deficient affine maps, giving cardinality and + character-sum bounds 127*2^128*(2^n)^7. + formal_status: formalized + declarations: + - CryptBoolean.sevenVariableAffineMaskWord + - CryptBoolean.rankDeficientSevenVariableAffineMaskImageWords + - CryptBoolean.card_rankDeficientSevenVariableAffineMaskImageWords_le + - CryptBoolean.HasRankAtMostSixWeightSixteenDeficientAffineMaskCover + - CryptBoolean.hasRankAtMostSixWeightSixteenDeficientAffineMaskCover + - CryptBoolean.orderTwoWeightSixteenRankAtMostSixResidualWords_subset_affineMaskImage_of_cover + - CryptBoolean.card_orderTwoWeightSixteenRankAtMostSixResidualWords_le + - CryptBoolean.orderTwoWeightSixteenRankAtMostSixResidualCharacterSum + - CryptBoolean.orderTwoWeightSixteenRankAtMostSixResidualCharacterSum_ge + references: [91] + dependencies: + - carlet-4-higher-order-order-two-weight-sixteen-rank-reduction + + - id: carlet-4-higher-order-order-two-weight-sixteen-character-bound + kind: lemma + location: Project bridge for Carlet, p. 53 and reference [91] + statement: >- + For n >= 3, the full weight-sixteen character sum is at least + -(3*127+127*2^128)*(2^n)^7. + formal_status: formalized + declarations: + - CryptBoolean.orderTwoWeightSixteenCharacterSum_ge_rankSevenClassification + references: [91] + dependencies: + - carlet-4-higher-order-order-two-weight-sixteen-rank-seven-classification + - carlet-4-higher-order-order-two-weight-sixteen-orbit-sos + - carlet-4-higher-order-order-two-weight-sixteen-residual-cover + + - id: carlet-4-higher-order-order-two-moment-difference + kind: lemma + location: Project bridge for Carlet, p. 53 and reference [91] + statement: >- + If the weight-sixteen character sum is at least -B*(2^n)^7, then + S_8(f)-15*2^n*S_7(f) is bounded below by + -(133000020000000+21000000000000*B)*|R(2,n)|*(2^n)^7. + formal_status: formalized + declarations: + - CryptBoolean.tuplePointParityMomentDifference_zero_ge + - CryptBoolean.tuplePointParityMomentDifference_eight_bounds + - CryptBoolean.tuplePointParityMomentDifference_twelve_bounds + - CryptBoolean.tuplePointParityMomentDifference_fourteen_bounds + - CryptBoolean.tuplePointParityMomentDifference_sixteen_bounds + - CryptBoolean.orderTwoCorrelationPowerSum_difference_eq_lowWeights + - CryptBoolean.orderTwoCorrelationPowerSum_difference_ge_of_weightSixteenCharacterSum + references: [91] + dependencies: + - carlet-4-higher-order-order-two-weight-eight-bound + - carlet-4-higher-order-order-two-weight-twelve-bound + - carlet-4-higher-order-order-two-weight-fourteen-bound + - carlet-4-higher-order-order-two-weight-sixteen-character-bound + + - id: carlet-4-higher-order-order-two-asymptotic-upper + kind: lemma + location: Project bridge for Carlet, p. 53 and reference [91] + statement: >- + A uniform code-cardinality-scaled seventh/eighth moment remainder K + implies rho(2,n)<=2^(n-1)-(sqrt(15)/2)*2^(n/2)+sqrt(K)/2. + formal_status: formalized + declarations: + - CryptBoolean.reedMuller_card_mul_two_pow_seven_le_orderTwoCorrelationPowerSum_seven + - CryptBoolean.orderTwoCorrelationPowerSum_eight_div_seven_ge_of_card_scaled + - CryptBoolean.sqrt_fifteen_mul_sqrtTwo_pow_sub_sqrt_le_momentRatio + - CryptBoolean.maximumHigherOrderNonlinearity_two_cast_le_of_card_scaled_moment_difference + - CryptBoolean.eventually_maximumHigherOrderNonlinearity_two_cast_le_of_card_scaled_moment_difference + references: [91] + dependencies: + - carlet-4-higher-order-order-two-moment-ratio + - carlet-4-higher-order-order-two-moment-difference + + - id: carlet-4-higher-order-general-r-propagation + kind: lemma + location: Project bridge for Carlet, p. 53 and reference [91] + statement: >- + An eventual uniform order-two moment remainder propagates, for each + fixed r>=2, to the sqrt(15)/2*(1+sqrt(2))^(r-2) leading coefficient + with an O(n^(r-2)) remainder. + formal_status: formalized + declarations: + - CryptBoolean.exists_maximumHigherOrderNonlinearity_cast_le_of_card_scaled_moment_difference + references: [91] + dependencies: + - carlet-4-higher-order-plotkin-induction + - carlet-4-higher-order-order-two-asymptotic-upper + + - id: carlet-4-prop-13 + kind: proposition + location: Carlet, Proposition 13, pp. 54--55 + statement: >- + Let 1<=r- + For n>0 and 0<=m- + The function f is m-resilient iff W_f(u)=0 for every u with + w_H(u)<=m. Correlation immunity alone is equivalent to vanishing at + every nonzero u of weight at most m. + formal_status: formalized + declarations: + - CryptBoolean.walshTransform_eq_zero_iff_vectorFourierCoeff_eq_zero + - CryptBoolean.theorem_3_correlationImmune_iff_walshTransform_eq_zero + - CryptBoolean.theorem_3_resilient_iff_walshTransform_eq_zero + references: [172] + dependencies: + - carlet-4-def-resiliency-correlation-immunity + - carlet-2-cor-1-poisson-summation + - carlet-2-def-walsh-transform + - carlet-2-balanced-zero-walsh + + - id: carlet-4-resiliency-support-dual-distance + kind: corollary + location: Carlet, p. 57 + statement: >- + The function f is m-resilient iff it is balanced and supp(f) has dual + distance at least m+1; correlation immunity omits the balancedness + condition. + formal_status: formalized + declarations: + - CryptBoolean.codeCharacterSum + - CryptBoolean.HasDualDistanceAtLeast + - CryptBoolean.sum_vectorWalshCharacter_eq_zero + - CryptBoolean.walshTransform_cast_eq_neg_two_mul_codeCharacterSum_support + - CryptBoolean.isCorrelationImmune_iff_support_hasDualDistanceAtLeast + - CryptBoolean.isBalanced_iff_support_card_eq_two_pow_pred + - CryptBoolean.isResilient_iff_support_card_and_hasDualDistanceAtLeast + references: [127, 128] + dependencies: + - carlet-4-theorem-3 + - carlet-2-def-support-weight + + - id: carlet-4-code-generator-resilient + kind: theorem + location: Carlet, pp. 57--58 + statement: >- + If G generates a binary [n,k,d] linear code and g:F_2^k -> F_2 is + balanced, then f(x)=g(x G^t) is (d-1)-resilient. + formal_status: formalized + declarations: + - CryptBoolean.binaryGeneratorCodeword + - CryptBoolean.IsBinaryCodeGenerator + - CryptBoolean.binaryGeneratorPullback + - CryptBoolean.isBalanced_binaryGeneratorPullback + - CryptBoolean.binaryGeneratorPullback_isResilient + references: [126] + dependencies: + - carlet-4-def-resiliency-correlation-immunity + + - id: carlet-4-resiliency-translation-invariance + kind: theorem + location: Carlet, p. 58 + statement: >- + If f is m-resilient, then x |-> f(x+b) is m-resilient for every b. + formal_status: formalized + declarations: + - CryptBoolean.walshTransform_domainTranslate_cast + - CryptBoolean.isResilient_domainTranslate + dependencies: + - carlet-4-theorem-3 + - carlet-2-prop-6-fourier-shifts + + - id: carlet-4-def-propagation-criteria + kind: definition + location: Carlet, pp. 58--59 + statement: >- + Propagation criteria, SAC, their order-k restriction forms, and EPC + are defined through balanced directional derivatives and resiliency of + the relevant derivatives, with the stated monotonicity implications. + formal_status: formalized + declarations: + - CryptBoolean.lowWeightNonzeroDirections + - CryptBoolean.SatisfiesPropagationCriterionOn + - CryptBoolean.SatisfiesPropagationCriterion + - CryptBoolean.satisfiesPropagationCriterion_iff_on_lowWeightNonzeroDirections + - CryptBoolean.isBalanced_booleanDerivative_iff_autocorrelation_eq_zero + - CryptBoolean.satisfiesPropagationCriterion_iff_autocorrelation_eq_zero + - CryptBoolean.SatisfiesStrictAvalancheCriterion + - CryptBoolean.satisfiesStrictAvalancheCriterion_iff_pc_one + - CryptBoolean.SatisfiesPropagationCriterion.mono + - CryptBoolean.coordinateRestriction + - CryptBoolean.SatisfiesPropagationCriterionOfOrder + - CryptBoolean.SatisfiesPropagationCriterionOfOrder.mono_order + - CryptBoolean.SatisfiesPropagationCriterionOfOrder.mono_level + - CryptBoolean.SatisfiesStrictAvalancheCriterionOfOrder + - CryptBoolean.satisfiesStrictAvalancheCriterionOfOrder_iff_pc_one + - CryptBoolean.SatisfiesExtendedPropagationCriterion + - CryptBoolean.SatisfiesExtendedPropagationCriterion.toPropagationCriterionOfOrder + references: [60, 153, 297, 298, 299, 347] + dependencies: + - carlet-2-def-2-derivative + - carlet-2-def-autocorrelation + - carlet-2-balanced-zero-walsh + - carlet-4-def-resiliency-correlation-immunity + + - id: carlet-4-def-linear-kernel + kind: definition + location: Carlet, p. 59 + statement: >- + ker_lin(f)={e | D_e f is constant} is an F_2-subspace of V_n; its + elements are the linear structures of f. + formal_status: formalized + declarations: + - CryptBoolean.IsLinearStructure + - CryptBoolean.isLinearStructure_zero + - CryptBoolean.booleanDerivative_add_direction + - CryptBoolean.IsLinearStructure.add + - CryptBoolean.IsLinearStructure.smul + - CryptBoolean.linearKernel + - CryptBoolean.mem_linearKernel + dependencies: + - carlet-2-def-2-derivative + + - id: carlet-4-prop-14 + kind: proposition + location: Carlet, Proposition 14, p. 59 + statement: >- + The function f has a nonzero linear structure iff it is linearly + equivalent to g(x_1,...,x_{n-1})+epsilon*x_n. The dimension-k form + separates k such affine coordinates. + formal_status: formalized + declarations: + - CryptBoolean.HasSeparatedLinearStructureNormalForm + - CryptBoolean.finrank_linearKernel_ge_iff_hasSeparatedLinearStructureNormalForm + - CryptBoolean.exists_nonzero_linearStructure_iff_exists_single_coordinate_normalForm + dependencies: + - carlet-4-def-linear-kernel + - carlet-2-def-affine-functions + + - id: carlet-4-linear-kernel-nonlinearity-bound + kind: corollary + location: Carlet, p. 59 + statement: >- + If dim ker_lin(f)=k, then + nl(f)<=2^(n-1)-2^((n+k-2)/2), with the displayed nonzero-structure + specialization. + formal_status: formalized + declarations: + - CryptBoolean.nonlinearity_cast_le_of_finrank_linearKernel_eq + - CryptBoolean.nonlinearity_cast_le_of_exists_nonzero_linearStructure + references: [40] + dependencies: + - carlet-4-prop-14 + - carlet-4-rel-36-covering-radius-bent + + - id: carlet-4-hyperplane-walsh-autocorrelation + kind: theorem + location: Carlet, pp. 59--60 + statement: >- + For e!=0, E={0,e}^perp and every a, the sum of W_f(u)^2 over a+E is + 2^(n-1)(2^n+(-1)^(a dot e) Delta_f(e)). + formal_status: formalized + declarations: + - CryptBoolean.walshHyperplane + - CryptBoolean.mem_walshHyperplane_iff + - CryptBoolean.natCard_walshHyperplane + - CryptBoolean.sum_walshTransform_sq_hyperplane_coset + dependencies: + - carlet-2-cor-1-poisson-summation + - carlet-2-rel-25-wiener-khinchin + + - id: carlet-4-prop-15 + kind: proposition + location: Carlet, Proposition 15, p. 60 + statement: >- + D_e f=0 iff supp(W_f) lies in {0,e}^perp, and D_e f=1 iff it lies in + the complementary coset. The stated balancedness and full-rank + consequences follow. + formal_status: formalized + declarations: + - CryptBoolean.walshSupport + - CryptBoolean.mem_walshSupport + - CryptBoolean.booleanDerivative_eq_zero_iff_walshSupport_subset_hyperplane + - CryptBoolean.booleanDerivative_eq_one_iff_walshSupport_subset_hyperplane_compl + - CryptBoolean.isBalanced_of_booleanDerivative_eq_one + - CryptBoolean.isLinearStructure_iff_booleanDerivative_eq_zero_of_not_balanced + - CryptBoolean.walshSupportSpan + - CryptBoolean.walshSupportRank + - CryptBoolean.no_nonzero_null_derivative_iff_walshSupportSpan_eq_top + - CryptBoolean.walshSupportRank_eq_n_iff + - CryptBoolean.no_nonzero_linearStructure_iff_walshSupportRank_eq_n_of_not_balanced + references: [42, 144, 226] + dependencies: + - carlet-4-hyperplane-walsh-autocorrelation + - carlet-4-def-linear-kernel + - carlet-2-def-walsh-transform + + - id: carlet-4-distance-to-linear-structures + kind: theorem + location: Carlet, p. 60 + statement: >- + For n>=2, the minimum distance from f to a function with a nonzero + linear structure is 2^(n-2)-(1/4)max_{e!=0}|Delta_f(e)|, with the + stated nonlinearity, universal, and bent consequences. + formal_status: formalized + declarations: + - CryptBoolean.HasNonzeroLinearStructure + - CryptBoolean.distanceToLinearStructures + - CryptBoolean.distanceToLinearStructures_le_hammingDistance + - CryptBoolean.exists_hammingDistance_eq_distanceToLinearStructures + - CryptBoolean.abs_autocorrelation_le_absoluteIndicator + - CryptBoolean.distanceToLinearStructures_cast_eq + - CryptBoolean.distanceToLinearStructures_le_nonlinearity + - CryptBoolean.distanceToLinearStructures_le_two_pow + - CryptBoolean.absoluteIndicator_eq_zero_iff_isBent + - CryptBoolean.distanceToLinearStructures_eq_two_pow_iff_isBent + references: [273] + dependencies: + - carlet-4-def-linear-kernel + - carlet-2-def-hamming-distance + - carlet-2-def-autocorrelation + - carlet-4-rel-36-covering-radius-bent + + - id: carlet-4-def-annihilator-algebraic-immunity + kind: definition + location: Carlet, pp. 61--62 + statement: >- + An annihilator of f is a nonzero g with fg=0. Algebraic immunity is + the least degree of a nonzero annihilator of f or f+1; the annihilator + ideal and affine-invariance statements are as displayed. + formal_status: formalized + declarations: + - CryptBoolean.support_mul + - CryptBoolean.booleanFunction_mul_self + - CryptBoolean.booleanFunction_mul_complement + - CryptBoolean.IsAnnihilator + - CryptBoolean.annihilatorIdeal + - CryptBoolean.mem_annihilatorIdeal_iff + - CryptBoolean.isAnnihilator_iff_mem_annihilatorIdeal + - CryptBoolean.IsAlgebraicImmunityWitness + - CryptBoolean.algebraicImmunityCandidates + - CryptBoolean.mem_algebraicImmunityCandidates + - CryptBoolean.algebraicImmunityCandidates_nonempty + - CryptBoolean.algebraicImmunity + - CryptBoolean.algebraicImmunity_le_functionAlgebraicDegree + - CryptBoolean.exists_witness_functionAlgebraicDegree_eq_algebraicImmunity + - CryptBoolean.IsAnnihilator.comp_affineEquiv + - CryptBoolean.IsAlgebraicImmunityWitness.comp_affineEquiv + - CryptBoolean.algebraicImmunity_comp_affineEquiv_le + - CryptBoolean.algebraicImmunity_comp_affineEquiv + references: [115] + dependencies: + - carlet-2-anf-existence-uniqueness + - carlet-2-def-algebraic-degree + - carlet-2-def-support-weight + + - id: carlet-4-low-degree-relation-equivalence + kind: theorem + location: Carlet, p. 62 + statement: >- + There exist g!=0 and h with degrees at most d and fg=h iff there is a + nonzero q of degree at most d annihilating f or f+1. + formal_status: formalized + declarations: + - CryptBoolean.exists_lowDegreeRelation_iff_exists_algebraicImmunityWitness + dependencies: + - carlet-4-def-annihilator-algebraic-immunity + + - id: carlet-4-annihilator-linear-system + kind: theorem + location: Carlet, p. 62 + statement: >- + A degree-at-most-d function g annihilates f iff its low-degree ANF + coefficient vector is in the kernel of evaluation on supp(f); this + system has sum_{i=0}^d C(n,i) unknowns and w_H(f) equations. + formal_status: formalized + declarations: + - CryptBoolean.extendLowDegreeCoefficients + - CryptBoolean.reedMullerAnfEquiv + - CryptBoolean.annihilatorEvaluationLinearMap + - CryptBoolean.mem_ker_annihilatorEvaluationLinearMap_iff + - CryptBoolean.annihilatorEvaluationLinearMap_domain_finrank + - CryptBoolean.annihilatorEvaluationLinearMap_codomain_finrank + dependencies: + - carlet-4-def-annihilator-algebraic-immunity + - carlet-2-anf-existence-uniqueness + - carlet-2-def-support-weight + + - id: carlet-4-ai-upper-bound + kind: theorem + location: Carlet, p. 62 and footnote 29 + statement: >- + Every n-variable Boolean function has AI(f)<=ceil(n/2), with the + displayed improvements for functions depending on k variables and for + a linear kernel of dimension n-k. + formal_status: formalized + declarations: + - CryptBoolean.functionAlgebraicDegree_affineMap_coordinate_le_one_general + - CryptBoolean.functionAlgebraicDegree_anfMonomial_comp_affineMap_le_card_general + - CryptBoolean.functionAlgebraicDegree_comp_affineMap_le_general + - CryptBoolean.algebraicImmunity_comp_surjectiveAffineMap_le + - CryptBoolean.algebraicImmunity_le_ceiling_half + - CryptBoolean.HasSurjectiveAffineFactorization + - CryptBoolean.algebraicImmunity_le_ceiling_half_of_hasSurjectiveAffineFactorization + - CryptBoolean.hasSurjectiveAffineFactorization_of_hasSeparatedLinearStructureNormalForm + - CryptBoolean.algebraicImmunity_le_ceiling_half_add_one_of_hasSeparatedLinearStructureNormalForm + - CryptBoolean.algebraicImmunity_le_ceiling_half_add_one_of_linearKernel_finrank_ge + references: [115] + dependencies: + - carlet-4-low-degree-relation-equivalence + - carlet-4-annihilator-linear-system + - carlet-4-prop-14 + + - id: carlet-4-fast-algebraic-optimality + kind: definition + location: Carlet, p. 63 + statement: >- + The dimension condition e+d>=n yields g!=0 and h with fg=h, + deg(g)<=e, and deg(h)<=d. Optimality against fast algebraic attacks is + the absence of such relations with deg(g)+deg(h)- + V(f)=sum_e Delta_f(e)^2 is the sum-of-squares indicator and + A(f)=max_{e!=0}|Delta_f(e)| is the absolute indicator; both are affine + invariants. + formal_status: formalized + declarations: + - CryptBoolean.sumOfSquaresIndicator + - CryptBoolean.absoluteIndicator + - CryptBoolean.booleanDerivative_comp_affineEquiv + - CryptBoolean.autocorrelation_comp_affineEquiv + - CryptBoolean.sumOfSquaresIndicator_comp_affineEquiv + - CryptBoolean.absoluteIndicator_comp_affineEquiv + - CryptBoolean.absoluteIndicator_zero_dimension + references: [354] + dependencies: + - carlet-2-def-autocorrelation + + - id: carlet-4-autocorrelation-indicator-bounds + kind: theorem + location: Carlet, pp. 64--65 + statement: >- + The indicators satisfy V(f)>=2^(2n), the displayed lower bound for + A(f) when n>0, the balanced-derivative equality criterion, and + V(f)>=2^(2n+k) when dim ker_lin(f)=k. + formal_status: formalized + declarations: + - CryptBoolean.autocorrelation_zero + - CryptBoolean.sumOfSquaresIndicator_lower_bound + - CryptBoolean.sumOfSquaresIndicator_eq_two_pow_iff + - CryptBoolean.absoluteIndicator_sq_lower_bound + - CryptBoolean.absoluteIndicator_lower_bound + - CryptBoolean.autocorrelation_sq_of_mem_linearKernel + - CryptBoolean.sumOfSquaresIndicator_lower_bound_linearKernel + - CryptBoolean.sumOfSquaresIndicator_lower_bound_of_finrank_eq + dependencies: + - carlet-4-def-autocorrelation-indicators + - carlet-4-def-linear-kernel + - carlet-2-balanced-zero-walsh + + - id: carlet-4-second-derivative-sum + kind: theorem + location: Carlet, p. 65 + statement: >- + V(f)=sum_{a,e} F(D_a D_e f), where the second derivative is the + four-term binary difference displayed by Carlet. + formal_status: formalized + declarations: + - CryptBoolean.secondBooleanDerivative + - CryptBoolean.secondBooleanDerivative_apply + - CryptBoolean.sumOfSquaresIndicator_eq_sum_secondBooleanDerivative + dependencies: + - carlet-4-def-autocorrelation-indicators + - carlet-2-rel-26-total-autocorrelation + + - id: carlet-4-rel-39-fourth-walsh-moment + kind: theorem + location: Carlet, Relation (39), pp. 65--66 + statement: >- + For every a, sum_e W_f(e)^2 W_f(a+e)^2 equals + 2^n sum_e Delta_f(e)^2(-1)^(e dot a); in particular the fourth Walsh + moment is 2^n V(f). + formal_status: formalized + declarations: + - CryptBoolean.sum_walshTransform_sq_mul_add_sq_eq + - CryptBoolean.sum_walshTransform_fourth_eq_two_pow_mul_sumOfSquaresIndicator + references: [41] + dependencies: + - carlet-4-def-autocorrelation-indicators + - carlet-2-rel-25-wiener-khinchin + - carlet-2-rel-22-plancherel + + - id: carlet-4-indicator-nonlinearity-spectral-support + kind: theorem + location: Carlet, pp. 65--66 + statement: >- + The stated fourth-moment bounds imply two nonlinearity bounds and + V(f) times the Walsh-support size is at least 2^(3n), with the plateaued + and bent equality characterizations. + formal_status: formalized + declarations: + - CryptBoolean.HasPlateauedWalshSpectrum + - CryptBoolean.abs_walshTransform_le_maxWalshMagnitude + - CryptBoolean.sum_walshTransform_fourth_le_sum_sq_mul_maxWalshMagnitude_sq + - CryptBoolean.sum_walshTransform_fourth_le_two_pow_mul_maxWalshMagnitude_fourth + - CryptBoolean.sumOfSquaresIndicator_div_two_pow_le_maxWalshMagnitude_sq + - CryptBoolean.sumOfSquaresIndicator_le_maxWalshMagnitude_fourth + - CryptBoolean.inv_sqrt_two_pow_mul_sqrt_sumOfSquaresIndicator_le_maxWalshMagnitude + - CryptBoolean.rpow_one_fourth_sumOfSquaresIndicator_le_maxWalshMagnitude + - CryptBoolean.nonlinearity_cast_le_sqrt_sumOfSquaresIndicator_bound + - CryptBoolean.nonlinearity_cast_le_fourthRoot_sumOfSquaresIndicator_bound + - CryptBoolean.sum_walshTransform_fourth_eq_sum_sq_mul_maxWalshMagnitude_sq_iff_plateaued + - CryptBoolean.sum_walshTransform_fourth_eq_two_pow_mul_maxWalshMagnitude_fourth_iff_flat + - CryptBoolean.nonlinearity_cast_eq_sqrt_sumOfSquaresIndicator_bound_iff_plateaued + - CryptBoolean.nonlinearity_cast_eq_fourthRoot_sumOfSquaresIndicator_bound_iff_bent + - CryptBoolean.two_pow_three_mul_n_le_sumOfSquaresIndicator_mul_card_walshSupport + - CryptBoolean.sumOfSquaresIndicator_mul_card_walshSupport_eq_two_pow_three_mul_n_iff_plateaued + references: [355, 358] + dependencies: + - carlet-4-def-nonlinearity + - carlet-4-rel-39-fourth-walsh-moment + - carlet-2-parseval + - carlet-2-spectral-support-bounds + - carlet-4-rel-36-covering-radius-bent + + - id: carlet-4-def-maximum-correlation + kind: definition + location: Carlet, pp. 66--67 + statement: >- + C_f(I) is the maximum normalized correlation with a function depending + only on I. It has the displayed distance and restriction formulas, and + vanishes exactly when all corresponding restrictions are balanced. + formal_status: formalized + declarations: + - CryptBoolean.CoordinateSignChoice + - CryptBoolean.coordinateBooleanFunction + - CryptBoolean.coordinateBooleanFunction_dependsOn + - CryptBoolean.exists_coordinateSignChoice_iff_dependsOn + - CryptBoolean.normalizedCorrelation + - CryptBoolean.normalizedCorrelation_eq_one_sub_two_mul_hammingDistance + - CryptBoolean.distanceToCoordinateFunctions + - CryptBoolean.maximumCorrelation + - CryptBoolean.distanceToCoordinateFunctions_cast_eq + - CryptBoolean.higherOrderNonlinearity_le_distanceToCoordinateFunctions + - CryptBoolean.restrictionMaximumCorrelation + - CryptBoolean.maximumCorrelation_eq_restrictionMaximumCorrelation + - CryptBoolean.restrictionRawImbalance + - CryptBoolean.maximumCorrelation_eq_sum_abs_restrictionRawImbalance_div_two_pow + - CryptBoolean.maximumCorrelation_eq_zero_iff_restrictions_balanced + references: [353] + dependencies: + - carlet-4-def-higher-order-nonlinearity + - carlet-4-def-resiliency-correlation-immunity + - carlet-2-balanced-zero-walsh + + - id: carlet-4-rel-40-maximum-correlation-bound + kind: theorem + location: Carlet, Relation (40), p. 66 + statement: >- + C_f(I) and the distance to functions depending on I satisfy the two + displayed Walsh-square and maximum-Walsh bounds. + formal_status: formalized + declarations: + - CryptBoolean.restrictedWalshSquareSum + - CryptBoolean.restrictedWalshSquareSum_eq_sum_filter + - CryptBoolean.two_pow_sq_mul_expect_restrictionMean_sq_eq_restrictedWalshSquareSum + - CryptBoolean.maximumCorrelation_le_sqrt_restrictedWalshSquareSum_div + - CryptBoolean.restrictedWalshSquareSum_le_card_mul_maxWalshMagnitude_sq + - CryptBoolean.sqrt_restrictedWalshSquareSum_le + - CryptBoolean.relation_40_maximumCorrelation_bound + - CryptBoolean.distanceToCoordinateFunctions_cast_ge_walshSquare + - CryptBoolean.distanceToCoordinateFunctions_cast_ge_maxWalshMagnitude + references: [37] + dependencies: + - carlet-4-def-maximum-correlation + - carlet-4-def-nonlinearity + - carlet-2-def-walsh-transform + - carlet-2-cor-1-poisson-summation + + - id: carlet-4-generalized-linear-structure-distance + kind: definition + location: Carlet, p. 67 + statement: >- + For 0<=k<=n, define the affine-invariant distance from f to the Boolean + functions g for which {e | D_e g=0} has dimension at least k. + formal_status: formalized + declarations: + - CryptBoolean.IsZeroDerivativeDirection + - CryptBoolean.zeroDerivativeKernel + - CryptBoolean.mem_zeroDerivativeKernel + - CryptBoolean.zeroDerivativeKernel_le_linearKernel + - CryptBoolean.zeroDerivativeKernelAffineEquiv + - CryptBoolean.finrank_zeroDerivativeKernel_comp_affineEquiv + - CryptBoolean.zeroDerivativeKernel_zero + - CryptBoolean.finrank_zeroDerivativeKernel_zero + - CryptBoolean.largeZeroDerivativeFunctions + - CryptBoolean.largeZeroDerivativeFunctions_nonempty + - CryptBoolean.generalizedLinearStructureDistance + - CryptBoolean.mem_largeZeroDerivativeFunctions_comp_affineEquiv_iff + - CryptBoolean.generalizedLinearStructureDistance_comp_affineEquiv_le + - CryptBoolean.generalizedLinearStructureDistance_comp_affineEquiv + references: [37] + dependencies: + - carlet-4-def-linear-kernel + - carlet-2-def-hamming-distance + + - id: carlet-4-other-complexity-definitions + kind: definition + location: Carlet, p. 67 + statement: >- + Algebraic thickness, normality, weak normality, and spectral complexity + are the affine-orbit, flat-restriction, and Walsh-support quantities + stated by Carlet. + formal_status: formalized + declarations: + - CryptBoolean.algebraicThickness + - CryptBoolean.exists_affineEquiv_anfSupport_card_eq_algebraicThickness + - CryptBoolean.IsConstantOnAffineFlat + - CryptBoolean.IsAffineOnAffineFlat + - CryptBoolean.IsConstantOnAffineFlat.isAffineOnAffineFlat + - CryptBoolean.normality + - CryptBoolean.weakNormality + - CryptBoolean.normality_le_weakNormality + - CryptBoolean.spectralComplexity + references: [65, 273, 299, 311] + dependencies: + - carlet-2-def-algebraic-degree + - carlet-2-affine-invariance + - carlet-2-spectral-support-bounds + + - id: carlet-4-kth-nonhomomorphicity + kind: theorem + location: Carlet, p. 67 + statement: >- + For even k with 4<=k<=2^n, NH_k(f) equals + 2^((k-1)n-1)+2^(-n-1) sum_u W_f(u)^k, with the stated affine maximum + and bent minimum characterizations. + formal_status: formalized + declarations: + - CryptBoolean.booleanTupleSum + - CryptBoolean.booleanTupleOutputSum + - CryptBoolean.kthNonhomomorphicity + - CryptBoolean.two_mul_two_pow_mul_kthNonhomomorphicity + - CryptBoolean.kthNonhomomorphicity_cast_eq_walshMoment + - CryptBoolean.kthNonhomomorphicity_cast_eq_carlet_formula + - CryptBoolean.IsAffineBooleanFunction + - CryptBoolean.isAffineBooleanFunction_iff_nonlinearity_eq_zero + - CryptBoolean.abs_walshTransform_le_two_pow + - CryptBoolean.sum_walshTransform_evenMoment_le + - CryptBoolean.kthNonhomomorphicity_affineFunction + - CryptBoolean.kthNonhomomorphicity_cast_le_max + - CryptBoolean.kthNonhomomorphicity_cast_eq_max_iff_isAffine + - CryptBoolean.carlet_kthNonhomomorphicity_cast_eq_max_iff_isAffine + - CryptBoolean.two_pow_pow_succ_le_sum_walshTransform_evenMoment + - CryptBoolean.sum_walshTransform_evenMoment_eq_min_iff_isBent + - CryptBoolean.kthNonhomomorphicity_cast_min_le + - CryptBoolean.kthNonhomomorphicity_cast_eq_min_iff_isBent + - CryptBoolean.carlet_kthNonhomomorphicity_cast_eq_min_iff_isBent + fidelity_note: >- + The implementation follows Carlet's name for the zero-sum/even-output + tuple count. Reference [357] calls that same count homomorphicity and + reserves nonhomomorphicity for the complementary odd-output count. + references: [357] + dependencies: + - carlet-2-def-walsh-transform + - carlet-2-parseval + - carlet-4-rel-36-covering-radius-bent + + - id: carlet-4-affine-reindex-first-resilient + kind: theorem + location: Carlet, concluding paragraph, p. 68 + statement: >- + If f is balanced and its zero-Walsh set contains n linearly independent + vectors, then some linear automorphism L makes f composed with L + 1-resilient. + formal_status: formalized + declarations: + - CryptBoolean.walshCoordinateLinearMap + - CryptBoolean.walshCoordinateLinearMap_injective + - CryptBoolean.walshReindexLinearEquiv + - CryptBoolean.bentDualFrequency_walshReindexLinearEquiv_single + - CryptBoolean.walshTransform_linearReindex_cast + - CryptBoolean.bentDualFrequency_zero + - CryptBoolean.isBalanced_linearReindex + - CryptBoolean.exists_linearEquiv_isResilient_one + dependencies: + - carlet-4-theorem-3 + - carlet-4-resiliency-translation-invariance + - carlet-2-def-affine-functions diff --git a/AGENTS.md b/AGENTS.md index e0db263..445a90e 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -28,8 +28,8 @@ node and production declaration. ## Current verified surface -The Blueprint baseline is 43 source-facing statement nodes: 41 formalized nodes associated with 180 -proved Lean declarations and 2 visibly open nodes, connected by 64 reviewed dependency edges. +The Blueprint baseline is 116 source-facing statement nodes: 115 formalized nodes associated with +759 proved Lean declarations and 1 visibly open node, connected by 223 reviewed dependency edges. - Chapter 2 contributes 36 nodes (35 formalized and 1 open), 159 declarations, and 45 incoming edges. It covers the scalar @@ -38,15 +38,26 @@ proved Lean declarations and 2 visibly open nodes, connected by 64 reviewed depe pseudo-Boolean Fourier operations, the full raw Poisson formula, derivatives, autocorrelation, finite-field trace and representation, distance scaling, affine invariance, restriction recovery, and spectral-support bounds. -- Chapter 3 contributes 7 nodes (6 formalized and 1 open), 21 declarations, and 19 incoming edges. - It defines `reedMuller r n` and proves the affine-weight theorem, general-order distance theorem, - dimension and cardinality formulas, and duality. -- The only open Chapter 2 node is Carlet Proposition 3 on the algebraic degree of trace monomials. +- Chapter 3 contributes 7 formalized nodes, 32 declarations, and 19 incoming edges. It defines + `reedMuller r n` and proves the affine-weight theorem, general-order distance theorem, + Proposition 12's minimum-weight affine-flat classification, dimension and cardinality formulas, + and duality. +- Chapter 4 contributes 73 formalized nodes, 568 declarations, and 159 incoming edges. Its compiled + surface covers the reviewed finite theory of nonlinearity, higher-order nonlinearity, resiliency + and propagation, linear structures, algebraic immunity, autocorrelation, maximum correlation, + and related complexity criteria, including the sharp random-nonlinearity interval, the exact + dimension-seven maximum, and the sharp fixed-order higher-order asymptotic upper bound. +- The sole open Chapter 2 node is Carlet Proposition 3 on the algebraic degree of trace monomials. It requires a finite-field coordinate bridge identifying coordinate ANF degree with maximum binary exponent weight and a cyclotomic-orbit noncancellation theorem. -- The only open Chapter 3 node is Carlet Proposition 12's minimum-weight equality classification. - It requires an arbitrary affine-flat normal form, the codimension--degree theorem for affine-flat - indicators, and equality-case slice infrastructure. +- Chapter 4 has no open source node. Its higher-order closure composes the moment-ratio reduction, + dual-code weight decomposition, exact weight-`16` rank-seven classification, character-sum + estimate, and finite Plotkin induction; these remain separate formalized nodes so that the proof + structure is visible in the Blueprint. +- Carlet's Reed--Muller coset-distance equality is formalized with the necessary pairwise-distinct- + coset hypothesis; the two-coset corollary assumes a non-affine representative. The formalized + `k`th nonhomomorphicity count follows Carlet's even-output naming while recording reference + [357]'s opposite convention. These counts must agree with `blueprint-verso/scripts/validate_manifest.py`. Update the validator, inventory, Verso nodes, and this baseline together whenever verified coverage changes. @@ -96,6 +107,9 @@ Stream-cipher, block-cipher, AES, and Boolean Cayley-graph results require their - The hourly FABL updater (and its release-dispatch entry point) changes the exact pin through a pull request, resolves both manifests, and merges only after the complete cloud CI succeeds. - Search pinned FABL and Mathlib before adding a local type, definition, theorem, or proof helper. +- Pinned FABL `v0.5.6` canonically owns the ANF, algebraic-degree, affine-function, and derivative + APIs used by CryptBoolean. Import them directly and add only source-facing or representation + bridges required by Carlet statements. - Local declarations must express cryptographic concepts, representation bridges, or proof lemmas used by a production theorem. - Carlet's Walsh transform is an unnormalized integer sum. FABL's `vectorFourierCoeff` is a diff --git a/CryptBoolean.lean b/CryptBoolean.lean index 9e62a6a..26b687f 100644 --- a/CryptBoolean.lean +++ b/CryptBoolean.lean @@ -8,6 +8,7 @@ module public import CryptBoolean.Bridge.FABL public import CryptBoolean.Carlet.Chapter02 public import CryptBoolean.Carlet.Chapter03 +public import CryptBoolean.Carlet.Chapter04 /-! # CryptBoolean diff --git a/CryptBoolean/Carlet/Chapter03.lean b/CryptBoolean/Carlet/Chapter03.lean index a40ed5e..917be24 100644 --- a/CryptBoolean/Carlet/Chapter03.lean +++ b/CryptBoolean/Carlet/Chapter03.lean @@ -6,6 +6,9 @@ Authors: Asher Yan with Codex module public import CryptBoolean.Carlet.Chapter03.ReedMuller +public import CryptBoolean.Carlet.Chapter03.ReedMullerMinimumWeight +public import CryptBoolean.Carlet.Chapter03.ReedMullerLowWeightSpectrum +public import CryptBoolean.Carlet.Chapter03.ReedMullerLowWeightAffineSpan public import CryptBoolean.Carlet.Chapter03.ReedMullerDuality /-! diff --git a/CryptBoolean/Carlet/Chapter03/ReedMuller.lean b/CryptBoolean/Carlet/Chapter03/ReedMuller.lean index 9b420fa..21052ed 100644 --- a/CryptBoolean/Carlet/Chapter03/ReedMuller.lean +++ b/CryptBoolean/Carlet/Chapter03/ReedMuller.lean @@ -61,12 +61,15 @@ private theorem anfCoeff_anfEval (c : ANFCoefficients n) : apply anfEval_injective rw [anfEval_anfCoeff] -private noncomputable def extendLowDegreeCoefficients +/-- Extend a low-degree coefficient vector by zero to all square-free monomials. -/ +noncomputable def extendLowDegreeCoefficients (r n : ℕ) (c : ↥(FABL.lowDegreeFourierFamily n r) → FABL.𝔽₂) : ANFCoefficients n := fun S ↦ if hS : S ∈ FABL.lowDegreeFourierFamily n r then c ⟨S, hS⟩ else 0 -private noncomputable def reedMullerAnfEquiv (r n : ℕ) : +/-- The canonical linear equivalence between a Reed--Muller word and its low-degree ANF +coefficient vector. -/ +noncomputable def reedMullerAnfEquiv (r n : ℕ) : reedMuller r n ≃ₗ[FABL.𝔽₂] (↥(FABL.lowDegreeFourierFamily n r) → FABL.𝔽₂) where toFun f S := anfCoeff f.1 S.1 invFun c := diff --git a/CryptBoolean/Carlet/Chapter03/ReedMullerDuality.lean b/CryptBoolean/Carlet/Chapter03/ReedMullerDuality.lean index d8f09b3..8799a98 100644 --- a/CryptBoolean/Carlet/Chapter03/ReedMullerDuality.lean +++ b/CryptBoolean/Carlet/Chapter03/ReedMullerDuality.lean @@ -34,6 +34,40 @@ def booleanFunctionPairing (n : ℕ) : booleanFunctionPairing n f g = ∑ x, f x * g x := rfl +/-- The binary cast of a support-intersection cardinality is the standard +Boolean-function pairing. -/ +theorem card_support_inter_cast (f g : BooleanFunction n) : + (((support f ∩ support g).card : ℕ) : FABL.𝔽₂) = + ∑ x, f x * g x := by + classical + have hinter : + support f ∩ support g = + Finset.univ.filter fun x : FABL.F₂Cube n ↦ f x = 1 ∧ g x = 1 := by + ext x + simp [mem_support] + rw [hinter, Finset.card_filter] + push_cast + apply Finset.sum_congr rfl + intro x _hx + by_cases hf : f x = 0 + · simp [hf] + · have hf_one : f x = 1 := Fin.eq_one_of_ne_zero _ hf + by_cases hg : g x = 0 + · simp [hf_one, hg] + · have hg_one : g x = 1 := Fin.eq_one_of_ne_zero _ hg + simp [hf_one, hg_one] + +/-- Orthogonality of two Boolean functions is equivalent to even overlap of +their supports in the direction needed below. -/ +theorem even_card_support_inter_of_pairing_eq_zero + (f g : BooleanFunction n) + (hpair : booleanFunctionPairing n f g = 0) : + Even (support f ∩ support g).card := by + rw [booleanFunctionPairing_apply] at hpair + apply ZMod.natCast_eq_zero_iff_even.mp + rw [card_support_inter_cast] + exact hpair + /-- The standard binary pairing on Boolean functions is nondegenerate. -/ theorem booleanFunctionPairing_nondegenerate : (booleanFunctionPairing n).Nondegenerate := by diff --git a/CryptBoolean/Carlet/Chapter03/ReedMullerLowWeightAffineSpan.lean b/CryptBoolean/Carlet/Chapter03/ReedMullerLowWeightAffineSpan.lean new file mode 100644 index 0000000..ab41f06 --- /dev/null +++ b/CryptBoolean/Carlet/Chapter03/ReedMullerLowWeightAffineSpan.lean @@ -0,0 +1,362 @@ +/- +Copyright (c) 2026 Asher Yan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Asher Yan with Codex +-/ +module + +public import CryptBoolean.Carlet.Chapter03.ReedMullerDuality +public import FABL.Chapter03.SubspacesAndDecisionTrees.Subspaces +public import Mathlib.LinearAlgebra.FiniteDimensional.Lemmas + +/-! +# Affine-span control for low-weight dual Reed--Muller words + +After translating one support point to zero and deleting that zero column, +evaluation of ambient linear forms produces a self-orthogonal binary code of +length one less than the Hamming weight. Its dimension is the affine-span +dimension of the support. +-/ + +open Finset +open scoped BigOperators BooleanCube + +@[expose] public section + +namespace CryptBoolean + +variable {n : ℕ} + +/-- A canonical finite enumeration of the support after deleting one chosen +basepoint. -/ +noncomputable def supportAwayEquiv + (h : BooleanFunction n) (p : FABL.F₂Cube n) : + Fin ((support h).erase p).card ≃ + {x // x ∈ (support h).erase p} := + Fintype.equivOfCardEq (by + rw [Fintype.card_fin, Fintype.card_coe]) + +/-- Evaluation of an ambient linear form on the non-basepoint support +differences of a Boolean function. -/ +noncomputable def supportDifferenceEvaluation + (h : BooleanFunction n) (p : FABL.F₂Cube n) : + FABL.F₂Cube n →ₗ[FABL.𝔽₂] + FABL.F₂Cube ((support h).erase p).card where + toFun a j := FABL.f₂DotProduct a ((supportAwayEquiv h p j).1 + p) + map_add' a b := by + funext j + simp only [FABL.f₂DotProduct, add_dotProduct, Pi.add_apply] + map_smul' c a := by + funext j + simp only [FABL.f₂DotProduct, smul_dotProduct, Pi.smul_apply, + RingHom.id_apply] + +@[simp] theorem supportDifferenceEvaluation_apply + (h : BooleanFunction n) (p a : FABL.F₂Cube n) + (j : Fin ((support h).erase p).card) : + supportDifferenceEvaluation h p a j = + FABL.f₂DotProduct a ((supportAwayEquiv h p j).1 + p) := + rfl + +/-- The direction space canonically recovered from the support-difference +evaluation map. -/ +noncomputable def supportDifferenceSpan + (h : BooleanFunction n) (p : FABL.F₂Cube n) : + Submodule FABL.𝔽₂ (FABL.F₂Cube n) := + FABL.perpendicularSubspace (LinearMap.ker (supportDifferenceEvaluation h p)) + +/-- The support differences away from a chosen basepoint. -/ +def supportDifferences + (h : BooleanFunction n) (p : FABL.F₂Cube n) : + Set (FABL.F₂Cube n) := + {v | ∃ x ∈ (support h).erase p, v = x + p} + +/-- The recovered support-difference space is exactly the linear span of the +actual support differences. -/ +theorem supportDifferenceSpan_eq_span_supportDifferences + (h : BooleanFunction n) (p : FABL.F₂Cube n) : + supportDifferenceSpan h p = + Submodule.span FABL.𝔽₂ (supportDifferences h p) := by + classical + have hker : + LinearMap.ker (supportDifferenceEvaluation h p) = + FABL.perpendicularSubspace + (Submodule.span FABL.𝔽₂ (supportDifferences h p)) := by + ext a + rw [LinearMap.mem_ker, FABL.mem_perpendicularSubspace_iff] + constructor + · intro ha v hv + have hspanLe : + Submodule.span FABL.𝔽₂ (supportDifferences h p) ≤ + LinearMap.ker (FABL.f₂DotProductBilin n a) := by + rw [Submodule.span_le] + intro w hw + obtain ⟨x, hx, rfl⟩ := hw + let xAway : {y // y ∈ (support h).erase p} := ⟨x, hx⟩ + let j : Fin ((support h).erase p).card := + (supportAwayEquiv h p).symm xAway + have hj := congrFun ha j + have hpoint : (supportAwayEquiv h p j).1 = x := by + change ((supportAwayEquiv h p) + ((supportAwayEquiv h p).symm xAway)).1 = x + rw [Equiv.apply_symm_apply] + change FABL.f₂DotProductBilin n a (x + p) = 0 + simpa only [FABL.f₂DotProductBilin_apply, + supportDifferenceEvaluation_apply, Pi.zero_apply, hpoint] using hj + exact LinearMap.mem_ker.mp (hspanLe hv) + · intro ha + funext j + have hgenerator : + (supportAwayEquiv h p j).1 + p ∈ supportDifferences h p := by + exact ⟨(supportAwayEquiv h p j).1, + (supportAwayEquiv h p j).2, rfl⟩ + have hspan : + (supportAwayEquiv h p j).1 + p ∈ + Submodule.span FABL.𝔽₂ (supportDifferences h p) := + Submodule.subset_span hgenerator + simpa only [supportDifferenceEvaluation_apply, Pi.zero_apply] using + ha ((supportAwayEquiv h p j).1 + p) hspan + rw [supportDifferenceSpan, hker, + FABL.perpendicularSubspace_perpendicularSubspace] + +/-- If the support-difference span has dimension `r`, then `r` actual +support differences form a basis of that span. -/ +theorem exists_supportDifferenceBasis_of_finrank_eq + (h : BooleanFunction n) (p : FABL.F₂Cube n) {r : ℕ} + (hrank : Module.finrank FABL.𝔽₂ + (supportDifferenceSpan h p) = r) : + ∃ v : Fin r → FABL.F₂Cube n, + (∀ i, v i ∈ supportDifferences h p) ∧ + Submodule.span FABL.𝔽₂ (Set.range v) = + supportDifferenceSpan h p ∧ + LinearIndependent FABL.𝔽₂ v := by + rw [supportDifferenceSpan_eq_span_supportDifferences] at hrank ⊢ + have hex := Submodule.exists_fun_fin_finrank_span_eq + FABL.𝔽₂ (supportDifferences h p) + rw [hrank] at hex + exact hex + +/-- Every support point lies in the affine flat through the chosen basepoint +with direction `supportDifferenceSpan`. -/ +theorem support_subset_binaryAffineSubspace_supportDifferenceSpan + (h : BooleanFunction n) (p : FABL.F₂Cube n) : + (support h : Set (FABL.F₂Cube n)) ⊆ + FABL.binaryAffineSubspace (supportDifferenceSpan h p) p := by + intro x hx + change x ∈ FABL.binaryAffineSubspace (supportDifferenceSpan h p) p + rw [FABL.mem_binaryAffineSubspace_iff_add_mem] + rw [supportDifferenceSpan, FABL.mem_perpendicularSubspace_iff] + intro a ha + rw [LinearMap.mem_ker] at ha + by_cases hxp : x = p + · subst x + rw [ZModModule.add_self] + simp [FABL.f₂DotProduct, dotProduct] + · let xAway : {y // y ∈ (support h).erase p} := + ⟨x, Finset.mem_erase.mpr ⟨hxp, hx⟩⟩ + let j : Fin ((support h).erase p).card := + (supportAwayEquiv h p).symm xAway + have hxzero := congrFun ha j + have hxzero' : FABL.f₂DotProduct a (x + p) = 0 := by + have hj : (supportAwayEquiv h p j).1 = x := by + change ((supportAwayEquiv h p) + ((supportAwayEquiv h p).symm xAway)).1 = x + rw [Equiv.apply_symm_apply] + simpa only [supportDifferenceEvaluation_apply, Pi.zero_apply, + hj] using hxzero + rw [show FABL.f₂DotProduct (x + p) a = + FABL.f₂DotProduct a (x + p) by exact dotProduct_comm _ _] + exact hxzero' + +/-- The recovered support-difference span has the same dimension as the +range of its evaluation map. -/ +theorem finrank_supportDifferenceSpan_eq_finrank_range + (h : BooleanFunction n) (p : FABL.F₂Cube n) : + Module.finrank FABL.𝔽₂ (supportDifferenceSpan h p) = + Module.finrank FABL.𝔽₂ + (LinearMap.range (supportDifferenceEvaluation h p)) := by + rw [supportDifferenceSpan, FABL.finrank_perpendicularSubspace] + have hrank := (supportDifferenceEvaluation h p).finrank_range_add_finrank_ker + have htotal : Module.finrank FABL.𝔽₂ (FABL.F₂Cube n) = n := by + rw [Module.finrank_fintype_fun_eq_card] + simp + rw [htotal] at hrank + omega + +/-- The affine linear form whose value at `x` is the dot product with the +translated point `x + p`. -/ +noncomputable def translatedLinearBooleanFunction + (p a : FABL.F₂Cube n) : BooleanFunction n := + FABL.affineFunction (FABL.f₂DotProduct a p) a + +@[simp] theorem translatedLinearBooleanFunction_apply + (p a x : FABL.F₂Cube n) : + translatedLinearBooleanFunction p a x = + FABL.f₂DotProduct a (x + p) := by + simp only [translatedLinearBooleanFunction, FABL.affineFunction, + FABL.f₂DotProduct, dotProduct_add] + ac_rfl + +/-- A product of two translated linear forms belongs to `RM(2,n)`. -/ +theorem translatedLinearBooleanFunction_mul_mem_reedMuller_two + (p a b : FABL.F₂Cube n) : + translatedLinearBooleanFunction p a * + translatedLinearBooleanFunction p b ∈ + reedMuller 2 n := by + rw [mem_reedMuller_iff] + have ha : FABL.functionAlgebraicDegree + (translatedLinearBooleanFunction p a) ≤ 1 := by + simpa only [translatedLinearBooleanFunction, mem_reedMuller_iff] using + (affineFunction_mem_reedMuller_one + (FABL.f₂DotProduct a p) a) + have hb : FABL.functionAlgebraicDegree + (translatedLinearBooleanFunction p b) ≤ 1 := by + simpa only [translatedLinearBooleanFunction, mem_reedMuller_iff] using + (affineFunction_mem_reedMuller_one + (FABL.f₂DotProduct b p) b) + exact (FABL.functionAlgebraicDegree_mul_le_add _ _).trans (by omega) + +/-- The dot product of two support-difference evaluation words is the +pairing of the original word with the corresponding quadratic function. -/ +theorem dotProduct_supportDifferenceEvaluation_eq_pairing + (h : BooleanFunction n) (p : FABL.F₂Cube n) (hp : p ∈ support h) + (a b : FABL.F₂Cube n) : + dotProduct (supportDifferenceEvaluation h p a) + (supportDifferenceEvaluation h p b) = + booleanFunctionPairing n + (translatedLinearBooleanFunction p a * + translatedLinearBooleanFunction p b) h := by + classical + rw [booleanFunctionPairing_apply] + let q : BooleanFunction n := + translatedLinearBooleanFunction p a * + translatedLinearBooleanFunction p b + rw [dotProduct] + simp only [supportDifferenceEvaluation_apply, + ← translatedLinearBooleanFunction_apply] + change + (∑ j : Fin ((support h).erase p).card, + q ((supportAwayEquiv h p j).1)) = + ∑ x : FABL.F₂Cube n, q x * h x + calc + (∑ j : Fin ((support h).erase p).card, + q ((supportAwayEquiv h p j).1)) = + ∑ x : {x // x ∈ (support h).erase p}, q x.1 := by + exact Fintype.sum_equiv (supportAwayEquiv h p) + (fun j ↦ q ((supportAwayEquiv h p j).1)) + (fun x ↦ q x.1) (fun _j ↦ rfl) + _ = ∑ x ∈ (support h).erase p, q x := by + symm + exact Finset.sum_subtype ((support h).erase p) + (fun x ↦ by simp) (fun x ↦ q x) + _ = ∑ x ∈ support h, q x := by + have hdecomp := Finset.sum_erase_add + (s := support h) (f := fun x ↦ q x) hp + have hqp : q p = 0 := by + simp [q, translatedLinearBooleanFunction_apply, + ZModModule.add_self, FABL.f₂DotProduct, dotProduct] + simpa only [hqp, add_zero] using hdecomp + _ = ∑ x : FABL.F₂Cube n, q x * h x := by + rw [support, FABL.f₂OneSupport, Finset.sum_filter] + apply Finset.sum_congr rfl + intro x _hx + by_cases hx : h x = 1 + · simp [hx] + · have hxzero : h x = 0 := by + by_contra hne + exact hx (Fin.eq_one_of_ne_zero _ hne) + simp [hxzero] + +/-- For a word orthogonal to `RM(2,n)`, the support-difference evaluation +code is self-orthogonal. -/ +theorem range_supportDifferenceEvaluation_le_perpendicular + (h : BooleanFunction n) (p : FABL.F₂Cube n) (hp : p ∈ support h) + (hdual : h ∈ reedMullerDual 2 n) : + LinearMap.range (supportDifferenceEvaluation h p) ≤ + FABL.perpendicularSubspace + (LinearMap.range (supportDifferenceEvaluation h p)) := by + intro y hy + rw [FABL.mem_perpendicularSubspace_iff] + intro z hz + obtain ⟨a, rfl⟩ := hy + obtain ⟨b, rfl⟩ := hz + change dotProduct (supportDifferenceEvaluation h p a) + (supportDifferenceEvaluation h p b) = 0 + rw [dotProduct_supportDifferenceEvaluation_eq_pairing h p hp] + rw [reedMullerDual, + LinearMap.BilinForm.mem_orthogonal_iff] at hdual + exact hdual + (translatedLinearBooleanFunction p a * + translatedLinearBooleanFunction p b) + (translatedLinearBooleanFunction_mul_mem_reedMuller_two p a b) + +/-- Deleting the translated zero column makes the standard +self-orthogonal-code bound sharp enough: twice the affine-span dimension is +at most one less than the Hamming weight. -/ +theorem two_mul_finrank_supportDifferenceSpan_le_hammingWeight_sub_one + (h : BooleanFunction n) (p : FABL.F₂Cube n) (hp : p ∈ support h) + (hdual : h ∈ reedMullerDual 2 n) : + 2 * Module.finrank FABL.𝔽₂ (supportDifferenceSpan h p) ≤ + hammingWeight h - 1 := by + have hself := range_supportDifferenceEvaluation_le_perpendicular + h p hp hdual + have hfinrank := Submodule.finrank_mono hself + rw [FABL.finrank_perpendicularSubspace] at hfinrank + have hrange := finrank_supportDifferenceSpan_eq_finrank_range h p + have hcard := Finset.card_erase_add_one hp + rw [hammingWeight_eq_card_support] + omega + +/-- Codimension-three Reed--Muller membership supplies the orthogonality +hypothesis in the affine-span bound. -/ +theorem two_mul_finrank_supportDifferenceSpan_le_of_mem_codimension_three + (h : BooleanFunction n) (p : FABL.F₂Cube n) (hp : p ∈ support h) + (hn : 3 ≤ n) (hmem : h ∈ reedMuller (n - 3) n) : + 2 * Module.finrank FABL.𝔽₂ (supportDifferenceSpan h p) ≤ + hammingWeight h - 1 := by + have hdual : h ∈ reedMullerDual 2 n := by + rw [reedMullerDual_eq (r := 2) (n := n) (by omega)] + simpa only [show n - 2 - 1 = n - 3 by omega] using hmem + exact two_mul_finrank_supportDifferenceSpan_le_hammingWeight_sub_one + h p hp hdual + +/-- A weight-twelve codimension-three word is contained in an affine flat of +dimension at most five. -/ +theorem finrank_supportDifferenceSpan_le_five_of_weight_twelve + (h : BooleanFunction n) (p : FABL.F₂Cube n) (hp : p ∈ support h) + (hn : 3 ≤ n) (hmem : h ∈ reedMuller (n - 3) n) + (hweight : hammingWeight h = 12) : + Module.finrank FABL.𝔽₂ (supportDifferenceSpan h p) ≤ 5 := by + have hbound := + two_mul_finrank_supportDifferenceSpan_le_of_mem_codimension_three + h p hp hn hmem + rw [hweight] at hbound + omega + +/-- A weight-fourteen codimension-three word is contained in an affine flat +of dimension at most six. -/ +theorem finrank_supportDifferenceSpan_le_six_of_weight_fourteen + (h : BooleanFunction n) (p : FABL.F₂Cube n) (hp : p ∈ support h) + (hn : 3 ≤ n) (hmem : h ∈ reedMuller (n - 3) n) + (hweight : hammingWeight h = 14) : + Module.finrank FABL.𝔽₂ (supportDifferenceSpan h p) ≤ 6 := by + have hbound := + two_mul_finrank_supportDifferenceSpan_le_of_mem_codimension_three + h p hp hn hmem + rw [hweight] at hbound + omega + +/-- A weight-sixteen codimension-three word is contained in an affine flat +of dimension at most seven. -/ +theorem finrank_supportDifferenceSpan_le_seven_of_weight_sixteen + (h : BooleanFunction n) (p : FABL.F₂Cube n) (hp : p ∈ support h) + (hn : 3 ≤ n) (hmem : h ∈ reedMuller (n - 3) n) + (hweight : hammingWeight h = 16) : + Module.finrank FABL.𝔽₂ (supportDifferenceSpan h p) ≤ 7 := by + have hbound := + two_mul_finrank_supportDifferenceSpan_le_of_mem_codimension_three + h p hp hn hmem + rw [hweight] at hbound + omega + +end CryptBoolean diff --git a/CryptBoolean/Carlet/Chapter03/ReedMullerLowWeightSpectrum.lean b/CryptBoolean/Carlet/Chapter03/ReedMullerLowWeightSpectrum.lean new file mode 100644 index 0000000..780e81c --- /dev/null +++ b/CryptBoolean/Carlet/Chapter03/ReedMullerLowWeightSpectrum.lean @@ -0,0 +1,256 @@ +/- +Copyright (c) 2026 Asher Yan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Asher Yan with Codex +-/ +module + +public import CryptBoolean.Carlet.Chapter03.ReedMullerDuality +public import CryptBoolean.Carlet.Chapter03.ReedMullerMinimumWeight + +/-! +# A low-weight restriction for codimension-three Reed--Muller codes + +The weight-ten exclusion needed by the Carlet--Mesnager moment argument. +The proof is the codimension-three instance of the Kasami--Tokura low-weight +restriction, obtained directly from the Plotkin slices and the affine-flat +classification of minimum-weight words. +-/ + +open Finset +open scoped BigOperators BooleanCube + +@[expose] public section + +namespace CryptBoolean + +variable {n : ℕ} + +/-- A Boolean function of non-full algebraic degree has even Hamming +weight. -/ +theorem even_hammingWeight_of_degree_lt_dimension + (f : BooleanFunction n) + (hdegree : FABL.functionAlgebraicDegree f < n) : + Even (hammingWeight f) := by + rw [hammingWeight_eq_card_support] + apply Nat.not_odd_iff_even.mp + intro hodd + have hfull := + (FABL.functionAlgebraicDegree_eq_dimension_iff_card_f₂OneSupport_odd + f (by omega)).2 (by + simpa only [support, FABL.f₂OneSupport] using hodd) + omega + +private theorem support_inter_firstCoordinateSlices_eq_singleton_separator + {m : ℕ} (u w v : BooleanFunction m) + (hvu : v = u + w) + (p : FABL.F₂Cube m) + (hp : support u ∩ support w = {p}) + (H : Submodule FABL.𝔽₂ (FABL.F₂Cube m)) + (a : FABL.F₂Cube m) + (hsupport : (support v : Set (FABL.F₂Cube m)) = + FABL.binaryAffineSubspace H a) : + ∃ ell : BooleanFunction m, + ell ∈ reedMuller 1 m ∧ support u ∩ support ell = {p} := by + have hpInter : p ∈ support u ∩ support w := by + rw [hp] + simp + have hpData := Finset.mem_inter.mp hpInter + have hpu : u p = 1 := (mem_support u p).mp hpData.1 + have hpw : w p = 1 := (mem_support w p).mp hpData.2 + have hpv : v p = 0 := by + rw [hvu, Pi.add_apply, hpu, hpw] + exact CharTwo.add_self_eq_zero 1 + have hpNotMem : p ∉ FABL.binaryAffineSubspace H a := by + intro hpA + have hpSupport : p ∈ (support v : Set (FABL.F₂Cube m)) := by + rw [hsupport] + exact hpA + have hpOne := (mem_support v p).mp hpSupport + exact zero_ne_one (hpv.symm.trans hpOne) + have hpParity := + not_congr + (FABL.mem_binaryAffineSubspace_iff_forall_perpendicular_parity + H a p) |>.mp hpNotMem + push Not at hpParity + obtain ⟨gamma, hgamma, hgammaNe⟩ := hpParity + let ell : BooleanFunction m := + FABL.affineFunction (FABL.f₂DotProduct gamma a) gamma + have hellMem : ell ∈ reedMuller 1 m := by + exact affineFunction_mem_reedMuller_one _ _ + have hellZero {x : FABL.F₂Cube m} + (hx : x ∈ FABL.binaryAffineSubspace H a) : ell x = 0 := by + have hxParity := + (FABL.mem_binaryAffineSubspace_iff_forall_perpendicular_parity + H a x).mp hx gamma hgamma + simp only [ell, FABL.affineFunction] + rw [hxParity] + exact CharTwo.add_self_eq_zero _ + have hellP : ell p = 1 := by + simp only [ell, FABL.affineFunction] + apply Fin.eq_one_of_ne_zero + intro hzero + apply hgammaNe + have heq := add_eq_zero_iff_eq_neg.mp hzero + exact (heq.trans + (ZMod.neg_eq_self_mod_two (FABL.f₂DotProduct gamma p))).symm + refine ⟨ell, hellMem, ?_⟩ + ext x + constructor + · intro hx + have hxData := Finset.mem_inter.mp hx + have hxu : u x = 1 := (mem_support u x).mp hxData.1 + have hxell : ell x = 1 := (mem_support ell x).mp hxData.2 + have hxNotAffine : x ∉ FABL.binaryAffineSubspace H a := by + intro hxAffine + have hxzero := hellZero hxAffine + exact zero_ne_one (hxzero.symm.trans hxell) + have hxv : v x = 0 := by + by_contra hxne + have hxone : v x = 1 := Fin.eq_one_of_ne_zero _ hxne + have hxSupport : x ∈ (support v : Set (FABL.F₂Cube m)) := + (mem_support v x).mpr hxone + rw [hsupport] at hxSupport + exact hxNotAffine hxSupport + have hxw : w x = 1 := by + rw [hvu, Pi.add_apply, hxu] at hxv + have heq := add_eq_zero_iff_eq_neg.mp hxv + exact (heq.trans (ZMod.neg_eq_self_mod_two (w x))).symm + have hxPair : x ∈ support u ∩ support w := + Finset.mem_inter.mpr + ⟨(mem_support u x).mpr hxu, (mem_support w x).mpr hxw⟩ + rw [hp] at hxPair + exact hxPair + · intro hx + have hxp : x = p := by simpa using hx + subst x + exact Finset.mem_inter.mpr + ⟨hpData.1, (mem_support ell p).mpr hellP⟩ + +/-- The codimension-three Reed--Muller code has no word of Hamming weight +ten. This is the only Kasami--Tokura weight-spectrum exclusion needed by the +seventh/eighth moment comparison. -/ +theorem hammingWeight_ne_ten_of_mem_reedMuller_codimension_three + (h : BooleanFunction n) (hn : 3 ≤ n) + (hmem : h ∈ reedMuller (n - 3) n) : + hammingWeight h ≠ 10 := by + induction n using Nat.strong_induction_on with + | h n ih => + intro hweight + by_cases hnThree : n = 3 + · subst n + have hupper : hammingWeight h ≤ 2 ^ 3 := by + rw [hammingWeight_eq_card_support, ← card_f₂Cube 3] + exact Finset.card_le_card (Finset.subset_univ _) + omega + · obtain ⟨m, rfl⟩ := Nat.exists_eq_succ_of_ne_zero (by omega : n ≠ 0) + have hm : 3 ≤ m := by omega + have hdegree : + FABL.functionAlgebraicDegree h ≤ m - 2 := by + have hdegree' : + FABL.functionAlgebraicDegree h ≤ (m + 1) - 3 := by + simpa only [mem_reedMuller_iff] using hmem + omega + let u : BooleanFunction m := firstCoordinateSlice h 0 + let w : BooleanFunction m := firstCoordinateSlice h 1 + let v : BooleanFunction m := u + w + have huDegree : FABL.functionAlgebraicDegree u ≤ m - 2 := by + simpa only [u] using + (firstCoordinateSlice_degree_le h 0 hdegree) + have hwDegree : FABL.functionAlgebraicDegree w ≤ m - 2 := by + simpa only [w] using + (firstCoordinateSlice_degree_le h 1 hdegree) + have hvDegree : FABL.functionAlgebraicDegree v ≤ m - 3 := by + have hvDegree' := + firstCoordinateDifference_degree_le_pred h hdegree + simpa only [v, u, w, show m - 2 - 1 = m - 3 by omega] using + hvDegree' + have hvMem : v ∈ reedMuller (m - 3) m := by + simpa only [mem_reedMuller_iff] using hvDegree + have hslices : hammingWeight u + hammingWeight w = 10 := by + have hsplit := hammingWeight_firstCoordinateSlices h + rw [hweight] at hsplit + simpa only [u, w] using hsplit.symm + have hweightIdentity : + hammingWeight v + 2 * (support u ∩ support w).card = 10 := by + have hadd := hammingWeight_add_add_two_mul_card_inter u w + rw [hslices] at hadd + simpa only [v] using hadd + by_cases hvZero : v = 0 + · have huw : u = w := by + funext x + have hzero := congrFun hvZero x + simp only [v, Pi.add_apply, Pi.zero_apply] at hzero + have heq := add_eq_zero_iff_eq_neg.mp hzero + exact heq.trans (ZMod.neg_eq_self_mod_two (w x)) + rw [huw] at hslices + have hwOdd : Odd (hammingWeight w) := by + use 2 + omega + have hwEven := even_hammingWeight_of_degree_lt_dimension w (by + omega) + exact (Nat.not_odd_iff_even.mpr hwEven) hwOdd + · have hvLower := + two_pow_sub_le_hammingWeight_of_degree_le v hvDegree hvZero + have hmSub : m - (m - 3) = 3 := by omega + rw [hmSub] at hvLower + norm_num at hvLower + have hvUpper : hammingWeight v ≤ 10 := by omega + have hvEven := even_hammingWeight_of_degree_lt_dimension v (by + omega) + obtain ⟨k, hk⟩ := hvEven + have hvNotTen : hammingWeight v ≠ 10 := + ih m (by omega) v hm hvMem + have hvWeight : hammingWeight v = 8 := by omega + have hinterCard : (support u ∩ support w).card = 1 := by + omega + obtain ⟨p, hp⟩ := Finset.card_eq_one.mp hinterCard + have hvDegreeEq : FABL.functionAlgebraicDegree v = m - 3 := by + apply Nat.le_antisymm hvDegree + by_cases hmThree : m = 3 + · omega + · have hmFour : 4 ≤ m := by omega + by_contra hnot + have hvDegreeFour : + FABL.functionAlgebraicDegree v ≤ m - 4 := by omega + have hvLowerFour := + two_pow_sub_le_hammingWeight_of_degree_le + v hvDegreeFour hvZero + have hmSubFour : m - (m - 4) = 4 := by omega + rw [hmSubFour, hvWeight] at hvLowerFour + norm_num at hvLowerFour + have hvWeightPower : hammingWeight v = 2 ^ (m - (m - 3)) := by + rw [hvWeight] + norm_num [show m - (m - 3) = 3 by omega] + obtain ⟨H, a, _hHrank, hvIndicator⟩ := + (degree_eq_and_hammingWeight_eq_iff_exists_affineFlatIndicator + v (r := m - 3) (by omega)).mp + ⟨hvDegreeEq, hvWeightPower⟩ + have hsupport : (support v : Set (FABL.F₂Cube m)) = + FABL.binaryAffineSubspace H a := + (eq_affineFlatIndicator_iff_support_eq v H a).mp hvIndicator + obtain ⟨ell, hellMem, hinterEll⟩ := + support_inter_firstCoordinateSlices_eq_singleton_separator + u w v rfl p hp H a hsupport + have huMem : u ∈ reedMuller (m - 2) m := by + simpa only [mem_reedMuller_iff] using huDegree + have huDual : u ∈ reedMullerDual 1 m := by + rw [reedMullerDual_eq (r := 1) (n := m) (by omega)] + simpa only [show m - 1 - 1 = m - 2 by omega] using huMem + rw [reedMullerDual, + LinearMap.BilinForm.mem_orthogonal_iff] at huDual + have hpairReverse := huDual ell hellMem + have hpair : booleanFunctionPairing m u ell = 0 := by + rw [booleanFunctionPairing_apply] + calc + (∑ x, u x * ell x) = ∑ x, ell x * u x := by + apply Finset.sum_congr rfl + intro x _hx + exact mul_comm _ _ + _ = 0 := hpairReverse + have hinterEven := + even_card_support_inter_of_pairing_eq_zero u ell hpair + rw [hinterEll] at hinterEven + norm_num at hinterEven + +end CryptBoolean diff --git a/CryptBoolean/Carlet/Chapter03/ReedMullerMinimumWeight.lean b/CryptBoolean/Carlet/Chapter03/ReedMullerMinimumWeight.lean new file mode 100644 index 0000000..58b46ed --- /dev/null +++ b/CryptBoolean/Carlet/Chapter03/ReedMullerMinimumWeight.lean @@ -0,0 +1,1024 @@ +/- +Copyright (c) 2026 Asher Yan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Asher Yan with Codex +-/ +module + +public import CryptBoolean.Carlet.Chapter03.ReedMuller +public import FABL.Chapter03.SubspacesAndDecisionTrees.Subspaces +public import Mathlib.LinearAlgebra.FiniteDimensional.Lemmas + +/-! +# Carlet Proposition 12: minimum-weight Reed--Muller words + +The equality cases in the Reed--Muller minimum-weight bound are precisely the indicators of +affine flats of the corresponding dimension. +-/ + +open Finset +open Module +open scoped BigOperators BooleanCube + +@[expose] public section + +namespace CryptBoolean + +open FABL + +variable {n r : ℕ} + +/-- The `𝔽₂`-valued indicator of the affine flat `H + a`. -/ +noncomputable def affineFlatIndicator + (H : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) (a : FABL.F₂Cube n) : + BooleanFunction n := by + classical + exact fun x ↦ if x ∈ FABL.binaryAffineSubspace H a then 1 else 0 + +@[simp] theorem affineFlatIndicator_apply_eq_one_iff + (H : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) (a x : FABL.F₂Cube n) : + affineFlatIndicator H a x = 1 ↔ x ∈ FABL.binaryAffineSubspace H a := by + classical + simp [affineFlatIndicator] + +@[simp] theorem mem_support_affineFlatIndicator + (H : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) (a x : FABL.F₂Cube n) : + x ∈ support (affineFlatIndicator H a) ↔ + x ∈ FABL.binaryAffineSubspace H a := by + rw [mem_support, affineFlatIndicator_apply_eq_one_iff] + +/-- A nonempty set closed under ternary sums is an affine set over `𝔽₂`. -/ +def IsBinaryAffineSet (S : Set (FABL.F₂Cube n)) : Prop := + S.Nonempty ∧ ∀ ⦃x⦄, x ∈ S → ∀ ⦃y⦄, y ∈ S → ∀ ⦃z⦄, z ∈ S → x + y + z ∈ S + +private theorem isBinaryAffineSet_iff_exists_binaryAffineSubspace + (S : Set (FABL.F₂Cube n)) : + IsBinaryAffineSet S ↔ + ∃ (H : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) (a : FABL.F₂Cube n), + S = FABL.binaryAffineSubspace H a := by + constructor + · rintro hS + obtain ⟨a, ha⟩ := hS.1 + let H : Submodule FABL.𝔽₂ (FABL.F₂Cube n) := + { carrier := {x | x + a ∈ S} + zero_mem' := by simpa using ha + add_mem' := by + intro x y hx hy + have hmem := hS.2 hx hy ha + have heq : (x + a) + (y + a) + a = x + y + a := by + calc + (x + a) + (y + a) + a = x + y + (a + a) + a := by abel + _ = x + y + a := by rw [ZModModule.add_self, add_zero] + change x + y + a ∈ S + simpa only [heq] using hmem + smul_mem' := by + intro c x hx + by_cases hc : c = 0 + · subst c + simpa using ha + · have hc_one : c = 1 := Fin.eq_one_of_ne_zero c hc + subst c + simpa using hx } + refine ⟨H, a, Set.ext fun x ↦ ?_⟩ + have hcancel : (x + a) + a = x := by + rw [add_assoc, ZModModule.add_self, add_zero] + constructor + · intro hx + apply (FABL.mem_binaryAffineSubspace_iff_add_mem H a x).2 + change (x + a) + a ∈ S + simpa only [hcancel] using hx + · intro hx + have hx' := (FABL.mem_binaryAffineSubspace_iff_add_mem H a x).1 hx + change (x + a) + a ∈ S at hx' + simpa only [hcancel] using hx' + · rintro ⟨H, a, rfl⟩ + constructor + · exact FABL.binaryAffineSubspace_nonempty H a + · intro x hx y hy z hz + have hx' := (FABL.mem_binaryAffineSubspace_iff_add_mem H a x).1 hx + have hy' := (FABL.mem_binaryAffineSubspace_iff_add_mem H a y).1 hy + have hz' := (FABL.mem_binaryAffineSubspace_iff_add_mem H a z).1 hz + apply (FABL.mem_binaryAffineSubspace_iff_add_mem H a (x + y + z)).2 + have hsum := H.add_mem (H.add_mem hx' hy') hz' + have heq : (x + a) + (y + a) + (z + a) = (x + y + z) + a := by + calc + (x + a) + (y + a) + (z + a) = + (x + y + z) + ((a + a) + a) := by abel + _ = (x + y + z) + a := by rw [ZModModule.add_self, zero_add] + simpa only [heq] using hsum + +private def liftedPartition + (A₀ A₁ : Set (FABL.F₂Cube n)) : Set (FABL.F₂Cube (n + 1)) := + {x | (x 0 = 0 ∧ Fin.tail x ∈ A₀) ∨ (x 0 = 1 ∧ Fin.tail x ∈ A₁)} + +private theorem finCons_add (a b : FABL.𝔽₂) (x y : FABL.F₂Cube n) : + (Fin.cons a x : FABL.F₂Cube (n + 1)) + + (Fin.cons b y : FABL.F₂Cube (n + 1)) = + (Fin.cons (a + b) (x + y) : FABL.F₂Cube (n + 1)) := by + funext i + refine Fin.cases ?_ (fun j ↦ ?_) i <;> simp + +private theorem finCons_add_add + (a b c : FABL.𝔽₂) (x y z : FABL.F₂Cube n) : + (Fin.cons a x : FABL.F₂Cube (n + 1)) + + (Fin.cons b y : FABL.F₂Cube (n + 1)) + + (Fin.cons c z : FABL.F₂Cube (n + 1)) = + (Fin.cons (a + b + c) (x + y + z) : FABL.F₂Cube (n + 1)) := by + rw [finCons_add, finCons_add] + +private theorem ternary_sum_mem_right_of_two_mem_left + {A B U : Set (FABL.F₂Cube n)} + (hA : IsBinaryAffineSet A) (hU : IsBinaryAffineSet U) + (hUnion : U = A ∪ B) (hdisjoint : Disjoint A B) + {x y z : FABL.F₂Cube n} (hx : x ∈ A) (hy : y ∈ A) (hz : z ∈ B) : + x + y + z ∈ B := by + have hxyzU : x + y + z ∈ U := by + apply hU.2 + · simpa [hUnion] using Or.inl hx + · simpa [hUnion] using Or.inl hy + · simpa [hUnion] using Or.inr hz + rw [hUnion] at hxyzU + rcases hxyzU with hleft | hright + · have hzA : z ∈ A := by + have hmem := hA.2 hx hy hleft + have heq : x + y + (x + y + z) = z := by + calc + x + y + (x + y + z) = (x + x) + (y + y) + z := by abel + _ = z := by simp only [ZModModule.add_self, zero_add] + simpa [heq] using hmem + exact (Set.disjoint_left.1 hdisjoint hzA hz).elim + · exact hright + +private theorem isBinaryAffineSet_liftedPartition + {A₀ A₁ U : Set (FABL.F₂Cube n)} + (hA₀ : IsBinaryAffineSet A₀) (hA₁ : IsBinaryAffineSet A₁) + (hU : IsBinaryAffineSet U) (hUnion : U = A₀ ∪ A₁) + (hdisjoint : Disjoint A₀ A₁) : + IsBinaryAffineSet (liftedPartition A₀ A₁) := by + constructor + · obtain ⟨x, hx⟩ := hA₀.1 + exact ⟨Fin.cons 0 x, by simp [liftedPartition, hx]⟩ + · intro x hx y hy z hz + rcases hx with hx | hx <;> rcases hy with hy | hy <;> rcases hz with hz | hz + · left + rw [← Fin.cons_self_tail x, hx.1, ← Fin.cons_self_tail y, hy.1, + ← Fin.cons_self_tail z, hz.1, finCons_add_add] + simpa [liftedPartition] using hA₀.2 hx.2 hy.2 hz.2 + · right + rw [← Fin.cons_self_tail x, hx.1, ← Fin.cons_self_tail y, hy.1, + ← Fin.cons_self_tail z, hz.1, finCons_add_add] + have hmem := ternary_sum_mem_right_of_two_mem_left hA₀ hU hUnion hdisjoint + hx.2 hy.2 hz.2 + simpa [liftedPartition] using hmem + · right + rw [← Fin.cons_self_tail x, hx.1, ← Fin.cons_self_tail y, hy.1, + ← Fin.cons_self_tail z, hz.1, finCons_add_add] + have hmem := ternary_sum_mem_right_of_two_mem_left hA₀ hU hUnion hdisjoint + hx.2 hz.2 hy.2 + simpa [liftedPartition, add_assoc, add_left_comm, add_comm] using hmem + · left + rw [← Fin.cons_self_tail x, hx.1, ← Fin.cons_self_tail y, hy.1, + ← Fin.cons_self_tail z, hz.1, finCons_add_add] + have hmem := ternary_sum_mem_right_of_two_mem_left hA₁ hU + (by simpa [Set.union_comm] using hUnion) hdisjoint.symm hy.2 hz.2 hx.2 + simpa [liftedPartition, add_assoc, add_left_comm, add_comm] using hmem + · right + rw [← Fin.cons_self_tail x, hx.1, ← Fin.cons_self_tail y, hy.1, + ← Fin.cons_self_tail z, hz.1, finCons_add_add] + have hmem := ternary_sum_mem_right_of_two_mem_left hA₀ hU hUnion hdisjoint + hy.2 hz.2 hx.2 + simpa [liftedPartition, add_assoc, add_left_comm, add_comm] using hmem + · left + rw [← Fin.cons_self_tail x, hx.1, ← Fin.cons_self_tail y, hy.1, + ← Fin.cons_self_tail z, hz.1, finCons_add_add] + have hmem := ternary_sum_mem_right_of_two_mem_left hA₁ hU + (by simpa [Set.union_comm] using hUnion) hdisjoint.symm hx.2 hz.2 hy.2 + simpa [liftedPartition, add_assoc, add_left_comm, add_comm] using hmem + · left + rw [← Fin.cons_self_tail x, hx.1, ← Fin.cons_self_tail y, hy.1, + ← Fin.cons_self_tail z, hz.1, finCons_add_add] + have hmem := ternary_sum_mem_right_of_two_mem_left hA₁ hU + (by simpa [Set.union_comm] using hUnion) hdisjoint.symm hx.2 hy.2 hz.2 + simpa [liftedPartition, add_assoc, add_left_comm, add_comm] using hmem + · right + rw [← Fin.cons_self_tail x, hx.1, ← Fin.cons_self_tail y, hy.1, + ← Fin.cons_self_tail z, hz.1, finCons_add_add] + simpa [liftedPartition] using hA₁.2 hx.2 hy.2 hz.2 + +private theorem isBinaryAffineSet_liftedLeft + {A : Set (FABL.F₂Cube n)} (hA : IsBinaryAffineSet A) : + IsBinaryAffineSet (liftedPartition A ∅) := by + constructor + · obtain ⟨x, hx⟩ := hA.1 + exact ⟨Fin.cons 0 x, by simp [liftedPartition, hx]⟩ + · intro x hx y hy z hz + have hx' : x 0 = 0 ∧ Fin.tail x ∈ A := hx.elim id (fun h ↦ (h.2.elim)) + have hy' : y 0 = 0 ∧ Fin.tail y ∈ A := hy.elim id (fun h ↦ (h.2.elim)) + have hz' : z 0 = 0 ∧ Fin.tail z ∈ A := hz.elim id (fun h ↦ (h.2.elim)) + left + rw [← Fin.cons_self_tail x, hx'.1, ← Fin.cons_self_tail y, hy'.1, + ← Fin.cons_self_tail z, hz'.1, finCons_add_add] + simpa [liftedPartition] using hA.2 hx'.2 hy'.2 hz'.2 + +private theorem isBinaryAffineSet_liftedRight + {A : Set (FABL.F₂Cube n)} (hA : IsBinaryAffineSet A) : + IsBinaryAffineSet (liftedPartition ∅ A) := by + constructor + · obtain ⟨x, hx⟩ := hA.1 + exact ⟨Fin.cons 1 x, by simp [liftedPartition, hx]⟩ + · intro x hx y hy z hz + have hx' : x 0 = 1 ∧ Fin.tail x ∈ A := hx.elim (fun h ↦ h.2.elim) id + have hy' : y 0 = 1 ∧ Fin.tail y ∈ A := hy.elim (fun h ↦ h.2.elim) id + have hz' : z 0 = 1 ∧ Fin.tail z ∈ A := hz.elim (fun h ↦ h.2.elim) id + right + rw [← Fin.cons_self_tail x, hx'.1, ← Fin.cons_self_tail y, hy'.1, + ← Fin.cons_self_tail z, hz'.1, finCons_add_add] + simpa [liftedPartition] using hA.2 hx'.2 hy'.2 hz'.2 + +private theorem isBinaryAffineSet_liftedSame + {A : Set (FABL.F₂Cube n)} (hA : IsBinaryAffineSet A) : + IsBinaryAffineSet (liftedPartition A A) := by + constructor + · obtain ⟨x, hx⟩ := hA.1 + exact ⟨Fin.cons 0 x, by simp [liftedPartition, hx]⟩ + · intro x hx y hy z hz + have hxt : Fin.tail x ∈ A := hx.elim And.right And.right + have hyt : Fin.tail y ∈ A := hy.elim And.right And.right + have hzt : Fin.tail z ∈ A := hz.elim And.right And.right + have htail := hA.2 hxt hyt hzt + rw [← Fin.cons_self_tail x, ← Fin.cons_self_tail y, + ← Fin.cons_self_tail z, finCons_add_add] + by_cases hb : x 0 + y 0 + z 0 = 0 + · left + simpa [liftedPartition, hb] using htail + · right + have hb_one : x 0 + y 0 + z 0 = 1 := Fin.eq_one_of_ne_zero _ hb + simpa [liftedPartition, hb_one] using htail + +/-- Restriction of a Boolean function to a fixed value of its first +coordinate. -/ +def firstCoordinateSlice + (f : BooleanFunction (n + 1)) (b : FABL.𝔽₂) : BooleanFunction n := + fun x ↦ f (Fin.cons b x) + +private theorem support_eq_liftedPartition (f : BooleanFunction (n + 1)) : + (support f : Set (FABL.F₂Cube (n + 1))) = + liftedPartition + (support (firstCoordinateSlice f 0) : Set (FABL.F₂Cube n)) + (support (firstCoordinateSlice f 1) : Set (FABL.F₂Cube n)) := by + ext x + simp only [Finset.mem_coe, mem_support, liftedPartition, Set.mem_setOf_eq] + by_cases hx : x 0 = 0 + · rw [← Fin.cons_self_tail x, hx] + simp [firstCoordinateSlice] + · have hx_one : x 0 = 1 := Fin.eq_one_of_ne_zero _ hx + rw [← Fin.cons_self_tail x, hx_one] + simp [firstCoordinateSlice] + +/-- Inclusion-exclusion for the Hamming weight of a sum of Boolean +functions. -/ +theorem hammingWeight_add_add_two_mul_card_inter + (f g : BooleanFunction n) : + hammingWeight (f + g) + 2 * (support f ∩ support g).card = + hammingWeight f + hammingWeight g := by + classical + rw [hammingWeight_eq_card_support, hammingWeight_eq_card_support, + hammingWeight_eq_card_support] + have hinter : + support f ∩ support g = + Finset.univ.filter fun x : FABL.F₂Cube n ↦ f x = 1 ∧ g x = 1 := by + ext x + simp [mem_support] + rw [hinter] + simp only [support, FABL.f₂OneSupport, Pi.add_apply] + simp only [Finset.card_filter] + rw [Finset.mul_sum] + rw [← Finset.sum_add_distrib, ← Finset.sum_add_distrib] + apply Finset.sum_congr rfl + intro x hx + by_cases hfx : f x = 0 + · by_cases hgx : g x = 0 + · norm_num [hfx, hgx] + · have hgx_one : g x = 1 := Fin.eq_one_of_ne_zero _ hgx + norm_num [hfx, hgx_one] + · have hfx_one : f x = 1 := Fin.eq_one_of_ne_zero _ hfx + by_cases hgx : g x = 0 + · norm_num [hfx_one, hgx] + · have hgx_one : g x = 1 := Fin.eq_one_of_ne_zero _ hgx + norm_num [hfx_one, hgx_one] + +private theorem disjoint_support_of_hammingWeight_add_eq_sum + (f g : BooleanFunction n) + (hweight : hammingWeight (f + g) = hammingWeight f + hammingWeight g) : + Disjoint (support f) (support g) := by + have hidentity := hammingWeight_add_add_two_mul_card_inter f g + rw [hweight] at hidentity + have hcard : (support f ∩ support g).card = 0 := by omega + rw [Finset.disjoint_iff_inter_eq_empty, Finset.card_eq_zero.mp hcard] + +private theorem support_add_eq_union_of_disjoint + (f g : BooleanFunction n) (hdisjoint : Disjoint (support f) (support g)) : + support (f + g) = support f ∪ support g := by + ext x + have hnotBoth : ¬(f x = 1 ∧ g x = 1) := by + intro h + exact Finset.disjoint_left.1 hdisjoint (mem_support f x |>.2 h.1) + (mem_support g x |>.2 h.2) + rw [mem_support] + simp only [Pi.add_apply, Finset.mem_union, mem_support] + by_cases hfx : f x = 0 + · by_cases hgx : g x = 0 + · simp [hfx, hgx] + · have hgx_one : g x = 1 := Fin.eq_one_of_ne_zero _ hgx + simp [hfx, hgx_one] + · have hfx_one : f x = 1 := Fin.eq_one_of_ne_zero _ hfx + by_cases hgx : g x = 0 + · simp [hfx_one, hgx] + · have hgx_one : g x = 1 := Fin.eq_one_of_ne_zero _ hgx + exact (hnotBoth ⟨hfx_one, hgx_one⟩).elim + +private theorem f₂CubeOfFinset_tailFrequency (T : Finset (Fin n)) : + FABL.f₂CubeOfFinset (FABL.tailFrequency T) = + Fin.cons 0 (FABL.f₂CubeOfFinset T) := by + funext i + refine Fin.cases ?_ (fun j ↦ ?_) i + · simp [FABL.f₂CubeOfFinset, FABL.tailFrequency] + · simp [FABL.f₂CubeOfFinset, FABL.tailFrequency] + +private theorem f₂CubeOfFinset_insert_zero_tailFrequency + (T : Finset (Fin n)) : + FABL.f₂CubeOfFinset (insert 0 (FABL.tailFrequency T)) = + Fin.cons 1 (FABL.f₂CubeOfFinset T) := by + funext i + refine Fin.cases ?_ (fun j ↦ ?_) i + · simp [FABL.f₂CubeOfFinset] + · simp [FABL.f₂CubeOfFinset, FABL.tailFrequency] + +private theorem anfCoeff_firstCoordinateSlice_zero + (f : BooleanFunction (n + 1)) (S : Finset (Fin n)) : + FABL.anfCoeff (firstCoordinateSlice f 0) S = + FABL.anfCoeff f (FABL.tailFrequency S) := by + classical + simp only [FABL.anfCoeff, firstCoordinateSlice] + apply Finset.sum_bij (fun T _ ↦ FABL.tailFrequency T) + · intro T hT + rw [Finset.mem_powerset] at hT ⊢ + exact Finset.map_subset_map.mpr hT + · intro T₁ hT₁ T₂ hT₂ heq + exact Finset.map_injective (Fin.succEmb n) heq + · intro U hU + rw [Finset.mem_powerset] at hU + obtain ⟨T, hTS, rfl⟩ := Finset.subset_map_iff.mp hU + exact ⟨T, Finset.mem_powerset.mpr hTS, rfl⟩ + · intro T hT + rw [f₂CubeOfFinset_tailFrequency] + +private theorem anfCoeff_firstCoordinateSlice_one + (f : BooleanFunction (n + 1)) (S : Finset (Fin n)) : + FABL.anfCoeff (firstCoordinateSlice f 1) S = + FABL.anfCoeff f (FABL.tailFrequency S) + + FABL.anfCoeff f (insert 0 (FABL.tailFrequency S)) := by + classical + have hsplit := Finset.sum_powerset_insert (FABL.zero_notMem_tailFrequency S) + (fun U ↦ f (FABL.f₂CubeOfFinset U)) + have htail : + (∑ U ∈ (FABL.tailFrequency S).powerset, + f (FABL.f₂CubeOfFinset U)) = + FABL.anfCoeff (firstCoordinateSlice f 0) S := by + rw [anfCoeff_firstCoordinateSlice_zero] + rfl + have hone : + (∑ U ∈ (FABL.tailFrequency S).powerset, + f (FABL.f₂CubeOfFinset (insert 0 U))) = + FABL.anfCoeff (firstCoordinateSlice f 1) S := by + simp only [FABL.anfCoeff, firstCoordinateSlice] + symm + apply Finset.sum_bij (fun T _ ↦ FABL.tailFrequency T) + · intro T hT + rw [Finset.mem_powerset] at hT ⊢ + exact Finset.map_subset_map.mpr hT + · intro T₁ hT₁ T₂ hT₂ heq + exact Finset.map_injective (Fin.succEmb n) heq + · intro U hU + rw [Finset.mem_powerset] at hU + obtain ⟨T, hTS, rfl⟩ := Finset.subset_map_iff.mp hU + exact ⟨T, Finset.mem_powerset.mpr hTS, rfl⟩ + · intro T hT + rw [f₂CubeOfFinset_insert_zero_tailFrequency] + have hcoeff : + FABL.anfCoeff f (insert 0 (FABL.tailFrequency S)) = + FABL.anfCoeff (firstCoordinateSlice f 0) S + + FABL.anfCoeff (firstCoordinateSlice f 1) S := by + simpa only [FABL.anfCoeff, htail, hone] using hsplit + rw [← anfCoeff_firstCoordinateSlice_zero] + rw [hcoeff, ← add_assoc, CharTwo.add_self_eq_zero, zero_add] + +/-- Hamming weight splits as the sum of the two first-coordinate slice +weights. -/ +theorem hammingWeight_firstCoordinateSlices + (f : BooleanFunction (n + 1)) : + hammingWeight f = + hammingWeight (firstCoordinateSlice f 0) + + hammingWeight (firstCoordinateSlice f 1) := by + classical + simp only [FABL.hammingNorm_eq_card_f₂OneSupport, FABL.f₂OneSupport, + Finset.card_filter] + rw [Fintype.sum_equiv + (Fin.consEquiv (fun _ : Fin (n + 1) ↦ FABL.𝔽₂)).symm + (fun x ↦ if f x = 1 then 1 else 0) + (fun bx ↦ if f (Fin.cons bx.1 bx.2) = 1 then 1 else 0) + (fun x ↦ by rw [← Fin.cons_self_tail x]; rfl)] + rw [Fintype.sum_prod_type] + have htwo : (Finset.univ : Finset FABL.𝔽₂) = {0, 1} := rfl + rw [htwo] + simp only [Finset.sum_insert, Finset.mem_singleton, zero_ne_one, + not_false_eq_true, Finset.sum_singleton] + rfl + +/-- Restricting one coordinate does not increase algebraic degree. -/ +theorem firstCoordinateSlice_degree_le + (f : BooleanFunction (n + 1)) (b : FABL.𝔽₂) + (hdeg : FABL.functionAlgebraicDegree f ≤ r) : + FABL.functionAlgebraicDegree (firstCoordinateSlice f b) ≤ r := by + rw [FABL.functionAlgebraicDegree, FABL.algebraicDegree_le_iff] + intro S hS + by_cases hb : b = 0 + · subst b + rw [anfCoeff_firstCoordinateSlice_zero] at hS + have hcard := (FABL.algebraicDegree_le_iff (FABL.anfCoeff f) r).mp hdeg + (FABL.tailFrequency S) hS + simpa [FABL.card_tailFrequency] using hcard + · have hb_one : b = 1 := Fin.eq_one_of_ne_zero b hb + subst b + rw [anfCoeff_firstCoordinateSlice_one] at hS + have hne : + FABL.anfCoeff f (FABL.tailFrequency S) ≠ 0 ∨ + FABL.anfCoeff f (insert 0 (FABL.tailFrequency S)) ≠ 0 := by + by_contra h + push Not at h + exact hS (by rw [h.1, h.2, add_zero]) + cases hne with + | inl htail => + have hcard := (FABL.algebraicDegree_le_iff (FABL.anfCoeff f) r).mp hdeg + (FABL.tailFrequency S) htail + simpa [FABL.card_tailFrequency] using hcard + | inr hinsert => + have hcard := (FABL.algebraicDegree_le_iff (FABL.anfCoeff f) r).mp hdeg + (insert 0 (FABL.tailFrequency S)) hinsert + rw [Finset.card_insert_of_notMem (FABL.zero_notMem_tailFrequency S), + FABL.card_tailFrequency] at hcard + omega + +/-- The sum of the two first-coordinate slices lowers the degree bound by +one. -/ +theorem firstCoordinateDifference_degree_le_pred + (f : BooleanFunction (n + 1)) + (hdeg : FABL.functionAlgebraicDegree f ≤ r) : + FABL.functionAlgebraicDegree + (firstCoordinateSlice f 0 + firstCoordinateSlice f 1) ≤ r - 1 := by + rw [FABL.functionAlgebraicDegree, FABL.algebraicDegree_le_iff] + intro S hS + rw [FABL.anfCoeff_add] at hS + change FABL.anfCoeff (firstCoordinateSlice f 0) S + + FABL.anfCoeff (firstCoordinateSlice f 1) S ≠ 0 at hS + rw [anfCoeff_firstCoordinateSlice_zero, + anfCoeff_firstCoordinateSlice_one] at hS + simp only [← add_assoc, CharTwo.add_self_eq_zero, zero_add] at hS + have hcard := (FABL.algebraicDegree_le_iff (FABL.anfCoeff f) r).mp hdeg + (insert 0 (FABL.tailFrequency S)) hS + rw [Finset.card_insert_of_notMem (FABL.zero_notMem_tailFrequency S), + FABL.card_tailFrequency] at hcard + omega + +private theorem function_eq_zero_of_both_firstCoordinateSlices_zero + (f : BooleanFunction (n + 1)) + (hzero : firstCoordinateSlice f 0 = 0) + (hone : firstCoordinateSlice f 1 = 0) : + f = 0 := by + funext x + rw [← Fin.cons_self_tail x] + by_cases hx : x 0 = 0 + · rw [hx] + exact congrFun hzero (Fin.tail x) + · have hxone : x 0 = 1 := Fin.eq_one_of_ne_zero _ hx + rw [hxone] + exact congrFun hone (Fin.tail x) + +private theorem exists_anfCoeff_ne_zero_of_ne_zero + (f : BooleanFunction n) (hf : f ≠ 0) : + ∃ S, FABL.anfCoeff f S ≠ 0 := by + by_contra h + push Not at h + apply hf + calc + f = FABL.anfEval (FABL.anfCoeff f) := (FABL.anfEval_anfCoeff f).symm + _ = 0 := by + funext x + simp [FABL.anfEval, h] + +private theorem degree_index_pos_of_exactly_one_nonzero_slice + (f : BooleanFunction (n + 1)) + (hzero : firstCoordinateSlice f 0 = 0) + (hone : firstCoordinateSlice f 1 ≠ 0) + (hdeg : FABL.functionAlgebraicDegree f ≤ r) : + 0 < r := by + obtain ⟨T, hT⟩ := exists_anfCoeff_ne_zero_of_ne_zero + (firstCoordinateSlice f 1) hone + have hzeroCoeff : FABL.anfCoeff (firstCoordinateSlice f 0) T = 0 := by + rw [hzero] + simp + have hinsert : FABL.anfCoeff f (insert 0 (FABL.tailFrequency T)) ≠ 0 := by + rw [anfCoeff_firstCoordinateSlice_one, ← anfCoeff_firstCoordinateSlice_zero, + hzeroCoeff, zero_add] at hT + exact hT + have hbound := (FABL.algebraicDegree_le_iff (FABL.anfCoeff f) r).mp hdeg + (insert 0 (FABL.tailFrequency T)) hinsert + rw [Finset.card_insert_of_notMem (FABL.zero_notMem_tailFrequency T), + FABL.card_tailFrequency] at hbound + omega + +private theorem degree_index_pos_of_zero_slice_nonzero + (f : BooleanFunction (n + 1)) + (hone : firstCoordinateSlice f 1 = 0) + (hzero : firstCoordinateSlice f 0 ≠ 0) + (hdeg : FABL.functionAlgebraicDegree f ≤ r) : + 0 < r := by + obtain ⟨S, hS⟩ := exists_anfCoeff_ne_zero_of_ne_zero + (firstCoordinateSlice f 0) hzero + have honeCoeff : FABL.anfCoeff (firstCoordinateSlice f 1) S = 0 := by + rw [hone] + simp + rw [anfCoeff_firstCoordinateSlice_zero] at hS + have hinsert : FABL.anfCoeff f (insert 0 (FABL.tailFrequency S)) ≠ 0 := by + intro hinsert + have hrel := anfCoeff_firstCoordinateSlice_one f S + rw [honeCoeff, hinsert, add_zero] at hrel + exact hS hrel.symm + have hbound := (FABL.algebraicDegree_le_iff (FABL.anfCoeff f) r).mp hdeg + (insert 0 (FABL.tailFrequency S)) hinsert + rw [Finset.card_insert_of_notMem (FABL.zero_notMem_tailFrequency S), + FABL.card_tailFrequency] at hbound + omega + +private theorem degree_index_pos_of_firstCoordinateDifference_nonzero + (f : BooleanFunction (n + 1)) + (hdiff : firstCoordinateSlice f 0 + firstCoordinateSlice f 1 ≠ 0) + (hdeg : FABL.functionAlgebraicDegree f ≤ r) : + 0 < r := by + obtain ⟨S, hS⟩ := exists_anfCoeff_ne_zero_of_ne_zero + (firstCoordinateSlice f 0 + firstCoordinateSlice f 1) hdiff + rw [FABL.anfCoeff_add] at hS + change FABL.anfCoeff (firstCoordinateSlice f 0) S + + FABL.anfCoeff (firstCoordinateSlice f 1) S ≠ 0 at hS + rw [anfCoeff_firstCoordinateSlice_zero, + anfCoeff_firstCoordinateSlice_one] at hS + simp only [← add_assoc, CharTwo.add_self_eq_zero, zero_add] at hS + have hbound := (FABL.algebraicDegree_le_iff (FABL.anfCoeff f) r).mp hdeg + (insert 0 (FABL.tailFrequency S)) hS + rw [Finset.card_insert_of_notMem (FABL.zero_notMem_tailFrequency S), + FABL.card_tailFrequency] at hbound + omega + +private theorem hammingWeight_add_le + (f g : BooleanFunction n) : + hammingWeight (f + g) ≤ hammingWeight f + hammingWeight g := by + have htriangle := hammingDist_triangle_left f g 0 + rw [hammingDist_zero_left] at htriangle + change hammingDistance f g ≤ hammingWeight f + hammingWeight g at htriangle + rw [hammingDistance_eq_hammingWeight_add] at htriangle + exact htriangle + +private theorem minimumWeight_support_isBinaryAffineSet + (f : BooleanFunction n) (hrn : r ≤ n) + (hdegree : FABL.functionAlgebraicDegree f ≤ r) + (hweight : hammingWeight f = 2 ^ (n - r)) (hf : f ≠ 0) : + IsBinaryAffineSet (support f : Set (FABL.F₂Cube n)) := by + induction n generalizing r with + | zero => + have hsupp : (support f : Set (FABL.F₂Cube 0)) = Set.univ := by + apply Set.eq_univ_of_forall + intro x + rw [Finset.mem_coe, mem_support] + have hx : f x ≠ 0 := by + intro hx + apply hf + funext y + simp [Subsingleton.elim y x, hx] + exact Fin.eq_one_of_ne_zero _ hx + rw [hsupp] + constructor + · exact Set.univ_nonempty + · simp + | succ n ih => + let f₀ : BooleanFunction n := firstCoordinateSlice f 0 + let f₁ : BooleanFunction n := firstCoordinateSlice f 1 + have hsplit : hammingWeight f = hammingWeight f₀ + hammingWeight f₁ := by + simpa [f₀, f₁] using hammingWeight_firstCoordinateSlices f + by_cases hf₀ : f₀ = 0 + · have hf₁ : f₁ ≠ 0 := by + intro hf₁ + apply hf + exact function_eq_zero_of_both_firstCoordinateSlices_zero f + (by simpa [f₀] using hf₀) (by simpa [f₁] using hf₁) + have hrpos : 0 < r := degree_index_pos_of_exactly_one_nonzero_slice f + (by simpa [f₀] using hf₀) (by simpa [f₁] using hf₁) hdegree + have hdegree₁ : FABL.functionAlgebraicDegree f₁ ≤ r - 1 := by + have hdiff := firstCoordinateDifference_degree_le_pred f hdegree + simpa [f₀, f₁, hf₀] using hdiff + have hrpred : r - 1 ≤ n := by omega + have hexp : (n + 1) - r = n - (r - 1) := by omega + have hweight₁ : hammingWeight f₁ = 2 ^ (n - (r - 1)) := by + rw [hsplit, hf₀] at hweight + simpa [hexp] using hweight + have hA₁ := ih f₁ hrpred hdegree₁ hweight₁ hf₁ + rw [support_eq_liftedPartition f] + have hsupp₀ : support f₀ = ∅ := by + ext x + simp [hf₀, support, FABL.f₂OneSupport] + simpa [f₀, f₁, hsupp₀] using isBinaryAffineSet_liftedRight hA₁ + · by_cases hf₁ : f₁ = 0 + · have hrpos : 0 < r := degree_index_pos_of_zero_slice_nonzero f + (by simpa [f₁] using hf₁) (by simpa [f₀] using hf₀) hdegree + have hdegree₀ : FABL.functionAlgebraicDegree f₀ ≤ r - 1 := by + have hdiff := firstCoordinateDifference_degree_le_pred f hdegree + simpa [f₀, f₁, hf₁] using hdiff + have hrpred : r - 1 ≤ n := by omega + have hexp : (n + 1) - r = n - (r - 1) := by omega + have hweight₀ : hammingWeight f₀ = 2 ^ (n - (r - 1)) := by + rw [hsplit, hf₁] at hweight + simpa [hexp] using hweight + have hA₀ := ih f₀ hrpred hdegree₀ hweight₀ hf₀ + rw [support_eq_liftedPartition f] + have hsupp₁ : support f₁ = ∅ := by + ext x + simp [hf₁, support, FABL.f₂OneSupport] + simpa [f₀, f₁, hsupp₁] using isBinaryAffineSet_liftedLeft hA₀ + · have hrn' : r ≤ n := by + by_contra h + have hre : r = n + 1 := by omega + have hpositive₀ : 0 < hammingWeight f₀ := hammingNorm_pos_iff.mpr hf₀ + have hpositive₁ : 0 < hammingWeight f₁ := hammingNorm_pos_iff.mpr hf₁ + rw [hsplit, hre] at hweight + norm_num at hweight + omega + have hdegree₀ : FABL.functionAlgebraicDegree f₀ ≤ r := by + simpa [f₀] using firstCoordinateSlice_degree_le f 0 hdegree + have hdegree₁ : FABL.functionAlgebraicDegree f₁ ≤ r := by + simpa [f₁] using firstCoordinateSlice_degree_le f 1 hdegree + have hlower₀ := two_pow_sub_le_hammingWeight_of_degree_le f₀ hdegree₀ hf₀ + have hlower₁ := two_pow_sub_le_hammingWeight_of_degree_le f₁ hdegree₁ hf₁ + have hexp : 2 ^ ((n + 1) - r) = 2 ^ (n - r) + 2 ^ (n - r) := by + rw [show (n + 1) - r = (n - r) + 1 by omega, pow_succ] + omega + have hsum : hammingWeight f₀ + hammingWeight f₁ = + 2 ^ (n - r) + 2 ^ (n - r) := by + rw [← hsplit, hweight, hexp] + have hweight₀ : hammingWeight f₀ = 2 ^ (n - r) := by omega + have hweight₁ : hammingWeight f₁ = 2 ^ (n - r) := by omega + have hA₀ := ih f₀ hrn' hdegree₀ hweight₀ hf₀ + have hA₁ := ih f₁ hrn' hdegree₁ hweight₁ hf₁ + let g : BooleanFunction n := f₀ + f₁ + have hdegreeg : FABL.functionAlgebraicDegree g ≤ r - 1 := by + simpa [g, f₀, f₁] using firstCoordinateDifference_degree_le_pred f hdegree + by_cases hg : g = 0 + · have heq : f₀ = f₁ := by + funext x + have hx := congrFun hg x + change f₀ x + f₁ x = 0 at hx + exact (add_eq_zero_iff_eq_neg.mp hx).trans + (ZMod.neg_eq_self_mod_two (f₁ x)) + rw [support_eq_liftedPartition f] + simpa [f₀, f₁, heq] using isBinaryAffineSet_liftedSame hA₀ + · have hrpos : 0 < r := by + apply degree_index_pos_of_firstCoordinateDifference_nonzero f + · simpa [g, f₀, f₁] using hg + · exact hdegree + have hrpred : r - 1 ≤ n := by omega + have hlowerg := two_pow_sub_le_hammingWeight_of_degree_le g hdegreeg hg + have hupperg : hammingWeight g ≤ hammingWeight f₀ + hammingWeight f₁ := + hammingWeight_add_le f₀ f₁ + have hexpg : 2 ^ (n - (r - 1)) = + 2 ^ (n - r) + 2 ^ (n - r) := by + rw [show n - (r - 1) = (n - r) + 1 by omega, pow_succ] + omega + have hweightg : hammingWeight g = 2 ^ (n - (r - 1)) := by + rw [hweight₀, hweight₁, ← hexpg] at hupperg + omega + have hAg := ih g hrpred hdegreeg hweightg hg + have hweightgSum : + hammingWeight g = hammingWeight f₀ + hammingWeight f₁ := by + rw [hweightg, hexpg, hweight₀, hweight₁] + have hdisjointFin := + disjoint_support_of_hammingWeight_add_eq_sum f₀ f₁ + (by simpa [g] using hweightgSum) + have hdisjointSet : + Disjoint (support f₀ : Set (FABL.F₂Cube n)) + (support f₁ : Set (FABL.F₂Cube n)) := by + rw [Set.disjoint_left] + intro x hx₀ hx₁ + exact Finset.disjoint_left.1 hdisjointFin hx₀ hx₁ + have hUnion : + (support g : Set (FABL.F₂Cube n)) = + (support f₀ : Set (FABL.F₂Cube n)) ∪ + (support f₁ : Set (FABL.F₂Cube n)) := by + have hfin := support_add_eq_union_of_disjoint f₀ f₁ hdisjointFin + simpa [g] using congrArg (fun s : Finset (FABL.F₂Cube n) ↦ + (s : Set (FABL.F₂Cube n))) hfin + rw [support_eq_liftedPartition f] + exact isBinaryAffineSet_liftedPartition hA₀ hA₁ hAg hUnion hdisjointSet + +private noncomputable def submoduleEquivAffineFlatSubtype + (H : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) (a : FABL.F₂Cube n) : + H ≃ {x : FABL.F₂Cube n // x ∈ FABL.binaryAffineSubspace H a} where + toFun x := ⟨x.1 + a, by + rw [FABL.mem_binaryAffineSubspace_iff_add_mem] + simpa only [add_assoc, ZModModule.add_self, add_zero] using x.2⟩ + invFun x := ⟨x.1 + a, (FABL.mem_binaryAffineSubspace_iff_add_mem H a x.1).1 x.2⟩ + left_inv x := by + apply Subtype.ext + simp only [add_assoc, ZModModule.add_self, add_zero] + right_inv x := by + apply Subtype.ext + simp only [add_assoc, ZModModule.add_self, add_zero] + +/-- The Hamming weight of an affine-flat indicator is the cardinality of its direction. -/ +theorem hammingWeight_affineFlatIndicator + (H : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) (a : FABL.F₂Cube n) : + hammingWeight (affineFlatIndicator H a) = + 2 ^ Module.finrank FABL.𝔽₂ H := by + classical + rw [hammingWeight_eq_card_support] + have hsupp : + support (affineFlatIndicator H a) = + Finset.univ.filter fun x : FABL.F₂Cube n ↦ + x ∈ FABL.binaryAffineSubspace H a := by + ext x + simp + rw [hsupp] + calc + (Finset.univ.filter fun x : FABL.F₂Cube n ↦ + x ∈ FABL.binaryAffineSubspace H a).card = + Fintype.card {x : FABL.F₂Cube n // x ∈ FABL.binaryAffineSubspace H a} := by + symm + exact Fintype.card_subtype _ + _ = Fintype.card H := Fintype.card_congr (submoduleEquivAffineFlatSubtype H a).symm + _ = Nat.card H := Nat.card_eq_fintype_card.symm + _ = 2 ^ Module.finrank FABL.𝔽₂ H := FABL.card_submodule_eq_two_pow_finrank H + +private noncomputable def affineFlatBasisProduct + (H : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) (a : FABL.F₂Cube n) : + BooleanFunction n := by + let P := FABL.perpendicularSubspace H + let B : Basis (Fin (Module.finrank FABL.𝔽₂ P)) FABL.𝔽₂ P := + Module.finBasis FABL.𝔽₂ P + exact ∏ i, FABL.affineFunction + (1 + FABL.f₂DotProduct (B i).1 a) (B i).1 + +private theorem affineFlatBasisProduct_apply_eq_one_iff + (H : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) (a x : FABL.F₂Cube n) : + affineFlatBasisProduct H a x = 1 ↔ + x ∈ FABL.binaryAffineSubspace H a := by + classical + simp only [affineFlatBasisProduct, Finset.prod_apply] + let P := FABL.perpendicularSubspace H + let B : Basis (Fin (Module.finrank FABL.𝔽₂ P)) FABL.𝔽₂ P := + Module.finBasis FABL.𝔽₂ P + change (∏ i, FABL.affineFunction + (1 + FABL.f₂DotProduct (B i).1 a) (B i).1 x) = 1 ↔ _ + constructor + · intro hproduct + rw [Finset.prod_eq_one_iff] at hproduct + have hbasis (i : Fin (Module.finrank FABL.𝔽₂ P)) : + FABL.f₂DotProduct (B i).1 x = FABL.f₂DotProduct (B i).1 a := by + have hi := hproduct i (Finset.mem_univ i) + change 1 + FABL.f₂DotProduct (B i).1 a + + FABL.f₂DotProduct (B i).1 x = 1 at hi + have hzero : FABL.f₂DotProduct (B i).1 a + + FABL.f₂DotProduct (B i).1 x = 0 := by + apply add_left_cancel (a := (1 : FABL.𝔽₂)) + simpa [add_assoc] using hi + have hzero' : FABL.f₂DotProduct (B i).1 x + + FABL.f₂DotProduct (B i).1 a = 0 := by + simpa [add_comm] using hzero + exact (add_eq_zero_iff_eq_neg.mp hzero').trans + (ZMod.neg_eq_self_mod_two (FABL.f₂DotProduct (B i).1 a)) + let L : P →ₗ[FABL.𝔽₂] FABL.𝔽₂ := + ((dotProductEquiv FABL.𝔽₂ (Fin n)) (x + a)).comp P.subtype + have hL : L = 0 := by + apply B.ext + intro i + change (x + a) ⬝ᵥ (B i).1 = 0 + rw [dotProduct_comm, dotProduct_add] + change FABL.f₂DotProduct (B i).1 x + + FABL.f₂DotProduct (B i).1 a = 0 + rw [hbasis] + exact ZModModule.add_self _ + rw [FABL.mem_binaryAffineSubspace_iff_forall_perpendicular_parity] + intro γ hγ + have hzero := DFunLike.congr_fun hL ⟨γ, hγ⟩ + change (x + a) ⬝ᵥ γ = 0 at hzero + rw [dotProduct_comm, dotProduct_add] at hzero + change FABL.f₂DotProduct γ x + FABL.f₂DotProduct γ a = 0 at hzero + exact (add_eq_zero_iff_eq_neg.mp hzero).trans + (ZMod.neg_eq_self_mod_two (FABL.f₂DotProduct γ a)) + · intro hx + rw [Finset.prod_eq_one_iff] + intro i hi + have hparity := + (FABL.mem_binaryAffineSubspace_iff_forall_perpendicular_parity H a x).1 hx + (B i).1 (B i).2 + change 1 + FABL.f₂DotProduct (B i).1 a + + FABL.f₂DotProduct (B i).1 x = 1 + rw [hparity, add_assoc, ZModModule.add_self, add_zero] + +private theorem affineFlatBasisProduct_eq_indicator + (H : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) (a : FABL.F₂Cube n) : + affineFlatBasisProduct H a = affineFlatIndicator H a := by + funext x + have hone : affineFlatBasisProduct H a x = 1 ↔ affineFlatIndicator H a x = 1 := + (affineFlatBasisProduct_apply_eq_one_iff H a x).trans + (affineFlatIndicator_apply_eq_one_iff H a x).symm + by_cases hproduct : affineFlatBasisProduct H a x = 0 + · have hindicator : affineFlatIndicator H a x = 0 := by + by_contra h + have hOne := Fin.eq_one_of_ne_zero _ h + exact zero_ne_one (hproduct.symm.trans (hone.mpr hOne)) + exact hproduct.trans hindicator.symm + · have hOne := Fin.eq_one_of_ne_zero _ hproduct + exact hOne.trans (hone.mp hOne).symm + +private theorem functionAlgebraicDegree_affineFlatIndicator_le_codimension + (H : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) (a : FABL.F₂Cube n) : + FABL.functionAlgebraicDegree (affineFlatIndicator H a) ≤ + FABL.f₂Codimension H := by + classical + rw [← affineFlatBasisProduct_eq_indicator H a] + let P := FABL.perpendicularSubspace H + let B : Basis (Fin (Module.finrank FABL.𝔽₂ P)) FABL.𝔽₂ P := + Module.finBasis FABL.𝔽₂ P + change FABL.functionAlgebraicDegree + (∏ i, FABL.affineFunction + (1 + FABL.f₂DotProduct (B i).1 a) (B i).1) ≤ FABL.f₂Codimension H + calc + FABL.functionAlgebraicDegree + (∏ i, FABL.affineFunction + (1 + FABL.f₂DotProduct (B i).1 a) (B i).1) ≤ + ∑ i : Fin (Module.finrank FABL.𝔽₂ P), + FABL.functionAlgebraicDegree + (FABL.affineFunction + (1 + FABL.f₂DotProduct (B i).1 a) (B i).1) := by + simpa using FABL.functionAlgebraicDegree_finset_prod_le + (Finset.univ : Finset (Fin (Module.finrank FABL.𝔽₂ P))) + (fun i ↦ FABL.affineFunction + (1 + FABL.f₂DotProduct (B i).1 a) (B i).1) + _ ≤ ∑ _i : Fin (Module.finrank FABL.𝔽₂ P), 1 := by + apply Finset.sum_le_sum + intro i hi + exact FABL.functionAlgebraicDegree_affineFunction_le_one _ _ + _ = FABL.f₂Codimension H := by simp [FABL.f₂Codimension, P] + +/-- An affine flat of codimension `k` has indicator of algebraic degree exactly `k`. -/ +theorem functionAlgebraicDegree_affineFlatIndicator + (H : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) (a : FABL.F₂Cube n) : + FABL.functionAlgebraicDegree (affineFlatIndicator H a) = + FABL.f₂Codimension H := by + apply Nat.le_antisymm (functionAlgebraicDegree_affineFlatIndicator_le_codimension H a) + by_contra hnot + have hlt : FABL.functionAlgebraicDegree (affineFlatIndicator H a) < + FABL.f₂Codimension H := by + omega + have hcodim : FABL.f₂Codimension H = + n - Module.finrank FABL.𝔽₂ H := by + exact FABL.finrank_perpendicularSubspace H + have hcodimle : FABL.f₂Codimension H ≤ n := by omega + have hcodimpos : 0 < FABL.f₂Codimension H := by + by_contra hzero + have : FABL.f₂Codimension H = 0 := by omega + omega + have hdegreePred : + FABL.functionAlgebraicDegree (affineFlatIndicator H a) ≤ + FABL.f₂Codimension H - 1 := by + omega + have hnonzero : affineFlatIndicator H a ≠ 0 := by + intro hzero + have ha := congrFun hzero a + have hmem : a ∈ FABL.binaryAffineSubspace H a := by + rw [FABL.mem_binaryAffineSubspace_iff_add_mem] + rw [ZModModule.add_self] + exact H.zero_mem + simp [affineFlatIndicator, hmem] at ha + have hlower := two_pow_sub_le_hammingWeight_of_degree_le + (affineFlatIndicator H a) hdegreePred hnonzero + rw [hammingWeight_affineFlatIndicator] at hlower + have hexp : n - (FABL.f₂Codimension H - 1) = + Module.finrank FABL.𝔽₂ H + 1 := by + omega + rw [hexp, pow_succ] at hlower + have hpositive : 0 < 2 ^ Module.finrank FABL.𝔽₂ H := Nat.two_pow_pos _ + omega + +/-- Reverse direction of Carlet Proposition 12: every affine flat of dimension `n - r` has +degree `r` and minimum Reed--Muller weight. -/ +theorem degree_eq_and_hammingWeight_eq_affineFlatIndicator + (H : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) (a : FABL.F₂Cube n) + (hrn : r ≤ n) (hfinrank : Module.finrank FABL.𝔽₂ H = n - r) : + FABL.functionAlgebraicDegree (affineFlatIndicator H a) = r ∧ + hammingWeight (affineFlatIndicator H a) = 2 ^ (n - r) := by + have hcodim : FABL.f₂Codimension H = r := by + rw [FABL.f₂Codimension, FABL.finrank_perpendicularSubspace, hfinrank] + omega + constructor + · rw [functionAlgebraicDegree_affineFlatIndicator, hcodim] + · rw [hammingWeight_affineFlatIndicator, hfinrank] + +/-- A binary Boolean function is the affine-flat indicator exactly when its support is that flat. -/ +theorem eq_affineFlatIndicator_iff_support_eq + (f : BooleanFunction n) (H : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) + (a : FABL.F₂Cube n) : + f = affineFlatIndicator H a ↔ + (support f : Set (FABL.F₂Cube n)) = FABL.binaryAffineSubspace H a := by + constructor + · rintro rfl + ext x + simp + · intro hsupp + funext x + by_cases hx : f x = 0 + · have hnotmem : x ∉ FABL.binaryAffineSubspace H a := by + intro hmem + have hxSupp : x ∈ (support f : Set (FABL.F₂Cube n)) := by + rw [hsupp] + exact hmem + have hxOne := (mem_support f x).1 hxSupp + exact zero_ne_one (hx.symm.trans hxOne) + simp [affineFlatIndicator, hx, hnotmem] + · have hxOne : f x = 1 := Fin.eq_one_of_ne_zero _ hx + have hmem : x ∈ FABL.binaryAffineSubspace H a := by + have hxSupp : x ∈ (support f : Set (FABL.F₂Cube n)) := by + rw [Finset.mem_coe, mem_support] + exact hxOne + rw [hsupp] at hxSupp + exact hxSupp + simp [affineFlatIndicator, hxOne, hmem] + +/-- Forward direction of Carlet Proposition 12: every minimum-weight word is an affine-flat +indicator of dimension `n - r`. -/ +theorem exists_affineFlatIndicator_of_degree_eq_and_hammingWeight_eq + (f : BooleanFunction n) (hrn : r ≤ n) + (hdegree : FABL.functionAlgebraicDegree f = r) + (hweight : hammingWeight f = 2 ^ (n - r)) : + ∃ (H : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) (a : FABL.F₂Cube n), + Module.finrank FABL.𝔽₂ H = n - r ∧ f = affineFlatIndicator H a := by + have hf : f ≠ 0 := by + intro hf + subst f + simp at hweight + exact (pow_ne_zero (n - r) (by norm_num : (2 : ℕ) ≠ 0)) hweight.symm + have hAffine := minimumWeight_support_isBinaryAffineSet f hrn hdegree.le hweight hf + obtain ⟨H, a, hsupp⟩ := + (@isBinaryAffineSet_iff_exists_binaryAffineSubspace n + (support f : Set (FABL.F₂Cube n))).1 hAffine + have hfindicator : f = affineFlatIndicator H a := + (eq_affineFlatIndicator_iff_support_eq f H a).2 hsupp + have hpow : 2 ^ Module.finrank FABL.𝔽₂ H = 2 ^ (n - r) := by + calc + 2 ^ Module.finrank FABL.𝔽₂ H = hammingWeight (affineFlatIndicator H a) := + (hammingWeight_affineFlatIndicator H a).symm + _ = hammingWeight f := by rw [hfindicator] + _ = 2 ^ (n - r) := hweight + have hfinrank : Module.finrank FABL.𝔽₂ H = n - r := + Nat.pow_right_injective (by norm_num) hpow + exact ⟨H, a, hfinrank, hfindicator⟩ + +/-- Carlet Proposition 12: for `0 ≤ r ≤ n`, the Boolean functions of degree `r` and +weight `2^(n-r)` are exactly the indicators of affine flats of dimension `n-r`. -/ +theorem degree_eq_and_hammingWeight_eq_iff_exists_affineFlatIndicator + (f : BooleanFunction n) (hrn : r ≤ n) : + (FABL.functionAlgebraicDegree f = r ∧ hammingWeight f = 2 ^ (n - r)) ↔ + ∃ (H : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) (a : FABL.F₂Cube n), + Module.finrank FABL.𝔽₂ H = n - r ∧ f = affineFlatIndicator H a := by + constructor + · rintro ⟨hdegree, hweight⟩ + exact exists_affineFlatIndicator_of_degree_eq_and_hammingWeight_eq + f hrn hdegree hweight + · rintro ⟨H, a, hfinrank, rfl⟩ + exact degree_eq_and_hammingWeight_eq_affineFlatIndicator H a hrn hfinrank + +/-- Carlet Proposition 12 in support form: the minimum-weight words of degree `r` are exactly +the Boolean functions whose support is an affine flat of dimension `n-r`. -/ +theorem degree_eq_and_hammingWeight_eq_iff_support_is_affineFlat + (f : BooleanFunction n) (hrn : r ≤ n) : + (FABL.functionAlgebraicDegree f = r ∧ hammingWeight f = 2 ^ (n - r)) ↔ + ∃ (H : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) (a : FABL.F₂Cube n), + Module.finrank FABL.𝔽₂ H = n - r ∧ + (support f : Set (FABL.F₂Cube n)) = FABL.binaryAffineSubspace H a := by + rw [degree_eq_and_hammingWeight_eq_iff_exists_affineFlatIndicator f hrn] + constructor + · rintro ⟨H, a, hfinrank, hfunction⟩ + exact ⟨H, a, hfinrank, + (eq_affineFlatIndicator_iff_support_eq f H a).1 hfunction⟩ + · rintro ⟨H, a, hfinrank, hsupp⟩ + exact ⟨H, a, hfinrank, + (eq_affineFlatIndicator_iff_support_eq f H a).2 hsupp⟩ + +end CryptBoolean diff --git a/CryptBoolean/Carlet/Chapter03/ReedMullerWeightSixteenSelfDual.lean b/CryptBoolean/Carlet/Chapter03/ReedMullerWeightSixteenSelfDual.lean new file mode 100644 index 0000000..5961f42 --- /dev/null +++ b/CryptBoolean/Carlet/Chapter03/ReedMullerWeightSixteenSelfDual.lean @@ -0,0 +1,478 @@ +/- +Copyright (c) 2026 Asher Yan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Asher Yan with Codex +-/ +module + +public import CryptBoolean.Carlet.Chapter03.ReedMullerLowWeightAffineSpan + +/-! +# The self-dual code attached to a full-span weight-sixteen word + +For a weight-sixteen word orthogonal to quadratic Boolean functions, affine +linear functions evaluated on its support form a self-orthogonal binary code. +When the affine span has dimension seven, adjoining the constant row gives a +binary self-dual code of length sixteen and dimension eight. +-/ + +open Finset +open scoped BigOperators BooleanCube + +@[expose] public section + +namespace CryptBoolean + +variable {n m : ℕ} + +/-- Prepend a zero coordinate to a binary vector. -/ +def prependZeroLinearMap (m : ℕ) : + FABL.F₂Cube m →ₗ[FABL.𝔽₂] FABL.F₂Cube (m + 1) where + toFun y := Fin.cons 0 y + map_add' y z := by + funext i + refine Fin.cases ?_ (fun j ↦ ?_) i + · simp + · simp + map_smul' c y := by + funext i + refine Fin.cases ?_ (fun j ↦ ?_) i + · simp + · simp + +@[simp] theorem prependZeroLinearMap_zero_apply + (y : FABL.F₂Cube m) : + prependZeroLinearMap m y 0 = 0 := by + rfl + +@[simp] theorem prependZeroLinearMap_succ_apply + (y : FABL.F₂Cube m) (i : Fin m) : + prependZeroLinearMap m y i.succ = y i := by + rfl + +theorem prependZeroLinearMap_injective : + Function.Injective (prependZeroLinearMap m) := by + intro y z hyz + funext i + have hi := congrFun hyz i.succ + simpa using hi + +@[simp] theorem f₂DotProduct_prependZeroLinearMap + (y z : FABL.F₂Cube m) : + FABL.f₂DotProduct (prependZeroLinearMap m y) + (prependZeroLinearMap m z) = + FABL.f₂DotProduct y z := by + simp [FABL.f₂DotProduct, dotProduct, Fin.sum_univ_succ] + +/-- The translated support-difference evaluation code with its deleted +basepoint coordinate restored as zero. -/ +noncomputable def extendedSupportDifferenceEvaluation + (h : BooleanFunction n) (p : FABL.F₂Cube n) : + FABL.F₂Cube n →ₗ[FABL.𝔽₂] + FABL.F₂Cube (((support h).erase p).card + 1) := + (prependZeroLinearMap ((support h).erase p).card).comp + (supportDifferenceEvaluation h p) + +/-- The constant-one word on the restored support coordinates. -/ +def supportDifferenceConstantWord + (h : BooleanFunction n) (p : FABL.F₂Cube n) : + FABL.F₂Cube (((support h).erase p).card + 1) := + 1 + +/-- The support point represented by a restored support coordinate. -/ +noncomputable def restoredSupportPoint + (h : BooleanFunction n) (p : FABL.F₂Cube n) : + Fin (((support h).erase p).card + 1) → FABL.F₂Cube n := + Fin.cases p (fun j ↦ (supportAwayEquiv h p j).1) + +@[simp] theorem restoredSupportPoint_zero + (h : BooleanFunction n) (p : FABL.F₂Cube n) : + restoredSupportPoint h p 0 = p := by + rfl + +@[simp] theorem restoredSupportPoint_succ + (h : BooleanFunction n) (p : FABL.F₂Cube n) + (j : Fin ((support h).erase p).card) : + restoredSupportPoint h p j.succ = (supportAwayEquiv h p j).1 := by + rfl + +/-- Restored support coordinates are pairwise distinct. -/ +theorem restoredSupportPoint_injective + (h : BooleanFunction n) (p : FABL.F₂Cube n) : + Function.Injective (restoredSupportPoint h p) := by + intro i j hij + induction i using Fin.cases with + | zero => + induction j using Fin.cases with + | zero => rfl + | succ j => + have hjAway := (supportAwayEquiv h p j).2 + have hjNe : (supportAwayEquiv h p j).1 ≠ p := + (Finset.mem_erase.mp hjAway).1 + exact (hjNe hij.symm).elim + | succ i => + induction j using Fin.cases with + | zero => + have hiAway := (supportAwayEquiv h p i).2 + have hiNe : (supportAwayEquiv h p i).1 ≠ p := + (Finset.mem_erase.mp hiAway).1 + exact (hiNe hij).elim + | succ j => + have hsub : supportAwayEquiv h p i = + supportAwayEquiv h p j := + Subtype.ext hij + exact congrArg Fin.succ ((supportAwayEquiv h p).injective hsub) + +/-- Evaluation of one translated affine-linear form on the restored support +coordinates. -/ +noncomputable def restoredAffineEvaluationWord + (h : BooleanFunction n) (p : FABL.F₂Cube n) + (c : FABL.𝔽₂) (a : FABL.F₂Cube n) : + FABL.F₂Cube (((support h).erase p).card + 1) := + extendedSupportDifferenceEvaluation h p a + + c • supportDifferenceConstantWord h p + +@[simp] theorem restoredAffineEvaluationWord_apply + (h : BooleanFunction n) (p : FABL.F₂Cube n) + (c : FABL.𝔽₂) (a : FABL.F₂Cube n) + (i : Fin (((support h).erase p).card + 1)) : + restoredAffineEvaluationWord h p c a i = + c + FABL.f₂DotProduct a (restoredSupportPoint h p i + p) := by + induction i using Fin.cases with + | zero => + simp [restoredAffineEvaluationWord, + extendedSupportDifferenceEvaluation, + supportDifferenceConstantWord, FABL.f₂DotProduct, dotProduct, + ZModModule.add_self] + | succ j => + simp [restoredAffineEvaluationWord, + extendedSupportDifferenceEvaluation, + supportDifferenceConstantWord, + supportDifferenceEvaluation_apply, add_comm] + +/-- The code generated by translated affine-linear evaluations on the full +support: the translated linear rows and the constant row. -/ +noncomputable def augmentedSupportDifferenceCode + (h : BooleanFunction n) (p : FABL.F₂Cube n) : + Submodule FABL.𝔽₂ + (FABL.F₂Cube (((support h).erase p).card + 1)) := + LinearMap.range (extendedSupportDifferenceEvaluation h p) ⊔ + FABL.𝔽₂ ∙ supportDifferenceConstantWord h p + +theorem restoredAffineEvaluationWord_mem_augmentedSupportDifferenceCode + (h : BooleanFunction n) (p : FABL.F₂Cube n) + (c : FABL.𝔽₂) (a : FABL.F₂Cube n) : + restoredAffineEvaluationWord h p c a ∈ + augmentedSupportDifferenceCode h p := by + rw [restoredAffineEvaluationWord, augmentedSupportDifferenceCode] + exact Submodule.add_mem _ + (Submodule.mem_sup_left ⟨a, rfl⟩) + (Submodule.mem_sup_right + (Submodule.smul_mem _ c + (Submodule.mem_span_singleton_self _))) + +/-- Distinct restored support coordinates are separated by a generated +affine-evaluation word. -/ +theorem exists_restoredAffineEvaluationWord_ne_of_ne + (h : BooleanFunction n) (p : FABL.F₂Cube n) + {i j : Fin (((support h).erase p).card + 1)} (hij : i ≠ j) : + ∃ y ∈ augmentedSupportDifferenceCode h p, y i ≠ y j := by + have hpoint : restoredSupportPoint h p i ≠ + restoredSupportPoint h p j := by + intro hEq + exact hij (restoredSupportPoint_injective h p hEq) + have hfun : ∃ k, restoredSupportPoint h p i k ≠ + restoredSupportPoint h p j k := by + by_contra h + push Not at h + apply hpoint + funext k + exact h k + obtain ⟨k, hk⟩ := hfun + let a : FABL.F₂Cube n := Pi.single k 1 + refine ⟨restoredAffineEvaluationWord h p 0 a, + restoredAffineEvaluationWord_mem_augmentedSupportDifferenceCode + h p 0 a, ?_⟩ + simp only [restoredAffineEvaluationWord_apply, zero_add, a, + FABL.f₂DotProduct, single_dotProduct, one_mul] + intro heq + exact hk (add_right_cancel heq) + +theorem range_extendedSupportDifferenceEvaluation_le_perpendicular + (h : BooleanFunction n) (p : FABL.F₂Cube n) (hp : p ∈ support h) + (hdual : h ∈ reedMullerDual 2 n) : + LinearMap.range (extendedSupportDifferenceEvaluation h p) ≤ + FABL.perpendicularSubspace + (LinearMap.range (extendedSupportDifferenceEvaluation h p)) := by + have hself := + range_supportDifferenceEvaluation_le_perpendicular h p hp hdual + intro y hy + rw [FABL.mem_perpendicularSubspace_iff] + intro z hz + obtain ⟨a, rfl⟩ := hy + obtain ⟨b, rfl⟩ := hz + rw [extendedSupportDifferenceEvaluation, + LinearMap.comp_apply, LinearMap.comp_apply, + f₂DotProduct_prependZeroLinearMap] + exact (FABL.mem_perpendicularSubspace_iff _ _).1 + (hself ⟨a, rfl⟩) + (supportDifferenceEvaluation h p b) + ⟨b, rfl⟩ + +private theorem binaryScalar_mul_self (b : FABL.𝔽₂) : b * b = b := by + fin_cases b <;> decide + +/-- The nonzero coordinates of a finite binary vector. -/ +def binaryVectorSupport (x : FABL.F₂Cube m) : Finset (Fin m) := + Finset.univ.filter fun i ↦ x i = 1 + +theorem mem_binaryVectorSupport + (x : FABL.F₂Cube m) (i : Fin m) : + i ∈ binaryVectorSupport x ↔ x i = 1 := by + simp [binaryVectorSupport] + +/-- The Hamming weight of a finite binary vector. -/ +def binaryVectorWeight (x : FABL.F₂Cube m) : ℕ := + (binaryVectorSupport x).card + +theorem f₂DotProduct_eq_sum_support + (x y : FABL.F₂Cube m) : + FABL.f₂DotProduct x y = ∑ i ∈ binaryVectorSupport x, y i := by + classical + rw [FABL.f₂DotProduct, dotProduct, binaryVectorSupport, + Finset.sum_filter] + apply Finset.sum_congr rfl + intro i _hi + by_cases hzero : x i = 0 + · simp [hzero] + · have hone : x i = 1 := Fin.eq_one_of_ne_zero _ hzero + simp [hone] + +theorem f₂DotProduct_self_eq_binaryVectorWeight_cast + (x : FABL.F₂Cube m) : + FABL.f₂DotProduct x x = (binaryVectorWeight x : FABL.𝔽₂) := by + rw [f₂DotProduct_eq_sum_support] + calc + (∑ i ∈ binaryVectorSupport x, x i) = + ∑ _i ∈ binaryVectorSupport x, (1 : FABL.𝔽₂) := by + apply Finset.sum_congr rfl + intro i hi + exact (mem_binaryVectorSupport x i).mp hi + _ = ((binaryVectorSupport x).card : FABL.𝔽₂) := by simp + _ = (binaryVectorWeight x : FABL.𝔽₂) := rfl + +theorem even_binaryVectorWeight_of_f₂DotProduct_self_eq_zero + (x : FABL.F₂Cube m) + (hself : FABL.f₂DotProduct x x = 0) : + Even (binaryVectorWeight x) := by + rw [f₂DotProduct_self_eq_binaryVectorWeight_cast, + ZMod.natCast_eq_zero_iff_even] at hself + exact hself + +theorem binaryVectorWeight_pos_of_ne_zero + (x : FABL.F₂Cube m) (hx : x ≠ 0) : + 0 < binaryVectorWeight x := by + apply Nat.pos_of_ne_zero + intro hzero + apply hx + funext i + by_contra hi + have hiOne : x i = 1 := Fin.eq_one_of_ne_zero _ hi + have hiSupport : i ∈ binaryVectorSupport x := + (mem_binaryVectorSupport x i).mpr hiOne + have hcard : (binaryVectorSupport x).card = 0 := hzero + rw [Finset.card_eq_zero.mp hcard] at hiSupport + simp at hiSupport + +@[simp] theorem f₂DotProduct_one_prependZeroLinearMap + (y : FABL.F₂Cube m) : + FABL.f₂DotProduct 1 (prependZeroLinearMap m y) = + FABL.f₂DotProduct y y := by + simp only [FABL.f₂DotProduct, dotProduct, Fin.sum_univ_succ, + Pi.one_apply, prependZeroLinearMap_zero_apply, + prependZeroLinearMap_succ_apply, one_mul, zero_add, + binaryScalar_mul_self] + +theorem supportDifferenceConstantWord_mem_range_perpendicular + (h : BooleanFunction n) (p : FABL.F₂Cube n) (hp : p ∈ support h) + (hdual : h ∈ reedMullerDual 2 n) : + supportDifferenceConstantWord h p ∈ + FABL.perpendicularSubspace + (LinearMap.range (extendedSupportDifferenceEvaluation h p)) := by + rw [FABL.mem_perpendicularSubspace_iff] + intro y hy + obtain ⟨a, rfl⟩ := hy + rw [supportDifferenceConstantWord, + extendedSupportDifferenceEvaluation, LinearMap.comp_apply, + f₂DotProduct_one_prependZeroLinearMap] + have hself := + range_supportDifferenceEvaluation_le_perpendicular h p hp hdual + exact (FABL.mem_perpendicularSubspace_iff _ _).1 + (hself ⟨a, rfl⟩) + (supportDifferenceEvaluation h p a) + ⟨a, rfl⟩ + +theorem f₂DotProduct_supportDifferenceConstantWord_self + (h : BooleanFunction n) (p : FABL.F₂Cube n) (hp : p ∈ support h) + (hweight : hammingWeight h = 16) : + FABL.f₂DotProduct (supportDifferenceConstantWord h p) + (supportDifferenceConstantWord h p) = 0 := by + have hlength : ((support h).erase p).card + 1 = 16 := by + rw [Finset.card_erase_add_one hp, ← hammingWeight_eq_card_support, + hweight] + simp only [FABL.f₂DotProduct, dotProduct, + supportDifferenceConstantWord, Pi.one_apply, mul_one, sum_const, + card_univ, hlength, Fintype.card_fin, nsmul_eq_mul, Nat.cast_ofNat] + decide + +/-- The full affine-evaluation code of a weight-sixteen dual word is +self-orthogonal. -/ +theorem augmentedSupportDifferenceCode_le_perpendicular + (h : BooleanFunction n) (p : FABL.F₂Cube n) (hp : p ∈ support h) + (hdual : h ∈ reedMullerDual 2 n) + (hweight : hammingWeight h = 16) : + augmentedSupportDifferenceCode h p ≤ + FABL.perpendicularSubspace (augmentedSupportDifferenceCode h p) := by + intro x hx + rw [FABL.mem_perpendicularSubspace_iff] + intro y hy + rw [augmentedSupportDifferenceCode] at hx hy + obtain ⟨x₀, hx₀, x₁, hx₁, rfl⟩ := Submodule.mem_sup.mp hx + obtain ⟨y₀, hy₀, y₁, hy₁, rfl⟩ := Submodule.mem_sup.mp hy + obtain ⟨a, rfl⟩ := hx₀ + obtain ⟨b, rfl⟩ := hy₀ + obtain ⟨α, rfl⟩ := Submodule.mem_span_singleton.mp hx₁ + obtain ⟨β, rfl⟩ := Submodule.mem_span_singleton.mp hy₁ + let ea := extendedSupportDifferenceEvaluation h p a + let eb := extendedSupportDifferenceEvaluation h p b + let c := supportDifferenceConstantWord h p + have hEE : FABL.f₂DotProduct ea eb = 0 := by + have hself := + range_extendedSupportDifferenceEvaluation_le_perpendicular + h p hp hdual + exact (FABL.mem_perpendicularSubspace_iff _ _).1 + (hself ⟨a, rfl⟩) eb ⟨b, rfl⟩ + have hCE : FABL.f₂DotProduct c eb = 0 := by + exact (FABL.mem_perpendicularSubspace_iff _ _).1 + (supportDifferenceConstantWord_mem_range_perpendicular + h p hp hdual) eb ⟨b, rfl⟩ + have hEC : FABL.f₂DotProduct ea c = 0 := by + rw [show FABL.f₂DotProduct ea c = + FABL.f₂DotProduct c ea by exact dotProduct_comm _ _] + exact (FABL.mem_perpendicularSubspace_iff _ _).1 + (supportDifferenceConstantWord_mem_range_perpendicular + h p hp hdual) ea ⟨a, rfl⟩ + have hCC : FABL.f₂DotProduct c c = 0 := + f₂DotProduct_supportDifferenceConstantWord_self h p hp hweight + change FABL.f₂DotProduct (ea + α • c) (eb + β • c) = 0 + change ea ⬝ᵥ eb = 0 at hEE + change c ⬝ᵥ eb = 0 at hCE + change ea ⬝ᵥ c = 0 at hEC + change c ⬝ᵥ c = 0 at hCC + simp only [FABL.f₂DotProduct, add_dotProduct, dotProduct_add, + smul_dotProduct, dotProduct_smul, hEE, hCE, hEC, hCC, + smul_zero, zero_add] + +/-- Every nonzero word in the full affine-evaluation code has weight at +least four. -/ +theorem four_le_binaryVectorWeight_of_mem_augmentedSupportDifferenceCode + (h : BooleanFunction n) (p : FABL.F₂Cube n) (hp : p ∈ support h) + (hdual : h ∈ reedMullerDual 2 n) + (hweight : hammingWeight h = 16) + (x : FABL.F₂Cube (((support h).erase p).card + 1)) + (hx : x ∈ augmentedSupportDifferenceCode h p) (hxne : x ≠ 0) : + 4 ≤ binaryVectorWeight x := by + have hselfCode := augmentedSupportDifferenceCode_le_perpendicular + h p hp hdual hweight + have hxx : FABL.f₂DotProduct x x = 0 := + (FABL.mem_perpendicularSubspace_iff _ _).1 (hselfCode hx) x hx + have heven := even_binaryVectorWeight_of_f₂DotProduct_self_eq_zero x hxx + have hpos := binaryVectorWeight_pos_of_ne_zero x hxne + by_contra hfour + have hlt : binaryVectorWeight x < 4 := Nat.lt_of_not_ge hfour + have htwo : binaryVectorWeight x = 2 := by + obtain ⟨k, hk⟩ := heven + omega + have hsupportCard : (binaryVectorSupport x).card = 2 := htwo + obtain ⟨i, j, hij, hsupport⟩ := Finset.card_eq_two.mp hsupportCard + obtain ⟨y, hy, hyij⟩ := + exists_restoredAffineEvaluationWord_ne_of_ne h p hij + have hxy : FABL.f₂DotProduct x y = 0 := + (FABL.mem_perpendicularSubspace_iff _ _).1 (hselfCode hx) y hy + rw [f₂DotProduct_eq_sum_support, hsupport] at hxy + have hsum : y i + y j = 0 := by + simpa only [Finset.sum_insert, Finset.mem_singleton, hij, + not_false_eq_true, Finset.sum_singleton] using hxy + have hyEq : y i = y j := by + have hneg := add_eq_zero_iff_eq_neg.mp hsum + simpa only [ZMod.neg_eq_self_mod_two] using hneg + exact hyij hyEq + +theorem finrank_range_extendedSupportDifferenceEvaluation + (h : BooleanFunction n) (p : FABL.F₂Cube n) : + Module.finrank FABL.𝔽₂ + (LinearMap.range (extendedSupportDifferenceEvaluation h p)) = + Module.finrank FABL.𝔽₂ + (LinearMap.range (supportDifferenceEvaluation h p)) := by + have hker : + LinearMap.ker (extendedSupportDifferenceEvaluation h p) = + LinearMap.ker (supportDifferenceEvaluation h p) := by + ext a + simp only [LinearMap.mem_ker, extendedSupportDifferenceEvaluation, + LinearMap.comp_apply] + constructor + · intro ha + apply prependZeroLinearMap_injective (m := ((support h).erase p).card) + simpa using ha + · intro ha + rw [ha] + exact LinearMap.map_zero _ + have hext := + (extendedSupportDifferenceEvaluation h p).finrank_range_add_finrank_ker + have hbase := + (supportDifferenceEvaluation h p).finrank_range_add_finrank_ker + rw [hker] at hext + omega + +/-- In the full affine-span case the augmented code has dimension eight. -/ +theorem finrank_augmentedSupportDifferenceCode_eq_eight + (h : BooleanFunction n) (p : FABL.F₂Cube n) + (hspan : Module.finrank FABL.𝔽₂ + (supportDifferenceSpan h p) = 7) : + Module.finrank FABL.𝔽₂ + (augmentedSupportDifferenceCode h p) = 8 := by + have hconstantNotRange : + supportDifferenceConstantWord h p ∉ + LinearMap.range (extendedSupportDifferenceEvaluation h p) := by + rintro ⟨a, ha⟩ + have hzero := congrFun ha 0 + simp only [extendedSupportDifferenceEvaluation, LinearMap.comp_apply, + prependZeroLinearMap_zero_apply, supportDifferenceConstantWord, + Pi.one_apply] at hzero + exact zero_ne_one hzero + rw [augmentedSupportDifferenceCode, + Submodule.finrank_sup_span_singleton hconstantNotRange, + finrank_range_extendedSupportDifferenceEvaluation, + ← finrank_supportDifferenceSpan_eq_finrank_range, hspan] + +/-- A full-span weight-sixteen dual word canonically produces a binary +self-dual code of length sixteen and dimension eight. -/ +theorem augmentedSupportDifferenceCode_eq_perpendicular + (h : BooleanFunction n) (p : FABL.F₂Cube n) (hp : p ∈ support h) + (hdual : h ∈ reedMullerDual 2 n) + (hweight : hammingWeight h = 16) + (hspan : Module.finrank FABL.𝔽₂ + (supportDifferenceSpan h p) = 7) : + augmentedSupportDifferenceCode h p = + FABL.perpendicularSubspace (augmentedSupportDifferenceCode h p) := by + have hle := augmentedSupportDifferenceCode_le_perpendicular + h p hp hdual hweight + apply Submodule.eq_of_le_of_finrank_eq hle + rw [FABL.finrank_perpendicularSubspace, + finrank_augmentedSupportDifferenceCode_eq_eight h p hspan] + have hlength : ((support h).erase p).card + 1 = 16 := by + rw [Finset.card_erase_add_one hp, ← hammingWeight_eq_card_support, + hweight] + rw [hlength] + +end CryptBoolean diff --git a/CryptBoolean/Carlet/Chapter04.lean b/CryptBoolean/Carlet/Chapter04.lean new file mode 100644 index 0000000..c420724 --- /dev/null +++ b/CryptBoolean/Carlet/Chapter04.lean @@ -0,0 +1,63 @@ +/- +Copyright (c) 2026 Asher Yan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Asher Yan with Codex +-/ +module + +public import CryptBoolean.Carlet.Chapter04.DegreeCount +public import CryptBoolean.Carlet.Chapter04.Nonlinearity +public import CryptBoolean.Carlet.Chapter04.RandomNonlinearityAsymptotics +public import CryptBoolean.Carlet.Chapter04.RodierLowerTail +public import CryptBoolean.Carlet.Chapter04.RodierSharpAsymptotics +public import CryptBoolean.Carlet.Chapter04.OddDimensionBestNonlinearity +public import CryptBoolean.Carlet.Chapter04.DegreeRepairNonlinearity +public import CryptBoolean.Carlet.Chapter04.SevenVariableMaximumNonlinearity +public import CryptBoolean.Carlet.Chapter04.FiveVariableMaximumNonlinearity +public import CryptBoolean.Carlet.Chapter04.HigherOrderNonlinearity +public import CryptBoolean.Carlet.Chapter04.HigherOrderJuntaDistance +public import CryptBoolean.Carlet.Chapter04.HigherOrderGeneralBounds +public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwo +public import CryptBoolean.Carlet.Chapter04.HigherOrderTupleCounts +public import CryptBoolean.Carlet.Chapter04.HigherOrderTupleCountDifferences +public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightEight +public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightTwelveClassification +public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightFourteenClassification +public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightSixteen +public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightSixteenRankSevenClassification +public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoLowWeightSpectrum +public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoAsymptotics +public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoMomentDifference +public import CryptBoolean.Carlet.Chapter04.HigherOrderSharpAsymptotics +public import CryptBoolean.Carlet.Chapter04.ReedMullerCosetDistance +public import CryptBoolean.Carlet.Chapter04.OddWeightingNonlinearity +public import CryptBoolean.Carlet.Chapter04.Resiliency +public import CryptBoolean.Carlet.Chapter04.SupportDualDistance +public import CryptBoolean.Carlet.Chapter04.CodeGeneratorResiliency +public import CryptBoolean.Carlet.Chapter04.PropagationCriteria +public import CryptBoolean.Carlet.Chapter04.PropagationNonlinearity +public import CryptBoolean.Carlet.Chapter04.AffineReindexResiliency +public import CryptBoolean.Carlet.Chapter04.LinearStructures +public import CryptBoolean.Carlet.Chapter04.LinearStructureNormalForm +public import CryptBoolean.Carlet.Chapter04.LinearKernelNonlinearity +public import CryptBoolean.Carlet.Chapter04.LinearStructureSpectrum +public import CryptBoolean.Carlet.Chapter04.DerivativeNonlinearity +public import CryptBoolean.Carlet.Chapter04.DistanceToLinearStructures +public import CryptBoolean.Carlet.Chapter04.AutocorrelationIndicators +public import CryptBoolean.Carlet.Chapter04.AutocorrelationBounds +public import CryptBoolean.Carlet.Chapter04.AutocorrelationIdentities +public import CryptBoolean.Carlet.Chapter04.IndicatorSpectralBounds +public import CryptBoolean.Carlet.Chapter04.GeneralizedLinearStructureDistance +public import CryptBoolean.Carlet.Chapter04.MaximumCorrelation +public import CryptBoolean.Carlet.Chapter04.AlgebraicImmunity +public import CryptBoolean.Carlet.Chapter04.AnnihilatorLinearSystem +public import CryptBoolean.Carlet.Chapter04.FastAlgebraic +public import CryptBoolean.Carlet.Chapter04.AlgebraicImmunityBounds +public import CryptBoolean.Carlet.Chapter04.OtherComplexity +public import CryptBoolean.Carlet.Chapter04.KthNonhomomorphicity + +/-! +# Carlet Chapter 4 + +Boolean functions and cryptography. +-/ diff --git a/CryptBoolean/Carlet/Chapter04/AffineReindexResiliency.lean b/CryptBoolean/Carlet/Chapter04/AffineReindexResiliency.lean new file mode 100644 index 0000000..8790a0a --- /dev/null +++ b/CryptBoolean/Carlet/Chapter04/AffineReindexResiliency.lean @@ -0,0 +1,166 @@ +/- +Copyright (c) 2026 Asher Yan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Asher Yan with Codex +-/ +module + +public import CryptBoolean.Carlet.Chapter04.Resiliency +public import FABL.Chapter06.Constructions.BentFunctions +public import Mathlib.LinearAlgebra.FiniteDimensional.Lemmas + +/-! +# Carlet Chapter 4 affine reindexing to first-order resiliency + +A basis of zero-Walsh frequencies determines a dual linear change of input +coordinates whose coordinate frequencies all have zero Walsh coefficient. +-/ + +open Finset Module +open scoped BooleanCube + +@[expose] public section + +namespace CryptBoolean + +variable {n : ℕ} + +/-- The coordinate map associated with a family of Walsh frequencies. -/ +def walshCoordinateLinearMap (u : Fin n → FABL.F₂Cube n) : + FABL.F₂Cube n →ₗ[FABL.𝔽₂] FABL.F₂Cube n where + toFun y i := FABL.f₂DotProduct (u i) y + map_add' y z := by + funext i + exact (FABL.f₂DotProductBilin n (u i)).map_add y z + map_smul' c y := by + funext i + exact (FABL.f₂DotProductBilin n (u i)).map_smul c y + +/-- A linearly independent full family of Walsh frequencies gives an +injective coordinate map. -/ +theorem walshCoordinateLinearMap_injective + (u : Fin n → FABL.F₂Cube n) + (hu : LinearIndependent FABL.𝔽₂ u) : + Function.Injective (walshCoordinateLinearMap u) := by + intro y z hyz + have hy : walshCoordinateLinearMap u (y - z) = 0 := by + rw [(walshCoordinateLinearMap u).map_sub, hyz, sub_self] + let B : Basis (Fin n) FABL.𝔽₂ (FABL.F₂Cube n) := + basisOfLinearIndependentOfCardEqFinrank' u hu (by + simp [Module.finrank_fintype_fun_eq_card]) + have hfunctional : + (dotProductEquiv FABL.𝔽₂ (Fin n)) (y - z) = 0 := by + apply B.ext + intro i + change dotProduct (y - z) (B i) = 0 + rw [show B i = u i by simp [B]] + rw [dotProduct_comm] + exact congrFun hy i + have hyzero : y - z = 0 := by + apply (dotProductEquiv FABL.𝔽₂ (Fin n)).injective + simpa using hfunctional + exact sub_eq_zero.mp hyzero + +/-- The input reindexing dual to a basis of prescribed Walsh frequencies. -/ +noncomputable def walshReindexLinearEquiv + (u : Fin n → FABL.F₂Cube n) + (hu : LinearIndependent FABL.𝔽₂ u) : + FABL.F₂Cube n ≃ₗ[FABL.𝔽₂] FABL.F₂Cube n := + (LinearEquiv.ofInjectiveEndo (walshCoordinateLinearMap u) + (walshCoordinateLinearMap_injective u hu)).symm + +/-- The dual frequency of a standard coordinate under the constructed +reindexing is the prescribed Walsh frequency. -/ +theorem bentDualFrequency_walshReindexLinearEquiv_single + (u : Fin n → FABL.F₂Cube n) + (hu : LinearIndependent FABL.𝔽₂ u) (i : Fin n) : + FABL.bentDualFrequency (walshReindexLinearEquiv u hu) + (FABL.f₂CubeOfFinset {i}) = u i := by + apply (dotProductEquiv FABL.𝔽₂ (Fin n)).injective + apply LinearMap.ext + intro y + change FABL.f₂DotProduct + (FABL.bentDualFrequency (walshReindexLinearEquiv u hu) + (FABL.f₂CubeOfFinset {i})) y = + FABL.f₂DotProduct (u i) y + rw [FABL.f₂DotProduct_bentDualFrequency] + simp [walshReindexLinearEquiv, walshCoordinateLinearMap, + FABL.f₂DotProduct, FABL.f₂CubeOfFinset_apply, dotProduct] + +/-- Raw Walsh coefficients are reindexed by the dual frequency under an +invertible linear change of variables. -/ +theorem walshTransform_linearReindex_cast + (f : BooleanFunction n) + (M : FABL.F₂Cube n ≃ₗ[FABL.𝔽₂] FABL.F₂Cube n) + (γ : FABL.F₂Cube n) : + (walshTransform (f ∘ M) γ : ℝ) = + (walshTransform f (FABL.bentDualFrequency M γ) : ℝ) := by + rw [walshTransform_eq_two_pow_mul_vectorFourierCoeff, + walshTransform_eq_two_pow_mul_vectorFourierCoeff] + change (2 : ℝ) ^ n * + FABL.vectorFourierCoeff + (FABL.bentLinearReindex M (realSignView f)) γ = _ + rw [FABL.vectorFourierCoeff_bentLinearReindex] + +/-- The dual reindexing fixes the zero frequency. -/ +@[simp] theorem bentDualFrequency_zero + (M : FABL.F₂Cube n ≃ₗ[FABL.𝔽₂] FABL.F₂Cube n) : + FABL.bentDualFrequency M 0 = 0 := by + apply (dotProductEquiv FABL.𝔽₂ (Fin n)).injective + apply LinearMap.ext + intro y + change FABL.f₂DotProduct (FABL.bentDualFrequency M 0) y = + FABL.f₂DotProduct 0 y + rw [FABL.f₂DotProduct_bentDualFrequency] + simp [FABL.f₂DotProduct] + +/-- Linear input reindexing preserves balancedness. -/ +theorem isBalanced_linearReindex + (f : BooleanFunction n) + (M : FABL.F₂Cube n ≃ₗ[FABL.𝔽₂] FABL.F₂Cube n) + (hf : IsBalanced f) : + IsBalanced (f ∘ M) := by + rw [isBalanced_iff_walshTransform_zero_eq_zero] at hf ⊢ + apply Int.cast_injective (α := ℝ) + rw [Int.cast_zero, walshTransform_linearReindex_cast, + bentDualFrequency_zero] + exact_mod_cast hf + +/-- Carlet's concluding observation in Chapter 4: a balanced function with +a basis of zero-Walsh frequencies becomes first-order resilient after a +linear input automorphism. -/ +theorem exists_linearEquiv_isResilient_one + (f : BooleanFunction n) (u : Fin n → FABL.F₂Cube n) + (hu : LinearIndependent FABL.𝔽₂ u) + (hbalanced : IsBalanced f) + (hzero : ∀ i, walshTransform f (u i) = 0) : + ∃ M : FABL.F₂Cube n ≃ₗ[FABL.𝔽₂] FABL.F₂Cube n, + IsResilient 1 (f ∘ M) := by + let M := walshReindexLinearEquiv u hu + refine ⟨M, (isResilient_iff_fabl 1 (f ∘ M)).mpr ?_⟩ + refine ⟨?_, (isBalanced_iff_fabl (f ∘ M)).mp + (isBalanced_linearReindex f M hbalanced)⟩ + rw [FABL.IsCorrelationImmune, FABL.IsLowDegreeFourierRegular] + intro S hS hScard + have hcard : S.card = 1 := + Nat.le_antisymm hScard (Finset.card_pos.mpr hS) + obtain ⟨i, rfl⟩ := Finset.card_eq_one.mp hcard + have hwalsh : + walshTransform (f ∘ M) (FABL.f₂CubeOfFinset {i}) = 0 := by + apply Int.cast_injective (α := ℝ) + rw [Int.cast_zero, walshTransform_linearReindex_cast, + bentDualFrequency_walshReindexLinearEquiv_single] + exact_mod_cast hzero i + have hvector := + (walshTransform_eq_zero_iff_vectorFourierCoeff_eq_zero + (f ∘ M) (FABL.f₂CubeOfFinset {i})).mp hwalsh + have hsupport : FABL.f₂Support (FABL.f₂CubeOfFinset {i}) = {i} := + (FABL.f₂CubeEquivFinset n).right_inv {i} + have hfourier : + FABL.fourierCoeff (signCubeView (f ∘ M)).toReal {i} = 0 := by + rw [signCubeView_toReal, ← hsupport] + exact (FABL.vectorFourierCoeff_eq_fourierCoeff_binaryFunctionOnSignCube + (realSignView (f ∘ M)) (FABL.f₂CubeOfFinset {i})).symm.trans hvector + simp [hfourier] + +end CryptBoolean diff --git a/CryptBoolean/Carlet/Chapter04/AlgebraicImmunity.lean b/CryptBoolean/Carlet/Chapter04/AlgebraicImmunity.lean new file mode 100644 index 0000000..c8fd4e6 --- /dev/null +++ b/CryptBoolean/Carlet/Chapter04/AlgebraicImmunity.lean @@ -0,0 +1,245 @@ +/- +Copyright (c) 2026 Asher Yan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Asher Yan with Codex +-/ +module + +public import CryptBoolean.Carlet.Chapter02.Affine +public import Mathlib.RingTheory.Ideal.Basic + +/-! +# Carlet Chapter 4 algebraic immunity + +Boolean-function annihilators, their principal ideal, algebraic immunity, affine invariance, and +the low-degree relation equivalence from Carlet Section 4.1.6. +-/ + +open scoped BooleanCube + +@[expose] public section + +namespace CryptBoolean + +variable {n : ℕ} + +/-- The support of a pointwise product is the intersection of the two supports. -/ +theorem support_mul (f g : BooleanFunction n) : + support (f * g) = support f ∩ support g := by + ext x + simp only [mem_support, Finset.mem_inter, Pi.mul_apply] + constructor + · intro h + have hne : f x * g x ≠ 0 := by rw [h]; exact one_ne_zero + exact ⟨Fin.eq_one_of_ne_zero _ (mul_ne_zero_iff.mp hne).1, + Fin.eq_one_of_ne_zero _ (mul_ne_zero_iff.mp hne).2⟩ + · rintro ⟨hf, hg⟩ + simp [hf, hg] + +/-- Every binary-valued function is idempotent under pointwise multiplication. -/ +theorem booleanFunction_mul_self (f : BooleanFunction n) : + f * f = f := by + funext x + change f x * f x = f x + by_cases hx : f x = 0 + · simp [hx] + · have hx1 : f x = (1 : FABL.𝔽₂) := Fin.eq_one_of_ne_zero _ hx + rw [hx1] + exact one_mul 1 + +/-- A Boolean function and its complement have disjoint pointwise product. -/ +theorem booleanFunction_mul_complement (f : BooleanFunction n) : + f * (f + 1) = 0 := by + rw [mul_add, mul_one, booleanFunction_mul_self, ZModModule.add_self] + +/-- A nonzero Boolean function whose pointwise product with `f` vanishes. -/ +def IsAnnihilator (f g : BooleanFunction n) : Prop := + g ≠ 0 ∧ f * g = 0 + +/-- The ideal of all (possibly zero) annihilators of `f`, generated by its complement. -/ +noncomputable def annihilatorIdeal (f : BooleanFunction n) : + Ideal (BooleanFunction n) := + Ideal.span {f + 1} + +/-- Membership in the annihilator ideal is exactly vanishing of the pointwise product with `f`. -/ +theorem mem_annihilatorIdeal_iff (f g : BooleanFunction n) : + g ∈ annihilatorIdeal f ↔ f * g = 0 := by + constructor + · intro hg + obtain ⟨a, ha⟩ := Ideal.mem_span_singleton'.mp hg + rw [← ha] + calc + f * (a * (f + 1)) = a * (f * (f + 1)) := by ac_rfl + _ = 0 := by rw [booleanFunction_mul_complement, mul_zero] + · intro hg + apply Ideal.mem_span_singleton'.mpr + refine ⟨g, ?_⟩ + calc + g * (f + 1) = g * f + g := by rw [mul_add, mul_one] + _ = f * g + g := by rw [mul_comm g f] + _ = 0 + g := by rw [hg] + _ = g := zero_add g + +/-- Nonzero elements of the annihilator ideal are precisely Carlet annihilators. -/ +theorem isAnnihilator_iff_mem_annihilatorIdeal (f g : BooleanFunction n) : + IsAnnihilator f g ↔ g ≠ 0 ∧ g ∈ annihilatorIdeal f := by + rw [IsAnnihilator, mem_annihilatorIdeal_iff] + +/-- A witness for algebraic immunity annihilates either `f` or its complement. -/ +def IsAlgebraicImmunityWitness (f g : BooleanFunction n) : Prop := + IsAnnihilator f g ∨ IsAnnihilator (f + 1) g + +/-- The finite family over which algebraic immunity takes its minimum. -/ +noncomputable def algebraicImmunityCandidates + (f : BooleanFunction n) : Finset (BooleanFunction n) := + by + classical + exact Finset.univ.filter (IsAlgebraicImmunityWitness f) + +/-- Membership in the candidate family is the defining annihilator disjunction. -/ +theorem mem_algebraicImmunityCandidates (f g : BooleanFunction n) : + g ∈ algebraicImmunityCandidates f ↔ IsAlgebraicImmunityWitness f g := by + classical + simp [algebraicImmunityCandidates] + +/-- Every Boolean function has a nonzero annihilator on one side of the complement pair. -/ +theorem algebraicImmunityCandidates_nonempty (f : BooleanFunction n) : + (algebraicImmunityCandidates f).Nonempty := by + classical + by_cases hf : f = 0 + · refine ⟨1, (mem_algebraicImmunityCandidates f 1).2 ?_⟩ + left + subst f + exact ⟨one_ne_zero, zero_mul 1⟩ + · refine ⟨f, (mem_algebraicImmunityCandidates f f).2 ?_⟩ + right + refine ⟨hf, ?_⟩ + rw [mul_comm] + exact booleanFunction_mul_complement f + +/-- Algebraic immunity is the least algebraic degree of a nonzero annihilator of `f` or `f+1`. -/ +noncomputable def algebraicImmunity (f : BooleanFunction n) : ℕ := + (algebraicImmunityCandidates f).inf' + (algebraicImmunityCandidates_nonempty f) + FABL.functionAlgebraicDegree + +/-- Algebraic immunity is bounded by the degree of every annihilator witness. -/ +theorem algebraicImmunity_le_functionAlgebraicDegree + (f g : BooleanFunction n) (hg : IsAlgebraicImmunityWitness f g) : + algebraicImmunity f ≤ FABL.functionAlgebraicDegree g := by + classical + exact Finset.inf'_le _ ((mem_algebraicImmunityCandidates f g).2 hg) + +/-- The finite witness family contains an annihilator attaining algebraic immunity. -/ +theorem exists_witness_functionAlgebraicDegree_eq_algebraicImmunity + (f : BooleanFunction n) : + ∃ g : BooleanFunction n, IsAlgebraicImmunityWitness f g ∧ + FABL.functionAlgebraicDegree g = algebraicImmunity f := by + classical + obtain ⟨g, hg, hdegree⟩ := Finset.exists_mem_eq_inf' + (s := algebraicImmunityCandidates f) + (algebraicImmunityCandidates_nonempty f) + FABL.functionAlgebraicDegree + exact ⟨g, (mem_algebraicImmunityCandidates f g).1 hg, hdegree.symm⟩ + +/-- Affine input reindexing preserves the annihilator relation. -/ +theorem IsAnnihilator.comp_affineEquiv + {f g : BooleanFunction n} (h : IsAnnihilator f g) + (L : FABL.F₂Cube n ≃ᵃ[FABL.𝔽₂] FABL.F₂Cube n) : + IsAnnihilator (f ∘ L) (g ∘ L) := by + constructor + · intro hzero + apply h.1 + funext x + have hx := congrFun hzero (L.symm x) + simpa using hx + · funext x + simpa [Function.comp_apply] using congrFun h.2 (L x) + +/-- Affine input reindexing transports algebraic-immunity witnesses. -/ +theorem IsAlgebraicImmunityWitness.comp_affineEquiv + {f g : BooleanFunction n} (h : IsAlgebraicImmunityWitness f g) + (L : FABL.F₂Cube n ≃ᵃ[FABL.𝔽₂] FABL.F₂Cube n) : + IsAlgebraicImmunityWitness (f ∘ L) (g ∘ L) := by + rcases h with h | h + · exact Or.inl (h.comp_affineEquiv L) + · right + have hcomp := h.comp_affineEquiv L + refine ⟨hcomp.1, ?_⟩ + funext x + simpa [Function.comp_apply] using congrFun hcomp.2 x + +/-- One half of affine invariance of algebraic immunity. -/ +theorem algebraicImmunity_comp_affineEquiv_le + (f : BooleanFunction n) + (L : FABL.F₂Cube n ≃ᵃ[FABL.𝔽₂] FABL.F₂Cube n) : + algebraicImmunity (f ∘ L) ≤ algebraicImmunity f := by + obtain ⟨g, hg, hdegree⟩ := + exists_witness_functionAlgebraicDegree_eq_algebraicImmunity f + calc + algebraicImmunity (f ∘ L) ≤ + FABL.functionAlgebraicDegree (g ∘ L) := + algebraicImmunity_le_functionAlgebraicDegree + (f ∘ L) (g ∘ L) (hg.comp_affineEquiv L) + _ = FABL.functionAlgebraicDegree g := + FABL.functionAlgebraicDegree_comp_affineEquiv g L + _ = algebraicImmunity f := hdegree + +/-- Algebraic immunity is invariant under affine equivalence. -/ +theorem algebraicImmunity_comp_affineEquiv + (f : BooleanFunction n) + (L : FABL.F₂Cube n ≃ᵃ[FABL.𝔽₂] FABL.F₂Cube n) : + algebraicImmunity (f ∘ L) = algebraicImmunity f := by + apply Nat.le_antisymm + (algebraicImmunity_comp_affineEquiv_le f L) + have h := algebraicImmunity_comp_affineEquiv_le (f ∘ L) L.symm + have hcomp : (f ∘ L) ∘ L.symm = f := by + funext x + simp + rw [hcomp] at h + exact h + +/-- A nonzero low-degree relation `f*g=h` exists exactly when `f` or `f+1` has a nonzero +annihilator of the same degree bound. -/ +theorem exists_lowDegreeRelation_iff_exists_algebraicImmunityWitness + (f : BooleanFunction n) (d : ℕ) : + (∃ g h : BooleanFunction n, + g ≠ 0 ∧ + FABL.functionAlgebraicDegree g ≤ d ∧ + FABL.functionAlgebraicDegree h ≤ d ∧ + f * g = h) ↔ + (∃ q : BooleanFunction n, + q ≠ 0 ∧ + FABL.functionAlgebraicDegree q ≤ d ∧ + (f * q = 0 ∨ (f + 1) * q = 0)) := by + constructor + · rintro ⟨g, h, hg, hgdegree, hhdegree, hrelation⟩ + by_cases hgh : g = h + · refine ⟨g, hg, hgdegree, Or.inr ?_⟩ + rw [add_mul, one_mul, hrelation, ← hgh, ZModModule.add_self] + · refine ⟨g + h, ?_, ?_, Or.inl ?_⟩ + · intro hzero + apply hgh + exact (eq_neg_of_add_eq_zero_left hzero).trans (ZModModule.neg_eq_self h) + · exact (FABL.functionAlgebraicDegree_add_le_max g h).trans + (max_le hgdegree hhdegree) + · have hfh : f * h = h := by + calc + f * h = f * (f * g) := by rw [hrelation] + _ = (f * f) * g := by rw [mul_assoc] + _ = f * g := by rw [booleanFunction_mul_self] + _ = h := hrelation + rw [mul_add, hrelation, hfh, ZModModule.add_self] + · rintro ⟨q, hq, hqdegree, hzero | hzero⟩ + · exact ⟨q, 0, hq, hqdegree, by simp, hzero⟩ + · refine ⟨q, q, hq, hqdegree, hqdegree, ?_⟩ + have hsum : f * q + q = 0 := by + simpa only [add_mul, one_mul] using hzero + calc + f * q = f * q + 0 := (add_zero _).symm + _ = f * q + (q + q) := by rw [ZModModule.add_self] + _ = (f * q + q) + q := by rw [add_assoc] + _ = 0 + q := by rw [hsum] + _ = q := zero_add q + +end CryptBoolean diff --git a/CryptBoolean/Carlet/Chapter04/AlgebraicImmunityBounds.lean b/CryptBoolean/Carlet/Chapter04/AlgebraicImmunityBounds.lean new file mode 100644 index 0000000..95d9ff2 --- /dev/null +++ b/CryptBoolean/Carlet/Chapter04/AlgebraicImmunityBounds.lean @@ -0,0 +1,344 @@ +/- +Copyright (c) 2026 Asher Yan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Asher Yan with Codex +-/ +module + +public import CryptBoolean.Carlet.Chapter04.FastAlgebraic +public import CryptBoolean.Carlet.Chapter04.LinearStructureNormalForm +public import Mathlib.LinearAlgebra.Prod + +/-! +# Upper bounds on algebraic immunity + +The universal half-dimension bound, its functorial form under surjective affine +factorization, and the improvement supplied by a large linear kernel. +-/ + +open Finset +open scoped BigOperators BooleanCube + +@[expose] public section + +namespace CryptBoolean + +variable {m n k : ℕ} + +/-- Every coordinate of an affine map between binary cubes has algebraic degree at most one. -/ +theorem functionAlgebraicDegree_affineMap_coordinate_le_one_general + (L : FABL.F₂Cube n →ᵃ[FABL.𝔽₂] FABL.F₂Cube m) (i : Fin m) : + FABL.functionAlgebraicDegree (fun x ↦ L x i) ≤ 1 := by + have hlinear : FABL.IsF₂Linear (fun x ↦ L.linear x i) := by + intro x y + exact congrArg (fun z ↦ z i) (L.linear.map_add x y) + obtain ⟨a, ha⟩ := (FABL.isF₂Linear_iff_exists_dotProduct _).mp hlinear + have hcoordinate : + (fun x ↦ L x i) = FABL.affineFunction (L 0 i) a := by + funext x + have hdecomp : L x = L.linear x + L 0 := by + simpa using congrFun (AffineMap.decomp L) x + calc + L x i = L.linear x i + L 0 i := by + simpa using congrArg (fun z ↦ z i) hdecomp + _ = FABL.f₂DotProduct a x + L 0 i := by rw [ha x] + _ = L 0 i + FABL.f₂DotProduct a x := add_comm _ _ + _ = FABL.affineFunction (L 0 i) a x := rfl + rw [hcoordinate] + exact FABL.functionAlgebraicDegree_affineFunction_le_one (L 0 i) a + +/-- Substituting affine coordinates of a different ambient dimension into an ANF monomial +does not increase its degree. -/ +theorem functionAlgebraicDegree_anfMonomial_comp_affineMap_le_card_general + (L : FABL.F₂Cube n →ᵃ[FABL.𝔽₂] FABL.F₂Cube m) + (S : Finset (Fin m)) : + FABL.functionAlgebraicDegree (fun x ↦ FABL.anfMonomial S (L x)) ≤ S.card := by + calc + FABL.functionAlgebraicDegree (fun x ↦ FABL.anfMonomial S (L x)) ≤ + ∑ i ∈ S, FABL.functionAlgebraicDegree (fun x ↦ L x i) := by + have hfunctions : (∏ i ∈ S, (fun x ↦ L x i)) = + (fun x ↦ FABL.anfMonomial S (L x)) := by + funext x + simp [FABL.anfMonomial, Finset.prod_apply] + rw [← hfunctions] + exact FABL.functionAlgebraicDegree_finset_prod_le S (fun i x ↦ L x i) + _ ≤ ∑ _i ∈ S, 1 := by + apply Finset.sum_le_sum + intro i _ + exact functionAlgebraicDegree_affineMap_coordinate_le_one_general L i + _ = S.card := by simp + +/-- Composition with an affine map between binary cubes cannot increase algebraic degree. -/ +theorem functionAlgebraicDegree_comp_affineMap_le_general + (f : BooleanFunction m) + (L : FABL.F₂Cube n →ᵃ[FABL.𝔽₂] FABL.F₂Cube m) : + FABL.functionAlgebraicDegree (f ∘ L) ≤ + FABL.functionAlgebraicDegree f := by + classical + let term : Finset (Fin m) → BooleanFunction n := + fun S x ↦ FABL.anfCoeff f S * FABL.anfMonomial S (L x) + have hsum : f ∘ L = ∑ S, term S := by + funext x + simp only [Function.comp_apply, Fintype.sum_apply, term] + exact (congrFun (FABL.anfEval_anfCoeff f) (L x)).symm + rw [hsum] + exact FABL.functionAlgebraicDegree_finset_sum_le Finset.univ term + (FABL.functionAlgebraicDegree f) (by + intro S _ + by_cases hS : FABL.anfCoeff f S = 0 + · have hterm : term S = 0 := by + funext x + simp [term, hS] + rw [hterm, FABL.functionAlgebraicDegree_zero] + exact Nat.zero_le _ + · have hSone : FABL.anfCoeff f S = 1 := Fin.eq_one_of_ne_zero _ hS + have hterm : term S = fun x ↦ FABL.anfMonomial S (L x) := by + funext x + simp [term, hSone] + rw [hterm] + apply (functionAlgebraicDegree_anfMonomial_comp_affineMap_le_card_general + L S).trans + exact (FABL.algebraicDegree_le_iff (FABL.anfCoeff f) _).mp + (by rfl) S hS) + +private theorem IsAlgebraicImmunityWitness.comp_surjectiveAffineMap + {f g : BooleanFunction m} (h : IsAlgebraicImmunityWitness f g) + (L : FABL.F₂Cube n →ᵃ[FABL.𝔽₂] FABL.F₂Cube m) + (hL : Function.Surjective L) : + IsAlgebraicImmunityWitness (f ∘ L) (g ∘ L) := by + have hnonzero (hg : g ≠ 0) : g ∘ L ≠ 0 := by + intro hzero + apply hg + funext y + obtain ⟨x, rfl⟩ := hL y + exact congrFun hzero x + rcases h with h | h + · left + refine ⟨hnonzero h.1, ?_⟩ + funext x + simpa [Function.comp_apply] using congrFun h.2 (L x) + · right + refine ⟨hnonzero h.1, ?_⟩ + funext x + simpa [Function.comp_apply] using congrFun h.2 (L x) + +/-- Pulling a Boolean function back along a surjective affine map cannot increase +algebraic immunity. -/ +theorem algebraicImmunity_comp_surjectiveAffineMap_le + (f : BooleanFunction m) + (L : FABL.F₂Cube n →ᵃ[FABL.𝔽₂] FABL.F₂Cube m) + (hL : Function.Surjective L) : + algebraicImmunity (f ∘ L) ≤ algebraicImmunity f := by + obtain ⟨g, hg, hdegree⟩ := + exists_witness_functionAlgebraicDegree_eq_algebraicImmunity f + calc + algebraicImmunity (f ∘ L) ≤ + FABL.functionAlgebraicDegree (g ∘ L) := + algebraicImmunity_le_functionAlgebraicDegree (f ∘ L) (g ∘ L) + (hg.comp_surjectiveAffineMap L hL) + _ ≤ FABL.functionAlgebraicDegree g := + functionAlgebraicDegree_comp_affineMap_le_general g L + _ = algebraicImmunity f := hdegree + +/-- Carlet's universal algebraic-immunity bound `AI(f) ≤ ⌈n/2⌉`. -/ +theorem algebraicImmunity_le_ceiling_half (f : BooleanFunction n) : + algebraicImmunity f ≤ (n + 1) / 2 := by + let d := (n + 1) / 2 + have hsum : n ≤ d + d := by + dsimp [d] + omega + obtain ⟨g, h, hg, hgdegree, hhdegree, hrelation⟩ := + exists_fastAlgebraicRelation_of_add_ge (f := f) (e := d) (d := d) hsum + obtain ⟨q, hq, hqdegree, hzero⟩ := + (exists_lowDegreeRelation_iff_exists_algebraicImmunityWitness f d).mp + ⟨g, h, hg, hgdegree, hhdegree, hrelation⟩ + have hwitness : IsAlgebraicImmunityWitness f q := by + rcases hzero with hzero | hzero + · exact Or.inl ⟨hq, hzero⟩ + · exact Or.inr ⟨hq, hzero⟩ + exact (algebraicImmunity_le_functionAlgebraicDegree f q hwitness).trans hqdegree + +/-- A function factors through at most `k` affine coordinates when it is the pullback of a +`k`-variable Boolean function along a surjective affine map. -/ +def HasSurjectiveAffineFactorization (f : BooleanFunction n) (k : ℕ) : Prop := + ∃ (L : FABL.F₂Cube n →ᵃ[FABL.𝔽₂] FABL.F₂Cube k) + (g : BooleanFunction k), + Function.Surjective L ∧ f = g ∘ L + +/-- Carlet's `k`-variable refinement: affine factorization through `k` coordinates gives +`AI(f) ≤ ⌈k/2⌉`. -/ +theorem algebraicImmunity_le_ceiling_half_of_hasSurjectiveAffineFactorization + (f : BooleanFunction n) (hf : HasSurjectiveAffineFactorization f k) : + algebraicImmunity f ≤ (k + 1) / 2 := by + obtain ⟨L, g, hL, rfl⟩ := hf + exact (algebraicImmunity_comp_surjectiveAffineMap_le g L hL).trans + (algebraicImmunity_le_ceiling_half g) + +private def splitCubeLinearEquiv (m k : ℕ) : + FABL.F₂Cube (m + k) ≃ₗ[FABL.𝔽₂] + (FABL.F₂Cube m × FABL.F₂Cube k) where + __ := (Fin.appendEquiv m k).symm + map_add' _ _ := by + apply Prod.ext <;> funext i <;> rfl + map_smul' _ _ := by + apply Prod.ext <;> funext i <;> rfl + +private def singletonCubeLinearEquiv : + FABL.𝔽₂ ≃ₗ[FABL.𝔽₂] FABL.F₂Cube 1 where + toFun a := ![a] + invFun x := x 0 + left_inv _ := rfl + right_inv x := by + funext i + fin_cases i + rfl + map_add' _ _ := by + funext i + fin_cases i + rfl + map_smul' _ _ := by + funext i + fin_cases i + rfl + +private def tailDotLinearMap (a : FABL.F₂Cube k) : + FABL.F₂Cube k →ₗ[FABL.𝔽₂] FABL.𝔽₂ where + toFun y := FABL.f₂DotProduct a y + map_add' y z := by + simp [FABL.f₂DotProduct, dotProduct, Finset.sum_add_distrib, mul_add] + map_smul' c y := by + rw [FABL.f₂DotProduct, FABL.f₂DotProduct, dotProduct, dotProduct] + simp only [Pi.smul_apply, smul_eq_mul, RingHom.id_apply] + calc + ∑ i, a i * (c * y i) = ∑ i, c * (a i * y i) := by + apply Finset.sum_congr rfl + intro i _ + ring + _ = c * ∑ i, a i * y i := by rw [Finset.mul_sum] + +private def headFactorLinearMap + (L : FABL.F₂Cube (m + k) ≃ₗ[FABL.𝔽₂] FABL.F₂Cube (m + k)) : + FABL.F₂Cube (m + k) →ₗ[FABL.𝔽₂] FABL.F₂Cube m := + (LinearMap.fst FABL.𝔽₂ (FABL.F₂Cube m) (FABL.F₂Cube k)).comp + ((splitCubeLinearEquiv m k).toLinearMap.comp L.symm.toLinearMap) + +private def separatedFactorLinearMap + (L : FABL.F₂Cube (m + k) ≃ₗ[FABL.𝔽₂] FABL.F₂Cube (m + k)) + (a : FABL.F₂Cube k) : + FABL.F₂Cube (m + k) →ₗ[FABL.𝔽₂] FABL.F₂Cube (m + 1) := + (splitCubeLinearEquiv m 1).symm.toLinearMap.comp + ((headFactorLinearMap L).prod + (singletonCubeLinearEquiv.toLinearMap.comp + ((tailDotLinearMap a).comp + ((LinearMap.snd FABL.𝔽₂ (FABL.F₂Cube m) (FABL.F₂Cube k)).comp + ((splitCubeLinearEquiv m k).toLinearMap.comp L.symm.toLinearMap))))) + +private theorem tailDotLinearMap_surjective + (a : FABL.F₂Cube k) (ha : a ≠ 0) : + Function.Surjective (tailDotLinearMap a) := by + have hexists : ∃ i : Fin k, a i ≠ 0 := by + by_contra h + push Not at h + apply ha + funext i + exact h i + obtain ⟨i, hi⟩ := hexists + have hiOne : a i = 1 := Fin.eq_one_of_ne_zero _ hi + intro b + let y : FABL.F₂Cube k := fun j ↦ if j = i then b else 0 + refine ⟨y, ?_⟩ + change FABL.f₂DotProduct a y = b + rw [FABL.f₂DotProduct, dotProduct, Finset.sum_eq_single i] + · simp [y, hiOne] + · intro j _ hji + simp [y, hji] + · simp + +private theorem headFactorLinearMap_surjective + (L : FABL.F₂Cube (m + k) ≃ₗ[FABL.𝔽₂] FABL.F₂Cube (m + k)) : + Function.Surjective (headFactorLinearMap L) := by + intro x + refine ⟨L (Fin.append x 0), ?_⟩ + simp [headFactorLinearMap, splitCubeLinearEquiv] + +private theorem separatedFactorLinearMap_surjective + (L : FABL.F₂Cube (m + k) ≃ₗ[FABL.𝔽₂] FABL.F₂Cube (m + k)) + (a : FABL.F₂Cube k) (ha : a ≠ 0) : + Function.Surjective (separatedFactorLinearMap L a) := by + intro z + let p := (Fin.appendEquiv m 1).symm z + obtain ⟨y, hy⟩ := tailDotLinearMap_surjective a ha (p.2 0) + refine ⟨L (Fin.append p.1 y), ?_⟩ + have hz : z = Fin.append p.1 p.2 := by + exact ((Fin.appendEquiv m 1).apply_symm_apply z).symm + rw [hz] + apply (splitCubeLinearEquiv m 1).injective + apply Prod.ext + · funext i + simp [separatedFactorLinearMap, headFactorLinearMap, + splitCubeLinearEquiv, p] + · funext i + fin_cases i + simpa [separatedFactorLinearMap, headFactorLinearMap, + splitCubeLinearEquiv, singletonCubeLinearEquiv] using hy + +/-- A separated linear-structure normal form with `m` nonlinear coordinates factors through +`m` affine coordinates when its tail form vanishes, and through `m+1` otherwise. -/ +theorem hasSurjectiveAffineFactorization_of_hasSeparatedLinearStructureNormalForm + (f : BooleanFunction (m + k)) + (hf : HasSeparatedLinearStructureNormalForm f) : + HasSurjectiveAffineFactorization f m ∨ + HasSurjectiveAffineFactorization f (m + 1) := by + obtain ⟨L, g, ε, hnormal⟩ := hf + by_cases hε : ε = 0 + · left + let A : FABL.F₂Cube (m + k) →ᵃ[FABL.𝔽₂] FABL.F₂Cube m := + (headFactorLinearMap L).toAffineMap + refine ⟨A, g, headFactorLinearMap_surjective L, ?_⟩ + funext z + let p := (Fin.appendEquiv m k).symm (L.symm z) + have hz : z = L (Fin.append p.1 p.2) := by + rw [← L.apply_symm_apply z] + exact congrArg L (((Fin.appendEquiv m k).apply_symm_apply (L.symm z)).symm) + rw [hz, hnormal, hε] + simp [A, headFactorLinearMap, splitCubeLinearEquiv, p, + FABL.f₂DotProduct] + · right + let A : FABL.F₂Cube (m + k) →ᵃ[FABL.𝔽₂] FABL.F₂Cube (m + 1) := + (separatedFactorLinearMap L ε).toAffineMap + let G : BooleanFunction (m + 1) := fun z ↦ + let p := (Fin.appendEquiv m 1).symm z + g p.1 + p.2 0 + refine ⟨A, G, separatedFactorLinearMap_surjective L ε hε, ?_⟩ + funext z + let p := (Fin.appendEquiv m k).symm (L.symm z) + have hz : z = L (Fin.append p.1 p.2) := by + rw [← L.apply_symm_apply z] + exact congrArg L (((Fin.appendEquiv m k).apply_symm_apply (L.symm z)).symm) + rw [hz, hnormal] + simp [A, G, separatedFactorLinearMap, headFactorLinearMap, + splitCubeLinearEquiv, singletonCubeLinearEquiv, tailDotLinearMap, p] + +/-- Carlet's linear-kernel refinement: `m` nonlinear coordinates and an affine tail give +`AI(f) ≤ ⌈m/2+1⌉ = ⌈(m+1)/2⌉`. -/ +theorem algebraicImmunity_le_ceiling_half_add_one_of_hasSeparatedLinearStructureNormalForm + (f : BooleanFunction (m + k)) + (hf : HasSeparatedLinearStructureNormalForm f) : + algebraicImmunity f ≤ (m + 2) / 2 := by + rcases hasSurjectiveAffineFactorization_of_hasSeparatedLinearStructureNormalForm f hf with + hfactor | hfactor + · exact (algebraicImmunity_le_ceiling_half_of_hasSurjectiveAffineFactorization + f hfactor).trans (by omega) + · simpa [Nat.add_assoc] using + (algebraicImmunity_le_ceiling_half_of_hasSurjectiveAffineFactorization f hfactor) + +/-- If the linear kernel contains `k` independent directions in dimension `m+k`, then +`AI(f) ≤ ⌈m/2+1⌉`. -/ +theorem algebraicImmunity_le_ceiling_half_add_one_of_linearKernel_finrank_ge + (f : BooleanFunction (m + k)) + (hk : k ≤ Module.finrank FABL.𝔽₂ (linearKernel f)) : + algebraicImmunity f ≤ (m + 2) / 2 := by + apply algebraicImmunity_le_ceiling_half_add_one_of_hasSeparatedLinearStructureNormalForm + exact (finrank_linearKernel_ge_iff_hasSeparatedLinearStructureNormalForm f).mp hk + +end CryptBoolean diff --git a/CryptBoolean/Carlet/Chapter04/AnnihilatorLinearSystem.lean b/CryptBoolean/Carlet/Chapter04/AnnihilatorLinearSystem.lean new file mode 100644 index 0000000..68d677d --- /dev/null +++ b/CryptBoolean/Carlet/Chapter04/AnnihilatorLinearSystem.lean @@ -0,0 +1,84 @@ +/- +Copyright (c) 2026 Asher Yan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Asher Yan with Codex +-/ +module + +public import CryptBoolean.Carlet.Chapter04.AlgebraicImmunity +public import CryptBoolean.Carlet.Chapter03.ReedMuller + +/-! +# Carlet Chapter 4 annihilator evaluation system + +The low-degree ANF coefficient vector of an annihilator lies in the kernel of evaluation on +the support of the target function. The domain and codomain dimensions give Carlet's counts of +unknowns and equations. +-/ + +open Finset +open scoped BigOperators BooleanCube + +@[expose] public section + +namespace CryptBoolean + +variable {n d : ℕ} + +/-- Evaluation on `supp(f)`, with a degree-at-most-`d` Boolean function represented by its +low-degree ANF coefficient vector. -/ +noncomputable def annihilatorEvaluationLinearMap (f : BooleanFunction n) (d : ℕ) : + (↥(FABL.lowDegreeFourierFamily n d) → FABL.𝔽₂) →ₗ[FABL.𝔽₂] + (↥(support f) → FABL.𝔽₂) where + toFun c x := ((reedMullerAnfEquiv d n).symm c).1 x.1 + map_add' c c' := by + funext x + exact congrFun (congrArg Subtype.val + (map_add (reedMullerAnfEquiv d n).symm c c')) x.1 + map_smul' a c := by + funext x + exact congrFun (congrArg Subtype.val + (map_smul (reedMullerAnfEquiv d n).symm a c)) x.1 + +/-- A low-degree coefficient vector belongs to the evaluation kernel exactly when the +corresponding Boolean function annihilates `f`. -/ +theorem mem_ker_annihilatorEvaluationLinearMap_iff + (f : BooleanFunction n) + (c : ↥(FABL.lowDegreeFourierFamily n d) → FABL.𝔽₂) : + c ∈ LinearMap.ker (annihilatorEvaluationLinearMap f d) ↔ + f * ((reedMullerAnfEquiv d n).symm c).1 = 0 := by + rw [LinearMap.mem_ker] + constructor + · intro hc + funext x + by_cases hfx : f x = 0 + · simp [hfx] + · have hfxone : f x = 1 := Fin.eq_one_of_ne_zero _ hfx + have hxSupport : x ∈ support f := (mem_support f x).2 hfxone + have hx := congrFun hc (⟨x, hxSupport⟩ : ↥(support f)) + change ((reedMullerAnfEquiv d n).symm c).1 x = 0 at hx + simp [hfxone, hx] + · intro hproduct + funext x + have hfx : f x.1 = 1 := (mem_support f x.1).1 x.2 + have hx := congrFun hproduct x.1 + change f x.1 * ((reedMullerAnfEquiv d n).symm c).1 x.1 = 0 at hx + change ((reedMullerAnfEquiv d n).symm c).1 x.1 = 0 + simpa [hfx] using hx + +/-- Carlet's number of low-degree ANF coefficient unknowns. -/ +theorem annihilatorEvaluationLinearMap_domain_finrank (n d : ℕ) : + Module.finrank FABL.𝔽₂ + (↥(FABL.lowDegreeFourierFamily n d) → FABL.𝔽₂) = + ∑ i ∈ Finset.range (d + 1), Nat.choose n i := by + rw [Module.finrank_fintype_fun_eq_card, Fintype.card_coe, + FABL.card_lowDegreeFourierFamily_eq_sum_choose] + +/-- Evaluation on `supp(f)` gives exactly `w_H(f)` scalar equations. -/ +theorem annihilatorEvaluationLinearMap_codomain_finrank + (f : BooleanFunction n) : + Module.finrank FABL.𝔽₂ (↥(support f) → FABL.𝔽₂) = hammingWeight f := by + rw [Module.finrank_fintype_fun_eq_card, Fintype.card_coe, + hammingWeight_eq_card_support] + +end CryptBoolean diff --git a/CryptBoolean/Carlet/Chapter04/AutocorrelationBounds.lean b/CryptBoolean/Carlet/Chapter04/AutocorrelationBounds.lean new file mode 100644 index 0000000..818978d --- /dev/null +++ b/CryptBoolean/Carlet/Chapter04/AutocorrelationBounds.lean @@ -0,0 +1,219 @@ +/- +Copyright (c) 2026 Asher Yan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Asher Yan with Codex +-/ +module + +public import CryptBoolean.Carlet.Chapter04.AutocorrelationIndicators +public import CryptBoolean.Carlet.Chapter04.HigherOrderNonlinearity +public import CryptBoolean.Carlet.Chapter04.LinearStructures + +/-! +# Carlet Chapter 4 bounds for autocorrelation indicators + +The zero direction supplies the universal lower bound for the sum-of-squares indicator. The +remaining autocorrelation coefficients control the absolute indicator, while the linear kernel +supplies a dimension-sensitive strengthening. +-/ + +open Finset +open scoped BigOperators BooleanCube NNReal + +@[expose] public section + +namespace CryptBoolean + +variable {n : ℕ} + +/-- The zero-direction autocorrelation is the cardinality of the Boolean cube. -/ +@[simp] theorem autocorrelation_zero (f : BooleanFunction n) : + autocorrelation f 0 = (2 : ℝ) ^ n := by + unfold autocorrelation realSignView FABL.realSignEncodedFunction FABL.signEncodedFunction + simp_rw [FABL.booleanDerivative, add_zero, ZModModule.add_self] + rw [Finset.sum_const, Finset.card_univ, card_f₂Cube, nsmul_eq_mul] + rw [FABL.signValue_signEncode_eq_binarySign, + (FABL.binarySign_eq_one_iff 0).2 rfl] + norm_num + +/-- Carlet's universal lower bound `V(f) ≥ 2^(2n)`. -/ +theorem sumOfSquaresIndicator_lower_bound (f : BooleanFunction n) : + (2 : ℝ) ^ (2 * n) ≤ sumOfSquaresIndicator f := by + rw [sumOfSquaresIndicator] + calc + (2 : ℝ) ^ (2 * n) = autocorrelation f 0 ^ 2 := by + rw [autocorrelation_zero, two_mul, pow_add, pow_two] + _ ≤ ∑ e : FABL.F₂Cube n, autocorrelation f e ^ 2 := + Finset.single_le_sum (fun e _ ↦ sq_nonneg (autocorrelation f e)) + (Finset.mem_univ 0) + +private theorem sumOfSquaresIndicator_eq_two_pow_iff_autocorrelation + (f : BooleanFunction n) : + sumOfSquaresIndicator f = (2 : ℝ) ^ (2 * n) ↔ + ∀ e : FABL.F₂Cube n, e ≠ 0 → autocorrelation f e = 0 := by + classical + constructor + · intro h e he + have hzeroSq : autocorrelation f 0 ^ 2 = (2 : ℝ) ^ (2 * n) := by + rw [autocorrelation_zero, two_mul, pow_add, pow_two] + have hrest : ∑ d ∈ (Finset.univ.erase (0 : FABL.F₂Cube n)), + autocorrelation f d ^ 2 = 0 := by + have hdecomp := Finset.sum_erase_add + (s := (Finset.univ : Finset (FABL.F₂Cube n))) + (f := fun d ↦ autocorrelation f d ^ 2) (Finset.mem_univ 0) + rw [sumOfSquaresIndicator] at h + linarith + have hsquare : autocorrelation f e ^ 2 = 0 := + (Finset.sum_eq_zero_iff_of_nonneg + (fun d _ ↦ sq_nonneg (autocorrelation f d))).mp hrest e (by simp [he]) + exact sq_eq_zero_iff.mp hsquare + · intro h + rw [sumOfSquaresIndicator] + calc + (∑ e : FABL.F₂Cube n, autocorrelation f e ^ 2) = autocorrelation f 0 ^ 2 := by + apply Finset.sum_eq_single 0 + · intro e _ he + rw [h e he, zero_pow (by decide)] + · simp + _ = (2 : ℝ) ^ (2 * n) := by + rw [autocorrelation_zero, two_mul, pow_add, pow_two] + +/-- Equality in the universal indicator bound holds exactly when every nonzero derivative is +balanced. -/ +theorem sumOfSquaresIndicator_eq_two_pow_iff (f : BooleanFunction n) : + sumOfSquaresIndicator f = (2 : ℝ) ^ (2 * n) ↔ + ∀ e : FABL.F₂Cube n, e ≠ 0 → IsBalanced (FABL.booleanDerivative f e) := by + rw [sumOfSquaresIndicator_eq_two_pow_iff_autocorrelation] + apply forall_congr' + intro e + apply forall_congr' + intro _he + rw [isBalanced_iff_walshTransform_zero_eq_zero, + autocorrelation_eq_walshTransform_booleanDerivative_zero] + constructor <;> intro h <;> exact_mod_cast h + +private theorem absoluteIndicator_nonneg (f : BooleanFunction n) : + 0 ≤ absoluteIndicator f := by + exact NNReal.zero_le_coe + +private theorem abs_autocorrelation_le_absoluteIndicator + (f : BooleanFunction n) (e : FABL.F₂Cube n) (he : e ≠ 0) : + |autocorrelation f e| ≤ absoluteIndicator f := by + classical + unfold absoluteIndicator + rw [← Real.coe_toNNReal |autocorrelation f e| (abs_nonneg _)] + exact_mod_cast Finset.le_sup + (f := fun d : FABL.F₂Cube n ↦ Real.toNNReal |autocorrelation f d|) + (by simp [he] : e ∈ Finset.univ.erase (0 : FABL.F₂Cube n)) + +/-- The square of the absolute indicator dominates the mean squared nonzero autocorrelation. -/ +theorem absoluteIndicator_sq_lower_bound + (f : BooleanFunction n) (hn : 0 < n) : + (sumOfSquaresIndicator f - (2 : ℝ) ^ (2 * n)) / + ((2 : ℝ) ^ n - 1) ≤ absoluteIndicator f ^ 2 := by + classical + have hden : 0 < (2 : ℝ) ^ n - 1 := by + have : (1 : ℝ) < 2 ^ n := one_lt_pow₀ (by norm_num) hn.ne' + linarith + apply (div_le_iff₀ hden).2 + have hterm (e : FABL.F₂Cube n) (he : e ≠ 0) : + autocorrelation f e ^ 2 ≤ absoluteIndicator f ^ 2 := by + have habs := abs_autocorrelation_le_absoluteIndicator f e he + have hindicator := absoluteIndicator_nonneg f + have hsquare := + (sq_le_sq₀ (abs_nonneg (autocorrelation f e)) hindicator).mpr habs + simpa only [sq_abs] using hsquare + have hsum : + (∑ e ∈ Finset.univ.erase (0 : FABL.F₂Cube n), autocorrelation f e ^ 2) ≤ + ∑ _e ∈ Finset.univ.erase (0 : FABL.F₂Cube n), absoluteIndicator f ^ 2 := by + apply Finset.sum_le_sum + intro e he + exact hterm e (by simpa using he) + have hdecomp : + sumOfSquaresIndicator f - (2 : ℝ) ^ (2 * n) = + ∑ e ∈ Finset.univ.erase (0 : FABL.F₂Cube n), autocorrelation f e ^ 2 := by + have hsumErase := Finset.sum_erase_add + (s := (Finset.univ : Finset (FABL.F₂Cube n))) + (f := fun e ↦ autocorrelation f e ^ 2) (Finset.mem_univ 0) + have hzeroSq : autocorrelation f 0 ^ 2 = (2 : ℝ) ^ (2 * n) := by + rw [autocorrelation_zero, two_mul, pow_add, pow_two] + rw [sumOfSquaresIndicator] + linarith + rw [hdecomp] + calc + (∑ e ∈ Finset.univ.erase (0 : FABL.F₂Cube n), autocorrelation f e ^ 2) ≤ + ∑ _e ∈ Finset.univ.erase (0 : FABL.F₂Cube n), absoluteIndicator f ^ 2 := hsum + _ = absoluteIndicator f ^ 2 * ((2 : ℝ) ^ n - 1) := by + rw [Finset.sum_const, nsmul_eq_mul, + Finset.cast_card_erase_of_mem (R := ℝ) (Finset.mem_univ 0), + Finset.card_univ, card_f₂Cube] + push_cast + ring_nf + +/-- In positive dimension, the absolute indicator is at least the square root of the mean squared +nonzero autocorrelation. -/ +theorem absoluteIndicator_lower_bound + (f : BooleanFunction n) (hn : 0 < n) : + Real.sqrt ((sumOfSquaresIndicator f - (2 : ℝ) ^ (2 * n)) / + ((2 : ℝ) ^ n - 1)) ≤ absoluteIndicator f := by + exact Real.sqrt_le_iff.mpr + ⟨absoluteIndicator_nonneg f, absoluteIndicator_sq_lower_bound f hn⟩ + +/-- A linear-structure direction contributes the full squared cube cardinality to the indicator. -/ +theorem autocorrelation_sq_of_mem_linearKernel + (f : BooleanFunction n) (e : FABL.F₂Cube n) (he : e ∈ linearKernel f) : + autocorrelation f e ^ 2 = (2 : ℝ) ^ (2 * n) := by + obtain ⟨ε, hε⟩ := (mem_linearKernel f e).mp he + unfold autocorrelation realSignView FABL.realSignEncodedFunction FABL.signEncodedFunction + simp_rw [hε] + rw [Finset.sum_const, Finset.card_univ, card_f₂Cube, nsmul_eq_mul, + two_mul, pow_add, pow_two] + push_cast + rcases FABL.signValue_eq_neg_one_or_one (FABL.signEncode ε) with hsign | hsign <;> + rw [hsign] <;> ring + +/-- A `k`-dimensional linear kernel strengthens Carlet's indicator bound to `2^(2n+k)`. -/ +theorem sumOfSquaresIndicator_lower_bound_linearKernel (f : BooleanFunction n) : + (2 : ℝ) ^ (2 * n + Module.finrank FABL.𝔽₂ (linearKernel f)) ≤ + sumOfSquaresIndicator f := by + classical + let kernelDirections := + Finset.univ.filter (fun e : FABL.F₂Cube n ↦ e ∈ linearKernel f) + have hsubset : + (∑ e ∈ kernelDirections, autocorrelation f e ^ 2) ≤ + ∑ e : FABL.F₂Cube n, autocorrelation f e ^ 2 := by + exact Finset.sum_le_sum_of_subset_of_nonneg + (Finset.subset_univ kernelDirections) + (fun e _ _ ↦ sq_nonneg (autocorrelation f e)) + have hcard : kernelDirections.card = + 2 ^ Module.finrank FABL.𝔽₂ (linearKernel f) := by + have hkernelCard : Fintype.card (linearKernel f) = + 2 ^ Module.finrank FABL.𝔽₂ (linearKernel f) := by + rw [← Nat.card_eq_fintype_card, + Module.natCard_eq_pow_finrank (K := FABL.𝔽₂) (V := linearKernel f), + Nat.card_zmod] + simpa [kernelDirections, Fintype.card_subtype] using hkernelCard + rw [sumOfSquaresIndicator] + calc + (2 : ℝ) ^ (2 * n + Module.finrank FABL.𝔽₂ (linearKernel f)) = + ∑ e ∈ kernelDirections, autocorrelation f e ^ 2 := by + rw [pow_add] + calc + (2 : ℝ) ^ (2 * n) * (2 : ℝ) ^ Module.finrank FABL.𝔽₂ (linearKernel f) = + (kernelDirections.card : ℝ) * (2 : ℝ) ^ (2 * n) := by + rw [hcard] + push_cast + ring + _ = ∑ e ∈ kernelDirections, autocorrelation f e ^ 2 := by + rw [Finset.sum_congr rfl (fun e he ↦ autocorrelation_sq_of_mem_linearKernel + f e (by simpa [kernelDirections] using he)), Finset.sum_const, nsmul_eq_mul] + _ ≤ ∑ e : FABL.F₂Cube n, autocorrelation f e ^ 2 := hsubset + +/-- Source-form specialization of the linear-kernel bound when its dimension is named `k`. -/ +theorem sumOfSquaresIndicator_lower_bound_of_finrank_eq + (f : BooleanFunction n) (k : ℕ) + (hk : Module.finrank FABL.𝔽₂ (linearKernel f) = k) : + (2 : ℝ) ^ (2 * n + k) ≤ sumOfSquaresIndicator f := by + simpa [hk] using sumOfSquaresIndicator_lower_bound_linearKernel f + +end CryptBoolean diff --git a/CryptBoolean/Carlet/Chapter04/AutocorrelationIdentities.lean b/CryptBoolean/Carlet/Chapter04/AutocorrelationIdentities.lean new file mode 100644 index 0000000..fc5279f --- /dev/null +++ b/CryptBoolean/Carlet/Chapter04/AutocorrelationIdentities.lean @@ -0,0 +1,114 @@ +/- +Copyright (c) 2026 Asher Yan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Asher Yan with Codex +-/ +module + +public import CryptBoolean.Carlet.Chapter04.AutocorrelationIndicators + +/-! +# Carlet Chapter 4 autocorrelation identities + +Second derivatives express the sum-of-squares indicator, while raw Plancherel and the +Wiener--Khintchine identity relate it to the fourth moment of the Walsh spectrum. +-/ + +open Finset +open scoped BigOperators BooleanCube + +@[expose] public section + +namespace CryptBoolean + +variable {n : ℕ} + +/-- Carlet's second-order derivative `D_a D_e f`. -/ +def secondBooleanDerivative (f : BooleanFunction n) (a e : FABL.F₂Cube n) : + BooleanFunction n := + FABL.booleanDerivative (FABL.booleanDerivative f e) a + +/-- The second-order derivative is the four-term binary difference displayed by Carlet. -/ +theorem secondBooleanDerivative_apply + (f : BooleanFunction n) (a e x : FABL.F₂Cube n) : + secondBooleanDerivative f a e x = + f x + f (x + a) + f (x + e) + f (x + a + e) := by + simp only [secondBooleanDerivative, FABL.booleanDerivative] + abel + +/-- Carlet's second-derivative expression for the sum-of-squares indicator. -/ +theorem sumOfSquaresIndicator_eq_sum_secondBooleanDerivative + (f : BooleanFunction n) : + sumOfSquaresIndicator f = + ∑ a, ∑ e, ∑ x, realSignView (secondBooleanDerivative f a e) x := by + classical + rw [sumOfSquaresIndicator] + calc + ∑ e, autocorrelation f e ^ 2 = + ∑ e, ∑ a, autocorrelation (FABL.booleanDerivative f e) a := by + apply Finset.sum_congr rfl + intro e _ + rw [sum_autocorrelation_eq_walshTransform_zero_sq] + congr 1 + rw [autocorrelation, walshTransform_cast_eq_sum_realSignView_mul_character] + simp + _ = ∑ a, ∑ e, autocorrelation (FABL.booleanDerivative f e) a := + Finset.sum_comm + _ = ∑ a, ∑ e, ∑ x, realSignView (secondBooleanDerivative f a e) x := by + simp only [autocorrelation, secondBooleanDerivative] + +/-- Carlet Relation (39): shifted Walsh-spectrum squares are the transform of squared +autocorrelation. -/ +theorem sum_walshTransform_sq_mul_add_sq_eq + (f : BooleanFunction n) (a : FABL.F₂Cube n) : + ∑ e, (walshTransform f e : ℝ) ^ 2 * + (walshTransform f (a + e) : ℝ) ^ 2 = + (2 : ℝ) ^ n * ∑ e, autocorrelation f e ^ 2 * + FABL.vectorWalshCharacter a e := by + classical + let φ : FABL.F₂Cube n → ℝ := autocorrelation f + let ψ : FABL.F₂Cube n → ℝ := + fun e ↦ FABL.vectorWalshCharacter a e * φ e + have hshift (e : FABL.F₂Cube n) : + rawFourierTransform ψ e = rawFourierTransform φ (a + e) := by + simpa [ψ] using rawFourierTransform_modulate_translate φ a 0 e + calc + ∑ e, (walshTransform f e : ℝ) ^ 2 * + (walshTransform f (a + e) : ℝ) ^ 2 = + ∑ e, rawFourierTransform φ e * rawFourierTransform φ (a + e) := by + apply Finset.sum_congr rfl + intro e _ + rw [rawFourierTransform_autocorrelation, + rawFourierTransform_autocorrelation] + _ = ∑ e, rawFourierTransform φ e * rawFourierTransform ψ e := by + apply Finset.sum_congr rfl + intro e _ + rw [hshift] + _ = (2 : ℝ) ^ n * ∑ e, φ e * ψ e := + sum_rawFourierTransform_mul φ ψ + _ = (2 : ℝ) ^ n * ∑ e, autocorrelation f e ^ 2 * + FABL.vectorWalshCharacter a e := by + congr 1 + apply Finset.sum_congr rfl + intro e _ + simp only [φ, ψ] + ring + +/-- The zero-shift specialization of Relation (39): the fourth Walsh moment is `2^n V(f)`. -/ +theorem sum_walshTransform_fourth_eq_two_pow_mul_sumOfSquaresIndicator + (f : BooleanFunction n) : + ∑ e, (walshTransform f e : ℝ) ^ 4 = + (2 : ℝ) ^ n * sumOfSquaresIndicator f := by + have h := sum_walshTransform_sq_mul_add_sq_eq f 0 + rw [sumOfSquaresIndicator] + calc + ∑ e, (walshTransform f e : ℝ) ^ 4 = + ∑ e, (walshTransform f e : ℝ) ^ 2 * + (walshTransform f e : ℝ) ^ 2 := by + apply Finset.sum_congr rfl + intro e _ + ring + _ = (2 : ℝ) ^ n * ∑ e, autocorrelation f e ^ 2 := by + simpa using h + +end CryptBoolean diff --git a/CryptBoolean/Carlet/Chapter04/AutocorrelationIndicators.lean b/CryptBoolean/Carlet/Chapter04/AutocorrelationIndicators.lean new file mode 100644 index 0000000..2155a7e --- /dev/null +++ b/CryptBoolean/Carlet/Chapter04/AutocorrelationIndicators.lean @@ -0,0 +1,114 @@ +/- +Copyright (c) 2026 Asher Yan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Asher Yan with Codex +-/ +module + +public import CryptBoolean.Carlet.Chapter02.Derivatives + +/-! +# Carlet Chapter 4 autocorrelation indicators + +The sum-of-squares and absolute indicators measure the global autocorrelation of a Boolean +function. Both are invariant under affine equivalence. +-/ + +open Finset +open scoped BigOperators BooleanCube NNReal + +@[expose] public section + +namespace CryptBoolean + +variable {n : ℕ} + +/-- Carlet's sum-of-squares indicator `V(f)`. -/ +noncomputable def sumOfSquaresIndicator (f : BooleanFunction n) : ℝ := + ∑ e, autocorrelation f e ^ 2 + +/-- Carlet's absolute indicator. In dimension zero the empty supremum is defined to be zero. -/ +noncomputable def absoluteIndicator (f : BooleanFunction n) : ℝ := + (((Finset.univ.erase (0 : FABL.F₂Cube n)).sup fun e ↦ + Real.toNNReal |autocorrelation f e| : ℝ≥0) : ℝ) + +/-- Binary differentiation commutes with an affine input equivalence, with directions transformed +by its linear part. -/ +theorem booleanDerivative_comp_affineEquiv + (f : BooleanFunction n) + (L : FABL.F₂Cube n ≃ᵃ[FABL.𝔽₂] FABL.F₂Cube n) + (e x : FABL.F₂Cube n) : + FABL.booleanDerivative (f ∘ L) e x = + FABL.booleanDerivative f (L.linear e) (L x) := by + rw [FABL.booleanDerivative, FABL.booleanDerivative] + change f (L x) + f (L (x + e)) = + f (L x) + f (L x + L.linear e) + have hL : L (x + e) = L x + L.linear e := by + simpa [add_comm] using L.toAffineMap.map_vadd x e + rw [hL] + +/-- Autocorrelation is reindexed by the linear part of an affine input equivalence. -/ +theorem autocorrelation_comp_affineEquiv + (f : BooleanFunction n) + (L : FABL.F₂Cube n ≃ᵃ[FABL.𝔽₂] FABL.F₂Cube n) + (e : FABL.F₂Cube n) : + autocorrelation (f ∘ L) e = autocorrelation f (L.linear e) := by + unfold autocorrelation + calc + ∑ x, realSignView (FABL.booleanDerivative (f ∘ L) e) x = + ∑ x, realSignView (FABL.booleanDerivative f (L.linear e)) (L x) := by + apply Finset.sum_congr rfl + intro x _ + change + FABL.signValue (FABL.signEncode (FABL.booleanDerivative (f ∘ L) e x)) = + FABL.signValue + (FABL.signEncode (FABL.booleanDerivative f (L.linear e) (L x))) + exact congrArg (fun b : FABL.𝔽₂ ↦ FABL.signValue (FABL.signEncode b)) + (booleanDerivative_comp_affineEquiv f L e x) + _ = ∑ x, realSignView (FABL.booleanDerivative f (L.linear e)) x := + Equiv.sum_comp L.toEquiv _ + +/-- The sum-of-squares indicator is invariant under affine equivalence. -/ +theorem sumOfSquaresIndicator_comp_affineEquiv + (f : BooleanFunction n) + (L : FABL.F₂Cube n ≃ᵃ[FABL.𝔽₂] FABL.F₂Cube n) : + sumOfSquaresIndicator (f ∘ L) = sumOfSquaresIndicator f := by + rw [sumOfSquaresIndicator, sumOfSquaresIndicator] + simp_rw [autocorrelation_comp_affineEquiv] + exact Equiv.sum_comp L.linear.toEquiv (fun e ↦ autocorrelation f e ^ 2) + +/-- The absolute indicator is invariant under affine equivalence. -/ +theorem absoluteIndicator_comp_affineEquiv + (f : BooleanFunction n) + (L : FABL.F₂Cube n ≃ᵃ[FABL.𝔽₂] FABL.F₂Cube n) : + absoluteIndicator (f ∘ L) = absoluteIndicator f := by + classical + let directions := Finset.univ.erase (0 : FABL.F₂Cube n) + let value : FABL.F₂Cube n → ℝ≥0 := + fun e ↦ Real.toNNReal |autocorrelation f e| + have himage : directions.image L.linear = directions := by + ext e + simp only [directions, Finset.mem_image, Finset.mem_erase, Finset.mem_univ, and_true] + constructor + · rintro ⟨d, hd, rfl⟩ + exact (L.linear.map_ne_zero_iff).2 hd + · intro he + refine ⟨L.linear.symm e, ?_, L.linear.apply_symm_apply e⟩ + exact (L.linear.symm.map_ne_zero_iff).2 he + have hsup : directions.sup (fun e ↦ value (L.linear e)) = directions.sup value := by + calc + directions.sup (fun e ↦ value (L.linear e)) = + (directions.image L.linear).sup value := + (Finset.sup_image directions L.linear value).symm + _ = directions.sup value := by rw [himage] + exact congrArg (fun q : ℝ≥0 ↦ (q : ℝ)) (by + simpa [absoluteIndicator, directions, value, autocorrelation_comp_affineEquiv] using hsup) + +/-- The absolute indicator of a zero-variable Boolean function follows the empty-family +convention. -/ +@[simp] theorem absoluteIndicator_zero_dimension (f : BooleanFunction 0) : + absoluteIndicator f = 0 := by + classical + simp [absoluteIndicator] + +end CryptBoolean diff --git a/CryptBoolean/Carlet/Chapter04/CodeGeneratorResiliency.lean b/CryptBoolean/Carlet/Chapter04/CodeGeneratorResiliency.lean new file mode 100644 index 0000000..e44673d --- /dev/null +++ b/CryptBoolean/Carlet/Chapter04/CodeGeneratorResiliency.lean @@ -0,0 +1,275 @@ +/- +Copyright (c) 2026 Asher Yan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Asher Yan with Codex +-/ +module + +public import CryptBoolean.Carlet.Chapter04.Resiliency +public import FABL.Chapter06.Constructions.KWiseIndependence +public import Mathlib.LinearAlgebra.Matrix.Rank + +import FABL.Chapter06.Pseudorandomness.FourierFourthMoment + +/-! +# Carlet Chapter 4 code-generator construction + +The generator matrix is kept in Carlet's row orientation: its row space is the +binary linear code, while multiplication by the matrix sends an input row +vector through the displayed transpose. +-/ + +open Finset +open scoped BigOperators BooleanCube Matrix + +@[expose] public section + +namespace CryptBoolean + +variable {n k d : ℕ} + +/-- The codeword obtained from the coefficient row vector `u` and the +generator matrix `G`. -/ +def binaryGeneratorCodeword + (G : Matrix (Fin k) (Fin n) FABL.𝔽₂) + (u : FABL.F₂Cube k) : FABL.F₂Cube n := + u ᵥ* G + +/-- A binary `[n,k,d]` generator matrix: its rows are independent and +the least weight of a nonzero generated codeword is exactly `d`. -/ +def IsBinaryCodeGenerator + (G : Matrix (Fin k) (Fin n) FABL.𝔽₂) (d : ℕ) : Prop := + LinearIndependent FABL.𝔽₂ G.row ∧ + (∀ u : FABL.F₂Cube k, u ≠ 0 → + d ≤ (FABL.f₂Support (binaryGeneratorCodeword G u)).card) ∧ + ∃ u : FABL.F₂Cube k, u ≠ 0 ∧ + (FABL.f₂Support (binaryGeneratorCodeword G u)).card = d + +/-- Carlet's function `f(x)=g(xGᵀ)`, using Mathlib's column action for +the displayed multiplication by `Gᵀ`. -/ +def binaryGeneratorPullback + (G : Matrix (Fin k) (Fin n) FABL.𝔽₂) + (g : BooleanFunction k) : BooleanFunction n := + fun x ↦ g (G *ᵥ x) + +private theorem mulVecLin_surjective_of_rows_linearIndependent + (G : Matrix (Fin k) (Fin n) FABL.𝔽₂) + (hrows : LinearIndependent FABL.𝔽₂ G.row) : + Function.Surjective G.mulVecLin := by + rw [← LinearMap.range_eq_top] + apply Submodule.eq_top_of_finrank_eq + change G.rank = Module.finrank FABL.𝔽₂ (FABL.F₂Cube k) + rw [hrows.rank_matrix, Module.finrank_fintype_fun_eq_card] + +private theorem mean_comp_surjective_linearMap + (L : FABL.F₂Cube n →ₗ[FABL.𝔽₂] FABL.F₂Cube k) + (hL : Function.Surjective L) (q : FABL.F₂Cube k → ℝ) : + FABL.mean (fun x ↦ q (L x)) = FABL.mean q := by + letI : Fintype (LinearMap.ker L) := Fintype.ofFinite _ + obtain ⟨R, hR⟩ := L.exists_rightInverse_of_surjective + (LinearMap.range_eq_top.mpr hL) + have hR_apply (y : FABL.F₂Cube k) : L (R y) = y := by + have h := LinearMap.congr_fun hR y + simpa using h + let e : (FABL.F₂Cube k × LinearMap.ker L) ≃ₗ[FABL.𝔽₂] + FABL.F₂Cube n := + { toFun := fun p ↦ R p.1 + p.2.1 + invFun := fun x ↦ + (L x, ⟨x - R (L x), by + rw [LinearMap.mem_ker] + simp [hR_apply]⟩) + left_inv := by + intro p + apply Prod.ext + · simp [hR_apply] + · apply Subtype.ext + simp [hR_apply] + right_inv := by + intro x + simp + map_add' := by + intro p q + simp [add_assoc, add_left_comm, add_comm] + map_smul' := by + intro c p + simp [smul_add] } + have he (p : FABL.F₂Cube k × LinearMap.ker L) : + L (e p) = p.1 := by + simp [e, hR_apply] + calc + FABL.mean (fun x ↦ q (L x)) = + FABL.mean (fun p : FABL.F₂Cube k × LinearMap.ker L ↦ + q (L (e p))) := by + symm + apply Finset.expect_equiv e.toEquiv + · simp + · simp + _ = FABL.mean (fun p : FABL.F₂Cube k × LinearMap.ker L ↦ q p.1) := by + apply Finset.expect_congr rfl + intro p _ + rw [he] + _ = FABL.mean q := by + change + Finset.expect Finset.univ + (fun p : FABL.F₂Cube k × LinearMap.ker L ↦ q p.1) = + Finset.expect Finset.univ q + rw [show + (Finset.univ : Finset (FABL.F₂Cube k × LinearMap.ker L)) = + (Finset.univ : Finset (FABL.F₂Cube k)) ×ˢ + (Finset.univ : Finset (LinearMap.ker L)) by ext; simp, + Finset.expect_product] + simp + +/-- Pulling a balanced Boolean function back through a full-row-rank binary +generator matrix preserves balancedness. -/ +theorem isBalanced_binaryGeneratorPullback + (G : Matrix (Fin k) (Fin n) FABL.𝔽₂) + (g : BooleanFunction k) + (hrows : LinearIndependent FABL.𝔽₂ G.row) + (hg : IsBalanced g) : + IsBalanced (binaryGeneratorPullback G g) := by + have hsurjective : Function.Surjective G.mulVecLin := + mulVecLin_surjective_of_rows_linearIndependent G hrows + have hmean : + FABL.mean (realSignView (binaryGeneratorPullback G g)) = + FABL.mean (realSignView g) := by + change FABL.mean (fun x ↦ realSignView g (G *ᵥ x)) = + FABL.mean (realSignView g) + simpa [Matrix.mulVecLin_apply] using + mean_comp_surjective_linearMap G.mulVecLin hsurjective + (realSignView g) + have hgmean : FABL.mean (realSignView g) = 0 := by + rw [← FABL.vectorFourierCoeff_zero_eq_mean] + exact walshTransform_eq_zero_iff_vectorFourierCoeff_eq_zero g 0 |>.mp + (isBalanced_iff_walshTransform_zero_eq_zero g |>.mp hg) + apply isBalanced_iff_walshTransform_zero_eq_zero _ |>.mpr + apply walshTransform_eq_zero_iff_vectorFourierCoeff_eq_zero _ 0 |>.mpr + rw [FABL.vectorFourierCoeff_zero_eq_mean] + exact hmean.trans hgmean + +private theorem codeDistance_pos + (G : Matrix (Fin k) (Fin n) FABL.𝔽₂) (d : ℕ) + (hG : IsBinaryCodeGenerator G d) : + 0 < d := by + obtain ⟨u, hu, hweight⟩ := hG.2.2 + have hinjective : Function.Injective G.vecMul := + Matrix.vecMul_injective_iff.mpr hG.1 + have hcodeword : binaryGeneratorCodeword G u ≠ 0 := by + intro hzero + apply hu + apply hinjective + simpa [binaryGeneratorCodeword] using hzero + have hsupport : + (FABL.f₂Support (binaryGeneratorCodeword G u)).Nonempty := + (FABL.f₂Support_nonempty_iff _).mpr hcodeword + rw [← hweight] + exact Finset.card_pos.mpr hsupport + +private theorem codeDistance_le_length + (G : Matrix (Fin k) (Fin n) FABL.𝔽₂) (d : ℕ) + (hG : IsBinaryCodeGenerator G d) : + d ≤ n := by + obtain ⟨u, _hu, hweight⟩ := hG.2.2 + rw [← hweight] + calc + (FABL.f₂Support (binaryGeneratorCodeword G u)).card ≤ + (Finset.univ : Finset (Fin n)).card := + Finset.card_le_card (Finset.subset_univ _) + _ = n := by simp + +private theorem ker_mulVecLin_eq_perpendicular_rowSpan + (G : Matrix (Fin k) (Fin n) FABL.𝔽₂) : + LinearMap.ker G.mulVecLin = + FABL.perpendicularSubspace (FABL.matrixRowSpan G) := by + ext u + simpa [LinearMap.mem_ker, Matrix.mulVecLin_apply] using + (FABL.mem_perpendicular_matrixRowSpan_iff_mulVec_eq_zero G u).symm + +private theorem lowWeight_ne_perpendicular_ker + (G : Matrix (Fin k) (Fin n) FABL.𝔽₂) (d : ℕ) + (hG : IsBinaryCodeGenerator G d) + (u : FABL.F₂Cube n) (hu : u ≠ 0) + (hweight : (FABL.f₂Support u).card ≤ d - 1) : + u ∉ FABL.perpendicularSubspace (LinearMap.ker G.mulVecLin) := by + intro huperp + have hurow : u ∈ FABL.matrixRowSpan G := by + rw [ker_mulVecLin_eq_perpendicular_rowSpan, + FABL.perpendicularSubspace_perpendicularSubspace] at huperp + exact huperp + rcases hurow with ⟨a, ha⟩ + have ha_ne : a ≠ 0 := by + intro hzero + apply hu + simpa [hzero] using ha.symm + have hminimum := hG.2.1 a ha_ne + change binaryGeneratorCodeword G a = u at ha + rw [ha] at hminimum + have hd : 0 < d := codeDistance_pos G d hG + omega + +private theorem lowWeight_vectorFourierCoeff_eq_zero + (G : Matrix (Fin k) (Fin n) FABL.𝔽₂) (d : ℕ) + (hG : IsBinaryCodeGenerator G d) + (g : BooleanFunction k) (u : FABL.F₂Cube n) + (hu : u ≠ 0) + (hweight : (FABL.f₂Support u).card ≤ d - 1) : + FABL.vectorFourierCoeff + (realSignView (binaryGeneratorPullback G g)) u = 0 := by + have hnotperp := + lowWeight_ne_perpendicular_ker G d hG u hu hweight + have hnotall : + ¬ ∀ v : FABL.F₂Cube n, v ∈ LinearMap.ker G.mulVecLin → + FABL.f₂DotProduct u v = 0 := by + intro h + exact hnotperp + ((FABL.mem_perpendicularSubspace_iff + (LinearMap.ker G.mulVecLin) u).mpr h) + push Not at hnotall + obtain ⟨v, hvker, hvdot⟩ := hnotall + have hmul : G *ᵥ v = 0 := by + simpa [LinearMap.mem_ker, Matrix.mulVecLin_apply] using hvker + have hinvariant : + (fun x ↦ realSignView (binaryGeneratorPullback G g) (x + v)) = + realSignView (binaryGeneratorPullback G g) := by + funext x + have hinput : G *ᵥ (x + v) = G *ᵥ x := by + rw [Matrix.mulVec_add, hmul, add_zero] + change + FABL.signValue (FABL.signEncode (g (G *ᵥ (x + v)))) = + FABL.signValue (FABL.signEncode (g (G *ᵥ x))) + rw [hinput] + have hdot_one : FABL.f₂DotProduct u v = 1 := + Fin.eq_one_of_ne_zero _ hvdot + have hcharacter : FABL.vectorWalshCharacter u v = -1 := by + rw [FABL.vectorWalshCharacter_apply, hdot_one] + exact FABL.binarySign_one + have htranslation := + FABL.vectorFourierCoeff_translate_add + (realSignView (binaryGeneratorPullback G g)) v u + rw [hinvariant, hcharacter] at htranslation + linarith + +/-- Carlet's code-generator construction: if `G` generates a binary +`[n,k,d]` linear code and `g` is balanced, then +`x ↦ g(xGᵀ)` is `(d-1)`-resilient. -/ +theorem binaryGeneratorPullback_isResilient + (G : Matrix (Fin k) (Fin n) FABL.𝔽₂) (d : ℕ) + (hG : IsBinaryCodeGenerator G d) + (g : BooleanFunction k) (hg : IsBalanced g) : + IsResilient (d - 1) (binaryGeneratorPullback G g) := by + have hd : 0 < d := codeDistance_pos G d hG + have hdn : d ≤ n := codeDistance_le_length G d hG + have hn : 0 < n := hd.trans_le hdn + have horder : d - 1 < n := + (Nat.sub_lt hd (by omega)).trans_le hdn + rw [theorem_3_resilient_iff_walshTransform_eq_zero + (d - 1) (binaryGeneratorPullback G g) hn horder] + intro u hweight + by_cases hu : u = 0 + · subst u + exact isBalanced_iff_walshTransform_zero_eq_zero _ |>.mp + (isBalanced_binaryGeneratorPullback G g hG.1 hg) + · apply walshTransform_eq_zero_iff_vectorFourierCoeff_eq_zero _ u |>.mpr + exact lowWeight_vectorFourierCoeff_eq_zero G d hG g u hu hweight + +end CryptBoolean diff --git a/CryptBoolean/Carlet/Chapter04/DegreeCount.lean b/CryptBoolean/Carlet/Chapter04/DegreeCount.lean new file mode 100644 index 0000000..f858016 --- /dev/null +++ b/CryptBoolean/Carlet/Chapter04/DegreeCount.lean @@ -0,0 +1,126 @@ +/- +Copyright (c) 2026 Asher Yan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Asher Yan with Codex +-/ +module + +public import CryptBoolean.Carlet.Chapter03.ReedMuller +public import Mathlib.Analysis.SpecificLimits.Normed + +/-! +# Carlet Chapter 4 degree count + +The exact number of Boolean functions of degree at most `n - 2` and the +resulting asymptotic probability of degree at least `n - 1`. +-/ + +open Finset +open scoped BigOperators BooleanCube Topology + +@[expose] public section + +namespace CryptBoolean + +/-- The low-degree binomial sum omits exactly the last two terms of the +full binomial expansion. -/ +theorem sum_choose_le_n_sub_two (n : ℕ) (hn : 2 ≤ n) : + (∑ j ∈ Finset.range (n - 2 + 1), Nat.choose n j) = + 2 ^ n - n - 1 := by + have hfull := Nat.sum_range_choose n + have hindex : n + 1 = (n - 1) + 2 := by omega + rw [hindex, Finset.sum_range_succ, Finset.sum_range_succ] at hfull + have hpred : Nat.choose n (n - 1) = n := by + exact (Nat.choose_symm (n := n) (k := 1) (by omega)).trans + (Nat.choose_one_right n) + have hself : Nat.choose n (n - 1 + 1) = 1 := by + rw [show n - 1 + 1 = n by omega, Nat.choose_self] + rw [hpred, hself] at hfull + have hrange : n - 2 + 1 = n - 1 := by omega + rw [hrange] + omega + +/-- The functions of degree at most `n - 2` are exactly the corresponding +Reed--Muller codewords, so their number has the standard dimension formula. -/ +theorem card_booleanFunctions_degree_le_n_sub_two (n : ℕ) : + Nat.card {f : BooleanFunction n // + FABL.functionAlgebraicDegree f ≤ n - 2} = + 2 ^ (∑ j ∈ Finset.range (n - 2 + 1), Nat.choose n j) := by + change Nat.card (reedMuller (n - 2) n) = _ + exact reedMuller_card + +/-- Carlet's simplified exact count of functions of degree at most `n - 2`. -/ +theorem card_booleanFunctions_degree_le_n_sub_two_eq + (n : ℕ) (hn : 2 ≤ n) : + Nat.card {f : BooleanFunction n // + FABL.functionAlgebraicDegree f ≤ n - 2} = + 2 ^ (2 ^ n - n - 1) := by + rw [card_booleanFunctions_degree_le_n_sub_two, + sum_choose_le_n_sub_two n hn] + +/-- The number of all `n`-variable Boolean functions is `2^(2^n)`. -/ +theorem natCard_booleanFunction (n : ℕ) : + Nat.card (BooleanFunction n) = 2 ^ (2 ^ n) := by + rw [Nat.card_fun] + simp [Nat.card_eq_fintype_card] + +private noncomputable def highDegreeEquivNotLow (n : ℕ) (hn : 2 ≤ n) : + {f : BooleanFunction n // n - 1 ≤ FABL.functionAlgebraicDegree f} ≃ + {f : BooleanFunction n // + ¬ FABL.functionAlgebraicDegree f ≤ n - 2} where + toFun f := ⟨f.1, by omega⟩ + invFun f := ⟨f.1, by omega⟩ + left_inv f := by rfl + right_inv f := by rfl + +/-- The proportion of `n`-variable Boolean functions having degree at least +`n - 1`. -/ +noncomputable def highAlgebraicDegreeProbability (n : ℕ) : ℝ := + 1 - ((1 : ℝ) / 2) ^ (n + 1) + +/-- The displayed probability is the exact uniform counting ratio. -/ +theorem highAlgebraicDegreeProbability_eq_card_ratio + (n : ℕ) (hn : 2 ≤ n) : + highAlgebraicDegreeProbability n = + (Nat.card {f : BooleanFunction n // + n - 1 ≤ FABL.functionAlgebraicDegree f} : ℝ) / + Nat.card (BooleanFunction n) := by + have hhigh : + Nat.card {f : BooleanFunction n // + n - 1 ≤ FABL.functionAlgebraicDegree f} = + 2 ^ (2 ^ n) - 2 ^ (2 ^ n - n - 1) := by + rw [Nat.card_congr (highDegreeEquivNotLow n hn)] + rw [Nat.card_eq_fintype_card, Fintype.card_subtype_compl] + rw [← Nat.card_eq_fintype_card, ← Nat.card_eq_fintype_card] + rw [natCard_booleanFunction, + card_booleanFunctions_degree_le_n_sub_two_eq n hn] + rw [highAlgebraicDegreeProbability, hhigh, + natCard_booleanFunction] + have hexp : 2 ^ n - n - 1 + (n + 1) = 2 ^ n := by + have := n.lt_two_pow_self + omega + have hle : 2 ^ (2 ^ n - n - 1) ≤ 2 ^ (2 ^ n) := by + exact Nat.pow_le_pow_right (by omega) (by omega) + rw [Nat.cast_sub hle] + norm_num [div_pow] + rw [show (2 : ℝ) ^ (2 ^ n) = + (2 : ℝ) ^ (2 ^ n - n - 1) * (2 : ℝ) ^ (n + 1) by + rw [← pow_add, hexp]] + field_simp + +/-- A uniformly chosen Boolean function has degree at least `n - 1` with +probability tending to one. -/ +theorem tendsto_highAlgebraicDegreeProbability : + Filter.Tendsto highAlgebraicDegreeProbability Filter.atTop (𝓝 1) := by + have hpow : + Filter.Tendsto (fun n : ℕ ↦ ((1 : ℝ) / 2) ^ n) + Filter.atTop (𝓝 0) := + tendsto_pow_atTop_nhds_zero_of_lt_one (by norm_num) (by norm_num) + have hshift : + Filter.Tendsto (fun n : ℕ ↦ ((1 : ℝ) / 2) ^ (n + 1)) + Filter.atTop (𝓝 0) := by + simpa [pow_succ, mul_comm] using hpow.const_mul ((1 : ℝ) / 2) + unfold highAlgebraicDegreeProbability + simpa only [sub_zero] using hshift.const_sub 1 + +end CryptBoolean diff --git a/CryptBoolean/Carlet/Chapter04/DegreeRepairNonlinearity.lean b/CryptBoolean/Carlet/Chapter04/DegreeRepairNonlinearity.lean new file mode 100644 index 0000000..b9e75a9 --- /dev/null +++ b/CryptBoolean/Carlet/Chapter04/DegreeRepairNonlinearity.lean @@ -0,0 +1,289 @@ +/- +Copyright (c) 2026 Asher Yan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Asher Yan with Codex +-/ +module + +public import CryptBoolean.Carlet.Chapter03.ReedMullerMinimumWeight +public import CryptBoolean.Carlet.Chapter04.OddDimensionBestNonlinearity + +/-! +# Degree repair with bounded nonlinearity loss + +The Sarkar--Maitra two-point repair of a balanced Boolean function, and its +application to the odd-dimensional high-nonlinearity family. +-/ + +open Finset +open Module +open scoped BigOperators BooleanCube + +@[expose] public section + +namespace CryptBoolean + +variable {n : ℕ} + +private theorem hammingWeight_comp_equiv + (f : BooleanFunction n) (e : Equiv.Perm (FABL.F₂Cube n)) : + hammingWeight (f ∘ e) = hammingWeight f := by + classical + rw [hammingWeight_eq_card_support, hammingWeight_eq_card_support] + change + (Finset.univ.filter fun x : FABL.F₂Cube n ↦ f (e x) = 1).card = + (Finset.univ.filter fun x : FABL.F₂Cube n ↦ f x = 1).card + rw [Finset.card_filter, Finset.card_filter] + change + (∑ x, if f (e x) = 1 then (1 : ℕ) else 0) = + ∑ x, if f x = 1 then (1 : ℕ) else 0 + exact Equiv.sum_comp e (fun x ↦ if f x = 1 then (1 : ℕ) else 0) + +private theorem mem_binaryAffineLine_iff + (x₀ x₁ x : FABL.F₂Cube n) : + x ∈ FABL.binaryAffineSubspace + (Submodule.span FABL.𝔽₂ {x₁ + x₀}) x₀ ↔ + x = x₀ ∨ x = x₁ := by + rw [FABL.mem_binaryAffineSubspace_iff_add_mem, + Submodule.mem_span_singleton] + constructor + · rintro ⟨c, hc⟩ + by_cases hc₀ : c = 0 + · subst c + left + simp only [zero_smul] at hc + have hx : x + x₀ = 0 := hc.symm + exact (add_eq_zero_iff_eq_neg.mp hx).trans (ZModModule.neg_eq_self x₀) + · have hc₁ : c = 1 := Fin.eq_one_of_ne_zero c hc₀ + subst c + right + simp only [one_smul] at hc + exact add_right_cancel hc.symm + · rintro (rfl | rfl) + · exact ⟨0, by rw [zero_smul, ZModModule.add_self]⟩ + · exact ⟨1, by simp⟩ + +private theorem add_affineLineIndicator_eq_comp_swap + (f : BooleanFunction n) (x₀ x₁ : FABL.F₂Cube n) + (hx₀ : f x₀ = 0) (hx₁ : f x₁ = 1) : + f + affineFlatIndicator + (Submodule.span FABL.𝔽₂ {x₁ + x₀}) x₀ = + f ∘ Equiv.swap x₀ x₁ := by + funext x + by_cases h₀ : x = x₀ + · subst x + simp [Pi.add_apply, affineFlatIndicator, + mem_binaryAffineLine_iff, hx₀, hx₁] + · by_cases h₁ : x = x₁ + · subst x + simp [Pi.add_apply, affineFlatIndicator, + mem_binaryAffineLine_iff, hx₀, hx₁] + · simp [Pi.add_apply, affineFlatIndicator, + mem_binaryAffineLine_iff, h₀, h₁, + Equiv.swap_apply_of_ne_of_ne] + +/-- Nonlinearity is one-Lipschitz with respect to raw Hamming distance. -/ +theorem nonlinearity_le_hammingDistance_add_nonlinearity + (f g : BooleanFunction n) : + nonlinearity f ≤ hammingDistance f g + nonlinearity g := by + classical + obtain ⟨p, _hp, hmin⟩ := Finset.exists_mem_eq_inf' + (s := (Finset.univ : Finset (FABL.𝔽₂ × FABL.F₂Cube n))) + Finset.univ_nonempty + (fun p ↦ hammingDistance g (FABL.affineFunction p.1 p.2)) + have hcandidate : + nonlinearity f ≤ hammingDistance f (FABL.affineFunction p.1 p.2) := by + exact Finset.inf'_le + (fun q : FABL.𝔽₂ × FABL.F₂Cube n ↦ + hammingDistance f (FABL.affineFunction q.1 q.2)) + (Finset.mem_univ p) + have htriangle := hammingDist_triangle f g (FABL.affineFunction p.1 p.2) + change hammingDistance f (FABL.affineFunction p.1 p.2) ≤ + hammingDistance f g + hammingDistance g (FABL.affineFunction p.1 p.2) at htriangle + change nonlinearity g = hammingDistance g (FABL.affineFunction p.1 p.2) at hmin + rw [← hmin] at htriangle + exact hcandidate.trans htriangle + +/-- Sarkar--Maitra Propositions 2--3: in dimension at least two, a balanced +Boolean function can be repaired to algebraic degree `n - 1` by changing at +most two values, with nonlinearity loss at most two. -/ +theorem exists_isBalanced_degree_pred_nonlinearity_ge_sub_two + (f : BooleanFunction n) (hn : 2 ≤ n) (hf : IsBalanced f) : + ∃ g : BooleanFunction n, + IsBalanced g ∧ + FABL.functionAlgebraicDegree g = n - 1 ∧ + nonlinearity f - 2 ≤ nonlinearity g := by + classical + have hnpos : 0 < n := by omega + have hweight : hammingWeight f = 2 ^ (n - 1) := by + rw [IsBalanced] at hf + have hpow : 2 ^ n = 2 * 2 ^ (n - 1) := by + have hnEq : n = (n - 1) + 1 := by omega + calc + 2 ^ n = 2 ^ ((n - 1) + 1) := congrArg (fun k : ℕ ↦ 2 ^ k) hnEq + _ = 2 ^ (n - 1) * 2 := by rw [pow_succ] + _ = 2 * 2 ^ (n - 1) := Nat.mul_comm _ _ + rw [hpow] at hf + omega + have hsupportCard : (support f).card = 2 ^ (n - 1) := by + rw [← hammingWeight_eq_card_support] + exact hweight + have heven : Even (support f).card := by + rw [hsupportCard, show n - 1 = (n - 2) + 1 by omega, pow_succ] + exact ⟨2 ^ (n - 2), by omega⟩ + have hdegreeLe : FABL.functionAlgebraicDegree f ≤ n - 1 := by + have hle := FABL.functionAlgebraicDegree_le_dimension f + have hne : FABL.functionAlgebraicDegree f ≠ n := by + intro hdegree + have hodd := + (FABL.functionAlgebraicDegree_eq_dimension_iff_card_f₂OneSupport_odd + f hnpos).mp hdegree + exact (Nat.not_odd_iff_even.mpr heven) hodd + omega + by_cases hdegree : FABL.functionAlgebraicDegree f = n - 1 + · exact ⟨f, hf, hdegree, by omega⟩ + · have hdegreeLow : FABL.functionAlgebraicDegree f ≤ n - 2 := by + omega + have hsupportNonempty : (support f).Nonempty := by + apply Finset.card_pos.mp + rw [hsupportCard] + exact Nat.two_pow_pos _ + obtain ⟨x₁, hx₁mem⟩ := hsupportNonempty + have hx₁ : f x₁ = 1 := (mem_support f x₁).mp hx₁mem + have hsupportLt : + (support f).card < Fintype.card (FABL.F₂Cube n) := by + rw [hsupportCard, card_f₂Cube] + have hpow : 2 ^ n = 2 * 2 ^ (n - 1) := by + have hnEq : n = (n - 1) + 1 := by omega + calc + 2 ^ n = 2 ^ ((n - 1) + 1) := congrArg (fun k : ℕ ↦ 2 ^ k) hnEq + _ = 2 ^ (n - 1) * 2 := by rw [pow_succ] + _ = 2 * 2 ^ (n - 1) := Nat.mul_comm _ _ + rw [hpow] + have hpositive : 0 < 2 ^ (n - 1) := Nat.two_pow_pos _ + omega + have hx₀exists : ∃ x₀ : FABL.F₂Cube n, x₀ ∉ support f := by + by_contra h + have hall : ∀ x₀ : FABL.F₂Cube n, x₀ ∈ support f := by + intro x₀ + by_contra hx₀ + exact h ⟨x₀, hx₀⟩ + have huniv : support f = Finset.univ := Finset.eq_univ_of_forall hall + have := congrArg Finset.card huniv + simp only [Finset.card_univ] at this + omega + obtain ⟨x₀, hx₀notMem⟩ := hx₀exists + have hx₀ : f x₀ = 0 := by + by_contra hx₀ne + have hx₀one : f x₀ = 1 := Fin.eq_one_of_ne_zero _ hx₀ne + exact hx₀notMem ((mem_support f x₀).mpr hx₀one) + have hxne : x₁ ≠ x₀ := by + intro h + subst x₁ + rw [hx₀] at hx₁ + exact zero_ne_one hx₁ + have hdirection : x₁ + x₀ ≠ 0 := by + intro hzero + apply hxne + exact (add_eq_zero_iff_eq_neg.mp hzero).trans + (ZModModule.neg_eq_self x₀) + let H : Submodule FABL.𝔽₂ (FABL.F₂Cube n) := + Submodule.span FABL.𝔽₂ {x₁ + x₀} + let p : BooleanFunction n := affineFlatIndicator H x₀ + let g : BooleanFunction n := f + p + have hfinrank : Module.finrank FABL.𝔽₂ H = 1 := by + dsimp [H] + exact finrank_span_singleton hdirection + have hpDegree : FABL.functionAlgebraicDegree p = n - 1 := by + rw [show p = affineFlatIndicator H x₀ by rfl, + functionAlgebraicDegree_affineFlatIndicator, + FABL.f₂Codimension, FABL.finrank_perpendicularSubspace, + hfinrank] + have hgSwap : g = f ∘ Equiv.swap x₀ x₁ := by + dsimp [g, p, H] + exact add_affineLineIndicator_eq_comp_swap f x₀ x₁ hx₀ hx₁ + have hgBalanced : IsBalanced g := by + rw [IsBalanced, hgSwap, hammingWeight_comp_equiv] + exact hf + have hdistance : hammingDistance f g = 2 := by + rw [hammingDistance_eq_hammingWeight_add] + have hcancel : f + g = p := by + dsimp [g] + funext x + simp only [Pi.add_apply] + rw [← add_assoc, CharTwo.add_self_eq_zero, zero_add] + rw [hcancel, show p = affineFlatIndicator H x₀ by rfl, + hammingWeight_affineFlatIndicator, hfinrank] + norm_num + have hgDegreeLe : FABL.functionAlgebraicDegree g ≤ n - 1 := by + dsimp [g] + have hle := FABL.functionAlgebraicDegree_add_le_max f p + rw [hpDegree] at hle + exact hle.trans (max_le hdegreeLe le_rfl) + have hgDegreeGe : n - 1 ≤ FABL.functionAlgebraicDegree g := by + by_contra hnot + have hgLow : FABL.functionAlgebraicDegree g ≤ n - 2 := by omega + have hpEq : f + g = p := by + dsimp [g] + funext x + simp only [Pi.add_apply] + rw [← add_assoc, CharTwo.add_self_eq_zero, zero_add] + have hle := FABL.functionAlgebraicDegree_add_le_max f g + rw [hpEq, hpDegree] at hle + have hmax : + max (FABL.functionAlgebraicDegree f) + (FABL.functionAlgebraicDegree g) ≤ n - 2 := + max_le hdegreeLow hgLow + omega + have hgDegree : FABL.functionAlgebraicDegree g = n - 1 := by omega + have hnonlinearity := + nonlinearity_le_hammingDistance_add_nonlinearity f g + rw [hdistance] at hnonlinearity + exact ⟨g, hgBalanced, hgDegree, by omega⟩ + +/-- Carlet footnote 22, degree-constrained family: for every odd `n ≥ 15` +there is a balanced Boolean function of algebraic degree `n - 1` whose +nonlinearity strictly exceeds the odd-dimensional quadratic bound. -/ +theorem exists_isBalanced_degree_pred_nonlinearity_gt_quadraticBound_of_odd + (hn : Odd n) (hn15 : 15 ≤ n) : + ∃ f : BooleanFunction n, + IsBalanced f ∧ + FABL.functionAlgebraicDegree f = n - 1 ∧ + 2 ^ (n - 1) - 2 ^ ((n - 1) / 2) < nonlinearity f := by + obtain ⟨k, hk⟩ := hn + have hk7 : 7 ≤ k := by omega + let m := k - 6 + have hm : 1 ≤ m := by + dsimp [m] + omega + have hnform : n = 13 + (m + m) := by + dsimp [m] + omega + rw [hnform] + obtain ⟨f, hbalanced, hdegree, hrepair⟩ := + exists_isBalanced_degree_pred_nonlinearity_ge_sub_two + (maitraKavutYucelBentExtension m) (by omega) + (isBalanced_maitraKavutYucelBentExtension m) + refine ⟨f, hbalanced, hdegree, ?_⟩ + rw [nonlinearity_maitraKavutYucelBentExtension] at hrepair + have hsub : 13 + (m + m) - 1 = 12 + (m + m) := by omega + have hhalf : (12 + (m + m)) / 2 = 6 + m := by omega + rw [hsub, hhalf] + have htwo : 2 ≤ 2 ^ m := by + rw [show 2 = 2 ^ 1 by norm_num] + exact Nat.pow_le_pow_right (by omega) hm + have hsix : 2 ^ (6 + m) = 64 * 2 ^ m := by + rw [pow_add] + norm_num + have hlarge : 64 * 2 ^ m ≤ 2 ^ (12 + (m + m)) := by + rw [← hsix] + exact Nat.pow_le_pow_right (by omega) (by omega) + have hgap : 60 * 2 ^ m + 2 < 64 * 2 ^ m := by omega + have hstrict : + 2 ^ (12 + (m + m)) - 64 * 2 ^ m < + (2 ^ (12 + (m + m)) - 60 * 2 ^ m) - 2 := by + omega + rw [hsix] + exact hstrict.trans_le hrepair + +end CryptBoolean diff --git a/CryptBoolean/Carlet/Chapter04/DerivativeNonlinearity.lean b/CryptBoolean/Carlet/Chapter04/DerivativeNonlinearity.lean new file mode 100644 index 0000000..922668a --- /dev/null +++ b/CryptBoolean/Carlet/Chapter04/DerivativeNonlinearity.lean @@ -0,0 +1,266 @@ +/- +Copyright (c) 2026 Asher Yan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Asher Yan with Codex +-/ +module + +public import CryptBoolean.Carlet.Chapter04.LinearStructureSpectrum + +/-! +# Carlet Chapter 4 derivative bounds for nonlinearity + +The raw hyperplane Walsh identity gives Carlet's autocorrelation upper bound for nonlinearity. +The derivative weight inequality gives Relation (37). +-/ + +open Finset +open scoped BigOperators BooleanCube NNReal + +@[expose] public section + +namespace CryptBoolean + +variable {n : ℕ} + +noncomputable local instance derivativeNonlinearitySubmoduleFintype + (E : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) : Fintype E := + Fintype.ofFinite E + +/-- The least absolute autocorrelation at a nonzero direction. In dimension zero the empty +family is assigned the value zero. -/ +noncomputable def minimumAutocorrelationMagnitude (f : BooleanFunction n) : ℝ := + let directions := Finset.univ.erase (0 : FABL.F₂Cube n) + if h : directions.Nonempty then + directions.inf' h fun e ↦ |autocorrelation f e| + else 0 + +private theorem exists_walshCharacter_mul_eq_abs + (e : FABL.F₂Cube n) (he : e ≠ 0) (t : ℝ) : + ∃ a : FABL.F₂Cube n, FABL.vectorWalshCharacter a e * t = |t| := by + by_cases ht : 0 ≤ t + · exact ⟨0, by simp [abs_of_nonneg ht]⟩ + · have htneg : t < 0 := lt_of_not_ge ht + obtain ⟨i, hi⟩ := Function.ne_iff.mp he + have hi' : e i ≠ 0 := by simpa using hi + have hei : e i = 1 := Fin.eq_one_of_ne_zero (e i) hi' + let a : FABL.F₂Cube n := Pi.single i 1 + have hcharacter : FABL.vectorWalshCharacter a e = -1 := by + rw [FABL.vectorWalshCharacter_apply] + have hdot : FABL.f₂DotProduct a e = 1 := by + simp [a, FABL.f₂DotProduct, single_dotProduct, hei] + rw [hdot, FABL.binarySign_one] + refine ⟨a, ?_⟩ + rw [hcharacter, abs_of_neg htneg] + ring + +private theorem abs_walshTransform_le_maxWalshMagnitude + (f : BooleanFunction n) (a : FABL.F₂Cube n) : + |(walshTransform f a : ℝ)| ≤ (maxWalshMagnitude f : ℝ) := by + have hnat : (walshTransform f a).natAbs ≤ maxWalshMagnitude f := by + rw [maxWalshMagnitude] + exact Finset.le_sup' (fun u : FABL.F₂Cube n ↦ (walshTransform f u).natAbs) + (Finset.mem_univ a) + have hcast : ((walshTransform f a).natAbs : ℝ) ≤ (maxWalshMagnitude f : ℝ) := by + exact_mod_cast hnat + simpa using hcast + +private theorem two_pow_add_abs_autocorrelation_le_maxWalshMagnitude_sq + (f : BooleanFunction n) (e : FABL.F₂Cube n) (he : e ≠ 0) : + (2 : ℝ) ^ n + |autocorrelation f e| ≤ (maxWalshMagnitude f : ℝ) ^ 2 := by + obtain ⟨a, ha⟩ := + exists_walshCharacter_mul_eq_abs e he (autocorrelation f e) + have hsum := sum_walshTransform_sq_hyperplane_coset f e a he + rw [ha] at hsum + have hmaxNonneg : 0 ≤ (maxWalshMagnitude f : ℝ) := by positivity + have hterm (u : walshHyperplane e) : + (walshTransform f (a + u.1) : ℝ) ^ 2 ≤ + (maxWalshMagnitude f : ℝ) ^ 2 := by + have habs := abs_walshTransform_le_maxWalshMagnitude f (a + u.1) + have hsquare := + (sq_le_sq₀ (abs_nonneg (walshTransform f (a + u.1) : ℝ)) hmaxNonneg).mpr habs + simpa only [sq_abs] using hsquare + have hsumLe : + (∑ u : walshHyperplane e, + (walshTransform f (a + u.1) : ℝ) ^ 2) ≤ + ∑ _u : walshHyperplane e, (maxWalshMagnitude f : ℝ) ^ 2 := by + apply Finset.sum_le_sum + intro u _hu + exact hterm u + have hcard : Fintype.card (walshHyperplane e) = 2 ^ (n - 1) := by + rw [← Nat.card_eq_fintype_card, natCard_walshHyperplane e he] + rw [hsum, Finset.sum_const, nsmul_eq_mul, Finset.card_univ, hcard] at hsumLe + push_cast at hsumLe + have hpositive : 0 < (2 : ℝ) ^ (n - 1) := by positivity + nlinarith + +/-- Adding a function with constant derivative changes autocorrelation in that direction only by +the sign of the derivative constant. -/ +theorem autocorrelation_add_of_isLinearStructure + (f g : BooleanFunction n) {e : FABL.F₂Cube n} {ε : FABL.𝔽₂} + (hg : ∀ x, FABL.booleanDerivative g e x = ε) : + autocorrelation (f + g) e = (bitSignInt ε : ℝ) * autocorrelation f e := by + classical + unfold autocorrelation + rw [Finset.mul_sum] + apply Finset.sum_congr rfl + intro x _hx + unfold realSignView FABL.realSignEncodedFunction FABL.signEncodedFunction + rw [show FABL.booleanDerivative (f + g) e x = + FABL.booleanDerivative f e x + ε by + rw [booleanDerivative_add] + exact congrArg (FABL.booleanDerivative f e x + ·) (hg x)] + rw [FABL.signValue_signEncode_eq_binarySign, + FABL.signValue_signEncode_eq_binarySign, AddChar.map_add_eq_mul, + bitSignInt_cast] + ring + +/-- Adding a function with constant derivative preserves the autocorrelation magnitude in that +direction. -/ +theorem abs_autocorrelation_add_of_isLinearStructure + (f g : BooleanFunction n) {e : FABL.F₂Cube n} {ε : FABL.𝔽₂} + (hg : ∀ x, FABL.booleanDerivative g e x = ε) : + |autocorrelation (f + g) e| = |autocorrelation f e| := by + rw [autocorrelation_add_of_isLinearStructure f g hg, abs_mul] + have hsign : |(bitSignInt ε : ℝ)| = 1 := by + rw [bitSignInt_cast] + rcases FABL.signValue_eq_neg_one_or_one (FABL.signEncode ε) with h | h <;> + rw [FABL.signValue_signEncode_eq_binarySign] at h <;> rw [h] <;> norm_num + rw [hsign, one_mul] + +/-- In positive dimension Carlet's absolute indicator is attained at a nonzero direction. -/ +theorem exists_abs_autocorrelation_eq_absoluteIndicator + (hn : 0 < n) (f : BooleanFunction n) : + ∃ e : FABL.F₂Cube n, e ≠ 0 ∧ + |autocorrelation f e| = absoluteIndicator f := by + classical + let i : Fin n := ⟨0, hn⟩ + let d : FABL.F₂Cube n := Pi.single i 1 + have hd : d ≠ 0 := by + intro hzero + have hi := congrFun hzero i + simp [d] at hi + let directions := Finset.univ.erase (0 : FABL.F₂Cube n) + have hnonempty : directions.Nonempty := + ⟨d, Finset.mem_erase.mpr ⟨hd, Finset.mem_univ d⟩⟩ + obtain ⟨e, he, hmaximum⟩ := Finset.exists_mem_eq_sup directions hnonempty + (fun d ↦ Real.toNNReal |autocorrelation f d|) + refine ⟨e, (Finset.mem_erase.mp he).1, ?_⟩ + have hmaximumReal := congrArg (fun q : ℝ≥0 ↦ (q : ℝ)) hmaximum + simpa [absoluteIndicator, directions] using hmaximumReal.symm + +/-- Carlet's upper derivative bound: the largest nonzero autocorrelation magnitude improves the +universal upper bound on raw nonlinearity. -/ +theorem nonlinearity_cast_le_autocorrelation_upper_bound + (f : BooleanFunction n) (hn : 0 < n) : + (nonlinearity f : ℝ) ≤ + (2 : ℝ) ^ (n - 1) - + Real.sqrt ((2 : ℝ) ^ n + absoluteIndicator f) / 2 := by + obtain ⟨e, he, hmaximum⟩ := + exists_abs_autocorrelation_eq_absoluteIndicator hn f + have hsquare := + two_pow_add_abs_autocorrelation_le_maxWalshMagnitude_sq f e he + rw [hmaximum] at hsquare + have hsqrt : + Real.sqrt ((2 : ℝ) ^ n + absoluteIndicator f) ≤ + (maxWalshMagnitude f : ℝ) := + Real.sqrt_le_iff.mpr ⟨by positivity, hsquare⟩ + have hpow : (2 : ℝ) ^ n / 2 = (2 : ℝ) ^ (n - 1) := by + have hpowsucc : (2 : ℝ) ^ n = (2 : ℝ) ^ (n - 1) * 2 := by + calc + (2 : ℝ) ^ n = (2 : ℝ) ^ ((n - 1) + 1) := by congr 1; omega + _ = (2 : ℝ) ^ (n - 1) * 2 := by rw [pow_succ] + rw [hpowsucc] + ring + rw [nonlinearity_cast_eq_relation_35, hpow] + linarith + +private theorem nonzeroDirections_nonempty + (f : BooleanFunction n) (hn : 0 < n) : + (Finset.univ.erase (0 : FABL.F₂Cube n)).Nonempty := by + obtain ⟨e, he, _hmaximum⟩ := + exists_abs_autocorrelation_eq_absoluteIndicator hn f + exact ⟨e, Finset.mem_erase.mpr ⟨he, Finset.mem_univ e⟩⟩ + +private theorem exists_abs_autocorrelation_eq_minimumAutocorrelationMagnitude + (f : BooleanFunction n) (hn : 0 < n) : + ∃ e : FABL.F₂Cube n, e ≠ 0 ∧ + |autocorrelation f e| = minimumAutocorrelationMagnitude f := by + classical + let directions := Finset.univ.erase (0 : FABL.F₂Cube n) + have hnonempty : directions.Nonempty := by + simpa [directions] using nonzeroDirections_nonempty f hn + obtain ⟨e, he, hminimum⟩ := Finset.exists_mem_eq_inf' hnonempty + (fun d ↦ |autocorrelation f d|) + refine ⟨e, (Finset.mem_erase.mp he).1, ?_⟩ + rw [minimumAutocorrelationMagnitude, dif_pos hnonempty] + exact hminimum.symm + +private theorem derivative_affineFunction + (b : FABL.𝔽₂) (a e : FABL.F₂Cube n) : + ∀ x, FABL.booleanDerivative (FABL.affineFunction b a) e x = + FABL.f₂DotProduct a e := by + intro x + simp only [FABL.booleanDerivative, FABL.affineFunction, FABL.f₂DotProduct, + dotProduct_add] + calc + b + dotProduct a x + (b + (dotProduct a x + dotProduct a e)) = + (b + b) + (dotProduct a x + dotProduct a x) + dotProduct a e := by + abel + _ = dotProduct a e := by + rw [ZModModule.add_self, ZModModule.add_self, zero_add, zero_add] + +private theorem autocorrelation_lower_bound_le_hammingDistance_affineFunction + (f : BooleanFunction n) (e : FABL.F₂Cube n) + (b : FABL.𝔽₂) (a : FABL.F₂Cube n) : + ((2 : ℝ) ^ n - |autocorrelation f e|) / 4 ≤ + (hammingDistance f (FABL.affineFunction b a) : ℝ) := by + let g := FABL.affineFunction b a + have hweight := hammingWeight_booleanDerivative_le_two_mul (f + g) e + rw [← hammingDistance_eq_hammingWeight_add] at hweight + have hweightReal : + (hammingWeight (FABL.booleanDerivative (f + g) e) : ℝ) ≤ + 2 * (hammingDistance f g : ℝ) := by + exact_mod_cast hweight + have hauto := autocorrelation_eq_two_pow_sub_two_derivative_weight (f + g) e + have habs : |autocorrelation (f + g) e| = |autocorrelation f e| := + abs_autocorrelation_add_of_isLinearStructure f g + (derivative_affineFunction b a e) + have hautoLe : autocorrelation (f + g) e ≤ |autocorrelation f e| := by + calc + autocorrelation (f + g) e ≤ |autocorrelation (f + g) e| := le_abs_self _ + _ = |autocorrelation f e| := habs + dsimp [g] at hweightReal hauto hautoLe ⊢ + nlinarith + +private theorem autocorrelation_lower_bound_le_nonlinearity + (f : BooleanFunction n) (e : FABL.F₂Cube n) : + ((2 : ℝ) ^ n - |autocorrelation f e|) / 4 ≤ (nonlinearity f : ℝ) := by + classical + obtain ⟨p, _hp, hminimum⟩ := Finset.exists_mem_eq_inf' + (s := (Finset.univ : Finset (FABL.𝔽₂ × FABL.F₂Cube n))) + Finset.univ_nonempty + (fun q ↦ hammingDistance f (FABL.affineFunction q.1 q.2)) + have hminimum' : + nonlinearity f = hammingDistance f (FABL.affineFunction p.1 p.2) := by + simpa [nonlinearity] using hminimum + rw [hminimum'] + exact autocorrelation_lower_bound_le_hammingDistance_affineFunction f e p.1 p.2 + +/-- Carlet Relation (37): the least nonzero autocorrelation magnitude gives a lower bound on raw +nonlinearity. The real exponent preserves the printed power in every positive dimension. -/ +theorem relation_37_nonlinearity_lower_bound + (f : BooleanFunction n) (hn : 0 < n) : + (2 : ℝ) ^ ((n : ℝ) - 2) - minimumAutocorrelationMagnitude f / 4 ≤ + (nonlinearity f : ℝ) := by + obtain ⟨e, _he, hminimum⟩ := + exists_abs_autocorrelation_eq_minimumAutocorrelationMagnitude f hn + have hlower := autocorrelation_lower_bound_le_nonlinearity f e + rw [hminimum] at hlower + have hpow : (2 : ℝ) ^ ((n : ℝ) - 2) = (2 : ℝ) ^ n / 4 := by + rw [Real.rpow_sub (by norm_num : (0 : ℝ) < 2), Real.rpow_natCast] + norm_num + rw [hpow] + linarith + +end CryptBoolean diff --git a/CryptBoolean/Carlet/Chapter04/DistanceToLinearStructures.lean b/CryptBoolean/Carlet/Chapter04/DistanceToLinearStructures.lean new file mode 100644 index 0000000..f1caa5b --- /dev/null +++ b/CryptBoolean/Carlet/Chapter04/DistanceToLinearStructures.lean @@ -0,0 +1,455 @@ +/- +Copyright (c) 2026 Asher Yan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Asher Yan with Codex +-/ +module + +public import CryptBoolean.Carlet.Chapter04.DerivativeNonlinearity +public import CryptBoolean.Carlet.Chapter04.LinearStructures + +/-! +# Carlet Chapter 4 distance to linear structures + +The distance to linear structures is the least raw Hamming distance to a Boolean function with a +nonzero constant-derivative direction. Its exact value is determined by the largest nontrivial +autocorrelation magnitude. +-/ + +open Finset +open scoped BigOperators BooleanCube NNReal + +@[expose] public section + +namespace CryptBoolean + +variable {n : ℕ} + +/-- A Boolean function admits a nonzero linear structure. -/ +def HasNonzeroLinearStructure (g : BooleanFunction n) : Prop := + ∃ e : FABL.F₂Cube n, e ≠ 0 ∧ IsLinearStructure g e + +private noncomputable instance hasNonzeroLinearStructureDecidable : + DecidablePred (HasNonzeroLinearStructure (n := n)) := + Classical.decPred _ + +private theorem exists_nonzero_direction (hn : 0 < n) : + ∃ e : FABL.F₂Cube n, e ≠ 0 := by + let i : Fin n := ⟨0, hn⟩ + refine ⟨Pi.single i 1, ?_⟩ + intro h + have hi := congrFun h i + simp at hi + +private theorem nonempty_hasNonzeroLinearStructure (hn : 0 < n) : + (Finset.univ.filter (HasNonzeroLinearStructure (n := n))).Nonempty := by + classical + obtain ⟨e, he⟩ := exists_nonzero_direction hn + refine ⟨(0 : BooleanFunction n), Finset.mem_filter.mpr ⟨Finset.mem_univ _, ?_⟩⟩ + refine ⟨e, he, 0, ?_⟩ + intro x + simp [FABL.booleanDerivative] + +/-- The least raw Hamming distance to a Boolean function admitting a nonzero linear structure. +The zero-dimensional empty-family value is defined to be zero. -/ +noncomputable def distanceToLinearStructures (f : BooleanFunction n) : ℕ := + by + classical + exact + if h : (Finset.univ.filter (HasNonzeroLinearStructure (n := n))).Nonempty then + (Finset.univ.filter (HasNonzeroLinearStructure (n := n))).inf' h + (hammingDistance f) + else 0 + +/-- The distance to linear structures is bounded by the distance to every function with a +nonzero linear structure. -/ +theorem distanceToLinearStructures_le_hammingDistance + (hn : 0 < n) (f g : BooleanFunction n) (hg : HasNonzeroLinearStructure g) : + distanceToLinearStructures f ≤ hammingDistance f g := by + classical + rw [distanceToLinearStructures, dif_pos (nonempty_hasNonzeroLinearStructure hn)] + exact Finset.inf'_le _ (Finset.mem_filter.mpr ⟨Finset.mem_univ _, hg⟩) + +/-- The nearest function with a nonzero linear structure exists in every positive dimension. -/ +theorem exists_hammingDistance_eq_distanceToLinearStructures + (hn : 0 < n) (f : BooleanFunction n) : + ∃ g : BooleanFunction n, HasNonzeroLinearStructure g ∧ + hammingDistance f g = distanceToLinearStructures f := by + classical + let s := Finset.univ.filter (HasNonzeroLinearStructure (n := n)) + have hs : s.Nonempty := nonempty_hasNonzeroLinearStructure hn + obtain ⟨g, hg, hmin⟩ := Finset.exists_mem_eq_inf' hs (hammingDistance f) + refine ⟨g, (Finset.mem_filter.mp hg).2, ?_⟩ + rw [distanceToLinearStructures, dif_pos hs] + exact hmin.symm + +private noncomputable instance cubeLinearOrder : LinearOrder (FABL.F₂Cube n) := + (Trunc.out (Fintype.truncEquivFin (FABL.F₂Cube n))).linearOrder + +private noncomputable def repairDerivative + (f : BooleanFunction n) (e : FABL.F₂Cube n) (ε : FABL.𝔽₂) : BooleanFunction n := + fun x ↦ if x < x + e then f x else f (x + e) + ε + +private theorem add_direction_twice (x e : FABL.F₂Cube n) : + (x + e) + e = x := by + calc + (x + e) + e = x + (e + e) := add_assoc _ _ _ + _ = x := by rw [ZModModule.add_self, add_zero] + +private theorem add_direction_ne (x : FABL.F₂Cube n) {e : FABL.F₂Cube n} + (he : e ≠ 0) : x + e ≠ x := by + intro h + apply he + apply add_left_cancel (a := x) + simpa using h + +private theorem repairDerivative_pair + (f : BooleanFunction n) {e : FABL.F₂Cube n} (he : e ≠ 0) + (ε : FABL.𝔽₂) (x : FABL.F₂Cube n) : + repairDerivative f e ε x + repairDerivative f e ε (x + e) = ε := by + classical + have hcycle := add_direction_twice x e + have hne := add_direction_ne x he + by_cases hlt : x < x + e + · have hnlt : ¬ x + e < (x + e) + e := by + rw [hcycle] + exact not_lt_of_ge hlt.le + rw [repairDerivative, if_pos hlt, repairDerivative, if_neg hnlt, hcycle] + calc + f x + (f x + ε) = (f x + f x) + ε := by abel + _ = ε := by rw [ZModModule.add_self, zero_add] + · have hrev : x + e < x := lt_of_le_of_ne (le_of_not_gt hlt) hne + have hrevCycle : x + e < (x + e) + e := by simpa [hcycle] using hrev + rw [repairDerivative, if_neg hlt, repairDerivative, if_pos hrevCycle] + calc + f (x + e) + ε + f (x + e) = (f (x + e) + f (x + e)) + ε := by abel + _ = ε := by rw [ZModModule.add_self, zero_add] + +private theorem isLinearStructure_repairDerivative + (f : BooleanFunction n) {e : FABL.F₂Cube n} (he : e ≠ 0) (ε : FABL.𝔽₂) : + IsLinearStructure (repairDerivative f e ε) e := by + refine ⟨ε, ?_⟩ + intro x + exact repairDerivative_pair f he ε x + +private theorem repairDerivative_error_pair + (f : BooleanFunction n) {e : FABL.F₂Cube n} (he : e ≠ 0) + (ε : FABL.𝔽₂) (x : FABL.F₂Cube n) : + (if (f + repairDerivative f e ε) x = 1 then (1 : ℕ) else 0) + + (if (f + repairDerivative f e ε) (x + e) = 1 then (1 : ℕ) else 0) = + if (FABL.booleanDerivative f e + (fun _ : FABL.F₂Cube n ↦ ε) : + BooleanFunction n) x = 1 then 1 else 0 := by + classical + have hcycle := add_direction_twice x e + have hne := add_direction_ne x he + by_cases hlt : x < x + e + · have hnlt : ¬ x + e < (x + e) + e := by + rw [hcycle] + exact not_lt_of_ge hlt.le + have hxzero : (f + repairDerivative f e ε) x = 0 := by + simp only [Pi.add_apply, repairDerivative, if_pos hlt] + exact ZModModule.add_self (f x) + have hyerror : (f + repairDerivative f e ε) (x + e) = + (FABL.booleanDerivative f e + (fun _ : FABL.F₂Cube n ↦ ε) : + BooleanFunction n) x := by + rw [Pi.add_apply, repairDerivative, if_neg hnlt, hcycle] + simp only [Pi.add_apply, FABL.booleanDerivative] + abel + rw [hxzero, hyerror] + simp + · have hrev : x + e < x := lt_of_le_of_ne (le_of_not_gt hlt) hne + have hrevCycle : x + e < (x + e) + e := by simpa [hcycle] using hrev + have hxerror : (f + repairDerivative f e ε) x = + (FABL.booleanDerivative f e + (fun _ : FABL.F₂Cube n ↦ ε) : + BooleanFunction n) x := by + rw [Pi.add_apply, repairDerivative, if_neg hlt] + simp only [Pi.add_apply, FABL.booleanDerivative] + abel + have hyzero : (f + repairDerivative f e ε) (x + e) = 0 := by + rw [Pi.add_apply, repairDerivative, if_pos hrevCycle] + exact ZModModule.add_self (f (x + e)) + rw [hxerror, hyzero] + simp + +private theorem two_mul_hammingDistance_repairDerivative + (f : BooleanFunction n) {e : FABL.F₂Cube n} (he : e ≠ 0) (ε : FABL.𝔽₂) : + 2 * hammingDistance f (repairDerivative f e ε) = + hammingWeight (FABL.booleanDerivative f e + (fun _ : FABL.F₂Cube n ↦ ε)) := by + classical + rw [hammingDistance_eq_hammingWeight_add, + hammingWeight_eq_card_support, hammingWeight_eq_card_support] + simp only [support, FABL.f₂OneSupport, Finset.card_filter] + change + 2 * ∑ x, (if (f + repairDerivative f e ε) x = 1 then (1 : ℕ) else 0) = + ∑ x, (if (FABL.booleanDerivative f e + (fun _ : FABL.F₂Cube n ↦ ε) : + BooleanFunction n) x = 1 then (1 : ℕ) else 0) + rw [two_mul] + calc + (∑ x, if (f + repairDerivative f e ε) x = 1 then (1 : ℕ) else 0) + + ∑ x, (if (f + repairDerivative f e ε) x = 1 then (1 : ℕ) else 0) = + (∑ x, if (f + repairDerivative f e ε) x = 1 then (1 : ℕ) else 0) + + ∑ x, (if (f + repairDerivative f e ε) (x + e) = 1 then + (1 : ℕ) else 0) := by + congr 1 + calc + ∑ x, (if (f + repairDerivative f e ε) x = 1 then (1 : ℕ) else 0) = + ∑ x, (if (f + repairDerivative f e ε) ((Equiv.addRight e) x) = 1 then + (1 : ℕ) else 0) := + (Equiv.sum_comp (Equiv.addRight e) + (fun x ↦ if (f + repairDerivative f e ε) x = 1 then (1 : ℕ) else 0)).symm + _ = ∑ x, (if (f + repairDerivative f e ε) (x + e) = 1 then + (1 : ℕ) else 0) := by + apply Finset.sum_congr rfl + intro x _ + rfl + _ = ∑ x, ((if (f + repairDerivative f e ε) x = 1 then (1 : ℕ) else 0) + + if (f + repairDerivative f e ε) (x + e) = 1 then (1 : ℕ) else 0) := by + rw [Finset.sum_add_distrib] + _ = ∑ x, (if (FABL.booleanDerivative f e + (fun _ : FABL.F₂Cube n ↦ ε) : + BooleanFunction n) x = 1 then + (1 : ℕ) else 0) := by + apply Finset.sum_congr rfl + intro x _ + exact repairDerivative_error_pair f he ε x + +/-- Every nonzero autocorrelation magnitude is bounded by Carlet's absolute indicator. -/ +theorem abs_autocorrelation_le_absoluteIndicator + (f : BooleanFunction n) {e : FABL.F₂Cube n} (he : e ≠ 0) : + |autocorrelation f e| ≤ absoluteIndicator f := by + have hle : Real.toNNReal |autocorrelation f e| ≤ + (Finset.univ.erase (0 : FABL.F₂Cube n)).sup + (fun d ↦ Real.toNNReal |autocorrelation f d|) := + Finset.le_sup (f := fun d ↦ Real.toNNReal |autocorrelation f d|) + (Finset.mem_erase.mpr ⟨he, Finset.mem_univ e⟩) + unfold absoluteIndicator + calc + |autocorrelation f e| = (Real.toNNReal |autocorrelation f e| : ℝ) := by + exact (Real.coe_toNNReal _ (abs_nonneg _)).symm + _ ≤ (((Finset.univ.erase (0 : FABL.F₂Cube n)).sup + (fun d ↦ Real.toNNReal |autocorrelation f d|) : ℝ≥0) : ℝ) := + NNReal.coe_le_coe.mpr hle + +private theorem distance_lower_bound_of_hasNonzeroLinearStructure + (f g : BooleanFunction n) (hg : HasNonzeroLinearStructure g) : + ((2 : ℝ) ^ n - absoluteIndicator f) / 4 ≤ hammingDistance f g := by + obtain ⟨e, he, ε, hε⟩ := hg + have hweight := hammingWeight_booleanDerivative_le_two_mul (f + g) e + rw [← hammingDistance_eq_hammingWeight_add] at hweight + have hweightReal : + (hammingWeight (FABL.booleanDerivative (f + g) e) : ℝ) ≤ + 2 * (hammingDistance f g : ℝ) := by + exact_mod_cast hweight + have hauto := autocorrelation_eq_two_pow_sub_two_derivative_weight (f + g) e + have habs : |autocorrelation (f + g) e| = |autocorrelation f e| := + abs_autocorrelation_add_of_isLinearStructure f g hε + have hindicator := abs_autocorrelation_le_absoluteIndicator f he + have hautoLe : autocorrelation (f + g) e ≤ absoluteIndicator f := by + calc + autocorrelation (f + g) e ≤ |autocorrelation (f + g) e| := le_abs_self _ + _ = |autocorrelation f e| := habs + _ ≤ absoluteIndicator f := hindicator + linarith + +private theorem hasNonzeroLinearStructure_repairDerivative + (f : BooleanFunction n) {e : FABL.F₂Cube n} (he : e ≠ 0) (ε : FABL.𝔽₂) : + HasNonzeroLinearStructure (repairDerivative f e ε) := + ⟨e, he, isLinearStructure_repairDerivative f he ε⟩ + +private theorem exists_repairDerivative_at_absoluteIndicator + (hn : 0 < n) (f : BooleanFunction n) : + ∃ g : BooleanFunction n, HasNonzeroLinearStructure g ∧ + (hammingDistance f g : ℝ) = + ((2 : ℝ) ^ n - absoluteIndicator f) / 4 := by + obtain ⟨e, he, hmax⟩ := exists_abs_autocorrelation_eq_absoluteIndicator hn f + by_cases hnonneg : 0 ≤ autocorrelation f e + · let g := repairDerivative f e 0 + refine ⟨g, hasNonzeroLinearStructure_repairDerivative f he 0, ?_⟩ + have hrepair := two_mul_hammingDistance_repairDerivative f he 0 + have hauto := autocorrelation_eq_two_pow_sub_two_derivative_weight f e + have habs : |autocorrelation f e| = autocorrelation f e := abs_of_nonneg hnonneg + have hrepairReal : + 2 * (hammingDistance f g : ℝ) = + (hammingWeight (FABL.booleanDerivative f e + + (fun _ : FABL.F₂Cube n ↦ (0 : FABL.𝔽₂))) : ℝ) := by + exact_mod_cast hrepair + have hzeroFunction : FABL.booleanDerivative f e + + (fun _ : FABL.F₂Cube n ↦ (0 : FABL.𝔽₂)) = FABL.booleanDerivative f e := by + funext x + simp + rw [hzeroFunction] at hrepairReal + rw [← hmax, habs] + linarith + · have hneg : autocorrelation f e < 0 := lt_of_not_ge hnonneg + let g := repairDerivative f e 1 + refine ⟨g, hasNonzeroLinearStructure_repairDerivative f he 1, ?_⟩ + have hrepair := two_mul_hammingDistance_repairDerivative f he 1 + have hautoRepair := autocorrelation_eq_two_pow_sub_two_derivative_weight (f + g) e + have hderivative : FABL.booleanDerivative (f + g) e = + FABL.booleanDerivative f e + (fun _ : FABL.F₂Cube n ↦ (1 : FABL.𝔽₂)) := by + funext x + rw [booleanDerivative_add] + simp only [Pi.add_apply] + change FABL.booleanDerivative f e x + + (repairDerivative f e 1 x + repairDerivative f e 1 (x + e)) = + FABL.booleanDerivative f e x + 1 + rw [repairDerivative_pair f he 1 x] + have hautoSign : autocorrelation (f + g) e = -autocorrelation f e := by + have hmul := autocorrelation_add_of_isLinearStructure f g + (repairDerivative_pair f he 1) + simpa [bitSignInt] using hmul + have hrepairReal : + 2 * (hammingDistance f g : ℝ) = + (hammingWeight (FABL.booleanDerivative f e + + (fun _ : FABL.F₂Cube n ↦ (1 : FABL.𝔽₂))) : ℝ) := by + exact_mod_cast hrepair + rw [hderivative] at hautoRepair + have habs : |autocorrelation f e| = -autocorrelation f e := abs_of_neg hneg + rw [← hmax, habs] + linarith + +/-- Carlet's exact formula for the distance to functions admitting a nonzero linear structure. -/ +theorem distanceToLinearStructures_cast_eq + (hn : 2 ≤ n) (f : BooleanFunction n) : + (distanceToLinearStructures f : ℝ) = + (2 : ℝ) ^ n / 4 - absoluteIndicator f / 4 := by + have hnpos : 0 < n := by omega + obtain ⟨gmin, hgmin, hmin⟩ := + exists_hammingDistance_eq_distanceToLinearStructures hnpos f + obtain ⟨grepair, hgrepair, hrepair⟩ := + exists_repairDerivative_at_absoluteIndicator hnpos f + apply le_antisymm + · calc + (distanceToLinearStructures f : ℝ) ≤ (hammingDistance f grepair : ℝ) := by + exact_mod_cast distanceToLinearStructures_le_hammingDistance hnpos f grepair hgrepair + _ = ((2 : ℝ) ^ n - absoluteIndicator f) / 4 := hrepair + _ = (2 : ℝ) ^ n / 4 - absoluteIndicator f / 4 := by ring + · rw [← hmin] + have hlower := distance_lower_bound_of_hasNonzeroLinearStructure f gmin hgmin + linarith + +/-- Distance to linear structures is no larger than ordinary nonlinearity. -/ +theorem distanceToLinearStructures_le_nonlinearity + (hn : 2 ≤ n) (f : BooleanFunction n) : + distanceToLinearStructures f ≤ nonlinearity f := by + classical + unfold nonlinearity + apply Finset.le_inf' + intro p _hp + apply distanceToLinearStructures_le_hammingDistance (by omega) f + obtain ⟨e, he⟩ := exists_nonzero_direction (by omega : 0 < n) + refine ⟨e, he, FABL.f₂DotProduct p.2 e, ?_⟩ + intro x + have hzero := ZModModule.add_self (p.1 + FABL.f₂DotProduct p.2 x) + have hzero' : p.1 + p.2 ⬝ᵥ x + (p.1 + p.2 ⬝ᵥ x) = 0 := by + simpa [FABL.f₂DotProduct] using hzero + simp only [FABL.booleanDerivative, FABL.affineFunction, FABL.f₂DotProduct, + dotProduct_add] + calc + p.1 + p.2 ⬝ᵥ x + (p.1 + (p.2 ⬝ᵥ x + p.2 ⬝ᵥ e)) = + (p.1 + p.2 ⬝ᵥ x + (p.1 + p.2 ⬝ᵥ x)) + p.2 ⬝ᵥ e := by abel + _ = p.2 ⬝ᵥ e := by rw [hzero', zero_add] + +/-- Every Boolean function is at distance at most `2^(n-2)` from a function with a nonzero +linear structure. -/ +theorem distanceToLinearStructures_le_two_pow + (hn : 2 ≤ n) (f : BooleanFunction n) : + distanceToLinearStructures f ≤ 2 ^ (n - 2) := by + have hreal : (distanceToLinearStructures f : ℝ) ≤ (2 ^ (n - 2) : ℕ) := by + rw [distanceToLinearStructures_cast_eq hn] + push_cast + have hnonneg : 0 ≤ absoluteIndicator f := by + unfold absoluteIndicator + positivity + have hpow : ((2 : ℝ) ^ (n - 2)) = (2 : ℝ) ^ n / 4 := by + have h := pow_sub_mul_pow (2 : ℝ) (by omega : 2 ≤ n) + calc + (2 : ℝ) ^ (n - 2) = ((2 : ℝ) ^ (n - 2) * 4) / 4 := by ring + _ = (2 : ℝ) ^ n / 4 := by norm_num at h ⊢; nlinarith + rw [hpow] + linarith + exact_mod_cast hreal + +/-- Vanishing nontrivial autocorrelation is equivalent to bentness. -/ +theorem absoluteIndicator_eq_zero_iff_isBent + (f : BooleanFunction n) : absoluteIndicator f = 0 ↔ IsBent f := by + constructor + · intro habsolute + apply (hasFlatWalshSpectrum_iff_isBent f).1 + intro a + have hzero (e : FABL.F₂Cube n) (he : e ≠ 0) : autocorrelation f e = 0 := by + have habs := abs_autocorrelation_le_absoluteIndicator f he + rw [habsolute] at habs + exact abs_eq_zero.mp (le_antisymm habs (abs_nonneg _)) + have hsquare : (walshTransform f a : ℝ) ^ 2 = (2 : ℝ) ^ n := by + rw [← rawFourierTransform_autocorrelation] + unfold rawFourierTransform + calc + ∑ x, autocorrelation f x * FABL.vectorWalshCharacter a x = + autocorrelation f 0 * FABL.vectorWalshCharacter a 0 := by + apply Finset.sum_eq_single 0 + · intro e _ he + rw [hzero e he, zero_mul] + · simp + _ = (2 : ℝ) ^ n := by rw [autocorrelation_zero]; simp + have hsqrt := congrArg Real.sqrt hsquare + rw [Real.sqrt_sq_eq_abs] at hsqrt + exact hsqrt + · intro hbent + have hflat := (hasFlatWalshSpectrum_iff_isBent f).2 hbent + have htransform : rawFourierTransform (autocorrelation f) = + fun _ : FABL.F₂Cube n ↦ (2 : ℝ) ^ n := by + funext a + rw [rawFourierTransform_autocorrelation] + calc + (walshTransform f a : ℝ) ^ 2 = |(walshTransform f a : ℝ)| ^ 2 := + (sq_abs _).symm + _ = Real.sqrt ((2 : ℝ) ^ n) ^ 2 := by rw [hflat a] + _ = (2 : ℝ) ^ n := Real.sq_sqrt (by positivity) + have hzero (e : FABL.F₂Cube n) (he : e ≠ 0) : autocorrelation f e = 0 := by + have hexpect := FABL.expect_vectorWalshCharacter e + rw [if_neg he, Fintype.expect_eq_sum_div_card] at hexpect + have hsum : ∑ x, FABL.vectorWalshCharacter e x = 0 := by + have hcard : (Fintype.card (FABL.F₂Cube n) : ℝ) ≠ 0 := by positivity + exact (div_eq_zero_iff.mp hexpect).resolve_right hcard + have hconstant : + rawFourierTransform (fun _ : FABL.F₂Cube n ↦ (2 : ℝ) ^ n) e = 0 := by + unfold rawFourierTransform + calc + ∑ x, (2 : ℝ) ^ n * FABL.vectorWalshCharacter e x = + (2 : ℝ) ^ n * ∑ x, FABL.vectorWalshCharacter e x := by + rw [Finset.mul_sum] + _ = 0 := by rw [hsum, mul_zero] + have hinvolution := rawFourierTransform_involution (autocorrelation f) e + rw [htransform, hconstant] at hinvolution + have hpow : (0 : ℝ) < (2 : ℝ) ^ n := by positivity + nlinarith + unfold absoluteIndicator + apply NNReal.coe_eq_zero.mpr + rw [Finset.sup_eq_zero] + intro e he + rw [hzero e (Finset.mem_erase.mp he).1, abs_zero, Real.toNNReal_zero] + +/-- The universal `2^(n-2)` bound is attained exactly by bent Boolean functions. -/ +theorem distanceToLinearStructures_eq_two_pow_iff_isBent + (hn : 2 ≤ n) (f : BooleanFunction n) : + distanceToLinearStructures f = 2 ^ (n - 2) ↔ IsBent f := by + rw [← Nat.cast_inj (R := ℝ), distanceToLinearStructures_cast_eq hn] + have hpow : ((2 : ℝ) ^ (n - 2)) = (2 : ℝ) ^ n / 4 := by + have h := pow_sub_mul_pow (2 : ℝ) (by omega : 2 ≤ n) + calc + (2 : ℝ) ^ (n - 2) = ((2 : ℝ) ^ (n - 2) * 4) / 4 := by ring + _ = (2 : ℝ) ^ n / 4 := by norm_num at h ⊢; nlinarith + push_cast + rw [hpow] + have hzero : (2 : ℝ) ^ n / 4 - absoluteIndicator f / 4 = + (2 : ℝ) ^ n / 4 ↔ absoluteIndicator f = 0 := by + constructor + · intro h + linarith + · intro h + rw [h] + ring + rw [hzero] + exact absoluteIndicator_eq_zero_iff_isBent f + +end CryptBoolean diff --git a/CryptBoolean/Carlet/Chapter04/FastAlgebraic.lean b/CryptBoolean/Carlet/Chapter04/FastAlgebraic.lean new file mode 100644 index 0000000..07988e1 --- /dev/null +++ b/CryptBoolean/Carlet/Chapter04/FastAlgebraic.lean @@ -0,0 +1,245 @@ +/- +Copyright (c) 2026 Asher Yan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Asher Yan with Codex +-/ +module + +public import CryptBoolean.Carlet.Chapter04.AnnihilatorLinearSystem +public import Mathlib.Data.Nat.Choose.Sum +public import Mathlib.LinearAlgebra.FiniteDimensional.Lemmas + +/-! +# Carlet Chapter 4 fast algebraic relations + +The dimension argument producing low-degree relations, optimality against such relations, and +the algebraic-immunity lower bound on a nonzero product. +-/ + +open Finset +open scoped BigOperators BooleanCube + +@[expose] public section + +namespace CryptBoolean + +variable {n e d : ℕ} + +/-- The two low-degree coefficient counts exceed the Boolean-function-space dimension whenever +the two degree bounds add to at least the number of variables. -/ +theorem two_pow_lt_sum_choose_add_sum_choose_of_add_ge + (n e d : ℕ) (hed : n ≤ e + d) : + 2 ^ n < + (∑ i ∈ Finset.range (e + 1), Nat.choose n i) + + ∑ i ∈ Finset.range (d + 1), Nat.choose n i := by + by_cases hen : e ≤ n + · have hne : n - e ≤ d := by omega + have hsubset : Finset.range (n - e + 1) ⊆ Finset.range (d + 1) := + Finset.range_mono (by omega) + have hsmallLarge : + (∑ i ∈ Finset.range (n - e + 1), Nat.choose n i) ≤ + ∑ i ∈ Finset.range (d + 1), Nat.choose n i := + Finset.sum_le_sum_of_subset_of_nonneg hsubset (by + intro i _hi _hnot + exact Nat.zero_le _) + have hreflect := Finset.sum_Ico_reflect + (fun i ↦ Nat.choose n i) 0 (n := n) (m := n - e + 1) (by omega) + have hsymm : + (∑ i ∈ Finset.range (n - e + 1), Nat.choose n i) = + ∑ i ∈ Finset.Ico e (n + 1), Nat.choose n i := by + have hsub : n + 1 - (n - e + 1) = e := by omega + rw [hsub] at hreflect + rw [Finset.range_eq_Ico] + calc + (∑ i ∈ Finset.Ico 0 (n - e + 1), Nat.choose n i) = + ∑ i ∈ Finset.Ico 0 (n - e + 1), Nat.choose n (n - i) := by + apply Finset.sum_congr rfl + intro i hi + symm + exact Nat.choose_symm (by + have := Finset.mem_Ico.mp hi + omega) + _ = ∑ i ∈ Finset.Ico e (n + 1), Nat.choose n i := by + simpa using hreflect + have hsplit := Finset.sum_range_add_sum_Ico + (fun i ↦ Nat.choose n i) (show e ≤ n + 1 by omega) + have hfirst : + (∑ i ∈ Finset.range (e + 1), Nat.choose n i) = + (∑ i ∈ Finset.range e, Nat.choose n i) + Nat.choose n e := by + rw [Finset.sum_range_succ] + have hfull := Nat.sum_range_choose n + have hchoose : 0 < Nat.choose n e := Nat.choose_pos hen + rw [hsymm] at hsmallLarge + rw [hfirst] + omega + · have hnen : n + 1 ≤ e + 1 := by omega + have hsubset : Finset.range (n + 1) ⊆ Finset.range (e + 1) := + Finset.range_mono hnen + have hfullLe : + (∑ i ∈ Finset.range (n + 1), Nat.choose n i) ≤ + ∑ i ∈ Finset.range (e + 1), Nat.choose n i := + Finset.sum_le_sum_of_subset_of_nonneg hsubset (by + intro i _hi _hnot + exact Nat.zero_le _) + have hzeroMem : 0 ∈ Finset.range (d + 1) := by simp + have honeLe : 1 ≤ ∑ i ∈ Finset.range (d + 1), Nat.choose n i := by + simpa using Finset.single_le_sum + (fun i (_hi : i ∈ Finset.range (d + 1)) ↦ Nat.zero_le (Nat.choose n i)) + hzeroMem + rw [Nat.sum_range_choose] at hfullLe + omega + +/-- Carlet's equivalent numerical form of the dimension condition. -/ +theorem sum_choose_add_sum_choose_gt_iff + (n e d : ℕ) : + 2 ^ n < + (∑ i ∈ Finset.range (e + 1), Nat.choose n i) + + ∑ i ∈ Finset.range (d + 1), Nat.choose n i ↔ + n ≤ e + d := by + constructor + · intro hsum + by_contra hed + have hedlt : e + d < n := Nat.lt_of_not_ge hed + have hd : d ≤ n := by omega + have hreflect := Finset.sum_Ico_reflect + (fun i ↦ Nat.choose n i) 0 (n := n) (m := d + 1) (by omega) + have hsub : n + 1 - (d + 1) = n - d := by omega + rw [hsub] at hreflect + have hsymm : + (∑ i ∈ Finset.range (d + 1), Nat.choose n i) = + ∑ i ∈ Finset.Ico (n - d) (n + 1), Nat.choose n i := by + rw [Finset.range_eq_Ico] + calc + (∑ i ∈ Finset.Ico 0 (d + 1), Nat.choose n i) = + ∑ i ∈ Finset.Ico 0 (d + 1), Nat.choose n (n - i) := by + apply Finset.sum_congr rfl + intro i hi + symm + exact Nat.choose_symm (by + have := Finset.mem_Ico.mp hi + omega) + _ = ∑ i ∈ Finset.Ico (n - d) (n + 1), Nat.choose n i := by + simpa using hreflect + let low := Finset.range (e + 1) + let high := Finset.Ico (n - d) (n + 1) + have hdisjoint : Disjoint low high := by + rw [Finset.disjoint_left] + intro i hilow hihigh + have hilow' := Finset.mem_range.mp hilow + have hihigh' := Finset.mem_Ico.mp hihigh + omega + have hsubset : low ∪ high ⊆ Finset.range (n + 1) := by + intro i hi + rcases Finset.mem_union.mp hi with hilow | hihigh + · exact Finset.mem_range.mpr (by + have := Finset.mem_range.mp hilow + omega) + · exact Finset.mem_range.mpr (Finset.mem_Ico.mp hihigh).2 + have hle := Finset.sum_le_sum_of_subset_of_nonneg hsubset (by + intro i _hi _hnot + exact Nat.zero_le (Nat.choose n i)) + rw [Finset.sum_union hdisjoint, Nat.sum_range_choose] at hle + change + (∑ i ∈ Finset.range (e + 1), Nat.choose n i) + + ∑ i ∈ high, Nat.choose n i ≤ 2 ^ n at hle + rw [← hsymm] at hle + omega + · exact two_pow_lt_sum_choose_add_sum_choose_of_add_ge n e d + +/-- The linear map whose kernel consists of bounded-degree relations `f*g=h`. -/ +noncomputable def fastAlgebraicRelationLinearMap + (f : BooleanFunction n) (e d : ℕ) : + (reedMuller e n × reedMuller d n) →ₗ[FABL.𝔽₂] BooleanFunction n where + toFun p := f * p.1.1 + p.2.1 + map_add' p q := by + ext x + change f x * (p.1.1 x + q.1.1 x) + (p.2.1 x + q.2.1 x) = + (f x * p.1.1 x + p.2.1 x) + (f x * q.1.1 x + q.2.1 x) + ring + map_smul' a p := by + ext x + change f x * (a * p.1.1 x) + a * p.2.1 x = + a * (f x * p.1.1 x + p.2.1 x) + ring + +/-- Carlet's dimension argument: if `e+d≥n`, there is a nonzero `g` of degree at most `e` +whose product with `f` has degree at most `d`. -/ +theorem exists_fastAlgebraicRelation_of_add_ge + (f : BooleanFunction n) (hed : n ≤ e + d) : + ∃ g h : BooleanFunction n, + g ≠ 0 ∧ + FABL.functionAlgebraicDegree g ≤ e ∧ + FABL.functionAlgebraicDegree h ≤ d ∧ + f * g = h := by + let L := fastAlgebraicRelationLinearMap f e d + have hdim : + Module.finrank FABL.𝔽₂ (BooleanFunction n) < + Module.finrank FABL.𝔽₂ (reedMuller e n × reedMuller d n) := by + rw [Module.finrank_prod, reedMuller_finrank, reedMuller_finrank, + Module.finrank_fintype_fun_eq_card, FABL.card_f₂Cube] + exact two_pow_lt_sum_choose_add_sum_choose_of_add_ge n e d hed + have hnotInjective : ¬ Function.Injective L := by + intro hinjective + have := LinearMap.finrank_le_finrank_of_injective hinjective + omega + have hker : LinearMap.ker L ≠ ⊥ := by + intro hbot + exact hnotInjective ((LinearMap.ker_eq_bot).mp hbot) + obtain ⟨p, hpKernel, hpNe⟩ := + Submodule.exists_mem_ne_zero_of_ne_bot hker + have hpMap : L p = 0 := (LinearMap.mem_ker.mp hpKernel) + have hrelation : f * p.1.1 = p.2.1 := by + funext x + have hx := congrFun hpMap x + change f x * p.1.1 x + p.2.1 x = 0 at hx + exact (eq_neg_of_add_eq_zero_left hx).trans + (ZMod.neg_eq_self_mod_two (p.2.1 x)) + have hpFirstNe : p.1 ≠ 0 := by + intro hpFirst + have hpFirstVal : p.1.1 = 0 := congrArg Subtype.val hpFirst + have hpSecondVal : p.2.1 = 0 := by + rw [← hrelation, hpFirstVal, mul_zero] + have hpSecond : p.2 = 0 := Subtype.ext hpSecondVal + apply hpNe + exact Prod.ext hpFirst hpSecond + exact ⟨p.1.1, p.2.1, + fun hzero ↦ hpFirstNe (Subtype.ext hzero), p.1.2, p.2.2, hrelation⟩ + +/-- Optimality against fast algebraic attacks: every nonzero multiplicand relation has total +degree at least `n`. -/ +def IsFastAlgebraicallyOptimal (f : BooleanFunction n) : Prop := + ∀ g h : BooleanFunction n, + g ≠ 0 → f * g = h → + n ≤ FABL.functionAlgebraicDegree g + FABL.functionAlgebraicDegree h + +/-- The quantified lower-bound definition is equivalent to absence of a subcritical relation. -/ +theorem isFastAlgebraicallyOptimal_iff_no_lowDegreeRelation + (f : BooleanFunction n) : + IsFastAlgebraicallyOptimal f ↔ + ¬ ∃ g h : BooleanFunction n, + g ≠ 0 ∧ f * g = h ∧ + FABL.functionAlgebraicDegree g + FABL.functionAlgebraicDegree h < n := by + constructor + · intro hf + rintro ⟨g, h, hg, hrelation, hdegree⟩ + exact (Nat.not_lt_of_ge (hf g h hg hrelation)) hdegree + · intro hf g h hg hrelation + by_contra hdegree + exact hf ⟨g, h, hg, hrelation, Nat.lt_of_not_ge hdegree⟩ + +/-- A nonzero product in a fast algebraic relation has degree at least the algebraic immunity. -/ +theorem algebraicImmunity_le_degree_of_mul_eq_of_ne_zero + (f g h : BooleanFunction n) (hrelation : f * g = h) (hh : h ≠ 0) : + algebraicImmunity f ≤ FABL.functionAlgebraicDegree h := by + apply algebraicImmunity_le_functionAlgebraicDegree f h + right + refine ⟨hh, ?_⟩ + calc + (f + 1) * h = (f + 1) * (f * g) := by rw [hrelation] + _ = ((f + 1) * f) * g := by rw [mul_assoc] + _ = 0 * g := by + rw [add_mul, one_mul, booleanFunction_mul_self, + ZModModule.add_self] + _ = 0 := zero_mul g + +end CryptBoolean diff --git a/CryptBoolean/Carlet/Chapter04/FiveVariableMaximumNonlinearity.lean b/CryptBoolean/Carlet/Chapter04/FiveVariableMaximumNonlinearity.lean new file mode 100644 index 0000000..5720b03 --- /dev/null +++ b/CryptBoolean/Carlet/Chapter04/FiveVariableMaximumNonlinearity.lean @@ -0,0 +1,643 @@ +/- +Copyright (c) 2026 Asher Yan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Asher Yan with Codex +-/ +module + +public import CryptBoolean.Carlet.Chapter04.OddDimensionBestNonlinearity +public import CryptBoolean.Carlet.Chapter04.HigherOrderNonlinearity + +/-! +# Maximum nonlinearity in five variables + +The quadratic construction gives nonlinearity twelve. The matching upper bound is obtained from +the binary leader code on a hypothetical weight-thirteen coset leader, followed by a residual-code +and radius-one sphere-packing contradiction. +-/ + +open Function +open scoped BigOperators BooleanCube + +@[expose] public section + +namespace CryptBoolean + +private abbrev OneCoordinates {ι : Type*} (x : ι → FABL.𝔽₂) := + {i : ι // x i ≠ 0} + +private abbrev ZeroCoordinates {ι : Type*} (x : ι → FABL.𝔽₂) := + {i : ι // x i = 0} + +private def bitWeight (b : FABL.𝔽₂) : ℕ := + if b ≠ 0 then 1 else 0 + +private theorem hammingNorm_eq_sum_bitWeight + {ι : Type*} [Fintype ι] (x : ι → FABL.𝔽₂) : + hammingNorm x = ∑ i, bitWeight (x i) := by + simp [hammingNorm, bitWeight, Finset.card_filter] + +private theorem card_oneCoordinates + {ι : Type*} [Fintype ι] (x : ι → FABL.𝔽₂) : + Fintype.card (OneCoordinates x) = hammingNorm x := by + rw [Fintype.card_subtype, hammingNorm] + +private theorem card_zeroCoordinates + {ι : Type*} [Fintype ι] (x : ι → FABL.𝔽₂) : + Fintype.card (ZeroCoordinates x) = Fintype.card ι - hammingNorm x := by + rw [Fintype.card_subtype, hammingNorm] + have hpartition := Finset.card_filter_add_card_filter_not + (s := (Finset.univ : Finset ι)) (p := fun i ↦ x i ≠ 0) + simp only [Finset.card_univ, not_ne_iff] at hpartition + omega + +private theorem bitWeight_add_intersection_identity (x y : FABL.𝔽₂) : + bitWeight (x + y) + 2 * (if x ≠ 0 then bitWeight y else 0) = + bitWeight x + bitWeight y := by + fin_cases x <;> fin_cases y <;> decide + +private theorem sum_ite_nonzero_eq_sum_oneCoordinates + {ι : Type*} [Fintype ι] (x y : ι → FABL.𝔽₂) : + (∑ i, if x i ≠ 0 then bitWeight (y i) else 0) = + ∑ j : OneCoordinates x, bitWeight (y j.1) := by + classical + rw [← Finset.sum_filter] + exact Finset.sum_subtype (Finset.univ.filter fun i ↦ x i ≠ 0) + (by simp) (fun i ↦ bitWeight (y i)) + +private theorem hammingNorm_add_restrictOne_identity + {ι : Type*} [Fintype ι] (x y : ι → FABL.𝔽₂) : + hammingNorm (x + y) + + 2 * hammingNorm (fun j : OneCoordinates x ↦ y j.1) = + hammingNorm x + hammingNorm y := by + rw [hammingNorm_eq_sum_bitWeight, hammingNorm_eq_sum_bitWeight, + hammingNorm_eq_sum_bitWeight, hammingNorm_eq_sum_bitWeight, + ← sum_ite_nonzero_eq_sum_oneCoordinates x y, Finset.mul_sum, + ← Finset.sum_add_distrib] + calc + ∑ i, (bitWeight ((x + y) i) + + 2 * (if x i ≠ 0 then bitWeight (y i) else 0)) = + ∑ i, (bitWeight (x i) + bitWeight (y i)) := by + apply Finset.sum_congr rfl + intro i _hi + simpa using bitWeight_add_intersection_identity (x i) (y i) + _ = (∑ i, bitWeight (x i)) + ∑ i, bitWeight (y i) := + Finset.sum_add_distrib + +private theorem bitWeight_add_one (x : FABL.𝔽₂) : + bitWeight (x + 1) + bitWeight x = 1 := by + fin_cases x <;> decide + +private theorem hammingNorm_add_one_add + {ι : Type*} [Fintype ι] (x : ι → FABL.𝔽₂) : + hammingNorm (x + 1) + hammingNorm x = Fintype.card ι := by + rw [hammingNorm_eq_sum_bitWeight, hammingNorm_eq_sum_bitWeight, + ← Finset.sum_add_distrib] + calc + ∑ i, (bitWeight ((x + 1) i) + bitWeight (x i)) = + ∑ _i : ι, 1 := by + apply Finset.sum_congr rfl + intro i _hi + simpa using bitWeight_add_one (x i) + _ = Fintype.card ι := by simp + +private def radiusOneError {ι : Type*} [DecidableEq ι] : + Option ι → (ι → FABL.𝔽₂) + | none => 0 + | some i => Pi.single i 1 + +private theorem radiusOneError_injective + {ι : Type*} [DecidableEq ι] : + Function.Injective (radiusOneError (ι := ι)) := by + intro e e' h + cases e with + | none => + cases e' with + | none => rfl + | some j => + exfalso + have hj := congrFun h j + simp [radiusOneError] at hj + | some i => + cases e' with + | none => + exfalso + have hi := congrFun h i + simp [radiusOneError] at hi + | some j => + congr 1 + by_contra hij + have hi := congrFun h i + simp [radiusOneError, hij] at hi + +private theorem hammingNorm_radiusOneError_le_one + {ι : Type*} [Fintype ι] [DecidableEq ι] (e : Option ι) : + hammingNorm (radiusOneError e) ≤ 1 := by + cases e with + | none => simp [radiusOneError] + | some i => + rw [radiusOneError, hammingNorm] + have hsubset : + (Finset.univ.filter fun j : ι ↦ + (Pi.single i (1 : FABL.𝔽₂) : ι → FABL.𝔽₂) j ≠ 0) ⊆ {i} := by + intro j hj + simp only [Finset.mem_filter, Finset.mem_univ, true_and] at hj + simpa [Pi.single_apply] using hj + exact (Finset.card_le_card hsubset).trans_eq (Finset.card_singleton i) + +private def radiusOnePackingMap + {ι : Type*} [DecidableEq ι] + (C : Submodule FABL.𝔽₂ (ι → FABL.𝔽₂)) : + C × Option ι → (ι → FABL.𝔽₂) := + fun p ↦ p.1.1 + radiusOneError p.2 + +private theorem radiusOnePackingMap_injective + {ι : Type*} [Fintype ι] [DecidableEq ι] + (C : Submodule FABL.𝔽₂ (ι → FABL.𝔽₂)) + (hmin : ∀ c d : C, c ≠ d → 3 ≤ hammingDist c.1 d.1) : + Function.Injective (radiusOnePackingMap C) := by + rintro ⟨c, e⟩ ⟨d, e'⟩ h + by_cases hcd : c = d + · subst d + have herr : radiusOneError e = radiusOneError e' := add_left_cancel h + rw [radiusOneError_injective herr] + · have hthree : 3 ≤ hammingDist c.1 d.1 := hmin c d hcd + have htriangle := hammingDist_triangle c.1 + (radiusOnePackingMap C (c, e)) d.1 + have hfirst : + hammingDist c.1 (radiusOnePackingMap C (c, e)) = + hammingNorm (radiusOneError e) := by + rw [hammingDist_eq_hammingNorm] + simp [radiusOnePackingMap] + have hsecond : + hammingDist (radiusOnePackingMap C (c, e)) d.1 = + hammingNorm (radiusOneError e') := by + rw [h, hammingDist_comm, hammingDist_eq_hammingNorm] + simp [radiusOnePackingMap] + rw [hfirst, hsecond] at htriangle + have he := hammingNorm_radiusOneError_le_one e + have he' := hammingNorm_radiusOneError_le_one e' + omega + +private theorem binaryRadiusOneHammingBound + {ι : Type*} [Fintype ι] + (C : Submodule FABL.𝔽₂ (ι → FABL.𝔽₂)) + (hmin : ∀ c d : C, c ≠ d → 3 ≤ hammingDist c.1 d.1) : + 2 ^ Module.finrank FABL.𝔽₂ C * (Fintype.card ι + 1) ≤ + 2 ^ Fintype.card ι := by + classical + letI : Fintype C := Fintype.ofFinite C + have hcard := Fintype.card_le_of_injective + (radiusOnePackingMap C) (radiusOnePackingMap_injective C hmin) + rw [Fintype.card_prod, Fintype.card_option, Fintype.card_fun] at hcard + rw [← Nat.card_eq_fintype_card, + Module.natCard_eq_pow_finrank (K := FABL.𝔽₂) (V := C), + Nat.card_zmod] at hcard + exact hcard + +private def residualMap + {ι : Type*} [Fintype ι] + (C : Submodule FABL.𝔽₂ (ι → FABL.𝔽₂)) (c : C) : + C →ₗ[FABL.𝔽₂] (ZeroCoordinates c.1 → FABL.𝔽₂) where + toFun x j := x.1 j.1 + map_add' _ _ := rfl + map_smul' _ _ := rfl + +private def residualCode + {ι : Type*} [Fintype ι] + (C : Submodule FABL.𝔽₂ (ι → FABL.𝔽₂)) (c : C) : + Submodule FABL.𝔽₂ (ZeroCoordinates c.1 → FABL.𝔽₂) := + LinearMap.range (residualMap C c) + +private theorem bitWeight_add_residual_identity (x c : FABL.𝔽₂) : + bitWeight x + bitWeight (x + c) = + bitWeight c + 2 * (if c = 0 then bitWeight x else 0) := by + fin_cases x <;> fin_cases c <;> decide + +private theorem sum_ite_zero_eq_sum_zeroCoordinates + {ι : Type*} [Fintype ι] (x c : ι → FABL.𝔽₂) : + (∑ i, if c i = 0 then bitWeight (x i) else 0) = + ∑ j : ZeroCoordinates c, bitWeight (x j.1) := by + classical + rw [← Finset.sum_filter] + exact Finset.sum_subtype (Finset.univ.filter fun i ↦ c i = 0) + (by simp) (fun i ↦ bitWeight (x i)) + +private theorem hammingNorm_add_residual_identity + {ι : Type*} [Fintype ι] (x c : ι → FABL.𝔽₂) : + hammingNorm x + hammingNorm (x + c) = + hammingNorm c + + 2 * hammingNorm (fun j : ZeroCoordinates c ↦ x j.1) := by + rw [hammingNorm_eq_sum_bitWeight, hammingNorm_eq_sum_bitWeight, + hammingNorm_eq_sum_bitWeight, hammingNorm_eq_sum_bitWeight, + ← Finset.sum_add_distrib] + calc + ∑ i, (bitWeight (x i) + bitWeight ((x + c) i)) = + ∑ i, (bitWeight (c i) + + 2 * (if c i = 0 then bitWeight (x i) else 0)) := by + apply Finset.sum_congr rfl + intro i _hi + simpa using bitWeight_add_residual_identity (x i) (c i) + _ = (∑ i, bitWeight (c i)) + + 2 * ∑ i, (if c i = 0 then bitWeight (x i) else 0) := by + rw [Finset.sum_add_distrib, Finset.mul_sum] + _ = (∑ i, bitWeight (c i)) + + 2 * ∑ j : ZeroCoordinates c, bitWeight (x j.1) := by + rw [sum_ite_zero_eq_sum_zeroCoordinates] + +private theorem neg_eq_self_submodule + {ι : Type*} + (C : Submodule FABL.𝔽₂ (ι → FABL.𝔽₂)) (x : C) : + -x = x := by + apply Subtype.ext + funext i + simp [ZMod.neg_eq_self_mod_two] + +private theorem ker_residualMap_eq_span + {ι : Type*} [Fintype ι] + (C : Submodule FABL.𝔽₂ (ι → FABL.𝔽₂)) (c : C) (hc : c ≠ 0) + (hmin : ∀ x : C, x ≠ 0 → hammingNorm c.1 ≤ hammingNorm x.1) : + (residualMap C c).ker = FABL.𝔽₂ ∙ c := by + apply le_antisymm + · intro x hx + rw [Submodule.mem_span_singleton] + by_cases hx0 : x = 0 + · exact ⟨0, by simp [hx0]⟩ + by_cases hxc : x = c + · exact ⟨1, by simp [hxc]⟩ + exfalso + have hxc0 : x + c ≠ 0 := by + intro hzero + have hneg : x = -c := add_eq_zero_iff_eq_neg.mp hzero + apply hxc + rw [neg_eq_self_submodule C c] at hneg + exact hneg + have hxweight := hmin x hx0 + have hxcweight := hmin (x + c) hxc0 + have hmapzero : residualMap C c x = 0 := hx + have hidentity := hammingNorm_add_residual_identity x.1 c.1 + change hammingNorm x.1 + hammingNorm (x + c).1 = + hammingNorm c.1 + 2 * hammingNorm (residualMap C c x) at hidentity + rw [hmapzero, hammingNorm_zero, mul_zero, add_zero] at hidentity + have hcpos : 0 < hammingNorm c.1 := hammingNorm_pos_iff.mpr (by + intro hzero + apply hc + exact Subtype.ext hzero) + omega + · intro x hx + rw [Submodule.mem_span_singleton] at hx + obtain ⟨a, rfl⟩ := hx + change residualMap C c (a • c) = 0 + by_cases ha : a = 0 + · subst a + simp only [zero_smul] + funext j + rfl + · have haone : a = 1 := Fin.eq_one_of_ne_zero a ha + subst a + simp only [one_smul] + funext j + exact j.2 + +private theorem finrank_residualCode + {ι : Type*} [Fintype ι] + (C : Submodule FABL.𝔽₂ (ι → FABL.𝔽₂)) (c : C) (hc : c ≠ 0) + (hmin : ∀ x : C, x ≠ 0 → hammingNorm c.1 ≤ hammingNorm x.1) : + Module.finrank FABL.𝔽₂ (residualCode C c) = + Module.finrank FABL.𝔽₂ C - 1 := by + have hrank := (residualMap C c).finrank_range_add_finrank_ker + rw [ker_residualMap_eq_span C c hc hmin, finrank_span_singleton hc] at hrank + exact Nat.eq_sub_of_add_eq hrank + +private theorem residualCode_hammingNorm_ge_three + {ι : Type*} [Fintype ι] + (C : Submodule FABL.𝔽₂ (ι → FABL.𝔽₂)) (c : C) (_hc : c ≠ 0) + (hcweight : 5 ≤ hammingNorm c.1) + (hmin : ∀ x : C, x ≠ 0 → hammingNorm c.1 ≤ hammingNorm x.1) + (z : residualCode C c) (hz : z ≠ 0) : + 3 ≤ hammingNorm z.1 := by + obtain ⟨x, hx⟩ := z.2 + have hx0 : x ≠ 0 := by + intro hzero + subst x + apply hz + apply Subtype.ext + simpa using hx.symm + have hxc0 : x + c ≠ 0 := by + intro hzero + have hneg : x = -c := add_eq_zero_iff_eq_neg.mp hzero + rw [neg_eq_self_submodule C c] at hneg + subst x + apply hz + apply Subtype.ext + rw [← hx] + funext j + exact j.2 + have hxweight := hmin x hx0 + have hxcweight := hmin (x + c) hxc0 + have hidentity := hammingNorm_add_residual_identity x.1 c.1 + change hammingNorm x.1 + hammingNorm (x + c).1 = + hammingNorm c.1 + 2 * hammingNorm (residualMap C c x) at hidentity + rw [hx] at hidentity + omega + +private theorem binaryRadiusOneHammingBound_of_hammingNorm + {ι : Type*} [Fintype ι] + (C : Submodule FABL.𝔽₂ (ι → FABL.𝔽₂)) + (hweight : ∀ c : C, c ≠ 0 → 3 ≤ hammingNorm c.1) : + 2 ^ Module.finrank FABL.𝔽₂ C * (Fintype.card ι + 1) ≤ + 2 ^ Fintype.card ι := by + classical + apply binaryRadiusOneHammingBound C + intro x y hxy + let z : C := y - x + have hz : z ≠ 0 := sub_ne_zero.mpr hxy.symm + rw [hammingDist_eq_hammingNorm] + simpa [z, sub_eq_add_neg, add_comm] using hweight z hz + +private theorem noBinaryCodeFinrankFiveCardSevenOrEight + {ι : Type*} [Fintype ι] + (C : Submodule FABL.𝔽₂ (ι → FABL.𝔽₂)) + (hfinrank : Module.finrank FABL.𝔽₂ C = 5) + (hcard : Fintype.card ι = 7 ∨ Fintype.card ι = 8) + (hweight : ∀ c : C, c ≠ 0 → 3 ≤ hammingNorm c.1) : False := by + classical + have hbound := binaryRadiusOneHammingBound_of_hammingNorm C hweight + rcases hcard with hcard | hcard <;> + rw [hfinrank, hcard] at hbound <;> norm_num at hbound + +private noncomputable def supportRestriction (u : BooleanFunction 5) : + reedMuller 1 5 →ₗ[FABL.𝔽₂] (OneCoordinates u → FABL.𝔽₂) where + toFun c j := c.1 j.1 + map_add' _ _ := rfl + map_smul' _ _ := rfl + +private noncomputable def leaderCode (u : BooleanFunction 5) : + Submodule FABL.𝔽₂ (OneCoordinates u → FABL.𝔽₂) := + LinearMap.range (supportRestriction u) + +private noncomputable def reedMullerOne : reedMuller 1 5 := + ⟨FABL.affineFunction 1 0, affineFunction_mem_reedMuller_one 1 0⟩ + +private theorem supportRestriction_reedMullerOne (u : BooleanFunction 5) : + supportRestriction u reedMullerOne = 1 := by + funext j + simp [supportRestriction, reedMullerOne, FABL.affineFunction, + FABL.f₂DotProduct] + +private theorem supportRestriction_hammingNorm_ge_five + (u : BooleanFunction 5) (huweight : hammingWeight u = 13) + (hleader : ∀ c : reedMuller 1 5, + 13 ≤ hammingWeight (u + c.1)) + (c : reedMuller 1 5) (hc : c ≠ 0) : + 5 ≤ hammingNorm (supportRestriction u c) := by + obtain ⟨b, a, hca⟩ := + FABL.exists_affineFunction_of_functionAlgebraicDegree_le_one c.1 c.2 + by_cases ha : a = 0 + · have hb : b ≠ 0 := by + intro hb + apply hc + apply Subtype.ext + rw [hca] + funext x + simp [FABL.affineFunction, ha, hb, FABL.f₂DotProduct] + have hb_one : b = 1 := Fin.eq_one_of_ne_zero b hb + have hrestriction : supportRestriction u c = 1 := by + funext j + change c.1 j.1 = 1 + rw [hca] + simp [FABL.affineFunction, ha, hb_one, FABL.f₂DotProduct] + rw [hrestriction, hammingNorm] + simp [card_oneCoordinates u, huweight] + · have hcweight : hammingWeight c.1 = 16 := by + rw [hca, hammingWeight_affineFunction_of_ne_zero b a ha] + norm_num + let d : reedMuller 1 5 := c + reedMullerOne + have hdrepresentation : + d.1 = FABL.affineFunction (b + 1) a := by + funext x + simp [d, reedMullerOne, hca, FABL.affineFunction, + FABL.f₂DotProduct] + abel + have hdweight : hammingWeight d.1 = 16 := by + rw [hdrepresentation, hammingWeight_affineFunction_of_ne_zero (b + 1) a ha] + norm_num + have hcidentity := hammingNorm_add_restrictOne_identity u c.1 + change hammingWeight (u + c.1) + + 2 * hammingNorm (supportRestriction u c) = + hammingWeight u + hammingWeight c.1 at hcidentity + rw [huweight, hcweight] at hcidentity + have hcleader := hleader c + have hcle : hammingNorm (supportRestriction u c) ≤ 8 := by omega + have hdidentity := hammingNorm_add_restrictOne_identity u d.1 + change hammingWeight (u + d.1) + + 2 * hammingNorm (supportRestriction u d) = + hammingWeight u + hammingWeight d.1 at hdidentity + rw [huweight, hdweight] at hdidentity + have hdleader := hleader d + have hdle : hammingNorm (supportRestriction u d) ≤ 8 := by omega + have hrestriction : + supportRestriction u d = supportRestriction u c + 1 := by + funext j + simp [supportRestriction, d, reedMullerOne, FABL.affineFunction, + FABL.f₂DotProduct] + have hcomplement := hammingNorm_add_one_add (supportRestriction u c) + have huNorm : hammingNorm u = 13 := huweight + rw [← hrestriction, card_oneCoordinates u, huNorm] at hcomplement + omega + +private theorem supportRestriction_injective + (u : BooleanFunction 5) (huweight : hammingWeight u = 13) + (hleader : ∀ c : reedMuller 1 5, + 13 ≤ hammingWeight (u + c.1)) : + Function.Injective (supportRestriction u) := by + intro c d hcd + by_contra hne + have hsub : supportRestriction u (c - d) = 0 := by + rw [LinearMap.map_sub, hcd, sub_self] + have hnonzero : c - d ≠ 0 := sub_ne_zero.mpr hne + have hfive := supportRestriction_hammingNorm_ge_five + u huweight hleader (c - d) hnonzero + rw [hsub, hammingNorm_zero] at hfive + omega + +private theorem leaderCode_finrank + (u : BooleanFunction 5) (huweight : hammingWeight u = 13) + (hleader : ∀ c : reedMuller 1 5, + 13 ≤ hammingWeight (u + c.1)) : + Module.finrank FABL.𝔽₂ (leaderCode u) = 6 := by + rw [leaderCode, LinearMap.finrank_range_of_inj + (supportRestriction_injective u huweight hleader), reedMuller_finrank] + norm_num [Finset.sum_range_succ] + +private theorem leaderCode_hammingNorm_ge_five + (u : BooleanFunction 5) (huweight : hammingWeight u = 13) + (hleader : ∀ c : reedMuller 1 5, + 13 ≤ hammingWeight (u + c.1)) + (z : leaderCode u) (hz : z ≠ 0) : + 5 ≤ hammingNorm z.1 := by + obtain ⟨c, hc⟩ := z.2 + have hcne : c ≠ 0 := by + intro hzero + subst c + apply hz + apply Subtype.ext + simpa using hc.symm + rw [← hc] + exact supportRestriction_hammingNorm_ge_five u huweight hleader c hcne + +private noncomputable def leaderCodeOne (u : BooleanFunction 5) : leaderCode u := + ⟨1, reedMullerOne, supportRestriction_reedMullerOne u⟩ + +private theorem leaderCodeOne_ne_zero + (u : BooleanFunction 5) (huweight : hammingWeight u = 13) : + leaderCodeOne u ≠ 0 := by + intro hzero + have hpoint := congrFun (congrArg Subtype.val hzero) + have hcard : 0 < Fintype.card (OneCoordinates u) := by + have huNorm : hammingNorm u = 13 := huweight + rw [card_oneCoordinates u, huNorm] + omega + obtain ⟨j⟩ := Fintype.card_pos_iff.mp hcard + have := hpoint j + simp [leaderCodeOne] at this + +private theorem exists_nontrivial_leaderCode + (u : BooleanFunction 5) (huweight : hammingWeight u = 13) + (hleader : ∀ c : reedMuller 1 5, + 13 ≤ hammingWeight (u + c.1)) : + ∃ z : leaderCode u, z ≠ 0 ∧ z ≠ leaderCodeOne u := by + classical + letI : Fintype (leaderCode u) := Fintype.ofFinite (leaderCode u) + have hcard : Fintype.card (leaderCode u) = 64 := by + rw [← Nat.card_eq_fintype_card, + Module.natCard_eq_pow_finrank (K := FABL.𝔽₂) (V := leaderCode u), + Nat.card_zmod, leaderCode_finrank u huweight hleader] + norm_num + by_contra hexists + have hsubset : + (Finset.univ : Finset (leaderCode u)) ⊆ {0, leaderCodeOne u} := by + intro z _hz + simp only [Finset.mem_insert, Finset.mem_singleton] + by_contra hz + exact hexists ⟨z, (not_or.mp hz).1, (not_or.mp hz).2⟩ + have hcardle := Finset.card_le_card hsubset + rw [Finset.card_univ, hcard] at hcardle + have hpair : ({0, leaderCodeOne u} : Finset (leaderCode u)).card ≤ 2 := by + exact Finset.card_le_two + omega + +private theorem exists_minimum_leaderCodeWord + (u : BooleanFunction 5) (huweight : hammingWeight u = 13) + (hleader : ∀ c : reedMuller 1 5, + 13 ≤ hammingWeight (u + c.1)) : + ∃ c : leaderCode u, + c ≠ 0 ∧ + (∀ z : leaderCode u, z ≠ 0 → hammingNorm c.1 ≤ hammingNorm z.1) ∧ + hammingNorm c.1 ≤ 6 := by + classical + letI : Fintype (leaderCode u) := Fintype.ofFinite (leaderCode u) + let nonzeroWords := (Finset.univ : Finset (leaderCode u)).erase 0 + have hnonempty : nonzeroWords.Nonempty := by + exact ⟨leaderCodeOne u, by + simp [nonzeroWords, leaderCodeOne_ne_zero u huweight]⟩ + obtain ⟨c, hc, hceq⟩ := Finset.exists_mem_eq_inf' hnonempty + (fun z : leaderCode u ↦ hammingNorm z.1) + have hcne : c ≠ 0 := by simpa [nonzeroWords] using hc + have hcmin : ∀ z : leaderCode u, z ≠ 0 → + hammingNorm c.1 ≤ hammingNorm z.1 := by + intro z hz + have hle := Finset.inf'_le + (fun w : leaderCode u ↦ hammingNorm w.1) + (show z ∈ nonzeroWords by simp [nonzeroWords, hz]) + rw [hceq] at hle + exact hle + obtain ⟨q, hqzero, hqone⟩ := + exists_nontrivial_leaderCode u huweight hleader + have hqcomp : q + leaderCodeOne u ≠ 0 := by + intro hzero + have hneg : q = -(leaderCodeOne u) := add_eq_zero_iff_eq_neg.mp hzero + rw [neg_eq_self_submodule (leaderCode u) (leaderCodeOne u)] at hneg + exact hqone hneg + have hqle := hcmin q hqzero + have hqcomple := hcmin (q + leaderCodeOne u) hqcomp + have hqrepresentation : + (q + leaderCodeOne u).1 = q.1 + 1 := by + funext j + simp [leaderCodeOne] + have hsum := hammingNorm_add_one_add q.1 + have huNorm : hammingNorm u = 13 := huweight + rw [← hqrepresentation, card_oneCoordinates u, huNorm] at hsum + refine ⟨c, hcne, hcmin, ?_⟩ + omega + +private theorem no_firstOrderCosetLeader_weight_thirteen + (u : BooleanFunction 5) (huweight : hammingWeight u = 13) + (hleader : ∀ c : reedMuller 1 5, + 13 ≤ hammingWeight (u + c.1)) : False := by + let C := leaderCode u + obtain ⟨c, hc, hcmin, hcle⟩ := + exists_minimum_leaderCodeWord u huweight hleader + have hcge := leaderCode_hammingNorm_ge_five u huweight hleader c hc + have hresidualFinrank := finrank_residualCode C c hc hcmin + have hCfinrank := leaderCode_finrank u huweight hleader + change Module.finrank FABL.𝔽₂ (residualCode C c) = + Module.finrank FABL.𝔽₂ C - 1 at hresidualFinrank + rw [hCfinrank] at hresidualFinrank + norm_num at hresidualFinrank + have hzeroCard := card_zeroCoordinates c.1 + have hambientCard : Fintype.card (OneCoordinates u) = 13 := by + have huNorm : hammingNorm u = 13 := huweight + rw [card_oneCoordinates u, huNorm] + rw [hambientCard] at hzeroCard + have hresidualCard : + Fintype.card (ZeroCoordinates c.1) = 7 ∨ + Fintype.card (ZeroCoordinates c.1) = 8 := by + omega + have hresidualWeight : + ∀ z : residualCode C c, z ≠ 0 → 3 ≤ hammingNorm z.1 := + residualCode_hammingNorm_ge_three C c hc hcge hcmin + exact noBinaryCodeFinrankFiveCardSevenOrEight + (residualCode C c) hresidualFinrank hresidualCard hresidualWeight + +/-- The largest nonlinearity of a five-variable Boolean function is twelve. -/ +theorem maximumNonlinearity_five : maximumNonlinearity 5 = 12 := by + have hlower := quadraticBound_le_maximumNonlinearity_of_odd + (n := 5) (by decide) + norm_num at hlower + obtain ⟨f, hf⟩ := exists_nonlinearity_eq_maximumNonlinearity 5 + have hupper := nonlinearity_cast_le_coveringRadius f + rw [hf] at hupper + have hpow : (2 : ℝ) ^ (5 : ℕ) = 32 := by norm_num + rw [hpow] at hupper + have hsqrt : 4 < Real.sqrt 32 := by + calc + (4 : ℝ) = Real.sqrt 16 := by norm_num + _ < Real.sqrt 32 := Real.sqrt_lt_sqrt (by norm_num) (by norm_num) + have hltReal : (maximumNonlinearity 5 : ℝ) < 14 := by + linarith + have hlt : maximumNonlinearity 5 < 14 := by + exact_mod_cast hltReal + apply Nat.le_antisymm + · by_contra hnot + have hmax : maximumNonlinearity 5 = 13 := by omega + have hnonlinearity : nonlinearity f = 13 := by omega + have hhigher : higherOrderNonlinearity 1 f = 13 := by + rw [← nonlinearity_eq_higherOrderNonlinearity_one] + exact hnonlinearity + obtain ⟨g, hg, hfg⟩ := + exists_reedMuller_hammingDistance_eq_higherOrderNonlinearity 1 f + let u : BooleanFunction 5 := f + g + have huweight : hammingWeight u = 13 := by + rw [← hammingDistance_eq_hammingWeight_add f g, hfg, hhigher] + have hleader : ∀ c : reedMuller 1 5, + 13 ≤ hammingWeight (u + c.1) := by + intro c + have hminimum := higherOrderNonlinearity_le_hammingDistance + 1 f (g + c.1) ((reedMuller 1 5).add_mem hg c.2) + rw [hhigher, hammingDistance_eq_hammingWeight_add] at hminimum + simpa only [u, add_assoc] using hminimum + exact (no_firstOrderCosetLeader_weight_thirteen u huweight hleader).elim + · exact hlower + +end CryptBoolean diff --git a/CryptBoolean/Carlet/Chapter04/GeneralizedLinearStructureDistance.lean b/CryptBoolean/Carlet/Chapter04/GeneralizedLinearStructureDistance.lean new file mode 100644 index 0000000..6728eaa --- /dev/null +++ b/CryptBoolean/Carlet/Chapter04/GeneralizedLinearStructureDistance.lean @@ -0,0 +1,181 @@ +/- +Copyright (c) 2026 Asher Yan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Asher Yan with Codex +-/ +module + +public import CryptBoolean.Carlet.Chapter04.Nonlinearity +public import CryptBoolean.Carlet.Chapter04.LinearStructures +public import CryptBoolean.Carlet.Chapter04.AutocorrelationIndicators + +/-! +# Carlet Chapter 4 generalized linear-structure distance + +The zero-derivative directions form a linear space. Carlet's criterion is the +minimum Hamming distance to a function whose zero-derivative space has a +prescribed lower bound on its dimension. +-/ + +open Finset +open scoped BooleanCube + +@[expose] public section + +namespace CryptBoolean + +variable {n : ℕ} + +/-- A direction along which a Boolean function has identically zero derivative. -/ +def IsZeroDerivativeDirection + (f : BooleanFunction n) (e : FABL.F₂Cube n) : Prop := + ∀ x, FABL.booleanDerivative f e x = 0 + +/-- The directions along which a Boolean function has identically zero derivative. -/ +def zeroDerivativeKernel + (f : BooleanFunction n) : Submodule FABL.𝔽₂ (FABL.F₂Cube n) where + carrier := {e | IsZeroDerivativeDirection f e} + zero_mem' := by + intro x + rw [FABL.booleanDerivative, add_zero, ZModModule.add_self] + add_mem' := by + intro e d he hd x + rw [booleanDerivative_add_direction, he, hd, zero_add] + smul_mem' := by + intro c e he + by_cases hc : c = 0 + · subst c + intro x + rw [zero_smul, FABL.booleanDerivative, add_zero, ZModModule.add_self] + · have hc_one : c = 1 := Fin.eq_one_of_ne_zero c hc + simpa [hc_one] using he + +/-- Membership in the zero-derivative kernel is the defining pointwise condition. -/ +@[simp] theorem mem_zeroDerivativeKernel + (f : BooleanFunction n) (e : FABL.F₂Cube n) : + e ∈ zeroDerivativeKernel f ↔ IsZeroDerivativeDirection f e := + Iff.rfl + +/-- The zero-derivative kernel is a subspace of Carlet's linear kernel. -/ +theorem zeroDerivativeKernel_le_linearKernel (f : BooleanFunction n) : + zeroDerivativeKernel f ≤ linearKernel f := by + intro e he + exact ⟨0, he⟩ + +/-- Affine input reindexing transports the zero-derivative kernel by its linear part. -/ +def zeroDerivativeKernelAffineEquiv + (f : BooleanFunction n) + (L : FABL.F₂Cube n ≃ᵃ[FABL.𝔽₂] FABL.F₂Cube n) : + zeroDerivativeKernel (f ∘ L) ≃ₗ[FABL.𝔽₂] zeroDerivativeKernel f where + toFun e := ⟨L.linear e, by + intro y + have he := e.property (L.symm y) + rw [booleanDerivative_comp_affineEquiv, L.apply_symm_apply] at he + exact he⟩ + invFun e := ⟨L.linear.symm e, by + intro x + rw [booleanDerivative_comp_affineEquiv, L.linear.apply_symm_apply] + exact e.property (L x)⟩ + left_inv e := by + ext i + exact congrFun (L.linear.symm_apply_apply e.1) i + right_inv e := by + ext i + exact congrFun (L.linear.apply_symm_apply e.1) i + map_add' e d := by + ext i + exact congrFun (L.linear.map_add e.1 d.1) i + map_smul' c e := by + ext i + exact congrFun (L.linear.map_smul c e.1) i + +/-- Affine input reindexing preserves the zero-derivative dimension. -/ +theorem finrank_zeroDerivativeKernel_comp_affineEquiv + (f : BooleanFunction n) + (L : FABL.F₂Cube n ≃ᵃ[FABL.𝔽₂] FABL.F₂Cube n) : + Module.finrank FABL.𝔽₂ (zeroDerivativeKernel (f ∘ L)) = + Module.finrank FABL.𝔽₂ (zeroDerivativeKernel f) := + (zeroDerivativeKernelAffineEquiv f L).finrank_eq + +/-- The zero function has every direction in its zero-derivative kernel. -/ +@[simp] theorem zeroDerivativeKernel_zero : + zeroDerivativeKernel (0 : BooleanFunction n) = ⊤ := by + ext e + simp [zeroDerivativeKernel, IsZeroDerivativeDirection, FABL.booleanDerivative] + +/-- The zero function's zero-derivative kernel has the full cube dimension. -/ +@[simp] theorem finrank_zeroDerivativeKernel_zero : + Module.finrank FABL.𝔽₂ + (zeroDerivativeKernel (0 : BooleanFunction n)) = n := by + rw [zeroDerivativeKernel_zero, finrank_top, + Module.finrank_fintype_fun_eq_card] + simp + +/-- Functions whose zero-derivative space has dimension at least `k`. -/ +noncomputable def largeZeroDerivativeFunctions + (k : ℕ) : Finset (BooleanFunction n) := + Finset.univ.filter fun g ↦ + k ≤ Module.finrank FABL.𝔽₂ (zeroDerivativeKernel g) + +/-- The comparison class is nonempty throughout its meaningful range `k ≤ n`. -/ +theorem largeZeroDerivativeFunctions_nonempty + (k : ℕ) (hk : k ≤ n) : + (largeZeroDerivativeFunctions (n := n) k).Nonempty := by + refine ⟨0, ?_⟩ + simp [largeZeroDerivativeFunctions, hk] + +/-- Carlet's generalized distance to functions with a zero-derivative space +of dimension at least `k`. -/ +noncomputable def generalizedLinearStructureDistance + (f : BooleanFunction n) (k : ℕ) (hk : k ≤ n) : ℕ := + (largeZeroDerivativeFunctions (n := n) k).inf' + (largeZeroDerivativeFunctions_nonempty k hk) + (hammingDistance f) + +/-- Affine input reindexing preserves membership in the comparison class. -/ +theorem mem_largeZeroDerivativeFunctions_comp_affineEquiv_iff + (g : BooleanFunction n) (k : ℕ) + (L : FABL.F₂Cube n ≃ᵃ[FABL.𝔽₂] FABL.F₂Cube n) : + g ∘ L ∈ largeZeroDerivativeFunctions (n := n) k ↔ + g ∈ largeZeroDerivativeFunctions (n := n) k := by + simp only [largeZeroDerivativeFunctions, Finset.mem_filter, Finset.mem_univ, + true_and] + rw [finrank_zeroDerivativeKernel_comp_affineEquiv] + +/-- One half of affine invariance for the generalized distance. -/ +theorem generalizedLinearStructureDistance_comp_affineEquiv_le + (f : BooleanFunction n) (k : ℕ) (hk : k ≤ n) + (L : FABL.F₂Cube n ≃ᵃ[FABL.𝔽₂] FABL.F₂Cube n) : + generalizedLinearStructureDistance (f ∘ L) k hk ≤ + generalizedLinearStructureDistance f k hk := by + classical + unfold generalizedLinearStructureDistance + obtain ⟨g, hg, hmin⟩ := Finset.exists_mem_eq_inf' + (s := largeZeroDerivativeFunctions (n := n) k) + (largeZeroDerivativeFunctions_nonempty k hk) + (hammingDistance f) + calc + (largeZeroDerivativeFunctions (n := n) k).inf' + (largeZeroDerivativeFunctions_nonempty k hk) + (hammingDistance (f ∘ L)) ≤ + hammingDistance (f ∘ L) (g ∘ L) := + Finset.inf'_le _ + ((mem_largeZeroDerivativeFunctions_comp_affineEquiv_iff g k L).2 hg) + _ = hammingDistance f g := hammingDistance_comp_affineEquiv f g L + _ = (largeZeroDerivativeFunctions (n := n) k).inf' + (largeZeroDerivativeFunctions_nonempty k hk) + (hammingDistance f) := hmin.symm + +/-- Carlet's generalized linear-structure distance is affine invariant. -/ +theorem generalizedLinearStructureDistance_comp_affineEquiv + (f : BooleanFunction n) (k : ℕ) (hk : k ≤ n) + (L : FABL.F₂Cube n ≃ᵃ[FABL.𝔽₂] FABL.F₂Cube n) : + generalizedLinearStructureDistance (f ∘ L) k hk = + generalizedLinearStructureDistance f k hk := by + apply Nat.le_antisymm + (generalizedLinearStructureDistance_comp_affineEquiv_le f k hk L) + have h := generalizedLinearStructureDistance_comp_affineEquiv_le + (f ∘ L) k hk L.symm + simpa [Function.comp_def] using h + +end CryptBoolean diff --git a/CryptBoolean/Carlet/Chapter04/HigherOrderGeneralBounds.lean b/CryptBoolean/Carlet/Chapter04/HigherOrderGeneralBounds.lean new file mode 100644 index 0000000..329cf95 --- /dev/null +++ b/CryptBoolean/Carlet/Chapter04/HigherOrderGeneralBounds.lean @@ -0,0 +1,985 @@ +/- +Copyright (c) 2026 Asher Yan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Asher Yan with Codex +-/ +module + +public import CryptBoolean.Carlet.Chapter04.HigherOrderNonlinearity +import CryptBoolean.Carlet.Chapter04.AlgebraicImmunityBounds +import FABL.Chapter03.LearningTheory.FourierEstimation +import Mathlib.Analysis.SpecificLimits.Normed +import Mathlib.Data.Finset.Powerset + +/-! +# Carlet Chapter 4 general higher-order nonlinearity bounds + +The exact finite sphere-covering count underlying Carlet's asymptotic +existence bound for higher-order nonlinearity. +-/ + +open Finset MeasureTheory ProbabilityTheory Set Filter +open scoped BigOperators BooleanCube ENNReal Topology NNReal + +@[expose] public section + +namespace CryptBoolean + +variable {n : ℕ} + +private def firstCoordinateTailLinearMap (n : ℕ) : + FABL.F₂Cube (n + 1) →ₗ[FABL.𝔽₂] FABL.F₂Cube n where + toFun := Fin.tail + map_add' _ _ := rfl + map_smul' _ _ := rfl + +private def firstCoordinateLift + (f : BooleanFunction n) : BooleanFunction (n + 1) := + f ∘ (firstCoordinateTailLinearMap n).toAffineMap + +private def firstCoordinatePlotkinCombine + (g h : BooleanFunction n) : BooleanFunction (n + 1) := + firstCoordinateLift g + + (fun x ↦ x 0) * firstCoordinateLift h + +private theorem firstCoordinatePlotkinCombine_zero + (g h : BooleanFunction n) (x : FABL.F₂Cube n) : + firstCoordinatePlotkinCombine g h (Fin.cons 0 x) = g x := by + simp [firstCoordinatePlotkinCombine, firstCoordinateLift, + firstCoordinateTailLinearMap] + +private theorem firstCoordinatePlotkinCombine_one + (g h : BooleanFunction n) (x : FABL.F₂Cube n) : + firstCoordinatePlotkinCombine g h (Fin.cons 1 x) = g x + h x := by + simp [firstCoordinatePlotkinCombine, firstCoordinateLift, + firstCoordinateTailLinearMap] + +private theorem firstCoordinatePlotkinCombine_degree_le + (r : ℕ) (hr : 1 ≤ r) (g h : BooleanFunction n) + (hg : FABL.functionAlgebraicDegree g ≤ r) + (hh : FABL.functionAlgebraicDegree h ≤ r - 1) : + FABL.functionAlgebraicDegree (firstCoordinatePlotkinCombine g h) ≤ r := by + have hgLift : + FABL.functionAlgebraicDegree (firstCoordinateLift g) ≤ r := + (functionAlgebraicDegree_comp_affineMap_le_general g + (firstCoordinateTailLinearMap n).toAffineMap).trans hg + have hhLift : + FABL.functionAlgebraicDegree (firstCoordinateLift h) ≤ r - 1 := + (functionAlgebraicDegree_comp_affineMap_le_general h + (firstCoordinateTailLinearMap n).toAffineMap).trans hh + have hcoordinate : + FABL.functionAlgebraicDegree + (fun x : FABL.F₂Cube (n + 1) ↦ x 0) ≤ 1 := by + simpa using functionAlgebraicDegree_affineMap_coordinate_le_one_general + (AffineMap.id FABL.𝔽₂ (FABL.F₂Cube (n + 1))) (0 : Fin (n + 1)) + apply (FABL.functionAlgebraicDegree_add_le_max + (firstCoordinateLift g) + ((fun x : FABL.F₂Cube (n + 1) ↦ x 0) * firstCoordinateLift h)).trans + apply max_le hgLift + exact (FABL.functionAlgebraicDegree_mul_le_add _ _).trans + ((Nat.add_le_add hcoordinate hhLift).trans (by omega)) + +private def firstCoordinateSlice + (f : BooleanFunction (n + 1)) (b : FABL.𝔽₂) : BooleanFunction n := + fun x ↦ f (Fin.cons b x) + +private theorem hammingDistance_firstCoordinateSlices + (f g : BooleanFunction (n + 1)) : + hammingDistance f g = + hammingDistance (firstCoordinateSlice f 0) (firstCoordinateSlice g 0) + + hammingDistance (firstCoordinateSlice f 1) (firstCoordinateSlice g 1) := by + classical + unfold hammingDistance hammingDist + rw [Finset.card_filter, Finset.card_filter, Finset.card_filter] + change (∑ x : FABL.F₂Cube (n + 1), if f x ≠ g x then 1 else 0) = _ + rw [← Equiv.sum_comp (Fin.consEquiv + (fun _ : Fin (n + 1) ↦ FABL.𝔽₂)), Fintype.sum_prod_type] + change (∑ b : FABL.𝔽₂, ∑ x : FABL.F₂Cube n, + if f (Fin.cons b x) ≠ g (Fin.cons b x) then 1 else 0) = _ + rw [show (Finset.univ : Finset FABL.𝔽₂) = {0, 1} by rfl] + simp only [Finset.sum_insert, Finset.mem_singleton, zero_ne_one, + not_false_eq_true, Finset.sum_singleton] + rfl + +private theorem hammingDistance_add_left_add_right + (f g h : BooleanFunction n) : + hammingDistance f (g + h) = hammingDistance (f + g) h := by + simp only [hammingDistance_eq_hammingWeight_add] + rw [add_assoc] + +/-- The covering radius `ρ(r,n)`: the largest order-`r` nonlinearity in +dimension `n`. -/ +noncomputable def maximumHigherOrderNonlinearity (r n : ℕ) : ℕ := + (Finset.univ : Finset (BooleanFunction n)).sup' + Finset.univ_nonempty (higherOrderNonlinearity r) + +/-- Every order-`r` nonlinearity is bounded by the Reed--Muller covering radius. -/ +theorem higherOrderNonlinearity_le_maximum + (r : ℕ) (f : BooleanFunction n) : + higherOrderNonlinearity r f ≤ maximumHigherOrderNonlinearity r n := by + exact Finset.le_sup' (higherOrderNonlinearity r) (Finset.mem_univ f) + +/-- The finite Boolean-function space contains a word attaining the +order-`r` Reed--Muller covering radius. -/ +theorem exists_higherOrderNonlinearity_eq_maximum (r n : ℕ) : + ∃ f : BooleanFunction n, + higherOrderNonlinearity r f = maximumHigherOrderNonlinearity r n := by + classical + unfold maximumHigherOrderNonlinearity + obtain ⟨f, _hf, hmax⟩ := Finset.exists_mem_eq_sup' + (s := (Finset.univ : Finset (BooleanFunction n))) + Finset.univ_nonempty (higherOrderNonlinearity r) + exact ⟨f, hmax.symm⟩ + +private theorem higherOrderNonlinearity_succ_le_maximum_add_maximum + (r : ℕ) (hr : 1 ≤ r) (f : BooleanFunction (n + 1)) : + higherOrderNonlinearity r f ≤ + maximumHigherOrderNonlinearity r n + + maximumHigherOrderNonlinearity (r - 1) n := by + let fzero : BooleanFunction n := firstCoordinateSlice f 0 + let fone : BooleanFunction n := firstCoordinateSlice f 1 + obtain ⟨g, hg, hdistanceG⟩ := + exists_reedMuller_hammingDistance_eq_higherOrderNonlinearity r fzero + obtain ⟨h, hh, hdistanceH⟩ := + exists_reedMuller_hammingDistance_eq_higherOrderNonlinearity + (r - 1) (fone + g) + let q : BooleanFunction (n + 1) := firstCoordinatePlotkinCombine g h + have hq : q ∈ reedMuller r (n + 1) := by + exact firstCoordinatePlotkinCombine_degree_le r hr g h hg hh + have hqzero : firstCoordinateSlice q 0 = g := by + funext x + exact firstCoordinatePlotkinCombine_zero g h x + have hqone : firstCoordinateSlice q 1 = g + h := by + funext x + exact firstCoordinatePlotkinCombine_one g h x + calc + higherOrderNonlinearity r f ≤ hammingDistance f q := + higherOrderNonlinearity_le_hammingDistance r f q hq + _ = hammingDistance fzero g + hammingDistance fone (g + h) := by + rw [hammingDistance_firstCoordinateSlices, hqzero, hqone] + _ = hammingDistance fzero g + hammingDistance (fone + g) h := by + rw [hammingDistance_add_left_add_right] + _ = higherOrderNonlinearity r fzero + + higherOrderNonlinearity (r - 1) (fone + g) := by + rw [hdistanceG, hdistanceH] + _ ≤ maximumHigherOrderNonlinearity r n + + maximumHigherOrderNonlinearity (r - 1) n := + Nat.add_le_add + (higherOrderNonlinearity_le_maximum r fzero) + (higherOrderNonlinearity_le_maximum (r - 1) (fone + g)) + +/-- The Reed--Muller covering radii satisfy the Plotkin recurrence +`ρ(r,n+1) ≤ ρ(r,n) + ρ(r-1,n)`. -/ +theorem maximumHigherOrderNonlinearity_succ_le + (r n : ℕ) (hr : 1 ≤ r) : + maximumHigherOrderNonlinearity r (n + 1) ≤ + maximumHigherOrderNonlinearity r n + + maximumHigherOrderNonlinearity (r - 1) n := by + obtain ⟨f, hf⟩ := exists_higherOrderNonlinearity_eq_maximum r (n + 1) + rw [← hf] + exact higherOrderNonlinearity_succ_le_maximum_add_maximum r hr f + +/-- The order-`n` Reed--Muller code has covering radius zero in dimension `n`. -/ +theorem maximumHigherOrderNonlinearity_self (n : ℕ) : + maximumHigherOrderNonlinearity n n = 0 := by + obtain ⟨f, hf⟩ := exists_higherOrderNonlinearity_eq_maximum n n + rw [← hf] + apply Nat.eq_zero_of_le_zero + calc + higherOrderNonlinearity n f ≤ hammingDistance f f := + higherOrderNonlinearity_le_hammingDistance n f f + (FABL.functionAlgebraicDegree_le_dimension f) + _ = 0 := hammingDist_self f + +/-- Iterating the Plotkin recurrence bounds `ρ(r,n)` by the sum of the +order-`r-1` covering radii in dimensions `r,…,n-1`. -/ +theorem maximumHigherOrderNonlinearity_le_sum_Ico + (r n : ℕ) (hr : 1 ≤ r) (hrn : r ≤ n) : + maximumHigherOrderNonlinearity r n ≤ + ∑ j ∈ Finset.Ico r n, maximumHigherOrderNonlinearity (r - 1) j := by + induction n with + | zero => omega + | succ n ih => + by_cases heq : r = n + 1 + · subst r + simp [maximumHigherOrderNonlinearity_self] + · have hrn' : r ≤ n := by omega + calc + maximumHigherOrderNonlinearity r (n + 1) ≤ + maximumHigherOrderNonlinearity r n + + maximumHigherOrderNonlinearity (r - 1) n := + maximumHigherOrderNonlinearity_succ_le r n hr + _ ≤ (∑ j ∈ Finset.Ico r n, + maximumHigherOrderNonlinearity (r - 1) j) + + maximumHigherOrderNonlinearity (r - 1) n := + Nat.add_le_add_right (ih hrn') _ + _ = ∑ j ∈ Finset.Ico r (n + 1), + maximumHigherOrderNonlinearity (r - 1) j := by + rw [Finset.sum_Ico_succ_top hrn'] + +/-- A pointwise real-valued bound for the order-`r-1` covering radii can be +summed through the Plotkin recurrence to bound the order-`r` covering radius. -/ +theorem maximumHigherOrderNonlinearity_cast_le_sum_Ico_of_le + (r n : ℕ) (hr : 1 ≤ r) (hrn : r ≤ n) (bound : ℕ → ℝ) + (hbound : ∀ j ∈ Finset.Ico r n, + (maximumHigherOrderNonlinearity (r - 1) j : ℝ) ≤ bound j) : + (maximumHigherOrderNonlinearity r n : ℝ) ≤ + ∑ j ∈ Finset.Ico r n, bound j := by + calc + (maximumHigherOrderNonlinearity r n : ℝ) ≤ + (((∑ j ∈ Finset.Ico r n, + maximumHigherOrderNonlinearity (r - 1) j) : ℕ) : ℝ) := by + exact_mod_cast maximumHigherOrderNonlinearity_le_sum_Ico r n hr hrn + _ = ∑ j ∈ Finset.Ico r n, + (maximumHigherOrderNonlinearity (r - 1) j : ℝ) := by + push_cast + rfl + _ ≤ ∑ j ∈ Finset.Ico r n, bound j := by + exact Finset.sum_le_sum fun j hj ↦ hbound j hj + +private theorem sqrtTwo_sub_one_ne_zero : Real.sqrt 2 - 1 ≠ 0 := by + intro h + have hsqrt : Real.sqrt 2 = 1 := sub_eq_zero.mp h + have hsquare := Real.sq_sqrt (by norm_num : (0 : ℝ) ≤ 2) + rw [hsqrt] at hsquare + norm_num at hsquare + +/-- Carlet's finite higher-order induction step: a bound with leading +coefficient `A` at order `r-1` yields coefficient `A * (1 + √2)` at order +`r`, with the finite error terms summed over dimensions `r,…,n-1`. -/ +theorem maximumHigherOrderNonlinearity_cast_le_carlet_step + (r n : ℕ) (hr : 1 ≤ r) (hrn : r ≤ n) (A : ℝ) (error : ℕ → ℝ) + (hlower : ∀ j ∈ Finset.Ico r n, + (maximumHigherOrderNonlinearity (r - 1) j : ℝ) ≤ + (2 : ℝ) ^ j / 2 - A * (Real.sqrt 2) ^ j + error j) : + (maximumHigherOrderNonlinearity r n : ℝ) ≤ + ((2 : ℝ) ^ n - (2 : ℝ) ^ r) / 2 - + A * (1 + Real.sqrt 2) * + ((Real.sqrt 2) ^ n - (Real.sqrt 2) ^ r) + + ∑ j ∈ Finset.Ico r n, error j := by + apply (maximumHigherOrderNonlinearity_cast_le_sum_Ico_of_le + r n hr hrn + (fun j ↦ (2 : ℝ) ^ j / 2 - A * (Real.sqrt 2) ^ j + error j) + hlower).trans_eq + have htwo : + (∑ j ∈ Finset.Ico r n, (2 : ℝ) ^ j) = + (2 : ℝ) ^ n - (2 : ℝ) ^ r := by + rw [geom_sum_Ico (by norm_num : (2 : ℝ) ≠ 1) hrn] + norm_num + have hsqrt : + (∑ j ∈ Finset.Ico r n, (Real.sqrt 2) ^ j) = + ((Real.sqrt 2) ^ n - (Real.sqrt 2) ^ r) / + (Real.sqrt 2 - 1) := + geom_sum_Ico (x := Real.sqrt 2) + (sub_ne_zero.mp sqrtTwo_sub_one_ne_zero) hrn + rw [Finset.sum_add_distrib, Finset.sum_sub_distrib, + ← Finset.sum_div, ← Finset.mul_sum, htwo, hsqrt] + have hquot : + ((Real.sqrt 2) ^ n - (Real.sqrt 2) ^ r) / + (Real.sqrt 2 - 1) = + (1 + Real.sqrt 2) * + ((Real.sqrt 2) ^ n - (Real.sqrt 2) ^ r) := by + apply (div_eq_iff sqrtTwo_sub_one_ne_zero).2 + have hsquare := Real.sq_sqrt (by norm_num : (0 : ℝ) ≤ 2) + have hfactor : + (1 + Real.sqrt 2) * (Real.sqrt 2 - 1) = (1 : ℝ) := by + nlinarith + calc + (Real.sqrt 2) ^ n - (Real.sqrt 2) ^ r = + 1 * ((Real.sqrt 2) ^ n - (Real.sqrt 2) ^ r) := by ring + _ = ((1 + Real.sqrt 2) * (Real.sqrt 2 - 1)) * + ((Real.sqrt 2) ^ n - (Real.sqrt 2) ^ r) := by rw [hfactor] + _ = (1 + Real.sqrt 2) * + ((Real.sqrt 2) ^ n - (Real.sqrt 2) ^ r) * + (Real.sqrt 2 - 1) := by ring + rw [hquot] + ring + +/-- A polynomial error term propagates through one Plotkin step while the +square-root coefficient is multiplied by `1 + √2`. -/ +theorem maximumHigherOrderNonlinearity_cast_le_carlet_polynomial_step + (r n d : ℕ) (hr : 1 ≤ r) (hrn : r ≤ n) (A C : ℝ) + (hA : 0 ≤ A) (hC : 0 ≤ C) + (hlower : ∀ j ∈ Finset.Ico r n, + (maximumHigherOrderNonlinearity (r - 1) j : ℝ) ≤ + (2 : ℝ) ^ j / 2 - A * (Real.sqrt 2) ^ j + + C * (j + 1 : ℝ) ^ d) : + (maximumHigherOrderNonlinearity r n : ℝ) ≤ + (2 : ℝ) ^ n / 2 - + (A * (1 + Real.sqrt 2)) * (Real.sqrt 2) ^ n + + (C + A * (1 + Real.sqrt 2) * (Real.sqrt 2) ^ r) * + (n + 1 : ℝ) ^ (d + 1) := by + have hsqrt : 0 ≤ Real.sqrt 2 := Real.sqrt_nonneg _ + have hsum : + (∑ j ∈ Finset.Ico r n, C * (j + 1 : ℝ) ^ d) ≤ + C * (n + 1 : ℝ) ^ (d + 1) := by + calc + (∑ j ∈ Finset.Ico r n, C * (j + 1 : ℝ) ^ d) ≤ + ∑ _j ∈ Finset.Ico r n, C * (n + 1 : ℝ) ^ d := by + apply Finset.sum_le_sum + intro j hj + have hjn : j + 1 ≤ n + 1 := by + have := (Finset.mem_Ico.mp hj).2 + omega + exact mul_le_mul_of_nonneg_left + (pow_le_pow_left₀ (by positivity) (by exact_mod_cast hjn) d) hC + _ = ((Finset.Ico r n).card : ℝ) * + (C * (n + 1 : ℝ) ^ d) := by + simp [nsmul_eq_mul] + _ ≤ (n + 1 : ℝ) * (C * (n + 1 : ℝ) ^ d) := by + apply mul_le_mul_of_nonneg_right + · exact_mod_cast (show (Finset.Ico r n).card ≤ n + 1 by + rw [Nat.card_Ico] + omega) + · positivity + _ = C * (n + 1 : ℝ) ^ (d + 1) := by + rw [pow_succ] + ring + have hstep := maximumHigherOrderNonlinearity_cast_le_carlet_step + r n hr hrn A (fun j ↦ C * (j + 1 : ℝ) ^ d) hlower + have hpower : 1 ≤ (n + 1 : ℝ) ^ (d + 1) := by + apply one_le_pow₀ + exact_mod_cast Nat.le_add_left 1 n + have hcoefficient : + 0 ≤ A * (1 + Real.sqrt 2) * (Real.sqrt 2) ^ r := by + positivity + calc + (maximumHigherOrderNonlinearity r n : ℝ) ≤ + ((2 : ℝ) ^ n - (2 : ℝ) ^ r) / 2 - + A * (1 + Real.sqrt 2) * + ((Real.sqrt 2) ^ n - (Real.sqrt 2) ^ r) + + ∑ j ∈ Finset.Ico r n, C * (j + 1 : ℝ) ^ d := hstep + _ ≤ ((2 : ℝ) ^ n - (2 : ℝ) ^ r) / 2 - + A * (1 + Real.sqrt 2) * + ((Real.sqrt 2) ^ n - (Real.sqrt 2) ^ r) + + C * (n + 1 : ℝ) ^ (d + 1) := by linarith + _ ≤ (2 : ℝ) ^ n / 2 - + (A * (1 + Real.sqrt 2)) * (Real.sqrt 2) ^ n + + (C + A * (1 + Real.sqrt 2) * (Real.sqrt 2) ^ r) * + (n + 1 : ℝ) ^ (d + 1) := by + have hscaled := mul_le_mul_of_nonneg_left hpower hcoefficient + nlinarith [show 0 ≤ (2 : ℝ) ^ r by positivity] + +/-- Iterating the Plotkin step propagates an order-two `O(1)` error to an +order-`r` polynomial error of degree `r - 2`. -/ +theorem exists_maximumHigherOrderNonlinearity_cast_le_iterated_carlet + (A C : ℝ) (hA : 0 ≤ A) (hC : 0 ≤ C) + (hbase : ∀ n : ℕ, + (maximumHigherOrderNonlinearity 2 n : ℝ) ≤ + (2 : ℝ) ^ n / 2 - A * (Real.sqrt 2) ^ n + C) + (r : ℕ) (hr : 2 ≤ r) : + ∃ D : ℝ, 0 ≤ D ∧ ∀ n : ℕ, r ≤ n → + (maximumHigherOrderNonlinearity r n : ℝ) ≤ + (2 : ℝ) ^ n / 2 - + (A * (1 + Real.sqrt 2) ^ (r - 2)) * (Real.sqrt 2) ^ n + + D * (n + 1 : ℝ) ^ (r - 2) := by + refine Nat.le_induction ?_ ?_ r hr + · refine ⟨C, hC, ?_⟩ + intro n _hn + simpa using hbase n + · intro k hk ih + rcases ih with ⟨D, hD, hbound⟩ + let Ak : ℝ := A * (1 + Real.sqrt 2) ^ (k - 2) + let Dnext : ℝ := + D + Ak * (1 + Real.sqrt 2) * (Real.sqrt 2) ^ (k + 1) + have hAk : 0 ≤ Ak := by + dsimp only [Ak] + positivity + have hDnext : 0 ≤ Dnext := by + dsimp only [Dnext] + positivity + refine ⟨Dnext, hDnext, ?_⟩ + intro n hkn + have hstep := maximumHigherOrderNonlinearity_cast_le_carlet_polynomial_step + (k + 1) n (k - 2) (by omega) hkn Ak D hAk hD + (fun j hj ↦ hbound j (by + have hjlower := (Finset.mem_Ico.mp hj).1 + omega)) + have hexponent : k - 2 + 1 = k + 1 - 2 := by omega + have hcoefficient : + Ak * (1 + Real.sqrt 2) = + A * (1 + Real.sqrt 2) ^ (k + 1 - 2) := by + dsimp only [Ak] + rw [show k + 1 - 2 = (k - 2) + 1 by omega, pow_succ] + ring + simpa only [hcoefficient, hexponent, Dnext] using hstep + +/-- Every positive-order Reed--Muller covering radius is at most half the +ambient Boolean cube size. -/ +theorem maximumHigherOrderNonlinearity_cast_le_half_two_pow + (r n : ℕ) (hr : 1 ≤ r) : + (maximumHigherOrderNonlinearity r n : ℝ) ≤ (2 : ℝ) ^ n / 2 := by + obtain ⟨f, hf⟩ := exists_higherOrderNonlinearity_eq_maximum r n + have hfinite := two_mul_higherOrderNonlinearity_le_two_pow r hr f + have hfiniteReal : + (2 : ℝ) * (higherOrderNonlinearity r f : ℝ) ≤ (2 : ℝ) ^ n := by + exact_mod_cast hfinite + rw [← hf] + linarith + +/-- An eventual order-two `O(1)` bound can be enlarged on its finite prefix +to a nonnegative constant valid in every dimension. -/ +theorem exists_global_orderTwo_bound_of_eventually + (A C : ℝ) (hA : 0 ≤ A) + (hbase : ∀ᶠ n in Filter.atTop, + (maximumHigherOrderNonlinearity 2 n : ℝ) ≤ + (2 : ℝ) ^ n / 2 - A * (Real.sqrt 2) ^ n + C) : + ∃ C' : ℝ, 0 ≤ C' ∧ ∀ n : ℕ, + (maximumHigherOrderNonlinearity 2 n : ℝ) ≤ + (2 : ℝ) ^ n / 2 - A * (Real.sqrt 2) ^ n + C' := by + obtain ⟨N, hN⟩ := Filter.eventually_atTop.mp hbase + let C' : ℝ := max 0 C + A * (Real.sqrt 2) ^ N + have hsqrtOne : (1 : ℝ) ≤ Real.sqrt 2 := by + rw [Real.one_le_sqrt] + norm_num + have hC' : 0 ≤ C' := by + dsimp only [C'] + positivity + refine ⟨C', hC', ?_⟩ + intro n + by_cases hn : N ≤ n + · have hnBound := hN n hn + have hCC' : C ≤ C' := by + calc + C ≤ max 0 C := le_max_right _ _ + _ ≤ max 0 C + A * (Real.sqrt 2) ^ N := + le_add_of_nonneg_right (mul_nonneg hA (by positivity)) + _ = C' := rfl + linarith + · have hnN : n ≤ N := Nat.le_of_lt (Nat.lt_of_not_ge hn) + have hpower : (Real.sqrt 2) ^ n ≤ (Real.sqrt 2) ^ N := + pow_le_pow_right₀ hsqrtOne hnN + have hscaled := mul_le_mul_of_nonneg_left hpower hA + have hhalf := maximumHigherOrderNonlinearity_cast_le_half_two_pow 2 n + (by omega) + have hprefix : A * (Real.sqrt 2) ^ n ≤ C' := by + dsimp only [C'] + have hmax : 0 ≤ max 0 C := le_max_left _ _ + linarith + linarith + +/-- Carlet's full Plotkin propagation from an eventual order-two base: the +sharp coefficient is multiplied by `(1 + √2)^(r-2)` and the error is +`O(n^(r-2))`. -/ +theorem exists_maximumHigherOrderNonlinearity_cast_le_of_eventual_orderTwo + (A : ℝ) (hA : 0 ≤ A) + (hbase : ∃ C : ℝ, ∀ᶠ n in Filter.atTop, + (maximumHigherOrderNonlinearity 2 n : ℝ) ≤ + (2 : ℝ) ^ n / 2 - A * (Real.sqrt 2) ^ n + C) + (r : ℕ) (hr : 2 ≤ r) : + ∃ D : ℝ, 0 ≤ D ∧ ∀ n : ℕ, r ≤ n → + (maximumHigherOrderNonlinearity r n : ℝ) ≤ + (2 : ℝ) ^ n / 2 - + (A * (1 + Real.sqrt 2) ^ (r - 2)) * (Real.sqrt 2) ^ n + + D * (n + 1 : ℝ) ^ (r - 2) := by + rcases hbase with ⟨C, hbase⟩ + obtain ⟨C', hC', hglobal⟩ := + exists_global_orderTwo_bound_of_eventually A C hA hbase + exact exists_maximumHigherOrderNonlinearity_cast_le_iterated_carlet + A C' hA hC' hglobal r hr + +private def toggleOn + (g : BooleanFunction n) (S : Finset (FABL.F₂Cube n)) : BooleanFunction n := + fun x ↦ if x ∈ S then g x + 1 else g x + +private theorem hammingDistance_toggleOn + (g : BooleanFunction n) (S : Finset (FABL.F₂Cube n)) : + hammingDistance (toggleOn g S) g = S.card := by + classical + unfold hammingDistance hammingDist toggleOn + congr 1 + ext x + by_cases hx : x ∈ S <;> simp [hx] + +private def mismatchSet + (f g : BooleanFunction n) : Finset (FABL.F₂Cube n) := + Finset.univ.filter fun x ↦ f x ≠ g x + +private theorem toggleOn_mismatchSet (f g : BooleanFunction n) : + toggleOn g (mismatchSet f g) = f := by + funext x + by_cases hfg : f x = g x + · simp [toggleOn, mismatchSet, hfg] + · have hsum : g x + 1 = f x := by + by_cases hfx : f x = 0 + · have hgx0 : g x ≠ 0 := by + intro hgx + apply hfg + rw [hfx, hgx] + have hgx : g x = 1 := Fin.eq_one_of_ne_zero (g x) hgx0 + simp [hfx, hgx] + · have hfone : f x = 1 := Fin.eq_one_of_ne_zero (f x) hfx + have hgx : g x = 0 := by + by_contra hgx + exact hfg (hfone.trans (Fin.eq_one_of_ne_zero (g x) hgx).symm) + simp [hfone, hgx] + change (if x ∈ mismatchSet f g then g x + 1 else g x) = f x + rw [if_pos] + · exact hsum + · simp [mismatchSet, hfg] + +private theorem mismatchSet_card (f g : BooleanFunction n) : + (mismatchSet f g).card = hammingDistance f g := by + rfl + +private theorem toggleOn_injective (g : BooleanFunction n) : + Function.Injective (toggleOn g) := by + intro S T hST + ext x + have hx := congrFun hST x + by_cases hxS : x ∈ S <;> by_cases hxT : x ∈ T <;> + simp only [toggleOn, hxS, hxT, if_pos] at hx ⊢ <;> + simp_all + +private def hammingSubsetFamily + (α : Type*) [Fintype α] [DecidableEq α] (t : ℕ) : Finset (Finset α) := + (Finset.range (t + 1)).biUnion fun j ↦ + Finset.powersetCard j (Finset.univ : Finset α) + +@[simp] private theorem mem_hammingSubsetFamily + {α : Type*} [Fintype α] [DecidableEq α] + (S : Finset α) (t : ℕ) : + S ∈ hammingSubsetFamily α t ↔ S.card ≤ t := by + classical + simp [hammingSubsetFamily] + +/-- The cardinality of a binary Hamming ball of radius `t` in dimension `N`. -/ +def hammingBallVolume (N t : ℕ) : ℕ := + ∑ j ∈ Finset.range (t + 1), Nat.choose N j + +private theorem card_hammingSubsetFamily + (α : Type*) [Fintype α] [DecidableEq α] (t : ℕ) : + (hammingSubsetFamily α t).card = hammingBallVolume (Fintype.card α) t := by + classical + have hdisjoint : + ((Finset.range (t + 1) : Finset ℕ) : Set ℕ).PairwiseDisjoint + (fun j ↦ Finset.powersetCard j (Finset.univ : Finset α)) := by + intro i hi j hj hij + change Disjoint + (Finset.powersetCard i (Finset.univ : Finset α)) + (Finset.powersetCard j (Finset.univ : Finset α)) + rw [Finset.disjoint_left] + intro S hSi hSj + exact hij ((Finset.mem_powersetCard.mp hSi).2.symm.trans + (Finset.mem_powersetCard.mp hSj).2) + rw [hammingSubsetFamily, Finset.card_biUnion hdisjoint] + simp [hammingBallVolume] + +private def hammingBall + (g : BooleanFunction n) (t : ℕ) : Finset (BooleanFunction n) := + Finset.univ.filter fun f ↦ hammingDistance f g ≤ t + +private theorem hammingBall_eq_image (g : BooleanFunction n) (t : ℕ) : + hammingBall g t = + (hammingSubsetFamily (FABL.F₂Cube n) t).image (toggleOn g) := by + classical + ext f + constructor + · intro hf + rw [Finset.mem_image] + refine ⟨mismatchSet f g, ?_, ?_⟩ + · rw [mem_hammingSubsetFamily, mismatchSet_card] + simpa [hammingBall] using hf + · exact toggleOn_mismatchSet f g + · intro hf + rcases Finset.mem_image.mp hf with ⟨S, hS, rfl⟩ + simp [hammingBall, hammingDistance_toggleOn, + (mem_hammingSubsetFamily S t).mp hS] + +private theorem card_hammingBall (g : BooleanFunction n) (t : ℕ) : + (hammingBall g t).card = hammingBallVolume (2 ^ n) t := by + classical + rw [hammingBall_eq_image, + Finset.card_image_of_injective _ (toggleOn_injective g), + card_hammingSubsetFamily] + simp + +/-- If the Reed--Muller Hamming balls of radius `t` have total cardinality +strictly below the Boolean-function space, some function has order-`r` +nonlinearity greater than `t`. -/ +theorem exists_higherOrderNonlinearity_gt_of_counting + (r n t : ℕ) + (hcount : + 2 ^ (∑ j ∈ Finset.range (r + 1), Nat.choose n j) * + hammingBallVolume (2 ^ n) t < 2 ^ (2 ^ n)) : + ∃ f : BooleanFunction n, t < higherOrderNonlinearity r f := by + classical + letI : Fintype (reedMuller r n) := Fintype.ofFinite (reedMuller r n) + let covered : Finset (BooleanFunction n) := + (Finset.univ : Finset (reedMuller r n)).biUnion fun g ↦ + hammingBall g.1 t + by_contra hnone + push Not at hnone + have hle (f : BooleanFunction n) : higherOrderNonlinearity r f ≤ t := by + exact hnone f + have hcovered : covered = Finset.univ := by + apply Finset.eq_univ_of_forall + intro f + obtain ⟨g, hg, hdistance⟩ := + exists_reedMuller_hammingDistance_eq_higherOrderNonlinearity r f + change f ∈ (Finset.univ : Finset (reedMuller r n)).biUnion + (fun g ↦ hammingBall g.1 t) + rw [Finset.mem_biUnion] + refine ⟨⟨g, hg⟩, Finset.mem_univ _, ?_⟩ + simp [hammingBall, hdistance, hle f] + have hcoverCard : + 2 ^ (2 ^ n) ≤ + 2 ^ (∑ j ∈ Finset.range (r + 1), Nat.choose n j) * + hammingBallVolume (2 ^ n) t := by + calc + 2 ^ (2 ^ n) = covered.card := by + rw [hcovered, Finset.card_univ, Fintype.card_fun] + simp + _ ≤ (Finset.univ : Finset (reedMuller r n)).card * + hammingBallVolume (2 ^ n) t := by + apply Finset.card_biUnion_le_card_mul + intro g hg + rw [card_hammingBall] + _ = 2 ^ (∑ j ∈ Finset.range (r + 1), Nat.choose n j) * + hammingBallVolume (2 ^ n) t := by + rw [Finset.card_univ, ← Nat.card_eq_fintype_card, reedMuller_card] + exact (Nat.not_le_of_gt hcount) hcoverCard + +/-- Power-of-two form of the exact finite sphere-covering criterion. -/ +theorem exists_higherOrderNonlinearity_gt_of_hammingBallVolume_lt + (r n t : ℕ) + (hdimension : + ∑ j ∈ Finset.range (r + 1), Nat.choose n j ≤ 2 ^ n) + (hvolume : + hammingBallVolume (2 ^ n) t < + 2 ^ (2 ^ n - ∑ j ∈ Finset.range (r + 1), Nat.choose n j)) : + ∃ f : BooleanFunction n, t < higherOrderNonlinearity r f := by + apply exists_higherOrderNonlinearity_gt_of_counting r n t + have hpow : 0 < + 2 ^ (∑ j ∈ Finset.range (r + 1), Nat.choose n j) := by + positivity + calc + 2 ^ (∑ j ∈ Finset.range (r + 1), Nat.choose n j) * + hammingBallVolume (2 ^ n) t < + 2 ^ (∑ j ∈ Finset.range (r + 1), Nat.choose n j) * + 2 ^ (2 ^ n - ∑ j ∈ Finset.range (r + 1), Nat.choose n j) := + Nat.mul_lt_mul_of_pos_left hvolume hpow + _ = 2 ^ (2 ^ n) := by + rw [← pow_add, Nat.add_sub_of_le hdimension] + +local instance higherOrderSignMeasurableSpace : MeasurableSpace FABL.Sign := ⊤ + +local instance higherOrderSignMeasurableSingletonClass : + MeasurableSingletonClass FABL.Sign where + measurableSet_singleton _ := by simp + +private def lowPositiveSignCube (N t : ℕ) : Finset ({−1,1}^[N]) := + Finset.univ.filter fun x ↦ FABL.positiveCoordinateCount x ≤ t + +private theorem image_lowPositiveSignCube (N t : ℕ) : + (lowPositiveSignCube N t).image (FABL.signCubeEquivFinset N) = + hammingSubsetFamily (Fin N) t := by + classical + ext S + constructor + · intro hS + rcases Finset.mem_image.mp hS with ⟨x, hx, rfl⟩ + rw [mem_hammingSubsetFamily] + simpa [lowPositiveSignCube] using hx + · intro hS + rw [Finset.mem_image] + refine ⟨(FABL.signCubeEquivFinset N).symm S, ?_, + (FABL.signCubeEquivFinset N).apply_symm_apply S⟩ + simp only [lowPositiveSignCube, Finset.mem_filter, Finset.mem_univ, true_and] + rw [← FABL.signCubeEquivFinset_apply_card] + simpa using (mem_hammingSubsetFamily S t).mp hS + +private theorem card_lowPositiveSignCube (N t : ℕ) : + (lowPositiveSignCube N t).card = hammingBallVolume N t := by + calc + (lowPositiveSignCube N t).card = + ((lowPositiveSignCube N t).image (FABL.signCubeEquivFinset N)).card := + (Finset.card_image_of_injective _ + (FABL.signCubeEquivFinset N).injective).symm + _ = (hammingSubsetFamily (Fin N) t).card := by + rw [image_lowPositiveSignCube] + _ = hammingBallVolume N t := by + simpa using card_hammingSubsetFamily (Fin N) t + +private theorem measure_uniformPMF_real_eq_ncard_div_card + {Ω : Type*} [Fintype Ω] [Nonempty Ω] + [MeasurableSpace Ω] [MeasurableSingletonClass Ω] + (A : Set Ω) : + (FABL.uniformPMF Ω).toMeasure.real A = + (A.ncard : ℝ) / Fintype.card Ω := by + classical + rw [Measure.real_def, PMF.toMeasure_apply_eq_tsum, tsum_fintype, + ENNReal.toReal_sum] + · rw [Set.ncard_eq_toFinset_card' A] + simp only [FABL.uniformPMF, Set.indicator_apply, + PMF.uniformOfFintype_apply] + calc + (∑ x : Ω, + (if x ∈ A then ((Fintype.card Ω : ℝ≥0∞)⁻¹) else 0).toReal) = + ∑ x ∈ Finset.univ.filter (fun x ↦ x ∈ A), + ((Fintype.card Ω : ℝ≥0∞)⁻¹).toReal := by + rw [Finset.sum_filter] + apply Finset.sum_congr rfl + intro x _ + by_cases hx : x ∈ A <;> simp [hx] + _ = ((Finset.univ.filter fun x : Ω ↦ x ∈ A).card : ℝ) * + ((Fintype.card Ω : ℝ≥0∞)⁻¹).toReal := by + simp [nsmul_eq_mul] + _ = _ := by + rw [ENNReal.toReal_inv, ENNReal.toReal_natCast] + simp [div_eq_mul_inv] + · intro x _ + by_cases hx : x ∈ A <;> simp [hx, FABL.uniformPMF] + +private theorem measure_lowPositiveSignCube (N t : ℕ) : + (FABL.uniformPMF ({−1,1}^[N])).toMeasure.real + {x | FABL.positiveCoordinateCount x ≤ t} = + (hammingBallVolume N t : ℝ) / (2 : ℝ) ^ N := by + classical + rw [measure_uniformPMF_real_eq_ncard_div_card] + have hncard : + ({x : {−1,1}^[N] | FABL.positiveCoordinateCount x ≤ t} : Set _).ncard = + (lowPositiveSignCube N t).card := by + rw [Set.ncard_eq_toFinset_card'] + congr 1 + ext x + simp [lowPositiveSignCube] + rw [hncard, card_lowPositiveSignCube] + congr 1 + norm_num [Fintype.card_pi, FABL.Sign] + +private theorem expect_neg_signValue_eq_zero : + Finset.expect Finset.univ (fun s : FABL.Sign ↦ -FABL.signValue s) = 0 := by + rw [Fintype.expect_eq_sum_div_card] + norm_num [FABL.Sign, FABL.signValue] + +private theorem neg_signValue_mem_Icc (s : FABL.Sign) : + -FABL.signValue s ∈ Set.Icc (-1 : ℝ) 1 := by + rcases Int.units_eq_one_or s with rfl | rfl <;> simp [FABL.signValue] + +private theorem two_mul_sqrt_half (N D : ℕ) : + 2 * Real.sqrt ((N : ℝ) * D / 2) = + Real.sqrt (2 * (N : ℝ) * D) := by + rw [show (2 : ℝ) * N * D = 4 * ((N : ℝ) * D / 2) by ring, + Real.sqrt_mul (by norm_num : (0 : ℝ) ≤ 4)] + norm_num + +private theorem measure_lowPositiveSignCube_le_exp + (N D t : ℕ) (hN : 0 < N) + (ht : (t : ℝ) ≤ (N : ℝ) / 2 - Real.sqrt ((N : ℝ) * D / 2)) : + (FABL.uniformPMF ({−1,1}^[N])).toMeasure.real + {x | FABL.positiveCoordinateCount x ≤ t} ≤ + Real.exp (-(D : ℝ)) := by + rw [FABL.uniformSample_toMeasure_eq_pi FABL.Sign N] + let μ : Measure (Fin N → FABL.Sign) := + Measure.pi fun _ : Fin N ↦ (FABL.uniformPMF FABL.Sign).toMeasure + let threshold : ℝ := Real.sqrt (2 * (N : ℝ) * D) + have hcoordinate (i : Fin N) : + HasSubgaussianMGF + (fun samples : Fin N → FABL.Sign ↦ -FABL.signValue (samples i)) 1 μ := by + have h := hasSubgaussianMGF_of_mem_Icc + (μ := μ) + (X := fun samples : Fin N → FABL.Sign ↦ -FABL.signValue (samples i)) + (measurable_of_finite fun samples : Fin N → FABL.Sign ↦ + -FABL.signValue (samples i)).aemeasurable + (ae_of_all _ fun samples ↦ neg_signValue_mem_Icc (samples i)) + have hmean : + ∫ samples : Fin N → FABL.Sign, -FABL.signValue (samples i) ∂μ = 0 := by + rw [integral_comp_eval + (μ := fun _ : Fin N ↦ (FABL.uniformPMF FABL.Sign).toMeasure) + (i := i) + (measurable_of_finite fun s : FABL.Sign ↦ + -FABL.signValue s).aestronglyMeasurable] + rw [FABL.integral_uniformPMF_eq_expect, expect_neg_signValue_eq_zero] + rw [hmean] at h + norm_num at h ⊢ + exact h + have hindep : + iIndepFun + (fun i (samples : Fin N → FABL.Sign) ↦ -FABL.signValue (samples i)) μ := by + exact iIndepFun_pi fun _ ↦ + (measurable_of_finite fun s : FABL.Sign ↦ -FABL.signValue s).aemeasurable + have htail : + μ.real {samples | + threshold ≤ ∑ i : Fin N, -FABL.signValue (samples i)} ≤ + Real.exp (-(D : ℝ)) := by + have h := HasSubgaussianMGF.measure_sum_ge_le_of_iIndepFun hindep + (c := fun _ : Fin N ↦ (1 : NNReal)) (s := Finset.univ) + (fun i _ ↦ hcoordinate i) + (ε := threshold) + (Real.sqrt_nonneg _) + have hNReal : (0 : ℝ) < N := by exact_mod_cast hN + have hthresholdSq : threshold ^ 2 = 2 * (N : ℝ) * D := by + exact Real.sq_sqrt (by positivity) + have hexponent : + -threshold ^ 2 / (2 * (N : ℝ)) = -(D : ℝ) := by + rw [hthresholdSq] + field_simp + norm_num [Finset.sum_const, Finset.card_univ, Fintype.card_fin, + nsmul_eq_mul] at h + rw [hexponent] at h + simpa only [Finset.sum_neg_distrib] using h + have hsubset : + {x : Fin N → FABL.Sign | FABL.positiveCoordinateCount x ≤ t} ⊆ + {samples | threshold ≤ ∑ i : Fin N, -FABL.signValue (samples i)} := by + intro x hx + have hxR : (FABL.positiveCoordinateCount x : ℝ) ≤ t := by + exact_mod_cast hx + have hsum := FABL.sum_signValue_eq_two_mul_positiveCoordinateCount_sub x + change threshold ≤ ∑ i : Fin N, -FABL.signValue (x i) + rw [Finset.sum_neg_distrib, hsum] + dsimp only [threshold] + rw [← two_mul_sqrt_half N D] + nlinarith + exact (measureReal_mono hsubset).trans htail + +private theorem exp_neg_natCast_lt_two_pow_inv (D : ℕ) (hD : 0 < D) : + Real.exp (-(D : ℝ)) < ((2 : ℝ) ^ D)⁻¹ := by + have hbase : (Real.exp 1)⁻¹ < (2 : ℝ)⁻¹ := + (inv_lt_inv₀ (Real.exp_pos 1) (by norm_num : (0 : ℝ) < 2)).2 + Real.exp_one_gt_two + have hpow : ((Real.exp 1)⁻¹) ^ D < ((2 : ℝ)⁻¹) ^ D := + pow_lt_pow_left₀ hbase (by positivity) (Nat.ne_of_gt hD) + calc + Real.exp (-(D : ℝ)) = Real.exp ((D : ℝ) * (-1)) := by + congr 1 + ring + _ = Real.exp (-1) ^ D := Real.exp_nat_mul (-1) D + _ = ((Real.exp 1)⁻¹) ^ D := by rw [Real.exp_neg] + _ < ((2 : ℝ)⁻¹) ^ D := hpow + _ = ((2 : ℝ) ^ D)⁻¹ := by rw [inv_pow] + +private theorem hammingBallVolume_lt_two_pow_sub + (N D t : ℕ) (hN : 0 < N) (hD : 0 < D) (hDN : D ≤ N) + (ht : (t : ℝ) ≤ (N : ℝ) / 2 - Real.sqrt ((N : ℝ) * D / 2)) : + hammingBallVolume N t < 2 ^ (N - D) := by + have hratio : + (hammingBallVolume N t : ℝ) / (2 : ℝ) ^ N < + ((2 : ℝ) ^ D)⁻¹ := by + calc + (hammingBallVolume N t : ℝ) / (2 : ℝ) ^ N = + (FABL.uniformPMF ({−1,1}^[N])).toMeasure.real + {x | FABL.positiveCoordinateCount x ≤ t} := + (measure_lowPositiveSignCube N t).symm + _ ≤ Real.exp (-(D : ℝ)) := + measure_lowPositiveSignCube_le_exp N D t hN ht + _ < ((2 : ℝ) ^ D)⁻¹ := exp_neg_natCast_lt_two_pow_inv D hD + have hreal : + (2 : ℝ) ^ D * hammingBallVolume N t < (2 : ℝ) ^ N := by + have h := (div_lt_iff₀ (show 0 < (2 : ℝ) ^ N by positivity)).mp hratio + have hmul := mul_lt_mul_of_pos_left h (show 0 < (2 : ℝ) ^ D by positivity) + field_simp at hmul + simpa [mul_assoc, mul_left_comm, mul_comm] using hmul + have hnat : 2 ^ D * hammingBallVolume N t < 2 ^ N := by + exact_mod_cast hreal + have hpowN : 2 ^ N = 2 ^ D * 2 ^ (N - D) := by + rw [← pow_add, Nat.add_sub_of_le hDN] + rw [hpowN] at hnat + exact (Nat.mul_lt_mul_left (by positivity : 0 < 2 ^ D)).mp hnat + +/-- Finite-dimensional form of Carlet's probabilistic lower bound. -/ +theorem exists_higherOrderNonlinearity_gt_lower_bound_of_dimension + (r n : ℕ) + (hdimension : + 2 * (∑ j ∈ Finset.range (r + 1), Nat.choose n j) ≤ 2 ^ n) : + ∃ f : BooleanFunction n, + (2 : ℝ) ^ n / 2 - + Real.sqrt + ((2 : ℝ) ^ n / 2 * + (∑ j ∈ Finset.range (r + 1), Nat.choose n j : ℕ)) < + (higherOrderNonlinearity r f : ℝ) := by + let N : ℕ := 2 ^ n + let D : ℕ := ∑ j ∈ Finset.range (r + 1), Nat.choose n j + let threshold : ℝ := + (N : ℝ) / 2 - Real.sqrt ((N : ℝ) * D / 2) + have hN : 0 < N := by simp [N] + have hD : 0 < D := by + simp only [D, Finset.sum_pos_iff] + exact ⟨0, by simp, by simp⟩ + have hDN : D ≤ N := by + dsimp only [D, N] + omega + have hthreshold : 0 ≤ threshold := by + have hdimensionR : (2 : ℝ) * D ≤ N := by + exact_mod_cast hdimension + have hNreal : (0 : ℝ) < N := by exact_mod_cast hN + have hsqrtSq : Real.sqrt ((N : ℝ) * D / 2) ^ 2 = (N : ℝ) * D / 2 := + Real.sq_sqrt (by positivity) + have hsqrtNonneg := Real.sqrt_nonneg ((N : ℝ) * D / 2) + dsimp only [threshold] + have hproduct : 0 ≤ (N : ℝ) * ((N : ℝ) - 2 * D) := + mul_nonneg hNreal.le (sub_nonneg.mpr hdimensionR) + nlinarith + let t : ℕ := ⌊threshold⌋₊ + have ht : (t : ℝ) ≤ (N : ℝ) / 2 - Real.sqrt ((N : ℝ) * D / 2) := by + exact Nat.floor_le hthreshold + have hvolume : hammingBallVolume N t < 2 ^ (N - D) := + hammingBallVolume_lt_two_pow_sub N D t hN hD hDN ht + obtain ⟨f, hf⟩ := + exists_higherOrderNonlinearity_gt_of_hammingBallVolume_lt + r n t hDN (by simpa [N, D] using hvolume) + refine ⟨f, ?_⟩ + have hthresholdLt : threshold < (higherOrderNonlinearity r f : ℝ) := + (Nat.floor_lt hthreshold).mp hf + simpa [threshold, N, D, div_mul_eq_mul_div] using hthresholdLt + +private theorem sum_choose_le_mul_pow (r n : ℕ) (hn : 0 < n) : + (∑ j ∈ Finset.range (r + 1), Nat.choose n j) ≤ (r + 1) * n ^ r := by + calc + (∑ j ∈ Finset.range (r + 1), Nat.choose n j) ≤ + ∑ _j ∈ Finset.range (r + 1), n ^ r := by + apply Finset.sum_le_sum + intro j hj + exact (Nat.choose_le_pow n j).trans + (Nat.pow_le_pow_right hn (Nat.le_of_lt_succ (Finset.mem_range.mp hj))) + _ = (r + 1) * n ^ r := by simp [mul_comm] + +/-- For fixed order `r`, the Reed--Muller dimension is eventually at most +half of the ambient Boolean cube dimension. -/ +theorem eventually_twice_sum_choose_le_two_pow (r : ℕ) : + ∀ᶠ n in Filter.atTop, + 2 * (∑ j ∈ Finset.range (r + 1), Nat.choose n j) ≤ 2 ^ n := by + have hlittle : + (fun n : ℕ ↦ (n : ℝ) ^ r) =o[Filter.atTop] + (fun n : ℕ ↦ (2 : ℝ) ^ n) := + isLittleO_pow_const_const_pow_of_one_lt r (by norm_num) + have hconstant : (0 : ℝ) < (2 * (r + 1 : ℕ) : ℝ) := by positivity + have hbound := hlittle.bound (inv_pos.mpr hconstant) + filter_upwards [hbound, eventually_gt_atTop 0] with n hn hnpos + have hn' : 0 < n := hnpos + norm_num [Real.norm_eq_abs, abs_of_nonneg] at hn + have hboundR : + (2 : ℝ) * (r + 1 : ℕ) * (n : ℝ) ^ r ≤ (2 : ℝ) ^ n := by + have hmul := mul_le_mul_of_nonneg_left hn hconstant.le + field_simp at hmul + simpa [mul_assoc, mul_left_comm, mul_comm] using hmul + have hboundN : 2 * (r + 1) * n ^ r ≤ 2 ^ n := by + exact_mod_cast hboundR + calc + 2 * (∑ j ∈ Finset.range (r + 1), Nat.choose n j) ≤ + 2 * ((r + 1) * n ^ r) := + Nat.mul_le_mul_left 2 (sum_choose_le_mul_pow r n hn') + _ = 2 * (r + 1) * n ^ r := by ring + _ ≤ 2 ^ n := hboundN + +private theorem two_pow_nat_div_two_eq_rpow_sub_one (n : ℕ) : + (2 : ℝ) ^ n / 2 = (2 : ℝ) ^ ((n : ℝ) - 1) := by + rw [← Real.rpow_natCast] + simpa using + (Real.rpow_sub (x := (2 : ℝ)) (by norm_num : (0 : ℝ) < 2) + (n : ℝ) 1).symm + +/-- Carlet's fixed-order asymptotic lower bound for higher-order nonlinearity. -/ +theorem eventually_exists_higherOrderNonlinearity_gt_carlet_lower_bound (r : ℕ) : + ∀ᶠ n in Filter.atTop, + ∃ f : BooleanFunction n, + (2 : ℝ) ^ ((n : ℝ) - 1) - + Real.sqrt + ((2 : ℝ) ^ ((n : ℝ) - 1) * + (∑ j ∈ Finset.range (r + 1), Nat.choose n j : ℕ)) < + (higherOrderNonlinearity r f : ℝ) := by + filter_upwards [eventually_twice_sum_choose_le_two_pow r] with n hdimension + simpa [two_pow_nat_div_two_eq_rpow_sub_one] using + exists_higherOrderNonlinearity_gt_lower_bound_of_dimension r n hdimension + +end CryptBoolean diff --git a/CryptBoolean/Carlet/Chapter04/HigherOrderJuntaDistance.lean b/CryptBoolean/Carlet/Chapter04/HigherOrderJuntaDistance.lean new file mode 100644 index 0000000..ba720b6 --- /dev/null +++ b/CryptBoolean/Carlet/Chapter04/HigherOrderJuntaDistance.lean @@ -0,0 +1,125 @@ +/- +Copyright (c) 2026 Asher Yan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Asher Yan with Codex +-/ +module + +public import CryptBoolean.Carlet.Chapter04.HigherOrderNonlinearity + +/-! +# Carlet Chapter 4 distance to coordinate juntas + +A Boolean function depending on `r` coordinates has algebraic degree at most +`r`, so it is a valid Reed--Muller approximant for order-`r` nonlinearity. +-/ + +open Finset Set +open scoped BooleanCube + +@[expose] public section + +namespace CryptBoolean + +variable {n : ℕ} + +/-- Invariance under one binary coordinate forces every ANF coefficient +containing that coordinate to vanish. -/ +theorem anfCoeff_eq_zero_of_coordinate_invariant + (g : BooleanFunction n) (S : Finset (Fin n)) (i : Fin n) + (hiS : i ∈ S) + (hinvariant : ∀ x : FABL.F₂Cube n, + g (Function.update x i 1) = g (Function.update x i 0)) : + FABL.anfCoeff g S = 0 := by + classical + let R := S.erase i + have hiR : i ∉ R := Finset.notMem_erase i S + have hS : S = insert i R := (Finset.insert_erase hiS).symm + have hdisjoint : Disjoint R.powerset (R.powerset.image (insert i)) := by + rw [Finset.disjoint_left] + intro T hTR hTimage + have hiT : i ∉ T := + Finset.notMem_of_mem_powerset_of_notMem hTR hiR + obtain ⟨U, hUR, hUT⟩ := Finset.mem_image.mp hTimage + subst T + exact hiT (Finset.mem_insert_self i U) + have hinjective : Set.InjOn (insert i) + (R.powerset : Set (Finset (Fin n))) := by + intro A hAR B hBR hAB + have hiA : i ∉ A := + Finset.notMem_of_mem_powerset_of_notMem hAR hiR + have hiB : i ∉ B := + Finset.notMem_of_mem_powerset_of_notMem hBR hiR + have herase := congrArg (fun T : Finset (Fin n) ↦ T.erase i) hAB + simpa [hiA, hiB] using herase + have hpoint (T : Finset (Fin n)) (hTR : T ∈ R.powerset) : + g (FABL.f₂CubeOfFinset (insert i T)) = + g (FABL.f₂CubeOfFinset T) := by + have hiT : i ∉ T := + Finset.notMem_of_mem_powerset_of_notMem hTR hiR + have hone : Function.update (FABL.f₂CubeOfFinset T) i 1 = + FABL.f₂CubeOfFinset (insert i T) := by + funext j + by_cases hji : j = i + · subst j + simp [FABL.f₂CubeOfFinset_apply] + · simp [FABL.f₂CubeOfFinset_apply, hji] + have hzero : Function.update (FABL.f₂CubeOfFinset T) i 0 = + FABL.f₂CubeOfFinset T := by + apply Function.update_eq_self_iff.mpr + simp [FABL.f₂CubeOfFinset_apply, hiT] + simpa [hone, hzero] using hinvariant (FABL.f₂CubeOfFinset T) + rw [FABL.anfCoeff, hS, Finset.powerset_insert, + Finset.sum_union hdisjoint, Finset.sum_image hinjective] + have heq : + (∑ T ∈ R.powerset, + g (FABL.f₂CubeOfFinset (insert i T))) = + ∑ T ∈ R.powerset, g (FABL.f₂CubeOfFinset T) := by + apply Finset.sum_congr rfl + intro T hTR + exact hpoint T hTR + rw [heq, CharTwo.add_self_eq_zero] + +/-- A function depending only on `I` has no ANF coefficient supported +outside `I`. -/ +theorem anfCoeff_eq_zero_of_dependsOn_of_not_subset + (g : BooleanFunction n) {I S : Finset (Fin n)} + (hdepends : DependsOn g (I : Set (Fin n))) (hS : ¬ S ⊆ I) : + FABL.anfCoeff g S = 0 := by + obtain ⟨i, hiS, hiI⟩ := Finset.not_subset.mp hS + apply anfCoeff_eq_zero_of_coordinate_invariant g S i hiS + intro x + apply hdepends + intro j hjI + have hji : j ≠ i := by + intro h + subst j + exact hiI hjI + rw [Function.update_of_ne hji, Function.update_of_ne hji] + +/-- A Boolean function depending only on `I` has algebraic degree at most +the cardinality of `I`. -/ +theorem functionAlgebraicDegree_le_card_of_dependsOn + (g : BooleanFunction n) (I : Finset (Fin n)) + (hdepends : DependsOn g (I : Set (Fin n))) : + FABL.functionAlgebraicDegree g ≤ I.card := by + rw [FABL.functionAlgebraicDegree, FABL.algebraicDegree_le_iff] + intro S hcoeff + by_contra hcard + have hnotSubset : ¬ S ⊆ I := by + intro hsubset + exact hcard (Finset.card_le_card hsubset) + exact hcoeff + (anfCoeff_eq_zero_of_dependsOn_of_not_subset g hdepends hnotSubset) + +/-- Carlet's coordinate-junta bound: every function depending on a set `I` +of `r` coordinates is an admissible order-`r` approximant. -/ +theorem higherOrderNonlinearity_le_hammingDistance_of_dependsOn + (r : ℕ) (f g : BooleanFunction n) (I : Finset (Fin n)) + (hI : I.card = r) (hdepends : DependsOn g (I : Set (Fin n))) : + higherOrderNonlinearity r f ≤ hammingDistance f g := by + apply higherOrderNonlinearity_le_hammingDistance r f g + rw [mem_reedMuller_iff, ← hI] + exact functionAlgebraicDegree_le_card_of_dependsOn g I hdepends + +end CryptBoolean diff --git a/CryptBoolean/Carlet/Chapter04/HigherOrderLowWeightFlats.lean b/CryptBoolean/Carlet/Chapter04/HigherOrderLowWeightFlats.lean new file mode 100644 index 0000000..2e51f0f --- /dev/null +++ b/CryptBoolean/Carlet/Chapter04/HigherOrderLowWeightFlats.lean @@ -0,0 +1,422 @@ +/- +Copyright (c) 2026 Asher Yan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Asher Yan with Codex +-/ +module + +public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwo +public import CryptBoolean.Carlet.Chapter03.ReedMullerMinimumWeight + +/-! +# Affine-flat characters for low-weight Reed--Muller words + +Canonical affine-flat enumerators and the support-character identities shared by +the weight-eight, weight-twelve, weight-fourteen, and weight-sixteen analyses. +-/ + +open Finset +open scoped BigOperators BooleanCube + +@[expose] public section + +namespace CryptBoolean + +open FABL + +variable {n : ℕ} + +noncomputable local instance lowWeightFlatsAffineSubspaceFintype : Fintype + (AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) := + Fintype.ofFinite _ + +noncomputable local instance lowWeightFlatsAffineSubspaceDecidableEq : DecidableEq + (AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) := + Classical.decEq _ + +noncomputable local instance lowWeightFlatsSubmoduleFintype : Fintype + (Submodule FABL.𝔽₂ (FABL.F₂Cube n)) := + Fintype.ofFinite _ + +/-- The canonical finite family of `k`-dimensional affine flats in the +binary cube. -/ +noncomputable def binaryAffineFlats (k n : ℕ) : + Finset (AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) := by + classical + exact Finset.univ.filter fun A ↦ + A ≠ ⊥ ∧ Module.finrank FABL.𝔽₂ A.direction = k + +/-- The canonical finite family of `k`-dimensional linear subspaces in the +binary cube. -/ +noncomputable def binaryLinearSubspaces (k n : ℕ) : + Finset (Submodule FABL.𝔽₂ (FABL.F₂Cube n)) := by + classical + exact Finset.univ.filter fun H ↦ Module.finrank FABL.𝔽₂ H = k + +@[simp] theorem mem_binaryLinearSubspaces + {k : ℕ} + (H : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) : + H ∈ binaryLinearSubspaces k n ↔ Module.finrank FABL.𝔽₂ H = k := by + classical + simp [binaryLinearSubspaces] + +theorem binaryAffineSubspace_mem_binaryAffineFlats + {k : ℕ} + (H : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) + (u : FABL.F₂Cube n) (hH : H ∈ binaryLinearSubspaces k n) : + FABL.binaryAffineSubspace H u ∈ binaryAffineFlats k n := by + simp only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, true_and] + constructor + · intro hbot + have hu : u ∈ (⊥ : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) := by + rw [← hbot] + exact AffineSubspace.self_mem_mk' _ _ + rw [← SetLike.mem_coe, AffineSubspace.bot_coe] at hu + exact hu + · rw [FABL.binaryAffineSubspace_direction] + exact (mem_binaryLinearSubspaces H).mp hH + +/-- The Boolean indicator of a Mathlib affine subspace. -/ +noncomputable def binaryAffineFlatIndicator + (A : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) : + BooleanFunction n := by + classical + exact fun x ↦ if x ∈ A then 1 else 0 + +/-- The finite point set of an affine flat. -/ +noncomputable def binaryAffineFlatPoints + (A : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) : + Finset (FABL.F₂Cube n) := by + classical + exact Finset.univ.filter fun x ↦ x ∈ A + +@[simp] theorem mem_binaryAffineFlatPoints + (A : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) + (x : FABL.F₂Cube n) : + x ∈ binaryAffineFlatPoints A ↔ x ∈ A := by + classical + simp [binaryAffineFlatPoints] + +@[simp] theorem binaryAffineFlatIndicator_apply_eq_one_iff + (A : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) + (x : FABL.F₂Cube n) : + binaryAffineFlatIndicator A x = 1 ↔ x ∈ A := by + classical + simp [binaryAffineFlatIndicator] + +theorem binaryAffineFlatIndicator_eq_affineFlatIndicator + (A : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) + (a : FABL.F₂Cube n) (ha : a ∈ A) : + binaryAffineFlatIndicator A = affineFlatIndicator A.direction a := by + classical + have hflat : FABL.binaryAffineSubspace A.direction a = A := by + exact AffineSubspace.mk'_eq ha + funext x + simp only [binaryAffineFlatIndicator, affineFlatIndicator] + rw [hflat] + +/-- The indicator of a binary `k`-flat belongs to the Reed--Muller code of +complementary order. -/ +theorem binaryAffineFlatIndicator_mem_reedMuller + {k : ℕ} + (A : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) + (hA : A ∈ binaryAffineFlats k n) : + binaryAffineFlatIndicator A ∈ reedMuller (n - k) n := by + have hAdata : A ≠ ⊥ ∧ Module.finrank FABL.𝔽₂ A.direction = k := by + simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, + true_and] using hA + obtain ⟨a, ha⟩ := (AffineSubspace.nonempty_iff_ne_bot A).2 hAdata.1 + have hdegree : FABL.functionAlgebraicDegree + (binaryAffineFlatIndicator A) = n - k := by + rw [binaryAffineFlatIndicator_eq_affineFlatIndicator A a ha, + functionAlgebraicDegree_affineFlatIndicator, FABL.f₂Codimension, + FABL.finrank_perpendicularSubspace, hAdata.2] + simpa only [mem_reedMuller_iff] using hdegree.le + +/-- A nonempty `k`-flat has exactly `2^k` points. -/ +theorem hammingWeight_binaryAffineFlatIndicator + (A : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) + (hA : A ≠ ⊥) : + hammingWeight (binaryAffineFlatIndicator A) = + 2 ^ Module.finrank FABL.𝔽₂ A.direction := by + obtain ⟨a, ha⟩ := (AffineSubspace.nonempty_iff_ne_bot A).2 hA + rw [binaryAffineFlatIndicator_eq_affineFlatIndicator A a ha, + hammingWeight_affineFlatIndicator] + +theorem card_binaryAffineFlatPoints + (A : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) + (hA : A ≠ ⊥) : + (binaryAffineFlatPoints A).card = + 2 ^ Module.finrank FABL.𝔽₂ A.direction := by + rw [← hammingWeight_binaryAffineFlatIndicator A hA, + hammingWeight_eq_card_support] + congr 1 + ext x + simp [binaryAffineFlatPoints, binaryAffineFlatIndicator] + +theorem support_binaryAffineFlatIndicator + (A : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) : + support (binaryAffineFlatIndicator A) = binaryAffineFlatPoints A := by + ext x + simp [support, FABL.f₂OneSupport, binaryAffineFlatIndicator, + binaryAffineFlatPoints] + +/-- Binary addition removes twice the common support from the sum of the +two Hamming weights. -/ +theorem hammingWeight_add_add_two_mul_card_support_inter + (f g : BooleanFunction n) : + hammingWeight (f + g) + 2 * (support f ∩ support g).card = + hammingWeight f + hammingWeight g := by + classical + rw [hammingWeight_eq_card_support, hammingWeight_eq_card_support, + hammingWeight_eq_card_support] + have hinter : + support f ∩ support g = + Finset.univ.filter fun x : FABL.F₂Cube n ↦ f x = 1 ∧ g x = 1 := by + ext x + simp [mem_support] + rw [hinter] + simp only [support, FABL.f₂OneSupport, Pi.add_apply] + simp only [Finset.card_filter] + rw [Finset.mul_sum] + rw [← Finset.sum_add_distrib, ← Finset.sum_add_distrib] + apply Finset.sum_congr rfl + intro x _hx + by_cases hfx : f x = 0 + · by_cases hgx : g x = 0 + · norm_num [hfx, hgx] + · have hgxOne : g x = 1 := Fin.eq_one_of_ne_zero _ hgx + norm_num [hfx, hgxOne] + · have hfxOne : f x = 1 := Fin.eq_one_of_ne_zero _ hfx + by_cases hgx : g x = 0 + · norm_num [hfxOne, hgx] + · have hgxOne : g x = 1 := Fin.eq_one_of_ne_zero _ hgx + norm_num [hfxOne, hgxOne] + +/-- Indicators distinguish nonempty affine subspaces. -/ +theorem binaryAffineFlatIndicator_injective_on_nonempty : + Set.InjOn + (binaryAffineFlatIndicator (n := n)) + {A : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) | A ≠ ⊥} := by + intro A hA B hB hindicator + ext x + have hx := congrFun hindicator x + simpa only [binaryAffineFlatIndicator_apply_eq_one_iff] using + (show binaryAffineFlatIndicator A x = 1 ↔ + binaryAffineFlatIndicator B x = 1 by rw [hx]) + +/-- The character attached to an affine flat and a Boolean function. -/ +noncomputable def binaryAffineFlatCharacter + (f : BooleanFunction n) + (A : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) : ℝ := + FABL.binarySign + (booleanFunctionPairing n f (binaryAffineFlatIndicator A)) + +/-- The character of the affine coset `u + H`. -/ +noncomputable def binaryAffineCosetCharacter + (f : BooleanFunction n) (u : FABL.F₂Cube n) + (H : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) : ℝ := + binaryAffineFlatCharacter f (FABL.binaryAffineSubspace H u) + +/-- The canonical character sum over the `k`-dimensional affine flats. -/ +noncomputable def binaryAffineFlatCharacterSum + (k : ℕ) (f : BooleanFunction n) : ℝ := + ∑ A ∈ binaryAffineFlats k n, binaryAffineFlatCharacter f A + +/-- The indicator of a disjoint union is the binary sum of its indicators. -/ +theorem binaryAffineFlatIndicator_eq_add_of_points_eq_union + (A B C : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) + (hpoints : binaryAffineFlatPoints C = + binaryAffineFlatPoints A ∪ binaryAffineFlatPoints B) + (hdisjoint : Disjoint (binaryAffineFlatPoints A) + (binaryAffineFlatPoints B)) : + binaryAffineFlatIndicator C = + binaryAffineFlatIndicator A + binaryAffineFlatIndicator B := by + funext x + have hmem : x ∈ C ↔ x ∈ A ∨ x ∈ B := by + have hx := Finset.ext_iff.mp hpoints x + simpa only [mem_binaryAffineFlatPoints, Finset.mem_union] using hx + have hnotBoth : ¬ (x ∈ A ∧ x ∈ B) := by + intro hboth + exact (Finset.disjoint_left.mp hdisjoint) + (by simpa only [mem_binaryAffineFlatPoints] using hboth.1) + (by simpa only [mem_binaryAffineFlatPoints] using hboth.2) + simp only [binaryAffineFlatIndicator, Pi.add_apply] + by_cases hxA : x ∈ A <;> by_cases hxB : x ∈ B + · exact (hnotBoth ⟨hxA, hxB⟩).elim + · simp [hxA, hxB, hmem] + · simp [hxA, hxB, hmem] + · simp [hxA, hxB, hmem] + +/-- For disjoint affine flats, an indicator decomposition recovers the +corresponding disjoint union of point sets. -/ +theorem binaryAffineFlatPoints_eq_union_of_indicator_eq_add + (A B C : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) + (hdisjoint : Disjoint (binaryAffineFlatPoints A) + (binaryAffineFlatPoints B)) + (hindicator : binaryAffineFlatIndicator C = + binaryAffineFlatIndicator A + binaryAffineFlatIndicator B) : + binaryAffineFlatPoints C = + binaryAffineFlatPoints A ∪ binaryAffineFlatPoints B := by + classical + ext x + simp only [mem_binaryAffineFlatPoints, Finset.mem_union] + have happ := congrFun hindicator x + have hnotBoth : ¬(x ∈ A ∧ x ∈ B) := by + intro hboth + exact (Finset.disjoint_left.mp hdisjoint) + (by simpa only [mem_binaryAffineFlatPoints] using hboth.1) + (by simpa only [mem_binaryAffineFlatPoints] using hboth.2) + by_cases hxA : x ∈ A <;> by_cases hxB : x ∈ B + · exact (hnotBoth ⟨hxA, hxB⟩).elim + · have hC : x ∈ C := by + apply (binaryAffineFlatIndicator_apply_eq_one_iff C x).mp + rw [hindicator, Pi.add_apply] + simp [binaryAffineFlatIndicator, hxA, hxB] + simp [hC, hxA, hxB] + · have hC : x ∈ C := by + apply (binaryAffineFlatIndicator_apply_eq_one_iff C x).mp + rw [hindicator, Pi.add_apply] + simp [binaryAffineFlatIndicator, hxA, hxB] + simp [hC, hxA, hxB] + · have hC : x ∉ C := by + intro hxC + have hCOne := + (binaryAffineFlatIndicator_apply_eq_one_iff C x).2 hxC + rw [hindicator, Pi.add_apply] at hCOne + simp [binaryAffineFlatIndicator, hxA, hxB] at hCOne + simp [hC, hxA, hxB] + +/-- A linear subspace contained in the union of two linear subspaces is +contained in one of them. -/ +theorem submodule_le_left_or_right_of_subset_union + (A B C : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) + (hsubset : ∀ x ∈ A, x ∈ B ∨ x ∈ C) : + A ≤ B ∨ A ≤ C := by + by_contra hneither + have hnotAB : ¬ A ≤ B := fun hAB ↦ hneither (Or.inl hAB) + have hnotAC : ¬ A ≤ C := fun hAC ↦ hneither (Or.inr hAC) + obtain ⟨x, hxA, hxB⟩ := SetLike.not_le_iff_exists.mp hnotAB + obtain ⟨y, hyA, hyC⟩ := SetLike.not_le_iff_exists.mp hnotAC + have hxC : x ∈ C := (hsubset x hxA).resolve_left hxB + have hyB : y ∈ B := (hsubset y hyA).resolve_right hyC + have hxyA : x + y ∈ A := A.add_mem hxA hyA + rcases hsubset (x + y) hxyA with hxyB | hxyC + · apply hxB + have hsub := B.sub_mem hxyB hyB + simpa only [add_sub_cancel_right] using hsub + · apply hyC + have hsub := C.sub_mem hxyC hxC + simpa only [add_sub_cancel_left] using hsub + +/-- Equal unions of two distinct equidimensional linear subspaces determine +the same unordered pair. -/ +theorem unordered_submodule_pair_eq_of_union_eq + (A B C D : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) + (hrankAC : Module.finrank FABL.𝔽₂ A = Module.finrank FABL.𝔽₂ C) + (hrankAD : Module.finrank FABL.𝔽₂ A = Module.finrank FABL.𝔽₂ D) + (hrankBC : Module.finrank FABL.𝔽₂ B = Module.finrank FABL.𝔽₂ C) + (hrankBD : Module.finrank FABL.𝔽₂ B = Module.finrank FABL.𝔽₂ D) + (hneAB : A ≠ B) + (hunion : ∀ x, x ∈ A ∨ x ∈ B ↔ x ∈ C ∨ x ∈ D) : + (A = C ∧ B = D) ∨ (A = D ∧ B = C) := by + have hAle : A ≤ C ∨ A ≤ D := + submodule_le_left_or_right_of_subset_union A C D + (fun x hx ↦ (hunion x).mp (Or.inl hx)) + rcases hAle with hAC | hAD + · left + have hACeq : A = C := + Submodule.eq_of_le_of_finrank_eq hAC hrankAC + have hBle : B ≤ C ∨ B ≤ D := + submodule_le_left_or_right_of_subset_union B C D + (fun x hx ↦ (hunion x).mp (Or.inr hx)) + have hBD : B ≤ D := hBle.resolve_left (fun hBC ↦ by + apply hneAB + exact hACeq.trans + (Submodule.eq_of_le_of_finrank_eq hBC hrankBC).symm) + exact ⟨hACeq, Submodule.eq_of_le_of_finrank_eq hBD hrankBD⟩ + · right + have hADeq : A = D := + Submodule.eq_of_le_of_finrank_eq hAD hrankAD + have hBle : B ≤ C ∨ B ≤ D := + submodule_le_left_or_right_of_subset_union B C D + (fun x hx ↦ (hunion x).mp (Or.inr hx)) + have hBC : B ≤ C := hBle.resolve_right (fun hBD ↦ by + apply hneAB + exact hADeq.trans + (Submodule.eq_of_le_of_finrank_eq hBD hrankBD).symm) + exact ⟨hADeq, Submodule.eq_of_le_of_finrank_eq hBC hrankBC⟩ + +/-- Characters turn a binary disjoint-support sum into multiplication. -/ +theorem binaryAffineFlatCharacter_eq_mul_of_indicator_eq_add + (f : BooleanFunction n) + (A B C : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) + (hindicator : binaryAffineFlatIndicator C = + binaryAffineFlatIndicator A + binaryAffineFlatIndicator B) : + binaryAffineFlatCharacter f C = + binaryAffineFlatCharacter f A * binaryAffineFlatCharacter f B := by + rw [binaryAffineFlatCharacter, hindicator, map_add, AddChar.map_add_eq_mul] + rfl + +/-- Every affine-flat character has square one. -/ +@[simp] theorem sq_binaryAffineFlatCharacter + (f : BooleanFunction n) + (A : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) : + binaryAffineFlatCharacter f A ^ 2 = 1 := by + unfold binaryAffineFlatCharacter + by_cases hzero : booleanFunctionPairing n f + (binaryAffineFlatIndicator A) = 0 + · rw [hzero] + norm_num + · have hone : booleanFunctionPairing n f + (binaryAffineFlatIndicator A) = 1 := Fin.eq_one_of_ne_zero _ hzero + rw [hone] + rw [FABL.binarySign_one] + norm_num + +theorem binaryAffineFlatCharacter_eq_one_or_neg_one + (f : BooleanFunction n) + (A : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) : + binaryAffineFlatCharacter f A = 1 ∨ + binaryAffineFlatCharacter f A = -1 := by + unfold binaryAffineFlatCharacter + by_cases hzero : booleanFunctionPairing n f + (binaryAffineFlatIndicator A) = 0 + · left + rw [hzero] + exact AddChar.map_zero_eq_one FABL.binarySign + · right + have hone : booleanFunctionPairing n f + (binaryAffineFlatIndicator A) = 1 := Fin.eq_one_of_ne_zero _ hzero + rw [hone, FABL.binarySign_one] + +theorem neg_one_le_binaryAffineFlatCharacter + (f : BooleanFunction n) + (A : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) : + -1 ≤ binaryAffineFlatCharacter f A := by + rcases binaryAffineFlatCharacter_eq_one_or_neg_one f A with h | h + · rw [h] + norm_num + · rw [h] + +theorem binaryAffineFlatCharacter_le_one + (f : BooleanFunction n) + (A : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) : + binaryAffineFlatCharacter f A ≤ 1 := by + rcases binaryAffineFlatCharacter_eq_one_or_neg_one f A with h | h + · rw [h] + · rw [h] + norm_num + +theorem binaryAffineCosetCharacter_mul_le_one + (f : BooleanFunction n) (u : FABL.F₂Cube n) + (H K : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) : + binaryAffineCosetCharacter f u H * + binaryAffineCosetCharacter f u K ≤ 1 := by + rcases binaryAffineFlatCharacter_eq_one_or_neg_one f + (FABL.binaryAffineSubspace H u) with hH | hH <;> + rcases binaryAffineFlatCharacter_eq_one_or_neg_one f + (FABL.binaryAffineSubspace K u) with hK | hK <;> + simp only [binaryAffineCosetCharacter, hH, hK] <;> norm_num + +end CryptBoolean diff --git a/CryptBoolean/Carlet/Chapter04/HigherOrderNonlinearity.lean b/CryptBoolean/Carlet/Chapter04/HigherOrderNonlinearity.lean new file mode 100644 index 0000000..ebada0a --- /dev/null +++ b/CryptBoolean/Carlet/Chapter04/HigherOrderNonlinearity.lean @@ -0,0 +1,347 @@ +/- +Copyright (c) 2026 Asher Yan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Asher Yan with Codex +-/ +module + +public import CryptBoolean.Carlet.Chapter04.Nonlinearity +public import CryptBoolean.Carlet.Chapter02.Derivatives +public import CryptBoolean.Carlet.Chapter03.ReedMuller + +/-! +# Carlet Chapter 4 higher-order nonlinearity + +Distance to Reed--Muller codes and both recursive lower bounds in Carlet +Proposition 13. +-/ + +open Finset +open scoped BigOperators BooleanCube + +@[expose] public section + +namespace CryptBoolean + +variable {n : ℕ} + +/-- The order-`r` nonlinearity is the minimum raw Hamming distance to `R(r,n)`. -/ +noncomputable def higherOrderNonlinearity + (r : ℕ) (f : BooleanFunction n) : ℕ := + letI : Fintype (reedMuller r n) := Fintype.ofFinite (reedMuller r n) + (Finset.univ : Finset (reedMuller r n)).inf' + Finset.univ_nonempty fun g ↦ hammingDistance f g.1 + +/-- Ordinary nonlinearity is first-order Reed--Muller distance. -/ +theorem nonlinearity_eq_higherOrderNonlinearity_one + (f : BooleanFunction n) : + nonlinearity f = higherOrderNonlinearity 1 f := by + classical + letI : Fintype (reedMuller 1 n) := Fintype.ofFinite (reedMuller 1 n) + unfold nonlinearity higherOrderNonlinearity + apply le_antisymm + · apply Finset.le_inf' + intro g _hg + obtain ⟨b, a, hga⟩ := + FABL.exists_affineFunction_of_functionAlgebraicDegree_le_one g.1 g.2 + have hle := Finset.inf'_le + (fun p : FABL.𝔽₂ × FABL.F₂Cube n ↦ + hammingDistance f (FABL.affineFunction p.1 p.2)) + (Finset.mem_univ (b, a)) + simpa [hga] using hle + · apply Finset.le_inf' + intro p _hp + let g : reedMuller 1 n := + ⟨FABL.affineFunction p.1 p.2, + affineFunction_mem_reedMuller_one p.1 p.2⟩ + have hle := Finset.inf'_le + (fun g : reedMuller 1 n ↦ hammingDistance f g.1) + (Finset.mem_univ g) + exact hle + +/-- Translating the input preserves Hamming weight. -/ +theorem hammingWeight_translate + (f : BooleanFunction n) (a : FABL.F₂Cube n) : + hammingWeight (fun x ↦ f (x + a)) = hammingWeight f := by + classical + rw [hammingWeight_eq_card_support, hammingWeight_eq_card_support] + change + (Finset.univ.filter fun x : FABL.F₂Cube n ↦ f (x + a) = 1).card = + (Finset.univ.filter fun x : FABL.F₂Cube n ↦ f x = 1).card + rw [Finset.card_filter, Finset.card_filter] + change + (∑ x, if f (x + a) = 1 then (1 : ℕ) else 0) = + ∑ x, if f x = 1 then (1 : ℕ) else 0 + exact Equiv.sum_comp (Equiv.addRight a) + (fun x ↦ if f x = 1 then (1 : ℕ) else 0) + +/-- The weight of a directional derivative is at most twice the original weight. -/ +theorem hammingWeight_booleanDerivative_le_two_mul + (f : BooleanFunction n) (a : FABL.F₂Cube n) : + hammingWeight (FABL.booleanDerivative f a) ≤ 2 * hammingWeight f := by + have htriangle := hammingDist_triangle_left f (fun x ↦ f (x + a)) 0 + rw [hammingDist_zero_left] at htriangle + change hammingDistance f (fun x ↦ f (x + a)) ≤ + hammingWeight f + hammingWeight (fun x ↦ f (x + a)) at htriangle + rw [hammingWeight_translate] at htriangle + rw [hammingDistance_eq_hammingWeight_add] at htriangle + have hderivative : + f + (fun x ↦ f (x + a)) = FABL.booleanDerivative f a := rfl + rw [hderivative] at htriangle + simpa [two_mul] using htriangle + +/-- Directional differentiation distributes over pointwise addition. -/ +theorem booleanDerivative_add + (f g : BooleanFunction n) (a : FABL.F₂Cube n) : + FABL.booleanDerivative (f + g) a = + FABL.booleanDerivative f a + FABL.booleanDerivative g a := by + funext x + simp only [FABL.booleanDerivative, Pi.add_apply] + abel + +/-- Distance to `R(r,n)` is bounded by the distance to each of its codewords. -/ +theorem higherOrderNonlinearity_le_hammingDistance + (r : ℕ) (f g : BooleanFunction n) (hg : g ∈ reedMuller r n) : + higherOrderNonlinearity r f ≤ hammingDistance f g := by + classical + letI : Fintype (reedMuller r n) := Fintype.ofFinite (reedMuller r n) + exact Finset.inf'_le + (fun h : reedMuller r n ↦ hammingDistance f h.1) + (Finset.mem_univ ⟨g, hg⟩) + +/-- The finite Reed--Muller code contains a closest codeword. -/ +theorem exists_reedMuller_hammingDistance_eq_higherOrderNonlinearity + (r : ℕ) (f : BooleanFunction n) : + ∃ g : BooleanFunction n, g ∈ reedMuller r n ∧ + hammingDistance f g = higherOrderNonlinearity r f := by + classical + letI : Fintype (reedMuller r n) := Fintype.ofFinite (reedMuller r n) + obtain ⟨g, _hg, hmin⟩ := Finset.exists_mem_eq_inf' + (s := (Finset.univ : Finset (reedMuller r n))) + Finset.univ_nonempty (fun h ↦ hammingDistance f h.1) + exact ⟨g.1, g.2, hmin.symm⟩ + +/-- Every derivative's order-`r-1` nonlinearity is at most twice the +order-`r` nonlinearity of the original function. -/ +theorem derivative_higherOrderNonlinearity_le_two_mul + (r : ℕ) (f : BooleanFunction n) (a : FABL.F₂Cube n) : + higherOrderNonlinearity (r - 1) (FABL.booleanDerivative f a) ≤ + 2 * higherOrderNonlinearity r f := by + obtain ⟨g, hg, hfg⟩ := + exists_reedMuller_hammingDistance_eq_higherOrderNonlinearity r f + have hdegreeDerivative : + FABL.functionAlgebraicDegree (FABL.booleanDerivative g a) ≤ r - 1 := + (FABL.functionAlgebraicDegree_booleanDerivative_le g a).trans + (Nat.sub_le_sub_right hg 1) + calc + higherOrderNonlinearity (r - 1) (FABL.booleanDerivative f a) ≤ + hammingDistance (FABL.booleanDerivative f a) + (FABL.booleanDerivative g a) := + higherOrderNonlinearity_le_hammingDistance + (r - 1) (FABL.booleanDerivative f a) (FABL.booleanDerivative g a) + hdegreeDerivative + _ = hammingWeight + (FABL.booleanDerivative f a + FABL.booleanDerivative g a) := + hammingDistance_eq_hammingWeight_add _ _ + _ = hammingWeight (FABL.booleanDerivative (f + g) a) := by + rw [booleanDerivative_add] + _ ≤ 2 * hammingWeight (f + g) := + hammingWeight_booleanDerivative_le_two_mul (f + g) a + _ = 2 * higherOrderNonlinearity r f := by + rw [← hammingDistance_eq_hammingWeight_add, hfg] + +/-- The largest lower-order nonlinearity among all directional derivatives. -/ +noncomputable def maxDerivativeHigherOrderNonlinearity + (r : ℕ) (f : BooleanFunction n) : ℕ := + (Finset.univ : Finset (FABL.F₂Cube n)).sup' + Finset.univ_nonempty fun a ↦ + higherOrderNonlinearity (r - 1) (FABL.booleanDerivative f a) + +/-- Division-free form of the first bound in Carlet Proposition 13. -/ +theorem maxDerivativeHigherOrderNonlinearity_le_two_mul + (r : ℕ) (f : BooleanFunction n) : + maxDerivativeHigherOrderNonlinearity r f ≤ + 2 * higherOrderNonlinearity r f := by + classical + rw [maxDerivativeHigherOrderNonlinearity] + apply Finset.sup'_le + intro a _ha + exact derivative_higherOrderNonlinearity_le_two_mul r f a + +/-- First recursive lower bound in Carlet Proposition 13. -/ +theorem proposition_13_first_bound + (r : ℕ) (f : BooleanFunction n) : + (maxDerivativeHigherOrderNonlinearity r f : ℝ) / 2 ≤ + (higherOrderNonlinearity r f : ℝ) := by + have hcast : + (maxDerivativeHigherOrderNonlinearity r f : ℝ) ≤ + 2 * (higherOrderNonlinearity r f : ℝ) := by + exact_mod_cast maxDerivativeHigherOrderNonlinearity_le_two_mul r f + linarith + +/-- Increasing the Reed--Muller order can only decrease the distance to the code. -/ +theorem higherOrderNonlinearity_antitone + {r s : ℕ} (hrs : r ≤ s) (f : BooleanFunction n) : + higherOrderNonlinearity s f ≤ higherOrderNonlinearity r f := by + obtain ⟨g, hg, hfg⟩ := + exists_reedMuller_hammingDistance_eq_higherOrderNonlinearity r f + exact (higherOrderNonlinearity_le_hammingDistance s f g + (reedMuller_mono hrs hg)).trans_eq hfg + +/-- For positive order, twice the distance to `R(r,n)` is at most the cube size. -/ +theorem two_mul_higherOrderNonlinearity_le_two_pow + (r : ℕ) (hr : 1 ≤ r) (f : BooleanFunction n) : + 2 * higherOrderNonlinearity r f ≤ 2 ^ n := by + calc + 2 * higherOrderNonlinearity r f ≤ + 2 * higherOrderNonlinearity 1 f := + Nat.mul_le_mul_left 2 (higherOrderNonlinearity_antitone hr f) + _ = 2 * nonlinearity f := by + rw [nonlinearity_eq_higherOrderNonlinearity_one] + _ ≤ 2 ^ n := by + have hrelation := two_mul_nonlinearity_add_maxWalshMagnitude f + omega + +/-- Autocorrelation is the zero-frequency Walsh value of the derivative. -/ +theorem autocorrelation_eq_walshTransform_booleanDerivative_zero + (f : BooleanFunction n) (a : FABL.F₂Cube n) : + autocorrelation f a = + (walshTransform (FABL.booleanDerivative f a) 0 : ℝ) := by + rw [autocorrelation, walshTransform_cast_eq_sum_realSignView_mul_character] + simp + +/-- Autocorrelation is cube size minus twice the derivative weight. -/ +theorem autocorrelation_eq_two_pow_sub_two_derivative_weight + (f : BooleanFunction n) (a : FABL.F₂Cube n) : + autocorrelation f a = + (2 ^ n : ℝ) - 2 * hammingWeight (FABL.booleanDerivative f a) := by + rw [autocorrelation_eq_walshTransform_booleanDerivative_zero, + walshTransform_zero_eq_two_pow_sub_two_weight] + push_cast + ring + +/-- The derivative of an order-`r` approximant bounds autocorrelation by the +derivative's order-`r-1` nonlinearity. -/ +theorem autocorrelation_le_two_pow_sub_two_higherOrderNonlinearity + (r : ℕ) (f g : BooleanFunction n) (hg : g ∈ reedMuller r n) + (a : FABL.F₂Cube n) : + autocorrelation (f + g) a ≤ + (2 ^ n : ℝ) - + 2 * higherOrderNonlinearity (r - 1) (FABL.booleanDerivative f a) := by + have hdegreeDerivative : + FABL.functionAlgebraicDegree (FABL.booleanDerivative g a) ≤ r - 1 := + (FABL.functionAlgebraicDegree_booleanDerivative_le g a).trans + (Nat.sub_le_sub_right hg 1) + have hnl := higherOrderNonlinearity_le_hammingDistance + (r - 1) (FABL.booleanDerivative f a) (FABL.booleanDerivative g a) + hdegreeDerivative + have hweight : + higherOrderNonlinearity (r - 1) (FABL.booleanDerivative f a) ≤ + hammingWeight (FABL.booleanDerivative (f + g) a) := by + calc + higherOrderNonlinearity (r - 1) (FABL.booleanDerivative f a) ≤ + hammingDistance (FABL.booleanDerivative f a) + (FABL.booleanDerivative g a) := hnl + _ = hammingWeight + (FABL.booleanDerivative f a + FABL.booleanDerivative g a) := + hammingDistance_eq_hammingWeight_add _ _ + _ = hammingWeight (FABL.booleanDerivative (f + g) a) := by + rw [booleanDerivative_add] + rw [autocorrelation_eq_two_pow_sub_two_derivative_weight] + have hweightReal : + (higherOrderNonlinearity (r - 1) (FABL.booleanDerivative f a) : ℝ) ≤ + (hammingWeight (FABL.booleanDerivative (f + g) a) : ℝ) := by + exact_mod_cast hweight + linarith + +/-- The sum of lower-order nonlinearities of all directional derivatives. -/ +noncomputable def derivativeHigherOrderNonlinearitySum + (r : ℕ) (f : BooleanFunction n) : ℕ := + ∑ a : FABL.F₂Cube n, + higherOrderNonlinearity (r - 1) (FABL.booleanDerivative f a) + +/-- Squared-correlation form underlying the second bound in Carlet Proposition 13. -/ +theorem higherOrderNonlinearity_gap_sq_le + (r : ℕ) (f : BooleanFunction n) : + ((2 ^ n : ℝ) - 2 * higherOrderNonlinearity r f) ^ 2 ≤ + (2 ^ n : ℝ) ^ 2 - + 2 * derivativeHigherOrderNonlinearitySum r f := by + obtain ⟨g, hg, hfg⟩ := + exists_reedMuller_hammingDistance_eq_higherOrderNonlinearity r f + have hsum : + (∑ a : FABL.F₂Cube n, autocorrelation (f + g) a) ≤ + ∑ a : FABL.F₂Cube n, + ((2 ^ n : ℝ) - + 2 * higherOrderNonlinearity (r - 1) + (FABL.booleanDerivative f a)) := by + apply Finset.sum_le_sum + intro a _ha + exact autocorrelation_le_two_pow_sub_two_higherOrderNonlinearity + r f g hg a + have hwalsh : + (walshTransform (f + g) 0 : ℝ) = + (2 ^ n : ℝ) - 2 * higherOrderNonlinearity r f := by + rw [walshTransform_zero_eq_two_pow_sub_two_weight] + push_cast + rw [← hammingDistance_eq_hammingWeight_add, hfg] + calc + ((2 ^ n : ℝ) - 2 * higherOrderNonlinearity r f) ^ 2 = + (walshTransform (f + g) 0 : ℝ) ^ 2 := by rw [hwalsh] + _ = ∑ a : FABL.F₂Cube n, autocorrelation (f + g) a := by + rw [sum_autocorrelation_eq_walshTransform_zero_sq] + _ ≤ ∑ a : FABL.F₂Cube n, + ((2 ^ n : ℝ) - + 2 * higherOrderNonlinearity (r - 1) + (FABL.booleanDerivative f a)) := hsum + _ = (2 ^ n : ℝ) ^ 2 - + 2 * derivativeHigherOrderNonlinearitySum r f := by + rw [Finset.sum_sub_distrib, Finset.sum_const, Finset.card_univ, + card_f₂Cube, nsmul_eq_mul, ← Finset.mul_sum] + rw [derivativeHigherOrderNonlinearitySum, Nat.cast_sum] + push_cast + ring + +/-- Second recursive lower bound in Carlet Proposition 13. -/ +theorem proposition_13_second_bound + (r : ℕ) (hr : 1 ≤ r) (f : BooleanFunction n) : + (2 ^ n : ℝ) / 2 - + Real.sqrt ((2 ^ n : ℝ) ^ 2 - + 2 * derivativeHigherOrderNonlinearitySum r f) / 2 ≤ + (higherOrderNonlinearity r f : ℝ) := by + have hgap : + 0 ≤ (2 ^ n : ℝ) - 2 * higherOrderNonlinearity r f := by + have hcardReal : + 2 * (higherOrderNonlinearity r f : ℝ) ≤ (2 ^ n : ℝ) := by + exact_mod_cast two_mul_higherOrderNonlinearity_le_two_pow r hr f + linarith + have hsq := higherOrderNonlinearity_gap_sq_le r f + have hradicand : + 0 ≤ (2 ^ n : ℝ) ^ 2 - + 2 * derivativeHigherOrderNonlinearitySum r f := + (sq_nonneg ((2 ^ n : ℝ) - + 2 * higherOrderNonlinearity r f)).trans hsq + have hsqrt : + (2 ^ n : ℝ) - 2 * higherOrderNonlinearity r f ≤ + Real.sqrt ((2 ^ n : ℝ) ^ 2 - + 2 * derivativeHigherOrderNonlinearitySum r f) := + (Real.le_sqrt hgap hradicand).mpr hsq + linarith + +/-- Carlet Proposition 13 in the source's `2^(n-1)` and `2^(2n)` notation. -/ +theorem proposition_13_second_bound_source_form + (r : ℕ) (hr : 1 ≤ r) (hrn : r < n) (f : BooleanFunction n) : + (2 : ℝ) ^ (n - 1) - + Real.sqrt ((2 : ℝ) ^ (2 * n) - + 2 * derivativeHigherOrderNonlinearitySum r f) / 2 ≤ + (higherOrderNonlinearity r f : ℝ) := by + have hn : n ≠ 0 := by omega + have hhalf : (2 ^ n : ℝ) / 2 = (2 : ℝ) ^ (n - 1) := by + obtain ⟨k, rfl⟩ := Nat.exists_eq_succ_of_ne_zero hn + simp [pow_succ] + have hsquare : (2 ^ n : ℝ) ^ 2 = (2 : ℝ) ^ (2 * n) := by + calc + (2 ^ n : ℝ) ^ 2 = (2 : ℝ) ^ (n * 2) := (pow_mul 2 n 2).symm + _ = (2 : ℝ) ^ (2 * n) := by rw [Nat.mul_comm n 2] + simpa [hhalf, hsquare] using proposition_13_second_bound r hr f + +end CryptBoolean diff --git a/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwo.lean b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwo.lean new file mode 100644 index 0000000..04d1c4c --- /dev/null +++ b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwo.lean @@ -0,0 +1,1034 @@ +/- +Copyright (c) 2026 Asher Yan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Asher Yan with Codex +-/ +module + +public import CryptBoolean.Carlet.Chapter04.HigherOrderGeneralBounds +public import CryptBoolean.Carlet.Chapter02.Fourier +public import CryptBoolean.Carlet.Chapter03.ReedMullerDuality +public import FABL.Chapter05.KrawtchoukPolynomials + +/-! +# Carlet--Mesnager's second-order power-sum bridge + +The finite moment argument reducing the covering radius of `RM(2,n)` to a +uniform lower bound for consecutive correlation power sums. +-/ + +open Finset +open scoped BigOperators BooleanCube + +@[expose] public section + +namespace CryptBoolean + +variable {n m : ℕ} + +/-- The raw correlation of `f` with a Reed--Muller approximant `g`. -/ +def orderTwoCorrelation + (f g : BooleanFunction n) : ℝ := + (walshTransform (f + g) 0 : ℝ) + +/-- Raw correlation is cube size minus twice Hamming distance. -/ +theorem orderTwoCorrelation_eq_two_pow_sub_two_hammingDistance + (f g : BooleanFunction n) : + orderTwoCorrelation f g = + (2 ^ n : ℝ) - 2 * hammingDistance f g := by + rw [orderTwoCorrelation, walshTransform_zero_eq_two_pow_sub_two_weight, + hammingDistance_eq_hammingWeight_add] + push_cast + ring + +/-- Carlet--Mesnager's `A₂(f)`, expressed through the exact distance-- +correlation relation. -/ +noncomputable def maximumOrderTwoCorrelation + (f : BooleanFunction n) : ℝ := + (2 ^ n : ℝ) - 2 * higherOrderNonlinearity 2 f + +/-- The definition of `A₂(f)` is the complement of twice the second-order +nonlinearity. -/ +theorem maximumOrderTwoCorrelation_eq + (f : BooleanFunction n) : + maximumOrderTwoCorrelation f = + (2 ^ n : ℝ) - 2 * higherOrderNonlinearity 2 f := by + rfl + +/-- Every second-order Reed--Muller correlation is at most `A₂(f)`. -/ +theorem orderTwoCorrelation_le_maximum + (f g : BooleanFunction n) (hg : g ∈ reedMuller 2 n) : + orderTwoCorrelation f g ≤ maximumOrderTwoCorrelation f := by + rw [orderTwoCorrelation_eq_two_pow_sub_two_hammingDistance, + maximumOrderTwoCorrelation_eq] + have hdistance : + (higherOrderNonlinearity 2 f : ℝ) ≤ + (hammingDistance f g : ℝ) := by + exact_mod_cast higherOrderNonlinearity_le_hammingDistance 2 f g hg + linarith + +/-- A closest second-order Reed--Muller word attains `A₂(f)`. -/ +theorem exists_orderTwoCorrelation_eq_maximum + (f : BooleanFunction n) : + ∃ g : BooleanFunction n, g ∈ reedMuller 2 n ∧ + orderTwoCorrelation f g = maximumOrderTwoCorrelation f := by + obtain ⟨g, hg, hdistance⟩ := + exists_reedMuller_hammingDistance_eq_higherOrderNonlinearity 2 f + refine ⟨g, hg, ?_⟩ + rw [orderTwoCorrelation_eq_two_pow_sub_two_hammingDistance, + maximumOrderTwoCorrelation_eq, hdistance] + +/-- The maximum second-order correlation is nonnegative. -/ +theorem maximumOrderTwoCorrelation_nonneg + (f : BooleanFunction n) : + 0 ≤ maximumOrderTwoCorrelation f := by + rw [maximumOrderTwoCorrelation_eq] + have hbound := two_mul_higherOrderNonlinearity_le_two_pow 2 (by omega) f + have hboundReal : + 2 * (higherOrderNonlinearity 2 f : ℝ) ≤ (2 ^ n : ℝ) := by + exact_mod_cast hbound + linarith + +private theorem orderTwoCorrelation_add_one + (f g : BooleanFunction n) : + orderTwoCorrelation f (g + 1) = -orderTwoCorrelation f g := by + classical + have hbit (b : FABL.𝔽₂) : bitSignInt (b + 1) = -bitSignInt b := by + rw [bitSignInt, bitSignInt, FABL.signEncode_add, FABL.signEncode_one] + norm_num + unfold orderTwoCorrelation + norm_cast + unfold walshTransform + rw [← Finset.sum_neg_distrib] + apply Finset.sum_congr rfl + intro x _hx + rw [walshTerm_zero, walshTerm_zero] + simp only [Pi.add_apply, Pi.one_apply] + rw [show f x + (g x + 1) = (f x + g x) + 1 by abel] + exact hbit (f x + g x) + +/-- Every second-order correlation has absolute value at most `A₂(f)`. -/ +theorem abs_orderTwoCorrelation_le_maximum + (f g : BooleanFunction n) (hg : g ∈ reedMuller 2 n) : + |orderTwoCorrelation f g| ≤ maximumOrderTwoCorrelation f := by + have hupper := orderTwoCorrelation_le_maximum f g hg + have hone : (1 : BooleanFunction n) ∈ reedMuller 2 n := by + rw [mem_reedMuller_iff] + simp + have hcomplement : g + 1 ∈ reedMuller 2 n := + (reedMuller 2 n).add_mem hg hone + have hlower' : + orderTwoCorrelation f (g + 1) ≤ maximumOrderTwoCorrelation f := by + exact orderTwoCorrelation_le_maximum f (g + 1) hcomplement + rw [orderTwoCorrelation_add_one] at hlower' + rw [abs_le] + constructor <;> linarith + +/-- The even `2k`-th correlation power sum over `RM(2,n)`. -/ +noncomputable def orderTwoCorrelationPowerSum + (k : ℕ) (f : BooleanFunction n) : ℝ := + letI : Fintype (reedMuller 2 n) := Fintype.ofFinite (reedMuller 2 n) + ∑ g : reedMuller 2 n, (orderTwoCorrelation f g.1) ^ (2 * k) + +private theorem evenPower_nonneg (x : ℝ) (k : ℕ) : + 0 ≤ x ^ (2 * k) := by + rw [show 2 * k = k * 2 by omega, pow_mul] + exact sq_nonneg (x ^ k) + +/-- Correlation power sums are nonnegative. -/ +theorem orderTwoCorrelationPowerSum_nonneg + (k : ℕ) (f : BooleanFunction n) : + 0 ≤ orderTwoCorrelationPowerSum k f := by + classical + rw [orderTwoCorrelationPowerSum] + exact Finset.sum_nonneg fun g _hg ↦ evenPower_nonneg _ _ + +private theorem exists_walshTransform_ne_zero + (f : BooleanFunction n) : + ∃ a : FABL.F₂Cube n, walshTransform f a ≠ 0 := by + by_contra h + push Not at h + have hsum : ∑ a : FABL.F₂Cube n, (walshTransform f a : ℝ) ^ 2 = 0 := by + simp [h] + have hparseval := sum_walshTransform_sq_eq_two_pow_sq f + rw [hsum] at hparseval + have hpow : (0 : ℝ) < (2 : ℝ) ^ n := by positivity + nlinarith + +private theorem orderTwoCorrelation_affine_zero + (f : BooleanFunction n) (a : FABL.F₂Cube n) : + orderTwoCorrelation f (FABL.affineFunction 0 a) = + walshTransform f a := by + classical + unfold orderTwoCorrelation walshTransform walshTerm + push_cast + apply Finset.sum_congr rfl + intro x _hx + simp [FABL.affineFunction, FABL.f₂DotProduct, dotProduct] + +/-- Every correlation power sum has a nonzero affine-correlation summand. -/ +theorem orderTwoCorrelationPowerSum_pos + (k : ℕ) (f : BooleanFunction n) : + 0 < orderTwoCorrelationPowerSum k f := by + classical + letI : Fintype (reedMuller 2 n) := Fintype.ofFinite (reedMuller 2 n) + obtain ⟨a, ha⟩ := exists_walshTransform_ne_zero f + let g : reedMuller 2 n := + ⟨FABL.affineFunction 0 a, + reedMuller_mono (by omega : 1 ≤ 2) + (affineFunction_mem_reedMuller_one 0 a)⟩ + have hg : orderTwoCorrelation f g.1 ≠ 0 := by + change orderTwoCorrelation f (FABL.affineFunction 0 a) ≠ 0 + rw [orderTwoCorrelation_affine_zero] + exact_mod_cast ha + have hterm : 0 < (orderTwoCorrelation f g.1) ^ (2 * k) := by + rw [show 2 * k = k * 2 by omega, pow_mul] + exact sq_pos_of_ne_zero (pow_ne_zero k hg) + rw [orderTwoCorrelationPowerSum] + exact Finset.sum_pos' + (fun h _hh ↦ evenPower_nonneg _ _) + ⟨g, Finset.mem_univ g, hterm⟩ + +/-- The consecutive power sums satisfy the finite maximum-moment inequality +used in Carlet--Mesnager Relation (9.9). -/ +theorem orderTwoCorrelationPowerSum_succ_le + (k : ℕ) (f : BooleanFunction n) : + orderTwoCorrelationPowerSum (k + 1) f ≤ + (maximumOrderTwoCorrelation f) ^ 2 * + orderTwoCorrelationPowerSum k f := by + classical + letI : Fintype (reedMuller 2 n) := Fintype.ofFinite (reedMuller 2 n) + rw [orderTwoCorrelationPowerSum, orderTwoCorrelationPowerSum, + Finset.mul_sum] + apply Finset.sum_le_sum + intro g _hg + have habs := abs_orderTwoCorrelation_le_maximum f g.1 g.2 + have hmaximum := maximumOrderTwoCorrelation_nonneg f + have hsquare : + (orderTwoCorrelation f g.1) ^ 2 ≤ + (maximumOrderTwoCorrelation f) ^ 2 := by + rw [sq_le_sq, abs_of_nonneg hmaximum] + exact habs + have hpow : 0 ≤ (orderTwoCorrelation f g.1) ^ (2 * k) := by + exact evenPower_nonneg _ _ + calc + (orderTwoCorrelation f g.1) ^ (2 * (k + 1)) = + (orderTwoCorrelation f g.1) ^ 2 * + (orderTwoCorrelation f g.1) ^ (2 * k) := by + rw [Nat.mul_succ, pow_add] + ring + _ ≤ (maximumOrderTwoCorrelation f) ^ 2 * + (orderTwoCorrelation f g.1) ^ (2 * k) := + mul_le_mul_of_nonneg_right hsquare hpow + +/-- Carlet--Mesnager Relation (9.9): the square root of a consecutive +power-sum ratio is bounded by the maximum second-order correlation. -/ +theorem sqrt_orderTwoCorrelationPowerSum_ratio_le + (k : ℕ) (f : BooleanFunction n) : + Real.sqrt + (orderTwoCorrelationPowerSum (k + 1) f / + orderTwoCorrelationPowerSum k f) ≤ + maximumOrderTwoCorrelation f := by + have hden := orderTwoCorrelationPowerSum_pos k f + have hnum := orderTwoCorrelationPowerSum_nonneg (k + 1) f + have hratio : + orderTwoCorrelationPowerSum (k + 1) f / + orderTwoCorrelationPowerSum k f ≤ + (maximumOrderTwoCorrelation f) ^ 2 := by + rw [div_le_iff₀ hden] + exact orderTwoCorrelationPowerSum_succ_le k f + have hratioNonneg : + 0 ≤ orderTwoCorrelationPowerSum (k + 1) f / + orderTwoCorrelationPowerSum k f := + div_nonneg hnum hden.le + have hsqrt := Real.sq_sqrt hratioNonneg + have hsqrtNonneg := Real.sqrt_nonneg + (orderTwoCorrelationPowerSum (k + 1) f / + orderTwoCorrelationPowerSum k f) + have hmaximum := maximumOrderTwoCorrelation_nonneg f + nlinarith + +/-- The minimum consecutive moment ratio appearing in Relation (9.10). -/ +noncomputable def minimumOrderTwoMomentRatio + (k n : ℕ) : ℝ := + (Finset.univ : Finset (BooleanFunction n)).inf' + Finset.univ_nonempty fun f ↦ + Real.sqrt + (orderTwoCorrelationPowerSum (k + 1) f / + orderTwoCorrelationPowerSum k f) + +/-- Carlet--Mesnager Relation (9.10), before inserting the low-weight +dual-code character-sum estimate. -/ +theorem maximumHigherOrderNonlinearity_two_cast_le_momentRatio + (k n : ℕ) : + (maximumHigherOrderNonlinearity 2 n : ℝ) ≤ + (2 ^ n : ℝ) / 2 - minimumOrderTwoMomentRatio k n / 2 := by + classical + obtain ⟨f, hmaximum⟩ := + exists_higherOrderNonlinearity_eq_maximum 2 n + have hratioLeMaximum := + sqrt_orderTwoCorrelationPowerSum_ratio_le k f + have hsourceRelation := maximumOrderTwoCorrelation_eq f + have hminimum : minimumOrderTwoMomentRatio k n ≤ + Real.sqrt + (orderTwoCorrelationPowerSum (k + 1) f / + orderTwoCorrelationPowerSum k f) := by + rw [minimumOrderTwoMomentRatio] + exact Finset.inf'_le _ (Finset.mem_univ f) + rw [← hmaximum] + linarith + +/-- The parity of the multiset of points in an ordered tuple, viewed as a +Boolean function. -/ +def tuplePointParity + (x : Fin m → FABL.F₂Cube n) : BooleanFunction n := + fun y ↦ ∑ i, if x i = y then 1 else 0 + +/-- Pairing with the tuple point-parity function evaluates a Boolean function +on every entry of the tuple and adds the results. -/ +theorem booleanFunctionPairing_tuplePointParity + (f : BooleanFunction n) (x : Fin m → FABL.F₂Cube n) : + booleanFunctionPairing n f (tuplePointParity x) = + ∑ i, f (x i) := by + classical + rw [booleanFunctionPairing_apply] + simp_rw [tuplePointParity, Finset.mul_sum] + rw [Finset.sum_comm] + simp + +/-- The ordered `2k`-tuples whose point-parity function belongs to the dual +Reed--Muller code occurring in Carlet--Mesnager Lemma 9.2.2. -/ +noncomputable def orderTwoAdmissibleTuples + (k n : ℕ) : Finset (Fin (2 * k) → FABL.F₂Cube n) := by + classical + exact (Finset.univ : Finset (Fin (2 * k) → FABL.F₂Cube n)).filter fun x ↦ + tuplePointParity x ∈ reedMuller (n - 3) n + +/-- The dual Reed--Muller words used to group the admissible tuples. -/ +noncomputable def orderTwoDualWords + (n : ℕ) : Finset (BooleanFunction n) := by + classical + exact (Finset.univ : Finset (BooleanFunction n)).filter fun h ↦ + h ∈ reedMuller (n - 3) n + +/-- The fiber of ordered tuples having a prescribed point-parity word. -/ +noncomputable def tuplePointParityFiber + (k : ℕ) (h : BooleanFunction n) : + Finset (Fin (2 * k) → FABL.F₂Cube n) := by + classical + exact (Finset.univ : Finset (Fin (2 * k) → FABL.F₂Cube n)).filter fun x ↦ + tuplePointParity x = h + +/-- The number of ordered tuples having a prescribed point-parity word. -/ +noncomputable def tuplePointParityMultiplicity + (k : ℕ) (h : BooleanFunction n) : ℕ := + (tuplePointParityFiber k h).card + +private def tupleRelabelEquiv + (m : ℕ) (σ : Equiv.Perm (FABL.F₂Cube n)) : + (Fin m → FABL.F₂Cube n) ≃ (Fin m → FABL.F₂Cube n) := + Equiv.piCongrRight fun _ ↦ σ + +private theorem tuplePointParity_tupleRelabelEquiv + (x : Fin m → FABL.F₂Cube n) (σ : Equiv.Perm (FABL.F₂Cube n)) : + tuplePointParity (tupleRelabelEquiv m σ x) = + tuplePointParity x ∘ σ.symm := by + classical + funext y + simp only [tuplePointParity, tupleRelabelEquiv, + Equiv.piCongrRight_apply, Function.comp_apply] + apply Finset.sum_congr rfl + intro i _hi + simp only [Pi.map_apply, σ.apply_eq_iff_eq_symm_apply] + +/-- Relabeling all cube points by a permutation preserves point-parity fiber +cardinality. -/ +theorem tuplePointParityMultiplicity_comp_perm + (k : ℕ) (h : BooleanFunction n) + (σ : Equiv.Perm (FABL.F₂Cube n)) : + tuplePointParityMultiplicity k h = + tuplePointParityMultiplicity k (h ∘ σ.symm) := by + classical + rw [tuplePointParityMultiplicity, tuplePointParityMultiplicity] + apply Finset.card_equiv (tupleRelabelEquiv (2 * k) σ) + intro x + simp only [tuplePointParityFiber, Finset.mem_filter, Finset.mem_univ, + true_and] + rw [tuplePointParity_tupleRelabelEquiv] + constructor + · intro hx + rw [hx] + · intro hx + funext y + have hy := congrFun hx (σ y) + simpa using hy + +/-- Point-parity fiber cardinality depends only on the Hamming weight of the +prescribed word. -/ +theorem tuplePointParityMultiplicity_eq_of_hammingWeight_eq + (k : ℕ) (h₁ h₂ : BooleanFunction n) + (hweight : hammingWeight h₁ = hammingWeight h₂) : + tuplePointParityMultiplicity k h₁ = + tuplePointParityMultiplicity k h₂ := by + classical + have hcard : (support h₁).card = (support h₂).card := by + rw [← hammingWeight_eq_card_support, + ← hammingWeight_eq_card_support] + exact hweight + obtain ⟨σ, hσ⟩ := + Equiv.Perm.exists_map_finset_eq (support h₁) (support h₂) hcard + have hcomp : h₁ ∘ σ.symm = h₂ := by + funext y + have hmem : σ.symm y ∈ support h₁ ↔ y ∈ support h₂ := by + rw [← hσ] + simp + have hone : h₁ (σ.symm y) = 1 ↔ h₂ y = 1 := by + simpa using hmem + by_cases hleft : h₁ (σ.symm y) = 0 + · have hright : h₂ y = 0 := by + by_contra hright + have hrightOne : h₂ y = 1 := + Fin.eq_one_of_ne_zero _ hright + have hleftOne := hone.mpr hrightOne + exact zero_ne_one (hleft.symm.trans hleftOne) + exact hleft.trans hright.symm + · have hleftOne : h₁ (σ.symm y) = 1 := + Fin.eq_one_of_ne_zero _ hleft + exact hleftOne.trans (hone.mp hleftOne).symm + rw [← hcomp] + exact tuplePointParityMultiplicity_comp_perm k h₁ σ + +/-- The common point-parity multiplicity of words of Hamming weight `w`, or +zero when no such word exists. -/ +noncomputable def tuplePointParityMultiplicityByWeight + (k n w : ℕ) : ℕ := + if hweight : ∃ h : BooleanFunction n, hammingWeight h = w then + tuplePointParityMultiplicity k (Classical.choose hweight) + else + 0 + +/-- A point-parity fiber multiplicity is its weight-indexed multiplicity. -/ +theorem tuplePointParityMultiplicity_eq_byWeight + (k : ℕ) (h : BooleanFunction n) : + tuplePointParityMultiplicity k h = + tuplePointParityMultiplicityByWeight k n (hammingWeight h) := by + classical + rw [tuplePointParityMultiplicityByWeight, + dif_pos (⟨h, rfl⟩ : ∃ g : BooleanFunction n, + hammingWeight g = hammingWeight h)] + apply tuplePointParityMultiplicity_eq_of_hammingWeight_eq + exact (Classical.choose_spec + (⟨h, rfl⟩ : ∃ g : BooleanFunction n, + hammingWeight g = hammingWeight h)).symm + +private noncomputable def booleanFunctionPairingCharacter + (h : BooleanFunction n) : AddChar (BooleanFunction n) ℝ := + FABL.binarySign.compAddMonoidHom + { toFun := fun g ↦ booleanFunctionPairing n g h + map_zero' := by simp + map_add' := by simp } + +private noncomputable def reedMullerPairingCharacter + (h : BooleanFunction n) : AddChar (reedMuller 2 n) ℝ := + (booleanFunctionPairingCharacter h).compAddMonoidHom + (reedMuller 2 n).subtype.toAddMonoidHom + +private theorem booleanFunctionPairingCharacter_eq_zero_iff + (h : BooleanFunction n) : + booleanFunctionPairingCharacter h = 0 ↔ h = 0 := by + classical + constructor + · intro hzero + apply (booleanFunctionPairing_nondegenerate (n := n)).2 h + intro g + have happ := DFunLike.congr_fun hzero g + change FABL.binarySign (booleanFunctionPairing n g h) = 1 at happ + exact (FABL.binarySign_eq_one_iff _).mp happ + · rintro rfl + ext g + rw [AddChar.zero_apply] + simp [booleanFunctionPairingCharacter] + +private theorem sum_booleanFunctionPairingCharacter + (h : BooleanFunction n) : + ∑ g : BooleanFunction n, + FABL.binarySign (booleanFunctionPairing n g h) = + if h = 0 then (2 : ℝ) ^ (2 ^ n) else 0 := by + classical + change (∑ g : BooleanFunction n, + booleanFunctionPairingCharacter h g) = _ + rw [AddChar.sum_eq_ite] + by_cases hh : h = 0 + · rw [if_pos ((booleanFunctionPairingCharacter_eq_zero_iff h).2 hh), + if_pos hh, + show Fintype.card (BooleanFunction n) = 2 ^ (2 ^ n) by simp] + norm_cast + · rw [if_neg (mt (booleanFunctionPairingCharacter_eq_zero_iff h).mp hh), + if_neg hh] + +private theorem sum_booleanFunctionPairingCharacter_add + (p h : BooleanFunction n) : + ∑ g : BooleanFunction n, + FABL.binarySign (booleanFunctionPairing n g (p + h)) = + if p = h then (2 : ℝ) ^ (2 ^ n) else 0 := by + rw [sum_booleanFunctionPairingCharacter] + congr 1 + rw [add_eq_zero_iff_eq_neg, ZModModule.neg_eq_self] + +/-- The character sum over `RM(2,n)` induced by pairing with `h`. -/ +noncomputable def reedMullerTwoPairingCharacterSum + (h : BooleanFunction n) : ℝ := + letI : Fintype (reedMuller 2 n) := Fintype.ofFinite (reedMuller 2 n) + ∑ g : reedMuller 2 n, + FABL.binarySign (booleanFunctionPairing n g.1 h) + +private theorem reedMullerPairingCharacter_eq_zero_iff + (h : BooleanFunction n) : + reedMullerPairingCharacter h = 0 ↔ h ∈ reedMullerDual 2 n := by + classical + constructor + · intro hzero + rw [reedMullerDual, LinearMap.BilinForm.mem_orthogonal_iff] + intro g hg + have happ := DFunLike.congr_fun hzero + (⟨g, hg⟩ : reedMuller 2 n) + change FABL.binarySign (booleanFunctionPairing n g h) = 1 at happ + exact (FABL.binarySign_eq_one_iff _).mp happ + · intro hdual + ext g + rw [AddChar.zero_apply] + apply (FABL.binarySign_eq_one_iff _).2 + rw [reedMullerDual, LinearMap.BilinForm.mem_orthogonal_iff] at hdual + exact hdual g.1 g.2 + +/-- Character orthogonality on `RM(2,n)` at a word in the dual code. -/ +theorem reedMullerTwoPairingCharacterSum_eq_card_of_mem_dual + (h : BooleanFunction n) (hdual : h ∈ reedMullerDual 2 n) : + reedMullerTwoPairingCharacterSum h = + (Nat.card (reedMuller 2 n) : ℝ) := by + classical + letI : Fintype (reedMuller 2 n) := Fintype.ofFinite (reedMuller 2 n) + rw [reedMullerTwoPairingCharacterSum] + change (∑ g : reedMuller 2 n, reedMullerPairingCharacter h g) = _ + rw [AddChar.sum_eq_ite, + if_pos ((reedMullerPairingCharacter_eq_zero_iff h).2 hdual), + Nat.card_eq_fintype_card] + +/-- Character orthogonality on `RM(2,n)` away from the dual code. -/ +theorem reedMullerTwoPairingCharacterSum_eq_zero_of_not_mem_dual + (h : BooleanFunction n) (hdual : h ∉ reedMullerDual 2 n) : + reedMullerTwoPairingCharacterSum h = 0 := by + classical + letI : Fintype (reedMuller 2 n) := Fintype.ofFinite (reedMuller 2 n) + rw [reedMullerTwoPairingCharacterSum] + change (∑ g : reedMuller 2 n, reedMullerPairingCharacter h g) = 0 + rw [AddChar.sum_eq_ite, + if_neg (mt (reedMullerPairingCharacter_eq_zero_iff h).mp hdual)] + +private theorem orderTwoCorrelation_eq_sum_realSignView + (f g : BooleanFunction n) : + orderTwoCorrelation f g = ∑ y, realSignView (f + g) y := by + rw [orderTwoCorrelation, + walshTransform_cast_eq_sum_realSignView_mul_character] + simp + +private theorem product_realSignView_eq_pairing_tuplePointParity + (f : BooleanFunction n) (x : Fin m → FABL.F₂Cube n) : + ∏ i, realSignView f (x i) = + FABL.binarySign (booleanFunctionPairing n f (tuplePointParity x)) := by + rw [booleanFunctionPairing_tuplePointParity] + simp only [realSignView, FABL.realSignEncodedFunction, + FABL.signEncodedFunction, FABL.signValue_signEncode_eq_binarySign] + symm + induction (Finset.univ : Finset (Fin m)) using Finset.induction_on with + | empty => simp + | @insert i s hi ih => + rw [Finset.sum_insert hi, Finset.prod_insert hi, + AddChar.map_add_eq_mul, ih] + +private theorem sum_realSignView_eq_two_pow_sub_two_weight + (g : BooleanFunction n) : + ∑ y, realSignView g y = + (2 ^ n : ℝ) - 2 * (hammingWeight g : ℝ) := by + calc + (∑ y, realSignView g y) = (walshTransform g 0 : ℝ) := by + symm + rw [walshTransform_cast_eq_sum_realSignView_mul_character] + simp + _ = (2 ^ n : ℝ) - 2 * (hammingWeight g : ℝ) := by + exact_mod_cast walshTransform_zero_eq_two_pow_sub_two_weight g + +private noncomputable def cubePointEquivFin + (n : ℕ) : FABL.F₂Cube n ≃ Fin (2 ^ n) := + Fintype.equivFinOfCardEq (card_f₂Cube n) + +private noncomputable def booleanFunctionVectorEquiv + (n : ℕ) : BooleanFunction n ≃ FABL.F₂Cube (2 ^ n) := + Equiv.arrowCongr (cubePointEquivFin n) (Equiv.refl FABL.𝔽₂) + +private theorem f₂Support_card_booleanFunctionVectorEquiv + (g : BooleanFunction n) : + (FABL.f₂Support (booleanFunctionVectorEquiv n g)).card = + hammingWeight g := by + classical + rw [hammingWeight_eq_card_support] + symm + apply Finset.card_equiv (cubePointEquivFin n) + intro y + rw [mem_support, FABL.mem_f₂Support] + change g y = 1 ↔ + g ((cubePointEquivFin n).symm (cubePointEquivFin n y)) ≠ 0 + rw [(cubePointEquivFin n).symm_apply_apply] + constructor + · intro hy + rw [hy] + exact one_ne_zero + · exact Fin.eq_one_of_ne_zero _ + +private theorem vectorWalshCharacter_booleanFunctionVectorEquiv + (g h : BooleanFunction n) : + FABL.vectorWalshCharacter (booleanFunctionVectorEquiv n g) + (booleanFunctionVectorEquiv n h) = + FABL.binarySign (booleanFunctionPairing n g h) := by + rw [FABL.vectorWalshCharacter_apply, booleanFunctionPairing_apply] + congr 1 + unfold FABL.f₂DotProduct dotProduct + symm + apply Fintype.sum_equiv (cubePointEquivFin n) + intro y + simp [booleanFunctionVectorEquiv, Equiv.arrowCongr, + Function.comp_apply] + +private theorem negativeCoordinateCount_binaryCubeSignEquiv + (q : ℕ) (x : FABL.F₂Cube q) : + FABL.negativeCoordinateCount (FABL.binaryCubeSignEquiv q x) = + (FABL.f₂Support x).card := by + classical + unfold FABL.negativeCoordinateCount FABL.f₂Support + congr 1 + ext i + by_cases hi : x i = 0 + · simp [hi] + · have hiOne : x i = 1 := Fin.eq_one_of_ne_zero _ hi + simp [hiOne] + +private theorem sum_vectorWalshCharacter_supportCard_eq_krawtchoukValue + (q j : ℕ) (x : FABL.F₂Cube q) : + ∑ γ ∈ (Finset.univ : Finset (FABL.F₂Cube q)).filter + (fun γ ↦ (FABL.f₂Support γ).card = j), + FABL.vectorWalshCharacter γ x = + FABL.krawtchoukValue j (FABL.binaryCubeSignEquiv q x) := by + classical + rw [Finset.sum_filter, FABL.krawtchoukValue] + calc + (∑ γ : FABL.F₂Cube q, + if (FABL.f₂Support γ).card = j then + FABL.vectorWalshCharacter γ x else 0) = + ∑ S : Finset (Fin q), + if S.card = j then + FABL.monomial S (FABL.binaryCubeSignEquiv q x) else 0 := by + apply Fintype.sum_equiv (FABL.f₂CubeEquivFinset q) + intro γ + rw [FABL.f₂CubeEquivFinset_apply] + by_cases hcard : (FABL.f₂Support γ).card = j + · rw [if_pos hcard, if_pos hcard, FABL.vectorWalshCharacter, + FABL.monomial_binaryCubeSignEquiv] + · rw [if_neg hcard, if_neg hcard] + _ = ∑ S ∈ (Finset.univ : Finset (Fin q)).powersetCard j, + FABL.monomial S (FABL.binaryCubeSignEquiv q x) := by + rw [← Finset.sum_filter] + congr 1 + ext S + simp [eq_comm] + +private theorem sum_booleanFunctionPairing_weightLayer_eq_eval_krawtchouk + (j : ℕ) (hj : j ≤ 2 ^ n) (h : BooleanFunction n) : + ∑ g ∈ (Finset.univ : Finset (BooleanFunction n)).filter + (fun g ↦ hammingWeight g = j), + FABL.binarySign (booleanFunctionPairing n g h) = + Polynomial.eval (hammingWeight h : ℝ) + (FABL.krawtchoukPolynomial (2 ^ n) j) := by + classical + calc + (∑ g ∈ (Finset.univ : Finset (BooleanFunction n)).filter + (fun g ↦ hammingWeight g = j), + FABL.binarySign (booleanFunctionPairing n g h)) = + ∑ γ ∈ (Finset.univ : Finset (FABL.F₂Cube (2 ^ n))).filter + (fun γ ↦ (FABL.f₂Support γ).card = j), + FABL.vectorWalshCharacter γ (booleanFunctionVectorEquiv n h) := by + rw [Finset.sum_filter, Finset.sum_filter] + apply Fintype.sum_equiv (booleanFunctionVectorEquiv n) + intro g + have hweight := f₂Support_card_booleanFunctionVectorEquiv g + have hcharacter := + vectorWalshCharacter_booleanFunctionVectorEquiv g h + by_cases hg : hammingWeight g = j + · rw [if_pos hg, if_pos (hweight.trans hg), hcharacter] + · rw [if_neg hg, if_neg (by rw [hweight]; exact hg)] + _ = FABL.krawtchoukValue j + (FABL.binaryCubeSignEquiv (2 ^ n) + (booleanFunctionVectorEquiv n h)) := + sum_vectorWalshCharacter_supportCard_eq_krawtchoukValue + (2 ^ n) j (booleanFunctionVectorEquiv n h) + _ = Polynomial.eval (hammingWeight h : ℝ) + (FABL.krawtchoukPolynomial (2 ^ n) j) := by + have hrepresentation := + (FABL.krawtchoukPolynomial_represents j hj + (FABL.binaryCubeSignEquiv (2 ^ n) + (booleanFunctionVectorEquiv n h))).2 + rw [negativeCoordinateCount_binaryCubeSignEquiv, + f₂Support_card_booleanFunctionVectorEquiv] at hrepresentation + exact hrepresentation.symm + +private theorem hammingWeight_le_two_pow + (g : BooleanFunction n) : hammingWeight g ≤ 2 ^ n := by + rw [← card_f₂Cube n] + exact hammingNorm_le_card_fintype + +private theorem two_pow_mul_tuplePointParityMultiplicity_eq_fourierSum + (k : ℕ) (h : BooleanFunction n) : + (2 : ℝ) ^ (2 ^ n) * (tuplePointParityMultiplicity k h : ℝ) = + ∑ g : BooleanFunction n, + FABL.binarySign (booleanFunctionPairing n g h) * + ((2 ^ n : ℝ) - 2 * (hammingWeight g : ℝ)) ^ (2 * k) := by + classical + rw [tuplePointParityMultiplicity] + calc + (2 : ℝ) ^ (2 ^ n) * ((tuplePointParityFiber k h).card : ℝ) = + ∑ x : Fin (2 * k) → FABL.F₂Cube n, + if tuplePointParity x = h then (2 : ℝ) ^ (2 ^ n) else 0 := by + rw [show ((tuplePointParityFiber k h).card : ℝ) = + ∑ _x ∈ tuplePointParityFiber k h, (1 : ℝ) by simp, + Finset.mul_sum, tuplePointParityFiber, Finset.sum_filter] + simp + _ = ∑ x : Fin (2 * k) → FABL.F₂Cube n, + ∑ g : BooleanFunction n, + FABL.binarySign + (booleanFunctionPairing n g (tuplePointParity x + h)) := by + apply Finset.sum_congr rfl + intro x _hx + exact (sum_booleanFunctionPairingCharacter_add + (tuplePointParity x) h).symm + _ = ∑ g : BooleanFunction n, + ∑ x : Fin (2 * k) → FABL.F₂Cube n, + FABL.binarySign (booleanFunctionPairing n g h) * + FABL.binarySign + (booleanFunctionPairing n g (tuplePointParity x)) := by + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro g _hg + apply Finset.sum_congr rfl + intro x _hx + have hadd := map_add (booleanFunctionPairing n g) + (tuplePointParity x) h + rw [hadd, AddChar.map_add_eq_mul, mul_comm] + _ = ∑ g : BooleanFunction n, + ∑ x : Fin (2 * k) → FABL.F₂Cube n, + FABL.binarySign (booleanFunctionPairing n g h) * + ∏ i, realSignView g (x i) := by + apply Finset.sum_congr rfl + intro g _hg + apply Finset.sum_congr rfl + intro x _hx + rw [product_realSignView_eq_pairing_tuplePointParity] + _ = ∑ g : BooleanFunction n, + FABL.binarySign (booleanFunctionPairing n g h) * + (∑ y, realSignView g y) ^ (2 * k) := by + apply Finset.sum_congr rfl + intro g _hg + rw [← Finset.mul_sum, Fintype.sum_pow] + _ = ∑ g : BooleanFunction n, + FABL.binarySign (booleanFunctionPairing n g h) * + ((2 ^ n : ℝ) - 2 * (hammingWeight g : ℝ)) ^ (2 * k) := by + apply Finset.sum_congr rfl + intro g _hg + rw [sum_realSignView_eq_two_pow_sub_two_weight] + +private theorem booleanFunctionFourierSum_eq_krawtchoukSum + (k : ℕ) (h : BooleanFunction n) : + (∑ g : BooleanFunction n, + FABL.binarySign (booleanFunctionPairing n g h) * + ((2 ^ n : ℝ) - 2 * (hammingWeight g : ℝ)) ^ (2 * k)) = + ∑ j ∈ Finset.range (2 ^ n + 1), + Polynomial.eval (hammingWeight h : ℝ) + (FABL.krawtchoukPolynomial (2 ^ n) j) * + ((2 ^ n : ℝ) - 2 * (j : ℝ)) ^ (2 * k) := by + classical + calc + (∑ g : BooleanFunction n, + FABL.binarySign (booleanFunctionPairing n g h) * + ((2 ^ n : ℝ) - 2 * (hammingWeight g : ℝ)) ^ (2 * k)) = + ∑ j ∈ Finset.range (2 ^ n + 1), + ∑ g ∈ (Finset.univ : Finset (BooleanFunction n)).filter + (fun g ↦ hammingWeight g = j), + FABL.binarySign (booleanFunctionPairing n g h) * + ((2 ^ n : ℝ) - 2 * (hammingWeight g : ℝ)) ^ (2 * k) := by + symm + apply Finset.sum_fiberwise_of_maps_to + intro g _hg + rw [Finset.mem_range] + exact Nat.lt_succ_of_le (hammingWeight_le_two_pow g) + _ = ∑ j ∈ Finset.range (2 ^ n + 1), + (∑ g ∈ (Finset.univ : Finset (BooleanFunction n)).filter + (fun g ↦ hammingWeight g = j), + FABL.binarySign (booleanFunctionPairing n g h)) * + ((2 ^ n : ℝ) - 2 * (j : ℝ)) ^ (2 * k) := by + apply Finset.sum_congr rfl + intro j _hj + calc + (∑ g ∈ (Finset.univ : Finset (BooleanFunction n)).filter + (fun g ↦ hammingWeight g = j), + FABL.binarySign (booleanFunctionPairing n g h) * + ((2 ^ n : ℝ) - 2 * (hammingWeight g : ℝ)) ^ (2 * k)) = + ∑ g ∈ (Finset.univ : Finset (BooleanFunction n)).filter + (fun g ↦ hammingWeight g = j), + FABL.binarySign (booleanFunctionPairing n g h) * + ((2 ^ n : ℝ) - 2 * (j : ℝ)) ^ (2 * k) := by + apply Finset.sum_congr rfl + intro g hg + rw [(Finset.mem_filter.mp hg).2] + _ = (∑ g ∈ (Finset.univ : Finset (BooleanFunction n)).filter + (fun g ↦ hammingWeight g = j), + FABL.binarySign (booleanFunctionPairing n g h)) * + ((2 ^ n : ℝ) - 2 * (j : ℝ)) ^ (2 * k) := by + rw [Finset.sum_mul] + _ = ∑ j ∈ Finset.range (2 ^ n + 1), + Polynomial.eval (hammingWeight h : ℝ) + (FABL.krawtchoukPolynomial (2 ^ n) j) * + ((2 ^ n : ℝ) - 2 * (j : ℝ)) ^ (2 * k) := by + apply Finset.sum_congr rfl + intro j hj + rw [sum_booleanFunctionPairing_weightLayer_eq_eval_krawtchouk + j (Nat.le_of_lt_succ (Finset.mem_range.mp hj)) h] + +/-- Mesnager HDR Lemma 9.2.7 in finite Fourier form: the ordered-tuple +multiplicity at a realizable weight is the inverse Fourier transform of the +`2k`-th powers of the one-point character sums. -/ +theorem tuplePointParityMultiplicityByWeight_eq_fourierSum + (k : ℕ) (h : BooleanFunction n) : + (tuplePointParityMultiplicityByWeight k n (hammingWeight h) : ℝ) = + (∑ g : BooleanFunction n, + FABL.binarySign (booleanFunctionPairing n g h) * + ((2 ^ n : ℝ) - 2 * (hammingWeight g : ℝ)) ^ (2 * k)) / + (2 : ℝ) ^ (2 ^ n) := by + rw [← tuplePointParityMultiplicity_eq_byWeight k h, + eq_div_iff (by positivity)] + simpa [mul_comm] using + two_pow_mul_tuplePointParityMultiplicity_eq_fourierSum k h + +/-- The finite Krawtchouk sum equal to Mesnager's exponential-generating +coefficient `[z^(2k)] sinh(z)^w cosh(z)^(2^n-w)`. Here `w` is the actual +Hamming weight, rather than Mesnager's half-weight parameter. -/ +noncomputable def tuplePointParityKrawtchoukMultiplicity + (k n w : ℕ) : ℝ := + (∑ j ∈ Finset.range (2 ^ n + 1), + Polynomial.eval (w : ℝ) + (FABL.krawtchoukPolynomial (2 ^ n) j) * + ((2 ^ n : ℝ) - 2 * (j : ℝ)) ^ (2 * k)) / + (2 : ℝ) ^ (2 ^ n) + +/-- Mesnager HDR Lemma 9.2.7 in explicit finite Krawtchouk form. -/ +theorem tuplePointParityMultiplicityByWeight_eq_krawtchoukSum + (k : ℕ) (h : BooleanFunction n) : + (tuplePointParityMultiplicityByWeight k n (hammingWeight h) : ℝ) = + tuplePointParityKrawtchoukMultiplicity k n (hammingWeight h) := by + rw [tuplePointParityMultiplicityByWeight_eq_fourierSum, + tuplePointParityKrawtchoukMultiplicity, + booleanFunctionFourierSum_eq_krawtchoukSum] + +private noncomputable def orderTwoDualTuples + (k n : ℕ) : Finset (Fin (2 * k) → FABL.F₂Cube n) := by + classical + exact (Finset.univ : Finset (Fin (2 * k) → FABL.F₂Cube n)).filter fun x ↦ + tuplePointParity x ∈ reedMullerDual 2 n + +private theorem orderTwoCorrelationPowerSum_eq_dualTupleCharacterSum + (k : ℕ) (f : BooleanFunction n) : + orderTwoCorrelationPowerSum k f = + (Nat.card (reedMuller 2 n) : ℝ) * + ∑ x ∈ orderTwoDualTuples k n, + FABL.binarySign + (booleanFunctionPairing n f (tuplePointParity x)) := by + classical + letI : Fintype (reedMuller 2 n) := Fintype.ofFinite (reedMuller 2 n) + rw [orderTwoCorrelationPowerSum] + calc + ∑ g : reedMuller 2 n, (orderTwoCorrelation f g.1) ^ (2 * k) = + ∑ g : reedMuller 2 n, + ∑ x : Fin (2 * k) → FABL.F₂Cube n, + ∏ i, realSignView (f + g.1) (x i) := by + apply Finset.sum_congr rfl + intro g _hg + rw [orderTwoCorrelation_eq_sum_realSignView, Fintype.sum_pow] + _ = ∑ x : Fin (2 * k) → FABL.F₂Cube n, + ∑ g : reedMuller 2 n, + FABL.binarySign + (booleanFunctionPairing n f (tuplePointParity x)) * + FABL.binarySign + (booleanFunctionPairing n g.1 (tuplePointParity x)) := by + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro x _hx + apply Finset.sum_congr rfl + intro g _hg + rw [product_realSignView_eq_pairing_tuplePointParity] + have hpairing : + booleanFunctionPairing n (f + g.1) (tuplePointParity x) = + booleanFunctionPairing n f (tuplePointParity x) + + booleanFunctionPairing n g.1 (tuplePointParity x) := by + have hadd := congrArg + (fun L : BooleanFunction n →ₗ[FABL.𝔽₂] FABL.𝔽₂ ↦ + L (tuplePointParity x)) + (map_add (booleanFunctionPairing n) f g.1) + exact hadd + rw [hpairing, AddChar.map_add_eq_mul] + _ = ∑ x : Fin (2 * k) → FABL.F₂Cube n, + FABL.binarySign + (booleanFunctionPairing n f (tuplePointParity x)) * + reedMullerTwoPairingCharacterSum (tuplePointParity x) := by + apply Finset.sum_congr rfl + intro x _hx + rw [← Finset.mul_sum] + rfl + _ = (Nat.card (reedMuller 2 n) : ℝ) * + ∑ x ∈ orderTwoDualTuples k n, + FABL.binarySign + (booleanFunctionPairing n f (tuplePointParity x)) := by + rw [orderTwoDualTuples, Finset.sum_filter, Finset.mul_sum] + apply Finset.sum_congr rfl + intro x _hx + by_cases hx : tuplePointParity x ∈ reedMullerDual 2 n <;> + simp [hx, + reedMullerTwoPairingCharacterSum_eq_card_of_mem_dual, + reedMullerTwoPairingCharacterSum_eq_zero_of_not_mem_dual, + mul_comm] + +/-- Carlet--Mesnager Lemma 9.2.2: the `2k`-th correlation power sum is the +cardinality of `RM(2,n)` times the character sum over the ordered tuples whose +point-parity function belongs to `RM(n-3,n)`. -/ +theorem orderTwoCorrelationPowerSum_eq_admissibleTupleCharacterSum + (k : ℕ) (f : BooleanFunction n) (hn : 3 ≤ n) : + orderTwoCorrelationPowerSum k f = + (Nat.card (reedMuller 2 n) : ℝ) * + ∑ x ∈ orderTwoAdmissibleTuples k n, + FABL.binarySign + (booleanFunctionPairing n f (tuplePointParity x)) := by + classical + rw [orderTwoCorrelationPowerSum_eq_dualTupleCharacterSum] + rw [orderTwoDualTuples, orderTwoAdmissibleTuples, + reedMullerDual_eq (r := 2) (n := n) (by omega)] + rw [show n - 2 - 1 = n - 3 by omega] + +private theorem admissibleTupleCharacterSum_eq_weightGrouped + (k : ℕ) (f : BooleanFunction n) : + (∑ x ∈ orderTwoAdmissibleTuples k n, + FABL.binarySign + (booleanFunctionPairing n f (tuplePointParity x))) = + ∑ h ∈ orderTwoDualWords n, + (tuplePointParityMultiplicityByWeight k n (hammingWeight h) : ℝ) * + FABL.binarySign (booleanFunctionPairing n f h) := by + classical + calc + (∑ x ∈ orderTwoAdmissibleTuples k n, + FABL.binarySign + (booleanFunctionPairing n f (tuplePointParity x))) = + ∑ h ∈ orderTwoDualWords n, + ∑ x ∈ (orderTwoAdmissibleTuples k n).filter + (fun x ↦ tuplePointParity x = h), + FABL.binarySign + (booleanFunctionPairing n f (tuplePointParity x)) := by + symm + apply Finset.sum_fiberwise_of_maps_to + intro x hx + simpa only [orderTwoAdmissibleTuples, orderTwoDualWords, + Finset.mem_filter, Finset.mem_univ, true_and] using hx + _ = ∑ h ∈ orderTwoDualWords n, + (tuplePointParityMultiplicityByWeight k n (hammingWeight h) : ℝ) * + FABL.binarySign (booleanFunctionPairing n f h) := by + apply Finset.sum_congr rfl + intro h hh + have hdual : h ∈ reedMuller (n - 3) n := by + simpa only [orderTwoDualWords, Finset.mem_filter, + Finset.mem_univ, true_and] using hh + have hfiber : + (orderTwoAdmissibleTuples k n).filter + (fun x ↦ tuplePointParity x = h) = + tuplePointParityFiber k h := by + ext x + simp only [orderTwoAdmissibleTuples, tuplePointParityFiber, + Finset.mem_filter, Finset.mem_univ, true_and] + constructor + · exact fun hx ↦ hx.2 + · intro hx + exact ⟨by simpa only [hx] using hdual, hx⟩ + rw [hfiber] + calc + (∑ x ∈ tuplePointParityFiber k h, + FABL.binarySign + (booleanFunctionPairing n f (tuplePointParity x))) = + ∑ _x ∈ tuplePointParityFiber k h, + FABL.binarySign (booleanFunctionPairing n f h) := by + apply Finset.sum_congr rfl + intro x hx + have hxparity : tuplePointParity x = h := by + simpa [tuplePointParityFiber] using hx + rw [hxparity] + _ = ((tuplePointParityFiber k h).card : ℝ) * + FABL.binarySign (booleanFunctionPairing n f h) := by + simp + _ = (tuplePointParityMultiplicityByWeight k n + (hammingWeight h) : ℝ) * + FABL.binarySign (booleanFunctionPairing n f h) := by + change (tuplePointParityMultiplicity k h : ℝ) * + FABL.binarySign (booleanFunctionPairing n f h) = _ + rw [tuplePointParityMultiplicity_eq_byWeight] + +/-- Carlet--Mesnager Proposition 9.2.5, first grouping layer: the correlation +power sum is grouped by dual Reed--Muller words, with a tuple multiplicity that +depends only on the word's Hamming weight. -/ +theorem orderTwoCorrelationPowerSum_eq_dualWeightGroupedCharacterSum + (k : ℕ) (f : BooleanFunction n) (hn : 3 ≤ n) : + orderTwoCorrelationPowerSum k f = + (Nat.card (reedMuller 2 n) : ℝ) * + ∑ h ∈ orderTwoDualWords n, + (tuplePointParityMultiplicityByWeight k n (hammingWeight h) : ℝ) * + FABL.binarySign (booleanFunctionPairing n f h) := by + rw [orderTwoCorrelationPowerSum_eq_admissibleTupleCharacterSum k f hn, + admissibleTupleCharacterSum_eq_weightGrouped] + +/-- Proposition 9.2.5 with each tuple multiplicity replaced by its exact finite +Fourier inversion formula. -/ +theorem orderTwoCorrelationPowerSum_eq_dualFourierMultiplicityCharacterSum + (k : ℕ) (f : BooleanFunction n) (hn : 3 ≤ n) : + orderTwoCorrelationPowerSum k f = + (Nat.card (reedMuller 2 n) : ℝ) * + ∑ h ∈ orderTwoDualWords n, + ((∑ g : BooleanFunction n, + FABL.binarySign (booleanFunctionPairing n g h) * + ((2 ^ n : ℝ) - 2 * (hammingWeight g : ℝ)) ^ (2 * k)) / + (2 : ℝ) ^ (2 ^ n)) * + FABL.binarySign (booleanFunctionPairing n f h) := by + rw [orderTwoCorrelationPowerSum_eq_dualWeightGroupedCharacterSum k f hn] + congr 1 + apply Finset.sum_congr rfl + intro h _hh + rw [tuplePointParityMultiplicityByWeight_eq_fourierSum] + +/-- Proposition 9.2.5 with each tuple multiplicity replaced by the explicit +finite Krawtchouk sum equivalent to Mesnager's generating-function formula. -/ +theorem orderTwoCorrelationPowerSum_eq_dualKrawtchoukMultiplicityCharacterSum + (k : ℕ) (f : BooleanFunction n) (hn : 3 ≤ n) : + orderTwoCorrelationPowerSum k f = + (Nat.card (reedMuller 2 n) : ℝ) * + ∑ h ∈ orderTwoDualWords n, + tuplePointParityKrawtchoukMultiplicity k n (hammingWeight h) * + FABL.binarySign (booleanFunctionPairing n f h) := by + rw [orderTwoCorrelationPowerSum_eq_dualFourierMultiplicityCharacterSum + k f hn] + congr 1 + apply Finset.sum_congr rfl + intro h _hh + rw [← tuplePointParityMultiplicityByWeight_eq_fourierSum, + tuplePointParityMultiplicityByWeight_eq_krawtchoukSum] + +end CryptBoolean diff --git a/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoAsymptotics.lean b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoAsymptotics.lean new file mode 100644 index 0000000..9e3c791 --- /dev/null +++ b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoAsymptotics.lean @@ -0,0 +1,496 @@ +/- +Copyright (c) 2026 Asher Yan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Asher Yan with Codex +-/ +module + +public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwo +public import CryptBoolean.Carlet.Chapter04.HigherOrderTupleCounts +public import CryptBoolean.Carlet.Chapter04.IndicatorSpectralBounds +import Mathlib.Algebra.Order.Chebyshev + +/-! +# Asymptotic order-two moment estimates + +Uniform denominator and ratio estimates that turn the low-weight dual-code +character bounds into Carlet--Mesnager's order-two covering-radius base. +-/ + +open Finset Filter +open scoped BigOperators BooleanCube Topology + +@[expose] public section + +namespace CryptBoolean + +variable {n : ℕ} + +/-- The support of a tuple's point-parity word is contained in the tuple's +image. -/ +theorem hammingWeight_tuplePointParity_le + {m : ℕ} (x : Fin m → FABL.F₂Cube n) : + hammingWeight (tuplePointParity x) ≤ m := by + rw [hammingWeight_eq_card_support] + calc + (support (tuplePointParity x)).card ≤ + (Finset.univ.image x).card := by + apply Finset.card_le_card + intro y hy + by_contra hyimage + have hne (i : Fin m) : x i ≠ y := by + intro hxy + apply hyimage + exact Finset.mem_image.mpr ⟨i, Finset.mem_univ i, hxy⟩ + have hzero : tuplePointParity x y = 0 := by + simp [tuplePointParity, hne] + have hyone := (mem_support (tuplePointParity x) y).mp hy + rw [hzero] at hyone + norm_num at hyone + _ ≤ Finset.univ.card := Finset.card_image_le + _ = m := by simp + +private theorem tuplePointParity_fin_two_eq_zero_iff + (x : Fin 2 → FABL.F₂Cube n) : + tuplePointParity x = 0 ↔ x 0 = x 1 := by + constructor + · intro hzero + by_contra hne + have happ := congrFun hzero (x 0) + have hfilter : + (Finset.univ.filter fun i : Fin 2 ↦ x i = x 0) = {0} := by + ext i + fin_cases i <;> simp [Ne.symm hne] + simp only [tuplePointParity, Finset.sum_boole, hfilter, + Finset.card_singleton, Nat.cast_one, Pi.zero_apply] at happ + norm_num at happ + · intro heq + funext y + by_cases hy : x 0 = y + · have hall (i : Fin 2) : x i = y := by + fin_cases i <;> simpa [heq] using hy + rw [tuplePointParity, Finset.sum_boole] + have hfilter : + (Finset.univ.filter fun i : Fin 2 ↦ x i = y) = Finset.univ := + Finset.filter_eq_self.mpr fun i _hi ↦ hall i + rw [hfilter, Finset.card_univ, Fintype.card_fin] + change (2 : FABL.𝔽₂) = 0 + exact ZMod.natCast_self 2 + · have hnone (i : Fin 2) : x i ≠ y := by + fin_cases i <;> simpa [heq] using hy + simp [tuplePointParity, hnone] + +private def diagonalPointPair (y : FABL.F₂Cube n) : + Fin 2 → FABL.F₂Cube n := fun _i ↦ y + +private theorem diagonalPointPair_injective : + Function.Injective (diagonalPointPair (n := n)) := by + intro x y hxy + exact congrFun hxy 0 + +private theorem tuplePointParityMultiplicity_one_zero (n : ℕ) : + tuplePointParityMultiplicity 1 (0 : BooleanFunction n) = 2 ^ n := by + classical + rw [tuplePointParityMultiplicity, tuplePointParityFiber] + have hfilter : + (Finset.univ : Finset (Fin 2 → FABL.F₂Cube n)).filter + (fun x ↦ tuplePointParity x = 0) = + (Finset.univ : Finset (FABL.F₂Cube n)).image diagonalPointPair := by + ext x + simp only [Finset.mem_filter, Finset.mem_univ, true_and, + Finset.mem_image] + rw [tuplePointParity_fin_two_eq_zero_iff] + constructor + · intro hx + refine ⟨x 0, ?_⟩ + funext i + fin_cases i + · rfl + · exact hx + · rintro ⟨y, rfl⟩ + rfl + rw [hfilter, Finset.card_image_of_injective _ diagonalPointPair_injective, + Finset.card_univ, card_f₂Cube] + +/-- The point-parity multiplicity of the zero word for one pair is the cube +size. -/ +theorem tuplePointParityMultiplicityByWeight_one_zero (n : ℕ) : + tuplePointParityMultiplicityByWeight 1 n 0 = 2 ^ n := by + calc + tuplePointParityMultiplicityByWeight 1 n 0 = + tuplePointParityMultiplicity 1 (0 : BooleanFunction n) := by + simpa using + (tuplePointParityMultiplicity_eq_byWeight + 1 (0 : BooleanFunction n)).symm + _ = 2 ^ n := tuplePointParityMultiplicity_one_zero n + +private theorem tuplePointParityMultiplicityByWeight_one_eq_zero_of_dual_ne_zero + (h : BooleanFunction n) (hn : 3 ≤ n) + (hdual : h ∈ reedMuller (n - 3) n) (hne : h ≠ 0) : + tuplePointParityMultiplicityByWeight 1 n (hammingWeight h) = 0 := by + rw [← tuplePointParityMultiplicity_eq_byWeight 1 h, + tuplePointParityMultiplicity, tuplePointParityFiber] + rw [Finset.card_eq_zero, Finset.filter_eq_empty_iff] + intro x _hx hparity + have hupper := hammingWeight_tuplePointParity_le x + rw [hparity] at hupper + have hdegree : FABL.functionAlgebraicDegree h ≤ n - 3 := by + simpa only [mem_reedMuller_iff] using hdual + have hlower := two_pow_sub_le_hammingWeight_of_degree_le h hdegree hne + have hexponent : n - (n - 3) = 3 := by omega + rw [hexponent] at hlower + norm_num at hlower + omega + +/-- The second correlation moment over `RM(2,n)` is the code cardinality +times the Boolean cube size. -/ +theorem orderTwoCorrelationPowerSum_one_eq + (f : BooleanFunction n) (hn : 3 ≤ n) : + orderTwoCorrelationPowerSum 1 f = + (Nat.card (reedMuller 2 n) : ℝ) * (2 : ℝ) ^ n := by + rw [orderTwoCorrelationPowerSum_eq_dualWeightGroupedCharacterSum 1 f hn] + congr 1 + calc + (∑ h ∈ orderTwoDualWords n, + (tuplePointParityMultiplicityByWeight 1 n (hammingWeight h) : ℝ) * + FABL.binarySign (booleanFunctionPairing n f h)) = + (tuplePointParityMultiplicityByWeight 1 n + (hammingWeight (0 : BooleanFunction n)) : ℝ) * + FABL.binarySign + (booleanFunctionPairing n f (0 : BooleanFunction n)) := by + apply Finset.sum_eq_single 0 + · intro h hh hne + have hdual : h ∈ reedMuller (n - 3) n := by + simpa only [orderTwoDualWords, Finset.mem_filter, Finset.mem_univ, + true_and] using hh + rw [tuplePointParityMultiplicityByWeight_one_eq_zero_of_dual_ne_zero + h hn hdual hne] + simp + · simp [orderTwoDualWords] + _ = (2 : ℝ) ^ n := by + simp [tuplePointParityMultiplicityByWeight_one_zero] + +/-- Jensen's inequality and the exact second moment give the code-cardinality +scaled denominator required by the seventh/eighth moment comparison. -/ +theorem reedMuller_card_mul_two_pow_seven_le_orderTwoCorrelationPowerSum_seven + (f : BooleanFunction n) (hn : 3 ≤ n) : + (Nat.card (reedMuller 2 n) : ℝ) * ((2 : ℝ) ^ n) ^ 7 ≤ + orderTwoCorrelationPowerSum 7 f := by + classical + letI : Fintype (reedMuller 2 n) := Fintype.ofFinite (reedMuller 2 n) + have hjensen := + pow_sum_le_card_mul_sum_pow + (s := (Finset.univ : Finset (reedMuller 2 n))) + (f := fun g : reedMuller 2 n ↦ + (orderTwoCorrelation f g.1) ^ 2) + (fun g _hg ↦ sq_nonneg (orderTwoCorrelation f g.1)) 6 + have hmoments : + (orderTwoCorrelationPowerSum 1 f) ^ 7 ≤ + (Nat.card (reedMuller 2 n) : ℝ) ^ 6 * + orderTwoCorrelationPowerSum 7 f := by + simpa only [orderTwoCorrelationPowerSum, mul_one, pow_mul, + Nat.card_eq_fintype_card, Finset.card_univ] using hjensen + rw [orderTwoCorrelationPowerSum_one_eq f hn] at hmoments + have hcard : 0 < (Nat.card (reedMuller 2 n) : ℝ) := by + exact_mod_cast Nat.card_pos + have hfactor : + ((Nat.card (reedMuller 2 n) : ℝ) * (2 : ℝ) ^ n) ^ 7 = + (Nat.card (reedMuller 2 n) : ℝ) ^ 6 * + ((Nat.card (reedMuller 2 n) : ℝ) * ((2 : ℝ) ^ n) ^ 7) := by + ring + rw [hfactor] at hmoments + exact le_of_mul_le_mul_left hmoments (pow_pos hcard 6) + +/-- Parseval forces the squared largest raw Walsh coefficient to be at least +the Boolean cube size. -/ +theorem two_pow_le_maxWalshMagnitude_sq (f : BooleanFunction n) : + (2 : ℝ) ^ n ≤ (maxWalshMagnitude f : ℝ) ^ 2 := by + have hsum : + (∑ a : FABL.F₂Cube n, (walshTransform f a : ℝ) ^ 2) ≤ + ∑ _a : FABL.F₂Cube n, (maxWalshMagnitude f : ℝ) ^ 2 := by + apply Finset.sum_le_sum + intro a _ha + have habs := abs_walshTransform_le_maxWalshMagnitude f a + simpa only [sq_abs] using + (sq_le_sq₀ (abs_nonneg (walshTransform f a : ℝ)) + (Nat.cast_nonneg (maxWalshMagnitude f))).mpr habs + rw [sum_walshTransform_sq_eq_two_pow_sq, Finset.sum_const, + Finset.card_univ, card_f₂Cube, nsmul_eq_mul] at hsum + norm_num only [Nat.cast_pow, Nat.cast_ofNat] at hsum + have hpow : (0 : ℝ) < (2 : ℝ) ^ n := by positivity + nlinarith + +/-- The affine subcode and Parseval give the uniform denominator estimate +`S_k(f) ≥ (2^n)^k`. -/ +theorem two_pow_pow_le_orderTwoCorrelationPowerSum + (k : ℕ) (f : BooleanFunction n) : + ((2 : ℝ) ^ n) ^ k ≤ orderTwoCorrelationPowerSum k f := by + classical + letI : Fintype (reedMuller 2 n) := Fintype.ofFinite (reedMuller 2 n) + have hmaximum : + ∃ a : FABL.F₂Cube n, + |(walshTransform f a : ℝ)| = (maxWalshMagnitude f : ℝ) := by + unfold maxWalshMagnitude + obtain ⟨a, _ha, hmax⟩ := Finset.exists_mem_eq_sup' + (s := (Finset.univ : Finset (FABL.F₂Cube n))) Finset.univ_nonempty + (fun u ↦ (walshTransform f u).natAbs) + refine ⟨a, ?_⟩ + rw [hmax, Nat.cast_natAbs, Int.cast_abs] + obtain ⟨a, ha⟩ := hmaximum + let g : reedMuller 2 n := + ⟨FABL.affineFunction 0 a, + reedMuller_mono (by omega : 1 ≤ 2) + (affineFunction_mem_reedMuller_one 0 a)⟩ + have hcorrelation : + orderTwoCorrelation f g.1 = walshTransform f a := by + unfold orderTwoCorrelation walshTransform walshTerm + push_cast + apply Finset.sum_congr rfl + intro x _hx + simp [g, FABL.affineFunction, FABL.f₂DotProduct, dotProduct] + have htermLe : + (orderTwoCorrelation f g.1) ^ (2 * k) ≤ + orderTwoCorrelationPowerSum k f := by + rw [orderTwoCorrelationPowerSum] + have hsingle := Finset.single_le_sum + (s := (Finset.univ : Finset (reedMuller 2 n))) + (f := fun h : reedMuller 2 n ↦ + (orderTwoCorrelation f h.1) ^ (2 * k)) + (fun h _hh ↦ by + rw [show 2 * k = k * 2 by omega, pow_mul] + exact sq_nonneg ((orderTwoCorrelation f h.1) ^ k)) + (Finset.mem_univ g) + simpa using hsingle + have hmaxSq := two_pow_le_maxWalshMagnitude_sq f + have hpower : + ((2 : ℝ) ^ n) ^ k ≤ + ((maxWalshMagnitude f : ℝ) ^ 2) ^ k := + pow_le_pow_left₀ (by positivity) hmaxSq k + calc + ((2 : ℝ) ^ n) ^ k ≤ + ((maxWalshMagnitude f : ℝ) ^ 2) ^ k := hpower + _ = (maxWalshMagnitude f : ℝ) ^ (2 * k) := by + rw [pow_mul] + _ = |(walshTransform f a : ℝ)| ^ (2 * k) := by rw [ha] + _ = (|(walshTransform f a : ℝ)| ^ 2) ^ k := by rw [pow_mul] + _ = ((walshTransform f a : ℝ) ^ 2) ^ k := by rw [sq_abs] + _ = (walshTransform f a : ℝ) ^ (2 * k) := by rw [pow_mul] + _ = (orderTwoCorrelation f g.1) ^ (2 * k) := by rw [hcorrelation] + _ ≤ orderTwoCorrelationPowerSum k f := htermLe + +/-- An additive `K (2^n)^7` remainder in the eighth-versus-seventh moment +comparison becomes an additive constant in the quotient. -/ +theorem orderTwoCorrelationPowerSum_eight_div_seven_ge + (f : BooleanFunction n) (K : ℝ) (hK : 0 ≤ K) + (hdifference : + 15 * (2 : ℝ) ^ n * orderTwoCorrelationPowerSum 7 f - + K * ((2 : ℝ) ^ n) ^ 7 ≤ + orderTwoCorrelationPowerSum 8 f) : + 15 * (2 : ℝ) ^ n - K ≤ + orderTwoCorrelationPowerSum 8 f / + orderTwoCorrelationPowerSum 7 f := by + have hden := orderTwoCorrelationPowerSum_pos 7 f + have hdenLower := two_pow_pow_le_orderTwoCorrelationPowerSum 7 f + have hremainder : + K * ((2 : ℝ) ^ n) ^ 7 ≤ + K * orderTwoCorrelationPowerSum 7 f := + mul_le_mul_of_nonneg_left hdenLower hK + rw [le_div_iff₀ hden] + nlinarith + +/-- The code-cardinality-scaled remainder produced by dual-weight grouping +also becomes an additive constant in the seventh/eighth moment quotient. -/ +theorem orderTwoCorrelationPowerSum_eight_div_seven_ge_of_card_scaled + (f : BooleanFunction n) (K : ℝ) (hK : 0 ≤ K) (hn : 3 ≤ n) + (hdifference : + 15 * (2 : ℝ) ^ n * orderTwoCorrelationPowerSum 7 f - + K * ((Nat.card (reedMuller 2 n) : ℝ) * ((2 : ℝ) ^ n) ^ 7) ≤ + orderTwoCorrelationPowerSum 8 f) : + 15 * (2 : ℝ) ^ n - K ≤ + orderTwoCorrelationPowerSum 8 f / + orderTwoCorrelationPowerSum 7 f := by + have hden := orderTwoCorrelationPowerSum_pos 7 f + have hdenLower := + reedMuller_card_mul_two_pow_seven_le_orderTwoCorrelationPowerSum_seven + f hn + have hremainder : + K * ((Nat.card (reedMuller 2 n) : ℝ) * ((2 : ℝ) ^ n) ^ 7) ≤ + K * orderTwoCorrelationPowerSum 7 f := + mul_le_mul_of_nonneg_left hdenLower hK + rw [le_div_iff₀ hden] + nlinarith + +/-- Square roots of powers of the cube size are powers of `√2`. -/ +theorem sqrt_two_pow_eq_sqrtTwo_pow (n : ℕ) : + Real.sqrt ((2 : ℝ) ^ n) = (Real.sqrt 2) ^ n := by + induction n with + | zero => simp + | succ n ih => + rw [pow_succ, Real.sqrt_mul (by positivity), ih, pow_succ] + +/-- The quotient estimate gives the sharp square-root term with an additive +`sqrt K` loss. -/ +theorem sqrt_fifteen_mul_sqrtTwo_pow_sub_sqrt_le_momentRatio + (f : BooleanFunction n) (K : ℝ) (hK : 0 ≤ K) + (hratio : + 15 * (2 : ℝ) ^ n - K ≤ + orderTwoCorrelationPowerSum 8 f / + orderTwoCorrelationPowerSum 7 f) : + Real.sqrt 15 * (Real.sqrt 2) ^ n - Real.sqrt K ≤ + Real.sqrt + (orderTwoCorrelationPowerSum 8 f / + orderTwoCorrelationPowerSum 7 f) := by + let R : ℝ := + orderTwoCorrelationPowerSum 8 f / orderTwoCorrelationPowerSum 7 f + have hR : 0 ≤ R := by + exact div_nonneg (orderTwoCorrelationPowerSum_nonneg 8 f) + (orderTwoCorrelationPowerSum_nonneg 7 f) + have hsum : 15 * (2 : ℝ) ^ n ≤ R + K := by + dsimp only [R] + linarith + have hsqrtSum : + Real.sqrt (15 * (2 : ℝ) ^ n) ≤ + Real.sqrt R + Real.sqrt K := by + have hleftSq := Real.sq_sqrt (by positivity : + (0 : ℝ) ≤ 15 * (2 : ℝ) ^ n) + have hRSq := Real.sq_sqrt hR + have hKSq := Real.sq_sqrt hK + have hleftNonneg := Real.sqrt_nonneg (15 * (2 : ℝ) ^ n) + have hrightNonneg : 0 ≤ Real.sqrt R + Real.sqrt K := by positivity + have hproduct : 0 ≤ Real.sqrt R * Real.sqrt K := mul_nonneg + (Real.sqrt_nonneg R) (Real.sqrt_nonneg K) + nlinarith + have hfactor : + Real.sqrt (15 * (2 : ℝ) ^ n) = + Real.sqrt 15 * (Real.sqrt 2) ^ n := by + rw [Real.sqrt_mul (by norm_num : (0 : ℝ) ≤ 15), + sqrt_two_pow_eq_sqrtTwo_pow] + dsimp only [R] at hsqrtSum ⊢ + rw [hfactor] at hsqrtSum + linarith + +/-- A uniform eighth-versus-seventh moment comparison gives the sharp +order-two covering-radius estimate, with an explicit additive loss. -/ +theorem maximumHigherOrderNonlinearity_two_cast_le_of_moment_difference + (K : ℝ) (hK : 0 ≤ K) + (hdifference : ∀ f : BooleanFunction n, + 15 * (2 : ℝ) ^ n * orderTwoCorrelationPowerSum 7 f - + K * ((2 : ℝ) ^ n) ^ 7 ≤ + orderTwoCorrelationPowerSum 8 f) : + (maximumHigherOrderNonlinearity 2 n : ℝ) ≤ + (2 : ℝ) ^ n / 2 - + (Real.sqrt 15 / 2) * (Real.sqrt 2) ^ n + + Real.sqrt K / 2 := by + obtain ⟨f, hf⟩ := exists_higherOrderNonlinearity_eq_maximum 2 n + have hratio := orderTwoCorrelationPowerSum_eight_div_seven_ge + f K hK (hdifference f) + have hlower := + sqrt_fifteen_mul_sqrtTwo_pow_sub_sqrt_le_momentRatio f K hK hratio + have hupper := sqrt_orderTwoCorrelationPowerSum_ratio_le 7 f + rw [maximumOrderTwoCorrelation_eq, hf] at hupper + linarith + +/-- A code-cardinality-scaled moment remainder gives the same sharp +order-two covering-radius estimate. -/ +theorem maximumHigherOrderNonlinearity_two_cast_le_of_card_scaled_moment_difference + (K : ℝ) (hK : 0 ≤ K) (hn : 3 ≤ n) + (hdifference : ∀ f : BooleanFunction n, + 15 * (2 : ℝ) ^ n * orderTwoCorrelationPowerSum 7 f - + K * ((Nat.card (reedMuller 2 n) : ℝ) * ((2 : ℝ) ^ n) ^ 7) ≤ + orderTwoCorrelationPowerSum 8 f) : + (maximumHigherOrderNonlinearity 2 n : ℝ) ≤ + (2 : ℝ) ^ n / 2 - + (Real.sqrt 15 / 2) * (Real.sqrt 2) ^ n + + Real.sqrt K / 2 := by + obtain ⟨f, hf⟩ := exists_higherOrderNonlinearity_eq_maximum 2 n + have hratio := + orderTwoCorrelationPowerSum_eight_div_seven_ge_of_card_scaled + f K hK hn (hdifference f) + have hlower := + sqrt_fifteen_mul_sqrtTwo_pow_sub_sqrt_le_momentRatio f K hK hratio + have hupper := sqrt_orderTwoCorrelationPowerSum_ratio_le 7 f + rw [maximumOrderTwoCorrelation_eq, hf] at hupper + linarith + +/-- Eventual uniform control of the moment remainder is exactly the +Carlet--Mesnager order-two `O(1)` base expected by the Plotkin propagation. -/ +theorem eventually_maximumHigherOrderNonlinearity_two_cast_le_of_moment_difference + (K : ℝ) (hK : 0 ≤ K) + (hdifference : ∀ᶠ n in Filter.atTop, ∀ f : BooleanFunction n, + 15 * (2 : ℝ) ^ n * orderTwoCorrelationPowerSum 7 f - + K * ((2 : ℝ) ^ n) ^ 7 ≤ + orderTwoCorrelationPowerSum 8 f) : + ∀ᶠ n in Filter.atTop, + (maximumHigherOrderNonlinearity 2 n : ℝ) ≤ + (2 : ℝ) ^ n / 2 - + (Real.sqrt 15 / 2) * (Real.sqrt 2) ^ n + + Real.sqrt K / 2 := by + filter_upwards [hdifference] with n hn + exact maximumHigherOrderNonlinearity_two_cast_le_of_moment_difference + K hK hn + +/-- Eventual code-cardinality-scaled moment control gives the sharp +order-two `O(1)` base. -/ +theorem eventually_maximumHigherOrderNonlinearity_two_cast_le_of_card_scaled_moment_difference + (K : ℝ) (hK : 0 ≤ K) + (hdifference : ∀ᶠ n in Filter.atTop, ∀ f : BooleanFunction n, + 15 * (2 : ℝ) ^ n * orderTwoCorrelationPowerSum 7 f - + K * ((Nat.card (reedMuller 2 n) : ℝ) * ((2 : ℝ) ^ n) ^ 7) ≤ + orderTwoCorrelationPowerSum 8 f) : + ∀ᶠ n in Filter.atTop, + (maximumHigherOrderNonlinearity 2 n : ℝ) ≤ + (2 : ℝ) ^ n / 2 - + (Real.sqrt 15 / 2) * (Real.sqrt 2) ^ n + + Real.sqrt K / 2 := by + filter_upwards [hdifference, Filter.eventually_ge_atTop 3] with n hn hthree + exact + maximumHigherOrderNonlinearity_two_cast_le_of_card_scaled_moment_difference + K hK hthree hn + +/-- The complete abstract Carlet--Mesnager closure: a uniform seventh/eighth +moment remainder propagates the sharp order-two constant to every fixed +higher order. -/ +theorem exists_maximumHigherOrderNonlinearity_cast_le_of_moment_difference + (K : ℝ) (hK : 0 ≤ K) + (hdifference : ∀ᶠ n in Filter.atTop, ∀ f : BooleanFunction n, + 15 * (2 : ℝ) ^ n * orderTwoCorrelationPowerSum 7 f - + K * ((2 : ℝ) ^ n) ^ 7 ≤ + orderTwoCorrelationPowerSum 8 f) + (r : ℕ) (hr : 2 ≤ r) : + ∃ D : ℝ, 0 ≤ D ∧ ∀ n : ℕ, r ≤ n → + (maximumHigherOrderNonlinearity r n : ℝ) ≤ + (2 : ℝ) ^ n / 2 - + ((Real.sqrt 15 / 2) * + (1 + Real.sqrt 2) ^ (r - 2)) * + (Real.sqrt 2) ^ n + + D * (n + 1 : ℝ) ^ (r - 2) := by + apply exists_maximumHigherOrderNonlinearity_cast_le_of_eventual_orderTwo + (Real.sqrt 15 / 2) (by positivity) _ r hr + refine ⟨Real.sqrt K / 2, ?_⟩ + exact eventually_maximumHigherOrderNonlinearity_two_cast_le_of_moment_difference + K hK hdifference + +/-- A code-cardinality-scaled seventh/eighth moment remainder propagates the +sharp Carlet--Mesnager coefficient to every fixed higher order. -/ +theorem exists_maximumHigherOrderNonlinearity_cast_le_of_card_scaled_moment_difference + (K : ℝ) (hK : 0 ≤ K) + (hdifference : ∀ᶠ n in Filter.atTop, ∀ f : BooleanFunction n, + 15 * (2 : ℝ) ^ n * orderTwoCorrelationPowerSum 7 f - + K * ((Nat.card (reedMuller 2 n) : ℝ) * ((2 : ℝ) ^ n) ^ 7) ≤ + orderTwoCorrelationPowerSum 8 f) + (r : ℕ) (hr : 2 ≤ r) : + ∃ D : ℝ, 0 ≤ D ∧ ∀ n : ℕ, r ≤ n → + (maximumHigherOrderNonlinearity r n : ℝ) ≤ + (2 : ℝ) ^ n / 2 - + ((Real.sqrt 15 / 2) * + (1 + Real.sqrt 2) ^ (r - 2)) * + (Real.sqrt 2) ^ n + + D * (n + 1 : ℝ) ^ (r - 2) := by + apply exists_maximumHigherOrderNonlinearity_cast_le_of_eventual_orderTwo + (Real.sqrt 15 / 2) (by positivity) _ r hr + refine ⟨Real.sqrt K / 2, ?_⟩ + exact + eventually_maximumHigherOrderNonlinearity_two_cast_le_of_card_scaled_moment_difference + K hK hdifference + +end CryptBoolean diff --git a/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoLowWeightSpectrum.lean b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoLowWeightSpectrum.lean new file mode 100644 index 0000000..553b36f --- /dev/null +++ b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoLowWeightSpectrum.lean @@ -0,0 +1,50 @@ +/- +Copyright (c) 2026 Asher Yan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Asher Yan with Codex +-/ +module + +public import CryptBoolean.Carlet.Chapter03.ReedMullerLowWeightSpectrum +public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightTwelve + +/-! +# The low-weight spectrum used by the order-two moment argument + +This module packages the minimum-distance and weight-ten exclusions into the +finite spectrum interface used to group the seventh and eighth moments. +-/ + +open scoped BooleanCube + +@[expose] public section + +namespace CryptBoolean + +variable {n : ℕ} + +/-- Below weight sixteen, the only even weights in the codimension-three +dual code are `0, 8, 12, 14, 16`. -/ +theorem hasOrderTwoLowWeightSpectrum (hn : 3 ≤ n) : + HasOrderTwoLowWeightSpectrum n := by + intro h hh heven hupper + have hdual : h ∈ reedMuller (n - 3) n := by + simpa only [orderTwoDualWords, Finset.mem_filter, Finset.mem_univ, + true_and] using hh + by_cases hzero : h = 0 + · left + simp [hzero] + · have hdegree : FABL.functionAlgebraicDegree h ≤ n - 3 := by + simpa only [mem_reedMuller_iff] using hdual + have hlower := + two_pow_sub_le_hammingWeight_of_degree_le h hdegree hzero + have hexponent : n - (n - 3) = 3 := by omega + rw [hexponent] at hlower + norm_num at hlower + have hnotTen := + hammingWeight_ne_ten_of_mem_reedMuller_codimension_three + h hn hdual + obtain ⟨k, hk⟩ := heven + omega + +end CryptBoolean diff --git a/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoMomentDifference.lean b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoMomentDifference.lean new file mode 100644 index 0000000..b9f09eb --- /dev/null +++ b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoMomentDifference.lean @@ -0,0 +1,397 @@ +/- +Copyright (c) 2026 Asher Yan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Asher Yan with Codex +-/ +module + +public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoAsymptotics +public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoLowWeightSpectrum +public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightEight +public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightFourteen +public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightSixteen +public import CryptBoolean.Carlet.Chapter04.HigherOrderTupleCountDifferences + +/-! +# The seventh/eighth order-two moment difference + +The low-weight dual-code grouping and uniform remainder estimate in the +Carlet--Mesnager order-two argument. +-/ + +open Finset Filter +open scoped BigOperators BooleanCube Topology + +@[expose] public section + +namespace CryptBoolean + +variable {n : ℕ} + +/-- The character sum over the words of a fixed weight in the order-two +dual Reed--Muller code. -/ +noncomputable def orderTwoWeightCharacterSum + (w : ℕ) (f : BooleanFunction n) : ℝ := + ∑ h ∈ (orderTwoDualWords n).filter (fun h ↦ hammingWeight h = w), + FABL.binarySign (booleanFunctionPairing n f h) + +/-- A tuple-parity multiplicity vanishes when the prescribed word has more +support points than the tuple has entries. -/ +theorem tuplePointParityMultiplicityByWeight_eq_zero_of_lt + (k : ℕ) (h : BooleanFunction n) + (hweight : 2 * k < hammingWeight h) : + tuplePointParityMultiplicityByWeight k n (hammingWeight h) = 0 := by + rw [← tuplePointParityMultiplicity_eq_byWeight k h, + tuplePointParityMultiplicity, tuplePointParityFiber] + apply Finset.card_eq_zero.mpr + rw [Finset.filter_eq_empty_iff] + intro x _hx hparity + have hupper := hammingWeight_tuplePointParity_le x + rw [hparity] at hupper + omega + +/-- Above weight sixteen, the coefficient in the seventh/eighth moment +difference vanishes. -/ +theorem tuplePointParityMomentDifference_eq_zero_of_sixteen_lt + (h : BooleanFunction n) (hweight : 16 < hammingWeight h) : + tuplePointParityMomentDifference n (hammingWeight h) = 0 := by + rw [tuplePointParityMomentDifference, + tuplePointParityMultiplicityByWeight_eq_zero_of_lt 8 h (by omega), + tuplePointParityMultiplicityByWeight_eq_zero_of_lt 7 h (by omega)] + ring + +/-- The fixed-weight definition specializes definitionally to the canonical +weight-eight character sum. -/ +theorem orderTwoWeightCharacterSum_eight + (f : BooleanFunction n) : + orderTwoWeightCharacterSum 8 f = + orderTwoWeightEightCharacterSum f := by + rfl + +/-- The fixed-weight definition specializes definitionally to the canonical +weight-twelve character sum. -/ +theorem orderTwoWeightCharacterSum_twelve + (f : BooleanFunction n) : + orderTwoWeightCharacterSum 12 f = + orderTwoWeightTwelveCharacterSum f := by + rfl + +/-- The fixed-weight definition specializes definitionally to the canonical +weight-fourteen character sum. -/ +theorem orderTwoWeightCharacterSum_fourteen + (f : BooleanFunction n) : + orderTwoWeightCharacterSum 14 f = + orderTwoWeightFourteenCharacterSum f := by + rfl + +/-- The fixed-weight definition specializes definitionally to the canonical +weight-sixteen character sum. -/ +theorem orderTwoWeightCharacterSum_sixteen + (f : BooleanFunction n) : + orderTwoWeightCharacterSum 16 f = + orderTwoWeightSixteenCharacterSum f := by + rfl + +/-- The weight-zero character sum consists only of the zero word. -/ +theorem orderTwoWeightCharacterSum_zero (f : BooleanFunction n) : + orderTwoWeightCharacterSum 0 f = 1 := by + classical + have hfilter : + (orderTwoDualWords n).filter (fun h ↦ hammingWeight h = 0) = + {0} := by + ext h + simp only [Finset.mem_filter, Finset.mem_singleton] + constructor + · intro hh + exact hammingNorm_eq_zero.mp hh.2 + · rintro rfl + simp [orderTwoDualWords] + rw [orderTwoWeightCharacterSum, hfilter] + simp + +/-- The dual-code coefficient sum is supported only at weights +`0, 8, 12, 14, 16`. -/ +theorem orderTwoMomentDifferenceCharacterSum_eq_lowWeights + (f : BooleanFunction n) (hn : 7 ≤ n) : + (∑ h ∈ orderTwoDualWords n, + tuplePointParityMomentDifference n (hammingWeight h) * + FABL.binarySign (booleanFunctionPairing n f h)) = + tuplePointParityMomentDifference n 0 + + tuplePointParityMomentDifference n 8 * + orderTwoWeightEightCharacterSum f + + tuplePointParityMomentDifference n 12 * + orderTwoWeightTwelveCharacterSum f + + tuplePointParityMomentDifference n 14 * + orderTwoWeightFourteenCharacterSum f + + tuplePointParityMomentDifference n 16 * + orderTwoWeightSixteenCharacterSum f := by + classical + have hpointwise (h : BooleanFunction n) (hh : h ∈ orderTwoDualWords n) : + tuplePointParityMomentDifference n (hammingWeight h) * + FABL.binarySign (booleanFunctionPairing n f h) = + (if hammingWeight h = 0 then + tuplePointParityMomentDifference n 0 * + FABL.binarySign (booleanFunctionPairing n f h) else 0) + + (if hammingWeight h = 8 then + tuplePointParityMomentDifference n 8 * + FABL.binarySign (booleanFunctionPairing n f h) else 0) + + (if hammingWeight h = 12 then + tuplePointParityMomentDifference n 12 * + FABL.binarySign (booleanFunctionPairing n f h) else 0) + + (if hammingWeight h = 14 then + tuplePointParityMomentDifference n 14 * + FABL.binarySign (booleanFunctionPairing n f h) else 0) + + (if hammingWeight h = 16 then + tuplePointParityMomentDifference n 16 * + FABL.binarySign (booleanFunctionPairing n f h) else 0) := by + have hdual : h ∈ reedMuller (n - 3) n := by + simpa only [orderTwoDualWords, Finset.mem_filter, Finset.mem_univ, + true_and] using hh + have hdegree : FABL.functionAlgebraicDegree h ≤ n - 3 := by + simpa only [mem_reedMuller_iff] using hdual + have heven : Even (hammingWeight h) := + even_hammingWeight_of_degree_lt_dimension h (by omega) + by_cases hupper : hammingWeight h ≤ 16 + · rcases hasOrderTwoLowWeightSpectrum (n := n) (by omega) + h hh heven hupper with hzero | height | htwelve | hfourteen | hsixteen + · simp [hzero] + · simp [height] + · simp [htwelve] + · simp [hfourteen] + · simp [hsixteen] + · have hlarge : 16 < hammingWeight h := by omega + rw [tuplePointParityMomentDifference_eq_zero_of_sixteen_lt h hlarge] + have hne0 : hammingWeight h ≠ 0 := by omega + have hne8 : hammingWeight h ≠ 8 := by omega + have hne12 : hammingWeight h ≠ 12 := by omega + have hne14 : hammingWeight h ≠ 14 := by omega + have hne16 : hammingWeight h ≠ 16 := by omega + simp [hne0, hne8, hne12, hne14, hne16] + calc + (∑ h ∈ orderTwoDualWords n, + tuplePointParityMomentDifference n (hammingWeight h) * + FABL.binarySign (booleanFunctionPairing n f h)) = + ∑ h ∈ orderTwoDualWords n, + ((if hammingWeight h = 0 then + tuplePointParityMomentDifference n 0 * + FABL.binarySign (booleanFunctionPairing n f h) else 0) + + (if hammingWeight h = 8 then + tuplePointParityMomentDifference n 8 * + FABL.binarySign (booleanFunctionPairing n f h) else 0) + + (if hammingWeight h = 12 then + tuplePointParityMomentDifference n 12 * + FABL.binarySign (booleanFunctionPairing n f h) else 0) + + (if hammingWeight h = 14 then + tuplePointParityMomentDifference n 14 * + FABL.binarySign (booleanFunctionPairing n f h) else 0) + + (if hammingWeight h = 16 then + tuplePointParityMomentDifference n 16 * + FABL.binarySign (booleanFunctionPairing n f h) else 0)) := by + apply Finset.sum_congr rfl + intro h hh + exact hpointwise h hh + _ = tuplePointParityMomentDifference n 0 * + orderTwoWeightCharacterSum 0 f + + tuplePointParityMomentDifference n 8 * + orderTwoWeightCharacterSum 8 f + + tuplePointParityMomentDifference n 12 * + orderTwoWeightCharacterSum 12 f + + tuplePointParityMomentDifference n 14 * + orderTwoWeightCharacterSum 14 f + + tuplePointParityMomentDifference n 16 * + orderTwoWeightCharacterSum 16 f := by + simp only [Finset.sum_add_distrib] + simp_rw [← Finset.sum_filter] + simp only [orderTwoWeightCharacterSum, Finset.mul_sum] + _ = _ := by + rw [orderTwoWeightCharacterSum_zero, + orderTwoWeightCharacterSum_eight, + orderTwoWeightCharacterSum_twelve, + orderTwoWeightCharacterSum_fourteen, + orderTwoWeightCharacterSum_sixteen] + ring + +/-- The correlation-power difference is the common code cardinality times +the low-weight coefficient sum. -/ +theorem orderTwoCorrelationPowerSum_difference_eq_lowWeights + (f : BooleanFunction n) (hn : 7 ≤ n) : + orderTwoCorrelationPowerSum 8 f - + 15 * (2 : ℝ) ^ n * orderTwoCorrelationPowerSum 7 f = + (Nat.card (reedMuller 2 n) : ℝ) * + (tuplePointParityMomentDifference n 0 + + tuplePointParityMomentDifference n 8 * + orderTwoWeightEightCharacterSum f + + tuplePointParityMomentDifference n 12 * + orderTwoWeightTwelveCharacterSum f + + tuplePointParityMomentDifference n 14 * + orderTwoWeightFourteenCharacterSum f + + tuplePointParityMomentDifference n 16 * + orderTwoWeightSixteenCharacterSum f) := by + have hsevenFactor : + 15 * (2 : ℝ) ^ n * + (∑ h ∈ orderTwoDualWords n, + (tuplePointParityMultiplicityByWeight 7 n + (hammingWeight h) : ℝ) * + FABL.binarySign (booleanFunctionPairing n f h)) = + ∑ h ∈ orderTwoDualWords n, + 15 * (2 : ℝ) ^ n * + (tuplePointParityMultiplicityByWeight 7 n + (hammingWeight h) : ℝ) * + FABL.binarySign (booleanFunctionPairing n f h) := by + rw [Finset.mul_sum] + apply Finset.sum_congr rfl + intro h _hh + ring + rw [orderTwoCorrelationPowerSum_eq_dualWeightGroupedCharacterSum + 8 f (by omega), + orderTwoCorrelationPowerSum_eq_dualWeightGroupedCharacterSum + 7 f (by omega), + ← orderTwoMomentDifferenceCharacterSum_eq_lowWeights f hn] + unfold tuplePointParityMomentDifference + simp_rw [sub_mul] + rw [Finset.sum_sub_distrib] + rw [← hsevenFactor] + ring + +/-- A dimension-independent `q⁷` lower bound for the weight-sixteen character +sum gives a code-cardinality-scaled seventh/eighth moment remainder. -/ +theorem orderTwoCorrelationPowerSum_difference_ge_of_weightSixteenCharacterSum + (f : BooleanFunction n) (hn : 7 ≤ n) + (hweightTwelve : HasWeightTwelveFlatPairClassification n) + (hweightFourteen : HasWeightFourteenFlatPairClassification n) + (B : ℝ) (hB : 0 ≤ B) + (hweightSixteen : + -B * ((2 : ℝ) ^ n) ^ 7 ≤ orderTwoWeightSixteenCharacterSum f) : + orderTwoCorrelationPowerSum 8 f - + 15 * (2 : ℝ) ^ n * orderTwoCorrelationPowerSum 7 f ≥ + -(133000020000000 + 21000000000000 * B) * + ((Nat.card (reedMuller 2 n) : ℝ) * ((2 : ℝ) ^ n) ^ 7) := by + let q : ℝ := (2 : ℝ) ^ n + let d0 := tuplePointParityMomentDifference n 0 + let d8 := tuplePointParityMomentDifference n 8 + let d12 := tuplePointParityMomentDifference n 12 + let d14 := tuplePointParityMomentDifference n 14 + let d16 := tuplePointParityMomentDifference n 16 + let m8 := orderTwoWeightEightCharacterSum f + let m12 := orderTwoWeightTwelveCharacterSum f + let m14 := orderTwoWeightFourteenCharacterSum f + let m16 := orderTwoWeightSixteenCharacterSum f + have hq : 2 ≤ q := by + dsimp only [q] + have hpow : (2 : ℕ) ^ 1 ≤ 2 ^ n := + Nat.pow_le_pow_right (by norm_num) (by omega) + exact_mod_cast hpow + have hd0 : -20000000 * q ^ 7 ≤ d0 := by + simpa only [q, d0] using + tuplePointParityMomentDifference_zero_ge n hn + have hd8 := tuplePointParityMomentDifference_eight_bounds n hn + have hd12 := tuplePointParityMomentDifference_twelve_bounds n hn + have hd14 := tuplePointParityMomentDifference_fourteen_bounds n hn + have hd16 := tuplePointParityMomentDifference_sixteen_bounds n hn + have hm8Exact := orderTwoWeightEightCharacterSum_ge f (by omega) + have hm8 : -q ^ 3 ≤ m8 := by + have hproduct : q * (q - 1) * (q - 2) ≤ q ^ 3 := by + nlinarith [mul_nonneg (sub_nonneg.mpr hq) (sub_nonneg.mpr (by linarith : 1 ≤ q))] + dsimp only [q, m8] at hm8Exact ⊢ + nlinarith + have hm12 : -q ^ 5 ≤ m12 := by + have h := orderTwoWeightTwelveCharacterSum_ge f hweightTwelve + dsimp only [q, m12] at h ⊢ + have hq5 : 0 ≤ ((2 : ℝ) ^ n) ^ 5 := by positivity + linarith + have hm14 : -q ^ 6 ≤ m14 := by + have h := orderTwoWeightFourteenCharacterSum_ge f hweightFourteen + dsimp only [q, m14] at h ⊢ + have hq6 : 0 ≤ ((2 : ℝ) ^ n) ^ 6 := by positivity + linarith + have hm16 : -B * q ^ 7 ≤ m16 := by + simpa only [q, m16] using hweightSixteen + have hterm8 : + -120000000000000 * q ^ 7 ≤ d8 * m8 := by + have hmulLower := mul_le_mul_of_nonneg_left hm8 hd8.1 + have hmulUpper := mul_le_mul_of_nonneg_right hd8.2 + (pow_nonneg (by positivity : 0 ≤ q) 3) + dsimp only [q, d8, m8] at hmulLower hmulUpper ⊢ + nlinarith + have hterm12 : + -3000000000000 * q ^ 7 ≤ d12 * m12 := by + have hmulLower := mul_le_mul_of_nonneg_left hm12 hd12.1 + have hmulUpper := mul_le_mul_of_nonneg_right hd12.2 + (pow_nonneg (by positivity : 0 ≤ q) 5) + dsimp only [q, d12, m12] at hmulLower hmulUpper ⊢ + nlinarith + have hterm14 : + -10000000000000 * q ^ 7 ≤ d14 * m14 := by + have hmulLower := mul_le_mul_of_nonneg_left hm14 hd14.1 + have hmulUpper := mul_le_mul_of_nonneg_right hd14.2 + (pow_nonneg (by positivity : 0 ≤ q) 6) + dsimp only [q, d14, m14] at hmulLower hmulUpper ⊢ + nlinarith + have hterm16 : + -(21000000000000 * B) * q ^ 7 ≤ d16 * m16 := by + have hmulLower := mul_le_mul_of_nonneg_left hm16 hd16.1 + have hmulUpper := mul_le_mul_of_nonneg_right hd16.2 + (mul_nonneg hB + (pow_nonneg (by positivity : 0 ≤ q) 7)) + dsimp only [q, d16, m16] at hmulLower hmulUpper ⊢ + nlinarith + have hsum : + -(133000020000000 + 21000000000000 * B) * q ^ 7 ≤ + d0 + d8 * m8 + d12 * m12 + d14 * m14 + d16 * m16 := by + have hq7 : 0 ≤ q ^ 7 := pow_nonneg (by positivity) 7 + linarith + rw [orderTwoCorrelationPowerSum_difference_eq_lowWeights f hn] + have hcard : 0 ≤ (Nat.card (reedMuller 2 n) : ℝ) := by positivity + have := mul_le_mul_of_nonneg_left hsum hcard + dsimp only [q, d0, d8, d12, d14, d16, m8, m12, m14, m16] at this ⊢ + nlinarith + +/-- Compatibility form using the earlier exceptional-family multiplicity +interface for the weight-sixteen character sum. -/ +theorem orderTwoCorrelationPowerSum_difference_ge + (f : BooleanFunction n) (hn : 7 ≤ n) + (hweightTwelve : HasWeightTwelveFlatPairClassification n) + (hweightFourteen : HasWeightFourteenFlatPairClassification n) + (typeA typeB : Finset (BooleanFunction n)) + (hweightSixteen : HasWeightSixteenExceptionalMultiplicity typeA typeB) + (hweightSixteenCounts : + HasWeightSixteenExceptionalCountBounds typeA typeB) : + orderTwoCorrelationPowerSum 8 f - + 15 * (2 : ℝ) ^ n * orderTwoCorrelationPowerSum 7 f ≥ + -500000000000000 * + ((Nat.card (reedMuller 2 n) : ℝ) * ((2 : ℝ) ^ n) ^ 7) := by + let q : ℝ := (2 : ℝ) ^ n + have hq : 2 ≤ q := by + dsimp only [q] + have hpow : (2 : ℕ) ^ 1 ≤ 2 ^ n := + Nat.pow_le_pow_right (by norm_num) (by omega) + exact_mod_cast hpow + have hm16Raw := orderTwoWeightSixteenCharacterSum_ge f typeA typeB + hweightSixteen hweightSixteenCounts + have hq5le : q ^ 5 ≤ q ^ 7 := by + calc + q ^ 5 ≤ q ^ 5 * q ^ 2 := + le_mul_of_one_le_right (pow_nonneg (by positivity) 5) + (one_le_pow₀ (by linarith : 1 ≤ q)) + _ = q ^ 7 := by ring + have hq6le : q ^ 6 ≤ q ^ 7 := by + calc + q ^ 6 ≤ q ^ 6 * q := + le_mul_of_one_le_right (pow_nonneg (by positivity) 6) + (by linarith : 1 ≤ q) + _ = q ^ 7 := by ring + have hq7 : 0 ≤ q ^ 7 := pow_nonneg (by positivity) 7 + have hm16 : -17 * ((2 : ℝ) ^ n) ^ 7 ≤ + orderTwoWeightSixteenCharacterSum f := by + dsimp only [q] at hq5le hq6le hq7 + linarith + have hgeneric := + orderTwoCorrelationPowerSum_difference_ge_of_weightSixteenCharacterSum + f hn hweightTwelve hweightFourteen 17 (by norm_num) (by + simpa only [neg_mul] using hm16) + have hscale : 0 ≤ + (Nat.card (reedMuller 2 n) : ℝ) * ((2 : ℝ) ^ n) ^ 7 := by + positivity + nlinarith + +end CryptBoolean diff --git a/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightEight.lean b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightEight.lean new file mode 100644 index 0000000..198ea7e --- /dev/null +++ b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightEight.lean @@ -0,0 +1,1116 @@ +/- +Copyright (c) 2026 Asher Yan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Asher Yan with Codex +-/ +module + +public import CryptBoolean.Carlet.Chapter04.HigherOrderLowWeightFlats +public import Mathlib.Data.Fintype.CardEmbedding +public import Mathlib.LinearAlgebra.AffineSpace.FiniteDimensional + +/-! +# The weight-eight dual character sum + +Carlet--Mesnager Proposition 9.2.10 for the minimum-weight words of +`RM(n - 3, n)`. +-/ + +open Finset +open scoped BigOperators BooleanCube + +@[expose] public section + +namespace CryptBoolean + +open FABL + +variable {n : ℕ} + +noncomputable local instance weightEightAffineSubspaceFintype : Fintype + (AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) := + Fintype.ofFinite _ + +noncomputable local instance weightEightAffineSubspaceDecidableEq : DecidableEq + (AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) := + Classical.decEq _ + +noncomputable local instance weightEightAffineSubspacePointFintype + (A : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) : Fintype A := + Fintype.ofFinite A + +/-- The weight-eight words in the dual Reed--Muller code `RM(n - 3,n)`. -/ +noncomputable def orderTwoWeightEightDualWords (n : ℕ) : + Finset (BooleanFunction n) := by + classical + exact (orderTwoDualWords n).filter fun h ↦ hammingWeight h = 8 + +/-- Carlet--Mesnager's `M_f^(8)`, as a canonical dual-code character sum. -/ +noncomputable def orderTwoWeightEightCharacterSum + (f : BooleanFunction n) : ℝ := + ∑ h ∈ orderTwoWeightEightDualWords n, + FABL.binarySign (booleanFunctionPairing n f h) + +private theorem mem_orderTwoWeightEightDualWords_iff_exists_flat + (h : BooleanFunction n) (hn : 3 ≤ n) : + h ∈ orderTwoWeightEightDualWords n ↔ + ∃ A ∈ binaryAffineFlats 3 n, h = binaryAffineFlatIndicator A := by + classical + constructor + · intro hh + have hh' : + h ∈ reedMuller (n - 3) n ∧ hammingWeight h = 8 := by + simpa only [orderTwoWeightEightDualWords, orderTwoDualWords, + Finset.mem_filter, Finset.mem_univ, true_and] using hh + have hdual : h ∈ reedMuller (n - 3) n := by + exact hh'.1 + have hweight : hammingWeight h = 8 := hh'.2 + have hnonzero : h ≠ 0 := by + intro hzero + subst h + simp at hweight + have hdegreeLe : FABL.functionAlgebraicDegree h ≤ n - 3 := by + simpa only [mem_reedMuller_iff] using hdual + have hdegree : FABL.functionAlgebraicDegree h = n - 3 := by + apply Nat.le_antisymm hdegreeLe + by_contra hnot + have hn4 : 4 ≤ n := by omega + have hdegreeFour : FABL.functionAlgebraicDegree h ≤ n - 4 := by + omega + have hlower := two_pow_sub_le_hammingWeight_of_degree_le + (r := n - 4) h hdegreeFour hnonzero + have hexponent : n - (n - 4) = 4 := by omega + rw [hexponent, hweight] at hlower + norm_num at hlower + have hweightPow : hammingWeight h = 2 ^ (n - (n - 3)) := by + rw [hweight] + have hexponent : n - (n - 3) = 3 := by omega + rw [hexponent] + norm_num + obtain ⟨H, a, hHrank, hhIndicator⟩ := + (degree_eq_and_hammingWeight_eq_iff_exists_affineFlatIndicator + h (r := n - 3) (by omega)).1 ⟨hdegree, hweightPow⟩ + let A : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) := + FABL.binaryAffineSubspace H a + have hAmem : A ∈ binaryAffineFlats 3 n := by + have hAne : A ≠ ⊥ := by + intro hbot + have haBot : a ∈ (⊥ : + AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) := by + rw [← hbot] + exact AffineSubspace.self_mem_mk' a H + rw [← SetLike.mem_coe, AffineSubspace.bot_coe] at haBot + exact haBot + have hArank : Module.finrank FABL.𝔽₂ A.direction = 3 := by + change Module.finrank FABL.𝔽₂ + (FABL.binaryAffineSubspace H a).direction = 3 + rw [FABL.binaryAffineSubspace_direction] + simpa only [show n - (n - 3) = 3 by omega] using hHrank + simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, + true_and] using And.intro hAne hArank + refine ⟨A, hAmem, ?_⟩ + rw [hhIndicator] + have hdirection : A.direction = H := by + exact FABL.binaryAffineSubspace_direction H a + rw [← hdirection] + exact (binaryAffineFlatIndicator_eq_affineFlatIndicator A a + (AffineSubspace.self_mem_mk' a H)).symm + · rintro ⟨A, hAmem, rfl⟩ + have hAdata : A ≠ ⊥ ∧ + Module.finrank FABL.𝔽₂ A.direction = 3 := by + simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, + true_and] using hAmem + have hA : A ≠ ⊥ := by + exact hAdata.1 + have hArank : Module.finrank FABL.𝔽₂ A.direction = 3 := by + exact hAdata.2 + obtain ⟨a, ha⟩ := (AffineSubspace.nonempty_iff_ne_bot A).2 hA + have hdegree : + FABL.functionAlgebraicDegree (binaryAffineFlatIndicator A) = n - 3 := by + rw [binaryAffineFlatIndicator_eq_affineFlatIndicator A a ha, + functionAlgebraicDegree_affineFlatIndicator, FABL.f₂Codimension, + FABL.finrank_perpendicularSubspace, hArank] + have hdual : binaryAffineFlatIndicator A ∈ reedMuller (n - 3) n := by + simpa only [mem_reedMuller_iff] using hdegree.le + have hweight : hammingWeight (binaryAffineFlatIndicator A) = 8 := by + rw [hammingWeight_binaryAffineFlatIndicator A hA, hArank] + norm_num + simp only [orderTwoWeightEightDualWords, orderTwoDualWords, + Finset.mem_filter, Finset.mem_univ, true_and] + exact ⟨hdual, hweight⟩ + +/-- Minimum-weight classification identifies the weight-eight dual words +with the indicators of the canonical three-dimensional affine flats. -/ +theorem orderTwoWeightEightDualWords_eq_affineFlatIndicators + (hn : 3 ≤ n) : + orderTwoWeightEightDualWords n = + (binaryAffineFlats 3 n).image binaryAffineFlatIndicator := by + classical + ext h + rw [Finset.mem_image] + exact (mem_orderTwoWeightEightDualWords_iff_exists_flat h hn).trans + (exists_congr fun A ↦ and_congr_right fun _ ↦ eq_comm) + +/-- The dual-code definition of `M_f^(8)` is the affine-three-flat +character sum used in Proposition 9.2.10. -/ +theorem orderTwoWeightEightCharacterSum_eq_affineFlatCharacterSum + (f : BooleanFunction n) (hn : 3 ≤ n) : + orderTwoWeightEightCharacterSum f = + binaryAffineFlatCharacterSum 3 f := by + classical + rw [orderTwoWeightEightCharacterSum, + orderTwoWeightEightDualWords_eq_affineFlatIndicators hn, + binaryAffineFlatCharacterSum] + rw [Finset.sum_image] + · rfl + · intro A hA B hB hAB + have hAdata : A ≠ ⊥ ∧ + Module.finrank FABL.𝔽₂ A.direction = 3 := by + have hA' : A ∈ binaryAffineFlats 3 n := hA + simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, + true_and] using hA' + have hBdata : B ≠ ⊥ ∧ + Module.finrank FABL.𝔽₂ B.direction = 3 := by + have hB' : B ∈ binaryAffineFlats 3 n := hB + simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, + true_and] using hB' + exact binaryAffineFlatIndicator_injective_on_nonempty + hAdata.1 hBdata.1 + hAB + +private abbrev AffinePlaneEmbedding (n : ℕ) := + Fin 3 ↪ FABL.F₂Cube n + +private def affinePlaneFirstDirection + (e : AffinePlaneEmbedding n) : FABL.F₂Cube n := + e 1 + e 0 + +private def affinePlaneSecondDirection + (e : AffinePlaneEmbedding n) : FABL.F₂Cube n := + e 2 + e 0 + +private theorem affinePlaneFirstDirection_ne_zero + (e : AffinePlaneEmbedding n) : + affinePlaneFirstDirection e ≠ 0 := by + intro hzero + have heq : e 1 + e 0 = e 0 + e 0 := + hzero.trans (ZModModule.add_self (e 0)).symm + have hindices : (1 : Fin 3) = 0 := + e.injective (add_right_cancel heq) + norm_num at hindices + +private theorem affinePlaneSecondDirection_ne_zero + (e : AffinePlaneEmbedding n) : + affinePlaneSecondDirection e ≠ 0 := by + intro hzero + have heq : e 2 + e 0 = e 0 + e 0 := + hzero.trans (ZModModule.add_self (e 0)).symm + have hindices : (2 : Fin 3) = 0 := + e.injective (add_right_cancel heq) + omega + +private theorem affinePlaneDirections_ne + (e : AffinePlaneEmbedding n) : + affinePlaneFirstDirection e ≠ affinePlaneSecondDirection e := by + intro heq + have hpoints : e 1 = e 2 := add_right_cancel heq + have hindices : (1 : Fin 3) = 2 := e.injective hpoints + omega + +private theorem affinePlaneSecondDirection_not_mem_firstSpan + (e : AffinePlaneEmbedding n) : + affinePlaneSecondDirection e ∉ + FABL.𝔽₂ ∙ affinePlaneFirstDirection e := by + rw [Submodule.mem_span_singleton] + rintro ⟨c, hc⟩ + by_cases hczero : c = 0 + · subst c + simp only [zero_smul] at hc + exact affinePlaneSecondDirection_ne_zero e hc.symm + · have hcone : c = 1 := Fin.eq_one_of_ne_zero c hczero + subst c + simp only [one_smul] at hc + exact affinePlaneDirections_ne e hc + +private noncomputable def affinePlaneThroughEmbedding + (e : AffinePlaneEmbedding n) : + AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) := + FABL.binaryAffineSubspace + ((FABL.𝔽₂ ∙ affinePlaneFirstDirection e) ⊔ + (FABL.𝔽₂ ∙ affinePlaneSecondDirection e)) + (e 0) + +private theorem affinePlaneThroughEmbedding_direction_finrank + (e : AffinePlaneEmbedding n) : + Module.finrank FABL.𝔽₂ (affinePlaneThroughEmbedding e).direction = 2 := by + rw [affinePlaneThroughEmbedding, FABL.binaryAffineSubspace_direction, + Submodule.finrank_sup_span_singleton + (affinePlaneSecondDirection_not_mem_firstSpan e), + finrank_span_singleton (affinePlaneFirstDirection_ne_zero e)] + +private theorem affinePlaneThroughEmbedding_ne_bot + (e : AffinePlaneEmbedding n) : + affinePlaneThroughEmbedding e ≠ ⊥ := by + intro hbot + have hmem : e 0 ∈ (⊥ : + AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) := by + rw [← hbot] + exact AffineSubspace.self_mem_mk' _ _ + rw [← SetLike.mem_coe, AffineSubspace.bot_coe] at hmem + exact hmem + +private theorem affinePlaneThroughEmbedding_mem_flats + (e : AffinePlaneEmbedding n) : + affinePlaneThroughEmbedding e ∈ binaryAffineFlats 2 n := by + simp only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, + true_and] + exact ⟨affinePlaneThroughEmbedding_ne_bot e, + affinePlaneThroughEmbedding_direction_finrank e⟩ + +private theorem neg_f₂Cube (x : FABL.F₂Cube n) : -x = x := by + funext i + exact ZMod.neg_eq_self_mod_two (x i) + +private theorem affinePlaneEmbedding_mem + (e : AffinePlaneEmbedding n) (i : Fin 3) : + e i ∈ affinePlaneThroughEmbedding e := by + fin_cases i + · exact AffineSubspace.self_mem_mk' _ _ + · rw [affinePlaneThroughEmbedding, + FABL.mem_binaryAffineSubspace_iff_add_mem] + exact (le_sup_left : + FABL.𝔽₂ ∙ affinePlaneFirstDirection e ≤ + (FABL.𝔽₂ ∙ affinePlaneFirstDirection e) ⊔ + (FABL.𝔽₂ ∙ affinePlaneSecondDirection e)) + (Submodule.mem_span_singleton_self (affinePlaneFirstDirection e)) + · rw [affinePlaneThroughEmbedding, + FABL.mem_binaryAffineSubspace_iff_add_mem] + exact (le_sup_right : + FABL.𝔽₂ ∙ affinePlaneSecondDirection e ≤ + (FABL.𝔽₂ ∙ affinePlaneFirstDirection e) ⊔ + (FABL.𝔽₂ ∙ affinePlaneSecondDirection e)) + (Submodule.mem_span_singleton_self (affinePlaneSecondDirection e)) + +private def affinePlaneEmbeddingOfSubtype + (A : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) + (e : Fin 3 ↪ A) : AffinePlaneEmbedding n := + e.trans (Function.Embedding.subtype _) + +private theorem affinePlaneThroughEmbeddingOfSubtype_eq + (A : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) + (hA : A ∈ binaryAffineFlats 2 n) (e : Fin 3 ↪ A) : + affinePlaneThroughEmbedding (affinePlaneEmbeddingOfSubtype A e) = A := by + have hAdata : A ≠ ⊥ ∧ Module.finrank FABL.𝔽₂ A.direction = 2 := by + simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, + true_and] using hA + let e' := affinePlaneEmbeddingOfSubtype A e + have hfirst : affinePlaneFirstDirection e' ∈ A.direction := by + have hvsub := AffineSubspace.vsub_mem_direction (e 1).2 (e 0).2 + change (e 1 : FABL.F₂Cube n) - (e 0 : FABL.F₂Cube n) ∈ A.direction at hvsub + rw [sub_eq_add_neg, neg_f₂Cube] at hvsub + simpa only [affinePlaneFirstDirection, e', affinePlaneEmbeddingOfSubtype, + Function.Embedding.trans_apply, Function.Embedding.subtype_apply] using hvsub + have hsecond : affinePlaneSecondDirection e' ∈ A.direction := by + have hvsub := AffineSubspace.vsub_mem_direction (e 2).2 (e 0).2 + change (e 2 : FABL.F₂Cube n) - (e 0 : FABL.F₂Cube n) ∈ A.direction at hvsub + rw [sub_eq_add_neg, neg_f₂Cube] at hvsub + simpa only [affinePlaneSecondDirection, e', affinePlaneEmbeddingOfSubtype, + Function.Embedding.trans_apply, Function.Embedding.subtype_apply] using hvsub + have hdirectionLe : (affinePlaneThroughEmbedding e').direction ≤ A.direction := by + rw [affinePlaneThroughEmbedding, FABL.binaryAffineSubspace_direction] + exact sup_le + (Submodule.span_le.2 (Set.singleton_subset_iff.2 hfirst)) + (Submodule.span_le.2 (Set.singleton_subset_iff.2 hsecond)) + have hdirection : (affinePlaneThroughEmbedding e').direction = A.direction := by + apply Submodule.eq_of_le_of_finrank_eq hdirectionLe + rw [affinePlaneThroughEmbedding_direction_finrank, hAdata.2] + apply (AffineSubspace.eq_iff_direction_eq_of_mem + (affinePlaneEmbedding_mem e' 0) (e 0).2).2 + exact hdirection + +private noncomputable def affinePlaneFiberEquiv + (A : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) + (hA : A ∈ binaryAffineFlats 2 n) : + {e : AffinePlaneEmbedding n // affinePlaneThroughEmbedding e = A} ≃ + (Fin 3 ↪ A) where + toFun e := + { toFun := fun i ↦ ⟨e.1 i, by + have hi := affinePlaneEmbedding_mem e.1 i + simpa only [e.2] using hi⟩ + inj' := fun _ _ hij ↦ e.1.injective (congrArg Subtype.val hij) } + invFun e := + ⟨affinePlaneEmbeddingOfSubtype A e, + affinePlaneThroughEmbeddingOfSubtype_eq A hA e⟩ + left_inv e := by + apply Subtype.ext + apply Function.Embedding.ext + intro i + rfl + right_inv e := by + apply Function.Embedding.ext + intro i + rfl + +private theorem affinePlaneFiber_card + (A : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) + (hA : A ∈ binaryAffineFlats 2 n) : + ((Finset.univ : Finset (AffinePlaneEmbedding n)).filter fun e ↦ + affinePlaneThroughEmbedding e = A).card = 24 := by + classical + have hAdata : A ≠ ⊥ ∧ Module.finrank FABL.𝔽₂ A.direction = 2 := by + simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, + true_and] using hA + rw [← Fintype.card_subtype] + rw [Fintype.card_congr (affinePlaneFiberEquiv A hA), + Fintype.card_embedding_eq] + have hcardA : Fintype.card A = 4 := by + rw [Fintype.card_subtype] + change (binaryAffineFlatPoints A).card = 4 + rw [card_binaryAffineFlatPoints A hAdata.1, hAdata.2] + norm_num + rw [hcardA] + decide + +/-- The number of affine two-flats is +`2^n (2^n - 1) (2^n - 2) / 24`, in division-free form. -/ +theorem card_binaryAffineFlats_two (n : ℕ) : + (binaryAffineFlats 2 n).card * 24 = + 2 ^ n * (2 ^ n - 1) * (2 ^ n - 2) := by + classical + have hmaps : + ((Finset.univ : Finset (AffinePlaneEmbedding n)) : + Set (AffinePlaneEmbedding n)).MapsTo + affinePlaneThroughEmbedding (binaryAffineFlats 2 n) := by + intro e _he + exact affinePlaneThroughEmbedding_mem_flats e + have hfiber := Finset.card_eq_sum_card_fiberwise hmaps + calc + (binaryAffineFlats 2 n).card * 24 = + ∑ A ∈ binaryAffineFlats 2 n, + (((Finset.univ : Finset (AffinePlaneEmbedding n)).filter fun e ↦ + affinePlaneThroughEmbedding e = A).card) := by + symm + exact Finset.sum_const_nat fun A hA ↦ affinePlaneFiber_card A hA + _ = (Finset.univ : Finset (AffinePlaneEmbedding n)).card := hfiber.symm + _ = (2 ^ n).descFactorial 3 := by + rw [Finset.card_univ, Fintype.card_embedding_eq, + Fintype.card_fin, card_f₂Cube] + _ = 2 ^ n * (2 ^ n - 1) * (2 ^ n - 2) := by + simp [Nat.descFactorial_succ] + ring + +private noncomputable def parallelAffinePlanePairs (n : ℕ) : + Finset + (AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × + AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) := by + classical + exact ((binaryAffineFlats 2 n).product (binaryAffineFlats 2 n)).filter + fun p ↦ p.1.direction = p.2.direction + +private noncomputable def distinctParallelAffinePlanePairs (n : ℕ) : + Finset + (AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × + AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) := by + classical + exact (parallelAffinePlanePairs n).filter fun p ↦ p.1 ≠ p.2 + +private def affineThreeFlatOfParallelPair + (p : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × + AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) : + AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) := + p.1 ⊔ p.2 + +private theorem affinePlaneData_of_mem_parallelPairs + {p : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × + AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)} + (hp : p ∈ parallelAffinePlanePairs n) : + p.1 ∈ binaryAffineFlats 2 n ∧ + p.2 ∈ binaryAffineFlats 2 n ∧ + p.1.direction = p.2.direction := by + have hp' : + p ∈ (binaryAffineFlats 2 n).product (binaryAffineFlats 2 n) ∧ + p.1.direction = p.2.direction := by + simpa only [parallelAffinePlanePairs, Finset.mem_filter] using hp + have hproduct := Finset.mem_product.mp hp'.1 + exact ⟨hproduct.1, hproduct.2, hp'.2⟩ + +private theorem affinePlaneData_of_mem_distinctParallelPairs + {p : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × + AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)} + (hp : p ∈ distinctParallelAffinePlanePairs n) : + p.1 ∈ binaryAffineFlats 2 n ∧ + p.2 ∈ binaryAffineFlats 2 n ∧ + p.1.direction = p.2.direction ∧ p.1 ≠ p.2 := by + have hp' : p ∈ parallelAffinePlanePairs n ∧ p.1 ≠ p.2 := by + simpa only [distinctParallelAffinePlanePairs, Finset.mem_filter] using hp + obtain ⟨hfirst, hsecond, hdirection⟩ := + affinePlaneData_of_mem_parallelPairs hp'.1 + exact ⟨hfirst, hsecond, hdirection, hp'.2⟩ + +private theorem parallelAffinePlanes_disjoint + {A B : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)} + (hdirection : A.direction = B.direction) (hne : A ≠ B) : + Disjoint (binaryAffineFlatPoints A) (binaryAffineFlatPoints B) := by + rw [Finset.disjoint_left] + intro x hxA hxB + apply hne + have hxA' : x ∈ A := by + simpa only [binaryAffineFlatPoints, Finset.mem_filter, + Finset.mem_univ, true_and] using hxA + have hxB' : x ∈ B := by + simpa only [binaryAffineFlatPoints, Finset.mem_filter, + Finset.mem_univ, true_and] using hxB + exact (AffineSubspace.eq_iff_direction_eq_of_mem hxA' hxB').2 hdirection + +private theorem affineThreeFlatOfParallelPair_mem_flats + {p : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × + AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)} + (hp : p ∈ distinctParallelAffinePlanePairs n) : + affineThreeFlatOfParallelPair p ∈ binaryAffineFlats 3 n := by + obtain ⟨hA, hB, hdirection, hne⟩ := + affinePlaneData_of_mem_distinctParallelPairs hp + have hAdata : p.1 ≠ ⊥ ∧ Module.finrank FABL.𝔽₂ p.1.direction = 2 := by + simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, + true_and] using hA + have hBdata : p.2 ≠ ⊥ ∧ Module.finrank FABL.𝔽₂ p.2.direction = 2 := by + simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, + true_and] using hB + obtain ⟨a, ha⟩ := (AffineSubspace.nonempty_iff_ne_bot p.1).2 hAdata.1 + obtain ⟨b, hb⟩ := (AffineSubspace.nonempty_iff_ne_bot p.2).2 hBdata.1 + have hdifference : b -ᵥ a ∉ p.1.direction := by + intro hdifference + have hbA : b ∈ p.1 := by + simpa only [vsub_vadd] using + (AffineSubspace.vadd_mem_of_mem_direction hdifference ha) + exact hne (AffineSubspace.ext_of_direction_eq hdirection ⟨b, hbA, hb⟩) + have hnebot : affineThreeFlatOfParallelPair p ≠ ⊥ := by + intro hbot + have haBot : a ∈ (⊥ : + AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) := by + rw [← hbot] + exact (le_sup_left : p.1 ≤ p.1 ⊔ p.2) ha + rw [← SetLike.mem_coe, AffineSubspace.bot_coe] at haBot + exact haBot + have hrank : Module.finrank FABL.𝔽₂ + (affineThreeFlatOfParallelPair p).direction = 3 := by + rw [affineThreeFlatOfParallelPair, + AffineSubspace.direction_sup ha hb, ← hdirection, sup_idem, + Submodule.finrank_sup_span_singleton hdifference, hAdata.2] + simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, + true_and] using And.intro hnebot hrank + +private theorem points_affineThreeFlatOfParallelPair + {p : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × + AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)} + (hp : p ∈ distinctParallelAffinePlanePairs n) : + binaryAffineFlatPoints (affineThreeFlatOfParallelPair p) = + binaryAffineFlatPoints p.1 ∪ binaryAffineFlatPoints p.2 := by + obtain ⟨hA, hB, hdirection, hne⟩ := + affinePlaneData_of_mem_distinctParallelPairs hp + have hAdata : p.1 ≠ ⊥ ∧ Module.finrank FABL.𝔽₂ p.1.direction = 2 := by + simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, + true_and] using hA + have hBdata : p.2 ≠ ⊥ ∧ Module.finrank FABL.𝔽₂ p.2.direction = 2 := by + simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, + true_and] using hB + have hC := affineThreeFlatOfParallelPair_mem_flats hp + have hCdata : affineThreeFlatOfParallelPair p ≠ ⊥ ∧ + Module.finrank FABL.𝔽₂ + (affineThreeFlatOfParallelPair p).direction = 3 := by + simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, + true_and] using hC + symm + apply Finset.eq_of_subset_of_card_le + · intro x hx + simp only [Finset.mem_union] at hx + simp only [binaryAffineFlatPoints, Finset.mem_filter, Finset.mem_univ, + true_and] at hx ⊢ + exact hx.elim (fun hxA ↦ (le_sup_left : p.1 ≤ p.1 ⊔ p.2) hxA) + (fun hxB ↦ (le_sup_right : p.2 ≤ p.1 ⊔ p.2) hxB) + · rw [card_binaryAffineFlatPoints _ hCdata.1, hCdata.2, + Finset.card_union_of_disjoint + (parallelAffinePlanes_disjoint hdirection hne), + card_binaryAffineFlatPoints _ hAdata.1, hAdata.2, + card_binaryAffineFlatPoints _ hBdata.1, hBdata.2] + norm_num + +private theorem indicator_affineThreeFlatOfParallelPair + {p : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × + AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)} + (hp : p ∈ distinctParallelAffinePlanePairs n) : + binaryAffineFlatIndicator (affineThreeFlatOfParallelPair p) = + binaryAffineFlatIndicator p.1 + binaryAffineFlatIndicator p.2 := by + have hpoints := points_affineThreeFlatOfParallelPair hp + have hdisjoint := parallelAffinePlanes_disjoint + (affinePlaneData_of_mem_distinctParallelPairs hp).2.2.1 + (affinePlaneData_of_mem_distinctParallelPairs hp).2.2.2 + exact binaryAffineFlatIndicator_eq_add_of_points_eq_union + p.1 p.2 (affineThreeFlatOfParallelPair p) hpoints hdisjoint + +private theorem character_affineThreeFlatOfParallelPair + (f : BooleanFunction n) + {p : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × + AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)} + (hp : p ∈ distinctParallelAffinePlanePairs n) : + binaryAffineFlatCharacter f (affineThreeFlatOfParallelPair p) = + binaryAffineFlatCharacter f p.1 * binaryAffineFlatCharacter f p.2 := by + exact binaryAffineFlatCharacter_eq_mul_of_indicator_eq_add + f p.1 p.2 (affineThreeFlatOfParallelPair p) + (indicator_affineThreeFlatOfParallelPair hp) + +private noncomputable def affinePlanesIn + (C : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) : + Finset (AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) := by + classical + exact (binaryAffineFlats 2 n).filter fun A ↦ A ≤ C + +private theorem affinePlaneThroughEmbeddingOfSubtype_le + (C : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) + (e : Fin 3 ↪ C) : + affinePlaneThroughEmbedding (affinePlaneEmbeddingOfSubtype C e) ≤ C := by + let e' := affinePlaneEmbeddingOfSubtype C e + have hfirst : affinePlaneFirstDirection e' ∈ C.direction := by + have hvsub := AffineSubspace.vsub_mem_direction (e 1).2 (e 0).2 + change (e 1 : FABL.F₂Cube n) - (e 0 : FABL.F₂Cube n) ∈ C.direction at hvsub + rw [sub_eq_add_neg, neg_f₂Cube] at hvsub + simpa only [affinePlaneFirstDirection, e', affinePlaneEmbeddingOfSubtype, + Function.Embedding.trans_apply, Function.Embedding.subtype_apply] using hvsub + have hsecond : affinePlaneSecondDirection e' ∈ C.direction := by + have hvsub := AffineSubspace.vsub_mem_direction (e 2).2 (e 0).2 + change (e 2 : FABL.F₂Cube n) - (e 0 : FABL.F₂Cube n) ∈ C.direction at hvsub + rw [sub_eq_add_neg, neg_f₂Cube] at hvsub + simpa only [affinePlaneSecondDirection, e', affinePlaneEmbeddingOfSubtype, + Function.Embedding.trans_apply, Function.Embedding.subtype_apply] using hvsub + have hdirectionLe : (affinePlaneThroughEmbedding e').direction ≤ C.direction := by + rw [affinePlaneThroughEmbedding, FABL.binaryAffineSubspace_direction] + exact sup_le + (Submodule.span_le.2 (Set.singleton_subset_iff.2 hfirst)) + (Submodule.span_le.2 (Set.singleton_subset_iff.2 hsecond)) + intro x hx + have hbase : (e' 0) ∈ C := (e 0).2 + have hdiffPlane : x -ᵥ e' 0 ∈ (affinePlaneThroughEmbedding e').direction := + AffineSubspace.vsub_mem_direction hx (affinePlaneEmbedding_mem e' 0) + have hdiffC : x -ᵥ e' 0 ∈ C.direction := hdirectionLe hdiffPlane + simpa only [vsub_vadd] using + (AffineSubspace.vadd_mem_of_mem_direction hdiffC hbase) + +private theorem affinePlaneThroughSubtype_mem_affinePlanesIn + (C : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) + (e : Fin 3 ↪ C) : + affinePlaneThroughEmbedding (affinePlaneEmbeddingOfSubtype C e) ∈ + affinePlanesIn C := by + simp only [affinePlanesIn, Finset.mem_filter] + exact ⟨affinePlaneThroughEmbedding_mem_flats _, + affinePlaneThroughEmbeddingOfSubtype_le C e⟩ + +private noncomputable def affinePlaneInFiberEquiv + (C A : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) + (hA : A ∈ affinePlanesIn C) : + {e : Fin 3 ↪ C // + affinePlaneThroughEmbedding (affinePlaneEmbeddingOfSubtype C e) = A} ≃ + (Fin 3 ↪ A) where + toFun e := + { toFun := fun i ↦ ⟨e.1 i, by + have hi := affinePlaneEmbedding_mem + (affinePlaneEmbeddingOfSubtype C e.1) i + have hset : + (affinePlaneThroughEmbedding + (affinePlaneEmbeddingOfSubtype C e.1) : Set (FABL.F₂Cube n)) = + (A : Set (FABL.F₂Cube n)) := congrArg SetLike.coe e.2 + have hiA : + affinePlaneEmbeddingOfSubtype C e.1 i ∈ (A : Set (FABL.F₂Cube n)) := + (Set.ext_iff.mp hset _).mp hi + change (e.1 i : FABL.F₂Cube n) ∈ (A : Set (FABL.F₂Cube n)) at hiA + change (e.1 i : FABL.F₂Cube n) ∈ (A : Set (FABL.F₂Cube n)) + exact hiA⟩ + inj' := by + intro i j hij + have hval : (e.1 i : FABL.F₂Cube n) = + (e.1 j : FABL.F₂Cube n) := + congrArg (fun z : A ↦ (z : FABL.F₂Cube n)) hij + apply e.1.injective + apply Subtype.ext + exact hval } + invFun e := by + have hAdata : A ∈ binaryAffineFlats 2 n ∧ A ≤ C := by + simpa only [affinePlanesIn, Finset.mem_filter] using hA + let eC : Fin 3 ↪ C := + { toFun := fun i ↦ ⟨e i, hAdata.2 (e i).2⟩ + inj' := by + intro i j hij + have hval : (e i : FABL.F₂Cube n) = + (e j : FABL.F₂Cube n) := + congrArg (fun z : C ↦ (z : FABL.F₂Cube n)) hij + apply e.injective + apply Subtype.ext + exact hval } + refine ⟨eC, ?_⟩ + have hembedding : affinePlaneEmbeddingOfSubtype C eC = + affinePlaneEmbeddingOfSubtype A e := by + apply Function.Embedding.ext + intro i + rfl + rw [hembedding] + exact affinePlaneThroughEmbeddingOfSubtype_eq A hAdata.1 e + left_inv e := by + apply Subtype.ext + apply Function.Embedding.ext + intro i + rfl + right_inv e := by + apply Function.Embedding.ext + intro i + rfl + +private theorem affinePlaneInFiber_card + (C A : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) + (hA : A ∈ affinePlanesIn C) : + ((Finset.univ : Finset (Fin 3 ↪ C)).filter fun e ↦ + affinePlaneThroughEmbedding (affinePlaneEmbeddingOfSubtype C e) = A).card = 24 := by + classical + have hAdata : A ∈ binaryAffineFlats 2 n ∧ A ≤ C := by + simpa only [affinePlanesIn, Finset.mem_filter] using hA + have hAflat : A ≠ ⊥ ∧ Module.finrank FABL.𝔽₂ A.direction = 2 := by + simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, + true_and] using hAdata.1 + rw [← Fintype.card_subtype] + rw [Fintype.card_congr (affinePlaneInFiberEquiv C A hA), + Fintype.card_embedding_eq] + have hcardA : Fintype.card A = 4 := by + rw [Fintype.card_subtype] + change (binaryAffineFlatPoints A).card = 4 + rw [card_binaryAffineFlatPoints A hAflat.1, hAflat.2] + norm_num + rw [hcardA] + decide + +private theorem card_affinePlanesIn + (C : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) + (hC : C ∈ binaryAffineFlats 3 n) : + (affinePlanesIn C).card = 14 := by + classical + have hCdata : C ≠ ⊥ ∧ Module.finrank FABL.𝔽₂ C.direction = 3 := by + simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, + true_and] using hC + have hmaps : + ((Finset.univ : Finset (Fin 3 ↪ C)) : Set (Fin 3 ↪ C)).MapsTo + (fun e ↦ affinePlaneThroughEmbedding + (affinePlaneEmbeddingOfSubtype C e)) (affinePlanesIn C) := by + intro e _he + exact affinePlaneThroughSubtype_mem_affinePlanesIn C e + have hfiber := Finset.card_eq_sum_card_fiberwise hmaps + have hcardC : Fintype.card C = 8 := by + rw [Fintype.card_subtype] + change (binaryAffineFlatPoints C).card = 8 + rw [card_binaryAffineFlatPoints C hCdata.1, hCdata.2] + norm_num + have hcount : (affinePlanesIn C).card * 24 = 336 := by + calc + (affinePlanesIn C).card * 24 = + ∑ A ∈ affinePlanesIn C, + (((Finset.univ : Finset (Fin 3 ↪ C)).filter fun e ↦ + affinePlaneThroughEmbedding + (affinePlaneEmbeddingOfSubtype C e) = A).card) := by + symm + exact Finset.sum_const_nat fun A hA ↦ affinePlaneInFiber_card C A hA + _ = (Finset.univ : Finset (Fin 3 ↪ C)).card := hfiber.symm + _ = 336 := by + rw [Finset.card_univ, Fintype.card_embedding_eq, + Fintype.card_fin, hcardC] + decide + omega + +private theorem mem_affineThreeFlatOfParallelPair_iff + {p : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × + AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)} + (hp : p ∈ distinctParallelAffinePlanePairs n) + (x : FABL.F₂Cube n) : + x ∈ affineThreeFlatOfParallelPair p ↔ x ∈ p.1 ∨ x ∈ p.2 := by + have hpoints := points_affineThreeFlatOfParallelPair hp + have hx := Finset.ext_iff.mp hpoints x + simpa only [binaryAffineFlatPoints, Finset.mem_filter, Finset.mem_univ, + true_and, Finset.mem_union] using hx + +private theorem exists_parallelAffinePlaneComplement + (C A : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) + (hC : C ∈ binaryAffineFlats 3 n) + (hA : A ∈ affinePlanesIn C) : + ∃ B : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n), + (A, B) ∈ distinctParallelAffinePlanePairs n ∧ A ⊔ B = C := by + have hCdata : C ≠ ⊥ ∧ Module.finrank FABL.𝔽₂ C.direction = 3 := by + simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, + true_and] using hC + have hAdata : A ∈ binaryAffineFlats 2 n ∧ A ≤ C := by + simpa only [affinePlanesIn, Finset.mem_filter] using hA + have hAflat : A ≠ ⊥ ∧ Module.finrank FABL.𝔽₂ A.direction = 2 := by + simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, + true_and] using hAdata.1 + have hdirectionLe : A.direction ≤ C.direction := + AffineSubspace.direction_le hAdata.2 + have hdirectionLt : A.direction < C.direction := + Submodule.lt_of_le_of_finrank_lt_finrank hdirectionLe (by + rw [hAflat.2, hCdata.2] + omega) + obtain ⟨d, hdC, hdA⟩ := SetLike.exists_of_lt hdirectionLt + obtain ⟨a, ha⟩ := (AffineSubspace.nonempty_iff_ne_bot A).2 hAflat.1 + let b : FABL.F₂Cube n := d +ᵥ a + have haC : a ∈ C := hAdata.2 ha + have hbC : b ∈ C := by + exact AffineSubspace.vadd_mem_of_mem_direction hdC haC + have hbA : b ∉ A := by + intro hbA + have hdirection := AffineSubspace.vsub_mem_direction hbA ha + have hdb : b -ᵥ a = d := by simp [b] + exact hdA (hdb ▸ hdirection) + let B : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) := + FABL.binaryAffineSubspace A.direction b + have hBne : B ≠ ⊥ := by + intro hbot + have hbBot : b ∈ (⊥ : + AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) := by + rw [← hbot] + exact AffineSubspace.self_mem_mk' _ _ + rw [← SetLike.mem_coe, AffineSubspace.bot_coe] at hbBot + exact hbBot + have hBflat : B ∈ binaryAffineFlats 2 n := by + have hBrank : Module.finrank FABL.𝔽₂ B.direction = 2 := by + change Module.finrank FABL.𝔽₂ + (FABL.binaryAffineSubspace A.direction b).direction = 2 + rw [FABL.binaryAffineSubspace_direction, hAflat.2] + simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, + true_and] using And.intro hBne hBrank + have hBdirection : B.direction = A.direction := by + exact FABL.binaryAffineSubspace_direction A.direction b + have hABne : A ≠ B := by + intro hAB + apply hbA + rw [hAB] + exact AffineSubspace.self_mem_mk' _ _ + have hpair : (A, B) ∈ distinctParallelAffinePlanePairs n := by + have hparallel : (A, B) ∈ parallelAffinePlanePairs n := by + simp only [parallelAffinePlanePairs, Finset.mem_filter] + exact ⟨Finset.mem_product.mpr ⟨hAdata.1, hBflat⟩, + hBdirection.symm⟩ + simpa only [distinctParallelAffinePlanePairs, Finset.mem_filter] using + And.intro hparallel hABne + have hBle : B ≤ C := by + intro x hx + have hdiffB : x -ᵥ b ∈ B.direction := + AffineSubspace.vsub_mem_direction hx (AffineSubspace.self_mem_mk' _ _) + have hdiffC : x -ᵥ b ∈ C.direction := by + rw [hBdirection] at hdiffB + exact hdirectionLe hdiffB + simpa only [vsub_vadd] using + (AffineSubspace.vadd_mem_of_mem_direction hdiffC hbC) + have hhullLe : A ⊔ B ≤ C := sup_le hAdata.2 hBle + have hhullFlat := affineThreeFlatOfParallelPair_mem_flats hpair + have hhullData : A ⊔ B ≠ ⊥ ∧ + Module.finrank FABL.𝔽₂ (A ⊔ B).direction = 3 := by + simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, + true_and, affineThreeFlatOfParallelPair] using hhullFlat + have hdirectionHull : (A ⊔ B).direction = C.direction := by + apply Submodule.eq_of_le_of_finrank_eq (AffineSubspace.direction_le hhullLe) + rw [hhullData.2, hCdata.2] + have hhull : A ⊔ B = C := + AffineSubspace.eq_of_direction_eq_of_nonempty_of_le hdirectionHull + ⟨a, (le_sup_left : A ≤ A ⊔ B) ha⟩ hhullLe + exact ⟨B, hpair, hhull⟩ + +private theorem distinctParallelPair_eq_of_first_eq_of_hull_eq + {p q : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × + AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)} + (hp : p ∈ distinctParallelAffinePlanePairs n) + (hq : q ∈ distinctParallelAffinePlanePairs n) + (hfirst : p.1 = q.1) + (hhull : affineThreeFlatOfParallelPair p = + affineThreeFlatOfParallelPair q) : + p = q := by + apply Prod.ext + · exact hfirst + · obtain ⟨hpA, hpB, hpdir, hpne⟩ := + affinePlaneData_of_mem_distinctParallelPairs hp + obtain ⟨hqA, hqB, hqdir, hqne⟩ := + affinePlaneData_of_mem_distinctParallelPairs hq + have hpBdata : p.2 ≠ ⊥ ∧ Module.finrank FABL.𝔽₂ p.2.direction = 2 := by + simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, + true_and] using hpB + obtain ⟨b, hb⟩ := (AffineSubspace.nonempty_iff_ne_bot p.2).2 hpBdata.1 + have hbNotFirst : b ∉ p.1 := by + intro hbFirst + exact hpne (AffineSubspace.ext_of_direction_eq hpdir ⟨b, hbFirst, hb⟩) + have hbNotQfirst : b ∉ q.1 := by + rw [← hfirst] + exact hbNotFirst + have hbHullQ : b ∈ affineThreeFlatOfParallelPair q := by + rw [← hhull] + exact (le_sup_right : p.2 ≤ p.1 ⊔ p.2) hb + have hbQ : b ∈ q.2 := + ((mem_affineThreeFlatOfParallelPair_iff hq b).1 hbHullQ).resolve_left hbNotQfirst + have hdirection : p.2.direction = q.2.direction := + hpdir.symm.trans ((congrArg AffineSubspace.direction hfirst).trans hqdir) + exact AffineSubspace.ext_of_direction_eq hdirection ⟨b, hb, hbQ⟩ + +private theorem parallelPairFiber_card + (C : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) + (hC : C ∈ binaryAffineFlats 3 n) : + ((distinctParallelAffinePlanePairs n).filter fun p ↦ + affineThreeFlatOfParallelPair p = C).card = 14 := by + classical + rw [← card_affinePlanesIn C hC] + apply Finset.card_bij (fun p _hp ↦ p.1) + · intro p hp + have hp' : p ∈ distinctParallelAffinePlanePairs n ∧ + affineThreeFlatOfParallelPair p = C := by + simpa only [Finset.mem_filter] using hp + simp only [affinePlanesIn, Finset.mem_filter] + exact ⟨(affinePlaneData_of_mem_distinctParallelPairs hp'.1).1, + (le_sup_left : p.1 ≤ affineThreeFlatOfParallelPair p).trans_eq hp'.2⟩ + · intro p hp q hq hfirst + have hp' : p ∈ distinctParallelAffinePlanePairs n ∧ + affineThreeFlatOfParallelPair p = C := by + simpa only [Finset.mem_filter] using hp + have hq' : q ∈ distinctParallelAffinePlanePairs n ∧ + affineThreeFlatOfParallelPair q = C := by + simpa only [Finset.mem_filter] using hq + exact distinctParallelPair_eq_of_first_eq_of_hull_eq + hp'.1 hq'.1 hfirst (hp'.2.trans hq'.2.symm) + · intro A hA + obtain ⟨B, hpair, hhull⟩ := + exists_parallelAffinePlaneComplement C A hC hA + refine ⟨(A, B), ?_, rfl⟩ + simpa only [Finset.mem_filter, affineThreeFlatOfParallelPair] using + And.intro hpair hhull + +private theorem distinctParallelPairCharacterSum_eq_fourteen_mul + (f : BooleanFunction n) : + (∑ p ∈ distinctParallelAffinePlanePairs n, + binaryAffineFlatCharacter f p.1 * binaryAffineFlatCharacter f p.2) = + 14 * binaryAffineFlatCharacterSum 3 f := by + classical + calc + (∑ p ∈ distinctParallelAffinePlanePairs n, + binaryAffineFlatCharacter f p.1 * binaryAffineFlatCharacter f p.2) = + ∑ C ∈ binaryAffineFlats 3 n, + ∑ p ∈ (distinctParallelAffinePlanePairs n).filter fun p ↦ + affineThreeFlatOfParallelPair p = C, + binaryAffineFlatCharacter f p.1 * + binaryAffineFlatCharacter f p.2 := by + symm + apply Finset.sum_fiberwise_of_maps_to + intro p hp + exact affineThreeFlatOfParallelPair_mem_flats hp + _ = ∑ C ∈ binaryAffineFlats 3 n, + 14 * binaryAffineFlatCharacter f C := by + apply Finset.sum_congr rfl + intro C hC + calc + (∑ p ∈ (distinctParallelAffinePlanePairs n).filter fun p ↦ + affineThreeFlatOfParallelPair p = C, + binaryAffineFlatCharacter f p.1 * + binaryAffineFlatCharacter f p.2) = + ∑ p ∈ (distinctParallelAffinePlanePairs n).filter fun p ↦ + affineThreeFlatOfParallelPair p = C, + binaryAffineFlatCharacter f C := by + apply Finset.sum_congr rfl + intro p hp + have hp' : p ∈ distinctParallelAffinePlanePairs n ∧ + affineThreeFlatOfParallelPair p = C := by + simpa only [Finset.mem_filter] using hp + rw [← hp'.2, character_affineThreeFlatOfParallelPair f hp'.1] + _ = 14 * binaryAffineFlatCharacter f C := by + rw [Finset.sum_const, nsmul_eq_mul, + parallelPairFiber_card C hC] + norm_num + _ = 14 * binaryAffineFlatCharacterSum 3 f := by + rw [binaryAffineFlatCharacterSum] + simp only [Finset.mul_sum] + +private noncomputable def affinePlaneDirections (n : ℕ) : + Finset (Submodule FABL.𝔽₂ (FABL.F₂Cube n)) := by + classical + exact (binaryAffineFlats 2 n).image AffineSubspace.direction + +private noncomputable def affinePlanesWithDirection + (H : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) : + Finset (AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) := by + classical + exact (binaryAffineFlats 2 n).filter fun A ↦ A.direction = H + +private theorem parallelPairFiber_eq_product + (H : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) : + (parallelAffinePlanePairs n).filter (fun p ↦ p.1.direction = H) = + (affinePlanesWithDirection H).product + (affinePlanesWithDirection H) := by + classical + ext p + constructor + · intro hp + have hpOuter := Finset.mem_filter.mp hp + have hpParallel := Finset.mem_filter.mp hpOuter.1 + have hpProduct := Finset.mem_product.mp hpParallel.1 + apply Finset.mem_product.mpr + exact ⟨Finset.mem_filter.mpr ⟨hpProduct.1, hpOuter.2⟩, + Finset.mem_filter.mpr + ⟨hpProduct.2, hpParallel.2.symm.trans hpOuter.2⟩⟩ + · intro hp + have hpProduct := Finset.mem_product.mp hp + have hpFirst := Finset.mem_filter.mp hpProduct.1 + have hpSecond := Finset.mem_filter.mp hpProduct.2 + apply Finset.mem_filter.mpr + refine ⟨Finset.mem_filter.mpr ?_, hpFirst.2⟩ + exact ⟨Finset.mem_product.mpr ⟨hpFirst.1, hpSecond.1⟩, + hpFirst.2.trans hpSecond.2.symm⟩ + +private theorem parallelPairCharacterSum_eq_directionSquares + (f : BooleanFunction n) : + (∑ p ∈ parallelAffinePlanePairs n, + binaryAffineFlatCharacter f p.1 * binaryAffineFlatCharacter f p.2) = + ∑ H ∈ affinePlaneDirections n, + (∑ A ∈ affinePlanesWithDirection H, + binaryAffineFlatCharacter f A) ^ 2 := by + classical + calc + (∑ p ∈ parallelAffinePlanePairs n, + binaryAffineFlatCharacter f p.1 * binaryAffineFlatCharacter f p.2) = + ∑ H ∈ affinePlaneDirections n, + ∑ p ∈ (parallelAffinePlanePairs n).filter fun p ↦ + p.1.direction = H, + binaryAffineFlatCharacter f p.1 * + binaryAffineFlatCharacter f p.2 := by + symm + apply Finset.sum_fiberwise_of_maps_to + intro p hp + have hpdata := affinePlaneData_of_mem_parallelPairs hp + simp only [affinePlaneDirections, Finset.mem_image] + exact ⟨p.1, hpdata.1, rfl⟩ + _ = ∑ H ∈ affinePlaneDirections n, + (∑ A ∈ affinePlanesWithDirection H, + binaryAffineFlatCharacter f A) ^ 2 := by + apply Finset.sum_congr rfl + intro H _hH + rw [parallelPairFiber_eq_product] + calc + (∑ p ∈ (affinePlanesWithDirection H).product + (affinePlanesWithDirection H), + binaryAffineFlatCharacter f p.1 * + binaryAffineFlatCharacter f p.2) = + ∑ A ∈ affinePlanesWithDirection H, + ∑ B ∈ affinePlanesWithDirection H, + binaryAffineFlatCharacter f A * + binaryAffineFlatCharacter f B := by + exact Finset.sum_product _ _ _ + _ = (∑ A ∈ affinePlanesWithDirection H, + binaryAffineFlatCharacter f A) ^ 2 := by + simp only [pow_two, Finset.mul_sum, mul_comm] + +private theorem parallelPairCharacterSum_nonneg + (f : BooleanFunction n) : + 0 ≤ ∑ p ∈ parallelAffinePlanePairs n, + binaryAffineFlatCharacter f p.1 * binaryAffineFlatCharacter f p.2 := by + rw [parallelPairCharacterSum_eq_directionSquares] + positivity + +private theorem diagonalParallelAffinePlanePairs_eq_image : + (parallelAffinePlanePairs n).filter (fun p ↦ ¬ p.1 ≠ p.2) = + (binaryAffineFlats 2 n).image fun A ↦ (A, A) := by + classical + ext p + constructor + · intro hp + have hp' : p ∈ parallelAffinePlanePairs n ∧ p.1 = p.2 := by + simpa only [Finset.mem_filter, not_ne_iff] using hp + have hpdata := affinePlaneData_of_mem_parallelPairs hp'.1 + apply Finset.mem_image.mpr + refine ⟨p.1, hpdata.1, ?_⟩ + exact Prod.ext rfl hp'.2 + · intro hp + obtain ⟨A, hA, hp⟩ := Finset.mem_image.mp hp + subst p + apply Finset.mem_filter.mpr + refine ⟨?_, by simp⟩ + apply Finset.mem_filter.mpr + exact ⟨Finset.mem_product.mpr ⟨hA, hA⟩, rfl⟩ + +private theorem diagonalParallelPairCharacterSum_eq_card + (f : BooleanFunction n) : + (∑ p ∈ (parallelAffinePlanePairs n).filter (fun p ↦ ¬ p.1 ≠ p.2), + binaryAffineFlatCharacter f p.1 * binaryAffineFlatCharacter f p.2) = + ((binaryAffineFlats 2 n).card : ℝ) := by + classical + rw [diagonalParallelAffinePlanePairs_eq_image] + rw [Finset.sum_image] + · calc + (∑ A ∈ binaryAffineFlats 2 n, + binaryAffineFlatCharacter f A * binaryAffineFlatCharacter f A) = + ∑ _A ∈ binaryAffineFlats 2 n, (1 : ℝ) := by + apply Finset.sum_congr rfl + intro A _hA + rw [← pow_two, sq_binaryAffineFlatCharacter] + _ = ((binaryAffineFlats 2 n).card : ℝ) := by simp + · intro A _hA B _hB hpair + exact congrArg Prod.fst hpair + +private theorem parallelPairCharacterSum_eq_distinct_add_card + (f : BooleanFunction n) : + (∑ p ∈ parallelAffinePlanePairs n, + binaryAffineFlatCharacter f p.1 * binaryAffineFlatCharacter f p.2) = + (∑ p ∈ distinctParallelAffinePlanePairs n, + binaryAffineFlatCharacter f p.1 * binaryAffineFlatCharacter f p.2) + + ((binaryAffineFlats 2 n).card : ℝ) := by + have hsplit := Finset.sum_filter_add_sum_filter_not + (parallelAffinePlanePairs n) (fun p ↦ p.1 ≠ p.2) + (fun p ↦ binaryAffineFlatCharacter f p.1 * + binaryAffineFlatCharacter f p.2) + change + (∑ p ∈ distinctParallelAffinePlanePairs n, + binaryAffineFlatCharacter f p.1 * binaryAffineFlatCharacter f p.2) + + (∑ p ∈ (parallelAffinePlanePairs n).filter (fun p ↦ ¬ p.1 ≠ p.2), + binaryAffineFlatCharacter f p.1 * binaryAffineFlatCharacter f p.2) = + ∑ p ∈ parallelAffinePlanePairs n, + binaryAffineFlatCharacter f p.1 * binaryAffineFlatCharacter f p.2 at hsplit + rw [diagonalParallelPairCharacterSum_eq_card f] at hsplit + exact hsplit.symm + +/-- The three-flat character sum is bounded below by minus one fourteenth +of the number of affine two-flats. -/ +theorem binaryAffineFlatCharacterSum_three_ge_neg_card + (f : BooleanFunction n) : + binaryAffineFlatCharacterSum 3 f ≥ + -((binaryAffineFlats 2 n).card : ℝ) / 14 := by + have hnonneg := parallelPairCharacterSum_nonneg f + rw [parallelPairCharacterSum_eq_distinct_add_card, + distinctParallelPairCharacterSum_eq_fourteen_mul] at hnonneg + linarith + +/-- Carlet--Mesnager Proposition 9.2.10(1), in its affine-flat form: +`M_f^(8) ≥ -2^n(2^n-1)(2^n-2)/336`. -/ +theorem binaryAffineFlatCharacterSum_three_ge + (f : BooleanFunction n) (hn : 3 ≤ n) : + binaryAffineFlatCharacterSum 3 f ≥ + -((2 ^ n : ℝ) * ((2 ^ n : ℝ) - 1) * + ((2 ^ n : ℝ) - 2)) / 336 := by + have hqTwo : 2 ≤ 2 ^ n := by + have hpow : 2 ^ 3 ≤ 2 ^ n := + Nat.pow_le_pow_right (by omega) hn + norm_num at hpow ⊢ + omega + have hqOne : 1 ≤ 2 ^ n := by omega + have hcount := congrArg (fun m : ℕ ↦ (m : ℝ)) + (card_binaryAffineFlats_two n) + norm_num only [Nat.cast_mul, Nat.cast_ofNat] at hcount + rw [Nat.cast_sub hqOne, Nat.cast_sub hqTwo] at hcount + norm_num only [Nat.cast_pow, Nat.cast_ofNat] at hcount + have hlower := binaryAffineFlatCharacterSum_three_ge_neg_card f + nlinarith + +/-- Carlet--Mesnager Proposition 9.2.10(1) for the canonical weight-eight +dual-code character sum. -/ +theorem orderTwoWeightEightCharacterSum_ge + (f : BooleanFunction n) (hn : 3 ≤ n) : + orderTwoWeightEightCharacterSum f ≥ + -((2 ^ n : ℝ) * ((2 ^ n : ℝ) - 1) * + ((2 ^ n : ℝ) - 2)) / 336 := by + rw [orderTwoWeightEightCharacterSum_eq_affineFlatCharacterSum f hn] + exact binaryAffineFlatCharacterSum_three_ge f hn + +end CryptBoolean diff --git a/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightFourteen.lean b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightFourteen.lean new file mode 100644 index 0000000..03ebb27 --- /dev/null +++ b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightFourteen.lean @@ -0,0 +1,1099 @@ +/- +Copyright (c) 2026 Asher Yan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Asher Yan with Codex +-/ +module + +public import CryptBoolean.Carlet.Chapter04.HigherOrderLowWeightFlats +public import CryptBoolean.Carlet.Chapter02.Subspaces +public import FABL.Chapter06.F₂Polynomials.Encoding +public import Mathlib.LinearAlgebra.AffineSpace.FiniteDimensional + +/-! +# The weight-fourteen dual character sum + +The square-sum argument behind Carlet--Mesnager Proposition 9.2.10(3). +-/ + +open Finset +open scoped BigOperators BooleanCube + +@[expose] public section + +namespace CryptBoolean + +open FABL + +variable {n : ℕ} + +noncomputable local instance weightFourteenFintypeSubmodule : Fintype + (Submodule FABL.𝔽₂ (FABL.F₂Cube n)) := + Fintype.ofFinite _ + +noncomputable local instance weightFourteenDecidableEqSubmodule : DecidableEq + (Submodule FABL.𝔽₂ (FABL.F₂Cube n)) := + Classical.decEq _ + +noncomputable local instance weightFourteenDecidablePredSubmoduleMembership + (H : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) : + DecidablePred (fun x ↦ x ∈ H) := + Classical.decPred _ + +/-- Ordered pairs of three-dimensional binary linear subspaces. -/ +noncomputable def binaryThreeSubspacePairs (n : ℕ) : + Finset (Submodule FABL.𝔽₂ (FABL.F₂Cube n) × + Submodule FABL.𝔽₂ (FABL.F₂Cube n)) := + (binaryLinearSubspaces 3 n).product (binaryLinearSubspaces 3 n) + +/-- Ordered pairs of three-spaces with trivial intersection. -/ +noncomputable def transverseBinaryThreeSubspacePairs (n : ℕ) : + Finset (Submodule FABL.𝔽₂ (FABL.F₂Cube n) × + Submodule FABL.𝔽₂ (FABL.F₂Cube n)) := by + classical + exact (binaryThreeSubspacePairs n).filter fun p ↦ p.1 ⊓ p.2 = ⊥ + +/-- Ordered pairs of three-spaces with nontrivial intersection. -/ +noncomputable def nontransverseBinaryThreeSubspacePairs (n : ℕ) : + Finset (Submodule FABL.𝔽₂ (FABL.F₂Cube n) × + Submodule FABL.𝔽₂ (FABL.F₂Cube n)) := by + classical + exact (binaryThreeSubspacePairs n).filter fun p ↦ p.1 ⊓ p.2 ≠ ⊥ + +/-- A basepoint together with an ordered pair of transverse three-space +directions. -/ +abbrev WeightFourteenRepresentation (n : ℕ) := + FABL.F₂Cube n × + (Submodule FABL.𝔽₂ (FABL.F₂Cube n) × + Submodule FABL.𝔽₂ (FABL.F₂Cube n)) + +/-- The finite family of ordered singleton-intersection representations. -/ +noncomputable def weightFourteenRepresentations (n : ℕ) : + Finset (WeightFourteenRepresentation n) := + Finset.univ.product (transverseBinaryThreeSubspacePairs n) + +@[simp] theorem mem_weightFourteenRepresentations + (p : WeightFourteenRepresentation n) : + p ∈ weightFourteenRepresentations n ↔ + p.2 ∈ transverseBinaryThreeSubspacePairs n := by + classical + simp [weightFourteenRepresentations] + +/-- The normalized character sum over ordered singleton-intersection +representations by two affine three-flats. -/ +noncomputable def weightFourteenRepresentationCharacterSum + (f : BooleanFunction n) : ℝ := + (1 / 2 : ℝ) * + ∑ u : FABL.F₂Cube n, + ∑ p ∈ transverseBinaryThreeSubspacePairs n, + binaryAffineCosetCharacter f u p.1 * + binaryAffineCosetCharacter f u p.2 + +/-- The Boolean word represented by two affine three-flats through `u`. -/ +noncomputable def weightFourteenRepresentationWord + (u : FABL.F₂Cube n) + (H K : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) : BooleanFunction n := + binaryAffineFlatIndicator (FABL.binaryAffineSubspace H u) + + binaryAffineFlatIndicator (FABL.binaryAffineSubspace K u) + +/-- The weight-fourteen words in the dual Reed--Muller code. -/ +noncomputable def orderTwoWeightFourteenDualWords (n : ℕ) : + Finset (BooleanFunction n) := by + classical + exact (orderTwoDualWords n).filter fun h ↦ hammingWeight h = 14 + +/-- The canonical character sum over weight-fourteen words in the dual +Reed--Muller code. -/ +noncomputable def orderTwoWeightFourteenCharacterSum + (f : BooleanFunction n) : ℝ := + ∑ h ∈ orderTwoWeightFourteenDualWords n, + FABL.binarySign (booleanFunctionPairing n f h) + +private theorem binaryAffineCosetPoints_inter_eq_singleton + (u : FABL.F₂Cube n) + (H K : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) + (htransverse : H ⊓ K = ⊥) : + binaryAffineFlatPoints (FABL.binaryAffineSubspace H u) ∩ + binaryAffineFlatPoints (FABL.binaryAffineSubspace K u) = {u} := by + classical + ext x + simp only [Finset.mem_inter, mem_binaryAffineFlatPoints, + FABL.mem_binaryAffineSubspace_iff_add_mem, Finset.mem_singleton] + constructor + · rintro ⟨hxH, hxK⟩ + have hxMeet : x + u ∈ H ⊓ K := ⟨hxH, hxK⟩ + rw [htransverse] at hxMeet + have hxzero : x + u = 0 := by simpa using hxMeet + exact (add_eq_zero_iff_eq_neg.mp hxzero).trans (by + funext i + exact ZMod.neg_eq_self_mod_two (u i)) + · intro hxu + subst x + have hzero : u + u = 0 := ZModModule.add_self u + rw [hzero] + exact ⟨H.zero_mem, K.zero_mem⟩ + +private theorem transversePairData + {H K : Submodule FABL.𝔽₂ (FABL.F₂Cube n)} + (hp : (H, K) ∈ transverseBinaryThreeSubspacePairs n) : + H ∈ binaryLinearSubspaces 3 n ∧ + K ∈ binaryLinearSubspaces 3 n ∧ H ⊓ K = ⊥ := by + have hp' : (H, K) ∈ binaryThreeSubspacePairs n ∧ H ⊓ K = ⊥ := by + simpa only [transverseBinaryThreeSubspacePairs, + Finset.mem_filter] using hp + have hpPair := hp'.1 + change (H, K) ∈ (binaryLinearSubspaces 3 n).product + (binaryLinearSubspaces 3 n) at hpPair + exact ⟨(Finset.mem_product.mp hpPair).1, + (Finset.mem_product.mp hpPair).2, hp'.2⟩ + +@[simp] theorem swap_mem_transverseBinaryThreeSubspacePairs + (H K : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) : + (K, H) ∈ transverseBinaryThreeSubspacePairs n ↔ + (H, K) ∈ transverseBinaryThreeSubspacePairs n := by + constructor + · intro hKH + have hdata := transversePairData hKH + simp only [transverseBinaryThreeSubspacePairs, Finset.mem_filter] + constructor + · change (H, K) ∈ (binaryLinearSubspaces 3 n).product + (binaryLinearSubspaces 3 n) + exact Finset.mem_product.mpr ⟨hdata.2.1, hdata.1⟩ + · simpa only [inf_comm] using hdata.2.2 + · intro hHK + have hdata := transversePairData hHK + simp only [transverseBinaryThreeSubspacePairs, Finset.mem_filter] + constructor + · change (K, H) ∈ (binaryLinearSubspaces 3 n).product + (binaryLinearSubspaces 3 n) + exact Finset.mem_product.mpr ⟨hdata.2.1, hdata.1⟩ + · simpa only [inf_comm] using hdata.2.2 + +private theorem transversePair_ne + {H K : Submodule FABL.𝔽₂ (FABL.F₂Cube n)} + (hp : (H, K) ∈ transverseBinaryThreeSubspacePairs n) : + H ≠ K := by + have hpdata := transversePairData hp + have hHrank : Module.finrank FABL.𝔽₂ H = 3 := + (mem_binaryLinearSubspaces H).mp hpdata.1 + intro hHK + have hHbot : H = ⊥ := by + simpa only [hHK, inf_idem] using hpdata.2.2 + rw [hHbot] at hHrank + simp at hHrank + +private theorem binaryAffineSubspace_ne_bot + (H : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) (u : FABL.F₂Cube n) : + FABL.binaryAffineSubspace H u ≠ ⊥ := by + intro hbot + have hu : u ∈ (⊥ : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) := by + rw [← hbot] + exact AffineSubspace.self_mem_mk' _ _ + rw [← SetLike.mem_coe, AffineSubspace.bot_coe] at hu + exact hu + +/-- A transverse pair of affine three-flats through one point represents a +word of Hamming weight fourteen. -/ +theorem hammingWeight_weightFourteenRepresentationWord + (u : FABL.F₂Cube n) + (H K : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) + (hp : (H, K) ∈ transverseBinaryThreeSubspacePairs n) : + hammingWeight (weightFourteenRepresentationWord u H K) = 14 := by + have hpdata := transversePairData hp + have hfirstRank : Module.finrank FABL.𝔽₂ H = 3 := + (mem_binaryLinearSubspaces H).mp hpdata.1 + have hsecondRank : Module.finrank FABL.𝔽₂ K = 3 := + (mem_binaryLinearSubspaces K).mp hpdata.2.1 + have hintersection := binaryAffineCosetPoints_inter_eq_singleton + u H K hpdata.2.2 + have hidentity := hammingWeight_add_add_two_mul_card_support_inter + (binaryAffineFlatIndicator (FABL.binaryAffineSubspace H u)) + (binaryAffineFlatIndicator (FABL.binaryAffineSubspace K u)) + rw [support_binaryAffineFlatIndicator, + support_binaryAffineFlatIndicator, hintersection, + hammingWeight_binaryAffineFlatIndicator _ + (binaryAffineSubspace_ne_bot H u), + hammingWeight_binaryAffineFlatIndicator _ + (binaryAffineSubspace_ne_bot K u), + FABL.binaryAffineSubspace_direction, + FABL.binaryAffineSubspace_direction, + hfirstRank, hsecondRank] at hidentity + have hweight : hammingWeight + (binaryAffineFlatIndicator (FABL.binaryAffineSubspace H u) + + binaryAffineFlatIndicator (FABL.binaryAffineSubspace K u)) = 14 := by + norm_num at hidentity + omega + simpa only [weightFourteenRepresentationWord] using hweight + +/-- Every transverse singleton-intersection representation produces a +weight-fourteen dual Reed--Muller word. -/ +theorem weightFourteenRepresentationWord_mem_dualWords + (u : FABL.F₂Cube n) + (H K : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) + (hp : (H, K) ∈ transverseBinaryThreeSubspacePairs n) : + weightFourteenRepresentationWord u H K ∈ + orderTwoWeightFourteenDualWords n := by + have hpdata := transversePairData hp + have hfirst := binaryAffineFlatIndicator_mem_reedMuller + (FABL.binaryAffineSubspace H u) + (binaryAffineSubspace_mem_binaryAffineFlats H u hpdata.1) + have hsecond := binaryAffineFlatIndicator_mem_reedMuller + (FABL.binaryAffineSubspace K u) + (binaryAffineSubspace_mem_binaryAffineFlats K u hpdata.2.1) + simp only [orderTwoWeightFourteenDualWords, orderTwoDualWords, + Finset.mem_filter, Finset.mem_univ, true_and] + exact ⟨(reedMuller (n - 3) n).add_mem hfirst hsecond, + hammingWeight_weightFourteenRepresentationWord u H K hp⟩ + +/-- The character of a represented weight-fourteen word is the product of +the two affine-flat characters. -/ +theorem weightFourteenRepresentationWord_character + (f : BooleanFunction n) (u : FABL.F₂Cube n) + (H K : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) : + FABL.binarySign (booleanFunctionPairing n f + (weightFourteenRepresentationWord u H K)) = + binaryAffineCosetCharacter f u H * + binaryAffineCosetCharacter f u K := by + rw [weightFourteenRepresentationWord, map_add, AddChar.map_add_eq_mul] + rfl + +private theorem mem_binaryAffineSubspace_bot_iff + (u x : FABL.F₂Cube n) : + x ∈ FABL.binaryAffineSubspace + (⊥ : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) u ↔ x = u := by + rw [FABL.mem_binaryAffineSubspace_iff_add_mem] + constructor + · intro hx + have hzero : x + u = 0 := by simpa using hx + exact (add_eq_zero_iff_eq_neg.mp hzero).trans (by + funext i + exact ZMod.neg_eq_self_mod_two (u i)) + · rintro rfl + simpa only [ZModModule.add_self] using + (Submodule.zero_mem (⊥ : Submodule FABL.𝔽₂ (FABL.F₂Cube n))) + +private theorem booleanRealEmbedding_weightFourteenRepresentationWord + (u : FABL.F₂Cube n) + (H K : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) + (htransverse : H ⊓ K = ⊥) : + FABL.booleanRealEmbedding (weightFourteenRepresentationWord u H K) = + fun x ↦ + FABL.setIndicator (FABL.binaryAffineSubspace H u : + Set (FABL.F₂Cube n)) x + + FABL.setIndicator (FABL.binaryAffineSubspace K u : + Set (FABL.F₂Cube n)) x - + 2 * FABL.setIndicator + (FABL.binaryAffineSubspace + (⊥ : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) u : + Set (FABL.F₂Cube n)) x := by + funext x + have hintersection : x ∈ FABL.binaryAffineSubspace H u ∧ + x ∈ FABL.binaryAffineSubspace K u ↔ x = u := by + constructor + · intro hx + have hxMeet : x + u ∈ H ⊓ K := by + exact ⟨(FABL.mem_binaryAffineSubspace_iff_add_mem H u x).mp hx.1, + (FABL.mem_binaryAffineSubspace_iff_add_mem K u x).mp hx.2⟩ + rw [htransverse] at hxMeet + have hzero : x + u = 0 := by simpa using hxMeet + exact (add_eq_zero_iff_eq_neg.mp hzero).trans (by + funext i + exact ZMod.neg_eq_self_mod_two (u i)) + · rintro rfl + constructor <;> rw [FABL.mem_binaryAffineSubspace_iff_add_mem, + ZModModule.add_self] <;> exact Submodule.zero_mem _ + by_cases hxH : x ∈ FABL.binaryAffineSubspace H u <;> + by_cases hxK : x ∈ FABL.binaryAffineSubspace K u + · have hxu : x = u := hintersection.mp ⟨hxH, hxK⟩ + have hxBot : x ∈ FABL.binaryAffineSubspace + (⊥ : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) u := + (mem_binaryAffineSubspace_bot_iff u x).mpr hxu + simp [FABL.booleanRealEmbedding, weightFourteenRepresentationWord, + binaryAffineFlatIndicator, FABL.setIndicator, hxH, hxK, hxBot] + norm_num + · have hxBot : x ∉ FABL.binaryAffineSubspace + (⊥ : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) u := by + intro hxBot + have hxu := (mem_binaryAffineSubspace_bot_iff u x).mp hxBot + exact hxK (hintersection.mpr hxu).2 + simp [FABL.booleanRealEmbedding, weightFourteenRepresentationWord, + binaryAffineFlatIndicator, FABL.setIndicator, hxH, hxK, hxBot] + · have hxBot : x ∉ FABL.binaryAffineSubspace + (⊥ : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) u := by + intro hxBot + have hxu := (mem_binaryAffineSubspace_bot_iff u x).mp hxBot + exact hxH (hintersection.mpr hxu).1 + simp [FABL.booleanRealEmbedding, weightFourteenRepresentationWord, + binaryAffineFlatIndicator, FABL.setIndicator, hxH, hxK, hxBot] + · have hxBot : x ∉ FABL.binaryAffineSubspace + (⊥ : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) u := by + intro hxBot + have hxu := (mem_binaryAffineSubspace_bot_iff u x).mp hxBot + exact hxH (hintersection.mpr hxu).1 + simp [FABL.booleanRealEmbedding, weightFourteenRepresentationWord, + binaryAffineFlatIndicator, FABL.setIndicator, hxH, hxK, hxBot] + +private theorem rawFourierTransform_setIndicator_binaryAffineSubspace + (H : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) + (u a : FABL.F₂Cube n) : + rawFourierTransform + (FABL.setIndicator (FABL.binaryAffineSubspace H u : + Set (FABL.F₂Cube n))) a = + FABL.vectorWalshCharacter a u * + if a ∈ FABL.perpendicularSubspace H then (Nat.card H : ℝ) else 0 := by + classical + by_cases ha : a ∈ FABL.perpendicularSubspace H + · rw [if_pos ha, rawFourierTransform_eq_two_pow_mul_vectorFourierCoeff, + FABL.vectorFourierCoeff_setIndicator_binaryAffineSubspace_of_mem H u a ha] + calc + (2 ^ n : ℝ) * + (FABL.vectorWalshCharacter a u * FABL.inversePerpendicularCard H) = + FABL.vectorWalshCharacter a u * + ((2 ^ n : ℝ) * FABL.inversePerpendicularCard H) := by ring + _ = FABL.vectorWalshCharacter a u * (Nat.card H : ℝ) := by + rw [two_pow_mul_inversePerpendicularCard_eq_card] + · rw [if_neg ha, rawFourierTransform_eq_two_pow_mul_vectorFourierCoeff, + FABL.vectorFourierCoeff_setIndicator_binaryAffineSubspace_of_not_mem + H u a ha, mul_zero, mul_zero] + +private noncomputable def weightFourteenRawCoefficient + (H K : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) + (a : FABL.F₂Cube n) : ℝ := by + classical + exact (if a ∈ FABL.perpendicularSubspace H then 8 else 0) + + (if a ∈ FABL.perpendicularSubspace K then 8 else 0) - 2 + +private theorem rawFourierTransform_weightFourteenRepresentationWord + (u : FABL.F₂Cube n) + (H K : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) + (hH : Module.finrank FABL.𝔽₂ H = 3) + (hK : Module.finrank FABL.𝔽₂ K = 3) + (htransverse : H ⊓ K = ⊥) + (a : FABL.F₂Cube n) : + rawFourierTransform + (FABL.booleanRealEmbedding + (weightFourteenRepresentationWord u H K)) a = + FABL.vectorWalshCharacter a u * + weightFourteenRawCoefficient H K a := by + classical + have hreal := booleanRealEmbedding_weightFourteenRepresentationWord + u H K htransverse + calc + rawFourierTransform + (FABL.booleanRealEmbedding + (weightFourteenRepresentationWord u H K)) a = + rawFourierTransform + (FABL.setIndicator (FABL.binaryAffineSubspace H u : + Set (FABL.F₂Cube n))) a + + rawFourierTransform + (FABL.setIndicator (FABL.binaryAffineSubspace K u : + Set (FABL.F₂Cube n))) a - + 2 * rawFourierTransform + (FABL.setIndicator + (FABL.binaryAffineSubspace + (⊥ : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) u : + Set (FABL.F₂Cube n))) a := by + rw [hreal] + simp only [rawFourierTransform] + rw [Finset.mul_sum] + rw [← Finset.sum_add_distrib, ← Finset.sum_sub_distrib] + apply Finset.sum_congr rfl + intro x _hx + ring + _ = FABL.vectorWalshCharacter a u * + weightFourteenRawCoefficient H K a := by + have haBot : a ∈ FABL.perpendicularSubspace + (⊥ : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) := by + rw [FABL.mem_perpendicularSubspace_iff] + intro x hx + have hxzero : x = 0 := by simpa using hx + subst x + simp [FABL.f₂DotProduct] + have hcardBot : Nat.card + (⊥ : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) = 1 := by + rw [FABL.card_submodule_eq_two_pow_finrank, finrank_bot] + norm_num + rw [rawFourierTransform_setIndicator_binaryAffineSubspace, + rawFourierTransform_setIndicator_binaryAffineSubspace, + rawFourierTransform_setIndicator_binaryAffineSubspace] + rw [FABL.card_submodule_eq_two_pow_finrank, + FABL.card_submodule_eq_two_pow_finrank, hH, hK] + rw [hcardBot, if_pos haBot] + norm_num only [Nat.cast_one] + unfold weightFourteenRawCoefficient + ring + +private theorem weightFourteenRawCoefficient_cases + (H K : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) + (a : FABL.F₂Cube n) : + weightFourteenRawCoefficient H K a = -2 ∨ + weightFourteenRawCoefficient H K a = 6 ∨ + weightFourteenRawCoefficient H K a = 14 := by + classical + unfold weightFourteenRawCoefficient + by_cases haH : a ∈ FABL.perpendicularSubspace H <;> + by_cases haK : a ∈ FABL.perpendicularSubspace K <;> + simp [haH, haK] <;> norm_num + +private theorem weightFourteenRawCoefficient_ne_zero + (H K : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) + (a : FABL.F₂Cube n) : + weightFourteenRawCoefficient H K a ≠ 0 := by + rcases weightFourteenRawCoefficient_cases H K a with h | h | h <;> + rw [h] <;> norm_num + +private theorem weightFourteenRawCoefficient_eq_of_sq_eq_sq + (H K L M : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) + (a : FABL.F₂Cube n) + (hsq : weightFourteenRawCoefficient H K a ^ 2 = + weightFourteenRawCoefficient L M a ^ 2) : + weightFourteenRawCoefficient H K a = + weightFourteenRawCoefficient L M a := by + rcases weightFourteenRawCoefficient_cases H K a with hHK | hHK | hHK <;> + rcases weightFourteenRawCoefficient_cases L M a with hLM | hLM | hLM <;> + nlinarith [hsq] + +private theorem vectorWalshCharacter_sq + (a u : FABL.F₂Cube n) : + FABL.vectorWalshCharacter a u ^ 2 = 1 := by + rcases FABL.vectorWalshCharacter_eq_neg_one_or_one a u with h | h <;> + rw [h] <;> norm_num + +private theorem weightFourteenRepresentationWord_apply_eq_one_iff_of_ne_zero + (u y : FABL.F₂Cube n) + (H K : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) + (htransverse : H ⊓ K = ⊥) (hy : y ≠ 0) : + weightFourteenRepresentationWord u H K (y + u) = 1 ↔ + y ∈ H ∨ y ∈ K := by + have hnotBoth : ¬ (y ∈ H ∧ y ∈ K) := by + intro hboth + have hyMeet : y ∈ H ⊓ K := hboth + rw [htransverse] at hyMeet + exact hy (by simpa using hyMeet) + simp only [weightFourteenRepresentationWord, + binaryAffineFlatIndicator, Pi.add_apply, + FABL.mem_binaryAffineSubspace_iff_add_mem] + have hyu : y + u + u = y := by + rw [add_assoc, ZModModule.add_self, add_zero] + rw [hyu] + by_cases hyH : y ∈ H <;> by_cases hyK : y ∈ K + · exact (hnotBoth ⟨hyH, hyK⟩).elim + · simp [hyH, hyK] + · simp [hyH, hyK] + · simp [hyH, hyK] + +/-- Once the singleton intersection point is fixed, the two three-space +directions representing a weight-fourteen word are unique up to swapping. -/ +theorem weightFourteenRepresentationWord_eq_same_basepoint_iff + (u : FABL.F₂Cube n) + (H K L M : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) + (hp : (H, K) ∈ transverseBinaryThreeSubspacePairs n) + (hq : (L, M) ∈ transverseBinaryThreeSubspacePairs n) : + weightFourteenRepresentationWord u H K = + weightFourteenRepresentationWord u L M ↔ + (H = L ∧ K = M) ∨ (H = M ∧ K = L) := by + constructor + · intro hword + have hpdata := transversePairData hp + have hqdata := transversePairData hq + have hHrank : Module.finrank FABL.𝔽₂ H = 3 := + (mem_binaryLinearSubspaces H).mp hpdata.1 + have hKrank : Module.finrank FABL.𝔽₂ K = 3 := + (mem_binaryLinearSubspaces K).mp hpdata.2.1 + have hLrank : Module.finrank FABL.𝔽₂ L = 3 := + (mem_binaryLinearSubspaces L).mp hqdata.1 + have hMrank : Module.finrank FABL.𝔽₂ M = 3 := + (mem_binaryLinearSubspaces M).mp hqdata.2.1 + have hHKne : H ≠ K := transversePair_ne hp + have hunion : ∀ y, y ∈ H ∨ y ∈ K ↔ y ∈ L ∨ y ∈ M := by + intro y + by_cases hy : y = 0 + · subst y + simp + · rw [← weightFourteenRepresentationWord_apply_eq_one_iff_of_ne_zero + u y H K hpdata.2.2 hy, + ← weightFourteenRepresentationWord_apply_eq_one_iff_of_ne_zero + u y L M hqdata.2.2 hy, + hword] + exact unordered_submodule_pair_eq_of_union_eq H K L M + (hHrank.trans hLrank.symm) (hHrank.trans hMrank.symm) + (hKrank.trans hLrank.symm) (hKrank.trans hMrank.symm) + hHKne hunion + · rintro (⟨rfl, rfl⟩ | ⟨rfl, rfl⟩) + · rfl + · simp only [weightFourteenRepresentationWord, add_comm] + +private theorem weightFourteenRepresentationWord_basepoint_eq + (u v : FABL.F₂Cube n) + (H K L M : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) + (hp : (H, K) ∈ transverseBinaryThreeSubspacePairs n) + (hq : (L, M) ∈ transverseBinaryThreeSubspacePairs n) + (hword : weightFourteenRepresentationWord u H K = + weightFourteenRepresentationWord v L M) : + u = v := by + have hpdata := transversePairData hp + have hqdata := transversePairData hq + have hHrank : Module.finrank FABL.𝔽₂ H = 3 := + (mem_binaryLinearSubspaces H).mp hpdata.1 + have hKrank : Module.finrank FABL.𝔽₂ K = 3 := + (mem_binaryLinearSubspaces K).mp hpdata.2.1 + have hLrank : Module.finrank FABL.𝔽₂ L = 3 := + (mem_binaryLinearSubspaces L).mp hqdata.1 + have hMrank : Module.finrank FABL.𝔽₂ M = 3 := + (mem_binaryLinearSubspaces M).mp hqdata.2.1 + apply FABL.vectorWalshCharacter_injective + ext a + have hraw : + FABL.vectorWalshCharacter a u * + weightFourteenRawCoefficient H K a = + FABL.vectorWalshCharacter a v * + weightFourteenRawCoefficient L M a := by + have htransform := congrArg + (fun g : BooleanFunction n ↦ + rawFourierTransform (FABL.booleanRealEmbedding g) a) hword + rw [rawFourierTransform_weightFourteenRepresentationWord + u H K hHrank hKrank hpdata.2.2 a, + rawFourierTransform_weightFourteenRepresentationWord + v L M hLrank hMrank hqdata.2.2 a] at htransform + exact htransform + have hsq : weightFourteenRawCoefficient H K a ^ 2 = + weightFourteenRawCoefficient L M a ^ 2 := by + calc + weightFourteenRawCoefficient H K a ^ 2 = + FABL.vectorWalshCharacter a u ^ 2 * + weightFourteenRawCoefficient H K a ^ 2 := by + rw [vectorWalshCharacter_sq, one_mul] + _ = (FABL.vectorWalshCharacter a u * + weightFourteenRawCoefficient H K a) ^ 2 := by ring + _ = (FABL.vectorWalshCharacter a v * + weightFourteenRawCoefficient L M a) ^ 2 := + congrArg (fun x : ℝ ↦ x ^ 2) hraw + _ = FABL.vectorWalshCharacter a v ^ 2 * + weightFourteenRawCoefficient L M a ^ 2 := by ring + _ = weightFourteenRawCoefficient L M a ^ 2 := by + rw [vectorWalshCharacter_sq, one_mul] + have hcoefficient := + weightFourteenRawCoefficient_eq_of_sq_eq_sq H K L M a hsq + have hphase : FABL.vectorWalshCharacter a u = + FABL.vectorWalshCharacter a v := by + apply mul_right_cancel₀ (weightFourteenRawCoefficient_ne_zero H K a) + calc + FABL.vectorWalshCharacter a u * + weightFourteenRawCoefficient H K a = + FABL.vectorWalshCharacter a v * + weightFourteenRawCoefficient L M a := hraw + _ = FABL.vectorWalshCharacter a v * + weightFourteenRawCoefficient H K a := by rw [hcoefficient] + calc + FABL.vectorWalshCharacter u a = + FABL.vectorWalshCharacter a u := by + rw [FABL.vectorWalshCharacter_apply, + FABL.vectorWalshCharacter_apply] + exact congrArg FABL.binarySign (dotProduct_comm u a) + _ = FABL.vectorWalshCharacter a v := hphase + _ = FABL.vectorWalshCharacter v a := by + rw [FABL.vectorWalshCharacter_apply, + FABL.vectorWalshCharacter_apply] + exact congrArg FABL.binarySign (dotProduct_comm a v) + +/-- A singleton-intersection representation of a weight-fourteen word is +unique up to exchanging its two affine three-flats. -/ +theorem weightFourteenRepresentationWord_eq_iff + (u v : FABL.F₂Cube n) + (H K L M : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) + (hp : (H, K) ∈ transverseBinaryThreeSubspacePairs n) + (hq : (L, M) ∈ transverseBinaryThreeSubspacePairs n) : + weightFourteenRepresentationWord u H K = + weightFourteenRepresentationWord v L M ↔ + u = v ∧ ((H = L ∧ K = M) ∨ (H = M ∧ K = L)) := by + constructor + · intro hword + have huv := weightFourteenRepresentationWord_basepoint_eq + u v H K L M hp hq hword + subst v + exact ⟨rfl, + (weightFourteenRepresentationWord_eq_same_basepoint_iff + u H K L M hp hq).mp hword⟩ + · rintro ⟨rfl, hpairs⟩ + exact (weightFourteenRepresentationWord_eq_same_basepoint_iff + u H K L M hp hq).mpr hpairs + +/-- The remaining Kasami--Tokura input: every weight-fourteen word of the +dual code has a singleton-intersection representation by two affine +three-flats. Uniqueness is proved above and is not part of this interface. -/ +def HasWeightFourteenFlatPairClassification (n : ℕ) : Prop := + ∀ h ∈ orderTwoWeightFourteenDualWords n, + ∃ u : FABL.F₂Cube n, + ∃ H K : Submodule FABL.𝔽₂ (FABL.F₂Cube n), + (H, K) ∈ transverseBinaryThreeSubspacePairs n ∧ + weightFourteenRepresentationWord u H K = h + +/-- Assuming only existence from the Kasami--Tokura classification, every +weight-fourteen word has exactly the two ordered representations obtained +by exchanging its affine three-flats. -/ +theorem card_weightFourteenRepresentationWord_fiber + (hclassification : HasWeightFourteenFlatPairClassification n) + (h : BooleanFunction n) : + ((weightFourteenRepresentations n).filter fun p ↦ + weightFourteenRepresentationWord p.1 p.2.1 p.2.2 = h).card = + if h ∈ orderTwoWeightFourteenDualWords n then 2 else 0 := by + classical + by_cases hh : h ∈ orderTwoWeightFourteenDualWords n + · rw [if_pos hh] + obtain ⟨u, H, K, hp, hword⟩ := hclassification h hh + have hfiber : + (weightFourteenRepresentations n).filter (fun p ↦ + weightFourteenRepresentationWord p.1 p.2.1 p.2.2 = h) = + {(u, (H, K)), (u, (K, H))} := by + ext p + rcases p with ⟨v, L, M⟩ + simp only [Finset.mem_filter, Finset.mem_insert, Finset.mem_singleton] + constructor + · rintro ⟨hrepresentation, hrepresentationWord⟩ + have hq : (L, M) ∈ transverseBinaryThreeSubspacePairs n := + (mem_weightFourteenRepresentations (v, (L, M))).mp + hrepresentation + have heq := (weightFourteenRepresentationWord_eq_iff + v u L M H K hq hp).mp + (hrepresentationWord.trans hword.symm) + rcases heq with ⟨hu, (⟨hLH, hMK⟩ | ⟨hLK, hMH⟩)⟩ + · left + subst v + subst L + subst M + rfl + · right + subst v + subst L + subst M + rfl + · rintro (hfirst | hsecond) + · cases hfirst + exact ⟨(mem_weightFourteenRepresentations (u, (H, K))).mpr hp, + hword⟩ + · cases hsecond + exact ⟨(mem_weightFourteenRepresentations (u, (K, H))).mpr + ((swap_mem_transverseBinaryThreeSubspacePairs H K).mpr hp), + by simpa only [weightFourteenRepresentationWord, add_comm] + using hword⟩ + have hdistinct : (u, (H, K)) ≠ (u, (K, H)) := by + intro heq + apply transversePair_ne hp + simpa using congrArg + (fun p : WeightFourteenRepresentation n ↦ p.2.1) heq + rw [hfiber] + simp [hdistinct] + · rw [if_neg hh] + apply Finset.card_eq_zero.mpr + ext p + simp only [Finset.mem_filter] + constructor + · rintro ⟨hrepresentation, hrepresentationWord⟩ + exfalso + apply hh + rw [← hrepresentationWord] + exact weightFourteenRepresentationWord_mem_dualWords + p.1 p.2.1 p.2.2 + ((mem_weightFourteenRepresentations p).mp hrepresentation) + · intro hpempty + simp at hpempty + +private theorem exists_spanning_pair_of_mem_threeSubspace + (H : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) + (hH : Module.finrank FABL.𝔽₂ H = 3) + (v : FABL.F₂Cube n) (hvH : v ∈ H) (hv0 : v ≠ 0) : + ∃ a b : FABL.F₂Cube n, + H = ((FABL.𝔽₂ ∙ v) ⊔ (FABL.𝔽₂ ∙ a)) ⊔ + (FABL.𝔽₂ ∙ b) := by + let S₁ : Submodule FABL.𝔽₂ (FABL.F₂Cube n) := FABL.𝔽₂ ∙ v + have hS₁le : S₁ ≤ H := by + exact Submodule.span_le.2 (Set.singleton_subset_iff.2 hvH) + have hS₁rank : Module.finrank FABL.𝔽₂ S₁ = 1 := by + exact finrank_span_singleton hv0 + have hS₁lt : S₁ < H := + Submodule.lt_of_le_of_finrank_lt_finrank hS₁le (by omega) + obtain ⟨a, haH, haS₁⟩ := SetLike.exists_of_lt hS₁lt + let S₂ : Submodule FABL.𝔽₂ (FABL.F₂Cube n) := + S₁ ⊔ (FABL.𝔽₂ ∙ a) + have hS₂le : S₂ ≤ H := by + exact sup_le hS₁le + (Submodule.span_le.2 (Set.singleton_subset_iff.2 haH)) + have hS₂rank : Module.finrank FABL.𝔽₂ S₂ = 2 := by + dsimp only [S₂] + rw [Submodule.finrank_sup_span_singleton haS₁, hS₁rank] + have hS₂lt : S₂ < H := + Submodule.lt_of_le_of_finrank_lt_finrank hS₂le (by omega) + obtain ⟨b, hbH, hbS₂⟩ := SetLike.exists_of_lt hS₂lt + refine ⟨a, b, ?_⟩ + symm + apply Submodule.eq_of_le_of_finrank_eq + · exact sup_le hS₂le + (Submodule.span_le.2 (Set.singleton_subset_iff.2 hbH)) + · rw [Submodule.finrank_sup_span_singleton hbS₂, hS₂rank, hH] + +private theorem exists_common_nonzero_of_nontransverse + {H K : Submodule FABL.𝔽₂ (FABL.F₂Cube n)} + (hHK : H ⊓ K ≠ ⊥) : + ∃ v : FABL.F₂Cube n, v ≠ 0 ∧ v ∈ H ∧ v ∈ K := by + obtain ⟨v, hv⟩ := Submodule.nonzero_mem_of_bot_lt + (bot_lt_iff_ne_bot.mpr hHK) + refine ⟨v, ?_, v.2.1, v.2.2⟩ + intro hv0 + apply hv + apply Subtype.ext + exact hv0 + +private structure NontransversePairWitness + (p : Submodule FABL.𝔽₂ (FABL.F₂Cube n) × + Submodule FABL.𝔽₂ (FABL.F₂Cube n)) where + v : FABL.F₂Cube n + a₁ : FABL.F₂Cube n + b₁ : FABL.F₂Cube n + a₂ : FABL.F₂Cube n + b₂ : FABL.F₂Cube n + first_span : p.1 = + ((FABL.𝔽₂ ∙ v) ⊔ (FABL.𝔽₂ ∙ a₁)) ⊔ (FABL.𝔽₂ ∙ b₁) + second_span : p.2 = + ((FABL.𝔽₂ ∙ v) ⊔ (FABL.𝔽₂ ∙ a₂)) ⊔ (FABL.𝔽₂ ∙ b₂) + +private noncomputable def nontransversePairWitness + (p : Submodule FABL.𝔽₂ (FABL.F₂Cube n) × + Submodule FABL.𝔽₂ (FABL.F₂Cube n)) + (hp : p ∈ nontransverseBinaryThreeSubspacePairs n) : + NontransversePairWitness p := by + classical + have hp' : p ∈ binaryThreeSubspacePairs n ∧ p.1 ⊓ p.2 ≠ ⊥ := by + simpa only [nontransverseBinaryThreeSubspacePairs, + Finset.mem_filter] using hp + have hpProduct : p.1 ∈ binaryLinearSubspaces 3 n ∧ + p.2 ∈ binaryLinearSubspaces 3 n := by + have hpPair := hp'.1 + change p ∈ (binaryLinearSubspaces 3 n).product + (binaryLinearSubspaces 3 n) at hpPair + exact Finset.mem_product.mp hpPair + have hfirstRank : Module.finrank FABL.𝔽₂ p.1 = 3 := + (mem_binaryLinearSubspaces p.1).mp hpProduct.1 + have hsecondRank : Module.finrank FABL.𝔽₂ p.2 = 3 := + (mem_binaryLinearSubspaces p.2).mp hpProduct.2 + let v := Classical.choose (exists_common_nonzero_of_nontransverse hp'.2) + have hv := Classical.choose_spec + (exists_common_nonzero_of_nontransverse hp'.2) + let a₁ := Classical.choose + (exists_spanning_pair_of_mem_threeSubspace p.1 hfirstRank v hv.2.1 hv.1) + let b₁ := Classical.choose (Classical.choose_spec + (exists_spanning_pair_of_mem_threeSubspace p.1 hfirstRank v hv.2.1 hv.1)) + have hfirst := Classical.choose_spec (Classical.choose_spec + (exists_spanning_pair_of_mem_threeSubspace p.1 hfirstRank v hv.2.1 hv.1)) + let a₂ := Classical.choose + (exists_spanning_pair_of_mem_threeSubspace p.2 hsecondRank v hv.2.2 hv.1) + let b₂ := Classical.choose (Classical.choose_spec + (exists_spanning_pair_of_mem_threeSubspace p.2 hsecondRank v hv.2.2 hv.1)) + have hsecond := Classical.choose_spec (Classical.choose_spec + (exists_spanning_pair_of_mem_threeSubspace p.2 hsecondRank v hv.2.2 hv.1)) + exact ⟨v, a₁, b₁, a₂, b₂, hfirst, hsecond⟩ + +private noncomputable def chosenNontransversePairWitness + (p : Submodule FABL.𝔽₂ (FABL.F₂Cube n) × + Submodule FABL.𝔽₂ (FABL.F₂Cube n)) + (hp : p ∈ nontransverseBinaryThreeSubspacePairs n) : + NontransversePairWitness p := + nontransversePairWitness p hp + +private def nontransversePairWitnessCode + {p : Submodule FABL.𝔽₂ (FABL.F₂Cube n) × + Submodule FABL.𝔽₂ (FABL.F₂Cube n)} + (w : NontransversePairWitness p) : Fin 5 → FABL.F₂Cube n := + ![w.v, w.a₁, w.b₁, w.a₂, w.b₂] + +private noncomputable def nontransversePairCode + (p : Submodule FABL.𝔽₂ (FABL.F₂Cube n) × + Submodule FABL.𝔽₂ (FABL.F₂Cube n)) : + Fin 5 → FABL.F₂Cube n := by + classical + exact if hp : p ∈ nontransverseBinaryThreeSubspacePairs n then + nontransversePairWitnessCode (chosenNontransversePairWitness p hp) + else 0 + +private theorem nontransversePairCode_injective_on : + Set.InjOn (nontransversePairCode (n := n)) + (nontransverseBinaryThreeSubspacePairs n : + Set (Submodule FABL.𝔽₂ (FABL.F₂Cube n) × + Submodule FABL.𝔽₂ (FABL.F₂Cube n))) := by + intro p hp q hq hcode + have hpFin : p ∈ nontransverseBinaryThreeSubspacePairs n := hp + have hqFin : q ∈ nontransverseBinaryThreeSubspacePairs n := hq + have hcode' : + nontransversePairWitnessCode + (chosenNontransversePairWitness p hp) = + nontransversePairWitnessCode + (chosenNontransversePairWitness q hq) := by + unfold nontransversePairCode at hcode + rw [dif_pos hpFin, dif_pos hqFin] at hcode + simpa only using hcode + have h0 : (chosenNontransversePairWitness p hp).v = + (chosenNontransversePairWitness q hq).v := by + simpa [nontransversePairWitnessCode] using congrFun hcode' (0 : Fin 5) + have h1 : (chosenNontransversePairWitness p hp).a₁ = + (chosenNontransversePairWitness q hq).a₁ := by + simpa [nontransversePairWitnessCode] using congrFun hcode' (1 : Fin 5) + have h2 : (chosenNontransversePairWitness p hp).b₁ = + (chosenNontransversePairWitness q hq).b₁ := by + simpa [nontransversePairWitnessCode] using congrFun hcode' (2 : Fin 5) + have h3 : (chosenNontransversePairWitness p hp).a₂ = + (chosenNontransversePairWitness q hq).a₂ := by + simpa [nontransversePairWitnessCode] using congrFun hcode' (3 : Fin 5) + have h4 : (chosenNontransversePairWitness p hp).b₂ = + (chosenNontransversePairWitness q hq).b₂ := by + simpa [nontransversePairWitnessCode] using congrFun hcode' (4 : Fin 5) + apply Prod.ext + · rw [(chosenNontransversePairWitness p hp).first_span, + (chosenNontransversePairWitness q hq).first_span, + h0, h1, h2] + · rw [(chosenNontransversePairWitness p hp).second_span, + (chosenNontransversePairWitness q hq).second_span, + h0, h3, h4] + +/-- Nontransverse ordered pairs of binary three-spaces inject +into five ambient vectors. -/ +theorem card_nontransverseBinaryThreeSubspacePairs_le (n : ℕ) : + (nontransverseBinaryThreeSubspacePairs n).card ≤ (2 ^ n) ^ 5 := by + classical + calc + (nontransverseBinaryThreeSubspacePairs n).card ≤ + (Finset.univ : Finset (Fin 5 → FABL.F₂Cube n)).card := by + apply Finset.card_le_card_of_injOn (nontransversePairCode (n := n)) + · intro p _hp + exact Finset.mem_univ _ + · exact nontransversePairCode_injective_on + _ = (2 ^ n) ^ 5 := by + rw [Finset.card_univ, Fintype.card_fun, Fintype.card_fin, card_f₂Cube] + +private theorem allThreeSubspacePairCharacterSum_eq_sq + (f : BooleanFunction n) (u : FABL.F₂Cube n) : + (∑ p ∈ binaryThreeSubspacePairs n, + binaryAffineCosetCharacter f u p.1 * + binaryAffineCosetCharacter f u p.2) = + (∑ H ∈ binaryLinearSubspaces 3 n, + binaryAffineCosetCharacter f u H) ^ 2 := by + classical + rw [binaryThreeSubspacePairs] + calc + (∑ p ∈ (binaryLinearSubspaces 3 n).product + (binaryLinearSubspaces 3 n), + binaryAffineCosetCharacter f u p.1 * + binaryAffineCosetCharacter f u p.2) = + ∑ H ∈ binaryLinearSubspaces 3 n, + ∑ K ∈ binaryLinearSubspaces 3 n, + binaryAffineCosetCharacter f u H * + binaryAffineCosetCharacter f u K := by + exact Finset.sum_product _ _ _ + _ = (∑ H ∈ binaryLinearSubspaces 3 n, + binaryAffineCosetCharacter f u H) ^ 2 := by + simp only [pow_two, Finset.mul_sum, mul_comm] + +private theorem threeSubspacePairCharacterSum_split + (f : BooleanFunction n) (u : FABL.F₂Cube n) : + (∑ p ∈ binaryThreeSubspacePairs n, + binaryAffineCosetCharacter f u p.1 * + binaryAffineCosetCharacter f u p.2) = + (∑ p ∈ transverseBinaryThreeSubspacePairs n, + binaryAffineCosetCharacter f u p.1 * + binaryAffineCosetCharacter f u p.2) + + ∑ p ∈ nontransverseBinaryThreeSubspacePairs n, + binaryAffineCosetCharacter f u p.1 * + binaryAffineCosetCharacter f u p.2 := by + have hsplit := Finset.sum_filter_add_sum_filter_not + (binaryThreeSubspacePairs n) (fun p ↦ p.1 ⊓ p.2 = ⊥) + (fun p ↦ binaryAffineCosetCharacter f u p.1 * + binaryAffineCosetCharacter f u p.2) + change + (∑ p ∈ transverseBinaryThreeSubspacePairs n, + binaryAffineCosetCharacter f u p.1 * + binaryAffineCosetCharacter f u p.2) + + (∑ p ∈ nontransverseBinaryThreeSubspacePairs n, + binaryAffineCosetCharacter f u p.1 * + binaryAffineCosetCharacter f u p.2) = + ∑ p ∈ binaryThreeSubspacePairs n, + binaryAffineCosetCharacter f u p.1 * + binaryAffineCosetCharacter f u p.2 at hsplit + exact hsplit.symm + +private theorem nontransverseThreeSubspacePairCharacterSum_le_card + (f : BooleanFunction n) (u : FABL.F₂Cube n) : + (∑ p ∈ nontransverseBinaryThreeSubspacePairs n, + binaryAffineCosetCharacter f u p.1 * + binaryAffineCosetCharacter f u p.2) ≤ + ((nontransverseBinaryThreeSubspacePairs n).card : ℝ) := by + calc + (∑ p ∈ nontransverseBinaryThreeSubspacePairs n, + binaryAffineCosetCharacter f u p.1 * + binaryAffineCosetCharacter f u p.2) ≤ + ∑ _p ∈ nontransverseBinaryThreeSubspacePairs n, (1 : ℝ) := by + apply Finset.sum_le_sum + intro p _hp + exact binaryAffineCosetCharacter_mul_le_one f u p.1 p.2 + _ = ((nontransverseBinaryThreeSubspacePairs n).card : ℝ) := by simp + +private theorem transverseThreeSubspacePairCharacterSum_ge_neg_card + (f : BooleanFunction n) (u : FABL.F₂Cube n) : + (∑ p ∈ transverseBinaryThreeSubspacePairs n, + binaryAffineCosetCharacter f u p.1 * + binaryAffineCosetCharacter f u p.2) ≥ + -((nontransverseBinaryThreeSubspacePairs n).card : ℝ) := by + have hall : 0 ≤ ∑ p ∈ binaryThreeSubspacePairs n, + binaryAffineCosetCharacter f u p.1 * + binaryAffineCosetCharacter f u p.2 := by + rw [allThreeSubspacePairCharacterSum_eq_sq] + positivity + rw [threeSubspacePairCharacterSum_split] at hall + have hexcluded := nontransverseThreeSubspacePairCharacterSum_le_card f u + linarith + +/-- A dimension-free coarse form of the weight-fourteen square-sum bound. +It has the `O(2^(6n))` order needed by the moment argument. -/ +theorem weightFourteenRepresentationCharacterSum_ge + (f : BooleanFunction n) : + weightFourteenRepresentationCharacterSum f ≥ + -((2 ^ n : ℝ) ^ 6) / 2 := by + classical + have hsum : + ∑ _u : FABL.F₂Cube n, + -((nontransverseBinaryThreeSubspacePairs n).card : ℝ) ≤ + ∑ u : FABL.F₂Cube n, + ∑ p ∈ transverseBinaryThreeSubspacePairs n, + binaryAffineCosetCharacter f u p.1 * + binaryAffineCosetCharacter f u p.2 := by + apply Finset.sum_le_sum + intro u _hu + exact transverseThreeSubspacePairCharacterSum_ge_neg_card f u + have hcardNat := card_nontransverseBinaryThreeSubspacePairs_le n + have hcardReal : + ((nontransverseBinaryThreeSubspacePairs n).card : ℝ) ≤ + (((2 ^ n) ^ 5 : ℕ) : ℝ) := by + exact_mod_cast hcardNat + norm_num only [Nat.cast_pow, Nat.cast_ofNat] at hcardReal + have hqnonneg : 0 ≤ (2 ^ n : ℝ) := by positivity + have hproduct := mul_le_mul_of_nonneg_left hcardReal hqnonneg + calc + weightFourteenRepresentationCharacterSum f = + (1 / 2 : ℝ) * + ∑ u : FABL.F₂Cube n, + ∑ p ∈ transverseBinaryThreeSubspacePairs n, + binaryAffineCosetCharacter f u p.1 * + binaryAffineCosetCharacter f u p.2 := rfl + _ ≥ (1 / 2 : ℝ) * + ∑ _u : FABL.F₂Cube n, + -((nontransverseBinaryThreeSubspacePairs n).card : ℝ) := by + exact mul_le_mul_of_nonneg_left hsum (by norm_num) + _ = -((2 ^ n : ℝ) * + (nontransverseBinaryThreeSubspacePairs n).card) / 2 := by + rw [Finset.sum_const, Finset.card_univ, card_f₂Cube] + norm_num + ring + _ ≥ -((2 ^ n : ℝ) ^ 6) / 2 := by + nlinarith + +private theorem sum_weightFourteenRepresentations_eq_two_mul + (f : BooleanFunction n) + (hclassification : HasWeightFourteenFlatPairClassification n) : + (∑ p ∈ weightFourteenRepresentations n, + binaryAffineCosetCharacter f p.1 p.2.1 * + binaryAffineCosetCharacter f p.1 p.2.2) = + 2 * orderTwoWeightFourteenCharacterSum f := by + classical + calc + (∑ p ∈ weightFourteenRepresentations n, + binaryAffineCosetCharacter f p.1 p.2.1 * + binaryAffineCosetCharacter f p.1 p.2.2) = + ∑ p ∈ weightFourteenRepresentations n, + FABL.binarySign (booleanFunctionPairing n f + (weightFourteenRepresentationWord p.1 p.2.1 p.2.2)) := by + apply Finset.sum_congr rfl + intro p _hp + rw [weightFourteenRepresentationWord_character] + _ = ∑ h ∈ orderTwoWeightFourteenDualWords n, + ∑ p ∈ (weightFourteenRepresentations n).filter + (fun p ↦ + weightFourteenRepresentationWord p.1 p.2.1 p.2.2 = h), + FABL.binarySign (booleanFunctionPairing n f + (weightFourteenRepresentationWord p.1 p.2.1 p.2.2)) := by + symm + apply Finset.sum_fiberwise_of_maps_to + intro p hp + exact weightFourteenRepresentationWord_mem_dualWords + p.1 p.2.1 p.2.2 + ((mem_weightFourteenRepresentations p).mp hp) + _ = ∑ h ∈ orderTwoWeightFourteenDualWords n, + 2 * FABL.binarySign (booleanFunctionPairing n f h) := by + apply Finset.sum_congr rfl + intro h hh + calc + (∑ p ∈ (weightFourteenRepresentations n).filter + (fun p ↦ + weightFourteenRepresentationWord p.1 p.2.1 p.2.2 = h), + FABL.binarySign (booleanFunctionPairing n f + (weightFourteenRepresentationWord p.1 p.2.1 p.2.2))) = + ∑ _p ∈ (weightFourteenRepresentations n).filter + (fun p ↦ + weightFourteenRepresentationWord p.1 p.2.1 p.2.2 = h), + FABL.binarySign (booleanFunctionPairing n f h) := by + apply Finset.sum_congr rfl + intro p hp + rw [(Finset.mem_filter.mp hp).2] + _ = (((weightFourteenRepresentations n).filter fun p ↦ + weightFourteenRepresentationWord p.1 p.2.1 p.2.2 = h).card : ℝ) * + FABL.binarySign (booleanFunctionPairing n f h) := by simp + _ = 2 * FABL.binarySign (booleanFunctionPairing n f h) := by + rw [card_weightFourteenRepresentationWord_fiber + hclassification h, if_pos hh] + norm_num + _ = 2 * orderTwoWeightFourteenCharacterSum f := by + rw [orderTwoWeightFourteenCharacterSum, Finset.mul_sum] + +/-- Under the Kasami--Tokura existence classification, the canonical +weight-fourteen character sum is exactly the normalized representation +sum. -/ +theorem orderTwoWeightFourteenCharacterSum_eq_representation + (f : BooleanFunction n) + (hclassification : HasWeightFourteenFlatPairClassification n) : + orderTwoWeightFourteenCharacterSum f = + weightFourteenRepresentationCharacterSum f := by + have hsum := sum_weightFourteenRepresentations_eq_two_mul + f hclassification + have hproduct : + (∑ p ∈ weightFourteenRepresentations n, + binaryAffineCosetCharacter f p.1 p.2.1 * + binaryAffineCosetCharacter f p.1 p.2.2) = + ∑ u : FABL.F₂Cube n, + ∑ p ∈ transverseBinaryThreeSubspacePairs n, + binaryAffineCosetCharacter f u p.1 * + binaryAffineCosetCharacter f u p.2 := by + rw [weightFourteenRepresentations] + exact Finset.sum_product _ _ _ + rw [weightFourteenRepresentationCharacterSum] + calc + orderTwoWeightFourteenCharacterSum f = + (1 / 2 : ℝ) * + (2 * orderTwoWeightFourteenCharacterSum f) := by ring + _ = (1 / 2 : ℝ) * + ∑ p ∈ weightFourteenRepresentations n, + binaryAffineCosetCharacter f p.1 p.2.1 * + binaryAffineCosetCharacter f p.1 p.2.2 := by rw [hsum] + _ = (1 / 2 : ℝ) * + ∑ u : FABL.F₂Cube n, + ∑ p ∈ transverseBinaryThreeSubspacePairs n, + binaryAffineCosetCharacter f u p.1 * + binaryAffineCosetCharacter f u p.2 := by rw [hproduct] + +/-- A reusable `O((2^n)^6)` lower bound for the canonical weight-fourteen +contribution, conditional only on the cited Kasami--Tokura existence +classification. -/ +theorem orderTwoWeightFourteenCharacterSum_ge + (f : BooleanFunction n) + (hclassification : HasWeightFourteenFlatPairClassification n) : + orderTwoWeightFourteenCharacterSum f ≥ -((2 ^ n : ℝ) ^ 6) / 2 := by + rw [orderTwoWeightFourteenCharacterSum_eq_representation + f hclassification] + exact weightFourteenRepresentationCharacterSum_ge f + +end CryptBoolean diff --git a/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightFourteenClassification.lean b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightFourteenClassification.lean new file mode 100644 index 0000000..5e28509 --- /dev/null +++ b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightFourteenClassification.lean @@ -0,0 +1,1233 @@ +/- +Copyright (c) 2026 Asher Yan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Asher Yan with Codex +-/ +module + +public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightFourteen +public import CryptBoolean.Carlet.Chapter03.ReedMullerLowWeightAffineSpan +public import CryptBoolean.Carlet.Chapter03.ReedMullerLowWeightSpectrum +public import CryptBoolean.Carlet.Chapter04.HigherOrderNonlinearity + +/-! +# The weight-fourteen affine-flat classification + +The Kasami--Tokura classification specialized to weight fourteen in the +codimension-three Reed--Muller code. +-/ + +open Finset +open scoped BigOperators BooleanCube + +@[expose] public section + +namespace CryptBoolean + +open FABL + +variable {n : ℕ} + +noncomputable local instance weightFourteenClassificationAffineSubspaceFintype : + Fintype (AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) := + Fintype.ofFinite _ + +noncomputable local instance weightFourteenClassificationSubmoduleFintype : + Fintype (Submodule FABL.𝔽₂ (FABL.F₂Cube n)) := + Fintype.ofFinite _ + +private theorem hammingWeight_le_cube_card + (f : BooleanFunction n) : + hammingWeight f ≤ 2 ^ n := by + rw [hammingWeight_eq_card_support, ← card_f₂Cube n] + exact Finset.card_le_card (Finset.subset_univ _) + +private theorem four_le_dimension_of_weight_fourteen + (h : BooleanFunction n) (hweight : hammingWeight h = 14) : + 4 ≤ n := by + have hle := hammingWeight_le_cube_card h + rw [hweight] at hle + by_contra hn + have hn' : n ≤ 3 := by omega + interval_cases n <;> norm_num at hle + +private noncomputable def singletonDirectionMap + (v : FABL.F₂Cube n) : FABL.𝔽₂ →ₗ[FABL.𝔽₂] FABL.F₂Cube n where + toFun c := c • v + map_add' a b := by simp [add_smul] + map_smul' a b := by simp [mul_smul] + +private theorem singletonDirectionMap_injective + {v : FABL.F₂Cube n} (hv : v ≠ 0) : + Function.Injective (singletonDirectionMap v) := by + intro a b hab + change a • v = b • v at hab + exact smul_left_injective FABL.𝔽₂ hv hab + +private noncomputable def firstCoordinateVector (m : ℕ) : + FABL.F₂Cube (m + 1) := + Pi.single 0 1 + +private theorem firstCoordinateVector_ne_zero (m : ℕ) : + firstCoordinateVector m ≠ 0 := by + intro h + have h0 := congrFun h 0 + simp [firstCoordinateVector] at h0 + +private theorem exists_linearEquiv_firstCoordinate_eq + {m : ℕ} (a : FABL.F₂Cube (m + 1)) (ha : a ≠ 0) : + ∃ L : FABL.F₂Cube (m + 1) ≃ₗ[FABL.𝔽₂] FABL.F₂Cube (m + 1), + L (firstCoordinateVector m) = a := by + let e₀ := LinearEquiv.ofInjective + (singletonDirectionMap (firstCoordinateVector m)) + (singletonDirectionMap_injective (firstCoordinateVector_ne_zero m)) + let eₐ := LinearEquiv.ofInjective + (singletonDirectionMap a) (singletonDirectionMap_injective ha) + let e : LinearMap.range (singletonDirectionMap (firstCoordinateVector m)) + ≃ₗ[FABL.𝔽₂] LinearMap.range (singletonDirectionMap a) := + e₀.symm.trans eₐ + obtain ⟨L, hL⟩ := Submodule.exists_linearEquiv_restrict_eq e + refine ⟨L, ?_⟩ + let x : LinearMap.range (singletonDirectionMap (firstCoordinateVector m)) := + ⟨firstCoordinateVector m, ⟨1, by simp [singletonDirectionMap]⟩⟩ + have hx := hL x + change L (firstCoordinateVector m) = a + calc + L (firstCoordinateVector m) = (e x : FABL.F₂Cube (m + 1)) := hx.symm + _ = a := by + change eₐ (e₀.symm x) = a + have he₀ : e₀ (1 : FABL.𝔽₂) = x := by + apply Subtype.ext + change (singletonDirectionMap (firstCoordinateVector m)) 1 = + firstCoordinateVector m + simp [singletonDirectionMap] + rw [← he₀, e₀.symm_apply_apply] + change (singletonDirectionMap a) 1 = a + simp [singletonDirectionMap] + +private theorem hammingWeight_comp_linearEquiv + (f : BooleanFunction n) + (L : FABL.F₂Cube n ≃ₗ[FABL.𝔽₂] FABL.F₂Cube n) : + hammingWeight (f ∘ L) = hammingWeight f := by + classical + rw [hammingWeight_eq_card_support, hammingWeight_eq_card_support] + simp only [support, FABL.f₂OneSupport, Function.comp_apply] + rw [Finset.card_filter, Finset.card_filter] + exact Equiv.sum_comp L.toEquiv + (fun x ↦ if f x = 1 then (1 : ℕ) else 0) + +private theorem firstCoordinateSlice_zero_eq_one_of_period + {m : ℕ} (f : BooleanFunction (m + 1)) + (hperiod : FABL.booleanDerivative f (firstCoordinateVector m) = 0) : + firstCoordinateSlice f 0 = firstCoordinateSlice f 1 := by + funext x + have hx := congrFun hperiod (Fin.cons 0 x) + simp only [FABL.booleanDerivative, Pi.zero_apply] at hx + have hadd : Fin.cons 0 x + firstCoordinateVector m = Fin.cons 1 x := by + funext i + refine Fin.cases ?_ (fun j ↦ ?_) i + · simp [firstCoordinateVector] + · simp [firstCoordinateVector] + rw [hadd] at hx + exact add_eq_zero_iff_eq_neg.mp hx |>.trans (by + exact ZMod.neg_eq_self_mod_two _) + +private theorem no_nonzero_period_of_weight_fourteen + (h : BooleanFunction n) + (hn : 4 ≤ n) + (hdegree : FABL.functionAlgebraicDegree h ≤ n - 3) + (hweight : hammingWeight h = 14) + (a : FABL.F₂Cube n) (ha : a ≠ 0) : + FABL.booleanDerivative h a ≠ 0 := by + intro hperiod + obtain ⟨m, rfl⟩ := Nat.exists_eq_succ_of_ne_zero (by omega : n ≠ 0) + obtain ⟨L, hLa⟩ := exists_linearEquiv_firstCoordinate_eq a ha + let f : BooleanFunction (m + 1) := h ∘ L + have hfPeriod : FABL.booleanDerivative f (firstCoordinateVector m) = 0 := by + funext x + simp only [f, FABL.booleanDerivative, Function.comp_apply, L.map_add, hLa] + exact congrFun hperiod (L x) + let g : BooleanFunction m := firstCoordinateSlice f 0 + have hslices : firstCoordinateSlice f 0 = firstCoordinateSlice f 1 := + firstCoordinateSlice_zero_eq_one_of_period f hfPeriod + have hfWeight : hammingWeight f = 14 := by + simpa only [f] using (hammingWeight_comp_linearEquiv h L).trans hweight + have hsliceWeight := hammingWeight_firstCoordinateSlices f + have hgWeight : hammingWeight g = 7 := by + change hammingWeight (firstCoordinateSlice f 0) = 7 + have htwice : 14 = hammingWeight (firstCoordinateSlice f 0) + + hammingWeight (firstCoordinateSlice f 0) := by + calc + 14 = hammingWeight f := hfWeight.symm + _ = hammingWeight (firstCoordinateSlice f 0) + + hammingWeight (firstCoordinateSlice f 1) := hsliceWeight + _ = _ := by rw [← hslices] + omega + have hfDegree : FABL.functionAlgebraicDegree f ≤ m - 2 := by + have hcomp := FABL.functionAlgebraicDegree_comp_affineEquiv + h L.toAffineEquiv + change FABL.functionAlgebraicDegree f = + FABL.functionAlgebraicDegree h at hcomp + rw [hcomp] + simpa only [show m + 1 - 3 = m - 2 by omega] using hdegree + have hgDegree : FABL.functionAlgebraicDegree g ≤ m - 2 := by + exact (firstCoordinateSlice_degree_le f 0 hfDegree) + have heven := even_hammingWeight_of_degree_lt_dimension g + (hgDegree.trans_lt (by omega)) + rw [hgWeight] at heven + norm_num at heven + +private noncomputable def supportPairSum + (t : Finset (FABL.F₂Cube n)) : FABL.F₂Cube n := + ∑ x ∈ t, x + +private theorem exists_four_support_points_same_sum + (h : BooleanFunction n) (p : FABL.F₂Cube n) + (hspan : Module.finrank FABL.𝔽₂ (supportDifferenceSpan h p) ≤ 6) + (hweight : hammingWeight h = 14) : + ∃ x y z w : FABL.F₂Cube n, + x ∈ support h ∧ y ∈ support h ∧ + z ∈ support h ∧ w ∈ support h ∧ + x ≠ y ∧ z ≠ w ∧ + Disjoint ({x, y} : Finset (FABL.F₂Cube n)) {z, w} ∧ + x + y = z + w := by + classical + let pairs := (support h).powersetCard 2 + let E := supportDifferenceSpan h p + have hsupportCard : (support h).card = 14 := by + simpa only [hammingWeight_eq_card_support] using hweight + have hpairsCard : pairs.card = 91 := by + simp only [pairs, Finset.card_powersetCard, hsupportCard] + norm_num [Nat.choose] + have hsumMem : ∀ t ∈ pairs, supportPairSum t ∈ E := by + intro t ht + have htdata := Finset.mem_powersetCard.mp ht + obtain ⟨x, y, hxy, rfl⟩ := Finset.card_eq_two.mp htdata.2 + simp only [supportPairSum, Finset.sum_insert, Finset.mem_singleton, + hxy, not_false_eq_true, Finset.sum_singleton] + have hxMem : x ∈ ({x, y} : Finset (FABL.F₂Cube n)) := by simp + have hyMem : y ∈ ({x, y} : Finset (FABL.F₂Cube n)) := by simp + have hx := support_subset_binaryAffineSubspace_supportDifferenceSpan h p + (htdata.1 hxMem) + have hy := support_subset_binaryAffineSubspace_supportDifferenceSpan h p + (htdata.1 hyMem) + change x ∈ FABL.binaryAffineSubspace (supportDifferenceSpan h p) p at hx + change y ∈ FABL.binaryAffineSubspace (supportDifferenceSpan h p) p at hy + rw [FABL.mem_binaryAffineSubspace_iff_add_mem] at hx hy + have hsum : x + y = (x + p) + (y + p) := by + calc + x + y = (x + y) + (p + p) := by + rw [ZModModule.add_self, add_zero] + _ = (x + p) + (y + p) := by abel + rw [hsum] + exact E.add_mem hx hy + let pairToE : {t // t ∈ pairs} → E := fun t ↦ + ⟨supportPairSum t.1, hsumMem t.1 t.2⟩ + have hECard : Fintype.card E ≤ 64 := by + rw [← Nat.card_eq_fintype_card] + rw [Module.natCard_eq_pow_finrank (K := FABL.𝔽₂) (V := E)] + have := hspan + interval_cases Module.finrank FABL.𝔽₂ E <;> norm_num + have hpigeon : Fintype.card E < Fintype.card {t // t ∈ pairs} := by + rw [Fintype.card_coe, hpairsCard] + omega + obtain ⟨A, B, hAB, hsum⟩ := + Fintype.exists_ne_map_eq_of_card_lt pairToE hpigeon + have hAdata := Finset.mem_powersetCard.mp A.2 + have hBdata := Finset.mem_powersetCard.mp B.2 + obtain ⟨x, y, hxy, hA⟩ := Finset.card_eq_two.mp hAdata.2 + obtain ⟨z, w, hzw, hB⟩ := Finset.card_eq_two.mp hBdata.2 + have hpairSum : x + y = z + w := by + have hval := congrArg Subtype.val hsum + simpa [pairToE, supportPairSum, hA, hB, hxy, hzw] using hval + have hdisjoint : Disjoint ({x, y} : Finset (FABL.F₂Cube n)) {z, w} := by + rw [Finset.disjoint_left] + intro q hqA hqB + have hqA' : q ∈ A.1 := by simpa only [hA] using hqA + have hqB' : q ∈ B.1 := by simpa only [hB] using hqB + have hAeraseCard : (A.1.erase q).card = 1 := by + rw [Finset.card_erase_of_mem hqA', hAdata.2] + have hBeraseCard : (B.1.erase q).card = 1 := by + rw [Finset.card_erase_of_mem hqB', hBdata.2] + obtain ⟨u, hAu⟩ := Finset.card_eq_one.mp hAeraseCard + obtain ⟨v, hBv⟩ := Finset.card_eq_one.mp hBeraseCard + have hsumErase : supportPairSum (A.1.erase q) = + supportPairSum (B.1.erase q) := by + have hA_sum := Finset.sum_erase_add (s := A.1) (f := fun x ↦ x) hqA' + have hB_sum := Finset.sum_erase_add (s := B.1) (f := fun x ↦ x) hqB' + have hsumVal := congrArg Subtype.val hsum + simp only [pairToE] at hsumVal + simp only [supportPairSum] + simp only [supportPairSum] at hsumVal + rw [← hA_sum, ← hB_sum] at hsumVal + exact add_right_cancel hsumVal + have huv : u = v := by + simpa [supportPairSum, hAu, hBv] using hsumErase + apply hAB + apply Subtype.ext + rw [← Finset.insert_erase hqA', ← Finset.insert_erase hqB', + hAu, hBv, huv] + refine ⟨x, y, z, w, ?_, ?_, ?_, ?_, hxy, hzw, hdisjoint, hpairSum⟩ + · exact hAdata.1 (by simp [hA]) + · exact hAdata.1 (by simp [hA]) + · exact hBdata.1 (by simp [hB]) + · exact hBdata.1 (by simp [hB]) + +private theorem booleanDerivative_self_direction + (f : BooleanFunction n) (a : FABL.F₂Cube n) : + FABL.booleanDerivative (FABL.booleanDerivative f a) a = 0 := by + funext x + simp only [FABL.booleanDerivative, Pi.zero_apply] + have harg : x + a + a = x := by + rw [add_assoc, ZModModule.add_self, add_zero] + rw [harg] + calc + (f x + f (x + a)) + (f (x + a) + f x) = + (f x + f x) + (f (x + a) + f (x + a)) := by abel + _ = 0 := by + rw [ZModModule.add_self, ZModModule.add_self, add_zero] + +private theorem booleanDerivative_value_add_direction + (f : BooleanFunction n) (a x : FABL.F₂Cube n) : + FABL.booleanDerivative f a (x + a) = + FABL.booleanDerivative f a x := by + simp only [FABL.booleanDerivative] + have harg : x + a + a = x := by + rw [add_assoc, ZModModule.add_self, add_zero] + rw [harg] + exact add_comm _ _ + +private theorem hammingWeight_booleanDerivative_eq_sixteen_of_le_twenty + (h : BooleanFunction n) + (hn : 4 ≤ n) + (hdegree : FABL.functionAlgebraicDegree h ≤ n - 3) + (hweight : hammingWeight h = 14) + (a : FABL.F₂Cube n) (ha : a ≠ 0) + (hupper : hammingWeight (FABL.booleanDerivative h a) ≤ 20) : + hammingWeight (FABL.booleanDerivative h a) = 16 := by + let d := FABL.booleanDerivative h a + have hdNe : d ≠ 0 := + no_nonzero_period_of_weight_fourteen h hn hdegree hweight a ha + have hdDegree : FABL.functionAlgebraicDegree d ≤ n - 4 := by + exact (FABL.functionAlgebraicDegree_booleanDerivative_le h a).trans + (by omega) + obtain ⟨m, rfl⟩ := Nat.exists_eq_succ_of_ne_zero (by omega : n ≠ 0) + obtain ⟨L, hLa⟩ := exists_linearEquiv_firstCoordinate_eq a ha + let f : BooleanFunction (m + 1) := d ∘ L + have hfPeriod : FABL.booleanDerivative f (firstCoordinateVector m) = 0 := by + funext x + simp only [f, FABL.booleanDerivative, Function.comp_apply, L.map_add, hLa] + exact congrFun (booleanDerivative_self_direction h a) (L x) + let g : BooleanFunction m := firstCoordinateSlice f 0 + have hslices : firstCoordinateSlice f 0 = firstCoordinateSlice f 1 := + firstCoordinateSlice_zero_eq_one_of_period f hfPeriod + have hfWeight : hammingWeight f = hammingWeight d := + hammingWeight_comp_linearEquiv d L + have hsliceWeight := hammingWeight_firstCoordinateSlices f + have htwice : hammingWeight d = 2 * hammingWeight g := by + change hammingWeight d = 2 * hammingWeight (firstCoordinateSlice f 0) + calc + hammingWeight d = hammingWeight f := hfWeight.symm + _ = hammingWeight (firstCoordinateSlice f 0) + + hammingWeight (firstCoordinateSlice f 1) := hsliceWeight + _ = 2 * hammingWeight (firstCoordinateSlice f 0) := by + rw [← hslices, two_mul] + have hfDegree : FABL.functionAlgebraicDegree f ≤ m - 3 := by + have hcomp := FABL.functionAlgebraicDegree_comp_affineEquiv + d L.toAffineEquiv + change FABL.functionAlgebraicDegree f = + FABL.functionAlgebraicDegree d at hcomp + rw [hcomp] + simpa only [show m + 1 - 4 = m - 3 by omega] using hdDegree + have hgDegree : FABL.functionAlgebraicDegree g ≤ m - 3 := + firstCoordinateSlice_degree_le f 0 hfDegree + have hgNe : g ≠ 0 := by + intro hg + apply hdNe + apply hammingNorm_eq_zero.mp + change hammingWeight d = 0 + rw [htwice] + simp [g, hg] + have hglower := two_pow_sub_le_hammingWeight_of_degree_le + g hgDegree hgNe + have hm : 3 ≤ m := by omega + have hexponent : m - (m - 3) = 3 := by omega + rw [hexponent] at hglower + norm_num at hglower + have hgupper : hammingWeight g ≤ 10 := by + have := hupper + change hammingWeight d ≤ 20 at this + rw [htwice] at this + omega + have hgeven := even_hammingWeight_of_degree_lt_dimension g + (hgDegree.trans_lt (by omega)) + have hgNotTen : hammingWeight g ≠ 10 := by + apply hammingWeight_ne_ten_of_mem_reedMuller_codimension_three g hm + simpa only [mem_reedMuller_iff] using hgDegree + obtain ⟨k, hk⟩ := hgeven + have hgWeight : hammingWeight g = 8 := by omega + rw [htwice, hgWeight] + +private theorem exists_weight_sixteen_derivative + (h : BooleanFunction n) + (hn : 4 ≤ n) + (hdegree : FABL.functionAlgebraicDegree h ≤ n - 3) + (hweight : hammingWeight h = 14) : + ∃ a : FABL.F₂Cube n, a ≠ 0 ∧ + hammingWeight (FABL.booleanDerivative h a) = 16 := by + have hsupportNonempty : (support h).Nonempty := by + apply Finset.card_pos.mp + rw [← hammingWeight_eq_card_support, hweight] + norm_num + obtain ⟨p, hp⟩ := hsupportNonempty + have hmem : h ∈ reedMuller (n - 3) n := by + simpa only [mem_reedMuller_iff] using hdegree + have hspan := finrank_supportDifferenceSpan_le_six_of_weight_fourteen + h p hp (by omega) hmem hweight + obtain ⟨x, y, z, w, hx, hy, hz, hw, hxy, hzw, + hdisjoint, hpairsum⟩ := + exists_four_support_points_same_sum h p hspan hweight + let a := x + y + have ha : a ≠ 0 := by + intro haZero + apply hxy + have := add_eq_zero_iff_eq_neg.mp haZero + exact this.trans (by + funext i + exact ZMod.neg_eq_self_mod_two (y i)) + let t : BooleanFunction n := fun q ↦ h (q + a) + have hfourSubset : ({x, y} ∪ {z, w} : Finset (FABL.F₂Cube n)) ⊆ + support h ∩ support t := by + intro q hq + simp only [Finset.mem_union, Finset.mem_insert, Finset.mem_singleton] at hq + simp only [Finset.mem_inter, mem_support] + rcases hq with (hqx | hqy) | (hqz | hqw) + · subst q + refine ⟨(mem_support h x).mp hx, ?_⟩ + change h (x + (x + y)) = 1 + have harg : x + (x + y) = y := by + rw [← add_assoc, ZModModule.add_self, zero_add] + rw [harg] + exact (mem_support h y).mp hy + · subst q + refine ⟨(mem_support h y).mp hy, ?_⟩ + change h (y + (x + y)) = 1 + have harg : y + (x + y) = x := by + calc + y + (x + y) = x + (y + y) := by abel + _ = x := by rw [ZModModule.add_self, add_zero] + rw [harg] + exact (mem_support h x).mp hx + · subst q + refine ⟨(mem_support h z).mp hz, ?_⟩ + change h (z + (x + y)) = 1 + have harg : z + (x + y) = w := by + rw [hpairsum] + rw [← add_assoc, ZModModule.add_self, zero_add] + rw [harg] + exact (mem_support h w).mp hw + · subst q + refine ⟨(mem_support h w).mp hw, ?_⟩ + change h (w + (x + y)) = 1 + have harg : w + (x + y) = z := by + rw [hpairsum] + calc + w + (z + w) = z + (w + w) := by abel + _ = z := by rw [ZModModule.add_self, add_zero] + rw [harg] + exact (mem_support h z).mp hz + have hfourCard : ({x, y} ∪ {z, w} : Finset (FABL.F₂Cube n)).card = 4 := by + rw [Finset.card_union_of_disjoint hdisjoint] + simp [hxy, hzw] + have hinterLower : 4 ≤ (support h ∩ support t).card := by + rw [← hfourCard] + exact Finset.card_mono hfourSubset + have htWeight : hammingWeight t = 14 := by + simpa only [t, hweight] using hammingWeight_translate h a + have hidentity := hammingWeight_add_add_two_mul_card_support_inter h t + have hderivative : h + t = FABL.booleanDerivative h a := rfl + rw [hderivative, hweight, htWeight] at hidentity + have hupper : hammingWeight (FABL.booleanDerivative h a) ≤ 20 := by + omega + exact ⟨a, ha, + hammingWeight_booleanDerivative_eq_sixteen_of_le_twenty + h hn hdegree hweight a ha hupper⟩ + +private theorem exists_derivative_affine_four_flat + (h : BooleanFunction n) + (hn : 4 ≤ n) + (hdegree : FABL.functionAlgebraicDegree h ≤ n - 3) + (hweight : hammingWeight h = 14) : + ∃ (a : FABL.F₂Cube n) + (D : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) + (b : FABL.F₂Cube n), + a ≠ 0 ∧ Module.finrank FABL.𝔽₂ D = 4 ∧ a ∈ D ∧ + FABL.booleanDerivative h a = affineFlatIndicator D b := by + obtain ⟨a, ha, hdWeight⟩ := + exists_weight_sixteen_derivative h hn hdegree hweight + let d := FABL.booleanDerivative h a + have hdNe : d ≠ 0 := by + intro hdZero + have : FABL.booleanDerivative h a = 0 := hdZero + rw [this] at hdWeight + simp at hdWeight + have hdDegreeLe : FABL.functionAlgebraicDegree d ≤ n - 4 := by + exact (FABL.functionAlgebraicDegree_booleanDerivative_le h a).trans + (by omega) + have hdDegree : FABL.functionAlgebraicDegree d = n - 4 := by + by_contra hne + have hlt : FABL.functionAlgebraicDegree d < n - 4 := + lt_of_le_of_ne hdDegreeLe hne + by_cases hnFour : n = 4 + · subst n + norm_num at hlt + · have hnFive : 5 ≤ n := by omega + have hsmall : FABL.functionAlgebraicDegree d ≤ n - 5 := by omega + have hlower := two_pow_sub_le_hammingWeight_of_degree_le d hsmall hdNe + have hexponent : n - (n - 5) = 5 := by omega + rw [hexponent, hdWeight] at hlower + norm_num at hlower + have hpower : 2 ^ (n - (n - 4)) = 16 := by + have : n - (n - 4) = 4 := by omega + rw [this] + norm_num + obtain ⟨D, b, hDrank, hdIndicator⟩ := + (degree_eq_and_hammingWeight_eq_iff_exists_affineFlatIndicator + d (r := n - 4) (by omega)).mp + ⟨hdDegree, by simpa only [hpower] using hdWeight⟩ + have hDrankFour : Module.finrank FABL.𝔽₂ D = 4 := by + simpa only [show n - (n - 4) = 4 by omega] using hDrank + have hbMem : b ∈ FABL.binaryAffineSubspace D b := by + rw [FABL.mem_binaryAffineSubspace_iff_add_mem, + ZModModule.add_self] + exact D.zero_mem + have hbaMem : b + a ∈ FABL.binaryAffineSubspace D b := by + have hdAtB : d b = 1 := by + rw [hdIndicator] + simp [affineFlatIndicator, hbMem] + have hdAtBA : d (b + a) = 1 := by + have heq : d (b + a) = d b := by + dsimp only [d] + simp only [FABL.booleanDerivative] + have harg : b + a + a = b := by + rw [add_assoc, ZModModule.add_self, add_zero] + rw [harg] + exact add_comm _ _ + rw [heq, hdAtB] + rw [hdIndicator] at hdAtBA + exact (affineFlatIndicator_apply_eq_one_iff D b (b + a)).mp hdAtBA + have haD : a ∈ D := by + rw [FABL.mem_binaryAffineSubspace_iff_add_mem] at hbaMem + have harg : b + a + b = a := by + calc + b + a + b = a + (b + b) := by abel + _ = a := by rw [ZModModule.add_self, add_zero] + rwa [harg] at hbaMem + exact ⟨a, D, b, ha, hDrankFour, haD, hdIndicator⟩ + +private theorem add_direction_mem_pair_iff + (a p x : FABL.F₂Cube n) : + x + a ∈ ({p, p + a} : Finset (FABL.F₂Cube n)) ↔ + x ∈ ({p, p + a} : Finset (FABL.F₂Cube n)) := by + simp only [Finset.mem_insert, Finset.mem_singleton] + constructor + · rintro (h | h) + · right + calc + x = (x + a) + a := by + rw [add_assoc, ZModModule.add_self, add_zero] + _ = p + a := by rw [h] + · left + calc + x = (x + a) + a := by + rw [add_assoc, ZModModule.add_self, add_zero] + _ = p := by + rw [h, add_assoc, ZModModule.add_self, add_zero] + · rintro (rfl | rfl) + · right; rfl + · left + rw [add_assoc, ZModModule.add_self, add_zero] + +private theorem card_direction_pair + (a p : FABL.F₂Cube n) (ha : a ≠ 0) : + ({p, p + a} : Finset (FABL.F₂Cube n)).card = 2 := by + have hne : p + a ≠ p := by + intro hpa + apply ha + apply add_left_cancel + simpa only [add_zero] using hpa + simp [Ne.symm hne] + +private theorem exists_three_direction_pair_representatives + (O : Finset (FABL.F₂Cube n)) + (a : FABL.F₂Cube n) (ha : a ≠ 0) + (hcard : O.card = 6) + (hinvariant : ∀ x, x ∈ O → x + a ∈ O) : + ∃ p q r : FABL.F₂Cube n, + O = {p, p + a} ∪ {q, q + a} ∪ {r, r + a} ∧ + Disjoint ({p, p + a} : Finset (FABL.F₂Cube n)) {q, q + a} ∧ + Disjoint (({p, p + a} ∪ {q, q + a}) : + Finset (FABL.F₂Cube n)) {r, r + a} := by + classical + have hOne : O.Nonempty := Finset.card_pos.mp (by omega) + obtain ⟨p, hp⟩ := hOne + let P : Finset (FABL.F₂Cube n) := {p, p + a} + have hPsub : P ⊆ O := by + intro x hx + simp only [P, Finset.mem_insert, Finset.mem_singleton] at hx + rcases hx with rfl | rfl + · exact hp + · exact hinvariant p hp + have hPcard : P.card = 2 := card_direction_pair a p ha + let O₁ := O \ P + have hO₁card : O₁.card = 4 := by + change (O \ P).card = 4 + rw [Finset.card_sdiff_of_subset hPsub, hcard, hPcard] + have hO₁nonempty : O₁.Nonempty := Finset.card_pos.mp (by omega) + obtain ⟨q, hq⟩ := hO₁nonempty + let Q : Finset (FABL.F₂Cube n) := {q, q + a} + have hQsub : Q ⊆ O₁ := by + intro x hx + simp only [Q, Finset.mem_insert, Finset.mem_singleton] at hx + have hqO : q ∈ O := (Finset.mem_sdiff.mp hq).1 + have hqNotP : q ∉ P := (Finset.mem_sdiff.mp hq).2 + rcases hx with rfl | rfl + · exact hq + · apply Finset.mem_sdiff.mpr + refine ⟨hinvariant q hqO, ?_⟩ + simpa only [P, add_direction_mem_pair_iff] using hqNotP + have hQcard : Q.card = 2 := card_direction_pair a q ha + let O₂ := O₁ \ Q + have hO₂card : O₂.card = 2 := by + change (O₁ \ Q).card = 2 + rw [Finset.card_sdiff_of_subset hQsub, hO₁card, hQcard] + have hO₂nonempty : O₂.Nonempty := Finset.card_pos.mp (by omega) + obtain ⟨r, hr⟩ := hO₂nonempty + let R : Finset (FABL.F₂Cube n) := {r, r + a} + have hRsub : R ⊆ O₂ := by + intro x hx + simp only [R, Finset.mem_insert, Finset.mem_singleton] at hx + have hrO₁ : r ∈ O₁ := (Finset.mem_sdiff.mp hr).1 + have hrNotQ : r ∉ Q := (Finset.mem_sdiff.mp hr).2 + have hrO : r ∈ O := (Finset.mem_sdiff.mp hrO₁).1 + have hrNotP : r ∉ P := (Finset.mem_sdiff.mp hrO₁).2 + rcases hx with rfl | rfl + · exact hr + · apply Finset.mem_sdiff.mpr + constructor + · apply Finset.mem_sdiff.mpr + refine ⟨hinvariant r hrO, ?_⟩ + simpa only [P, add_direction_mem_pair_iff] using hrNotP + · simpa only [Q, add_direction_mem_pair_iff] using hrNotQ + have hRcard : R.card = 2 := card_direction_pair a r ha + have hR_eq : O₂ = R := by + symm + apply Finset.eq_of_subset_of_card_le hRsub + rw [hRcard, hO₂card] + have hO₁eq : O₁ = Q ∪ R := by + rw [← hR_eq] + exact (Finset.union_sdiff_of_subset hQsub).symm + have hOeq : O = P ∪ Q ∪ R := by + calc + O = P ∪ O₁ := (Finset.union_sdiff_of_subset hPsub).symm + _ = P ∪ (Q ∪ R) := by rw [hO₁eq] + _ = P ∪ Q ∪ R := by rw [Finset.union_assoc] + have hPQdisjoint : Disjoint P Q := by + exact Finset.disjoint_left.mpr (fun x hxP hxQ ↦ + (Finset.mem_sdiff.mp (hQsub hxQ)).2 hxP) + have hPQRdisjoint : Disjoint (P ∪ Q) R := by + exact Finset.disjoint_left.mpr (fun x hxPQ hxR ↦ by + have hxO₂ := hRsub hxR + have hxNotQ := (Finset.mem_sdiff.mp hxO₂).2 + have hxNotP := (Finset.mem_sdiff.mp + (Finset.mem_sdiff.mp hxO₂).1).2 + exact (Finset.mem_union.mp hxPQ).elim hxNotP hxNotQ) + exact ⟨p, q, r, by simpa only [P, Q, R] using hOeq, + by simpa only [P, Q] using hPQdisjoint, + by simpa only [P, Q, R] using hPQRdisjoint⟩ + +private noncomputable def commonSupportPairs + (h : BooleanFunction n) (a : FABL.F₂Cube n) : + Finset (FABL.F₂Cube n) := + support h ∩ support (fun x ↦ h (x + a)) + +@[simp] private theorem mem_commonSupportPairs + (h : BooleanFunction n) (a x : FABL.F₂Cube n) : + x ∈ commonSupportPairs h a ↔ h x = 1 ∧ h (x + a) = 1 := by + simp [commonSupportPairs, mem_support] + +private theorem commonSupportPairs_invariant + (h : BooleanFunction n) (a x : FABL.F₂Cube n) + (hx : x ∈ commonSupportPairs h a) : + x + a ∈ commonSupportPairs h a := by + rw [mem_commonSupportPairs] at hx ⊢ + refine ⟨hx.2, ?_⟩ + simpa only [add_assoc, ZModModule.add_self, add_zero] using hx.1 + +private theorem card_commonSupportPairs_of_weight_fourteen_derivative_sixteen + (h : BooleanFunction n) (a : FABL.F₂Cube n) + (hweight : hammingWeight h = 14) + (hderivative : hammingWeight (FABL.booleanDerivative h a) = 16) : + (commonSupportPairs h a).card = 6 := by + let t : BooleanFunction n := fun x ↦ h (x + a) + have htWeight : hammingWeight t = 14 := by + simpa only [t, hweight] using hammingWeight_translate h a + have hidentity := hammingWeight_add_add_two_mul_card_support_inter h t + have hadd : h + t = FABL.booleanDerivative h a := rfl + change (support h ∩ support t).card = 6 + rw [hadd, hderivative, hweight, htWeight] at hidentity + omega + +private theorem support_outside_derivative_subset_commonSupportPairs + (h : BooleanFunction n) (a x : FABL.F₂Cube n) + (hx : x ∈ support h) + (hxd : x ∉ support (FABL.booleanDerivative h a)) : + x ∈ commonSupportPairs h a := by + rw [mem_commonSupportPairs] + refine ⟨(mem_support h x).mp hx, ?_⟩ + have hdZero : FABL.booleanDerivative h a x = 0 := by + by_contra hd + exact hxd ((mem_support _ x).mpr (Fin.eq_one_of_ne_zero _ hd)) + rw [FABL.booleanDerivative, (mem_support h x).mp hx] at hdZero + have hneg := add_eq_zero_iff_eq_neg.mp hdZero + simpa only [ZMod.neg_eq_self_mod_two] using hneg.symm + +private theorem commonSupportPairs_disjoint_derivativeSupport + (h : BooleanFunction n) (a : FABL.F₂Cube n) : + Disjoint (commonSupportPairs h a) + (support (FABL.booleanDerivative h a)) := by + rw [Finset.disjoint_left] + intro x hxO hxd + rw [mem_commonSupportPairs] at hxO + have hdOne := (mem_support (FABL.booleanDerivative h a) x).mp hxd + rw [FABL.booleanDerivative, hxO.1, hxO.2] at hdOne + change (0 : FABL.𝔽₂) = 1 at hdOne + exact zero_ne_one hdOne + +private noncomputable def threePairDirection + (a p q r : FABL.F₂Cube n) : + Submodule FABL.𝔽₂ (FABL.F₂Cube n) := + Submodule.span FABL.𝔽₂ + (↑({a, q + p, r + p} : Finset (FABL.F₂Cube n)) : + Set (FABL.F₂Cube n)) + +private noncomputable def threePairFlat + (a p q r : FABL.F₂Cube n) : + AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) := + FABL.binaryAffineSubspace (threePairDirection a p q r) p + +private theorem three_direction_pairs_subset_threePairFlat + (a p q r : FABL.F₂Cube n) : + ({p, p + a} ∪ {q, q + a} ∪ {r, r + a} : + Finset (FABL.F₂Cube n)) ⊆ + binaryAffineFlatPoints (threePairFlat a p q r) := by + intro x hx + rw [mem_binaryAffineFlatPoints] + unfold threePairFlat + rw [ + FABL.mem_binaryAffineSubspace_iff_add_mem] + simp only [Finset.mem_union, Finset.mem_insert, Finset.mem_singleton] at hx + rcases hx with ((hxp | hxpa) | (hxq | hxqa)) | (hxr | hxra) + · subst x + rw [ZModModule.add_self] + exact Submodule.zero_mem _ + · subst x + have harg : p + a + p = a := by + calc + p + a + p = a + (p + p) := by abel + _ = a := by rw [ZModModule.add_self, add_zero] + rw [harg] + exact Submodule.subset_span (by simp) + · subst x + exact Submodule.subset_span (by simp) + · subst x + have ha : a ∈ threePairDirection a p q r := + Submodule.subset_span (by simp) + have hqp : q + p ∈ threePairDirection a p q r := + Submodule.subset_span (by simp) + have harg : q + a + p = a + (q + p) := by abel + rw [harg] + exact (threePairDirection a p q r).add_mem ha hqp + · subst x + exact Submodule.subset_span (by simp) + · subst x + have ha : a ∈ threePairDirection a p q r := + Submodule.subset_span (by simp) + have hrp : r + p ∈ threePairDirection a p q r := + Submodule.subset_span (by simp) + have harg : r + a + p = a + (r + p) := by abel + rw [harg] + exact (threePairDirection a p q r).add_mem ha hrp + +private theorem finrank_threePairDirection_le_three + (a p q r : FABL.F₂Cube n) : + Module.finrank FABL.𝔽₂ (threePairDirection a p q r) ≤ 3 := by + have hspan := finrank_span_finset_le_card (R := FABL.𝔽₂) + ({a, q + p, r + p} : Finset (FABL.F₂Cube n)) + have hcard : ({a, q + p, r + p} : + Finset (FABL.F₂Cube n)).card ≤ 3 := Finset.card_le_three + rw [Set.finrank] at hspan + unfold threePairDirection + exact hspan.trans hcard + +private theorem threePairFlat_ne_bot + (a p q r : FABL.F₂Cube n) : + threePairFlat a p q r ≠ ⊥ := by + intro hbot + have hp : p ∈ (⊥ : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) := by + rw [← hbot] + exact AffineSubspace.self_mem_mk' _ _ + rw [← SetLike.mem_coe, AffineSubspace.bot_coe] at hp + exact hp + +private theorem finrank_threePairDirection_eq_three_of_six_subset + (O : Finset (FABL.F₂Cube n)) + (a p q r : FABL.F₂Cube n) + (hOcard : O.card = 6) + (hOsub : O ⊆ binaryAffineFlatPoints (threePairFlat a p q r)) : + Module.finrank FABL.𝔽₂ (threePairDirection a p q r) = 3 := by + have hcardFlat := card_binaryAffineFlatPoints (threePairFlat a p q r) + (threePairFlat_ne_bot a p q r) + rw [threePairFlat, FABL.binaryAffineSubspace_direction] at hcardFlat + have hlower : 6 ≤ 2 ^ Module.finrank FABL.𝔽₂ + (threePairDirection a p q r) := by + rw [← hcardFlat, ← hOcard] + exact Finset.card_mono hOsub + have hupper := finrank_threePairDirection_le_three a p q r + interval_cases Module.finrank FABL.𝔽₂ + (threePairDirection a p q r) + all_goals norm_num at hlower + all_goals omega + +private theorem threePairDirection_contains_direction + (a p q r : FABL.F₂Cube n) : + a ∈ threePairDirection a p q r := by + apply Submodule.subset_span + simp + +private theorem threePairFlat_add_direction_mem_iff + (a p q r x : FABL.F₂Cube n) : + x + a ∈ threePairFlat a p q r ↔ + x ∈ threePairFlat a p q r := by + unfold threePairFlat + rw [FABL.mem_binaryAffineSubspace_iff_add_mem, + FABL.mem_binaryAffineSubspace_iff_add_mem] + have ha := threePairDirection_contains_direction a p q r + constructor + · intro hx + have := (threePairDirection a p q r).add_mem hx ha + have harg : (x + a + p) + a = x + p := by + calc + (x + a + p) + a = x + p + (a + a) := by abel + _ = x + p := by rw [ZModModule.add_self, add_zero] + rwa [harg] at this + · intro hx + have := (threePairDirection a p q r).add_mem hx ha + have harg : (x + p) + a = x + a + p := by abel + rwa [harg] at this + +/-- Kasami--Tokura's weight-fourteen existence classification. -/ +theorem hasWeightFourteenFlatPairClassification (n : ℕ) : + HasWeightFourteenFlatPairClassification n := by + intro h hh + have hhData : h ∈ reedMuller (n - 3) n ∧ hammingWeight h = 14 := by + simpa only [orderTwoWeightFourteenDualWords, orderTwoDualWords, + Finset.mem_filter, Finset.mem_univ, true_and] using hh + have hmem := hhData.1 + have hweight := hhData.2 + have hn : 4 ≤ n := four_le_dimension_of_weight_fourteen h hweight + have hdegree : FABL.functionAlgebraicDegree h ≤ n - 3 := by + simpa only [mem_reedMuller_iff] using hmem + obtain ⟨a, D, b, ha, hDrank, haD, hdIndicator⟩ := + exists_derivative_affine_four_flat h hn hdegree hweight + let d := FABL.booleanDerivative h a + let A : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) := + FABL.binaryAffineSubspace D b + have hbA : b ∈ A := by + change b ∈ FABL.binaryAffineSubspace D b + rw [FABL.mem_binaryAffineSubspace_iff_add_mem, + ZModModule.add_self] + exact D.zero_mem + have hdBinaryIndicator : d = binaryAffineFlatIndicator A := by + change FABL.booleanDerivative h a = binaryAffineFlatIndicator A + rw [hdIndicator] + calc + affineFlatIndicator D b = affineFlatIndicator A.direction b := by + change affineFlatIndicator D b = + affineFlatIndicator (FABL.binaryAffineSubspace D b).direction b + rw [FABL.binaryAffineSubspace_direction] + _ = binaryAffineFlatIndicator A := + (binaryAffineFlatIndicator_eq_affineFlatIndicator A b hbA).symm + have hdWeight : hammingWeight d = 16 := by + rw [hdBinaryIndicator, + hammingWeight_binaryAffineFlatIndicator A] + · change 2 ^ Module.finrank FABL.𝔽₂ + (FABL.binaryAffineSubspace D b).direction = 16 + rw [FABL.binaryAffineSubspace_direction, hDrank] + norm_num + · intro hbot + have := hbA + rw [hbot, ← SetLike.mem_coe, AffineSubspace.bot_coe] at this + exact this + let O := commonSupportPairs h a + have hOcard : O.card = 6 := by + exact card_commonSupportPairs_of_weight_fourteen_derivative_sixteen + h a hweight hdWeight + have hOinvariant : ∀ x, x ∈ O → x + a ∈ O := by + intro x hx + exact commonSupportPairs_invariant h a x hx + obtain ⟨p, q, r, hOeq, hpqDisjoint, hpqrDisjoint⟩ := + exists_three_direction_pair_representatives O a ha hOcard hOinvariant + let Kdir := threePairDirection a p q r + let K := threePairFlat a p q r + let Kpoints := binaryAffineFlatPoints K + have hOsubK : O ⊆ Kpoints := by + rw [hOeq] + exact three_direction_pairs_subset_threePairFlat a p q r + have hKrank : Module.finrank FABL.𝔽₂ Kdir = 3 := by + exact finrank_threePairDirection_eq_three_of_six_subset + O a p q r hOcard hOsubK + have hKdirection : K.direction = Kdir := by + change (threePairFlat a p q r).direction = + threePairDirection a p q r + rw [threePairFlat, FABL.binaryAffineSubspace_direction] + have hKcard : Kpoints.card = 8 := by + have hcard := card_binaryAffineFlatPoints K + (threePairFlat_ne_bot a p q r) + change Kpoints.card = 8 + rw [hcard] + rw [hKdirection, hKrank] + norm_num + let C := Kpoints \ O + have hCcard : C.card = 2 := by + change (Kpoints \ O).card = 2 + rw [Finset.card_sdiff_of_subset hOsubK, hKcard, hOcard] + have hCinvariant : ∀ x, x ∈ C → x + a ∈ C := by + intro x hx + have hxData := Finset.mem_sdiff.mp hx + apply Finset.mem_sdiff.mpr + constructor + · have hxK : x ∈ K := (mem_binaryAffineFlatPoints K x).mp hxData.1 + apply (mem_binaryAffineFlatPoints K (x + a)).mpr + exact (threePairFlat_add_direction_mem_iff a p q r x).mpr hxK + · intro hxaO + apply hxData.2 + have := hOinvariant (x + a) hxaO + simpa only [add_assoc, ZModModule.add_self, add_zero] using this + have hCnonempty : C.Nonempty := Finset.card_pos.mp (by omega) + obtain ⟨c, hc⟩ := hCnonempty + have hcAdd : c + a ∈ C := hCinvariant c hc + have hcNe : c ≠ c + a := by + intro heq + apply ha + apply add_left_cancel + simpa only [add_zero] using heq.symm + have hCeq : C = {c, c + a} := by + apply Finset.eq_of_subset_of_card_le + · intro x hx + have hpairSub : ({c, c + a} : Finset (FABL.F₂Cube n)) ⊆ C := by + intro y hy + simp only [Finset.mem_insert, Finset.mem_singleton] at hy + rcases hy with rfl | rfl + · exact hc + · exact hcAdd + have hpairCard := card_direction_pair a c ha + have heq : ({c, c + a} : Finset (FABL.F₂Cube n)) = C := + Finset.eq_of_subset_of_card_le hpairSub (by rw [hpairCard, hCcard]) + simpa only [heq] using hx + · rw [hCcard] + simp [hcNe] + have hKne : K ≠ ⊥ := threePairFlat_ne_bot a p q r + have hKrankDirection : Module.finrank FABL.𝔽₂ K.direction = 3 := by + rw [hKdirection] + exact hKrank + have hKmem : K ∈ binaryAffineFlats 3 n := by + simp only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, + true_and] + exact ⟨hKne, hKrankDirection⟩ + have hKindicatorWeight : + hammingWeight (binaryAffineFlatIndicator K) = 8 := by + rw [hammingWeight_binaryAffineFlatIndicator K hKne, + hKrankDirection] + norm_num + have hCsubsetDerivative : C ⊆ support d := by + have hcDerivative : c ∈ support d := by + by_contra hcNotDerivative + have hcAddNotDerivative : c + a ∉ support d := by + intro hcAddDerivative + apply hcNotDerivative + apply (mem_support d c).mpr + have hvalue := booleanDerivative_value_add_direction h a c + have hcAddOne := (mem_support d (c + a)).mp hcAddDerivative + change d (c + a) = d c at hvalue + rw [← hvalue] + exact hcAddOne + have hsupportInterK : support h ∩ Kpoints = O := by + ext x + simp only [Finset.mem_inter] + constructor + · rintro ⟨hxSupport, hxK⟩ + by_cases hxO : x ∈ O + · exact hxO + · have hxC : x ∈ C := Finset.mem_sdiff.mpr ⟨hxK, hxO⟩ + rw [hCeq] at hxC + simp only [Finset.mem_insert, Finset.mem_singleton] at hxC + have hxNotDerivative : x ∉ support d := by + rcases hxC with rfl | rfl + · exact hcNotDerivative + · exact hcAddNotDerivative + exact (hxO + (support_outside_derivative_subset_commonSupportPairs + h a x hxSupport hxNotDerivative)).elim + · intro hxO + have hxCommon := (mem_commonSupportPairs h a x).mp hxO + exact ⟨(mem_support h x).mpr hxCommon.1, hOsubK hxO⟩ + have hinterCard : (support h ∩ + support (binaryAffineFlatIndicator K)).card = 6 := by + rw [support_binaryAffineFlatIndicator, hsupportInterK, hOcard] + have hsumWeight := + hammingWeight_add_add_two_mul_card_support_inter h + (binaryAffineFlatIndicator K) + rw [hweight, hKindicatorWeight, hinterCard] at hsumWeight + have hten : hammingWeight + (h + binaryAffineFlatIndicator K) = 10 := by omega + have hsumMem : h + binaryAffineFlatIndicator K ∈ + reedMuller (n - 3) n := + (reedMuller (n - 3) n).add_mem hmem + (binaryAffineFlatIndicator_mem_reedMuller K hKmem) + exact hammingWeight_ne_ten_of_mem_reedMuller_codimension_three + (h + binaryAffineFlatIndicator K) (by omega) hsumMem hten + intro x hxC + rw [hCeq] at hxC + simp only [Finset.mem_insert, Finset.mem_singleton] at hxC + rcases hxC with rfl | rfl + · exact hcDerivative + · apply (mem_support d (c + a)).mpr + have hvalue := booleanDerivative_value_add_direction h a c + change d (c + a) = d c at hvalue + rw [hvalue] + exact (mem_support d c).mp hcDerivative + have hcDerivativeOne : d c = 1 := + (mem_support d c).mp (hCsubsetDerivative hc) + have hsumAtC : h c + h (c + a) = 1 := by + simpa only [d, FABL.booleanDerivative] using hcDerivativeOne + have hsupportCcard : (support h ∩ C).card = 1 := by + rw [hCeq] + by_cases hcZero : h c = 0 + · have hcAddOne : h (c + a) = 1 := by + simpa only [hcZero, zero_add] using hsumAtC + have hcNotSupport : c ∉ support h := by + intro hcSupport + exact zero_ne_one (hcZero.symm.trans (mem_support h c |>.mp hcSupport)) + have hcAddSupport : c + a ∈ support h := + (mem_support h (c + a)).mpr hcAddOne + have hinter : support h ∩ ({c, c + a} : Finset (FABL.F₂Cube n)) = + {c + a} := by + ext x + simp only [Finset.mem_inter, Finset.mem_insert, Finset.mem_singleton] + constructor + · rintro ⟨hxSupport, rfl | rfl⟩ + · exact (hcNotSupport hxSupport).elim + · exact rfl + · intro hx + subst x + exact ⟨hcAddSupport, Or.inr rfl⟩ + rw [hinter] + simp + · have hcOne : h c = 1 := Fin.eq_one_of_ne_zero _ hcZero + have hcAddZero : h (c + a) = 0 := by + have heq : 1 + h (c + a) = 1 + 0 := by + simpa only [hcOne, add_zero] using hsumAtC + exact add_left_cancel heq + have hcSupport : c ∈ support h := (mem_support h c).mpr hcOne + have hcAddNotSupport : c + a ∉ support h := by + intro hcAddSupport + exact zero_ne_one + (hcAddZero.symm.trans (mem_support h (c + a) |>.mp hcAddSupport)) + have hinter : support h ∩ ({c, c + a} : Finset (FABL.F₂Cube n)) = + {c} := by + ext x + simp only [Finset.mem_inter, Finset.mem_insert, Finset.mem_singleton] + constructor + · rintro ⟨hxSupport, rfl | rfl⟩ + · exact rfl + · exact (hcAddNotSupport hxSupport).elim + · intro hx + subst x + exact ⟨hcSupport, Or.inl rfl⟩ + rw [hinter] + simp + have hOsubSupport : O ⊆ support h := by + intro x hxO + exact (mem_support h x).mpr ((mem_commonSupportPairs h a x).mp hxO).1 + have hsupportInterKpoints : + support h ∩ Kpoints = O ∪ (support h ∩ C) := by + calc + support h ∩ Kpoints = support h ∩ (O ∪ (Kpoints \ O)) := by + rw [Finset.union_sdiff_of_subset hOsubK] + _ = (support h ∩ O) ∪ (support h ∩ (Kpoints \ O)) := by + exact Finset.inter_union_distrib_left _ _ _ + _ = O ∪ (support h ∩ C) := by + rw [Finset.inter_eq_right.mpr hOsubSupport] + have hOdisjointSupportC : Disjoint O (support h ∩ C) := by + apply Disjoint.mono_right Finset.inter_subset_right + change Disjoint O (Kpoints \ O) + exact Finset.disjoint_sdiff + have hsupportInterKcard : (support h ∩ Kpoints).card = 7 := by + rw [hsupportInterKpoints, + Finset.card_union_of_disjoint hOdisjointSupportC, + hOcard, hsupportCcard] + let g : BooleanFunction n := h + binaryAffineFlatIndicator K + have hinterIndicatorCard : + (support h ∩ support (binaryAffineFlatIndicator K)).card = 7 := by + rw [support_binaryAffineFlatIndicator] + exact hsupportInterKcard + have hgWeight : hammingWeight g = 8 := by + have hsumWeight := + hammingWeight_add_add_two_mul_card_support_inter h + (binaryAffineFlatIndicator K) + rw [hweight, hKindicatorWeight, hinterIndicatorCard] at hsumWeight + change hammingWeight (h + binaryAffineFlatIndicator K) = 8 + omega + have hgMem : g ∈ reedMuller (n - 3) n := by + exact (reedMuller (n - 3) n).add_mem hmem + (binaryAffineFlatIndicator_mem_reedMuller K hKmem) + have hgDegreeLe : FABL.functionAlgebraicDegree g ≤ n - 3 := by + simpa only [mem_reedMuller_iff] using hgMem + have hgNe : g ≠ 0 := by + intro hgZero + rw [hgZero] at hgWeight + norm_num at hgWeight + have hgDegree : FABL.functionAlgebraicDegree g = n - 3 := by + apply Nat.le_antisymm hgDegreeLe + by_contra hnot + have hgDegreeFour : FABL.functionAlgebraicDegree g ≤ n - 4 := by + omega + have hlower := two_pow_sub_le_hammingWeight_of_degree_le + g hgDegreeFour hgNe + have hsub : n - (n - 4) = 4 := by omega + rw [hsub, hgWeight] at hlower + norm_num at hlower + have hgWeightPower : hammingWeight g = 2 ^ (n - (n - 3)) := by + rw [hgWeight] + norm_num [show n - (n - 3) = 3 by omega] + obtain ⟨Hdir, u, hHrank, hgAffineIndicator⟩ := + (degree_eq_and_hammingWeight_eq_iff_exists_affineFlatIndicator + g (r := n - 3) (by omega)).mp ⟨hgDegree, hgWeightPower⟩ + let H : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) := + FABL.binaryAffineSubspace Hdir u + have huH : u ∈ H := by + change u ∈ FABL.binaryAffineSubspace Hdir u + rw [FABL.mem_binaryAffineSubspace_iff_add_mem, + ZModModule.add_self] + exact Hdir.zero_mem + have hHdirection : H.direction = Hdir := by + change (FABL.binaryAffineSubspace Hdir u).direction = Hdir + rw [FABL.binaryAffineSubspace_direction] + have hHrankDirection : Module.finrank FABL.𝔽₂ H.direction = 3 := by + rw [hHdirection, hHrank] + omega + have hHne : H ≠ ⊥ := by + intro hbot + have := huH + rw [hbot, ← SetLike.mem_coe, AffineSubspace.bot_coe] at this + exact this + have hHmem : H ∈ binaryAffineFlats 3 n := by + simp only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, + true_and] + exact ⟨hHne, hHrankDirection⟩ + have hgBinaryIndicator : g = binaryAffineFlatIndicator H := by + calc + g = affineFlatIndicator Hdir u := hgAffineIndicator + _ = affineFlatIndicator H.direction u := by rw [hHdirection] + _ = binaryAffineFlatIndicator H := + (binaryAffineFlatIndicator_eq_affineFlatIndicator H u huH).symm + have hdecomposition : + h = binaryAffineFlatIndicator H + binaryAffineFlatIndicator K := by + funext x + have hx := congrFun hgBinaryIndicator x + change h x + binaryAffineFlatIndicator K x = + binaryAffineFlatIndicator H x at hx + calc + h x = (h x + binaryAffineFlatIndicator K x) + + binaryAffineFlatIndicator K x := by + rw [add_assoc, ZModModule.add_self, add_zero] + _ = binaryAffineFlatIndicator H x + + binaryAffineFlatIndicator K x := by rw [hx] + have hHindicatorWeight : hammingWeight (binaryAffineFlatIndicator H) = 8 := by + rw [hammingWeight_binaryAffineFlatIndicator H hHne, + hHrankDirection] + norm_num + have hflatSupportInterCard : + (support (binaryAffineFlatIndicator H) ∩ + support (binaryAffineFlatIndicator K)).card = 1 := by + have hweightIdentity := + hammingWeight_add_add_two_mul_card_support_inter + (binaryAffineFlatIndicator H) (binaryAffineFlatIndicator K) + rw [← hdecomposition, hweight, hHindicatorWeight, + hKindicatorWeight] at hweightIdentity + omega + have hflatPointsInterCard : + (binaryAffineFlatPoints H ∩ binaryAffineFlatPoints K).card = 1 := by + simpa only [support_binaryAffineFlatIndicator] using hflatSupportInterCard + obtain ⟨u₀, hflatPointsInter⟩ := Finset.card_eq_one.mp hflatPointsInterCard + have hu₀Inter : + u₀ ∈ binaryAffineFlatPoints H ∩ binaryAffineFlatPoints K := by + rw [hflatPointsInter] + simp + have hu₀H : u₀ ∈ H := + (mem_binaryAffineFlatPoints H u₀).mp (Finset.mem_inter.mp hu₀Inter).1 + have hu₀K : u₀ ∈ K := + (mem_binaryAffineFlatPoints K u₀).mp (Finset.mem_inter.mp hu₀Inter).2 + have hHflat : FABL.binaryAffineSubspace Hdir u₀ = H := by + calc + FABL.binaryAffineSubspace Hdir u₀ = + FABL.binaryAffineSubspace H.direction u₀ := by rw [hHdirection] + _ = H := AffineSubspace.mk'_eq hu₀H + have hKflat : FABL.binaryAffineSubspace Kdir u₀ = K := by + calc + FABL.binaryAffineSubspace Kdir u₀ = + FABL.binaryAffineSubspace K.direction u₀ := by rw [hKdirection] + _ = K := AffineSubspace.mk'_eq hu₀K + have hAffineInterSet : + ((H ⊓ K : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) : + Set (FABL.F₂Cube n)) = {u₀} := by + ext x + change (x ∈ H ∧ x ∈ K) ↔ x = u₀ + have hx := congrArg (fun s : Finset (FABL.F₂Cube n) ↦ x ∈ s) + hflatPointsInter + exact Iff.of_eq (by + simpa only [Finset.mem_inter, mem_binaryAffineFlatPoints, + Finset.mem_singleton] using hx) + have hInfDirection : (H ⊓ K).direction = ⊥ := by + rw [AffineSubspace.direction_eq_vectorSpan, hAffineInterSet, + vectorSpan_singleton] + have hmeet : Hdir ⊓ Kdir = ⊥ := by + calc + Hdir ⊓ Kdir = H.direction ⊓ K.direction := by + rw [hHdirection, hKdirection] + _ = (H ⊓ K).direction := + (AffineSubspace.direction_inf_of_mem hu₀H hu₀K).symm + _ = ⊥ := hInfDirection + have hHrankThree : Module.finrank FABL.𝔽₂ Hdir = 3 := by + omega + have hpairMem : + (Hdir, Kdir) ∈ transverseBinaryThreeSubspacePairs n := by + have hpProduct : (Hdir, Kdir) ∈ binaryThreeSubspacePairs n := by + change (Hdir, Kdir) ∈ + (binaryLinearSubspaces 3 n).product (binaryLinearSubspaces 3 n) + exact Finset.mem_product.mpr + ⟨(mem_binaryLinearSubspaces Hdir).mpr hHrankThree, + (mem_binaryLinearSubspaces Kdir).mpr hKrank⟩ + have hpData : + (Hdir, Kdir) ∈ binaryThreeSubspacePairs n ∧ Hdir ⊓ Kdir = ⊥ := + ⟨hpProduct, hmeet⟩ + simpa only [transverseBinaryThreeSubspacePairs, + Finset.mem_filter] using hpData + refine ⟨u₀, Hdir, Kdir, hpairMem, ?_⟩ + change binaryAffineFlatIndicator (FABL.binaryAffineSubspace Hdir u₀) + + binaryAffineFlatIndicator (FABL.binaryAffineSubspace Kdir u₀) = h + rw [hHflat, hKflat] + exact hdecomposition.symm + +end CryptBoolean diff --git a/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteen.lean b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteen.lean new file mode 100644 index 0000000..9184d6c --- /dev/null +++ b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteen.lean @@ -0,0 +1,863 @@ +/- +Copyright (c) 2026 Asher Yan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Asher Yan with Codex +-/ +module + +public import CryptBoolean.Carlet.Chapter04.HigherOrderLowWeightFlats +public import Mathlib.LinearAlgebra.AffineSpace.FiniteDimensional +public import Mathlib.LinearAlgebra.Dual.Basis + +/-! +# The weight-sixteen dual character sum + +The disjoint-three-flat square-sum argument behind Carlet--Mesnager +Proposition 9.2.10(4). +-/ + +open Finset +open scoped BigOperators BooleanCube + +@[expose] public section + +namespace CryptBoolean + +open FABL + +variable {n : ℕ} + +noncomputable local instance weightSixteenFintypeAffineSubspace : Fintype + (AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) := + Fintype.ofFinite _ + +noncomputable local instance weightSixteenDecidableEqAffineSubspace : DecidableEq + (AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) := + Classical.decEq _ + +noncomputable local instance weightSixteenFintypeDual + (H : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) : + Fintype (Module.Dual FABL.𝔽₂ H) := + Module.fintypeOfFintype (Module.finBasis FABL.𝔽₂ H).dualBasis + +/-- Ordered pairs of binary affine three-flats. -/ +noncomputable def binaryAffineThreeFlatPairs (n : ℕ) : + Finset (AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × + AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) := + (binaryAffineFlats 3 n).product (binaryAffineFlats 3 n) + +/-- Ordered pairs of disjoint binary affine three-flats. -/ +noncomputable def disjointBinaryAffineThreeFlatPairs (n : ℕ) : + Finset (AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × + AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) := by + classical + exact (binaryAffineThreeFlatPairs n).filter fun p ↦ p.1 ⊓ p.2 = ⊥ + +/-- Ordered pairs of intersecting binary affine three-flats. -/ +noncomputable def intersectingBinaryAffineThreeFlatPairs (n : ℕ) : + Finset (AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × + AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) := by + classical + exact (binaryAffineThreeFlatPairs n).filter fun p ↦ p.1 ⊓ p.2 ≠ ⊥ + +/-- The Boolean word represented by two affine three-flats. -/ +noncomputable def weightSixteenRepresentationWord + (A B : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) : + BooleanFunction n := + binaryAffineFlatIndicator A + binaryAffineFlatIndicator B + +/-- The weight-sixteen words in the dual Reed--Muller code. -/ +noncomputable def orderTwoWeightSixteenDualWords (n : ℕ) : + Finset (BooleanFunction n) := by + classical + exact (orderTwoDualWords n).filter fun h ↦ hammingWeight h = 16 + +/-- The canonical character sum over weight-sixteen dual words. -/ +noncomputable def orderTwoWeightSixteenCharacterSum + (f : BooleanFunction n) : ℝ := + ∑ h ∈ orderTwoWeightSixteenDualWords n, + FABL.binarySign (booleanFunctionPairing n f h) + +/-- The normalized character sum over ordered disjoint-flat +representations. -/ +noncomputable def weightSixteenRepresentationCharacterSum + (f : BooleanFunction n) : ℝ := + (1 / 2 : ℝ) * + ∑ p ∈ disjointBinaryAffineThreeFlatPairs n, + binaryAffineFlatCharacter f p.1 * binaryAffineFlatCharacter f p.2 + +private theorem affineThreeFlatPairData + {A B : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)} + (hp : (A, B) ∈ binaryAffineThreeFlatPairs n) : + A ∈ binaryAffineFlats 3 n ∧ B ∈ binaryAffineFlats 3 n := by + change (A, B) ∈ (binaryAffineFlats 3 n).product + (binaryAffineFlats 3 n) at hp + exact Finset.mem_product.mp hp + +private theorem affineThreeFlatData + {A : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)} + (hA : A ∈ binaryAffineFlats 3 n) : + A ≠ ⊥ ∧ Module.finrank FABL.𝔽₂ A.direction = 3 := by + simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, + true_and] using hA + +private theorem disjointAffineThreeFlatPairData + {A B : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)} + (hp : (A, B) ∈ disjointBinaryAffineThreeFlatPairs n) : + A ∈ binaryAffineFlats 3 n ∧ B ∈ binaryAffineFlats 3 n ∧ + A ⊓ B = ⊥ := by + have hp' : (A, B) ∈ binaryAffineThreeFlatPairs n ∧ A ⊓ B = ⊥ := by + simpa only [disjointBinaryAffineThreeFlatPairs, + Finset.mem_filter] using hp + exact ⟨(affineThreeFlatPairData hp'.1).1, + (affineThreeFlatPairData hp'.1).2, hp'.2⟩ + +private theorem binaryAffineFlatPoints_inter_eq_empty + (A B : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) + (hdisjoint : A ⊓ B = ⊥) : + binaryAffineFlatPoints A ∩ binaryAffineFlatPoints B = ∅ := by + ext x + constructor + · intro hx + exfalso + have hx' := Finset.mem_inter.mp hx + have hxMeet : x ∈ A ⊓ B := by + exact ⟨(mem_binaryAffineFlatPoints A x).mp hx'.1, + (mem_binaryAffineFlatPoints B x).mp hx'.2⟩ + rw [hdisjoint] at hxMeet + rw [← SetLike.mem_coe, AffineSubspace.bot_coe] at hxMeet + simp at hxMeet + · intro hx + simp at hx + +/-- A disjoint pair of affine three-flats represents a word of Hamming +weight sixteen. -/ +theorem hammingWeight_weightSixteenRepresentationWord + (A B : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) + (hp : (A, B) ∈ disjointBinaryAffineThreeFlatPairs n) : + hammingWeight (weightSixteenRepresentationWord A B) = 16 := by + have hpdata := disjointAffineThreeFlatPairData hp + have hAdata := affineThreeFlatData hpdata.1 + have hBdata := affineThreeFlatData hpdata.2.1 + have hintersection := binaryAffineFlatPoints_inter_eq_empty + A B hpdata.2.2 + have hidentity := hammingWeight_add_add_two_mul_card_support_inter + (binaryAffineFlatIndicator A) (binaryAffineFlatIndicator B) + rw [support_binaryAffineFlatIndicator, + support_binaryAffineFlatIndicator, hintersection, + hammingWeight_binaryAffineFlatIndicator A hAdata.1, + hammingWeight_binaryAffineFlatIndicator B hBdata.1, + hAdata.2, hBdata.2] at hidentity + change hammingWeight + (binaryAffineFlatIndicator A + binaryAffineFlatIndicator B) = 16 + norm_num at hidentity + omega + +/-- Every disjoint-three-flat representation produces a weight-sixteen +dual Reed--Muller word. -/ +theorem weightSixteenRepresentationWord_mem_dualWords + (A B : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) + (hp : (A, B) ∈ disjointBinaryAffineThreeFlatPairs n) : + weightSixteenRepresentationWord A B ∈ + orderTwoWeightSixteenDualWords n := by + have hpdata := disjointAffineThreeFlatPairData hp + have hA := binaryAffineFlatIndicator_mem_reedMuller A hpdata.1 + have hB := binaryAffineFlatIndicator_mem_reedMuller B hpdata.2.1 + simp only [orderTwoWeightSixteenDualWords, orderTwoDualWords, + Finset.mem_filter, Finset.mem_univ, true_and] + exact ⟨(reedMuller (n - 3) n).add_mem hA hB, + hammingWeight_weightSixteenRepresentationWord A B hp⟩ + +/-- The character of a represented word is the product of its two +affine-flat characters. -/ +theorem weightSixteenRepresentationWord_character + (f : BooleanFunction n) + (A B : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) : + FABL.binarySign (booleanFunctionPairing n f + (weightSixteenRepresentationWord A B)) = + binaryAffineFlatCharacter f A * binaryAffineFlatCharacter f B := by + rw [weightSixteenRepresentationWord, map_add, AddChar.map_add_eq_mul] + rfl + +/-- The type-`a` exceptional words: indicators of affine four-flats. -/ +noncomputable def orderTwoWeightSixteenTypeAWords (n : ℕ) : + Finset (BooleanFunction n) := by + classical + exact (binaryAffineFlats 4 n).image binaryAffineFlatIndicator + +/-- Every affine-four-flat indicator is a weight-sixteen word in the dual +Reed--Muller code. -/ +theorem orderTwoWeightSixteenTypeAWords_subset_dualWords (n : ℕ) : + orderTwoWeightSixteenTypeAWords n ⊆ orderTwoWeightSixteenDualWords n := by + classical + intro h hh + obtain ⟨A, hA, rfl⟩ := Finset.mem_image.mp hh + have hAdata : A ≠ ⊥ ∧ Module.finrank FABL.𝔽₂ A.direction = 4 := by + simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, + true_and] using hA + have hmemComplementary := binaryAffineFlatIndicator_mem_reedMuller A hA + have hmem : binaryAffineFlatIndicator A ∈ reedMuller (n - 3) n := + reedMuller_mono (by omega : n - 4 ≤ n - 3) hmemComplementary + have hweight : hammingWeight (binaryAffineFlatIndicator A) = 16 := by + rw [hammingWeight_binaryAffineFlatIndicator A hAdata.1, hAdata.2] + norm_num + simpa only [orderTwoWeightSixteenDualWords, orderTwoDualWords, + Finset.mem_filter, Finset.mem_univ, true_and] using ⟨hmem, hweight⟩ + +private theorem exists_spanning_quadruple_of_finrank_four + (H : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) + (hH : Module.finrank FABL.𝔽₂ H = 4) : + ∃ a b c d : FABL.F₂Cube n, + H = (((FABL.𝔽₂ ∙ a) ⊔ (FABL.𝔽₂ ∙ b)) ⊔ + (FABL.𝔽₂ ∙ c)) ⊔ (FABL.𝔽₂ ∙ d) := by + have hbotlt : (⊥ : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) < H := by + apply bot_lt_iff_ne_bot.mpr + intro hHbot + rw [hHbot, finrank_bot] at hH + omega + obtain ⟨a, haH, haBot⟩ := SetLike.exists_of_lt hbotlt + have ha0 : a ≠ 0 := by + intro ha + subst a + exact haBot (Submodule.zero_mem _) + let S₁ : Submodule FABL.𝔽₂ (FABL.F₂Cube n) := FABL.𝔽₂ ∙ a + have hS₁le : S₁ ≤ H := + Submodule.span_le.2 (Set.singleton_subset_iff.2 haH) + have hS₁rank : Module.finrank FABL.𝔽₂ S₁ = 1 := + finrank_span_singleton ha0 + have hS₁lt : S₁ < H := + Submodule.lt_of_le_of_finrank_lt_finrank hS₁le (by omega) + obtain ⟨b, hbH, hbS₁⟩ := SetLike.exists_of_lt hS₁lt + let S₂ : Submodule FABL.𝔽₂ (FABL.F₂Cube n) := + S₁ ⊔ (FABL.𝔽₂ ∙ b) + have hS₂le : S₂ ≤ H := by + exact sup_le hS₁le + (Submodule.span_le.2 (Set.singleton_subset_iff.2 hbH)) + have hS₂rank : Module.finrank FABL.𝔽₂ S₂ = 2 := by + dsimp only [S₂] + rw [Submodule.finrank_sup_span_singleton hbS₁, hS₁rank] + have hS₂lt : S₂ < H := + Submodule.lt_of_le_of_finrank_lt_finrank hS₂le (by omega) + obtain ⟨c, hcH, hcS₂⟩ := SetLike.exists_of_lt hS₂lt + let S₃ : Submodule FABL.𝔽₂ (FABL.F₂Cube n) := + S₂ ⊔ (FABL.𝔽₂ ∙ c) + have hS₃le : S₃ ≤ H := by + exact sup_le hS₂le + (Submodule.span_le.2 (Set.singleton_subset_iff.2 hcH)) + have hS₃rank : Module.finrank FABL.𝔽₂ S₃ = 3 := by + dsimp only [S₃] + rw [Submodule.finrank_sup_span_singleton hcS₂, hS₂rank] + have hS₃lt : S₃ < H := + Submodule.lt_of_le_of_finrank_lt_finrank hS₃le (by omega) + obtain ⟨d, hdH, hdS₃⟩ := SetLike.exists_of_lt hS₃lt + refine ⟨a, b, c, d, ?_⟩ + symm + apply Submodule.eq_of_le_of_finrank_eq + · exact sup_le hS₃le + (Submodule.span_le.2 (Set.singleton_subset_iff.2 hdH)) + · rw [Submodule.finrank_sup_span_singleton hdS₃, hS₃rank, hH] + +private structure AffineFourFlatWitness + (A : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) where + u : FABL.F₂Cube n + a : FABL.F₂Cube n + b : FABL.F₂Cube n + c : FABL.F₂Cube n + d : FABL.F₂Cube n + flat_eq : A = FABL.binaryAffineSubspace + ((((FABL.𝔽₂ ∙ a) ⊔ (FABL.𝔽₂ ∙ b)) ⊔ + (FABL.𝔽₂ ∙ c)) ⊔ (FABL.𝔽₂ ∙ d)) u + +private noncomputable def affineFourFlatWitness + (A : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) + (hA : A ∈ binaryAffineFlats 4 n) : AffineFourFlatWitness A := by + classical + have hAdata : A ≠ ⊥ ∧ Module.finrank FABL.𝔽₂ A.direction = 4 := by + simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, + true_and] using hA + let u := Classical.choose + ((AffineSubspace.nonempty_iff_ne_bot A).2 hAdata.1) + have hu := Classical.choose_spec + ((AffineSubspace.nonempty_iff_ne_bot A).2 hAdata.1) + let hspanExists := + exists_spanning_quadruple_of_finrank_four A.direction hAdata.2 + let a := Classical.choose hspanExists + let b := Classical.choose (Classical.choose_spec hspanExists) + let c := Classical.choose + (Classical.choose_spec (Classical.choose_spec hspanExists)) + let d := Classical.choose (Classical.choose_spec + (Classical.choose_spec (Classical.choose_spec hspanExists))) + have hspan := Classical.choose_spec (Classical.choose_spec + (Classical.choose_spec (Classical.choose_spec hspanExists))) + refine ⟨u, a, b, c, d, ?_⟩ + calc + A = FABL.binaryAffineSubspace A.direction u := + (AffineSubspace.mk'_eq hu).symm + _ = FABL.binaryAffineSubspace + ((((FABL.𝔽₂ ∙ a) ⊔ (FABL.𝔽₂ ∙ b)) ⊔ + (FABL.𝔽₂ ∙ c)) ⊔ (FABL.𝔽₂ ∙ d)) u := by rw [hspan] + +private def affineFourFlatWitnessCode + {A : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)} + (w : AffineFourFlatWitness A) : Fin 5 → FABL.F₂Cube n := + ![w.u, w.a, w.b, w.c, w.d] + +private noncomputable def affineFourFlatCode + (A : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) : + Fin 5 → FABL.F₂Cube n := by + classical + exact if hA : A ∈ binaryAffineFlats 4 n then + affineFourFlatWitnessCode (affineFourFlatWitness A hA) + else 0 + +private theorem affineFourFlatCode_injective_on : + Set.InjOn (affineFourFlatCode (n := n)) + (binaryAffineFlats 4 n : + Set (AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n))) := by + intro A hA B hB hcode + have hA' : A ∈ binaryAffineFlats 4 n := hA + have hB' : B ∈ binaryAffineFlats 4 n := hB + let wA := affineFourFlatWitness A hA + let wB := affineFourFlatWitness B hB + have hcode' : affineFourFlatWitnessCode wA = + affineFourFlatWitnessCode wB := by + unfold affineFourFlatCode at hcode + rw [dif_pos hA', dif_pos hB'] at hcode + simpa only [wA, wB] using hcode + have h0 : wA.u = wB.u := by + simpa [affineFourFlatWitnessCode] using congrFun hcode' (0 : Fin 5) + have h1 : wA.a = wB.a := by + simpa [affineFourFlatWitnessCode] using congrFun hcode' (1 : Fin 5) + have h2 : wA.b = wB.b := by + simpa [affineFourFlatWitnessCode] using congrFun hcode' (2 : Fin 5) + have h3 : wA.c = wB.c := by + simpa [affineFourFlatWitnessCode] using congrFun hcode' (3 : Fin 5) + have h4 : wA.d = wB.d := by + simpa [affineFourFlatWitnessCode] using congrFun hcode' (4 : Fin 5) + rw [wA.flat_eq, wB.flat_eq, h0, h1, h2, h3, h4] + +/-- The type-`a` exceptional family has at most `(2^n)^5` words. -/ +theorem card_orderTwoWeightSixteenTypeAWords_le (n : ℕ) : + (orderTwoWeightSixteenTypeAWords n).card ≤ (2 ^ n) ^ 5 := by + classical + calc + (orderTwoWeightSixteenTypeAWords n).card ≤ + (binaryAffineFlats 4 n).card := by + exact Finset.card_image_le + _ ≤ (Finset.univ : Finset (Fin 5 → FABL.F₂Cube n)).card := by + apply Finset.card_le_card_of_injOn (affineFourFlatCode (n := n)) + · intro A _hA + exact Finset.mem_univ _ + · exact affineFourFlatCode_injective_on + _ = (2 ^ n) ^ 5 := by + rw [Finset.card_univ, Fintype.card_fun, Fintype.card_fin, card_f₂Cube] + +private noncomputable def nonzeroBinaryDuals + (H : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) : + Finset (Module.Dual FABL.𝔽₂ H) := by + classical + exact Finset.univ.filter fun ℓ ↦ ℓ ≠ 0 + +private theorem card_nonzeroBinaryDuals_of_finrank_four + (H : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) + (hH : Module.finrank FABL.𝔽₂ H = 4) : + (nonzeroBinaryDuals H).card = 15 := by + classical + let B : Module.Basis (Fin (Module.finrank FABL.𝔽₂ H)) FABL.𝔽₂ H := + Module.finBasis FABL.𝔽₂ H + have hcardDual : Fintype.card (Module.Dual FABL.𝔽₂ H) = 16 := by + calc + Fintype.card (Module.Dual FABL.𝔽₂ H) = + Fintype.card (Fin (Module.finrank FABL.𝔽₂ H) → FABL.𝔽₂) := + Fintype.card_congr B.dualBasis.equivFun.toEquiv + _ = 16 := by + rw [Fintype.card_fun, Fintype.card_fin, hH] + norm_num + have hfilter : nonzeroBinaryDuals H = + (Finset.univ : Finset (Module.Dual FABL.𝔽₂ H)).erase 0 := by + ext ℓ + simp [nonzeroBinaryDuals] + rw [hfilter, Finset.card_erase_of_mem (Finset.mem_univ 0), + Finset.card_univ, hcardDual] + +private theorem exists_spanning_triple_of_finrank_three + (H : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) + (hH : Module.finrank FABL.𝔽₂ H = 3) : + ∃ a b c : FABL.F₂Cube n, + H = ((FABL.𝔽₂ ∙ a) ⊔ (FABL.𝔽₂ ∙ b)) ⊔ + (FABL.𝔽₂ ∙ c) := by + have hbotlt : (⊥ : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) < H := by + apply bot_lt_iff_ne_bot.mpr + intro hHbot + rw [hHbot, finrank_bot] at hH + omega + obtain ⟨a, haH, haBot⟩ := SetLike.exists_of_lt hbotlt + have ha0 : a ≠ 0 := by + intro ha + subst a + exact haBot (Submodule.zero_mem _) + let S₁ : Submodule FABL.𝔽₂ (FABL.F₂Cube n) := FABL.𝔽₂ ∙ a + have hS₁le : S₁ ≤ H := + Submodule.span_le.2 (Set.singleton_subset_iff.2 haH) + have hS₁rank : Module.finrank FABL.𝔽₂ S₁ = 1 := + finrank_span_singleton ha0 + have hS₁lt : S₁ < H := + Submodule.lt_of_le_of_finrank_lt_finrank hS₁le (by omega) + obtain ⟨b, hbH, hbS₁⟩ := SetLike.exists_of_lt hS₁lt + let S₂ : Submodule FABL.𝔽₂ (FABL.F₂Cube n) := + S₁ ⊔ (FABL.𝔽₂ ∙ b) + have hS₂le : S₂ ≤ H := by + exact sup_le hS₁le + (Submodule.span_le.2 (Set.singleton_subset_iff.2 hbH)) + have hS₂rank : Module.finrank FABL.𝔽₂ S₂ = 2 := by + dsimp only [S₂] + rw [Submodule.finrank_sup_span_singleton hbS₁, hS₁rank] + have hS₂lt : S₂ < H := + Submodule.lt_of_le_of_finrank_lt_finrank hS₂le (by omega) + obtain ⟨c, hcH, hcS₂⟩ := SetLike.exists_of_lt hS₂lt + refine ⟨a, b, c, ?_⟩ + symm + apply Submodule.eq_of_le_of_finrank_eq + · exact sup_le hS₂le + (Submodule.span_le.2 (Set.singleton_subset_iff.2 hcH)) + · rw [Submodule.finrank_sup_span_singleton hcS₂, hS₂rank, hH] + +private structure IntersectingAffineThreeFlatPairWitness + (p : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × + AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) where + u : FABL.F₂Cube n + a₁ : FABL.F₂Cube n + b₁ : FABL.F₂Cube n + c₁ : FABL.F₂Cube n + a₂ : FABL.F₂Cube n + b₂ : FABL.F₂Cube n + c₂ : FABL.F₂Cube n + first_eq : p.1 = FABL.binaryAffineSubspace + (((FABL.𝔽₂ ∙ a₁) ⊔ (FABL.𝔽₂ ∙ b₁)) ⊔ + (FABL.𝔽₂ ∙ c₁)) u + second_eq : p.2 = FABL.binaryAffineSubspace + (((FABL.𝔽₂ ∙ a₂) ⊔ (FABL.𝔽₂ ∙ b₂)) ⊔ + (FABL.𝔽₂ ∙ c₂)) u + +private noncomputable def intersectingAffineThreeFlatPairWitness + (p : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × + AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) + (hp : p ∈ intersectingBinaryAffineThreeFlatPairs n) : + IntersectingAffineThreeFlatPairWitness p := by + classical + have hp' : p ∈ binaryAffineThreeFlatPairs n ∧ p.1 ⊓ p.2 ≠ ⊥ := by + simpa only [intersectingBinaryAffineThreeFlatPairs, + Finset.mem_filter] using hp + have hpdata := affineThreeFlatPairData hp'.1 + have hfirstData := affineThreeFlatData hpdata.1 + have hsecondData := affineThreeFlatData hpdata.2 + let u := Classical.choose + ((AffineSubspace.nonempty_iff_ne_bot (p.1 ⊓ p.2)).2 hp'.2) + have hu := Classical.choose_spec + ((AffineSubspace.nonempty_iff_ne_bot (p.1 ⊓ p.2)).2 hp'.2) + let a₁ := Classical.choose + (exists_spanning_triple_of_finrank_three p.1.direction hfirstData.2) + let b₁ := Classical.choose (Classical.choose_spec + (exists_spanning_triple_of_finrank_three p.1.direction hfirstData.2)) + let c₁ := Classical.choose (Classical.choose_spec (Classical.choose_spec + (exists_spanning_triple_of_finrank_three p.1.direction hfirstData.2))) + have hfirstSpan := Classical.choose_spec (Classical.choose_spec + (Classical.choose_spec + (exists_spanning_triple_of_finrank_three p.1.direction hfirstData.2))) + let a₂ := Classical.choose + (exists_spanning_triple_of_finrank_three p.2.direction hsecondData.2) + let b₂ := Classical.choose (Classical.choose_spec + (exists_spanning_triple_of_finrank_three p.2.direction hsecondData.2)) + let c₂ := Classical.choose (Classical.choose_spec (Classical.choose_spec + (exists_spanning_triple_of_finrank_three p.2.direction hsecondData.2))) + have hsecondSpan := Classical.choose_spec (Classical.choose_spec + (Classical.choose_spec + (exists_spanning_triple_of_finrank_three p.2.direction hsecondData.2))) + refine ⟨u, a₁, b₁, c₁, a₂, b₂, c₂, ?_, ?_⟩ + · calc + p.1 = FABL.binaryAffineSubspace p.1.direction u := + (AffineSubspace.mk'_eq hu.1).symm + _ = FABL.binaryAffineSubspace + (((FABL.𝔽₂ ∙ a₁) ⊔ (FABL.𝔽₂ ∙ b₁)) ⊔ + (FABL.𝔽₂ ∙ c₁)) u := by rw [hfirstSpan] + · calc + p.2 = FABL.binaryAffineSubspace p.2.direction u := + (AffineSubspace.mk'_eq hu.2).symm + _ = FABL.binaryAffineSubspace + (((FABL.𝔽₂ ∙ a₂) ⊔ (FABL.𝔽₂ ∙ b₂)) ⊔ + (FABL.𝔽₂ ∙ c₂)) u := by rw [hsecondSpan] + +private def intersectingAffineThreeFlatPairWitnessCode + {p : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × + AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)} + (w : IntersectingAffineThreeFlatPairWitness p) : + Fin 7 → FABL.F₂Cube n := + ![w.u, w.a₁, w.b₁, w.c₁, w.a₂, w.b₂, w.c₂] + +private noncomputable def intersectingAffineThreeFlatPairCode + (p : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × + AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) : + Fin 7 → FABL.F₂Cube n := by + classical + exact if hp : p ∈ intersectingBinaryAffineThreeFlatPairs n then + intersectingAffineThreeFlatPairWitnessCode + (intersectingAffineThreeFlatPairWitness p hp) + else 0 + +private theorem intersectingAffineThreeFlatPairCode_injective_on : + Set.InjOn (intersectingAffineThreeFlatPairCode (n := n)) + (intersectingBinaryAffineThreeFlatPairs n : + Set (AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × + AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n))) := by + intro p hp q hq hcode + have hpFin : p ∈ intersectingBinaryAffineThreeFlatPairs n := hp + have hqFin : q ∈ intersectingBinaryAffineThreeFlatPairs n := hq + let wp := intersectingAffineThreeFlatPairWitness p hp + let wq := intersectingAffineThreeFlatPairWitness q hq + have hcode' : intersectingAffineThreeFlatPairWitnessCode wp = + intersectingAffineThreeFlatPairWitnessCode wq := by + unfold intersectingAffineThreeFlatPairCode at hcode + rw [dif_pos hpFin, dif_pos hqFin] at hcode + simpa only [wp, wq] using hcode + have h0 : wp.u = wq.u := by + simpa [intersectingAffineThreeFlatPairWitnessCode] using + congrFun hcode' (0 : Fin 7) + have h1 : wp.a₁ = wq.a₁ := by + simpa [intersectingAffineThreeFlatPairWitnessCode] using + congrFun hcode' (1 : Fin 7) + have h2 : wp.b₁ = wq.b₁ := by + simpa [intersectingAffineThreeFlatPairWitnessCode] using + congrFun hcode' (2 : Fin 7) + have h3 : wp.c₁ = wq.c₁ := by + simpa [intersectingAffineThreeFlatPairWitnessCode] using + congrFun hcode' (3 : Fin 7) + have h4 : wp.a₂ = wq.a₂ := by + simpa [intersectingAffineThreeFlatPairWitnessCode] using + congrFun hcode' (4 : Fin 7) + have h5 : wp.b₂ = wq.b₂ := by + simpa [intersectingAffineThreeFlatPairWitnessCode] using + congrFun hcode' (5 : Fin 7) + have h6 : wp.c₂ = wq.c₂ := by + simpa [intersectingAffineThreeFlatPairWitnessCode] using + congrFun hcode' (6 : Fin 7) + apply Prod.ext + · rw [wp.first_eq, wq.first_eq, h0, h1, h2, h3] + · rw [wp.second_eq, wq.second_eq, h0, h4, h5, h6] + +/-- Intersecting ordered pairs of affine three-flats inject into seven +ambient vectors. -/ +theorem card_intersectingBinaryAffineThreeFlatPairs_le (n : ℕ) : + (intersectingBinaryAffineThreeFlatPairs n).card ≤ (2 ^ n) ^ 7 := by + classical + calc + (intersectingBinaryAffineThreeFlatPairs n).card ≤ + (Finset.univ : Finset (Fin 7 → FABL.F₂Cube n)).card := by + apply Finset.card_le_card_of_injOn + (intersectingAffineThreeFlatPairCode (n := n)) + · intro p _hp + exact Finset.mem_univ _ + · exact intersectingAffineThreeFlatPairCode_injective_on + _ = (2 ^ n) ^ 7 := by + rw [Finset.card_univ, Fintype.card_fun, Fintype.card_fin, card_f₂Cube] + +private theorem allAffineThreeFlatPairCharacterSum_eq_sq + (f : BooleanFunction n) : + (∑ p ∈ binaryAffineThreeFlatPairs n, + binaryAffineFlatCharacter f p.1 * + binaryAffineFlatCharacter f p.2) = + (binaryAffineFlatCharacterSum 3 f) ^ 2 := by + classical + rw [binaryAffineThreeFlatPairs, binaryAffineFlatCharacterSum] + calc + (∑ p ∈ (binaryAffineFlats 3 n).product (binaryAffineFlats 3 n), + binaryAffineFlatCharacter f p.1 * + binaryAffineFlatCharacter f p.2) = + ∑ A ∈ binaryAffineFlats 3 n, + ∑ B ∈ binaryAffineFlats 3 n, + binaryAffineFlatCharacter f A * + binaryAffineFlatCharacter f B := by + exact Finset.sum_product _ _ _ + _ = (∑ A ∈ binaryAffineFlats 3 n, + binaryAffineFlatCharacter f A) ^ 2 := by + simp only [pow_two, Finset.mul_sum, mul_comm] + +private theorem affineThreeFlatPairCharacterSum_split + (f : BooleanFunction n) : + (∑ p ∈ binaryAffineThreeFlatPairs n, + binaryAffineFlatCharacter f p.1 * + binaryAffineFlatCharacter f p.2) = + (∑ p ∈ disjointBinaryAffineThreeFlatPairs n, + binaryAffineFlatCharacter f p.1 * + binaryAffineFlatCharacter f p.2) + + ∑ p ∈ intersectingBinaryAffineThreeFlatPairs n, + binaryAffineFlatCharacter f p.1 * + binaryAffineFlatCharacter f p.2 := by + have hsplit := Finset.sum_filter_add_sum_filter_not + (binaryAffineThreeFlatPairs n) (fun p ↦ p.1 ⊓ p.2 = ⊥) + (fun p ↦ binaryAffineFlatCharacter f p.1 * + binaryAffineFlatCharacter f p.2) + change + (∑ p ∈ disjointBinaryAffineThreeFlatPairs n, + binaryAffineFlatCharacter f p.1 * + binaryAffineFlatCharacter f p.2) + + (∑ p ∈ intersectingBinaryAffineThreeFlatPairs n, + binaryAffineFlatCharacter f p.1 * + binaryAffineFlatCharacter f p.2) = + ∑ p ∈ binaryAffineThreeFlatPairs n, + binaryAffineFlatCharacter f p.1 * + binaryAffineFlatCharacter f p.2 at hsplit + exact hsplit.symm + +private theorem binaryAffineFlatCharacter_mul_le_one + (f : BooleanFunction n) + (A B : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) : + binaryAffineFlatCharacter f A * binaryAffineFlatCharacter f B ≤ 1 := by + rcases binaryAffineFlatCharacter_eq_one_or_neg_one f A with hA | hA <;> + rcases binaryAffineFlatCharacter_eq_one_or_neg_one f B with hB | hB <;> + simp only [hA, hB] <;> norm_num + +private theorem intersectingAffineThreeFlatPairCharacterSum_le_card + (f : BooleanFunction n) : + (∑ p ∈ intersectingBinaryAffineThreeFlatPairs n, + binaryAffineFlatCharacter f p.1 * + binaryAffineFlatCharacter f p.2) ≤ + ((intersectingBinaryAffineThreeFlatPairs n).card : ℝ) := by + calc + (∑ p ∈ intersectingBinaryAffineThreeFlatPairs n, + binaryAffineFlatCharacter f p.1 * + binaryAffineFlatCharacter f p.2) ≤ + ∑ _p ∈ intersectingBinaryAffineThreeFlatPairs n, (1 : ℝ) := by + apply Finset.sum_le_sum + intro p _hp + exact binaryAffineFlatCharacter_mul_le_one f p.1 p.2 + _ = ((intersectingBinaryAffineThreeFlatPairs n).card : ℝ) := by simp + +private theorem disjointAffineThreeFlatPairCharacterSum_ge_neg_card + (f : BooleanFunction n) : + (∑ p ∈ disjointBinaryAffineThreeFlatPairs n, + binaryAffineFlatCharacter f p.1 * + binaryAffineFlatCharacter f p.2) ≥ + -((intersectingBinaryAffineThreeFlatPairs n).card : ℝ) := by + have hall : 0 ≤ ∑ p ∈ binaryAffineThreeFlatPairs n, + binaryAffineFlatCharacter f p.1 * + binaryAffineFlatCharacter f p.2 := by + rw [allAffineThreeFlatPairCharacterSum_eq_sq] + positivity + rw [affineThreeFlatPairCharacterSum_split] at hall + have hintersecting := + intersectingAffineThreeFlatPairCharacterSum_le_card f + linarith + +/-- The disjoint-three-flat representation sum has the `O((2^n)^7)` +lower bound required by the seventh/eighth moment argument. -/ +theorem weightSixteenRepresentationCharacterSum_ge + (f : BooleanFunction n) : + weightSixteenRepresentationCharacterSum f ≥ + -((2 ^ n : ℝ) ^ 7) / 2 := by + have hsum := disjointAffineThreeFlatPairCharacterSum_ge_neg_card f + have hcardNat := card_intersectingBinaryAffineThreeFlatPairs_le n + have hcardReal : + ((intersectingBinaryAffineThreeFlatPairs n).card : ℝ) ≤ + (((2 ^ n) ^ 7 : ℕ) : ℝ) := by + exact_mod_cast hcardNat + norm_num only [Nat.cast_pow, Nat.cast_ofNat] at hcardReal + calc + weightSixteenRepresentationCharacterSum f = + (1 / 2 : ℝ) * + ∑ p ∈ disjointBinaryAffineThreeFlatPairs n, + binaryAffineFlatCharacter f p.1 * + binaryAffineFlatCharacter f p.2 := rfl + _ ≥ (1 / 2 : ℝ) * + -((intersectingBinaryAffineThreeFlatPairs n).card : ℝ) := by + exact mul_le_mul_of_nonneg_left hsum (by norm_num) + _ ≥ -((2 ^ n : ℝ) ^ 7) / 2 := by + nlinarith + +/-- The ordered disjoint-flat representations of a Boolean word. -/ +noncomputable def weightSixteenRepresentationFiber + (h : BooleanFunction n) : + Finset (AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × + AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) := + (disjointBinaryAffineThreeFlatPairs n).filter fun p ↦ + weightSixteenRepresentationWord p.1 p.2 = h + +/-- The exact Kasami--Tokura exceptional-multiplicity interface. Type `a` +words have thirty ordered representations, type `b` words have six, and +all remaining weight-sixteen words have two. The zero fibers outside the +dual code also encode the existence classification. -/ +def HasWeightSixteenExceptionalMultiplicity + (typeA typeB : Finset (BooleanFunction n)) : Prop := + typeA ⊆ orderTwoWeightSixteenDualWords n ∧ + typeB ⊆ orderTwoWeightSixteenDualWords n ∧ + Disjoint typeA typeB ∧ + ∀ h : BooleanFunction n, + (weightSixteenRepresentationFiber h).card = + if h ∈ orderTwoWeightSixteenDualWords n then + if h ∈ typeA then 30 else if h ∈ typeB then 6 else 2 + else 0 + +/-- The coarse consequences of the exact exceptional-word counts: type +`a` contributes `O((2^n)^5)` words and type `b` contributes +`O((2^n)^6)`. -/ +def HasWeightSixteenExceptionalCountBounds + (typeA typeB : Finset (BooleanFunction n)) : Prop := + typeA.card ≤ (2 ^ n) ^ 5 ∧ typeB.card ≤ (2 ^ n) ^ 6 + +private theorem sum_ite_mem_subset + {s t : Finset (BooleanFunction n)} + (hst : s ⊆ t) (g : BooleanFunction n → ℝ) : + (∑ h ∈ t, if h ∈ s then g h else 0) = ∑ h ∈ s, g h := by + classical + rw [← Finset.sum_filter] + congr 1 + ext h + simp only [Finset.mem_filter] + constructor + · exact fun hh ↦ hh.2 + · exact fun hh ↦ ⟨hst hh, hh⟩ + +private theorem binarySign_le_one (b : FABL.𝔽₂) : + FABL.binarySign b ≤ 1 := by + by_cases hb : b = 0 + · rw [hb] + norm_num + · have hbOne : b = 1 := Fin.eq_one_of_ne_zero _ hb + rw [hbOne, FABL.binarySign_one] + norm_num + +private theorem booleanWordCharacterSum_le_card + (f : BooleanFunction n) (s : Finset (BooleanFunction n)) : + (∑ h ∈ s, FABL.binarySign (booleanFunctionPairing n f h)) ≤ + (s.card : ℝ) := by + calc + (∑ h ∈ s, FABL.binarySign (booleanFunctionPairing n f h)) ≤ + ∑ _h ∈ s, (1 : ℝ) := by + apply Finset.sum_le_sum + intro h _hh + exact binarySign_le_one (booleanFunctionPairing n f h) + _ = (s.card : ℝ) := by simp + +private theorem sum_disjointWeightSixteenRepresentations_eq + (f : BooleanFunction n) + (typeA typeB : Finset (BooleanFunction n)) + (hmultiplicity : HasWeightSixteenExceptionalMultiplicity typeA typeB) : + (∑ p ∈ disjointBinaryAffineThreeFlatPairs n, + binaryAffineFlatCharacter f p.1 * + binaryAffineFlatCharacter f p.2) = + 2 * orderTwoWeightSixteenCharacterSum f + + 28 * ∑ h ∈ typeA, + FABL.binarySign (booleanFunctionPairing n f h) + + 4 * ∑ h ∈ typeB, + FABL.binarySign (booleanFunctionPairing n f h) := by + classical + have htypeA := hmultiplicity.1 + have htypeB := hmultiplicity.2.1 + have hdisjoint := hmultiplicity.2.2.1 + have htypeASum := sum_ite_mem_subset htypeA + (fun h ↦ 28 * FABL.binarySign (booleanFunctionPairing n f h)) + have htypeBSum := sum_ite_mem_subset htypeB + (fun h ↦ 4 * FABL.binarySign (booleanFunctionPairing n f h)) + calc + (∑ p ∈ disjointBinaryAffineThreeFlatPairs n, + binaryAffineFlatCharacter f p.1 * + binaryAffineFlatCharacter f p.2) = + ∑ p ∈ disjointBinaryAffineThreeFlatPairs n, + FABL.binarySign (booleanFunctionPairing n f + (weightSixteenRepresentationWord p.1 p.2)) := by + apply Finset.sum_congr rfl + intro p _hp + rw [weightSixteenRepresentationWord_character] + _ = ∑ h ∈ orderTwoWeightSixteenDualWords n, + ∑ p ∈ weightSixteenRepresentationFiber h, + FABL.binarySign (booleanFunctionPairing n f + (weightSixteenRepresentationWord p.1 p.2)) := by + symm + unfold weightSixteenRepresentationFiber + apply Finset.sum_fiberwise_of_maps_to + intro p hp + exact weightSixteenRepresentationWord_mem_dualWords p.1 p.2 hp + _ = ∑ h ∈ orderTwoWeightSixteenDualWords n, + ((weightSixteenRepresentationFiber h).card : ℝ) * + FABL.binarySign (booleanFunctionPairing n f h) := by + apply Finset.sum_congr rfl + intro h _hh + calc + (∑ p ∈ weightSixteenRepresentationFiber h, + FABL.binarySign (booleanFunctionPairing n f + (weightSixteenRepresentationWord p.1 p.2))) = + ∑ _p ∈ weightSixteenRepresentationFiber h, + FABL.binarySign (booleanFunctionPairing n f h) := by + apply Finset.sum_congr rfl + intro p hp + rw [(Finset.mem_filter.mp hp).2] + _ = ((weightSixteenRepresentationFiber h).card : ℝ) * + FABL.binarySign (booleanFunctionPairing n f h) := by simp + _ = ∑ h ∈ orderTwoWeightSixteenDualWords n, + (2 * FABL.binarySign (booleanFunctionPairing n f h) + + (if h ∈ typeA then + 28 * FABL.binarySign (booleanFunctionPairing n f h) else 0) + + if h ∈ typeB then + 4 * FABL.binarySign (booleanFunctionPairing n f h) else 0) := by + apply Finset.sum_congr rfl + intro h hh + rw [hmultiplicity.2.2.2 h, if_pos hh] + by_cases hA : h ∈ typeA + · have hB : h ∉ typeB := by + intro hB + exact (Finset.disjoint_left.mp hdisjoint) hA hB + simp [hA, hB] + ring + · by_cases hB : h ∈ typeB + · simp [hA, hB] + ring + · simp [hA, hB] + _ = 2 * orderTwoWeightSixteenCharacterSum f + + 28 * ∑ h ∈ typeA, + FABL.binarySign (booleanFunctionPairing n f h) + + 4 * ∑ h ∈ typeB, + FABL.binarySign (booleanFunctionPairing n f h) := by + rw [Finset.sum_add_distrib, Finset.sum_add_distrib, + htypeASum, htypeBSum] + rw [← Finset.mul_sum, ← Finset.mul_sum, ← Finset.mul_sum] + rfl + +/-- Conditional on the cited exceptional-multiplicity classification, the +canonical weight-sixteen sum is the representation sum with the two +exceptional overcount corrections. -/ +theorem orderTwoWeightSixteenCharacterSum_eq_representation_sub_exceptions + (f : BooleanFunction n) + (typeA typeB : Finset (BooleanFunction n)) + (hmultiplicity : HasWeightSixteenExceptionalMultiplicity typeA typeB) : + orderTwoWeightSixteenCharacterSum f = + weightSixteenRepresentationCharacterSum f - + 14 * ∑ h ∈ typeA, + FABL.binarySign (booleanFunctionPairing n f h) - + 2 * ∑ h ∈ typeB, + FABL.binarySign (booleanFunctionPairing n f h) := by + rw [weightSixteenRepresentationCharacterSum, + sum_disjointWeightSixteenRepresentations_eq + f typeA typeB hmultiplicity] + ring + +/-- A conditional canonical lower bound retaining the sharper orders of +the two exceptional families. -/ +theorem orderTwoWeightSixteenCharacterSum_ge + (f : BooleanFunction n) + (typeA typeB : Finset (BooleanFunction n)) + (hmultiplicity : HasWeightSixteenExceptionalMultiplicity typeA typeB) + (hcounts : HasWeightSixteenExceptionalCountBounds typeA typeB) : + orderTwoWeightSixteenCharacterSum f ≥ + -((2 ^ n : ℝ) ^ 7) / 2 - 14 * (2 ^ n : ℝ) ^ 5 - + 2 * (2 ^ n : ℝ) ^ 6 := by + have hrepresentation := weightSixteenRepresentationCharacterSum_ge f + have htypeASum := booleanWordCharacterSum_le_card f typeA + have htypeBSum := booleanWordCharacterSum_le_card f typeB + have htypeACard : (typeA.card : ℝ) ≤ (2 ^ n : ℝ) ^ 5 := by + exact_mod_cast hcounts.1 + have htypeBCard : (typeB.card : ℝ) ≤ (2 ^ n : ℝ) ^ 6 := by + exact_mod_cast hcounts.2 + rw [orderTwoWeightSixteenCharacterSum_eq_representation_sub_exceptions + f typeA typeB hmultiplicity] + linarith + +end CryptBoolean diff --git a/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenAffineMaps.lean b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenAffineMaps.lean new file mode 100644 index 0000000..2c12df2 --- /dev/null +++ b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenAffineMaps.lean @@ -0,0 +1,240 @@ +/- +Copyright (c) 2026 Asher Yan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Asher Yan with Codex +-/ +module + +public import CryptBoolean.Carlet.Chapter03.ReedMullerLowWeightAffineSpan +public import Mathlib.Data.Fin.Tuple.Basic + +/-! +# Rank-deficient seven-variable affine-map data + +The rank-seven reduction for weight-sixteen words leaves affine maps from a +fixed seven-variable support pattern into the ambient Boolean cube. This file +gives a dimension-free encoding of the rank-deficient maps. A dependent +seven-tuple has a nonzero binary relation; choosing one nonzero coefficient +allows the corresponding direction to be recovered from the other six. +-/ + +open Finset +open scoped BigOperators BooleanCube + +@[expose] public section + +namespace CryptBoolean + +variable {n : ℕ} + +/-- A nonzero binary relation among seven directions. -/ +abbrev NonzeroSevenCoefficient := + {g : Fin 7 → FABL.𝔽₂ // g ≠ 0} + +/-- A nonzero relation has a coordinate with nonzero coefficient. -/ +theorem exists_nonzeroSevenCoefficient + (g : NonzeroSevenCoefficient) : ∃ i, g.1 i ≠ 0 := by + by_contra h + push Not at h + apply g.2 + funext i + exact h i + +/-- A canonical coordinate with nonzero coefficient in a nonzero relation. -/ +noncomputable def nonzeroSevenCoefficientPivot + (g : NonzeroSevenCoefficient) : Fin 7 := + Classical.choose (exists_nonzeroSevenCoefficient g) + +theorem nonzeroSevenCoefficientPivot_ne_zero + (g : NonzeroSevenCoefficient) : + g.1 (nonzeroSevenCoefficientPivot g) ≠ 0 := by + classical + unfold nonzeroSevenCoefficientPivot + exact Classical.choose_spec (exists_nonzeroSevenCoefficient g) + +theorem nonzeroSevenCoefficientPivot_eq_one + (g : NonzeroSevenCoefficient) : + g.1 (nonzeroSevenCoefficientPivot g) = 1 := + Fin.eq_one_of_ne_zero _ (nonzeroSevenCoefficientPivot_ne_zero g) + +/-- Data that reconstructs a dependent seven-tuple: a nonzero relation and +the six directions away from its canonical pivot. -/ +abbrev SevenDirectionDependenceData (n : ℕ) := + NonzeroSevenCoefficient × (Fin 6 → FABL.F₂Cube n) + +/-- Reconstruct the omitted direction as the binary linear combination of +the other six directions. -/ +noncomputable def dependentSevenDirectionTupleOfData + (d : SevenDirectionDependenceData n) : + Fin 7 → FABL.F₂Cube n := + let i := nonzeroSevenCoefficientPivot d.1 + Fin.insertNth i + (∑ k : Fin 6, d.1.1 (i.succAbove k) • d.2 k) + d.2 + +theorem not_linearIndependent_dependentSevenDirectionTupleOfData + (d : SevenDirectionDependenceData n) : + ¬LinearIndependent FABL.𝔽₂ + (dependentSevenDirectionTupleOfData d) := by + rw [Fintype.not_linearIndependent_iff] + let i := nonzeroSevenCoefficientPivot d.1 + refine ⟨d.1.1, ?_, i, nonzeroSevenCoefficientPivot_ne_zero d.1⟩ + · rw [Fin.sum_univ_succAbove _ i, + nonzeroSevenCoefficientPivot_eq_one d.1] + simp only [i, Fin.insertNth_apply_same, + Fin.insertNth_apply_succAbove, + dependentSevenDirectionTupleOfData, one_smul] + exact ZModModule.add_self _ + +/-- Every dependent seven-tuple is reconstructed by some dependence data. -/ +theorem dependentSevenDirectionTupleOfData_surjective : + Function.Surjective + (fun d : SevenDirectionDependenceData n ↦ + (⟨dependentSevenDirectionTupleOfData d, + not_linearIndependent_dependentSevenDirectionTupleOfData d⟩ : + {v : Fin 7 → FABL.F₂Cube n // + ¬LinearIndependent FABL.𝔽₂ v})) := by + rintro ⟨v, hv⟩ + rw [Fintype.not_linearIndependent_iff] at hv + obtain ⟨g, hg, j, hj⟩ := hv + have hgNe : g ≠ 0 := by + intro hzero + rw [hzero, Pi.zero_apply] at hj + exact hj rfl + let c : NonzeroSevenCoefficient := ⟨g, hgNe⟩ + let i := nonzeroSevenCoefficientPivot c + have hiOne : g i = 1 := by + change c.1 i = 1 + exact nonzeroSevenCoefficientPivot_eq_one c + rw [Fin.sum_univ_succAbove _ i, hiOne, one_smul] at hg + have hpivot : + (∑ k : Fin 6, g (i.succAbove k) • v (i.succAbove k)) = v i := by + have hvi : v i = + -(∑ k : Fin 6, g (i.succAbove k) • v (i.succAbove k)) := + add_eq_zero_iff_eq_neg.mp hg + simpa only [ZModModule.neg_eq_self] using hvi.symm + let d : SevenDirectionDependenceData n := + ⟨c, fun k ↦ v (i.succAbove k)⟩ + refine ⟨d, Subtype.ext ?_⟩ + funext j + obtain rfl | ⟨k, rfl⟩ := Fin.eq_self_or_eq_succAbove i j + · simpa only [d, i, c, dependentSevenDirectionTupleOfData, + Fin.insertNth_apply_same] using hpivot + · simp [d, i, dependentSevenDirectionTupleOfData] + +/-- The finite family of dependent seven-tuples of ambient directions. -/ +noncomputable def dependentSevenDirectionTuples (n : ℕ) : + Finset (Fin 7 → FABL.F₂Cube n) := by + classical + exact Finset.univ.image dependentSevenDirectionTupleOfData + +theorem mem_dependentSevenDirectionTuples_iff + (v : Fin 7 → FABL.F₂Cube n) : + v ∈ dependentSevenDirectionTuples n ↔ + ¬LinearIndependent FABL.𝔽₂ v := by + classical + constructor + · rw [dependentSevenDirectionTuples, Finset.mem_image] + rintro ⟨d, _hd, rfl⟩ + exact not_linearIndependent_dependentSevenDirectionTupleOfData d + · intro hv + obtain ⟨d, hd⟩ := + dependentSevenDirectionTupleOfData_surjective + (n := n) ⟨v, hv⟩ + rw [dependentSevenDirectionTuples, Finset.mem_image] + refine ⟨d, Finset.mem_univ d, ?_⟩ + exact congrArg Subtype.val hd + +/-- There are at most `127 q^6` dependent seven-tuples in an ambient binary +space of cardinality `q`. -/ +theorem card_dependentSevenDirectionTuples_le (n : ℕ) : + (dependentSevenDirectionTuples n).card ≤ + 127 * (2 ^ n) ^ 6 := by + classical + calc + (dependentSevenDirectionTuples n).card ≤ + (Finset.univ : Finset (SevenDirectionDependenceData n)).card := by + rw [dependentSevenDirectionTuples] + exact Finset.card_image_le + _ = Fintype.card (SevenDirectionDependenceData n) := + Finset.card_univ + _ = 127 * (2 ^ n) ^ 6 := by + simp [SevenDirectionDependenceData, NonzeroSevenCoefficient, + Fintype.card_prod, ZMod.card] + +/-- Translation together with seven direction vectors parameterizes an +affine map out of the seven-variable Boolean cube. -/ +abbrev SevenVariableAffineMapData (n : ℕ) := + FABL.F₂Cube n × (Fin 7 → FABL.F₂Cube n) + +/-- The affine point map encoded by a translation and seven directions. -/ +def sevenVariableAffinePoint + (d : SevenVariableAffineMapData n) (x : FABL.F₂Cube 7) : + FABL.F₂Cube n := + d.1 + ∑ i : Fin 7, x i • d.2 i + +/-- Seven-variable affine-map data are injective exactly when their seven +directions are linearly independent. -/ +theorem sevenVariableAffinePoint_injective_iff + (d : SevenVariableAffineMapData n) : + Function.Injective (sevenVariableAffinePoint d) ↔ + LinearIndependent FABL.𝔽₂ d.2 := by + constructor + · intro hinjective + rw [Fintype.linearIndependent_iff] + intro g hg i + have hpoint : sevenVariableAffinePoint d g = + sevenVariableAffinePoint d 0 := by + simp only [sevenVariableAffinePoint, hg, Pi.zero_apply, zero_smul, + Finset.sum_const_zero, add_zero] + exact congrFun (hinjective hpoint) i + · intro hindependent x y hxy + have hsum : (∑ i : Fin 7, x i • d.2 i) = + ∑ i : Fin 7, y i • d.2 i := by + exact add_left_cancel hxy + have hzero : ∑ i : Fin 7, (x i + y i) • d.2 i = 0 := by + calc + (∑ i : Fin 7, (x i + y i) • d.2 i) = + (∑ i : Fin 7, x i • d.2 i) + + ∑ i : Fin 7, y i • d.2 i := by + simp only [add_smul, Finset.sum_add_distrib] + _ = 0 := by rw [hsum, ZModModule.add_self] + have hcoeff := + Fintype.linearIndependent_iff.mp hindependent + (fun i ↦ x i + y i) hzero + funext i + have hi := hcoeff i + exact (add_eq_zero_iff_eq_neg.mp hi).trans + (ZMod.neg_eq_self_mod_two (y i)) + +/-- The affine-map data whose seven direction vectors are dependent. -/ +noncomputable def rankDeficientSevenVariableAffineMapData (n : ℕ) : + Finset (SevenVariableAffineMapData n) := + Finset.univ.product (dependentSevenDirectionTuples n) + +theorem mem_rankDeficientSevenVariableAffineMapData_iff + (d : SevenVariableAffineMapData n) : + d ∈ rankDeficientSevenVariableAffineMapData n ↔ + ¬Function.Injective (sevenVariableAffinePoint d) := by + simp [rankDeficientSevenVariableAffineMapData, + mem_dependentSevenDirectionTuples_iff, + sevenVariableAffinePoint_injective_iff] + +/-- Rank-deficient seven-variable affine-map data have cardinality at most +`127 q^7` in an ambient binary space of cardinality `q`. -/ +theorem card_rankDeficientSevenVariableAffineMapData_le (n : ℕ) : + (rankDeficientSevenVariableAffineMapData n).card ≤ + 127 * (2 ^ n) ^ 7 := by + change + ((Finset.univ : Finset (FABL.F₂Cube n)) ×ˢ + dependentSevenDirectionTuples n).card ≤ + 127 * (2 ^ n) ^ 7 + rw [Finset.card_product, Finset.card_univ, FABL.card_f₂Cube] + have hbound := card_dependentSevenDirectionTuples_le n + calc + 2 ^ n * (dependentSevenDirectionTuples n).card ≤ + 2 ^ n * (127 * (2 ^ n) ^ 6) := + Nat.mul_le_mul_left _ hbound + _ = 127 * (2 ^ n) ^ 7 := by ring + +end CryptBoolean diff --git a/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenCandidateSoundness.lean b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenCandidateSoundness.lean new file mode 100644 index 0000000..7e9ca4a --- /dev/null +++ b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenCandidateSoundness.lean @@ -0,0 +1,440 @@ +/- +Copyright (c) 2026 Asher Yan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Asher Yan with Codex +-/ +module + +public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightSixteenSystematicEncoding + +/-! +# Semantic soundness of generated normalized candidates + +A generated leaf is sound when its decoded affine map sends the declared +canonical pattern onto the support reconstructed from its systematic code. +The tree predicate packages a proof for every leaf and transports it along +propositional tree membership. +-/ + +@[expose] public section + +namespace CryptBoolean + +/-- Semantic soundness of one generated normalized candidate. -/ +def NormalizedWeightSixteenCandidate.IsSound + (candidate : NormalizedWeightSixteenCandidate) : Prop := + rankSevenWeightSixteenPatternImage candidate.patternClass + (normalizedCandidateAffineMapData candidate) = + systematicWeightSixteenSupportOfCode candidate.systematicCode + +/-- The little-endian numerical index of a seven-variable point. -/ +def normalizedSevenPointIndex (x : FABL.F₂Cube 7) : ℕ := + Nat.ofBits fun i ↦ decide (x i = 1) + +/-- An explicit enumeration of the sixteen indices in each canonical pattern. -/ +def rankSevenWeightSixteenPatternPointIndex : + RankSevenWeightSixteenPatternClass → Fin 16 → ℕ + | .twoE8 => + ![0, 1, 2, 3, 4, 5, 6, 7, + 64, 72, 80, 88, 96, 104, 112, 120] + | .d16Plus => + ![0, 1, 2, 4, 8, 16, 32, 64, + 127, 126, 125, 123, 119, 111, 95, 63] + | .f16 => + ![0, 1, 2, 4, 8, 16, 32, 64, + 126, 87, 55, 17, 31, 5, 3, 105] + +/-- The `i`th point of a canonical sixteen-point pattern. -/ +def rankSevenWeightSixteenPatternPoint + (c : RankSevenWeightSixteenPatternClass) (i : Fin 16) : + FABL.F₂Cube 7 := + f₂CubeOfNat 7 (rankSevenWeightSixteenPatternPointIndex c i) + +/-- The explicit sixteen-point enumeration has exactly the canonical range. -/ +theorem image_rankSevenWeightSixteenPatternPoint + (c : RankSevenWeightSixteenPatternClass) : + Finset.univ.image (rankSevenWeightSixteenPatternPoint c) = + rankSevenWeightSixteenPattern c := by + cases c <;> decide + +/-- The normalized origin and seven coordinate points as an eight-point family. -/ +def systematicWeightSixteenFixedPoint : Fin 8 → FABL.F₂Cube 7 := + Fin.cases 0 fun i ↦ Pi.single i (1 : FABL.𝔽₂) + +/-- The explicit eight-point family enumerates the fixed systematic support. -/ +theorem image_systematicWeightSixteenFixedPoint : + Finset.univ.image systematicWeightSixteenFixedPoint = + systematicWeightSixteenFixedPoints := by + decide + +/-- Whether the generated low/high masks contain a seven-variable point. -/ +def NormalizedWeightSixteenCandidate.maskContains + (candidate : NormalizedWeightSixteenCandidate) + (x : FABL.F₂Cube 7) : Bool := + let index := normalizedSevenPointIndex x + if index < 64 then candidate.maskLow.getLsbD index + else candidate.maskHigh.getLsbD (index - 64) + +/-- The set-bit indices of a sixty-four-bit mask. -/ +def bitVecSixtyFourSupport (mask : BitVec 64) : Finset (Fin 64) := + Finset.univ.filter fun i ↦ mask.getLsbD i = true + +/-- The low-half cube point represented by one mask index. -/ +def normalizedLowMaskPoint (i : Fin 64) : FABL.F₂Cube 7 := + f₂CubeOfNat 7 i + +/-- The high-half cube point represented by one mask index. -/ +def normalizedHighMaskPoint (i : Fin 64) : FABL.F₂Cube 7 := + f₂CubeOfNat 7 (64 + i) + +/-- The point set represented by the generated low/high masks, split into two +disjoint sixty-four-point halves. -/ +def NormalizedWeightSixteenCandidate.maskSupport + (candidate : NormalizedWeightSixteenCandidate) : + Finset (FABL.F₂Cube 7) := + (bitVecSixtyFourSupport candidate.maskLow).image normalizedLowMaskPoint ∪ + (bitVecSixtyFourSupport candidate.maskHigh).image normalizedHighMaskPoint + +private theorem bitVec_cpopNatRec_eq_sum_range + {w : ℕ} (mask : BitVec w) (n : ℕ) : + mask.cpopNatRec n 0 = + ∑ i ∈ Finset.range n, (mask.getLsbD i).toNat := by + induction n with + | zero => simp + | succ n ih => + rw [BitVec.cpopNatRec_succ, BitVec.cpopNatRec_eq, + ih, Finset.sum_range_succ] + simp + +/-- The cardinality of a bitvector's set-bit support is its population count. -/ +theorem card_bitVecSixtyFourSupport (mask : BitVec 64) : + (bitVecSixtyFourSupport mask).card = mask.cpop.toNat := by + calc + (bitVecSixtyFourSupport mask).card = + ∑ i : Fin 64, if mask.getLsbD i = true then 1 else 0 := by + symm + simpa [bitVecSixtyFourSupport] using + (Finset.sum_boole (R := ℕ) + (fun i : Fin 64 ↦ mask.getLsbD i = true) Finset.univ) + _ = ∑ i ∈ Finset.range 64, (mask.getLsbD i).toNat := by + rw [Finset.sum_fin_eq_sum_range] + apply Finset.sum_congr rfl + intro i hi + have hi64 : i < 64 := Finset.mem_range.mp hi + simp only [hi64, dite_true] + cases mask.getLsbD i <;> simp + _ = mask.cpopNatRec 64 0 := + (bitVec_cpopNatRec_eq_sum_range mask 64).symm + _ = mask.cpop.toNat := (BitVec.toNat_cpop mask).symm + +theorem normalizedLowMaskPoint_injective : + Function.Injective normalizedLowMaskPoint := by + decide + +theorem normalizedHighMaskPoint_injective : + Function.Injective normalizedHighMaskPoint := by + decide + +theorem normalizedLowMaskPoint_ne_highMaskPoint + (i j : Fin 64) : + normalizedLowMaskPoint i ≠ normalizedHighMaskPoint j := by + revert i j + decide + +/-- The cardinality of the represented mask support is the sum of the two +population counts. -/ +theorem NormalizedWeightSixteenCandidate.card_maskSupport + (candidate : NormalizedWeightSixteenCandidate) : + candidate.maskSupport.card = + candidate.maskLow.cpop.toNat + candidate.maskHigh.cpop.toNat := by + rw [NormalizedWeightSixteenCandidate.maskSupport, + Finset.card_union_of_disjoint] + · rw [Finset.card_image_of_injective _ normalizedLowMaskPoint_injective, + Finset.card_image_of_injective _ normalizedHighMaskPoint_injective, + card_bitVecSixtyFourSupport, card_bitVecSixtyFourSupport] + · rw [Finset.disjoint_left] + intro x hxLow hxHigh + obtain ⟨i, _hi, rfl⟩ := Finset.mem_image.mp hxLow + obtain ⟨j, _hj, heq⟩ := Finset.mem_image.mp hxHigh + exact normalizedLowMaskPoint_ne_highMaskPoint i j heq.symm + +theorem normalizedSevenPointIndex_lt (x : FABL.F₂Cube 7) : + normalizedSevenPointIndex x < 128 := by + revert x + set_option maxRecDepth 100000 in decide + +theorem f₂CubeOfNat_normalizedSevenPointIndex (x : FABL.F₂Cube 7) : + f₂CubeOfNat 7 (normalizedSevenPointIndex x) = x := by + revert x + set_option maxRecDepth 100000 in decide + +/-- A positive mask bit puts its corresponding point into the represented +support. -/ +theorem NormalizedWeightSixteenCandidate.mem_maskSupport_of_maskContains + {candidate : NormalizedWeightSixteenCandidate} + {x : FABL.F₂Cube 7} + (hcontains : candidate.maskContains x = true) : + x ∈ candidate.maskSupport := by + let index := normalizedSevenPointIndex x + have hbound : index < 128 := normalizedSevenPointIndex_lt x + change (if index < 64 then candidate.maskLow.getLsbD index + else candidate.maskHigh.getLsbD (index - 64)) = true at hcontains + by_cases hlow : index < 64 + · rw [if_pos hlow] at hcontains + rw [NormalizedWeightSixteenCandidate.maskSupport, Finset.mem_union] + left + refine Finset.mem_image.mpr ⟨⟨index, hlow⟩, ?_, ?_⟩ + · simp [bitVecSixtyFourSupport, hcontains] + · change f₂CubeOfNat 7 index = x + exact f₂CubeOfNat_normalizedSevenPointIndex x + · rw [if_neg hlow] at hcontains + have hhigh : index - 64 < 64 := by omega + rw [NormalizedWeightSixteenCandidate.maskSupport, Finset.mem_union] + right + refine Finset.mem_image.mpr ⟨⟨index - 64, hhigh⟩, ?_, ?_⟩ + · simp [bitVecSixtyFourSupport, hcontains] + · change f₂CubeOfNat 7 (64 + (index - 64)) = x + rw [Nat.add_sub_of_le (by omega : 64 ≤ index)] + exact f₂CubeOfNat_normalizedSevenPointIndex x + +/-- The generated pair of masks has Hamming weight sixteen. -/ +def NormalizedWeightSixteenCandidate.HasMaskWeightSixteen + (candidate : NormalizedWeightSixteenCandidate) : Prop := + candidate.maskLow.cpop + candidate.maskHigh.cpop = 16#64 + +/-- The pure bitvector weight certificate gives the represented support's +cardinality without evaluating a 128-point filter at every generated leaf. -/ +theorem NormalizedWeightSixteenCandidate.HasMaskWeightSixteen.maskSupport_card + {candidate : NormalizedWeightSixteenCandidate} + (hweight : candidate.HasMaskWeightSixteen) : + candidate.maskSupport.card = 16 := by + rw [candidate.card_maskSupport] + have hlow := BitVec.toNat_cpop_le candidate.maskLow + have hhigh := BitVec.toNat_cpop_le candidate.maskHigh + have hsumlt : + candidate.maskLow.cpop.toNat + candidate.maskHigh.cpop.toNat < + 2 ^ 64 := by + norm_num at ⊢ + omega + change candidate.maskLow.cpop + candidate.maskHigh.cpop = 16#64 at hweight + have htoNat := congrArg BitVec.toNat hweight + change (candidate.maskLow.cpop.toNat + + candidate.maskHigh.cpop.toNat) % 2 ^ 64 = 16 at htoNat + rw [Nat.mod_eq_of_lt hsumlt] at htoNat + exact htoNat + +/-- A compact certificate checks only fixed finite point families: the mask +weight, sixteen distinct mapped pattern points, and the two eight-point +systematic families. -/ +def NormalizedWeightSixteenCandidate.IsCompactMaskSound + (candidate : NormalizedWeightSixteenCandidate) : Prop := + candidate.HasMaskWeightSixteen ∧ + Function.Injective (fun i : Fin 16 ↦ + sevenVariableAffinePoint (normalizedCandidateAffineMapData candidate) + (rankSevenWeightSixteenPatternPoint candidate.patternClass i)) ∧ + (∀ i : Fin 16, + candidate.maskContains + (sevenVariableAffinePoint (normalizedCandidateAffineMapData candidate) + (rankSevenWeightSixteenPatternPoint candidate.patternClass i)) = true) ∧ + (∀ i : Fin 8, + candidate.maskContains (systematicWeightSixteenFixedPoint i) = true) ∧ + (∀ i : Fin 8, + candidate.maskContains + (systematicWeightSixteenColumnPoint + (systematicWeightSixteenColumn candidate.systematicCode i)) = true) + +instance NormalizedWeightSixteenCandidate.instDecidableIsCompactMaskSound + (candidate : NormalizedWeightSixteenCandidate) : + Decidable candidate.IsCompactMaskSound := by + unfold NormalizedWeightSixteenCandidate.IsCompactMaskSound + NormalizedWeightSixteenCandidate.HasMaskWeightSixteen + infer_instance + +/-- A compact certificate gives sixteen distinct points in the canonical +pattern image. -/ +theorem NormalizedWeightSixteenCandidate.IsCompactMaskSound.patternImage_card + {candidate : NormalizedWeightSixteenCandidate} + (hsound : candidate.IsCompactMaskSound) : + (rankSevenWeightSixteenPatternImage candidate.patternClass + (normalizedCandidateAffineMapData candidate)).card = 16 := by + rw [rankSevenWeightSixteenPatternImage, + ← image_rankSevenWeightSixteenPatternPoint, Finset.image_image] + have hinjective : Function.Injective + (sevenVariableAffinePoint (normalizedCandidateAffineMapData candidate) ∘ + rankSevenWeightSixteenPatternPoint candidate.patternClass) := by + intro i j hij + exact hsound.2.1 hij + simpa only [Finset.card_univ, Fintype.card_fin] using + Finset.card_image_of_injective + (Finset.univ : Finset (Fin 16)) hinjective + +/-- Every canonical image point selected by a compact certificate belongs to +the generated mask. -/ +theorem NormalizedWeightSixteenCandidate.IsCompactMaskSound.patternImage_subset + {candidate : NormalizedWeightSixteenCandidate} + (hsound : candidate.IsCompactMaskSound) : + rankSevenWeightSixteenPatternImage candidate.patternClass + (normalizedCandidateAffineMapData candidate) ⊆ + candidate.maskSupport := by + rw [rankSevenWeightSixteenPatternImage, + ← image_rankSevenWeightSixteenPatternPoint] + intro x hx + obtain ⟨y, hy, rfl⟩ := Finset.mem_image.mp hx + obtain ⟨i, _hi, rfl⟩ := Finset.mem_image.mp hy + exact NormalizedWeightSixteenCandidate.mem_maskSupport_of_maskContains + (hsound.2.2.1 i) + +/-- Every fixed or decoded systematic point selected by a compact certificate +belongs to the generated mask. -/ +theorem NormalizedWeightSixteenCandidate.IsCompactMaskSound.systematicSupport_subset + {candidate : NormalizedWeightSixteenCandidate} + (hsound : candidate.IsCompactMaskSound) : + systematicWeightSixteenSupportOfCode candidate.systematicCode ⊆ + candidate.maskSupport := by + intro x hx + rw [systematicWeightSixteenSupportOfCode, Finset.mem_union] at hx + obtain hx | hx := hx + · rw [← image_systematicWeightSixteenFixedPoint] at hx + obtain ⟨i, _hi, rfl⟩ := Finset.mem_image.mp hx + exact NormalizedWeightSixteenCandidate.mem_maskSupport_of_maskContains + (hsound.2.2.2.1 i) + · obtain ⟨i, _hi, rfl⟩ := Finset.mem_image.mp hx + exact NormalizedWeightSixteenCandidate.mem_maskSupport_of_maskContains + (hsound.2.2.2.2 i) + +/-- An affine image containing the normalized origin and seven coordinate +points has an invertible seven-dimensional linear part. -/ +theorem linearIndependent_of_systematicFixedPoints_subset_patternImage + (c : RankSevenWeightSixteenPatternClass) + (d : SevenVariableAffineMapData 7) + (hfixed : systematicWeightSixteenFixedPoints ⊆ + rankSevenWeightSixteenPatternImage c d) : + LinearIndependent FABL.𝔽₂ d.2 := by + classical + have hzero : (0 : FABL.F₂Cube 7) ∈ + rankSevenWeightSixteenPatternImage c d := by + apply hfixed + simp [systematicWeightSixteenFixedPoints] + obtain ⟨x0, _hx0Pattern, hx0⟩ := Finset.mem_image.mp hzero + have hsingle (i : Fin 7) : Pi.single i (1 : FABL.𝔽₂) ∈ + rankSevenWeightSixteenPatternImage c d := by + apply hfixed + simp [systematicWeightSixteenFixedPoints] + choose x hxPattern hx using fun i ↦ Finset.mem_image.mp (hsingle i) + let L : FABL.F₂Cube 7 →ₗ[FABL.𝔽₂] FABL.F₂Cube 7 := + Fintype.linearCombination FABL.𝔽₂ d.2 + change d.1 + L x0 = 0 at hx0 + have hLbasis (i : Fin 7) : + L (x i + x0) = Pi.single i (1 : FABL.𝔽₂) := by + have hxi := hx i + change d.1 + L (x i) = Pi.single i (1 : FABL.𝔽₂) at hxi + rw [map_add] + calc + L (x i) + L x0 = + (d.1 + d.1) + (L (x i) + L x0) := by + rw [ZModModule.add_self, zero_add] + _ = (d.1 + L (x i)) + (d.1 + L x0) := by abel + _ = Pi.single i (1 : FABL.𝔽₂) := by rw [hxi, hx0, add_zero] + have hsurjective : Function.Surjective L := by + intro y + refine ⟨∑ i : Fin 7, y i • (x i + x0), ?_⟩ + rw [map_sum] + simp_rw [map_smul, hLbasis] + ext j + simp only [Finset.sum_apply, Pi.smul_apply, smul_eq_mul] + rw [Finset.sum_eq_single j] + · simp + · intro i _hi hij + simp [Pi.single_eq_of_ne hij.symm] + · simp + rw [linearIndependent_iff_injective_fintypeLinearCombination] + exact LinearMap.injective_iff_surjective.mpr hsurjective + +/-- A valid compact mask certificate implies semantic candidate soundness once +the two generic mask cardinality bridges are supplied. -/ +theorem NormalizedWeightSixteenCandidate.IsCompactMaskSound.isSound + {candidate : NormalizedWeightSixteenCandidate} + (hsound : candidate.IsCompactMaskSound) + (hsystematicCard : + (systematicWeightSixteenSupportOfCode + candidate.systematicCode).card = 16) : + candidate.IsSound := by + have hmaskCard := hsound.1.maskSupport_card + have himageEq : + rankSevenWeightSixteenPatternImage candidate.patternClass + (normalizedCandidateAffineMapData candidate) = + candidate.maskSupport := by + apply Finset.eq_of_subset_of_card_le hsound.patternImage_subset + rw [hmaskCard, hsound.patternImage_card] + have hsystematicEq : + systematicWeightSixteenSupportOfCode candidate.systematicCode = + candidate.maskSupport := by + apply Finset.eq_of_subset_of_card_le hsound.systematicSupport_subset + rw [hmaskCard, hsystematicCard] + exact himageEq.trans hsystematicEq.symm + +namespace NormalizedWeightSixteenCandidateTree + +/-- A predicate holds for every candidate leaf of a generated tree. -/ +def All (P : NormalizedWeightSixteenCandidate → Prop) : + NormalizedWeightSixteenCandidateTree → Prop + | .leaf candidate => P candidate + | .node left right => left.All P ∧ right.All P + +/-- A pointwise implication transports a tree-wide invariant. -/ +theorem All.imp + {P Q : NormalizedWeightSixteenCandidate → Prop} + (hPQ : ∀ candidate, P candidate → Q candidate) : + (tree : NormalizedWeightSixteenCandidateTree) → + tree.All P → tree.All Q + | .leaf candidate, hall => hPQ candidate hall + | .node left right, hall => + ⟨All.imp hPQ left hall.1, All.imp hPQ right hall.2⟩ + +instance instDecidableAll + (P : NormalizedWeightSixteenCandidate → Prop) [DecidablePred P] : + (tree : NormalizedWeightSixteenCandidateTree) → Decidable (tree.All P) + | .leaf candidate => (inferInstance : DecidablePred P) candidate + | .node left right => + @instDecidableAnd (left.All P) (right.All P) + (instDecidableAll P left) (instDecidableAll P right) + +/-- A tree-wide invariant holds at every propositionally selected leaf. -/ +theorem All.of_member + {P : NormalizedWeightSixteenCandidate → Prop} + {candidate : NormalizedWeightSixteenCandidate} + {tree : NormalizedWeightSixteenCandidateTree} + (hall : tree.All P) (hmember : tree.Member candidate) : + P candidate := by + induction hmember with + | leaf => simpa [All] using hall + | left hmember ih => + exact ih hall.1 + | right hmember ih => + exact ih hall.2 + +end NormalizedWeightSixteenCandidateTree + +/-- Every systematic orthonormal-column code has a generated candidate with a +valid compact mask certificate. -/ +def HasNormalizedWeightSixteenCompactCandidateSoundness : Prop := + ∀ {code : BitVec 64}, + SystematicWeightSixteenConstraints code = true → + ∃ candidate : NormalizedWeightSixteenCandidate, + candidate.systematicCode = code ∧ candidate.IsCompactMaskSound + +/-- Declare a kernel-reduced compact-mask certificate for one generated +candidate tree while keeping each certificate as an independent declaration. -/ +macro "compact_mask_soundness " theoremName:ident " for " tree:term : command => + `(command| + set_option Elab.async true in + set_option linter.style.maxHeartbeats false in + set_option maxRecDepth 100000 in + set_option maxHeartbeats 20000000 in + /-- Every candidate leaf in the selected generated tree has a valid compact mask. -/ + theorem $theoremName : + NormalizedWeightSixteenCandidateTree.All + NormalizedWeightSixteenCandidate.IsCompactMaskSound $tree := by + exact of_decide_eq_true rfl) + +end CryptBoolean diff --git a/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenCandidateSoundnessCertificates.lean b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenCandidateSoundnessCertificates.lean new file mode 100644 index 0000000..fd7389b --- /dev/null +++ b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenCandidateSoundnessCertificates.lean @@ -0,0 +1,361 @@ +/- +Copyright (c) 2026 Asher Yan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Asher Yan with Codex +-/ +module + +public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightSixteenCandidateSoundness + +/-! +# Compact soundness certificates for normalized weight-sixteen candidates + +Each table row names one generated candidate bucket and its independent +kernel-checked compact-mask certificate. The table command emits ordinary +top-level theorem commands before assembling their source-facing soundness +theorem. +-/ + +@[expose] public section + +namespace CryptBoolean + +syntax normalizedWeightSixteenCertificateRow := + "|" term "," ident "," ident + +local syntax (name := normalizedWeightSixteenCertificatesCommand) + "normalized_weight_sixteen_certificates" ident "where" + normalizedWeightSixteenCertificateRow* : command + +local macro_rules + | `(command| normalized_weight_sixteen_certificates + $soundnessName:ident where + $[$rows:normalizedWeightSixteenCertificateRow]*) => do + let generated ← rows.mapM fun row => do + let `(normalizedWeightSixteenCertificateRow| + | $bucketPrefix:term, $tree:ident, $proofName:ident) := row + | Lean.Macro.throwUnsupported + let declaration ← + `(command| compact_mask_soundness $proofName for $tree) + let branch ← `(tactic| + ( + have hprefix : + code.extractLsb' 0 16 = + BitVec.ofNat 16 $bucketPrefix := by + simpa only [beq_iff_eq] using hprefixes + unfold normalizedWeightSixteenCandidateBucket at hbucket + rw [hprefix] at hbucket + cases hbucket + exact ⟨candidate, hcode, + NormalizedWeightSixteenCandidateTree.All.of_member + $proofName hmember⟩ + )) + pure (declaration, branch) + let declarations := generated.map Prod.fst + let branches := generated.map Prod.snd + let focusedBranches ← branches.mapM fun branch => + `(tactic| focus $branch:tactic) + let soundness ← `(command| + set_option Elab.async true in + set_option linter.style.maxHeartbeats false in + set_option maxHeartbeats 20000000 in + /-- Every systematic orthonormal-column code has a generated candidate + with a valid compact mask certificate. -/ + theorem $soundnessName : + HasNormalizedWeightSixteenCompactCandidateSoundness := by + intro code hconstraints + obtain ⟨tree, candidate, hbucket, hmember, hcode⟩ := + exists_normalizedWeightSixteenCandidate_of_constraints + code hconstraints + have hprefixes := + systematicWeightSixteen_prefix_allowed code hconstraints + unfold IsSystematicWeightSixteenPrefixAllowed at hprefixes + simp only [Bool.or_eq_true] at hprefixes + repeat' (apply Or.elim hprefixes <;> intro hprefixes) + $focusedBranches:tactic*) + return Lean.mkNullNode <| + declarations.map (·.raw) ++ + #[soundness.raw] + +normalized_weight_sixteen_certificates + normalizedWeightSixteenCompactCandidateSoundness where + | 2823, normalizedWeightSixteenCandidateBucket_0b07, normalizedWeightSixteenCandidateBucket_0b07_compact + | 3335, normalizedWeightSixteenCandidateBucket_0d07, normalizedWeightSixteenCandidateBucket_0d07_compact + | 3339, normalizedWeightSixteenCandidateBucket_0d0b, normalizedWeightSixteenCandidateBucket_0d0b_compact + | 3591, normalizedWeightSixteenCandidateBucket_0e07, normalizedWeightSixteenCandidateBucket_0e07_compact + | 3595, normalizedWeightSixteenCandidateBucket_0e0b, normalizedWeightSixteenCandidateBucket_0e0b_compact + | 3597, normalizedWeightSixteenCandidateBucket_0e0d, normalizedWeightSixteenCandidateBucket_0e0d_compact + | 4871, normalizedWeightSixteenCandidateBucket_1307, normalizedWeightSixteenCandidateBucket_1307_compact + | 4875, normalizedWeightSixteenCandidateBucket_130b, normalizedWeightSixteenCandidateBucket_130b_compact + | 5383, normalizedWeightSixteenCandidateBucket_1507, normalizedWeightSixteenCandidateBucket_1507_compact + | 5389, normalizedWeightSixteenCandidateBucket_150d, normalizedWeightSixteenCandidateBucket_150d_compact + | 5395, normalizedWeightSixteenCandidateBucket_1513, normalizedWeightSixteenCandidateBucket_1513_compact + | 5639, normalizedWeightSixteenCandidateBucket_1607, normalizedWeightSixteenCandidateBucket_1607_compact + | 5646, normalizedWeightSixteenCandidateBucket_160e, normalizedWeightSixteenCandidateBucket_160e_compact + | 5651, normalizedWeightSixteenCandidateBucket_1613, normalizedWeightSixteenCandidateBucket_1613_compact + | 5653, normalizedWeightSixteenCandidateBucket_1615, normalizedWeightSixteenCandidateBucket_1615_compact + | 6411, normalizedWeightSixteenCandidateBucket_190b, normalizedWeightSixteenCandidateBucket_190b_compact + | 6413, normalizedWeightSixteenCandidateBucket_190d, normalizedWeightSixteenCandidateBucket_190d_compact + | 6419, normalizedWeightSixteenCandidateBucket_1913, normalizedWeightSixteenCandidateBucket_1913_compact + | 6421, normalizedWeightSixteenCandidateBucket_1915, normalizedWeightSixteenCandidateBucket_1915_compact + | 6667, normalizedWeightSixteenCandidateBucket_1a0b, normalizedWeightSixteenCandidateBucket_1a0b_compact + | 6670, normalizedWeightSixteenCandidateBucket_1a0e, normalizedWeightSixteenCandidateBucket_1a0e_compact + | 6675, normalizedWeightSixteenCandidateBucket_1a13, normalizedWeightSixteenCandidateBucket_1a13_compact + | 6678, normalizedWeightSixteenCandidateBucket_1a16, normalizedWeightSixteenCandidateBucket_1a16_compact + | 6681, normalizedWeightSixteenCandidateBucket_1a19, normalizedWeightSixteenCandidateBucket_1a19_compact + | 7181, normalizedWeightSixteenCandidateBucket_1c0d, normalizedWeightSixteenCandidateBucket_1c0d_compact + | 7182, normalizedWeightSixteenCandidateBucket_1c0e, normalizedWeightSixteenCandidateBucket_1c0e_compact + | 7189, normalizedWeightSixteenCandidateBucket_1c15, normalizedWeightSixteenCandidateBucket_1c15_compact + | 7190, normalizedWeightSixteenCandidateBucket_1c16, normalizedWeightSixteenCandidateBucket_1c16_compact + | 7193, normalizedWeightSixteenCandidateBucket_1c19, normalizedWeightSixteenCandidateBucket_1c19_compact + | 7194, normalizedWeightSixteenCandidateBucket_1c1a, normalizedWeightSixteenCandidateBucket_1c1a_compact + | 8967, normalizedWeightSixteenCandidateBucket_2307, normalizedWeightSixteenCandidateBucket_2307_compact + | 8971, normalizedWeightSixteenCandidateBucket_230b, normalizedWeightSixteenCandidateBucket_230b_compact + | 8979, normalizedWeightSixteenCandidateBucket_2313, normalizedWeightSixteenCandidateBucket_2313_compact + | 8988, normalizedWeightSixteenCandidateBucket_231c, normalizedWeightSixteenCandidateBucket_231c_compact + | 8991, normalizedWeightSixteenCandidateBucket_231f, normalizedWeightSixteenCandidateBucket_231f_compact + | 9479, normalizedWeightSixteenCandidateBucket_2507, normalizedWeightSixteenCandidateBucket_2507_compact + | 9485, normalizedWeightSixteenCandidateBucket_250d, normalizedWeightSixteenCandidateBucket_250d_compact + | 9493, normalizedWeightSixteenCandidateBucket_2515, normalizedWeightSixteenCandidateBucket_2515_compact + | 9498, normalizedWeightSixteenCandidateBucket_251a, normalizedWeightSixteenCandidateBucket_251a_compact + | 9503, normalizedWeightSixteenCandidateBucket_251f, normalizedWeightSixteenCandidateBucket_251f_compact + | 9507, normalizedWeightSixteenCandidateBucket_2523, normalizedWeightSixteenCandidateBucket_2523_compact + | 9735, normalizedWeightSixteenCandidateBucket_2607, normalizedWeightSixteenCandidateBucket_2607_compact + | 9742, normalizedWeightSixteenCandidateBucket_260e, normalizedWeightSixteenCandidateBucket_260e_compact + | 9750, normalizedWeightSixteenCandidateBucket_2616, normalizedWeightSixteenCandidateBucket_2616_compact + | 9753, normalizedWeightSixteenCandidateBucket_2619, normalizedWeightSixteenCandidateBucket_2619_compact + | 9759, normalizedWeightSixteenCandidateBucket_261f, normalizedWeightSixteenCandidateBucket_261f_compact + | 9763, normalizedWeightSixteenCandidateBucket_2623, normalizedWeightSixteenCandidateBucket_2623_compact + | 9765, normalizedWeightSixteenCandidateBucket_2625, normalizedWeightSixteenCandidateBucket_2625_compact + | 10507, normalizedWeightSixteenCandidateBucket_290b, normalizedWeightSixteenCandidateBucket_290b_compact + | 10509, normalizedWeightSixteenCandidateBucket_290d, normalizedWeightSixteenCandidateBucket_290d_compact + | 10518, normalizedWeightSixteenCandidateBucket_2916, normalizedWeightSixteenCandidateBucket_2916_compact + | 10521, normalizedWeightSixteenCandidateBucket_2919, normalizedWeightSixteenCandidateBucket_2919_compact + | 10527, normalizedWeightSixteenCandidateBucket_291f, normalizedWeightSixteenCandidateBucket_291f_compact + | 10531, normalizedWeightSixteenCandidateBucket_2923, normalizedWeightSixteenCandidateBucket_2923_compact + | 10533, normalizedWeightSixteenCandidateBucket_2925, normalizedWeightSixteenCandidateBucket_2925_compact + | 10763, normalizedWeightSixteenCandidateBucket_2a0b, normalizedWeightSixteenCandidateBucket_2a0b_compact + | 10766, normalizedWeightSixteenCandidateBucket_2a0e, normalizedWeightSixteenCandidateBucket_2a0e_compact + | 10773, normalizedWeightSixteenCandidateBucket_2a15, normalizedWeightSixteenCandidateBucket_2a15_compact + | 10778, normalizedWeightSixteenCandidateBucket_2a1a, normalizedWeightSixteenCandidateBucket_2a1a_compact + | 10783, normalizedWeightSixteenCandidateBucket_2a1f, normalizedWeightSixteenCandidateBucket_2a1f_compact + | 10787, normalizedWeightSixteenCandidateBucket_2a23, normalizedWeightSixteenCandidateBucket_2a23_compact + | 10790, normalizedWeightSixteenCandidateBucket_2a26, normalizedWeightSixteenCandidateBucket_2a26_compact + | 10793, normalizedWeightSixteenCandidateBucket_2a29, normalizedWeightSixteenCandidateBucket_2a29_compact + | 11277, normalizedWeightSixteenCandidateBucket_2c0d, normalizedWeightSixteenCandidateBucket_2c0d_compact + | 11278, normalizedWeightSixteenCandidateBucket_2c0e, normalizedWeightSixteenCandidateBucket_2c0e_compact + | 11283, normalizedWeightSixteenCandidateBucket_2c13, normalizedWeightSixteenCandidateBucket_2c13_compact + | 11292, normalizedWeightSixteenCandidateBucket_2c1c, normalizedWeightSixteenCandidateBucket_2c1c_compact + | 11295, normalizedWeightSixteenCandidateBucket_2c1f, normalizedWeightSixteenCandidateBucket_2c1f_compact + | 11301, normalizedWeightSixteenCandidateBucket_2c25, normalizedWeightSixteenCandidateBucket_2c25_compact + | 11302, normalizedWeightSixteenCandidateBucket_2c26, normalizedWeightSixteenCandidateBucket_2c26_compact + | 11305, normalizedWeightSixteenCandidateBucket_2c29, normalizedWeightSixteenCandidateBucket_2c29_compact + | 11306, normalizedWeightSixteenCandidateBucket_2c2a, normalizedWeightSixteenCandidateBucket_2c2a_compact + | 12051, normalizedWeightSixteenCandidateBucket_2f13, normalizedWeightSixteenCandidateBucket_2f13_compact + | 12053, normalizedWeightSixteenCandidateBucket_2f15, normalizedWeightSixteenCandidateBucket_2f15_compact + | 12054, normalizedWeightSixteenCandidateBucket_2f16, normalizedWeightSixteenCandidateBucket_2f16_compact + | 12057, normalizedWeightSixteenCandidateBucket_2f19, normalizedWeightSixteenCandidateBucket_2f19_compact + | 12058, normalizedWeightSixteenCandidateBucket_2f1a, normalizedWeightSixteenCandidateBucket_2f1a_compact + | 12060, normalizedWeightSixteenCandidateBucket_2f1c, normalizedWeightSixteenCandidateBucket_2f1c_compact + | 12063, normalizedWeightSixteenCandidateBucket_2f1f, normalizedWeightSixteenCandidateBucket_2f1f_compact + | 12558, normalizedWeightSixteenCandidateBucket_310e, normalizedWeightSixteenCandidateBucket_310e_compact + | 12563, normalizedWeightSixteenCandidateBucket_3113, normalizedWeightSixteenCandidateBucket_3113_compact + | 12565, normalizedWeightSixteenCandidateBucket_3115, normalizedWeightSixteenCandidateBucket_3115_compact + | 12569, normalizedWeightSixteenCandidateBucket_3119, normalizedWeightSixteenCandidateBucket_3119_compact + | 12575, normalizedWeightSixteenCandidateBucket_311f, normalizedWeightSixteenCandidateBucket_311f_compact + | 12579, normalizedWeightSixteenCandidateBucket_3123, normalizedWeightSixteenCandidateBucket_3123_compact + | 12581, normalizedWeightSixteenCandidateBucket_3125, normalizedWeightSixteenCandidateBucket_3125_compact + | 12585, normalizedWeightSixteenCandidateBucket_3129, normalizedWeightSixteenCandidateBucket_3129_compact + | 12591, normalizedWeightSixteenCandidateBucket_312f, normalizedWeightSixteenCandidateBucket_312f_compact + | 12813, normalizedWeightSixteenCandidateBucket_320d, normalizedWeightSixteenCandidateBucket_320d_compact + | 12819, normalizedWeightSixteenCandidateBucket_3213, normalizedWeightSixteenCandidateBucket_3213_compact + | 12822, normalizedWeightSixteenCandidateBucket_3216, normalizedWeightSixteenCandidateBucket_3216_compact + | 12826, normalizedWeightSixteenCandidateBucket_321a, normalizedWeightSixteenCandidateBucket_321a_compact + | 12831, normalizedWeightSixteenCandidateBucket_321f, normalizedWeightSixteenCandidateBucket_321f_compact + | 12835, normalizedWeightSixteenCandidateBucket_3223, normalizedWeightSixteenCandidateBucket_3223_compact + | 12838, normalizedWeightSixteenCandidateBucket_3226, normalizedWeightSixteenCandidateBucket_3226_compact + | 12842, normalizedWeightSixteenCandidateBucket_322a, normalizedWeightSixteenCandidateBucket_322a_compact + | 12847, normalizedWeightSixteenCandidateBucket_322f, normalizedWeightSixteenCandidateBucket_322f_compact + | 12849, normalizedWeightSixteenCandidateBucket_3231, normalizedWeightSixteenCandidateBucket_3231_compact + | 13323, normalizedWeightSixteenCandidateBucket_340b, normalizedWeightSixteenCandidateBucket_340b_compact + | 13333, normalizedWeightSixteenCandidateBucket_3415, normalizedWeightSixteenCandidateBucket_3415_compact + | 13334, normalizedWeightSixteenCandidateBucket_3416, normalizedWeightSixteenCandidateBucket_3416_compact + | 13340, normalizedWeightSixteenCandidateBucket_341c, normalizedWeightSixteenCandidateBucket_341c_compact + | 13343, normalizedWeightSixteenCandidateBucket_341f, normalizedWeightSixteenCandidateBucket_341f_compact + | 13349, normalizedWeightSixteenCandidateBucket_3425, normalizedWeightSixteenCandidateBucket_3425_compact + | 13350, normalizedWeightSixteenCandidateBucket_3426, normalizedWeightSixteenCandidateBucket_3426_compact + | 13356, normalizedWeightSixteenCandidateBucket_342c, normalizedWeightSixteenCandidateBucket_342c_compact + | 13359, normalizedWeightSixteenCandidateBucket_342f, normalizedWeightSixteenCandidateBucket_342f_compact + | 13361, normalizedWeightSixteenCandidateBucket_3431, normalizedWeightSixteenCandidateBucket_3431_compact + | 13362, normalizedWeightSixteenCandidateBucket_3432, normalizedWeightSixteenCandidateBucket_3432_compact + | 14091, normalizedWeightSixteenCandidateBucket_370b, normalizedWeightSixteenCandidateBucket_370b_compact + | 14093, normalizedWeightSixteenCandidateBucket_370d, normalizedWeightSixteenCandidateBucket_370d_compact + | 14094, normalizedWeightSixteenCandidateBucket_370e, normalizedWeightSixteenCandidateBucket_370e_compact + | 14105, normalizedWeightSixteenCandidateBucket_3719, normalizedWeightSixteenCandidateBucket_3719_compact + | 14106, normalizedWeightSixteenCandidateBucket_371a, normalizedWeightSixteenCandidateBucket_371a_compact + | 14108, normalizedWeightSixteenCandidateBucket_371c, normalizedWeightSixteenCandidateBucket_371c_compact + | 14111, normalizedWeightSixteenCandidateBucket_371f, normalizedWeightSixteenCandidateBucket_371f_compact + | 14121, normalizedWeightSixteenCandidateBucket_3729, normalizedWeightSixteenCandidateBucket_3729_compact + | 14122, normalizedWeightSixteenCandidateBucket_372a, normalizedWeightSixteenCandidateBucket_372a_compact + | 14124, normalizedWeightSixteenCandidateBucket_372c, normalizedWeightSixteenCandidateBucket_372c_compact + | 14127, normalizedWeightSixteenCandidateBucket_372f, normalizedWeightSixteenCandidateBucket_372f_compact + | 14343, normalizedWeightSixteenCandidateBucket_3807, normalizedWeightSixteenCandidateBucket_3807_compact + | 14361, normalizedWeightSixteenCandidateBucket_3819, normalizedWeightSixteenCandidateBucket_3819_compact + | 14362, normalizedWeightSixteenCandidateBucket_381a, normalizedWeightSixteenCandidateBucket_381a_compact + | 14364, normalizedWeightSixteenCandidateBucket_381c, normalizedWeightSixteenCandidateBucket_381c_compact + | 14367, normalizedWeightSixteenCandidateBucket_381f, normalizedWeightSixteenCandidateBucket_381f_compact + | 14377, normalizedWeightSixteenCandidateBucket_3829, normalizedWeightSixteenCandidateBucket_3829_compact + | 14378, normalizedWeightSixteenCandidateBucket_382a, normalizedWeightSixteenCandidateBucket_382a_compact + | 14380, normalizedWeightSixteenCandidateBucket_382c, normalizedWeightSixteenCandidateBucket_382c_compact + | 14383, normalizedWeightSixteenCandidateBucket_382f, normalizedWeightSixteenCandidateBucket_382f_compact + | 14385, normalizedWeightSixteenCandidateBucket_3831, normalizedWeightSixteenCandidateBucket_3831_compact + | 14386, normalizedWeightSixteenCandidateBucket_3832, normalizedWeightSixteenCandidateBucket_3832_compact + | 14388, normalizedWeightSixteenCandidateBucket_3834, normalizedWeightSixteenCandidateBucket_3834_compact + | 14391, normalizedWeightSixteenCandidateBucket_3837, normalizedWeightSixteenCandidateBucket_3837_compact + | 15111, normalizedWeightSixteenCandidateBucket_3b07, normalizedWeightSixteenCandidateBucket_3b07_compact + | 15117, normalizedWeightSixteenCandidateBucket_3b0d, normalizedWeightSixteenCandidateBucket_3b0d_compact + | 15118, normalizedWeightSixteenCandidateBucket_3b0e, normalizedWeightSixteenCandidateBucket_3b0e_compact + | 15125, normalizedWeightSixteenCandidateBucket_3b15, normalizedWeightSixteenCandidateBucket_3b15_compact + | 15126, normalizedWeightSixteenCandidateBucket_3b16, normalizedWeightSixteenCandidateBucket_3b16_compact + | 15132, normalizedWeightSixteenCandidateBucket_3b1c, normalizedWeightSixteenCandidateBucket_3b1c_compact + | 15135, normalizedWeightSixteenCandidateBucket_3b1f, normalizedWeightSixteenCandidateBucket_3b1f_compact + | 15141, normalizedWeightSixteenCandidateBucket_3b25, normalizedWeightSixteenCandidateBucket_3b25_compact + | 15142, normalizedWeightSixteenCandidateBucket_3b26, normalizedWeightSixteenCandidateBucket_3b26_compact + | 15148, normalizedWeightSixteenCandidateBucket_3b2c, normalizedWeightSixteenCandidateBucket_3b2c_compact + | 15151, normalizedWeightSixteenCandidateBucket_3b2f, normalizedWeightSixteenCandidateBucket_3b2f_compact + | 15156, normalizedWeightSixteenCandidateBucket_3b34, normalizedWeightSixteenCandidateBucket_3b34_compact + | 15159, normalizedWeightSixteenCandidateBucket_3b37, normalizedWeightSixteenCandidateBucket_3b37_compact + | 15623, normalizedWeightSixteenCandidateBucket_3d07, normalizedWeightSixteenCandidateBucket_3d07_compact + | 15627, normalizedWeightSixteenCandidateBucket_3d0b, normalizedWeightSixteenCandidateBucket_3d0b_compact + | 15630, normalizedWeightSixteenCandidateBucket_3d0e, normalizedWeightSixteenCandidateBucket_3d0e_compact + | 15635, normalizedWeightSixteenCandidateBucket_3d13, normalizedWeightSixteenCandidateBucket_3d13_compact + | 15638, normalizedWeightSixteenCandidateBucket_3d16, normalizedWeightSixteenCandidateBucket_3d16_compact + | 15642, normalizedWeightSixteenCandidateBucket_3d1a, normalizedWeightSixteenCandidateBucket_3d1a_compact + | 15647, normalizedWeightSixteenCandidateBucket_3d1f, normalizedWeightSixteenCandidateBucket_3d1f_compact + | 15651, normalizedWeightSixteenCandidateBucket_3d23, normalizedWeightSixteenCandidateBucket_3d23_compact + | 15654, normalizedWeightSixteenCandidateBucket_3d26, normalizedWeightSixteenCandidateBucket_3d26_compact + | 15658, normalizedWeightSixteenCandidateBucket_3d2a, normalizedWeightSixteenCandidateBucket_3d2a_compact + | 15663, normalizedWeightSixteenCandidateBucket_3d2f, normalizedWeightSixteenCandidateBucket_3d2f_compact + | 15666, normalizedWeightSixteenCandidateBucket_3d32, normalizedWeightSixteenCandidateBucket_3d32_compact + | 15671, normalizedWeightSixteenCandidateBucket_3d37, normalizedWeightSixteenCandidateBucket_3d37_compact + | 15675, normalizedWeightSixteenCandidateBucket_3d3b, normalizedWeightSixteenCandidateBucket_3d3b_compact + | 15879, normalizedWeightSixteenCandidateBucket_3e07, normalizedWeightSixteenCandidateBucket_3e07_compact + | 15883, normalizedWeightSixteenCandidateBucket_3e0b, normalizedWeightSixteenCandidateBucket_3e0b_compact + | 15885, normalizedWeightSixteenCandidateBucket_3e0d, normalizedWeightSixteenCandidateBucket_3e0d_compact + | 15891, normalizedWeightSixteenCandidateBucket_3e13, normalizedWeightSixteenCandidateBucket_3e13_compact + | 15893, normalizedWeightSixteenCandidateBucket_3e15, normalizedWeightSixteenCandidateBucket_3e15_compact + | 15897, normalizedWeightSixteenCandidateBucket_3e19, normalizedWeightSixteenCandidateBucket_3e19_compact + | 15903, normalizedWeightSixteenCandidateBucket_3e1f, normalizedWeightSixteenCandidateBucket_3e1f_compact + | 15907, normalizedWeightSixteenCandidateBucket_3e23, normalizedWeightSixteenCandidateBucket_3e23_compact + | 15909, normalizedWeightSixteenCandidateBucket_3e25, normalizedWeightSixteenCandidateBucket_3e25_compact + | 15913, normalizedWeightSixteenCandidateBucket_3e29, normalizedWeightSixteenCandidateBucket_3e29_compact + | 15919, normalizedWeightSixteenCandidateBucket_3e2f, normalizedWeightSixteenCandidateBucket_3e2f_compact + | 15921, normalizedWeightSixteenCandidateBucket_3e31, normalizedWeightSixteenCandidateBucket_3e31_compact + | 15927, normalizedWeightSixteenCandidateBucket_3e37, normalizedWeightSixteenCandidateBucket_3e37_compact + | 15931, normalizedWeightSixteenCandidateBucket_3e3b, normalizedWeightSixteenCandidateBucket_3e3b_compact + | 15933, normalizedWeightSixteenCandidateBucket_3e3d, normalizedWeightSixteenCandidateBucket_3e3d_compact + | 17731, normalizedWeightSixteenCandidateBucket_4543, normalizedWeightSixteenCandidateBucket_4543_compact + | 17987, normalizedWeightSixteenCandidateBucket_4643, normalizedWeightSixteenCandidateBucket_4643_compact + | 17989, normalizedWeightSixteenCandidateBucket_4645, normalizedWeightSixteenCandidateBucket_4645_compact + | 18755, normalizedWeightSixteenCandidateBucket_4943, normalizedWeightSixteenCandidateBucket_4943_compact + | 18757, normalizedWeightSixteenCandidateBucket_4945, normalizedWeightSixteenCandidateBucket_4945_compact + | 19011, normalizedWeightSixteenCandidateBucket_4a43, normalizedWeightSixteenCandidateBucket_4a43_compact + | 19014, normalizedWeightSixteenCandidateBucket_4a46, normalizedWeightSixteenCandidateBucket_4a46_compact + | 19017, normalizedWeightSixteenCandidateBucket_4a49, normalizedWeightSixteenCandidateBucket_4a49_compact + | 19525, normalizedWeightSixteenCandidateBucket_4c45, normalizedWeightSixteenCandidateBucket_4c45_compact + | 19526, normalizedWeightSixteenCandidateBucket_4c46, normalizedWeightSixteenCandidateBucket_4c46_compact + | 19529, normalizedWeightSixteenCandidateBucket_4c49, normalizedWeightSixteenCandidateBucket_4c49_compact + | 19530, normalizedWeightSixteenCandidateBucket_4c4a, normalizedWeightSixteenCandidateBucket_4c4a_compact + | 20803, normalizedWeightSixteenCandidateBucket_5143, normalizedWeightSixteenCandidateBucket_5143_compact + | 20805, normalizedWeightSixteenCandidateBucket_5145, normalizedWeightSixteenCandidateBucket_5145_compact + | 20809, normalizedWeightSixteenCandidateBucket_5149, normalizedWeightSixteenCandidateBucket_5149_compact + | 20815, normalizedWeightSixteenCandidateBucket_514f, normalizedWeightSixteenCandidateBucket_514f_compact + | 21059, normalizedWeightSixteenCandidateBucket_5243, normalizedWeightSixteenCandidateBucket_5243_compact + | 21062, normalizedWeightSixteenCandidateBucket_5246, normalizedWeightSixteenCandidateBucket_5246_compact + | 21066, normalizedWeightSixteenCandidateBucket_524a, normalizedWeightSixteenCandidateBucket_524a_compact + | 21071, normalizedWeightSixteenCandidateBucket_524f, normalizedWeightSixteenCandidateBucket_524f_compact + | 21073, normalizedWeightSixteenCandidateBucket_5251, normalizedWeightSixteenCandidateBucket_5251_compact + | 21573, normalizedWeightSixteenCandidateBucket_5445, normalizedWeightSixteenCandidateBucket_5445_compact + | 21574, normalizedWeightSixteenCandidateBucket_5446, normalizedWeightSixteenCandidateBucket_5446_compact + | 21580, normalizedWeightSixteenCandidateBucket_544c, normalizedWeightSixteenCandidateBucket_544c_compact + | 21583, normalizedWeightSixteenCandidateBucket_544f, normalizedWeightSixteenCandidateBucket_544f_compact + | 21585, normalizedWeightSixteenCandidateBucket_5451, normalizedWeightSixteenCandidateBucket_5451_compact + | 21586, normalizedWeightSixteenCandidateBucket_5452, normalizedWeightSixteenCandidateBucket_5452_compact + | 22345, normalizedWeightSixteenCandidateBucket_5749, normalizedWeightSixteenCandidateBucket_5749_compact + | 22346, normalizedWeightSixteenCandidateBucket_574a, normalizedWeightSixteenCandidateBucket_574a_compact + | 22348, normalizedWeightSixteenCandidateBucket_574c, normalizedWeightSixteenCandidateBucket_574c_compact + | 22351, normalizedWeightSixteenCandidateBucket_574f, normalizedWeightSixteenCandidateBucket_574f_compact + | 22601, normalizedWeightSixteenCandidateBucket_5849, normalizedWeightSixteenCandidateBucket_5849_compact + | 22602, normalizedWeightSixteenCandidateBucket_584a, normalizedWeightSixteenCandidateBucket_584a_compact + | 22604, normalizedWeightSixteenCandidateBucket_584c, normalizedWeightSixteenCandidateBucket_584c_compact + | 22607, normalizedWeightSixteenCandidateBucket_584f, normalizedWeightSixteenCandidateBucket_584f_compact + | 22609, normalizedWeightSixteenCandidateBucket_5851, normalizedWeightSixteenCandidateBucket_5851_compact + | 22610, normalizedWeightSixteenCandidateBucket_5852, normalizedWeightSixteenCandidateBucket_5852_compact + | 22612, normalizedWeightSixteenCandidateBucket_5854, normalizedWeightSixteenCandidateBucket_5854_compact + | 22615, normalizedWeightSixteenCandidateBucket_5857, normalizedWeightSixteenCandidateBucket_5857_compact + | 23365, normalizedWeightSixteenCandidateBucket_5b45, normalizedWeightSixteenCandidateBucket_5b45_compact + | 23366, normalizedWeightSixteenCandidateBucket_5b46, normalizedWeightSixteenCandidateBucket_5b46_compact + | 23372, normalizedWeightSixteenCandidateBucket_5b4c, normalizedWeightSixteenCandidateBucket_5b4c_compact + | 23375, normalizedWeightSixteenCandidateBucket_5b4f, normalizedWeightSixteenCandidateBucket_5b4f_compact + | 23380, normalizedWeightSixteenCandidateBucket_5b54, normalizedWeightSixteenCandidateBucket_5b54_compact + | 23383, normalizedWeightSixteenCandidateBucket_5b57, normalizedWeightSixteenCandidateBucket_5b57_compact + | 23875, normalizedWeightSixteenCandidateBucket_5d43, normalizedWeightSixteenCandidateBucket_5d43_compact + | 23878, normalizedWeightSixteenCandidateBucket_5d46, normalizedWeightSixteenCandidateBucket_5d46_compact + | 23882, normalizedWeightSixteenCandidateBucket_5d4a, normalizedWeightSixteenCandidateBucket_5d4a_compact + | 23887, normalizedWeightSixteenCandidateBucket_5d4f, normalizedWeightSixteenCandidateBucket_5d4f_compact + | 23890, normalizedWeightSixteenCandidateBucket_5d52, normalizedWeightSixteenCandidateBucket_5d52_compact + | 23895, normalizedWeightSixteenCandidateBucket_5d57, normalizedWeightSixteenCandidateBucket_5d57_compact + | 23899, normalizedWeightSixteenCandidateBucket_5d5b, normalizedWeightSixteenCandidateBucket_5d5b_compact + | 24131, normalizedWeightSixteenCandidateBucket_5e43, normalizedWeightSixteenCandidateBucket_5e43_compact + | 24133, normalizedWeightSixteenCandidateBucket_5e45, normalizedWeightSixteenCandidateBucket_5e45_compact + | 24137, normalizedWeightSixteenCandidateBucket_5e49, normalizedWeightSixteenCandidateBucket_5e49_compact + | 24143, normalizedWeightSixteenCandidateBucket_5e4f, normalizedWeightSixteenCandidateBucket_5e4f_compact + | 24145, normalizedWeightSixteenCandidateBucket_5e51, normalizedWeightSixteenCandidateBucket_5e51_compact + | 24151, normalizedWeightSixteenCandidateBucket_5e57, normalizedWeightSixteenCandidateBucket_5e57_compact + | 24155, normalizedWeightSixteenCandidateBucket_5e5b, normalizedWeightSixteenCandidateBucket_5e5b_compact + | 24157, normalizedWeightSixteenCandidateBucket_5e5d, normalizedWeightSixteenCandidateBucket_5e5d_compact + | 25185, normalizedWeightSixteenCandidateBucket_6261, normalizedWeightSixteenCandidateBucket_6261_compact + | 25697, normalizedWeightSixteenCandidateBucket_6461, normalizedWeightSixteenCandidateBucket_6461_compact + | 25698, normalizedWeightSixteenCandidateBucket_6462, normalizedWeightSixteenCandidateBucket_6462_compact + | 26721, normalizedWeightSixteenCandidateBucket_6861, normalizedWeightSixteenCandidateBucket_6861_compact + | 26722, normalizedWeightSixteenCandidateBucket_6862, normalizedWeightSixteenCandidateBucket_6862_compact + | 26724, normalizedWeightSixteenCandidateBucket_6864, normalizedWeightSixteenCandidateBucket_6864_compact + | 26727, normalizedWeightSixteenCandidateBucket_6867, normalizedWeightSixteenCandidateBucket_6867_compact + | 27492, normalizedWeightSixteenCandidateBucket_6b64, normalizedWeightSixteenCandidateBucket_6b64_compact + | 27495, normalizedWeightSixteenCandidateBucket_6b67, normalizedWeightSixteenCandidateBucket_6b67_compact + | 28002, normalizedWeightSixteenCandidateBucket_6d62, normalizedWeightSixteenCandidateBucket_6d62_compact + | 28007, normalizedWeightSixteenCandidateBucket_6d67, normalizedWeightSixteenCandidateBucket_6d67_compact + | 28011, normalizedWeightSixteenCandidateBucket_6d6b, normalizedWeightSixteenCandidateBucket_6d6b_compact + | 28257, normalizedWeightSixteenCandidateBucket_6e61, normalizedWeightSixteenCandidateBucket_6e61_compact + | 28263, normalizedWeightSixteenCandidateBucket_6e67, normalizedWeightSixteenCandidateBucket_6e67_compact + | 28267, normalizedWeightSixteenCandidateBucket_6e6b, normalizedWeightSixteenCandidateBucket_6e6b_compact + | 28269, normalizedWeightSixteenCandidateBucket_6e6d, normalizedWeightSixteenCandidateBucket_6e6d_compact + | 30067, normalizedWeightSixteenCandidateBucket_7573, normalizedWeightSixteenCandidateBucket_7573_compact + | 30323, normalizedWeightSixteenCandidateBucket_7673, normalizedWeightSixteenCandidateBucket_7673_compact + | 30325, normalizedWeightSixteenCandidateBucket_7675, normalizedWeightSixteenCandidateBucket_7675_compact + | 31353, normalizedWeightSixteenCandidateBucket_7a79, normalizedWeightSixteenCandidateBucket_7a79_compact + | 33663, normalizedWeightSixteenCandidateBucket_837f, normalizedWeightSixteenCandidateBucket_837f_compact + | 34175, normalizedWeightSixteenCandidateBucket_857f, normalizedWeightSixteenCandidateBucket_857f_compact + | 34431, normalizedWeightSixteenCandidateBucket_867f, normalizedWeightSixteenCandidateBucket_867f_compact + | 35199, normalizedWeightSixteenCandidateBucket_897f, normalizedWeightSixteenCandidateBucket_897f_compact + | 35455, normalizedWeightSixteenCandidateBucket_8a7f, normalizedWeightSixteenCandidateBucket_8a7f_compact + | 35967, normalizedWeightSixteenCandidateBucket_8c7f, normalizedWeightSixteenCandidateBucket_8c7f_compact + | 36735, normalizedWeightSixteenCandidateBucket_8f7f, normalizedWeightSixteenCandidateBucket_8f7f_compact + | 37247, normalizedWeightSixteenCandidateBucket_917f, normalizedWeightSixteenCandidateBucket_917f_compact + | 37503, normalizedWeightSixteenCandidateBucket_927f, normalizedWeightSixteenCandidateBucket_927f_compact + | 38015, normalizedWeightSixteenCandidateBucket_947f, normalizedWeightSixteenCandidateBucket_947f_compact + | 38783, normalizedWeightSixteenCandidateBucket_977f, normalizedWeightSixteenCandidateBucket_977f_compact + | 39807, normalizedWeightSixteenCandidateBucket_9b7f, normalizedWeightSixteenCandidateBucket_9b7f_compact + | 40319, normalizedWeightSixteenCandidateBucket_9d7f, normalizedWeightSixteenCandidateBucket_9d7f_compact + | 41343, normalizedWeightSixteenCandidateBucket_a17f, normalizedWeightSixteenCandidateBucket_a17f_compact + | 41599, normalizedWeightSixteenCandidateBucket_a27f, normalizedWeightSixteenCandidateBucket_a27f_compact + | 42111, normalizedWeightSixteenCandidateBucket_a47f, normalizedWeightSixteenCandidateBucket_a47f_compact + | 42879, normalizedWeightSixteenCandidateBucket_a77f, normalizedWeightSixteenCandidateBucket_a77f_compact + | 43903, normalizedWeightSixteenCandidateBucket_ab7f, normalizedWeightSixteenCandidateBucket_ab7f_compact + | 44415, normalizedWeightSixteenCandidateBucket_ad7f, normalizedWeightSixteenCandidateBucket_ad7f_compact + | 45951, normalizedWeightSixteenCandidateBucket_b37f, normalizedWeightSixteenCandidateBucket_b37f_compact + | 46463, normalizedWeightSixteenCandidateBucket_b57f, normalizedWeightSixteenCandidateBucket_b57f_compact + | 47487, normalizedWeightSixteenCandidateBucket_b97f, normalizedWeightSixteenCandidateBucket_b97f_compact + | 49023, normalizedWeightSixteenCandidateBucket_bf7f, normalizedWeightSixteenCandidateBucket_bf7f_compact + +end CryptBoolean diff --git a/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenCharacterBound.lean b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenCharacterBound.lean new file mode 100644 index 0000000..a7fb730 --- /dev/null +++ b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenCharacterBound.lean @@ -0,0 +1,37 @@ +/- +Copyright (c) 2026 Asher Yan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Asher Yan with Codex +-/ +module + +public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightSixteenOrbitPairwiseDisjoint + +/-! +# Weight-sixteen character bound from a rank-seven classifier +-/ + +open scoped BooleanCube + +@[expose] public section + +namespace CryptBoolean + +variable {n : ℕ} + +/-- A certificate-producing rank-seven classifier implies the full +weight-sixteen dual character lower bound. -/ +theorem orderTwoWeightSixteenCharacterSum_ge_of_certificate + (f : BooleanFunction n) + (hn : 3 ≤ n) + (hcertificate : ∀ h : BooleanFunction n, + h ∈ orderTwoWeightSixteenDualWords n → + HasSupportAffineSpanRankSeven h → + RankSevenWeightSixteenPatternCertificate h) : + orderTwoWeightSixteenCharacterSum f ≥ + -((3 * 127 + 127 * 2 ^ 128) * (2 ^ n : ℝ) ^ 7) := + orderTwoWeightSixteenCharacterSum_ge_of_orbitClassification f + (hasRankSevenWeightSixteenOrbitClassification_of_certificate hcertificate) + (hasRankAtMostSixWeightSixteenDeficientAffineMaskCover hn) + +end CryptBoolean diff --git a/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenClassification.lean b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenClassification.lean new file mode 100644 index 0000000..4b81ec8 --- /dev/null +++ b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenClassification.lean @@ -0,0 +1,2065 @@ +/- +Copyright (c) 2026 Asher Yan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Asher Yan with Codex +-/ +module + +public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightSixteenTypeA +public import CryptBoolean.Carlet.Chapter04.GeneralizedLinearStructureDistance + +/-! +# The weight-sixteen exceptional families + +The period-space description and the six-vector count for the type-`b` +exceptional words in the Kasami--Tokura classification. +-/ + +open Finset +open scoped BigOperators BooleanCube + +@[expose] public section + +namespace CryptBoolean + +open FABL + +variable {n : ℕ} + +noncomputable local instance weightSixteenClassificationQuotientDecidableEq + (S : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) : + DecidableEq (FABL.F₂Cube n ⧸ S) := + Classical.decEq _ + +/-- The type-`b` exceptional family, characterized intrinsically by its +two-dimensional zero-derivative kernel. -/ +noncomputable def orderTwoWeightSixteenTypeBWords (n : ℕ) : + Finset (BooleanFunction n) := by + classical + exact (orderTwoWeightSixteenDualWords n).filter fun h ↦ + Module.finrank FABL.𝔽₂ (zeroDerivativeKernel h) = 2 + +/-- Type-`b` words are weight-sixteen words in the dual Reed--Muller code. -/ +theorem orderTwoWeightSixteenTypeBWords_subset_dualWords (n : ℕ) : + orderTwoWeightSixteenTypeBWords n ⊆ + orderTwoWeightSixteenDualWords n := by + intro h hh + exact (Finset.mem_filter.mp hh).1 + +private theorem binaryAffineFlatIndicator_period_of_mem_direction + (C : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) + (a : FABL.F₂Cube n) (ha : a ∈ C.direction) + (x : FABL.F₂Cube n) : + binaryAffineFlatIndicator C (x + a) = + binaryAffineFlatIndicator C x := by + classical + have hmem : x + a ∈ C ↔ x ∈ C := by + simpa only [vadd_eq_add, add_comm] using + (AffineSubspace.vadd_mem_iff_mem_of_mem_direction ha (p := x)) + simp only [binaryAffineFlatIndicator] + by_cases hx : x ∈ C + · rw [if_pos hx, if_pos (hmem.mpr hx)] + · rw [if_neg hx, if_neg (fun h ↦ hx (hmem.mp h))] + +theorem binaryAffineFlatIndicator_zeroDerivativeKernel + (C : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) (hC : C ≠ ⊥) : + zeroDerivativeKernel (binaryAffineFlatIndicator C) = C.direction := by + apply le_antisymm + · intro a ha + obtain ⟨x, hx⟩ := (AffineSubspace.nonempty_iff_ne_bot C).2 hC + have hderivative := ha x + simp only [FABL.booleanDerivative] at hderivative + have hxOne : binaryAffineFlatIndicator C x = 1 := + (binaryAffineFlatIndicator_apply_eq_one_iff C x).2 hx + have hxaOne : binaryAffineFlatIndicator C (x + a) = 1 := by + rw [hxOne] at hderivative + have heq := add_eq_zero_iff_eq_neg.mp hderivative + exact (heq.trans (ZMod.neg_eq_self_mod_two + (binaryAffineFlatIndicator C (x + a)))).symm + have hxa : x + a ∈ C := + (binaryAffineFlatIndicator_apply_eq_one_iff C (x + a)).1 hxaOne + have hvsub := AffineSubspace.vsub_mem_direction hxa hx + have hdifference : (x + a) - x = a := by + simp only [sub_eq_add_neg, ZModModule.neg_eq_self] + calc + x + a + x = a + (x + x) := by abel + _ = a := by rw [ZModModule.add_self, add_zero] + rw [vsub_eq_sub, hdifference] at hvsub + exact hvsub + · intro a ha x + simp only [FABL.booleanDerivative] + rw [binaryAffineFlatIndicator_period_of_mem_direction C a ha x] + exact ZModModule.add_self _ + +/-- The zero-derivative kernel of a type-`a` word has dimension four. -/ +theorem finrank_zeroDerivativeKernel_of_mem_weightSixteenTypeAWords + (h : BooleanFunction n) (hh : h ∈ orderTwoWeightSixteenTypeAWords n) : + Module.finrank FABL.𝔽₂ (zeroDerivativeKernel h) = 4 := by + classical + obtain ⟨C, hC, rfl⟩ := Finset.mem_image.mp hh + have hCdata : C ≠ ⊥ ∧ Module.finrank FABL.𝔽₂ C.direction = 4 := by + simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, + true_and] using hC + rw [binaryAffineFlatIndicator_zeroDerivativeKernel C hCdata.1, + hCdata.2] + +/-- The two exceptional weight-sixteen families are disjoint. -/ +theorem disjoint_orderTwoWeightSixteenTypeAWords_typeBWords (n : ℕ) : + Disjoint (orderTwoWeightSixteenTypeAWords n) + (orderTwoWeightSixteenTypeBWords n) := by + rw [Finset.disjoint_left] + intro h hA hB + have hfour := + finrank_zeroDerivativeKernel_of_mem_weightSixteenTypeAWords h hA + have htwo : Module.finrank FABL.𝔽₂ (zeroDerivativeKernel h) = 2 := + (Finset.mem_filter.mp hB).2 + omega + +/-- A Boolean function descends canonically to the quotient by its +zero-derivative kernel. -/ +noncomputable def zeroDerivativeKernelQuotientFunction + (h : BooleanFunction n) : + (FABL.F₂Cube n ⧸ zeroDerivativeKernel h) → FABL.𝔽₂ := + fun q ↦ Quotient.liftOn' q h (by + intro a b hab + let R := zeroDerivativeKernel h + have hquotient : R.mkQ a = R.mkQ b := Quotient.sound' hab + have habKernel : a + b ∈ R := by + have hdifference := (Submodule.Quotient.eq R).mp hquotient + simpa only [sub_eq_add_neg, ZModModule.neg_eq_self] using hdifference + have hperiod := habKernel b + simp only [FABL.booleanDerivative] at hperiod + have harg : b + (a + b) = a := by + calc + b + (a + b) = a + (b + b) := by abel + _ = a := by rw [ZModModule.add_self, add_zero] + rw [harg] at hperiod + have heq : h b = -h a := add_eq_zero_iff_eq_neg.mp hperiod + calc + h a = -h a := (ZMod.neg_eq_self_mod_two (h a)).symm + _ = h b := heq.symm) + +@[simp] theorem zeroDerivativeKernelQuotientFunction_mkQ + (h : BooleanFunction n) (x : FABL.F₂Cube n) : + zeroDerivativeKernelQuotientFunction h + ((zeroDerivativeKernel h).mkQ x) = h x := by + rfl + +private theorem card_submodule_mkQ_fiber_weightSixteen + (S : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) + (q : FABL.F₂Cube n ⧸ S) : + ((Finset.univ : Finset (FABL.F₂Cube n)).filter fun x ↦ + S.mkQ x = q).card = Nat.card S := by + classical + rw [← Fintype.card_subtype] + calc + Fintype.card {x : FABL.F₂Cube n // S.mkQ x = q} = + Fintype.card S.mkQ.toAddMonoidHom.ker := by + apply Fintype.card_congr + exact AddMonoidHom.fiberEquivKerOfSurjective + (f := S.mkQ.toAddMonoidHom) S.mkQ_surjective q + _ = Nat.card S := by + rw [← Nat.card_eq_fintype_card] + have hker : S.mkQ.toAddMonoidHom.ker = S.toAddSubgroup := by + rw [← LinearMap.ker_toAddSubgroup, Submodule.ker_mkQ] + rw [hker] + congr + +private theorem card_filter_mkQ_eq_card_mul_card_filter_weightSixteen + (S : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) + (P : (FABL.F₂Cube n ⧸ S) → Prop) [DecidablePred P] : + ((Finset.univ : Finset (FABL.F₂Cube n)).filter fun x ↦ + P (S.mkQ x)).card = + Nat.card S * + ((Finset.univ : Finset (FABL.F₂Cube n ⧸ S)).filter P).card := by + classical + have hfiber := Finset.sum_card_fiberwise_eq_card_filter + (s := (Finset.univ : Finset (FABL.F₂Cube n))) + (t := (Finset.univ : Finset (FABL.F₂Cube n ⧸ S)).filter P) + (g := S.mkQ) + rw [Finset.sum_const_nat] at hfiber + · calc + ((Finset.univ : Finset (FABL.F₂Cube n)).filter fun x ↦ + P (S.mkQ x)).card = + ((Finset.univ : Finset (FABL.F₂Cube n ⧸ S)).filter P).card * + Nat.card S := by + simpa only [Finset.mem_filter, Finset.mem_univ, true_and] using + hfiber.symm + _ = Nat.card S * + ((Finset.univ : Finset (FABL.F₂Cube n ⧸ S)).filter P).card := + Nat.mul_comm _ _ + · intro q hq + exact card_submodule_mkQ_fiber_weightSixteen S q + +private theorem exists_spanning_pair_of_finrank_two + (H : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) + (hH : Module.finrank FABL.𝔽₂ H = 2) : + ∃ a b : FABL.F₂Cube n, + H = (FABL.𝔽₂ ∙ a) ⊔ (FABL.𝔽₂ ∙ b) := by + have hbotlt : (⊥ : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) < H := by + apply bot_lt_iff_ne_bot.mpr + intro hHbot + rw [hHbot, finrank_bot] at hH + omega + obtain ⟨a, haH, haBot⟩ := SetLike.exists_of_lt hbotlt + have ha0 : a ≠ 0 := by + intro ha + subst a + exact haBot (Submodule.zero_mem _) + let S : Submodule FABL.𝔽₂ (FABL.F₂Cube n) := FABL.𝔽₂ ∙ a + have hSle : S ≤ H := + Submodule.span_le.2 (Set.singleton_subset_iff.2 haH) + have hSrank : Module.finrank FABL.𝔽₂ S = 1 := + finrank_span_singleton ha0 + have hSlt : S < H := + Submodule.lt_of_le_of_finrank_lt_finrank hSle (by omega) + obtain ⟨b, hbH, hbS⟩ := SetLike.exists_of_lt hSlt + refine ⟨a, b, ?_⟩ + symm + apply Submodule.eq_of_le_of_finrank_eq + · exact sup_le hSle + (Submodule.span_le.2 (Set.singleton_subset_iff.2 hbH)) + · rw [Submodule.finrank_sup_span_singleton hbS, hSrank, hH] + +private theorem mem_binaryAffineSubspace_iff_mkQ_eq + (S : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) + (a x : FABL.F₂Cube n) : + x ∈ FABL.binaryAffineSubspace S a ↔ S.mkQ x = S.mkQ a := by + rw [FABL.mem_binaryAffineSubspace_iff_add_mem] + constructor + · intro hx + apply (Submodule.Quotient.eq S).2 + simpa only [sub_eq_add_neg, ZModModule.neg_eq_self] using hx + · intro hx + have hdifference := (Submodule.Quotient.eq S).1 hx + simpa only [sub_eq_add_neg, ZModModule.neg_eq_self] using hdifference + +private theorem weightSixteenClassificationDisjointPairData + {p : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × + AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)} + (hp : p ∈ disjointBinaryAffineThreeFlatPairs n) : + p.1 ∈ binaryAffineFlats 3 n ∧ + p.2 ∈ binaryAffineFlats 3 n ∧ p.1 ⊓ p.2 = ⊥ := by + have hp' : p ∈ binaryAffineThreeFlatPairs n ∧ p.1 ⊓ p.2 = ⊥ := by + simpa only [disjointBinaryAffineThreeFlatPairs, + Finset.mem_filter] using hp + have hproduct : p ∈ + (binaryAffineFlats 3 n).product (binaryAffineFlats 3 n) := hp'.1 + exact ⟨(Finset.mem_product.mp hproduct).1, + (Finset.mem_product.mp hproduct).2, hp'.2⟩ + +private theorem weightSixteenClassificationPairPointSetsDisjoint + {p : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × + AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)} + (hp : p ∈ disjointBinaryAffineThreeFlatPairs n) : + Disjoint (binaryAffineFlatPoints p.1) + (binaryAffineFlatPoints p.2) := by + rw [Finset.disjoint_left] + intro x hxFirst hxSecond + have hxMeet : x ∈ p.1 ⊓ p.2 := + ⟨(mem_binaryAffineFlatPoints p.1 x).1 hxFirst, + (mem_binaryAffineFlatPoints p.2 x).1 hxSecond⟩ + rw [(weightSixteenClassificationDisjointPairData hp).2.2] at hxMeet + rw [← SetLike.mem_coe, AffineSubspace.bot_coe] at hxMeet + exact hxMeet + +private theorem firstFlatPoints_subset_support_of_mem_weightSixteenFiber + (h : BooleanFunction n) + {p : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × + AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)} + (hp : p ∈ weightSixteenRepresentationFiber h) : + binaryAffineFlatPoints p.1 ⊆ support h := by + have hpData := Finset.mem_filter.mp hp + intro x hx + have hxFirst : x ∈ p.1 := (mem_binaryAffineFlatPoints p.1 x).1 hx + have hxNotSecond : x ∉ p.2 := by + intro hxSecond + exact (Finset.disjoint_left.mp + (weightSixteenClassificationPairPointSetsDisjoint hpData.1)) hx + ((mem_binaryAffineFlatPoints p.2 x).2 hxSecond) + apply (mem_support h x).2 + rw [← hpData.2] + simp [weightSixteenRepresentationWord, binaryAffineFlatIndicator, + hxFirst, hxNotSecond] + +private theorem parallelAffineFlatPoints_disjoint + {A B : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)} + (hdirection : A.direction = B.direction) (hne : A ≠ B) : + Disjoint (binaryAffineFlatPoints A) (binaryAffineFlatPoints B) := by + rw [Finset.disjoint_left] + intro x hxA hxB + apply hne + have hxA' : x ∈ A := (mem_binaryAffineFlatPoints A x).1 hxA + have hxB' : x ∈ B := (mem_binaryAffineFlatPoints B x).1 hxB + exact (AffineSubspace.eq_iff_direction_eq_of_mem hxA' hxB').2 hdirection + +private theorem zeroDerivativeKernel_le_firstDirection_of_nonTypeA_fiber + (h : BooleanFunction n) + (hh : h ∈ orderTwoWeightSixteenDualWords n) + (hnotA : h ∉ orderTwoWeightSixteenTypeAWords n) + {p : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × + AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)} + (hp : p ∈ weightSixteenRepresentationFiber h) : + zeroDerivativeKernel h ≤ p.1.direction := by + intro r hr + by_contra hrDirection + classical + have hpFiber := Finset.mem_filter.mp hp + have hpData := weightSixteenClassificationDisjointPairData hpFiber.1 + have hAData : p.1 ≠ ⊥ ∧ + Module.finrank FABL.𝔽₂ p.1.direction = 3 := by + simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, + true_and] using hpData.1 + obtain ⟨a, ha⟩ := (AffineSubspace.nonempty_iff_ne_bot p.1).2 hAData.1 + let B := FABL.binaryAffineSubspace p.1.direction (a + r) + have hBbase : a + r ∈ B := by + change a + r ∈ FABL.binaryAffineSubspace p.1.direction (a + r) + rw [FABL.mem_binaryAffineSubspace_iff_add_mem, + ZModModule.add_self] + exact p.1.direction.zero_mem + have hBdirection : B.direction = p.1.direction := by + exact FABL.binaryAffineSubspace_direction p.1.direction (a + r) + have hBneBot : B ≠ ⊥ := by + intro hbot + have := hBbase + rw [hbot, ← SetLike.mem_coe, AffineSubspace.bot_coe] at this + exact this + have hABne : p.1 ≠ B := by + intro heq + have harA : a + r ∈ p.1 := by rw [heq]; exact hBbase + have hvsub := AffineSubspace.vsub_mem_direction harA ha + apply hrDirection + have hdifference : (a + r) -ᵥ a = r := by + simp only [vsub_eq_sub, sub_eq_add_neg, ZModModule.neg_eq_self] + calc + a + r + a = r + (a + a) := by abel + _ = r := by rw [ZModModule.add_self, add_zero] + rwa [hdifference] at hvsub + have hABdisjoint : Disjoint (binaryAffineFlatPoints p.1) + (binaryAffineFlatPoints B) := + parallelAffineFlatPoints_disjoint hBdirection.symm hABne + have hAcard : (binaryAffineFlatPoints p.1).card = 8 := by + rw [card_binaryAffineFlatPoints p.1 hAData.1, hAData.2] + norm_num + have hBcard : (binaryAffineFlatPoints B).card = 8 := by + rw [card_binaryAffineFlatPoints B hBneBot, hBdirection, hAData.2] + norm_num + have hfirstSubset : binaryAffineFlatPoints p.1 ⊆ support h := + firstFlatPoints_subset_support_of_mem_weightSixteenFiber h hp + have hsecondSubset : binaryAffineFlatPoints B ⊆ support h := by + intro x hx + have hxB : x ∈ B := (mem_binaryAffineFlatPoints B x).1 hx + have hxrA : x + r ∈ p.1 := by + have hxDirection : x + (a + r) ∈ p.1.direction := by + exact (FABL.mem_binaryAffineSubspace_iff_add_mem + p.1.direction (a + r) x).1 hxB + rw [show p.1 = FABL.binaryAffineSubspace p.1.direction a from + (AffineSubspace.mk'_eq ha).symm] + rw [FABL.mem_binaryAffineSubspace_iff_add_mem] + have harg : x + r + a = x + (a + r) := by abel + rwa [harg] + have hxrOne : h (x + r) = 1 := + (mem_support h (x + r)).1 + (hfirstSubset ((mem_binaryAffineFlatPoints p.1 (x + r)).2 hxrA)) + have hperiod := hr x + simp only [FABL.booleanDerivative] at hperiod + have hxOne : h x = 1 := by + have heq := add_eq_zero_iff_eq_neg.mp hperiod + rw [hxrOne] at heq + exact heq.trans (ZMod.neg_eq_self_mod_two 1) + exact (mem_support h x).2 hxOne + have hsupportCard : (support h).card = 16 := by + have hhData : h ∈ reedMuller (n - 3) n ∧ hammingWeight h = 16 := by + simpa only [orderTwoWeightSixteenDualWords, orderTwoDualWords, + Finset.mem_filter, Finset.mem_univ, true_and] using hh + simpa only [hammingWeight_eq_card_support] using hhData.2 + have hunionCard : + (binaryAffineFlatPoints p.1 ∪ binaryAffineFlatPoints B).card = 16 := by + rw [Finset.card_union_of_disjoint hABdisjoint, hAcard, hBcard] + have hunionSupport : + binaryAffineFlatPoints p.1 ∪ binaryAffineFlatPoints B = support h := by + apply Finset.eq_of_subset_of_card_le + · exact Finset.union_subset hfirstSubset hsecondSubset + · rw [hsupportCard, hunionCard] + let C := p.1 ⊔ B + have haC : a ∈ C := (le_sup_left : p.1 ≤ p.1 ⊔ B) ha + have hCneBot : C ≠ ⊥ := by + intro hbot + have := haC + rw [hbot, ← SetLike.mem_coe, AffineSubspace.bot_coe] at this + exact this + have hdifference : (a + r) -ᵥ a ∉ p.1.direction := by + simpa only [vsub_eq_sub, sub_eq_add_neg, ZModModule.neg_eq_self, + show a + r + a = r by + calc + a + r + a = r + (a + a) := by abel + _ = r := by rw [ZModModule.add_self, add_zero]] using hrDirection + have hCrank : Module.finrank FABL.𝔽₂ C.direction = 4 := by + dsimp only [C] + rw [AffineSubspace.direction_sup ha hBbase, + hBdirection, sup_idem, + Submodule.finrank_sup_span_singleton hdifference, hAData.2] + have hCcard : (binaryAffineFlatPoints C).card = 16 := by + rw [card_binaryAffineFlatPoints C hCneBot, hCrank] + norm_num + have hunionC : + binaryAffineFlatPoints p.1 ∪ binaryAffineFlatPoints B = + binaryAffineFlatPoints C := by + apply Finset.eq_of_subset_of_card_le + · intro x hx + rcases Finset.mem_union.mp hx with hxFirst | hxSecond + · have hle : p.1 ≤ C := by + exact le_sup_left + exact (mem_binaryAffineFlatPoints C x).2 + (hle ((mem_binaryAffineFlatPoints p.1 x).1 hxFirst)) + · have hle : B ≤ C := by + exact le_sup_right + exact (mem_binaryAffineFlatPoints C x).2 + (hle ((mem_binaryAffineFlatPoints B x).1 hxSecond)) + · rw [hCcard, hunionCard] + have hsupportC : support h = binaryAffineFlatPoints C := by + rw [← hunionSupport, hunionC] + have hsupportSet : (support h : Set (FABL.F₂Cube n)) = C := by + ext x + constructor + · intro hx + have hxFin : x ∈ support h := hx + have hxPoints : x ∈ binaryAffineFlatPoints C := by + rw [← hsupportC] + exact hxFin + exact (mem_binaryAffineFlatPoints C x).1 hxPoints + · intro hx + have hxPoints : x ∈ binaryAffineFlatPoints C := + (mem_binaryAffineFlatPoints C x).2 hx + have hxFin : x ∈ support h := by + rw [hsupportC] + exact hxPoints + exact hxFin + have hCflat : C ∈ binaryAffineFlats 4 n := by + simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, + true_and] using And.intro hCneBot hCrank + have hfunction : h = binaryAffineFlatIndicator C := by + have hflat : FABL.binaryAffineSubspace C.direction a = C := + AffineSubspace.mk'_eq haC + have haffine : h = affineFlatIndicator C.direction a := + (eq_affineFlatIndicator_iff_support_eq h C.direction a).2 (by + rw [hflat] + exact hsupportSet) + rw [binaryAffineFlatIndicator_eq_affineFlatIndicator C a haC] + exact haffine + have htypeA : h ∈ orderTwoWeightSixteenTypeAWords n := by + rw [orderTwoWeightSixteenTypeAWords, Finset.mem_image] + exact ⟨C, hCflat, hfunction.symm⟩ + exact hnotA htypeA + +private theorem zeroDerivativeKernel_le_firstDirection_of_typeB_fiber + (h : BooleanFunction n) + (hh : h ∈ orderTwoWeightSixteenTypeBWords n) + {p : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × + AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)} + (hp : p ∈ weightSixteenRepresentationFiber h) : + zeroDerivativeKernel h ≤ p.1.direction := by + apply zeroDerivativeKernel_le_firstDirection_of_nonTypeA_fiber h + (orderTwoWeightSixteenTypeBWords_subset_dualWords n hh) + · intro hA + exact (Finset.disjoint_left.mp + (disjoint_orderTwoWeightSixteenTypeAWords_typeBWords n)) hA hh + · exact hp + +/-- The quotient support of a Boolean function modulo its zero-derivative +kernel. -/ +noncomputable def zeroDerivativeSupportCosets (h : BooleanFunction n) : + Finset (FABL.F₂Cube n ⧸ zeroDerivativeKernel h) := by + classical + exact Finset.univ.filter fun q ↦ + zeroDerivativeKernelQuotientFunction h q = 1 + +/-- A type-`b` word is supported on exactly four cosets of its +two-dimensional zero-derivative kernel. -/ +theorem card_zeroDerivativeSupportCosets_of_mem_typeB + (h : BooleanFunction n) (hh : h ∈ orderTwoWeightSixteenTypeBWords n) : + (zeroDerivativeSupportCosets h).card = 4 := by + classical + let R := zeroDerivativeKernel h + let qh := zeroDerivativeKernelQuotientFunction h + have hhData := Finset.mem_filter.mp hh + have hweight : hammingWeight h = 16 := by + have hdualData : h ∈ reedMuller (n - 3) n ∧ + hammingWeight h = 16 := by + simpa only [orderTwoWeightSixteenDualWords, orderTwoDualWords, + Finset.mem_filter, Finset.mem_univ, true_and] using hhData.1 + exact hdualData.2 + have hRrank : Module.finrank FABL.𝔽₂ R = 2 := hhData.2 + have hRcard : Nat.card R = 4 := by + rw [FABL.card_submodule_eq_two_pow_finrank, hRrank] + norm_num + have hfactor := card_filter_mkQ_eq_card_mul_card_filter_weightSixteen + R (fun q ↦ qh q = 1) + have hleft : + ((Finset.univ : Finset (FABL.F₂Cube n)).filter fun x ↦ + qh (R.mkQ x) = 1).card = 16 := by + simpa only [R, qh, zeroDerivativeKernelQuotientFunction_mkQ, + support, FABL.f₂OneSupport, hammingWeight_eq_card_support] using hweight + have heq : 16 = 4 * + ((Finset.univ : Finset (FABL.F₂Cube n ⧸ R)).filter fun q ↦ + qh q = 1).card := by + calc + 16 = ((Finset.univ : Finset (FABL.F₂Cube n)).filter fun x ↦ + qh (R.mkQ x) = 1).card := hleft.symm + _ = Nat.card R * + ((Finset.univ : Finset (FABL.F₂Cube n ⧸ R)).filter fun q ↦ + qh q = 1).card := hfactor + _ = 4 * + ((Finset.univ : Finset (FABL.F₂Cube n ⧸ R)).filter fun q ↦ + qh q = 1).card := by rw [hRcard] + change ((Finset.univ : Finset (FABL.F₂Cube n ⧸ R)).filter fun q ↦ + qh q = 1).card = 4 + omega + +/-- The quotient cosets met by the first flat in a weight-sixteen +representation. -/ +noncomputable def weightSixteenRepresentationFirstCosets + (h : BooleanFunction n) + (p : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × + AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) : + Finset (FABL.F₂Cube n ⧸ zeroDerivativeKernel h) := by + classical + exact (binaryAffineFlatPoints p.1).image (zeroDerivativeKernel h).mkQ + +private theorem card_affineThreeFlatQuotientImage + (h : BooleanFunction n) + (A : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) + (hA : A ∈ binaryAffineFlats 3 n) + (hRrank : Module.finrank FABL.𝔽₂ (zeroDerivativeKernel h) = 2) + (hRle : zeroDerivativeKernel h ≤ A.direction) : + ((binaryAffineFlatPoints A).image + (zeroDerivativeKernel h).mkQ).card = 2 := by + classical + let R := zeroDerivativeKernel h + let t := (binaryAffineFlatPoints A).image R.mkQ + have hAData : A ≠ ⊥ ∧ Module.finrank FABL.𝔽₂ A.direction = 3 := by + simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, + true_and] using hA + have hAcard : (binaryAffineFlatPoints A).card = 8 := by + rw [card_binaryAffineFlatPoints A hAData.1, hAData.2] + norm_num + have hRcard : Nat.card R = 4 := by + rw [FABL.card_submodule_eq_two_pow_finrank, hRrank] + norm_num + have hfiber : ∀ q ∈ t, + ((binaryAffineFlatPoints A).filter fun x ↦ R.mkQ x = q).card = 4 := by + intro q hq + obtain ⟨x, hxA, hxq⟩ := Finset.mem_image.mp hq + have hfiberEq : + (binaryAffineFlatPoints A).filter (fun y ↦ R.mkQ y = q) = + (Finset.univ : Finset (FABL.F₂Cube n)).filter + (fun y ↦ R.mkQ y = q) := by + ext y + simp only [Finset.mem_filter, Finset.mem_univ, true_and] + constructor + · exact fun hy ↦ hy.2 + · intro hyq + have hyxQ : R.mkQ y = R.mkQ x := hyq.trans hxq.symm + have hyxR : y + x ∈ R := by + have hdifference := (Submodule.Quotient.eq R).1 hyxQ + simpa only [sub_eq_add_neg, ZModModule.neg_eq_self] using hdifference + have hxASet : x ∈ A := (mem_binaryAffineFlatPoints A x).1 hxA + have hyA : y ∈ A := by + rw [show A = FABL.binaryAffineSubspace A.direction x from + (AffineSubspace.mk'_eq hxASet).symm] + rw [FABL.mem_binaryAffineSubspace_iff_add_mem] + exact hRle hyxR + exact ⟨(mem_binaryAffineFlatPoints A y).2 hyA, hyq⟩ + rw [hfiberEq, card_submodule_mkQ_fiber_weightSixteen R q, hRcard] + have hsum := Finset.card_eq_sum_card_image R.mkQ + (binaryAffineFlatPoints A) + rw [Finset.sum_const_nat hfiber, hAcard] at hsum + change t.card = 2 + change 8 = t.card * 4 at hsum + omega + +private theorem weightSixteenRepresentationFirstCosets_mem_powersetCard + (h : BooleanFunction n) + (hh : h ∈ orderTwoWeightSixteenTypeBWords n) + {p : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × + AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)} + (hp : p ∈ weightSixteenRepresentationFiber h) : + weightSixteenRepresentationFirstCosets h p ∈ + (zeroDerivativeSupportCosets h).powersetCard 2 := by + classical + rw [Finset.mem_powersetCard] + constructor + · intro q hq + obtain ⟨x, hxFirst, rfl⟩ := Finset.mem_image.mp hq + have hxSupport := firstFlatPoints_subset_support_of_mem_weightSixteenFiber + h hp hxFirst + have hxOne : h x = 1 := (mem_support h x).1 hxSupport + simp only [zeroDerivativeSupportCosets, Finset.mem_filter, + Finset.mem_univ, true_and, + zeroDerivativeKernelQuotientFunction_mkQ] + exact hxOne + · have hpData := weightSixteenClassificationDisjointPairData + (Finset.mem_filter.mp hp).1 + have hRrank : Module.finrank FABL.𝔽₂ (zeroDerivativeKernel h) = 2 := + (Finset.mem_filter.mp hh).2 + exact card_affineThreeFlatQuotientImage h p.1 hpData.1 hRrank + (zeroDerivativeKernel_le_firstDirection_of_typeB_fiber h hh hp) + +private theorem firstFlat_eq_of_firstCosets_eq + (h : BooleanFunction n) + (hh : h ∈ orderTwoWeightSixteenTypeBWords n) + {p q : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × + AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)} + (hp : p ∈ weightSixteenRepresentationFiber h) + (hq : q ∈ weightSixteenRepresentationFiber h) + (hcosets : weightSixteenRepresentationFirstCosets h p = + weightSixteenRepresentationFirstCosets h q) : + p.1 = q.1 := by + classical + have hpData := weightSixteenClassificationDisjointPairData + (Finset.mem_filter.mp hp).1 + have hqData := weightSixteenClassificationDisjointPairData + (Finset.mem_filter.mp hq).1 + have hpRle := zeroDerivativeKernel_le_firstDirection_of_typeB_fiber + h hh hp + have hqRle := zeroDerivativeKernel_le_firstDirection_of_typeB_fiber + h hh hq + apply AffineSubspace.ext + intro x + constructor + · intro hxp + have hxCoset : (zeroDerivativeKernel h).mkQ x ∈ + weightSixteenRepresentationFirstCosets h p := by + apply Finset.mem_image.mpr + exact ⟨x, (mem_binaryAffineFlatPoints p.1 x).2 hxp, rfl⟩ + rw [hcosets] at hxCoset + obtain ⟨y, hyq, hyx⟩ := Finset.mem_image.mp hxCoset + have hyqSet : y ∈ q.1 := (mem_binaryAffineFlatPoints q.1 y).1 hyq + have hxyKernel : x + y ∈ zeroDerivativeKernel h := by + have hdifference := (Submodule.Quotient.eq + (zeroDerivativeKernel h)).1 hyx.symm + simpa only [sub_eq_add_neg, ZModModule.neg_eq_self] using hdifference + rw [show q.1 = FABL.binaryAffineSubspace q.1.direction y from + (AffineSubspace.mk'_eq hyqSet).symm] + rw [FABL.mem_binaryAffineSubspace_iff_add_mem] + exact hqRle hxyKernel + · intro hxq + have hxCoset : (zeroDerivativeKernel h).mkQ x ∈ + weightSixteenRepresentationFirstCosets h q := by + apply Finset.mem_image.mpr + exact ⟨x, (mem_binaryAffineFlatPoints q.1 x).2 hxq, rfl⟩ + rw [← hcosets] at hxCoset + obtain ⟨y, hyp, hyx⟩ := Finset.mem_image.mp hxCoset + have hypSet : y ∈ p.1 := (mem_binaryAffineFlatPoints p.1 y).1 hyp + have hxyKernel : x + y ∈ zeroDerivativeKernel h := by + have hdifference := (Submodule.Quotient.eq + (zeroDerivativeKernel h)).1 hyx.symm + simpa only [sub_eq_add_neg, ZModModule.neg_eq_self] using hdifference + rw [show p.1 = FABL.binaryAffineSubspace p.1.direction y from + (AffineSubspace.mk'_eq hypSet).symm] + rw [FABL.mem_binaryAffineSubspace_iff_add_mem] + exact hpRle hxyKernel + +private theorem weightSixteenRepresentationFirstCosets_injective_on_typeB_fiber + (h : BooleanFunction n) + (hh : h ∈ orderTwoWeightSixteenTypeBWords n) : + Set.InjOn (weightSixteenRepresentationFirstCosets h) + (weightSixteenRepresentationFiber h : Set + (AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × + AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n))) := by + intro p hp q hq hcosets + have hpFin : p ∈ weightSixteenRepresentationFiber h := hp + have hqFin : q ∈ weightSixteenRepresentationFiber h := hq + have hfirst := firstFlat_eq_of_firstCosets_eq h hh hpFin hqFin hcosets + have hpWord := (Finset.mem_filter.mp hpFin).2 + have hqWord := (Finset.mem_filter.mp hqFin).2 + have hsums : binaryAffineFlatIndicator p.1 + + binaryAffineFlatIndicator p.2 = + binaryAffineFlatIndicator q.1 + binaryAffineFlatIndicator q.2 := by + exact hpWord.trans hqWord.symm + rw [hfirst] at hsums + have hsecondIndicator : binaryAffineFlatIndicator p.2 = + binaryAffineFlatIndicator q.2 := add_left_cancel hsums + have hpSecond := (weightSixteenClassificationDisjointPairData + (Finset.mem_filter.mp hpFin).1).2.1 + have hqSecond := (weightSixteenClassificationDisjointPairData + (Finset.mem_filter.mp hqFin).1).2.1 + have hpSecondNe : p.2 ≠ ⊥ := by + have hpSecondData : p.2 ≠ ⊥ ∧ + Module.finrank FABL.𝔽₂ p.2.direction = 3 := by + simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, + true_and] using hpSecond + exact hpSecondData.1 + have hqSecondNe : q.2 ≠ ⊥ := by + have hqSecondData : q.2 ≠ ⊥ ∧ + Module.finrank FABL.𝔽₂ q.2.direction = 3 := by + simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, + true_and] using hqSecond + exact hqSecondData.1 + have hsecond : p.2 = q.2 := + binaryAffineFlatIndicator_injective_on_nonempty + hpSecondNe hqSecondNe hsecondIndicator + exact Prod.ext hfirst hsecond + +private theorem card_weightSixteenRepresentationFiber_typeB_le_six + (h : BooleanFunction n) (hh : h ∈ orderTwoWeightSixteenTypeBWords n) : + (weightSixteenRepresentationFiber h).card ≤ 6 := by + classical + calc + (weightSixteenRepresentationFiber h).card ≤ + ((zeroDerivativeSupportCosets h).powersetCard 2).card := by + apply Finset.card_le_card_of_injOn + (weightSixteenRepresentationFirstCosets h) + · intro p hp + exact weightSixteenRepresentationFirstCosets_mem_powersetCard + h hh hp + · exact weightSixteenRepresentationFirstCosets_injective_on_typeB_fiber + h hh + _ = 6 := by + rw [Finset.card_powersetCard, + card_zeroDerivativeSupportCosets_of_mem_typeB h hh] + norm_num [Nat.choose] + +private def twoCosetAffineThreeFlat + (R : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) + (x y : FABL.F₂Cube n) : + AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) := + FABL.binaryAffineSubspace R x ⊔ FABL.binaryAffineSubspace R y + +private theorem twoCosetAffineThreeFlat_mem_flats + (R : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) + (x y : FABL.F₂Cube n) + (hRrank : Module.finrank FABL.𝔽₂ R = 2) + (hxy : R.mkQ x ≠ R.mkQ y) : + twoCosetAffineThreeFlat R x y ∈ binaryAffineFlats 3 n := by + let A := FABL.binaryAffineSubspace R x + let B := FABL.binaryAffineSubspace R y + have hxA : x ∈ A := by + change x ∈ FABL.binaryAffineSubspace R x + rw [FABL.mem_binaryAffineSubspace_iff_add_mem, + ZModModule.add_self] + exact R.zero_mem + have hyB : y ∈ B := by + change y ∈ FABL.binaryAffineSubspace R y + rw [FABL.mem_binaryAffineSubspace_iff_add_mem, + ZModModule.add_self] + exact R.zero_mem + have hdifference : y -ᵥ x ∉ R := by + intro hyx + apply hxy + apply (Submodule.Quotient.eq R).2 + simpa only [vsub_eq_sub, sub_eq_add_neg, ZModModule.neg_eq_self, + add_comm] using hyx + have hneBot : twoCosetAffineThreeFlat R x y ≠ ⊥ := by + intro hbot + have hxBot : x ∈ (⊥ : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) := by + rw [← hbot] + exact (le_sup_left : A ≤ A ⊔ B) hxA + rw [← SetLike.mem_coe, AffineSubspace.bot_coe] at hxBot + exact hxBot + have hrank : Module.finrank FABL.𝔽₂ + (twoCosetAffineThreeFlat R x y).direction = 3 := by + rw [twoCosetAffineThreeFlat, + AffineSubspace.direction_sup hxA hyB, + FABL.binaryAffineSubspace_direction, + FABL.binaryAffineSubspace_direction, sup_idem, + Submodule.finrank_sup_span_singleton hdifference, hRrank] + simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, + true_and] using And.intro hneBot hrank + +private theorem points_twoCosetAffineThreeFlat + (R : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) + (x y : FABL.F₂Cube n) + (hRrank : Module.finrank FABL.𝔽₂ R = 2) + (hxy : R.mkQ x ≠ R.mkQ y) : + binaryAffineFlatPoints (twoCosetAffineThreeFlat R x y) = + binaryAffineFlatPoints (FABL.binaryAffineSubspace R x) ∪ + binaryAffineFlatPoints (FABL.binaryAffineSubspace R y) := by + let A := FABL.binaryAffineSubspace R x + let B := FABL.binaryAffineSubspace R y + let C := twoCosetAffineThreeFlat R x y + have hAne : A ≠ ⊥ := by + intro hbot + have hx : x ∈ A := by + change x ∈ FABL.binaryAffineSubspace R x + rw [FABL.mem_binaryAffineSubspace_iff_add_mem, + ZModModule.add_self] + exact R.zero_mem + rw [hbot, ← SetLike.mem_coe, AffineSubspace.bot_coe] at hx + exact hx + have hBne : B ≠ ⊥ := by + intro hbot + have hy : y ∈ B := by + change y ∈ FABL.binaryAffineSubspace R y + rw [FABL.mem_binaryAffineSubspace_iff_add_mem, + ZModModule.add_self] + exact R.zero_mem + rw [hbot, ← SetLike.mem_coe, AffineSubspace.bot_coe] at hy + exact hy + have hABne : A ≠ B := by + intro heq + apply hxy + apply (Submodule.Quotient.eq R).2 + have hyA : y ∈ A := by + rw [heq] + change y ∈ FABL.binaryAffineSubspace R y + rw [FABL.mem_binaryAffineSubspace_iff_add_mem, + ZModModule.add_self] + exact R.zero_mem + have hyx := (FABL.mem_binaryAffineSubspace_iff_add_mem R x y).1 hyA + simpa only [sub_eq_add_neg, ZModModule.neg_eq_self, add_comm] using hyx + have hdisjoint : Disjoint (binaryAffineFlatPoints A) + (binaryAffineFlatPoints B) := + parallelAffineFlatPoints_disjoint (by + simp only [A, B, FABL.binaryAffineSubspace_direction]) hABne + have hCflat := twoCosetAffineThreeFlat_mem_flats R x y hRrank hxy + have hAdirection : A.direction = R := by + exact FABL.binaryAffineSubspace_direction R x + have hBdirection : B.direction = R := by + exact FABL.binaryAffineSubspace_direction R y + have hCData : C ≠ ⊥ ∧ Module.finrank FABL.𝔽₂ C.direction = 3 := by + simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, + true_and, C] using hCflat + symm + apply Finset.eq_of_subset_of_card_le + · intro z hz + rcases Finset.mem_union.mp hz with hzA | hzB + · exact (mem_binaryAffineFlatPoints C z).2 + ((le_sup_left : A ≤ A ⊔ B) + ((mem_binaryAffineFlatPoints A z).1 hzA)) + · exact (mem_binaryAffineFlatPoints C z).2 + ((le_sup_right : B ≤ A ⊔ B) + ((mem_binaryAffineFlatPoints B z).1 hzB)) + · rw [card_binaryAffineFlatPoints C hCData.1, hCData.2, + Finset.card_union_of_disjoint hdisjoint, + card_binaryAffineFlatPoints A hAne, + card_binaryAffineFlatPoints B hBne, + hAdirection, hBdirection, hRrank] + norm_num + +private theorem indicator_twoCosetAffineThreeFlat + (R : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) + (x y : FABL.F₂Cube n) + (hRrank : Module.finrank FABL.𝔽₂ R = 2) + (hxy : R.mkQ x ≠ R.mkQ y) : + binaryAffineFlatIndicator (twoCosetAffineThreeFlat R x y) = + binaryAffineFlatIndicator (FABL.binaryAffineSubspace R x) + + binaryAffineFlatIndicator (FABL.binaryAffineSubspace R y) := by + have hpoints := points_twoCosetAffineThreeFlat R x y hRrank hxy + have hdisjoint : Disjoint + (binaryAffineFlatPoints (FABL.binaryAffineSubspace R x)) + (binaryAffineFlatPoints (FABL.binaryAffineSubspace R y)) := by + rw [Finset.disjoint_left] + intro z hzx hzy + apply hxy + have hzx' : R.mkQ z = R.mkQ x := + (mem_binaryAffineSubspace_iff_mkQ_eq R x z).1 + ((mem_binaryAffineFlatPoints _ z).1 hzx) + have hzy' : R.mkQ z = R.mkQ y := + (mem_binaryAffineSubspace_iff_mkQ_eq R y z).1 + ((mem_binaryAffineFlatPoints _ z).1 hzy) + exact hzx'.symm.trans hzy' + exact binaryAffineFlatIndicator_eq_add_of_points_eq_union + (FABL.binaryAffineSubspace R x) (FABL.binaryAffineSubspace R y) + (twoCosetAffineThreeFlat R x y) hpoints hdisjoint + +private theorem mem_twoCosetAffineThreeFlat_iff + (R : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) + (x y z : FABL.F₂Cube n) + (hRrank : Module.finrank FABL.𝔽₂ R = 2) + (hxy : R.mkQ x ≠ R.mkQ y) : + z ∈ twoCosetAffineThreeFlat R x y ↔ + R.mkQ z = R.mkQ x ∨ R.mkQ z = R.mkQ y := by + have hpoints := Finset.ext_iff.mp + (points_twoCosetAffineThreeFlat R x y hRrank hxy) z + simpa only [mem_binaryAffineFlatPoints, Finset.mem_union, + mem_binaryAffineSubspace_iff_mkQ_eq] using hpoints + +private theorem image_mkQ_points_twoCosetAffineThreeFlat + (R : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) + (x y : FABL.F₂Cube n) + (hRrank : Module.finrank FABL.𝔽₂ R = 2) + (hxy : R.mkQ x ≠ R.mkQ y) : + (binaryAffineFlatPoints (twoCosetAffineThreeFlat R x y)).image R.mkQ = + {R.mkQ x, R.mkQ y} := by + ext q + constructor + · intro hq + obtain ⟨z, hz, rfl⟩ := Finset.mem_image.mp hq + have hzFlat := (mem_binaryAffineFlatPoints _ z).1 hz + simpa only [Finset.mem_insert, Finset.mem_singleton] using + (mem_twoCosetAffineThreeFlat_iff R x y z hRrank hxy).1 hzFlat + · intro hq + simp only [Finset.mem_insert, Finset.mem_singleton] at hq + rcases hq with rfl | rfl + · apply Finset.mem_image.mpr + refine ⟨x, (mem_binaryAffineFlatPoints _ x).2 ?_, rfl⟩ + exact (mem_twoCosetAffineThreeFlat_iff R x y x hRrank hxy).2 + (Or.inl rfl) + · apply Finset.mem_image.mpr + refine ⟨y, (mem_binaryAffineFlatPoints _ y).2 ?_, rfl⟩ + exact (mem_twoCosetAffineThreeFlat_iff R x y y hRrank hxy).2 + (Or.inr rfl) + +private theorem weightSixteenRepresentationFirstCosets_surjOn_typeB_fiber + (h : BooleanFunction n) + (hh : h ∈ orderTwoWeightSixteenTypeBWords n) : + Set.SurjOn (weightSixteenRepresentationFirstCosets h) + (weightSixteenRepresentationFiber h : Set + (AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × + AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n))) + ((zeroDerivativeSupportCosets h).powersetCard 2 : Set + (Finset (FABL.F₂Cube n ⧸ zeroDerivativeKernel h))) := by + classical + intro t ht + have htFin : t ∈ (zeroDerivativeSupportCosets h).powersetCard 2 := ht + have htData := Finset.mem_powersetCard.mp htFin + let R := zeroDerivativeKernel h + let qs := zeroDerivativeSupportCosets h + let u := qs \ t + have hqscard : qs.card = 4 := + card_zeroDerivativeSupportCosets_of_mem_typeB h hh + have hucard : u.card = 2 := by + dsimp only [u] + rw [Finset.card_sdiff_of_subset htData.1, hqscard, htData.2] + obtain ⟨q₀, q₁, hq01, htEq⟩ := Finset.card_eq_two.mp htData.2 + obtain ⟨q₂, q₃, hq23, huEq⟩ := Finset.card_eq_two.mp hucard + have hq0t : q₀ ∈ t := by simp [htEq] + have hq1t : q₁ ∈ t := by simp [htEq] + have hq2u : q₂ ∈ u := by simp [huEq] + have hq3u : q₃ ∈ u := by simp [huEq] + have hq2notT : q₂ ∉ t := (Finset.mem_sdiff.mp hq2u).2 + have hq3notT : q₃ ∉ t := (Finset.mem_sdiff.mp hq3u).2 + have hq02 : q₀ ≠ q₂ := by + intro heq + exact hq2notT (heq ▸ hq0t) + have hq03 : q₀ ≠ q₃ := by + intro heq + exact hq3notT (heq ▸ hq0t) + have hq12 : q₁ ≠ q₂ := by + intro heq + exact hq2notT (heq ▸ hq1t) + have hq13 : q₁ ≠ q₃ := by + intro heq + exact hq3notT (heq ▸ hq1t) + let x₀ : FABL.F₂Cube n := Quotient.out q₀ + let x₁ : FABL.F₂Cube n := Quotient.out q₁ + let x₂ : FABL.F₂Cube n := Quotient.out q₂ + let x₃ : FABL.F₂Cube n := Quotient.out q₃ + have hx₀ : R.mkQ x₀ = q₀ := Submodule.Quotient.mk_out q₀ + have hx₁ : R.mkQ x₁ = q₁ := Submodule.Quotient.mk_out q₁ + have hx₂ : R.mkQ x₂ = q₂ := Submodule.Quotient.mk_out q₂ + have hx₃ : R.mkQ x₃ = q₃ := Submodule.Quotient.mk_out q₃ + have h01 : R.mkQ x₀ ≠ R.mkQ x₁ := by + intro heq + exact hq01 (hx₀.symm.trans (heq.trans hx₁)) + have h23 : R.mkQ x₂ ≠ R.mkQ x₃ := by + intro heq + exact hq23 (hx₂.symm.trans (heq.trans hx₃)) + have h02 : R.mkQ x₀ ≠ R.mkQ x₂ := by + intro heq + exact hq02 (hx₀.symm.trans (heq.trans hx₂)) + have h03 : R.mkQ x₀ ≠ R.mkQ x₃ := by + intro heq + exact hq03 (hx₀.symm.trans (heq.trans hx₃)) + have h12 : R.mkQ x₁ ≠ R.mkQ x₂ := by + intro heq + exact hq12 (hx₁.symm.trans (heq.trans hx₂)) + have h13 : R.mkQ x₁ ≠ R.mkQ x₃ := by + intro heq + exact hq13 (hx₁.symm.trans (heq.trans hx₃)) + have hRrank : Module.finrank FABL.𝔽₂ R = 2 := + (Finset.mem_filter.mp hh).2 + let A := twoCosetAffineThreeFlat R x₀ x₁ + let B := twoCosetAffineThreeFlat R x₂ x₃ + have hAflat : A ∈ binaryAffineFlats 3 n := + twoCosetAffineThreeFlat_mem_flats R x₀ x₁ hRrank h01 + have hBflat : B ∈ binaryAffineFlats 3 n := + twoCosetAffineThreeFlat_mem_flats R x₂ x₃ hRrank h23 + have hpointsDisjoint : Disjoint (binaryAffineFlatPoints A) + (binaryAffineFlatPoints B) := by + rw [Finset.disjoint_left] + intro z hzA hzB + have hzAData := (mem_twoCosetAffineThreeFlat_iff + R x₀ x₁ z hRrank h01).1 + ((mem_binaryAffineFlatPoints A z).1 hzA) + have hzBData := (mem_twoCosetAffineThreeFlat_iff + R x₂ x₃ z hRrank h23).1 + ((mem_binaryAffineFlatPoints B z).1 hzB) + rcases hzAData with hz0 | hz1 <;> + rcases hzBData with hz2 | hz3 + · exact h02 (hz0.symm.trans hz2) + · exact h03 (hz0.symm.trans hz3) + · exact h12 (hz1.symm.trans hz2) + · exact h13 (hz1.symm.trans hz3) + have hinf : A ⊓ B = ⊥ := by + by_contra hne + obtain ⟨z, hz⟩ := (AffineSubspace.nonempty_iff_ne_bot (A ⊓ B)).2 hne + exact (Finset.disjoint_left.mp hpointsDisjoint) + ((mem_binaryAffineFlatPoints A z).2 hz.1) + ((mem_binaryAffineFlatPoints B z).2 hz.2) + have hpair : (A, B) ∈ disjointBinaryAffineThreeFlatPairs n := by + simp only [disjointBinaryAffineThreeFlatPairs, Finset.mem_filter] + constructor + · change (A, B) ∈ (binaryAffineFlats 3 n).product + (binaryAffineFlats 3 n) + exact Finset.mem_product.mpr ⟨hAflat, hBflat⟩ + · exact hinf + have hpartition : t ∪ u = qs := by + exact Finset.union_sdiff_of_subset htData.1 + have hword : weightSixteenRepresentationWord A B = h := by + funext z + have hzA : z ∈ A ↔ R.mkQ z ∈ t := by + rw [mem_twoCosetAffineThreeFlat_iff R x₀ x₁ z hRrank h01, + htEq, hx₀, hx₁] + simp + have hzB : z ∈ B ↔ R.mkQ z ∈ u := by + rw [mem_twoCosetAffineThreeFlat_iff R x₂ x₃ z hRrank h23, + huEq, hx₂, hx₃] + simp + have hzSupport : h z = 1 ↔ z ∈ A ∨ z ∈ B := by + calc + h z = 1 ↔ R.mkQ z ∈ qs := by + dsimp only [qs, R, zeroDerivativeSupportCosets] + simp only [Finset.mem_filter, Finset.mem_univ, true_and, + zeroDerivativeKernelQuotientFunction_mkQ] + _ ↔ R.mkQ z ∈ t ∪ u := by rw [hpartition] + _ ↔ R.mkQ z ∈ t ∨ R.mkQ z ∈ u := Finset.mem_union + _ ↔ z ∈ A ∨ z ∈ B := or_congr hzA.symm hzB.symm + have hzNotBoth : ¬(z ∈ A ∧ z ∈ B) := by + intro hz + exact (Finset.disjoint_left.mp hpointsDisjoint) + ((mem_binaryAffineFlatPoints A z).2 hz.1) + ((mem_binaryAffineFlatPoints B z).2 hz.2) + simp only [weightSixteenRepresentationWord, Pi.add_apply, + binaryAffineFlatIndicator] + by_cases hza : z ∈ A <;> by_cases hzb : z ∈ B + · exact (hzNotBoth ⟨hza, hzb⟩).elim + · have hzOne : h z = 1 := hzSupport.2 (Or.inl hza) + simp [hza, hzb, hzOne] + · have hzOne : h z = 1 := hzSupport.2 (Or.inr hzb) + simp [hza, hzb, hzOne] + · have hzNotOne : h z ≠ 1 := by + intro hzOne + exact (hzSupport.1 hzOne).elim hza hzb + have hzZero : h z = 0 := by + by_contra hzNeZero + exact hzNotOne (Fin.eq_one_of_ne_zero _ hzNeZero) + simp [hza, hzb, hzZero] + have hpFiber : (A, B) ∈ weightSixteenRepresentationFiber h := by + simp only [weightSixteenRepresentationFiber, Finset.mem_filter] + exact ⟨hpair, hword⟩ + refine ⟨(A, B), hpFiber, ?_⟩ + change (binaryAffineFlatPoints A).image R.mkQ = t + dsimp only [A] + rw [image_mkQ_points_twoCosetAffineThreeFlat + R x₀ x₁ hRrank h01, hx₀, hx₁, htEq] + +/-- A type-`b` word has exactly six ordered disjoint-three-flat +representations. -/ +theorem card_weightSixteenRepresentationFiber_of_mem_typeBWords + (h : BooleanFunction n) (hh : h ∈ orderTwoWeightSixteenTypeBWords n) : + (weightSixteenRepresentationFiber h).card = 6 := by + have hlower := Finset.card_le_card_of_surjOn + (weightSixteenRepresentationFirstCosets h) + (weightSixteenRepresentationFirstCosets_surjOn_typeB_fiber h hh) + have hpowerset : ((zeroDerivativeSupportCosets h).powersetCard 2).card = 6 := by + rw [Finset.card_powersetCard, + card_zeroDerivativeSupportCosets_of_mem_typeB h hh] + norm_num [Nat.choose] + rw [hpowerset] at hlower + exact Nat.le_antisymm + (card_weightSixteenRepresentationFiber_typeB_le_six h hh) hlower + +private theorem support_weightSixteenRepresentationWord_eq_union + {p : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × + AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)} + (hp : p ∈ disjointBinaryAffineThreeFlatPairs n) : + support (weightSixteenRepresentationWord p.1 p.2) = + binaryAffineFlatPoints p.1 ∪ binaryAffineFlatPoints p.2 := by + classical + have hdisjoint := weightSixteenClassificationPairPointSetsDisjoint hp + ext x + have hnotBoth : ¬(x ∈ p.1 ∧ x ∈ p.2) := by + intro hboth + exact (Finset.disjoint_left.mp hdisjoint) + ((mem_binaryAffineFlatPoints p.1 x).2 hboth.1) + ((mem_binaryAffineFlatPoints p.2 x).2 hboth.2) + simp only [support, FABL.f₂OneSupport, Finset.mem_filter, + Finset.mem_univ, true_and, weightSixteenRepresentationWord, + Pi.add_apply, binaryAffineFlatIndicator, Finset.mem_union, + mem_binaryAffineFlatPoints] + by_cases hxFirst : x ∈ p.1 <;> by_cases hxSecond : x ∈ p.2 + · exact (hnotBoth ⟨hxFirst, hxSecond⟩).elim + · simp [hxFirst, hxSecond] + · simp [hxFirst, hxSecond] + · simp [hxFirst, hxSecond] + +private theorem support_eq_union_of_mem_weightSixteenFiber + (h : BooleanFunction n) + {p : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × + AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)} + (hp : p ∈ weightSixteenRepresentationFiber h) : + support h = + binaryAffineFlatPoints p.1 ∪ binaryAffineFlatPoints p.2 := by + have hpData := Finset.mem_filter.mp hp + rw [← hpData.2] + exact support_weightSixteenRepresentationWord_eq_union hpData.1 + +private theorem swap_mem_weightSixteenRepresentationFiber + (h : BooleanFunction n) + {p : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × + AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)} + (hp : p ∈ weightSixteenRepresentationFiber h) : + (p.2, p.1) ∈ weightSixteenRepresentationFiber h := by + classical + have hpData := Finset.mem_filter.mp hp + apply Finset.mem_filter.mpr + constructor + · have hpPair : p ∈ binaryAffineThreeFlatPairs n ∧ p.1 ⊓ p.2 = ⊥ := by + simpa only [disjointBinaryAffineThreeFlatPairs, + Finset.mem_filter] using hpData.1 + have hproduct := Finset.mem_product.mp hpPair.1 + rw [disjointBinaryAffineThreeFlatPairs, Finset.mem_filter] + exact ⟨Finset.mem_product.mpr ⟨hproduct.2, hproduct.1⟩, + by rw [inf_comm, hpPair.2]⟩ + · simpa only [weightSixteenRepresentationWord, add_comm] using hpData.2 + +private theorem first_ne_second_of_mem_weightSixteenFiber + (h : BooleanFunction n) + {p : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × + AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)} + (hp : p ∈ weightSixteenRepresentationFiber h) : + p.1 ≠ p.2 := by + intro heq + have hpData := Finset.mem_filter.mp hp + have hmeet := (weightSixteenClassificationDisjointPairData hpData.1).2.2 + rw [heq, inf_idem] at hmeet + have hsecondData := + (weightSixteenClassificationDisjointPairData hpData.1).2.1 + have hnonbot : p.2 ≠ ⊥ := by + have hsecondData' : p.2 ≠ ⊥ ∧ + Module.finrank FABL.𝔽₂ p.2.direction = 3 := by + simpa only [binaryAffineFlats, Finset.mem_filter, + Finset.mem_univ, true_and] using hsecondData + exact hsecondData'.1 + exact hnonbot hmeet + +private theorem affineThreeFlat_eq_of_points_subset + {A B : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)} + (hA : A ∈ binaryAffineFlats 3 n) + (hB : B ∈ binaryAffineFlats 3 n) + (hsubset : binaryAffineFlatPoints A ⊆ binaryAffineFlatPoints B) : + A = B := by + have hAData : A ≠ ⊥ ∧ Module.finrank FABL.𝔽₂ A.direction = 3 := by + simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, + true_and] using hA + have hBData : B ≠ ⊥ ∧ Module.finrank FABL.𝔽₂ B.direction = 3 := by + simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, + true_and] using hB + have hpoints : binaryAffineFlatPoints A = binaryAffineFlatPoints B := by + apply Finset.eq_of_subset_of_card_le hsubset + rw [card_binaryAffineFlatPoints A hAData.1, + card_binaryAffineFlatPoints B hBData.1, + hAData.2, hBData.2] + ext x + have hx := Finset.ext_iff.mp hpoints x + simpa only [mem_binaryAffineFlatPoints] using hx + +private theorem weightSixteenFiber_pair_eq_of_first_eq + (h : BooleanFunction n) + {p q : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × + AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)} + (hp : p ∈ weightSixteenRepresentationFiber h) + (hq : q ∈ weightSixteenRepresentationFiber h) + (hfirst : p.1 = q.1) : + p = q := by + have hpData := Finset.mem_filter.mp hp + have hqData := Finset.mem_filter.mp hq + have hpPair := weightSixteenClassificationDisjointPairData hpData.1 + have hqPair := weightSixteenClassificationDisjointPairData hqData.1 + have hunion : binaryAffineFlatPoints p.1 ∪ binaryAffineFlatPoints p.2 = + binaryAffineFlatPoints q.1 ∪ binaryAffineFlatPoints q.2 := by + rw [← support_eq_union_of_mem_weightSixteenFiber h hp, + ← support_eq_union_of_mem_weightSixteenFiber h hq] + have hsecondSubset : binaryAffineFlatPoints p.2 ⊆ + binaryAffineFlatPoints q.2 := by + intro x hxSecond + have hxUnion : x ∈ binaryAffineFlatPoints q.1 ∪ + binaryAffineFlatPoints q.2 := by + rw [← hunion] + exact Finset.mem_union_right _ hxSecond + rcases Finset.mem_union.mp hxUnion with hxFirst | hxSecond' + · have hxPFirst : x ∈ binaryAffineFlatPoints p.1 := by + rw [hfirst] + exact hxFirst + exact (Finset.disjoint_left.mp + (weightSixteenClassificationPairPointSetsDisjoint hpData.1)) + hxPFirst hxSecond |>.elim + · exact hxSecond' + apply Prod.ext hfirst + exact affineThreeFlat_eq_of_points_subset hpPair.2.1 hqPair.2.1 + hsecondSubset + +private theorem weightSixteenFiber_pair_eq_of_second_eq + (h : BooleanFunction n) + {p q : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × + AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)} + (hp : p ∈ weightSixteenRepresentationFiber h) + (hq : q ∈ weightSixteenRepresentationFiber h) + (hsecond : p.2 = q.2) : + p = q := by + have hpSwap := swap_mem_weightSixteenRepresentationFiber h hp + have hqSwap := swap_mem_weightSixteenRepresentationFiber h hq + have hswap := weightSixteenFiber_pair_eq_of_first_eq h hpSwap hqSwap hsecond + apply Prod.ext + · exact congrArg Prod.snd hswap + · exact congrArg Prod.fst hswap + +private theorem binaryAffineFlatPoints_inf_eq_inter + (A B : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) : + binaryAffineFlatPoints (A ⊓ B) = + binaryAffineFlatPoints A ∩ binaryAffineFlatPoints B := by + ext x + simp only [mem_binaryAffineFlatPoints, Finset.mem_inter, + AffineSubspace.mem_inf_iff] + +private theorem card_firstFlat_inter_firstFlat_eq_four_of_cross + (h : BooleanFunction n) + {p q : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × + AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)} + (hp : p ∈ weightSixteenRepresentationFiber h) + (hq : q ∈ weightSixteenRepresentationFiber h) + (hqFirstNeSecond : q.1 ≠ p.2) + (hqSecondNeSecond : q.2 ≠ p.2) : + (binaryAffineFlatPoints p.1 ∩ + binaryAffineFlatPoints q.1).card = 4 := by + classical + have hpData := Finset.mem_filter.mp hp + have hqData := Finset.mem_filter.mp hq + have hpPair := weightSixteenClassificationDisjointPairData hpData.1 + have hqPair := weightSixteenClassificationDisjointPairData hqData.1 + have hpFirstData : p.1 ≠ ⊥ ∧ + Module.finrank FABL.𝔽₂ p.1.direction = 3 := by + simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, + true_and] using hpPair.1 + have hunion : binaryAffineFlatPoints p.1 ∪ binaryAffineFlatPoints p.2 = + binaryAffineFlatPoints q.1 ∪ binaryAffineFlatPoints q.2 := by + rw [← support_eq_union_of_mem_weightSixteenFiber h hp, + ← support_eq_union_of_mem_weightSixteenFiber h hq] + have hfirstInterNonempty : + (binaryAffineFlatPoints p.1 ∩ + binaryAffineFlatPoints q.1).Nonempty := by + by_contra hnot + have hempty : binaryAffineFlatPoints p.1 ∩ + binaryAffineFlatPoints q.1 = ∅ := + Finset.not_nonempty_iff_eq_empty.mp hnot + have hsubset : binaryAffineFlatPoints q.1 ⊆ + binaryAffineFlatPoints p.2 := by + intro x hxq + have hxUnion : x ∈ binaryAffineFlatPoints p.1 ∪ + binaryAffineFlatPoints p.2 := by + rw [hunion] + exact Finset.mem_union_left _ hxq + rcases Finset.mem_union.mp hxUnion with hxp | hxp + · have hxInter : x ∈ binaryAffineFlatPoints p.1 ∩ + binaryAffineFlatPoints q.1 := Finset.mem_inter.mpr ⟨hxp, hxq⟩ + rw [hempty] at hxInter + exact (Finset.notMem_empty x hxInter).elim + · exact hxp + exact hqFirstNeSecond + (affineThreeFlat_eq_of_points_subset hqPair.1 hpPair.2.1 hsubset) + have hsecondInterNonempty : + (binaryAffineFlatPoints p.1 ∩ + binaryAffineFlatPoints q.2).Nonempty := by + by_contra hnot + have hempty : binaryAffineFlatPoints p.1 ∩ + binaryAffineFlatPoints q.2 = ∅ := + Finset.not_nonempty_iff_eq_empty.mp hnot + have hsubset : binaryAffineFlatPoints q.2 ⊆ + binaryAffineFlatPoints p.2 := by + intro x hxq + have hxUnion : x ∈ binaryAffineFlatPoints p.1 ∪ + binaryAffineFlatPoints p.2 := by + rw [hunion] + exact Finset.mem_union_right _ hxq + rcases Finset.mem_union.mp hxUnion with hxp | hxp + · have hxInter : x ∈ binaryAffineFlatPoints p.1 ∩ + binaryAffineFlatPoints q.2 := Finset.mem_inter.mpr ⟨hxp, hxq⟩ + rw [hempty] at hxInter + exact (Finset.notMem_empty x hxInter).elim + · exact hxp + exact hqSecondNeSecond + (affineThreeFlat_eq_of_points_subset hqPair.2.1 hpPair.2.1 hsubset) + have hpartition : binaryAffineFlatPoints p.1 = + (binaryAffineFlatPoints p.1 ∩ binaryAffineFlatPoints q.1) ∪ + (binaryAffineFlatPoints p.1 ∩ binaryAffineFlatPoints q.2) := by + ext x + constructor + · intro hxp + have hxUnion : x ∈ binaryAffineFlatPoints q.1 ∪ + binaryAffineFlatPoints q.2 := by + rw [← hunion] + exact Finset.mem_union_left _ hxp + rcases Finset.mem_union.mp hxUnion with hxq | hxq + · exact Finset.mem_union_left _ (Finset.mem_inter.mpr ⟨hxp, hxq⟩) + · exact Finset.mem_union_right _ (Finset.mem_inter.mpr ⟨hxp, hxq⟩) + · intro hx + rcases Finset.mem_union.mp hx with hx | hx + · exact (Finset.mem_inter.mp hx).1 + · exact (Finset.mem_inter.mp hx).1 + have hinterDisjoint : Disjoint + (binaryAffineFlatPoints p.1 ∩ binaryAffineFlatPoints q.1) + (binaryAffineFlatPoints p.1 ∩ binaryAffineFlatPoints q.2) := by + rw [Finset.disjoint_left] + intro x hxFirst hxSecond + exact (Finset.disjoint_left.mp + (weightSixteenClassificationPairPointSetsDisjoint hqData.1)) + (Finset.mem_inter.mp hxFirst).2 + (Finset.mem_inter.mp hxSecond).2 + have hsum : + (binaryAffineFlatPoints p.1 ∩ binaryAffineFlatPoints q.1).card + + (binaryAffineFlatPoints p.1 ∩ binaryAffineFlatPoints q.2).card = 8 := by + calc + _ = ((binaryAffineFlatPoints p.1 ∩ binaryAffineFlatPoints q.1) ∪ + (binaryAffineFlatPoints p.1 ∩ binaryAffineFlatPoints q.2)).card := + (Finset.card_union_of_disjoint hinterDisjoint).symm + _ = (binaryAffineFlatPoints p.1).card := by rw [← hpartition] + _ = 8 := by + rw [card_binaryAffineFlatPoints p.1 hpFirstData.1, + hpFirstData.2] + norm_num + have hfirstInfNe : p.1 ⊓ q.1 ≠ ⊥ := by + obtain ⟨x, hx⟩ := hfirstInterNonempty + intro hbot + have hxInf : x ∈ p.1 ⊓ q.1 := + (AffineSubspace.mem_inf_iff x p.1 q.1).2 + ⟨(mem_binaryAffineFlatPoints p.1 x).1 (Finset.mem_inter.mp hx).1, + (mem_binaryAffineFlatPoints q.1 x).1 (Finset.mem_inter.mp hx).2⟩ + rw [hbot, ← SetLike.mem_coe, AffineSubspace.bot_coe] at hxInf + exact hxInf + have hsecondInfNe : p.1 ⊓ q.2 ≠ ⊥ := by + obtain ⟨x, hx⟩ := hsecondInterNonempty + intro hbot + have hxInf : x ∈ p.1 ⊓ q.2 := + (AffineSubspace.mem_inf_iff x p.1 q.2).2 + ⟨(mem_binaryAffineFlatPoints p.1 x).1 (Finset.mem_inter.mp hx).1, + (mem_binaryAffineFlatPoints q.2 x).1 (Finset.mem_inter.mp hx).2⟩ + rw [hbot, ← SetLike.mem_coe, AffineSubspace.bot_coe] at hxInf + exact hxInf + have hfirstCard : + (binaryAffineFlatPoints p.1 ∩ binaryAffineFlatPoints q.1).card = + 2 ^ Module.finrank FABL.𝔽₂ (p.1 ⊓ q.1).direction := by + rw [← binaryAffineFlatPoints_inf_eq_inter, + card_binaryAffineFlatPoints (p.1 ⊓ q.1) hfirstInfNe] + have hsecondCard : + (binaryAffineFlatPoints p.1 ∩ binaryAffineFlatPoints q.2).card = + 2 ^ Module.finrank FABL.𝔽₂ (p.1 ⊓ q.2).direction := by + rw [← binaryAffineFlatPoints_inf_eq_inter, + card_binaryAffineFlatPoints (p.1 ⊓ q.2) hsecondInfNe] + have hfirstRank : Module.finrank FABL.𝔽₂ (p.1 ⊓ q.1).direction ≤ 3 := by + have hle := Submodule.finrank_mono + (AffineSubspace.direction_le (inf_le_left : p.1 ⊓ q.1 ≤ p.1)) + rwa [hpFirstData.2] at hle + have hsecondRank : Module.finrank FABL.𝔽₂ (p.1 ⊓ q.2).direction ≤ 3 := by + have hle := Submodule.finrank_mono + (AffineSubspace.direction_le (inf_le_left : p.1 ⊓ q.2 ≤ p.1)) + rwa [hpFirstData.2] at hle + interval_cases hfirstRankEq : + Module.finrank FABL.𝔽₂ (p.1 ⊓ q.1).direction <;> + interval_cases hsecondRankEq : + Module.finrank FABL.𝔽₂ (p.1 ⊓ q.2).direction <;> + norm_num [hfirstRankEq, hsecondRankEq] at hfirstCard hsecondCard <;> + omega + +private theorem finrank_direction_inf_eq_two_of_card_inter_eq_four + {A B : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)} + (hA : A ∈ binaryAffineFlats 3 n) + (hcard : (binaryAffineFlatPoints A ∩ + binaryAffineFlatPoints B).card = 4) : + Module.finrank FABL.𝔽₂ (A ⊓ B).direction = 2 := by + have hAData : A ≠ ⊥ ∧ Module.finrank FABL.𝔽₂ A.direction = 3 := by + simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, + true_and] using hA + have hnonempty : + (binaryAffineFlatPoints A ∩ binaryAffineFlatPoints B).Nonempty := + Finset.card_pos.mp (by omega) + have hinfNe : A ⊓ B ≠ ⊥ := by + obtain ⟨x, hx⟩ := hnonempty + intro hbot + have hxInf : x ∈ A ⊓ B := + (AffineSubspace.mem_inf_iff x A B).2 + ⟨(mem_binaryAffineFlatPoints A x).1 (Finset.mem_inter.mp hx).1, + (mem_binaryAffineFlatPoints B x).1 (Finset.mem_inter.mp hx).2⟩ + rw [hbot, ← SetLike.mem_coe, AffineSubspace.bot_coe] at hxInf + exact hxInf + have hpow : 4 = 2 ^ Module.finrank FABL.𝔽₂ (A ⊓ B).direction := by + calc + 4 = (binaryAffineFlatPoints A ∩ + binaryAffineFlatPoints B).card := hcard.symm + _ = (binaryAffineFlatPoints (A ⊓ B)).card := by + rw [binaryAffineFlatPoints_inf_eq_inter] + _ = 2 ^ Module.finrank FABL.𝔽₂ (A ⊓ B).direction := + card_binaryAffineFlatPoints (A ⊓ B) hinfNe + apply Nat.pow_right_injective (by norm_num : 2 ≤ 2) + calc + 2 ^ Module.finrank FABL.𝔽₂ (A ⊓ B).direction = 4 := hpow.symm + _ = 2 ^ 2 := by norm_num + +private theorem direction_firstInf_eq_secondInf_of_four_four_partition + {A C D : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)} + (hA : A ∈ binaryAffineFlats 3 n) + (hCDdisjoint : Disjoint (binaryAffineFlatPoints C) + (binaryAffineFlatPoints D)) + (hACcard : (binaryAffineFlatPoints A ∩ + binaryAffineFlatPoints C).card = 4) + (hADcard : (binaryAffineFlatPoints A ∩ + binaryAffineFlatPoints D).card = 4) : + (A ⊓ C).direction = (A ⊓ D).direction := by + classical + have hAData : A ≠ ⊥ ∧ Module.finrank FABL.𝔽₂ A.direction = 3 := by + simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, + true_and] using hA + have hACrank := + finrank_direction_inf_eq_two_of_card_inter_eq_four hA hACcard + have hADrank := + finrank_direction_inf_eq_two_of_card_inter_eq_four hA hADcard + by_contra hne + have hACstrict : (A ⊓ C).direction < + (A ⊓ C).direction ⊔ (A ⊓ D).direction := by + apply lt_of_le_of_ne le_sup_left + intro heq + have hADle : (A ⊓ D).direction ≤ (A ⊓ C).direction := by + calc + (A ⊓ D).direction ≤ + (A ⊓ C).direction ⊔ (A ⊓ D).direction := le_sup_right + _ = (A ⊓ C).direction := heq.symm + have heqDirections : (A ⊓ D).direction = (A ⊓ C).direction := + Submodule.eq_of_le_of_finrank_eq hADle (by rw [hADrank, hACrank]) + exact hne heqDirections.symm + have hsupLe : (A ⊓ C).direction ⊔ (A ⊓ D).direction ≤ A.direction := + sup_le + (AffineSubspace.direction_le (inf_le_left : A ⊓ C ≤ A)) + (AffineSubspace.direction_le (inf_le_left : A ⊓ D ≤ A)) + have hsupRankLower : 3 ≤ Module.finrank FABL.𝔽₂ + ↥((A ⊓ C).direction ⊔ (A ⊓ D).direction) := by + have hlt := Submodule.finrank_lt_finrank_of_lt hACstrict + rw [hACrank] at hlt + omega + have hsupRankUpper : Module.finrank FABL.𝔽₂ + ↥((A ⊓ C).direction ⊔ (A ⊓ D).direction) ≤ 3 := by + have hle := Submodule.finrank_mono hsupLe + rwa [hAData.2] at hle + have hsupRank : Module.finrank FABL.𝔽₂ + ↥((A ⊓ C).direction ⊔ (A ⊓ D).direction) = 3 := by omega + have hsupEq : (A ⊓ C).direction ⊔ (A ⊓ D).direction = A.direction := + Submodule.eq_of_le_of_finrank_eq hsupLe (by rw [hsupRank, hAData.2]) + obtain ⟨x, hx⟩ := Finset.card_pos.mp (by rw [hACcard]; omega : + 0 < (binaryAffineFlatPoints A ∩ binaryAffineFlatPoints C).card) + obtain ⟨y, hy⟩ := Finset.card_pos.mp (by rw [hADcard]; omega : + 0 < (binaryAffineFlatPoints A ∩ binaryAffineFlatPoints D).card) + have hxInf : x ∈ A ⊓ C := + (AffineSubspace.mem_inf_iff x A C).2 + ⟨(mem_binaryAffineFlatPoints A x).1 (Finset.mem_inter.mp hx).1, + (mem_binaryAffineFlatPoints C x).1 (Finset.mem_inter.mp hx).2⟩ + have hyInf : y ∈ A ⊓ D := + (AffineSubspace.mem_inf_iff y A D).2 + ⟨(mem_binaryAffineFlatPoints A y).1 (Finset.mem_inter.mp hy).1, + (mem_binaryAffineFlatPoints D y).1 (Finset.mem_inter.mp hy).2⟩ + have hyxA : y + x ∈ A.direction := by + have hvsub := AffineSubspace.vsub_mem_direction + ((AffineSubspace.mem_inf_iff y A D).1 hyInf).1 + ((AffineSubspace.mem_inf_iff x A C).1 hxInf).1 + simpa only [vsub_eq_sub, sub_eq_add_neg, ZModModule.neg_eq_self] using hvsub + have hyxSup : y + x ∈ + (A ⊓ C).direction ⊔ (A ⊓ D).direction := by + rw [hsupEq] + exact hyxA + obtain ⟨u, hu, v, hv, huv⟩ := Submodule.mem_sup.mp hyxSup + let z := u + x + have hzFirst : z ∈ A ⊓ C := by + exact AffineSubspace.vadd_mem_of_mem_direction hu hxInf + have hzEq : u + x = v + y := by + calc + u + x = u + x + (v + v) := by + rw [ZModModule.add_self, add_zero] + _ = (u + v) + (v + x) := by abel + _ = (y + x) + (v + x) := by rw [huv] + _ = y + v + (x + x) := by abel + _ = v + y := by rw [ZModModule.add_self, add_zero, add_comm] + have hzSecond : z ∈ A ⊓ D := by + change u + x ∈ A ⊓ D + rw [hzEq] + exact AffineSubspace.vadd_mem_of_mem_direction hv hyInf + exact (Finset.disjoint_left.mp hCDdisjoint) + ((mem_binaryAffineFlatPoints C z).2 + ((AffineSubspace.mem_inf_iff z A C).1 hzFirst).2) + ((mem_binaryAffineFlatPoints D z).2 + ((AffineSubspace.mem_inf_iff z A D).1 hzSecond).2) + +private theorem exists_cross_weightSixteenRepresentation_of_two_lt_card + (h : BooleanFunction n) + {p : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × + AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)} + (hp : p ∈ weightSixteenRepresentationFiber h) + (hcard : 2 < (weightSixteenRepresentationFiber h).card) : + ∃ q ∈ weightSixteenRepresentationFiber h, + q.1 ≠ p.1 ∧ q.1 ≠ p.2 ∧ q.2 ≠ p.1 ∧ q.2 ≠ p.2 := by + classical + have hpSwap := swap_mem_weightSixteenRepresentationFiber h hp + have hpFirstNeSecond := first_ne_second_of_mem_weightSixteenFiber h hp + have hpNeSwap : p ≠ (p.2, p.1) := by + intro heq + exact hpFirstNeSecond (congrArg Prod.fst heq) + have hpairCard : ({p, (p.2, p.1)} : Finset + (AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × + AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n))).card = 2 := by + rw [Finset.card_pair hpNeSwap] + have hpairLt : ({p, (p.2, p.1)} : Finset + (AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × + AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n))).card < + (weightSixteenRepresentationFiber h).card := by + rwa [hpairCard] + obtain ⟨q, hq, hqNotPair⟩ := + Finset.exists_mem_notMem_of_card_lt_card hpairLt + have hqNeP : q ≠ p := by + intro heq + apply hqNotPair + simp [heq] + have hqNeSwap : q ≠ (p.2, p.1) := by + intro heq + apply hqNotPair + simp [heq] + have hqFirstNePFirst : q.1 ≠ p.1 := by + intro heq + apply hqNeP + exact (weightSixteenFiber_pair_eq_of_first_eq h hp hq heq.symm).symm + have hqFirstNePSecond : q.1 ≠ p.2 := by + intro heq + apply hqNeSwap + exact weightSixteenFiber_pair_eq_of_first_eq h hpSwap hq heq.symm |>.symm + have hqSecondNePFirst : q.2 ≠ p.1 := by + intro heq + apply hqNeSwap + exact weightSixteenFiber_pair_eq_of_second_eq h hq hpSwap heq + have hqSecondNePSecond : q.2 ≠ p.2 := by + intro heq + apply hqNeP + exact weightSixteenFiber_pair_eq_of_second_eq h hq hp heq + exact ⟨q, hq, hqFirstNePFirst, hqFirstNePSecond, + hqSecondNePFirst, hqSecondNePSecond⟩ + +private theorem two_le_finrank_zeroDerivativeKernel_of_two_lt_fiber_card + (h : BooleanFunction n) + {p : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × + AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)} + (hp : p ∈ weightSixteenRepresentationFiber h) + (hcard : 2 < (weightSixteenRepresentationFiber h).card) : + 2 ≤ Module.finrank FABL.𝔽₂ (zeroDerivativeKernel h) := by + classical + obtain ⟨q, hq, hqFirstNePFirst, hqFirstNePSecond, + hqSecondNePFirst, hqSecondNePSecond⟩ := + exists_cross_weightSixteenRepresentation_of_two_lt_card h hp hcard + have hpData := Finset.mem_filter.mp hp + have hqData := Finset.mem_filter.mp hq + have hpPair := weightSixteenClassificationDisjointPairData hpData.1 + have hqPair := weightSixteenClassificationDisjointPairData hqData.1 + have hpSwap := swap_mem_weightSixteenRepresentationFiber h hp + have hACcard := card_firstFlat_inter_firstFlat_eq_four_of_cross + h hp hq hqFirstNePSecond hqSecondNePSecond + have hBCcard := card_firstFlat_inter_firstFlat_eq_four_of_cross + h hpSwap hq hqFirstNePFirst hqSecondNePFirst + have hCcolumn := direction_firstInf_eq_secondInf_of_four_four_partition + hqPair.1 + (weightSixteenClassificationPairPointSetsDisjoint hpData.1) + (by simpa only [Finset.inter_comm] using hACcard) + (by simpa only [Finset.inter_comm] using hBCcard) + let R := (p.1 ⊓ q.1).direction + have hRrank : Module.finrank FABL.𝔽₂ R = 2 := by + exact finrank_direction_inf_eq_two_of_card_inter_eq_four hpPair.1 hACcard + have hRBC : R = (p.2 ⊓ q.1).direction := by + calc + R = (q.1 ⊓ p.1).direction := by + simp only [R, inf_comm] + _ = (q.1 ⊓ p.2).direction := hCcolumn + _ = (p.2 ⊓ q.1).direction := by rw [inf_comm] + have hRleFirst : R ≤ p.1.direction := by + exact AffineSubspace.direction_le (inf_le_left : p.1 ⊓ q.1 ≤ p.1) + have hRleSecond : R ≤ p.2.direction := by + rw [hRBC] + exact AffineSubspace.direction_le (inf_le_left : p.2 ⊓ q.1 ≤ p.2) + have hRleKernel : R ≤ zeroDerivativeKernel h := by + intro r hr + apply (mem_zeroDerivativeKernel h r).2 + intro x + have hpWord := (Finset.mem_filter.mp hp).2 + rw [← hpWord] + simp only [FABL.booleanDerivative, weightSixteenRepresentationWord, + Pi.add_apply] + rw [binaryAffineFlatIndicator_period_of_mem_direction + p.1 r (hRleFirst hr) x, + binaryAffineFlatIndicator_period_of_mem_direction + p.2 r (hRleSecond hr) x] + exact ZModModule.add_self _ + have hle := Submodule.finrank_mono hRleKernel + rwa [hRrank] at hle + +private theorem mem_typeA_of_parallel_weightSixteenRepresentation + (h : BooleanFunction n) + {p : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × + AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)} + (hp : p ∈ weightSixteenRepresentationFiber h) + (hdirection : p.1.direction = p.2.direction) : + h ∈ orderTwoWeightSixteenTypeAWords n := by + classical + have hpData := Finset.mem_filter.mp hp + have hpPair := weightSixteenClassificationDisjointPairData hpData.1 + have hAData : p.1 ≠ ⊥ ∧ + Module.finrank FABL.𝔽₂ p.1.direction = 3 := by + simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, + true_and] using hpPair.1 + have hBData : p.2 ≠ ⊥ ∧ + Module.finrank FABL.𝔽₂ p.2.direction = 3 := by + simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, + true_and] using hpPair.2.1 + obtain ⟨a, ha⟩ := (AffineSubspace.nonempty_iff_ne_bot p.1).2 hAData.1 + obtain ⟨b, hb⟩ := (AffineSubspace.nonempty_iff_ne_bot p.2).2 hBData.1 + have hbNotA : b ∉ p.1 := by + intro hbA + have hbMeet : b ∈ p.1 ⊓ p.2 := + (AffineSubspace.mem_inf_iff b p.1 p.2).2 ⟨hbA, hb⟩ + rw [hpPair.2.2, ← SetLike.mem_coe, AffineSubspace.bot_coe] at hbMeet + exact hbMeet + have hdifference : b -ᵥ a ∉ p.1.direction := by + intro hdifference + apply hbNotA + simpa only [vsub_vadd] using + AffineSubspace.vadd_mem_of_mem_direction hdifference ha + let C := p.1 ⊔ p.2 + have haC : a ∈ C := (le_sup_left : p.1 ≤ p.1 ⊔ p.2) ha + have hCneBot : C ≠ ⊥ := by + intro hbot + have := haC + rw [hbot, ← SetLike.mem_coe, AffineSubspace.bot_coe] at this + exact this + have hCrank : Module.finrank FABL.𝔽₂ C.direction = 4 := by + dsimp only [C] + rw [AffineSubspace.direction_sup ha hb, ← hdirection, sup_idem, + Submodule.finrank_sup_span_singleton hdifference, hAData.2] + have hCcard : (binaryAffineFlatPoints C).card = 16 := by + rw [card_binaryAffineFlatPoints C hCneBot, hCrank] + norm_num + have hdisjoint := + weightSixteenClassificationPairPointSetsDisjoint hpData.1 + have hunionCard : + (binaryAffineFlatPoints p.1 ∪ + binaryAffineFlatPoints p.2).card = 16 := by + rw [Finset.card_union_of_disjoint hdisjoint, + card_binaryAffineFlatPoints p.1 hAData.1, + card_binaryAffineFlatPoints p.2 hBData.1, + hAData.2, hBData.2] + norm_num + have hpoints : binaryAffineFlatPoints C = + binaryAffineFlatPoints p.1 ∪ binaryAffineFlatPoints p.2 := by + symm + apply Finset.eq_of_subset_of_card_le + · intro x hx + rcases Finset.mem_union.mp hx with hxFirst | hxSecond + · exact (mem_binaryAffineFlatPoints C x).2 + ((le_sup_left : p.1 ≤ p.1 ⊔ p.2) + ((mem_binaryAffineFlatPoints p.1 x).1 hxFirst)) + · exact (mem_binaryAffineFlatPoints C x).2 + ((le_sup_right : p.2 ≤ p.1 ⊔ p.2) + ((mem_binaryAffineFlatPoints p.2 x).1 hxSecond)) + · rw [hCcard, hunionCard] + have hCflat : C ∈ binaryAffineFlats 4 n := by + simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, + true_and] using And.intro hCneBot hCrank + have hindicator := binaryAffineFlatIndicator_eq_add_of_points_eq_union + p.1 p.2 C hpoints hdisjoint + have hfunction : h = binaryAffineFlatIndicator C := by + calc + h = weightSixteenRepresentationWord p.1 p.2 := hpData.2.symm + _ = binaryAffineFlatIndicator p.1 + + binaryAffineFlatIndicator p.2 := rfl + _ = binaryAffineFlatIndicator C := hindicator.symm + rw [orderTwoWeightSixteenTypeAWords, Finset.mem_image] + exact ⟨C, hCflat, hfunction.symm⟩ + +private theorem finrank_zeroDerivativeKernel_le_two_of_nonTypeA_fiber + (h : BooleanFunction n) + (hh : h ∈ orderTwoWeightSixteenDualWords n) + (hnotA : h ∉ orderTwoWeightSixteenTypeAWords n) + {p : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × + AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)} + (hp : p ∈ weightSixteenRepresentationFiber h) : + Module.finrank FABL.𝔽₂ (zeroDerivativeKernel h) ≤ 2 := by + have hpData := Finset.mem_filter.mp hp + have hpPair := weightSixteenClassificationDisjointPairData hpData.1 + have hfirstRank : Module.finrank FABL.𝔽₂ p.1.direction = 3 := by + exact (by + simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, + true_and] using hpPair.1 : + p.1 ≠ ⊥ ∧ Module.finrank FABL.𝔽₂ p.1.direction = 3).2 + have hsecondRank : Module.finrank FABL.𝔽₂ p.2.direction = 3 := by + exact (by + simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, + true_and] using hpPair.2.1 : + p.2 ≠ ⊥ ∧ Module.finrank FABL.𝔽₂ p.2.direction = 3).2 + have hleFirst := zeroDerivativeKernel_le_firstDirection_of_nonTypeA_fiber + h hh hnotA hp + have hpSwap := swap_mem_weightSixteenRepresentationFiber h hp + have hleSecond : zeroDerivativeKernel h ≤ p.2.direction := by + simpa only using + zeroDerivativeKernel_le_firstDirection_of_nonTypeA_fiber + h hh hnotA hpSwap + have hkernelRankLeThree := Submodule.finrank_mono hleFirst + rw [hfirstRank] at hkernelRankLeThree + by_contra hnotLe + have hkernelRank : + Module.finrank FABL.𝔽₂ (zeroDerivativeKernel h) = 3 := by + omega + have hkernelFirst : zeroDerivativeKernel h = p.1.direction := + Submodule.eq_of_le_of_finrank_eq hleFirst (by + rw [hkernelRank, hfirstRank]) + have hkernelSecond : zeroDerivativeKernel h = p.2.direction := + Submodule.eq_of_le_of_finrank_eq hleSecond (by + rw [hkernelRank, hsecondRank]) + apply hnotA + exact mem_typeA_of_parallel_weightSixteenRepresentation h hp + (hkernelFirst.symm.trans hkernelSecond) + +private theorem two_le_card_weightSixteenRepresentationFiber_of_mem + (h : BooleanFunction n) + {p : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × + AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)} + (hp : p ∈ weightSixteenRepresentationFiber h) : + 2 ≤ (weightSixteenRepresentationFiber h).card := by + classical + let q := (p.2, p.1) + have hq : q ∈ weightSixteenRepresentationFiber h := by + exact swap_mem_weightSixteenRepresentationFiber h hp + have hpq : p ≠ q := by + intro heq + apply first_ne_second_of_mem_weightSixteenFiber h hp + simpa only [q] using congrArg Prod.fst heq + have hsubset : ({p, q} : Finset + (AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × + AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n))) ⊆ + weightSixteenRepresentationFiber h := by + intro r hr + simp only [Finset.mem_insert, Finset.mem_singleton] at hr + rcases hr with rfl | rfl + · exact hp + · exact hq + calc + 2 = ({p, q} : Finset + (AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × + AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n))).card := by + simp [hpq] + _ ≤ (weightSixteenRepresentationFiber h).card := + Finset.card_le_card hsubset + +private theorem card_weightSixteenRepresentationFiber_le_two_of_not_typeA_typeB + (h : BooleanFunction n) + (hh : h ∈ orderTwoWeightSixteenDualWords n) + (hnotA : h ∉ orderTwoWeightSixteenTypeAWords n) + (hnotB : h ∉ orderTwoWeightSixteenTypeBWords n) + {p : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × + AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)} + (hp : p ∈ weightSixteenRepresentationFiber h) : + (weightSixteenRepresentationFiber h).card ≤ 2 := by + classical + by_contra hnotLe + have hcard : 2 < (weightSixteenRepresentationFiber h).card := by + omega + have hkernelLower := + two_le_finrank_zeroDerivativeKernel_of_two_lt_fiber_card h hp hcard + have hkernelUpper := + finrank_zeroDerivativeKernel_le_two_of_nonTypeA_fiber h hh hnotA hp + have hkernelRank : + Module.finrank FABL.𝔽₂ (zeroDerivativeKernel h) = 2 := by + omega + apply hnotB + rw [orderTwoWeightSixteenTypeBWords, Finset.mem_filter] + exact ⟨hh, hkernelRank⟩ + +/-- A represented weight-sixteen dual word outside the two multiple- +representation families has only the two ordered representations obtained by +swapping its affine three-flats. -/ +theorem card_weightSixteenRepresentationFiber_of_not_mem_typeA_typeB + (h : BooleanFunction n) + (hh : h ∈ orderTwoWeightSixteenDualWords n) + (hnotA : h ∉ orderTwoWeightSixteenTypeAWords n) + (hnotB : h ∉ orderTwoWeightSixteenTypeBWords n) + {p : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × + AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)} + (hp : p ∈ weightSixteenRepresentationFiber h) : + (weightSixteenRepresentationFiber h).card = 2 := + Nat.le_antisymm + (card_weightSixteenRepresentationFiber_le_two_of_not_typeA_typeB + h hh hnotA hnotB hp) + (two_le_card_weightSixteenRepresentationFiber_of_mem h hp) + +private structure WeightSixteenTypeBWordWitness + (h : BooleanFunction n) where + a : FABL.F₂Cube n + b : FABL.F₂Cube n + x₀ : FABL.F₂Cube n + x₁ : FABL.F₂Cube n + x₂ : FABL.F₂Cube n + x₃ : FABL.F₂Cube n + word_eq : h = + binaryAffineFlatIndicator + (FABL.binaryAffineSubspace + ((FABL.𝔽₂ ∙ a) ⊔ (FABL.𝔽₂ ∙ b)) x₀) + + binaryAffineFlatIndicator + (FABL.binaryAffineSubspace + ((FABL.𝔽₂ ∙ a) ⊔ (FABL.𝔽₂ ∙ b)) x₁) + + binaryAffineFlatIndicator + (FABL.binaryAffineSubspace + ((FABL.𝔽₂ ∙ a) ⊔ (FABL.𝔽₂ ∙ b)) x₂) + + binaryAffineFlatIndicator + (FABL.binaryAffineSubspace + ((FABL.𝔽₂ ∙ a) ⊔ (FABL.𝔽₂ ∙ b)) x₃) + +private noncomputable def weightSixteenTypeBWordWitness + (h : BooleanFunction n) (hh : h ∈ orderTwoWeightSixteenTypeBWords n) : + WeightSixteenTypeBWordWitness h := by + classical + let R := zeroDerivativeKernel h + let qh := zeroDerivativeKernelQuotientFunction h + have hhData := Finset.mem_filter.mp hh + have hweight : hammingWeight h = 16 := by + have hdualData : h ∈ reedMuller (n - 3) n ∧ + hammingWeight h = 16 := by + simpa only [orderTwoWeightSixteenDualWords, orderTwoDualWords, + Finset.mem_filter, Finset.mem_univ, true_and] using hhData.1 + exact hdualData.2 + have hRrank : Module.finrank FABL.𝔽₂ R = 2 := hhData.2 + have hRcard : Nat.card R = 4 := by + rw [FABL.card_submodule_eq_two_pow_finrank, hRrank] + norm_num + let qs : Finset (FABL.F₂Cube n ⧸ R) := + Finset.univ.filter fun q ↦ qh q = 1 + have hfactor := card_filter_mkQ_eq_card_mul_card_filter_weightSixteen + R (fun q ↦ qh q = 1) + have hleft : + ((Finset.univ : Finset (FABL.F₂Cube n)).filter fun x ↦ + qh (R.mkQ x) = 1).card = 16 := by + simpa only [R, qh, zeroDerivativeKernelQuotientFunction_mkQ, + support, FABL.f₂OneSupport, hammingWeight_eq_card_support] using hweight + have hqscard : qs.card = 4 := by + have heq : 16 = 4 * + ((Finset.univ : Finset (FABL.F₂Cube n ⧸ R)).filter fun q ↦ + qh q = 1).card := by + calc + 16 = ((Finset.univ : Finset (FABL.F₂Cube n)).filter fun x ↦ + qh (R.mkQ x) = 1).card := hleft.symm + _ = Nat.card R * + ((Finset.univ : Finset (FABL.F₂Cube n ⧸ R)).filter fun q ↦ + qh q = 1).card := hfactor + _ = 4 * + ((Finset.univ : Finset (FABL.F₂Cube n ⧸ R)).filter fun q ↦ + qh q = 1).card := by rw [hRcard] + change ((Finset.univ : Finset (FABL.F₂Cube n ⧸ R)).filter fun q ↦ + qh q = 1).card = 4 + omega + let e : Fin 4 ≃ {q // q ∈ qs} := Fintype.equivOfCardEq (by + rw [Fintype.card_fin, Fintype.card_coe, hqscard]) + let q₀ : FABL.F₂Cube n ⧸ R := (e 0).1 + let q₁ : FABL.F₂Cube n ⧸ R := (e 1).1 + let q₂ : FABL.F₂Cube n ⧸ R := (e 2).1 + let q₃ : FABL.F₂Cube n ⧸ R := (e 3).1 + have h01 : q₀ ≠ q₁ := by + intro heq + have : (0 : Fin 4) = 1 := e.injective (Subtype.ext heq) + norm_num at this + have h02 : q₀ ≠ q₂ := by + intro heq + have : (0 : Fin 4) = 2 := e.injective (Subtype.ext heq) + exact (by decide : (0 : Fin 4) ≠ 2) this + have h03 : q₀ ≠ q₃ := by + intro heq + have : (0 : Fin 4) = 3 := e.injective (Subtype.ext heq) + exact (by decide : (0 : Fin 4) ≠ 3) this + have h12 : q₁ ≠ q₂ := by + intro heq + have : (1 : Fin 4) = 2 := e.injective (Subtype.ext heq) + exact (by decide : (1 : Fin 4) ≠ 2) this + have h13 : q₁ ≠ q₃ := by + intro heq + have : (1 : Fin 4) = 3 := e.injective (Subtype.ext heq) + exact (by decide : (1 : Fin 4) ≠ 3) this + have h23 : q₂ ≠ q₃ := by + intro heq + have : (2 : Fin 4) = 3 := e.injective (Subtype.ext heq) + exact (by decide : (2 : Fin 4) ≠ 3) this + have hqs : qs = {q₀, q₁, q₂, q₃} := by + ext q + constructor + · intro hq + obtain ⟨i, hi⟩ := e.surjective ⟨q, hq⟩ + fin_cases i + all_goals + simp only [Finset.mem_insert, Finset.mem_singleton] + have hvalue := congrArg Subtype.val hi + · exact Or.inl hvalue.symm + · exact Or.inr (Or.inl hvalue.symm) + · exact Or.inr (Or.inr (Or.inl hvalue.symm)) + · exact Or.inr (Or.inr (Or.inr hvalue.symm)) + · intro hq + simp only [Finset.mem_insert, Finset.mem_singleton] at hq + rcases hq with rfl | rfl | rfl | rfl + · exact (e 0).2 + · exact (e 1).2 + · exact (e 2).2 + · exact (e 3).2 + let x₀ : FABL.F₂Cube n := Quotient.out q₀ + let x₁ : FABL.F₂Cube n := Quotient.out q₁ + let x₂ : FABL.F₂Cube n := Quotient.out q₂ + let x₃ : FABL.F₂Cube n := Quotient.out q₃ + have hx₀ : R.mkQ x₀ = q₀ := Submodule.Quotient.mk_out q₀ + have hx₁ : R.mkQ x₁ = q₁ := Submodule.Quotient.mk_out q₁ + have hx₂ : R.mkQ x₂ = q₂ := Submodule.Quotient.mk_out q₂ + have hx₃ : R.mkQ x₃ = q₃ := Submodule.Quotient.mk_out q₃ + let a := Classical.choose + (exists_spanning_pair_of_finrank_two R hRrank) + let b := Classical.choose (Classical.choose_spec + (exists_spanning_pair_of_finrank_two R hRrank)) + have hRspan := Classical.choose_spec (Classical.choose_spec + (exists_spanning_pair_of_finrank_two R hRrank)) + refine ⟨a, b, x₀, x₁, x₂, x₃, ?_⟩ + change R = (FABL.𝔽₂ ∙ a) ⊔ (FABL.𝔽₂ ∙ b) at hRspan + rw [← hRspan] + funext x + have hquotientValue : qh (R.mkQ x) = h x := by + rfl + have hsupport : qh (R.mkQ x) = 1 ↔ + R.mkQ x = R.mkQ x₀ ∨ R.mkQ x = R.mkQ x₁ ∨ + R.mkQ x = R.mkQ x₂ ∨ R.mkQ x = R.mkQ x₃ := by + have hmem : R.mkQ x ∈ qs ↔ qh (R.mkQ x) = 1 := by + simp only [qs, Finset.mem_filter, Finset.mem_univ, true_and] + rw [← hmem, hqs, hx₀, hx₁, hx₂, hx₃] + simp + simp only [Pi.add_apply, binaryAffineFlatIndicator, + mem_binaryAffineSubspace_iff_mkQ_eq] + by_cases h0 : R.mkQ x = R.mkQ x₀ + · have h1 : R.mkQ x ≠ R.mkQ x₁ := fun hx ↦ + h01 (hx₀.symm.trans ((h0.symm.trans hx).trans hx₁)) + have h2 : R.mkQ x ≠ R.mkQ x₂ := fun hx ↦ + h02 (hx₀.symm.trans ((h0.symm.trans hx).trans hx₂)) + have h3 : R.mkQ x ≠ R.mkQ x₃ := fun hx ↦ + h03 (hx₀.symm.trans ((h0.symm.trans hx).trans hx₃)) + have hxOne : h x = 1 := by + rw [← hquotientValue] + exact hsupport.mpr (Or.inl h0) + rw [hxOne, if_pos h0, if_neg h1, if_neg h2, if_neg h3] + norm_num + · by_cases h1 : R.mkQ x = R.mkQ x₁ + · have h2 : R.mkQ x ≠ R.mkQ x₂ := fun hx ↦ + h12 (hx₁.symm.trans ((h1.symm.trans hx).trans hx₂)) + have h3 : R.mkQ x ≠ R.mkQ x₃ := fun hx ↦ + h13 (hx₁.symm.trans ((h1.symm.trans hx).trans hx₃)) + have hxOne : h x = 1 := by + rw [← hquotientValue] + exact hsupport.mpr (Or.inr (Or.inl h1)) + rw [hxOne, if_neg h0, if_pos h1, if_neg h2, if_neg h3] + norm_num + · by_cases h2 : R.mkQ x = R.mkQ x₂ + · have h3 : R.mkQ x ≠ R.mkQ x₃ := fun hx ↦ + h23 (hx₂.symm.trans ((h2.symm.trans hx).trans hx₃)) + have hxOne : h x = 1 := by + rw [← hquotientValue] + exact hsupport.mpr (Or.inr (Or.inr (Or.inl h2))) + rw [hxOne, if_neg h0, if_neg h1, if_pos h2, if_neg h3] + norm_num + · by_cases h3 : R.mkQ x = R.mkQ x₃ + · have hxOne : h x = 1 := by + rw [← hquotientValue] + exact hsupport.mpr (Or.inr (Or.inr (Or.inr h3))) + rw [hxOne, if_neg h0, if_neg h1, if_neg h2, if_pos h3] + norm_num + · have hxNotOne : h x ≠ 1 := by + intro hxOne + have hqOne : qh (R.mkQ x) = 1 := by + exact hquotientValue.trans hxOne + exact hsupport.mp hqOne |>.elim h0 fun hrest ↦ + hrest.elim h1 fun hrest' ↦ hrest'.elim h2 h3 + have hxZero : h x = 0 := by + by_contra hxNeZero + exact hxNotOne (Fin.eq_one_of_ne_zero _ hxNeZero) + rw [hxZero, if_neg h0, if_neg h1, if_neg h2, if_neg h3] + norm_num + +private def weightSixteenTypeBWordWitnessCode + {h : BooleanFunction n} (w : WeightSixteenTypeBWordWitness h) : + Fin 6 → FABL.F₂Cube n := + ![w.a, w.b, w.x₀, w.x₁, w.x₂, w.x₃] + +private noncomputable def weightSixteenTypeBWordCode + (h : BooleanFunction n) : Fin 6 → FABL.F₂Cube n := by + classical + exact if hh : h ∈ orderTwoWeightSixteenTypeBWords n then + weightSixteenTypeBWordWitnessCode + (weightSixteenTypeBWordWitness h hh) + else 0 + +private theorem weightSixteenTypeBWordCode_injective_on : + Set.InjOn (weightSixteenTypeBWordCode (n := n)) + (orderTwoWeightSixteenTypeBWords n : Set (BooleanFunction n)) := by + intro f hf g hg hcode + have hfFin : f ∈ orderTwoWeightSixteenTypeBWords n := hf + have hgFin : g ∈ orderTwoWeightSixteenTypeBWords n := hg + let wf := weightSixteenTypeBWordWitness f hfFin + let wg := weightSixteenTypeBWordWitness g hgFin + have hcode' : weightSixteenTypeBWordWitnessCode wf = + weightSixteenTypeBWordWitnessCode wg := by + unfold weightSixteenTypeBWordCode at hcode + rw [dif_pos hfFin, dif_pos hgFin] at hcode + simpa only [wf, wg] using hcode + have h0 : wf.a = wg.a := by + simpa [weightSixteenTypeBWordWitnessCode] using + congrFun hcode' (0 : Fin 6) + have h1 : wf.b = wg.b := by + simpa [weightSixteenTypeBWordWitnessCode] using + congrFun hcode' (1 : Fin 6) + have h2 : wf.x₀ = wg.x₀ := by + simpa [weightSixteenTypeBWordWitnessCode] using + congrFun hcode' (2 : Fin 6) + have h3 : wf.x₁ = wg.x₁ := by + simpa [weightSixteenTypeBWordWitnessCode] using + congrFun hcode' (3 : Fin 6) + have h4 : wf.x₂ = wg.x₂ := by + simpa [weightSixteenTypeBWordWitnessCode] using + congrFun hcode' (4 : Fin 6) + have h5 : wf.x₃ = wg.x₃ := by + simpa [weightSixteenTypeBWordWitnessCode] using + congrFun hcode' (5 : Fin 6) + rw [wf.word_eq, wg.word_eq, h0, h1, h2, h3, h4, h5] + +/-- Type-`b` exceptional words inject into six ambient vectors. -/ +theorem card_orderTwoWeightSixteenTypeBWords_le (n : ℕ) : + (orderTwoWeightSixteenTypeBWords n).card ≤ (2 ^ n) ^ 6 := by + classical + calc + (orderTwoWeightSixteenTypeBWords n).card ≤ + (Finset.univ : Finset (Fin 6 → FABL.F₂Cube n)).card := by + apply Finset.card_le_card_of_injOn + (weightSixteenTypeBWordCode (n := n)) + · intro h _hh + exact Finset.mem_univ _ + · exact weightSixteenTypeBWordCode_injective_on + _ = (2 ^ n) ^ 6 := by + rw [Finset.card_univ, Fintype.card_fun, Fintype.card_fin, card_f₂Cube] + +/-- The canonical exceptional families satisfy the count interface used by +the weight-sixteen character-sum estimate. -/ +theorem hasWeightSixteenExceptionalCountBounds_typeA_typeB (n : ℕ) : + HasWeightSixteenExceptionalCountBounds + (orderTwoWeightSixteenTypeAWords n) + (orderTwoWeightSixteenTypeBWords n) := by + exact ⟨card_orderTwoWeightSixteenTypeAWords_le n, + card_orderTwoWeightSixteenTypeBWords_le n⟩ + +end CryptBoolean diff --git a/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenNormalizedCandidateDecode.lean b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenNormalizedCandidateDecode.lean new file mode 100644 index 0000000..453363e --- /dev/null +++ b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenNormalizedCandidateDecode.lean @@ -0,0 +1,79 @@ +/- +Copyright (c) 2026 Asher Yan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Asher Yan with Codex +-/ +module + +public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightSixteenNormalizedCandidates + +/-! +# Decode normalized weight-sixteen affine certificates + +The generated affine code is row-major. Its low seven bits store a source +origin, and the following seven chunks store the rows of a linear map. The +corresponding `SevenVariableAffineMapData` therefore uses the image of the +source origin as translation and the transpose of those rows as directions. +-/ + +open Finset +open scoped BigOperators BooleanCube + +@[expose] public section + +namespace CryptBoolean + +/-- Interpret one affine-code bit as an element of the binary field. -/ +def normalizedCandidateAffineBit + (candidate : NormalizedWeightSixteenCandidate) (index : ℕ) : FABL.𝔽₂ := + if candidate.affineCode.getLsbD index then 1 else 0 + +/-- The source origin encoded in the low seven bits. -/ +def normalizedCandidateSourceOrigin + (candidate : NormalizedWeightSixteenCandidate) : FABL.F₂Cube 7 := + fun i ↦ normalizedCandidateAffineBit candidate i + +/-- The `j`th output row of the encoded linear map. -/ +def normalizedCandidateAffineRow + (candidate : NormalizedWeightSixteenCandidate) (j : Fin 7) : + FABL.F₂Cube 7 := + fun i ↦ normalizedCandidateAffineBit candidate (7 * (j + 1) + i) + +/-- Row evaluation of the encoded linear map. -/ +def normalizedCandidateLinearPoint + (candidate : NormalizedWeightSixteenCandidate) (x : FABL.F₂Cube 7) : + FABL.F₂Cube 7 := + fun j ↦ ∑ i : Fin 7, normalizedCandidateAffineRow candidate j i * x i + +/-- Decode the row-major affine certificate into the column-oriented data used +by `sevenVariableAffinePoint`. -/ +def normalizedCandidateAffineMapData + (candidate : NormalizedWeightSixteenCandidate) : + SevenVariableAffineMapData 7 := + (normalizedCandidateLinearPoint candidate + (normalizedCandidateSourceOrigin candidate), + fun i j ↦ normalizedCandidateAffineRow candidate j i) + +/-- Decoding transposes the stored rows and maps the source origin before using +it as the affine translation. -/ +theorem sevenVariableAffinePoint_normalizedCandidateAffineMapData + (candidate : NormalizedWeightSixteenCandidate) (x : FABL.F₂Cube 7) : + sevenVariableAffinePoint (normalizedCandidateAffineMapData candidate) x = + normalizedCandidateLinearPoint candidate + (x + normalizedCandidateSourceOrigin candidate) := by + funext j + simp only [sevenVariableAffinePoint, normalizedCandidateAffineMapData, + normalizedCandidateLinearPoint, Pi.add_apply, Finset.sum_apply, + Pi.smul_apply, smul_eq_mul] + simp_rw [mul_add] + rw [Finset.sum_add_distrib] + have hcomm : + (∑ i : Fin 7, x i * normalizedCandidateAffineRow candidate j i) = + ∑ i : Fin 7, normalizedCandidateAffineRow candidate j i * x i := by + apply Finset.sum_congr rfl + intro i _hi + exact mul_comm _ _ + rw [hcomm] + exact add_comm _ _ + +end CryptBoolean diff --git a/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenNormalizedCandidates.lean b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenNormalizedCandidates.lean new file mode 100644 index 0000000..b31f938 --- /dev/null +++ b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenNormalizedCandidates.lean @@ -0,0 +1,24648 @@ +/- +Copyright (c) 2026 Asher Yan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Asher Yan with Codex +-/ +module + +public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightSixteenRankSevenPatterns + +/-! +# Generated normalized weight-sixteen candidates + +Each leaf records a canonical class, an invertible affine normalization, +the resulting 128-bit support mask, and its systematic 64-bit column code. +Candidate trees are sharded by the low sixteen bits of the systematic code so +that each kernel-checked finite classification problem remains small. +-/ + +@[expose] public section + +namespace CryptBoolean + +/-- One normalized-pattern certificate. The affine code stores the source origin +in its low seven bits, followed by the seven rows of the normalizing linear map. -/ +structure NormalizedWeightSixteenCandidate where + patternClass : RankSevenWeightSixteenPatternClass + affineCode : BitVec 56 + maskLow : BitVec 64 + maskHigh : BitVec 64 + systematicCode : BitVec 64 + +/-- A balanced tree keeps finite classification reduction logarithmic in the +number of certificates in one prefix shard. -/ +inductive NormalizedWeightSixteenCandidateTree where + | leaf (candidate : NormalizedWeightSixteenCandidate) + | node (left right : NormalizedWeightSixteenCandidateTree) + +namespace NormalizedWeightSixteenCandidateTree + +/-- Whether the tree contains a certificate with the given systematic code. -/ +def containsSystematicCode : + NormalizedWeightSixteenCandidateTree → BitVec 64 → Bool + | .leaf candidate, code => candidate.systematicCode == code + | .node left right, code => + left.containsSystematicCode code || right.containsSystematicCode code + +/-- Propositional membership in a generated candidate tree. -/ +inductive Member (candidate : NormalizedWeightSixteenCandidate) : + NormalizedWeightSixteenCandidateTree → Prop + | leaf : Member candidate (.leaf candidate) + | left {left right} : Member candidate left → Member candidate (.node left right) + | right {left right} : Member candidate right → Member candidate (.node left right) + +end NormalizedWeightSixteenCandidateTree + +/-- Generated candidate shard for systematic prefix 0x0b07. -/ +def normalizedWeightSixteenCandidateBucket_0b07 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.node + (.leaf + { patternClass := .twoE8 + affineCode := BitVec.ofNat 56 18085074352242816 + maskLow := BitVec.ofNat 64 72057598332961279 + maskHigh := BitVec.ofNat 64 282574505115649 + systematicCode := BitVec.ofNat 64 16199641854970235655 }) + (.leaf + { patternClass := .d16Plus + affineCode := BitVec.ofNat 56 54397531543592960 + maskLow := BitVec.ofNat 64 12885099327 + maskHigh := BitVec.ofNat 64 13835058055282163715 + systematicCode := BitVec.ofNat 64 18373986379115989767 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9360144676980864 + maskLow := BitVec.ofNat 64 144115192370889023 + maskHigh := BitVec.ofNat 64 283399155613697 + systematicCode := BitVec.ofNat 64 16199675242525952775 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9150687711889536 + maskLow := BitVec.ofNat 64 144115192370889023 + maskHigh := BitVec.ofNat 64 283674029326337 + systematicCode := BitVec.ofNat 64 16200486548862601991 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18087518222452864 + maskLow := BitVec.ofNat 64 126100793861407039 + maskHigh := BitVec.ofNat 64 283674033520641 + systematicCode := BitVec.ofNat 64 16200489580052155143 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148233138079872 + maskLow := BitVec.ofNat 64 144115192370889023 + maskHigh := BitVec.ofNat 64 564049481875457 + systematicCode := BitVec.ofNat 64 16415814837058341639 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085063648643200 + maskLow := BitVec.ofNat 64 72268704565494079 + maskHigh := BitVec.ofNat 64 564049498603521 + systematicCode := BitVec.ofNat 64 16415817936966322951 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18050154154461312 + maskLow := BitVec.ofNat 64 72057601554186559 + maskHigh := BitVec.ofNat 64 565148993454081 + systematicCode := BitVec.ofNat 64 16416659062822603527 }) + ) + ) + ) + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9289775898984576 + maskLow := BitVec.ofNat 64 144115192370889023 + maskHigh := BitVec.ofNat 64 4611686568191623171 + systematicCode := BitVec.ofNat 64 18288747132631583495 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36100267430674560 + maskLow := BitVec.ofNat 64 36169547392287039 + maskHigh := BitVec.ofNat 64 4611686568216756225 + systematicCode := BitVec.ofNat 64 18288752423407389447 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36170086419038336 + maskLow := BitVec.ofNat 64 36028803461611839 + maskHigh := BitVec.ofNat 64 4611688217459032065 + systematicCode := BitVec.ofNat 64 18290154300193835783 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36169813688615040 + maskLow := BitVec.ofNat 64 140743930872639 + maskHigh := BitVec.ofNat 64 4612248968380841985 + systematicCode := BitVec.ofNat 64 18294640238914636551 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9289775898986624 + maskLow := BitVec.ofNat 64 144115192370889023 + maskHigh := BitVec.ofNat 64 9223372311736893443 + systematicCode := BitVec.ofNat 64 18360522147886205703 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36100267430676608 + maskLow := BitVec.ofNat 64 18084780138627391 + maskHigh := BitVec.ofNat 64 9223372311766237185 + systematicCode := BitVec.ofNat 64 18360528538156862215 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36170086419040384 + maskLow := BitVec.ofNat 64 18014403878388031 + maskHigh := BitVec.ofNat 64 9223374235882225665 + systematicCode := BitVec.ofNat 64 18362210790408391431 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36169813688617088 + maskLow := BitVec.ofNat 64 70374112953151 + maskHigh := BitVec.ofNat 64 9223934986808213505 + systematicCode := BitVec.ofNat 64 18366696729129192199 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9360698727760000 + maskLow := BitVec.ofNat 64 144115192370889023 + maskHigh := BitVec.ofNat 64 13835623204292395009 + systematicCode := BitVec.ofNat 64 18374092553129757447 }) + ) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x0d07. -/ +def normalizedWeightSixteenCandidateBucket_0d07 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.node + (.leaf + { patternClass := .d16Plus + affineCode := BitVec.ofNat 56 54397531543576704 + maskLow := BitVec.ofNat 64 21475165535 + maskHigh := BitVec.ofNat 64 11529215046068469765 + systematicCode := BitVec.ofNat 64 18373425636809444615 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9360144676964608 + maskLow := BitVec.ofNat 64 288230380446744927 + maskHigh := BitVec.ofNat 64 283261750214657 + systematicCode := BitVec.ofNat 64 16199675233969704199 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9150687711873280 + maskLow := BitVec.ofNat 64 288230380446744927 + maskHigh := BitVec.ofNat 64 285873050484737 + systematicCode := BitVec.ofNat 64 16201049498782600455 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18087518222436608 + maskLow := BitVec.ofNat 64 117093594606666079 + maskHigh := BitVec.ofNat 64 285873090330625 + systematicCode := BitVec.ofNat 64 16201054729028701447 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148233138063616 + maskLow := BitVec.ofNat 64 288230380446744927 + maskHigh := BitVec.ofNat 64 1126999435288577 + systematicCode := BitVec.ofNat 64 16559930025100774663 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085063648626944 + maskLow := BitVec.ofNat 64 72233520193405279 + maskHigh := BitVec.ofNat 64 1126999485579265 + systematicCode := BitVec.ofNat 64 16559935324065303815 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18050154154445056 + maskLow := BitVec.ofNat 64 72057601017315679 + maskHigh := BitVec.ofNat 64 1130297970130945 + systematicCode := BitVec.ofNat 64 16561337200851750151 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9289775898968320 + maskLow := BitVec.ofNat 64 288230380446744927 + maskHigh := BitVec.ofNat 64 2305843558977929221 + systematicCode := BitVec.ofNat 64 18144631944589413639 }) + ) + ) + ) + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36100267430658304 + maskLow := BitVec.ofNat 64 36169555982221663 + maskHigh := BitVec.ofNat 64 2305843559036616705 + systematicCode := BitVec.ofNat 64 18144639434354920711 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36170086419022080 + maskLow := BitVec.ofNat 64 36028803461742943 + maskHigh := BitVec.ofNat 64 2305847407268593665 + systematicCode := BitVec.ofNat 64 18146602062071532807 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36169813688598784 + maskLow := BitVec.ofNat 64 140743930873183 + maskHigh := BitVec.ofNat 64 2306968909120569345 + systematicCode := BitVec.ofNat 64 18151088000792333575 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9289775899230464 + maskLow := BitVec.ofNat 64 288230380446744927 + maskHigh := BitVec.ofNat 64 9223372174295834629 + systematicCode := BitVec.ofNat 64 18359956990353280263 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36100267430920448 + maskLow := BitVec.ofNat 64 9042405101732191 + maskHigh := BitVec.ofNat 64 9223372174360838145 + systematicCode := BitVec.ofNat 64 18359967778603339015 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36170086419284224 + maskLow := BitVec.ofNat 64 9007204086907231 + maskHigh := BitVec.ofNat 64 9223376434903384065 + systematicCode := BitVec.ofNat 64 18362771532715199751 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36169813688860928 + maskLow := BitVec.ofNat 64 35189203993951 + maskHigh := BitVec.ofNat 64 9224497936761626625 + systematicCode := BitVec.ofNat 64 18367257471436000519 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9360698727483648 + maskLow := BitVec.ofNat 64 288230380446744927 + maskHigh := BitVec.ofNat 64 11530345344088932353 + systematicCode := BitVec.ofNat 64 18373531810823212295 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x0d0b. -/ +def normalizedWeightSixteenCandidateBucket_0d0b : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.node + (.leaf + { patternClass := .d16Plus + affineCode := BitVec.ofNat 56 54397531539415168 + maskLow := BitVec.ofNat 64 73015562615 + maskHigh := BitVec.ofNat 64 9799832789158199313 + systematicCode := BitVec.ofNat 64 18372304152196353291 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9360144670722304 + maskLow := BitVec.ofNat 64 1152921508901880183 + maskHigh := BitVec.ofNat 64 283158872326145 + systematicCode := BitVec.ofNat 64 16199675216857206027 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9150687705630976 + maskLow := BitVec.ofNat 64 1152921508901880183 + maskHigh := BitVec.ofNat 64 299067188445185 + systematicCode := BitVec.ofNat 64 16202175398622596363 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18087518216194304 + maskLow := BitVec.ofNat 64 110338195165610359 + maskHigh := BitVec.ofNat 64 299067431190529 + systematicCode := BitVec.ofNat 64 16202185026981793035 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148233131821312 + maskLow := BitVec.ofNat 64 1152921508901880183 + maskHigh := BitVec.ofNat 64 4504699155810305 + systematicCode := BitVec.ofNat 64 16848160401185639691 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085063642384640 + maskLow := BitVec.ofNat 64 72207131914338679 + maskHigh := BitVec.ofNat 64 4504699407433729 + systematicCode := BitVec.ofNat 64 16848170098263264523 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18050154148202752 + maskLow := BitVec.ofNat 64 72057600614662519 + maskHigh := BitVec.ofNat 64 4521191830192129 + systematicCode := BitVec.ofNat 64 16850693476910042379 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9289775892726016 + maskLow := BitVec.ofNat 64 1152921508901880183 + maskHigh := BitVec.ofNat 64 576461302067658769 + systematicCode := BitVec.ofNat 64 17856401568505072907 }) + ) + ) + ) + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36100267424416000 + maskLow := BitVec.ofNat 64 36169607521829239 + maskHigh := BitVec.ofNat 64 576461302327672833 + systematicCode := BitVec.ofNat 64 17856413456249982219 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36170086412779776 + maskLow := BitVec.ofNat 64 36028803462529399 + maskHigh := BitVec.ofNat 64 576478344497856513 + systematicCode := BitVec.ofNat 64 17859497585826925835 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36169813682356480 + maskLow := BitVec.ofNat 64 140743930876279 + maskHigh := BitVec.ofNat 64 580964351930826753 + systematicCode := BitVec.ofNat 64 17863983524547726603 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9289775926280448 + maskLow := BitVec.ofNat 64 1152921508901880183 + maskHigh := BitVec.ofNat 64 9223372071215040529 + systematicCode := BitVec.ofNat 64 18358826675287428363 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36100267457970432 + maskLow := BitVec.ofNat 64 2260668921217399 + maskHigh := BitVec.ofNat 64 9223372071482949633 + systematicCode := BitVec.ofNat 64 18358846259496291595 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36170086446334208 + maskLow := BitVec.ofNat 64 2251804243984759 + maskHigh := BitVec.ofNat 64 9223389629041344513 + systematicCode := BitVec.ofNat 64 18363893017328815371 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36169813715910912 + maskLow := BitVec.ofNat 64 8800522277239 + maskHigh := BitVec.ofNat 64 9227875636482148353 + systematicCode := BitVec.ofNat 64 18368378956049616139 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9360698687949056 + maskLow := BitVec.ofNat 64 1152921508901880183 + maskHigh := BitVec.ofNat 64 9804353981240049665 + systematicCode := BitVec.ofNat 64 18372410326210120971 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x0e07. -/ +def normalizedWeightSixteenCandidateBucket_0e07 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.node + (.leaf + { patternClass := .d16Plus + affineCode := BitVec.ofNat 56 54397531543568512 + maskLow := BitVec.ofNat 64 38655297951 + maskHigh := BitVec.ofNat 64 6917529027641081865 + systematicCode := BitVec.ofNat 64 18301369146594954759 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9360144672768640 + maskLow := BitVec.ofNat 64 576460756598456735 + maskHigh := BitVec.ofNat 64 282986939416577 + systematicCode := BitVec.ofNat 64 16199674134474919431 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9150687707677312 + maskLow := BitVec.ofNat 64 576460756598456735 + maskHigh := BitVec.ofNat 64 290271092801537 + systematicCode := BitVec.ofNat 64 16201330969464409607 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18087518218240640 + maskLow := BitVec.ofNat 64 99079196097184159 + maskHigh := BitVec.ofNat 64 290271203950593 + systematicCode := BitVec.ofNat 64 16201337303500262919 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148233133867648 + maskLow := BitVec.ofNat 64 576460756598456735 + maskHigh := BitVec.ofNat 64 2252899342114817 + systematicCode := BitVec.ofNat 64 16631987614843801095 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085063644430976 + maskLow := BitVec.ofNat 64 72163151449227679 + maskHigh := BitVec.ofNat 64 2252899459530753 + systematicCode := BitVec.ofNat 64 16631994017598082567 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18050154150249088 + maskLow := BitVec.ofNat 64 72057599943573919 + maskHigh := BitVec.ofNat 64 2260595923484673 + systematicCode := BitVec.ofNat 64 16633676269849611783 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2534376453720192 + maskLow := BitVec.ofNat 64 576460756598456735 + maskHigh := BitVec.ofNat 64 2305843284095811593 + systematicCode := BitVec.ofNat 64 18144349365822950919 }) + ) + ) + ) + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36047490868332672 + maskLow := BitVec.ofNat 64 18084805908431263 + maskHigh := BitVec.ofNat 64 2305843284225818625 + systematicCode := BitVec.ofNat 64 18144359054578159111 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36169674097969280 + maskLow := BitVec.ofNat 64 18014403878781343 + maskHigh := BitVec.ofNat 64 2305851805310910465 + systematicCode := BitVec.ofNat 64 18146882433224936967 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36169810463180928 + maskLow := BitVec.ofNat 64 70374112954783 + maskHigh := BitVec.ofNat 64 2308094809027395585 + systematicCode := BitVec.ofNat 64 18151368371945737735 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2534376453980288 + maskLow := BitVec.ofNat 64 576460756598456735 + maskHigh := BitVec.ofNat 64 4611686155868446729 + systematicCode := BitVec.ofNat 64 18287899396332195335 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36047490868592768 + maskLow := BitVec.ofNat 64 9042422281601439 + maskHigh := BitVec.ofNat 64 4611686156000559105 + systematicCode := BitVec.ofNat 64 18287911284077104647 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36169674098229376 + maskLow := BitVec.ofNat 64 9007204087169439 + maskHigh := BitVec.ofNat 64 4611694814522507265 + systematicCode := BitVec.ofNat 64 18290995413654048263 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36169810463441024 + maskLow := BitVec.ofNat 64 35189203995039 + maskHigh := BitVec.ofNat 64 4613937818241081345 + systematicCode := BitVec.ofNat 64 18295481352374849031 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9360698723289728 + maskLow := BitVec.ofNat 64 576460756598456735 + maskHigh := BitVec.ofNat 64 6919789623682007041 + systematicCode := BitVec.ofNat 64 18301475320608722439 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x0e0b. -/ +def normalizedWeightSixteenCandidateBucket_0e0b : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.node + (.leaf + { patternClass := .d16Plus + affineCode := BitVec.ofNat 56 54397531539406976 + maskLow := BitVec.ofNat 64 141736092087 + maskHigh := BitVec.ofNat 64 5188146770730811425 + systematicCode := BitVec.ofNat 64 18300247661981863435 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9360144670687872 + maskLow := BitVec.ofNat 64 2305843013508727223 + maskHigh := BitVec.ofNat 64 282884262854657 + systematicCode := BitVec.ofNat 64 16199674117362421259 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9150687705596544 + maskLow := BitVec.ofNat 64 2305843013508727223 + maskHigh := BitVec.ofNat 64 316659370295297 + systematicCode := BitVec.ofNat 64 16202456869304405515 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18087518216159872 + maskLow := BitVec.ofNat 64 92323796656128439 + maskHigh := BitVec.ofNat 64 316659885670401 + systematicCode := BitVec.ofNat 64 16202467601453354507 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148233131786880 + maskLow := BitVec.ofNat 64 2305843013508727223 + maskHigh := BitVec.ofNat 64 9008298783164417 + systematicCode := BitVec.ofNat 64 16920217990928666123 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085063642350208 + maskLow := BitVec.ofNat 64 72136763170161079 + maskHigh := BitVec.ofNat 64 9008299303239681 + systematicCode := BitVec.ofNat 64 16920228791796043275 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18050154148168320 + maskLow := BitVec.ofNat 64 72057599540920759 + maskHigh := BitVec.ofNat 64 9042383643607041 + systematicCode := BitVec.ofNat 64 16923032545907904011 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2534376451639424 + maskLow := BitVec.ofNat 64 2305843013508727223 + maskHigh := BitVec.ofNat 64 576461027185541153 + systematicCode := BitVec.ofNat 64 17856118989738610187 }) + ) + ) + ) + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36047490866251904 + maskLow := BitVec.ofNat 64 18084908987646391 + maskHigh := BitVec.ofNat 64 576461027718201345 + systematicCode := BitVec.ofNat 64 17856133076473220619 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36169674095888512 + maskLow := BitVec.ofNat 64 18014403880354231 + maskHigh := BitVec.ofNat 64 576495936679706625 + systematicCode := BitVec.ofNat 64 17859777956980329995 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36169810461100160 + maskLow := BitVec.ofNat 64 70374112960951 + maskHigh := BitVec.ofNat 64 585467951558180865 + systematicCode := BitVec.ofNat 64 17864263895701130763 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2534376485191808 + maskLow := BitVec.ofNat 64 2305843013508727223 + maskHigh := BitVec.ofNat 64 4611686052787652641 + systematicCode := BitVec.ofNat 64 18286769081266343435 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36047490899804288 + maskLow := BitVec.ofNat 64 2260737640694199 + maskHigh := BitVec.ofNat 64 4611686053323997185 + systematicCode := BitVec.ofNat 64 18286789764970057227 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36169674129440896 + maskLow := BitVec.ofNat 64 2251804245033399 + maskHigh := BitVec.ofNat 64 4611721202800001025 + systematicCode := BitVec.ofNat 64 18292116898267663883 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36169810494652544 + maskLow := BitVec.ofNat 64 8800522281399 + maskHigh := BitVec.ofNat 64 4620693217682130945 + systematicCode := BitVec.ofNat 64 18296602836988464651 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9360698687916672 + maskLow := BitVec.ofNat 64 2305843013508727223 + maskHigh := BitVec.ofNat 64 5197189154894512129 + systematicCode := BitVec.ofNat 64 18300353835995631115 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x0e0d. -/ +def normalizedWeightSixteenCandidateBucket_0e0d : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.node + (.leaf + { patternClass := .d16Plus + affineCode := BitVec.ofNat 56 54397531538350336 + maskLow := BitVec.ofNat 64 279177150935 + maskHigh := BitVec.ofNat 64 2882303761517117505 + systematicCode := BitVec.ofNat 64 18156134681552883213 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9360144670476544 + maskLow := BitVec.ofNat 64 4611686022722421207 + maskHigh := BitVec.ofNat 64 282747360772097 + systematicCode := BitVec.ofNat 64 16199671918372851213 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9150687705385216 + maskLow := BitVec.ofNat 64 4611686022722421207 + maskHigh := BitVec.ofNat 64 351843740286977 + systematicCode := BitVec.ofNat 64 16203019810668023309 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18087518215948544 + maskLow := BitVec.ofNat 64 83316597401387479 + maskHigh := BitVec.ofNat 64 351844794630145 + systematicCode := BitVec.ofNat 64 16203032750396476941 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148233131575552 + maskLow := BitVec.ofNat 64 4611686022722421207 + maskHigh := BitVec.ofNat 64 18015498037897217 + systematicCode := BitVec.ofNat 64 17064333170414718477 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085063642138880 + maskLow := BitVec.ofNat 64 72101578798072279 + maskHigh := BitVec.ofNat 64 18015499094851585 + systematicCode := BitVec.ofNat 64 17064346178861600269 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18050154147956992 + maskLow := BitVec.ofNat 64 72057599004049879 + maskHigh := BitVec.ofNat 64 18084767270436865 + systematicCode := BitVec.ofNat 64 17067710683903626765 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2534376451883264 + maskLow := BitVec.ofNat 64 4611686022722421207 + maskHigh := BitVec.ofNat 64 576460889744482369 + systematicCode := BitVec.ofNat 64 17855553832205684237 }) + ) + ) + ) + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36047490866495744 + maskLow := BitVec.ofNat 64 9042662799770071 + maskHigh := BitVec.ofNat 64 576460890816118785 + systematicCode := BitVec.ofNat 64 17855572316919696909 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36169674096132352 + maskLow := BitVec.ofNat 64 9007204090839511 + maskHigh := BitVec.ofNat 64 576531121049698305 + systematicCode := BitVec.ofNat 64 17860338699287137805 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36169810461344000 + maskLow := BitVec.ofNat 64 35189204009431 + maskHigh := BitVec.ofNat 64 594475150812913665 + systematicCode := BitVec.ofNat 64 17864824638007938573 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2534376485175552 + maskLow := BitVec.ofNat 64 4611686022722421207 + maskHigh := BitVec.ofNat 64 2305843043573958721 + systematicCode := BitVec.ofNat 64 18142653893224173069 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36047490899788032 + maskLow := BitVec.ofNat 64 2260875079647703 + maskHigh := BitVec.ofNat 64 2305843044647174145 + systematicCode := BitVec.ofNat 64 18142676775917587981 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36169674129424640 + maskLow := BitVec.ofNat 64 2251804247130583 + maskHigh := BitVec.ofNat 64 2305913377958395905 + systematicCode := BitVec.ofNat 64 18148564660145360397 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36169810494636288 + maskLow := BitVec.ofNat 64 8800522289623 + maskHigh := BitVec.ofNat 64 2323857407723177985 + systematicCode := BitVec.ofNat 64 18153050598866161165 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9360698687965440 + maskLow := BitVec.ofNat 64 4611686022722421207 + maskHigh := BitVec.ofNat 64 2900388529844518913 + systematicCode := BitVec.ofNat 64 18156240855566650893 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x1307. -/ +def normalizedWeightSixteenCandidateBucket_1307 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .twoE8 + affineCode := BitVec.ofNat 56 18085043456999552 + maskLow := BitVec.ofNat 64 4503603922407199 + maskHigh := BitVec.ofNat 64 281543697235969 + systematicCode := BitVec.ofNat 64 16197381224838533895 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18087521418512512 + maskLow := BitVec.ofNat 64 869194732377539359 + maskHigh := BitVec.ofNat 64 281612417761281 + systematicCode := BitVec.ofNat 64 16198229010032366343 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9150690907949184 + maskLow := BitVec.ofNat 64 9007203549774623 + maskHigh := BitVec.ofNat 64 281612618039297 + systematicCode := BitVec.ofNat 64 16198241376099046151 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9360147873040512 + maskLow := BitVec.ofNat 64 9007203549774623 + maskHigh := BitVec.ofNat 64 294737837817857 + systematicCode := BitVec.ofNat 64 16201371767358034695 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148217157781632 + maskLow := BitVec.ofNat 64 9007203549774623 + maskHigh := BitVec.ofNat 64 563018673995777 + systematicCode := BitVec.ofNat 64 16413554241151111943 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085047668344960 + maskLow := BitVec.ofNat 64 4714710154937119 + maskHigh := BitVec.ofNat 64 563018674995201 + systematicCode := BitVec.ofNat 64 16413557306699879175 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18050138174163072 + maskLow := BitVec.ofNat 64 4503607143629599 + maskHigh := BitVec.ofNat 64 563087393423361 + systematicCode := BitVec.ofNat 64 16414398432556159751 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36170085353685120 + maskLow := BitVec.ofNat 64 576460758746071839 + maskHigh := BitVec.ofNat 64 4611686156000559105 + systematicCode := BitVec.ofNat 64 18287911330832913159 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36100266365321344 + maskLow := BitVec.ofNat 64 576601502676747039 + maskHigh := BitVec.ofNat 64 4611694814522507265 + systematicCode := BitVec.ofNat 64 18290995461487792903 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9289774833631360 + maskLow := BitVec.ofNat 64 9007203549774623 + maskHigh := BitVec.ofNat 64 4611694814654660611 + systematicCode := BitVec.ofNat 64 18291007728537768711 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36170085353687168 + maskLow := BitVec.ofNat 64 288230381520618271 + maskHigh := BitVec.ofNat 64 9223372174360838145 + systematicCode := BitVec.ofNat 64 18359967821047468807 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36100266365323392 + maskLow := BitVec.ofNat 64 288300757780857631 + maskHigh := BitVec.ofNat 64 9223376434903384065 + systematicCode := BitVec.ofNat 64 18362771576237265671 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9289774833633408 + maskLow := BitVec.ofNat 64 9007203549774623 + maskHigh := BitVec.ofNat 64 9223376434968412163 + systematicCode := BitVec.ofNat 64 18362782743792390919 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9360697662406784 + maskLow := BitVec.ofNat 64 9007203549774623 + maskHigh := BitVec.ofNat 64 13835621142676635649 + systematicCode := BitVec.ofNat 64 18374092518635279111 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x130b. -/ +def normalizedWeightSixteenCandidateBucket_130b : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .twoE8 + affineCode := BitVec.ofNat 56 18085043211468928 + maskLow := BitVec.ofNat 64 1125904201888567 + maskHigh := BitVec.ofNat 64 281492156841985 + systematicCode := BitVec.ofNat 64 16196250909772681995 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18087521439320192 + maskLow := BitVec.ofNat 64 3459890418022417207 + maskHigh := BitVec.ofNat 64 281509336973313 + systematicCode := BitVec.ofNat 64 16197098729325728523 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9150690928756864 + maskLow := BitVec.ofNat 64 2251804108718903 + maskHigh := BitVec.ofNat 64 281510142017537 + systematicCode := BitVec.ofNat 64 16197119891351212811 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9360147893848192 + maskLow := BitVec.ofNat 64 2251804108718903 + maskHigh := BitVec.ofNat 64 334268715237377 + systematicCode := BitVec.ofNat 64 16202502048064148235 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148217028774016 + maskLow := BitVec.ofNat 64 2251804108718903 + maskHigh := BitVec.ofNat 64 562967133601793 + systematicCode := BitVec.ofNat 64 16412423943197496075 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085047539337344 + maskLow := BitVec.ofNat 64 1337010434409271 + maskHigh := BitVec.ofNat 64 562967133814785 + systematicCode := BitVec.ofNat 64 16412426991566656267 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18050138045155456 + maskLow := BitVec.ofNat 64 1125907423101751 + maskHigh := BitVec.ofNat 64 562984313421825 + systematicCode := BitVec.ofNat 64 16413268117422936843 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36170085341200512 + maskLow := BitVec.ofNat 64 2305843015656342327 + maskHigh := BitVec.ofNat 64 4611686053323997185 + systematicCode := BitVec.ofNat 64 18286789846152450827 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36100266352836736 + maskLow := BitVec.ofNat 64 2305983759587017527 + maskHigh := BitVec.ofNat 64 4611721202800001025 + systematicCode := BitVec.ofNat 64 18292116980527993611 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9289774821146752 + maskLow := BitVec.ofNat 64 2251804108718903 + maskHigh := BitVec.ofNat 64 4611721203336380419 + systematicCode := BitVec.ofNat 64 18292138026490860299 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36170085341202560 + maskLow := BitVec.ofNat 64 1152921509975753527 + maskHigh := BitVec.ofNat 64 9223372071482949633 + systematicCode := BitVec.ofNat 64 18358846336367006475 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36100266352838784 + maskLow := BitVec.ofNat 64 1152991886235992887 + maskHigh := BitVec.ofNat 64 9223389629041344513 + systematicCode := BitVec.ofNat 64 18363893095277466379 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9289774821148800 + maskLow := BitVec.ofNat 64 2251804108718903 + maskHigh := BitVec.ofNat 64 9223389629309272067 + systematicCode := BitVec.ofNat 64 18363913041745482507 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9360697649922176 + maskLow := BitVec.ofNat 64 2251804108718903 + maskHigh := BitVec.ofNat 64 13835621039595847681 + systematicCode := BitVec.ofNat 64 18374092501388038923 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x1507. -/ +def normalizedWeightSixteenCandidateBucket_1507 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18087521418496256 + maskLow := BitVec.ofNat 64 725079544301683999 + maskHigh := BitVec.ofNat 64 281749858811905 + systematicCode := BitVec.ofNat 64 16198794158975489287 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9150690907932928 + maskLow := BitVec.ofNat 64 18014402804516127 + maskHigh := BitVec.ofNat 64 281750023438337 + systematicCode := BitVec.ofNat 64 16198804317462664455 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9360147873024256 + maskLow := BitVec.ofNat 64 18014402804516127 + maskHigh := BitVec.ofNat 64 292538816659457 + systematicCode := BitVec.ofNat 64 16201369568368465159 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148217157765376 + maskLow := BitVec.ofNat 64 18014402804516127 + maskHigh := BitVec.ofNat 64 1125968627408897 + systematicCode := BitVec.ofNat 64 16557669429193544967 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085047668328704 + maskLow := BitVec.ofNat 64 4679525782848799 + maskHigh := BitVec.ofNat 64 1125968630513665 + systematicCode := BitVec.ofNat 64 16557674693798860039 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18050138174146816 + maskLow := BitVec.ofNat 64 4503606606759199 + maskHigh := BitVec.ofNat 64 1126174785798145 + systematicCode := BitVec.ofNat 64 16559076570585306375 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36170085353668864 + maskLow := BitVec.ofNat 64 576460758746203423 + maskHigh := BitVec.ofNat 64 2305843284225818625 + systematicCode := BitVec.ofNat 64 18144359092710610183 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36100266365305088 + maskLow := BitVec.ofNat 64 576601511266682143 + maskHigh := BitVec.ofNat 64 2305851805310910465 + systematicCode := BitVec.ofNat 64 18146882472435324167 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9289774833615104 + maskLow := BitVec.ofNat 64 18014402804516127 + maskHigh := BitVec.ofNat 64 2305851805440966661 + systematicCode := BitVec.ofNat 64 18146892540495598855 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36170085353931008 + maskLow := BitVec.ofNat 64 144115192908023071 + maskHigh := BitVec.ofNat 64 9223372311766237185 + systematicCode := BitVec.ofNat 64 18360528563354277127 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36100266365567232 + maskLow := BitVec.ofNat 64 144150393922848031 + maskHigh := BitVec.ofNat 64 9223374235882225665 + systematicCode := BitVec.ofNat 64 18362210816683742471 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9289774833877248 + maskLow := BitVec.ofNat 64 18014402804516127 + maskHigh := BitVec.ofNat 64 9223374235911593989 + systematicCode := BitVec.ofNat 64 18362217586259465479 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9360697662130432 + maskLow := BitVec.ofNat 64 18014402804516127 + maskHigh := BitVec.ofNat 64 11530341220857413633 + systematicCode := BitVec.ofNat 64 18373531776328733959 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x150d. -/ +def normalizedWeightSixteenCandidateBucket_150d : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .twoE8 + affineCode := BitVec.ofNat 56 18085043209534464 + maskLow := BitVec.ofNat 64 562954248475991 + maskHigh := BitVec.ofNat 64 281483566776321 + systematicCode := BitVec.ofNat 64 16195685752239625485 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18087521439466496 + maskLow := BitVec.ofNat 64 5765170477282690391 + maskHigh := BitVec.ofNat 64 281509336973313 + systematicCode := BitVec.ofNat 64 16197098737915532557 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9150690928903168 + maskLow := BitVec.ofNat 64 2251804108719447 + maskHigh := BitVec.ofNat 64 281510678757377 + systematicCode := BitVec.ofNat 64 16197122090340914445 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9360147893994496 + maskLow := BitVec.ofNat 64 2251804108719447 + maskHigh := BitVec.ofNat 64 369444497391617 + systematicCode := BitVec.ofNat 64 16203064989427635469 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148217027749888 + maskLow := BitVec.ofNat 64 2251804108719447 + maskHigh := BitVec.ofNat 64 1125908496949249 + systematicCode := BitVec.ofNat 64 16555973982263121165 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085047538313216 + maskLow := BitVec.ofNat 64 738876108899671 + maskHigh := BitVec.ofNat 64 1125908497301505 + systematicCode := BitVec.ofNat 64 16555979221099025677 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18050138044131328 + maskLow := BitVec.ofNat 64 562956932810071 + maskHigh := BitVec.ofNat 64 1125934266712065 + systematicCode := BitVec.ofNat 64 16557381097885472013 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36170085341086720 + maskLow := BitVec.ofNat 64 4611686024870167895 + maskHigh := BitVec.ofNat 64 2305843044647174145 + systematicCode := BitVec.ofNat 64 18142676865689916685 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36100266352722944 + maskLow := BitVec.ofNat 64 4611826777390646615 + maskHigh := BitVec.ofNat 64 2305913377958395905 + systematicCode := BitVec.ofNat 64 18148564750995625229 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9289774821032960 + maskLow := BitVec.ofNat 64 2251804108719447 + maskHigh := BitVec.ofNat 64 2305913379031646213 + systematicCode := BitVec.ofNat 64 18148587987425236237 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36170085341348864 + maskLow := BitVec.ofNat 64 1152921509439014231 + maskHigh := BitVec.ofNat 64 9223372071482949633 + systematicCode := BitVec.ofNat 64 18358846336333583629 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36100266352985088 + maskLow := BitVec.ofNat 64 1152956710453839191 + maskHigh := BitVec.ofNat 64 9223389629041344513 + systematicCode := BitVec.ofNat 64 18363893095244043533 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9289774821295104 + maskLow := BitVec.ofNat 64 2251804108719447 + maskHigh := BitVec.ofNat 64 9223389629309263877 + systematicCode := BitVec.ofNat 64 18363913033189102861 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9360697649548288 + maskLow := BitVec.ofNat 64 2251804108719447 + maskHigh := BitVec.ofNat 64 11530340980335575041 + systematicCode := BitVec.ofNat 64 18373531750457873677 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x1513. -/ +def normalizedWeightSixteenCandidateBucket_1513 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.node + (.leaf + { patternClass := .d16Plus + affineCode := BitVec.ofNat 56 54397530474061952 + maskLow := BitVec.ofNat 64 1103823443735 + maskHigh := BitVec.ofNat 64 9259400833873740033 + systematicCode := BitVec.ofNat 64 18370061182969648403 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9360147067767040 + maskLow := BitVec.ofNat 64 1152921508901881623 + maskHigh := BitVec.ofNat 64 290374417383425 + systematicCode := BitVec.ofNat 64 16201357469647705363 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9150690102675712 + maskLow := BitVec.ofNat 64 1152921508901881623 + maskHigh := BitVec.ofNat 64 299067298545665 + systematicCode := BitVec.ofNat 64 16202181969922561299 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18087520613239040 + maskLow := BitVec.ofNat 64 583216156039513879 + maskHigh := BitVec.ofNat 64 299067431190529 + systematicCode := BitVec.ofNat 64 16202185052650935571 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9289774028357888 + maskLow := BitVec.ofNat 64 1152921508901881623 + maskHigh := BitVec.ofNat 64 36037593246236929 + systematicCode := BitVec.ofNat 64 17282201412242576659 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36100265560047872 + maskLow := BitVec.ofNat 64 576602593598441239 + maskHigh := BitVec.ofNat 64 36037593380421633 + systematicCode := BitVec.ofNat 64 17282204538120508691 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36170084548411648 + maskLow := BitVec.ofNat 64 576460758762718999 + maskHigh := BitVec.ofNat 64 36046389339226113 + systematicCode := BitVec.ofNat 64 17283045663976789267 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148216352508160 + maskLow := BitVec.ofNat 64 1152921508901881623 + maskHigh := BitVec.ofNat 64 72057662758486145 + systematicCode := BitVec.ofNat 64 17422360557448140051 }) + ) + ) + ) + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085046863071488 + maskLow := BitVec.ofNat 64 4644891166574359 + maskHigh := BitVec.ofNat 64 72057663025840129 + systematicCode := BitVec.ofNat 64 17422379016392742163 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18050137368889600 + maskLow := BitVec.ofNat 64 4503606078277399 + maskHigh := BitVec.ofNat 64 72075186225020929 + systematicCode := BitVec.ofNat 64 17427145398760183059 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36169809687281920 + maskLow := BitVec.ofNat 64 140743930877719 + maskHigh := BitVec.ofNat 64 108086391056924673 + systematicCode := BitVec.ofNat 64 17433326810180424979 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9289778323325184 + maskLow := BitVec.ofNat 64 1152921508901881623 + maskHigh := BitVec.ofNat 64 9223372071215038849 + systematicCode := BitVec.ofNat 64 18358826649618289939 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36100269855015168 + maskLow := BitVec.ofNat 64 2253453376161559 + maskHigh := BitVec.ofNat 64 9223372071482949633 + systematicCode := BitVec.ofNat 64 18358846259396023571 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36170088843378944 + maskLow := BitVec.ofNat 64 2251804133885719 + maskHigh := BitVec.ofNat 64 9223389629041344513 + systematicCode := BitVec.ofNat 64 18363893017228547347 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36169813982249216 + maskLow := BitVec.ofNat 64 554059241239 + maskHigh := BitVec.ofNat 64 9295429630892703873 + systematicCode := BitVec.ofNat 64 18370621925276325139 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9360692562168064 + maskLow := BitVec.ofNat 64 1152921508901881623 + maskHigh := BitVec.ofNat 64 9331476020366147585 + systematicCode := BitVec.ofNat 64 18370728073419625747 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x1607. -/ +def normalizedWeightSixteenCandidateBucket_1607 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18087520881623680 + maskLow := BitVec.ofNat 64 436849168149973279 + maskHigh := BitVec.ofNat 64 282024740913153 + systematicCode := BitVec.ofNat 64 16199076729168860679 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9150690371060352 + maskLow := BitVec.ofNat 64 36028801313999135 + maskHigh := BitVec.ofNat 64 282024834236417 + systematicCode := BitVec.ofNat 64 16199084692927813127 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9360147336151680 + maskLow := BitVec.ofNat 64 36028801313999135 + maskHigh := BitVec.ofNat 64 288140774342657 + systematicCode := BitVec.ofNat 64 16201088093408597511 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148216620892800 + maskLow := BitVec.ofNat 64 36028801313999135 + maskHigh := BitVec.ofNat 64 2251868534235137 + systematicCode := BitVec.ofNat 64 16629727018936571399 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085047131456128 + maskLow := BitVec.ofNat 64 4609157038672159 + maskHigh := BitVec.ofNat 64 2251868541550593 + systematicCode := BitVec.ofNat 64 16629733387331638791 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18050137637274240 + maskLow := BitVec.ofNat 64 4503605533018399 + maskHigh := BitVec.ofNat 64 2252349570547713 + systematicCode := BitVec.ofNat 64 16631415639583168007 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36169672499939456 + maskLow := BitVec.ofNat 64 288230381521013023 + maskHigh := BitVec.ofNat 64 2305843559036616705 + systematicCode := BitVec.ofNat 64 18144639463864014343 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36047489270302848 + maskLow := BitVec.ofNat 64 288300783550662943 + maskHigh := BitVec.ofNat 64 2305847407268593665 + systematicCode := BitVec.ofNat 64 18146602092658562567 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2534374855690368 + maskLow := BitVec.ofNat 64 36028801313999135 + maskHigh := BitVec.ofNat 64 2305847407327330313 + systematicCode := BitVec.ofNat 64 18146609961729136135 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36169672500199552 + maskLow := BitVec.ofNat 64 144115192908286239 + maskHigh := BitVec.ofNat 64 4611686568216756225 + systematicCode := BitVec.ofNat 64 18288752444293125639 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36047489270562944 + maskLow := BitVec.ofNat 64 144150411102718239 + maskHigh := BitVec.ofNat 64 4611688217459032065 + systematicCode := BitVec.ofNat 64 18290154322157508103 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2534374855950464 + maskLow := BitVec.ofNat 64 36028801313999135 + maskHigh := BitVec.ofNat 64 4611688217484206089 + systematicCode := BitVec.ofNat 64 18290159992238380551 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9360697125259904 + maskLow := BitVec.ofNat 64 36028801313999135 + maskHigh := BitVec.ofNat 64 6919781377218969601 + systematicCode := BitVec.ofNat 64 18301475286114244103 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x160e. -/ +def normalizedWeightSixteenCandidateBucket_160e : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .twoE8 + affineCode := BitVec.ofNat 56 2260638890081280 + maskLow := BitVec.ofNat 64 281479271770519 + maskHigh := BitVec.ofNat 64 281479271743489 + systematicCode := BitVec.ofNat 64 16195403173456385550 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10208046357948416 + maskLow := BitVec.ofNat 64 6917810506912827799 + maskHigh := BitVec.ofNat 64 281509336973313 + systematicCode := BitVec.ofNat 64 16197098737932244494 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9649494451038208 + maskLow := BitVec.ofNat 64 2251804108720535 + maskHigh := BitVec.ofNat 64 281510947127297 + systematicCode := BitVec.ofNat 64 16197122094619104782 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9592766522992640 + maskLow := BitVec.ofNat 64 2251804108720535 + maskHigh := BitVec.ofNat 64 387032388468737 + systematicCode := BitVec.ofNat 64 16203066084644296206 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9658737220659200 + maskLow := BitVec.ofNat 64 2251804108720535 + maskHigh := BitVec.ofNat 64 2251804108742657 + systematicCode := BitVec.ofNat 64 16627748997517743630 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11334392941389824 + maskLow := BitVec.ofNat 64 387032388012439 + maskHigh := BitVec.ofNat 64 2251804109176833 + systematicCode := BitVec.ofNat 64 16627755335848498702 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11338756628162560 + maskLow := BitVec.ofNat 64 281480882358679 + maskHigh := BitVec.ofNat 64 2251834173489153 + systematicCode := BitVec.ofNat 64 16629437588100027918 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11338761226971136 + maskLow := BitVec.ofNat 64 4611686023796689303 + maskHigh := BitVec.ofNat 64 2305843044647174145 + systematicCode := BitVec.ofNat 64 18142676865673205262 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11334397540198400 + maskLow := BitVec.ofNat 64 4611756425826339223 + maskHigh := BitVec.ofNat 64 2305913377958395905 + systematicCode := BitVec.ofNat 64 18148564750978913806 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9658741819467776 + maskLow := BitVec.ofNat 64 2251804108720535 + maskHigh := BitVec.ofNat 64 2305913379031629833 + systematicCode := BitVec.ofNat 64 18148587983147046414 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11338761228255360 + maskLow := BitVec.ofNat 64 2305843014046124439 + maskHigh := BitVec.ofNat 64 4611686053323997185 + systematicCode := BitVec.ofNat 64 18286789846102316558 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11334397541482624 + maskLow := BitVec.ofNat 64 2305878232240556439 + maskHigh := BitVec.ofNat 64 4611721202800001025 + systematicCode := BitVec.ofNat 64 18292116980477859342 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9658741820752000 + maskLow := BitVec.ofNat 64 2251804108720535 + maskHigh := BitVec.ofNat 64 4611721203336355849 + systematicCode := BitVec.ofNat 64 18292138013656290830 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9592251126669440 + maskLow := BitVec.ofNat 64 2251804108720535 + maskHigh := BitVec.ofNat 64 6919780861815029761 + systematicCode := BitVec.ofNat 64 18301475255931573774 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x1613. -/ +def normalizedWeightSixteenCandidateBucket_1613 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.node + (.leaf + { patternClass := .d16Plus + affineCode := BitVec.ofNat 56 54397530474053760 + maskLow := BitVec.ofNat 64 2203351853847 + maskHigh := BitVec.ofNat 64 4647714815446352385 + systematicCode := BitVec.ofNat 64 18298004692755158547 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9360147067732608 + maskLow := BitVec.ofNat 64 2305843013508729623 + maskHigh := BitVec.ofNat 64 285976639307777 + systematicCode := BitVec.ofNat 64 16201075994687837715 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9150690102641280 + maskLow := BitVec.ofNat 64 2305843013508729623 + maskHigh := BitVec.ofNat 64 316659417481217 + systematicCode := BitVec.ofNat 64 16202462345387709971 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18087520613204608 + maskLow := BitVec.ofNat 64 294985779887803159 + maskHigh := BitVec.ofNat 64 316659885670401 + systematicCode := BitVec.ofNat 64 16202467622844306963 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2534374587271296 + maskLow := BitVec.ofNat 64 2305843013508729623 + maskHigh := BitVec.ofNat 64 36033195132600833 + systematicCode := BitVec.ofNat 64 17281918833476113939 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36047489001883776 + maskLow := BitVec.ofNat 64 288302948214180631 + maskHigh := BitVec.ofNat 64 36033195602345985 + systematicCode := BitVec.ofNat 64 17281924158343747091 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36169672231520384 + maskLow := BitVec.ofNat 64 288230381554043671 + maskHigh := BitVec.ofNat 64 36063981458161665 + systematicCode := BitVec.ofNat 64 17283326035130193427 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148216352473728 + maskLow := BitVec.ofNat 64 2305843013508729623 + maskHigh := BitVec.ofNat 64 144115256796397697 + systematicCode := BitVec.ofNat 64 17494418147191166483 }) + ) + ) + ) + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085046863037056 + maskLow := BitVec.ofNat 64 4574522422397719 + maskHigh := BitVec.ofNat 64 144115257332203521 + systematicCode := BitVec.ofNat 64 17494437709925520915 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18050137368855168 + maskLow := BitVec.ofNat 64 4503605004536599 + maskHigh := BitVec.ofNat 64 144150372448993281 + systematicCode := BitVec.ofNat 64 17499484467758044691 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36169809662085248 + maskLow := BitVec.ofNat 64 70374112963351 + maskHigh := BitVec.ofNat 64 180143985094836225 + systematicCode := BitVec.ofNat 64 17505383300395046419 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2534378882236544 + maskLow := BitVec.ofNat 64 2305843013508729623 + maskHigh := BitVec.ofNat 64 4611686052787651201 + systematicCode := BitVec.ofNat 64 18286769059875395091 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36047493296849024 + maskLow := BitVec.ofNat 64 2254552887790359 + maskHigh := BitVec.ofNat 64 4611686053323997185 + systematicCode := BitVec.ofNat 64 18286789764886500883 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36169676526485632 + maskLow := BitVec.ofNat 64 2251804150663959 + maskHigh := BitVec.ofNat 64 4611721202800001025 + systematicCode := BitVec.ofNat 64 18292116898184107539 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36169813957050496 + maskLow := BitVec.ofNat 64 554059246359 + maskHigh := BitVec.ofNat 64 4755801206503243905 + systematicCode := BitVec.ofNat 64 18298845806215173651 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9360692562135680 + maskLow := BitVec.ofNat 64 2305843013508729623 + maskHigh := BitVec.ofNat 64 4791865188431167489 + systematicCode := BitVec.ofNat 64 18298951958670218771 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x1615. -/ +def normalizedWeightSixteenCandidateBucket_1615 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.node + (.leaf + { patternClass := .d16Plus + affineCode := BitVec.ofNat 56 54397530472997120 + maskLow := BitVec.ofNat 64 4402408672535 + maskHigh := BitVec.ofNat 64 2341871806232658945 + systematicCode := BitVec.ofNat 64 18153891712326178325 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9360147067521280 + maskLow := BitVec.ofNat 64 4611686022722424087 + maskHigh := BitVec.ofNat 64 283778152923137 + systematicCode := BitVec.ofNat 64 16200513044768101909 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9150690102429952 + maskLow := BitVec.ofNat 64 4611686022722424087 + maskHigh := BitVec.ofNat 64 351843756015617 + systematicCode := BitVec.ofNat 64 16203023096318006805 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18087520612993280 + maskLow := BitVec.ofNat 64 150870591811947799 + maskHigh := BitVec.ofNat 64 351844794630145 + systematicCode := BitVec.ofNat 64 16203032763231049237 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2534374587515136 + maskLow := BitVec.ofNat 64 4611686022722424087 + maskHigh := BitVec.ofNat 64 36030996075783169 + systematicCode := BitVec.ofNat 64 17281353675943187989 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36047489002127616 + maskLow := BitVec.ofNat 64 144154774789491991 + maskHigh := BitVec.ofNat 64 36030997115961345 + systematicCode := BitVec.ofNat 64 17281363398790223381 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36169672231764224 + maskLow := BitVec.ofNat 64 144115192974871831 + maskHigh := BitVec.ofNat 64 36099165796696065 + systematicCode := BitVec.ofNat 64 17283886777437001237 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148216352262400 + maskLow := BitVec.ofNat 64 4611686022722424087 + maskHigh := BitVec.ofNat 64 288230444872245377 + systematicCode := BitVec.ofNat 64 17638533326677218837 }) + ) + ) + ) + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085046862825728 + maskLow := BitVec.ofNat 64 4539338050309399 + maskHigh := BitVec.ofNat 64 288230445944930305 + systematicCode := BitVec.ofNat 64 17638555096991077909 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18050137368643840 + maskLow := BitVec.ofNat 64 4503604467666199 + maskHigh := BitVec.ofNat 64 288300744896937985 + systematicCode := BitVec.ofNat 64 17644162605753767445 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36169809662329088 + maskLow := BitVec.ofNat 64 35189204012311 + maskHigh := BitVec.ofNat 64 324259173170683905 + systematicCode := BitVec.ofNat 64 17649496280824288789 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2534378882220288 + maskLow := BitVec.ofNat 64 4611686022722424087 + maskHigh := BitVec.ofNat 64 2305843043573957761 + systematicCode := BitVec.ofNat 64 18142653880389604885 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36047493296832768 + maskLow := BitVec.ofNat 64 2256751911046423 + maskHigh := BitVec.ofNat 64 2305843044647174145 + systematicCode := BitVec.ofNat 64 18142676775867454997 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36169676526469376 + maskLow := BitVec.ofNat 64 2251804184218903 + maskHigh := BitVec.ofNat 64 2305913377958395905 + systematicCode := BitVec.ofNat 64 18148564660095227413 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36169813957034240 + maskLow := BitVec.ofNat 64 554059255063 + maskHigh := BitVec.ofNat 64 2594073385365405825 + systematicCode := BitVec.ofNat 64 18155293568092870165 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9360692562184448 + maskLow := BitVec.ofNat 64 4611686022722424087 + maskHigh := BitVec.ofNat 64 2630172552202289153 + systematicCode := BitVec.ofNat 64 18155399729171404309 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x190b. -/ +def normalizedWeightSixteenCandidateBucket_190b : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18087521437223168 + maskLow := BitVec.ofNat 64 2451084101491429687 + maskHigh := BitVec.ofNat 64 281749858811905 + systematicCode := BitVec.ofNat 64 16198794176155097355 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9150690926659840 + maskLow := BitVec.ofNat 64 18014402804519223 + maskHigh := BitVec.ofNat 64 281750425305089 + systematicCode := BitVec.ofNat 64 16198808715442067723 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9360147891751168 + maskLow := BitVec.ofNat 64 18014402804519223 + maskHigh := BitVec.ofNat 64 318875556118529 + systematicCode := BitVec.ofNat 64 16202495451095439627 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148217026676992 + maskLow := BitVec.ofNat 64 18014402804519223 + maskHigh := BitVec.ofNat 64 4503616807536641 + systematicCode := BitVec.ofNat 64 16844769507324795147 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085047537240320 + maskLow := BitVec.ofNat 64 1275437783257399 + maskHigh := BitVec.ofNat 64 4503616811433985 + systematicCode := BitVec.ofNat 64 16844779152863598859 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18050138043058432 + maskLow := BitVec.ofNat 64 1125906483581239 + maskHigh := BitVec.ofNat 64 4503874505539585 + systematicCode := BitVec.ofNat 64 16847302531510376715 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36170085339103488 + maskLow := BitVec.ofNat 64 2305843015657263415 + maskHigh := BitVec.ofNat 64 576461027718201345 + systematicCode := BitVec.ofNat 64 17856133131785541899 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36100266350739712 + maskLow := BitVec.ofNat 64 2305983819716563255 + maskHigh := BitVec.ofNat 64 576495936679706625 + systematicCode := BitVec.ofNat 64 17859778013370587403 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9289774819049728 + maskLow := BitVec.ofNat 64 18014402804519223 + maskHigh := BitVec.ofNat 64 576495937212416017 + systematicCode := BitVec.ofNat 64 17859792462364350731 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36170085372657920 + maskLow := BitVec.ofNat 64 144115192506159415 + maskHigh := BitVec.ofNat 64 9223372311766237185 + systematicCode := BitVec.ofNat 64 18360528563287431435 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36100266384294144 + maskLow := BitVec.ofNat 64 144124057183392055 + maskHigh := BitVec.ofNat 64 9223374235882225665 + systematicCode := BitVec.ofNat 64 18362210816616896779 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9289774852604160 + maskLow := BitVec.ofNat 64 18014402804519223 + maskHigh := BitVec.ofNat 64 9223374235911587857 + systematicCode := BitVec.ofNat 64 18362217569146706187 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9360697614272768 + maskLow := BitVec.ofNat 64 18014402804519223 + maskHigh := BitVec.ofNat 64 9804336663667671041 + systematicCode := BitVec.ofNat 64 18372410274468403467 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x190d. -/ +def normalizedWeightSixteenCandidateBucket_190d : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18087521437385728 + maskLow := BitVec.ofNat 64 4900479348827558231 + maskHigh := BitVec.ofNat 64 281612417761281 + systematicCode := BitVec.ofNat 64 16198229035801778445 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9150690926822400 + maskLow := BitVec.ofNat 64 9007203549778263 + maskHigh := BitVec.ofNat 64 281613556645889 + systematicCode := BitVec.ofNat 64 16198247973068151053 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9360147891913728 + maskLow := BitVec.ofNat 64 9007203549778263 + maskHigh := BitVec.ofNat 64 356250359431169 + systematicCode := BitVec.ofNat 64 16203060591448496397 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148217025669120 + maskLow := BitVec.ofNat 64 9007203549778263 + maskHigh := BitVec.ofNat 64 4503608217470977 + systematicCode := BitVec.ofNat 64 16844204358347987213 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085047536232448 + maskLow := BitVec.ofNat 64 712487829836119 + maskHigh := BitVec.ofNat 64 4503608219402241 + systematicCode := BitVec.ofNat 64 16844213995296987405 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18050138042050560 + maskLow := BitVec.ofNat 64 562956530159959 + maskHigh := BitVec.ofNat 64 4503737066455041 + systematicCode := BitVec.ofNat 64 16846737373943765261 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36170085339005952 + maskLow := BitVec.ofNat 64 4611686024870957399 + maskHigh := BitVec.ofNat 64 576460890816118785 + systematicCode := BitVec.ofNat 64 17855572389445310733 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36100266350642176 + maskLow := BitVec.ofNat 64 4611826828930257239 + maskHigh := BitVec.ofNat 64 576531121049698305 + systematicCode := BitVec.ofNat 64 17860338772890687757 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9289774818952192 + maskLow := BitVec.ofNat 64 9007203549778263 + maskHigh := BitVec.ofNat 64 576531122121375761 + systematicCode := BitVec.ofNat 64 17860357611340896525 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36170085372560384 + maskLow := BitVec.ofNat 64 288230380582015319 + maskHigh := BitVec.ofNat 64 9223372174360838145 + systematicCode := BitVec.ofNat 64 18359967820947200269 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36100266384196608 + maskLow := BitVec.ofNat 64 288239245259247959 + maskHigh := BitVec.ofNat 64 9223376434903384065 + systematicCode := BitVec.ofNat 64 18362771576136997133 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9289774852506624 + maskLow := BitVec.ofNat 64 9007203549778263 + maskHigh := BitVec.ofNat 64 9223376434968397841 + systematicCode := BitVec.ofNat 64 18362782718123251981 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9360697614175232 + maskLow := BitVec.ofNat 64 9007203549778263 + maskHigh := BitVec.ofNat 64 9804336526226620417 + systematicCode := BitVec.ofNat 64 18372410265844783373 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x1913. -/ +def normalizedWeightSixteenCandidateBucket_1913 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18087520638208256 + maskLow := BitVec.ofNat 64 2315976112670315287 + maskHigh := BitVec.ofNat 64 285873090330625 + systematicCode := BitVec.ofNat 64 16201054771927587091 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9150690127644928 + maskLow := BitVec.ofNat 64 288230380446749463 + maskHigh := BitVec.ofNat 64 285873562451969 + systematicCode := BitVec.ofNat 64 16201060480896538899 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9360147092736256 + maskLow := BitVec.ofNat 64 288230380446749463 + maskHigh := BitVec.ofNat 64 316814034731009 + systematicCode := BitVec.ofNat 64 16202486655137159443 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36170084540088576 + maskLow := BitVec.ofNat 64 2305843015672992535 + maskHigh := BitVec.ofNat 64 36033195602345985 + systematicCode := BitVec.ofNat 64 17281924179296327955 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36100265551724800 + maskLow := BitVec.ofNat 64 2305984850508714775 + maskHigh := BitVec.ofNat 64 36063981458161665 + systematicCode := BitVec.ofNat 64 17283326057160710419 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9289774020034816 + maskLow := BitVec.ofNat 64 288230380446749463 + maskHigh := BitVec.ofNat 64 36063981927956737 + systematicCode := BitVec.ofNat 64 17283331710195669267 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148216227662080 + maskLow := BitVec.ofNat 64 288230380446749463 + maskHigh := BitVec.ofNat 64 72057611218092161 + systematicCode := BitVec.ofNat 64 17421230259494525203 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085046738225408 + maskLow := BitVec.ofNat 64 1267191446049559 + maskHigh := BitVec.ofNat 64 72057611284905985 + systematicCode := BitVec.ofNat 64 17421248701259520275 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18050137244043520 + maskLow := BitVec.ofNat 64 1125906357752599 + maskHigh := BitVec.ofNat 64 72061992084701185 + systematicCode := BitVec.ofNat 64 17426015083626961171 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9289778315002112 + maskLow := BitVec.ofNat 64 288230380446749463 + maskHigh := BitVec.ofNat 64 9223372174295826817 + systematicCode := BitVec.ofNat 64 18359956947571382547 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36100269846692096 + maskLow := BitVec.ofNat 64 9008852817220375 + maskHigh := BitVec.ofNat 64 9223372174360838145 + systematicCode := BitVec.ofNat 64 18359967778436225299 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36170088835055872 + maskLow := BitVec.ofNat 64 9007203574944535 + maskHigh := BitVec.ofNat 64 9223376434903384065 + systematicCode := BitVec.ofNat 64 18362771532548086035 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9360692553844992 + maskLow := BitVec.ofNat 64 288230380446749463 + maskHigh := BitVec.ofNat 64 9331462826025287681 + systematicCode := BitVec.ofNat 64 18370728056172386579 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x1915. -/ +def normalizedWeightSixteenCandidateBucket_1915 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18087520638370816 + maskLow := BitVec.ofNat 64 4630263371185329431 + maskHigh := BitVec.ofNat 64 283674033520641 + systematicCode := BitVec.ofNat 64 16200489631574268181 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9150690127807488 + maskLow := BitVec.ofNat 64 144115192370894103 + maskHigh := BitVec.ofNat 64 283675078033409 + systematicCode := BitVec.ofNat 64 16200499738522622229 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9360147092898816 + maskLow := BitVec.ofNat 64 144115192370894103 + maskHigh := BitVec.ofNat 64 352127222284289 + systematicCode := BitVec.ofNat 64 16203051795490216213 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36170084539991040 + maskLow := BitVec.ofNat 64 4611686024886686999 + maskHigh := BitVec.ofNat 64 36030997115961345 + systematicCode := BitVec.ofNat 64 17281363436956096789 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36100265551627264 + maskLow := BitVec.ofNat 64 4611827859722409239 + maskHigh := BitVec.ofNat 64 36099165796696065 + systematicCode := BitVec.ofNat 64 17283886816680810773 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9289774019937280 + maskLow := BitVec.ofNat 64 144115192370894103 + maskHigh := BitVec.ofNat 64 36099166836916481 + systematicCode := BitVec.ofNat 64 17283896859172215061 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148216226654208 + maskLow := BitVec.ofNat 64 144115192370894103 + maskHigh := BitVec.ofNat 64 72057602628026497 + systematicCode := BitVec.ofNat 64 17420665110517717269 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085046737217536 + maskLow := BitVec.ofNat 64 704241492628759 + maskHigh := BitVec.ofNat 64 72057602661416961 + systematicCode := BitVec.ofNat 64 17420683543692908821 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18050137243035648 + maskLow := BitVec.ofNat 64 562956404331799 + maskHigh := BitVec.ofNat 64 72059793061314561 + systematicCode := BitVec.ofNat 64 17425449926060349717 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9289778314904576 + maskLow := BitVec.ofNat 64 144115192370894103 + maskHigh := BitVec.ofNat 64 9223372311736877441 + systematicCode := BitVec.ofNat 64 18360522096547928341 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36100269846594560 + maskLow := BitVec.ofNat 64 18016052071961879 + maskHigh := BitVec.ofNat 64 9223372311766237185 + systematicCode := BitVec.ofNat 64 18360528537956325653 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36170088834958336 + maskLow := BitVec.ofNat 64 18014402829686039 + maskHigh := BitVec.ofNat 64 9223374235882225665 + systematicCode := BitVec.ofNat 64 18362210790207854869 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9360692553747456 + maskLow := BitVec.ofNat 64 144115192370894103 + maskHigh := BitVec.ofNat 64 9331460626968477697 + systematicCode := BitVec.ofNat 64 18370728047548766485 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x1a0b. -/ +def normalizedWeightSixteenCandidateBucket_1a0b : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18087520900350592 + maskLow := BitVec.ofNat 64 1298162596884586807 + maskHigh := BitVec.ofNat 64 282024740913153 + systematicCode := BitVec.ofNat 64 16199076746348468747 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9150690389787264 + maskLow := BitVec.ofNat 64 36028801314005303 + maskHigh := BitVec.ofNat 64 282025034776577 + systematicCode := BitVec.ofNat 64 16199089090907216395 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9360147354878592 + maskLow := BitVec.ofNat 64 36028801314005303 + maskHigh := BitVec.ofNat 64 301283374268417 + systematicCode := BitVec.ofNat 64 16202213976135571979 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148216489804416 + maskLow := BitVec.ofNat 64 36028801314005303 + maskHigh := BitVec.ofNat 64 9007216434890753 + systematicCode := BitVec.ofNat 64 16916827097067821579 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085047000367744 + maskLow := BitVec.ofNat 64 1205069039083831 + maskHigh := BitVec.ofNat 64 9007216442998785 + systematicCode := BitVec.ofNat 64 16916837846396377611 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18050137506185856 + maskLow := BitVec.ofNat 64 1125905409843511 + maskHigh := BitVec.ofNat 64 9007749010817025 + systematicCode := BitVec.ofNat 64 16919641600508238347 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36169672485374080 + maskLow := BitVec.ofNat 64 1152921509977727287 + maskHigh := BitVec.ofNat 64 576461302327672833 + systematicCode := BitVec.ofNat 64 17856413502938946059 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36047489255737472 + maskLow := BitVec.ofNat 64 1152992015085019447 + maskHigh := BitVec.ofNat 64 576478344497856513 + systematicCode := BitVec.ofNat 64 17859497633593825803 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2534374841124992 + maskLow := BitVec.ofNat 64 36028801314005303 + maskHigh := BitVec.ofNat 64 576478344757919777 + systematicCode := BitVec.ofNat 64 17859509883597888011 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36169672518926464 + maskLow := BitVec.ofNat 64 144115192507212087 + maskHigh := BitVec.ofNat 64 4611686568216756225 + systematicCode := BitVec.ofNat 64 18288752444226279947 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36047489289289856 + maskLow := BitVec.ofNat 64 144124125902872887 + maskHigh := BitVec.ofNat 64 4611688217459032065 + systematicCode := BitVec.ofNat 64 18290154322090662411 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2534374874677376 + maskLow := BitVec.ofNat 64 36028801314005303 + maskHigh := BitVec.ofNat 64 4611688217484199969 + systematicCode := BitVec.ofNat 64 18290159975125621259 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9360697077402240 + maskLow := BitVec.ofNat 64 36028801314005303 + maskHigh := BitVec.ofNat 64 5197154519749754881 + systematicCode := BitVec.ofNat 64 18300353784253913611 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x1a0e. -/ +def normalizedWeightSixteenCandidateBucket_1a0e : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10208046374594560 + maskLow := BitVec.ofNat 64 5188428250002563479 + maskHigh := BitVec.ofNat 64 281612417761281 + systematicCode := BitVec.ofNat 64 16198229035818490382 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9649494467684352 + maskLow := BitVec.ofNat 64 9007203549782423 + maskHigh := BitVec.ofNat 64 281613623689217 + systematicCode := BitVec.ofNat 64 16198247977346341390 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9592766539638784 + maskLow := BitVec.ofNat 64 9007203549782423 + maskHigh := BitVec.ofNat 64 360644110974977 + systematicCode := BitVec.ofNat 64 16203061686665157134 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9658737237305344 + maskLow := BitVec.ofNat 64 9007203549782423 + maskHigh := BitVec.ofNat 64 9007203549792257 + systematicCode := BitVec.ofNat 64 16915979373602609678 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11334392958035968 + maskLow := BitVec.ofNat 64 360644108951959 + maskHigh := BitVec.ofNat 64 9007203551805441 + systematicCode := BitVec.ofNat 64 16915990110046460430 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11338756644808704 + maskLow := BitVec.ofNat 64 281480479711639 + maskHigh := BitVec.ofNat 64 9007336693760001 + systematicCode := BitVec.ofNat 64 16918793864158321166 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11338761177032704 + maskLow := BitVec.ofNat 64 4611686023798268311 + maskHigh := BitVec.ofNat 64 576460890816118785 + systematicCode := BitVec.ofNat 64 17855572389428599310 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11334397490259968 + maskLow := BitVec.ofNat 64 4611756528905560471 + maskHigh := BitVec.ofNat 64 576531121049698305 + systematicCode := BitVec.ofNat 64 17860338772873976334 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9658741769529344 + maskLow := BitVec.ofNat 64 9007203549782423 + maskHigh := BitVec.ofNat 64 576531122121359393 + systematicCode := BitVec.ofNat 64 17860357607062706702 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11338761342697600 + maskLow := BitVec.ofNat 64 576460756734779799 + maskHigh := BitVec.ofNat 64 4611686156000559105 + systematicCode := BitVec.ofNat 64 18287911330715933198 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11334397655924864 + maskLow := BitVec.ofNat 64 576469690130440599 + maskHigh := BitVec.ofNat 64 4611694814522507265 + systematicCode := BitVec.ofNat 64 18290995461370812942 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9658741935194240 + maskLow := BitVec.ofNat 64 9007203549782423 + maskHigh := BitVec.ofNat 64 4611694814654629921 + systematicCode := BitVec.ofNat 64 18291007698590439950 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9592251112104064 + maskLow := BitVec.ofNat 64 9007203549782423 + maskHigh := BitVec.ofNat 64 5197154107426603009 + systematicCode := BitVec.ofNat 64 18300353771318483470 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x1a13. -/ +def normalizedWeightSixteenCandidateBucket_1a13 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18087520634012288 + maskLow := BitVec.ofNat 64 1163054608063472407 + maskHigh := BitVec.ofNat 64 290271203950593 + systematicCode := BitVec.ofNat 64 16201337342120958483 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9150690123448960 + maskLow := BitVec.ofNat 64 576460756598465303 + maskHigh := BitVec.ofNat 64 290271340527617 + systematicCode := BitVec.ofNat 64 16201340856361687571 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9360147088540288 + maskLow := BitVec.ofNat 64 576460756598465303 + maskHigh := BitVec.ofNat 64 299221915795457 + systematicCode := BitVec.ofNat 64 16202205180177291795 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36169672219035776 + maskLow := BitVec.ofNat 64 1152921510009185047 + maskHigh := BitVec.ofNat 64 36037593380421633 + systematicCode := BitVec.ofNat 64 17282204550449732115 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36047488989399168 + maskLow := BitVec.ofNat 64 1152994076669322007 + maskHigh := BitVec.ofNat 64 36046389339226113 + systematicCode := BitVec.ofNat 64 17283045677383948819 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2534374574786688 + maskLow := BitVec.ofNat 64 576460756598465303 + maskHigh := BitVec.ofNat 64 36046389473460737 + systematicCode := BitVec.ofNat 64 17283049131429206547 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148216223466112 + maskLow := BitVec.ofNat 64 576460756598465303 + maskHigh := BitVec.ofNat 64 144115205256003713 + systematicCode := BitVec.ofNat 64 17493287849237551635 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085046734029440 + maskLow := BitVec.ofNat 64 1196822701875991 + maskHigh := BitVec.ofNat 64 144115205389942785 + systematicCode := BitVec.ofNat 64 17493307394792299027 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18050137239847552 + maskLow := BitVec.ofNat 64 1125905284014871 + maskHigh := BitVec.ofNat 64 144123984169140225 + systematicCode := BitVec.ofNat 64 17498354152624822803 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2534378869751936 + maskLow := BitVec.ofNat 64 576460756598465303 + maskHigh := BitVec.ofNat 64 4611686155868439169 + systematicCode := BitVec.ofNat 64 18287899357828487699 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36047493284364416 + maskLow := BitVec.ofNat 64 9009952328852247 + maskHigh := BitVec.ofNat 64 4611686156000559105 + systematicCode := BitVec.ofNat 64 18287911283926702611 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36169676514001024 + maskLow := BitVec.ofNat 64 9007203591725847 + maskHigh := BitVec.ofNat 64 4611694814522507265 + systematicCode := BitVec.ofNat 64 18290995413503646227 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9360692549651072 + maskLow := BitVec.ofNat 64 576460756598465303 + maskHigh := BitVec.ofNat 64 4791838799749447681 + systematicCode := BitVec.ofNat 64 18298951941422979603 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x1a16. -/ +def normalizedWeightSixteenCandidateBucket_1a16 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10208042113181696 + maskLow := BitVec.ofNat 64 4647996294718105879 + maskHigh := BitVec.ofNat 64 283674033520641 + systematicCode := BitVec.ofNat 64 16200489631590980118 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9649490206271488 + maskLow := BitVec.ofNat 64 144115192370899223 + maskHigh := BitVec.ofNat 64 283675082162177 + systematicCode := BitVec.ofNat 64 16200499742800812566 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9592762278225920 + maskLow := BitVec.ofNat 64 144115192370899223 + maskHigh := BitVec.ofNat 64 352397805223937 + systematicCode := BitVec.ofNat 64 16203052890706876950 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11338748392794112 + maskLow := BitVec.ofNat 64 4611686023829727511 + maskHigh := BitVec.ofNat 64 36030997115961345 + systematicCode := BitVec.ofNat 64 17281363436939385366 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11334384706021376 + maskLow := BitVec.ofNat 64 4611758590489864471 + maskHigh := BitVec.ofNat 64 36099165796696065 + systematicCode := BitVec.ofNat 64 17283886816664099350 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9658728985290752 + maskLow := BitVec.ofNat 64 144115192370899223 + maskHigh := BitVec.ofNat 64 36099166836900353 + systematicCode := BitVec.ofNat 64 17283896854894025238 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9658732975892480 + maskLow := BitVec.ofNat 64 144115192370899223 + maskHigh := BitVec.ofNat 64 144115192370905217 + systematicCode := BitVec.ofNat 64 17492440125772339734 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11334388696623104 + maskLow := BitVec.ofNat 64 352397771745559 + maskHigh := BitVec.ofNat 64 144115192404377601 + systematicCode := BitVec.ofNat 64 17492459658442381846 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11338752383395840 + maskLow := BitVec.ofNat 64 281480353884439 + maskHigh := BitVec.ofNat 64 144117387099176961 + systematicCode := BitVec.ofNat 64 17497506416274905622 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9658750191681664 + maskLow := BitVec.ofNat 64 144115192370899223 + maskHigh := BitVec.ofNat 64 4611686568191591041 + systematicCode := BitVec.ofNat 64 18288747081293306390 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11334405912412288 + maskLow := BitVec.ofNat 64 36031550093076759 + maskHigh := BitVec.ofNat 64 4611686568216756225 + systematicCode := BitVec.ofNat 64 18288752423206853142 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11338769599185024 + maskLow := BitVec.ofNat 64 36028801355950359 + maskHigh := BitVec.ofNat 64 4611688217459032065 + systematicCode := BitVec.ofNat 64 18290154299993299478 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9592242855616640 + maskLow := BitVec.ofNat 64 144115192370899223 + maskHigh := BitVec.ofNat 64 4791832202579017729 + systematicCode := BitVec.ofNat 64 18298951928487549462 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x1a19. -/ +def normalizedWeightSixteenCandidateBucket_1a19 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.node + (.leaf + { patternClass := .d16Plus + affineCode := BitVec.ofNat 56 54397530333585664 + maskLow := BitVec.ofNat 64 17596749541655 + maskHigh := BitVec.ofNat 64 612489549322391553 + systematicCode := BitVec.ofNat 64 17865665751467956761 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9360147061278976 + maskLow := BitVec.ofNat 64 4611686022722433303 + maskHigh := BitVec.ofNat 64 283829692530689 + systematicCode := BitVec.ofNat 64 16200516330418084377 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9150690096187648 + maskLow := BitVec.ofNat 64 4611686022722433303 + maskHigh := BitVec.ofNat 64 351843756802049 + systematicCode := BitVec.ofNat 64 16203023109152578073 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18087520606750976 + maskLow := BitVec.ofNat 64 154248291532484887 + maskHigh := BitVec.ofNat 64 351844794630145 + systematicCode := BitVec.ofNat 64 16203032763281185305 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2534374606242048 + maskLow := BitVec.ofNat 64 4611686022722433303 + maskHigh := BitVec.ofNat 64 36030996075780097 + systematicCode := BitVec.ofNat 64 17281353663108618777 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36047489020854528 + maskLow := BitVec.ofNat 64 144141580649967895 + maskHigh := BitVec.ofNat 64 36030997115961345 + systematicCode := BitVec.ofNat 64 17281363398740089369 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36169672250491136 + maskLow := BitVec.ofNat 64 144115192773554455 + maskHigh := BitVec.ofNat 64 36099165796696065 + systematicCode := BitVec.ofNat 64 17283886777386867225 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2534378867654912 + maskLow := BitVec.ofNat 64 4611686022722433303 + maskHigh := BitVec.ofNat 64 576460889744478337 + systematicCode := BitVec.ofNat 64 17855553819371117081 }) + ) + ) + ) + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36047493282267392 + maskLow := BitVec.ofNat 64 9025345491644695 + maskHigh := BitVec.ofNat 64 576460890816118785 + systematicCode := BitVec.ofNat 64 17855572316869564953 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36169676511904000 + maskLow := BitVec.ofNat 64 9007203826610455 + maskHigh := BitVec.ofNat 64 576531121049698305 + systematicCode := BitVec.ofNat 64 17860338699237005849 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148216196204800 + maskLow := BitVec.ofNat 64 4611686022722433303 + maskHigh := BitVec.ofNat 64 1152921521786980481 + systematicCode := BitVec.ofNat 64 17925633387695708697 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085046706768128 + maskLow := BitVec.ofNat 64 1135250050724119 + maskHigh := BitVec.ofNat 64 1152921522860457985 + systematicCode := BitVec.ofNat 64 17925659555988970009 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18050137212586240 + maskLow := BitVec.ofNat 64 1125904344494359 + maskHigh := BitVec.ofNat 64 1152991873351286785 + systematicCode := BitVec.ofNat 64 17932388566611991065 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36169809689379072 + maskLow := BitVec.ofNat 64 8800522301719 + maskHigh := BitVec.ofNat 64 1188950301625812993 + systematicCode := BitVec.ofNat 64 17937722241682512409 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36169813950791936 + maskLow := BitVec.ofNat 64 554059264279 + maskHigh := BitVec.ofNat 64 1729382256910270593 + systematicCode := BitVec.ofNat 64 17939965210909219353 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9360692555942144 + maskLow := BitVec.ofNat 64 4611686022722433303 + maskHigh := BitVec.ofNat 64 1765481423747153921 + systematicCode := BitVec.ofNat 64 17940071371987753497 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x1c0d. -/ +def normalizedWeightSixteenCandidateBucket_1c0d : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18087520900301824 + maskLow := BitVec.ofNat 64 1441714835007029591 + maskHigh := BitVec.ofNat 64 282024740913153 + systematicCode := BitVec.ofNat 64 16199076746381892621 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9150690389738496 + maskLow := BitVec.ofNat 64 36028801314013527 + maskHigh := BitVec.ofNat 64 282025068199937 + systematicCode := BitVec.ofNat 64 16199089099463597069 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9360147354829824 + maskLow := BitVec.ofNat 64 36028801314013527 + maskHigh := BitVec.ofNat 64 303473807589377 + systematicCode := BitVec.ofNat 64 16202216166568893453 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148216488585216 + maskLow := BitVec.ofNat 64 36028801314013527 + maskHigh := BitVec.ofNat 64 18014407099557889 + systematicCode := BitVec.ofNat 64 17060377127577066509 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085046999148544 + maskLow := BitVec.ofNat 64 606934713581911 + maskHigh := BitVec.ofNat 64 18014407107805185 + systematicCode := BitVec.ofNat 64 17060390075895323661 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18050137504966656 + maskLow := BitVec.ofNat 64 562954919559511 + maskHigh := BitVec.ofNat 64 18014948265426945 + systematicCode := BitVec.ofNat 64 17063754580937350157 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36169672485520384 + maskLow := BitVec.ofNat 64 1152921509442961751 + maskHigh := BitVec.ofNat 64 576461302327672833 + systematicCode := BitVec.ofNat 64 17856413502905523213 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36047489255883776 + maskLow := BitVec.ofNat 64 1152956968151892311 + maskHigh := BitVec.ofNat 64 576478344497856513 + systematicCode := BitVec.ofNat 64 17859497633560402957 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2534374841271296 + maskLow := BitVec.ofNat 64 36028801314013527 + maskHigh := BitVec.ofNat 64 576478344757911617 + systematicCode := BitVec.ofNat 64 17859509875041508365 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36169672518812672 + maskLow := BitVec.ofNat 64 288230380585173335 + maskHigh := BitVec.ofNat 64 2305843559036616705 + systematicCode := BitVec.ofNat 64 18144639463763745805 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36047489289176064 + maskLow := BitVec.ofNat 64 288239451417690455 + maskHigh := BitVec.ofNat 64 2305847407268593665 + systematicCode := BitVec.ofNat 64 18146602092558294029 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2534374874563584 + maskLow := BitVec.ofNat 64 36028801314013527 + maskHigh := BitVec.ofNat 64 2305847407327316033 + systematicCode := BitVec.ofNat 64 18146609936059997197 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9360697077353472 + maskLow := BitVec.ofNat 64 36028801314013527 + maskHigh := BitVec.ofNat 64 2900318709790801921 + systematicCode := BitVec.ofNat 64 18156240795201313805 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x1c0e. -/ +def normalizedWeightSixteenCandidateBucket_1c0e : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10208046375764992 + maskLow := BitVec.ofNat 64 2882585240788877719 + maskHigh := BitVec.ofNat 64 281749858811905 + systematicCode := BitVec.ofNat 64 16198794176205233166 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9649494468854784 + maskLow := BitVec.ofNat 64 18014402804531607 + maskHigh := BitVec.ofNat 64 281750525771777 + systematicCode := BitVec.ofNat 64 16198808728276638734 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9592766540809216 + maskLow := BitVec.ofNat 64 18014402804531607 + maskHigh := BitVec.ofNat 64 325459740983297 + systematicCode := BitVec.ofNat 64 16202498736745421838 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9658737238475776 + maskLow := BitVec.ofNat 64 18014402804531607 + maskHigh := BitVec.ofNat 64 18014402804525057 + systematicCode := BitVec.ofNat 64 17060094553088662542 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11334392959206400 + maskLow := BitVec.ofNat 64 325459736871319 + maskHigh := BitVec.ofNat 64 18014402808643585 + systematicCode := BitVec.ofNat 64 17060107497112017934 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11338756645979136 + maskLow := BitVec.ofNat 64 281479942848919 + maskHigh := BitVec.ofNat 64 18014673387454465 + systematicCode := BitVec.ofNat 64 17063472002154044430 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11338761177926784 + maskLow := BitVec.ofNat 64 2305843014049808791 + maskHigh := BitVec.ofNat 64 576461027718201345 + systematicCode := BitVec.ofNat 64 17856133131735407630 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11334397491154048 + maskLow := BitVec.ofNat 64 2305878472758739351 + maskHigh := BitVec.ofNat 64 576495936679706625 + systematicCode := BitVec.ofNat 64 17859778013320453134 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9658741770423424 + maskLow := BitVec.ofNat 64 18014402804531607 + maskHigh := BitVec.ofNat 64 576495937212391489 + systematicCode := BitVec.ofNat 64 17859792449529781262 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11338761342307456 + maskLow := BitVec.ofNat 64 576460756736885143 + maskHigh := BitVec.ofNat 64 2305843284225818625 + systematicCode := BitVec.ofNat 64 18144359092593630222 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11334397655534720 + maskLow := BitVec.ofNat 64 576469827569402263 + maskHigh := BitVec.ofNat 64 2305851805310910465 + systematicCode := BitVec.ofNat 64 18146882472318344206 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9658741934804096 + maskLow := BitVec.ofNat 64 18014402804531607 + maskHigh := BitVec.ofNat 64 2305851805440936001 + systematicCode := BitVec.ofNat 64 18146892510548270094 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9592251113030656 + maskLow := BitVec.ofNat 64 18014402804531607 + maskHigh := BitVec.ofNat 64 2900318434908700673 + systematicCode := BitVec.ofNat 64 18156240790889503758 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x1c15. -/ +def normalizedWeightSixteenCandidateBucket_1c15 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18087520633963520 + maskLow := BitVec.ofNat 64 1171498857364800791 + maskHigh := BitVec.ofNat 64 290271203950593 + systematicCode := BitVec.ofNat 64 16201337342154382357 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9150690123400192 + maskLow := BitVec.ofNat 64 576460756598474007 + maskHigh := BitVec.ofNat 64 290271342493697 + systematicCode := BitVec.ofNat 64 16201340864918068245 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9360147088491520 + maskLow := BitVec.ofNat 64 576460756598474007 + maskHigh := BitVec.ofNat 64 299350764814337 + systematicCode := BitVec.ofNat 64 16202207370610613269 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36169672219182080 + maskLow := BitVec.ofNat 64 1152921509505877271 + maskHigh := BitVec.ofNat 64 36037593380421633 + systematicCode := BitVec.ofNat 64 17282204550416309269 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36047488989545472 + maskLow := BitVec.ofNat 64 1152961091320497431 + maskHigh := BitVec.ofNat 64 36046389339226113 + systematicCode := BitVec.ofNat 64 17283045677350525973 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2534374574932992 + maskLow := BitVec.ofNat 64 576460756598474007 + maskHigh := BitVec.ofNat 64 36046389473453057 + systematicCode := BitVec.ofNat 64 17283049122872826901 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148216222246912 + maskLow := BitVec.ofNat 64 576460756598474007 + maskHigh := BitVec.ofNat 64 288230384741785729 + systematicCode := BitVec.ofNat 64 17636837879746796565 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085046732810240 + maskLow := BitVec.ofNat 64 598688376374551 + maskHigh := BitVec.ofNat 64 288230384875864065 + systematicCode := BitVec.ofNat 64 17636859624291245077 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18050137238628352 + maskLow := BitVec.ofNat 64 562954793731351 + maskHigh := BitVec.ofNat 64 288239172244865025 + systematicCode := BitVec.ofNat 64 17642467133053934613 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2534378869638144 + maskLow := BitVec.ofNat 64 576460756598474007 + maskHigh := BitVec.ofNat 64 2305843284095796353 + systematicCode := BitVec.ofNat 64 18144349327319243797 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36047493284250624 + maskLow := BitVec.ofNat 64 18019350606857495 + maskHigh := BitVec.ofNat 64 2305843284225818625 + systematicCode := BitVec.ofNat 64 18144359054427757589 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36169676513887232 + maskLow := BitVec.ofNat 64 18014402880029975 + maskHigh := BitVec.ofNat 64 2305851805310910465 + systematicCode := BitVec.ofNat 64 18146882433074535445 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9360692549602304 + maskLow := BitVec.ofNat 64 576460756598474007 + maskHigh := BitVec.ofNat 64 2630110978611609601 + systematicCode := BitVec.ofNat 64 18155399703300545557 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x1c16. -/ +def normalizedWeightSixteenCandidateBucket_1c16 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10208042114352128 + maskLow := BitVec.ofNat 64 2342153285504420119 + maskHigh := BitVec.ofNat 64 285873090330625 + systematicCode := BitVec.ofNat 64 16201054771977722902 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9649490207441920 + maskLow := BitVec.ofNat 64 288230380446763287 + maskHigh := BitVec.ofNat 64 285873568546817 + systematicCode := BitVec.ofNat 64 16201060493731109910 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9592762279396352 + maskLow := BitVec.ofNat 64 288230380446763287 + maskHigh := BitVec.ofNat 64 317213466689537 + systematicCode := BitVec.ofNat 64 16202489940787141654 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11338748393688192 + maskLow := BitVec.ofNat 64 2305843014112725271 + maskHigh := BitVec.ofNat 64 36033195602345985 + systematicCode := BitVec.ofNat 64 17281924179246193686 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11334384706915456 + maskLow := BitVec.ofNat 64 2305882595927345431 + maskHigh := BitVec.ofNat 64 36063981458161665 + systematicCode := BitVec.ofNat 64 17283326057110576150 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9658728986184832 + maskLow := BitVec.ofNat 64 288230380446763287 + maskHigh := BitVec.ofNat 64 36063981927932929 + systematicCode := BitVec.ofNat 64 17283331697361099798 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9658732977062912 + maskLow := BitVec.ofNat 64 288230380446763287 + maskHigh := BitVec.ofNat 64 288230380446752897 + systematicCode := BitVec.ofNat 64 17636555305258392598 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11334388697793536 + maskLow := BitVec.ofNat 64 317213399664919 + maskHigh := BitVec.ofNat 64 288230380513787905 + systematicCode := BitVec.ofNat 64 17636577045507939350 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11338752384566272 + maskLow := BitVec.ofNat 64 281479817021719 + maskHigh := BitVec.ofNat 64 288234774198288385 + systematicCode := BitVec.ofNat 64 17642184554270628886 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9658750191291520 + maskLow := BitVec.ofNat 64 288230380446763287 + maskHigh := BitVec.ofNat 64 2305843558977897601 + systematicCode := BitVec.ofNat 64 18144631901807516694 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11334405912022144 + maskLow := BitVec.ofNat 64 36033749116340503 + maskHigh := BitVec.ofNat 64 2305843559036616705 + systematicCode := BitVec.ofNat 64 18144639434187807766 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11338769598794880 + maskLow := BitVec.ofNat 64 36028801389512983 + maskHigh := BitVec.ofNat 64 2305847407268593665 + systematicCode := BitVec.ofNat 64 18146602061904419862 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9592242856543232 + maskLow := BitVec.ofNat 64 288230380446763287 + maskHigh := BitVec.ofNat 64 2630106580497989633 + systematicCode := BitVec.ofNat 64 18155399698988735510 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x1c19. -/ +def normalizedWeightSixteenCandidateBucket_1c19 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9360147061441536 + maskLow := BitVec.ofNat 64 2305843013508747543 + maskHigh := BitVec.ofNat 64 286157027934209 + systematicCode := BitVec.ofNat 64 16201081470771141657 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9150690096350208 + maskLow := BitVec.ofNat 64 2305843013508747543 + maskHigh := BitVec.ofNat 64 316659420233729 + systematicCode := BitVec.ofNat 64 16202462366778661913 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18087520606913536 + maskLow := BitVec.ofNat 64 306807728909668631 + maskHigh := BitVec.ofNat 64 316659885670401 + systematicCode := BitVec.ofNat 64 16202467622927866905 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2534374606144512 + maskLow := BitVec.ofNat 64 2305843013508747543 + maskHigh := BitVec.ofNat 64 36033195132590081 + systematicCode := BitVec.ofNat 64 17281918812085165081 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36047489020756992 + maskLow := BitVec.ofNat 64 288256768725831959 + maskHigh := BitVec.ofNat 64 36033195602345985 + systematicCode := BitVec.ofNat 64 17281924158260190233 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36169672250393600 + maskLow := BitVec.ofNat 64 288230380849418519 + maskHigh := BitVec.ofNat 64 36063981458161665 + systematicCode := BitVec.ofNat 64 17283326035046636569 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2534378867557376 + maskLow := BitVec.ofNat 64 2305843013508747543 + maskHigh := BitVec.ofNat 64 576461027185528961 + systematicCode := BitVec.ofNat 64 17856118968347663385 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36047493282169856 + maskLow := BitVec.ofNat 64 18032544746393879 + maskHigh := BitVec.ofNat 64 576461027718201345 + systematicCode := BitVec.ofNat 64 17856133076389665817 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36169676511806464 + maskLow := BitVec.ofNat 64 18014403081359639 + maskHigh := BitVec.ofNat 64 576495936679706625 + systematicCode := BitVec.ofNat 64 17859777956896775193 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148216195196928 + maskLow := BitVec.ofNat 64 2305843013508747543 + maskHigh := BitVec.ofNat 64 1152921513196914817 + systematicCode := BitVec.ofNat 64 17925068238718901273 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085046705760256 + maskLow := BitVec.ofNat 64 572300097310999 + maskHigh := BitVec.ofNat 64 1152921513733652481 + systematicCode := BitVec.ofNat 64 17925094398422359065 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18050137211578368 + maskLow := BitVec.ofNat 64 562954391081239 + maskHigh := BitVec.ofNat 64 1152956688979066881 + systematicCode := BitVec.ofNat 64 17931823409045380121 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9360692555844608 + maskLow := BitVec.ofNat 64 2305843013508747543 + maskHigh := BitVec.ofNat 64 1765446238838194177 + systematicCode := BitVec.ofNat 64 17940071363364133913 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x1c1a. -/ +def normalizedWeightSixteenCandidateBucket_1c1a : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9592762379273216 + maskLow := BitVec.ofNat 64 1152921508901904663 + maskHigh := BitVec.ofNat 64 290825388949505 + systematicCode := BitVec.ofNat 64 16201364040947670042 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9649490307318784 + maskLow := BitVec.ofNat 64 1152921508901904663 + maskHigh := BitVec.ofNat 64 299067305426945 + systematicCode := BitVec.ofNat 64 16202181995591703578 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10208042214228992 + maskLow := BitVec.ofNat 64 612771028594155799 + maskHigh := BitVec.ofNat 64 299067431190529 + systematicCode := BitVec.ofNat 64 16202185052751207450 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9658729050688640 + maskLow := BitVec.ofNat 64 1152921508901904663 + maskHigh := BitVec.ofNat 64 36037593246210049 + systematicCode := BitVec.ofNat 64 17282201386573437978 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11334384771419264 + maskLow := BitVec.ofNat 64 576487144877547799 + maskHigh := BitVec.ofNat 64 36037593380421633 + systematicCode := BitVec.ofNat 64 17282204538020240410 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11338748458192000 + maskLow := BitVec.ofNat 64 576460757001134359 + maskHigh := BitVec.ofNat 64 36046389339226113 + systematicCode := BitVec.ofNat 64 17283045663876520986 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9658750091414656 + maskLow := BitVec.ofNat 64 1152921508901904663 + maskHigh := BitVec.ofNat 64 576461302067630209 + systematicCode := BitVec.ofNat 64 17856401542835936282 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11334405812145280 + maskLow := BitVec.ofNat 64 36046943255879959 + maskHigh := BitVec.ofNat 64 576461302327672833 + systematicCode := BitVec.ofNat 64 17856413456149715994 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11338769498918016 + maskLow := BitVec.ofNat 64 36028801590845719 + maskHigh := BitVec.ofNat 64 576478344497856513 + systematicCode := BitVec.ofNat 64 17859497585726659610 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9658733076939776 + maskLow := BitVec.ofNat 64 1152921508901904663 + maskHigh := BitVec.ofNat 64 1152921508901881985 + systematicCode := BitVec.ofNat 64 17924785664230497306 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11334388797670400 + maskLow := BitVec.ofNat 64 290825120604439 + maskHigh := BitVec.ofNat 64 1152921509170249729 + systematicCode := BitVec.ofNat 64 17924811819639053338 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11338752484443136 + maskLow := BitVec.ofNat 64 281479414374679 + maskHigh := BitVec.ofNat 64 1152939096792956929 + systematicCode := BitVec.ofNat 64 17931540830262074394 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9592242925208576 + maskLow := BitVec.ofNat 64 1152921508901904663 + maskHigh := BitVec.ofNat 64 1765428646383714305 + systematicCode := BitVec.ofNat 64 17940071359052323866 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x2307. -/ +def normalizedWeightSixteenCandidateBucket_2307 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .twoE8 + affineCode := BitVec.ofNat 56 18084907091787904 + maskLow := BitVec.ofNat 64 17596481995039 + maskHigh := BitVec.ofNat 64 1168231108609 + systematicCode := BitVec.ofNat 64 15044442059595653895 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085475940337792 + maskLow := BitVec.ofNat 64 864708724936343839 + maskHigh := BitVec.ofNat 64 1236950589441 + systematicCode := BitVec.ofNat 64 15045289913238430471 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148645429774464 + maskLow := BitVec.ofNat 64 35188667253023 + maskHigh := BitVec.ofNat 64 1237151911937 + systematicCode := BitVec.ofNat 64 15045319871222719239 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085456763979904 + maskLow := BitVec.ofNat 64 54060792009654559 + maskHigh := BitVec.ofNat 64 2267742740481 + systematicCode := BitVec.ofNat 64 15260618235928126215 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148626253416576 + maskLow := BitVec.ofNat 64 35188667253023 + maskHigh := BitVec.ofNat 64 2267755319297 + systematicCode := BitVec.ofNat 64 15260639397953610503 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18050274539374720 + maskLow := BitVec.ofNat 64 17599702434079 + maskHigh := BitVec.ofNat 64 2336462213121 + systematicCode := BitVec.ofNat 64 15261459267043795719 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9359738777405568 + maskLow := BitVec.ofNat 64 35188667253023 + maskHigh := BitVec.ofNat 64 3378867951640577 + systematicCode := BitVec.ofNat 64 16637933958408643335 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36099311808839808 + maskLow := BitVec.ofNat 64 612489562207486239 + maskHigh := BitVec.ofNat 64 4613937818241081345 + systematicCode := BitVec.ofNat 64 18295481469197558535 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9288820277149824 + maskLow := BitVec.ofNat 64 35188667253023 + maskHigh := BitVec.ofNat 64 4613937818383679491 + systematicCode := BitVec.ofNat 64 18295511396883571463 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36099311808841856 + maskLow := BitVec.ofNat 64 306244787546292511 + maskHigh := BitVec.ofNat 64 9224497936761626625 + systematicCode := BitVec.ofNat 64 18367257583947031303 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9288820277151872 + maskLow := BitVec.ofNat 64 35188667253023 + maskHigh := BitVec.ofNat 64 9224497936832921603 + systematicCode := BitVec.ofNat 64 18367286412138193671 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9359743105925248 + maskLow := BitVec.ofNat 64 35188667253023 + maskHigh := BitVec.ofNat 64 13835060391744380929 + systematicCode := BitVec.ofNat 64 18374074926179754759 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x230b. -/ +def normalizedWeightSixteenCandidateBucket_230b : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .twoE8 + affineCode := BitVec.ofNat 56 18084906846257280 + maskLow := BitVec.ofNat 64 4402344821047 + maskHigh := BitVec.ofNat 64 1116691497985 + systematicCode := BitVec.ofNat 64 15043311744529801995 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085475961145472 + maskLow := BitVec.ofNat 64 3458768916162216247 + maskHigh := BitVec.ofNat 64 1133871368193 + systematicCode := BitVec.ofNat 64 15044159632531792651 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148645450582144 + maskLow := BitVec.ofNat 64 8800388186423 + maskHigh := BitVec.ofNat 64 1134676673537 + systematicCode := BitVec.ofNat 64 15044198386474885899 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085456634972288 + maskLow := BitVec.ofNat 64 54047597870121271 + maskHigh := BitVec.ofNat 64 2216203126785 + systematicCode := BitVec.ofNat 64 15259487937974510347 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148626124408960 + maskLow := BitVec.ofNat 64 8800388186423 + maskHigh := BitVec.ofNat 64 2216215708673 + systematicCode := BitVec.ofNat 64 15259513497979396875 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18050274410367104 + maskLow := BitVec.ofNat 64 4405562900791 + maskHigh := BitVec.ofNat 64 2233382994945 + systematicCode := BitVec.ofNat 64 15260328951910572811 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9359738798213248 + maskLow := BitVec.ofNat 64 8800388186423 + maskHigh := BitVec.ofNat 64 13511915573610497 + systematicCode := BitVec.ofNat 64 16927290217219957515 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36099311796355200 + maskLow := BitVec.ofNat 64 2341871819117756727 + maskHigh := BitVec.ofNat 64 4620693217682130945 + systematicCode := BitVec.ofNat 64 18296602988237759243 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9288820264665216 + maskLow := BitVec.ofNat 64 8800388186423 + maskHigh := BitVec.ofNat 64 4620693218227388419 + systematicCode := BitVec.ofNat 64 18296641694836663051 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36099311796357248 + maskLow := BitVec.ofNat 64 1170935916001427767 + maskHigh := BitVec.ofNat 64 9227875636482148353 + systematicCode := BitVec.ofNat 64 18368379102987232011 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9288820264667264 + maskLow := BitVec.ofNat 64 8800388186423 + maskHigh := BitVec.ofNat 64 9227875636754776067 + systematicCode := BitVec.ofNat 64 18368416710091285259 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9359743093440640 + maskLow := BitVec.ofNat 64 8800388186423 + maskHigh := BitVec.ofNat 64 13835060288665159681 + systematicCode := BitVec.ofNat 64 18374074908932514571 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x2313. -/ +def normalizedWeightSixteenCandidateBucket_2313 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .twoE8 + affineCode := BitVec.ofNat 56 18084905248227456 + maskLow := BitVec.ofNat 64 279223403287 + maskHigh := BitVec.ofNat 64 85899345985 + systematicCode := BitVec.ofNat 64 14466842161908359955 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085459448170624 + maskLow := BitVec.ofNat 64 3458764792993612567 + maskHigh := BitVec.ofNat 64 103079215233 + systematicCode := BitVec.ofNat 64 14467690084134822675 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148628937607296 + maskLow := BitVec.ofNat 64 554050978583 + maskHigh := BitVec.ofNat 64 103884521537 + systematicCode := BitVec.ofNat 64 14467737634036720403 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085459298355328 + maskLow := BitVec.ofNat 64 864691407628206871 + maskHigh := BitVec.ofNat 64 154618822785 + systematicCode := BitVec.ofNat 64 14683018424071496467 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148628787792000 + maskLow := BitVec.ofNat 64 554050978583 + maskHigh := BitVec.ofNat 64 154820149313 + systematicCode := BitVec.ofNat 64 14683061575993991955 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18050274943043712 + maskLow := BitVec.ofNat 64 282394297111 + maskHigh := BitVec.ofNat 64 171798691905 + systematicCode := BitVec.ofNat 64 14683859369154388755 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9359735069476992 + maskLow := BitVec.ofNat 64 554050978583 + maskHigh := BitVec.ofNat 64 216172868013129857 + systematicCode := BitVec.ofNat 64 17505993973109302035 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36099303806206080 + maskLow := BitVec.ofNat 64 2882303774402216727 + maskHigh := BitVec.ofNat 64 4755801206503243905 + systematicCode := BitVec.ofNat 64 18298845992092640019 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9288812274516096 + maskLow := BitVec.ofNat 64 554050978583 + maskHigh := BitVec.ofNat 64 4755801207174332419 + systematicCode := BitVec.ofNat 64 18298893529009562387 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36099303806208128 + maskLow := BitVec.ofNat 64 1441151893643658007 + maskHigh := BitVec.ofNat 64 9295429630892703873 + systematicCode := BitVec.ofNat 64 18370622106842112787 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9288812274518144 + maskLow := BitVec.ofNat 64 554050978583 + maskHigh := BitVec.ofNat 64 9295429631228248067 + systematicCode := BitVec.ofNat 64 18370668544264184595 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9359735103291520 + maskLow := BitVec.ofNat 64 554050978583 + maskHigh := BitVec.ofNat 64 13835058227080855681 + systematicCode := BitVec.ofNat 64 18374066112704750355 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x231c. -/ +def normalizedWeightSixteenCandidateBucket_231c : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.node + (.leaf + { patternClass := .twoE8 + affineCode := BitVec.ofNat 56 18032063728713856 + maskLow := BitVec.ofNat 64 844437815247127 + maskHigh := BitVec.ofNat 64 5185 + systematicCode := BitVec.ofNat 64 10994566944484696860 }) + (.leaf + { patternClass := .twoE8 + affineCode := BitVec.ofNat 56 2392610335228032 + maskLow := BitVec.ofNat 64 22269405643031 + maskHigh := BitVec.ofNat 64 196611 + systematicCode := BitVec.ofNat 64 11718792120789377820 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18102982377867392 + maskLow := BitVec.ofNat 64 3458764526705656087 + maskHigh := BitVec.ofNat 64 6273 + systematicCode := BitVec.ofNat 64 10995414771431580444 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18102982228052096 + maskLow := BitVec.ofNat 64 864691141340250391 + maskHigh := BitVec.ofNat 64 9345 + systematicCode := BitVec.ofNat 64 11210743111368254236 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18102980097345664 + maskLow := BitVec.ofNat 64 54043208413561111 + maskHigh := BitVec.ofNat 64 10305 + systematicCode := BitVec.ofNat 64 11211584203269546780 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10274422947840640 + maskLow := BitVec.ofNat 64 2882304040690204951 + maskHigh := BitVec.ofNat 64 4325505 + systematicCode := BitVec.ofNat 64 12511720470922142492 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11400322854684928 + maskLow := BitVec.ofNat 64 1441152159931646231 + maskHigh := BitVec.ofNat 64 8454273 + systematicCode := BitVec.ofNat 64 12583496585671615260 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11400357214423168 + maskLow := BitVec.ofNat 64 44259638198551 + maskHigh := BitVec.ofNat 64 12582915 + systematicCode := BitVec.ofNat 64 12586860961900274460 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10274425078547072 + maskLow := BitVec.ofNat 64 2341876208574349591 + maskHigh := BitVec.ofNat 64 67241985 + systematicCode := BitVec.ofNat 64 13088190019184894748 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18102948018129152 + maskLow := BitVec.ofNat 64 2306159672857674007 + maskHigh := BitVec.ofNat 64 71307265 + systematicCode := BitVec.ofNat 64 13091287343222694684 }) + ) + ) + ) + ) + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11400324985391360 + maskLow := BitVec.ofNat 64 1170940305458020631 + maskHigh := BitVec.ofNat 64 134285313 + systematicCode := BitVec.ofNat 64 13159966133934367516 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18094151925105280 + maskLow := BitVec.ofNat 64 1153519643227537687 + maskHigh := BitVec.ofNat 64 142610433 + systematicCode := BitVec.ofNat 64 13163626407959143196 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11400359345129600 + maskLow := BitVec.ofNat 64 40136469594391 + maskHigh := BitVec.ofNat 64 201326595 + systematicCode := BitVec.ofNat 64 13165573513967248156 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10274425228362368 + maskLow := BitVec.ofNat 64 612507145803612439 + maskHigh := BitVec.ofNat 64 268574721 + systematicCode := BitVec.ofNat 64 13376424776203510556 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18102947868313856 + maskLow := BitVec.ofNat 64 576751027668336919 + maskHigh := BitVec.ofNat 64 272630785 + systematicCode := BitVec.ofNat 64 13379513304147763996 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18102945737607424 + maskLow := BitVec.ofNat 64 36310826046669079 + maskHigh := BitVec.ofNat 64 335544385 + systematicCode := BitVec.ofNat 64 13381756273508164380 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11400325135206656 + maskLow := BitVec.ofNat 64 306262371142418711 + maskHigh := BitVec.ofNat 64 536944641 + systematicCode := BitVec.ofNat 64 13448200890952983324 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18094151775289984 + maskLow := BitVec.ofNat 64 288802126493335831 + maskHigh := BitVec.ofNat 64 545260545 + systematicCode := BitVec.ofNat 64 13451852368884212508 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18094149644583552 + maskLow := BitVec.ofNat 64 18577902513897751 + maskHigh := BitVec.ofNat 64 671088705 + systematicCode := BitVec.ofNat 64 13454095338244612892 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11400359494944896 + maskLow := BitVec.ofNat 64 26942330061079 + maskHigh := BitVec.ofNat 64 805306371 + systematicCode := BitVec.ofNat 64 13454929777191232284 }) + ) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x231f. -/ +def normalizedWeightSixteenCandidateBucket_231f : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11329994895919232 + maskLow := BitVec.ofNat 64 39861591703831 + maskHigh := BitVec.ofNat 64 3377699720527875 + systematicCode := BitVec.ofNat 64 16637848826669703967 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9095787268278400 + maskLow := BitVec.ofNat 64 12885131543 + maskHigh := BitVec.ofNat 64 3377699720537153 + systematicCode := BitVec.ofNat 64 16637875460700840735 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18050172400699648 + maskLow := BitVec.ofNat 64 281337364759 + maskHigh := BitVec.ofNat 64 5629499534213185 + systematicCode := BitVec.ofNat 64 16854031439592760095 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18050171863827072 + maskLow := BitVec.ofNat 64 280280400151 + maskHigh := BitVec.ofNat 64 11258999068426305 + systematicCode := BitVec.ofNat 64 16926370508590687007 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11329995045734528 + maskLow := BitVec.ofNat 64 26667452170519 + maskHigh := BitVec.ofNat 64 13510798882111491 + systematicCode := BitVec.ofNat 64 16927205089893688095 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9095787418093696 + maskLow := BitVec.ofNat 64 12885131543 + maskHigh := BitVec.ofNat 64 13510798882117697 + systematicCode := BitVec.ofNat 64 16927228451109413663 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18050171335346432 + maskLow := BitVec.ofNat 64 4404490240279 + maskHigh := BitVec.ofNat 64 73183493944771585 + systematicCode := BitVec.ofNat 64 17430501022348419871 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18050171460192512 + maskLow := BitVec.ofNat 64 17598628987159 + maskHigh := BitVec.ofNat 64 76561193665302529 + systematicCode := BitVec.ofNat 64 17431631337481380639 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18050171331150464 + maskLow := BitVec.ofNat 64 4403417547031 + maskHigh := BitVec.ofNat 64 146366987889542145 + systematicCode := BitVec.ofNat 64 17502840091346346783 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18050171460158080 + maskLow := BitVec.ofNat 64 17597555507479 + maskHigh := BitVec.ofNat 64 153122387330600961 + systematicCode := BitVec.ofNat 64 17503970406479307551 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11330007829973120 + maskLow := BitVec.ofNat 64 22544283566359 + maskHigh := BitVec.ofNat 64 216172782113783811 + systematicCode := BitVec.ofNat 64 17505917641960661791 }) + ) + ) + ) + ) + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9095800202332288 + maskLow := BitVec.ofNat 64 12885131543 + maskHigh := BitVec.ofNat 64 216172782113789057 + systematicCode := BitVec.ofNat 64 17505940990391952159 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36170119700938880 + maskLow := BitVec.ofNat 64 35188702937367 + maskHigh := BitVec.ofNat 64 4613937818241081345 + systematicCode := BitVec.ofNat 64 18295481352225170207 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36170119713423488 + maskLow := BitVec.ofNat 64 8800422297879 + maskHigh := BitVec.ofNat 64 4620693217682130945 + systematicCode := BitVec.ofNat 64 18296602836905370399 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36170120778776704 + maskLow := BitVec.ofNat 64 554053632279 + maskHigh := BitVec.ofNat 64 4755801206503243905 + systematicCode := BitVec.ofNat 64 18298845806132077343 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9024877407371392 + maskLow := BitVec.ofNat 64 12885131543 + maskHigh := BitVec.ofNat 64 4767060205571670019 + systematicCode := BitVec.ofNat 64 18298946511725339423 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36170122926358784 + maskLow := BitVec.ofNat 64 35188685111575 + maskHigh := BitVec.ofNat 64 9224497936761626625 + systematicCode := BitVec.ofNat 64 18367257471269544735 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36170122934681856 + maskLow := BitVec.ofNat 64 8800405258519 + maskHigh := BitVec.ofNat 64 9227875636482148353 + systematicCode := BitVec.ofNat 64 18368378955949744927 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36170120803975424 + maskLow := BitVec.ofNat 64 554052321559 + maskHigh := BitVec.ofNat 64 9295429630892703873 + systematicCode := BitVec.ofNat 64 18370621925176451871 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9024877407373440 + maskLow := BitVec.ofNat 64 12885131543 + maskHigh := BitVec.ofNat 64 9301059130426916867 + systematicCode := BitVec.ofNat 64 18370721526979961631 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11330007863787648 + maskLow := BitVec.ofNat 64 44534516121879 + maskHigh := BitVec.ofNat 64 13835058055282163715 + systematicCode := BitVec.ofNat 64 18373986483071558431 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9095800236146816 + maskLow := BitVec.ofNat 64 12885131543 + maskHigh := BitVec.ofNat 64 13835058055282174081 + systematicCode := BitVec.ofNat 64 18374013129987400479 }) + ) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x2507. -/ +def normalizedWeightSixteenCandidateBucket_2507 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085475940321536 + maskLow := BitVec.ofNat 64 720593536860619039 + maskHigh := BitVec.ofNat 64 1374389551105 + systematicCode := BitVec.ofNat 64 15045855062181553415 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148645429758208 + maskLow := BitVec.ofNat 64 70373039472927 + maskHigh := BitVec.ofNat 64 1374557310977 + systematicCode := BitVec.ofNat 64 15045882812586337543 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085456763963648 + maskLow := BitVec.ofNat 64 45053592755044639 + maskHigh := BitVec.ofNat 64 4466766004225 + systematicCode := BitVec.ofNat 64 15404735622993683719 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148626253400320 + maskLow := BitVec.ofNat 64 70373039472927 + maskHigh := BitVec.ofNat 64 4466776477697 + systematicCode := BitVec.ofNat 64 15404754577439663367 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18050274539358464 + maskLow := BitVec.ofNat 64 17599165694239 + maskHigh := BitVec.ofNat 64 4672924422145 + systematicCode := BitVec.ofNat 64 15406137405072942343 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9359738777389312 + maskLow := BitVec.ofNat 64 70373039472927 + maskHigh := BitVec.ofNat 64 2815917998227457 + systematicCode := BitVec.ofNat 64 16637371008488908039 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36099311808823552 + maskLow := BitVec.ofNat 64 612489570797551903 + maskHigh := BitVec.ofNat 64 2308094809027395585 + systematicCode := BitVec.ofNat 64 18151368480145089799 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9288820277133568 + maskLow := BitVec.ofNat 64 70373039472927 + maskHigh := BitVec.ofNat 64 2308094809169985541 + systematicCode := BitVec.ofNat 64 18151396208841401607 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36099311809085696 + maskLow := BitVec.ofNat 64 153122408805761311 + maskHigh := BitVec.ofNat 64 9223934986808213505 + systematicCode := BitVec.ofNat 64 18366696824393508103 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9288820277395712 + maskLow := BitVec.ofNat 64 70373039472927 + maskHigh := BitVec.ofNat 64 9223934986843848709 + systematicCode := BitVec.ofNat 64 18366721254605268231 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9359743105648896 + maskLow := BitVec.ofNat 64 70373039472927 + maskHigh := BitVec.ofNat 64 11529219718992904193 + systematicCode := BitVec.ofNat 64 18373514183873209607 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x250d. -/ +def normalizedWeightSixteenCandidateBucket_250d : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .twoE8 + affineCode := BitVec.ofNat 56 18084906844322816 + maskLow := BitVec.ofNat 64 2203323793751 + maskHigh := BitVec.ofNat 64 1108101562881 + systematicCode := BitVec.ofNat 64 15042746586996745485 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085475961291776 + maskLow := BitVec.ofNat 64 5764609726352785751 + maskHigh := BitVec.ofNat 64 1133871368193 + systematicCode := BitVec.ofNat 64 15044159641121596685 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148645450728448 + maskLow := BitVec.ofNat 64 8800388317527 + maskHigh := BitVec.ofNat 64 1135213543937 + systematicCode := BitVec.ofNat 64 15044200585464587533 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085456633948160 + maskLow := BitVec.ofNat 64 45038199592255831 + maskHigh := BitVec.ofNat 64 4406636447745 + systematicCode := BitVec.ofNat 64 15403040176063259917 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148626123384832 + maskLow := BitVec.ofNat 64 8800388317527 + maskHigh := BitVec.ofNat 64 4406646931969 + systematicCode := BitVec.ofNat 64 15403065727478342925 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18050274409342976 + maskLow := BitVec.ofNat 64 2206002905431 + maskHigh := BitVec.ofNat 64 4432406249985 + systematicCode := BitVec.ofNat 64 15404441932373107981 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9359738798359552 + maskLow := BitVec.ofNat 64 8800388317527 + maskHigh := BitVec.ofNat 64 22519106238416897 + systematicCode := BitVec.ofNat 64 17071405396705879309 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36099311796241408 + maskLow := BitVec.ofNat 64 4647714836921516375 + maskHigh := BitVec.ofNat 64 2323857407723177985 + systematicCode := BitVec.ofNat 64 18153050758705390861 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9288820264551424 + maskLow := BitVec.ofNat 64 8800388317527 + maskHigh := BitVec.ofNat 64 2323857408805306373 + systematicCode := BitVec.ofNat 64 18153091655771038989 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36099311796503552 + maskLow := BitVec.ofNat 64 1161928725336752471 + maskHigh := BitVec.ofNat 64 9227875636482148353 + systematicCode := BitVec.ofNat 64 18368379102953809165 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9288820264813568 + maskLow := BitVec.ofNat 64 8800388317527 + maskHigh := BitVec.ofNat 64 9227875636752678917 + systematicCode := BitVec.ofNat 64 18368416701534905613 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9359743093066752 + maskLow := BitVec.ofNat 64 8800388317527 + maskHigh := BitVec.ofNat 64 11529219478474721281 + systematicCode := BitVec.ofNat 64 18373514158002349325 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x2515. -/ +def normalizedWeightSixteenCandidateBucket_2515 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .twoE8 + affineCode := BitVec.ofNat 56 18084905246292992 + maskLow := BitVec.ofNat 64 141818135831 + maskHigh := BitVec.ofNat 64 77309411361 + systematicCode := BitVec.ofNat 64 14466277004375303445 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085459448316928 + maskLow := BitVec.ofNat 64 5764607664768484631 + maskHigh := BitVec.ofNat 64 103079215233 + systematicCode := BitVec.ofNat 64 14467690092724626709 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148628937753600 + maskLow := BitVec.ofNat 64 554051110167 + maskHigh := BitVec.ofNat 64 104421392417 + systematicCode := BitVec.ofNat 64 14467739833026422037 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085459297331200 + maskLow := BitVec.ofNat 64 720576082113529111 + maskHigh := BitVec.ofNat 64 283467841665 + systematicCode := BitVec.ofNat 64 14826570662160246037 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148628786767872 + maskLow := BitVec.ofNat 64 554051110167 + maskHigh := BitVec.ofNat 64 283635613729 + systematicCode := BitVec.ofNat 64 14826613805492938005 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18050274942019584 + maskLow := BitVec.ofNat 64 144418604311 + maskHigh := BitVec.ofNat 64 309237645345 + systematicCode := BitVec.ofNat 64 14827972349616923925 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9359735069623296 + maskLow := BitVec.ofNat 64 554051110167 + maskHigh := BitVec.ofNat 64 360288047499051137 + systematicCode := BitVec.ofNat 64 17650109152595223829 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36099303806092288 + maskLow := BitVec.ofNat 64 5188146792205976855 + maskHigh := BitVec.ofNat 64 2594073385365405825 + systematicCode := BitVec.ofNat 64 18155293762560271637 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9288812274402304 + maskLow := BitVec.ofNat 64 554051110167 + maskHigh := BitVec.ofNat 64 2594073386573365253 + systematicCode := BitVec.ofNat 64 18155343489943938325 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36099303806354432 + maskLow := BitVec.ofNat 64 1297036714157868311 + maskHigh := BitVec.ofNat 64 9295429630892703873 + systematicCode := BitVec.ofNat 64 18370622106808689941 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9288812274664448 + maskLow := BitVec.ofNat 64 554051110167 + maskHigh := BitVec.ofNat 64 9295429631194693637 + systematicCode := BitVec.ofNat 64 18370668535707804949 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9359735102917632 + maskLow := BitVec.ofNat 64 554051110167 + maskHigh := BitVec.ofNat 64 11529215355306115201 + systematicCode := BitVec.ofNat 64 18373505361774585109 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x251a. -/ +def normalizedWeightSixteenCandidateBucket_251a : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.node + (.leaf + { patternClass := .twoE8 + affineCode := BitVec.ofNat 56 18032063726779392 + maskLow := BitVec.ofNat 64 1407396358725911 + maskHigh := BitVec.ofNat 64 4641 + systematicCode := BitVec.ofNat 64 10994001804098086170 }) + (.leaf + { patternClass := .twoE8 + affineCode := BitVec.ofNat 56 2392610333293568 + maskLow := BitVec.ofNat 64 19932943556887 + maskHigh := BitVec.ofNat 64 327685 + systematicCode := BitVec.ofNat 64 11862909507854804250 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18102982378013696 + maskLow := BitVec.ofNat 64 5764607544509407511 + maskHigh := BitVec.ofNat 64 6273 + systematicCode := BitVec.ofNat 64 10995414780021646618 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18102982227027968 + maskLow := BitVec.ofNat 64 720575961854451991 + maskHigh := BitVec.ofNat 64 17025 + systematicCode := BitVec.ofNat 64 11354295349457265946 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18102980096321536 + maskLow := BitVec.ofNat 64 45036017748877591 + maskHigh := BitVec.ofNat 64 18465 + systematicCode := BitVec.ofNat 64 11355697192288724250 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10274422946621440 + maskLow := BitVec.ofNat 64 5188146912465068311 + maskHigh := BitVec.ofNat 64 2359425 + systematicCode := BitVec.ofNat 64 12368168241389511962 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11400322853677056 + maskLow := BitVec.ofNat 64 1297036834416959767 + maskHigh := BitVec.ofNat 64 8454273 + systematicCode := BitVec.ofNat 64 12583496585637930266 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11400357213399040 + maskLow := BitVec.ofNat 64 79306571456791 + maskHigh := BitVec.ofNat 64 10485765 + systematicCode := BitVec.ofNat 64 12586300219559912730 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10274425077327872 + maskLow := BitVec.ofNat 64 4647717018764910871 + maskHigh := BitVec.ofNat 64 33818625 + systematicCode := BitVec.ofNat 64 12944637789652264218 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18102948018291712 + maskLow := BitVec.ofNat 64 4612037866443579671 + maskHigh := BitVec.ofNat 64 35655681 + systematicCode := BitVec.ofNat 64 12946609213783483674 }) + ) + ) + ) + ) + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11400324984383488 + maskLow := BitVec.ofNat 64 1161930907180146967 + maskHigh := BitVec.ofNat 64 134285313 + systematicCode := BitVec.ofNat 64 13159966133900682522 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18094151925056512 + maskLow := BitVec.ofNat 64 1154117777553170711 + maskHigh := BitVec.ofNat 64 142610433 + systematicCode := BitVec.ofNat 64 13163626407992829210 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11400359344105472 + maskLow := BitVec.ofNat 64 73121818550551 + maskHigh := BitVec.ofNat 64 167772165 + systematicCode := BitVec.ofNat 64 13165012771593463066 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10274425228313600 + maskLow := BitVec.ofNat 64 612507145803735319 + maskHigh := BitVec.ofNat 64 268713985 + systematicCode := BitVec.ofNat 64 13376989925180187930 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18102947867305984 + maskLow := BitVec.ofNat 64 576751027668459799 + maskHigh := BitVec.ofNat 64 270533121 + systematicCode := BitVec.ofNat 64 13378948155171087642 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18102945736599552 + maskLow := BitVec.ofNat 64 36310826046791959 + maskHigh := BitVec.ofNat 64 301989921 + systematicCode := BitVec.ofNat 64 13381191124531488026 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11400325135369216 + maskLow := BitVec.ofNat 64 153139983811944727 + maskHigh := BitVec.ofNat 64 1073823745 + systematicCode := BitVec.ofNat 64 13592318269428606234 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18094151774070784 + maskLow := BitVec.ofNat 64 145249888371024151 + maskHigh := BitVec.ofNat 64 1082130945 + systematicCode := BitVec.ofNat 64 13595965349380433178 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18094149643364352 + maskLow := BitVec.ofNat 64 10133653212700951 + maskHigh := BitVec.ofNat 64 1207959585 + systematicCode := BitVec.ofNat 64 13598208318740833562 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11400359495091200 + maskLow := BitVec.ofNat 64 26942330183959 + maskHigh := BitVec.ofNat 64 1342177285 + systematicCode := BitVec.ofNat 64 13599047164290344218 }) + ) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x251f. -/ +def normalizedWeightSixteenCandidateBucket_251f : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11329994894895104 + maskLow := BitVec.ofNat 64 72709501714711 + maskHigh := BitVec.ofNat 64 2814749767106565 + systematicCode := BitVec.ofNat 64 16637288084295787807 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9095787267254272 + maskLow := BitVec.ofNat 64 21475197207 + maskHigh := BitVec.ofNat 64 2814749767123489 + systematicCode := BitVec.ofNat 64 16637314701147317535 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18050172399691776 + maskLow := BitVec.ofNat 64 143898542359 + maskHigh := BitVec.ofNat 64 5066549580791841 + systematicCode := BitVec.ofNat 64 16853466282026149151 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18050171862607872 + maskLow := BitVec.ofNat 64 142338261271 + maskHigh := BitVec.ofNat 64 20266198323167265 + systematicCode := BitVec.ofNat 64 17070483489019929887 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11329995045880832 + maskLow := BitVec.ofNat 64 26530013348119 + maskHigh := BitVec.ofNat 64 22517998136852485 + systematicCode := BitVec.ofNat 64 17071322476992668959 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9095787418240000 + maskLow := BitVec.ofNat 64 21475197207 + maskHigh := BitVec.ofNat 64 22517998136858657 + systematicCode := BitVec.ofNat 64 17071343639151846687 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18050171334338560 + maskLow := BitVec.ofNat 64 2205467115799 + maskHigh := BitVec.ofNat 64 72620543991349761 + systematicCode := BitVec.ofNat 64 17429935864781808927 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18050171329931264 + maskLow := BitVec.ofNat 64 2203859648791 + maskHigh := BitVec.ofNat 64 290482175965397505 + systematicCode := BitVec.ofNat 64 17646953071775589663 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18050171459946752 + maskLow := BitVec.ofNat 64 17597018767639 + maskHigh := BitVec.ofNat 64 306244774661197825 + systematicCode := BitVec.ofNat 64 17648648544475030815 }) + ) + ) + ) + ) + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11330007830119424 + maskLow := BitVec.ofNat 64 20345260441879 + maskHigh := BitVec.ofNat 64 360287970189639685 + systematicCode := BitVec.ofNat 64 17650035029026219295 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9095800202478592 + maskLow := BitVec.ofNat 64 21475197207 + maskHigh := BitVec.ofNat 64 360287970189644417 + systematicCode := BitVec.ofNat 64 17650056169878005023 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36170119700825088 + maskLow := BitVec.ofNat 64 70373110808855 + maskHigh := BitVec.ofNat 64 2308094809027395585 + systematicCode := BitVec.ofNat 64 18151368371796190495 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36170119713407232 + maskLow := BitVec.ofNat 64 8800455983383 + maskHigh := BitVec.ofNat 64 2323857407723177985 + systematicCode := BitVec.ofNat 64 18153050598816490783 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36170120778760448 + maskLow := BitVec.ofNat 64 554055860503 + maskHigh := BitVec.ofNat 64 2594073385365405825 + systematicCode := BitVec.ofNat 64 18155293568043197727 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9024877407257600 + maskLow := BitVec.ofNat 64 21475197207 + maskHigh := BitVec.ofNat 64 2614339583688572933 + systematicCode := BitVec.ofNat 64 18155396472659846431 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36170122926261248 + maskLow := BitVec.ofNat 64 70373057331479 + maskHigh := BitVec.ofNat 64 9223934986808213505 + systematicCode := BitVec.ofNat 64 18366696728929314079 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9024877407519744 + maskLow := BitVec.ofNat 64 21475197207 + maskHigh := BitVec.ofNat 64 9300496180473495557 + systematicCode := BitVec.ofNat 64 18370721518423713055 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11330007863413760 + maskLow := BitVec.ofNat 64 79718888341783 + maskHigh := BitVec.ofNat 64 11529215046068469765 + systematicCode := BitVec.ofNat 64 18373425740731327775 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9095800235772928 + maskLow := BitVec.ofNat 64 21475197207 + maskHigh := BitVec.ofNat 64 11529215046068488321 + systematicCode := BitVec.ofNat 64 18373452379057366303 }) + ) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x2523. -/ +def normalizedWeightSixteenCandidateBucket_2523 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .d16Plus + affineCode := BitVec.ofNat 56 54397257743638656 + maskLow := BitVec.ofNat 64 281479289962775 + maskHigh := BitVec.ofNat 64 9223512774343196673 + systematicCode := BitVec.ofNat 64 18365575244248851747 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9359635698223360 + maskLow := BitVec.ofNat 64 1152921508902273303 + maskHigh := BitVec.ofNat 64 2253002672963585 + systematicCode := BitVec.ofNat 64 16632014184015013155 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9288717197967616 + maskLow := BitVec.ofNat 64 1152921508902273303 + maskHigh := BitVec.ofNat 64 2392537444712449 + systematicCode := BitVec.ofNat 64 16636216409679537443 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36099208729657600 + maskLow := BitVec.ofNat 64 612771028594524439 + maskHigh := BitVec.ofNat 64 2392537570476033 + systematicCode := BitVec.ofNat 64 16636219466839041315 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148542350592256 + maskLow := BitVec.ofNat 64 1152921508902273303 + maskHigh := BitVec.ofNat 64 4504699273222145 + systematicCode := BitVec.ofNat 64 16848166972485608739 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085372861155584 + maskLow := BitVec.ofNat 64 576487144877916439 + maskHigh := BitVec.ofNat 64 4504699407433729 + systematicCode := BitVec.ofNat 64 16848170123932411171 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36169573178867968 + maskLow := BitVec.ofNat 64 576460758763110679 + maskHigh := BitVec.ofNat 64 4644337249943553 + systematicCode := BitVec.ofNat 64 16852388949609489699 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148523174234368 + maskLow := BitVec.ofNat 64 1152921508902273303 + maskHigh := BitVec.ofNat 64 72057662765797505 + systematicCode := BitVec.ofNat 64 17422367128748107043 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085353684797696 + maskLow := BitVec.ofNat 64 36046943256248599 + maskHigh := BitVec.ofNat 64 72057663025840129 + systematicCode := BitVec.ofNat 64 17422379042061886755 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36169571048161536 + maskLow := BitVec.ofNat 64 36028803462922519 + maskHigh := BitVec.ofNat 64 72198331534671873 + systematicCode := BitVec.ofNat 64 17428840871459628323 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9289266953781504 + maskLow := BitVec.ofNat 64 1152921508902273303 + maskHigh := BitVec.ofNat 64 9223372071214581889 + systematicCode := BitVec.ofNat 64 18358820078318331171 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36099758485471488 + maskLow := BitVec.ofNat 64 290825120973079 + maskHigh := BitVec.ofNat 64 9223372071482949633 + systematicCode := BitVec.ofNat 64 18358846233726887203 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9359090270931200 + maskLow := BitVec.ofNat 64 1152921508902273303 + maskHigh := BitVec.ofNat 64 9300073968276865025 + systematicCode := BitVec.ofNat 64 18370721502119666979 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x2607. -/ +def normalizedWeightSixteenCandidateBucket_2607 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085407220843136 + maskLow := BitVec.ofNat 64 432363160709169439 + maskHigh := BitVec.ofNat 64 1649267474433 + systematicCode := BitVec.ofNat 64 15046137632374924807 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148576710279808 + maskLow := BitVec.ofNat 64 140741783912735 + maskHigh := BitVec.ofNat 64 1649368109057 + systematicCode := BitVec.ofNat 64 15046163188051486215 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085388044485248 + maskLow := BitVec.ofNat 64 27039194245824799 + maskHigh := BitVec.ofNat 64 8864812531713 + systematicCode := BitVec.ofNat 64 15476794312248272391 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148557533921920 + maskLow := BitVec.ofNat 64 140741783912735 + maskHigh := BitVec.ofNat 64 8864818794497 + systematicCode := BitVec.ofNat 64 15476811071966029319 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18050205819880064 + maskLow := BitVec.ofNat 64 17598092214559 + maskHigh := BitVec.ofNat 64 9345848840193 + systematicCode := BitVec.ofNat 64 15478476474070803975 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9359670057910912 + maskLow := BitVec.ofNat 64 140741783912735 + maskHigh := BitVec.ofNat 64 1690018091401217 + systematicCode := BitVec.ofNat 64 16565313414467823111 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36046466531215488 + maskLow := BitVec.ofNat 64 306244813316489503 + maskHigh := BitVec.ofNat 64 2306968909120569345 + systematicCode := BitVec.ofNat 64 18151088100368328199 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2533352116603008 + maskLow := BitVec.ofNat 64 140741783912735 + maskHigh := BitVec.ofNat 64 2306968909191839753 + systematicCode := BitVec.ofNat 64 18151113630074938887 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36046466531475584 + maskLow := BitVec.ofNat 64 153122425985892639 + maskHigh := BitVec.ofNat 64 4612248968380841985 + systematicCode := BitVec.ofNat 64 18294640329867273735 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2533352116863104 + maskLow := BitVec.ofNat 64 140741783912735 + maskHigh := BitVec.ofNat 64 4612248968416460809 + systematicCode := BitVec.ofNat 64 18294663660584183303 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9359674386172544 + maskLow := BitVec.ofNat 64 140741783912735 + maskHigh := BitVec.ofNat 64 6917538373489950721 + systematicCode := BitVec.ofNat 64 18301457693658719751 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x260e. -/ +def normalizedWeightSixteenCandidateBucket_260e : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .twoE8 + affineCode := BitVec.ofNat 56 2261695720471552 + maskLow := BitVec.ofNat 64 1103813476759 + maskHigh := BitVec.ofNat 64 1103806595329 + systematicCode := BitVec.ofNat 64 15042464008213505550 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10208966823127040 + maskLow := BitVec.ofNat 64 6917530131448267159 + maskHigh := BitVec.ofNat 64 1133871368193 + systematicCode := BitVec.ofNat 64 15044159641138308622 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9650414916216832 + maskLow := BitVec.ofNat 64 8800388579735 + maskHigh := BitVec.ofNat 64 1135481979137 + systematicCode := BitVec.ofNat 64 15044200589742777870 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11334870219630592 + maskLow := BitVec.ofNat 64 27022701571408279 + maskHigh := BitVec.ofNat 64 8800387991553 + systematicCode := BitVec.ofNat 64 15474816290829444622 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9659214498899968 + maskLow := BitVec.ofNat 64 8800388579735 + maskHigh := BitVec.ofNat 64 8800394281217 + systematicCode := BitVec.ofNat 64 15474840747011155470 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11339267997706240 + maskLow := BitVec.ofNat 64 1105417798039 + maskHigh := BitVec.ofNat 64 8830452760833 + systematicCode := BitVec.ofNat 64 15476498422587663886 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9593243801233408 + maskLow := BitVec.ofNat 64 8800388579735 + maskHigh := BitVec.ofNat 64 27022701570820097 + systematicCode := BitVec.ofNat 64 17071686867387622926 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11335454370588672 + maskLow := BitVec.ofNat 64 4629700455592165783 + maskHigh := BitVec.ofNat 64 2323857407723177985 + systematicCode := BitVec.ofNat 64 18153050758688679438 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9659798649858048 + maskLow := BitVec.ofNat 64 8800388579735 + maskHigh := BitVec.ofNat 64 2323857408801112073 + systematicCode := BitVec.ofNat 64 18153091651492849166 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11335454371872896 + maskLow := BitVec.ofNat 64 2314850247123730839 + maskHigh := BitVec.ofNat 64 4620693217682130945 + systematicCode := BitVec.ofNat 64 18296602988187624974 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9659798651142272 + maskLow := BitVec.ofNat 64 8800388579735 + maskHigh := BitVec.ofNat 64 4620693218221096969 + systematicCode := BitVec.ofNat 64 18296641682002093582 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9593239774453888 + maskLow := BitVec.ofNat 64 8800388579735 + maskHigh := BitVec.ofNat 64 6917537858093844481 + systematicCode := BitVec.ofNat 64 18301457663476049422 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x2616. -/ +def normalizedWeightSixteenCandidateBucket_2616 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .twoE8 + affineCode := BitVec.ofNat 56 2261699715546112 + maskLow := BitVec.ofNat 64 73115699479 + maskHigh := BitVec.ofNat 64 73014444049 + systematicCode := BitVec.ofNat 64 14465994425592063510 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10208967622141952 + maskLow := BitVec.ofNat 64 6917529100656118039 + maskHigh := BitVec.ofNat 64 103079215233 + systematicCode := BitVec.ofNat 64 14467690092741338646 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9650415715231744 + maskLow := BitVec.ofNat 64 554051373335 + maskHigh := BitVec.ofNat 64 104689827857 + systematicCode := BitVec.ofNat 64 14467739837304612374 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11334867556247552 + maskLow := BitVec.ofNat 64 432345637242603799 + maskHigh := BitVec.ofNat 64 554050781313 + systematicCode := BitVec.ofNat 64 14898346776926430742 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9659211835516928 + maskLow := BitVec.ofNat 64 554051373335 + maskHigh := BitVec.ofNat 64 554151444497 + systematicCode := BitVec.ofNat 64 14898388825025750550 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11339265600661504 + maskLow := BitVec.ofNat 64 74625648919 + maskHigh := BitVec.ofNat 64 584115552273 + systematicCode := BitVec.ofNat 64 14900028839831479830 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9593241137850368 + maskLow := BitVec.ofNat 64 554051373335 + maskHigh := BitVec.ofNat 64 432345637242011777 + systematicCode := BitVec.ofNat 64 17650390623276967446 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11335456234956800 + maskLow := BitVec.ofNat 64 4899916433234397463 + maskHigh := BitVec.ofNat 64 2594073385365405825 + systematicCode := BitVec.ofNat 64 18155293762543560214 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9659800514226176 + maskLow := BitVec.ofNat 64 554051373335 + maskHigh := BitVec.ofNat 64 2594073386506256393 + systematicCode := BitVec.ofNat 64 18155343485665748502 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11335456236241024 + maskLow := BitVec.ofNat 64 2449958235944847639 + maskHigh := BitVec.ofNat 64 4755801206503243905 + systematicCode := BitVec.ofNat 64 18298845992042505750 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9659800515510400 + maskLow := BitVec.ofNat 64 554051373335 + maskHigh := BitVec.ofNat 64 4755801207073669129 + systematicCode := BitVec.ofNat 64 18298893516174992918 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9593241106145408 + maskLow := BitVec.ofNat 64 554051373335 + maskHigh := BitVec.ofNat 64 6917529611756634241 + systematicCode := BitVec.ofNat 64 18301448867248285206 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x2619. -/ +def normalizedWeightSixteenCandidateBucket_2619 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.node + (.leaf + { patternClass := .twoE8 + affineCode := BitVec.ofNat 56 2393087596968960 + maskLow := BitVec.ofNat 64 1688888515563799 + maskHigh := BitVec.ofNat 64 4369 + systematicCode := BitVec.ofNat 64 10993719229626590745 }) + (.leaf + { patternClass := .twoE8 + affineCode := BitVec.ofNat 56 18032540990454784 + maskLow := BitVec.ofNat 64 18764712710423 + maskHigh := BitVec.ofNat 64 393225 + systematicCode := BitVec.ofNat 64 11863192082326300185 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10274116102006784 + maskLow := BitVec.ofNat 64 6917529066296381719 + maskHigh := BitVec.ofNat 64 6273 + systematicCode := BitVec.ofNat 64 10995414780038489625 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11400016036112384 + maskLow := BitVec.ofNat 64 432345602882867479 + maskHigh := BitVec.ofNat 64 33153 + systematicCode := BitVec.ofNat 64 11426071464223581721 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11400016302450688 + maskLow := BitVec.ofNat 64 27021636419522839 + maskHigh := BitVec.ofNat 64 34833 + systematicCode := BitVec.ofNat 64 11427753682520122905 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18102914064319488 + maskLow := BitVec.ofNat 64 4899916467594137879 + maskHigh := BitVec.ofNat 64 2359425 + systematicCode := BitVec.ofNat 64 12368168241372669465 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18102914063149056 + maskLow := BitVec.ofNat 64 2449958270304588055 + maskHigh := BitVec.ofNat 64 4325505 + systematicCode := BitVec.ofNat 64 12511720470871615001 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18102639185373184 + maskLow := BitVec.ofNat 64 149606596415767 + maskHigh := BitVec.ofNat 64 6291465 + systematicCode := BitVec.ofNat 64 12514243729328514585 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18102913797981184 + maskLow := BitVec.ofNat 64 4629701520744059159 + maskHigh := BitVec.ofNat 64 33818625 + systematicCode := BitVec.ofNat 64 12944637789635421721 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10274390979782656 + maskLow := BitVec.ofNat 64 4612389710164726039 + maskHigh := BitVec.ofNat 64 35655681 + systematicCode := BitVec.ofNat 64 12946609213800326681 }) + ) + ) + ) + ) + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18102913796810752 + maskLow := BitVec.ofNat 64 2314851312275624215 + maskHigh := BitVec.ofNat 64 67241985 + systematicCode := BitVec.ofNat 64 13088190019134367257 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10274390980953088 + maskLow := BitVec.ofNat 64 2307109650904453399 + maskHigh := BitVec.ofNat 64 71307265 + systematicCode := BitVec.ofNat 64 13091287343273223705 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18102638919034880 + maskLow := BitVec.ofNat 64 142391051358487 + maskHigh := BitVec.ofNat 64 100663305 + systematicCode := BitVec.ofNat 64 13092956281345353241 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18094117677696000 + maskLow := BitVec.ofNat 64 306262371142799639 + maskHigh := BitVec.ofNat 64 537165825 + systematicCode := BitVec.ofNat 64 13449048614417999385 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11400290913888256 + maskLow := BitVec.ofNat 64 288802126493716759 + maskHigh := BitVec.ofNat 64 538968321 + systematicCode := BitVec.ofNat 64 13451004645419197977 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11400291180226560 + maskLow := BitVec.ofNat 64 18577902514278679 + maskHigh := BitVec.ofNat 64 570425361 + systematicCode := BitVec.ofNat 64 13453247614779598361 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18094117676525568 + maskLow := BitVec.ofNat 64 153139983812202775 + maskHigh := BitVec.ofNat 64 1073905665 + systematicCode := BitVec.ofNat 64 13592600843916944921 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11400290915058688 + maskLow := BitVec.ofNat 64 145249888371282199 + maskHigh := BitVec.ofNat 64 1077936385 + systematicCode := BitVec.ofNat 64 13595682774892095001 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11400291181396992 + maskLow := BitVec.ofNat 64 10133653212958999 + maskHigh := BitVec.ofNat 64 1140850705 + systematicCode := BitVec.ofNat 64 13597925744252495385 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18093842798749696 + maskLow := BitVec.ofNat 64 26942330442007 + maskHigh := BitVec.ofNat 64 1610612745 + systematicCode := BitVec.ofNat 64 13599329738778682905 }) + ) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x261f. -/ +def normalizedWeightSixteenCandidateBucket_261f : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089445584807936 + maskLow := BitVec.ofNat 64 141910015050007 + maskHigh := BitVec.ofNat 64 1688849860263945 + systematicCode := BitVec.ofNat 64 16565231594047612447 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711166981154816 + maskLow := BitVec.ofNat 64 38655328535 + maskHigh := BitVec.ofNat 64 1688849860296977 + systematicCode := BitVec.ofNat 64 16565258202309338655 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11338722287167488 + maskLow := BitVec.ofNat 64 74122363159 + maskHigh := BitVec.ofNat 64 9570149208162321 + systematicCode := BitVec.ofNat 64 16925522772240770591 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11338722288337920 + maskLow := BitVec.ofNat 64 73619046679 + maskHigh := BitVec.ofNat 64 19140298416324625 + systematicCode := BitVec.ofNat 64 17070200910236624415 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089445020674048 + maskLow := BitVec.ofNat 64 26461294133527 + maskHigh := BitVec.ofNat 64 27021597764222985 + systematicCode := BitVec.ofNat 64 17071605051480942111 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711166417020928 + maskLow := BitVec.ofNat 64 38655328535 + maskHigh := BitVec.ofNat 64 27021597764229137 + systematicCode := BitVec.ofNat 64 17071625114111845919 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11338718292092928 + maskLow := BitVec.ofNat 64 1104883056919 + maskHigh := BitVec.ofNat 64 144678138029277441 + systematicCode := BitVec.ofNat 64 17501992354996430367 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11338718293263360 + maskLow := BitVec.ofNat 64 1104348283159 + maskHigh := BitVec.ofNat 64 289356276058554625 + systematicCode := BitVec.ofNat 64 17646670492992284191 }) + ) + ) + ) + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089441558276096 + maskLow := BitVec.ofNat 64 19245749076247 + maskHigh := BitVec.ofNat 64 432345564227567625 + systematicCode := BitVec.ofNat 64 17650317603497780767 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711162954622976 + maskLow := BitVec.ofNat 64 38655328535 + maskHigh := BitVec.ofNat 64 432345564227572097 + systematicCode := BitVec.ofNat 64 17650337640559814175 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11340917350878336 + maskLow := BitVec.ofNat 64 140741855248663 + maskHigh := BitVec.ofNat 64 2306968909120569345 + systematicCode := BitVec.ofNat 64 18151088000626075167 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9786517887150080 + maskLow := BitVec.ofNat 64 38655328535 + maskHigh := BitVec.ofNat 64 2613213683781730313 + systematicCode := BitVec.ofNat 64 18155396468381722143 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11340917351268480 + maskLow := BitVec.ofNat 64 140741819597079 + maskHigh := BitVec.ofNat 64 4612248968380841985 + systematicCode := BitVec.ofNat 64 18294640238714824223 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9786517888434304 + maskLow := BitVec.ofNat 64 38655328535 + maskHigh := BitVec.ofNat 64 4765371355711406089 + systematicCode := BitVec.ofNat 64 18298946498890966559 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089441526571136 + maskLow := BitVec.ofNat 64 150087632781591 + maskHigh := BitVec.ofNat 64 6917529027641081865 + systematicCode := BitVec.ofNat 64 18301369250499995167 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711162922918016 + maskLow := BitVec.ofNat 64 38655328535 + maskHigh := BitVec.ofNat 64 6917529027641116801 + systematicCode := BitVec.ofNat 64 18301395884531131935 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x2623. -/ +def normalizedWeightSixteenCandidateBucket_2623 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .d16Plus + affineCode := BitVec.ofNat 56 54397257743630464 + maskLow := BitVec.ofNat 64 562954284761367 + maskHigh := BitVec.ofNat 64 4611826755915874305 + systematicCode := BitVec.ofNat 64 18293518754034361891 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9359635698188928 + maskLow := BitVec.ofNat 64 2305843013509382423 + maskHigh := BitVec.ofNat 64 1127103034556417 + systematicCode := BitVec.ofNat 64 16559956589993928227 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2533317756881024 + maskLow := BitVec.ofNat 64 2305843013509382423 + maskHigh := BitVec.ofNat 64 1266637466632193 + systematicCode := BitVec.ofNat 64 16564157711851857443 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36046432171493504 + maskLow := BitVec.ofNat 64 306807728910303511 + maskHigh := BitVec.ofNat 64 1266637932068865 + systematicCode := BitVec.ofNat 64 16564162968001062435 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148542350557824 + maskLow := BitVec.ofNat 64 2305843013509382423 + maskHigh := BitVec.ofNat 64 9008298833483777 + systematicCode := BitVec.ofNat 64 16920223467011974691 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085372861121152 + maskLow := BitVec.ofNat 64 288256768726466839 + maskHigh := BitVec.ofNat 64 9008299303239681 + systematicCode := BitVec.ofNat 64 16920228813186999843 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36169569957611648 + maskLow := BitVec.ofNat 64 288230381554696471 + maskHigh := BitVec.ofNat 64 9147936810205185 + systematicCode := BitVec.ofNat 64 16924445439824111139 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148523174199936 + maskLow := BitVec.ofNat 64 2305843013509382423 + maskHigh := BitVec.ofNat 64 144115256799531137 + systematicCode := BitVec.ofNat 64 17494423623274472995 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085353684763264 + maskLow := BitVec.ofNat 64 18032544747028759 + maskHigh := BitVec.ofNat 64 144115257332203521 + systematicCode := BitVec.ofNat 64 17494437731316475427 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36169571022964864 + maskLow := BitVec.ofNat 64 18014403881009431 + maskHigh := BitVec.ofNat 64 144255925568405505 + systematicCode := BitVec.ofNat 64 17500897361674249763 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2533867512692864 + maskLow := BitVec.ofNat 64 2305843013509382423 + maskHigh := BitVec.ofNat 64 4611686052787259521 + systematicCode := BitVec.ofNat 64 18286763583792096803 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36046981927305344 + maskLow := BitVec.ofNat 64 572300097945879 + maskHigh := BitVec.ofNat 64 4611686053323997185 + systematicCode := BitVec.ofNat 64 18286789743495554595 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9359090270898816 + maskLow := BitVec.ofNat 64 2305843013509382423 + maskHigh := BitVec.ofNat 64 4764949143783211009 + systematicCode := BitVec.ofNat 64 18298946482586920483 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x2625. -/ +def normalizedWeightSixteenCandidateBucket_2625 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .d16Plus + affineCode := BitVec.ofNat 56 54397257742573824 + maskLow := BitVec.ofNat 64 1125904273965335 + maskHigh := BitVec.ofNat 64 2305983746702311425 + systematicCode := BitVec.ofNat 64 18149405773605381669 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9359635697977600 + maskLow := BitVec.ofNat 64 4611686022723207447 + maskHigh := BitVec.ofNat 64 564153618006017 + systematicCode := BitVec.ofNat 64 16415841401951757861 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2533317757124864 + maskLow := BitVec.ofNat 64 4611686022723207447 + maskHigh := BitVec.ofNat 64 703687477690369 + systematicCode := BitVec.ofNat 64 16420040316196496933 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36046432171737344 + maskLow := BitVec.ofNat 64 154248291533259031 + maskHigh := BitVec.ofNat 64 703688515518465 + systematicCode := BitVec.ofNat 64 16420049970325104165 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148542350346496 + maskLow := BitVec.ofNat 64 4611686022723207447 + maskHigh := BitVec.ofNat 64 18015498054670337 + systematicCode := BitVec.ofNat 64 17064336456064706085 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085372860909824 + maskLow := BitVec.ofNat 64 144141580650742039 + maskHigh := BitVec.ofNat 64 18015499094851585 + systematicCode := BitVec.ofNat 64 17064346191696176677 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36169569957855488 + maskLow := BitVec.ofNat 64 144115192975655191 + maskHigh := BitVec.ofNat 64 18155136031391745 + systematicCode := BitVec.ofNat 64 17068558420253353509 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148523173988608 + maskLow := BitVec.ofNat 64 4611686022723207447 + maskHigh := BitVec.ofNat 64 288230444873289857 + systematicCode := BitVec.ofNat 64 17638536612327204389 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085353684551936 + maskLow := BitVec.ofNat 64 9025345492418839 + maskHigh := BitVec.ofNat 64 288230445944930305 + systematicCode := BitVec.ofNat 64 17638555109825652261 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36169571023208704 + maskLow := BitVec.ofNat 64 9007204091625751 + maskHigh := BitVec.ofNat 64 288371113642164225 + systematicCode := BitVec.ofNat 64 17645010342103492133 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2533867512676608 + maskLow := BitVec.ofNat 64 4611686022723207447 + maskHigh := BitVec.ofNat 64 2305843043573696641 + systematicCode := BitVec.ofNat 64 18142650594739627557 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36046981927289088 + maskLow := BitVec.ofNat 64 1135250051498263 + maskHigh := BitVec.ofNat 64 2305843044647174145 + systematicCode := BitVec.ofNat 64 18142676763032888869 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9359090270947584 + maskLow := BitVec.ofNat 64 4611686022723207447 + maskHigh := BitVec.ofNat 64 2612228522436984833 + systematicCode := BitVec.ofNat 64 18155396443521426981 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x290b. -/ +def normalizedWeightSixteenCandidateBucket_290b : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085475959048448 + maskLow := BitVec.ofNat 64 2449962599632142647 + maskHigh := BitVec.ofNat 64 1374389551105 + systematicCode := BitVec.ofNat 64 15045855079361161483 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148645448485120 + maskLow := BitVec.ofNat 64 70373040259383 + maskHigh := BitVec.ofNat 64 1374959961089 + systematicCode := BitVec.ofNat 64 15045887210565740811 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085456632875264 + maskLow := BitVec.ofNat 64 38284999175242039 + maskHigh := BitVec.ofNat 64 17609365929985 + systematicCode := BitVec.ofNat 64 15691840099171182859 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148626122311936 + maskLow := BitVec.ofNat 64 70373040259383 + maskHigh := BitVec.ofNat 64 17609374827521 + systematicCode := BitVec.ofNat 64 15691859036437555467 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18050274408270080 + maskLow := BitVec.ofNat 64 4404624294199 + maskHigh := BitVec.ofNat 64 17867063952385 + systematicCode := BitVec.ofNat 64 15694363365998012683 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9359738796116224 + maskLow := BitVec.ofNat 64 70373040259383 + maskHigh := BitVec.ofNat 64 9571265899675649 + systematicCode := BitVec.ofNat 64 16925601367460751627 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36099311794258176 + maskLow := BitVec.ofNat 64 2341871879248216375 + maskHigh := BitVec.ofNat 64 585467951558180865 + systematicCode := BitVec.ofNat 64 17864264021080353035 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9288820262568192 + maskLow := BitVec.ofNat 64 70373040259383 + maskHigh := BitVec.ofNat 64 585467952103424017 + systematicCode := BitVec.ofNat 64 17864296130710153483 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36099311827812608 + maskLow := BitVec.ofNat 64 146367060905099575 + maskHigh := BitVec.ofNat 64 9223934986808213505 + systematicCode := BitVec.ofNat 64 18366696824326662411 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9288820296122624 + maskLow := BitVec.ofNat 64 70373040259383 + maskHigh := BitVec.ofNat 64 9223934986842275857 + systematicCode := BitVec.ofNat 64 18366721237492508939 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9359743057791232 + maskLow := BitVec.ofNat 64 70373040259383 + maskHigh := BitVec.ofNat 64 9799850656222167041 + systematicCode := BitVec.ofNat 64 18372392682012879115 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x290d. -/ +def normalizedWeightSixteenCandidateBucket_290d : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085475959211008 + maskLow := BitVec.ofNat 64 4899918597898436951 + maskHigh := BitVec.ofNat 64 1236950589441 + systematicCode := BitVec.ofNat 64 15045289939007842573 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148645448647680 + maskLow := BitVec.ofNat 64 35188668170583 + maskHigh := BitVec.ofNat 64 1238091432449 + systematicCode := BitVec.ofNat 64 15045326468191824141 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085456631867392 + maskLow := BitVec.ofNat 64 38282800151986519 + maskHigh := BitVec.ofNat 64 17600775987201 + systematicCode := BitVec.ofNat 64 15691274950194374925 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148626121304064 + maskLow := BitVec.ofNat 64 35188668170583 + maskHigh := BitVec.ofNat 64 17600784892417 + systematicCode := BitVec.ofNat 64 15691296086450448653 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18050274407262208 + maskLow := BitVec.ofNat 64 2205601038679 + maskHigh := BitVec.ofNat 64 17729624998401 + systematicCode := BitVec.ofNat 64 15693798208431401229 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9359738796278784 + maskLow := BitVec.ofNat 64 35188668170583 + maskHigh := BitVec.ofNat 64 19141406517895169 + systematicCode := BitVec.ofNat 64 17070279496866408717 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36099311794160640 + maskLow := BitVec.ofNat 64 4647714888461910359 + maskHigh := BitVec.ofNat 64 594475150812913665 + systematicCode := BitVec.ofNat 64 17864824780600453389 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9288820262470656 + maskLow := BitVec.ofNat 64 35188668170583 + maskHigh := BitVec.ofNat 64 594475151895035921 + systematicCode := BitVec.ofNat 64 17864861279686699277 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36099311827715072 + maskLow := BitVec.ofNat 64 290482248980955479 + maskHigh := BitVec.ofNat 64 9224497936761626625 + systematicCode := BitVec.ofNat 64 18367257583846762765 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9288820296025088 + maskLow := BitVec.ofNat 64 35188668170583 + maskHigh := BitVec.ofNat 64 9224497936829251601 + systematicCode := BitVec.ofNat 64 18367286386469054733 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9359743057693696 + maskLow := BitVec.ofNat 64 35188668170583 + maskHigh := BitVec.ofNat 64 9799850518783205377 + systematicCode := BitVec.ofNat 64 18372392673389259021 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x2916. -/ +def normalizedWeightSixteenCandidateBucket_2916 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.node + (.leaf + { patternClass := .twoE8 + affineCode := BitVec.ofNat 56 18032063712214016 + maskLow := BitVec.ofNat 64 4785147619641623 + maskHigh := BitVec.ofNat 64 1545 + systematicCode := BitVec.ofNat 64 10705767047079995670 }) + (.leaf + { patternClass := .twoE8 + affineCode := BitVec.ofNat 56 2392610318728192 + maskLow := BitVec.ofNat 64 6635725588759 + maskHigh := BitVec.ofNat 64 1114129 + systematicCode := BitVec.ofNat 64 12151144264872896790 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18102982246925312 + maskLow := BitVec.ofNat 64 4899916467594660119 + maskHigh := BitVec.ofNat 64 9345 + systematicCode := BitVec.ofNat 64 11210743137138452758 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18102982245754880 + maskLow := BitVec.ofNat 64 2449958270305110295 + maskHigh := BitVec.ofNat 64 17025 + systematicCode := BitVec.ofNat 64 11354295366637398294 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18102980098402304 + maskLow := BitVec.ofNat 64 38280669848209687 + maskHigh := BitVec.ofNat 64 24585 + systematicCode := BitVec.ofNat 64 11356818694082210070 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10274422923732992 + maskLow := BitVec.ofNat 64 6917529066296903959 + maskHigh := BitVec.ofNat 64 1572993 + systematicCode := BitVec.ofNat 64 12152839884272707862 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11400322857838592 + maskLow := BitVec.ofNat 64 432345602883389719 + maskHigh := BitVec.ofNat 64 8454273 + systematicCode := BitVec.ofNat 64 12583496568457799958 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11400357215479808 + maskLow := BitVec.ofNat 64 105591772088599 + maskHigh := BitVec.ofNat 64 8912913 + systematicCode := BitVec.ofNat 64 12585178717766428950 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18102947889284096 + maskLow := BitVec.ofNat 64 4612037866444359959 + maskHigh := BitVec.ofNat 64 34079745 + systematicCode := BitVec.ofNat 64 12945478915830130966 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10274425071085568 + maskLow := BitVec.ofNat 64 4647717018765691159 + maskHigh := BitVec.ofNat 64 34611201 + systematicCode := BitVec.ofNat 64 12945768087605618966 }) + ) + ) + ) + ) + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18102947888113664 + maskLow := BitVec.ofNat 64 2306159672858577175 + maskHigh := BitVec.ofNat 64 67633665 + systematicCode := BitVec.ofNat 64 13089591896292665622 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10274425072256000 + maskLow := BitVec.ofNat 64 2341876208575252759 + maskHigh := BitVec.ofNat 64 68173825 + systematicCode := BitVec.ofNat 64 13089885466114926870 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18102945740761088 + maskLow := BitVec.ofNat 64 36310826047572247 + maskHigh := BitVec.ofNat 64 100663305 + systematicCode := BitVec.ofNat 64 13092956350333266198 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11400325005191168 + maskLow := BitVec.ofNat 64 290484379284736279 + maskHigh := BitVec.ofNat 64 536944641 + systematicCode := BitVec.ofNat 64 13448200890851928342 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18094151768998912 + maskLow := BitVec.ofNat 64 292804348819343639 + maskHigh := BitVec.ofNat 64 545260545 + systematicCode := BitVec.ofNat 64 13451852368985270550 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11400359362832384 + maskLow := BitVec.ofNat 64 73121819330839 + maskHigh := BitVec.ofNat 64 570425361 + systematicCode := BitVec.ofNat 64 13453247545791686934 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11400325006361600 + maskLow := BitVec.ofNat 64 146371390232135959 + maskHigh := BitVec.ofNat 64 1073823745 + systematicCode := BitVec.ofNat 64 13592318269361236246 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18094151767828480 + maskLow := BitVec.ofNat 64 148653976371398935 + maskHigh := BitVec.ofNat 64 1082130945 + systematicCode := BitVec.ofNat 64 13595965349447805206 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11400359364002816 + maskLow := BitVec.ofNat 64 40136470497559 + maskHigh := BitVec.ofNat 64 1140850705 + systematicCode := BitVec.ofNat 64 13597925675264583958 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18094149620475904 + maskLow := BitVec.ofNat 64 6755953492953367 + maskHigh := BitVec.ofNat 64 1610612745 + systematicCode := BitVec.ofNat 64 13599329807766595862 }) + ) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x2919. -/ +def normalizedWeightSixteenCandidateBucket_2919 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .twoE8 + affineCode := BitVec.ofNat 56 18084905231727616 + maskLow := BitVec.ofNat 64 38941036823 + maskHigh := BitVec.ofNat 64 25769803785 + systematicCode := BitVec.ofNat 64 14178042213064321305 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085459317228544 + maskLow := BitVec.ofNat 64 4899916433234923799 + maskHigh := BitVec.ofNat 64 154618822785 + systematicCode := BitVec.ofNat 64 14683018449840908569 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148628806665216 + maskLow := BitVec.ofNat 64 554051899671 + maskHigh := BitVec.ofNat 64 155759673353 + systematicCode := BitVec.ofNat 64 14683068172963096857 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085459316058112 + maskLow := BitVec.ofNat 64 2449958235945373975 + maskHigh := BitVec.ofNat 64 283467841665 + systematicCode := BitVec.ofNat 64 14826570679339854105 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148628805494784 + maskLow := BitVec.ofNat 64 554051899671 + maskHigh := BitVec.ofNat 64 284038266889 + systematicCode := BitVec.ofNat 64 14826618203472341273 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18050274944100352 + maskLow := BitVec.ofNat 64 40937525527 + maskHigh := BitVec.ofNat 64 412316860425 + systematicCode := BitVec.ofNat 64 14829093834297125145 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9359735038411776 + maskLow := BitVec.ofNat 64 554051899671 + maskHigh := BitVec.ofNat 64 1224979124414578817 + systematicCode := BitVec.ofNat 64 17938335130700425497 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36099303741588480 + maskLow := BitVec.ofNat 64 6917529100656644375 + maskHigh := BitVec.ofNat 64 1729382256910270593 + systematicCode := BitVec.ofNat 64 17939965405443991833 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9288812209898496 + maskLow := BitVec.ofNat 64 554051899671 + maskHigh := BitVec.ofNat 64 1729382258520883217 + systematicCode := BitVec.ofNat 64 17940015150007265561 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36099303775142912 + maskLow := BitVec.ofNat 64 432345637243130135 + maskHigh := BitVec.ofNat 64 9295429630892703873 + systematicCode := BitVec.ofNat 64 18370622089629083929 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9288812243452928 + maskLow := BitVec.ofNat 64 554051899671 + maskHigh := BitVec.ofNat 64 9295429630993367057 + systematicCode := BitVec.ofNat 64 18370664137728403737 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9359735005121536 + maskLow := BitVec.ofNat 64 554051899671 + maskHigh := BitVec.ofNat 64 9799833201475059841 + systematicCode := BitVec.ofNat 64 18372379479047612697 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x291f. -/ +def normalizedWeightSixteenCandidateBucket_291f : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18050172403853312 + maskLow := BitVec.ofNat 64 40820113687 + maskHigh := BitVec.ofNat 64 1688849860263945 + systematicCode := BitVec.ofNat 64 16565231490648058143 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11329994913622016 + maskLow := BitVec.ofNat 64 72606423286039 + maskHigh := BitVec.ofNat 64 9570149208162321 + systematicCode := BitVec.ofNat 64 16925522858493749535 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9095787285981184 + maskLow := BitVec.ofNat 64 73015591191 + maskHigh := BitVec.ofNat 64 9570149208179209 + systematicCode := BitVec.ofNat 64 16925545077232183583 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11329994914792448 + maskLow := BitVec.ofNat 64 39621074452759 + maskHigh := BitVec.ofNat 64 19140298416324625 + systematicCode := BitVec.ofNat 64 17070200987966646559 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9095787287151616 + maskLow := BitVec.ofNat 64 73015591191 + maskHigh := BitVec.ofNat 64 19140298416333833 + systematicCode := BitVec.ofNat 64 17070221024828139807 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18050171839719424 + maskLow := BitVec.ofNat 64 39058506007 + maskHigh := BitVec.ofNat 64 27021597764222985 + systematicCode := BitVec.ofNat 64 17071604973650258207 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36170119698744320 + maskLow := BitVec.ofNat 64 70373312921879 + maskHigh := BitVec.ofNat 64 585467951558180865 + systematicCode := BitVec.ofNat 64 17864263895618431263 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36170119698841856 + maskLow := BitVec.ofNat 64 35188938735895 + maskHigh := BitVec.ofNat 64 594475150812913665 + systematicCode := BitVec.ofNat 64 17864824637958531359 }) + ) + ) + ) + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18050171302881280 + maskLow := BitVec.ofNat 64 2203457782039 + maskHigh := BitVec.ofNat 64 1161928703861588481 + systematicCode := BitVec.ofNat 64 17936309347767036191 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18050171303889152 + maskLow := BitVec.ofNat 64 4402478940439 + maskHigh := BitVec.ofNat 64 1170935903116329985 + systematicCode := BitVec.ofNat 64 17936874505333516575 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11330007798907904 + maskLow := BitVec.ofNat 64 7151121694999 + maskHigh := BitVec.ofNat 64 1224979098644774929 + systematicCode := BitVec.ofNat 64 17938269786044573983 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9095800171267072 + maskLow := BitVec.ofNat 64 73015591191 + maskHigh := BitVec.ofNat 64 1224979098644776577 + systematicCode := BitVec.ofNat 64 17938282147983468831 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36170120772518144 + maskLow := BitVec.ofNat 64 554058219799 + maskHigh := BitVec.ofNat 64 1729382256910270593 + systematicCode := BitVec.ofNat 64 17939965210859809055 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9024877342753792 + maskLow := BitVec.ofNat 64 73015591191 + maskHigh := BitVec.ofNat 64 1756403854674493457 + systematicCode := BitVec.ofNat 64 17940068132723435807 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9024877376308224 + maskLow := BitVec.ofNat 64 73015591191 + maskHigh := BitVec.ofNat 64 9297118480752967697 + systematicCode := BitVec.ofNat 64 18370717120444573983 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11330007765617664 + maskLow := BitVec.ofNat 64 106107168194839 + maskHigh := BitVec.ofNat 64 9799832789158199313 + systematicCode := BitVec.ofNat 64 18372304238938106143 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9095800137976832 + maskLow := BitVec.ofNat 64 73015591191 + maskHigh := BitVec.ofNat 64 9799832789158224001 + systematicCode := BitVec.ofNat 64 18372326496330656031 }) + ) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x2923. -/ +def normalizedWeightSixteenCandidateBucket_2923 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085372886124800 + maskLow := BitVec.ofNat 64 2305882595928506647 + maskHigh := BitVec.ofNat 64 1126999485579265 + systematicCode := BitVec.ofNat 64 16559935366964193571 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148542375561472 + maskLow := BitVec.ofNat 64 288230380447924503 + maskHigh := BitVec.ofNat 64 1126999955350529 + systematicCode := BitVec.ofNat 64 16559941007214717219 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36169573170544896 + maskLow := BitVec.ofNat 64 2305843015674167575 + maskHigh := BitVec.ofNat 64 1266637932068865 + systematicCode := BitVec.ofNat 64 16564162988684159267 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9359635723192576 + maskLow := BitVec.ofNat 64 288230380447924503 + maskHigh := BitVec.ofNat 64 9008453452300289 + systematicCode := BitVec.ofNat 64 16920247845749336355 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36099208721334528 + maskLow := BitVec.ofNat 64 2342153285505581335 + maskHigh := BitVec.ofNat 64 9147936810205185 + systematicCode := BitVec.ofNat 64 16924445462124112163 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9288717189644544 + maskLow := BitVec.ofNat 64 288230380447924503 + maskHigh := BitVec.ofNat 64 9147937288421377 + systematicCode := BitVec.ofNat 64 16924451183877499171 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148523049388288 + maskLow := BitVec.ofNat 64 288230380447924503 + maskHigh := BitVec.ofNat 64 72057611226186881 + systematicCode := BitVec.ofNat 64 17421241211661134115 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085353559951616 + maskLow := BitVec.ofNat 64 36033749117501719 + maskHigh := BitVec.ofNat 64 72057611284905985 + systematicCode := BitVec.ofNat 64 17421248744041425187 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9289266945458432 + maskLow := BitVec.ofNat 64 288230380447924503 + maskHigh := BitVec.ofNat 64 9223372174293803137 + systematicCode := BitVec.ofNat 64 18359945995404781859 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36099758477148416 + maskLow := BitVec.ofNat 64 317213400826135 + maskHigh := BitVec.ofNat 64 9223372174360838145 + systematicCode := BitVec.ofNat 64 18359967735654328611 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9359090262608128 + maskLow := BitVec.ofNat 64 288230380447924503 + maskHigh := BitVec.ofNat 64 9296696268355010561 + systematicCode := BitVec.ofNat 64 18370717104005785891 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x2925. -/ +def normalizedWeightSixteenCandidateBucket_2925 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085372886287360 + maskLow := BitVec.ofNat 64 4611758590491164951 + maskHigh := BitVec.ofNat 64 564049498603521 + systematicCode := BitVec.ofNat 64 16415817988488440101 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148542375724032 + maskLow := BitVec.ofNat 64 144115192372199703 + maskHigh := BitVec.ofNat 64 564050538807809 + systematicCode := BitVec.ofNat 64 16415828026718365989 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36169573170447360 + maskLow := BitVec.ofNat 64 4611686024887992599 + maskHigh := BitVec.ofNat 64 703688515518465 + systematicCode := BitVec.ofNat 64 16420050008221493541 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9359635723355136 + maskLow := BitVec.ofNat 64 144115192372199703 + maskHigh := BitVec.ofNat 64 18015781522505729 + systematicCode := BitVec.ofNat 64 17064365224224827685 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36099208721236992 + maskLow := BitVec.ofNat 64 4647996294719406359 + maskHigh := BitVec.ofNat 64 18155136031391745 + systematicCode := BitVec.ofNat 64 17068558459766647077 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9288717189547008 + maskLow := BitVec.ofNat 64 144115192372199703 + maskHigh := BitVec.ofNat 64 18155137080033281 + systematicCode := BitVec.ofNat 64 17068568570976479525 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148523048380416 + maskLow := BitVec.ofNat 64 144115192372199703 + maskHigh := BitVec.ofNat 64 72057602636251777 + systematicCode := BitVec.ofNat 64 17420678253117647141 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085353558943744 + maskLow := BitVec.ofNat 64 36031550094377239 + maskHigh := BitVec.ofNat 64 72057602661416961 + systematicCode := BitVec.ofNat 64 17420683595031193893 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9289266945360896 + maskLow := BitVec.ofNat 64 144115192372199703 + maskHigh := BitVec.ofNat 64 9223372311732764801 + systematicCode := BitVec.ofNat 64 18360508953948006693 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36099758477050880 + maskLow := BitVec.ofNat 64 352397773046039 + maskHigh := BitVec.ofNat 64 9223372311766237185 + systematicCode := BitVec.ofNat 64 18360528486618048805 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9359090262510592 + maskLow := BitVec.ofNat 64 144115192372199703 + maskHigh := BitVec.ofNat 64 9296133318368034817 + systematicCode := BitVec.ofNat 64 18370714904948844837 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x2a0b. -/ +def normalizedWeightSixteenCandidateBucket_2a0b : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085407239570048 + maskLow := BitVec.ofNat 64 1297041095026344247 + maskHigh := BitVec.ofNat 64 1649267474433 + systematicCode := BitVec.ofNat 64 15046137649554532875 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148576729006720 + maskLow := BitVec.ofNat 64 140741785485623 + maskHigh := BitVec.ofNat 64 1649569432577 + systematicCode := BitVec.ofNat 64 15046167586030889483 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085387913396864 + maskLow := BitVec.ofNat 64 20270600666808631 + maskHigh := BitVec.ofNat 64 35201551990785 + systematicCode := BitVec.ofNat 64 15763898788425771531 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148557402833536 + maskLow := BitVec.ofNat 64 140741785485623 + maskHigh := BitVec.ofNat 64 35201556677633 + systematicCode := BitVec.ofNat 64 15763915530963921419 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18050205688791680 + maskLow := BitVec.ofNat 64 4403551600951 + maskHigh := BitVec.ofNat 64 35734127903745 + systematicCode := BitVec.ofNat 64 15766702434995874315 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9359670076637824 + maskLow := BitVec.ofNat 64 140741785485623 + maskHigh := BitVec.ofNat 64 5067666272321537 + systematicCode := BitVec.ofNat 64 16853543773439666699 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36046466516650112 + maskLow := BitVec.ofNat 64 1170936044852412727 + maskHigh := BitVec.ofNat 64 580964351930826753 + systematicCode := BitVec.ofNat 64 17863983641303591435 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2533352102037632 + maskLow := BitVec.ofNat 64 140741785485623 + maskHigh := BitVec.ofNat 64 580964352203423777 + systematicCode := BitVec.ofNat 64 17864013551943690763 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36046466550202496 + maskLow := BitVec.ofNat 64 146367129625624887 + maskHigh := BitVec.ofNat 64 4612248968380841985 + systematicCode := BitVec.ofNat 64 18294640329800428043 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2533352135590016 + maskLow := BitVec.ofNat 64 140741785485623 + maskHigh := BitVec.ofNat 64 4612248968414887969 + systematicCode := BitVec.ofNat 64 18294663643471424011 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9359674338314880 + maskLow := BitVec.ofNat 64 140741785485623 + maskHigh := BitVec.ofNat 64 5188182504858746881 + systematicCode := BitVec.ofNat 64 18300336191798389259 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x2a0e. -/ +def normalizedWeightSixteenCandidateBucket_2a0e : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10208966839773184 + maskLow := BitVec.ofNat 64 5188147874539569559 + maskHigh := BitVec.ofNat 64 1236950589441 + systematicCode := BitVec.ofNat 64 15045289939024554510 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9650414932862976 + maskLow := BitVec.ofNat 64 35188669219223 + maskHigh := BitVec.ofNat 64 1238158541057 + systematicCode := BitVec.ofNat 64 15045326472470014478 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11334870236276736 + maskLow := BitVec.ofNat 64 20267302131925399 + maskHigh := BitVec.ofNat 64 35188667064321 + systematicCode := BitVec.ofNat 64 15763051064960559630 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9659214515546112 + maskLow := BitVec.ofNat 64 35188669219223 + maskHigh := BitVec.ofNat 64 35188671774977 + systematicCode := BitVec.ofNat 64 15763071105983261198 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11339268014352384 + maskLow := BitVec.ofNat 64 1105016717719 + maskHigh := BitVec.ofNat 64 35321811042561 + systematicCode := BitVec.ofNat 64 15765854698645957134 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9593243817879552 + maskLow := BitVec.ofNat 64 35188669219223 + maskHigh := BitVec.ofNat 64 20267302129770497 + systematicCode := BitVec.ofNat 64 17070560967548152334 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11335454320650240 + maskLow := BitVec.ofNat 64 4629700558672953751 + maskHigh := BitVec.ofNat 64 594475150812913665 + systematicCode := BitVec.ofNat 64 17864824780583741966 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9659798599919616 + maskLow := BitVec.ofNat 64 35188669219223 + maskHigh := BitVec.ofNat 64 594475151890841633 + systematicCode := BitVec.ofNat 64 17864861275408509454 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11335454486315136 + maskLow := BitVec.ofNat 64 578712693853192599 + maskHigh := BitVec.ofNat 64 4613937818241081345 + systematicCode := BitVec.ofNat 64 18295481469080578574 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9659798765584512 + maskLow := BitVec.ofNat 64 35188669219223 + maskHigh := BitVec.ofNat 64 4613937818375815201 + systematicCode := BitVec.ofNat 64 18295511366936242702 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9593239759888512 + maskLow := BitVec.ofNat 64 35188669219223 + maskHigh := BitVec.ofNat 64 5188182092541861889 + systematicCode := BitVec.ofNat 64 18300336178862959118 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x2a15. -/ +def normalizedWeightSixteenCandidateBucket_2a15 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.node + (.leaf + { patternClass := .twoE8 + affineCode := BitVec.ofNat 56 2393087611534336 + maskLow := BitVec.ofNat 64 5066691316876567 + maskHigh := BitVec.ofNat 64 1285 + systematicCode := BitVec.ofNat 64 10705484472608500245 }) + (.leaf + { patternClass := .twoE8 + affineCode := BitVec.ofNat 56 18032541005020160 + maskLow := BitVec.ofNat 64 5519035139351 + maskHigh := BitVec.ofNat 64 1179681 + systematicCode := BitVec.ofNat 64 12151426839344392725 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10274116124895232 + maskLow := BitVec.ofNat 64 5188146912466896151 + maskHigh := BitVec.ofNat 64 9345 + systematicCode := BitVec.ofNat 64 11210743137155295765 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11400016031950848 + maskLow := BitVec.ofNat 64 1297036834418787607 + maskHigh := BitVec.ofNat 64 33153 + systematicCode := BitVec.ofNat 64 11426071481403714069 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11400016300369920 + maskLow := BitVec.ofNat 64 20266340059251991 + maskHigh := BitVec.ofNat 64 40965 + systematicCode := BitVec.ofNat 64 11428875184313608725 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18102914195407872 + maskLow := BitVec.ofNat 64 5764607544511235351 + maskHigh := BitVec.ofNat 64 1572993 + systematicCode := BitVec.ofNat 64 12152839884255865365 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18102914044422144 + maskLow := BitVec.ofNat 64 720575961856279831 + maskHigh := BitVec.ofNat 64 4325505 + systematicCode := BitVec.ofNat 64 12511720453691484693 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18102639183292416 + maskLow := BitVec.ofNat 64 175943337444631 + maskHigh := BitVec.ofNat 64 4718625 + systematicCode := BitVec.ofNat 64 12513122227535030805 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10274390986024960 + maskLow := BitVec.ofNat 64 4612389710166295831 + maskHigh := BitVec.ofNat 64 34079745 + systematicCode := BitVec.ofNat 64 12945478915846973973 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18102913926988800 + maskLow := BitVec.ofNat 64 4629701520745628951 + maskHigh := BitVec.ofNat 64 34611201 + systematicCode := BitVec.ofNat 64 12945768087588776469 }) + ) + ) + ) + ) + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11400290893080576 + maskLow := BitVec.ofNat 64 1153519643229488407 + maskHigh := BitVec.ofNat 64 134742273 + systematicCode := BitVec.ofNat 64 13161648386540775957 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18094117833753600 + maskLow := BitVec.ofNat 64 1170940305459971351 + maskHigh := BitVec.ofNat 64 135299073 + systematicCode := BitVec.ofNat 64 13161944155352738325 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11400291161499648 + maskLow := BitVec.ofNat 64 18577902515848471 + maskHigh := BitVec.ofNat 64 167772165 + systematicCode := BitVec.ofNat 64 13165012840581376533 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18102913776003072 + maskLow := BitVec.ofNat 64 578713655925867799 + maskHigh := BitVec.ofNat 64 268574721 + systematicCode := BitVec.ofNat 64 13376424776085613077 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10274391137010688 + maskLow := BitVec.ofNat 64 581105093716280599 + maskHigh := BitVec.ofNat 64 272630785 + systematicCode := BitVec.ofNat 64 13379513304265665045 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18102638914873344 + maskLow := BitVec.ofNat 64 142391052928279 + maskHigh := BitVec.ofNat 64 301989921 + systematicCode := BitVec.ofNat 64 13381191055543577109 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18094117682767872 + maskLow := BitVec.ofNat 64 146371390233183511 + maskHigh := BitVec.ofNat 64 1073905665 + systematicCode := BitVec.ofNat 64 13592600843849574933 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11400291044066304 + maskLow := BitVec.ofNat 64 148653976372446487 + maskHigh := BitVec.ofNat 64 1077936385 + systematicCode := BitVec.ofNat 64 13595682774959467029 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18093842821638144 + maskLow := BitVec.ofNat 64 40136471545111 + maskHigh := BitVec.ofNat 64 1207959585 + systematicCode := BitVec.ofNat 64 13598208249752922645 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11400291312485376 + maskLow := BitVec.ofNat 64 6755953494000919 + maskHigh := BitVec.ofNat 64 1342177285 + systematicCode := BitVec.ofNat 64 13599047233278257685 }) + ) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x2a1a. -/ +def normalizedWeightSixteenCandidateBucket_2a1a : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .twoE8 + affineCode := BitVec.ofNat 56 2261699730111488 + maskLow := BitVec.ofNat 64 21778997527 + maskHigh := BitVec.ofNat 64 21474836485 + systematicCode := BitVec.ofNat 64 14177759634281081370 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10208967645030400 + maskLow := BitVec.ofNat 64 5188146792207819031 + maskHigh := BitVec.ofNat 64 154618822785 + systematicCode := BitVec.ofNat 64 14683018449857620506 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9650415738120192 + maskLow := BitVec.ofNat 64 554052952343 + maskHigh := BitVec.ofNat 64 155826782213 + systematicCode := BitVec.ofNat 64 14683068177241287194 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11334867552086016 + maskLow := BitVec.ofNat 64 1297036714159710487 + maskHigh := BitVec.ofNat 64 554050781313 + systematicCode := BitVec.ofNat 64 14898346794106038810 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9659211831355392 + maskLow := BitVec.ofNat 64 554052952343 + maskHigh := BitVec.ofNat 64 554352771077 + systematicCode := BitVec.ofNat 64 14898393223005153818 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11339265598580736 + maskLow := BitVec.ofNat 64 22684967191 + maskHigh := BitVec.ofNat 64 687194767365 + systematicCode := BitVec.ofNat 64 14901150324511681050 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9593241133688832 + maskLow := BitVec.ofNat 64 554052952343 + maskHigh := BitVec.ofNat 64 1297036714157539457 + systematicCode := BitVec.ofNat 64 17938616601382169114 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11335456199583744 + maskLow := BitVec.ofNat 64 5764607664770326807 + maskHigh := BitVec.ofNat 64 1729382256910270593 + systematicCode := BitVec.ofNat 64 17939965405427280410 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9659800478853120 + maskLow := BitVec.ofNat 64 554052952343 + maskHigh := BitVec.ofNat 64 1729382258252447777 + systematicCode := BitVec.ofNat 64 17940015145729075738 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11335456365248640 + maskLow := BitVec.ofNat 64 720576082115371287 + maskHigh := BitVec.ofNat 64 4755801206503243905 + systematicCode := BitVec.ofNat 64 18298845974862899738 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9659800644518016 + maskLow := BitVec.ofNat 64 554052952343 + maskHigh := BitVec.ofNat 64 4755801206671015969 + systematicCode := BitVec.ofNat 64 18298889118195591706 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9593241101983872 + maskLow := BitVec.ofNat 64 554052952343 + maskHigh := BitVec.ofNat 64 5188147457925578881 + systematicCode := BitVec.ofNat 64 18300322984521312794 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x2a1f. -/ +def normalizedWeightSixteenCandidateBucket_2a1f : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11338722268440576 + maskLow := BitVec.ofNat 64 22584328471 + maskHigh := BitVec.ofNat 64 2814749767106565 + systematicCode := BitVec.ofNat 64 16637287980862679583 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089445580646400 + maskLow := BitVec.ofNat 64 141858477015319 + maskHigh := BitVec.ofNat 64 5066549580791841 + systematicCode := BitVec.ofNat 64 16853466368245574175 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711166976993280 + maskLow := BitVec.ofNat 64 141736116503 + maskHigh := BitVec.ofNat 64 5066549580824837 + systematicCode := BitVec.ofNat 64 16853488578394204703 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089445043562496 + maskLow := BitVec.ofNat 64 39603895632151 + maskHigh := BitVec.ofNat 64 20266198323167265 + systematicCode := BitVec.ofNat 64 17070483562454919711 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711166439909376 + maskLow := BitVec.ofNat 64 141736116503 + maskHigh := BitVec.ofNat 64 20266198323176453 + systematicCode := BitVec.ofNat 64 17070502499788139039 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11338722419426304 + maskLow := BitVec.ofNat 64 21879685399 + maskHigh := BitVec.ofNat 64 22517998136852485 + systematicCode := BitVec.ofNat 64 17071322394866952735 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11340917251001472 + maskLow := BitVec.ofNat 64 140742058148119 + maskHigh := BitVec.ofNat 64 580964351930826753 + systematicCode := BitVec.ofNat 64 17863983524448315935 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11338718393140224 + maskLow := BitVec.ofNat 64 1103947202839 + maskHigh := BitVec.ofNat 64 1157425104234217729 + systematicCode := BitVec.ofNat 64 17936026768983730719 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089441554114560 + maskLow := BitVec.ofNat 64 6051611115799 + maskHigh := BitVec.ofNat 64 1297036692682702881 + systematicCode := BitVec.ofNat 64 17938552360516135455 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711162950461440 + maskLow := BitVec.ofNat 64 141736116503 + maskHigh := BitVec.ofNat 64 1297036692682704257 + systematicCode := BitVec.ofNat 64 17938563618665277983 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9786517851777024 + maskLow := BitVec.ofNat 64 141736116503 + maskHigh := BitVec.ofNat 64 1751900255047122977 + systematicCode := BitVec.ofNat 64 17940068128445311519 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9786518017441920 + maskLow := BitVec.ofNat 64 141736116503 + maskHigh := BitVec.ofNat 64 4758615956270350369 + systematicCode := BitVec.ofNat 64 18298942100911827487 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089441522409600 + maskLow := BitVec.ofNat 64 176475913421079 + maskHigh := BitVec.ofNat 64 5188146770730811425 + systematicCode := BitVec.ofNat 64 18300247748706773535 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711162918756480 + maskLow := BitVec.ofNat 64 141736116503 + maskHigh := BitVec.ofNat 64 5188146770730852481 + systematicCode := BitVec.ofNat 64 18300270001804421663 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x2a23. -/ +def normalizedWeightSixteenCandidateBucket_2a23 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085372881928832 + maskLow := BitVec.ofNat 64 1152961091322708247 + maskHigh := BitVec.ofNat 64 2252899459530753 + systematicCode := BitVec.ofNat 64 16631994056218782243 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148542371365504 + maskLow := BitVec.ofNat 64 576460756600684823 + maskHigh := BitVec.ofNat 64 2252899593757697 + systematicCode := BitVec.ofNat 64 16631997501741083171 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36169569945127040 + maskLow := BitVec.ofNat 64 1152921510011404567 + maskHigh := BitVec.ofNat 64 2392537570476033 + systematicCode := BitVec.ofNat 64 16636219478898780707 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9359635718996608 + maskLow := BitVec.ofNat 64 576460756600684823 + maskHigh := BitVec.ofNat 64 4504853892038657 + systematicCode := BitVec.ofNat 64 16848190251728251427 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36046432159008896 + maskLow := BitVec.ofNat 64 1171498857367011607 + maskHigh := BitVec.ofNat 64 4644337249943553 + systematicCode := BitVec.ofNat 64 16852388963286133283 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2533317744396416 + maskLow := BitVec.ofNat 64 576460756600684823 + maskHigh := BitVec.ofNat 64 4644337388486657 + systematicCode := BitVec.ofNat 64 16852392486049819171 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148523045192320 + maskLow := BitVec.ofNat 64 576460756600684823 + maskHigh := BitVec.ofNat 64 144115205259920513 + systematicCode := BitVec.ofNat 64 17493297706187500067 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085353555755648 + maskLow := BitVec.ofNat 64 18019350609068311 + maskHigh := BitVec.ofNat 64 144115205389942785 + systematicCode := BitVec.ofNat 64 17493307433296013859 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2533867500208256 + maskLow := BitVec.ofNat 64 576460756600684823 + maskHigh := BitVec.ofNat 64 4611686155866480769 + systematicCode := BitVec.ofNat 64 18287889500878547491 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36046981914820736 + maskLow := BitVec.ofNat 64 598688378585367 + maskHigh := BitVec.ofNat 64 4611686156000559105 + systematicCode := BitVec.ofNat 64 18287911245422996003 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9359090258414208 + maskLow := BitVec.ofNat 64 576460756600684823 + maskHigh := BitVec.ofNat 64 4758193743939502081 + systematicCode := BitVec.ofNat 64 18298942084473039395 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x2a26. -/ +def normalizedWeightSixteenCandidateBucket_2a26 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10208417117513728 + maskLow := BitVec.ofNat 64 4611827859725025559 + maskHigh := BitVec.ofNat 64 564049498603521 + systematicCode := BitVec.ofNat 64 16415817988505152038 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9649865210603520 + maskLow := BitVec.ofNat 64 144115192373510423 + maskHigh := BitVec.ofNat 64 564050538823937 + systematicCode := BitVec.ofNat 64 16415828030996556326 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11338202931947520 + maskLow := BitVec.ofNat 64 4611686023832338711 + maskHigh := BitVec.ofNat 64 703688515518465 + systematicCode := BitVec.ofNat 64 16420050008204782118 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9592694095620096 + maskLow := BitVec.ofNat 64 144115192373510423 + maskHigh := BitVec.ofNat 64 18016052105445377 + systematicCode := BitVec.ofNat 64 17064366319441488422 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11333805153871872 + maskLow := BitVec.ofNat 64 4630263371187945751 + maskHigh := BitVec.ofNat 64 18155136031391745 + systematicCode := BitVec.ofNat 64 17068558459749935654 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9658149433141248 + maskLow := BitVec.ofNat 64 144115192373510423 + maskHigh := BitVec.ofNat 64 18155137075904513 + systematicCode := BitVec.ofNat 64 17068568566698289702 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9658664793286656 + maskLow := BitVec.ofNat 64 144115192373510423 + maskHigh := BitVec.ofNat 64 144115192375017857 + systematicCode := BitVec.ofNat 64 17492453268372269606 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11334320514017280 + maskLow := BitVec.ofNat 64 18016052074578199 + maskHigh := BitVec.ofNat 64 144115192404377601 + systematicCode := BitVec.ofNat 64 17492459709780666918 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9660863852462208 + maskLow := BitVec.ofNat 64 144115192373510423 + maskHigh := BitVec.ofNat 64 4611686568183365761 + systematicCode := BitVec.ofNat 64 18288733938693384742 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11336519573192832 + maskLow := BitVec.ofNat 64 704241495245079 + maskHigh := BitVec.ofNat 64 4611686568216756225 + systematicCode := BitVec.ofNat 64 18288752371868576294 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9592174673010816 + maskLow := BitVec.ofNat 64 144115192373510423 + maskHigh := BitVec.ofNat 64 4756504893978574849 + systematicCode := BitVec.ofNat 64 18298938785887627814 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x2a29. -/ +def normalizedWeightSixteenCandidateBucket_2a29 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .d16Plus + affineCode := BitVec.ofNat 56 54397257603162368 + maskLow := BitVec.ofNat 64 4503604198179095 + maskHigh := BitVec.ofNat 64 576601489792827393 + systematicCode := BitVec.ofNat 64 17861179812747160105 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9359635691735296 + maskLow := BitVec.ofNat 64 4611686022725566743 + maskHigh := BitVec.ofNat 64 564205157613569 + systematicCode := BitVec.ofNat 64 16415844687601740329 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2533317775851776 + maskLow := BitVec.ofNat 64 4611686022725566743 + maskHigh := BitVec.ofNat 64 703687476903937 + systematicCode := BitVec.ofNat 64 16420040303361927721 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36046432190464256 + maskLow := BitVec.ofNat 64 150870591815090455 + maskHigh := BitVec.ofNat 64 703688515518465 + systematicCode := BitVec.ofNat 64 16420049970274970153 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148542344104192 + maskLow := BitVec.ofNat 64 4611686022725566743 + maskHigh := BitVec.ofNat 64 18015498054673409 + systematicCode := BitVec.ofNat 64 17064336468899277353 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085372854667520 + maskLow := BitVec.ofNat 64 144154774792634647 + maskHigh := BitVec.ofNat 64 18015499094851585 + systematicCode := BitVec.ofNat 64 17064346191746312745 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36169569976582400 + maskLow := BitVec.ofNat 64 144115192776687895 + maskHigh := BitVec.ofNat 64 18155136031391745 + systematicCode := BitVec.ofNat 64 17068558420203219497 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2533867498111232 + maskLow := BitVec.ofNat 64 4611686022725566743 + maskHigh := BitVec.ofNat 64 576460889743433857 + systematicCode := BitVec.ofNat 64 17855550533721139753 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36046981912723712 + maskLow := BitVec.ofNat 64 4539338053452055 + maskHigh := BitVec.ofNat 64 576460890816118785 + systematicCode := BitVec.ofNat 64 17855572304034998825 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148523017931008 + maskLow := BitVec.ofNat 64 4611686022725566743 + maskHigh := BitVec.ofNat 64 1152921521787241601 + systematicCode := BitVec.ofNat 64 17925636673345694249 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085353528494336 + maskLow := BitVec.ofNat 64 2256751914189079 + maskHigh := BitVec.ofNat 64 1152921522860457985 + systematicCode := BitVec.ofNat 64 17925659568823544361 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36169571050258688 + maskLow := BitVec.ofNat 64 2251804250276119 + maskHigh := BitVec.ofNat 64 1153062242095726593 + systematicCode := BitVec.ofNat 64 17933236302961715753 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9359090264705280 + maskLow := BitVec.ofNat 64 4611686022725566743 + maskHigh := BitVec.ofNat 64 1747537393981849601 + systematicCode := BitVec.ofNat 64 17940068086337776169 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x2c0d. -/ +def normalizedWeightSixteenCandidateBucket_2c0d : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085407239521280 + maskLow := BitVec.ofNat 64 1441154084081041751 + maskHigh := BitVec.ofNat 64 1649267474433 + systematicCode := BitVec.ofNat 64 15046137649587956749 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148576728957952 + maskLow := BitVec.ofNat 64 140741787582807 + maskHigh := BitVec.ofNat 64 1649602986497 + systematicCode := BitVec.ofNat 64 15046167594587270157 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085387912177664 + maskLow := BitVec.ofNat 64 11261202390909271 + maskHigh := BitVec.ofNat 64 70377334145025 + systematicCode := BitVec.ofNat 64 15907451017958140941 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148557401614336 + maskLow := BitVec.ofNat 64 140741787582807 + maskHigh := BitVec.ofNat 64 70377336734209 + systematicCode := BitVec.ofNat 64 15907465570029546509 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18050205687572480 + maskLow := BitVec.ofNat 64 2203993571671 + maskHigh := BitVec.ofNat 64 70918499992065 + systematicCode := BitVec.ofNat 64 15910815415424986125 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9359670076589056 + maskLow := BitVec.ofNat 64 140741787582807 + maskHigh := BitVec.ofNat 64 5630607635808257 + systematicCode := BitVec.ofNat 64 16854106714803153933 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36046466516796416 + maskLow := BitVec.ofNat 64 1161928983038722391 + maskHigh := BitVec.ofNat 64 580964351930826753 + systematicCode := BitVec.ofNat 64 17863983641270168589 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2533352102183936 + maskLow := BitVec.ofNat 64 140741787582807 + maskHigh := BitVec.ofNat 64 580964352201326657 + systematicCode := BitVec.ofNat 64 17864013543387311117 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36046466550088704 + maskLow := BitVec.ofNat 64 290482455142531415 + maskHigh := BitVec.ofNat 64 2306968909120569345 + systematicCode := BitVec.ofNat 64 18151088100268059661 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2533352135476224 + maskLow := BitVec.ofNat 64 140741787582807 + maskHigh := BitVec.ofNat 64 2306968909188169793 + systematicCode := BitVec.ofNat 64 18151113604405799949 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9359674338266112 + maskLow := BitVec.ofNat 64 140741787582807 + maskHigh := BitVec.ofNat 64 2882374680017141761 + systematicCode := BitVec.ofNat 64 18156223202745789453 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x2c0e. -/ +def normalizedWeightSixteenCandidateBucket_2c0e : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10208966840943616 + maskLow := BitVec.ofNat 64 2882304865327972759 + maskHigh := BitVec.ofNat 64 1374389551105 + systematicCode := BitVec.ofNat 64 15045855079411297294 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9650414934033408 + maskLow := BitVec.ofNat 64 70373043405207 + maskHigh := BitVec.ofNat 64 1375060623617 + systematicCode := BitVec.ofNat 64 15045887223400311822 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11334870237447168 + maskLow := BitVec.ofNat 64 11260102879281559 + maskHigh := BitVec.ofNat 64 70373039161345 + systematicCode := BitVec.ofNat 64 15907168443469736974 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9659214516716544 + maskLow := BitVec.ofNat 64 70373043405207 + maskHigh := BitVec.ofNat 64 70373041766657 + systematicCode := BitVec.ofNat 64 15907184095035993102 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11339268015522816 + maskLow := BitVec.ofNat 64 1104481943959 + maskHigh := BitVec.ofNat 64 70643622084865 + systematicCode := BitVec.ofNat 64 15910532836641680398 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9593243819049984 + maskLow := BitVec.ofNat 64 70373043405207 + maskHigh := BitVec.ofNat 64 11260102875037697 + systematicCode := BitVec.ofNat 64 16926445779505982478 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11335454321544320 + maskLow := BitVec.ofNat 64 2314850487645569431 + maskHigh := BitVec.ofNat 64 585467951558180865 + systematicCode := BitVec.ofNat 64 17864264021030218766 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9659798600813696 + maskLow := BitVec.ofNat 64 70373043405207 + maskHigh := BitVec.ofNat 64 585467952097132609 + systematicCode := BitVec.ofNat 64 17864296117875584014 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11335454485924992 + maskLow := BitVec.ofNat 64 578712831294243223 + maskHigh := BitVec.ofNat 64 2308094809027395585 + systematicCode := BitVec.ofNat 64 18151368480028109838 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9659798765194368 + maskLow := BitVec.ofNat 64 70373043405207 + maskHigh := BitVec.ofNat 64 2308094809162121281 + systematicCode := BitVec.ofNat 64 18151396178894072846 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9593239760815104 + maskLow := BitVec.ofNat 64 70373043405207 + maskHigh := BitVec.ofNat 64 2882374405139218433 + systematicCode := BitVec.ofNat 64 18156223198433979406 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x2c13. -/ +def normalizedWeightSixteenCandidateBucket_2c13 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.node + (.leaf + { patternClass := .twoE8 + affineCode := BitVec.ofNat 56 2393087613468800 + maskLow := BitVec.ofNat 64 5629778711347991 + maskHigh := BitVec.ofNat 64 771 + systematicCode := BitVec.ofNat 64 10561367085543074835 }) + (.leaf + { patternClass := .twoE8 + affineCode := BitVec.ofNat 56 18032541006954624 + maskLow := BitVec.ofNat 64 3311424045847 + maskHigh := BitVec.ofNat 64 1310785 + systematicCode := BitVec.ofNat 64 12151991979731004435 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10274116126114432 + maskLow := BitVec.ofNat 64 2882304040694252311 + maskHigh := BitVec.ofNat 64 17025 + systematicCode := BitVec.ofNat 64 11354295366687927315 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11400016032958720 + maskLow := BitVec.ofNat 64 1441152159935693591 + maskHigh := BitVec.ofNat 64 33153 + systematicCode := BitVec.ofNat 64 11426071481437400083 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11400016301394048 + maskLow := BitVec.ofNat 64 11259278245561111 + maskHigh := BitVec.ofNat 64 49155 + systematicCode := BitVec.ofNat 64 11429435926653971475 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18102914195261568 + maskLow := BitVec.ofNat 64 3458764526709703447 + maskHigh := BitVec.ofNat 64 1572993 + systematicCode := BitVec.ofNat 64 12152839875665800211 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18102914045446272 + maskLow := BitVec.ofNat 64 864691141344297751 + maskHigh := BitVec.ofNat 64 2359425 + systematicCode := BitVec.ofNat 64 12368168215602474003 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18102639184316544 + maskLow := BitVec.ofNat 64 211119121695511 + maskHigh := BitVec.ofNat 64 2621505 + systematicCode := BitVec.ofNat 64 12369009238515854355 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10274390987244160 + maskLow := BitVec.ofNat 64 2307109650908119831 + maskHigh := BitVec.ofNat 64 67633665 + systematicCode := BitVec.ofNat 64 13089591896343194643 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18102913926826240 + maskLow := BitVec.ofNat 64 2314851312279290647 + maskHigh := BitVec.ofNat 64 68173825 + systematicCode := BitVec.ofNat 64 13089885466064399379 }) + ) + ) + ) + ) + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11400290894088448 + maskLow := BitVec.ofNat 64 1154117777557095191 + maskHigh := BitVec.ofNat 64 134742273 + systematicCode := BitVec.ofNat 64 13161648386574461971 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18094117833802368 + maskLow := BitVec.ofNat 64 1161930907184071447 + maskHigh := BitVec.ofNat 64 135299073 + systematicCode := BitVec.ofNat 64 13161944155319053331 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11400291162523776 + maskLow := BitVec.ofNat 64 10133653216625431 + maskHigh := BitVec.ofNat 64 201326595 + systematicCode := BitVec.ofNat 64 13165573582955162643 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18102913777010944 + maskLow := BitVec.ofNat 64 578713655927964439 + maskHigh := BitVec.ofNat 64 268713985 + systematicCode := BitVec.ofNat 64 13376989925062290451 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10274391137059456 + maskLow := BitVec.ofNat 64 581105093718377239 + maskHigh := BitVec.ofNat 64 270533121 + systematicCode := BitVec.ofNat 64 13378948155288988691 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18102638915881216 + maskLow := BitVec.ofNat 64 142391055024919 + maskHigh := BitVec.ofNat 64 335544385 + systematicCode := BitVec.ofNat 64 13381756204520254483 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18094117683987072 + maskLow := BitVec.ofNat 64 290484379287880471 + maskHigh := BitVec.ofNat 64 537165825 + systematicCode := BitVec.ofNat 64 13449048614316944403 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11400291043903744 + maskLow := BitVec.ofNat 64 292804348822487831 + maskHigh := BitVec.ofNat 64 538968321 + systematicCode := BitVec.ofNat 64 13451004645520256019 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18093842822857344 + maskLow := BitVec.ofNat 64 73121822475031 + maskHigh := BitVec.ofNat 64 671088705 + systematicCode := BitVec.ofNat 64 13454095269256702995 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11400291312339072 + maskLow := BitVec.ofNat 64 6755953496097559 + maskHigh := BitVec.ofNat 64 805306371 + systematicCode := BitVec.ofNat 64 13454929846179146771 }) + ) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x2c1c. -/ +def normalizedWeightSixteenCandidateBucket_2c1c : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .twoE8 + affineCode := BitVec.ofNat 56 2261699732045952 + maskLow := BitVec.ofNat 64 13224722711 + maskHigh := BitVec.ofNat 64 12884901891 + systematicCode := BitVec.ofNat 64 14033642238592166940 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10208967646249600 + maskLow := BitVec.ofNat 64 2882303774406295831 + maskHigh := BitVec.ofNat 64 283467841665 + systematicCode := BitVec.ofNat 64 14826570679389989916 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9650415739339392 + maskLow := BitVec.ofNat 64 554055057687 + maskHigh := BitVec.ofNat 64 284138930179 + systematicCode := BitVec.ofNat 64 14826618216306912284 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11334867553093888 + maskLow := BitVec.ofNat 64 1441151893647737111 + maskHigh := BitVec.ofNat 64 554050781313 + systematicCode := BitVec.ofNat 64 14898346794139462684 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9659211832363264 + maskLow := BitVec.ofNat 64 554055057687 + maskHigh := BitVec.ofNat 64 554386325507 + systematicCode := BitVec.ofNat 64 14898393231561534492 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11339265599604864 + maskLow := BitVec.ofNat 64 13560267031 + maskHigh := BitVec.ofNat 64 824633720835 + systematicCode := BitVec.ofNat 64 14901711066818358300 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9593241134696704 + maskLow := BitVec.ofNat 64 554055057687 + maskHigh := BitVec.ofNat 64 1441151893643460737 + systematicCode := BitVec.ofNat 64 17939177352312335388 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11335456200591616 + maskLow := BitVec.ofNat 64 3458764792997691671 + maskHigh := BitVec.ofNat 64 1729382256910270593 + systematicCode := BitVec.ofNat 64 17939965396837477404 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9659800479860992 + maskLow := BitVec.ofNat 64 554055057687 + maskHigh := BitVec.ofNat 64 1729382257715576897 + systematicCode := BitVec.ofNat 64 17940012946739375132 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11335456364972288 + maskLow := BitVec.ofNat 64 864691407632285975 + maskHigh := BitVec.ofNat 64 2594073385365405825 + systematicCode := BitVec.ofNat 64 18155293736774151196 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9659800644241664 + maskLow := BitVec.ofNat 64 554055057687 + maskHigh := BitVec.ofNat 64 2594073385566732353 + systematicCode := BitVec.ofNat 64 18155336888696646684 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9593241102991744 + maskLow := BitVec.ofNat 64 554055057687 + maskHigh := BitVec.ofNat 64 2882304586150838401 + systematicCode := BitVec.ofNat 64 18156207805035392028 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x2c1f. -/ +def normalizedWeightSixteenCandidateBucket_2c1f : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11338722269464704 + maskLow := BitVec.ofNat 64 13493174551 + maskHigh := BitVec.ofNat 64 3377699720527875 + systematicCode := BitVec.ofNat 64 16637848723169487903 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089445581654272 + maskLow := BitVec.ofNat 64 141849889177879 + maskHigh := BitVec.ofNat 64 5629499534213185 + systematicCode := BitVec.ofNat 64 16854031517222120479 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711166978001152 + maskLow := BitVec.ofNat 64 279177167127 + maskHigh := BitVec.ofNat 64 5629499534246147 + systematicCode := BitVec.ofNat 64 16854051528314203167 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089445044781696 + maskLow := BitVec.ofNat 64 72580656627991 + maskHigh := BitVec.ofNat 64 11258999068426305 + systematicCode := BitVec.ofNat 64 16926370581958568991 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711166441128576 + maskLow := BitVec.ofNat 64 279177167127 + maskHigh := BitVec.ofNat 64 11258999068443139 + systematicCode := BitVec.ofNat 64 16926389502112181279 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11338722419280000 + maskLow := BitVec.ofNat 64 13291847959 + maskHigh := BitVec.ofNat 64 13510798882111491 + systematicCode := BitVec.ofNat 64 16927204999177907231 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089441555122432 + maskLow := BitVec.ofNat 64 3852589957399 + maskHigh := BitVec.ofNat 64 1441151880758558785 + systematicCode := BitVec.ofNat 64 17939117500902878239 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711162951469312 + maskLow := BitVec.ofNat 64 279177167127 + maskHigh := BitVec.ofNat 64 1441151880758559617 + systematicCode := BitVec.ofNat 64 17939124369595575327 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9786517852784896 + maskLow := BitVec.ofNat 64 279177167127 + maskHigh := BitVec.ofNat 64 1742893055792382017 + systematicCode := BitVec.ofNat 64 17940065929455741983 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9786518017165568 + maskLow := BitVec.ofNat 64 279177167127 + maskHigh := BitVec.ofNat 64 2597451085085933633 + systematicCode := BitVec.ofNat 64 18155389871413013535 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089441523417472 + maskLow := BitVec.ofNat 64 211660287607063 + maskHigh := BitVec.ofNat 64 2882303761517117505 + systematicCode := BitVec.ofNat 64 18156134759687728159 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711162919764352 + maskLow := BitVec.ofNat 64 279177167127 + maskHigh := BitVec.ofNat 64 2882303761517166721 + systematicCode := BitVec.ofNat 64 18156154822318631967 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x2c25. -/ +def normalizedWeightSixteenCandidateBucket_2c25 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085372881880064 + maskLow := BitVec.ofNat 64 1152994076673769751 + maskHigh := BitVec.ofNat 64 2252899459530753 + systematicCode := BitVec.ofNat 64 16631994056252206117 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148542371316736 + maskLow := BitVec.ofNat 64 576460756602913047 + maskHigh := BitVec.ofNat 64 2252899593765377 + systematicCode := BitVec.ofNat 64 16631997510297463845 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36169569945273344 + maskLow := BitVec.ofNat 64 1152921509510316311 + maskHigh := BitVec.ofNat 64 2392537570476033 + systematicCode := BitVec.ofNat 64 16636219478865357861 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9359635718947840 + maskLow := BitVec.ofNat 64 576460756602913047 + maskHigh := BitVec.ofNat 64 4504982741057537 + systematicCode := BitVec.ofNat 64 16848192442161572901 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36046432159155200 + maskLow := BitVec.ofNat 64 1163054608067920151 + maskHigh := BitVec.ofNat 64 4644337249943553 + systematicCode := BitVec.ofNat 64 16852388963252710437 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2533317744542720 + maskLow := BitVec.ofNat 64 576460756602913047 + maskHigh := BitVec.ofNat 64 4644337386520577 + systematicCode := BitVec.ofNat 64 16852392477493439525 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148523043973120 + maskLow := BitVec.ofNat 64 576460756602913047 + maskHigh := BitVec.ofNat 64 288230384743744129 + systematicCode := BitVec.ofNat 64 17636847736696744997 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085353554536448 + maskLow := BitVec.ofNat 64 9009952333299991 + maskHigh := BitVec.ofNat 64 288230384875864065 + systematicCode := BitVec.ofNat 64 17636859662794959909 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2533867500094464 + maskLow := BitVec.ofNat 64 576460756602913047 + maskHigh := BitVec.ofNat 64 2305843284091879553 + systematicCode := BitVec.ofNat 64 18144339470369303589 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36046981914706944 + maskLow := BitVec.ofNat 64 1196822706323735 + maskHigh := BitVec.ofNat 64 2305843284225818625 + systematicCode := BitVec.ofNat 64 18144359015924050981 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9359090258365440 + maskLow := BitVec.ofNat 64 576460756602913047 + maskHigh := BitVec.ofNat 64 2596465922801664001 + systematicCode := BitVec.ofNat 64 18155389846350605349 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x2c26. -/ +def normalizedWeightSixteenCandidateBucket_2c26 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10208417118684160 + maskLow := BitVec.ofNat 64 2305984850513428759 + maskHigh := BitVec.ofNat 64 1126999485579265 + systematicCode := BitVec.ofNat 64 16559935367014329382 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9649865211773952 + maskLow := BitVec.ofNat 64 288230380451463447 + maskHigh := BitVec.ofNat 64 1126999955374337 + systematicCode := BitVec.ofNat 64 16559941020049288230 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11338202932841600 + maskLow := BitVec.ofNat 64 2305843014117425431 + maskHigh := BitVec.ofNat 64 1266637932068865 + systematicCode := BitVec.ofNat 64 16564162988634024998 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9592694096790528 + maskLow := BitVec.ofNat 64 288230380451463447 + maskHigh := BitVec.ofNat 64 9008852884258817 + systematicCode := BitVec.ofNat 64 16920251131399318566 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11333805154765952 + maskLow := BitVec.ofNat 64 2315976112675029271 + maskHigh := BitVec.ofNat 64 9147936810205185 + systematicCode := BitVec.ofNat 64 16924445462073977894 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9658149434035328 + maskLow := BitVec.ofNat 64 288230380451463447 + maskHigh := BitVec.ofNat 64 9147937282326529 + systematicCode := BitVec.ofNat 64 16924451171042929702 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9658664794457088 + maskLow := BitVec.ofNat 64 288230380451463447 + maskHigh := BitVec.ofNat 64 288230380448776577 + systematicCode := BitVec.ofNat 64 17636566257425001510 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11334320515187712 + maskLow := BitVec.ofNat 64 9008852821934359 + maskHigh := BitVec.ofNat 64 288230380513787905 + systematicCode := BitVec.ofNat 64 17636577088289844262 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9660863852072064 + maskLow := BitVec.ofNat 64 288230380451463447 + maskHigh := BitVec.ofNat 64 2305843558969802881 + systematicCode := BitVec.ofNat 64 18144620949640916006 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11336519572802688 + maskLow := BitVec.ofNat 64 1267191450763543 + maskHigh := BitVec.ofNat 64 2305843559036616705 + systematicCode := BitVec.ofNat 64 18144639391405911078 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9592174673937408 + maskLow := BitVec.ofNat 64 288230380451463447 + maskHigh := BitVec.ofNat 64 2595340022827712513 + systematicCode := BitVec.ofNat 64 18155388746822134822 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x2c29. -/ +def normalizedWeightSixteenCandidateBucket_2c29 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9359635691897856 + maskLow := BitVec.ofNat 64 2305843013513969943 + maskHigh := BitVec.ofNat 64 1127283423182849 + systematicCode := BitVec.ofNat 64 16559962066077232169 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2533317775754240 + maskLow := BitVec.ofNat 64 2305843013513969943 + maskHigh := BitVec.ofNat 64 1266637463879681 + systematicCode := BitVec.ofNat 64 16564157690460908585 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36046432190366720 + maskLow := BitVec.ofNat 64 294985779893043479 + maskHigh := BitVec.ofNat 64 1266637932068865 + systematicCode := BitVec.ofNat 64 16564162967917505577 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148542344266752 + maskLow := BitVec.ofNat 64 2305843013513969943 + maskHigh := BitVec.ofNat 64 9008298833494529 + systematicCode := BitVec.ofNat 64 16920223488402926633 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085372854830080 + maskLow := BitVec.ofNat 64 288302948219420951 + maskHigh := BitVec.ofNat 64 9008299303239681 + systematicCode := BitVec.ofNat 64 16920228813270559785 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36169569976484864 + maskLow := BitVec.ofNat 64 288230380854640919 + maskHigh := BitVec.ofNat 64 9147936810205185 + systematicCode := BitVec.ofNat 64 16924445439740554281 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2533867498013696 + maskLow := BitVec.ofNat 64 2305843013513969943 + maskHigh := BitVec.ofNat 64 576461027182395521 + systematicCode := BitVec.ofNat 64 17856113492264365097 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36046981912626176 + maskLow := BitVec.ofNat 64 4574522427638039 + maskHigh := BitVec.ofNat 64 576461027718201345 + systematicCode := BitVec.ofNat 64 17856133054998719529 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148523016923136 + maskLow := BitVec.ofNat 64 2305843013513969943 + maskHigh := BitVec.ofNat 64 1152921513197306497 + systematicCode := BitVec.ofNat 64 17925073714802207785 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085353527486464 + maskLow := BitVec.ofNat 64 2254552893030679 + maskHigh := BitVec.ofNat 64 1152921513733652481 + systematicCode := BitVec.ofNat 64 17925094419813313577 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9359090264607744 + maskLow := BitVec.ofNat 64 2305843013513969943 + maskHigh := BitVec.ofNat 64 1738530194190237697 + systematicCode := BitVec.ofNat 64 17940065887280835625 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x2c2a. -/ +def normalizedWeightSixteenCandidateBucket_2c2a : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9592694196667392 + maskLow := BitVec.ofNat 64 1152921508908171543 + maskHigh := BitVec.ofNat 64 2253453644529665 + systematicCode := BitVec.ofNat 64 16632020755314977834 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9658149498539136 + maskLow := BitVec.ofNat 64 1152921508908171543 + maskHigh := BitVec.ofNat 64 2392537437831169 + systematicCode := BitVec.ofNat 64 16636216384010398762 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11333805219269760 + maskLow := BitVec.ofNat 64 583216156045803799 + maskHigh := BitVec.ofNat 64 2392537570476033 + systematicCode := BitVec.ofNat 64 16636219466738773034 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9649865311650816 + maskLow := BitVec.ofNat 64 1152921508908171543 + maskHigh := BitVec.ofNat 64 4504699273249025 + systematicCode := BitVec.ofNat 64 16848166998154751018 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10208417218561024 + maskLow := BitVec.ofNat 64 576602593604731159 + maskHigh := BitVec.ofNat 64 4504699407433729 + systematicCode := BitVec.ofNat 64 16848170124032683050 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11338202997345408 + maskLow := BitVec.ofNat 64 576460757007401239 + maskHigh := BitVec.ofNat 64 4644337249943553 + systematicCode := BitVec.ofNat 64 16852388949509221418 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9660863752195200 + maskLow := BitVec.ofNat 64 1152921508908171543 + maskHigh := BitVec.ofNat 64 576461302060318849 + systematicCode := BitVec.ofNat 64 17856394971535977514 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11336519472925824 + maskLow := BitVec.ofNat 64 4644891172864279 + maskHigh := BitVec.ofNat 64 576461302327672833 + systematicCode := BitVec.ofNat 64 17856413430480579626 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9658664894333952 + maskLow := BitVec.ofNat 64 1152921508908171543 + maskHigh := BitVec.ofNat 64 1152921508902338945 + systematicCode := BitVec.ofNat 64 17924792235530464298 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11334320615064576 + maskLow := BitVec.ofNat 64 2253453382451479 + maskHigh := BitVec.ofNat 64 1152921509170249729 + systematicCode := BitVec.ofNat 64 17924811845308197930 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9592174742602752 + maskLow := BitVec.ofNat 64 1152921508908171543 + maskHigh := BitVec.ofNat 64 1734026594294431745 + systematicCode := BitVec.ofNat 64 17940064787752365098 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x2f13. -/ +def normalizedWeightSixteenCandidateBucket_2f13 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11330472174160000 + maskLow := BitVec.ofNat 64 10133378342912791 + maskHigh := BitVec.ofNat 64 13194139533315 + systematicCode := BitVec.ofNat 64 15480423791423401747 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9096264546519168 + maskLow := BitVec.ofNat 64 12893356823 + maskHigh := BitVec.ofNat 64 13194141892673 + systematicCode := BitVec.ofNat 64 15480468017372147475 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18050274674608384 + maskLow := BitVec.ofNat 64 281345590039 + maskHigh := BitVec.ofNat 64 21990232555585 + systematicCode := BitVec.ofNat 64 15696606335358545683 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18050205955129984 + maskLow := BitVec.ofNat 64 280288625431 + maskHigh := BitVec.ofNat 64 43980465111105 + systematicCode := BitVec.ofNat 64 15768945404356472595 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11330472323975296 + maskLow := BitVec.ofNat 64 6755678622384919 + maskHigh := BitVec.ofNat 64 52776558133251 + systematicCode := BitVec.ofNat 64 15769780054647385875 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9096264696334464 + maskLow := BitVec.ofNat 64 12893356823 + maskHigh := BitVec.ofNat 64 52776559706177 + systematicCode := BitVec.ofNat 64 15769821007780720403 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11332121490753664 + maskLow := BitVec.ofNat 64 5630053593449239 + maskHigh := BitVec.ofNat 64 216172782113783811 + systematicCode := BitVec.ofNat 64 17505917710948577043 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9097913863112832 + maskLow := BitVec.ofNat 64 12893356823 + maskHigh := BitVec.ofNat 64 216172782115094657 + systematicCode := BitVec.ofNat 64 17505958651297476371 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9026991068151936 + maskLow := BitVec.ofNat 64 12893356823 + maskHigh := BitVec.ofNat 64 4755845186968354819 + systematicCode := BitVec.ofNat 64 18298928850819821331 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9026991068153984 + maskLow := BitVec.ofNat 64 12893356823 + maskHigh := BitVec.ofNat 64 9295451621125259267 + systematicCode := BitVec.ofNat 64 18370703866074443539 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11332121524568192 + maskLow := BitVec.ofNat 64 11259553127662359 + maskHigh := BitVec.ofNat 64 13835058055282163715 + systematicCode := BitVec.ofNat 64 18373986552059473683 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9097913896927360 + maskLow := BitVec.ofNat 64 12893356823 + maskHigh := BitVec.ofNat 64 13835058055284785281 + systematicCode := BitVec.ofNat 64 18374030790892924691 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x2f15. -/ +def normalizedWeightSixteenCandidateBucket_2f15 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11330472173135872 + maskLow := BitVec.ofNat 64 18577490205279511 + maskHigh := BitVec.ofNat 64 10995116277765 + systematicCode := BitVec.ofNat 64 15479863049049485077 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9096264545495040 + maskLow := BitVec.ofNat 64 21483291927 + maskHigh := BitVec.ofNat 64 10995120603169 + systematicCode := BitVec.ofNat 64 15479907257818623765 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18050274673600512 + maskLow := BitVec.ofNat 64 143906637079 + maskHigh := BitVec.ofNat 64 19791209300001 + systematicCode := BitVec.ofNat 64 15696041177791934229 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18050205953910784 + maskLow := BitVec.ofNat 64 142346355991 + maskHigh := BitVec.ofNat 64 79164837199905 + systematicCode := BitVec.ofNat 64 15913058384785714965 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11330472324121600 + maskLow := BitVec.ofNat 64 6755541183431959 + maskHigh := BitVec.ofNat 64 87960930222085 + systematicCode := BitVec.ofNat 64 15913897441746366229 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9096264696480768 + maskLow := BitVec.ofNat 64 21483291927 + maskHigh := BitVec.ofNat 64 87960931794977 + systematicCode := BitVec.ofNat 64 15913936195823152917 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11332121490899968 + maskLow := BitVec.ofNat 64 5067103640028439 + maskHigh := BitVec.ofNat 64 360287970189639685 + systematicCode := BitVec.ofNat 64 17650035098014134037 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9097913863259136 + maskLow := BitVec.ofNat 64 21483291927 + maskHigh := BitVec.ofNat 64 360287970190819457 + systematicCode := BitVec.ofNat 64 17650073830783528725 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9026991068038144 + maskLow := BitVec.ofNat 64 21483291927 + maskHigh := BitVec.ofNat 64 2594152550202605573 + systematicCode := BitVec.ofNat 64 18155378811754327829 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9026991068300288 + maskLow := BitVec.ofNat 64 21483291927 + maskHigh := BitVec.ofNat 64 9295449422102003717 + systematicCode := BitVec.ofNat 64 18370703857518194453 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11332121524194304 + maskLow := BitVec.ofNat 64 20266752382403863 + maskHigh := BitVec.ofNat 64 11529215046068469765 + systematicCode := BitVec.ofNat 64 18373425809719242517 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9097913896553472 + maskLow := BitVec.ofNat 64 21483291927 + maskHigh := BitVec.ofNat 64 11529215046073188481 + systematicCode := BitVec.ofNat 64 18373470039962890005 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x2f16. -/ +def normalizedWeightSixteenCandidateBucket_2f16 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089854680442880 + maskLow := BitVec.ofNat 64 36310345018575127 + maskHigh := BitVec.ofNat 64 6597069766665 + systematicCode := BitVec.ofNat 64 15407806558801309462 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711576076789760 + maskLow := BitVec.ofNat 64 38663162135 + maskHigh := BitVec.ofNat 64 6597078220817 + systematicCode := BitVec.ofNat 64 15407850758980644630 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11339267748014080 + maskLow := BitVec.ofNat 64 74130196759 + maskHigh := BitVec.ofNat 64 37383395344401 + systematicCode := BitVec.ofNat 64 15768097668006555414 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11339267749184512 + maskLow := BitVec.ofNat 64 73626880279 + maskHigh := BitVec.ofNat 64 74766790688785 + systematicCode := BitVec.ofNat 64 15912775806002409238 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089785933703168 + maskLow := BitVec.ofNat 64 6755472463956247 + maskHigh := BitVec.ofNat 64 105553116266505 + systematicCode := BitVec.ofNat 64 15914180016234639126 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711507330050048 + maskLow := BitVec.ofNat 64 38663162135 + maskHigh := BitVec.ofNat 64 105553117839377 + systematicCode := BitVec.ofNat 64 15914217670783151894 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089339284367360 + maskLow := BitVec.ofNat 64 4785628663318807 + maskHigh := BitVec.ofNat 64 432345564227567625 + systematicCode := BitVec.ofNat 64 17650317672485695254 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711060680714240 + maskLow := BitVec.ofNat 64 38663162135 + maskHigh := BitVec.ofNat 64 432345564228681857 + systematicCode := BitVec.ofNat 64 17650355301465337622 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9786347430635520 + maskLow := BitVec.ofNat 64 38663162135 + maskHigh := BitVec.ofNat 64 2594148152156094473 + systematicCode := BitVec.ofNat 64 18155378807476203286 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9786347431919744 + maskLow := BitVec.ofNat 64 38663162135 + maskHigh := BitVec.ofNat 64 4755838589898588169 + systematicCode := BitVec.ofNat 64 18298928837985447702 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089339252662400 + maskLow := BitVec.ofNat 64 38281150891886871 + maskHigh := BitVec.ofNat 64 6917529027641081865 + systematicCode := BitVec.ofNat 64 18301369319487909654 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711060649009280 + maskLow := BitVec.ofNat 64 38663162135 + maskHigh := BitVec.ofNat 64 6917529027649994881 + systematicCode := BitVec.ofNat 64 18301413545436655382 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x2f19. -/ +def normalizedWeightSixteenCandidateBucket_2f19 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18050274677762048 + maskLow := BitVec.ofNat 64 40827425047 + maskHigh := BitVec.ofNat 64 6597069766665 + systematicCode := BitVec.ofNat 64 15407806386413842201 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11330472191862784 + maskLow := BitVec.ofNat 64 18577387126067479 + maskHigh := BitVec.ofNat 64 37383395344401 + systematicCode := BitVec.ofNat 64 15768097823247445785 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9096264564221952 + maskLow := BitVec.ofNat 64 73022902551 + maskHigh := BitVec.ofNat 64 37383399669769 + systematicCode := BitVec.ofNat 64 15768137633903488793 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11330472193033216 + maskLow := BitVec.ofNat 64 10133137824747799 + maskHigh := BitVec.ofNat 64 74766790688785 + systematicCode := BitVec.ofNat 64 15912775952720342809 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9096264565392384 + maskLow := BitVec.ofNat 64 73022902551 + maskHigh := BitVec.ofNat 64 74766793048073 + systematicCode := BitVec.ofNat 64 15912813581499445017 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18050205931022336 + maskLow := BitVec.ofNat 64 39065817367 + maskHigh := BitVec.ofNat 64 105553116266505 + systematicCode := BitVec.ofNat 64 15914179869416042265 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11332121459688448 + maskLow := BitVec.ofNat 64 1689403919503639 + maskHigh := BitVec.ofNat 64 1224979098644774929 + systematicCode := BitVec.ofNat 64 17938269855032487705 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9097913832047616 + maskLow := BitVec.ofNat 64 73022902551 + maskHigh := BitVec.ofNat 64 1224979098645168257 + systematicCode := BitVec.ofNat 64 17938299808888991513 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9026991003534336 + maskLow := BitVec.ofNat 64 73022902551 + maskHigh := BitVec.ofNat 64 1729487810026536977 + systematicCode := BitVec.ofNat 64 17940050471817916185 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9026991037088768 + maskLow := BitVec.ofNat 64 73022902551 + maskHigh := BitVec.ofNat 64 9295436227962470417 + systematicCode := BitVec.ofNat 64 18370699459539054361 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11332121426398208 + maskLow := BitVec.ofNat 64 27022151823462679 + maskHigh := BitVec.ofNat 64 9799832789158199313 + systematicCode := BitVec.ofNat 64 18372304307926019865 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9097913798757376 + maskLow := BitVec.ofNat 64 73022902551 + maskHigh := BitVec.ofNat 64 9799832789164490881 + systematicCode := BitVec.ofNat 64 18372344157236178713 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x2f1a. -/ +def normalizedWeightSixteenCandidateBucket_2f1a : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11339267729287168 + maskLow := BitVec.ofNat 64 22590595351 + maskHigh := BitVec.ofNat 64 10995116277765 + systematicCode := BitVec.ofNat 64 15479862876628463386 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089854676281344 + maskLow := BitVec.ofNat 64 36310293478973719 + maskHigh := BitVec.ofNat 64 19791209300001 + systematicCode := BitVec.ofNat 64 15696041332999270170 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711576072628224 + maskLow := BitVec.ofNat 64 141742383383 + maskHigh := BitVec.ofNat 64 19791217754117 + systematicCode := BitVec.ofNat 64 15696081135065509658 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089785956591616 + maskLow := BitVec.ofNat 64 10133120644882711 + maskHigh := BitVec.ofNat 64 79164837199905 + systematicCode := BitVec.ofNat 64 15913058527208615706 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711507352938496 + maskLow := BitVec.ofNat 64 141742383383 + maskHigh := BitVec.ofNat 64 79164839559173 + systematicCode := BitVec.ofNat 64 15913095056459443994 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11339267880272896 + maskLow := BitVec.ofNat 64 21885952279 + maskHigh := BitVec.ofNat 64 87960930222085 + systematicCode := BitVec.ofNat 64 15913897290632736538 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089339280205824 + maskLow := BitVec.ofNat 64 1407928942797079 + maskHigh := BitVec.ofNat 64 1297036692682702881 + systematicCode := BitVec.ofNat 64 17938552429504048922 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711060676552704 + maskLow := BitVec.ofNat 64 141742383383 + maskHigh := BitVec.ofNat 64 1297036692683030657 + systematicCode := BitVec.ofNat 64 17938581279570800410 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9786347395262464 + maskLow := BitVec.ofNat 64 141742383383 + maskHigh := BitVec.ofNat 64 1729470217840492577 + systematicCode := BitVec.ofNat 64 17940050467539791642 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9786347560927360 + maskLow := BitVec.ofNat 64 141742383383 + maskHigh := BitVec.ofNat 64 4755812201619521569 + systematicCode := BitVec.ofNat 64 18298924440006307610 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089339248500864 + maskLow := BitVec.ofNat 64 45036550332948759 + maskHigh := BitVec.ofNat 64 5188146770730811425 + systematicCode := BitVec.ofNat 64 18300247817694687002 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711060644847744 + maskLow := BitVec.ofNat 64 141742383383 + maskHigh := BitVec.ofNat 64 5188146770741297281 + systematicCode := BitVec.ofNat 64 18300287662709944090 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x2f1c. -/ +def normalizedWeightSixteenCandidateBucket_2f1c : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11339267730311296 + maskLow := BitVec.ofNat 64 13497352471 + maskHigh := BitVec.ofNat 64 13194139533315 + systematicCode := BitVec.ofNat 64 15480423618935271196 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089854677289216 + maskLow := BitVec.ofNat 64 36310284889047319 + maskHigh := BitVec.ofNat 64 21990232555585 + systematicCode := BitVec.ofNat 64 15696606481975815964 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711576073636096 + maskLow := BitVec.ofNat 64 279181345047 + maskHigh := BitVec.ofNat 64 21990241009667 + systematicCode := BitVec.ofNat 64 15696644084985507612 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089785957810816 + maskLow := BitVec.ofNat 64 18577361356275991 + maskHigh := BitVec.ofNat 64 43980465111105 + systematicCode := BitVec.ofNat 64 15768945546712264476 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711507354157696 + maskLow := BitVec.ofNat 64 279181345047 + maskHigh := BitVec.ofNat 64 43980469436419 + systematicCode := BitVec.ofNat 64 15768982058783485724 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11339267880126592 + maskLow := BitVec.ofNat 64 13296025879 + maskHigh := BitVec.ofNat 64 52776558133251 + systematicCode := BitVec.ofNat 64 15769779894943690524 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089339281213696 + maskLow := BitVec.ofNat 64 844978989383959 + maskHigh := BitVec.ofNat 64 1441151880758558785 + systematicCode := BitVec.ofNat 64 17939117569890791196 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711060677560576 + maskLow := BitVec.ofNat 64 279181345047 + maskHigh := BitVec.ofNat 64 1441151880758755457 + systematicCode := BitVec.ofNat 64 17939142030501097244 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9786347396270336 + maskLow := BitVec.ofNat 64 279181345047 + maskHigh := BitVec.ofNat 64 1729435033468403777 + systematicCode := BitVec.ofNat 64 17940048268550221596 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9786347560651008 + maskLow := BitVec.ofNat 64 279181345047 + maskHigh := BitVec.ofNat 64 2594086579504939073 + systematicCode := BitVec.ofNat 64 18155372210507493148 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089339249508736 + maskLow := BitVec.ofNat 64 54043749587697943 + maskHigh := BitVec.ofNat 64 2882303761517117505 + systematicCode := BitVec.ofNat 64 18156134828675641116 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711060645855616 + maskLow := BitVec.ofNat 64 279181345047 + maskHigh := BitVec.ofNat 64 2882303761529700481 + systematicCode := BitVec.ofNat 64 18156172483224153884 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x2f1f. -/ +def normalizedWeightSixteenCandidateBucket_2f1f : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11338735203518592 + maskLow := BitVec.ofNat 64 13228933399 + maskHigh := BitVec.ofNat 64 216172782113783811 + systematicCode := BitVec.ofNat 64 17505917551294820127 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11338735203664896 + maskLow := BitVec.ofNat 64 21785313559 + maskHigh := BitVec.ofNat 64 360287970189639685 + systematicCode := BitVec.ofNat 64 17650034946983735071 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18050168377321472 + maskLow := BitVec.ofNat 64 38948405527 + maskHigh := BitVec.ofNat 64 432345564227567625 + systematicCode := BitVec.ofNat 64 17650317525766975263 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11338735172453376 + maskLow := BitVec.ofNat 64 73123594519 + maskHigh := BitVec.ofNat 64 1224979098644774929 + systematicCode := BitVec.ofNat 64 17938269738294718239 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18050168373159936 + maskLow := BitVec.ofNat 64 141826294039 + maskHigh := BitVec.ofNat 64 1297036692682702881 + systematicCode := BitVec.ofNat 64 17938552317077958431 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18050168374167808 + maskLow := BitVec.ofNat 64 279231693079 + maskHigh := BitVec.ofNat 64 1441151880758558785 + systematicCode := BitVec.ofNat 64 17939117474611015455 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9928081347248384 + maskLow := BitVec.ofNat 64 554059268375 + maskHigh := BitVec.ofNat 64 1657324662872342657 + systematicCode := BitVec.ofNat 64 17939230335028899615 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9852725846147328 + maskLow := BitVec.ofNat 64 554059268375 + maskHigh := BitVec.ofNat 64 1729382256910270577 + systematicCode := BitVec.ofNat 64 17939962167290703647 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36104665470927104 + maskLow := BitVec.ofNat 64 485339791639 + maskHigh := BitVec.ofNat 64 1729382256910270593 + systematicCode := BitVec.ofNat 64 17939965198480256799 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9852725852389632 + maskLow := BitVec.ofNat 64 554059268375 + maskHigh := BitVec.ofNat 64 2594073385365405773 + systematicCode := BitVec.ofNat 64 18155290507227377439 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36104665477169408 + maskLow := BitVec.ofNat 64 330720968983 + maskHigh := BitVec.ofNat 64 2594073385365405825 + systematicCode := BitVec.ofNat 64 18155293555596537631 }) + ) + ) + ) + ) + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18050168342462848 + maskLow := BitVec.ofNat 64 282402586903 + maskHigh := BitVec.ofNat 64 2882303761517117505 + systematicCode := BitVec.ofNat 64 18156134681857044255 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9852725852405888 + maskLow := BitVec.ofNat 64 554059268375 + maskHigh := BitVec.ofNat 64 4755801206503243819 + systematicCode := BitVec.ofNat 64 18298840546293002015 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36104665477185664 + maskLow := BitVec.ofNat 64 184692080919 + maskHigh := BitVec.ofNat 64 4755801206503243905 + systematicCode := BitVec.ofNat 64 18298845785128906527 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18050168341454976 + maskLow := BitVec.ofNat 64 144426762519 + maskHigh := BitVec.ofNat 64 5188146770730811425 + systematicCode := BitVec.ofNat 64 18300247662319578911 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18050168345616512 + maskLow := BitVec.ofNat 64 40944894231 + maskHigh := BitVec.ofNat 64 6917529027641081865 + systematicCode := BitVec.ofNat 64 18301369146999779103 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9852725877604608 + maskLow := BitVec.ofNat 64 554059268375 + maskHigh := BitVec.ofNat 64 9295429630892703767 + systematicCode := BitVec.ofNat 64 18370615561547624223 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36104665502384384 + maskLow := BitVec.ofNat 64 98792734999 + maskHigh := BitVec.ofNat 64 9295429630892703873 + systematicCode := BitVec.ofNat 64 18370621899878379295 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11338735139163136 + maskLow := BitVec.ofNat 64 74633543959 + maskHigh := BitVec.ofNat 64 9799832789158199313 + systematicCode := BitVec.ofNat 64 18372304152534134559 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11338735236959232 + maskLow := BitVec.ofNat 64 22691283223 + maskHigh := BitVec.ofNat 64 11529215046068469765 + systematicCode := BitVec.ofNat 64 18373425637214334751 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11338735237333120 + maskLow := BitVec.ofNat 64 13564477719 + maskHigh := BitVec.ofNat 64 13835058055282163715 + systematicCode := BitVec.ofNat 64 18373986379521011487 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9928081316071808 + maskLow := BitVec.ofNat 64 554059268375 + maskHigh := BitVec.ofNat 64 16717361816799281281 + systematicCode := BitVec.ofNat 64 18374119095421316895 }) + ) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x310e. -/ +def normalizedWeightSixteenCandidateBucket_310e : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.node + (.leaf + { patternClass := .twoE8 + affineCode := BitVec.ofNat 56 18032059717139456 + maskLow := BitVec.ofNat 64 72340172838076823 + maskHigh := BitVec.ofNat 64 105 + systematicCode := BitVec.ofNat 64 10127054529323151630 }) + (.leaf + { patternClass := .twoE8 + affineCode := BitVec.ofNat 56 2392606323653632 + maskLow := BitVec.ofNat 64 450988409239 + maskHigh := BitVec.ofNat 64 16843009 + systematicCode := BitVec.ofNat 64 12727613778775388430 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18102982513263616 + maskLow := BitVec.ofNat 64 4629701520760308119 + maskHigh := BitVec.ofNat 64 10305 + systematicCode := BitVec.ofNat 64 11211584263400009998 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18102982512093184 + maskLow := BitVec.ofNat 64 2314851312291873175 + maskHigh := BitVec.ofNat 64 18465 + systematicCode := BitVec.ofNat 64 11355697243829121294 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18102982495447040 + maskLow := BitVec.ofNat 64 578713655940546967 + maskHigh := BitVec.ofNat 64 24585 + systematicCode := BitVec.ofNat 64 11356818728442474766 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18102948421960704 + maskLow := BitVec.ofNat 64 4612037866460086679 + maskHigh := BitVec.ofNat 64 2621505 + systematicCode := BitVec.ofNat 64 12369009367433687310 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18102948420790272 + maskLow := BitVec.ofNat 64 2306159672874303895 + maskHigh := BitVec.ofNat 64 4718625 + systematicCode := BitVec.ofNat 64 12513122347896221966 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18102948404144128 + maskLow := BitVec.ofNat 64 576751027684966807 + maskHigh := BitVec.ofNat 64 6291465 + systematicCode := BitVec.ofNat 64 12514243832576422158 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10274422124718080 + maskLow := BitVec.ofNat 64 6917529066312630679 + maskHigh := BitVec.ofNat 64 17303553 + systematicCode := BitVec.ofNat 64 12729309432669155598 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10274422141364224 + maskLow := BitVec.ofNat 64 5188146912481575319 + maskHigh := BitVec.ofNat 64 18882561 + systematicCode := BitVec.ofNat 64 12730439730555662606 }) + ) + ) + ) + ) + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10274422142534656 + maskLow := BitVec.ofNat 64 2882304040706834839 + maskHigh := BitVec.ofNat 64 20987905 + systematicCode := BitVec.ofNat 64 12731004870942535950 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11400325521221632 + maskLow := BitVec.ofNat 64 27021636435771799 + maskHigh := BitVec.ofNat 64 134285313 + systematicCode := BitVec.ofNat 64 13159966082360291598 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11400359612524544 + maskLow := BitVec.ofNat 64 105591787815319 + maskHigh := BitVec.ofNat 64 134742273 + systematicCode := BitVec.ofNat 64 13161648266162876686 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11400325537867776 + maskLow := BitVec.ofNat 64 20266340073931159 + maskHigh := BitVec.ofNat 64 536944641 + systematicCode := BitVec.ofNat 64 13448200856491667726 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11400359629170688 + maskLow := BitVec.ofNat 64 79306587963799 + maskHigh := BitVec.ofNat 64 538968321 + systematicCode := BitVec.ofNat 64 13451004542154584334 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18094148839277568 + maskLow := BitVec.ofNat 64 90142365603398039 + maskHigh := BitVec.ofNat 64 671088705 + systematicCode := BitVec.ofNat 64 13454095351314985230 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11400325539038208 + maskLow := BitVec.ofNat 64 11259278258143639 + maskHigh := BitVec.ofNat 64 1073823745 + systematicCode := BitVec.ofNat 64 13592318235000975630 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11400359630341120 + maskLow := BitVec.ofNat 64 44259654828439 + maskHigh := BitVec.ofNat 64 1077936385 + systematicCode := BitVec.ofNat 64 13595682671594057998 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18094148838107136 + maskLow := BitVec.ofNat 64 81099981976568215 + maskHigh := BitVec.ofNat 64 1207959585 + systematicCode := BitVec.ofNat 64 13598208340333900046 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18094148821460992 + maskLow := BitVec.ofNat 64 74318194256445847 + maskHigh := BitVec.ofNat 64 1610612745 + systematicCode := BitVec.ofNat 64 13599329842126860558 }) + ) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x3113. -/ +def normalizedWeightSixteenCandidateBucket_3113 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085459179735296 + maskLow := BitVec.ofNat 64 2314850487658152727 + maskHigh := BitVec.ofNat 64 4466766004225 + systematicCode := BitVec.ofNat 64 15404735674532507923 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148628669171968 + maskLow := BitVec.ofNat 64 70373055988503 + maskHigh := BitVec.ofNat 64 4467304955969 + systematicCode := BitVec.ofNat 64 15404767771377873171 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085459029920000 + maskLow := BitVec.ofNat 64 578712831306826519 + maskHigh := BitVec.ofNat 64 17609365929985 + systematicCode := BitVec.ofNat 64 15691840133530398995 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148628519356672 + maskLow := BitVec.ofNat 64 70373055988503 + maskHigh := BitVec.ofNat 64 17609500655681 + systematicCode := BitVec.ofNat 64 15691867832396362003 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9359734801041664 + maskLow := BitVec.ofNat 64 70373055988503 + maskHigh := BitVec.ofNat 64 144678223928639489 + systematicCode := BitVec.ofNat 64 17502053323671154963 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36099303537770752 + maskLow := BitVec.ofNat 64 2882304865340556055 + maskHigh := BitVec.ofNat 64 180143985094836225 + systematicCode := BitVec.ofNat 64 17505383425909010707 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9288812006080768 + maskLow := BitVec.ofNat 64 70373055988503 + maskHigh := BitVec.ofNat 64 180143985765908737 + systematicCode := BitVec.ofNat 64 17505415569898025235 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36099307832738048 + maskLow := BitVec.ofNat 64 11260102891864855 + maskHigh := BitVec.ofNat 64 9223934986808213505 + systematicCode := BitVec.ofNat 64 18366696789967450387 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9288816301048064 + maskLow := BitVec.ofNat 64 70373055988503 + maskHigh := BitVec.ofNat 64 9223934986810818817 + systematicCode := BitVec.ofNat 64 18366712441533706515 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9359730539890944 + maskLow := BitVec.ofNat 64 70373055988503 + maskHigh := BitVec.ofNat 64 9259422824106311681 + systematicCode := BitVec.ofNat 64 18370140916558934291 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x3115. -/ +def normalizedWeightSixteenCandidateBucket_3115 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085459179897856 + maskLow := BitVec.ofNat 64 4629700558687634711 + maskHigh := BitVec.ofNat 64 2267742740481 + systematicCode := BitVec.ofNat 64 15260618296056754453 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148628669334528 + maskLow := BitVec.ofNat 64 35188683900183 + maskHigh := BitVec.ofNat 64 2268820668449 + systematicCode := BitVec.ofNat 64 15260654790881521941 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085459028912128 + maskLow := BitVec.ofNat 64 578712693867873559 + maskHigh := BitVec.ofNat 64 17600775987201 + systematicCode := BitVec.ofNat 64 15691274984553591061 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148628518348800 + maskLow := BitVec.ofNat 64 35188683900183 + maskHigh := BitVec.ofNat 64 17600910721057 + systematicCode := BitVec.ofNat 64 15691304882409255189 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9359734801204224 + maskLow := BitVec.ofNat 64 35188683900183 + maskHigh := BitVec.ofNat 64 289356353367973889 + systematicCode := BitVec.ofNat 64 17646731453076812053 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36099303537673216 + maskLow := BitVec.ofNat 64 5188147874554250519 + maskHigh := BitVec.ofNat 64 324259173170683905 + systematicCode := BitVec.ofNat 64 17649496423551545621 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9288812005983232 + maskLow := BitVec.ofNat 64 35188683900183 + maskHigh := BitVec.ofNat 64 324259174378635521 + systematicCode := BitVec.ofNat 64 17649532956997005589 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36099307832640512 + maskLow := BitVec.ofNat 64 20267302146606359 + maskHigh := BitVec.ofNat 64 9224497936761626625 + systematicCode := BitVec.ofNat 64 18367257549487550741 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9288816300950528 + maskLow := BitVec.ofNat 64 35188683900183 + maskHigh := BitVec.ofNat 64 9224497936766337281 + systematicCode := BitVec.ofNat 64 18367277590510252309 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9359730539793408 + maskLow := BitVec.ofNat 64 35188683900183 + maskHigh := BitVec.ofNat 64 9259420625083047937 + systematicCode := BitVec.ofNat 64 18370140907935314197 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x3119. -/ +def normalizedWeightSixteenCandidateBucket_3119 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085459050890240 + maskLow := BitVec.ofNat 64 4629700455608422679 + maskHigh := BitVec.ofNat 64 2216203126785 + systematicCode := BitVec.ofNat 64 15259487998103138585 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148628540326912 + maskLow := BitVec.ofNat 64 8800404836631 + maskHigh := BitVec.ofNat 64 2217281060873 + systematicCode := BitVec.ofNat 64 15259528890907308313 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085459049719808 + maskLow := BitVec.ofNat 64 2314850247139987735 + maskHigh := BitVec.ofNat 64 4406636447745 + systematicCode := BitVec.ofNat 64 15403040227602084121 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148628539156480 + maskLow := BitVec.ofNat 64 8800404836631 + maskHigh := BitVec.ofNat 64 4407175413769 + systematicCode := BitVec.ofNat 64 15403078921416552729 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9359734772073472 + maskLow := BitVec.ofNat 64 8800404836631 + maskHigh := BitVec.ofNat 64 1157425130004023297 + systematicCode := BitVec.ofNat 64 17936083331021484313 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36099303475250176 + maskLow := BitVec.ofNat 64 6917530131464524055 + maskHigh := BitVec.ofNat 64 1188950301625812993 + systematicCode := BitVec.ofNat 64 17937722401723855129 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9288811943560192 + maskLow := BitVec.ofNat 64 8800404836631 + maskHigh := BitVec.ofNat 64 1188950303236423937 + systematicCode := BitVec.ofNat 64 17937763350328324377 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36099307770217472 + maskLow := BitVec.ofNat 64 27022701587665175 + maskHigh := BitVec.ofNat 64 9227875636482148353 + systematicCode := BitVec.ofNat 64 18368379051414991129 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9288816238527488 + maskLow := BitVec.ofNat 64 8800404836631 + maskHigh := BitVec.ofNat 64 9227875636488438017 + systematicCode := BitVec.ofNat 64 18368403507596701977 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9359730477370368 + maskLow := BitVec.ofNat 64 8800404836631 + maskHigh := BitVec.ofNat 64 9259407430943508481 + systematicCode := BitVec.ofNat 64 18370136509821432089 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x311f. -/ +def normalizedWeightSixteenCandidateBucket_311f : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11329990918547456 + maskLow := BitVec.ofNat 64 70544854712599 + maskHigh := BitVec.ofNat 64 144678138029277441 + systematicCode := BitVec.ofNat 64 17501992406755979551 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9095783290906624 + maskLow := BitVec.ofNat 64 1103823470871 + maskHigh := BitVec.ofNat 64 144678138029293609 + systematicCode := BitVec.ofNat 64 17502005795176395039 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36170118899729408 + maskLow := BitVec.ofNat 64 70373391565079 + maskHigh := BitVec.ofNat 64 180143985094836225 + systematicCode := BitVec.ofNat 64 17505383300312871199 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11329990919717888 + maskLow := BitVec.ofNat 64 35497921577239 + maskHigh := BitVec.ofNat 64 289356276058554625 + systematicCode := BitVec.ofNat 64 17646670536228876575 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9095783292077056 + maskLow := BitVec.ofNat 64 1103823470871 + maskHigh := BitVec.ofNat 64 289356276058562633 + systematicCode := BitVec.ofNat 64 17646681742772351263 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36170118899826944 + maskLow := BitVec.ofNat 64 35188985921815 + maskHigh := BitVec.ofNat 64 324259173170683905 + systematicCode := BitVec.ofNat 64 17649496280775405855 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11329991019594752 + maskLow := BitVec.ofNat 64 9212721725719 + maskHigh := BitVec.ofNat 64 1157425104234217729 + systematicCode := BitVec.ofNat 64 17936026795107823903 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9095783391953920 + maskLow := BitVec.ofNat 64 1103823470871 + maskHigh := BitVec.ofNat 64 1157425104234219617 + systematicCode := BitVec.ofNat 64 17936033620851503391 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36170118908150016 + maskLow := BitVec.ofNat 64 8800505528599 + maskHigh := BitVec.ofNat 64 1188950301625812993 + systematicCode := BitVec.ofNat 64 17937722241633628447 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9024860563440640 + maskLow := BitVec.ofNat 64 1103823470871 + maskHigh := BitVec.ofNat 64 1621295865853378817 + systematicCode := BitVec.ofNat 64 17939230326472651039 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9024864858407936 + maskLow := BitVec.ofNat 64 1103823470871 + maskHigh := BitVec.ofNat 64 9229564486342410497 + systematicCode := BitVec.ofNat 64 18368465320765632799 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11329986724891648 + maskLow := BitVec.ofNat 64 114353521131799 + maskHigh := BitVec.ofNat 64 9259400833873740033 + systematicCode := BitVec.ofNat 64 18370061235217969439 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9095779097250816 + maskLow := BitVec.ofNat 64 1103823470871 + maskHigh := BitVec.ofNat 64 9259400833873766401 + systematicCode := BitVec.ofNat 64 18370074696651714847 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x3123. -/ +def normalizedWeightSixteenCandidateBucket_3123 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085356905826560 + maskLow := BitVec.ofNat 64 2305878472775631127 + maskHigh := BitVec.ofNat 64 1125968630513665 + systematicCode := BitVec.ofNat 64 16557674771056963875 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148526395263232 + maskLow := BitVec.ofNat 64 18014402821423383 + maskHigh := BitVec.ofNat 64 1125969163198529 + systematicCode := BitVec.ofNat 64 16557689207266292003 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085356756011264 + maskLow := BitVec.ofNat 64 576469827586294039 + maskHigh := BitVec.ofNat 64 4503616811433985 + systematicCode := BitVec.ofNat 64 16844779230054854947 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148526245447936 + maskLow := BitVec.ofNat 64 18014402821423383 + maskHigh := BitVec.ofNat 64 4503616941459521 + systematicCode := BitVec.ofNat 64 16844789268284780835 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9359632527132928 + maskLow := BitVec.ofNat 64 18014402821423383 + maskHigh := BitVec.ofNat 64 144117473002651649 + systematicCode := BitVec.ofNat 64 17497549724313268515 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36099201263862016 + maskLow := BitVec.ofNat 64 2882585240805769495 + maskHigh := BitVec.ofNat 64 144255925568405505 + systematicCode := BitVec.ofNat 64 17500897418468733219 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9288709732172032 + maskLow := BitVec.ofNat 64 18014402821423383 + maskHigh := BitVec.ofNat 64 144255926235365377 + systematicCode := BitVec.ofNat 64 17500911970540138787 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9289259487985920 + maskLow := BitVec.ofNat 64 18014402821423383 + maskHigh := BitVec.ofNat 64 9223374235878107137 + systematicCode := BitVec.ofNat 64 18362197795352162595 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36099751019675904 + maskLow := BitVec.ofNat 64 325459753763095 + maskHigh := BitVec.ofNat 64 9223374235882225665 + systematicCode := BitVec.ofNat 64 18362210739375517987 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9359082805135616 + maskLow := BitVec.ofNat 64 18014402821423383 + maskHigh := BitVec.ofNat 64 9229142273881538561 + systematicCode := BitVec.ofNat 64 18368465304057360675 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x3125. -/ +def normalizedWeightSixteenCandidateBucket_3125 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085356905989120 + maskLow := BitVec.ofNat 64 4611756528922591511 + maskHigh := BitVec.ofNat 64 563018674995201 + systematicCode := BitVec.ofNat 64 16413557392581210405 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148526395425792 + maskLow := BitVec.ofNat 64 9007203566813463 + maskHigh := BitVec.ofNat 64 563019746656289 + systematicCode := BitVec.ofNat 64 16413576226769940773 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085356755003392 + maskLow := BitVec.ofNat 64 576469690147471639 + maskHigh := BitVec.ofNat 64 4503608219402241 + systematicCode := BitVec.ofNat 64 16844214081078047013 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148526244440064 + maskLow := BitVec.ofNat 64 9007203566813463 + maskHigh := BitVec.ofNat 64 4503608351524897 + systematicCode := BitVec.ofNat 64 16844226318297674021 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9359632527295488 + maskLow := BitVec.ofNat 64 9007203566813463 + maskHigh := BitVec.ofNat 64 288234851509731329 + systematicCode := BitVec.ofNat 64 17642227853718925605 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36099201263764480 + maskLow := BitVec.ofNat 64 5188428250019594519 + maskHigh := BitVec.ofNat 64 288371113642164225 + systematicCode := BitVec.ofNat 64 17645010416111268133 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9288709732074496 + maskLow := BitVec.ofNat 64 9007203566813463 + maskHigh := BitVec.ofNat 64 288371114848092161 + systematicCode := BitVec.ofNat 64 17645029357639119141 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9289259487888384 + maskLow := BitVec.ofNat 64 9007203566813463 + maskHigh := BitVec.ofNat 64 9223376434901370881 + systematicCode := BitVec.ofNat 64 18362760753895387429 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36099751019578368 + maskLow := BitVec.ofNat 64 360644125982999 + maskHigh := BitVec.ofNat 64 9223376434903384065 + systematicCode := BitVec.ofNat 64 18362771490339238181 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9359082805038080 + maskLow := BitVec.ofNat 64 9007203566813463 + maskHigh := BitVec.ofNat 64 9228579323926020097 + systematicCode := BitVec.ofNat 64 18368463105000419621 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x3129. -/ +def normalizedWeightSixteenCandidateBucket_3129 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085356776981504 + maskLow := BitVec.ofNat 64 4611756425844162839 + maskHigh := BitVec.ofNat 64 562967133814785 + systematicCode := BitVec.ofNat 64 16412427094627594537 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148526266418176 + maskLow := BitVec.ofNat 64 2251804126544151 + maskHigh := BitVec.ofNat 64 562968207048713 + systematicCode := BitVec.ofNat 64 16412450326795727145 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085356775811072 + maskLow := BitVec.ofNat 64 2305878232258380055 + maskHigh := BitVec.ofNat 64 1125908497301505 + systematicCode := BitVec.ofNat 64 16555979324126540073 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148526265247744 + maskLow := BitVec.ofNat 64 2251804126544151 + maskHigh := BitVec.ofNat 64 1125909033656329 + systematicCode := BitVec.ofNat 64 16556000357304971561 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9359632498164736 + maskLow := BitVec.ofNat 64 2251804126544151 + maskHigh := BitVec.ofNat 64 1152939122563219457 + systematicCode := BitVec.ofNat 64 17931579731663597865 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36099201201341440 + maskLow := BitVec.ofNat 64 6917810506930651415 + maskHigh := BitVec.ofNat 64 1153062242095726593 + systematicCode := BitVec.ofNat 64 17933236394283577641 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9288709669651456 + maskLow := BitVec.ofNat 64 2251804126544151 + maskHigh := BitVec.ofNat 64 1153062243705880577 + systematicCode := BitVec.ofNat 64 17933259750970437929 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9289259425465344 + maskLow := BitVec.ofNat 64 2251804126544151 + maskHigh := BitVec.ofNat 64 9223389629040910337 + systematicCode := BitVec.ofNat 64 18363886653869076777 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36099750957155328 + maskLow := BitVec.ofNat 64 387032405836055 + maskHigh := BitVec.ofNat 64 9223389629041344513 + systematicCode := BitVec.ofNat 64 18363892992199831849 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9359082742615040 + maskLow := BitVec.ofNat 64 2251804126544151 + maskHigh := BitVec.ofNat 64 9225201624203919361 + systematicCode := BitVec.ofNat 64 18367337205026205993 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x312f. -/ +def normalizedWeightSixteenCandidateBucket_312f : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11329956827244544 + maskLow := BitVec.ofNat 64 18014574628372759 + maskHigh := BitVec.ofNat 64 144117387099176961 + systematicCode := BitVec.ofNat 64 17497506468034130223 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9095749199603712 + maskLow := BitVec.ofNat 64 281479296909591 + maskHigh := BitVec.ofNat 64 144117387103305769 + systematicCode := BitVec.ofNat 64 17497519787736117551 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36169573438882816 + maskLow := BitVec.ofNat 64 18014403165225239 + maskHigh := BitVec.ofNat 64 144255925568405505 + systematicCode := BitVec.ofNat 64 17500897361591021871 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11329956828414976 + maskLow := BitVec.ofNat 64 9007512812585239 + maskHigh := BitVec.ofNat 64 288234774198288385 + systematicCode := BitVec.ofNat 64 17642184597507027247 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9095749200774144 + maskLow := BitVec.ofNat 64 281479296909591 + maskHigh := BitVec.ofNat 64 288234774200320073 + systematicCode := BitVec.ofNat 64 17642195735332073775 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36169573438980352 + maskLow := BitVec.ofNat 64 9007203876929815 + maskHigh := BitVec.ofNat 64 288371113642164225 + systematicCode := BitVec.ofNat 64 17645010342053556527 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11329956928291840 + maskLow := BitVec.ofNat 64 2252216450744599 + maskHigh := BitVec.ofNat 64 1152939096792956929 + systematicCode := BitVec.ofNat 64 17931540856385974575 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9095749300651008 + maskLow := BitVec.ofNat 64 281479296909591 + maskHigh := BitVec.ofNat 64 1152939096793415777 + systematicCode := BitVec.ofNat 64 17931547613411225903 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36169573447303424 + maskLow := BitVec.ofNat 64 2251804234547479 + maskHigh := BitVec.ofNat 64 1153062242095726593 + systematicCode := BitVec.ofNat 64 17933236302911779119 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9024826472137728 + maskLow := BitVec.ofNat 64 281479296909591 + maskHigh := BitVec.ofNat 64 1585407806322835457 + systematicCode := BitVec.ofNat 64 17939230258022658351 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9025376227951616 + maskLow := BitVec.ofNat 64 281479296909591 + maskHigh := BitVec.ofNat 64 9223396226110652417 + systematicCode := BitVec.ofNat 64 18363944060502225199 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11329407172742144 + maskLow := BitVec.ofNat 64 29273401898107159 + maskHigh := BitVec.ofNat 64 9223512774343196673 + systematicCode := BitVec.ofNat 64 18365575296765604143 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9095199545101312 + maskLow := BitVec.ofNat 64 281479296909591 + maskHigh := BitVec.ofNat 64 9223512774349946881 + systematicCode := BitVec.ofNat 64 18365588758199349551 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x320d. -/ +def normalizedWeightSixteenCandidateBucket_320d : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.node + (.leaf + { patternClass := .twoE8 + affineCode := BitVec.ofNat 56 2393089209564160 + maskLow := BitVec.ofNat 64 72622747343192407 + maskHigh := BitVec.ofNat 64 85 + systematicCode := BitVec.ofNat 64 10126771954851656205 }) + (.leaf + { patternClass := .twoE8 + affineCode := BitVec.ofNat 56 18032542603049984 + maskLow := BitVec.ofNat 64 365105840471 + maskHigh := BitVec.ofNat 64 16908801 + systematicCode := BitVec.ofNat 64 12727896353246884365 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10274115858556928 + maskLow := BitVec.ofNat 64 4647717018798195031 + maskHigh := BitVec.ofNat 64 10305 + systematicCode := BitVec.ofNat 64 11211584263416853005 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11400015765612544 + maskLow := BitVec.ofNat 64 1161930907213431127 + maskHigh := BitVec.ofNat 64 34833 + systematicCode := BitVec.ofNat 64 11427753734060519949 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11400015767693312 + maskLow := BitVec.ofNat 64 290484379317240151 + maskHigh := BitVec.ofNat 64 40965 + systematicCode := BitVec.ofNat 64 11428875218673873421 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10274388588980224 + maskLow := BitVec.ofNat 64 4612389710197752151 + maskHigh := BitVec.ofNat 64 2621505 + systematicCode := BitVec.ofNat 64 12369009367450530317 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11400288496035840 + maskLow := BitVec.ofNat 64 1153519643260944727 + maskHigh := BitVec.ofNat 64 8912913 + systematicCode := BitVec.ofNat 64 12585178838144332301 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11400288498116608 + maskLow := BitVec.ofNat 64 288802126526742871 + maskHigh := BitVec.ofNat 64 10485765 + systematicCode := BitVec.ofNat 64 12586300322824532493 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18102930708382720 + maskLow := BitVec.ofNat 64 5764607544542691671 + maskHigh := BitVec.ofNat 64 17303553 + systematicCode := BitVec.ofNat 64 12729309432652313101 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18102930706301952 + maskLow := BitVec.ofNat 64 4899916467627163991 + maskHigh := BitVec.ofNat 64 18882561 + systematicCode := BitVec.ofNat 64 12730439730538820109 }) + ) + ) + ) + ) + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18094134613066752 + maskLow := BitVec.ofNat 64 1441152159965053271 + maskHigh := BitVec.ofNat 64 25198593 + systematicCode := BitVec.ofNat 64 12731287441119130125 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18102911381039104 + maskLow := BitVec.ofNat 64 45036017782161751 + maskHigh := BitVec.ofNat 64 67241985 + systematicCode := BitVec.ofNat 64 13088189967593976333 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18102638650615808 + maskLow := BitVec.ofNat 64 175943368900951 + maskHigh := BitVec.ofNat 64 67633665 + systematicCode := BitVec.ofNat 64 13089591775931478541 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18102911378958336 + maskLow := BitVec.ofNat 64 38280669880713559 + maskHigh := BitVec.ofNat 64 268574721 + systematicCode := BitVec.ofNat 64 13376424741725352461 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18102638648535040 + maskLow := BitVec.ofNat 64 149606629441879 + maskHigh := BitVec.ofNat 64 270533121 + systematicCode := BitVec.ofNat 64 13378948051923186189 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10274407916323840 + maskLow := BitVec.ofNat 64 108227132873834839 + maskHigh := BitVec.ofNat 64 335544385 + systematicCode := BitVec.ofNat 64 13381756282317189645 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18094115285723136 + maskLow := BitVec.ofNat 64 11259278274920791 + maskHigh := BitVec.ofNat 64 1073905665 + systematicCode := BitVec.ofNat 64 13592600809489314317 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18093842555299840 + maskLow := BitVec.ofNat 64 44259671605591 + maskHigh := BitVec.ofNat 64 1082130945 + systematicCode := BitVec.ofNat 64 13595965246082396685 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11400307823379456 + maskLow := BitVec.ofNat 64 81099981993345367 + maskHigh := BitVec.ofNat 64 1140850705 + systematicCode := BitVec.ofNat 64 13597925765845561869 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11400307825460224 + maskLow := BitVec.ofNat 64 74318194273222999 + maskHigh := BitVec.ofNat 64 1342177285 + systematicCode := BitVec.ofNat 64 13599047267638522381 }) + ) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x3213. -/ +def normalizedWeightSixteenCandidateBucket_3213 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085390460256896 + maskLow := BitVec.ofNat 64 1161928983068082967 + maskHigh := BitVec.ofNat 64 8864812531713 + systematicCode := BitVec.ofNat 64 15476794363787096595 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148559949693568 + maskLow := BitVec.ofNat 64 140741816943383 + maskHigh := BitVec.ofNat 64 8865083031617 + systematicCode := BitVec.ofNat 64 15476824265904239123 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085390310441600 + maskLow := BitVec.ofNat 64 290482455171891991 + maskHigh := BitVec.ofNat 64 35201551990785 + systematicCode := BitVec.ofNat 64 15763898822784987667 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148559799878272 + maskLow := BitVec.ofNat 64 140741816943383 + maskHigh := BitVec.ofNat 64 35201619591233 + systematicCode := BitVec.ofNat 64 15763924326922727955 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9359666081563264 + maskLow := BitVec.ofNat 64 140741816943383 + maskHigh := BitVec.ofNat 64 72620629890727937 + systematicCode := BitVec.ofNat 64 17429995729650070035 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36046458260162688 + maskLow := BitVec.ofNat 64 1441154084110402327 + maskHigh := BitVec.ofNat 64 108086391056924673 + systematicCode := BitVec.ofNat 64 17433326927071031827 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2533343845550208 + maskLow := BitVec.ofNat 64 140741816943383 + maskHigh := BitVec.ofNat 64 108086391392436737 + systematicCode := BitVec.ofNat 64 17433356872070345235 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36046462555127936 + maskLow := BitVec.ofNat 64 11261202420269847 + maskHigh := BitVec.ofNat 64 4612248968380841985 + systematicCode := BitVec.ofNat 64 18294640295441216019 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2533348140515456 + maskLow := BitVec.ofNat 64 140741816943383 + maskHigh := BitVec.ofNat 64 4612248968383431169 + systematicCode := BitVec.ofNat 64 18294654847512621587 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9359661820414592 + maskLow := BitVec.ofNat 64 140741816943383 + maskHigh := BitVec.ofNat 64 4647758795911495681 + systematicCode := BitVec.ofNat 64 18298084426344444435 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x3216. -/ +def normalizedWeightSixteenCandidateBucket_3216 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10208969769494528 + maskLow := BitVec.ofNat 64 4647714888494418199 + maskHigh := BitVec.ofNat 64 2267742740481 + systematicCode := BitVec.ofNat 64 15260618296073466390 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9650417862584320 + maskLow := BitVec.ofNat 64 35188700678423 + maskHigh := BitVec.ofNat 64 2268824862737 + systematicCode := BitVec.ofNat 64 15260654795159712278 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11334869703600128 + maskLow := BitVec.ofNat 64 290482249013463319 + maskHigh := BitVec.ofNat 64 35188667064321 + systematicCode := BitVec.ofNat 64 15763051099319775766 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9659213982869504 + maskLow := BitVec.ofNat 64 35188700678423 + maskHigh := BitVec.ofNat 64 35188734689297 + systematicCode := BitVec.ofNat 64 15763079901942067734 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9593243285202944 + maskLow := BitVec.ofNat 64 35188700678423 + maskHigh := BitVec.ofNat 64 290482248979849217 + systematicCode := BitVec.ofNat 64 17647012923758555670 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11335449792899072 + maskLow := BitVec.ofNat 64 4899918597930944791 + maskHigh := BitVec.ofNat 64 324259173170683905 + systematicCode := BitVec.ofNat 64 17649496423534834198 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9659794072168448 + maskLow := BitVec.ofNat 64 35188700678423 + maskHigh := BitVec.ofNat 64 324259174311526913 + systematicCode := BitVec.ofNat 64 17649532952718815766 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11335470999289984 + maskLow := BitVec.ofNat 64 38282800184494359 + maskHigh := BitVec.ofNat 64 4613937818241081345 + systematicCode := BitVec.ofNat 64 18295481434721366550 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9659815278559360 + maskLow := BitVec.ofNat 64 35188700678423 + maskHigh := BitVec.ofNat 64 4613937818249986561 + systematicCode := BitVec.ofNat 64 18295502570977440278 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9593239227211904 + maskLow := BitVec.ofNat 64 35188700678423 + maskHigh := BitVec.ofNat 64 4647752198841704449 + systematicCode := BitVec.ofNat 64 18298084413409014294 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x321a. -/ +def normalizedWeightSixteenCandidateBucket_321a : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10208969775736832 + maskLow := BitVec.ofNat 64 4647714836954816791 + maskHigh := BitVec.ofNat 64 2216203126785 + systematicCode := BitVec.ofNat 64 15259487998119850522 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9650417868826624 + maskLow := BitVec.ofNat 64 8800421617943 + maskHigh := BitVec.ofNat 64 2217285255173 + systematicCode := BitVec.ofNat 64 15259528895185498650 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11334869682792448 + maskLow := BitVec.ofNat 64 1161928725370052887 + maskHigh := BitVec.ofNat 64 8800387991553 + systematicCode := BitVec.ofNat 64 15474816342368268826 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9659213962061824 + maskLow := BitVec.ofNat 64 8800421617943 + maskHigh := BitVec.ofNat 64 8800658522117 + systematicCode := BitVec.ofNat 64 15474853940949365274 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9593243264395264 + maskLow := BitVec.ofNat 64 8800421617943 + maskHigh := BitVec.ofNat 64 1161928725336426497 + systematicCode := BitVec.ofNat 64 17936364801703227930 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11335449807464448 + maskLow := BitVec.ofNat 64 5764609726386086167 + maskHigh := BitVec.ofNat 64 1188950301625812993 + systematicCode := BitVec.ofNat 64 17937722401707143706 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9659794086733824 + maskLow := BitVec.ofNat 64 8800421617943 + maskHigh := BitVec.ofNat 64 1188950302967988737 + systematicCode := BitVec.ofNat 64 17937763346050134554 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11335471013855360 + maskLow := BitVec.ofNat 64 45038199625556247 + maskHigh := BitVec.ofNat 64 4620693217682130945 + systematicCode := BitVec.ofNat 64 18296602936648806938 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9659815293124736 + maskLow := BitVec.ofNat 64 8800421617943 + maskHigh := BitVec.ofNat 64 4620693217692615169 + systematicCode := BitVec.ofNat 64 18296628488063889946 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9593239237615744 + maskLow := BitVec.ofNat 64 8800421617943 + maskHigh := BitVec.ofNat 64 4647725810562631681 + systematicCode := BitVec.ofNat 64 18298080015295132186 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x321f. -/ +def normalizedWeightSixteenCandidateBucket_321f : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089444515293184 + maskLow := BitVec.ofNat 64 140827716321559 + maskHigh := BitVec.ofNat 64 72620543991349761 + systematicCode := BitVec.ofNat 64 17429935916507804191 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711165911640064 + maskLow := BitVec.ofNat 64 2203351875863 + maskHigh := BitVec.ofNat 64 72620543991382037 + systematicCode := BitVec.ofNat 64 17429949296338416159 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11340912989588608 + maskLow := BitVec.ofNat 64 140742152519959 + maskHigh := BitVec.ofNat 64 108086391056924673 + systematicCode := BitVec.ofNat 64 17433326810081538591 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089444510885888 + maskLow := BitVec.ofNat 64 35480758485271 + maskHigh := BitVec.ofNat 64 290482175965397505 + systematicCode := BitVec.ofNat 64 17646953110717149727 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711165907232768 + maskLow := BitVec.ofNat 64 2203351875863 + maskHigh := BitVec.ofNat 64 290482175965405253 + systematicCode := BitVec.ofNat 64 17646963217732350495 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089444483835904 + maskLow := BitVec.ofNat 64 9144019026199 + maskHigh := BitVec.ofNat 64 1161928703861588481 + systematicCode := BitVec.ofNat 64 17936309369596097055 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711165880182784 + maskLow := BitVec.ofNat 64 2203351875863 + maskHigh := BitVec.ofNat 64 1161928703861590097 + systematicCode := BitVec.ofNat 64 17936315095811502623 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9786512791349248 + maskLow := BitVec.ofNat 64 2203351875863 + maskHigh := BitVec.ofNat 64 1549238271815451137 + systematicCode := BitVec.ofNat 64 17939229226977866271 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9786533997740160 + maskLow := BitVec.ofNat 64 2203351875863 + maskHigh := BitVec.ofNat 64 4623507967449235969 + systematicCode := BitVec.ofNat 64 18296690301232886303 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089440457056384 + maskLow := BitVec.ofNat 64 184722282086679 + maskHigh := BitVec.ofNat 64 4647714815446352385 + systematicCode := BitVec.ofNat 64 18298004744986636831 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711161853403264 + maskLow := BitVec.ofNat 64 2203351875863 + maskHigh := BitVec.ofNat 64 4647714815446394881 + systematicCode := BitVec.ofNat 64 18298018202125480479 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x3223. -/ +def normalizedWeightSixteenCandidateBucket_3223 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085356368953984 + maskLow := BitVec.ofNat 64 1152956968185561367 + maskHigh := BitVec.ofNat 64 2251868541550593 + systematicCode := BitVec.ofNat 64 16629733460311552547 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148525858390656 + maskLow := BitVec.ofNat 64 36028801347682583 + maskHigh := BitVec.ofNat 64 2251868801605697 + systematicCode := BitVec.ofNat 64 16629745701792657955 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085356219138688 + maskLow := BitVec.ofNat 64 288239451451359511 + maskHigh := BitVec.ofNat 64 9007216442998785 + systematicCode := BitVec.ofNat 64 16916837919309443619 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148525708575360 + maskLow := BitVec.ofNat 64 36028801347682583 + maskHigh := BitVec.ofNat 64 9007216501721153 + systematicCode := BitVec.ofNat 64 16916845762811146787 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9359631990260352 + maskLow := BitVec.ofNat 64 36028801347682583 + maskHigh := BitVec.ofNat 64 72059878968918017 + systematicCode := BitVec.ofNat 64 17425492130292183587 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36046424168859776 + maskLow := BitVec.ofNat 64 1441714835040698647 + maskHigh := BitVec.ofNat 64 72198331534671873 + systematicCode := BitVec.ofNat 64 17428840919630754339 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2533309754247296 + maskLow := BitVec.ofNat 64 36028801347682583 + maskHigh := BitVec.ofNat 64 72198331861958657 + systematicCode := BitVec.ofNat 64 17428853272712458787 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2533859510059136 + maskLow := BitVec.ofNat 64 36028801347682583 + maskHigh := BitVec.ofNat 64 4611688217450784769 + systematicCode := BitVec.ofNat 64 18290141300825928227 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36046973924671616 + maskLow := BitVec.ofNat 64 606934747250967 + maskHigh := BitVec.ofNat 64 4611688217459032065 + systematicCode := BitVec.ofNat 64 18290154249144185379 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9359082268265088 + maskLow := BitVec.ofNat 64 36028801347682583 + maskHigh := BitVec.ofNat 64 4623085754992558081 + systematicCode := BitVec.ofNat 64 18296690284524614179 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x3226. -/ +def normalizedWeightSixteenCandidateBucket_3226 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10208424308647936 + maskLow := BitVec.ofNat 64 4611826828964331799 + maskHigh := BitVec.ofNat 64 563018674995201 + systematicCode := BitVec.ofNat 64 16413557392597922342 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9649872401737728 + maskLow := BitVec.ofNat 64 9007203583852823 + maskHigh := BitVec.ofNat 64 563019746672657 + systematicCode := BitVec.ofNat 64 16413576231048131110 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11334324242753536 + maskLow := BitVec.ofNat 64 288239245293322519 + maskHigh := BitVec.ofNat 64 9007203551805441 + systematicCode := BitVec.ofNat 64 16915990195844231718 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9658668522022912 + maskLow := BitVec.ofNat 64 9007203583852823 + maskHigh := BitVec.ofNat 64 9007203616819217 + systematicCode := BitVec.ofNat 64 16916001337830486566 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9592697824356352 + maskLow := BitVec.ofNat 64 9007203583852823 + maskHigh := BitVec.ofNat 64 288239245261275137 + systematicCode := BitVec.ofNat 64 17642509324400669222 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11333813410359296 + maskLow := BitVec.ofNat 64 4900479348861632791 + maskHigh := BitVec.ofNat 64 288371113642164225 + systematicCode := BitVec.ofNat 64 17645010416094556710 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9658157689628672 + maskLow := BitVec.ofNat 64 9007203583852823 + maskHigh := BitVec.ofNat 64 288371114781048833 + systematicCode := BitVec.ofNat 64 17645029353360929318 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9660872108949632 + maskLow := BitVec.ofNat 64 9007203583852823 + maskHigh := BitVec.ofNat 64 4611694814520576001 + systematicCode := BitVec.ofNat 64 18290985738640765478 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11336527829680256 + maskLow := BitVec.ofNat 64 712487863910679 + maskHigh := BitVec.ofNat 64 4611694814522507265 + systematicCode := BitVec.ofNat 64 18290995375589765670 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9592182396821632 + maskLow := BitVec.ofNat 64 9007203583852823 + maskHigh := BitVec.ofNat 64 4621396905126002689 + systematicCode := BitVec.ofNat 64 18296686985939202598 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x322a. -/ +def normalizedWeightSixteenCandidateBucket_322a : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10208424314890240 + maskLow := BitVec.ofNat 64 4611826777426297111 + maskHigh := BitVec.ofNat 64 562967133814785 + systematicCode := BitVec.ofNat 64 16412427094644306474 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9649872407980032 + maskLow := BitVec.ofNat 64 2251804144369943 + maskHigh := BitVec.ofNat 64 562968207065093 + systematicCode := BitVec.ofNat 64 16412450331073917482 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11334324221945856 + maskLow := BitVec.ofNat 64 1152956710489489687 + maskHigh := BitVec.ofNat 64 2251804109176833 + systematicCode := BitVec.ofNat 64 16627755438892724778 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9658668501215232 + maskLow := BitVec.ofNat 64 2251804144369943 + maskHigh := BitVec.ofNat 64 2251804377096197 + systematicCode := BitVec.ofNat 64 16627775376837784106 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9592697803548672 + maskLow := BitVec.ofNat 64 2251804144369943 + maskHigh := BitVec.ofNat 64 1152956710454296577 + systematicCode := BitVec.ofNat 64 17931861202345341482 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11333813424924672 + maskLow := BitVec.ofNat 64 5765170477318340887 + maskHigh := BitVec.ofNat 64 1153062242095726593 + systematicCode := BitVec.ofNat 64 17933236394266866218 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9658157704194048 + maskLow := BitVec.ofNat 64 2251804144369943 + maskHigh := BitVec.ofNat 64 1153062243437510657 + systematicCode := BitVec.ofNat 64 17933259746692248106 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9660872123515008 + maskLow := BitVec.ofNat 64 2251804144369943 + maskHigh := BitVec.ofNat 64 4611721202799648769 + systematicCode := BitVec.ofNat 64 18292111638614454826 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11336527844245632 + maskLow := BitVec.ofNat 64 738876144550167 + maskHigh := BitVec.ofNat 64 4611721202800001025 + systematicCode := BitVec.ofNat 64 18292116877450359338 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9592182407225472 + maskLow := BitVec.ofNat 64 2251804144369943 + maskHigh := BitVec.ofNat 64 4614641505683374081 + systematicCode := BitVec.ofNat 64 18295561085964988970 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x322f. -/ +def normalizedWeightSixteenCandidateBucket_322f : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089717245716480 + maskLow := BitVec.ofNat 64 36028887255286039 + maskHigh := BitVec.ofNat 64 72059793061314561 + systematicCode := BitVec.ofNat 64 17425449977785954863 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711438642063360 + maskLow := BitVec.ofNat 64 562954290397463 + maskHigh := BitVec.ofNat 64 72059793069572117 + systematicCode := BitVec.ofNat 64 17425463288898138671 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11338219776658560 + maskLow := BitVec.ofNat 64 36028801691484439 + maskHigh := BitVec.ofNat 64 72198331534671873 + systematicCode := BitVec.ofNat 64 17428840871359689263 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089717241309184 + maskLow := BitVec.ofNat 64 9007495649493271 + maskHigh := BitVec.ofNat 64 288239172244865025 + systematicCode := BitVec.ofNat 64 17642467171995300399 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711438637656064 + maskLow := BitVec.ofNat 64 562954290397463 + maskHigh := BitVec.ofNat 64 288239172246831173 + systematicCode := BitVec.ofNat 64 17642477210292073007 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089717214259200 + maskLow := BitVec.ofNat 64 2252147748045079 + maskHigh := BitVec.ofNat 64 1152956688979066881 + systematicCode := BitVec.ofNat 64 17931823430874247727 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711438610606080 + maskLow := BitVec.ofNat 64 562954290397463 + maskHigh := BitVec.ofNat 64 1152956688979460177 + systematicCode := BitVec.ofNat 64 17931829088371225135 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9785694600079360 + maskLow := BitVec.ofNat 64 562954290397463 + maskHigh := BitVec.ofNat 64 1513350212284973057 + systematicCode := BitVec.ofNat 64 17939229158527873583 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9788409019400320 + maskLow := BitVec.ofNat 64 562954290397463 + maskHigh := BitVec.ofNat 64 4611732197915885569 + systematicCode := BitVec.ofNat 64 18292169040969478703 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089201817936000 + maskLow := BitVec.ofNat 64 47287800424366359 + maskHigh := BitVec.ofNat 64 4611826755915874305 + systematicCode := BitVec.ofNat 64 18293518806534271535 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9710923214282880 + maskLow := BitVec.ofNat 64 562954290397463 + maskHigh := BitVec.ofNat 64 4611826755926753281 + systematicCode := BitVec.ofNat 64 18293532263673115183 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x3231. -/ +def normalizedWeightSixteenCandidateBucket_3231 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .d16Plus + affineCode := BitVec.ofNat 56 54397238693142784 + maskLow := BitVec.ofNat 64 72057598718837015 + maskHigh := BitVec.ofNat 64 36169534524096513 + systematicCode := BitVec.ofNat 64 17284727890897023537 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9359628500601088 + maskLow := BitVec.ofNat 64 4611686022772752663 + maskHigh := BitVec.ofNat 64 565235949764609 + systematicCode := BitVec.ofNat 64 16416685813996991025 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2533313780777216 + maskLow := BitVec.ofNat 64 4611686022772752663 + maskHigh := BitVec.ofNat 64 703687461175297 + systematicCode := BitVec.ofNat 64 16420037017711948337 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36046428195389696 + maskLow := BitVec.ofNat 64 83316597451718935 + maskHigh := BitVec.ofNat 64 703688515518465 + systematicCode := BitVec.ofNat 64 16420049957440401969 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2533859241623808 + maskLow := BitVec.ofNat 64 4611686022772752663 + maskHigh := BitVec.ofNat 64 36030996059006977 + systematicCode := BitVec.ofNat 64 17281350377458643505 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36046973656236288 + maskLow := BitVec.ofNat 64 72101578848403735 + maskHigh := BitVec.ofNat 64 36030997115961345 + systematicCode := BitVec.ofNat 64 17281363385905525297 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148522368731392 + maskLow := BitVec.ofNat 64 4611686022772752663 + maskHigh := BitVec.ofNat 64 288230444873293889 + systematicCode := BitVec.ofNat 64 17638536625161777713 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085352879294720 + maskLow := BitVec.ofNat 64 9042662850101527 + maskHigh := BitVec.ofNat 64 288230445944930305 + systematicCode := BitVec.ofNat 64 17638555109875790385 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148522218916096 + maskLow := BitVec.ofNat 64 4611686022772752663 + maskHigh := BitVec.ofNat 64 1152921521787242561 + systematicCode := BitVec.ofNat 64 17925636686180266545 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085352729479424 + maskLow := BitVec.ofNat 64 2260875129979159 + maskHigh := BitVec.ofNat 64 1152921522860457985 + systematicCode := BitVec.ofNat 64 17925659568873681457 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9359083073571072 + maskLow := BitVec.ofNat 64 4611686022772752663 + maskHigh := BitVec.ofNat 64 1477321416339619841 + systematicCode := BitVec.ofNat 64 17939226959942529585 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x340b. -/ +def normalizedWeightSixteenCandidateBucket_340b : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.node + (.leaf + { patternClass := .twoE8 + affineCode := BitVec.ofNat 56 2393089211498624 + maskLow := BitVec.ofNat 64 73187896353423671 + maskHigh := BitVec.ofNat 64 51 + systematicCode := BitVec.ofNat 64 9982654567786230795 }) + (.leaf + { patternClass := .twoE8 + affineCode := BitVec.ofNat 56 18032542604984448 + maskLow := BitVec.ofNat 64 219110506807 + maskHigh := BitVec.ofNat 64 17040385 + systematicCode := BitVec.ofNat 64 12728461493633496075 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10274115859776128 + maskLow := BitVec.ofNat 64 2341876208641311031 + maskHigh := BitVec.ofNat 64 18465 + systematicCode := BitVec.ofNat 64 11355697243879650315 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11400015766620416 + maskLow := BitVec.ofNat 64 1170940305524982071 + maskHigh := BitVec.ofNat 64 34833 + systematicCode := BitVec.ofNat 64 11427753734094205963 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11400015768717440 + maskLow := BitVec.ofNat 64 146371390298194231 + maskHigh := BitVec.ofNat 64 49155 + systematicCode := BitVec.ofNat 64 11429435961014236171 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10274388590199424 + maskLow := BitVec.ofNat 64 2307109650971033911 + maskHigh := BitVec.ofNat 64 4718625 + systematicCode := BitVec.ofNat 64 12513122347946750987 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11400288497043712 + maskLow := BitVec.ofNat 64 1154117777620009271 + maskHigh := BitVec.ofNat 64 8912913 + systematicCode := BitVec.ofNat 64 12585178838178018315 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11400288499140736 + maskLow := BitVec.ofNat 64 145249888437862711 + maskHigh := BitVec.ofNat 64 12582915 + systematicCode := BitVec.ofNat 64 12586861065198318603 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18102930708236416 + maskLow := BitVec.ofNat 64 3458764526772617527 + maskHigh := BitVec.ofNat 64 17303553 + systematicCode := BitVec.ofNat 64 12729309424062247947 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18102930706139392 + maskLow := BitVec.ofNat 64 2449958270371168567 + maskHigh := BitVec.ofNat 64 20987905 + systematicCode := BitVec.ofNat 64 12731004870892008459 }) + ) + ) + ) + ) + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18094134613115520 + maskLow := BitVec.ofNat 64 1297036834483798327 + maskHigh := BitVec.ofNat 64 25198593 + systematicCode := BitVec.ofNat 64 12731287441085445131 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18102911382063232 + maskLow := BitVec.ofNat 64 54043208480522551 + maskHigh := BitVec.ofNat 64 33818625 + systematicCode := BitVec.ofNat 64 12944637729504965643 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18102638651639936 + maskLow := BitVec.ofNat 64 211119184609591 + maskHigh := BitVec.ofNat 64 34079745 + systematicCode := BitVec.ofNat 64 12945478786912302091 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18102911379966208 + maskLow := BitVec.ofNat 64 38280669914267959 + maskHigh := BitVec.ofNat 64 268713985 + systematicCode := BitVec.ofNat 64 13376989890702029835 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18102638649542912 + maskLow := BitVec.ofNat 64 149606662996279 + maskHigh := BitVec.ofNat 64 272630785 + systematicCode := BitVec.ofNat 64 13379513200899863563 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10274407916372608 + maskLow := BitVec.ofNat 64 108227132907389239 + maskHigh := BitVec.ofNat 64 301989921 + systematicCode := BitVec.ofNat 64 13381191133340513291 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18094115286942336 + maskLow := BitVec.ofNat 64 20266340124262711 + maskHigh := BitVec.ofNat 64 537165825 + systematicCode := BitVec.ofNat 64 13449048579956683787 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18093842556519040 + maskLow := BitVec.ofNat 64 79306638295351 + maskHigh := BitVec.ofNat 64 545260545 + systematicCode := BitVec.ofNat 64 13451852265619600395 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11400307823216896 + maskLow := BitVec.ofNat 64 90142365653729591 + maskHigh := BitVec.ofNat 64 570425361 + systematicCode := BitVec.ofNat 64 13453247627849970699 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11400307825313920 + maskLow := BitVec.ofNat 64 74318194306777399 + maskHigh := BitVec.ofNat 64 805306371 + systematicCode := BitVec.ofNat 64 13454929880539411467 }) + ) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x3415. -/ +def normalizedWeightSixteenCandidateBucket_3415 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085390460208128 + maskLow := BitVec.ofNat 64 1170936044917425431 + maskHigh := BitVec.ofNat 64 8864812531713 + systematicCode := BitVec.ofNat 64 15476794363820520469 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148559949644800 + maskLow := BitVec.ofNat 64 140741850498327 + maskHigh := BitVec.ofNat 64 8865085128737 + systematicCode := BitVec.ofNat 64 15476824274460619797 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085390309222400 + maskLow := BitVec.ofNat 64 146367129690637591 + maskHigh := BitVec.ofNat 64 70377334145025 + systematicCode := BitVec.ofNat 64 15907451052317357077 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148559798659072 + maskLow := BitVec.ofNat 64 140741850498327 + maskHigh := BitVec.ofNat 64 70377368191009 + systematicCode := BitVec.ofNat 64 15907474365988353045 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9359666081514496 + maskLow := BitVec.ofNat 64 140741850498327 + maskHigh := BitVec.ofNat 64 73183571254214657 + systematicCode := BitVec.ofNat 64 17430558671013557269 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36046458260308992 + maskLow := BitVec.ofNat 64 1297041095091356951 + maskHigh := BitVec.ofNat 64 108086391056924673 + systematicCode := BitVec.ofNat 64 17433326927037608981 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2533343845696512 + maskLow := BitVec.ofNat 64 140741850498327 + maskHigh := BitVec.ofNat 64 108086391358882817 + systematicCode := BitVec.ofNat 64 17433356863513965589 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36046462555014144 + maskLow := BitVec.ofNat 64 20270600731821335 + maskHigh := BitVec.ofNat 64 2306968909120569345 + systematicCode := BitVec.ofNat 64 18151088065908847637 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2533348140401664 + maskLow := BitVec.ofNat 64 140741850498327 + maskHigh := BitVec.ofNat 64 2306968909125256193 + systematicCode := BitVec.ofNat 64 18151104808446997525 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9359661820365824 + maskLow := BitVec.ofNat 64 140741850498327 + maskHigh := BitVec.ofNat 64 2341950971069890561 + systematicCode := BitVec.ofNat 64 18153971437291844629 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x3416. -/ +def normalizedWeightSixteenCandidateBucket_3416 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10208969770664960 + maskLow := BitVec.ofNat 64 2341871879314278679 + maskHigh := BitVec.ofNat 64 4466766004225 + systematicCode := BitVec.ofNat 64 15404735674582643734 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9650417863754752 + maskLow := BitVec.ofNat 64 70373106321687 + maskHigh := BitVec.ofNat 64 4467311247377 + systematicCode := BitVec.ofNat 64 15404767784212444182 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11334869704770560 + maskLow := BitVec.ofNat 64 146367060971161879 + maskHigh := BitVec.ofNat 64 70373039161345 + systematicCode := BitVec.ofNat 64 15907168477828953110 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9659213984039936 + maskLow := BitVec.ofNat 64 70373106321687 + maskHigh := BitVec.ofNat 64 70373073223697 + systematicCode := BitVec.ofNat 64 15907192890994799638 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9593243286373376 + maskLow := BitVec.ofNat 64 70373106321687 + maskHigh := BitVec.ofNat 64 146367060904001537 + systematicCode := BitVec.ofNat 64 17502897735716385814 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11335449793793152 + maskLow := BitVec.ofNat 64 2449962599698204951 + maskHigh := BitVec.ofNat 64 180143985094836225 + systematicCode := BitVec.ofNat 64 17505383425858876438 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9659794073062528 + maskLow := BitVec.ofNat 64 70373106321687 + maskHigh := BitVec.ofNat 64 180143985665246209 + systematicCode := BitVec.ofNat 64 17505415557063455766 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11335470998899840 + maskLow := BitVec.ofNat 64 38284999241304343 + maskHigh := BitVec.ofNat 64 2308094809027395585 + systematicCode := BitVec.ofNat 64 18151368445668897814 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9659815278169216 + maskLow := BitVec.ofNat 64 70373106321687 + maskHigh := BitVec.ofNat 64 2308094809036293121 + systematicCode := BitVec.ofNat 64 18151387382935270422 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9593239228138496 + maskLow := BitVec.ofNat 64 70373106321687 + maskHigh := BitVec.ofNat 64 2341946573023363073 + systematicCode := BitVec.ofNat 64 18153971432980034582 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x341c. -/ +def normalizedWeightSixteenCandidateBucket_341c : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10208969776956032 + maskLow := BitVec.ofNat 64 2341871819184750871 + maskHigh := BitVec.ofNat 64 4406636447745 + systematicCode := BitVec.ofNat 64 15403040227652219932 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9650417870045824 + maskLow := BitVec.ofNat 64 8800455180567 + maskHigh := BitVec.ofNat 64 4407181705219 + systematicCode := BitVec.ofNat 64 15403078934251123740 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11334869683800320 + maskLow := BitVec.ofNat 64 1170935916068421911 + maskHigh := BitVec.ofNat 64 8800387991553 + systematicCode := BitVec.ofNat 64 15474816342401692700 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9659213963069696 + maskLow := BitVec.ofNat 64 8800455180567 + maskHigh := BitVec.ofNat 64 8800660619267 + systematicCode := BitVec.ofNat 64 15474853949505745948 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9593243265403136 + maskLow := BitVec.ofNat 64 8800455180567 + maskHigh := BitVec.ofNat 64 1170935916001232897 + systematicCode := BitVec.ofNat 64 17936925552633394204 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11335449808472320 + maskLow := BitVec.ofNat 64 3458768916229210391 + maskHigh := BitVec.ofNat 64 1188950301625812993 + systematicCode := BitVec.ofNat 64 17937722393117340700 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9659794087741696 + maskLow := BitVec.ofNat 64 8800455180567 + maskHigh := BitVec.ofNat 64 1188950302431118337 + systematicCode := BitVec.ofNat 64 17937761147060433948 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11335471013579008 + maskLow := BitVec.ofNat 64 54047597937115415 + maskHigh := BitVec.ofNat 64 2323857407723177985 + systematicCode := BitVec.ofNat 64 18153050698560058396 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9659815292848384 + maskLow := BitVec.ofNat 64 8800455180567 + maskHigh := BitVec.ofNat 64 2323857407735759873 + systematicCode := BitVec.ofNat 64 18153076258564944924 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9593239238623616 + maskLow := BitVec.ofNat 64 8800455180567 + maskHigh := BitVec.ofNat 64 2341885000372193281 + systematicCode := BitVec.ofNat 64 18153964835809211420 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x341f. -/ +def normalizedWeightSixteenCandidateBucket_341f : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089444516301056 + maskLow := BitVec.ofNat 64 140819159941399 + maskHigh := BitVec.ofNat 64 73183493944771585 + systematicCode := BitVec.ofNat 64 17430501065484350495 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711165912647936 + maskLow := BitVec.ofNat 64 4402408685847 + maskHigh := BitVec.ofNat 64 73183493944803347 + systematicCode := BitVec.ofNat 64 17430512246258414623 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089444512105088 + maskLow := BitVec.ofNat 64 70519135240471 + maskHigh := BitVec.ofNat 64 146366987889542145 + systematicCode := BitVec.ofNat 64 17502840130220799007 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711165908451968 + maskLow := BitVec.ofNat 64 4402408685847 + maskHigh := BitVec.ofNat 64 146366987889557539 + systematicCode := BitVec.ofNat 64 17502850220056392735 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089444484843776 + maskLow := BitVec.ofNat 64 9006613627159 + maskHigh := BitVec.ofNat 64 1170935903116329985 + systematicCode := BitVec.ofNat 64 17936874518539219999 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711165881190656 + maskLow := BitVec.ofNat 64 4402408685847 + maskHigh := BitVec.ofNat 64 1170935903116331057 + systematicCode := BitVec.ofNat 64 17936878037175120927 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9786512792357120 + maskLow := BitVec.ofNat 64 4402408685847 + maskHigh := BitVec.ofNat 64 1405123083739595777 + systematicCode := BitVec.ofNat 64 17938666277058130975 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9786533997463808 + maskLow := BitVec.ofNat 64 4402408685847 + maskHigh := BitVec.ofNat 64 2327235107443704833 + systematicCode := BitVec.ofNat 64 18153138071734072351 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089440458064256 + maskLow := BitVec.ofNat 64 219906687729943 + maskHigh := BitVec.ofNat 64 2341871806232658945 + systematicCode := BitVec.ofNat 64 18153891755967591455 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711161854411136 + maskLow := BitVec.ofNat 64 4402408685847 + maskHigh := BitVec.ofNat 64 2341871806232709121 + systematicCode := BitVec.ofNat 64 18153903022639690783 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x3425. -/ +def normalizedWeightSixteenCandidateBucket_3425 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085356368905216 + maskLow := BitVec.ofNat 64 1152992015152382231 + maskHigh := BitVec.ofNat 64 2251868541550593 + systematicCode := BitVec.ofNat 64 16629733460344976421 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148525858341888 + maskLow := BitVec.ofNat 64 36028801381368087 + maskHigh := BitVec.ofNat 64 2251868801613857 + systematicCode := BitVec.ofNat 64 16629745710349038629 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085356217919488 + maskLow := BitVec.ofNat 64 144124125970235671 + maskHigh := BitVec.ofNat 64 18014407107805185 + systematicCode := BitVec.ofNat 64 17060390148841813029 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148525707356160 + maskLow := BitVec.ofNat 64 36028801381368087 + maskHigh := BitVec.ofNat 64 18014407132973089 + systematicCode := BitVec.ofNat 64 17060395801876771877 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9359631990211584 + maskLow := BitVec.ofNat 64 36028801381368087 + maskHigh := BitVec.ofNat 64 72062069402238977 + systematicCode := BitVec.ofNat 64 17426055071655670821 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36046424169006080 + maskLow := BitVec.ofNat 64 1298162596951949591 + maskHigh := BitVec.ofNat 64 72198331534671873 + systematicCode := BitVec.ofNat 64 17428840919597331493 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2533309754393600 + maskLow := BitVec.ofNat 64 36028801381368087 + maskHigh := BitVec.ofNat 64 72198331828535297 + systematicCode := BitVec.ofNat 64 17428853264156079141 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2533859509945344 + maskLow := BitVec.ofNat 64 36028801381368087 + maskHigh := BitVec.ofNat 64 2305847407260485633 + systematicCode := BitVec.ofNat 64 18146591270316684325 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36046973924557824 + maskLow := BitVec.ofNat 64 1205069106446615 + maskHigh := BitVec.ofNat 64 2305847407268593665 + systematicCode := BitVec.ofNat 64 18146602019645240357 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9359082268216320 + maskLow := BitVec.ofNat 64 36028801381368087 + maskHigh := BitVec.ofNat 64 2326249945033605121 + systematicCode := BitVec.ofNat 64 18153138046402180133 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x3426. -/ +def normalizedWeightSixteenCandidateBucket_3426 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10208424309818368 + maskLow := BitVec.ofNat 64 2305983819784192279 + maskHigh := BitVec.ofNat 64 1125968630513665 + systematicCode := BitVec.ofNat 64 16557674771107099686 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9649872402908160 + maskLow := BitVec.ofNat 64 18014402872148247 + maskHigh := BitVec.ofNat 64 1125969163223057 + systematicCode := BitVec.ofNat 64 16557689220100863014 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11334324243923968 + maskLow := BitVec.ofNat 64 144124057251021079 + maskHigh := BitVec.ofNat 64 18014402808643585 + systematicCode := BitVec.ofNat 64 17060107574353409062 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9658668523193344 + maskLow := BitVec.ofNat 64 18014402872148247 + maskHigh := BitVec.ofNat 64 18014402838005777 + systematicCode := BitVec.ofNat 64 17060114326883218470 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9592697825526784 + maskLow := BitVec.ofNat 64 18014402872148247 + maskHigh := BitVec.ofNat 64 144124057187516417 + systematicCode := BitVec.ofNat 64 17498394136358499366 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11333813411253376 + maskLow := BitVec.ofNat 64 2451084101559058711 + maskHigh := BitVec.ofNat 64 144255925568405505 + systematicCode := BitVec.ofNat 64 17500897418418598950 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9658157690522752 + maskLow := BitVec.ofNat 64 18014402872148247 + maskHigh := BitVec.ofNat 64 144255926134898689 + systematicCode := BitVec.ofNat 64 17500911957705569318 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9660872108559488 + maskLow := BitVec.ofNat 64 18014402872148247 + maskHigh := BitVec.ofNat 64 2305851805307013121 + systematicCode := BitVec.ofNat 64 18146872749588296742 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11336527829290112 + maskLow := BitVec.ofNat 64 1275437850886423 + maskHigh := BitVec.ofNat 64 2305851805310910465 + systematicCode := BitVec.ofNat 64 18146882395127100454 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9592182397748224 + maskLow := BitVec.ofNat 64 18014402872148247 + maskHigh := BitVec.ofNat 64 2325124045122568193 + systematicCode := BitVec.ofNat 64 18153136946873709606 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x342c. -/ +def normalizedWeightSixteenCandidateBucket_342c : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10208424316109440 + maskLow := BitVec.ofNat 64 2305983759658320151 + maskHigh := BitVec.ofNat 64 1125908497301505 + systematicCode := BitVec.ofNat 64 16555979324176675884 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9649872409199232 + maskLow := BitVec.ofNat 64 2251804180021527 + maskHigh := BitVec.ofNat 64 1125909033680899 + systematicCode := BitVec.ofNat 64 16556000370139542572 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11334324222953728 + maskLow := BitVec.ofNat 64 1152991886307295511 + maskHigh := BitVec.ofNat 64 2251804109176833 + systematicCode := BitVec.ofNat 64 16627755438926148652 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9658668502223104 + maskLow := BitVec.ofNat 64 2251804180021527 + maskHigh := BitVec.ofNat 64 2251804377104387 + systematicCode := BitVec.ofNat 64 16627775385394164780 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9592697804556544 + maskLow := BitVec.ofNat 64 2251804180021527 + maskHigh := BitVec.ofNat 64 1152991886236450817 + systematicCode := BitVec.ofNat 64 17932421953275507756 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11333813425932544 + maskLow := BitVec.ofNat 64 3459890418093719831 + maskHigh := BitVec.ofNat 64 1153062242095726593 + systematicCode := BitVec.ofNat 64 17933236385677063212 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9658157705201920 + maskLow := BitVec.ofNat 64 2251804180021527 + maskHigh := BitVec.ofNat 64 1153062242900770817 + systematicCode := BitVec.ofNat 64 17933257547702547500 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9660872123238656 + maskLow := BitVec.ofNat 64 2251804180021527 + maskHigh := BitVec.ofNat 64 2305913377958182913 + systematicCode := BitVec.ofNat 64 18148561599548830764 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11336527843969280 + maskLow := BitVec.ofNat 64 1337010505711895 + maskHigh := BitVec.ofNat 64 2305913377958395905 + systematicCode := BitVec.ofNat 64 18148564647917990956 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9592182408233344 + maskLow := BitVec.ofNat 64 2251804180021527 + maskHigh := BitVec.ofNat 64 2309361446423101441 + systematicCode := BitVec.ofNat 64 18151448096912389164 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x342f. -/ +def normalizedWeightSixteenCandidateBucket_342f : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089717246724352 + maskLow := BitVec.ofNat 64 36028878698905879 + maskHigh := BitVec.ofNat 64 72061992084701185 + systematicCode := BitVec.ofNat 64 17426015126762501167 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711438643071232 + maskLow := BitVec.ofNat 64 1125904277373207 + maskHigh := BitVec.ofNat 64 72061992092827667 + systematicCode := BitVec.ofNat 64 17426026238818137135 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089717242528384 + maskLow := BitVec.ofNat 64 18014548908900631 + maskHigh := BitVec.ofNat 64 144123984169140225 + systematicCode := BitVec.ofNat 64 17498354191498949679 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711438638875264 + maskLow := BitVec.ofNat 64 1125904277373207 + maskHigh := BitVec.ofNat 64 144123984173072419 + systematicCode := BitVec.ofNat 64 17498364212616115247 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089717215267072 + maskLow := BitVec.ofNat 64 2252010342646039 + maskHigh := BitVec.ofNat 64 1152991873351286785 + systematicCode := BitVec.ofNat 64 17932388579817370671 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711438611613952 + maskLow := BitVec.ofNat 64 1125904277373207 + maskHigh := BitVec.ofNat 64 1152991873351548977 + systematicCode := BitVec.ofNat 64 17932392029734843439 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9785694601087232 + maskLow := BitVec.ofNat 64 1125904277373207 + maskHigh := BitVec.ofNat 64 1369235024209248257 + systematicCode := BitVec.ofNat 64 17938666208608138287 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9788409019123968 + maskLow := BitVec.ofNat 64 1125904277373207 + maskHigh := BitVec.ofNat 64 2305926572097667073 + systematicCode := BitVec.ofNat 64 18148616811470664751 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089201818943872 + maskLow := BitVec.ofNat 64 56294999712661783 + maskHigh := BitVec.ofNat 64 2305983746702311425 + systematicCode := BitVec.ofNat 64 18149405817515226159 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9710923215290752 + maskLow := BitVec.ofNat 64 1125904277373207 + maskHigh := BitVec.ofNat 64 2305983746715156481 + systematicCode := BitVec.ofNat 64 18149417084187325487 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x3431. -/ +def normalizedWeightSixteenCandidateBucket_3431 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9359628500763648 + maskLow := BitVec.ofNat 64 2305843013592613143 + maskHigh := BitVec.ofNat 64 1130375799635969 + systematicCode := BitVec.ofNat 64 16561363943402648625 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2533313780679680 + maskLow := BitVec.ofNat 64 2305843013592613143 + maskHigh := BitVec.ofNat 64 1266637416693761 + systematicCode := BitVec.ofNat 64 16564152214377608241 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36046428195292160 + maskLow := BitVec.ofNat 64 92323796740014359 + maskHigh := BitVec.ofNat 64 1266637932068865 + systematicCode := BitVec.ofNat 64 16564162946526557233 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2533859241526272 + maskLow := BitVec.ofNat 64 2305843013592613143 + maskHigh := BitVec.ofNat 64 36033195082270721 + systematicCode := BitVec.ofNat 64 17281913336001868849 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36046973656138752 + maskLow := BitVec.ofNat 64 72136763254046999 + maskHigh := BitVec.ofNat 64 36033195602345985 + systematicCode := BitVec.ofNat 64 17281924136869246001 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148522368893952 + maskLow := BitVec.ofNat 64 2305843013592613143 + maskHigh := BitVec.ofNat 64 144115256799543329 + systematicCode := BitVec.ofNat 64 17494423644665426993 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085352879457280 + maskLow := BitVec.ofNat 64 18084909071532311 + maskHigh := BitVec.ofNat 64 144115257332203521 + systematicCode := BitVec.ofNat 64 17494437731400037425 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148522217908224 + maskLow := BitVec.ofNat 64 2305843013592613143 + maskHigh := BitVec.ofNat 64 1152921513197307937 + systematicCode := BitVec.ofNat 64 17925073736193160241 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085352728471552 + maskLow := BitVec.ofNat 64 2260737724580119 + maskHigh := BitVec.ofNat 64 1152921513733652481 + systematicCode := BitVec.ofNat 64 17925094419896874033 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9359083073473536 + maskLow := BitVec.ofNat 64 2305843013592613143 + maskHigh := BitVec.ofNat 64 1333206227726893057 + systematicCode := BitVec.ofNat 64 17938664009955423281 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x3432. -/ +def normalizedWeightSixteenCandidateBucket_3432 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9592710709642240 + maskLow := BitVec.ofNat 64 1152921509002543383 + maskHigh := BitVec.ofNat 64 2260669189586945 + systematicCode := BitVec.ofNat 64 16633703008105477170 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9658166011513984 + maskLow := BitVec.ofNat 64 1152921509002543383 + maskHigh := BitVec.ofNat 64 2392537327730689 + systematicCode := BitVec.ofNat 64 16636209812710437938 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11333821732244608 + maskLow := BitVec.ofNat 64 110338195266273559 + maskHigh := BitVec.ofNat 64 2392537570476033 + systematicCode := BitVec.ofNat 64 16636219441069634610 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9660859224444032 + maskLow := BitVec.ofNat 64 1152921509002543383 + maskHigh := BitVec.ofNat 64 36037593128798209 + systematicCode := BitVec.ofNat 64 17282194815273481266 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11336514945174656 + maskLow := BitVec.ofNat 64 72207132015001879 + maskHigh := BitVec.ofNat 64 36037593380421633 + systematicCode := BitVec.ofNat 64 17282204512351106098 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9649885287023616 + maskLow := BitVec.ofNat 64 1152921509002543383 + maskHigh := BitVec.ofNat 64 72057662765826065 + systematicCode := BitVec.ofNat 64 17422367154417251378 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10208437193933824 + maskLow := BitVec.ofNat 64 36169607622492439 + maskHigh := BitVec.ofNat 64 72057663025840129 + systematicCode := BitVec.ofNat 64 17422379042162160690 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9658681407308800 + maskLow := BitVec.ofNat 64 1152921509002543383 + maskHigh := BitVec.ofNat 64 1152921508902340625 + systematicCode := BitVec.ofNat 64 17924792261199606834 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11334337128039424 + maskLow := BitVec.ofNat 64 2260669021880599 + maskHigh := BitVec.ofNat 64 1152921509170249729 + systematicCode := BitVec.ofNat 64 17924811845408470066 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9592191255577600 + maskLow := BitVec.ofNat 64 1152921509002543383 + maskHigh := BitVec.ofNat 64 1261148633420529665 + systematicCode := BitVec.ofNat 64 17938382534961869874 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x370b. -/ +def normalizedWeightSixteenCandidateBucket_370b : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11330469510776960 + maskLow := BitVec.ofNat 64 145245490458460471 + maskHigh := BitVec.ofNat 64 824633720835 + systematicCode := BitVec.ofNat 64 14901711273666557707 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9096261883136128 + maskLow := BitVec.ofNat 64 13019185463 + maskHigh := BitVec.ofNat 64 824667538433 + systematicCode := BitVec.ofNat 64 14901764261482280715 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11330488836950144 + maskLow := BitVec.ofNat 64 74313796327375159 + maskHigh := BitVec.ofNat 64 52776558133251 + systematicCode := BitVec.ofNat 64 15769780089007650571 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9096281209309312 + maskLow := BitVec.ofNat 64 13019185463 + maskHigh := BitVec.ofNat 64 52776575435777 + systematicCode := BitVec.ofNat 64 15769829804007962379 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11332125219489920 + maskLow := BitVec.ofNat 64 73192294467043639 + maskHigh := BitVec.ofNat 64 13510798882111491 + systematicCode := BitVec.ofNat 64 16927205193191733003 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9097917591849088 + maskLow := BitVec.ofNat 64 13019185463 + maskHigh := BitVec.ofNat 64 13510798899152897 + systematicCode := BitVec.ofNat 64 16927254895407609611 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9026999058301056 + maskLow := BitVec.ofNat 64 13019185463 + maskHigh := BitVec.ofNat 64 4620728951810031619 + systematicCode := BitVec.ofNat 64 18296677016646399755 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9026999058303104 + maskLow := BitVec.ofNat 64 13019185463 + maskHigh := BitVec.ofNat 64 9227893503546097667 + systematicCode := BitVec.ofNat 64 18368452031901021963 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11332129514717312 + maskLow := BitVec.ofNat 64 146375788411814199 + maskHigh := BitVec.ofNat 64 13835058055282163715 + systematicCode := BitVec.ofNat 64 18373986586419738379 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9097921887076480 + maskLow := BitVec.ofNat 64 13019185463 + maskHigh := BitVec.ofNat 64 13835058055316244481 + systematicCode := BitVec.ofNat 64 18374039587120166667 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x370d. -/ +def normalizedWeightSixteenCandidateBucket_370d : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11330469509752832 + maskLow := BitVec.ofNat 64 288795529557639511 + maskHigh := BitVec.ofNat 64 687194767365 + systematicCode := BitVec.ofNat 64 14901150531292641037 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9096261882112000 + maskLow := BitVec.ofNat 64 21609120087 + maskHigh := BitVec.ofNat 64 687262007809 + systematicCode := BitVec.ofNat 64 14901203501928757005 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11330488837096448 + maskLow := BitVec.ofNat 64 74311597304119639 + maskHigh := BitVec.ofNat 64 87960930222085 + systematicCode := BitVec.ofNat 64 15913897476106630925 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9096281209455616 + maskLow := BitVec.ofNat 64 21609120087 + maskHigh := BitVec.ofNat 64 87960947524097 + systematicCode := BitVec.ofNat 64 15913944992050394893 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11332125219636224 + maskLow := BitVec.ofNat 64 72629344513622359 + maskHigh := BitVec.ofNat 64 22517998136852485 + systematicCode := BitVec.ofNat 64 17071322580257289997 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9097917591995392 + maskLow := BitVec.ofNat 64 21609120087 + maskHigh := BitVec.ofNat 64 22517998153762817 + systematicCode := BitVec.ofNat 64 17071370074893661965 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9026999058187264 + maskLow := BitVec.ofNat 64 21609120087 + maskHigh := BitVec.ofNat 64 2323928326223167493 + systematicCode := BitVec.ofNat 64 18153126977580906253 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9026999058449408 + maskLow := BitVec.ofNat 64 21609120087 + maskHigh := BitVec.ofNat 64 9227893366107144197 + systematicCode := BitVec.ofNat 64 18368452023344772877 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11332129514343424 + maskLow := BitVec.ofNat 64 290490976487670103 + maskHigh := BitVec.ofNat 64 11529215046068469765 + systematicCode := BitVec.ofNat 64 18373425844079507213 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9097921886702592 + maskLow := BitVec.ofNat 64 21609120087 + maskHigh := BitVec.ofNat 64 11529215046136104961 + systematicCode := BitVec.ofNat 64 18373478836190131981 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x370e. -/ +def normalizedWeightSixteenCandidateBucket_370e : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089857343825920 + maskLow := BitVec.ofNat 64 576743331221012887 + maskHigh := BitVec.ofNat 64 412316860425 + systematicCode := BitVec.ofNat 64 14829094041044465422 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711578740172800 + maskLow := BitVec.ofNat 64 38788989335 + maskHigh := BitVec.ofNat 64 412451143937 + systematicCode := BitVec.ofNat 64 14829147003090777870 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089785134688256 + maskLow := BitVec.ofNat 64 74310497792491927 + maskHigh := BitVec.ofNat 64 105553116266505 + systematicCode := BitVec.ofNat 64 15914180050594903822 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711506531035136 + maskLow := BitVec.ofNat 64 38788989335 + maskHigh := BitVec.ofNat 64 105553133568257 + systematicCode := BitVec.ofNat 64 15914226467010393870 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089341947750400 + maskLow := BitVec.ofNat 64 72347869536911767 + maskHigh := BitVec.ofNat 64 27021597764222985 + systematicCode := BitVec.ofNat 64 17071605154728851214 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711063344097280 + maskLow := BitVec.ofNat 64 38788989335 + maskHigh := BitVec.ofNat 64 27021597781067777 + systematicCode := BitVec.ofNat 64 17071651545575470862 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9786345566267392 + maskLow := BitVec.ofNat 64 38788989335 + maskHigh := BitVec.ofNat 64 2323928051345260553 + systematicCode := BitVec.ofNat 64 18153126973302781710 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9786345567551616 + maskLow := BitVec.ofNat 64 38788989335 + maskHigh := BitVec.ofNat 64 4620728539493171209 + systematicCode := BitVec.ofNat 64 18296677003812026126 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089337920970880 + maskLow := BitVec.ofNat 64 578721352639381911 + maskHigh := BitVec.ofNat 64 6917529027641081865 + systematicCode := BitVec.ofNat 64 18301369353848174350 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711059317317760 + maskLow := BitVec.ofNat 64 38788989335 + maskHigh := BitVec.ofNat 64 6917529027775825921 + systematicCode := BitVec.ofNat 64 18301422341663897358 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x3719. -/ +def normalizedWeightSixteenCandidateBucket_3719 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11330471925524480 + maskLow := BitVec.ofNat 64 288793364894126359 + maskHigh := BitVec.ofNat 64 35321811042561 + systematicCode := BitVec.ofNat 64 15765854853886523161 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9096264297883648 + maskLow := BitVec.ofNat 64 1103940882711 + maskHigh := BitVec.ofNat 64 35321878282249 + systematicCode := BitVec.ofNat 64 15765894630183352089 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11330471926694912 + maskLow := BitVec.ofNat 64 145241126771691799 + maskHigh := BitVec.ofNat 64 70643622084865 + systematicCode := BitVec.ofNat 64 15910532983359420185 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9096264299054080 + maskLow := BitVec.ofNat 64 1103940882711 + maskHigh := BitVec.ofNat 64 70643655901193 + systematicCode := BitVec.ofNat 64 15910570577779308313 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11332121193350144 + maskLow := BitVec.ofNat 64 1697650382541079 + maskHigh := BitVec.ofNat 64 1157425104234217729 + systematicCode := BitVec.ofNat 64 17936026851312351001 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9097913565709312 + maskLow := BitVec.ofNat 64 1103940882711 + maskHigh := BitVec.ofNat 64 1157425104234612737 + systematicCode := BitVec.ofNat 64 17936048009210050329 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9026990737196032 + maskLow := BitVec.ofNat 64 1103940882711 + maskHigh := BitVec.ofNat 64 1189055854742077697 + systematicCode := BitVec.ofNat 64 17937798672138975001 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9026995032163328 + maskLow := BitVec.ofNat 64 1103940882711 + maskHigh := BitVec.ofNat 64 9227876048799006977 + systematicCode := BitVec.ofNat 64 18368438829407352601 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11332116898647040 + maskLow := BitVec.ofNat 64 432354364749844759 + maskHigh := BitVec.ofNat 64 9259400833873740033 + systematicCode := BitVec.ofNat 64 18370061338699839257 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9097909271006208 + maskLow := BitVec.ofNat 64 1103940882711 + maskHigh := BitVec.ofNat 64 9259400833974405121 + systematicCode := BitVec.ofNat 64 18370101188009998105 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x371a. -/ +def normalizedWeightSixteenCandidateBucket_371a : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089856806987776 + maskLow := BitVec.ofNat 64 576742248889262359 + maskHigh := BitVec.ofNat 64 17729624998401 + systematicCode := BitVec.ofNat 64 15693798363638347546 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711578203334656 + maskLow := BitVec.ofNat 64 2203452514583 + maskHigh := BitVec.ofNat 64 17729759281157 + systematicCode := BitVec.ofNat 64 15693838131345372954 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089788087298048 + maskLow := BitVec.ofNat 64 145241109591826711 + maskHigh := BitVec.ofNat 64 70918499992065 + systematicCode := BitVec.ofNat 64 15910815557847693082 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711509483644928 + maskLow := BitVec.ofNat 64 2203452514583 + maskHigh := BitVec.ofNat 64 70918533808133 + systematicCode := BitVec.ofNat 64 15910852052739307290 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089341410912256 + maskLow := BitVec.ofNat 64 1416175405834519 + maskHigh := BitVec.ofNat 64 1161928703861588481 + systematicCode := BitVec.ofNat 64 17936309425783912218 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711062807259136 + maskLow := BitVec.ofNat 64 2203452514583 + maskHigh := BitVec.ofNat 64 1161928703861917697 + systematicCode := BitVec.ofNat 64 17936329479891859226 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9786341003143168 + maskLow := BitVec.ofNat 64 2203452514583 + maskHigh := BitVec.ofNat 64 1189038262556033537 + systematicCode := BitVec.ofNat 64 17937798667860850458 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9786362209534080 + maskLow := BitVec.ofNat 64 2203452514583 + maskHigh := BitVec.ofNat 64 4620693904876896769 + systematicCode := BitVec.ofNat 64 18296663809874605850 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089337384132736 + maskLow := BitVec.ofNat 64 720584740901560599 + maskHigh := BitVec.ofNat 64 4647714815446352385 + systematicCode := BitVec.ofNat 64 18298004848468506394 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711058780479616 + maskLow := BitVec.ofNat 64 2203452514583 + maskHigh := BitVec.ofNat 64 4647714815614126081 + systematicCode := BitVec.ofNat 64 18298044693483763482 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x371c. -/ +def normalizedWeightSixteenCandidateBucket_371c : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089856807995648 + maskLow := BitVec.ofNat 64 576742240299335959 + maskHigh := BitVec.ofNat 64 17867063952385 + systematicCode := BitVec.ofNat 64 15694363512614893340 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711578204342528 + maskLow := BitVec.ofNat 64 4402475778327 + maskHigh := BitVec.ofNat 64 17867198234627 + systematicCode := BitVec.ofNat 64 15694401081265370908 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089788088517248 + maskLow := BitVec.ofNat 64 288793339124334871 + maskHigh := BitVec.ofNat 64 35734127903745 + systematicCode := BitVec.ofNat 64 15766702577351341852 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711509484864128 + maskLow := BitVec.ofNat 64 4402475778327 + maskHigh := BitVec.ofNat 64 35734195142659 + systematicCode := BitVec.ofNat 64 15766739055063349020 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089341411920128 + maskLow := BitVec.ofNat 64 853225452421399 + maskHigh := BitVec.ofNat 64 1170935903116329985 + systematicCode := BitVec.ofNat 64 17936874566170654492 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711062808267008 + maskLow := BitVec.ofNat 64 4402475778327 + maskHigh := BitVec.ofNat 64 1170935903116527617 + systematicCode := BitVec.ofNat 64 17936890230822156060 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9786341004151040 + maskLow := BitVec.ofNat 64 4402475778327 + maskHigh := BitVec.ofNat 64 1189003078183945217 + systematicCode := BitVec.ofNat 64 17937796468871280412 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9786362209257728 + maskLow := BitVec.ofNat 64 4402475778327 + maskHigh := BitVec.ofNat 64 2323858232356897793 + systematicCode := BitVec.ofNat 64 18153111580375791388 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089337385140608 + maskLow := BitVec.ofNat 64 864699928977424663 + maskHigh := BitVec.ofNat 64 2341871806232658945 + systematicCode := BitVec.ofNat 64 18153891859449460508 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711058781487488 + maskLow := BitVec.ofNat 64 4402475778327 + maskHigh := BitVec.ofNat 64 2341871806433986561 + systematicCode := BitVec.ofNat 64 18153929513997973276 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x371f. -/ +def normalizedWeightSixteenCandidateBucket_371f : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9928078950203648 + maskLow := BitVec.ofNat 64 8800522305815 + maskHigh := BitVec.ofNat 64 1184446701998442497 + systematicCode := BitVec.ofNat 64 17936969704897197855 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9852723981779200 + maskLow := BitVec.ofNat 64 8800522305815 + maskHigh := BitVec.ofNat 64 1188950301625812737 + systematicCode := BitVec.ofNat 64 17937719198064523039 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36104663606558976 + maskLow := BitVec.ofNat 64 7701010678039 + maskHigh := BitVec.ofNat 64 1188950301625812993 + systematicCode := BitVec.ofNat 64 17937722229254076191 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9852724787036416 + maskLow := BitVec.ofNat 64 8800522305815 + maskHigh := BitVec.ofNat 64 2323857407723176973 + systematicCode := BitVec.ofNat 64 18153047503507240735 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36104664411816192 + maskLow := BitVec.ofNat 64 4454015402263 + maskHigh := BitVec.ofNat 64 2323857407723177985 + systematicCode := BitVec.ofNat 64 18153050586235615007 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18050167277109632 + maskLow := BitVec.ofNat 64 4405697020183 + maskHigh := BitVec.ofNat 64 2341871806232658945 + systematicCode := BitVec.ofNat 64 18153891712496121631 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9852724787052672 + maskLow := BitVec.ofNat 64 8800522305815 + maskHigh := BitVec.ofNat 64 4620693217682129419 + systematicCode := BitVec.ofNat 64 18296597542572865311 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36104664411832448 + maskLow := BitVec.ofNat 64 2246402212119 + maskHigh := BitVec.ofNat 64 4620693217682130945 + systematicCode := BitVec.ofNat 64 18296602815767983903 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18050167276101760 + maskLow := BitVec.ofNat 64 2206136893719 + maskHigh := BitVec.ofNat 64 4647714815446352385 + systematicCode := BitVec.ofNat 64 18298004692958656287 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9852728008311040 + maskLow := BitVec.ofNat 64 8800522305815 + maskHigh := BitVec.ofNat 64 9227875636482146567 + systematicCode := BitVec.ofNat 64 18368372557827487519 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36104667633090816 + maskLow := BitVec.ofNat 64 1129710715159 + maskHigh := BitVec.ofNat 64 9227875636482148353 + systematicCode := BitVec.ofNat 64 18368378930517456671 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11338714098437120 + maskLow := BitVec.ofNat 64 1105551524119 + maskHigh := BitVec.ofNat 64 9259400833873740033 + systematicCode := BitVec.ofNat 64 18370061183173211935 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9928074923952512 + maskLow := BitVec.ofNat 64 8800522305815 + maskHigh := BitVec.ofNat 64 16176929861514823681 + systematicCode := BitVec.ofNat 64 18374119061196322591 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x3729. -/ +def normalizedWeightSixteenCandidateBucket_3729 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11329960555980800 + maskLow := BitVec.ofNat 64 288232613965005079 + maskHigh := BitVec.ofNat 64 9007336693760001 + systematicCode := BitVec.ofNat 64 16918793950410979113 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9095752928339968 + maskLow := BitVec.ofNat 64 281479407010071 + maskHigh := BitVec.ofNat 64 9007336760803849 + systematicCode := BitVec.ofNat 64 16918816066071770921 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11329960557151232 + maskLow := BitVec.ofNat 64 144119624912404759 + maskHigh := BitVec.ofNat 64 18014673387454465 + systematicCode := BitVec.ofNat 64 17063472079883876137 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9095752929510400 + maskLow := BitVec.ofNat 64 281479407010071 + maskHigh := BitVec.ofNat 64 18014673420944393 + systematicCode := BitVec.ofNat 64 17063492013667727145 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11329973441266688 + maskLow := BitVec.ofNat 64 2258401313751319 + maskHigh := BitVec.ofNat 64 1152939096792956929 + systematicCode := BitVec.ofNat 64 17931540856520718121 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9095765813625856 + maskLow := BitVec.ofNat 64 281479407010071 + maskHigh := BitVec.ofNat 64 1152939096793417217 + systematicCode := BitVec.ofNat 64 17931547647905183529 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9024842985112576 + maskLow := BitVec.ofNat 64 281479407010071 + maskHigh := BitVec.ofNat 64 1180083839859490817 + systematicCode := BitVec.ofNat 64 17936969662115952425 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9025392740926464 + maskLow := BitVec.ofNat 64 281479407010071 + maskHigh := BitVec.ofNat 64 9223390041357746177 + systematicCode := BitVec.ofNat 64 18363935230049466153 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11329423685716992 + maskLow := BitVec.ofNat 64 434597368471552279 + maskHigh := BitVec.ofNat 64 9223512774343196673 + systematicCode := BitVec.ofNat 64 18365575331259561769 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9095216058076160 + maskLow := BitVec.ofNat 64 281479407010071 + maskHigh := BitVec.ofNat 64 9223512774444318721 + systematicCode := BitVec.ofNat 64 18365597588652111657 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x372a. -/ +def normalizedWeightSixteenCandidateBucket_372a : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089720441776128 + maskLow := BitVec.ofNat 64 576461873426268439 + maskHigh := BitVec.ofNat 64 4503737066455041 + systematicCode := BitVec.ofNat 64 16846737460162803498 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711441838123008 + maskLow := BitVec.ofNat 64 562954384769303 + maskHigh := BitVec.ofNat 64 4503737200541957 + systematicCode := BitVec.ofNat 64 16846759567233791786 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089719904692224 + maskLow := BitVec.ofNat 64 144119607733584151 + maskHigh := BitVec.ofNat 64 18014948265426945 + systematicCode := BitVec.ofNat 64 17063754654372149034 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711441301039104 + maskLow := BitVec.ofNat 64 562954384769303 + maskHigh := BitVec.ofNat 64 18014948298851333 + systematicCode := BitVec.ofNat 64 17063773488627726122 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089716415244288 + maskLow := BitVec.ofNat 64 2257301803172119 + maskHigh := BitVec.ofNat 64 1152956688979066881 + systematicCode := BitVec.ofNat 64 17931823431008991018 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711437811591168 + maskLow := BitVec.ofNat 64 562954384769303 + maskHigh := BitVec.ofNat 64 1152956688979461377 + systematicCode := BitVec.ofNat 64 17931829122865182506 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9785693268387840 + maskLow := BitVec.ofNat 64 562954384769303 + maskHigh := BitVec.ofNat 64 1175580240232185857 + systematicCode := BitVec.ofNat 64 17936968562621167402 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9788407687708800 + maskLow := BitVec.ofNat 64 562954384769303 + maskHigh := BitVec.ofNat 64 4611721889994375169 + systematicCode := BitVec.ofNat 64 18292160210516719402 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089201018921088 + maskLow := BitVec.ofNat 64 722827744624312599 + maskHigh := BitVec.ofNat 64 4611826755915874305 + systematicCode := BitVec.ofNat 64 18293518841028228906 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9710922415267968 + maskLow := BitVec.ofNat 64 562954384769303 + maskHigh := BitVec.ofNat 64 4611826756084039681 + systematicCode := BitVec.ofNat 64 18293541094125877034 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x372c. -/ +def normalizedWeightSixteenCandidateBucket_372c : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089720442784000 + maskLow := BitVec.ofNat 64 576461864838430999 + maskHigh := BitVec.ofNat 64 4503874505539585 + systematicCode := BitVec.ofNat 64 16847302609139349292 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711441839130880 + maskLow := BitVec.ofNat 64 1125904340287767 + maskHigh := BitVec.ofNat 64 4503874639495427 + systematicCode := BitVec.ofNat 64 16847322517153789740 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089719905911424 + maskLow := BitVec.ofNat 64 288232588198347031 + maskHigh := BitVec.ofNat 64 9007749010817025 + systematicCode := BitVec.ofNat 64 16919641673875797804 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711441302258304 + maskLow := BitVec.ofNat 64 1125904340287767 + maskHigh := BitVec.ofNat 64 9007749077664259 + systematicCode := BitVec.ofNat 64 16919660490951767852 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089716416252160 + maskLow := BitVec.ofNat 64 2255102782013719 + maskHigh := BitVec.ofNat 64 1152991873351286785 + systematicCode := BitVec.ofNat 64 17932388579952113452 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711437812599040 + maskLow := BitVec.ofNat 64 1125904340287767 + maskHigh := BitVec.ofNat 64 1152991873351549697 + systematicCode := BitVec.ofNat 64 17932392064228800300 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9785693269395712 + maskLow := BitVec.ofNat 64 1125904340287767 + maskHigh := BitVec.ofNat 64 1166573040977575937 + systematicCode := BitVec.ofNat 64 17936405612701431596 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9788407687432448 + maskLow := BitVec.ofNat 64 1125904340287767 + maskHigh := BitVec.ofNat 64 2305914202591854593 + systematicCode := BitVec.ofNat 64 18148607981017904940 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089201019928960 + maskLow := BitVec.ofNat 64 866942932702265623 + maskHigh := BitVec.ofNat 64 2305983746702311425 + systematicCode := BitVec.ofNat 64 18149405852009183020 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9710922416275840 + maskLow := BitVec.ofNat 64 1125904340287767 + maskHigh := BitVec.ofNat 64 2305983746903900161 + systematicCode := BitVec.ofNat 64 18149425914640086828 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x372f. -/ +def normalizedWeightSixteenCandidateBucket_372f : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9926953937207552 + maskLow := BitVec.ofNat 64 2251804251324695 + maskHigh := BitVec.ofNat 64 1153044649909682177 + systematicCode := BitVec.ofNat 64 17932448444633790255 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9851667151388928 + maskLow := BitVec.ofNat 64 2251804251324695 + maskHigh := BitVec.ofNat 64 1153062242095661057 + systematicCode := BitVec.ofNat 64 17933233259612157743 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36103606776168704 + maskLow := BitVec.ofNat 64 1970329274614039 + maskHigh := BitVec.ofNat 64 1153062242095726593 + systematicCode := BitVec.ofNat 64 17933236290801710895 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9851770230554880 + maskLow := BitVec.ofNat 64 2251804251324695 + maskHigh := BitVec.ofNat 64 2305913377958133773 + systematicCode := BitVec.ofNat 64 18148561496066963247 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36103709855334656 + maskLow := BitVec.ofNat 64 1125955884089623 + maskHigh := BitVec.ofNat 64 2305913377958395905 + systematicCode := BitVec.ofNat 64 18148564647513765679 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18049621816263040 + maskLow := BitVec.ofNat 64 1125907565707543 + maskHigh := BitVec.ofNat 64 2305983746702311425 + systematicCode := BitVec.ofNat 64 18149405773774272303 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9851770230571136 + maskLow := BitVec.ofNat 64 2251804251324695 + maskHigh := BitVec.ofNat 64 4611721202799607819 + systematicCode := BitVec.ofNat 64 18292111535132587823 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36103709855350912 + maskLow := BitVec.ofNat 64 562997340733719 + maskHigh := BitVec.ofNat 64 4611721202800001025 + systematicCode := BitVec.ofNat 64 18292116877046134575 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18049621815255168 + maskLow := BitVec.ofNat 64 562957075415319 + maskHigh := BitVec.ofNat 64 4611826755915874305 + systematicCode := BitVec.ofNat 64 18293518754236806959 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9852182547464448 + maskLow := BitVec.ofNat 64 2251804251324695 + maskHigh := BitVec.ofNat 64 9223389629040885767 + systematicCode := BitVec.ofNat 64 18363886550387210031 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36104122172244224 + maskLow := BitVec.ofNat 64 281505184153879 + maskHigh := BitVec.ofNat 64 9223389629041344513 + systematicCode := BitVec.ofNat 64 18363892991795607343 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11338202728893440 + maskLow := BitVec.ofNat 64 281481024962839 + maskHigh := BitVec.ofNat 64 9223512774343196673 + systematicCode := BitVec.ofNat 64 18365575244451362607 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9926438541412736 + maskLow := BitVec.ofNat 64 2251804251324695 + maskHigh := BitVec.ofNat 64 16141041801984737281 + systematicCode := BitVec.ofNat 64 18374118992746329903 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x3807. -/ +def normalizedWeightSixteenCandidateBucket_3807 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.node + (.leaf + { patternClass := .twoE8 + affineCode := BitVec.ofNat 56 2393089457029248 + maskLow := BitVec.ofNat 64 76578790414811423 + maskHigh := BitVec.ofNat 64 15 + systematicCode := BitVec.ofNat 64 9693298291795048455 }) + (.leaf + { patternClass := .twoE8 + affineCode := BitVec.ofNat 56 18032542850515072 + maskLow := BitVec.ofNat 64 64693010719 + maskHigh := BitVec.ofNat 64 17829889 + systematicCode := BitVec.ofNat 64 12729591774339872775 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10274115990864512 + maskLow := BitVec.ofNat 64 612507146071900447 + maskHigh := BitVec.ofNat 64 24585 + systematicCode := BitVec.ofNat 64 11356818728560375815 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11400015897708800 + maskLow := BitVec.ofNat 64 306262371410706719 + maskHigh := BitVec.ofNat 64 40965 + systematicCode := BitVec.ofNat 64 11428875218774931463 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11400015897725056 + maskLow := BitVec.ofNat 64 153139984080109855 + maskHigh := BitVec.ofNat 64 49155 + systematicCode := BitVec.ofNat 64 11429435961081608199 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10274388721287808 + maskLow := BitVec.ofNat 64 581105093982617887 + maskHigh := BitVec.ofNat 64 6291465 + systematicCode := BitVec.ofNat 64 12514243832694323207 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11400288628132096 + maskLow := BitVec.ofNat 64 292804349086728479 + maskHigh := BitVec.ofNat 64 10485765 + systematicCode := BitVec.ofNat 64 12586300322925590535 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11400288628148352 + maskLow := BitVec.ofNat 64 148653976638783775 + maskHigh := BitVec.ofNat 64 12582915 + systematicCode := BitVec.ofNat 64 12586861065265690631 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18102930687428736 + maskLow := BitVec.ofNat 64 864691141608538399 + maskHigh := BitVec.ofNat 64 18882561 + systematicCode := BitVec.ofNat 64 12730439704768624647 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18102930687412480 + maskLow := BitVec.ofNat 64 720575962122617119 + maskHigh := BitVec.ofNat 64 20987905 + systematicCode := BitVec.ofNat 64 12731004853711878151 }) + ) + ) + ) + ) + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18094134594388608 + maskLow := BitVec.ofNat 64 432345603150774559 + maskHigh := BitVec.ofNat 64 25198593 + systematicCode := BitVec.ofNat 64 12731287423905314823 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18102911511070848 + maskLow := BitVec.ofNat 64 54043208681849119 + maskHigh := BitVec.ofNat 64 34611201 + systematicCode := BitVec.ofNat 64 12945768027458320391 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18102638780647552 + maskLow := BitVec.ofNat 64 211119385936159 + maskHigh := BitVec.ofNat 64 35655681 + systematicCode := BitVec.ofNat 64 12946609084865656839 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18102911511054592 + maskLow := BitVec.ofNat 64 45036018017042719 + maskHigh := BitVec.ofNat 64 68173825 + systematicCode := BitVec.ofNat 64 13089885414524008455 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18102638780631296 + maskLow := BitVec.ofNat 64 175943603781919 + maskHigh := BitVec.ofNat 64 71307265 + systematicCode := BitVec.ofNat 64 13091287222861510663 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10274407897645696 + maskLow := BitVec.ofNat 64 108227133108715807 + maskHigh := BitVec.ofNat 64 100663305 + systematicCode := BitVec.ofNat 64 13092956359142291463 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18094115418030720 + maskLow := BitVec.ofNat 64 27021636687429919 + maskHigh := BitVec.ofNat 64 135299073 + systematicCode := BitVec.ofNat 64 13161944103778662407 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18093842687607424 + maskLow := BitVec.ofNat 64 105592039473439 + maskHigh := BitVec.ofNat 64 142610433 + systematicCode := BitVec.ofNat 64 13163626287581247495 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11400307804489984 + maskLow := BitVec.ofNat 64 90142365855056159 + maskHigh := BitVec.ofNat 64 167772165 + systematicCode := BitVec.ofNat 64 13165012853651748871 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11400307804506240 + maskLow := BitVec.ofNat 64 81099982228226335 + maskHigh := BitVec.ofNat 64 201326595 + systematicCode := BitVec.ofNat 64 13165573604548229127 }) + ) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x3819. -/ +def normalizedWeightSixteenCandidateBucket_3819 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085390304150528 + maskLow := BitVec.ofNat 64 306244813584404759 + maskHigh := BitVec.ofNat 64 35201551990785 + systematicCode := BitVec.ofNat 64 15763898822885259289 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148559793587200 + maskLow := BitVec.ofNat 64 140742051827991 + maskHigh := BitVec.ofNat 64 35201623261193 + systematicCode := BitVec.ofNat 64 15763924352591869977 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085390302980096 + maskLow := BitVec.ofNat 64 153122426253807895 + maskHigh := BitVec.ofNat 64 70377334145025 + systematicCode := BitVec.ofNat 64 15907451052384204825 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148559792416768 + maskLow := BitVec.ofNat 64 140742051827991 + maskHigh := BitVec.ofNat 64 70377369763849 + systematicCode := BitVec.ofNat 64 15907474383101114393 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9359666025333760 + maskLow := BitVec.ofNat 64 140742051827991 + maskHigh := BitVec.ofNat 64 76561219435134977 + systematicCode := BitVec.ofNat 64 17431680172873889817 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36046458229097472 + maskLow := BitVec.ofNat 64 432363160977084695 + maskHigh := BitVec.ofNat 64 108086391056924673 + systematicCode := BitVec.ofNat 64 17433326909858002969 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2533343814484992 + maskLow := BitVec.ofNat 64 140742051827991 + maskHigh := BitVec.ofNat 64 108086391157559297 + systematicCode := BitVec.ofNat 64 17433352465534564377 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36046462490510336 + maskLow := BitVec.ofNat 64 27039194513740055 + maskHigh := BitVec.ofNat 64 580964351930826753 + systematicCode := BitVec.ofNat 64 17863983589731350553 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2533348075897856 + maskLow := BitVec.ofNat 64 140742051827991 + maskHigh := BitVec.ofNat 64 580964351937089537 + systematicCode := BitVec.ofNat 64 17864000349449107481 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9359661764185088 + maskLow := BitVec.ofNat 64 140742051827991 + maskHigh := BitVec.ofNat 64 612595102438686721 + systematicCode := BitVec.ofNat 64 17865741078320003097 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x381a. -/ +def normalizedWeightSixteenCandidateBucket_381a : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10208969926722560 + maskLow := BitVec.ofNat 64 612489571065733399 + maskHigh := BitVec.ofNat 64 17609365929985 + systematicCode := BitVec.ofNat 64 15691840133647382554 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9650418019812352 + maskLow := BitVec.ofNat 64 70373307654423 + maskHigh := BitVec.ofNat 64 17609508519941 + systematicCode := BitVec.ofNat 64 15691867862343694362 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11334869833778176 + maskLow := BitVec.ofNat 64 153122409073942807 + maskHigh := BitVec.ofNat 64 70373039161345 + systematicCode := BitVec.ofNat 64 15907168477895800858 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9659214113047552 + maskLow := BitVec.ofNat 64 70373307654423 + maskHigh := BitVec.ofNat 64 70373074796549 + systematicCode := BitVec.ofNat 64 15907192908107560986 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9593243415380992 + maskLow := BitVec.ofNat 64 70373307654423 + maskHigh := BitVec.ofNat 64 153122408805449729 + systematicCode := BitVec.ofNat 64 17504019237576718362 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11335449922800768 + maskLow := BitVec.ofNat 64 720593537128800535 + maskHigh := BitVec.ofNat 64 180143985094836225 + systematicCode := BitVec.ofNat 64 17505383408679270426 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9659794202070144 + maskLow := BitVec.ofNat 64 70373307654423 + maskHigh := BitVec.ofNat 64 180143985262596097 + systematicCode := BitVec.ofNat 64 17505411159084054554 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11335470963526784 + maskLow := BitVec.ofNat 64 45053593023226135 + maskHigh := BitVec.ofNat 64 585467951558180865 + systematicCode := BitVec.ofNat 64 17864263969491400730 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9659815242796160 + maskLow := BitVec.ofNat 64 70373307654423 + maskHigh := BitVec.ofNat 64 585467951568654337 + systematicCode := BitVec.ofNat 64 17864282923937380378 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9593239357146112 + maskLow := BitVec.ofNat 64 70373307654423 + maskHigh := BitVec.ofNat 64 612577510252625921 + systematicCode := BitVec.ofNat 64 17865741074008193050 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x381c. -/ +def normalizedWeightSixteenCandidateBucket_381c : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10208969926771328 + maskLow := BitVec.ofNat 64 612489562475806999 + maskHigh := BitVec.ofNat 64 17600775987201 + systematicCode := BitVec.ofNat 64 15691274984670574620 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9650418019861120 + maskLow := BitVec.ofNat 64 35188935573783 + maskHigh := BitVec.ofNat 64 17600918585347 + systematicCode := BitVec.ofNat 64 15691304912356587548 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11334869833615616 + maskLow := BitVec.ofNat 64 306244787814613271 + maskHigh := BitVec.ofNat 64 35188667064321 + systematicCode := BitVec.ofNat 64 15763051099420047388 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9659214112884992 + maskLow := BitVec.ofNat 64 35188935573783 + maskHigh := BitVec.ofNat 64 35188738359299 + systematicCode := BitVec.ofNat 64 15763079927611209756 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9593243415218432 + maskLow := BitVec.ofNat 64 35188935573783 + maskHigh := BitVec.ofNat 64 306244787546103809 + systematicCode := BitVec.ofNat 64 17648695176549054492 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11335449922914560 + maskLow := BitVec.ofNat 64 864708725204664599 + maskHigh := BitVec.ofNat 64 324259173170683905 + systematicCode := BitVec.ofNat 64 17649496397765425180 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9659794202183936 + maskLow := BitVec.ofNat 64 35188935573783 + maskHigh := BitVec.ofNat 64 324259173372006401 + systematicCode := BitVec.ofNat 64 17649526355749713948 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11335470963640576 + maskLow := BitVec.ofNat 64 54060792277975319 + maskHigh := BitVec.ofNat 64 594475150812913665 + systematicCode := BitVec.ofNat 64 17864824720455120924 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9659815242909952 + maskLow := BitVec.ofNat 64 35188935573783 + maskHigh := BitVec.ofNat 64 594475150825492481 + systematicCode := BitVec.ofNat 64 17864845882480605212 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9593239357227392 + maskLow := BitVec.ofNat 64 35188935573783 + maskHigh := BitVec.ofNat 64 612542325880528897 + systematicCode := BitVec.ofNat 64 17865738874951251996 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x381f. -/ +def normalizedWeightSixteenCandidateBucket_381f : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089444641147136 + maskLow := BitVec.ofNat 64 140767821660439 + maskHigh := BitVec.ofNat 64 76561193665302529 + systematicCode := BitVec.ofNat 64 17431631363370596383 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711166037494016 + maskLow := BitVec.ofNat 64 17596749545751 + maskHigh := BitVec.ofNat 64 76561193665331207 + systematicCode := BitVec.ofNat 64 17431638128985651231 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089444641112704 + maskLow := BitVec.ofNat 64 70416257351959 + maskHigh := BitVec.ofNat 64 153122387330600961 + systematicCode := BitVec.ofNat 64 17503970428107044895 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711166037459584 + maskLow := BitVec.ofNat 64 17596749545751 + maskHigh := BitVec.ofNat 64 153122387330613259 + systematicCode := BitVec.ofNat 64 17503976102783629343 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089444640901376 + maskLow := BitVec.ofNat 64 35240475197719 + maskHigh := BitVec.ofNat 64 306244774661197825 + systematicCode := BitVec.ofNat 64 17648648557546518559 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711166037248256 + maskLow := BitVec.ofNat 64 17596749545751 + maskHigh := BitVec.ofNat 64 306244774661201933 + systematicCode := BitVec.ofNat 64 17648652041823205407 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9786512917203200 + maskLow := BitVec.ofNat 64 17596749545751 + maskHigh := BitVec.ofNat 64 540431955284463617 + systematicCode := BitVec.ofNat 64 17650435900973791263 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9786533957929216 + maskLow := BitVec.ofNat 64 17596749545751 + maskHigh := BitVec.ofNat 64 607985949695021057 + systematicCode := BitVec.ofNat 64 17864912110876112927 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089440582910336 + maskLow := BitVec.ofNat 64 246295168123159 + maskHigh := BitVec.ofNat 64 612489549322391553 + systematicCode := BitVec.ofNat 64 17865665777862653983 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711161979257216 + maskLow := BitVec.ofNat 64 17596749545751 + maskHigh := BitVec.ofNat 64 612489549322444801 + systematicCode := BitVec.ofNat 64 17865672646555351071 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x3829. -/ +def normalizedWeightSixteenCandidateBucket_3829 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085356212847616 + maskLow := BitVec.ofNat 64 288300783820144919 + maskHigh := BitVec.ofNat 64 9007216442998785 + systematicCode := BitVec.ofNat 64 16916837919409715241 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148525702284288 + maskLow := BitVec.ofNat 64 36028801583481111 + maskHigh := BitVec.ofNat 64 9007216501735433 + systematicCode := BitVec.ofNat 64 16916845788480288809 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085356211677184 + maskLow := BitVec.ofNat 64 144150411372200215 + maskHigh := BitVec.ofNat 64 18014407107805185 + systematicCode := BitVec.ofNat 64 17060390148908660777 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148525701113856 + maskLow := BitVec.ofNat 64 36028801583481111 + maskHigh := BitVec.ofNat 64 18014407132979209 + systematicCode := BitVec.ofNat 64 17060395818989533225 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9359631934030848 + maskLow := BitVec.ofNat 64 36028801583481111 + maskHigh := BitVec.ofNat 64 72075212002164737 + systematicCode := BitVec.ofNat 64 17427176573516003369 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36046424137794560 + maskLow := BitVec.ofNat 64 436849168419455255 + maskHigh := BitVec.ofNat 64 72198331534671873 + systematicCode := BitVec.ofNat 64 17428840902417725481 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2533309723182080 + maskLow := BitVec.ofNat 64 36028801583481111 + maskHigh := BitVec.ofNat 64 72198331627995137 + systematicCode := BitVec.ofNat 64 17428848866176677929 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2533859445441536 + maskLow := BitVec.ofNat 64 36028801583481111 + maskHigh := BitVec.ofNat 64 576478344490541057 + systematicCode := BitVec.ofNat 64 17859491192185436201 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36046973860054016 + maskLow := BitVec.ofNat 64 4609157308154135 + maskHigh := BitVec.ofNat 64 576478344497856513 + systematicCode := BitVec.ofNat 64 17859497560580503593 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9359082212035584 + maskLow := BitVec.ofNat 64 36028801583481111 + maskHigh := BitVec.ofNat 64 603623087564390401 + systematicCode := BitVec.ofNat 64 17864912068296980521 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x382a. -/ +def normalizedWeightSixteenCandidateBucket_382a : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10208424465875968 + maskLow := BitVec.ofNat 64 576601511537213719 + maskHigh := BitVec.ofNat 64 4503616811433985 + systematicCode := BitVec.ofNat 64 16844779230171838506 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9649872558965760 + maskLow := BitVec.ofNat 64 18014403075047703 + maskHigh := BitVec.ofNat 64 4503616941490181 + systematicCode := BitVec.ofNat 64 16844789298232113194 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11334324372931584 + maskLow := BitVec.ofNat 64 144150394193379607 + maskHigh := BitVec.ofNat 64 18014402808643585 + systematicCode := BitVec.ofNat 64 17060107574420256810 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9658668652200960 + maskLow := BitVec.ofNat 64 18014403075047703 + maskHigh := BitVec.ofNat 64 18014402838011909 + systematicCode := BitVec.ofNat 64 17060114343995979818 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9592697954534400 + maskLow := BitVec.ofNat 64 18014403075047703 + maskHigh := BitVec.ofNat 64 144150393926975489 + systematicCode := BitVec.ofNat 64 17499515638218831914 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11333813540260992 + maskLow := BitVec.ofNat 64 725079544572215575 + maskHigh := BitVec.ofNat 64 144255925568405505 + systematicCode := BitVec.ofNat 64 17500897401238992938 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9658157819530368 + maskLow := BitVec.ofNat 64 18014403075047703 + maskHigh := BitVec.ofNat 64 144255925733031937 + systematicCode := BitVec.ofNat 64 17500907559726168106 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9660872073186432 + maskLow := BitVec.ofNat 64 18014403075047703 + maskHigh := BitVec.ofNat 64 576495936676601857 + systematicCode := BitVec.ofNat 64 17859772671457048618 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11336527793917056 + maskLow := BitVec.ofNat 64 4679526053380375 + maskHigh := BitVec.ofNat 64 576495936679706625 + systematicCode := BitVec.ofNat 64 17859777936062363690 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9592182526755840 + maskLow := BitVec.ofNat 64 18014403075047703 + maskHigh := BitVec.ofNat 64 599119487932825601 + systematicCode := BitVec.ofNat 64 17864910968768509994 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x382c. -/ +def normalizedWeightSixteenCandidateBucket_382c : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10208424465924736 + maskLow := BitVec.ofNat 64 576601502949376279 + maskHigh := BitVec.ofNat 64 4503608219402241 + systematicCode := BitVec.ofNat 64 16844214081195030572 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9649872559014528 + maskLow := BitVec.ofNat 64 9007203822403863 + maskHigh := BitVec.ofNat 64 4503608351555587 + systematicCode := BitVec.ofNat 64 16844226348245006380 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11334324372769024 + maskLow := BitVec.ofNat 64 288300758053486871 + maskHigh := BitVec.ofNat 64 9007203551805441 + systematicCode := BitVec.ofNat 64 16915990195944503340 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9658668652038400 + maskLow := BitVec.ofNat 64 9007203822403863 + maskHigh := BitVec.ofNat 64 9007203616833539 + systematicCode := BitVec.ofNat 64 16916001363499628588 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9592697954371840 + maskLow := BitVec.ofNat 64 9007203822403863 + maskHigh := BitVec.ofNat 64 288300757782888449 + systematicCode := BitVec.ofNat 64 17644191577191168044 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11333813540374784 + maskLow := BitVec.ofNat 64 869194732650168599 + maskHigh := BitVec.ofNat 64 288371113642164225 + systematicCode := BitVec.ofNat 64 17645010390325147692 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9658157819644160 + maskLow := BitVec.ofNat 64 9007203822403863 + maskHigh := BitVec.ofNat 64 288371113842442241 + systematicCode := BitVec.ofNat 64 17645022756391827500 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9660872073300224 + maskLow := BitVec.ofNat 64 9007203822403863 + maskHigh := BitVec.ofNat 64 576531121048698881 + systematicCode := BitVec.ofNat 64 17860335621443893292 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11336527794030848 + maskLow := BitVec.ofNat 64 4714710427566359 + maskHigh := BitVec.ofNat 64 576531121049698305 + systematicCode := BitVec.ofNat 64 17860338686992660524 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9592182526837120 + maskLow := BitVec.ofNat 64 9007203822403863 + maskHigh := BitVec.ofNat 64 590112288675987457 + systematicCode := BitVec.ofNat 64 17864348018781403180 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x382f. -/ +def normalizedWeightSixteenCandidateBucket_382f : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089717371570432 + maskLow := BitVec.ofNat 64 36028827360624919 + maskHigh := BitVec.ofNat 64 72075186225020929 + systematicCode := BitVec.ofNat 64 17427145424648747055 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711438767917312 + maskLow := BitVec.ofNat 64 4503604199227671 + maskHigh := BitVec.ofNat 64 72075186232360967 + systematicCode := BitVec.ofNat 64 17427152121545373743 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089717371536000 + maskLow := BitVec.ofNat 64 18014446031012119 + maskHigh := BitVec.ofNat 64 144150372448993281 + systematicCode := BitVec.ofNat 64 17499484489385195567 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711438767882880 + maskLow := BitVec.ofNat 64 4503604199227671 + maskHigh := BitVec.ofNat 64 144150372452139019 + systematicCode := BitVec.ofNat 64 17499490095343351855 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089717371324672 + maskLow := BitVec.ofNat 64 9007255366205719 + maskHigh := BitVec.ofNat 64 288300744896937985 + systematicCode := BitVec.ofNat 64 17644162618824669231 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711438767671552 + maskLow := BitVec.ofNat 64 4503604199227671 + maskHigh := BitVec.ofNat 64 288300744897986573 + systematicCode := BitVec.ofNat 64 17644166034382927919 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9785694725933312 + maskLow := BitVec.ofNat 64 4503604199227671 + maskHigh := BitVec.ofNat 64 504543895754899457 + systematicCode := BitVec.ofNat 64 17650435832523798575 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9788408979589376 + maskLow := BitVec.ofNat 64 4503604199227671 + maskHigh := BitVec.ofNat 64 576583897606782977 + systematicCode := BitVec.ofNat 64 17860390850612705327 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089201943789952 + maskLow := BitVec.ofNat 64 63050399355044119 + maskHigh := BitVec.ofNat 64 576601489792827393 + systematicCode := BitVec.ofNat 64 17861179839410288687 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9710923340136832 + maskLow := BitVec.ofNat 64 4503604199227671 + maskHigh := BitVec.ofNat 64 576601489806458881 + systematicCode := BitVec.ofNat 64 17861186708102985775 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x3831. -/ +def normalizedWeightSixteenCandidateBucket_3831 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9359628471632896 + maskLow := BitVec.ofNat 64 576460756883669271 + maskHigh := BitVec.ofNat 64 4521217717436417 + systematicCode := BitVec.ofNat 64 16850715821347321905 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2533313718256640 + maskLow := BitVec.ofNat 64 576460756883669271 + maskHigh := BitVec.ofNat 64 4644337138794497 + systematicCode := BitVec.ofNat 64 16852382590596167729 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36046428132869120 + maskLow := BitVec.ofNat 64 99079196382396695 + maskHigh := BitVec.ofNat 64 4644337249943553 + systematicCode := BitVec.ofNat 64 16852388924632021041 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2533859179103232 + maskLow := BitVec.ofNat 64 576460756883669271 + maskHigh := BitVec.ofNat 64 36046389221810177 + systematicCode := BitVec.ofNat 64 17283039235975559217 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36046973593715712 + maskLow := BitVec.ofNat 64 72163151734440215 + maskHigh := BitVec.ofNat 64 36046389339226113 + systematicCode := BitVec.ofNat 64 17283045638729840689 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148522239886336 + maskLow := BitVec.ofNat 64 576460756883669271 + maskHigh := BitVec.ofNat 64 144115205259935753 + systematicCode := BitVec.ofNat 64 17493297744691214385 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085352750449664 + maskLow := BitVec.ofNat 64 18084806193643799 + maskHigh := BitVec.ofNat 64 144115205389942785 + systematicCode := BitVec.ofNat 64 17493307433446422577 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9148522238715904 + maskLow := BitVec.ofNat 64 576460756883669271 + maskHigh := BitVec.ofNat 64 288230384743751689 + systematicCode := BitVec.ofNat 64 17636847775200458801 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18085352749279232 + maskLow := BitVec.ofNat 64 9042422566813975 + maskHigh := BitVec.ofNat 64 288230384875864065 + systematicCode := BitVec.ofNat 64 17636859662945368113 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9359083011050496 + maskLow := BitVec.ofNat 64 576460756883669271 + maskHigh := BitVec.ofNat 64 468515098869104641 + systematicCode := BitVec.ofNat 64 17650433633736341553 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x3832. -/ +def normalizedWeightSixteenCandidateBucket_3832 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9592710738772992 + maskLow := BitVec.ofNat 64 288230380748734743 + maskHigh := BitVec.ofNat 64 9042405168775169 + systematicCode := BitVec.ofNat 64 16923054886050150450 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9658166076017792 + maskLow := BitVec.ofNat 64 288230380748734743 + maskHigh := BitVec.ofNat 64 9147936770359297 + systematicCode := BitVec.ofNat 64 16924440188928997426 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11333821796748416 + maskLow := BitVec.ofNat 64 117093594908655895 + maskHigh := BitVec.ofNat 64 9147936810205185 + systematicCode := BitVec.ofNat 64 16924445419175098418 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9660859288947840 + maskLow := BitVec.ofNat 64 288230380748734743 + maskHigh := BitVec.ofNat 64 36063981407870977 + systematicCode := BitVec.ofNat 64 17283320715247171634 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11336515009678464 + maskLow := BitVec.ofNat 64 72233520495395095 + maskHigh := BitVec.ofNat 64 36063981458161665 + systematicCode := BitVec.ofNat 64 17283326014211700786 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9649885343204352 + maskLow := BitVec.ofNat 64 288230380748734743 + maskHigh := BitVec.ofNat 64 72057611226218501 + systematicCode := BitVec.ofNat 64 17421241254443038770 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10208437250114560 + maskLow := BitVec.ofNat 64 36169556284211479 + maskHigh := BitVec.ofNat 64 72057611284905985 + systematicCode := BitVec.ofNat 64 17421248744208545842 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9658681436439552 + maskLow := BitVec.ofNat 64 288230380748734743 + maskHigh := BitVec.ofNat 64 288230380448784389 + systematicCode := BitVec.ofNat 64 17636566300206905394 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11334337157170176 + maskLow := BitVec.ofNat 64 9042405403722007 + maskHigh := BitVec.ofNat 64 288230380513787905 + systematicCode := BitVec.ofNat 64 17636577088456964146 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9592191315919872 + maskLow := BitVec.ofNat 64 288230380748734743 + maskHigh := BitVec.ofNat 64 396457504764067841 + systematicCode := BitVec.ofNat 64 17650152158742788146 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x3834. -/ +def normalizedWeightSixteenCandidateBucket_3834 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9592710738610432 + maskLow := BitVec.ofNat 64 144115192706433303 + maskHigh := BitVec.ofNat 64 18084780172115969 + systematicCode := BitVec.ofNat 64 17067730825022486580 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9658166076131584 + maskLow := BitVec.ofNat 64 144115192706433303 + maskHigh := BitVec.ofNat 64 18155136027197441 + systematicCode := BitVec.ofNat 64 17068555377038276660 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11333821796862208 + maskLow := BitVec.ofNat 64 126100794196951319 + maskHigh := BitVec.ofNat 64 18155136031391745 + systematicCode := BitVec.ofNat 64 17068558408227829812 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9660859289061632 + maskLow := BitVec.ofNat 64 144115192706433303 + maskHigh := BitVec.ofNat 64 36099165779968001 + systematicCode := BitVec.ofNat 64 17283883665234016308 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11336515009792256 + maskLow := BitVec.ofNat 64 72268704901038359 + maskHigh := BitVec.ofNat 64 36099165796696065 + systematicCode := BitVec.ofNat 64 17283886765141997620 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9649885343253120 + maskLow := BitVec.ofNat 64 144115192706433303 + maskHigh := BitVec.ofNat 64 72057602636283907 + systematicCode := BitVec.ofNat 64 17420678304455931956 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10208437250163328 + maskLow := BitVec.ofNat 64 36169547727831319 + maskHigh := BitVec.ofNat 64 72057602661416961 + systematicCode := BitVec.ofNat 64 17420683595231737908 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9658681436276992 + maskLow := BitVec.ofNat 64 144115192706433303 + maskHigh := BitVec.ofNat 64 144115192375033859 + systematicCode := BitVec.ofNat 64 17492453319710554164 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11334337157007616 + maskLow := BitVec.ofNat 64 18084780474171671 + maskHigh := BitVec.ofNat 64 144115192404377601 + systematicCode := BitVec.ofNat 64 17492459709981210676 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9592191316001152 + maskLow := BitVec.ofNat 64 144115192706433303 + maskHigh := BitVec.ofNat 64 252342316654657537 + systematicCode := BitVec.ofNat 64 17506036970633246772 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x3837. -/ +def normalizedWeightSixteenCandidateBucket_3837 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089736547928320 + maskLow := BitVec.ofNat 64 576460782770913559 + maskHigh := BitVec.ofNat 64 4521191830192129 + systematicCode := BitVec.ofNat 64 16850693502798084151 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711457944275200 + maskLow := BitVec.ofNat 64 72057598735614231 + maskHigh := BitVec.ofNat 64 4521191947632647 + systematicCode := BitVec.ofNat 64 16850700165335496759 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089736547893888 + maskLow := BitVec.ofNat 64 288230423799070999 + maskHigh := BitVec.ofNat 64 9042383643607041 + systematicCode := BitVec.ofNat 64 16923032567534532663 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711457944240768 + maskLow := BitVec.ofNat 64 72057598735614231 + maskHigh := BitVec.ofNat 64 9042383693938699 + systematicCode := BitVec.ofNat 64 16923038139133474871 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089736547682560 + maskLow := BitVec.ofNat 64 144115244313149719 + maskHigh := BitVec.ofNat 64 18084767270436865 + systematicCode := BitVec.ofNat 64 17067710696974006327 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711457944029440 + maskLow := BitVec.ofNat 64 72057598735614231 + maskHigh := BitVec.ofNat 64 18084767287214093 + systematicCode := BitVec.ofNat 64 17067714078173050935 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9785709374540032 + maskLow := BitVec.ofNat 64 72057598735614231 + maskHigh := BitVec.ofNat 64 31665934896726017 + systematicCode := BitVec.ofNat 64 17071714484448409655 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9788402587470080 + maskLow := BitVec.ofNat 64 72057598735614231 + maskHigh := BitVec.ofNat 64 36151942338052097 + systematicCode := BitVec.ofNat 64 17283930098444023863 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089217125073280 + maskLow := BitVec.ofNat 64 1008806321228677399 + maskHigh := BitVec.ofNat 64 36169534524096513 + systematicCode := BitVec.ofNat 64 17284727917694367799 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9710938521420160 + maskLow := BitVec.ofNat 64 72057598735614231 + maskHigh := BitVec.ofNat 64 36169534742200321 + systematicCode := BitVec.ofNat 64 17284734786387064887 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x3b07. -/ +def normalizedWeightSixteenCandidateBucket_3b07 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11330469639784576 + maskLow := BitVec.ofNat 64 148636384721174815 + maskHigh := BitVec.ofNat 64 824633720835 + systematicCode := BitVec.ofNat 64 14901711273733929735 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9096262012143744 + maskLow := BitVec.ofNat 64 13421838623 + maskHigh := BitVec.ofNat 64 824668327937 + systematicCode := BitVec.ofNat 64 14901764278729259783 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11330488816142464 + maskLow := BitVec.ofNat 64 81082390310617375 + maskHigh := BitVec.ofNat 64 13194139533315 + systematicCode := BitVec.ofNat 64 15480423813016468231 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9096281188501632 + maskLow := BitVec.ofNat 64 13421838623 + maskHigh := BitVec.ofNat 64 13194158411777 + systematicCode := BitVec.ofNat 64 15480473545196387079 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11332125198682240 + maskLow := BitVec.ofNat 64 76596382869291295 + maskHigh := BitVec.ofNat 64 3377699720527875 + systematicCode := BitVec.ofNat 64 16637848917200550663 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9097917571041408 + maskLow := BitVec.ofNat 64 13421838623 + maskHigh := BitVec.ofNat 64 3377699738361857 + systematicCode := BitVec.ofNat 64 16637898636596034311 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9026999070785664 + maskLow := BitVec.ofNat 64 13421838623 + maskHigh := BitVec.ofNat 64 4613947164089909251 + systematicCode := BitVec.ofNat 64 18295546718693047047 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9026999070787712 + maskLow := BitVec.ofNat 64 13421838623 + maskHigh := BitVec.ofNat 64 9224502609686036483 + systematicCode := BitVec.ofNat 64 18367321733947669255 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11332129527201920 + maskLow := BitVec.ofNat 64 153157576534589727 + maskHigh := BitVec.ofNat 64 13835058055282163715 + systematicCode := BitVec.ofNat 64 18373986586487110407 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9097921899561088 + maskLow := BitVec.ofNat 64 13421838623 + maskHigh := BitVec.ofNat 64 13835058055317823489 + systematicCode := BitVec.ofNat 64 18374039604367145735 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x3b0d. -/ +def normalizedWeightSixteenCandidateBucket_3b0d : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11330469507672064 + maskLow := BitVec.ofNat 64 1153486658415427927 + maskHigh := BitVec.ofNat 64 584115552273 + systematicCode := BitVec.ofNat 64 14900029046612179725 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9096261880031232 + maskLow := BitVec.ofNat 64 73551380823 + maskHigh := BitVec.ofNat 64 584384119297 + systematicCode := BitVec.ofNat 64 14900082000068688653 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11330488835015680 + maskLow := BitVec.ofNat 64 81066997147828567 + maskHigh := BitVec.ofNat 64 74766790688785 + systematicCode := BitVec.ofNat 64 15912775974313409293 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9096281207374848 + maskLow := BitVec.ofNat 64 73551380823 + maskHigh := BitVec.ofNat 64 74766809563649 + systematicCode := BitVec.ofNat 64 15912819109323684621 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11332125217555456 + maskLow := BitVec.ofNat 64 72655733195342167 + maskHigh := BitVec.ofNat 64 19140298416324625 + systematicCode := BitVec.ofNat 64 17070201078397221645 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9097917589914624 + maskLow := BitVec.ofNat 64 73551380823 + maskHigh := BitVec.ofNat 64 19140298433241089 + systematicCode := BitVec.ofNat 64 17070244175054191373 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9026999056106496 + maskLow := BitVec.ofNat 64 73551380823 + maskHigh := BitVec.ofNat 64 594546069312897041 + systematicCode := BitVec.ofNat 64 17864896601496566541 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9026999089660928 + maskLow := BitVec.ofNat 64 73551380823 + maskHigh := BitVec.ofNat 64 9224502369167867921 + systematicCode := BitVec.ofNat 64 18367321708278921997 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11332129478970368 + maskLow := BitVec.ofNat 64 1161963893065580887 + maskHigh := BitVec.ofNat 64 9799832789158199313 + systematicCode := BitVec.ofNat 64 18372304359466416909 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9097921851329536 + maskLow := BitVec.ofNat 64 73551380823 + maskHigh := BitVec.ofNat 64 9799832789428740097 + systematicCode := BitVec.ofNat 64 18372357351577041677 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x3b0e. -/ +def normalizedWeightSixteenCandidateBucket_3b0e : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089857360472064 + maskLow := BitVec.ofNat 64 2306125588533936535 + maskHigh := BitVec.ofNat 64 309237645345 + systematicCode := BitVec.ofNat 64 14827972556364004110 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711578756818944 + maskLow := BitVec.ofNat 64 142270857623 + maskHigh := BitVec.ofNat 64 309774582017 + systematicCode := BitVec.ofNat 64 14828025501230709518 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089785151334400 + maskLow := BitVec.ofNat 64 81065897636200855 + maskHigh := BitVec.ofNat 64 79164837199905 + systematicCode := BitVec.ofNat 64 15913058548801682190 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711506547681280 + maskLow := BitVec.ofNat 64 142270857623 + maskHigh := BitVec.ofNat 64 79164856074497 + systematicCode := BitVec.ofNat 64 15913100584283683598 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089341964396544 + maskLow := BitVec.ofNat 64 72374258218631575 + maskHigh := BitVec.ofNat 64 20266198323167265 + systematicCode := BitVec.ofNat 64 17070483652868782862 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711063360743424 + maskLow := BitVec.ofNat 64 142270857623 + maskHigh := BitVec.ofNat 64 20266198340018177 + systematicCode := BitVec.ofNat 64 17070525645736000270 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9786345516328960 + maskLow := BitVec.ofNat 64 142270857623 + maskHigh := BitVec.ofNat 64 594545794434990113 + systematicCode := BitVec.ofNat 64 17864896597218441998 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9786345681993856 + maskLow := BitVec.ofNat 64 142270857623 + maskHigh := BitVec.ofNat 64 4613946648693833761 + systematicCode := BitVec.ofNat 64 18295546688746175246 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089337906405504 + maskLow := BitVec.ofNat 64 2314885397672427927 + maskHigh := BitVec.ofNat 64 5188146770730811425 + systematicCode := BitVec.ofNat 64 18300247869235084046 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711059302752384 + maskLow := BitVec.ofNat 64 142270857623 + maskHigh := BitVec.ofNat 64 5188146771269787649 + systematicCode := BitVec.ofNat 64 18300300857050807054 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x3b15. -/ +def normalizedWeightSixteenCandidateBucket_3b15 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11330471904716800 + maskLow := BitVec.ofNat 64 1153484596831126807 + maskHigh := BitVec.ofNat 64 8830452760833 + systematicCode := BitVec.ofNat 64 15476498595008101141 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9096264277075968 + maskLow := BitVec.ofNat 64 1104343532823 + maskHigh := BitVec.ofNat 64 8830721327137 + systematicCode := BitVec.ofNat 64 15476542752238418709 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11330472055702528 + maskLow := BitVec.ofNat 64 148618929974084887 + maskHigh := BitVec.ofNat 64 70643622084865 + systematicCode := BitVec.ofNat 64 15910532983426792213 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9096264428061696 + maskLow := BitVec.ofNat 64 1104343532823 + maskHigh := BitVec.ofNat 64 70643656687649 + systematicCode := BitVec.ofNat 64 15910570595026287381 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11332121222480896 + maskLow := BitVec.ofNat 64 5101738784785687 + maskHigh := BitVec.ofNat 64 289356276058554625 + systematicCode := BitVec.ofNat 64 17646670592433928981 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9097913594840064 + maskLow := BitVec.ofNat 64 1104343532823 + maskHigh := BitVec.ofNat 64 289356276059742209 + systematicCode := BitVec.ofNat 64 17646696131265116949 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9026990799619072 + maskLow := BitVec.ofNat 64 1104343532823 + maskHigh := BitVec.ofNat 64 324338338007875841 + systematicCode := BitVec.ofNat 64 17649568278807395093 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9026995094586368 + maskLow := BitVec.ofNat 64 1104343532823 + maskHigh := BitVec.ofNat 64 9224498245999264001 + systematicCode := BitVec.ofNat 64 18367312912320641813 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11332116961070080 + maskLow := BitVec.ofNat 64 1297071881886696727 + maskHigh := BitVec.ofNat 64 9259400833873740033 + systematicCode := BitVec.ofNat 64 18370061355879971605 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9097909333429248 + maskLow := BitVec.ofNat 64 1104343532823 + maskHigh := BitVec.ofNat 64 9259400834175737857 + systematicCode := BitVec.ofNat 64 18370105586123619093 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x3b16. -/ +def normalizedWeightSixteenCandidateBucket_3b16 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089856827795456 + maskLow := BitVec.ofNat 64 2306124557741787415 + maskHigh := BitVec.ofNat 64 4432406249985 + systematicCode := BitVec.ofNat 64 15404442104759925526 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711578224142336 + maskLow := BitVec.ofNat 64 2203855161623 + maskHigh := BitVec.ofNat 64 4432943185937 + systematicCode := BitVec.ofNat 64 15404486253400439574 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089788081055744 + maskLow := BitVec.ofNat 64 148618861254609175 + maskHigh := BitVec.ofNat 64 70918499992065 + systematicCode := BitVec.ofNat 64 15910815557915065110 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711509477402624 + maskLow := BitVec.ofNat 64 2203855161623 + maskHigh := BitVec.ofNat 64 70918534594577 + systematicCode := BitVec.ofNat 64 15910852069986286358 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089341431719936 + maskLow := BitVec.ofNat 64 4820263808076055 + maskHigh := BitVec.ofNat 64 290482175965397505 + systematicCode := BitVec.ofNat 64 17646953166905490198 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711062828066816 + maskLow := BitVec.ofNat 64 2203855161623 + maskHigh := BitVec.ofNat 64 290482175966519297 + systematicCode := BitVec.ofNat 64 17646977601946925846 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9786340988577792 + maskLow := BitVec.ofNat 64 2203855161623 + maskHigh := BitVec.ofNat 64 324333939961364993 + systematicCode := BitVec.ofNat 64 17649568274529270550 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9786362194968704 + maskLow := BitVec.ofNat 64 2203855161623 + maskHigh := BitVec.ofNat 64 4613938402356625921 + systematicCode := BitVec.ofNat 64 18295537892787895062 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089337373728896 + maskLow := BitVec.ofNat 64 2449993386493544727 + maskHigh := BitVec.ofNat 64 4647714815446352385 + systematicCode := BitVec.ofNat 64 18298004865648638742 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711058770075776 + maskLow := BitVec.ofNat 64 2203855161623 + maskHigh := BitVec.ofNat 64 4647714816016785409 + systematicCode := BitVec.ofNat 64 18298049091597384470 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x3b1c. -/ +def normalizedWeightSixteenCandidateBucket_3b1c : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089856957810944 + maskLow := BitVec.ofNat 64 2306124497612259607 + maskHigh := BitVec.ofNat 64 4672924422145 + systematicCode := BitVec.ofNat 64 15406137551689562908 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711578354157824 + maskLow := BitVec.ofNat 64 17597017964823 + maskHigh := BitVec.ofNat 64 4673461354499 + systematicCode := BitVec.ofNat 64 15406175103160433436 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089788238332544 + maskLow := BitVec.ofNat 64 1153484467982123287 + maskHigh := BitVec.ofNat 64 9345848840193 + systematicCode := BitVec.ofNat 64 15478476616426011420 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711509634679424 + maskLow := BitVec.ofNat 64 17597017964823 + maskHigh := BitVec.ofNat 64 9346117402627 + systematicCode := BitVec.ofNat 64 15478513076958411548 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089341561735424 + maskLow := BitVec.ofNat 64 879614134141207 + maskHigh := BitVec.ofNat 64 306244774661197825 + systematicCode := BitVec.ofNat 64 17648648588065717020 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711062958082304 + maskLow := BitVec.ofNat 64 17597017964823 + maskHigh := BitVec.ofNat 64 306244774661398529 + systematicCode := BitVec.ofNat 64 17648659854737816348 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9786341118593280 + maskLow := BitVec.ofNat 64 17597017964823 + maskHigh := BitVec.ofNat 64 324272367310213121 + systematicCode := BitVec.ofNat 64 17649561677560560412 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9786362159319296 + maskLow := BitVec.ofNat 64 17597017964823 + maskHigh := BitVec.ofNat 64 594475975446630401 + systematicCode := BitVec.ofNat 64 17864881204291451676 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089337503744384 + maskLow := BitVec.ofNat 64 3458799703024550167 + maskHigh := BitVec.ofNat 64 612489549322391553 + systematicCode := BitVec.ofNat 64 17865665898591501084 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711058900091264 + maskLow := BitVec.ofNat 64 17597017964823 + maskHigh := BitVec.ofNat 64 612489550127702017 + systematicCode := BitVec.ofNat 64 17865703553140013852 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x3b1f. -/ +def normalizedWeightSixteenCandidateBucket_3b1f : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9928078906507520 + maskLow := BitVec.ofNat 64 35189204025623 + maskHigh := BitVec.ofNat 64 309622474381729793 + systematicCode := BitVec.ofNat 64 17648734913586477855 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9852723973456128 + maskLow := BitVec.ofNat 64 35189204025623 + maskHigh := BitVec.ofNat 64 324259173170680577 + systematicCode := BitVec.ofNat 64 17649493219959585567 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36104663598235904 + maskLow := BitVec.ofNat 64 20895552864535 + maskHigh := BitVec.ofNat 64 324259173170683905 + systematicCode := BitVec.ofNat 64 17649496268328745759 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9852724772471040 + maskLow := BitVec.ofNat 64 35189204025623 + maskHigh := BitVec.ofNat 64 594475150812909617 + systematicCode := BitVec.ofNat 64 17864821542649281311 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36104664397250816 + maskLow := BitVec.ofNat 64 17803176411415 + maskHigh := BitVec.ofNat 64 594475150812913665 + systematicCode := BitVec.ofNat 64 17864824625377655583 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18050167401955712 + maskLow := BitVec.ofNat 64 17600239206679 + maskHigh := BitVec.ofNat 64 612489549322391553 + systematicCode := BitVec.ofNat 64 17865665751570791199 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9852724774568064 + maskLow := BitVec.ofNat 64 35189204025623 + maskHigh := BitVec.ofNat 64 4613937818241073699 + systematicCode := BitVec.ofNat 64 18295471659846155039 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36104664399347840 + maskLow := BitVec.ofNat 64 2349884080407 + maskHigh := BitVec.ofNat 64 4613937818241081345 + systematicCode := BitVec.ofNat 64 18295481313974762271 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9852727999987968 + maskLow := BitVec.ofNat 64 35189204025623 + maskHigh := BitVec.ofNat 64 9224497936761618707 + systematicCode := BitVec.ofNat 64 18367246675100777247 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36104667624767744 + maskLow := BitVec.ofNat 64 1181652975895 + maskHigh := BitVec.ofNat 64 9224497936761626625 + systematicCode := BitVec.ofNat 64 18367257428724235039 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9928074915629440 + maskLow := BitVec.ofNat 64 35189204025623 + maskHigh := BitVec.ofNat 64 14447547604604559361 + systematicCode := BitVec.ofNat 64 18374114663217183519 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x3b25. -/ +def normalizedWeightSixteenCandidateBucket_3b25 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11329960535173120 + maskLow := BitVec.ofNat 64 1152923845901222167 + maskHigh := BitVec.ofNat 64 2251834173489153 + systematicCode := BitVec.ofNat 64 16629437691532557093 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9095752907532288 + maskLow := BitVec.ofNat 64 281479808876823 + maskHigh := BitVec.ofNat 64 2251834441859617 + systematicCode := BitVec.ofNat 64 16629464188126837541 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11329960686158848 + maskLow := BitVec.ofNat 64 144132922533019927 + maskHigh := BitVec.ofNat 64 18014673387454465 + systematicCode := BitVec.ofNat 64 17063472079951248165 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9095753058518016 + maskLow := BitVec.ofNat 64 281479808876823 + maskHigh := BitVec.ofNat 64 18014673420947489 + systematicCode := BitVec.ofNat 64 17063492030914706213 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11329973470397440 + maskLow := BitVec.ofNat 64 9026995296207127 + maskHigh := BitVec.ofNat 64 288234774198288385 + systematicCode := BitVec.ofNat 64 17642184597709142821 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9095765842756608 + maskLow := BitVec.ofNat 64 281479808876823 + maskHigh := BitVec.ofNat 64 288234774200324609 + systematicCode := BitVec.ofNat 64 17642195787073010469 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9024843047535616 + maskLow := BitVec.ofNat 64 281479808876823 + maskHigh := BitVec.ofNat 64 308637311963299841 + systematicCode := BitVec.ofNat 64 17648734887917730597 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9025392803349504 + maskLow := BitVec.ofNat 64 281479808876823 + maskHigh := BitVec.ofNat 64 9223376744138997761 + systematicCode := BitVec.ofNat 64 18362809312962755365 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11329423748140032 + maskLow := BitVec.ofNat 64 1306043896769610007 + maskHigh := BitVec.ofNat 64 9223512774343196673 + systematicCode := BitVec.ofNat 64 18365575348439694117 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9095216120499200 + maskLow := BitVec.ofNat 64 281479808876823 + maskHigh := BitVec.ofNat 64 9223512774647218177 + systematicCode := BitVec.ofNat 64 18365601986765732645 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x3b26. -/ +def normalizedWeightSixteenCandidateBucket_3b26 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089720462583808 + maskLow := BitVec.ofNat 64 2305844182277226775 + maskHigh := BitVec.ofNat 64 1125934266712065 + systematicCode := BitVec.ofNat 64 16557381201284381478 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711441858930688 + maskLow := BitVec.ofNat 64 562954785849623 + maskHigh := BitVec.ofNat 64 1125934803452177 + systematicCode := BitVec.ofNat 64 16557407689288858406 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089719898449920 + maskLow := BitVec.ofNat 64 144132853813805335 + maskHigh := BitVec.ofNat 64 18014948265426945 + systematicCode := BitVec.ofNat 64 17063754654439521062 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711441294796800 + maskLow := BitVec.ofNat 64 562954785849623 + maskHigh := BitVec.ofNat 64 18014948298854417 + systematicCode := BitVec.ofNat 64 17063773505874705190 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089716436051968 + maskLow := BitVec.ofNat 64 9025895784841495 + maskHigh := BitVec.ofNat 64 288239172244865025 + systematicCode := BitVec.ofNat 64 17642467172197415718 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711437832398848 + maskLow := BitVec.ofNat 64 562954785849623 + maskHigh := BitVec.ofNat 64 288239172246835457 + systematicCode := BitVec.ofNat 64 17642477262033009446 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9785693253822464 + maskLow := BitVec.ofNat 64 562954785849623 + maskHigh := BitVec.ofNat 64 307511412056522753 + systematicCode := BitVec.ofNat 64 17648733788422945574 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9788407673143424 + maskLow := BitVec.ofNat 64 562954785849623 + maskHigh := BitVec.ofNat 64 4611695398636093441 + systematicCode := BitVec.ofNat 64 18291034293430008614 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089201008517248 + maskLow := BitVec.ofNat 64 2458965401376719127 + maskHigh := BitVec.ofNat 64 4611826755915874305 + systematicCode := BitVec.ofNat 64 18293518858208361254 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9710922404864128 + maskLow := BitVec.ofNat 64 562954785849623 + maskHigh := BitVec.ofNat 64 4611826756488265729 + systematicCode := BitVec.ofNat 64 18293545492239498022 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x3b2c. -/ +def normalizedWeightSixteenCandidateBucket_3b2c : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089720592599296 + maskLow := BitVec.ofNat 64 2305844122151354647 + maskHigh := BitVec.ofNat 64 1126174785798145 + systematicCode := BitVec.ofNat 64 16559076648214018860 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711441988946176 + maskLow := BitVec.ofNat 64 4503604463468823 + maskHigh := BitVec.ofNat 64 1126175321620739 + systematicCode := BitVec.ofNat 64 16559096539048852268 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089720055726720 + maskLow := BitVec.ofNat 64 1152923717056135447 + maskHigh := BitVec.ofNat 64 2252349570547713 + systematicCode := BitVec.ofNat 64 16631415712950467372 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711441452073600 + maskLow := BitVec.ofNat 64 4503604463468823 + maskHigh := BitVec.ofNat 64 2252349837935107 + systematicCode := BitVec.ofNat 64 16631434512846830380 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089716566067456 + maskLow := BitVec.ofNat 64 9010502625722647 + maskHigh := BitVec.ofNat 64 288300744896937985 + systematicCode := BitVec.ofNat 64 17644162619026783020 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711437962414336 + maskLow := BitVec.ofNat 64 4503604463468823 + maskHigh := BitVec.ofNat 64 288300744897987329 + systematicCode := BitVec.ofNat 64 17644166086123862828 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9785693383837952 + maskLow := BitVec.ofNat 64 4503604463468823 + maskHigh := BitVec.ofNat 64 291748813361643521 + systematicCode := BitVec.ofNat 64 17647044938663738156 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9788407637494016 + maskLow := BitVec.ofNat 64 4503604463468823 + maskHigh := BitVec.ofNat 64 576531945682370561 + systematicCode := BitVec.ofNat 64 17860377604933565228 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089201138532736 + maskLow := BitVec.ofNat 64 3467771717911380247 + maskHigh := BitVec.ofNat 64 576601489792827393 + systematicCode := BitVec.ofNat 64 17861179891151223596 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9710922534879616 + maskLow := BitVec.ofNat 64 4503604463468823 + maskHigh := BitVec.ofNat 64 576601490599182337 + systematicCode := BitVec.ofNat 64 17861199953782127404 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x3b2f. -/ +def normalizedWeightSixteenCandidateBucket_3b2f : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9926953893511424 + maskLow := BitVec.ofNat 64 9007204095033623 + maskHigh := BitVec.ofNat 64 288313939037519873 + systematicCode := BitVec.ofNat 64 17644213653323070255 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9851667143065856 + maskLow := BitVec.ofNat 64 9007204095033623 + maskHigh := BitVec.ofNat 64 288371113641312257 + systematicCode := BitVec.ofNat 64 17645007281507220271 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36103606767845632 + maskLow := BitVec.ofNat 64 5348029397795095 + maskHigh := BitVec.ofNat 64 288371113642164225 + systematicCode := BitVec.ofNat 64 17645010329876380463 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9851770215989504 + maskLow := BitVec.ofNat 64 9007204095033623 + maskHigh := BitVec.ofNat 64 576531121048649777 + systematicCode := BitVec.ofNat 64 17860335535209003823 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36103709840769280 + maskLow := BitVec.ofNat 64 4503810626093335 + maskHigh := BitVec.ofNat 64 576531121049698305 + systematicCode := BitVec.ofNat 64 17860338686655806255 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18049621941109120 + maskLow := BitVec.ofNat 64 4503607688888599 + maskHigh := BitVec.ofNat 64 576601489792827393 + systematicCode := BitVec.ofNat 64 17861179812848941871 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9851770218086528 + maskLow := BitVec.ofNat 64 9007204095033623 + maskHigh := BitVec.ofNat 64 4611694814520541219 + systematicCode := BitVec.ofNat 64 18290985652405877551 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36103709842866304 + maskLow := BitVec.ofNat 64 563100822602007 + maskHigh := BitVec.ofNat 64 4611694814522507265 + systematicCode := BitVec.ofNat 64 18290995375252912943 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9852182539141376 + maskLow := BitVec.ofNat 64 9007204095033623 + maskHigh := BitVec.ofNat 64 9223376434901352467 + systematicCode := BitVec.ofNat 64 18362760667660499759 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36104122163921152 + maskLow := BitVec.ofNat 64 281557126414615 + maskHigh := BitVec.ofNat 64 9223376434903384065 + systematicCode := BitVec.ofNat 64 18362771490002385711 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9926438533089664 + maskLow := BitVec.ofNat 64 9007204095033623 + maskHigh := BitVec.ofNat 64 14411659545076039681 + systematicCode := BitVec.ofNat 64 18374114594767190831 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x3b34. -/ +def normalizedWeightSixteenCandidateBucket_3b34 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089736572897536 + maskLow := BitVec.ofNat 64 2305843091422118167 + maskHigh := BitVec.ofNat 64 1130297970130945 + systematicCode := BitVec.ofNat 64 16561337243986508596 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711457969244416 + maskLow := BitVec.ofNat 64 72057598936940823 + maskHigh := BitVec.ofNat 64 1130298490224659 + systematicCode := BitVec.ofNat 64 16561348304503323444 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089736568701568 + maskLow := BitVec.ofNat 64 1152921655534747927 + maskHigh := BitVec.ofNat 64 2260595923484673 + systematicCode := BitVec.ofNat 64 16633676308722957108 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711457965048448 + maskLow := BitVec.ofNat 64 72057598936940823 + maskHigh := BitVec.ofNat 64 2260596175142947 + systematicCode := BitVec.ofNat 64 16633686278301301556 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089736541440256 + maskLow := BitVec.ofNat 64 144115399133298967 + maskHigh := BitVec.ofNat 64 18084767270436865 + systematicCode := BitVec.ofNat 64 17067710697041378100 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711457937787136 + maskLow := BitVec.ofNat 64 72057598936940823 + maskHigh := BitVec.ofNat 64 18084767287214129 + systematicCode := BitVec.ofNat 64 17067714095420029748 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9785709364136192 + maskLow := BitVec.ofNat 64 72057598936940823 + maskHigh := BitVec.ofNat 64 21532835735142401 + systematicCode := BitVec.ofNat 64 17070584186495056692 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9788402577066240 + maskLow := BitVec.ofNat 64 72057598936940823 + maskHigh := BitVec.ofNat 64 36112359919452161 + systematicCode := BitVec.ofNat 64 17283925683217644340 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089217118830976 + maskLow := BitVec.ofNat 64 3602879706795409687 + maskHigh := BitVec.ofNat 64 36169534524096513 + systematicCode := BitVec.ofNat 64 17284727934941346612 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9710938515177856 + maskLow := BitVec.ofNat 64 72057598936940823 + maskHigh := BitVec.ofNat 64 36169535346180097 + systematicCode := BitVec.ofNat 64 17284739201613445940 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x3b37. -/ +def normalizedWeightSixteenCandidateBucket_3b37 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9926941908287744 + maskLow := BitVec.ofNat 64 144115193041977623 + maskHigh := BitVec.ofNat 64 18085591920934913 + systematicCode := BitVec.ofNat 64 17067744070701628215 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9851659685593344 + maskLow := BitVec.ofNat 64 144115193041977623 + maskHigh := BitVec.ofNat 64 18155136014811137 + systematicCode := BitVec.ofNat 64 17068555325297343287 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36103599310373120 + maskLow := BitVec.ofNat 64 72902023934181655 + maskHigh := BitVec.ofNat 64 18155136031391745 + systematicCode := BitVec.ofNat 64 17068558408025717559 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9851761959502080 + maskLow := BitVec.ofNat 64 144115193041977623 + maskHigh := BitVec.ofNat 64 36099165779919617 + systematicCode := BitVec.ofNat 64 17283883613493082935 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36103701584281856 + maskLow := BitVec.ofNat 64 72060897538933015 + maskHigh := BitVec.ofNat 64 36099165796696065 + systematicCode := BitVec.ofNat 64 17283886764939885367 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18049634725347712 + maskLow := BitVec.ofNat 64 72057602225275159 + maskHigh := BitVec.ofNat 64 36169534524096513 + systematicCode := BitVec.ofNat 64 17284727890998278967 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9851762227937408 + maskLow := BitVec.ofNat 64 144115193041977623 + maskHigh := BitVec.ofNat 64 4611686568183333379 + systematicCode := BitVec.ofNat 64 18288733886952454967 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36103701852717184 + maskLow := BitVec.ofNat 64 565162532733207 + maskHigh := BitVec.ofNat 64 4611686568216756225 + systematicCode := BitVec.ofNat 64 18288752371666467639 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9852175081668864 + maskLow := BitVec.ofNat 64 144115193041977623 + maskHigh := BitVec.ofNat 64 9223372311732748547 + systematicCode := BitVec.ofNat 64 18360508902207077175 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36104114706448640 + maskLow := BitVec.ofNat 64 282588044394775 + maskHigh := BitVec.ofNat 64 9223372311766237185 + systematicCode := BitVec.ofNat 64 18360528486415940407 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9926431075617152 + maskLow := BitVec.ofNat 64 144115193041977623 + maskHigh := BitVec.ofNat 64 13871227589823037441 + systematicCode := BitVec.ofNat 64 18374105798808910647 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x3d07. -/ +def normalizedWeightSixteenCandidateBucket_3d07 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11330469639768320 + maskLow := BitVec.ofNat 64 292751573333901599 + maskHigh := BitVec.ofNat 64 687194767365 + systematicCode := BitVec.ofNat 64 14901150531393699079 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9096262012127488 + maskLow := BitVec.ofNat 64 22548644127 + maskHigh := BitVec.ofNat 64 687262928897 + systematicCode := BitVec.ofNat 64 14901203527799225607 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11330488816126208 + maskLow := BitVec.ofNat 64 90089590102229279 + maskHigh := BitVec.ofNat 64 10995116277765 + systematicCode := BitVec.ofNat 64 15479863062119857415 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9096281188485376 + maskLow := BitVec.ofNat 64 22548644127 + maskHigh := BitVec.ofNat 64 10995137253377 + systematicCode := BitVec.ofNat 64 15479910603833031943 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11332125198665984 + maskLow := BitVec.ofNat 64 76631567778251039 + maskHigh := BitVec.ofNat 64 2814749767106565 + systematicCode := BitVec.ofNat 64 16637288166270516487 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9097917571025152 + maskLow := BitVec.ofNat 64 22548644127 + maskHigh := BitVec.ofNat 64 2814749784948737 + systematicCode := BitVec.ofNat 64 16637335686676299015 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9026999070769408 + maskLow := BitVec.ofNat 64 22548644127 + maskHigh := BitVec.ofNat 64 2308104154876215301 + systematicCode := BitVec.ofNat 64 18151431530650877191 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9026999071031552 + maskLow := BitVec.ofNat 64 22548644127 + maskHigh := BitVec.ofNat 64 9223937323270406149 + systematicCode := BitVec.ofNat 64 18366756576414743815 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11332129526925568 + maskLow := BitVec.ofNat 64 306315148774146335 + maskHigh := BitVec.ofNat 64 11529215046068469765 + systematicCode := BitVec.ofNat 64 18373425844180565255 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9097921899284736 + maskLow := BitVec.ofNat 64 22548644127 + maskHigh := BitVec.ofNat 64 11529215046139789313 + systematicCode := BitVec.ofNat 64 18373478862060600583 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x3d0b. -/ +def normalizedWeightSixteenCandidateBucket_3d0b : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11330469508679936 + maskLow := BitVec.ofNat 64 1154051807928975671 + maskHigh := BitVec.ofNat 64 584115552273 + systematicCode := BitVec.ofNat 64 14900029046645865739 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9096261881039104 + maskLow := BitVec.ofNat 64 74088251703 + maskHigh := BitVec.ofNat 64 584384250881 + systematicCode := BitVec.ofNat 64 14900082008692178187 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11330488834853120 + maskLow := BitVec.ofNat 64 90076395962695991 + maskHigh := BitVec.ofNat 64 37383395344401 + systematicCode := BitVec.ofNat 64 15768097836317818123 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9096281207212288 + maskLow := BitVec.ofNat 64 74088251703 + maskHigh := BitVec.ofNat 64 37383416316929 + systematicCode := BitVec.ofNat 64 15768140979917896971 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11332125217392896 + maskLow := BitVec.ofNat 64 73253868057723191 + maskHigh := BitVec.ofNat 64 9570149208162321 + systematicCode := BitVec.ofNat 64 16925522940401630475 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9097917589752064 + maskLow := BitVec.ofNat 64 74088251703 + maskHigh := BitVec.ofNat 64 9570149225218049 + systematicCode := BitVec.ofNat 64 16925566045648403723 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9026999056204032 + maskLow := BitVec.ofNat 64 74088251703 + maskHigh := BitVec.ofNat 64 585503685686067217 + systematicCode := BitVec.ofNat 64 17864331452519890187 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9026999089758464 + maskLow := BitVec.ofNat 64 74088251703 + maskHigh := BitVec.ofNat 64 9223937220191191057 + systematicCode := BitVec.ofNat 64 18366756559302245643 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11332129479067904 + maskLow := BitVec.ofNat 64 1171006277229281591 + maskHigh := BitVec.ofNat 64 9799832789158199313 + systematicCode := BitVec.ofNat 64 18372304359500102923 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9097921851427072 + maskLow := BitVec.ofNat 64 74088251703 + maskHigh := BitVec.ofNat 64 9799832789430845441 + systematicCode := BitVec.ofNat 64 18372357360200531211 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x3d0e. -/ +def normalizedWeightSixteenCandidateBucket_3d0e : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089857361642496 + maskLow := BitVec.ofNat 64 4611968598284501399 + maskHigh := BitVec.ofNat 64 171798691905 + systematicCode := BitVec.ofNat 64 14683859575901338894 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711578757989376 + maskLow := BitVec.ofNat 64 280246682007 + maskHigh := BitVec.ofNat 64 172872499457 + systematicCode := BitVec.ofNat 64 14683912512178240782 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089785152504832 + maskLow := BitVec.ofNat 64 90073097427812759 + maskHigh := BitVec.ofNat 64 43980465111105 + systematicCode := BitVec.ofNat 64 15768945559782636814 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711506548851712 + maskLow := BitVec.ofNat 64 280246682007 + maskHigh := BitVec.ofNat 64 43980486082817 + systematicCode := BitVec.ofNat 64 15768985404797893902 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089341965566976 + maskLow := BitVec.ofNat 64 72409443127591319 + maskHigh := BitVec.ofNat 64 11258999068426305 + systematicCode := BitVec.ofNat 64 16926370663816314126 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711063361913856 + maskLow := BitVec.ofNat 64 280246682007 + maskHigh := BitVec.ofNat 64 11258999085285377 + systematicCode := BitVec.ofNat 64 16926410457693830414 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9786345517223040 + maskLow := BitVec.ofNat 64 280246682007 + maskHigh := BitVec.ofNat 64 585503273369206849 + systematicCode := BitVec.ofNat 64 17864331439685516558 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9786345681603712 + maskLow := BitVec.ofNat 64 280246682007 + maskHigh := BitVec.ofNat 64 2308103639480139841 + systematicCode := BitVec.ofNat 64 18151431500704005390 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089337907332096 + maskLow := BitVec.ofNat 64 4629770791049822615 + maskHigh := BitVec.ofNat 64 2882303761517117505 + systematicCode := BitVec.ofNat 64 18156134888806104334 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711059303678976 + maskLow := BitVec.ofNat 64 280246682007 + maskHigh := BitVec.ofNat 64 2882303762595069953 + systematicCode := BitVec.ofNat 64 18156187876621827342 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x3d13. -/ +def normalizedWeightSixteenCandidateBucket_3d13 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11330471905724672 + maskLow := BitVec.ofNat 64 1154047684760371991 + maskHigh := BitVec.ofNat 64 8830452760833 + systematicCode := BitVec.ofNat 64 15476498595041787155 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9096264278083840 + maskLow := BitVec.ofNat 64 1104880403223 + maskHigh := BitVec.ofNat 64 8830721458241 + systematicCode := BitVec.ofNat 64 15476542760861908243 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11330472055539968 + maskLow := BitVec.ofNat 64 292734256025764631 + maskHigh := BitVec.ofNat 64 35321811042561 + systematicCode := BitVec.ofNat 64 15765854853987581203 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9096264427899136 + maskLow := BitVec.ofNat 64 1104880403223 + maskHigh := BitVec.ofNat 64 35321879199809 + systematicCode := BitVec.ofNat 64 15765894656053820691 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11332121222318336 + maskLow := BitVec.ofNat 64 5699873647166231 + maskHigh := BitVec.ofNat 64 144678138029277441 + systematicCode := BitVec.ofNat 64 17501992454438337811 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9097913594677504 + maskLow := BitVec.ofNat 64 1104880403223 + maskHigh := BitVec.ofNat 64 144678138030604289 + systematicCode := BitVec.ofNat 64 17502018001859329299 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9026990799716608 + maskLow := BitVec.ofNat 64 1104880403223 + maskHigh := BitVec.ofNat 64 180187965559931137 + systematicCode := BitVec.ofNat 64 17505450891708284179 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9026995094683904 + maskLow := BitVec.ofNat 64 1104880403223 + maskHigh := BitVec.ofNat 64 9223935158606889217 + systematicCode := BitVec.ofNat 64 18366747763343965459 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11332116961167616 + maskLow := BitVec.ofNat 64 1441222254871511831 + maskHigh := BitVec.ofNat 64 9259400833873740033 + systematicCode := BitVec.ofNat 64 18370061355913657619 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9097909333526784 + maskLow := BitVec.ofNat 64 1104880403223 + maskHigh := BitVec.ofNat 64 9259400834209300481 + systematicCode := BitVec.ofNat 64 18370105594747108627 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x3d16. -/ +def normalizedWeightSixteenCandidateBucket_3d16 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089856828965888 + maskLow := BitVec.ofNat 64 4611967567492352279 + maskHigh := BitVec.ofNat 64 2233382994945 + systematicCode := BitVec.ofNat 64 15260329124297260310 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711578225312768 + maskLow := BitVec.ofNat 64 4403415288087 + maskHigh := BitVec.ofNat 64 2234456801297 + systematicCode := BitVec.ofNat 64 15260373264347970838 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089788082226176 + maskLow := BitVec.ofNat 64 292734049867335959 + maskHigh := BitVec.ofNat 64 35734127903745 + systematicCode := BitVec.ofNat 64 15766702577452399894 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711509478573056 + maskLow := BitVec.ofNat 64 4403415288087 + maskHigh := BitVec.ofNat 64 35734196060177 + systematicCode := BitVec.ofNat 64 15766739080933817622 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089341432890368 + maskLow := BitVec.ofNat 64 4855448717035799 + maskHigh := BitVec.ofNat 64 146366987889542145 + systematicCode := BitVec.ofNat 64 17502840177853021462 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711062829237248 + maskLow := BitVec.ofNat 64 4403415288087 + maskHigh := BitVec.ofNat 64 146366987890671617 + systematicCode := BitVec.ofNat 64 17502862413904755990 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9786340989471872 + maskLow := BitVec.ofNat 64 4403415288087 + maskHigh := BitVec.ofNat 64 180181368490165249 + systematicCode := BitVec.ofNat 64 17505450878873910550 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9786362194578560 + maskLow := BitVec.ofNat 64 4403415288087 + maskHigh := BitVec.ofNat 64 2308095393142932481 + systematicCode := BitVec.ofNat 64 18151422704745725206 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089337374655488 + maskLow := BitVec.ofNat 64 4899986768692054295 + maskHigh := BitVec.ofNat 64 2341871806232658945 + systematicCode := BitVec.ofNat 64 18153891885219659030 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711058771002368 + maskLow := BitVec.ofNat 64 4403415288087 + maskHigh := BitVec.ofNat 64 2341871807373524993 + systematicCode := BitVec.ofNat 64 18153936111168404758 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x3d1a. -/ +def normalizedWeightSixteenCandidateBucket_3d1a : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089856957973504 + maskLow := BitVec.ofNat 64 4611967515952750871 + maskHigh := BitVec.ofNat 64 2336462213121 + systematicCode := BitVec.ofNat 64 15261459422250351898 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711578354320384 + maskLow := BitVec.ofNat 64 17597554827543 + maskHigh := BitVec.ofNat 64 2337536016389 + systematicCode := BitVec.ofNat 64 15261499164187966746 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089788238283776 + maskLow := BitVec.ofNat 64 1154047427062341911 + maskHigh := BitVec.ofNat 64 9345848840193 + systematicCode := BitVec.ofNat 64 15478476616459697434 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711509634630656 + maskLow := BitVec.ofNat 64 17597554827543 + maskHigh := BitVec.ofNat 64 9346117533701 + systematicCode := BitVec.ofNat 64 15478513085581901082 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089341561897984 + maskLow := BitVec.ofNat 64 1477748996514071 + maskHigh := BitVec.ofNat 64 153122387330600961 + systematicCode := BitVec.ofNat 64 17503970458626506010 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711062958244864 + maskLow := BitVec.ofNat 64 17597554827543 + maskHigh := BitVec.ofNat 64 153122387330940929 + systematicCode := BitVec.ofNat 64 17503983915765349658 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9786341118479488 + maskLow := BitVec.ofNat 64 17597554827543 + maskHigh := BitVec.ofNat 64 180154980211101697 + systematicCode := BitVec.ofNat 64 17505446480894770458 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9786362159205504 + maskLow := BitVec.ofNat 64 17597554827543 + maskHigh := BitVec.ofNat 64 585468638752935937 + systematicCode := BitVec.ofNat 64 17864318245748096282 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089337503663104 + maskLow := BitVec.ofNat 64 5764677897147195671 + maskHigh := BitVec.ofNat 64 612489549322391553 + systematicCode := BitVec.ofNat 64 17865665907181567258 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711058900009984 + maskLow := BitVec.ofNat 64 17597554827543 + maskHigh := BitVec.ofNat 64 612489550664581121 + systematicCode := BitVec.ofNat 64 17865705752196824346 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x3d1f. -/ +def normalizedWeightSixteenCandidateBucket_3d1f : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9928078906133632 + maskLow := BitVec.ofNat 64 70374112985367 + maskHigh := BitVec.ofNat 64 155937137097719809 + systematicCode := BitVec.ofNat 64 17504056767000952095 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9852723973358592 + maskLow := BitVec.ofNat 64 70374112985367 + maskHigh := BitVec.ofNat 64 180143985094825217 + systematicCode := BitVec.ofNat 64 17505378040473795871 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36104663598138368 + maskLow := BitVec.ofNat 64 23095112990999 + maskHigh := BitVec.ofNat 64 180143985094836225 + systematicCode := BitVec.ofNat 64 17505383279309700383 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9852724772373504 + maskLow := BitVec.ofNat 64 70374112985367 + maskHigh := BitVec.ofNat 64 585467951558168657 + systematicCode := BitVec.ofNat 64 17864258601285926175 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36104664397153280 + maskLow := BitVec.ofNat 64 17941152235799 + maskHigh := BitVec.ofNat 64 585467951558180865 + systematicCode := BitVec.ofNat 64 17864263874481044767 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9852724774454272 + maskLow := BitVec.ofNat 64 70374112985367 + maskHigh := BitVec.ofNat 64 2308094809027380293 + systematicCode := BitVec.ofNat 64 18151358679417175327 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36104664399234048 + maskLow := BitVec.ofNat 64 4695473094935 + maskHigh := BitVec.ofNat 64 2308094809027395585 + systematicCode := BitVec.ofNat 64 18151368333545782559 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9852727999890432 + maskLow := BitVec.ofNat 64 70374112985367 + maskHigh := BitVec.ofNat 64 9223934986808197397 + systematicCode := BitVec.ofNat 64 18366683725181041951 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36104667624670208 + maskLow := BitVec.ofNat 64 1190779781399 + maskHigh := BitVec.ofNat 64 9223934986808213505 + systematicCode := BitVec.ofNat 64 18366696677794200863 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9928074915531904 + maskLow := BitVec.ofNat 64 70374112985367 + maskHigh := BitVec.ofNat 64 12141704595390873601 + systematicCode := BitVec.ofNat 64 18373551713297448223 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x3d23. -/ +def normalizedWeightSixteenCandidateBucket_3d23 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11329960536180992 + maskLow := BitVec.ofNat 64 1152926182900171031 + maskHigh := BitVec.ofNat 64 2251834173489153 + systematicCode := BitVec.ofNat 64 16629437691566243107 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9095752908540160 + maskLow := BitVec.ofNat 64 281480345616663 + maskHigh := BitVec.ofNat 64 2251834441860161 + systematicCode := BitVec.ofNat 64 16629464196750327075 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11329960685996288 + maskLow := BitVec.ofNat 64 288248248584569111 + maskHigh := BitVec.ofNat 64 9007336693760001 + systematicCode := BitVec.ofNat 64 16918793950512037155 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9095753058355456 + maskLow := BitVec.ofNat 64 281480345616663 + maskHigh := BitVec.ofNat 64 9007336760807489 + systematicCode := BitVec.ofNat 64 16918816091942239523 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11329973470234880 + maskLow := BitVec.ofNat 64 18036394110943511 + maskHigh := BitVec.ofNat 64 144117387099176961 + systematicCode := BitVec.ofNat 64 17497506468269931811 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9095765842594048 + maskLow := BitVec.ofNat 64 281480345616663 + maskHigh := BitVec.ofNat 64 144117387103310849 + systematicCode := BitVec.ofNat 64 17497519848100543779 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9024843047633152 + maskLow := BitVec.ofNat 64 281480345616663 + maskHigh := BitVec.ofNat 64 155514924632702977 + systematicCode := BitVec.ofNat 64 17504056749888453923 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9025392803447040 + maskLow := BitVec.ofNat 64 281480345616663 + maskHigh := BitVec.ofNat 64 9223374407676788737 + systematicCode := BitVec.ofNat 64 18362244163986079011 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11329423748237568 + maskLow := BitVec.ofNat 64 1459166284636946711 + maskHigh := BitVec.ofNat 64 9223512774343196673 + systematicCode := BitVec.ofNat 64 18365575348473380131 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9095216120596736 + maskLow := BitVec.ofNat 64 281480345616663 + maskHigh := BitVec.ofNat 64 9223512774682869761 + systematicCode := BitVec.ofNat 64 18365601995389222179 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x3d26. -/ +def normalizedWeightSixteenCandidateBucket_3d26 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089720463754240 + maskLow := BitVec.ofNat 64 4611687192027791639 + maskHigh := BitVec.ofNat 64 562984313421825 + systematicCode := BitVec.ofNat 64 16413268220821716262 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711441860101120 + maskLow := BitVec.ofNat 64 1125905276141847 + maskHigh := BitVec.ofNat 64 562985386901777 + systematicCode := BitVec.ofNat 64 16413294700236389670 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089719899620352 + maskLow := BitVec.ofNat 64 288248042426532119 + maskHigh := BitVec.ofNat 64 9007749010817025 + systematicCode := BitVec.ofNat 64 16919641673976855846 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711441295967232 + maskLow := BitVec.ofNat 64 1125905276141847 + maskHigh := BitVec.ofNat 64 9007749077667857 + systematicCode := BitVec.ofNat 64 16919660516822236454 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089716437222400 + maskLow := BitVec.ofNat 64 18033095576453399 + maskHigh := BitVec.ofNat 64 144123984169140225 + systematicCode := BitVec.ofNat 64 17498354191734750502 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711437833569280 + maskLow := BitVec.ofNat 64 1125905276141847 + maskHigh := BitVec.ofNat 64 144123984173076737 + systematicCode := BitVec.ofNat 64 17498364272980540710 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9785693254716544 + maskLow := BitVec.ofNat 64 1125905276141847 + maskHigh := BitVec.ofNat 64 153826074772635649 + systematicCode := BitVec.ofNat 64 17504053451404098854 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9788407672753280 + maskLow := BitVec.ofNat 64 1125905276141847 + maskHigh := BitVec.ofNat 64 2305852389422530561 + systematicCode := BitVec.ofNat 64 18146919105387838758 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089201009443840 + maskLow := BitVec.ofNat 64 4917930798457880855 + maskHigh := BitVec.ofNat 64 2305983746702311425 + systematicCode := BitVec.ofNat 64 18149405877779381542 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9710922405790720 + maskLow := BitVec.ofNat 64 1125905276141847 + maskHigh := BitVec.ofNat 64 2305983747847094273 + systematicCode := BitVec.ofNat 64 18149432511810518310 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x3d2a. -/ +def normalizedWeightSixteenCandidateBucket_3d2a : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089720592761856 + maskLow := BitVec.ofNat 64 4611687140489756951 + maskHigh := BitVec.ofNat 64 563087393423361 + systematicCode := BitVec.ofNat 64 16414398518774807850 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711441989108736 + maskLow := BitVec.ofNat 64 4503604998242583 + maskHigh := BitVec.ofNat 64 563088466116869 + systematicCode := BitVec.ofNat 64 16414420600076385578 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089720055677952 + maskLow := BitVec.ofNat 64 1152925925204099351 + maskHigh := BitVec.ofNat 64 2252349570547713 + systematicCode := BitVec.ofNat 64 16631415712984153386 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711441452024832 + maskLow := BitVec.ofNat 64 4503604998242583 + maskHigh := BitVec.ofNat 64 2252349837935621 + systematicCode := BitVec.ofNat 64 16631434521470319914 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089716566230016 + maskLow := BitVec.ofNat 64 18019901438492951 + maskHigh := BitVec.ofNat 64 144150372448993281 + systematicCode := BitVec.ofNat 64 17499484489620995370 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711437962576896 + maskLow := BitVec.ofNat 64 4503604998242583 + maskHigh := BitVec.ofNat 64 144150372452140289 + systematicCode := BitVec.ofNat 64 17499490155707776298 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9785693383724160 + maskLow := BitVec.ofNat 64 4503604998242583 + maskHigh := BitVec.ofNat 64 147070675332366337 + systematicCode := BitVec.ofNat 64 17502927551564627242 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9788407637380224 + maskLow := BitVec.ofNat 64 4503604998242583 + maskHigh := BitVec.ofNat 64 576496623871328257 + systematicCode := BitVec.ofNat 64 17859814646390209834 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089201138451456 + maskLow := BitVec.ofNat 64 5782621926914588951 + maskHigh := BitVec.ofNat 64 576601489792827393 + systematicCode := BitVec.ofNat 64 17861179899741289770 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9710922534798336 + maskLow := BitVec.ofNat 64 4503604998242583 + maskHigh := BitVec.ofNat 64 576601491138150401 + systematicCode := BitVec.ofNat 64 17861202152838937898 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x3d2f. -/ +def normalizedWeightSixteenCandidateBucket_3d2f : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9926953893137536 + maskLow := BitVec.ofNat 64 18014403886645527 + maskHigh := BitVec.ofNat 64 144161367568416769 + systematicCode := BitVec.ofNat 64 17499535506737544495 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9851667142968320 + maskLow := BitVec.ofNat 64 18014403886645527 + maskHigh := BitVec.ofNat 64 144255925565587457 + systematicCode := BitVec.ofNat 64 17500892102021430575 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36103606767748096 + maskLow := BitVec.ofNat 64 5910979888087319 + maskHigh := BitVec.ofNat 64 144255925568405505 + systematicCode := BitVec.ofNat 64 17500897340857335087 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9851770215891968 + maskLow := BitVec.ofNat 64 18014403886645527 + maskHigh := BitVec.ofNat 64 576495936676560977 + systematicCode := BitVec.ofNat 64 17859772593845648687 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36103709840671744 + maskLow := BitVec.ofNat 64 4503948601917719 + maskHigh := BitVec.ofNat 64 576495936679706625 + systematicCode := BitVec.ofNat 64 17859777935759195439 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9851770217972736 + maskLow := BitVec.ofNat 64 18014403886645527 + maskHigh := BitVec.ofNat 64 2305851805306978373 + systematicCode := BitVec.ofNat 64 18146872671976897839 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36103709842752512 + maskLow := BitVec.ofNat 64 1126197341782295 + maskHigh := BitVec.ofNat 64 2305851805310910465 + systematicCode := BitVec.ofNat 64 18146882394823933231 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9852182539043840 + maskLow := BitVec.ofNat 64 18014403886645527 + maskHigh := BitVec.ofNat 64 9223374235878096917 + systematicCode := BitVec.ofNat 64 18362197717740764463 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36104122163823616 + maskLow := BitVec.ofNat 64 281566253220119 + maskHigh := BitVec.ofNat 64 9223374235882225665 + systematicCode := BitVec.ofNat 64 18362210739072351535 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9926438532992128 + maskLow := BitVec.ofNat 64 18014403886645527 + maskHigh := BitVec.ofNat 64 12105816535864442881 + systematicCode := BitVec.ofNat 64 18373551644847455535 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x3d32. -/ +def normalizedWeightSixteenCandidateBucket_3d32 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089736573060096 + maskLow := BitVec.ofNat 64 4611686109729063191 + maskHigh := BitVec.ofNat 64 565148993454081 + systematicCode := BitVec.ofNat 64 16416659114547297586 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711457969406976 + maskLow := BitVec.ofNat 64 72057599440257303 + maskHigh := BitVec.ofNat 64 565150050418709 + systematicCode := BitVec.ofNat 64 16416672365530856754 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089736568652800 + maskLow := BitVec.ofNat 64 1152921802066952471 + maskHigh := BitVec.ofNat 64 2260595923484673 + systematicCode := BitVec.ofNat 64 16633676308756643122 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711457964999680 + maskLow := BitVec.ofNat 64 72057599440257303 + maskHigh := BitVec.ofNat 64 2260596175142981 + systematicCode := BitVec.ofNat 64 16633686286924791090 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089736541602816 + maskLow := BitVec.ofNat 64 288230725151424791 + maskHigh := BitVec.ofNat 64 9042383643607041 + systematicCode := BitVec.ofNat 64 16923032567635590450 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9711457937949696 + maskLow := BitVec.ofNat 64 72057599440257303 + maskHigh := BitVec.ofNat 64 9042383693938769 + systematicCode := BitVec.ofNat 64 16923038165003943218 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9785709364022400 + maskLow := BitVec.ofNat 64 72057599440257303 + maskHigh := BitVec.ofNat 64 11962686526980097 + systematicCode := BitVec.ofNat 64 16926466799395945778 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9788402576952448 + maskLow := BitVec.ofNat 64 72057599440257303 + maskHigh := BitVec.ofNat 64 36074976524107777 + systematicCode := BitVec.ofNat 64 17283362724674288946 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18089217118749696 + maskLow := BitVec.ofNat 64 6052837904588275991 + maskHigh := BitVec.ofNat 64 36169534524096513 + systematicCode := BitVec.ofNat 64 17284727943531412786 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9710938515096576 + maskLow := BitVec.ofNat 64 72057599440257303 + maskHigh := BitVec.ofNat 64 36169535916605441 + systematicCode := BitVec.ofNat 64 17284741400670256434 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x3d37. -/ +def normalizedWeightSixteenCandidateBucket_3d37 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9926941907913856 + maskLow := BitVec.ofNat 64 288230381654704407 + maskHigh := BitVec.ofNat 64 9043070888706049 + systematicCode := BitVec.ofNat 64 16923065924116102455 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9851659685495808 + maskLow := BitVec.ofNat 64 288230381654704407 + maskHigh := BitVec.ofNat 64 9147936760201217 + systematicCode := BitVec.ofNat 64 16924440145811553591 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36103599310275584 + maskLow := BitVec.ofNat 64 73464974424473879 + maskHigh := BitVec.ofNat 64 9147936810205185 + systematicCode := BitVec.ofNat 64 16924445419006672183 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9851761959404544 + maskLow := BitVec.ofNat 64 288230381654704407 + maskHigh := BitVec.ofNat 64 36063981407831297 + systematicCode := BitVec.ofNat 64 17283320672129727799 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36103701584184320 + maskLow := BitVec.ofNat 64 72063097099059479 + maskHigh := BitVec.ofNat 64 36063981458161665 + systematicCode := BitVec.ofNat 64 17283326014043274551 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9851762227823616 + maskLow := BitVec.ofNat 64 288230381654704407 + maskHigh := BitVec.ofNat 64 2305843558969771013 + systematicCode := BitVec.ofNat 64 18144620906523475255 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36103701852603392 + maskLow := BitVec.ofNat 64 1130320636215575 + maskHigh := BitVec.ofNat 64 2305843559036616705 + systematicCode := BitVec.ofNat 64 18144639391237487927 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9852175081571328 + maskLow := BitVec.ofNat 64 288230381654704407 + maskHigh := BitVec.ofNat 64 9223372174293795077 + systematicCode := BitVec.ofNat 64 18359945952287341879 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36104114706351104 + maskLow := BitVec.ofNat 64 282597171200279 + maskHigh := BitVec.ofNat 64 9223372174360838145 + systematicCode := BitVec.ofNat 64 18359967735485906231 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9926431075519616 + maskLow := BitVec.ofNat 64 288230381654704407 + maskHigh := BitVec.ofNat 64 11565384580642897921 + systematicCode := BitVec.ofNat 64 18373542848889175351 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x3d3b. -/ +def normalizedWeightSixteenCandidateBucket_3d3b : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9926941810117760 + maskLow := BitVec.ofNat 64 1152921510512492823 + maskHigh := BitVec.ofNat 64 2261180290695169 + systematicCode := BitVec.ofNat 64 16633709630945049915 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9851659623072768 + maskLow := BitVec.ofNat 64 1152921510512492823 + maskHigh := BitVec.ofNat 64 2392537319931905 + systematicCode := BitVec.ofNat 64 16636209786839973179 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36103599247852544 + maskLow := BitVec.ofNat 64 76842674547654935 + maskHigh := BitVec.ofNat 64 2392537570476033 + systematicCode := BitVec.ofNat 64 16636219440968580411 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9851761896981504 + maskLow := BitVec.ofNat 64 1152921510512492823 + maskHigh := BitVec.ofNat 64 36037593128767745 + systematicCode := BitVec.ofNat 64 17282194789403016507 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36103701521761280 + maskLow := BitVec.ofNat 64 72076291641245975 + maskHigh := BitVec.ofNat 64 36037593380421633 + systematicCode := BitVec.ofNat 64 17282204512250051899 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9851762163319808 + maskLow := BitVec.ofNat 64 1152921510512492823 + maskHigh := BitVec.ofNat 64 576461302060290065 + systematicCode := BitVec.ofNat 64 17856394945665514811 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36103701788099584 + maskLow := BitVec.ofNat 64 4521266438537495 + maskHigh := BitVec.ofNat 64 576461302327672833 + systematicCode := BitVec.ofNat 64 17856413430379527483 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9852175019148288 + maskLow := BitVec.ofNat 64 1152921510512492823 + maskHigh := BitVec.ofNat 64 9223372071214579985 + systematicCode := BitVec.ofNat 64 18358820052447870267 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36104114643928064 + maskLow := BitVec.ofNat 64 282649113461015 + maskHigh := BitVec.ofNat 64 9223372071482949633 + systematicCode := BitVec.ofNat 64 18358846233625836859 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9926431013096576 + maskLow := BitVec.ofNat 64 1152921510512492823 + maskHigh := BitVec.ofNat 64 9836002323933954049 + systematicCode := BitVec.ofNat 64 18372416949049703739 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x3e07. -/ +def normalizedWeightSixteenCandidateBucket_3e07 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10204569732924032 + maskLow := BitVec.ofNat 64 580981950559355167 + maskHigh := BitVec.ofNat 64 412316860425 + systematicCode := BitVec.ofNat 64 14829094041162366471 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9087465919103616 + maskLow := BitVec.ofNat 64 40802255135 + maskHigh := BitVec.ofNat 64 412452130817 + systematicCode := BitVec.ofNat 64 14829147033272991239 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10204588909281920 + maskLow := BitVec.ofNat 64 108103989685453087 + maskHigh := BitVec.ofNat 64 6597069766665 + systematicCode := BitVec.ofNat 64 15407806567610334727 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9087485095461504 + maskLow := BitVec.ofNat 64 40802255135 + maskHigh := BitVec.ofNat 64 6597094936577 + systematicCode := BitVec.ofNat 64 15407853014090137095 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10206225291821696 + maskLow := BitVec.ofNat 64 76701937596170527 + maskHigh := BitVec.ofNat 64 1688849860263945 + systematicCode := BitVec.ofNat 64 16565231671744282119 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9089121478001280 + maskLow := BitVec.ofNat 64 40802255135 + maskHigh := BitVec.ofNat 64 1688849878122497 + systematicCode := BitVec.ofNat 64 16565278092655214087 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2262803536693376 + maskLow := BitVec.ofNat 64 40802255135 + maskHigh := BitVec.ofNat 64 2306973582044954633 + systematicCode := BitVec.ofNat 64 18151148951884414471 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2262803536953472 + maskLow := BitVec.ofNat 64 40802255135 + maskHigh := BitVec.ofNat 64 4612251304843018249 + systematicCode := BitVec.ofNat 64 18294698982393658887 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10206229620083328 + maskLow := BitVec.ofNat 64 612630293253259551 + maskHigh := BitVec.ofNat 64 6917529027641081865 + systematicCode := BitVec.ofNat 64 18301369353966075399 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9089125806262912 + maskLow := BitVec.ofNat 64 40802255135 + maskHigh := BitVec.ofNat 64 6917529027783720961 + systematicCode := BitVec.ofNat 64 18301422371846110727 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x3e0b. -/ +def normalizedWeightSixteenCandidateBucket_3e0b : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10204569601835648 + maskLow := BitVec.ofNat 64 2306973313609564471 + maskHigh := BitVec.ofNat 64 309237645345 + systematicCode := BitVec.ofNat 64 14827972556414533131 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9087465788015232 + maskLow := BitVec.ofNat 64 143881470263 + maskHigh := BitVec.ofNat 64 309774779393 + systematicCode := BitVec.ofNat 64 14828025514165943819 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10204588928008832 + maskLow := BitVec.ofNat 64 108090795545919799 + maskHigh := BitVec.ofNat 64 19791209300001 + systematicCode := BitVec.ofNat 64 15696041341808295435 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9087485114188416 + maskLow := BitVec.ofNat 64 143881470263 + maskHigh := BitVec.ofNat 64 19791234466817 + systematicCode := BitVec.ofNat 64 15696083390175002123 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10206225310548608 + maskLow := BitVec.ofNat 64 73324237875642679 + maskHigh := BitVec.ofNat 64 5066549580791841 + systematicCode := BitVec.ofNat 64 16853466445875396107 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9089121496728192 + maskLow := BitVec.ofNat 64 143881470263 + maskHigh := BitVec.ofNat 64 5066549597863937 + systematicCode := BitVec.ofNat 64 16853508451627318795 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2262803522128000 + maskLow := BitVec.ofNat 64 143881470263 + maskHigh := BitVec.ofNat 64 580982218994745377 + systematicCode := BitVec.ofNat 64 17864048873753427467 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2262803555680384 + maskLow := BitVec.ofNat 64 143881470263 + maskHigh := BitVec.ofNat 64 4612251201763803169 + systematicCode := BitVec.ofNat 64 18294698965281160715 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10206229572225664 + maskLow := BitVec.ofNat 64 2342012550163530039 + maskHigh := BitVec.ofNat 64 5188146770730811425 + systematicCode := BitVec.ofNat 64 18300247869285613067 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9089125758405248 + maskLow := BitVec.ofNat 64 143881470263 + maskHigh := BitVec.ofNat 64 5188146771276103681 + systematicCode := BitVec.ofNat 64 18300300869986041355 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x3e0d. -/ +def normalizedWeightSixteenCandidateBucket_3e0d : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10204569600616448 + maskLow := BitVec.ofNat 64 4612251173846581591 + maskHigh := BitVec.ofNat 64 171798691905 + systematicCode := BitVec.ofNat 64 14683859575918181901 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9087465786796032 + maskLow := BitVec.ofNat 64 281320423767 + maskHigh := BitVec.ofNat 64 172872565249 + systematicCode := BitVec.ofNat 64 14683912516489985549 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10204588927960064 + maskLow := BitVec.ofNat 64 108088596522664279 + maskHigh := BitVec.ofNat 64 21990232555585 + systematicCode := BitVec.ofNat 64 15696606490784841229 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9087485114139648 + maskLow := BitVec.ofNat 64 281320423767 + maskHigh := BitVec.ofNat 64 21990257721857 + systematicCode := BitVec.ofNat 64 15696646340095000077 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10206225310499840 + maskLow := BitVec.ofNat 64 72761287922221399 + maskHigh := BitVec.ofNat 64 5629499534213185 + systematicCode := BitVec.ofNat 64 16854031594818518541 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9089121496679424 + maskLow := BitVec.ofNat 64 281320423767 + maskHigh := BitVec.ofNat 64 5629499551154177 + systematicCode := BitVec.ofNat 64 16854071392990936589 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2262803522274304 + maskLow := BitVec.ofNat 64 281320423767 + maskHigh := BitVec.ofNat 64 580982081555791937 + systematicCode := BitVec.ofNat 64 17864048865197178381 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2262803555566592 + maskLow := BitVec.ofNat 64 281320423767 + maskHigh := BitVec.ofNat 64 2306973341526786113 + systematicCode := BitVec.ofNat 64 18151148926215667213 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10206229572176896 + maskLow := BitVec.ofNat 64 4647855559377224023 + maskHigh := BitVec.ofNat 64 2882303761517117505 + systematicCode := BitVec.ofNat 64 18156134888822947341 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9089125758356480 + maskLow := BitVec.ofNat 64 281320423767 + maskHigh := BitVec.ofNat 64 2882303762599280641 + systematicCode := BitVec.ofNat 64 18156187880933572109 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x3e13. -/ +def normalizedWeightSixteenCandidateBucket_3e13 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10204571998880384 + maskLow := BitVec.ofNat 64 2306969190440960791 + maskHigh := BitVec.ofNat 64 4432406249985 + systematicCode := BitVec.ofNat 64 15404442104810454547 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9087468185059968 + maskLow := BitVec.ofNat 64 2205465772823 + maskHigh := BitVec.ofNat 64 4432943382593 + systematicCode := BitVec.ofNat 64 15404486266335673875 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10204572148695680 + maskLow := BitVec.ofNat 64 580964633251218199 + maskHigh := BitVec.ofNat 64 17729624998401 + systematicCode := BitVec.ofNat 64 15693798363756248595 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9087468334875264 + maskLow := BitVec.ofNat 64 2205465772823 + maskHigh := BitVec.ofNat 64 17729760264257 + systematicCode := BitVec.ofNat 64 15693838161527586323 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10206221315474048 + maskLow := BitVec.ofNat 64 5770243465085719 + maskHigh := BitVec.ofNat 64 72620543991349761 + systematicCode := BitVec.ofNat 64 17429935959912103443 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9089117501653632 + maskLow := BitVec.ofNat 64 2205465772823 + maskHigh := BitVec.ofNat 64 72620543992692737 + systematicCode := BitVec.ofNat 64 17429960407838244371 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2262795265640576 + maskLow := BitVec.ofNat 64 2205465772823 + maskHigh := BitVec.ofNat 64 108108381289447937 + systematicCode := BitVec.ofNat 64 17433392193880604179 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2262799560605824 + maskLow := BitVec.ofNat 64 2205465772823 + maskHigh := BitVec.ofNat 64 4612249140179501569 + systematicCode := BitVec.ofNat 64 18294690169322880531 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10206217054325376 + maskLow := BitVec.ofNat 64 2882444505447990039 + maskHigh := BitVec.ofNat 64 4647714815446352385 + systematicCode := BitVec.ofNat 64 18298004865699167763 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9089113240504960 + maskLow := BitVec.ofNat 64 2205465772823 + maskHigh := BitVec.ofNat 64 4647714816117473281 + systematicCode := BitVec.ofNat 64 18298049104532618771 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x3e15. -/ +def normalizedWeightSixteenCandidateBucket_3e15 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10204571997661184 + maskLow := BitVec.ofNat 64 4612249112262280471 + maskHigh := BitVec.ofNat 64 2233382994945 + systematicCode := BitVec.ofNat 64 15260329124314103317 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9087468183840768 + maskLow := BitVec.ofNat 64 4404489028887 + maskHigh := BitVec.ofNat 64 2234456866849 + systematicCode := BitVec.ofNat 64 15260373268659715605 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10204572148646912 + maskLow := BitVec.ofNat 64 580964495812265239 + maskHigh := BitVec.ofNat 64 17867063952385 + systematicCode := BitVec.ofNat 64 15694363512732794389 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9087468334826496 + maskLow := BitVec.ofNat 64 4404489028887 + maskHigh := BitVec.ofNat 64 17867199217697 + systematicCode := BitVec.ofNat 64 15694401111447584277 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10206221315425280 + maskLow := BitVec.ofNat 64 5207293511664919 + maskHigh := BitVec.ofNat 64 73183493944771585 + systematicCode := BitVec.ofNat 64 17430501108855225877 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9089117501604864 + maskLow := BitVec.ofNat 64 4404489028887 + maskHigh := BitVec.ofNat 64 73183493945982977 + systematicCode := BitVec.ofNat 64 17430523349201862165 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2262795265786880 + maskLow := BitVec.ofNat 64 4404489028887 + maskHigh := BitVec.ofNat 64 108106182266192897 + systematicCode := BitVec.ofNat 64 17433392185324355093 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2262799560492032 + maskLow := BitVec.ofNat 64 4404489028887 + maskHigh := BitVec.ofNat 64 2306969218358182913 + systematicCode := BitVec.ofNat 64 18151140130257387029 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10206217054276608 + maskLow := BitVec.ofNat 64 5188287514661684503 + maskHigh := BitVec.ofNat 64 2341871806232658945 + systematicCode := BitVec.ofNat 64 18153891885236502037 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9089113240456192 + maskLow := BitVec.ofNat 64 4404489028887 + maskHigh := BitVec.ofNat 64 2341871807440650241 + systematicCode := BitVec.ofNat 64 18153936115480149525 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x3e19. -/ +def normalizedWeightSixteenCandidateBucket_3e19 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10204571991418880 + maskLow := BitVec.ofNat 64 4612249009183068439 + maskHigh := BitVec.ofNat 64 2336462213121 + systematicCode := BitVec.ofNat 64 15261459422267194905 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9087468177598464 + maskLow := BitVec.ofNat 64 17598628565271 + maskHigh := BitVec.ofNat 64 2337536081929 + systematicCode := BitVec.ofNat 64 15261499168499711513 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10204571992589312 + maskLow := BitVec.ofNat 64 2306968949922795799 + maskHigh := BitVec.ofNat 64 4672924422145 + systematicCode := BitVec.ofNat 64 15406137551740091929 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9087468178768896 + maskLow := BitVec.ofNat 64 17598628565271 + maskHigh := BitVec.ofNat 64 4673461551113 + systematicCode := BitVec.ofNat 64 15406175116095667737 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10206221259244544 + maskLow := BitVec.ofNat 64 1829593791140119 + maskHigh := BitVec.ofNat 64 76561193665302529 + systematicCode := BitVec.ofNat 64 17431631389628710425 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9089117445424128 + maskLow := BitVec.ofNat 64 17598628565271 + maskHigh := BitVec.ofNat 64 76561193665724417 + systematicCode := BitVec.ofNat 64 17431644851062455833 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2262795234575360 + maskLow := BitVec.ofNat 64 17598628565271 + maskHigh := BitVec.ofNat 64 108092988126662657 + systematicCode := BitVec.ofNat 64 17433387787345215001 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2262799495988224 + maskLow := BitVec.ofNat 64 17598628565271 + maskHigh := BitVec.ofNat 64 580964764247658497 + systematicCode := BitVec.ofNat 64 17864035671259758105 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10206216998095872 + maskLow := BitVec.ofNat 64 6917669771571958039 + maskHigh := BitVec.ofNat 64 612489549322391553 + systematicCode := BitVec.ofNat 64 17865665907198410265 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9089113184275456 + maskLow := BitVec.ofNat 64 17598628565271 + maskHigh := BitVec.ofNat 64 612489550933032961 + systematicCode := BitVec.ofNat 64 17865705756508569113 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x3e1f. -/ +def normalizedWeightSixteenCandidateBucket_3e1f : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9024864894340224 + maskLow := BitVec.ofNat 64 140743930904855 + maskHigh := BitVec.ofNat 64 78250043525595137 + systematicCode := BitVec.ofNat 64 17431716598491528735 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 45124575984110720 + maskLow := BitVec.ofNat 64 140743930904855 + maskHigh := BitVec.ofNat 64 108086391056897537 + systematicCode := BitVec.ofNat 64 17433320446452710943 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11611461569498240 + maskLow := BitVec.ofNat 64 24195698360599 + maskHigh := BitVec.ofNat 64 108086391056924673 + systematicCode := BitVec.ofNat 64 17433326784783466015 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 45124580245523584 + maskLow := BitVec.ofNat 64 140743930904855 + maskHigh := BitVec.ofNat 64 580964351930798177 + systematicCode := BitVec.ofNat 64 17863977126326058527 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11611465830911104 + maskLow := BitVec.ofNat 64 18010945454359 + maskHigh := BitVec.ofNat 64 580964351930826753 + systematicCode := BitVec.ofNat 64 17863983499016027679 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 45124580345400448 + maskLow := BitVec.ofNat 64 140743930904855 + maskHigh := BitVec.ofNat 64 2306968909120537673 + systematicCode := BitVec.ofNat 64 18151077204457307679 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11611465930787968 + maskLow := BitVec.ofNat 64 4713726705943 + maskHigh := BitVec.ofNat 64 2306968909120569345 + systematicCode := BitVec.ofNat 64 18151087958080765471 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 45124580345790592 + maskLow := BitVec.ofNat 64 140743930904855 + maskHigh := BitVec.ofNat 64 4612248968380809769 + systematicCode := BitVec.ofNat 64 18294627234966552095 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11611465931178112 + maskLow := BitVec.ofNat 64 2377264496919 + maskHigh := BitVec.ofNat 64 4612248968380841985 + systematicCode := BitVec.ofNat 64 18294640187579711007 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9024860565554304 + maskLow := BitVec.ofNat 64 140743930904855 + maskHigh := BitVec.ofNat 64 7530018576963502081 + systematicCode := BitVec.ofNat 64 18301494119276363295 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x3e23. -/ +def normalizedWeightSixteenCandidateBucket_3e23 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10204060629336704 + maskLow := BitVec.ofNat 64 2305847688580759831 + maskHigh := BitVec.ofNat 64 1125934266712065 + systematicCode := BitVec.ofNat 64 16557381201334910499 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9086956815516288 + maskLow := BitVec.ofNat 64 562956396069143 + maskHigh := BitVec.ofNat 64 1125934803452993 + systematicCode := BitVec.ofNat 64 16557407702224092707 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10204060779152000 + maskLow := BitVec.ofNat 64 576478625810022679 + maskHigh := BitVec.ofNat 64 4503737066455041 + systematicCode := BitVec.ofNat 64 16846737460280704547 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9086956965331584 + maskLow := BitVec.ofNat 64 562956396069143 + maskHigh := BitVec.ofNat 64 4503737200545857 + systematicCode := BitVec.ofNat 64 16846759597416005155 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10204073563390592 + maskLow := BitVec.ofNat 64 36050793694167319 + maskHigh := BitVec.ofNat 64 72059793061314561 + systematicCode := BitVec.ofNat 64 17425449978038599203 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9086969749570176 + maskLow := BitVec.ofNat 64 562956396069143 + maskHigh := BitVec.ofNat 64 72059793069577217 + systematicCode := BitVec.ofNat 64 17425463353574309411 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2260647513557120 + maskLow := BitVec.ofNat 64 562956396069143 + maskHigh := BitVec.ofNat 64 77827831060627457 + systematicCode := BitVec.ofNat 64 17431716581379030563 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2261197269368960 + maskLow := BitVec.ofNat 64 562956396069143 + maskHigh := BitVec.ofNat 64 4611688389249466369 + systematicCode := BitVec.ofNat 64 18290186569964994083 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10203523841395328 + maskLow := BitVec.ofNat 64 2918332564978729239 + maskHigh := BitVec.ofNat 64 4611826755915874305 + systematicCode := BitVec.ofNat 64 18293518858258890275 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9086420027574912 + maskLow := BitVec.ofNat 64 562956396069143 + maskHigh := BitVec.ofNat 64 4611826756595220481 + systematicCode := BitVec.ofNat 64 18293545505174732323 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x3e25. -/ +def normalizedWeightSixteenCandidateBucket_3e25 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10204060628117504 + maskLow := BitVec.ofNat 64 4611688361332375831 + maskHigh := BitVec.ofNat 64 562984313421825 + systematicCode := BitVec.ofNat 64 16413268220838559269 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9086956814297088 + maskLow := BitVec.ofNat 64 1125906349621527 + maskHigh := BitVec.ofNat 64 562985386902049 + systematicCode := BitVec.ofNat 64 16413294704548134437 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10204060779103232 + maskLow := BitVec.ofNat 64 576478488371200279 + maskHigh := BitVec.ofNat 64 4503874505539585 + systematicCode := BitVec.ofNat 64 16847302609257250341 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9086956965282816 + maskLow := BitVec.ofNat 64 1125906349621527 + maskHigh := BitVec.ofNat 64 4503874639499297 + systematicCode := BitVec.ofNat 64 16847322547336003109 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10204073563341824 + maskLow := BitVec.ofNat 64 36048594671042839 + maskHigh := BitVec.ofNat 64 72061992084701185 + systematicCode := BitVec.ofNat 64 17426015127015144997 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9086969749521408 + maskLow := BitVec.ofNat 64 1125906349621527 + maskHigh := BitVec.ofNat 64 72061992092832257 + systematicCode := BitVec.ofNat 64 17426026303494307365 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2260647513703424 + maskLow := BitVec.ofNat 64 1125906349621527 + maskHigh := BitVec.ofNat 64 77264881107337217 + systematicCode := BitVec.ofNat 64 17431714382389460517 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2261197269255168 + maskLow := BitVec.ofNat 64 1125906349621527 + maskHigh := BitVec.ofNat 64 2305847716498112513 + systematicCode := BitVec.ofNat 64 18146636530899500581 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10203523841346560 + maskLow := BitVec.ofNat 64 5224175574192554263 + maskHigh := BitVec.ofNat 64 2305983746702311425 + systematicCode := BitVec.ofNat 64 18149405877796224549 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9086420027526144 + maskLow := BitVec.ofNat 64 1125906349621527 + maskHigh := BitVec.ofNat 64 2305983747918397441 + systematicCode := BitVec.ofNat 64 18149432516122263077 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x3e29. -/ +def normalizedWeightSixteenCandidateBucket_3e29 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10204060621875200 + maskLow := BitVec.ofNat 64 4611688258253947159 + maskHigh := BitVec.ofNat 64 563087393423361 + systematicCode := BitVec.ofNat 64 16414398518791650857 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9086956808054784 + maskLow := BitVec.ofNat 64 4503606070935831 + maskHigh := BitVec.ofNat 64 563088466117129 + systematicCode := BitVec.ofNat 64 16414420604388130345 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10204060623045632 + maskLow := BitVec.ofNat 64 2305847448063508759 + maskHigh := BitVec.ofNat 64 1126174785798145 + systematicCode := BitVec.ofNat 64 16559076648264547881 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9086956809225216 + maskLow := BitVec.ofNat 64 4503606070935831 + maskHigh := BitVec.ofNat 64 1126175321621513 + systematicCode := BitVec.ofNat 64 16559096551984086569 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10204073507161088 + maskLow := BitVec.ofNat 64 36035400532295959 + maskHigh := BitVec.ofNat 64 72075186225020929 + systematicCode := BitVec.ofNat 64 17427145424901389865 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9086969693340672 + maskLow := BitVec.ofNat 64 4503606070935831 + maskHigh := BitVec.ofNat 64 72075186232362497 + systematicCode := BitVec.ofNat 64 17427152186221542953 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2260647482491904 + maskLow := BitVec.ofNat 64 4503606070935831 + maskHigh := BitVec.ofNat 64 73887181387595777 + systematicCode := BitVec.ofNat 64 17430588482549988905 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2261197204751360 + maskLow := BitVec.ofNat 64 4503606070935831 + maskHigh := BitVec.ofNat 64 576478756807376897 + systematicCode := BitVec.ofNat 64 17859532071901871657 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10203523785165824 + maskLow := BitVec.ofNat 64 6953557831103611159 + maskHigh := BitVec.ofNat 64 576601489792827393 + systematicCode := BitVec.ofNat 64 17861179899758132777 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9086419971345408 + maskLow := BitVec.ofNat 64 4503606070935831 + maskHigh := BitVec.ofNat 64 576601491410780161 + systematicCode := BitVec.ofNat 64 17861202157150682665 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x3e2f. -/ +def normalizedWeightSixteenCandidateBucket_3e2f : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9025376263883904 + maskLow := BitVec.ofNat 64 36028803469869335 + maskHigh := BitVec.ofNat 64 72081783302127617 + systematicCode := BitVec.ofNat 64 17427195338228121135 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 45123996431961216 + maskLow := BitVec.ofNat 64 36028803469869335 + maskHigh := BitVec.ofNat 64 72198331527725057 + systematicCode := BitVec.ofNat 64 17428834508000345647 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11610882017348736 + maskLow := BitVec.ofNat 64 6192455938539799 + maskHigh := BitVec.ofNat 64 72198331534671873 + systematicCode := BitVec.ofNat 64 17428840846331100719 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 45124546154220672 + maskLow := BitVec.ofNat 64 36028803469869335 + maskHigh := BitVec.ofNat 64 576478344490516577 + systematicCode := BitVec.ofNat 64 17859491118885781039 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11611431739608192 + maskLow := BitVec.ofNat 64 4504018395136279 + maskHigh := BitVec.ofNat 64 576478344497856513 + systematicCode := BitVec.ofNat 64 17859497560294178351 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 45124546254097536 + maskLow := BitVec.ofNat 64 36028803469869335 + maskHigh := BitVec.ofNat 64 2305847407260467273 + systematicCode := BitVec.ofNat 64 18146591197017030191 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11611431839485056 + maskLow := BitVec.ofNat 64 1126215595393303 + maskHigh := BitVec.ofNat 64 2305847407268593665 + systematicCode := BitVec.ofNat 64 18146602019358916143 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 45124546254487680 + maskLow := BitVec.ofNat 64 36028803469869335 + maskHigh := BitVec.ofNat 64 4611688217450774569 + systematicCode := BitVec.ofNat 64 18290141227526274607 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11611431839875200 + maskLow := BitVec.ofNat 64 563128203018519 + maskHigh := BitVec.ofNat 64 4611688217459032065 + systematicCode := BitVec.ofNat 64 18290154248857861679 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9024826474251392 + maskLow := BitVec.ofNat 64 36028803469869335 + maskHigh := BitVec.ofNat 64 7494130517441249281 + systematicCode := BitVec.ofNat 64 18301494050826370607 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x3e31. -/ +def normalizedWeightSixteenCandidateBucket_3e31 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10204053430740992 + maskLow := BitVec.ofNat 64 4611686196685373719 + maskHigh := BitVec.ofNat 64 565148993454081 + systematicCode := BitVec.ofNat 64 16416659114564140593 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9086949616920576 + maskLow := BitVec.ofNat 64 72057600497221911 + maskHigh := BitVec.ofNat 64 565150050418729 + systematicCode := BitVec.ofNat 64 16416672369842601521 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10204053431911424 + maskLow := BitVec.ofNat 64 2305843324910633239 + maskHigh := BitVec.ofNat 64 1130297970130945 + systematicCode := BitVec.ofNat 64 16561337244037037617 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9086949618091008 + maskLow := BitVec.ofNat 64 72057600497221911 + maskHigh := BitVec.ofNat 64 1130298490224713 + systematicCode := BitVec.ofNat 64 16561348317438557745 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10204053531788288 + maskLow := BitVec.ofNat 64 576461171079577879 + maskHigh := BitVec.ofNat 64 4521191830192129 + systematicCode := BitVec.ofNat 64 16850693502915984945 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9086949717967872 + maskLow := BitVec.ofNat 64 72057600497221911 + maskHigh := BitVec.ofNat 64 4521191947632737 + systematicCode := BitVec.ofNat 64 16850700195517709873 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2260634964591616 + maskLow := BitVec.ofNat 64 72057600497221911 + maskHigh := BitVec.ofNat 64 6333186992766977 + systematicCode := BitVec.ofNat 64 16854127730381307441 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2261180425438208 + maskLow := BitVec.ofNat 64 72057600497221911 + maskHigh := BitVec.ofNat 64 36052986291552257 + systematicCode := BitVec.ofNat 64 17283080150185950769 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10203508071205888 + maskLow := BitVec.ofNat 64 7493989786403799319 + maskHigh := BitVec.ofNat 64 36169534524096513 + systematicCode := BitVec.ofNat 64 17284727943548255793 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9086404257385472 + maskLow := BitVec.ofNat 64 72057600497221911 + maskHigh := BitVec.ofNat 64 36169536252149761 + systematicCode := BitVec.ofNat 64 17284741404982001201 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x3e37. -/ +def normalizedWeightSixteenCandidateBucket_3e37 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9025397304609920 + maskLow := BitVec.ofNat 64 576460758880157975 + maskHigh := BitVec.ofNat 64 4521604264493057 + systematicCode := BitVec.ofNat 64 16850725755606679095 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 45123996165622912 + maskLow := BitVec.ofNat 64 576460758880157975 + maskHigh := BitVec.ofNat 64 4644337132896257 + systematicCode := BitVec.ofNat 64 16852382551790468663 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11610881751010432 + maskLow := BitVec.ofNat 64 73746450474926359 + maskHigh := BitVec.ofNat 64 4644337249943553 + systematicCode := BitVec.ofNat 64 16852388924480437815 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 45124541626469504 + maskLow := BitVec.ofNat 64 576460758880157975 + maskHigh := BitVec.ofNat 64 36046389221787137 + systematicCode := BitVec.ofNat 64 17283039197169860151 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11611427211857024 + maskLow := BitVec.ofNat 64 72064197684429079 + maskHigh := BitVec.ofNat 64 36046389339226113 + systematicCode := BitVec.ofNat 64 17283045638578257463 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 45124554510584960 + maskLow := BitVec.ofNat 64 576460758880157975 + maskHigh := BitVec.ofNat 64 2305843284091864073 + systematicCode := BitVec.ofNat 64 18144339431563607607 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11611440095972480 + maskLow := BitVec.ofNat 64 1130338889826583 + maskHigh := BitVec.ofNat 64 2305843284225818625 + systematicCode := BitVec.ofNat 64 18144359015772470839 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 45124554510975104 + maskLow := BitVec.ofNat 64 576460758880157975 + maskHigh := BitVec.ofNat 64 4611686155866472969 + systematicCode := BitVec.ofNat 64 18287889462072852023 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11611440096362624 + maskLow := BitVec.ofNat 64 565189913149719 + maskHigh := BitVec.ofNat 64 4611686156000559105 + systematicCode := BitVec.ofNat 64 18287911245271416375 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9024843253564544 + maskLow := BitVec.ofNat 64 576460758880157975 + maskHigh := BitVec.ofNat 64 6953698562282618881 + systematicCode := BitVec.ofNat 64 18301485254868090423 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x3e3b. -/ +def normalizedWeightSixteenCandidateBucket_3e3b : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9025397402406016 + maskLow := BitVec.ofNat 64 2305843016193081623 + maskHigh := BitVec.ofNat 64 1130607727869953 + systematicCode := BitVec.ofNat 64 16561369462435626555 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 45123996230126720 + maskLow := BitVec.ofNat 64 2305843016193081623 + maskHigh := BitVec.ofNat 64 1266637413154817 + systematicCode := BitVec.ofNat 64 16564152192818888251 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11610881815514240 + maskLow := BitVec.ofNat 64 77124150598107415 + maskHigh := BitVec.ofNat 64 1266637932068865 + systematicCode := BitVec.ofNat 64 16564162946442346043 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 45124541690973312 + maskLow := BitVec.ofNat 64 2305843016193081623 + maskHigh := BitVec.ofNat 64 36033195082256897 + systematicCode := BitVec.ofNat 64 17281913314443148859 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11611427276360832 + maskLow := BitVec.ofNat 64 72077392226615575 + maskHigh := BitVec.ofNat 64 36033195602345985 + systematicCode := BitVec.ofNat 64 17281924136785034811 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 45124554475211904 + maskLow := BitVec.ofNat 64 2305843016193081623 + maskHigh := BitVec.ofNat 64 576461027182383137 + systematicCode := BitVec.ofNat 64 17856113470705647163 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11611440060599424 + maskLow := BitVec.ofNat 64 4521336231756055 + maskHigh := BitVec.ofNat 64 576461027718201345 + systematicCode := BitVec.ofNat 64 17856133054914510395 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 45124554525540480 + maskLow := BitVec.ofNat 64 2305843016193081623 + maskHigh := BitVec.ofNat 64 4611686052787257889 + systematicCode := BitVec.ofNat 64 18286763562233380411 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11611440110928000 + maskLow := BitVec.ofNat 64 565293395018007 + maskHigh := BitVec.ofNat 64 4611686053323997185 + systematicCode := BitVec.ofNat 64 18286789743411347003 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9024843318068352 + maskLow := BitVec.ofNat 64 2305843016193081623 + maskHigh := BitVec.ofNat 64 5224316305775001601 + systematicCode := BitVec.ofNat 64 18300359355028618811 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x3e3d. -/ +def normalizedWeightSixteenCandidateBucket_3e3d : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9025397402779904 + maskLow := BitVec.ofNat 64 4611686025943646487 + maskHigh := BitVec.ofNat 64 565321849110529 + systematicCode := BitVec.ofNat 64 16416689125416779325 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 45123996230240512 + maskLow := BitVec.ofNat 64 4611686025943646487 + maskHigh := BitVec.ofNat 64 703687459864577 + systematicCode := BitVec.ofNat 64 16420037004776717885 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11610881815628032 + maskLow := BitVec.ofNat 64 77687101088399639 + maskHigh := BitVec.ofNat 64 703688515518465 + systematicCode := BitVec.ofNat 64 16420049957389876797 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 45124541691087104 + maskLow := BitVec.ofNat 64 4611686025943646487 + maskHigh := BitVec.ofNat 64 36030996059001857 + systematicCode := BitVec.ofNat 64 17281350364523413053 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11611427276474624 + maskLow := BitVec.ofNat 64 72079591786742039 + maskHigh := BitVec.ofNat 64 36030997115961345 + systematicCode := BitVec.ofNat 64 17281363385855000125 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 45124554475325696 + maskLow := BitVec.ofNat 64 4611686025943646487 + maskHigh := BitVec.ofNat 64 576460889743429697 + systematicCode := BitVec.ofNat 64 17855550520785911357 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11611440060713216 + maskLow := BitVec.ofNat 64 4521474207580439 + maskHigh := BitVec.ofNat 64 576460890816118785 + systematicCode := BitVec.ofNat 64 17855572303984475709 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 45124554525264128 + maskLow := BitVec.ofNat 64 4611686025943646487 + maskHigh := BitVec.ofNat 64 2305843043573695553 + systematicCode := BitVec.ofNat 64 18142650581804400189 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11611440110651648 + maskLow := BitVec.ofNat 64 1130580347519255 + maskHigh := BitVec.ofNat 64 2305843044647174145 + systematicCode := BitVec.ofNat 64 18142676762982366781 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9024843318182144 + maskLow := BitVec.ofNat 64 4611686025943646487 + maskHigh := BitVec.ofNat 64 2918473297098178561 + systematicCode := BitVec.ofNat 64 18156244166986448445 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x4543. -/ +def normalizedWeightSixteenCandidateBucket_4543 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .d16Plus + affineCode := BitVec.ofNat 56 54327438755274880 + maskLow := BitVec.ofNat 64 282673272652055 + maskHigh := BitVec.ofNat 64 9223372043297226753 + systematicCode := BitVec.ofNat 64 18357163980835341635 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9013804931285248 + maskLow := BitVec.ofNat 64 1152921534671683863 + maskHigh := BitVec.ofNat 64 2261152104972289 + systematicCode := BitVec.ofNat 64 16633709605275911491 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9084723431540992 + maskLow := BitVec.ofNat 64 1152921534671683863 + maskHigh := BitVec.ofNat 64 2269392018079745 + systematicCode := BitVec.ofNat 64 16634520937080374595 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36033753428066560 + maskLow := BitVec.ofNat 64 612771054363934999 + maskHigh := BitVec.ofNat 64 2269394147213313 + systematicCode := BitVec.ofNat 64 16634537214048552259 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9083087049001216 + maskLow := BitVec.ofNat 64 1152921534671683863 + maskHigh := BitVec.ofNat 64 4512395737176065 + systematicCode := BitVec.ofNat 64 16849849225276114243 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36034298888913152 + maskLow := BitVec.ofNat 64 576602619368243479 + maskHigh := BitVec.ofNat 64 4512397867876353 + systematicCode := BitVec.ofNat 64 16849865570962720067 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9083067872643328 + maskLow := BitVec.ofNat 64 1152921534671683863 + maskHigh := BitVec.ofNat 64 72058143794794625 + systematicCode := BitVec.ofNat 64 17424049381538612547 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36034296758206720 + maskLow := BitVec.ofNat 64 36169633291632919 + maskHigh := BitVec.ofNat 64 72058145941225473 + systematicCode := BitVec.ofNat 64 17424074489092195651 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9084173675462912 + maskLow := BitVec.ofNat 64 1152921534671683863 + maskHigh := BitVec.ofNat 64 9223372041150269569 + systematicCode := BitVec.ofNat 64 18357137825527842115 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9014359015885056 + maskLow := BitVec.ofNat 64 1152921534671683863 + maskHigh := BitVec.ofNat 64 9299950824853602305 + systematicCode := BitVec.ofNat 64 18370721476450534723 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x4643. -/ +def normalizedWeightSixteenCandidateBucket_4643 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .d16Plus + affineCode := BitVec.ofNat 56 54327438755266688 + maskLow := BitVec.ofNat 64 565333660336407 + maskHigh := BitVec.ofNat 64 4611686029164806145 + systematicCode := BitVec.ofNat 64 18285387866085934659 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2258405490198656 + maskLow := BitVec.ofNat 64 2305843056458400023 + maskHigh := BitVec.ofNat 64 1130583568678913 + systematicCode := BitVec.ofNat 64 16561369441044678211 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9084723431506560 + maskLow := BitVec.ofNat 64 2305843056458400023 + maskHigh := BitVec.ofNat 64 1161084297281537 + systematicCode := BitVec.ofNat 64 16562744818019223107 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36033341111175296 + maskLow := BitVec.ofNat 64 306807771859321111 + maskHigh := BitVec.ofNat 64 1161086426415105 + systematicCode := BitVec.ofNat 64 16562761090675656259 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9083087048966784 + maskLow := BitVec.ofNat 64 2305843056458400023 + maskHigh := BitVec.ofNat 64 9011597318035457 + systematicCode := BitVec.ofNat 64 16921625344337397315 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36034295667656832 + maskLow := BitVec.ofNat 64 288302991163851031 + maskHigh := BitVec.ofNat 64 9011599448735745 + systematicCode := BitVec.ofNat 64 16921641685712258627 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9083067872608896 + maskLow := BitVec.ofNat 64 2305843056458400023 + maskHigh := BitVec.ofNat 64 144115462954815617 + systematicCode := BitVec.ofNat 64 17495825500599895619 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36034296733010048 + maskLow := BitVec.ofNat 64 18084951937319191 + maskHigh := BitVec.ofNat 64 144115465101246465 + systematicCode := BitVec.ofNat 64 17495850603841734211 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2328774234374272 + maskLow := BitVec.ofNat 64 2305843056458400023 + maskHigh := BitVec.ofNat 64 4611686027017848961 + systematicCode := BitVec.ofNat 64 18285361706466690627 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9014359015852672 + maskLow := BitVec.ofNat 64 2305843056458400023 + maskHigh := BitVec.ofNat 64 4764843592277557249 + systematicCode := BitVec.ofNat 64 18298946461195978307 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x4645. -/ +def normalizedWeightSixteenCandidateBucket_4645 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .d16Plus + affineCode := BitVec.ofNat 56 54327438754210048 + maskLow := BitVec.ofNat 64 1130628665901335 + maskHigh := BitVec.ofNat 64 2305843028541046785 + systematicCode := BitVec.ofNat 64 18141835636587120197 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2258405490442496 + maskLow := BitVec.ofNat 64 4611686074262028567 + maskHigh := BitVec.ofNat 64 565305742983169 + systematicCode := BitVec.ofNat 64 16416689112582211141 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9084723431295232 + maskLow := BitVec.ofNat 64 4611686074262028567 + maskHigh := BitVec.ofNat 64 633318715949057 + systematicCode := BitVec.ofNat 64 16419192579896919621 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36033341111419136 + maskLow := BitVec.ofNat 64 154248343072080151 + maskHigh := BitVec.ofNat 64 633320845082625 + systematicCode := BitVec.ofNat 64 16419208843929863749 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9083087048755456 + maskLow := BitVec.ofNat 64 4611686074262028567 + maskHigh := BitVec.ofNat 64 18016597549520897 + systematicCode := BitVec.ofNat 64 17065177582459962949 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36034295667900672 + maskLow := BitVec.ofNat 64 144154826329096471 + maskHigh := BitVec.ofNat 64 18016599680221185 + systematicCode := BitVec.ofNat 64 17065193915211335237 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9083067872397568 + maskLow := BitVec.ofNat 64 4611686074262028567 + maskHigh := BitVec.ofNat 64 288230513591718017 + systematicCode := BitVec.ofNat 64 17639377738722461253 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36034296733253888 + maskLow := BitVec.ofNat 64 9042714339377431 + maskHigh := BitVec.ofNat 64 288230515738148865 + systematicCode := BitVec.ofNat 64 17639402833340810821 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2328774234358016 + maskLow := BitVec.ofNat 64 4611686074262028567 + maskHigh := BitVec.ofNat 64 2305843026394089601 + systematicCode := BitVec.ofNat 64 18141809468344387141 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9014359015901440 + maskLow := BitVec.ofNat 64 4611686074262028567 + maskHigh := BitVec.ofNat 64 2612158154766548993 + systematicCode := BitVec.ofNat 64 18155396430686864965 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x4943. -/ +def normalizedWeightSixteenCandidateBucket_4943 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9083087073970432 + maskLow := BitVec.ofNat 64 288230457756156183 + maskHigh := BitVec.ofNat 64 1161084295717889 + systematicCode := BitVec.ofNat 64 16562744761865554243 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36034298880590080 + maskLow := BitVec.ofNat 64 2305984927818121495 + maskHigh := BitVec.ofNat 64 1161086426415105 + systematicCode := BitVec.ofNat 64 16562761111897721155 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9084723456510208 + maskLow := BitVec.ofNat 64 288230457756156183 + maskHigh := BitVec.ofNat 64 9011597320388609 + systematicCode := BitVec.ofNat 64 16921625426159552835 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36033753419743488 + maskLow := BitVec.ofNat 64 2342153362813813015 + maskHigh := BitVec.ofNat 64 9011599448735745 + systematicCode := BitVec.ofNat 64 16921641707473291587 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9013804922962176 + maskLow := BitVec.ofNat 64 288230457756156183 + maskHigh := BitVec.ofNat 64 9042939825094657 + systematicCode := BitVec.ofNat 64 16923065881334204739 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9083067747797248 + maskLow := BitVec.ofNat 64 288230457756156183 + maskHigh := BitVec.ofNat 64 72058143794005121 + systematicCode := BitVec.ofNat 64 17424044966311971139 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9084173667139840 + maskLow := BitVec.ofNat 64 288230457756156183 + maskHigh := BitVec.ofNat 64 9223372041151848577 + systematicCode := BitVec.ofNat 64 18357142240753961283 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9014359007561984 + maskLow := BitVec.ofNat 64 288230457756156183 + maskHigh := BitVec.ofNat 64 9296559930993541121 + systematicCode := BitVec.ofNat 64 18370717061223893315 }) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x4945. -/ +def normalizedWeightSixteenCandidateBucket_4945 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9083087074132992 + maskLow := BitVec.ofNat 64 144115278270234903 + maskHigh := BitVec.ofNat 64 633318714393089 + systematicCode := BitVec.ofNat 64 16419192532299368773 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36034298880492544 + maskLow := BitVec.ofNat 64 4611827945621750039 + maskHigh := BitVec.ofNat 64 633320845082625 + systematicCode := BitVec.ofNat 64 16419208882365221189 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9084723456672768 + maskLow := BitVec.ofNat 64 144115278270234903 + maskHigh := BitVec.ofNat 64 18016597553840129 + systematicCode := BitVec.ofNat 64 17065177672838236485 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36033753419645952 + maskLow := BitVec.ofNat 64 4647996380617441559 + maskHigh := BitVec.ofNat 64 18016599680221185 + systematicCode := BitVec.ofNat 64 17065193954185660741 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9013804922864640 + maskLow := BitVec.ofNat 64 144115278270234903 + maskHigh := BitVec.ofNat 64 18085323451924481 + systematicCode := BitVec.ofNat 64 17067744019363350853 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9083067746789376 + maskLow := BitVec.ofNat 64 144115278270234903 + maskHigh := BitVec.ofNat 64 72058143793873537 + systematicCode := BitVec.ofNat 64 17424042758698649925 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9084173667042304 + maskLow := BitVec.ofNat 64 144115278270234903 + maskHigh := BitVec.ofNat 64 9223372041153953921 + systematicCode := BitVec.ofNat 64 18357144448367020357 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9014359007464448 + maskLow := BitVec.ofNat 64 144115278270234903 + maskHigh := BitVec.ofNat 64 9295994782016864257 + systematicCode := BitVec.ofNat 64 18370714853610572101 }) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x4a43. -/ +def normalizedWeightSixteenCandidateBucket_4a43 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9083087069774464 + maskLow := BitVec.ofNat 64 576460902627344663 + maskHigh := BitVec.ofNat 64 2269392016516097 + systematicCode := BitVec.ofNat 64 16634520880926837315 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36034295655172224 + maskLow := BitVec.ofNat 64 1152994222698201367 + maskHigh := BitVec.ofNat 64 2269394147213313 + systematicCode := BitVec.ofNat 64 16634537226647259715 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9084723452314240 + maskLow := BitVec.ofNat 64 576460902627344663 + maskHigh := BitVec.ofNat 64 4512395739529217 + systematicCode := BitVec.ofNat 64 16849849307098401347 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36033341098690688 + maskLow := BitVec.ofNat 64 1171499003393671447 + maskHigh := BitVec.ofNat 64 4512397867876353 + systematicCode := BitVec.ofNat 64 16849865584100395587 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2258405477714048 + maskLow := BitVec.ofNat 64 576460902627344663 + maskHigh := BitVec.ofNat 64 4521477428740097 + systematicCode := BitVec.ofNat 64 16850725717102971459 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9083067743601280 + maskLow := BitVec.ofNat 64 576460902627344663 + maskHigh := BitVec.ofNat 64 144115462954026113 + systematicCode := BitVec.ofNat 64 17495821085373254211 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2328774221889664 + maskLow := BitVec.ofNat 64 576460902627344663 + maskHigh := BitVec.ofNat 64 4611686027019427969 + systematicCode := BitVec.ofNat 64 18285366121692809795 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9014359003368064 + maskLow := BitVec.ofNat 64 576460902627344663 + maskHigh := BitVec.ofNat 64 4758061804557434881 + systematicCode := BitVec.ofNat 64 18298942045969336899 }) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x4a46. -/ +def normalizedWeightSixteenCandidateBucket_4a46 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9641137837058048 + maskLow := BitVec.ofNat 64 144115364169580823 + maskHigh := BitVec.ofNat 64 633318714409217 + systematicCode := BitVec.ofNat 64 16419192536577559110 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11264020256811008 + maskLow := BitVec.ofNat 64 4611758762288546071 + maskHigh := BitVec.ofNat 64 633320845082625 + systematicCode := BitVec.ofNat 64 16419208882348509766 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9640694650120192 + maskLow := BitVec.ofNat 64 144115364169580823 + maskHigh := BitVec.ofNat 64 18016597557968897 + systematicCode := BitVec.ofNat 64 17065177677116426822 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11263986165508096 + maskLow := BitVec.ofNat 64 4630263542984016151 + maskHigh := BitVec.ofNat 64 18016599680221185 + systematicCode := BitVec.ofNat 64 17065193954168949318 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9575239384459264 + maskLow := BitVec.ofNat 64 144115364169580823 + maskHigh := BitVec.ofNat 64 18085052868984833 + systematicCode := BitVec.ofNat 64 17067742924146690630 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9641210046195712 + maskLow := BitVec.ofNat 64 144115364169580823 + maskHigh := BitVec.ofNat 64 144115462953828737 + systematicCode := BitVec.ofNat 64 17495817773953272390 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9922685058826368 + maskLow := BitVec.ofNat 64 144115364169580823 + maskHigh := BitVec.ofNat 64 4611686027025744001 + systematicCode := BitVec.ofNat 64 18285369433112398406 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9574719925919872 + maskLow := BitVec.ofNat 64 144115364169580823 + maskHigh := BitVec.ofNat 64 4756366357627404289 + systematicCode := BitVec.ofNat 64 18298938734549355078 }) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x4a49. -/ +def normalizedWeightSixteenCandidateBucket_4a49 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .d16Plus + affineCode := BitVec.ofNat 56 54327438614798592 + maskLow := BitVec.ofNat 64 4521677144785175 + maskHigh := BitVec.ofNat 64 576460823170383873 + systematicCode := BitVec.ofNat 64 17854731177589230153 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2258405509169408 + maskLow := BitVec.ofNat 64 4611686228880851223 + maskHigh := BitVec.ofNat 64 565254203375617 + systematicCode := BitVec.ofNat 64 16416685826932230729 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9084723425052928 + maskLow := BitVec.ofNat 64 4611686228880851223 + maskHigh := BitVec.ofNat 64 633318716735489 + systematicCode := BitVec.ofNat 64 16419192592731490889 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36033341130146048 + maskLow := BitVec.ofNat 64 150870797970374935 + maskHigh := BitVec.ofNat 64 633320845082625 + systematicCode := BitVec.ofNat 64 16419208843879729737 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9083087042513152 + maskLow := BitVec.ofNat 64 4611686228880851223 + maskHigh := BitVec.ofNat 64 18016597549523969 + systematicCode := BitVec.ofNat 64 17065177595294534217 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36034295686627584 + maskLow := BitVec.ofNat 64 144141786808385815 + maskHigh := BitVec.ofNat 64 18016599680221185 + systematicCode := BitVec.ofNat 64 17065193915161201225 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2328774219792640 + maskLow := BitVec.ofNat 64 4611686228880851223 + maskHigh := BitVec.ofNat 64 576460821025005697 + systematicCode := BitVec.ofNat 64 17854709407325899337 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9083067716339968 + maskLow := BitVec.ofNat 64 4611686228880851223 + maskHigh := BitVec.ofNat 64 1152921538966848641 + systematicCode := BitVec.ofNat 64 17926477799740951113 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36034296760303872 + maskLow := BitVec.ofNat 64 2261081238077719 + maskHigh := BitVec.ofNat 64 1152921541114068993 + systematicCode := BitVec.ofNat 64 17926507292338702921 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9014359009659136 + maskLow := BitVec.ofNat 64 4611686228880851223 + maskHigh := BitVec.ofNat 64 1747467026311413761 + systematicCode := BitVec.ofNat 64 17940068073503214153 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x4c45. -/ +def normalizedWeightSixteenCandidateBucket_4c45 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9083087069725696 + maskLow := BitVec.ofNat 64 576461048656232727 + maskHigh := BitVec.ofNat 64 2269392016523777 + systematicCode := BitVec.ofNat 64 16634520889483217989 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36034295655318528 + maskLow := BitVec.ofNat 64 1152961383378256151 + maskHigh := BitVec.ofNat 64 2269394147213313 + systematicCode := BitVec.ofNat 64 16634537226613836869 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9084723452265472 + maskLow := BitVec.ofNat 64 576461048656232727 + maskHigh := BitVec.ofNat 64 4512395741495297 + systematicCode := BitVec.ofNat 64 16849849315654782021 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36033341098836992 + maskLow := BitVec.ofNat 64 1163054900121239831 + maskHigh := BitVec.ofNat 64 4512397867876353 + systematicCode := BitVec.ofNat 64 16849865584066972741 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2258405477860352 + maskLow := BitVec.ofNat 64 576461048656232727 + maskHigh := BitVec.ofNat 64 4521348579721217 + systematicCode := BitVec.ofNat 64 16850723526669651013 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9083067742382080 + maskLow := BitVec.ofNat 64 576461048656232727 + maskHigh := BitVec.ofNat 64 288230513590796929 + systematicCode := BitVec.ofNat 64 17639371115882499141 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2328774221775872 + maskLow := BitVec.ofNat 64 576461048656232727 + maskHigh := BitVec.ofNat 64 2305843026397773953 + systematicCode := BitVec.ofNat 64 18141816091183565893 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9014359003319296 + maskLow := BitVec.ofNat 64 576461048656232727 + maskHigh := BitVec.ofNat 64 2596333983419596801 + systematicCode := BitVec.ofNat 64 18155389807846902853 }) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x4c46. -/ +def normalizedWeightSixteenCandidateBucket_4c46 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9641137838228480 + maskLow := BitVec.ofNat 64 288230689684390167 + maskHigh := BitVec.ofNat 64 1161084295741697 + systematicCode := BitVec.ofNat 64 16562744774700125254 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11264020257705088 + maskLow := BitVec.ofNat 64 2305882905164972311 + maskHigh := BitVec.ofNat 64 1161086426415105 + systematicCode := BitVec.ofNat 64 16562761111847586886 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9640694651290624 + maskLow := BitVec.ofNat 64 288230689684390167 + maskHigh := BitVec.ofNat 64 9011597326483457 + systematicCode := BitVec.ofNat 64 16921625438994123846 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11263986166402176 + maskLow := BitVec.ofNat 64 2315976421907955991 + maskHigh := BitVec.ofNat 64 9011599448735745 + systematicCode := BitVec.ofNat 64 16921641707423157318 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9575239385353344 + maskLow := BitVec.ofNat 64 288230689684390167 + maskHigh := BitVec.ofNat 64 9042540393136129 + systematicCode := BitVec.ofNat 64 16923062595684224070 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9641210047366144 + maskLow := BitVec.ofNat 64 288230689684390167 + maskHigh := BitVec.ofNat 64 288230513590731137 + systematicCode := BitVec.ofNat 64 17639370012075838534 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9922685058436224 + maskLow := BitVec.ofNat 64 288230689684390167 + maskHigh := BitVec.ofNat 64 2305843026401984641 + systematicCode := BitVec.ofNat 64 18141817194990095430 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9574719926846464 + maskLow := BitVec.ofNat 64 288230689684390167 + maskHigh := BitVec.ofNat 64 2595203685466243073 + systematicCode := BitVec.ofNat 64 18155388704040242246 }) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x4c49. -/ +def normalizedWeightSixteenCandidateBucket_4c49 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2258405509071872 + maskLow := BitVec.ofNat 64 2305843357106110743 + maskHigh := BitVec.ofNat 64 1130403180052481 + systematicCode := BitVec.ofNat 64 16561363964961377353 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9084723425215488 + maskLow := BitVec.ofNat 64 2305843357106110743 + maskHigh := BitVec.ofNat 64 1161084300034049 + systematicCode := BitVec.ofNat 64 16562744839410175049 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36033341130048512 + maskLow := BitVec.ofNat 64 294986123485184279 + maskHigh := BitVec.ofNat 64 1161086426415105 + systematicCode := BitVec.ofNat 64 16562761090592099401 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9083087042675712 + maskLow := BitVec.ofNat 64 2305843357106110743 + maskHigh := BitVec.ofNat 64 9011597318046209 + systematicCode := BitVec.ofNat 64 16921625365728349257 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36034295686530048 + maskLow := BitVec.ofNat 64 288257112323195159 + maskHigh := BitVec.ofNat 64 9011599448735745 + systematicCode := BitVec.ofNat 64 16921641685628701769 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2328774219695104 + maskLow := BitVec.ofNat 64 2305843357106110743 + maskHigh := BitVec.ofNat 64 576460821027111041 + systematicCode := BitVec.ofNat 64 17854711614938958921 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9083067715332096 + maskLow := BitVec.ofNat 64 2305843357106110743 + maskHigh := BitVec.ofNat 64 1152921538966717057 + systematicCode := BitVec.ofNat 64 17926475592127630409 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9014359009561600 + maskLow := BitVec.ofNat 64 2305843357106110743 + maskHigh := BitVec.ofNat 64 1738424642684583937 + systematicCode := BitVec.ofNat 64 17940065865889893449 }) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x4c4a. -/ +def normalizedWeightSixteenCandidateBucket_4c4a : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9575239449857152 + maskLow := BitVec.ofNat 64 1152921921218740503 + maskHigh := BitVec.ofNat 64 2260701133406209 + systematicCode := BitVec.ofNat 64 16633703033975950410 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9640694751167488 + maskLow := BitVec.ofNat 64 1152921921218740503 + maskHigh := BitVec.ofNat 64 2269392024961025 + systematicCode := BitVec.ofNat 64 16634520962749516874 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11263986230905984 + maskLow := BitVec.ofNat 64 583216568356372759 + maskHigh := BitVec.ofNat 64 2269394147213313 + systematicCode := BitVec.ofNat 64 16634537213948283978 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9641137938105344 + maskLow := BitVec.ofNat 64 1152921921218740503 + maskHigh := BitVec.ofNat 64 4512395737202945 + systematicCode := BitVec.ofNat 64 16849849250945256522 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11264020322208896 + maskLow := BitVec.ofNat 64 576487557194383639 + maskHigh := BitVec.ofNat 64 4512397867876353 + systematicCode := BitVec.ofNat 64 16849865570862451786 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9922684958559360 + maskLow := BitVec.ofNat 64 1152921921218740503 + maskHigh := BitVec.ofNat 64 576460821031321729 + systematicCode := BitVec.ofNat 64 17854712718745488458 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9641210147243008 + maskLow := BitVec.ofNat 64 1152921921218740503 + maskHigh := BitVec.ofNat 64 1152921538966651265 + systematicCode := BitVec.ofNat 64 17926474488320969802 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9574719995511808 + maskLow := BitVec.ofNat 64 1152921921218740503 + maskHigh := BitVec.ofNat 64 1733903450871169025 + systematicCode := BitVec.ofNat 64 17940064762083232842 }) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x5143. -/ +def normalizedWeightSixteenCandidateBucket_5143 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9083071093672192 + maskLow := BitVec.ofNat 64 18015510906077463 + maskHigh := BitVec.ofNat 64 1161084279988289 + systematicCode := BitVec.ofNat 64 16562735965637792067 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9083070943856896 + maskLow := BitVec.ofNat 64 18015510906077463 + maskHigh := BitVec.ofNat 64 4512395720656961 + systematicCode := BitVec.ofNat 64 16849836026656280899 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9084720260450560 + maskLow := BitVec.ofNat 64 18015510906077463 + maskHigh := BitVec.ofNat 64 144115462988627969 + systematicCode := BitVec.ofNat 64 17495837664298750275 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36033745962270976 + maskLow := BitVec.ofNat 64 2882586348890423575 + maskHigh := BitVec.ofNat 64 144115465101246465 + systematicCode := BitVec.ofNat 64 17495850660097249603 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9013797465489664 + maskLow := BitVec.ofNat 64 18015510906077463 + maskHigh := BitVec.ofNat 64 144159174983417857 + systematicCode := BitVec.ofNat 64 17499535429730128195 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9084166209667328 + maskLow := BitVec.ofNat 64 18015510906077463 + maskHigh := BitVec.ofNat 64 9223372041183307777 + systematicCode := BitVec.ofNat 64 18357151036980678979 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9014351550089472 + maskLow := BitVec.ofNat 64 18015510906077463 + maskHigh := BitVec.ofNat 64 9229001813414379521 + systematicCode := BitVec.ofNat 64 18368465227049947459 }) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x5145. -/ +def normalizedWeightSixteenCandidateBucket_5145 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9083071093834752 + maskLow := BitVec.ofNat 64 9008320241271063 + maskHigh := BitVec.ofNat 64 633318698663969 + systematicCode := BitVec.ofNat 64 16419183736071606597 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9083070942849024 + maskLow := BitVec.ofNat 64 9008320241271063 + maskHigh := BitVec.ofNat 64 4512395720525857 + systematicCode := BitVec.ofNat 64 16849833827599339845 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9084720260613120 + maskLow := BitVec.ofNat 64 9008320241271063 + maskHigh := BitVec.ofNat 64 288230513658953729 + systematicCode := BitVec.ofNat 64 17639392101410754885 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36033745962173440 + maskLow := BitVec.ofNat 64 5188429366694052119 + maskHigh := BitVec.ofNat 64 288230515738148865 + systematicCode := BitVec.ofNat 64 17639402906809618757 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9013797465392128 + maskLow := BitVec.ofNat 64 9008320241271063 + maskHigh := BitVec.ofNat 64 288309547431362561 + systematicCode := BitVec.ofNat 64 17644213567759274309 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9084166209569792 + maskLow := BitVec.ofNat 64 9008320241271063 + maskHigh := BitVec.ofNat 64 9223372041216870401 + systematicCode := BitVec.ofNat 64 18357153244593738053 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9014351549991936 + maskLow := BitVec.ofNat 64 9008320241271063 + maskHigh := BitVec.ofNat 64 9228438726022004737 + systematicCode := BitVec.ofNat 64 18368463019436626245 }) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x5149. -/ +def normalizedWeightSixteenCandidateBucket_5149 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9083070964827136 + maskLow := BitVec.ofNat 64 2252972339822871 + maskHigh := BitVec.ofNat 64 633318697877513 + systematicCode := BitVec.ofNat 64 16419179337957724489 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9083070963656704 + maskLow := BitVec.ofNat 64 2252972339822871 + maskHigh := BitVec.ofNat 64 1161084279070729 + systematicCode := BitVec.ofNat 64 16562729368466968905 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9084720231482368 + maskLow := BitVec.ofNat 64 2252972339822871 + maskHigh := BitVec.ofNat 64 1152921539235414017 + systematicCode := BitVec.ofNat 64 17926500958522003785 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36033745899750400 + maskLow := BitVec.ofNat 64 6917811675143930135 + maskHigh := BitVec.ofNat 64 1152921541114068993 + systematicCode := BitVec.ofNat 64 17926507383121596745 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9013797402969088 + maskLow := BitVec.ofNat 64 2252972339822871 + maskHigh := BitVec.ofNat 64 1153027064165564417 + systematicCode := BitVec.ofNat 64 17932448341957235017 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9084166147146752 + maskLow := BitVec.ofNat 64 2252972339822871 + maskHigh := BitVec.ofNat 64 9223372041418203137 + systematicCode := BitVec.ofNat 64 18357157642707095881 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9014351487568896 + maskLow := BitVec.ofNat 64 2252972339822871 + maskHigh := BitVec.ofNat 64 9225060923222261761 + systematicCode := BitVec.ofNat 64 18367337102349652297 }) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x514f. -/ +def normalizedWeightSixteenCandidateBucket_514f : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9082658139285504 + maskLow := BitVec.ofNat 64 283128539185431 + maskHigh := BitVec.ofNat 64 144115462987317289 + systematicCode := BitVec.ofNat 64 17495837534945628495 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36034299148928000 + maskLow := BitVec.ofNat 64 18038042304512279 + maskHigh := BitVec.ofNat 64 144115465101246465 + systematicCode := BitVec.ofNat 64 17495850603758506319 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9082658140455936 + maskLow := BitVec.ofNat 64 283128539185431 + maskHigh := BitVec.ofNat 64 288230513657774153 + systematicCode := BitVec.ofNat 64 17639391980681253199 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36034299149025536 + maskLow := BitVec.ofNat 64 9028644026515735 + maskHigh := BitVec.ofNat 64 288230515738148865 + systematicCode := BitVec.ofNat 64 17639402833290875215 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9082658240332800 + maskLow := BitVec.ofNat 64 283128539185431 + maskHigh := BitVec.ofNat 64 1152921539235020897 + systematicCode := BitVec.ofNat 64 17926500855039742287 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36034299157348608 + maskLow := BitVec.ofNat 64 2260050445926679 + maskHigh := BitVec.ofNat 64 1152921541114068993 + systematicCode := BitVec.ofNat 64 17926507292288766287 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9011735411819520 + maskLow := BitVec.ofNat 64 283128539185431 + maskHigh := BitVec.ofNat 64 1585267075276865537 + systematicCode := BitVec.ofNat 64 17939230129676964175 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9082104155997184 + maskLow := BitVec.ofNat 64 283128539185431 + maskHigh := BitVec.ofNat 64 9223372041518841857 + systematicCode := BitVec.ofNat 64 18357157746188570959 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11263951871151104 + maskLow := BitVec.ofNat 64 29275051140382999 + maskHigh := BitVec.ofNat 64 9223372043297226753 + systematicCode := BitVec.ofNat 64 18357164032813125967 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9012289496419328 + maskLow := BitVec.ofNat 64 283128539185431 + maskHigh := BitVec.ofNat 64 9223372485678858241 + systematicCode := BitVec.ofNat 64 18360555314629136719 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x5243. -/ +def normalizedWeightSixteenCandidateBucket_5243 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9083070556799616 + maskLow := BitVec.ofNat 64 36031008927187223 + maskHigh := BitVec.ofNat 64 2269392000786497 + systematicCode := BitVec.ofNat 64 16634512084699075139 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9083070406984320 + maskLow := BitVec.ofNat 64 36031008927187223 + maskHigh := BitVec.ofNat 64 9011597301516353 + systematicCode := BitVec.ofNat 64 16921612145717563971 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9084719723577984 + maskLow := BitVec.ofNat 64 36031008927187223 + maskHigh := BitVec.ofNat 64 72058143828606977 + systematicCode := BitVec.ofNat 64 17424061545237598787 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36033333108541568 + maskLow := BitVec.ofNat 64 1441717042620203287 + maskHigh := BitVec.ofNat 64 72058145941225473 + systematicCode := BitVec.ofNat 64 17424074536724353603 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2258397487564928 + maskLow := BitVec.ofNat 64 36031008927187223 + maskHigh := BitVec.ofNat 64 72079595007901697 + systematicCode := BitVec.ofNat 64 17427195265498894915 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2328766231740544 + maskLow := BitVec.ofNat 64 36031008927187223 + maskHigh := BitVec.ofNat 64 4611686027050887169 + systematicCode := BitVec.ofNat 64 18285374917919527491 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9014351013218944 + maskLow := BitVec.ofNat 64 36031008927187223 + maskHigh := BitVec.ofNat 64 4622945569399111681 + systematicCode := BitVec.ofNat 64 18296690211795391043 }) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x5246. -/ +def normalizedWeightSixteenCandidateBucket_5246 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9641145028192256 + maskLow := BitVec.ofNat 64 9009436932768023 + maskHigh := BitVec.ofNat 64 633318698680337 + systematicCode := BitVec.ofNat 64 16419183740349796934 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9641213774931968 + maskLow := BitVec.ofNat 64 9009436932768023 + maskHigh := BitVec.ofNat 64 9011597301319697 + systematicCode := BitVec.ofNat 64 16921608847132152390 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9640698378856448 + maskLow := BitVec.ofNat 64 9009436932768023 + maskHigh := BitVec.ofNat 64 288230513725997057 + systematicCode := BitVec.ofNat 64 17639393200905605702 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11263994421995520 + maskLow := BitVec.ofNat 64 4900481582210547991 + maskHigh := BitVec.ofNat 64 288230515738148865 + systematicCode := BitVec.ofNat 64 17639402906792907334 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9575247640946688 + maskLow := BitVec.ofNat 64 9009436932768023 + maskHigh := BitVec.ofNat 64 288305153679818753 + systematicCode := BitVec.ofNat 64 17644212472542614086 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9922693315313792 + maskLow := BitVec.ofNat 64 9009436932768023 + maskHigh := BitVec.ofNat 64 4611686027151575041 + systematicCode := BitVec.ofNat 64 18285378229339116102 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9574727649730688 + maskLow := BitVec.ofNat 64 9009436932768023 + maskHigh := BitVec.ofNat 64 4621256307221987329 + systematicCode := BitVec.ofNat 64 18296686900375409222 }) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x524a. -/ +def normalizedWeightSixteenCandidateBucket_524a : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9641145034434560 + maskLow := BitVec.ofNat 64 2254140570927383 + maskHigh := BitVec.ofNat 64 633318697893893 + systematicCode := BitVec.ofNat 64 16419179342235914826 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9641213754124288 + maskLow := BitVec.ofNat 64 2254140570927383 + maskHigh := BitVec.ofNat 64 2269391999803397 + systematicCode := BitVec.ofNat 64 16634504387999781450 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9640698358048768 + maskLow := BitVec.ofNat 64 2254140570927383 + maskHigh := BitVec.ofNat 64 1152921539503783937 + systematicCode := BitVec.ofNat 64 17926502058016854602 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11263994436560896 + maskLow := BitVec.ofNat 64 5765172813744898327 + maskHigh := BitVec.ofNat 64 1152921541114068993 + systematicCode := BitVec.ofNat 64 17926507383104885322 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9575247655512064 + maskLow := BitVec.ofNat 64 2254140570927383 + maskHigh := BitVec.ofNat 64 1153009476274487297 + systematicCode := BitVec.ofNat 64 17932447246740574794 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9922693329879168 + maskLow := BitVec.ofNat 64 2254140570927383 + maskHigh := BitVec.ofNat 64 4611686027554234369 + systematicCode := BitVec.ofNat 64 18285382627452473930 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9574727660134528 + maskLow := BitVec.ofNat 64 2254140570927383 + maskHigh := BitVec.ofNat 64 4614500804701716481 + systematicCode := BitVec.ofNat 64 18295560983288435274 }) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x524f. -/ +def normalizedWeightSixteenCandidateBucket_524f : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9641619653699584 + maskLow := BitVec.ofNat 64 565703027523863 + maskHigh := BitVec.ofNat 64 72058143827296277 + systematicCode := BitVec.ofNat 64 17424061411572732495 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11264037101522048 + maskLow := BitVec.ofNat 64 36053540325622039 + maskHigh := BitVec.ofNat 64 72058145941225473 + systematicCode := BitVec.ofNat 64 17424074488992256591 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9641619649292288 + maskLow := BitVec.ofNat 64 565703027523863 + maskHigh := BitVec.ofNat 64 288230513724883013 + systematicCode := BitVec.ofNat 64 17639393080176169551 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9641619622242304 + maskLow := BitVec.ofNat 64 565703027523863 + maskHigh := BitVec.ofNat 64 1152921539503456337 + systematicCode := BitVec.ofNat 64 17926501954534658639 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9576237634988032 + maskLow := BitVec.ofNat 64 565703027523863 + maskHigh := BitVec.ofNat 64 1513209485533904897 + systematicCode := BitVec.ofNat 64 17939229034460369487 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9923683309355136 + maskLow := BitVec.ofNat 64 565703027523863 + maskHigh := BitVec.ofNat 64 4611686027721965569 + systematicCode := BitVec.ofNat 64 18285382730934014543 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18019382829572224 + maskLow := BitVec.ofNat 64 47290549161492759 + maskHigh := BitVec.ofNat 64 4611686029164806145 + systematicCode := BitVec.ofNat 64 18285387918046876239 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9575648924328064 + maskLow := BitVec.ofNat 64 565703027523863 + maskHigh := BitVec.ofNat 64 4611686742129377281 + systematicCode := BitVec.ofNat 64 18288779195567985231 }) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x5251. -/ +def normalizedWeightSixteenCandidateBucket_5251 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .d16Plus + affineCode := BitVec.ofNat 56 54327419704779008 + maskLow := BitVec.ofNat 64 72082887100399895 + maskHigh := BitVec.ofNat 64 36029898678075393 + systematicCode := BitVec.ofNat 64 17280522259459756625 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2258401514094848 + maskLow := BitVec.ofNat 64 4611689321257304343 + maskHigh := BitVec.ofNat 64 564223411224577 + systematicCode := BitVec.ofNat 64 16415844700536984145 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9084716233918720 + maskLow := BitVec.ofNat 64 4611689321257304343 + maskHigh := BitVec.ofNat 64 633318732464129 + systematicCode := BitVec.ofNat 64 16419195878381474385 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36033337135071488 + maskLow := BitVec.ofNat 64 83319895936270615 + maskHigh := BitVec.ofNat 64 633320845082625 + systematicCode := BitVec.ofNat 64 16419208831045161553 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2328765963305216 + maskLow := BitVec.ofNat 64 4611689321257304343 + maskHigh := BitVec.ofNat 64 36029896564156417 + systematicCode := BitVec.ofNat 64 17280509251063403089 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9083067067140352 + maskLow := BitVec.ofNat 64 4611689321257304343 + maskHigh := BitVec.ofNat 64 288230513591722049 + systematicCode := BitVec.ofNat 64 17639377751557034577 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9083066917325056 + maskLow := BitVec.ofNat 64 4611689321257304343 + maskHigh := BitVec.ofNat 64 1152921538966849601 + systematicCode := BitVec.ofNat 64 17926477812575523409 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9014351818524928 + maskLow := BitVec.ofNat 64 4611689321257304343 + maskHigh := BitVec.ofNat 64 1477251048669184001 + systematicCode := BitVec.ofNat 64 17939226947107967569 }) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x5445. -/ +def normalizedWeightSixteenCandidateBucket_5445 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9083070556750848 + maskLow := BitVec.ofNat 64 36033216540377367 + maskHigh := BitVec.ofNat 64 2269392000794657 + systematicCode := BitVec.ofNat 64 16634512093255455813 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9083070405765120 + maskLow := BitVec.ofNat 64 36033216540377367 + maskHigh := BitVec.ofNat 64 18016597532870689 + systematicCode := BitVec.ofNat 64 17065162184783189061 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9084719723529216 + maskLow := BitVec.ofNat 64 36033216540377367 + maskHigh := BitVec.ofNat 64 72058143862030337 + systematicCode := BitVec.ofNat 64 17424063744227300421 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36033333108687872 + maskLow := BitVec.ofNat 64 1298167012110958871 + maskHigh := BitVec.ofNat 64 72058145941225473 + systematicCode := BitVec.ofNat 64 17424074536690930757 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2258397487711232 + maskLow := BitVec.ofNat 64 36033216540377367 + maskHigh := BitVec.ofNat 64 72077404574580737 + systematicCode := BitVec.ofNat 64 17427193075065574469 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2328766231626752 + maskLow := BitVec.ofNat 64 36033216540377367 + maskHigh := BitVec.ofNat 64 2305843026460690433 + systematicCode := BitVec.ofNat 64 18141824887410283589 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9014351013170176 + maskLow := BitVec.ofNat 64 36033216540377367 + maskHigh := BitVec.ofNat 64 2326109759440158721 + systematicCode := BitVec.ofNat 64 18153137973672956997 }) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x5446. -/ +def normalizedWeightSixteenCandidateBucket_5446 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9641145029362688 + maskLow := BitVec.ofNat 64 18018835210764567 + maskHigh := BitVec.ofNat 64 1161084280012817 + systematicCode := BitVec.ofNat 64 16562735978472363078 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9641213776102400 + maskLow := BitVec.ofNat 64 18018835210764567 + maskHigh := BitVec.ofNat 64 18016597532805137 + systematicCode := BitVec.ofNat 64 17065161085254718534 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9640698380026880 + maskLow := BitVec.ofNat 64 18018835210764567 + maskHigh := BitVec.ofNat 64 144115463089094657 + systematicCode := BitVec.ofNat 64 17495840962783302726 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11263994422889600 + maskLow := BitVec.ofNat 64 2451088533897675031 + maskHigh := BitVec.ofNat 64 144115465101246465 + systematicCode := BitVec.ofNat 64 17495850660047115334 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9575247641840768 + maskLow := BitVec.ofNat 64 18018835210764567 + maskHigh := BitVec.ofNat 64 144152590798553089 + systematicCode := BitVec.ofNat 64 17499532144080147526 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9922693314923648 + maskLow := BitVec.ofNat 64 18018835210764567 + maskHigh := BitVec.ofNat 64 2305843026527815681 + systematicCode := BitVec.ofNat 64 18141825991216813126 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9574727650657280 + maskLow := BitVec.ofNat 64 18018835210764567 + maskHigh := BitVec.ofNat 64 2324983584655409153 + systematicCode := BitVec.ofNat 64 18153136869866296390 }) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x544c. -/ +def normalizedWeightSixteenCandidateBucket_544c : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9641145035653760 + maskLow := BitVec.ofNat 64 2256477033136407 + maskHigh := BitVec.ofNat 64 1161084279095299 + systematicCode := BitVec.ofNat 64 16562729381301539916 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9641213755132160 + maskLow := BitVec.ofNat 64 2256477033136407 + maskHigh := BitVec.ofNat 64 2269391999811587 + systematicCode := BitVec.ofNat 64 16634504396556162124 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9640698359056640 + maskLow := BitVec.ofNat 64 2256477033136407 + maskHigh := BitVec.ofNat 64 1152921540040523777 + systematicCode := BitVec.ofNat 64 17926504248450176076 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11263994437568768 + maskLow := BitVec.ofNat 64 3459895090946834711 + maskHigh := BitVec.ofNat 64 1152921541114068993 + systematicCode := BitVec.ofNat 64 17926507374515082316 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9575247656519936 + maskLow := BitVec.ofNat 64 2256477033136407 + maskHigh := BitVec.ofNat 64 1152974300492333057 + systematicCode := BitVec.ofNat 64 17931884305377088588 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9922693329602816 + maskLow := BitVec.ofNat 64 2256477033136407 + maskHigh := BitVec.ofNat 64 2305843027467354113 + systematicCode := BitVec.ofNat 64 18141832588386849868 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9574727661142400 + maskLow := BitVec.ofNat 64 2256477033136407 + maskHigh := BitVec.ofNat 64 2309220745441443841 + systematicCode := BitVec.ofNat 64 18151447994235835468 }) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x544f. -/ +def normalizedWeightSixteenCandidateBucket_544f : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9641619654707456 + maskLow := BitVec.ofNat 64 1130852004200727 + maskHigh := BitVec.ofNat 64 72058143860850707 + systematicCode := BitVec.ofNat 64 17424063610562565199 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9641619650511488 + maskLow := BitVec.ofNat 64 1130852004200727 + maskHigh := BitVec.ofNat 64 144115463087980579 + systematicCode := BitVec.ofNat 64 17495840833430377551 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9641619623250176 + maskLow := BitVec.ofNat 64 1130852004200727 + maskHigh := BitVec.ofNat 64 1152921540040327217 + systematicCode := BitVec.ofNat 64 17926504144968111183 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9576237635995904 + maskLow := BitVec.ofNat 64 1130852004200727 + maskHigh := BitVec.ofNat 64 1369094306047983617 + systematicCode := BitVec.ofNat 64 17938666093097014351 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9923683309078784 + maskLow := BitVec.ofNat 64 1130852004200727 + maskHigh := BitVec.ofNat 64 2305843027668631553 + systematicCode := BitVec.ofNat 64 18141832691868521551 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18019382830580096 + maskLow := BitVec.ofNat 64 56299947439489303 + maskHigh := BitVec.ofNat 64 2305843028541046785 + systematicCode := BitVec.ofNat 64 18141835679957996623 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9575648925335936 + maskLow := BitVec.ofNat 64 1130852004200727 + maskHigh := BitVec.ofNat 64 2305843870354636801 + systematicCode := BitVec.ofNat 64 18144666206515516495 }) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x5451. -/ +def normalizedWeightSixteenCandidateBucket_5451 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2258401513997312 + maskLow := BitVec.ofNat 64 2305848511066865943 + maskHigh := BitVec.ofNat 64 1127310803599361 + systematicCode := BitVec.ofNat 64 16559962087635965009 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9084716234081280 + maskLow := BitVec.ofNat 64 2305848511066865943 + maskHigh := BitVec.ofNat 64 1161084347219969 + systematicCode := BitVec.ofNat 64 16562750315493479505 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36033337134973952 + maskLow := BitVec.ofNat 64 92329294214267159 + maskHigh := BitVec.ofNat 64 1161086426415105 + systematicCode := BitVec.ofNat 64 16562761069201151057 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2328765963207680 + maskLow := BitVec.ofNat 64 2305848511066865943 + maskHigh := BitVec.ofNat 64 36029896597719041 + systematicCode := BitVec.ofNat 64 17280511458676462673 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9083067067302912 + maskLow := BitVec.ofNat 64 2305848511066865943 + maskHigh := BitVec.ofNat 64 144115462954827809 + systematicCode := BitVec.ofNat 64 17495825521990849617 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9083066916317184 + maskLow := BitVec.ofNat 64 2305848511066865943 + maskHigh := BitVec.ofNat 64 1152921538966718497 + systematicCode := BitVec.ofNat 64 17926475613518582865 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9014351818427392 + maskLow := BitVec.ofNat 64 2305848511066865943 + maskHigh := BitVec.ofNat 64 1333100676221239297 + systematicCode := BitVec.ofNat 64 17938663988564481105 }) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x5452. -/ +def normalizedWeightSixteenCandidateBucket_5452 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9575255962832000 + maskLow := BitVec.ofNat 64 1152928105971646743 + maskHigh := BitVec.ofNat 64 2253485588348929 + systematicCode := BitVec.ofNat 64 16632020781185455186 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9640711264142336 + maskLow := BitVec.ofNat 64 1152928105971646743 + maskHigh := BitVec.ofNat 64 2269392135061505 + systematicCode := BitVec.ofNat 64 16634527534049481810 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11264002743880832 + maskLow := BitVec.ofNat 64 110344792235376919 + maskHigh := BitVec.ofNat 64 2269394147213313 + systematicCode := BitVec.ofNat 64 16634537188279145554 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9922680430808192 + maskLow := BitVec.ofNat 64 1152928105971646743 + maskHigh := BitVec.ofNat 64 36029896664844289 + systematicCode := BitVec.ofNat 64 17280512562482992210 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9641157913478144 + maskLow := BitVec.ofNat 64 1152928105971646743 + maskHigh := BitVec.ofNat 64 72058143794823185 + systematicCode := BitVec.ofNat 64 17424049407207756882 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9641226660217856 + maskLow := BitVec.ofNat 64 1152928105971646743 + maskHigh := BitVec.ofNat 64 1152921538966652945 + systematicCode := BitVec.ofNat 64 17926474513990112338 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9574736508486656 + maskLow := BitVec.ofNat 64 1152928105971646743 + maskHigh := BitVec.ofNat 64 1261025489997266945 + systematicCode := BitVec.ofNat 64 17938382509292737618 }) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x5749. -/ +def normalizedWeightSixteenCandidateBucket_5749 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9082661868021760 + maskLow := BitVec.ofNat 64 290344084242711 + maskHigh := BitVec.ofNat 64 9011597303349769 + systematicCode := BitVec.ofNat 64 16921619820722607945 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9082661869192192 + maskLow := BitVec.ofNat 64 290344084242711 + maskHigh := BitVec.ofNat 64 18016597536932873 + systematicCode := BitVec.ofNat 64 17065174266458232649 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9082674753307648 + maskLow := BitVec.ofNat 64 290344084242711 + maskHigh := BitVec.ofNat 64 1152921539235022337 + systematicCode := BitVec.ofNat 64 17926500889533699913 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9011751924794368 + maskLow := BitVec.ofNat 64 290344084242711 + maskHigh := BitVec.ofNat 64 1179943108813520897 + systematicCode := BitVec.ofNat 64 17936969533770258249 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9082120668972032 + maskLow := BitVec.ofNat 64 290344084242711 + maskHigh := BitVec.ofNat 64 9223372041424470017 + systematicCode := BitVec.ofNat 64 18357157711694616393 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11263968384125952 + maskLow := BitVec.ofNat 64 434606233148784919 + maskHigh := BitVec.ofNat 64 9223372043297226753 + systematicCode := BitVec.ofNat 64 18357164067307083593 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9012306009394176 + maskLow := BitVec.ofNat 64 290344084242711 + maskHigh := BitVec.ofNat 64 9223378670431764481 + systematicCode := BitVec.ofNat 64 18362815910535845705 }) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x574a. -/ +def normalizedWeightSixteenCandidateBucket_574a : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9641622849759232 + maskLow := BitVec.ofNat 64 571887780430103 + maskHigh := BitVec.ofNat 64 4512395722490117 + systematicCode := BitVec.ofNat 64 16849843697349711690 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9641622312675328 + maskLow := BitVec.ofNat 64 571887780430103 + maskHigh := BitVec.ofNat 64 18016597541127173 + systematicCode := BitVec.ofNat 64 17065175365953148746 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9641618823227392 + maskLow := BitVec.ofNat 64 571887780430103 + maskHigh := BitVec.ofNat 64 1152921539503457537 + systematicCode := BitVec.ofNat 64 17926501989028616010 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9576236303296512 + maskLow := BitVec.ofNat 64 571887780430103 + maskHigh := BitVec.ofNat 64 1175439513481117697 + systematicCode := BitVec.ofNat 64 17936968438553663306 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9923681977663616 + maskLow := BitVec.ofNat 64 571887780430103 + maskHigh := BitVec.ofNat 64 4611686027564679169 + systematicCode := BitVec.ofNat 64 18285382696440059722 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18019382030557312 + maskLow := BitVec.ofNat 64 722836678019973399 + maskHigh := BitVec.ofNat 64 4611686029164806145 + systematicCode := BitVec.ofNat 64 18285387952540833610 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9575648125313152 + maskLow := BitVec.ofNat 64 571887780430103 + maskHigh := BitVec.ofNat 64 4611697050050887681 + systematicCode := BitVec.ofNat 64 18291039791474693962 }) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x574c. -/ +def normalizedWeightSixteenCandidateBucket_574c : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9641622850767104 + maskLow := BitVec.ofNat 64 1134975172804887 + maskHigh := BitVec.ofNat 64 4512395724587267 + systematicCode := BitVec.ofNat 64 16849845896339543884 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9641622313894528 + maskLow := BitVec.ofNat 64 1134975172804887 + maskHigh := BitVec.ofNat 64 9011597309641219 + systematicCode := BitVec.ofNat 64 16921623119207356236 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9641618824235264 + maskLow := BitVec.ofNat 64 1134975172804887 + maskHigh := BitVec.ofNat 64 1152921540040327937 + systematicCode := BitVec.ofNat 64 17926504179462068044 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9576236304304384 + maskLow := BitVec.ofNat 64 1134975172804887 + maskHigh := BitVec.ofNat 64 1166432322816311297 + systematicCode := BitVec.ofNat 64 17936405497190307660 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9923681977387264 + maskLow := BitVec.ofNat 64 1134975172804887 + maskHigh := BitVec.ofNat 64 2305843027479887873 + systematicCode := BitVec.ofNat 64 18141832657374566220 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18019382031565184 + maskLow := BitVec.ofNat 64 866952003534782743 + maskHigh := BitVec.ofNat 64 2305843028541046785 + systematicCode := BitVec.ofNat 64 18141835714451953484 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9575648126321024 + maskLow := BitVec.ofNat 64 1134975172804887 + maskHigh := BitVec.ofNat 64 2305856239860449281 + systematicCode := BitVec.ofNat 64 18146926802422224716 }) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x574f. -/ +def normalizedWeightSixteenCandidateBucket_574f : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9576754884706560 + maskLow := BitVec.ofNat 64 2261149957554455 + maskHigh := BitVec.ofNat 64 1152921536819101697 + systematicCode := BitVec.ofNat 64 17925666554237114191 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9643314296979712 + maskLow := BitVec.ofNat 64 2261149957554455 + maskHigh := BitVec.ofNat 64 1152921540845633537 + systematicCode := BitVec.ofNat 64 17926504351932045135 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36033787787804928 + maskLow := BitVec.ofNat 64 1979674980843799 + maskHigh := BitVec.ofNat 64 1152921541114068993 + systematicCode := BitVec.ofNat 64 17926507279639729999 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9589949024190720 + maskLow := BitVec.ofNat 64 2261149957554455 + maskHigh := BitVec.ofNat 64 2305843027467304973 + systematicCode := BitVec.ofNat 64 18141832484904982351 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18019076008853888 + maskLow := BitVec.ofNat 64 1346356283244823 + maskHigh := BitVec.ofNat 64 2305843028541046785 + systematicCode := BitVec.ofNat 64 18141835636756010831 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9589949024206976 + maskLow := BitVec.ofNat 64 2261149957554455 + maskHigh := BitVec.ofNat 64 4611686027554193419 + systematicCode := BitVec.ofNat 64 18285382523970606927 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18019076007846016 + maskLow := BitVec.ofNat 64 748221957734679 + maskHigh := BitVec.ofNat 64 4611686029164806145 + systematicCode := BitVec.ofNat 64 18285387866288379727 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9642725582373120 + maskLow := BitVec.ofNat 64 2261149957554455 + maskHigh := BitVec.ofNat 64 9223372041418178567 + systematicCode := BitVec.ofNat 64 18357157539225229135 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11264020053756928 + maskLow := BitVec.ofNat 64 396378236846359 + maskHigh := BitVec.ofNat 64 9223372043297226753 + systematicCode := BitVec.ofNat 64 18357163981037852495 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9577343599593856 + maskLow := BitVec.ofNat 64 2261149957554455 + maskHigh := BitVec.ofNat 64 16140901101003079681 + systematicCode := BitVec.ofNat 64 18374118890069776207 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x5849. -/ +def normalizedWeightSixteenCandidateBucket_5849 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9083070400693248 + maskLow := BitVec.ofNat 64 36046462219518231 + maskHigh := BitVec.ofNat 64 9011597301530633 + systematicCode := BitVec.ofNat 64 16921612171386705993 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9083070399522816 + maskLow := BitVec.ofNat 64 36046462219518231 + maskHigh := BitVec.ofNat 64 18016597532876809 + systematicCode := BitVec.ofNat 64 17065162201895950409 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9084719667348480 + maskLow := BitVec.ofNat 64 36046462219518231 + maskHigh := BitVec.ofNat 64 72058144062570497 + systematicCode := BitVec.ofNat 64 17424068125093943369 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36033333077476352 + maskLow := BitVec.ofNat 64 436866829055492375 + maskHigh := BitVec.ofNat 64 72058145941225473 + systematicCode := BitVec.ofNat 64 17424074519511324745 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2258397456499712 + maskLow := BitVec.ofNat 64 36046462219518231 + maskHigh := BitVec.ofNat 64 72064261974654977 + systematicCode := BitVec.ofNat 64 17426067192338602057 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2328766167122944 + maskLow := BitVec.ofNat 64 36046462219518231 + maskHigh := BitVec.ofNat 64 576460821291360257 + systematicCode := BitVec.ofNat 64 17854724809279035465 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9014350956989440 + maskLow := BitVec.ofNat 64 36046462219518231 + maskHigh := BitVec.ofNat 64 603482901970944001 + systematicCode := BitVec.ofNat 64 17864911995567757385 }) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x584a. -/ +def normalizedWeightSixteenCandidateBucket_584a : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9641145185420288 + maskLow := BitVec.ofNat 64 18032132429512983 + maskHigh := BitVec.ofNat 64 4512395720687621 + systematicCode := BitVec.ofNat 64 16849836056603613258 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9641213905110016 + maskLow := BitVec.ofNat 64 18032132429512983 + maskHigh := BitVec.ofNat 64 18016597532811269 + systematicCode := BitVec.ofNat 64 17065161102367479882 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9640698509034496 + maskLow := BitVec.ofNat 64 18032132429512983 + maskHigh := BitVec.ofNat 64 144115463490961409 + systematicCode := BitVec.ofNat 64 17495845343649945674 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11263994551897216 + maskLow := BitVec.ofNat 64 725097273926680855 + maskHigh := BitVec.ofNat 64 144115465101246465 + systematicCode := BitVec.ofNat 64 17495850642867509322 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9575247770848384 + maskLow := BitVec.ofNat 64 18032132429512983 + maskHigh := BitVec.ofNat 64 144126254059094017 + systematicCode := BitVec.ofNat 64 17498406261353175114 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9922693279550592 + maskLow := BitVec.ofNat 64 18032132429512983 + maskHigh := BitVec.ofNat 64 576460821559812097 + systematicCode := BitVec.ofNat 64 17854725913085565002 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9574727779664896 + maskLow := BitVec.ofNat 64 18032132429512983 + maskHigh := BitVec.ofNat 64 598979027465666561 + systematicCode := BitVec.ofNat 64 17864910891761096778 }) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x584c. -/ +def normalizedWeightSixteenCandidateBucket_584c : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9641145185469056 + maskLow := BitVec.ofNat 64 9025070613725463 + maskHigh := BitVec.ofNat 64 4512395720556547 + systematicCode := BitVec.ofNat 64 16849833857546672204 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9641213904947456 + maskLow := BitVec.ofNat 64 9025070613725463 + maskHigh := BitVec.ofNat 64 9011597301334019 + systematicCode := BitVec.ofNat 64 16921608872801294412 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9640698508871936 + maskLow := BitVec.ofNat 64 9025070613725463 + maskHigh := BitVec.ofNat 64 288230514664603649 + systematicCode := BitVec.ofNat 64 17639399772205570124 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11263994552011008 + maskLow := BitVec.ofNat 64 869212599441490199 + maskHigh := BitVec.ofNat 64 288230515738148865 + systematicCode := BitVec.ofNat 64 17639402881023498316 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9575247770962176 + maskLow := BitVec.ofNat 64 9025070613725463 + maskHigh := BitVec.ofNat 64 288243641158205441 + systematicCode := BitVec.ofNat 64 17642523648452155468 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9922693279664384 + maskLow := BitVec.ofNat 64 9025070613725463 + maskHigh := BitVec.ofNat 64 576460822096691201 + systematicCode := BitVec.ofNat 64 17854728112142243916 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9574727779746176 + maskLow := BitVec.ofNat 64 9025070613725463 + maskHigh := BitVec.ofNat 64 589971690771972097 + systematicCode := BitVec.ofNat 64 17864347933217609804 }) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x584f. -/ +def normalizedWeightSixteenCandidateBucket_584f : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9641619779553536 + maskLow := BitVec.ofNat 64 4521745864261911 + maskHigh := BitVec.ofNat 64 72058144062177287 + systematicCode := BitVec.ofNat 64 17424067991429470287 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9641619779519104 + maskLow := BitVec.ofNat 64 4521745864261911 + maskHigh := BitVec.ofNat 64 144115463490633739 + systematicCode := BitVec.ofNat 64 17495845214297282639 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9641619779307776 + maskLow := BitVec.ofNat 64 4521745864261911 + maskHigh := BitVec.ofNat 64 288230514664407053 + systematicCode := BitVec.ofNat 64 17639399651476527183 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9576237760841984 + maskLow := BitVec.ofNat 64 4521745864261911 + maskHigh := BitVec.ofNat 64 504403229132455937 + systematicCode := BitVec.ofNat 64 17650435734125434959 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9923683269544192 + maskLow := BitVec.ofNat 64 4521745864261911 + maskHigh := BitVec.ofNat 64 576460822901948417 + systematicCode := BitVec.ofNat 64 17854728232870893647 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18019382955426176 + maskLow := BitVec.ofNat 64 63068541020078359 + maskHigh := BitVec.ofNat 64 576460823170383873 + systematicCode := BitVec.ofNat 64 17854731203713390671 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9575649050182016 + maskLow := BitVec.ofNat 64 4521745864261911 + maskHigh := BitVec.ofNat 64 576461716523581441 + systematicCode := BitVec.ofNat 64 17856435847543937103 }) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x5851. -/ +def normalizedWeightSixteenCandidateBucket_5851 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2258401451574272 + maskLow := BitVec.ofNat 64 576479448296128791 + maskHigh := BitVec.ofNat 64 4505113603342337 + systematicCode := BitVec.ofNat 64 16848192480967284817 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9084716204950528 + maskLow := BitVec.ofNat 64 576479448296128791 + maskHigh := BitVec.ofNat 64 4512395989221377 + systematicCode := BitVec.ofNat 64 16849859172604729425 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36033337072550912 + maskLow := BitVec.ofNat 64 99097887794856215 + maskHigh := BitVec.ofNat 64 4512397867876353 + systematicCode := BitVec.ofNat 64 16849865545446283345 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2328765900784640 + maskLow := BitVec.ofNat 64 576479448296128791 + maskHigh := BitVec.ofNat 64 36029896799051777 + systematicCode := BitVec.ofNat 64 17280515856789821521 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9083066938295296 + maskLow := BitVec.ofNat 64 576479448296128791 + maskHigh := BitVec.ofNat 64 144115462954041353 + systematicCode := BitVec.ofNat 64 17495821123876968529 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9083066937124864 + maskLow := BitVec.ofNat 64 576479448296128791 + maskHigh := BitVec.ofNat 64 288230513590804489 + systematicCode := BitVec.ofNat 64 17639371154386212945 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9014351756004352 + maskLow := BitVec.ofNat 64 576479448296128791 + maskHigh := BitVec.ofNat 64 468383159487037441 + systematicCode := BitVec.ofNat 64 17650433595232639057 }) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x5852. -/ +def normalizedWeightSixteenCandidateBucket_5852 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9575256027335808 + maskLow := BitVec.ofNat 64 288250171656044823 + maskHigh := BitVec.ofNat 64 9008988108619777 + systematicCode := BitVec.ofNat 64 16920251174516774994 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9640711293273088 + maskLow := BitVec.ofNat 64 288250171656044823 + maskHigh := BitVec.ofNat 64 9011597838450689 + systematicCode := BitVec.ofNat 64 16921636391160731730 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11264002808384640 + maskLow := BitVec.ofNat 64 117113385815965975 + maskHigh := BitVec.ofNat 64 9011599448735745 + systematicCode := BitVec.ofNat 64 16921641664524277842 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9922680495312000 + maskLow := BitVec.ofNat 64 288250171656044823 + maskHigh := BitVec.ofNat 64 36029897067503617 + systematicCode := BitVec.ofNat 64 17280516960596351058 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9641157969658880 + maskLow := BitVec.ofNat 64 288250171656044823 + maskHigh := BitVec.ofNat 64 72058143794036741 + systematicCode := BitVec.ofNat 64 17424045009093875794 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9641226689348608 + maskLow := BitVec.ofNat 64 288250171656044823 + maskHigh := BitVec.ofNat 64 288230513590738949 + systematicCode := BitVec.ofNat 64 17639370054857742418 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9574736568828928 + maskLow := BitVec.ofNat 64 288250171656044823 + maskHigh := BitVec.ofNat 64 396321167402598401 + systematicCode := BitVec.ofNat 64 17650152115960895570 }) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x5854. -/ +def normalizedWeightSixteenCandidateBucket_5854 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9575256027449600 + maskLow := BitVec.ofNat 64 144137182603444503 + maskHigh := BitVec.ofNat 64 18016324802314241 + systematicCode := BitVec.ofNat 64 17064366371182434388 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9640711293110528 + maskLow := BitVec.ofNat 64 144137182603444503 + maskHigh := BitVec.ofNat 64 18016598606675969 + systematicCode := BitVec.ofNat 64 17065190819716356180 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11264002808498432 + maskLow := BitVec.ofNat 64 126122784093962519 + maskHigh := BitVec.ofNat 64 18016599680221185 + systematicCode := BitVec.ofNat 64 17065193902646843476 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9922680495425792 + maskLow := BitVec.ofNat 64 144137182603444503 + maskHigh := BitVec.ofNat 64 36029897604382721 + systematicCode := BitVec.ofNat 64 17280519159653029972 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9641157969707648 + maskLow := BitVec.ofNat 64 144137182603444503 + maskHigh := BitVec.ofNat 64 72058143793905667 + systematicCode := BitVec.ofNat 64 17424042810036934740 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9641226689186048 + maskLow := BitVec.ofNat 64 144137182603444503 + maskHigh := BitVec.ofNat 64 144115462953844739 + systematicCode := BitVec.ofNat 64 17495817825291556948 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9574736568910208 + maskLow := BitVec.ofNat 64 144137182603444503 + maskHigh := BitVec.ofNat 64 252203780303486977 + systematicCode := BitVec.ofNat 64 17506036919294974036 }) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x5857. -/ +def normalizedWeightSixteenCandidateBucket_5857 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9641638955911424 + maskLow := BitVec.ofNat 64 72083986612027671 + maskHigh := BitVec.ofNat 64 4512395988828167 + systematicCode := BitVec.ofNat 64 16849859038940256343 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9641638955876992 + maskLow := BitVec.ofNat 64 72083986612027671 + maskHigh := BitVec.ofNat 64 9011597838123019 + systematicCode := BitVec.ofNat 64 16921636261808068695 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9641638955665664 + maskLow := BitVec.ofNat 64 72083986612027671 + maskHigh := BitVec.ofNat 64 18016598606479373 + systematicCode := BitVec.ofNat 64 17065190698987313239 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9576252409448704 + maskLow := BitVec.ofNat 64 72083986612027671 + maskHigh := BitVec.ofNat 64 31526299050704897 + systematicCode := BitVec.ofNat 64 17071714420275566679 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9923676877424896 + maskLow := BitVec.ofNat 64 72083986612027671 + maskHigh := BitVec.ofNat 64 36029898409639937 + systematicCode := BitVec.ofNat 64 17280519280381679703 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18019398136709504 + maskLow := BitVec.ofNat 64 1008832709105090839 + maskHigh := BitVec.ofNat 64 36029898678075393 + systematicCode := BitVec.ofNat 64 17280522285718132823 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9575664231465344 + maskLow := BitVec.ofNat 64 72083986612027671 + maskHigh := BitVec.ofNat 64 36044192329236481 + systematicCode := BitVec.ofNat 64 17282235725507483735 }) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x5b45. -/ +def normalizedWeightSixteenCandidateBucket_5b45 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9082661847214080 + maskLow := BitVec.ofNat 64 316680823701783 + maskHigh := BitVec.ofNat 64 2269392000254497 + systematicCode := BitVec.ofNat 64 16634510946498337605 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9082661998199808 + maskLow := BitVec.ofNat 64 316680823701783 + maskHigh := BitVec.ofNat 64 18016597536935969 + systematicCode := BitVec.ofNat 64 17065174283705211717 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9082674782438400 + maskLow := BitVec.ofNat 64 316680823701783 + maskHigh := BitVec.ofNat 64 288230513657778689 + systematicCode := BitVec.ofNat 64 17639392032422189893 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9011751987217408 + maskLow := BitVec.ofNat 64 316680823701783 + maskHigh := BitVec.ofNat 64 308496580917329921 + systematicCode := BitVec.ofNat 64 17648734759572036421 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9082120731395072 + maskLow := BitVec.ofNat 64 316680823701783 + maskHigh := BitVec.ofNat 64 9223372041221570561 + systematicCode := BitVec.ofNat 64 18357153313580997445 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11263968446548992 + maskLow := BitVec.ofNat 64 1306079097784434967 + maskHigh := BitVec.ofNat 64 9223372043297226753 + systematicCode := BitVec.ofNat 64 18357164084487215941 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9012306071817216 + maskLow := BitVec.ofNat 64 316680823701783 + maskHigh := BitVec.ofNat 64 9223391967650512897 + systematicCode := BitVec.ofNat 64 18363941827622558533 }) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x5b46. -/ +def normalizedWeightSixteenCandidateBucket_5b46 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9641622870566912 + maskLow := BitVec.ofNat 64 598172980281623 + maskHigh := BitVec.ofNat 64 1161084279456017 + systematicCode := BitVec.ofNat 64 16562734823125441350 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9641622306433024 + maskLow := BitVec.ofNat 64 598172980281623 + maskHigh := BitVec.ofNat 64 18016597541130257 + systematicCode := BitVec.ofNat 64 17065175383200127814 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9641618844035072 + maskLow := BitVec.ofNat 64 598172980281623 + maskHigh := BitVec.ofNat 64 288230513724887297 + systematicCode := BitVec.ofNat 64 17639393131917105990 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9576236288731136 + maskLow := BitVec.ofNat 64 598172980281623 + maskHigh := BitVec.ofNat 64 307370685305454593 + systematicCode := BitVec.ofNat 64 17648733664355441478 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9923681963098240 + maskLow := BitVec.ofNat 64 598172980281623 + maskHigh := BitVec.ofNat 64 4611686027160453121 + systematicCode := BitVec.ofNat 64 18285378298326440774 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18019382020153472 + maskLow := BitVec.ofNat 64 2459000619571151127 + maskHigh := BitVec.ofNat 64 4611686029164806145 + systematicCode := BitVec.ofNat 64 18285387969720965958 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9575648114909312 + maskLow := BitVec.ofNat 64 598172980281623 + maskHigh := BitVec.ofNat 64 4611723541409169409 + systematicCode := BitVec.ofNat 64 18292165708561406790 }) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x5b4c. -/ +def normalizedWeightSixteenCandidateBucket_5b4c : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9641623000582400 + maskLow := BitVec.ofNat 64 4539063172399383 + maskHigh := BitVec.ofNat 64 1161084283126019 + systematicCode := BitVec.ofNat 64 16562741420094937932 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9641622463709824 + maskLow := BitVec.ofNat 64 4539063172399383 + maskHigh := BitVec.ofNat 64 2269392008118787 + systematicCode := BitVec.ofNat 64 16634518642962750284 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9641618974050560 + maskLow := BitVec.ofNat 64 4539063172399383 + maskHigh := BitVec.ofNat 64 288230514664407809 + systematicCode := BitVec.ofNat 64 17639399703217462092 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9576236418746624 + maskLow := BitVec.ofNat 64 4539063172399383 + maskHigh := BitVec.ofNat 64 291608146739200001 + systematicCode := BitVec.ofNat 64 17647044840265374540 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9923681927448832 + maskLow := BitVec.ofNat 64 4539063172399383 + maskHigh := BitVec.ofNat 64 576460822109224961 + systematicCode := BitVec.ofNat 64 17854728181129960268 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18019382150168960 + maskLow := BitVec.ofNat 64 3467807176620310807 + maskHigh := BitVec.ofNat 64 576460823170383873 + systematicCode := BitVec.ofNat 64 17854731255454325580 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9575648244924800 + maskLow := BitVec.ofNat 64 4539063172399383 + maskHigh := BitVec.ofNat 64 576513668447993857 + systematicCode := BitVec.ofNat 64 17859826741403999052 }) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x5b4f. -/ +def normalizedWeightSixteenCandidateBucket_5b4f : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9576754876383488 + maskLow := BitVec.ofNat 64 9042937677676823 + maskHigh := BitVec.ofNat 64 288230459903574017 + systematicCode := BitVec.ofNat 64 17638562077992508239 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9643314253283584 + maskLow := BitVec.ofNat 64 9042937677676823 + maskHigh := BitVec.ofNat 64 288230514865733633 + systematicCode := BitVec.ofNat 64 17639399858440461135 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36033787779481856 + maskLow := BitVec.ofNat 64 5383762980438295 + maskHigh := BitVec.ofNat 64 288230515738148865 + systematicCode := BitVec.ofNat 64 17639402820574731087 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9589949009625344 + maskLow := BitVec.ofNat 64 9042937677676823 + maskHigh := BitVec.ofNat 64 576460822096642097 + systematicCode := BitVec.ofNat 64 17854728025907354447 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18019076133699968 + maskLow := BitVec.ofNat 64 4750444282839319 + maskHigh := BitVec.ofNat 64 576460823170383873 + systematicCode := BitVec.ofNat 64 17854731177691011919 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9589949011722368 + maskLow := BitVec.ofNat 64 9042937677676823 + maskHigh := BitVec.ofNat 64 4611686027151540259 + systematicCode := BitVec.ofNat 64 18285378143104228175 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9642725574050048 + maskLow := BitVec.ofNat 64 9042937677676823 + maskHigh := BitVec.ofNat 64 9223372041216851987 + systematicCode := BitVec.ofNat 64 18357153158358850383 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9577343591270784 + maskLow := BitVec.ofNat 64 9042937677676823 + maskHigh := BitVec.ofNat 64 14411518947172024321 + systematicCode := BitVec.ofNat 64 18374114509203397455 }) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x5b54. -/ +def normalizedWeightSixteenCandidateBucket_5b54 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9641638980880640 + maskLow := BitVec.ofNat 64 72097180751560983 + maskHigh := BitVec.ofNat 64 1161084346040339 + systematicCode := BitVec.ofNat 64 16562750181828746068 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9641638976684672 + maskLow := BitVec.ofNat 64 72097180751560983 + maskHigh := BitVec.ofNat 64 2269392133947427 + systematicCode := BitVec.ofNat 64 16634527404696558420 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9641638949423360 + maskLow := BitVec.ofNat 64 72097180751560983 + maskHigh := BitVec.ofNat 64 18016598606479409 + systematicCode := BitVec.ofNat 64 17065190716234292052 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9576252399044864 + maskLow := BitVec.ofNat 64 72097180751560983 + maskHigh := BitVec.ofNat 64 21393199889121281 + systematicCode := BitVec.ofNat 64 17070584122322213716 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9923676867021056 + maskLow := BitVec.ofNat 64 72097180751560983 + maskHigh := BitVec.ofNat 64 36029897805660161 + systematicCode := BitVec.ofNat 64 17280519263134702420 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18019398130467200 + maskLow := BitVec.ofNat 64 3602919288610029847 + maskHigh := BitVec.ofNat 64 36029898678075393 + systematicCode := BitVec.ofNat 64 17280522302965111636 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9575664225223040 + maskLow := BitVec.ofNat 64 72097180751560983 + maskHigh := BitVec.ofNat 64 36083774747836417 + systematicCode := BitVec.ofNat 64 17283366023460838228 }) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x5b57. -/ +def normalizedWeightSixteenCandidateBucket_5b57 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9576747418910976 + maskLow := BitVec.ofNat 64 144159172836000023 + maskHigh := BitVec.ofNat 64 18015513053495297 + systematicCode := BitVec.ofNat 64 17064353125503294295 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9643302268059904 + maskLow := BitVec.ofNat 64 144159172836000023 + maskHigh := BitVec.ofNat 64 18016598619062273 + systematicCode := BitVec.ofNat 64 17065190871457291095 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36033780322009344 + maskLow := BitVec.ofNat 64 72946003728204055 + maskHigh := BitVec.ofNat 64 18016599680221185 + systematicCode := BitVec.ofNat 64 17065193902444731223 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9589940753137920 + maskLow := BitVec.ofNat 64 144159172836000023 + maskHigh := BitVec.ofNat 64 36029897604334337 + systematicCode := BitVec.ofNat 64 17280519107912096599 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18019088917938560 + maskLow := BitVec.ofNat 64 72312685030605079 + maskHigh := BitVec.ofNat 64 36029898678075393 + systematicCode := BitVec.ofNat 64 17280522259561012055 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9589941021573248 + maskLow := BitVec.ofNat 64 144159172836000023 + maskHigh := BitVec.ofNat 64 4611686027025711619 + systematicCode := BitVec.ofNat 64 18285369381371468631 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9642718116577536 + maskLow := BitVec.ofNat 64 144159172836000023 + maskHigh := BitVec.ofNat 64 9223372041153937667 + systematicCode := BitVec.ofNat 64 18357144396626090839 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9577336133798272 + maskLow := BitVec.ofNat 64 144159172836000023 + maskHigh := BitVec.ofNat 64 13871089053471866881 + systematicCode := BitVec.ofNat 64 18374105747470637911 }) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x5d43. -/ +def normalizedWeightSixteenCandidateBucket_5d43 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9082661848221952 + maskLow := BitVec.ofNat 64 351856605856023 + maskHigh := BitVec.ofNat 64 2269392000255041 + systematicCode := BitVec.ofNat 64 16634510955121827139 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9082661998037248 + maskLow := BitVec.ofNat 64 351856605856023 + maskHigh := BitVec.ofNat 64 9011597303353409 + systematicCode := BitVec.ofNat 64 16921619846593076547 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9082674782275840 + maskLow := BitVec.ofNat 64 351856605856023 + maskHigh := BitVec.ofNat 64 144115462987322369 + systematicCode := BitVec.ofNat 64 17495837595310054723 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9011751987314944 + maskLow := BitVec.ofNat 64 351856605856023 + maskHigh := BitVec.ofNat 64 155374193586733057 + systematicCode := BitVec.ofNat 64 17504056621542759747 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9082120731492608 + maskLow := BitVec.ofNat 64 351856605856023 + maskHigh := BitVec.ofNat 64 9223372041185918977 + systematicCode := BitVec.ofNat 64 18357151105967807811 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11263968446646528 + maskLow := BitVec.ofNat 64 1459236660897186071 + maskHigh := BitVec.ofNat 64 9223372043297226753 + systematicCode := BitVec.ofNat 64 18357164084520901955 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9012306071914752 + maskLow := BitVec.ofNat 64 351856605856023 + maskHigh := BitVec.ofNat 64 9223394304112721921 + systematicCode := BitVec.ofNat 64 18363944035235749187 }) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x5d46. -/ +def normalizedWeightSixteenCandidateBucket_5d46 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9641622871737344 + maskLow := BitVec.ofNat 64 1196307305791767 + maskHigh := BitVec.ofNat 64 633318698123537 + systematicCode := BitVec.ofNat 64 16419182585003138374 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9641622307603456 + maskLow := BitVec.ofNat 64 1196307305791767 + maskHigh := BitVec.ofNat 64 9011597309644817 + systematicCode := BitVec.ofNat 64 16921623145077824838 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9641618845205504 + maskLow := BitVec.ofNat 64 1196307305791767 + maskHigh := BitVec.ofNat 64 144115463087984897 + systematicCode := BitVec.ofNat 64 17495840893794803014 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9576236289625216 + maskLow := BitVec.ofNat 64 1196307305791767 + maskHigh := BitVec.ofNat 64 153685356611371009 + systematicCode := BitVec.ofNat 64 17504053335892974918 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9923681962708096 + maskLow := BitVec.ofNat 64 1196307305791767 + maskHigh := BitVec.ofNat 64 2305843026536693761 + systematicCode := BitVec.ofNat 64 18141826060204137798 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18019382021080064 + maskLow := BitVec.ofNat 64 4918001200487530775 + maskHigh := BitVec.ofNat 64 2305843028541046785 + systematicCode := BitVec.ofNat 64 18141835740222152006 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9575648115835904 + maskLow := BitVec.ofNat 64 1196307305791767 + maskHigh := BitVec.ofNat 64 2305918053029773313 + systematicCode := BitVec.ofNat 64 18148615678052293958 }) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x5d4a. -/ +def normalizedWeightSixteenCandidateBucket_5d4a : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9641623000744960 + maskLow := BitVec.ofNat 64 4574110105534743 + maskHigh := BitVec.ofNat 64 633318699696389 + systematicCode := BitVec.ofNat 64 16419186982982802762 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9641622463661056 + maskLow := BitVec.ofNat 64 4574110105534743 + maskHigh := BitVec.ofNat 64 2269392008119301 + systematicCode := BitVec.ofNat 64 16634518651586239818 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9641618974213120 + maskLow := BitVec.ofNat 64 4574110105534743 + maskHigh := BitVec.ofNat 64 144115463490635009 + systematicCode := BitVec.ofNat 64 17495845274661707082 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9576236418632832 + maskLow := BitVec.ofNat 64 4574110105534743 + maskHigh := BitVec.ofNat 64 146930008709922817 + systematicCode := BitVec.ofNat 64 17502927453166263626 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9923681927335040 + maskLow := BitVec.ofNat 64 4574110105534743 + maskHigh := BitVec.ofNat 64 576460821570256897 + systematicCode := BitVec.ofNat 64 17854725982073150794 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18019382150087680 + maskLow := BitVec.ofNat 64 5782692432021881111 + maskHigh := BitVec.ofNat 64 576460823170383873 + systematicCode := BitVec.ofNat 64 17854731264044391754 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9575648244843520 + maskLow := BitVec.ofNat 64 4574110105534743 + maskHigh := BitVec.ofNat 64 576548990259036161 + systematicCode := BitVec.ofNat 64 17860389699947355466 }) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x5d4f. -/ +def normalizedWeightSixteenCandidateBucket_5d4f : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9576754876285952 + maskLow := BitVec.ofNat 64 18085321304506647 + maskHigh := BitVec.ofNat 64 144115280417652737 + systematicCode := BitVec.ofNat 64 17494449088940039503 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9643314252909696 + maskLow := BitVec.ofNat 64 18085321304506647 + maskHigh := BitVec.ofNat 64 144115463658405889 + systematicCode := BitVec.ofNat 64 17495845421261348175 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36033787779384320 + maskLow := BitVec.ofNat 64 5981897305948439 + maskHigh := BitVec.ofNat 64 144115465101246465 + systematicCode := BitVec.ofNat 64 17495850582485851471 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9589949009527808 + maskLow := BitVec.ofNat 64 18085321304506647 + maskHigh := BitVec.ofNat 64 576460821559771217 + systematicCode := BitVec.ofNat 64 17854725835474165071 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9589949011608576 + maskLow := BitVec.ofNat 64 18085321304506647 + maskHigh := BitVec.ofNat 64 2305843026527780933 + systematicCode := BitVec.ofNat 64 18141825913605414223 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9642725573952512 + maskLow := BitVec.ofNat 64 18085321304506647 + maskHigh := BitVec.ofNat 64 9223372041183297557 + systematicCode := BitVec.ofNat 64 18357150959369280847 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9577343591173248 + maskLow := BitVec.ofNat 64 18085321304506647 + maskHigh := BitVec.ofNat 64 12105676075397283841 + systematicCode := BitVec.ofNat 64 18373551567840042319 }) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x5d52. -/ +def normalizedWeightSixteenCandidateBucket_5d52 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9641638981043200 + maskLow := BitVec.ofNat 64 72130166100394263 + maskHigh := BitVec.ofNat 64 633318731153429 + systematicCode := BitVec.ofNat 64 16419195744716610898 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9641638976635904 + maskLow := BitVec.ofNat 64 72130166100394263 + maskHigh := BitVec.ofNat 64 2269392133947461 + systematicCode := BitVec.ofNat 64 16634527413320047954 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9641638949585920 + maskLow := BitVec.ofNat 64 72130166100394263 + maskHigh := BitVec.ofNat 64 9011597838123089 + systematicCode := BitVec.ofNat 64 16921636287678537042 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9576252398931072 + maskLow := BitVec.ofNat 64 72130166100394263 + maskHigh := BitVec.ofNat 64 11823050680958977 + systematicCode := BitVec.ofNat 64 16926466735223102802 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9923676866907264 + maskLow := BitVec.ofNat 64 72130166100394263 + maskHigh := BitVec.ofNat 64 36029897235234817 + systematicCode := BitVec.ofNat 64 17280517064077892946 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18019398130385920 + maskLow := BitVec.ofNat 64 6052910471248412951 + maskHigh := BitVec.ofNat 64 36029898678075393 + systematicCode := BitVec.ofNat 64 17280522311555177810 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9575664225141760 + maskLow := BitVec.ofNat 64 72130166100394263 + maskHigh := BitVec.ofNat 64 36121158143180801 + systematicCode := BitVec.ofNat 64 17283928982004194642 }) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x5d57. -/ +def normalizedWeightSixteenCandidateBucket_5d57 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9576747418813440 + maskLow := BitVec.ofNat 64 288309545283944727 + maskHigh := BitVec.ofNat 64 9008322388688897 + systematicCode := BitVec.ofNat 64 16920240136450825559 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9643302267686016 + maskLow := BitVec.ofNat 64 288309545283944727 + maskHigh := BitVec.ofNat 64 9011597848608769 + systematicCode := BitVec.ofNat 64 16921636434278178135 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36033780321911808 + maskLow := BitVec.ofNat 64 73544138053714199 + maskHigh := BitVec.ofNat 64 9011599448735745 + systematicCode := BitVec.ofNat 64 16921641664355851607 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9589940753040384 + maskLow := BitVec.ofNat 64 288309545283944727 + maskHigh := BitVec.ofNat 64 36029897067463937 + systematicCode := BitVec.ofNat 64 17280516917478907223 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9589941021459456 + maskLow := BitVec.ofNat 64 288309545283944727 + maskHigh := BitVec.ofNat 64 2305843026401952773 + systematicCode := BitVec.ofNat 64 18141817151872654679 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9642718116480000 + maskLow := BitVec.ofNat 64 288309545283944727 + maskHigh := BitVec.ofNat 64 9223372041151840517 + systematicCode := BitVec.ofNat 64 18357142197636521303 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9577336133700736 + maskLow := BitVec.ofNat 64 288309545283944727 + maskHigh := BitVec.ofNat 64 11565248243281428481 + systematicCode := BitVec.ofNat 64 18373542806107282775 }) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x5d5b. -/ +def normalizedWeightSixteenCandidateBucket_5d5b : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9576747356390400 + maskLow := BitVec.ofNat 64 1153027062018146583 + maskHigh := BitVec.ofNat 64 2252974487240705 + systematicCode := BitVec.ofNat 64 16632014158345887067 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9643302169889920 + maskLow := BitVec.ofNat 64 1153027062018146583 + maskHigh := BitVec.ofNat 64 2269392142860289 + systematicCode := BitVec.ofNat 64 16634527559919951195 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 36033780259488768 + maskLow := BitVec.ofNat 64 76948226053308695 + maskHigh := BitVec.ofNat 64 2269394147213313 + systematicCode := BitVec.ofNat 64 16634537188178091355 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9589940690617344 + maskLow := BitVec.ofNat 64 1153027062018146583 + maskHigh := BitVec.ofNat 64 36029896664813825 + systematicCode := BitVec.ofNat 64 17280512536612527451 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9589940956955648 + maskLow := BitVec.ofNat 64 1153027062018146583 + maskHigh := BitVec.ofNat 64 576460821031292945 + systematicCode := BitVec.ofNat 64 17854712692875025755 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9642718054056960 + maskLow := BitVec.ofNat 64 1153027062018146583 + maskHigh := BitVec.ofNat 64 9223372041150267665 + systematicCode := BitVec.ofNat 64 18357137799657381211 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9577336071277696 + maskLow := BitVec.ofNat 64 1153027062018146583 + maskHigh := BitVec.ofNat 64 9835879180510691329 + systematicCode := BitVec.ofNat 64 18372416923380571483 }) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x5e43. -/ +def normalizedWeightSixteenCandidateBucket_5e43 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9082593128743552 + maskLow := BitVec.ofNat 64 703700326744343 + maskHigh := BitVec.ofNat 64 1161084279456833 + systematicCode := BitVec.ofNat 64 16562734836060675651 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9082593278558848 + maskLow := BitVec.ofNat 64 703700326744343 + maskHigh := BitVec.ofNat 64 4512395722494017 + systematicCode := BitVec.ofNat 64 16849843727531925059 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9082606062797440 + maskLow := BitVec.ofNat 64 703700326744343 + maskHigh := BitVec.ofNat 64 72058143827301377 + systematicCode := BitVec.ofNat 64 17424061476248903235 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2256283826784384 + maskLow := BitVec.ofNat 64 703700326744343 + maskHigh := BitVec.ofNat 64 77687104309559297 + systematicCode := BitVec.ofNat 64 17431716457311526467 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2326652570960000 + maskLow := BitVec.ofNat 64 703700326744343 + maskHigh := BitVec.ofNat 64 4611686027053498369 + systematicCode := BitVec.ofNat 64 18285374986906656323 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10138068539804288 + maskLow := BitVec.ofNat 64 2918473308909404439 + maskHigh := BitVec.ofNat 64 4611686029164806145 + systematicCode := BitVec.ofNat 64 18285387969771494979 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9012237352438400 + maskLow := BitVec.ofNat 64 703700326744343 + maskHigh := BitVec.ofNat 64 4611730550795796481 + systematicCode := BitVec.ofNat 64 18292169019981192771 }) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x5e45. -/ +def normalizedWeightSixteenCandidateBucket_5e45 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9082593127524352 + maskLow := BitVec.ofNat 64 1266658870100247 + maskHigh := BitVec.ofNat 64 633318698123809 + systematicCode := BitVec.ofNat 64 16419182589314883141 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9082593278510080 + maskLow := BitVec.ofNat 64 1266658870100247 + maskHigh := BitVec.ofNat 64 4512395724591137 + systematicCode := BitVec.ofNat 64 16849845926521757253 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9082606062748672 + maskLow := BitVec.ofNat 64 1266658870100247 + maskHigh := BitVec.ofNat 64 72058143860855297 + systematicCode := BitVec.ofNat 64 17424063675238735429 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2256283826930688 + maskLow := BitVec.ofNat 64 1266658870100247 + maskHigh := BitVec.ofNat 64 77124162946072577 + systematicCode := BitVec.ofNat 64 17431714266878336581 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2326652570846208 + maskLow := BitVec.ofNat 64 1266658870100247 + maskHigh := BitVec.ofNat 64 2305843026465390593 + systematicCode := BitVec.ofNat 64 18141824956397542981 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10138068539755520 + maskLow := BitVec.ofNat 64 5224316326713032983 + maskHigh := BitVec.ofNat 64 2305843028541046785 + systematicCode := BitVec.ofNat 64 18141835740238995013 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9012237352389632 + maskLow := BitVec.ofNat 64 1266658870100247 + maskHigh := BitVec.ofNat 64 2305922725954191361 + systematicCode := BitVec.ofNat 64 18148616781858889285 }) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x5e49. -/ +def normalizedWeightSixteenCandidateBucket_5e49 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9082593121282048 + maskLow := BitVec.ofNat 64 4644410130235671 + maskHigh := BitVec.ofNat 64 633318699696649 + systematicCode := BitVec.ofNat 64 16419186987294547529 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9082593122452480 + maskLow := BitVec.ofNat 64 4644410130235671 + maskHigh := BitVec.ofNat 64 1161084283126793 + systematicCode := BitVec.ofNat 64 16562741433030172233 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9082606006567936 + maskLow := BitVec.ofNat 64 4644410130235671 + maskHigh := BitVec.ofNat 64 72058144062178817 + systematicCode := BitVec.ofNat 64 17424068056105639497 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2256283795719168 + maskLow := BitVec.ofNat 64 4644410130235671 + maskHigh := BitVec.ofNat 64 73746514765152257 + systematicCode := BitVec.ofNat 64 17430588384151625289 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2326652506342400 + maskLow := BitVec.ofNat 64 4644410130235671 + maskHigh := BitVec.ofNat 64 576460821297627137 + systematicCode := BitVec.ofNat 64 17854724878266555977 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10138068483574784 + maskLow := BitVec.ofNat 64 6953698635162910999 + maskHigh := BitVec.ofNat 64 576460823170383873 + systematicCode := BitVec.ofNat 64 17854731264061234761 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9012237296208896 + maskLow := BitVec.ofNat 64 4644410130235671 + maskHigh := BitVec.ofNat 64 576566857322987521 + systematicCode := BitVec.ofNat 64 17860390803753950793 }) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x5e4f. -/ +def normalizedWeightSixteenCandidateBucket_5e4f : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 45041086383279232 + maskLow := BitVec.ofNat 64 36170088558166295 + maskHigh := BitVec.ofNat 64 72057690674692097 + systematicCode := BitVec.ofNat 64 17422391499197144655 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9082104191929472 + maskLow := BitVec.ofNat 64 36170088558166295 + maskHigh := BitVec.ofNat 64 72058144162840577 + systematicCode := BitVec.ofNat 64 17424068198393601615 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11266150762302592 + maskLow := BitVec.ofNat 64 6333741026836759 + maskHigh := BitVec.ofNat 64 72058145941225473 + systematicCode := BitVec.ofNat 64 17424074463424699983 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 45111455093902464 + maskLow := BitVec.ofNat 64 36170088558166295 + maskHigh := BitVec.ofNat 64 576460821291335777 + systematicCode := BitVec.ofNat 64 17854724735979380303 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 45111455193779328 + maskLow := BitVec.ofNat 64 36170088558166295 + maskHigh := BitVec.ofNat 64 2305843026460672073 + systematicCode := BitVec.ofNat 64 18141824814110629455 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 45111455194169472 + maskLow := BitVec.ofNat 64 36170088558166295 + maskHigh := BitVec.ofNat 64 4611686027050876969 + systematicCode := BitVec.ofNat 64 18285374844619873871 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9011735413933184 + maskLow := BitVec.ofNat 64 36170088558166295 + maskHigh := BitVec.ofNat 64 7493990331847802881 + systematicCode := BitVec.ofNat 64 18301493978097147471 }) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x5e51. -/ +def normalizedWeightSixteenCandidateBucket_5e51 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9082585930147840 + maskLow := BitVec.ofNat 64 72199435332944151 + maskHigh := BitVec.ofNat 64 633318731153449 + systematicCode := BitVec.ofNat 64 16419195749028355665 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9082585931318272 + maskLow := BitVec.ofNat 64 72199435332944151 + maskHigh := BitVec.ofNat 64 1161084346040393 + systematicCode := BitVec.ofNat 64 16562750194763980369 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9082586031195136 + maskLow := BitVec.ofNat 64 72199435332944151 + maskHigh := BitVec.ofNat 64 4512395988828257 + systematicCode := BitVec.ofNat 64 16849859069122469457 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2256271277818880 + maskLow := BitVec.ofNat 64 72199435332944151 + maskHigh := BitVec.ofNat 64 6193551146745857 + systematicCode := BitVec.ofNat 64 16854127666208464465 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2326635727029248 + maskLow := BitVec.ofNat 64 72199435332944151 + maskHigh := BitVec.ofNat 64 36029896899690497 + systematicCode := BitVec.ofNat 64 17280515960271298129 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10138052769614848 + maskLow := BitVec.ofNat 64 7494131621239521559 + maskHigh := BitVec.ofNat 64 36029898678075393 + systematicCode := BitVec.ofNat 64 17280522311572020817 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9012221582248960 + maskLow := BitVec.ofNat 64 72199435332944151 + maskHigh := BitVec.ofNat 64 36143148375736321 + systematicCode := BitVec.ofNat 64 17283930085810789969 }) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x5e57. -/ +def normalizedWeightSixteenCandidateBucket_5e57 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 45041086116940928 + maskLow := BitVec.ofNat 64 576610290179834135 + maskHigh := BitVec.ofNat 64 4504727056285697 + systematicCode := BitVec.ofNat 64 16848182546707930711 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9082125232655488 + maskLow := BitVec.ofNat 64 576610290179834135 + maskHigh := BitVec.ofNat 64 4512395995119617 + systematicCode := BitVec.ofNat 64 16849859211410431575 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11266150495964288 + maskLow := BitVec.ofNat 64 73895981774602519 + maskHigh := BitVec.ofNat 64 4512397867876353 + systematicCode := BitVec.ofNat 64 16849865545294700119 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 45111450566151296 + maskLow := BitVec.ofNat 64 576610290179834135 + maskHigh := BitVec.ofNat 64 36029896799028737 + systematicCode := BitVec.ofNat 64 17280515817984122455 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 45111463450266752 + maskLow := BitVec.ofNat 64 576610290179834135 + maskHigh := BitVec.ofNat 64 2305843026397758473 + systematicCode := BitVec.ofNat 64 18141816052377869911 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 45111463450656896 + maskLow := BitVec.ofNat 64 576610290179834135 + maskHigh := BitVec.ofNat 64 4611686027019420169 + systematicCode := BitVec.ofNat 64 18285366082887114327 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9011752193246336 + maskLow := BitVec.ofNat 64 576610290179834135 + maskHigh := BitVec.ofNat 64 6953566622900551681 + systematicCode := BitVec.ofNat 64 18301485216364387927 }) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x5e5b. -/ +def normalizedWeightSixteenCandidateBucket_5e5b : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 45041086181444736 + maskLow := BitVec.ofNat 64 2306018935369171223 + maskHigh := BitVec.ofNat 64 1127078875365377 + systematicCode := BitVec.ofNat 64 16559956568602992219 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9082125330451584 + maskLow := BitVec.ofNat 64 2306018935369171223 + maskHigh := BitVec.ofNat 64 1161084350758913 + systematicCode := BitVec.ofNat 64 16562750337052204635 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11266150560468096 + maskLow := BitVec.ofNat 64 77300069774197015 + maskHigh := BitVec.ofNat 64 1161086426415105 + systematicCode := BitVec.ofNat 64 16562761069116939867 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 45111450630655104 + maskLow := BitVec.ofNat 64 2306018935369171223 + maskHigh := BitVec.ofNat 64 36029896597705217 + systematicCode := BitVec.ofNat 64 17280511437117742683 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 45111463414893696 + maskLow := BitVec.ofNat 64 2306018935369171223 + maskHigh := BitVec.ofNat 64 576460821027098657 + systematicCode := BitVec.ofNat 64 17854711593380240987 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 45111463465222272 + maskLow := BitVec.ofNat 64 2306018935369171223 + maskHigh := BitVec.ofNat 64 4611686027017847329 + systematicCode := BitVec.ofNat 64 18285361684907974235 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9011752257750144 + maskLow := BitVec.ofNat 64 2306018935369171223 + maskHigh := BitVec.ofNat 64 5224210754269347841 + systematicCode := BitVec.ofNat 64 18300359333637676635 }) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x5e5d. -/ +def normalizedWeightSixteenCandidateBucket_5e5d : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 45041086181558528 + maskLow := BitVec.ofNat 64 4611897128954954007 + maskHigh := BitVec.ofNat 64 564137511878657 + systematicCode := BitVec.ofNat 64 16415841389117202013 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9082125330825472 + maskLow := BitVec.ofNat 64 4611897128954954007 + maskHigh := BitVec.ofNat 64 633318733774849 + systematicCode := BitVec.ofNat 64 16419195891316711005 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 11266150560581888 + maskLow := BitVec.ofNat 64 77898204099707159 + maskHigh := BitVec.ofNat 64 633320845082625 + systematicCode := BitVec.ofNat 64 16419208830994636381 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 45111450630768896 + maskLow := BitVec.ofNat 64 4611897128954954007 + maskHigh := BitVec.ofNat 64 36029896564151297 + systematicCode := BitVec.ofNat 64 17280509238128172637 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 45111463415007488 + maskLow := BitVec.ofNat 64 4611897128954954007 + maskHigh := BitVec.ofNat 64 576460821025001537 + systematicCode := BitVec.ofNat 64 17854709394390670941 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 45111463464945920 + maskLow := BitVec.ofNat 64 4611897128954954007 + maskHigh := BitVec.ofNat 64 2305843026394088513 + systematicCode := BitVec.ofNat 64 18141809455409159773 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9011752257863936 + maskLow := BitVec.ofNat 64 4611897128954954007 + maskHigh := BitVec.ofNat 64 2918402929427742721 + systematicCode := BitVec.ofNat 64 18156244154151886429 }) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x6261. -/ +def normalizedWeightSixteenCandidateBucket_6261 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.leaf + { patternClass := .d16Plus + affineCode := BitVec.ofNat 56 54324726491848960 + maskLow := BitVec.ofNat 64 78531522797306135 + maskHigh := BitVec.ofNat 64 422214612549633 + systematicCode := BitVec.ofNat 64 16203880473810985569 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2256799222857984 + maskLow := BitVec.ofNat 64 4612530447652552983 + maskHigh := BitVec.ofNat 64 283847946141697 + systematicCode := BitVec.ofNat 64 16200516343353336417 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2326618211221760 + maskLow := BitVec.ofNat 64 4612530447652552983 + maskHigh := BitVec.ofNat 64 422212501241857 + systematicCode := BitVec.ofNat 64 16203867534133060193 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9082159386200320 + maskLow := BitVec.ofNat 64 4612530447652552983 + maskHigh := BitVec.ofNat 64 18016597566297089 + systematicCode := BitVec.ofNat 64 17065180880944521825 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9082146601961728 + maskLow := BitVec.ofNat 64 4612530447652552983 + maskHigh := BitVec.ofNat 64 288230513592766529 + systematicCode := BitVec.ofNat 64 17639381037207020129 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9082146452146432 + maskLow := BitVec.ofNat 64 4612530447652552983 + maskHigh := BitVec.ofNat 64 1152921538967110721 + systematicCode := BitVec.ofNat 64 17926481098225508961 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9012340431653120 + maskLow := BitVec.ofNat 64 4612530447652552983 + maskHigh := BitVec.ofNat 64 1459307018903879681 + systematicCode := BitVec.ofNat 64 17939223661457990241 }) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x6461. -/ +def normalizedWeightSixteenCandidateBucket_6461 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2256799222760448 + maskLow := BitVec.ofNat 64 2307250388392280343 + maskHigh := BitVec.ofNat 64 286184408350721 + systematicCode := BitVec.ofNat 64 16201081492329882721 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2326618211124224 + maskLow := BitVec.ofNat 64 2307250388392280343 + maskHigh := BitVec.ofNat 64 422212536893441 + systematicCode := BitVec.ofNat 64 16203869741746119777 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9082159386362880 + maskLow := BitVec.ofNat 64 2307250388392280343 + maskHigh := BitVec.ofNat 64 9011597368365569 + systematicCode := BitVec.ofNat 64 16921630841811657825 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9082146602124288 + maskLow := BitVec.ofNat 64 2307250388392280343 + maskHigh := BitVec.ofNat 64 144115462957961249 + systematicCode := BitVec.ofNat 64 17495830998074156129 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9082146451138560 + maskLow := BitVec.ofNat 64 2307250388392280343 + maskHigh := BitVec.ofNat 64 1152921538967110177 + systematicCode := BitVec.ofNat 64 17926481089601889377 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9012340431555584 + maskLow := BitVec.ofNat 64 2307250388392280343 + maskHigh := BitVec.ofNat 64 1306184631573282817 + systematicCode := BitVec.ofNat 64 17938658512481182817 }) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x6462. -/ +def normalizedWeightSixteenCandidateBucket_6462 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9577301441006720 + maskLow := BitVec.ofNat 64 1154610358762144023 + maskHigh := BitVec.ofNat 64 290857332768769 + systematicCode := BitVec.ofNat 64 16201364066818155618 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9922032696052864 + maskLow := BitVec.ofNat 64 1154610358762144023 + maskHigh := BitVec.ofNat 64 422212608196609 + systematicCode := BitVec.ofNat 64 16203870845552649314 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9643268111860736 + maskLow := BitVec.ofNat 64 1154610358762144023 + maskHigh := BitVec.ofNat 64 4512395854614785 + systematicCode := BitVec.ofNat 64 16849855822245225570 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9643271574258688 + maskLow := BitVec.ofNat 64 1154610358762144023 + maskHigh := BitVec.ofNat 64 72058143802134545 + systematicCode := BitVec.ofNat 64 17424055978507723874 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9643272138392576 + maskLow := BitVec.ofNat 64 1154610358762144023 + maskHigh := BitVec.ofNat 64 1152921538967109905 + systematicCode := BitVec.ofNat 64 17926481085290079330 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9576781986661376 + maskLow := BitVec.ofNat 64 1154610358762144023 + maskHigh := BitVec.ofNat 64 1229623437907984385 + systematicCode := BitVec.ofNat 64 17938375937992778850 }) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x6861. -/ +def normalizedWeightSixteenCandidateBucket_6861 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2256799160337408 + maskLow := BitVec.ofNat 64 581245831202537751 + maskHigh := BitVec.ofNat 64 299481627099137 + systematicCode := BitVec.ofNat 64 16202207409416333409 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2326618148701184 + maskLow := BitVec.ofNat 64 581245831202537751 + maskHigh := BitVec.ofNat 64 422212739792897 + systematicCode := BitVec.ofNat 64 16203874139859478625 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9082159357232128 + maskLow := BitVec.ofNat 64 581245831202537751 + maskHigh := BitVec.ofNat 64 2269392268166657 + systematicCode := BitVec.ofNat 64 16634530746433169505 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9082146473116672 + maskLow := BitVec.ofNat 64 581245831202537751 + maskHigh := BitVec.ofNat 64 144115462957958153 + systematicCode := BitVec.ofNat 64 17495830980826916961 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9082146471946240 + maskLow := BitVec.ofNat 64 581245831202537751 + maskHigh := BitVec.ofNat 64 288230513592762889 + systematicCode := BitVec.ofNat 64 17639381011336161377 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9012340369132544 + maskLow := BitVec.ofNat 64 581245831202537751 + maskHigh := BitVec.ofNat 64 434738103677091841 + systematicCode := BitVec.ofNat 64 17650423738282698849 }) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x6862. -/ +def normalizedWeightSixteenCandidateBucket_6862 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9577301505510528 + maskLow := BitVec.ofNat 64 293296930027536663 + maskHigh := BitVec.ofNat 64 317348691050497 + systematicCode := BitVec.ofNat 64 16202489983904606306 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9922032760556672 + maskLow := BitVec.ofNat 64 293296930027536663 + maskHigh := BitVec.ofNat 64 422213012422657 + systematicCode := BitVec.ofNat 64 16203875243666008162 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9643268140991488 + maskLow := BitVec.ofNat 64 293296930027536663 + maskHigh := BitVec.ofNat 64 1161084815803649 + systematicCode := BitVec.ofNat 64 16562755726866737250 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9643271630439424 + maskLow := BitVec.ofNat 64 293296930027536663 + maskHigh := BitVec.ofNat 64 72058143802131461 + systematicCode := BitVec.ofNat 64 17424055961260484706 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9643272167523328 + maskLow := BitVec.ofNat 64 293296930027536663 + maskHigh := BitVec.ofNat 64 288230513592762629 + systematicCode := BitVec.ofNat 64 17639381007024351330 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9576782047003648 + maskLow := BitVec.ofNat 64 293296930027536663 + maskHigh := BitVec.ofNat 64 361554609732321281 + systematicCode := BitVec.ofNat 64 17650141163794294882 }) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x6864. -/ +def normalizedWeightSixteenCandidateBucket_6864 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9577301505624320 + maskLow := BitVec.ofNat 64 149744691905102103 + maskHigh := BitVec.ofNat 64 352670502092801 + systematicCode := BitVec.ofNat 64 16203052942447831140 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9922032760670464 + maskLow := BitVec.ofNat 64 149744691905102103 + maskHigh := BitVec.ofNat 64 422213551390721 + systematicCode := BitVec.ofNat 64 16203877442722687076 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9643268140828928 + maskLow := BitVec.ofNat 64 149744691905102103 + maskHigh := BitVec.ofNat 64 633319771341569 + systematicCode := BitVec.ofNat 64 16419205679177492580 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9643271630488192 + maskLow := BitVec.ofNat 64 149744691905102103 + maskHigh := BitVec.ofNat 64 72058143802130947 + systematicCode := BitVec.ofNat 64 17424055952636864612 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9643272167360768 + maskLow := BitVec.ofNat 64 149744691905102103 + maskHigh := BitVec.ofNat 64 144115462957957379 + systematicCode := BitVec.ofNat 64 17495830967891486820 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9576782047084928 + maskLow := BitVec.ofNat 64 149744691905102103 + maskHigh := BitVec.ofNat 64 216876471703044097 + systematicCode := BitVec.ofNat 64 17506023776695052388 }) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x6867. -/ +def normalizedWeightSixteenCandidateBucket_6867 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9577309239838976 + maskLow := BitVec.ofNat 64 78812997774016791 + maskHigh := BitVec.ofNat 64 404622426505217 + systematicCode := BitVec.ofNat 64 16203066188126775399 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9922040494885120 + maskLow := BitVec.ofNat 64 78812997774016791 + maskHigh := BitVec.ofNat 64 422214344114177 + systematicCode := BitVec.ofNat 64 16203877494463424615 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18021034519249280 + maskLow := BitVec.ofNat 64 1015561720267079959 + maskHigh := BitVec.ofNat 64 422214612549633 + systematicCode := BitVec.ofNat 64 16203880499799877735 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9643275338205440 + maskLow := BitVec.ofNat 64 78812997774016791 + maskHigh := BitVec.ofNat 64 633319771340813 + systematicCode := BitVec.ofNat 64 16419205627436361831 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9643275338416768 + maskLow := BitVec.ofNat 64 78812997774016791 + maskHigh := BitVec.ofNat 64 1161084815802379 + systematicCode := BitVec.ofNat 64 16562755666501986407 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9643275338451200 + maskLow := BitVec.ofNat 64 78812997774016791 + maskHigh := BitVec.ofNat 64 2269392268165127 + systematicCode := BitVec.ofNat 64 16634530681756608615 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9576789244461440 + maskLow := BitVec.ofNat 64 78812997774016791 + maskHigh := BitVec.ofNat 64 4081389309788161 + systematicCode := BitVec.ofNat 64 16637954948519192679 }) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x6b64. -/ +def normalizedWeightSixteenCandidateBucket_6b64 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9577309229435136 + maskLow := BitVec.ofNat 64 82190697494544663 + maskHigh := BitVec.ofNat 64 365040007905281 + systematicCode := BitVec.ofNat 64 16203061772900395876 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9922040484481280 + maskLow := BitVec.ofNat 64 82190697494544663 + maskHigh := BitVec.ofNat 64 422213740134401 + systematicCode := BitVec.ofNat 64 16203877477216447332 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18021034513006976 + maskLow := BitVec.ofNat 64 3613012805353013527 + maskHigh := BitVec.ofNat 64 422214612549633 + systematicCode := BitVec.ofNat 64 16203880517046856548 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9643275331963136 + maskLow := BitVec.ofNat 64 82190697494544663 + maskHigh := BitVec.ofNat 64 633319771340849 + systematicCode := BitVec.ofNat 64 16419205644683340644 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9643275359224448 + maskLow := BitVec.ofNat 64 82190697494544663 + maskHigh := BitVec.ofNat 64 4512395854610467 + systematicCode := BitVec.ofNat 64 16849855761880214372 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9643275363420416 + maskLow := BitVec.ofNat 64 82190697494544663 + maskHigh := BitVec.ofNat 64 9011597368360979 + systematicCode := BitVec.ofNat 64 16921630777134836580 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9576789238219136 + maskLow := BitVec.ofNat 64 82190697494544663 + maskHigh := BitVec.ofNat 64 14214488471371777 + systematicCode := BitVec.ofNat 64 16927311224577747812 }) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x6b67. -/ +def normalizedWeightSixteenCandidateBucket_6b67 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9574701940736256 + maskLow := BitVec.ofNat 64 155374191439315223 + maskHigh := BitVec.ofNat 64 351858753273857 + systematicCode := BitVec.ofNat 64 16203039696768691047 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9587793001054464 + maskLow := BitVec.ofNat 64 155374191439315223 + maskHigh := BitVec.ofNat 64 422213539004417 + systematicCode := BitVec.ofNat 64 16203877390981753703 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18021032122204544 + maskLow := BitVec.ofNat 64 137359792929833239 + maskHigh := BitVec.ofNat 64 422214612549633 + systematicCode := BitVec.ofNat 64 16203880473912240999 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9640677237735680 + maskLow := BitVec.ofNat 64 155374191439315223 + maskHigh := BitVec.ofNat 64 633319771389953 + systematicCode := BitVec.ofNat 64 16419205730918427495 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9587827360792704 + maskLow := BitVec.ofNat 64 155374191439315223 + maskHigh := BitVec.ofNat 64 4611686027017486339 + systematicCode := BitVec.ofNat 64 18285356238771546983 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9640672638402816 + maskLow := BitVec.ofNat 64 155374191439315223 + maskHigh := BitVec.ofNat 64 9223372041149825027 + systematicCode := BitVec.ofNat 64 18357131254026169191 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9575290655623552 + maskLow := BitVec.ofNat 64 155374191439315223 + maskHigh := BitVec.ofNat 64 13835761744871424001 + systematicCode := BitVec.ofNat 64 18374092604870716263 }) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x6d62. -/ +def normalizedWeightSixteenCandidateBucket_6d62 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9577309229321344 + maskLow := BitVec.ofNat 64 90634946795864343 + maskHigh := BitVec.ofNat 64 327656612560897 + systematicCode := BitVec.ofNat 64 16202498814357040482 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9922040484367488 + maskLow := BitVec.ofNat 64 90634946795864343 + maskHigh := BitVec.ofNat 64 422213169709057 + systematicCode := BitVec.ofNat 64 16203875278159637858 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 18021034512925696 + maskLow := BitVec.ofNat 64 6071415251943883031 + maskHigh := BitVec.ofNat 64 422214612549633 + systematicCode := BitVec.ofNat 64 16203880525636922722 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9643275332125696 + maskLow := BitVec.ofNat 64 90634946795864343 + maskHigh := BitVec.ofNat 64 1161084815802449 + systematicCode := BitVec.ofNat 64 16562755692372454754 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9643275359175680 + maskLow := BitVec.ofNat 64 90634946795864343 + maskHigh := BitVec.ofNat 64 4512395854610501 + systematicCode := BitVec.ofNat 64 16849855770503703906 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9643275363582976 + maskLow := BitVec.ofNat 64 90634946795864343 + maskHigh := BitVec.ofNat 64 18016597566291989 + systematicCode := BitVec.ofNat 64 17065180816267570530 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9576789238137856 + maskLow := BitVec.ofNat 64 90634946795864343 + maskHigh := BitVec.ofNat 64 23784637679534081 + systematicCode := BitVec.ofNat 64 17071428611676859746 }) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x6d67. -/ +def normalizedWeightSixteenCandidateBucket_6d67 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9574701940638720 + maskLow := BitVec.ofNat 64 308496578769912087 + maskHigh := BitVec.ofNat 64 316682971119617 + systematicCode := BitVec.ofNat 64 16202478945838656871 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9587793000956928 + maskLow := BitVec.ofNat 64 308496578769912087 + maskHigh := BitVec.ofNat 64 422213002264577 + systematicCode := BitVec.ofNat 64 16203875200548564327 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9640677237361792 + maskLow := BitVec.ofNat 64 308496578769912087 + maskHigh := BitVec.ofNat 64 1161084815843329 + systematicCode := BitVec.ofNat 64 16562755769984183655 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9587827360678912 + maskLow := BitVec.ofNat 64 308496578769912087 + maskHigh := BitVec.ofNat 64 2305843026393858053 + systematicCode := BitVec.ofNat 64 18141806199706053991 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9640672638305280 + maskLow := BitVec.ofNat 64 308496578769912087 + maskHigh := BitVec.ofNat 64 9223372041149816837 + systematicCode := BitVec.ofNat 64 18357131245469920615 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9575290655526016 + maskLow := BitVec.ofNat 64 308496578769912087 + maskHigh := BitVec.ofNat 64 11530481685611151361 + systematicCode := BitVec.ofNat 64 18373531853940682087 }) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x6d6b. -/ +def normalizedWeightSixteenCandidateBucket_6d6b : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9574701878215680 + maskLow := BitVec.ofNat 64 1179943106666103063 + maskHigh := BitVec.ofNat 64 290346231660545 + systematicCode := BitVec.ofNat 64 16201357443978587499 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9587792938533888 + maskLow := BitVec.ofNat 64 1179943106666103063 + maskHigh := BitVec.ofNat 64 422212600397825 + systematicCode := BitVec.ofNat 64 16203870819682184555 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9640677139565696 + maskLow := BitVec.ofNat 64 1179943106666103063 + maskHigh := BitVec.ofNat 64 4512395854645249 + systematicCode := BitVec.ofNat 64 16849855848115694955 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9587827296175104 + maskLow := BitVec.ofNat 64 1179943106666103063 + maskHigh := BitVec.ofNat 64 576460821023981585 + systematicCode := BitVec.ofNat 64 17854706121575066987 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9640672575882240 + maskLow := BitVec.ofNat 64 1179943106666103063 + maskHigh := BitVec.ofNat 64 9223372041149810705 + systematicCode := BitVec.ofNat 64 18357131228357422443 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9575290593102976 + maskLow := BitVec.ofNat 64 1179943106666103063 + maskHigh := BitVec.ofNat 64 9804477128421408769 + systematicCode := BitVec.ofNat 64 18372410352080612715 }) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x6e61. -/ +def normalizedWeightSixteenCandidateBucket_6e61 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2256782647362560 + maskLow := BitVec.ofNat 64 108367870328635671 + maskHigh := BitVec.ofNat 64 305666380005377 + systematicCode := BitVec.ofNat 64 16202216239868702305 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 2326601635726336 + maskLow := BitVec.ofNat 64 108367870328635671 + maskHigh := BitVec.ofNat 64 422212834164737 + systematicCode := BitVec.ofNat 64 16203874174353043041 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 10138223226129408 + maskLow := BitVec.ofNat 64 7530300056235213079 + maskHigh := BitVec.ofNat 64 422214612549633 + systematicCode := BitVec.ofNat 64 16203880525653765729 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9082142844257280 + maskLow := BitVec.ofNat 64 108367870328635671 + maskHigh := BitVec.ofNat 64 2269392268165217 + systematicCode := BitVec.ofNat 64 16634530711938821729 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9082142744380416 + maskLow := BitVec.ofNat 64 108367870328635671 + maskHigh := BitVec.ofNat 64 9011597368361033 + systematicCode := BitVec.ofNat 64 16921630790070070881 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9082142743209984 + maskLow := BitVec.ofNat 64 108367870328635671 + maskHigh := BitVec.ofNat 64 18016597566292009 + systematicCode := BitVec.ofNat 64 17065180820579315297 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9012323856157696 + maskLow := BitVec.ofNat 64 108367870328635671 + maskHigh := BitVec.ofNat 64 29414137213747201 + systematicCode := BitVec.ofNat 64 17071711186165198433 }) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x6e67. -/ +def normalizedWeightSixteenCandidateBucket_6e67 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 45040983843032192 + maskLow := BitVec.ofNat 64 614741353431105815 + maskHigh := BitVec.ofNat 64 299095080042497 + systematicCode := BitVec.ofNat 64 16202197475156979303 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 45110802831395968 + maskLow := BitVec.ofNat 64 614741353431105815 + maskHigh := BitVec.ofNat 64 422212733894657 + systematicCode := BitVec.ofNat 64 16203874101053779559 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9084750262979712 + maskLow := BitVec.ofNat 64 614741353431105815 + maskHigh := BitVec.ofNat 64 2269392268189697 + systematicCode := BitVec.ofNat 64 16634530785238871655 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 45112452098051200 + maskLow := BitVec.ofNat 64 614741353431105815 + maskHigh := BitVec.ofNat 64 2305843026393841673 + systematicCode := BitVec.ofNat 64 18141806195427929703 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 45112452098441344 + maskLow := BitVec.ofNat 64 614741353431105815 + maskHigh := BitVec.ofNat 64 4611686027017461769 + systematicCode := BitVec.ofNat 64 18285356225937174119 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9013831762723968 + maskLow := BitVec.ofNat 64 614741353431105815 + maskHigh := BitVec.ofNat 64 6919921567090606081 + systematicCode := BitVec.ofNat 64 18301475359414447719 }) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x6e6b. -/ +def normalizedWeightSixteenCandidateBucket_6e6b : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 45040983907536000 + maskLow := BitVec.ofNat 64 2350879009782432023 + maskHigh := BitVec.ofNat 64 285952480116737 + systematicCode := BitVec.ofNat 64 16201075973296909931 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 45110802895899776 + maskLow := BitVec.ofNat 64 2350879009782432023 + maskHigh := BitVec.ofNat 64 422212533354497 + systematicCode := BitVec.ofNat 64 16203869720187399787 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9084750360775808 + maskLow := BitVec.ofNat 64 2350879009782432023 + maskHigh := BitVec.ofNat 64 9011597368379393 + systematicCode := BitVec.ofNat 64 16921630863370382955 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 45112452062678144 + maskLow := BitVec.ofNat 64 2350879009782432023 + maskHigh := BitVec.ofNat 64 576460821023965217 + systematicCode := BitVec.ofNat 64 17854706117296942699 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 45112452113006720 + maskLow := BitVec.ofNat 64 2350879009782432023 + maskHigh := BitVec.ofNat 64 4611686027017455649 + systematicCode := BitVec.ofNat 64 18285356208824675947 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9013831827227776 + maskLow := BitVec.ofNat 64 2350879009782432023 + maskHigh := BitVec.ofNat 64 5197294709621391361 + systematicCode := BitVec.ofNat 64 18300353857554378347 }) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x6e6d. -/ +def normalizedWeightSixteenCandidateBucket_6e6d : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 45040983907649792 + maskLow := BitVec.ofNat 64 4665729218250866967 + maskHigh := BitVec.ofNat 64 283762046795777 + systematicCode := BitVec.ofNat 64 16200513031933554285 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 45110802896013568 + maskLow := BitVec.ofNat 64 4665729218250866967 + maskHigh := BitVec.ofNat 64 422212499931137 + systematicCode := BitVec.ofNat 64 16203867521197829741 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9084750361149696 + maskLow := BitVec.ofNat 64 4665729218250866967 + maskHigh := BitVec.ofNat 64 18016597566302209 + systematicCode := BitVec.ofNat 64 17065180893879758445 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 45112452062791936 + maskLow := BitVec.ofNat 64 4665729218250866967 + maskHigh := BitVec.ofNat 64 576460821023957057 + systematicCode := BitVec.ofNat 64 17854706108740693613 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 45112452112730368 + maskLow := BitVec.ofNat 64 4665729218250866967 + maskHigh := BitVec.ofNat 64 2305843026393827393 + systematicCode := BitVec.ofNat 64 18141806169759182445 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9013831827341568 + maskLow := BitVec.ofNat 64 4665729218250866967 + maskHigh := BitVec.ofNat 64 2900458899662438401 + systematicCode := BitVec.ofNat 64 18156240868501909101 }) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x7573. -/ +def normalizedWeightSixteenCandidateBucket_7573 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9574685365240832 + maskLow := BitVec.ofNat 64 1585267073129447703 + maskHigh := BitVec.ofNat 64 283130686603265 + systematicCode := BitVec.ofNat 64 16199675191188092275 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9587776425559040 + maskLow := BitVec.ofNat 64 1585267073129447703 + maskHigh := BitVec.ofNat 64 422212490297345 + systematicCode := BitVec.ofNat 64 16203864248382223731 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9587810516861952 + maskLow := BitVec.ofNat 64 1585267073129447703 + maskHigh := BitVec.ofNat 64 36029896547401985 + systematicCode := BitVec.ofNat 64 17280505965312570739 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9640656098839680 + maskLow := BitVec.ofNat 64 1585267073129447703 + maskHigh := BitVec.ofNat 64 72058143802163329 + systematicCode := BitVec.ofNat 64 17424056004378195315 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9640656062907392 + maskLow := BitVec.ofNat 64 1585267073129447703 + maskHigh := BitVec.ofNat 64 9223372041149809025 + systematicCode := BitVec.ofNat 64 18357131202688284019 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9575274080128128 + maskLow := BitVec.ofNat 64 1585267073129447703 + maskHigh := BitVec.ofNat 64 9331599167547506689 + systematicCode := BitVec.ofNat 64 18370728099290117491 }) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x7673. -/ +def normalizedWeightSixteenCandidateBucket_7673 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 45040991631346816 + maskLow := BitVec.ofNat 64 3026418953888006423 + maskHigh := BitVec.ofNat 64 282860103663617 + systematicCode := BitVec.ofNat 64 16199674095971497587 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 45110810619710592 + maskLow := BitVec.ofNat 64 3026418953888006423 + maskHigh := BitVec.ofNat 64 422212486168577 + systematicCode := BitVec.ofNat 64 16203864244104099443 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 45112447002250368 + maskLow := BitVec.ofNat 64 3026418953888006423 + maskHigh := BitVec.ofNat 64 36029896547385857 + systematicCode := BitVec.ofNat 64 17280505961034446451 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9084762345999488 + maskLow := BitVec.ofNat 64 3026418953888006423 + maskHigh := BitVec.ofNat 64 144115462957973633 + systematicCode := BitVec.ofNat 64 17495831019632883315 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 45112453444698240 + maskLow := BitVec.ofNat 64 3026418953888006423 + maskHigh := BitVec.ofNat 64 4611686027017454209 + systematicCode := BitVec.ofNat 64 18285356187433727603 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9013839551038592 + maskLow := BitVec.ofNat 64 3026418953888006423 + maskHigh := BitVec.ofNat 64 4791970743158046721 + systematicCode := BitVec.ofNat 64 18298951980228966003 }) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x7675. -/ +def normalizedWeightSixteenCandidateBucket_7675 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 45040991631460608 + maskLow := BitVec.ofNat 64 5476377151177556247 + maskHigh := BitVec.ofNat 64 282731254644737 + systematicCode := BitVec.ofNat 64 16199671905538307701 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 45110810619824384 + maskLow := BitVec.ofNat 64 5476377151177556247 + maskHigh := BitVec.ofNat 64 422212484202497 + systematicCode := BitVec.ofNat 64 16203864235547850357 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 45112447002364160 + maskLow := BitVec.ofNat 64 5476377151177556247 + maskHigh := BitVec.ofNat 64 36029896547378177 + systematicCode := BitVec.ofNat 64 17280505952478197365 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9084762346373376 + maskLow := BitVec.ofNat 64 5476377151177556247 + maskHigh := BitVec.ofNat 64 288230513592770689 + systematicCode := BitVec.ofNat 64 17639381050142258805 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 45112453444421888 + maskLow := BitVec.ofNat 64 5476377151177556247 + maskHigh := BitVec.ofNat 64 2305843026393826433 + systematicCode := BitVec.ofNat 64 18141806156924614261 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9013839551152384 + maskLow := BitVec.ofNat 64 5476377151177556247 + maskHigh := BitVec.ofNat 64 2630242922020208641 + systematicCode := BitVec.ofNat 64 18155399742106662517 }) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x7a79. -/ +def normalizedWeightSixteenCandidateBucket_7a79 : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 45040991641864448 + maskLow := BitVec.ofNat 64 8070450536542961943 + maskHigh := BitVec.ofNat 64 282679715037185 + systematicCode := BitVec.ofNat 64 16199668619888327289 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 45110810630228224 + maskLow := BitVec.ofNat 64 8070450536542961943 + maskHigh := BitVec.ofNat 64 422212483416065 + systematicCode := BitVec.ofNat 64 16203864222713281145 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 45112447012768000 + maskLow := BitVec.ofNat 64 8070450536542961943 + maskHigh := BitVec.ofNat 64 36029896547375105 + systematicCode := BitVec.ofNat 64 17280505939643628153 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 45112453404887296 + maskLow := BitVec.ofNat 64 8070450536542961943 + maskHigh := BitVec.ofNat 64 576460821023953025 + systematicCode := BitVec.ofNat 64 17854706095906126457 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9084762390069504 + maskLow := BitVec.ofNat 64 8070450536542961943 + maskHigh := BitVec.ofNat 64 1152921538967111809 + systematicCode := BitVec.ofNat 64 17926481111160748665 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 9013839561556224 + maskLow := BitVec.ofNat 64 8070450536542961943 + maskHigh := BitVec.ofNat 64 1765551793565073409 + systematicCode := BitVec.ofNat 64 17940071384923011705 }) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x837f. -/ +def normalizedWeightSixteenCandidateBucket_837f : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.node + (.node + (.leaf + { patternClass := .d16Plus + affineCode := BitVec.ofNat 56 36453777734140032 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 4611686027017454123 + systematicCode := BitVec.ofNat 64 18285356187350631295 }) + (.leaf + { patternClass := .d16Plus + affineCode := BitVec.ofNat 56 36453777734148224 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 9223372041149808919 + systematicCode := BitVec.ofNat 64 18357131202588410751 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 582749769468032 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 1130581958066187 + systematicCode := BitVec.ofNat 64 16561369440961594239 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 844570975832192 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 1161084350365707 + systematicCode := BitVec.ofNat 64 16562750336969114495 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 845528745246976 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 1161084815835411 + systematicCode := BitVec.ofNat 64 16562755769817727871 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 635526327632128 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 2261150225924103 + systematicCode := BitVec.ofNat 64 16633709605176050559 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 844983292723456 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 2269392142401543 + systematicCode := BitVec.ofNat 64 16634527559820084095 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 845525519829120 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 2269392268182051 + systematicCode := BitVec.ofNat 64 16634530785089192831 }) + ) + ) + ) + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 845528753570048 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 4512395854643463 + systematicCode := BitVec.ofNat 64 16849855848015823743 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 844570963347584 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 4512395993153571 + systematicCode := BitVec.ofNat 64 16849859211260756863 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 582749756983424 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 4521475415474211 + systematicCode := BitVec.ofNat 64 16850725716953301887 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 845525532313728 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 9011597368377867 + systematicCode := BitVec.ofNat 64 16921630863287288703 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 844983284400384 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 9011597846577171 + systematicCode := BitVec.ofNat 64 16921636434111726463 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 635526319309056 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 9042937744719891 + systematicCode := BitVec.ofNat 64 16923065881167758207 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 845526622863616 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 72058143802163223 + systematicCode := BitVec.ofNat 64 17424056004278322047 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 844562973198464 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 72058144129417731 + systematicCode := BitVec.ofNat 64 17424068198110757759 }) + ) + ) + ) + ) + (.node + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 582741766834304 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 72079592868807171 + systematicCode := BitVec.ofNat 64 17427195265216054143 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 580628106053760 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 77687102162239491 + systematicCode := BitVec.ofNat 64 17431716456828928895 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 845526597666944 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 144115462957973547 + systematicCode := BitVec.ofNat 64 17495831019549787007 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 844975826927872 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 144115463624917251 + systematicCode := BitVec.ofNat 64 17495845420961727359 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 635518861836544 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 144159172840128771 + systematicCode := BitVec.ofNat 64 17499535429430510463 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 633473383661824 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 155374191439331331 + systematicCode := BitVec.ofNat 64 17504056621043385215 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 642686122330752 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 4611686027696832515 + systematicCode := BitVec.ofNat 64 18285382730854073215 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 633958748785280 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 4611730548648476675 + systematicCode := BitVec.ofNat 64 18292169019498595199 }) + ) + ) + ) + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 636072409565824 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 4622945567260017155 + systematicCode := BitVec.ofNat 64 18296690211512550271 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 636080399714944 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 4758061802544168995 + systematicCode := BitVec.ofNat 64 18298942045819667327 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 636080412199552 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 4764843590666944523 + systematicCode := BitVec.ofNat 64 18298946461112894335 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 651482215352576 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 9223372041489498115 + systematicCode := BitVec.ofNat 64 18357157746091852671 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 634027468261632 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 9223394301965320195 + systematicCode := BitVec.ofNat 64 18363944034736374655 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 636072946436352 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 9229001811271090435 + systematicCode := BitVec.ofNat 64 18368465226750329727 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 636080403908864 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 9296559928913166355 + systematicCode := BitVec.ofNat 64 18370717061057446783 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 636080412231936 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 9299950822974554119 + systematicCode := BitVec.ofNat 64 18370721476350673791 }) + ) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x857f. -/ +def normalizedWeightSixteenCandidateBucket_857f : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.node + (.leaf + { patternClass := .d16Plus + affineCode := BitVec.ofNat 56 36453777733083392 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 2305843026393826381 + systematicCode := BitVec.ofNat 64 18141806156874941823 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 582749769711872 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 565304669241357 + systematicCode := BitVec.ofNat 64 16416689112532551039 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 844570976076032 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 633318733512717 + systematicCode := BitVec.ofNat 64 16419195891267044735 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 845528745149440 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 633319771373845 + systematicCode := BitVec.ofNat 64 16419205730718549375 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 845525519975424 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 2269392268174405 + systematicCode := BitVec.ofNat 64 16634530776532944255 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 844570963493888 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 4512395991187525 + systematicCode := BitVec.ofNat 64 16849859202704508287 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 582749757129728 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 4521346566455365 + systematicCode := BitVec.ofNat 64 16850723526520112511 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 845525532557568 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 18016597566301197 + systematicCode := BitVec.ofNat 64 17065180893830088063 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 844983284302848 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 18016598614933525 + systematicCode := BitVec.ofNat 64 17065190871257417087 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 635526319211520 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 18085321337995285 + systematicCode := BitVec.ofNat 64 17067744019163481471 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 844562973344768 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 72058144095994885 + systematicCode := BitVec.ofNat 64 17424068189554509183 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 582741766980608 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 72077402435486725 + systematicCode := BitVec.ofNat 64 17427193074782864767 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 580628106200064 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 77124160798883845 + systematicCode := BitVec.ofNat 64 17431714266429162879 }) + ) + ) + ) + ) + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 845526597910784 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 288230513592770637 + systematicCode := BitVec.ofNat 64 17639381050092586367 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 844975826830336 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 288230514798690565 + systematicCode := BitVec.ofNat 64 17639399858107417983 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 635518861739008 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 288309545285976325 + systematicCode := BitVec.ofNat 64 17644213567426233727 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 633473383564288 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 308496578769920005 + systematicCode := BitVec.ofNat 64 17648734759072531839 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 642686122281984 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 2305843027609944069 + systematicCode := BitVec.ofNat 64 18141832691754894719 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 633958748736512 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 2305922723807002629 + systematicCode := BitVec.ofNat 64 18148616781409715583 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 636072409517056 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 2326109757301064709 + systematicCode := BitVec.ofNat 64 18153137973390247295 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 636080399666176 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 2596333981406330949 + systematicCode := BitVec.ofNat 64 18155389807697364351 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 636080412248320 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 2612158153692807181 + systematicCode := BitVec.ofNat 64 18155396430637204863 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 651482215255040 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 9223372041453838341 + systematicCode := BitVec.ofNat 64 18357157737468233087 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 634027468164096 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 9223391965503102981 + systematicCode := BitVec.ofNat 64 18363941827123053951 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 636072946338816 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 9228438723876618501 + systematicCode := BitVec.ofNat 64 18368463019103585663 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 636080403811328 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 9295994779902935061 + systematicCode := BitVec.ofNat 64 18370714853410702719 }) + ) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x867f. -/ +def normalizedWeightSixteenCandidateBucket_867f : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 651534025517056 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 633319771357737 + systematicCode := BitVec.ofNat 64 16419205726440425087 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 651534026411136 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 1161084815811657 + systematicCode := BitVec.ofNat 64 16562755756983355007 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 651499935108224 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 9011597840482377 + systematicCode := BitVec.ofNat 64 16921636421277353599 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 638408874790016 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 9042538312761417 + systematicCode := BitVec.ofNat 64 16923062595517974143 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 651499934214144 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 18016598610804777 + systematicCode := BitVec.ofNat 64 17065190866979292799 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 638408873895936 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 18085050755055657 + systematicCode := BitVec.ofNat 64 17067742923946886783 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 651508191595648 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 144115463524451337 + systematicCode := BitVec.ofNat 64 17495845408127354495 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 638417131277440 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 144152588655264777 + systematicCode := BitVec.ofNat 64 17499532143780726399 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 639405779061888 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 153685354464165897 + systematicCode := BitVec.ofNat 64 17504053335443736191 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 651508190701568 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 288230514731647497 + systematicCode := BitVec.ofNat 64 17639399853829293695 }) + ) + ) + ) + ) + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 638417130383360 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 288305151534432777 + systematicCode := BitVec.ofNat 64 17644212472209639039 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 639405778167808 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 307370683158110217 + systematicCode := BitVec.ofNat 64 17648733663872648831 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 704272906863616 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 2305843027538624521 + systematicCode := BitVec.ofNat 64 18141832687443084927 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 638817605272576 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 2305918050882568201 + systematicCode := BitVec.ofNat 64 18148615677603055231 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 637897140093952 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 2324983582512120841 + systematicCode := BitVec.ofNat 64 18153136869566875263 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 637889416283136 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 2595203683385868361 + systematicCode := BitVec.ofNat 64 18155388703873992319 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 704272905937024 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 4611686027589853193 + systematicCode := BitVec.ofNat 64 18285382717918643839 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 638817604345984 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 4611723539261825033 + systematicCode := BitVec.ofNat 64 18292165708078614143 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 637897139167360 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 4621256305076601353 + systematicCode := BitVec.ofNat 64 18296686900042434175 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 637889415356544 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 4756366355513475113 + systematicCode := BitVec.ofNat 64 18298938734349551231 }) + ) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x897f. -/ +def normalizedWeightSixteenCandidateBucket_897f : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.node + (.leaf + { patternClass := .d16Plus + affineCode := BitVec.ofNat 56 36453777593671936 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 576460821023953009 + systematicCode := BitVec.ofNat 64 17854706095856716159 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 582749788438784 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 565253129633841 + systematicCode := BitVec.ofNat 64 16416685826882832767 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 844570994802944 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 633318732726321 + systematicCode := BitVec.ofNat 64 16419195878432737663 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 582749788341248 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 1130401569439825 + systematicCode := BitVec.ofNat 64 16561363964878686591 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 844570994705408 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 1161084347613265 + systematicCode := BitVec.ofNat 64 16562750315578558847 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 845525551186944 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 9011597368367185 + systematicCode := BitVec.ofNat 64 16921630841896733055 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 845525551284480 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 18016597566298161 + systematicCode := BitVec.ofNat 64 17065180880995780991 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 844562942133248 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 72058143895457809 + systematicCode := BitVec.ofNat 64 17424063791575370111 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 582741735769088 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 72064259835564049 + systematicCode := BitVec.ofNat 64 17426067192056154495 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 580628074988544 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 73746512618749969 + systematicCode := BitVec.ofNat 64 17430588383769299327 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 642686066101248 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 576460822641934353 + systematicCode := BitVec.ofNat 64 17854728232689895807 }) + ) + ) + ) + ) + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 633958692555776 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 576566855176585233 + systematicCode := BitVec.ofNat 64 17860390803371624831 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 636072353336320 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 603482899831853073 + systematicCode := BitVec.ofNat 64 17864911995285309823 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 845526624960768 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 1152921538967111793 + systematicCode := BitVec.ofNat 64 17926481111111338367 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 844975764407296 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 1152921540577263889 + systematicCode := BitVec.ofNat 64 17926504351532157311 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 635518799315968 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 1153027062018605329 + systematicCode := BitVec.ofNat 64 17932448341557348735 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 633473321141248 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 1179943106666104849 + systematicCode := BitVec.ofNat 64 17936969533270493567 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 636080405908480 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 1738424641073971281 + systematicCode := BitVec.ofNat 64 17940065865807202687 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 636080406006016 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 1747467025237671985 + systematicCode := BitVec.ofNat 64 17940068073453816191 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 651482152832000 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 9223372041250932753 + systematicCode := BitVec.ofNat 64 18357153339354351999 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 634027405741056 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 9223378668284348433 + systematicCode := BitVec.ofNat 64 18362815910036081023 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 636072883915776 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 9225060921075302673 + systematicCode := BitVec.ofNat 64 18367337101949766015 }) + ) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x8a7f. -/ +def normalizedWeightSixteenCandidateBucket_8a7f : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 638408939293824 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 2260699254358113 + systematicCode := BitVec.ofNat 64 16633703033876548223 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 651499999612032 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 2269392135520353 + systematicCode := BitVec.ofNat 64 16634527534151404159 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 651534090914944 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 4512395854616673 + systematicCode := BitVec.ofNat 64 16849855822347143807 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 651508320603264 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 144115463122587681 + systematicCode := BitVec.ofNat 64 17495841010148215423 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 638417260285056 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 144126251915808801 + systematicCode := BitVec.ofNat 64 17498406261054016127 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 639405908069504 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 146930006563504161 + systematicCode := BitVec.ofNat 64 17502927452783872639 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 704273035871232 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 576460822369288225 + systematicCode := BitVec.ofNat 64 17854728228378086015 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 638817734280192 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 576548988112617505 + systematicCode := BitVec.ofNat 64 17860389699564964479 }) + ) + ) + ) + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 637897269101568 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 598979025322381345 + systematicCode := BitVec.ofNat 64 17864910891461937791 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 651508205266944 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 1152921540308894241 + systematicCode := BitVec.ofNat 64 17926504347254033023 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 638417144948736 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 1153009474127528481 + systematicCode := BitVec.ofNat 64 17932447246340754047 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 639405792733184 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 1175439511333767201 + systematicCode := BitVec.ofNat 64 17936968438070610559 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 637889484948480 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 1733903448992120929 + systematicCode := BitVec.ofNat 64 17940064761983830655 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 704272916340864 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 4611686027185621025 + systematicCode := BitVec.ofNat 64 18285378319804762751 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 638817614749824 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 4611697047903537185 + systematicCode := BitVec.ofNat 64 18291039790991641215 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 637897149571200 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 4614500802554757665 + systematicCode := BitVec.ofNat 64 18295560982888614527 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x8c7f. -/ +def normalizedWeightSixteenCandidateBucket_8c7f : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 651508320717056 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 288230513793044545 + systematicCode := BitVec.ofNat 64 17639393256860585087 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 638417260398848 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 288243639012823105 + systematicCode := BitVec.ofNat 64 17642523648119573631 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 639405908183296 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 291608144592773185 + systematicCode := BitVec.ofNat 64 17647044839882853503 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 704273035952512 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 576460821830312001 + systematicCode := BitVec.ofNat 64 17854726029321145471 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 638817734361472 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 576513666301567041 + systematicCode := BitVec.ofNat 64 17859826741021478015 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 637897269182848 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 589971688626589761 + systematicCode := BitVec.ofNat 64 17864347932885027967 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 651508206274816 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 1152921539772154945 + systematicCode := BitVec.ofNat 64 17926502148264463487 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 638417145956608 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 1152974298345374785 + systematicCode := BitVec.ofNat 64 17931884304977398911 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 639405793741056 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 1166432320669091905 + systematicCode := BitVec.ofNat 64 17936405496740678783 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 704272917348736 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 2305843026595416129 + systematicCode := BitVec.ofNat 64 18141826090272263295 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 638817615757696 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 2305856237713229889 + systematicCode := BitVec.ofNat 64 18146926801972595839 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 637897150579072 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 2309220743294485569 + systematicCode := BitVec.ofNat 64 18151447993836145791 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x8f7f. -/ +def normalizedWeightSixteenCandidateBucket_8f7f : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 915485737372800 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 72057688535629953 + systematicCode := BitVec.ofNat 64 17422391498915090303 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 653664531008640 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 72058143795216513 + systematicCode := BitVec.ofNat 64 17424049433399431039 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 651550870228096 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 72058143802136193 + systematicCode := BitVec.ofNat 64 17424055978693922687 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 639924365722624 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 144115278274379905 + systematicCode := BitVec.ofNat 64 17494449088641208191 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 845017644041216 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 144115462955155585 + systematicCode := BitVec.ofNat 64 17495825552443805567 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 845529013584896 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 144115462957962625 + systematicCode := BitVec.ofNat 64 17495830998243446655 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 639924365820160 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 288230457758195841 + systematicCode := BitVec.ofNat 64 17638562077660123007 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 845017644138752 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 288230513591918721 + systematicCode := BitVec.ofNat 64 17639377781976174463 }) + ) + ) + ) + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 845529013682432 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 288230513592767361 + systematicCode := BitVec.ofNat 64 17639381037309071231 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 639407250278656 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 504403226986025089 + systematicCode := BitVec.ofNat 64 17650435733742718847 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 703967019483520 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 576460821024006273 + systematicCode := BitVec.ofNat 64 17854706121912848255 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 704273841209728 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 576460821037584513 + systematicCode := BitVec.ofNat 64 17854712783641808767 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 638818539618688 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 576461714377150593 + systematicCode := BitVec.ofNat 64 17856435847161220991 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 639924374143232 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 1152921534672144513 + systematicCode := BitVec.ofNat 64 17925666553837621119 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 845017652461824 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 1152921538967046273 + systematicCode := BitVec.ofNat 64 17926477860174270335 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 845529022005504 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 1152921538967111553 + systematicCode := BitVec.ofNat 64 17926481098327560063 }) + ) + ) + ) + ) + (.node + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 639407125432576 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 1369094303900763265 + systematicCode := BitVec.ofNat 64 17938666092647190399 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 639407124424704 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 1513209483386552961 + systematicCode := BitVec.ofNat 64 17939229033976991615 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 633456808166400 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 1585267073129447809 + systematicCode := BitVec.ofNat 64 17939230129176809343 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 703966894637440 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 2305843026393876609 + systematicCode := BitVec.ofNat 64 18141806200110944127 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 704273716363648 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 2305843026406671489 + systematicCode := BitVec.ofNat 64 18141817259819306879 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 638818414772608 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 2305843868207416449 + systematicCode := BitVec.ofNat 64 18144666206065692543 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 703966893629568 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 4611686027017496705 + systematicCode := BitVec.ofNat 64 18285356239176568703 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 704273715355776 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 4611686027028333185 + systematicCode := BitVec.ofNat 64 18285369489351675775 }) + ) + ) + ) + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 638818413764736 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 4611686739982025345 + systematicCode := BitVec.ofNat 64 18288779195084607359 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 633456810280064 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 7493990329708740737 + systematicCode := BitVec.ofNat 64 18301493977815093119 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 651533822462976 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 9223372041149835393 + systematicCode := BitVec.ofNat 64 18357131254431190911 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 651465639857152 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 9223372041156559233 + systematicCode := BitVec.ofNat 64 18357144508901199743 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 634010892766208 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 9223372483531440513 + systematicCode := BitVec.ofNat 64 18360555314128981887 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 640513080609920 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 12105676073254011009 + systematicCode := BitVec.ofNat 64 18373551567541211007 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 640513080707456 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 14411518945026646145 + systematicCode := BitVec.ofNat 64 18374114508871012223 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 640513089030528 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 16140901098856122497 + systematicCode := BitVec.ofNat 64 18374118889670283135 }) + ) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x917f. -/ +def normalizedWeightSixteenCandidateBucket_917f : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .d16Plus + affineCode := BitVec.ofNat 56 36453758683652352 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 36029896547374849 + systematicCode := BitVec.ofNat 64 17280505939594744191 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 582745793364224 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 564222337483521 + systematicCode := BitVec.ofNat 64 16415844700488110463 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 844566999728384 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 633318716998401 + systematicCode := BitVec.ofNat 64 16419192592783282559 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 582745793266688 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 1127309192987905 + systematicCode := BitVec.ofNat 64 16559962087553798527 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 844566999630848 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 1161084300428545 + systematicCode := BitVec.ofNat 64 16562744839495782783 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 582745730843648 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 4505111590080769 + systematicCode := BitVec.ofNat 64 16848192480818532735 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 844566937207808 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 4512395743465729 + systematicCode := BitVec.ofNat 64 16849849315808022911 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 580615557088256 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 6193549016072449 + systematicCode := BitVec.ofNat 64 16854127665959833983 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 642670352141312 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 36029898275455233 + systematicCode := BitVec.ofNat 64 17280519280334377343 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 633942978595840 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 36143146245062913 + systematicCode := BitVec.ofNat 64 17283930085562159487 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 636073152351232 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 468383157473775873 + systematicCode := BitVec.ofNat 64 17650433595083886975 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 636073214774272 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 1333100674610627841 + systematicCode := BitVec.ofNat 64 17938663988482314623 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 636073214871808 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 1477251047595442945 + systematicCode := BitVec.ofNat 64 17939226947059093887 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x927f. -/ +def normalizedWeightSixteenCandidateBucket_927f : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 638425452268672 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 2253483709302273 + systematicCode := BitVec.ofNat 64 16632020781086577279 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 651516512586880 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 2269392025421313 + systematicCode := BitVec.ofNat 64 16634520962851967615 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 638425516772480 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 9008986028249601 + systematicCode := BitVec.ofNat 64 16920251174351311487 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 651516577090688 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 9011597328519681 + systematicCode := BitVec.ofNat 64 16921625439164207743 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 639421888367744 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 11823048550269441 + systematicCode := BitVec.ofNat 64 16926466734974407295 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 704289016169472 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 36029897939894785 + systematicCode := BitVec.ofNat 64 17280519276022567551 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 638833714578432 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 36121156012491265 + systematicCode := BitVec.ofNat 64 17283928981755499135 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 637906058265600 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 396321165322228225 + systematicCode := BitVec.ofNat 64 17650152115795432063 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 637905997923328 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 1261025488118220289 + systematicCode := BitVec.ofNat 64 17938382509193859711 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x947f. -/ +def normalizedWeightSixteenCandidateBucket_947f : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 638425516886272 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 18016322688390145 + systematicCode := BitVec.ofNat 64 17064366370983548031 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 651516577204480 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 18016597562102785 + systematicCode := BitVec.ofNat 64 17065177677320197247 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 639421888481536 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 21393197758424065 + systematicCode := BitVec.ofNat 64 17070584122073388159 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 704289016250752 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 36029897369461761 + systematicCode := BitVec.ofNat 64 17280517076965627007 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 638833714659712 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 36083772617139201 + systematicCode := BitVec.ofNat 64 17283366023212012671 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 637906058346880 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 252203778189562881 + systematicCode := BitVec.ofNat 64 17506036919096087679 }) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x977f. -/ +def normalizedWeightSixteenCandidateBucket_977f : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 915485471034496 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 4504725043054593 + systematicCode := BitVec.ofNat 64 16848182546559571839 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 653664264670336 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 4512395737597953 + systematicCode := BitVec.ofNat 64 16849849277002717055 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 639916908250112 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 9008320308332545 + systematicCode := BitVec.ofNat 64 16920240136285689727 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 845010186568704 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 9011597318375425 + systematicCode := BitVec.ofNat 64 16921625396047091583 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 639916908347648 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 18015510939576321 + systematicCode := BitVec.ofNat 64 17064353125304604543 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 845010186666240 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 18016597549721601 + systematicCode := BitVec.ofNat 64 17065177625579460479 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 639421898885376 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 31526296920004609 + systematicCode := BitVec.ofNat 64 17071714420026546047 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 703979803722112 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 36029896547428353 + systematicCode := BitVec.ofNat 64 17280505965516134271 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 704289022493056 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 36029896765478913 + systematicCode := BitVec.ofNat 64 17280512661739050879 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 638833720902016 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 36044190198536193 + systematicCode := BitVec.ofNat 64 17282235725258463103 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 633473589593216 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 6953566620887320577 + systematicCode := BitVec.ofNat 64 18301485216216029055 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 640505623137408 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 11565248241201072129 + systematicCode := BitVec.ofNat 64 18373542805942146943 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 640505623234944 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 13871089051357947905 + systematicCode := BitVec.ofNat 64 18374105747271948159 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x9b7f. -/ +def normalizedWeightSixteenCandidateBucket_9b7f : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 915485535538304 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 1127077264793601 + systematicCode := BitVec.ofNat 64 16559956568521481087 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 653664329174144 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 1161084296929281 + systematicCode := BitVec.ofNat 64 16562744817937718143 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 639916845827072 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 2252972608217089 + systematicCode := BitVec.ofNat 64 16632014158247598975 }) + ) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 845010124145664 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 2269392017645569 + systematicCode := BitVec.ofNat 64 16634520936982092671 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 633473654097024 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 5224210752658776065 + systematicCode := BitVec.ofNat 64 18300359333556165503 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 640505560714368 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 9835879178631667713 + systematicCode := BitVec.ofNat 64 18372416923282283391 }) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0x9d7f. -/ +def normalizedWeightSixteenCandidateBucket_9d7f : + NormalizedWeightSixteenCandidateTree := + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 915485535652096 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 564136438185985 + systematicCode := BitVec.ofNat 64 16415841389069114751 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 653664329287936 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 633318715736065 + systematicCode := BitVec.ofNat 64 16419192579848838527 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 633473654210816 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 2918402928354050049 + systematicCode := BitVec.ofNat 64 18156244154103799167 }) + ) + ) + +/-- Generated candidate shard for systematic prefix 0xa17f. -/ +def normalizedWeightSixteenCandidateBucket_a17f : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .d16Plus + affineCode := BitVec.ofNat 56 36451065470722304 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 422212483350529 + systematicCode := BitVec.ofNat 64 16203864222665449855 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 581143502127360 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 283846872596481 + systematicCode := BitVec.ofNat 64 16200516343305511295 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 581143502029824 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 286182798065665 + systematicCode := BitVec.ofNat 64 16201081492248764799 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 581143439606784 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 299479614947329 + systematicCode := BitVec.ofNat 64 16202207409268629887 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 581126926631936 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 305664257753089 + systematicCode := BitVec.ofNat 64 16202216239621120383 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 642840808655872 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 422214218350593 + systematicCode := BitVec.ofNat 64 16203877494417170815 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 634045252504576 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 29414135091494913 + systematicCode := BitVec.ofNat 64 17071711185917616511 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 634061765479424 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 434738101664940033 + systematicCode := BitVec.ofNat 64 17650423738134995327 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 634061827902464 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 1306184629962997761 + systematicCode := BitVec.ofNat 64 17938658512400064895 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 634061828000000 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 1459307017830334465 + systematicCode := BitVec.ofNat 64 17939223661410165119 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0xa27f. -/ +def normalizedWeightSixteenCandidateBucket_a27f : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 640470930443392 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 290855454113793 + systematicCode := BitVec.ofNat 64 16201364066720326271 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 640470994947200 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 317346611855361 + systematicCode := BitVec.ofNat 64 16202489983740191359 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 640478718758016 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 327654486179841 + systematicCode := BitVec.ofNat 64 16202498814109393535 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 705925398709248 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 422213878677505 + systematicCode := BitVec.ofNat 64 16203877490105361023 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 639958727574528 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 23784635553153025 + systematicCode := BitVec.ofNat 64 17071428611429212799 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 639951536440320 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 361554607653126145 + systematicCode := BitVec.ofNat 64 17650141163629879935 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 639951476098048 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 1229623436029329409 + systematicCode := BitVec.ofNat 64 17938375937894949503 }) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0xa47f. -/ +def normalizedWeightSixteenCandidateBucket_a47f : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 640470995060992 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 352668389474305 + systematicCode := BitVec.ofNat 64 16203052942249993343 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 640478718871808 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 365037879558145 + systematicCode := BitVec.ofNat 64 16203061772652618879 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 705925398790528 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 422213306286081 + systematicCode := BitVec.ofNat 64 16203875291048420479 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 639958727655808 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 14214486343024641 + systematicCode := BitVec.ofNat 64 16927311224329970815 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 639951536521600 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 216876469590425601 + systematicCode := BitVec.ofNat 64 17506023776497214591 }) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0xa77f. -/ +def normalizedWeightSixteenCandidateBucket_a77f : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 915383197125760 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 299093075689473 + systematicCode := BitVec.ofNat 64 16202197475009668991 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 637871430075392 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 316680895463425 + systematicCode := BitVec.ofNat 64 16202478945674569599 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 637871430172928 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 351856641966081 + systematicCode := BitVec.ofNat 64 16203039696571049855 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 640478729275648 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 404620297371649 + systematicCode := BitVec.ofNat 64 16203066187878803327 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 705923007988096 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 422212497047553 + systematicCode := BitVec.ofNat 64 16203864248586839935 }) + ) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 705925405032832 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 422212701519873 + systematicCode := BitVec.ofNat 64 16203870875821844351 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 639958733898112 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 4081387180654593 + systematicCode := BitVec.ofNat 64 16637954948271220607 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 635553159070848 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 6919921565086253057 + systematicCode := BitVec.ofNat 64 18301475359267137407 }) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 638460144962688 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 11530481683535495169 + systematicCode := BitVec.ofNat 64 18373531853776594815 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 638460145060224 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 13835761742760116225 + systematicCode := BitVec.ofNat 64 18374092604673075071 }) + ) + ) + ) + ) + +/-- Generated candidate shard for systematic prefix 0xab7f. -/ +def normalizedWeightSixteenCandidateBucket_ab7f : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 915383261629568 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 285950879989761 + systematicCode := BitVec.ofNat 64 16201075973216447359 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 637871367652352 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 290344358903809 + systematicCode := BitVec.ofNat 64 16201357443881347967 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 635553223574656 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 5197294708021264385 + systematicCode := BitVec.ofNat 64 18300353857473915775 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 638460082539648 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 9804477126548652033 + systematicCode := BitVec.ofNat 64 18372410351983373183 }) + ) + ) + +/-- Generated candidate shard for systematic prefix 0xad7f. -/ +def normalizedWeightSixteenCandidateBucket_ad7f : + NormalizedWeightSixteenCandidateTree := + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 915383261743360 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 283760985636865 + systematicCode := BitVec.ofNat 64 16200513031886515583 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 635553223688448 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 2900458898601279489 + systematicCode := BitVec.ofNat 64 18156240868454870399 }) + ) + +/-- Generated candidate shard for systematic prefix 0xb37f. -/ +def normalizedWeightSixteenCandidateBucket_b37f : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 915390985440384 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 282858660823041 + systematicCode := BitVec.ofNat 64 16199674095891559295 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 637854854677504 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 283128908218369 + systematicCode := BitVec.ofNat 64 16199675191091377023 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 635560947385472 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 4791970741715206145 + systematicCode := BitVec.ofNat 64 18298951980149027711 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 638443569564800 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 9331599165769121793 + systematicCode := BitVec.ofNat 64 18370728099193402239 }) + ) + ) + +/-- Generated candidate shard for systematic prefix 0xb57f. -/ +def normalizedWeightSixteenCandidateBucket_b57f : + NormalizedWeightSixteenCandidateTree := + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 915390985554176 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 282730382229505 + systematicCode := BitVec.ofNat 64 16199671905491793279 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 635560947499264 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 2630242921147793409 + systematicCode := BitVec.ofNat 64 18155399742060148095 }) + ) + +/-- Generated candidate shard for systematic prefix 0xb97f. -/ +def normalizedWeightSixteenCandidateBucket_b97f : + NormalizedWeightSixteenCandidateTree := + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 915390995958016 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 282679446601729 + systematicCode := BitVec.ofNat 64 16199668619842075007 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 635560957903104 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 1765551793296637953 + systematicCode := BitVec.ofNat 64 17940071384876759423 }) + ) + +/-- Generated candidate shard for systematic prefix 0xbf7f. -/ +def normalizedWeightSixteenCandidateBucket_bf7f : + NormalizedWeightSixteenCandidateTree := + (.node + (.node + (.node + (.node + (.node + (.leaf + { patternClass := .d16Plus + affineCode := BitVec.ofNat 56 36036515227312384 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 282675420069889 + systematicCode := BitVec.ofNat 64 16199668607058296703 }) + (.leaf + { patternClass := .d16Plus + affineCode := BitVec.ofNat 56 36170086419038336 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 16753531353454084097 + systematicCode := BitVec.ofNat 64 18374119097041403775 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 849924671488384 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 283573068234753 + systematicCode := BitVec.ofNat 64 16199675242934157183 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 849927068533120 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 296973366198273 + systematicCode := BitVec.ofNat 64 16201371815095287679 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 849927062290816 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 336607324405761 + systematicCode := BitVec.ofNat 64 16202502113098776447 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 849927062209536 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 374119568769025 + systematicCode := BitVec.ofNat 64 16203065071675555711 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 655931868974080 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 396380384264193 + systematicCode := BitVec.ofNat 64 16203066175498862463 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 849415698989440 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 3941854412275713 + systematicCode := BitVec.ofNat 64 16637954884251402111 }) + ) + ) + ) + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 849415692747136 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 14075005113466881 + systematicCode := BitVec.ofNat 64 16927311160360091519 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 849415692665856 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 23645283170648065 + systematicCode := BitVec.ofNat 64 17071428547492626303 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 655863686368256 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 29275053287800833 + systematicCode := BitVec.ofNat 64 17071711121997676415 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 849408501612928 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 216738019137290241 + systematicCode := BitVec.ofNat 64 17506023725311770495 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 849408501531648 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 361418347599888385 + systematicCode := BitVec.ofNat 64 17650141121000685439 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 655880199343104 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 434606235296202753 + systematicCode := BitVec.ofNat 64 17650423699783925631 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 849408441189376 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 1229500318375477249 + systematicCode := BitVec.ofNat 64 17938375912311668607 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 655880261766144 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 1306079099931852801 + systematicCode := BitVec.ofNat 64 17938658491094908799 }) + ) + ) + ) + ) + (.node + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 655880261863680 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 1459236663044603905 + systematicCode := BitVec.ofNat 64 17939223648627965823 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 849959297548544 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 1693494199527145473 + systematicCode := BitVec.ofNat 64 17939230336648986495 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 849961161916672 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 1761048193937702913 + systematicCode := BitVec.ofNat 64 17940068134343917439 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 849381609767168 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 1765534201379028993 + systematicCode := BitVec.ofNat 64 17940071372497207167 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 849961151512832 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 2615606223231254529 + systematicCode := BitVec.ofNat 64 18155396474280591231 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 849381599363328 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 2630185747415564289 + systematicCode := BitVec.ofNat 64 18155399729613487999 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 849373875552512 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 2900389355551981569 + systematicCode := BitVec.ofNat 64 18156240855873994623 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 849961151399040 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 4767763895160930305 + systematicCode := BitVec.ofNat 64 18298946513346215807 }) + ) + ) + ) + (.node + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 849381599249536 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 4791876185158057985 + systematicCode := BitVec.ofNat 64 18298951959145856895 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 849373875438720 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 5197189843699892225 + systematicCode := BitVec.ofNat 64 18300353836336529279 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 849373810934912 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 6919790209810825217 + systematicCode := BitVec.ofNat 64 18301475321016729471 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 655966499261568 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 9301762820016177153 + systematicCode := BitVec.ofNat 64 18370721528600838015 }) + ) + ) + (.node + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 655898316655744 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 9331482619314962433 + systematicCode := BitVec.ofNat 64 18370728073895329663 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 655914829630592 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 9804354395435958273 + systematicCode := BitVec.ofNat 64 18372410326551084927 }) + ) + (.node + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 655914892053632 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 11530345655406952449 + systematicCode := BitVec.ofNat 64 18373531811231285119 }) + (.leaf + { patternClass := .f16 + affineCode := BitVec.ofNat 56 655914892151168 + maskLow := BitVec.ofNat 64 9223372041149808919 + maskHigh := BitVec.ofNat 64 13835623378205016065 + systematicCode := BitVec.ofNat 64 18374092553537961855 }) + ) + ) + ) + ) + ) + +/-- Select the generated candidate shard determined by the first two sorted columns. -/ +def normalizedWeightSixteenCandidateBucket (codePrefix : BitVec 16) : + Option NormalizedWeightSixteenCandidateTree := + match codePrefix.toNat with + | 2823 => some normalizedWeightSixteenCandidateBucket_0b07 + | 3335 => some normalizedWeightSixteenCandidateBucket_0d07 + | 3339 => some normalizedWeightSixteenCandidateBucket_0d0b + | 3591 => some normalizedWeightSixteenCandidateBucket_0e07 + | 3595 => some normalizedWeightSixteenCandidateBucket_0e0b + | 3597 => some normalizedWeightSixteenCandidateBucket_0e0d + | 4871 => some normalizedWeightSixteenCandidateBucket_1307 + | 4875 => some normalizedWeightSixteenCandidateBucket_130b + | 5383 => some normalizedWeightSixteenCandidateBucket_1507 + | 5389 => some normalizedWeightSixteenCandidateBucket_150d + | 5395 => some normalizedWeightSixteenCandidateBucket_1513 + | 5639 => some normalizedWeightSixteenCandidateBucket_1607 + | 5646 => some normalizedWeightSixteenCandidateBucket_160e + | 5651 => some normalizedWeightSixteenCandidateBucket_1613 + | 5653 => some normalizedWeightSixteenCandidateBucket_1615 + | 6411 => some normalizedWeightSixteenCandidateBucket_190b + | 6413 => some normalizedWeightSixteenCandidateBucket_190d + | 6419 => some normalizedWeightSixteenCandidateBucket_1913 + | 6421 => some normalizedWeightSixteenCandidateBucket_1915 + | 6667 => some normalizedWeightSixteenCandidateBucket_1a0b + | 6670 => some normalizedWeightSixteenCandidateBucket_1a0e + | 6675 => some normalizedWeightSixteenCandidateBucket_1a13 + | 6678 => some normalizedWeightSixteenCandidateBucket_1a16 + | 6681 => some normalizedWeightSixteenCandidateBucket_1a19 + | 7181 => some normalizedWeightSixteenCandidateBucket_1c0d + | 7182 => some normalizedWeightSixteenCandidateBucket_1c0e + | 7189 => some normalizedWeightSixteenCandidateBucket_1c15 + | 7190 => some normalizedWeightSixteenCandidateBucket_1c16 + | 7193 => some normalizedWeightSixteenCandidateBucket_1c19 + | 7194 => some normalizedWeightSixteenCandidateBucket_1c1a + | 8967 => some normalizedWeightSixteenCandidateBucket_2307 + | 8971 => some normalizedWeightSixteenCandidateBucket_230b + | 8979 => some normalizedWeightSixteenCandidateBucket_2313 + | 8988 => some normalizedWeightSixteenCandidateBucket_231c + | 8991 => some normalizedWeightSixteenCandidateBucket_231f + | 9479 => some normalizedWeightSixteenCandidateBucket_2507 + | 9485 => some normalizedWeightSixteenCandidateBucket_250d + | 9493 => some normalizedWeightSixteenCandidateBucket_2515 + | 9498 => some normalizedWeightSixteenCandidateBucket_251a + | 9503 => some normalizedWeightSixteenCandidateBucket_251f + | 9507 => some normalizedWeightSixteenCandidateBucket_2523 + | 9735 => some normalizedWeightSixteenCandidateBucket_2607 + | 9742 => some normalizedWeightSixteenCandidateBucket_260e + | 9750 => some normalizedWeightSixteenCandidateBucket_2616 + | 9753 => some normalizedWeightSixteenCandidateBucket_2619 + | 9759 => some normalizedWeightSixteenCandidateBucket_261f + | 9763 => some normalizedWeightSixteenCandidateBucket_2623 + | 9765 => some normalizedWeightSixteenCandidateBucket_2625 + | 10507 => some normalizedWeightSixteenCandidateBucket_290b + | 10509 => some normalizedWeightSixteenCandidateBucket_290d + | 10518 => some normalizedWeightSixteenCandidateBucket_2916 + | 10521 => some normalizedWeightSixteenCandidateBucket_2919 + | 10527 => some normalizedWeightSixteenCandidateBucket_291f + | 10531 => some normalizedWeightSixteenCandidateBucket_2923 + | 10533 => some normalizedWeightSixteenCandidateBucket_2925 + | 10763 => some normalizedWeightSixteenCandidateBucket_2a0b + | 10766 => some normalizedWeightSixteenCandidateBucket_2a0e + | 10773 => some normalizedWeightSixteenCandidateBucket_2a15 + | 10778 => some normalizedWeightSixteenCandidateBucket_2a1a + | 10783 => some normalizedWeightSixteenCandidateBucket_2a1f + | 10787 => some normalizedWeightSixteenCandidateBucket_2a23 + | 10790 => some normalizedWeightSixteenCandidateBucket_2a26 + | 10793 => some normalizedWeightSixteenCandidateBucket_2a29 + | 11277 => some normalizedWeightSixteenCandidateBucket_2c0d + | 11278 => some normalizedWeightSixteenCandidateBucket_2c0e + | 11283 => some normalizedWeightSixteenCandidateBucket_2c13 + | 11292 => some normalizedWeightSixteenCandidateBucket_2c1c + | 11295 => some normalizedWeightSixteenCandidateBucket_2c1f + | 11301 => some normalizedWeightSixteenCandidateBucket_2c25 + | 11302 => some normalizedWeightSixteenCandidateBucket_2c26 + | 11305 => some normalizedWeightSixteenCandidateBucket_2c29 + | 11306 => some normalizedWeightSixteenCandidateBucket_2c2a + | 12051 => some normalizedWeightSixteenCandidateBucket_2f13 + | 12053 => some normalizedWeightSixteenCandidateBucket_2f15 + | 12054 => some normalizedWeightSixteenCandidateBucket_2f16 + | 12057 => some normalizedWeightSixteenCandidateBucket_2f19 + | 12058 => some normalizedWeightSixteenCandidateBucket_2f1a + | 12060 => some normalizedWeightSixteenCandidateBucket_2f1c + | 12063 => some normalizedWeightSixteenCandidateBucket_2f1f + | 12558 => some normalizedWeightSixteenCandidateBucket_310e + | 12563 => some normalizedWeightSixteenCandidateBucket_3113 + | 12565 => some normalizedWeightSixteenCandidateBucket_3115 + | 12569 => some normalizedWeightSixteenCandidateBucket_3119 + | 12575 => some normalizedWeightSixteenCandidateBucket_311f + | 12579 => some normalizedWeightSixteenCandidateBucket_3123 + | 12581 => some normalizedWeightSixteenCandidateBucket_3125 + | 12585 => some normalizedWeightSixteenCandidateBucket_3129 + | 12591 => some normalizedWeightSixteenCandidateBucket_312f + | 12813 => some normalizedWeightSixteenCandidateBucket_320d + | 12819 => some normalizedWeightSixteenCandidateBucket_3213 + | 12822 => some normalizedWeightSixteenCandidateBucket_3216 + | 12826 => some normalizedWeightSixteenCandidateBucket_321a + | 12831 => some normalizedWeightSixteenCandidateBucket_321f + | 12835 => some normalizedWeightSixteenCandidateBucket_3223 + | 12838 => some normalizedWeightSixteenCandidateBucket_3226 + | 12842 => some normalizedWeightSixteenCandidateBucket_322a + | 12847 => some normalizedWeightSixteenCandidateBucket_322f + | 12849 => some normalizedWeightSixteenCandidateBucket_3231 + | 13323 => some normalizedWeightSixteenCandidateBucket_340b + | 13333 => some normalizedWeightSixteenCandidateBucket_3415 + | 13334 => some normalizedWeightSixteenCandidateBucket_3416 + | 13340 => some normalizedWeightSixteenCandidateBucket_341c + | 13343 => some normalizedWeightSixteenCandidateBucket_341f + | 13349 => some normalizedWeightSixteenCandidateBucket_3425 + | 13350 => some normalizedWeightSixteenCandidateBucket_3426 + | 13356 => some normalizedWeightSixteenCandidateBucket_342c + | 13359 => some normalizedWeightSixteenCandidateBucket_342f + | 13361 => some normalizedWeightSixteenCandidateBucket_3431 + | 13362 => some normalizedWeightSixteenCandidateBucket_3432 + | 14091 => some normalizedWeightSixteenCandidateBucket_370b + | 14093 => some normalizedWeightSixteenCandidateBucket_370d + | 14094 => some normalizedWeightSixteenCandidateBucket_370e + | 14105 => some normalizedWeightSixteenCandidateBucket_3719 + | 14106 => some normalizedWeightSixteenCandidateBucket_371a + | 14108 => some normalizedWeightSixteenCandidateBucket_371c + | 14111 => some normalizedWeightSixteenCandidateBucket_371f + | 14121 => some normalizedWeightSixteenCandidateBucket_3729 + | 14122 => some normalizedWeightSixteenCandidateBucket_372a + | 14124 => some normalizedWeightSixteenCandidateBucket_372c + | 14127 => some normalizedWeightSixteenCandidateBucket_372f + | 14343 => some normalizedWeightSixteenCandidateBucket_3807 + | 14361 => some normalizedWeightSixteenCandidateBucket_3819 + | 14362 => some normalizedWeightSixteenCandidateBucket_381a + | 14364 => some normalizedWeightSixteenCandidateBucket_381c + | 14367 => some normalizedWeightSixteenCandidateBucket_381f + | 14377 => some normalizedWeightSixteenCandidateBucket_3829 + | 14378 => some normalizedWeightSixteenCandidateBucket_382a + | 14380 => some normalizedWeightSixteenCandidateBucket_382c + | 14383 => some normalizedWeightSixteenCandidateBucket_382f + | 14385 => some normalizedWeightSixteenCandidateBucket_3831 + | 14386 => some normalizedWeightSixteenCandidateBucket_3832 + | 14388 => some normalizedWeightSixteenCandidateBucket_3834 + | 14391 => some normalizedWeightSixteenCandidateBucket_3837 + | 15111 => some normalizedWeightSixteenCandidateBucket_3b07 + | 15117 => some normalizedWeightSixteenCandidateBucket_3b0d + | 15118 => some normalizedWeightSixteenCandidateBucket_3b0e + | 15125 => some normalizedWeightSixteenCandidateBucket_3b15 + | 15126 => some normalizedWeightSixteenCandidateBucket_3b16 + | 15132 => some normalizedWeightSixteenCandidateBucket_3b1c + | 15135 => some normalizedWeightSixteenCandidateBucket_3b1f + | 15141 => some normalizedWeightSixteenCandidateBucket_3b25 + | 15142 => some normalizedWeightSixteenCandidateBucket_3b26 + | 15148 => some normalizedWeightSixteenCandidateBucket_3b2c + | 15151 => some normalizedWeightSixteenCandidateBucket_3b2f + | 15156 => some normalizedWeightSixteenCandidateBucket_3b34 + | 15159 => some normalizedWeightSixteenCandidateBucket_3b37 + | 15623 => some normalizedWeightSixteenCandidateBucket_3d07 + | 15627 => some normalizedWeightSixteenCandidateBucket_3d0b + | 15630 => some normalizedWeightSixteenCandidateBucket_3d0e + | 15635 => some normalizedWeightSixteenCandidateBucket_3d13 + | 15638 => some normalizedWeightSixteenCandidateBucket_3d16 + | 15642 => some normalizedWeightSixteenCandidateBucket_3d1a + | 15647 => some normalizedWeightSixteenCandidateBucket_3d1f + | 15651 => some normalizedWeightSixteenCandidateBucket_3d23 + | 15654 => some normalizedWeightSixteenCandidateBucket_3d26 + | 15658 => some normalizedWeightSixteenCandidateBucket_3d2a + | 15663 => some normalizedWeightSixteenCandidateBucket_3d2f + | 15666 => some normalizedWeightSixteenCandidateBucket_3d32 + | 15671 => some normalizedWeightSixteenCandidateBucket_3d37 + | 15675 => some normalizedWeightSixteenCandidateBucket_3d3b + | 15879 => some normalizedWeightSixteenCandidateBucket_3e07 + | 15883 => some normalizedWeightSixteenCandidateBucket_3e0b + | 15885 => some normalizedWeightSixteenCandidateBucket_3e0d + | 15891 => some normalizedWeightSixteenCandidateBucket_3e13 + | 15893 => some normalizedWeightSixteenCandidateBucket_3e15 + | 15897 => some normalizedWeightSixteenCandidateBucket_3e19 + | 15903 => some normalizedWeightSixteenCandidateBucket_3e1f + | 15907 => some normalizedWeightSixteenCandidateBucket_3e23 + | 15909 => some normalizedWeightSixteenCandidateBucket_3e25 + | 15913 => some normalizedWeightSixteenCandidateBucket_3e29 + | 15919 => some normalizedWeightSixteenCandidateBucket_3e2f + | 15921 => some normalizedWeightSixteenCandidateBucket_3e31 + | 15927 => some normalizedWeightSixteenCandidateBucket_3e37 + | 15931 => some normalizedWeightSixteenCandidateBucket_3e3b + | 15933 => some normalizedWeightSixteenCandidateBucket_3e3d + | 17731 => some normalizedWeightSixteenCandidateBucket_4543 + | 17987 => some normalizedWeightSixteenCandidateBucket_4643 + | 17989 => some normalizedWeightSixteenCandidateBucket_4645 + | 18755 => some normalizedWeightSixteenCandidateBucket_4943 + | 18757 => some normalizedWeightSixteenCandidateBucket_4945 + | 19011 => some normalizedWeightSixteenCandidateBucket_4a43 + | 19014 => some normalizedWeightSixteenCandidateBucket_4a46 + | 19017 => some normalizedWeightSixteenCandidateBucket_4a49 + | 19525 => some normalizedWeightSixteenCandidateBucket_4c45 + | 19526 => some normalizedWeightSixteenCandidateBucket_4c46 + | 19529 => some normalizedWeightSixteenCandidateBucket_4c49 + | 19530 => some normalizedWeightSixteenCandidateBucket_4c4a + | 20803 => some normalizedWeightSixteenCandidateBucket_5143 + | 20805 => some normalizedWeightSixteenCandidateBucket_5145 + | 20809 => some normalizedWeightSixteenCandidateBucket_5149 + | 20815 => some normalizedWeightSixteenCandidateBucket_514f + | 21059 => some normalizedWeightSixteenCandidateBucket_5243 + | 21062 => some normalizedWeightSixteenCandidateBucket_5246 + | 21066 => some normalizedWeightSixteenCandidateBucket_524a + | 21071 => some normalizedWeightSixteenCandidateBucket_524f + | 21073 => some normalizedWeightSixteenCandidateBucket_5251 + | 21573 => some normalizedWeightSixteenCandidateBucket_5445 + | 21574 => some normalizedWeightSixteenCandidateBucket_5446 + | 21580 => some normalizedWeightSixteenCandidateBucket_544c + | 21583 => some normalizedWeightSixteenCandidateBucket_544f + | 21585 => some normalizedWeightSixteenCandidateBucket_5451 + | 21586 => some normalizedWeightSixteenCandidateBucket_5452 + | 22345 => some normalizedWeightSixteenCandidateBucket_5749 + | 22346 => some normalizedWeightSixteenCandidateBucket_574a + | 22348 => some normalizedWeightSixteenCandidateBucket_574c + | 22351 => some normalizedWeightSixteenCandidateBucket_574f + | 22601 => some normalizedWeightSixteenCandidateBucket_5849 + | 22602 => some normalizedWeightSixteenCandidateBucket_584a + | 22604 => some normalizedWeightSixteenCandidateBucket_584c + | 22607 => some normalizedWeightSixteenCandidateBucket_584f + | 22609 => some normalizedWeightSixteenCandidateBucket_5851 + | 22610 => some normalizedWeightSixteenCandidateBucket_5852 + | 22612 => some normalizedWeightSixteenCandidateBucket_5854 + | 22615 => some normalizedWeightSixteenCandidateBucket_5857 + | 23365 => some normalizedWeightSixteenCandidateBucket_5b45 + | 23366 => some normalizedWeightSixteenCandidateBucket_5b46 + | 23372 => some normalizedWeightSixteenCandidateBucket_5b4c + | 23375 => some normalizedWeightSixteenCandidateBucket_5b4f + | 23380 => some normalizedWeightSixteenCandidateBucket_5b54 + | 23383 => some normalizedWeightSixteenCandidateBucket_5b57 + | 23875 => some normalizedWeightSixteenCandidateBucket_5d43 + | 23878 => some normalizedWeightSixteenCandidateBucket_5d46 + | 23882 => some normalizedWeightSixteenCandidateBucket_5d4a + | 23887 => some normalizedWeightSixteenCandidateBucket_5d4f + | 23890 => some normalizedWeightSixteenCandidateBucket_5d52 + | 23895 => some normalizedWeightSixteenCandidateBucket_5d57 + | 23899 => some normalizedWeightSixteenCandidateBucket_5d5b + | 24131 => some normalizedWeightSixteenCandidateBucket_5e43 + | 24133 => some normalizedWeightSixteenCandidateBucket_5e45 + | 24137 => some normalizedWeightSixteenCandidateBucket_5e49 + | 24143 => some normalizedWeightSixteenCandidateBucket_5e4f + | 24145 => some normalizedWeightSixteenCandidateBucket_5e51 + | 24151 => some normalizedWeightSixteenCandidateBucket_5e57 + | 24155 => some normalizedWeightSixteenCandidateBucket_5e5b + | 24157 => some normalizedWeightSixteenCandidateBucket_5e5d + | 25185 => some normalizedWeightSixteenCandidateBucket_6261 + | 25697 => some normalizedWeightSixteenCandidateBucket_6461 + | 25698 => some normalizedWeightSixteenCandidateBucket_6462 + | 26721 => some normalizedWeightSixteenCandidateBucket_6861 + | 26722 => some normalizedWeightSixteenCandidateBucket_6862 + | 26724 => some normalizedWeightSixteenCandidateBucket_6864 + | 26727 => some normalizedWeightSixteenCandidateBucket_6867 + | 27492 => some normalizedWeightSixteenCandidateBucket_6b64 + | 27495 => some normalizedWeightSixteenCandidateBucket_6b67 + | 28002 => some normalizedWeightSixteenCandidateBucket_6d62 + | 28007 => some normalizedWeightSixteenCandidateBucket_6d67 + | 28011 => some normalizedWeightSixteenCandidateBucket_6d6b + | 28257 => some normalizedWeightSixteenCandidateBucket_6e61 + | 28263 => some normalizedWeightSixteenCandidateBucket_6e67 + | 28267 => some normalizedWeightSixteenCandidateBucket_6e6b + | 28269 => some normalizedWeightSixteenCandidateBucket_6e6d + | 30067 => some normalizedWeightSixteenCandidateBucket_7573 + | 30323 => some normalizedWeightSixteenCandidateBucket_7673 + | 30325 => some normalizedWeightSixteenCandidateBucket_7675 + | 31353 => some normalizedWeightSixteenCandidateBucket_7a79 + | 33663 => some normalizedWeightSixteenCandidateBucket_837f + | 34175 => some normalizedWeightSixteenCandidateBucket_857f + | 34431 => some normalizedWeightSixteenCandidateBucket_867f + | 35199 => some normalizedWeightSixteenCandidateBucket_897f + | 35455 => some normalizedWeightSixteenCandidateBucket_8a7f + | 35967 => some normalizedWeightSixteenCandidateBucket_8c7f + | 36735 => some normalizedWeightSixteenCandidateBucket_8f7f + | 37247 => some normalizedWeightSixteenCandidateBucket_917f + | 37503 => some normalizedWeightSixteenCandidateBucket_927f + | 38015 => some normalizedWeightSixteenCandidateBucket_947f + | 38783 => some normalizedWeightSixteenCandidateBucket_977f + | 39807 => some normalizedWeightSixteenCandidateBucket_9b7f + | 40319 => some normalizedWeightSixteenCandidateBucket_9d7f + | 41343 => some normalizedWeightSixteenCandidateBucket_a17f + | 41599 => some normalizedWeightSixteenCandidateBucket_a27f + | 42111 => some normalizedWeightSixteenCandidateBucket_a47f + | 42879 => some normalizedWeightSixteenCandidateBucket_a77f + | 43903 => some normalizedWeightSixteenCandidateBucket_ab7f + | 44415 => some normalizedWeightSixteenCandidateBucket_ad7f + | 45951 => some normalizedWeightSixteenCandidateBucket_b37f + | 46463 => some normalizedWeightSixteenCandidateBucket_b57f + | 47487 => some normalizedWeightSixteenCandidateBucket_b97f + | 49023 => some normalizedWeightSixteenCandidateBucket_bf7f + | _ => none + +end CryptBoolean diff --git a/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenNormalizedClassification.lean b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenNormalizedClassification.lean new file mode 100644 index 0000000..51318b9 --- /dev/null +++ b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenNormalizedClassification.lean @@ -0,0 +1,391 @@ +/- +Copyright (c) 2026 Asher Yan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Asher Yan with Codex +-/ +module + +public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightSixteenNormalizedClassifier +public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightSixteenNormalizedCandidateDecode +public meta import Std.Tactic.BVDecide.Reflect + +/-! +# Complete normalized rank-seven pattern classifier + +A systematic code is indexed by its first two ordered nonunit odd columns. +For each admissible prefix, the corresponding finite candidate tree contains +every code satisfying the systematic orthonormality constraints. The union of +these prefix cases yields the normalized rank-seven classification. +-/ + +@[expose] public section + +namespace CryptBoolean + +open Lean Parser.Term + +syntax normalizedWeightSixteenClassificationRow := + "|" term "," ident "," ident + +local syntax (name := normalizedWeightSixteenClassificationCommand) + "normalized_weight_sixteen_classification" ident "where" + normalizedWeightSixteenClassificationRow* : command + +local macro_rules + | `(command| normalized_weight_sixteen_classification + $dispatcherName:ident where + $[$rows:normalizedWeightSixteenClassificationRow]*) => do + let generated ← rows.mapM fun row => do + let `(normalizedWeightSixteenClassificationRow| + | $bucketPrefix:term, $tree:ident, $proofName:ident) := row + | Lean.Macro.throwUnsupported + let declaration ← + `(command| + set_option Elab.async true in + /-- Every systematic code with the selected prefix and satisfying + the orthonormality constraints belongs to its candidate tree. -/ + theorem $proofName + (code : BitVec 64) + (hprefix : + code.extractLsb' 0 16 = BitVec.ofNat 16 $bucketPrefix) + (hconstraints : + SystematicWeightSixteenConstraints code = true) : + ($tree).containsSystematicCode code = true := by + unfold SystematicWeightSixteenConstraints + systematicWeightSixteenColumn at hconstraints + unfold isSystematicWeightSixteenNonunitOddColumn at hconstraints + unfold areSystematicWeightSixteenColumnsOrthogonal at hconstraints + unfold $tree + simp only [ + NormalizedWeightSixteenCandidateTree.containsSystematicCode] + weightSixteenFiniteCertificate) + let branch ← + `(tactic| + ( + have hprefix : + code.extractLsb' 0 16 = + BitVec.ofNat 16 $bucketPrefix := by + simpa only [beq_iff_eq] using hprefixes + unfold isGeneratedSystematicWeightSixteenCode + rw [hprefix] + exact $proofName code hprefix hconstraints + )) + pure (declaration, branch) + let declarations := generated.map Prod.fst + let branches := generated.map Prod.snd + let focusedBranches ← branches.mapM fun branch => + `(tactic| focus $branch:tactic) + let dispatcherDeclaration ← `(command| + /-- Every systematic orthonormal-column code occurs in the generated + finite family of normalized rank-seven weight-sixteen supports. -/ + theorem $dispatcherName + (code : BitVec 64) + (hconstraints : + SystematicWeightSixteenConstraints code = true) : + isGeneratedSystematicWeightSixteenCode code = true := by + have hprefixes := + systematicWeightSixteen_prefix_allowed code hconstraints + unfold IsSystematicWeightSixteenPrefixAllowed at hprefixes + simp only [Bool.or_eq_true] at hprefixes + repeat' (apply Or.elim hprefixes <;> intro hprefixes) + $focusedBranches:tactic*) + return Lean.mkNullNode <| + declarations.map (·.raw) ++ #[dispatcherDeclaration.raw] + +set_option maxRecDepth 100000 in +set_option maxHeartbeats 20000000 in +normalized_weight_sixteen_classification + systematicWeightSixteen_generated_of_constraints where + | 2823, normalizedWeightSixteenCandidateBucket_0b07, systematicWeightSixteen_bucket_0b07_complete + | 3335, normalizedWeightSixteenCandidateBucket_0d07, systematicWeightSixteen_bucket_0d07_complete + | 3339, normalizedWeightSixteenCandidateBucket_0d0b, systematicWeightSixteen_bucket_0d0b_complete + | 3591, normalizedWeightSixteenCandidateBucket_0e07, systematicWeightSixteen_bucket_0e07_complete + | 3595, normalizedWeightSixteenCandidateBucket_0e0b, systematicWeightSixteen_bucket_0e0b_complete + | 3597, normalizedWeightSixteenCandidateBucket_0e0d, systematicWeightSixteen_bucket_0e0d_complete + | 4871, normalizedWeightSixteenCandidateBucket_1307, systematicWeightSixteen_bucket_1307_complete + | 4875, normalizedWeightSixteenCandidateBucket_130b, systematicWeightSixteen_bucket_130b_complete + | 5383, normalizedWeightSixteenCandidateBucket_1507, systematicWeightSixteen_bucket_1507_complete + | 5389, normalizedWeightSixteenCandidateBucket_150d, systematicWeightSixteen_bucket_150d_complete + | 5395, normalizedWeightSixteenCandidateBucket_1513, systematicWeightSixteen_bucket_1513_complete + | 5639, normalizedWeightSixteenCandidateBucket_1607, systematicWeightSixteen_bucket_1607_complete + | 5646, normalizedWeightSixteenCandidateBucket_160e, systematicWeightSixteen_bucket_160e_complete + | 5651, normalizedWeightSixteenCandidateBucket_1613, systematicWeightSixteen_bucket_1613_complete + | 5653, normalizedWeightSixteenCandidateBucket_1615, systematicWeightSixteen_bucket_1615_complete + | 6411, normalizedWeightSixteenCandidateBucket_190b, systematicWeightSixteen_bucket_190b_complete + | 6413, normalizedWeightSixteenCandidateBucket_190d, systematicWeightSixteen_bucket_190d_complete + | 6419, normalizedWeightSixteenCandidateBucket_1913, systematicWeightSixteen_bucket_1913_complete + | 6421, normalizedWeightSixteenCandidateBucket_1915, systematicWeightSixteen_bucket_1915_complete + | 6667, normalizedWeightSixteenCandidateBucket_1a0b, systematicWeightSixteen_bucket_1a0b_complete + | 6670, normalizedWeightSixteenCandidateBucket_1a0e, systematicWeightSixteen_bucket_1a0e_complete + | 6675, normalizedWeightSixteenCandidateBucket_1a13, systematicWeightSixteen_bucket_1a13_complete + | 6678, normalizedWeightSixteenCandidateBucket_1a16, systematicWeightSixteen_bucket_1a16_complete + | 6681, normalizedWeightSixteenCandidateBucket_1a19, systematicWeightSixteen_bucket_1a19_complete + | 7181, normalizedWeightSixteenCandidateBucket_1c0d, systematicWeightSixteen_bucket_1c0d_complete + | 7182, normalizedWeightSixteenCandidateBucket_1c0e, systematicWeightSixteen_bucket_1c0e_complete + | 7189, normalizedWeightSixteenCandidateBucket_1c15, systematicWeightSixteen_bucket_1c15_complete + | 7190, normalizedWeightSixteenCandidateBucket_1c16, systematicWeightSixteen_bucket_1c16_complete + | 7193, normalizedWeightSixteenCandidateBucket_1c19, systematicWeightSixteen_bucket_1c19_complete + | 7194, normalizedWeightSixteenCandidateBucket_1c1a, systematicWeightSixteen_bucket_1c1a_complete + | 8967, normalizedWeightSixteenCandidateBucket_2307, systematicWeightSixteen_bucket_2307_complete + | 8971, normalizedWeightSixteenCandidateBucket_230b, systematicWeightSixteen_bucket_230b_complete + | 8979, normalizedWeightSixteenCandidateBucket_2313, systematicWeightSixteen_bucket_2313_complete + | 8988, normalizedWeightSixteenCandidateBucket_231c, systematicWeightSixteen_bucket_231c_complete + | 8991, normalizedWeightSixteenCandidateBucket_231f, systematicWeightSixteen_bucket_231f_complete + | 9479, normalizedWeightSixteenCandidateBucket_2507, systematicWeightSixteen_bucket_2507_complete + | 9485, normalizedWeightSixteenCandidateBucket_250d, systematicWeightSixteen_bucket_250d_complete + | 9493, normalizedWeightSixteenCandidateBucket_2515, systematicWeightSixteen_bucket_2515_complete + | 9498, normalizedWeightSixteenCandidateBucket_251a, systematicWeightSixteen_bucket_251a_complete + | 9503, normalizedWeightSixteenCandidateBucket_251f, systematicWeightSixteen_bucket_251f_complete + | 9507, normalizedWeightSixteenCandidateBucket_2523, systematicWeightSixteen_bucket_2523_complete + | 9735, normalizedWeightSixteenCandidateBucket_2607, systematicWeightSixteen_bucket_2607_complete + | 9742, normalizedWeightSixteenCandidateBucket_260e, systematicWeightSixteen_bucket_260e_complete + | 9750, normalizedWeightSixteenCandidateBucket_2616, systematicWeightSixteen_bucket_2616_complete + | 9753, normalizedWeightSixteenCandidateBucket_2619, systematicWeightSixteen_bucket_2619_complete + | 9759, normalizedWeightSixteenCandidateBucket_261f, systematicWeightSixteen_bucket_261f_complete + | 9763, normalizedWeightSixteenCandidateBucket_2623, systematicWeightSixteen_bucket_2623_complete + | 9765, normalizedWeightSixteenCandidateBucket_2625, systematicWeightSixteen_bucket_2625_complete + | 10507, normalizedWeightSixteenCandidateBucket_290b, systematicWeightSixteen_bucket_290b_complete + | 10509, normalizedWeightSixteenCandidateBucket_290d, systematicWeightSixteen_bucket_290d_complete + | 10518, normalizedWeightSixteenCandidateBucket_2916, systematicWeightSixteen_bucket_2916_complete + | 10521, normalizedWeightSixteenCandidateBucket_2919, systematicWeightSixteen_bucket_2919_complete + | 10527, normalizedWeightSixteenCandidateBucket_291f, systematicWeightSixteen_bucket_291f_complete + | 10531, normalizedWeightSixteenCandidateBucket_2923, systematicWeightSixteen_bucket_2923_complete + | 10533, normalizedWeightSixteenCandidateBucket_2925, systematicWeightSixteen_bucket_2925_complete + | 10763, normalizedWeightSixteenCandidateBucket_2a0b, systematicWeightSixteen_bucket_2a0b_complete + | 10766, normalizedWeightSixteenCandidateBucket_2a0e, systematicWeightSixteen_bucket_2a0e_complete + | 10773, normalizedWeightSixteenCandidateBucket_2a15, systematicWeightSixteen_bucket_2a15_complete + | 10778, normalizedWeightSixteenCandidateBucket_2a1a, systematicWeightSixteen_bucket_2a1a_complete + | 10783, normalizedWeightSixteenCandidateBucket_2a1f, systematicWeightSixteen_bucket_2a1f_complete + | 10787, normalizedWeightSixteenCandidateBucket_2a23, systematicWeightSixteen_bucket_2a23_complete + | 10790, normalizedWeightSixteenCandidateBucket_2a26, systematicWeightSixteen_bucket_2a26_complete + | 10793, normalizedWeightSixteenCandidateBucket_2a29, systematicWeightSixteen_bucket_2a29_complete + | 11277, normalizedWeightSixteenCandidateBucket_2c0d, systematicWeightSixteen_bucket_2c0d_complete + | 11278, normalizedWeightSixteenCandidateBucket_2c0e, systematicWeightSixteen_bucket_2c0e_complete + | 11283, normalizedWeightSixteenCandidateBucket_2c13, systematicWeightSixteen_bucket_2c13_complete + | 11292, normalizedWeightSixteenCandidateBucket_2c1c, systematicWeightSixteen_bucket_2c1c_complete + | 11295, normalizedWeightSixteenCandidateBucket_2c1f, systematicWeightSixteen_bucket_2c1f_complete + | 11301, normalizedWeightSixteenCandidateBucket_2c25, systematicWeightSixteen_bucket_2c25_complete + | 11302, normalizedWeightSixteenCandidateBucket_2c26, systematicWeightSixteen_bucket_2c26_complete + | 11305, normalizedWeightSixteenCandidateBucket_2c29, systematicWeightSixteen_bucket_2c29_complete + | 11306, normalizedWeightSixteenCandidateBucket_2c2a, systematicWeightSixteen_bucket_2c2a_complete + | 12051, normalizedWeightSixteenCandidateBucket_2f13, systematicWeightSixteen_bucket_2f13_complete + | 12053, normalizedWeightSixteenCandidateBucket_2f15, systematicWeightSixteen_bucket_2f15_complete + | 12054, normalizedWeightSixteenCandidateBucket_2f16, systematicWeightSixteen_bucket_2f16_complete + | 12057, normalizedWeightSixteenCandidateBucket_2f19, systematicWeightSixteen_bucket_2f19_complete + | 12058, normalizedWeightSixteenCandidateBucket_2f1a, systematicWeightSixteen_bucket_2f1a_complete + | 12060, normalizedWeightSixteenCandidateBucket_2f1c, systematicWeightSixteen_bucket_2f1c_complete + | 12063, normalizedWeightSixteenCandidateBucket_2f1f, systematicWeightSixteen_bucket_2f1f_complete + | 12558, normalizedWeightSixteenCandidateBucket_310e, systematicWeightSixteen_bucket_310e_complete + | 12563, normalizedWeightSixteenCandidateBucket_3113, systematicWeightSixteen_bucket_3113_complete + | 12565, normalizedWeightSixteenCandidateBucket_3115, systematicWeightSixteen_bucket_3115_complete + | 12569, normalizedWeightSixteenCandidateBucket_3119, systematicWeightSixteen_bucket_3119_complete + | 12575, normalizedWeightSixteenCandidateBucket_311f, systematicWeightSixteen_bucket_311f_complete + | 12579, normalizedWeightSixteenCandidateBucket_3123, systematicWeightSixteen_bucket_3123_complete + | 12581, normalizedWeightSixteenCandidateBucket_3125, systematicWeightSixteen_bucket_3125_complete + | 12585, normalizedWeightSixteenCandidateBucket_3129, systematicWeightSixteen_bucket_3129_complete + | 12591, normalizedWeightSixteenCandidateBucket_312f, systematicWeightSixteen_bucket_312f_complete + | 12813, normalizedWeightSixteenCandidateBucket_320d, systematicWeightSixteen_bucket_320d_complete + | 12819, normalizedWeightSixteenCandidateBucket_3213, systematicWeightSixteen_bucket_3213_complete + | 12822, normalizedWeightSixteenCandidateBucket_3216, systematicWeightSixteen_bucket_3216_complete + | 12826, normalizedWeightSixteenCandidateBucket_321a, systematicWeightSixteen_bucket_321a_complete + | 12831, normalizedWeightSixteenCandidateBucket_321f, systematicWeightSixteen_bucket_321f_complete + | 12835, normalizedWeightSixteenCandidateBucket_3223, systematicWeightSixteen_bucket_3223_complete + | 12838, normalizedWeightSixteenCandidateBucket_3226, systematicWeightSixteen_bucket_3226_complete + | 12842, normalizedWeightSixteenCandidateBucket_322a, systematicWeightSixteen_bucket_322a_complete + | 12847, normalizedWeightSixteenCandidateBucket_322f, systematicWeightSixteen_bucket_322f_complete + | 12849, normalizedWeightSixteenCandidateBucket_3231, systematicWeightSixteen_bucket_3231_complete + | 13323, normalizedWeightSixteenCandidateBucket_340b, systematicWeightSixteen_bucket_340b_complete + | 13333, normalizedWeightSixteenCandidateBucket_3415, systematicWeightSixteen_bucket_3415_complete + | 13334, normalizedWeightSixteenCandidateBucket_3416, systematicWeightSixteen_bucket_3416_complete + | 13340, normalizedWeightSixteenCandidateBucket_341c, systematicWeightSixteen_bucket_341c_complete + | 13343, normalizedWeightSixteenCandidateBucket_341f, systematicWeightSixteen_bucket_341f_complete + | 13349, normalizedWeightSixteenCandidateBucket_3425, systematicWeightSixteen_bucket_3425_complete + | 13350, normalizedWeightSixteenCandidateBucket_3426, systematicWeightSixteen_bucket_3426_complete + | 13356, normalizedWeightSixteenCandidateBucket_342c, systematicWeightSixteen_bucket_342c_complete + | 13359, normalizedWeightSixteenCandidateBucket_342f, systematicWeightSixteen_bucket_342f_complete + | 13361, normalizedWeightSixteenCandidateBucket_3431, systematicWeightSixteen_bucket_3431_complete + | 13362, normalizedWeightSixteenCandidateBucket_3432, systematicWeightSixteen_bucket_3432_complete + | 14091, normalizedWeightSixteenCandidateBucket_370b, systematicWeightSixteen_bucket_370b_complete + | 14093, normalizedWeightSixteenCandidateBucket_370d, systematicWeightSixteen_bucket_370d_complete + | 14094, normalizedWeightSixteenCandidateBucket_370e, systematicWeightSixteen_bucket_370e_complete + | 14105, normalizedWeightSixteenCandidateBucket_3719, systematicWeightSixteen_bucket_3719_complete + | 14106, normalizedWeightSixteenCandidateBucket_371a, systematicWeightSixteen_bucket_371a_complete + | 14108, normalizedWeightSixteenCandidateBucket_371c, systematicWeightSixteen_bucket_371c_complete + | 14111, normalizedWeightSixteenCandidateBucket_371f, systematicWeightSixteen_bucket_371f_complete + | 14121, normalizedWeightSixteenCandidateBucket_3729, systematicWeightSixteen_bucket_3729_complete + | 14122, normalizedWeightSixteenCandidateBucket_372a, systematicWeightSixteen_bucket_372a_complete + | 14124, normalizedWeightSixteenCandidateBucket_372c, systematicWeightSixteen_bucket_372c_complete + | 14127, normalizedWeightSixteenCandidateBucket_372f, systematicWeightSixteen_bucket_372f_complete + | 14343, normalizedWeightSixteenCandidateBucket_3807, systematicWeightSixteen_bucket_3807_complete + | 14361, normalizedWeightSixteenCandidateBucket_3819, systematicWeightSixteen_bucket_3819_complete + | 14362, normalizedWeightSixteenCandidateBucket_381a, systematicWeightSixteen_bucket_381a_complete + | 14364, normalizedWeightSixteenCandidateBucket_381c, systematicWeightSixteen_bucket_381c_complete + | 14367, normalizedWeightSixteenCandidateBucket_381f, systematicWeightSixteen_bucket_381f_complete + | 14377, normalizedWeightSixteenCandidateBucket_3829, systematicWeightSixteen_bucket_3829_complete + | 14378, normalizedWeightSixteenCandidateBucket_382a, systematicWeightSixteen_bucket_382a_complete + | 14380, normalizedWeightSixteenCandidateBucket_382c, systematicWeightSixteen_bucket_382c_complete + | 14383, normalizedWeightSixteenCandidateBucket_382f, systematicWeightSixteen_bucket_382f_complete + | 14385, normalizedWeightSixteenCandidateBucket_3831, systematicWeightSixteen_bucket_3831_complete + | 14386, normalizedWeightSixteenCandidateBucket_3832, systematicWeightSixteen_bucket_3832_complete + | 14388, normalizedWeightSixteenCandidateBucket_3834, systematicWeightSixteen_bucket_3834_complete + | 14391, normalizedWeightSixteenCandidateBucket_3837, systematicWeightSixteen_bucket_3837_complete + | 15111, normalizedWeightSixteenCandidateBucket_3b07, systematicWeightSixteen_bucket_3b07_complete + | 15117, normalizedWeightSixteenCandidateBucket_3b0d, systematicWeightSixteen_bucket_3b0d_complete + | 15118, normalizedWeightSixteenCandidateBucket_3b0e, systematicWeightSixteen_bucket_3b0e_complete + | 15125, normalizedWeightSixteenCandidateBucket_3b15, systematicWeightSixteen_bucket_3b15_complete + | 15126, normalizedWeightSixteenCandidateBucket_3b16, systematicWeightSixteen_bucket_3b16_complete + | 15132, normalizedWeightSixteenCandidateBucket_3b1c, systematicWeightSixteen_bucket_3b1c_complete + | 15135, normalizedWeightSixteenCandidateBucket_3b1f, systematicWeightSixteen_bucket_3b1f_complete + | 15141, normalizedWeightSixteenCandidateBucket_3b25, systematicWeightSixteen_bucket_3b25_complete + | 15142, normalizedWeightSixteenCandidateBucket_3b26, systematicWeightSixteen_bucket_3b26_complete + | 15148, normalizedWeightSixteenCandidateBucket_3b2c, systematicWeightSixteen_bucket_3b2c_complete + | 15151, normalizedWeightSixteenCandidateBucket_3b2f, systematicWeightSixteen_bucket_3b2f_complete + | 15156, normalizedWeightSixteenCandidateBucket_3b34, systematicWeightSixteen_bucket_3b34_complete + | 15159, normalizedWeightSixteenCandidateBucket_3b37, systematicWeightSixteen_bucket_3b37_complete + | 15623, normalizedWeightSixteenCandidateBucket_3d07, systematicWeightSixteen_bucket_3d07_complete + | 15627, normalizedWeightSixteenCandidateBucket_3d0b, systematicWeightSixteen_bucket_3d0b_complete + | 15630, normalizedWeightSixteenCandidateBucket_3d0e, systematicWeightSixteen_bucket_3d0e_complete + | 15635, normalizedWeightSixteenCandidateBucket_3d13, systematicWeightSixteen_bucket_3d13_complete + | 15638, normalizedWeightSixteenCandidateBucket_3d16, systematicWeightSixteen_bucket_3d16_complete + | 15642, normalizedWeightSixteenCandidateBucket_3d1a, systematicWeightSixteen_bucket_3d1a_complete + | 15647, normalizedWeightSixteenCandidateBucket_3d1f, systematicWeightSixteen_bucket_3d1f_complete + | 15651, normalizedWeightSixteenCandidateBucket_3d23, systematicWeightSixteen_bucket_3d23_complete + | 15654, normalizedWeightSixteenCandidateBucket_3d26, systematicWeightSixteen_bucket_3d26_complete + | 15658, normalizedWeightSixteenCandidateBucket_3d2a, systematicWeightSixteen_bucket_3d2a_complete + | 15663, normalizedWeightSixteenCandidateBucket_3d2f, systematicWeightSixteen_bucket_3d2f_complete + | 15666, normalizedWeightSixteenCandidateBucket_3d32, systematicWeightSixteen_bucket_3d32_complete + | 15671, normalizedWeightSixteenCandidateBucket_3d37, systematicWeightSixteen_bucket_3d37_complete + | 15675, normalizedWeightSixteenCandidateBucket_3d3b, systematicWeightSixteen_bucket_3d3b_complete + | 15879, normalizedWeightSixteenCandidateBucket_3e07, systematicWeightSixteen_bucket_3e07_complete + | 15883, normalizedWeightSixteenCandidateBucket_3e0b, systematicWeightSixteen_bucket_3e0b_complete + | 15885, normalizedWeightSixteenCandidateBucket_3e0d, systematicWeightSixteen_bucket_3e0d_complete + | 15891, normalizedWeightSixteenCandidateBucket_3e13, systematicWeightSixteen_bucket_3e13_complete + | 15893, normalizedWeightSixteenCandidateBucket_3e15, systematicWeightSixteen_bucket_3e15_complete + | 15897, normalizedWeightSixteenCandidateBucket_3e19, systematicWeightSixteen_bucket_3e19_complete + | 15903, normalizedWeightSixteenCandidateBucket_3e1f, systematicWeightSixteen_bucket_3e1f_complete + | 15907, normalizedWeightSixteenCandidateBucket_3e23, systematicWeightSixteen_bucket_3e23_complete + | 15909, normalizedWeightSixteenCandidateBucket_3e25, systematicWeightSixteen_bucket_3e25_complete + | 15913, normalizedWeightSixteenCandidateBucket_3e29, systematicWeightSixteen_bucket_3e29_complete + | 15919, normalizedWeightSixteenCandidateBucket_3e2f, systematicWeightSixteen_bucket_3e2f_complete + | 15921, normalizedWeightSixteenCandidateBucket_3e31, systematicWeightSixteen_bucket_3e31_complete + | 15927, normalizedWeightSixteenCandidateBucket_3e37, systematicWeightSixteen_bucket_3e37_complete + | 15931, normalizedWeightSixteenCandidateBucket_3e3b, systematicWeightSixteen_bucket_3e3b_complete + | 15933, normalizedWeightSixteenCandidateBucket_3e3d, systematicWeightSixteen_bucket_3e3d_complete + | 17731, normalizedWeightSixteenCandidateBucket_4543, systematicWeightSixteen_bucket_4543_complete + | 17987, normalizedWeightSixteenCandidateBucket_4643, systematicWeightSixteen_bucket_4643_complete + | 17989, normalizedWeightSixteenCandidateBucket_4645, systematicWeightSixteen_bucket_4645_complete + | 18755, normalizedWeightSixteenCandidateBucket_4943, systematicWeightSixteen_bucket_4943_complete + | 18757, normalizedWeightSixteenCandidateBucket_4945, systematicWeightSixteen_bucket_4945_complete + | 19011, normalizedWeightSixteenCandidateBucket_4a43, systematicWeightSixteen_bucket_4a43_complete + | 19014, normalizedWeightSixteenCandidateBucket_4a46, systematicWeightSixteen_bucket_4a46_complete + | 19017, normalizedWeightSixteenCandidateBucket_4a49, systematicWeightSixteen_bucket_4a49_complete + | 19525, normalizedWeightSixteenCandidateBucket_4c45, systematicWeightSixteen_bucket_4c45_complete + | 19526, normalizedWeightSixteenCandidateBucket_4c46, systematicWeightSixteen_bucket_4c46_complete + | 19529, normalizedWeightSixteenCandidateBucket_4c49, systematicWeightSixteen_bucket_4c49_complete + | 19530, normalizedWeightSixteenCandidateBucket_4c4a, systematicWeightSixteen_bucket_4c4a_complete + | 20803, normalizedWeightSixteenCandidateBucket_5143, systematicWeightSixteen_bucket_5143_complete + | 20805, normalizedWeightSixteenCandidateBucket_5145, systematicWeightSixteen_bucket_5145_complete + | 20809, normalizedWeightSixteenCandidateBucket_5149, systematicWeightSixteen_bucket_5149_complete + | 20815, normalizedWeightSixteenCandidateBucket_514f, systematicWeightSixteen_bucket_514f_complete + | 21059, normalizedWeightSixteenCandidateBucket_5243, systematicWeightSixteen_bucket_5243_complete + | 21062, normalizedWeightSixteenCandidateBucket_5246, systematicWeightSixteen_bucket_5246_complete + | 21066, normalizedWeightSixteenCandidateBucket_524a, systematicWeightSixteen_bucket_524a_complete + | 21071, normalizedWeightSixteenCandidateBucket_524f, systematicWeightSixteen_bucket_524f_complete + | 21073, normalizedWeightSixteenCandidateBucket_5251, systematicWeightSixteen_bucket_5251_complete + | 21573, normalizedWeightSixteenCandidateBucket_5445, systematicWeightSixteen_bucket_5445_complete + | 21574, normalizedWeightSixteenCandidateBucket_5446, systematicWeightSixteen_bucket_5446_complete + | 21580, normalizedWeightSixteenCandidateBucket_544c, systematicWeightSixteen_bucket_544c_complete + | 21583, normalizedWeightSixteenCandidateBucket_544f, systematicWeightSixteen_bucket_544f_complete + | 21585, normalizedWeightSixteenCandidateBucket_5451, systematicWeightSixteen_bucket_5451_complete + | 21586, normalizedWeightSixteenCandidateBucket_5452, systematicWeightSixteen_bucket_5452_complete + | 22345, normalizedWeightSixteenCandidateBucket_5749, systematicWeightSixteen_bucket_5749_complete + | 22346, normalizedWeightSixteenCandidateBucket_574a, systematicWeightSixteen_bucket_574a_complete + | 22348, normalizedWeightSixteenCandidateBucket_574c, systematicWeightSixteen_bucket_574c_complete + | 22351, normalizedWeightSixteenCandidateBucket_574f, systematicWeightSixteen_bucket_574f_complete + | 22601, normalizedWeightSixteenCandidateBucket_5849, systematicWeightSixteen_bucket_5849_complete + | 22602, normalizedWeightSixteenCandidateBucket_584a, systematicWeightSixteen_bucket_584a_complete + | 22604, normalizedWeightSixteenCandidateBucket_584c, systematicWeightSixteen_bucket_584c_complete + | 22607, normalizedWeightSixteenCandidateBucket_584f, systematicWeightSixteen_bucket_584f_complete + | 22609, normalizedWeightSixteenCandidateBucket_5851, systematicWeightSixteen_bucket_5851_complete + | 22610, normalizedWeightSixteenCandidateBucket_5852, systematicWeightSixteen_bucket_5852_complete + | 22612, normalizedWeightSixteenCandidateBucket_5854, systematicWeightSixteen_bucket_5854_complete + | 22615, normalizedWeightSixteenCandidateBucket_5857, systematicWeightSixteen_bucket_5857_complete + | 23365, normalizedWeightSixteenCandidateBucket_5b45, systematicWeightSixteen_bucket_5b45_complete + | 23366, normalizedWeightSixteenCandidateBucket_5b46, systematicWeightSixteen_bucket_5b46_complete + | 23372, normalizedWeightSixteenCandidateBucket_5b4c, systematicWeightSixteen_bucket_5b4c_complete + | 23375, normalizedWeightSixteenCandidateBucket_5b4f, systematicWeightSixteen_bucket_5b4f_complete + | 23380, normalizedWeightSixteenCandidateBucket_5b54, systematicWeightSixteen_bucket_5b54_complete + | 23383, normalizedWeightSixteenCandidateBucket_5b57, systematicWeightSixteen_bucket_5b57_complete + | 23875, normalizedWeightSixteenCandidateBucket_5d43, systematicWeightSixteen_bucket_5d43_complete + | 23878, normalizedWeightSixteenCandidateBucket_5d46, systematicWeightSixteen_bucket_5d46_complete + | 23882, normalizedWeightSixteenCandidateBucket_5d4a, systematicWeightSixteen_bucket_5d4a_complete + | 23887, normalizedWeightSixteenCandidateBucket_5d4f, systematicWeightSixteen_bucket_5d4f_complete + | 23890, normalizedWeightSixteenCandidateBucket_5d52, systematicWeightSixteen_bucket_5d52_complete + | 23895, normalizedWeightSixteenCandidateBucket_5d57, systematicWeightSixteen_bucket_5d57_complete + | 23899, normalizedWeightSixteenCandidateBucket_5d5b, systematicWeightSixteen_bucket_5d5b_complete + | 24131, normalizedWeightSixteenCandidateBucket_5e43, systematicWeightSixteen_bucket_5e43_complete + | 24133, normalizedWeightSixteenCandidateBucket_5e45, systematicWeightSixteen_bucket_5e45_complete + | 24137, normalizedWeightSixteenCandidateBucket_5e49, systematicWeightSixteen_bucket_5e49_complete + | 24143, normalizedWeightSixteenCandidateBucket_5e4f, systematicWeightSixteen_bucket_5e4f_complete + | 24145, normalizedWeightSixteenCandidateBucket_5e51, systematicWeightSixteen_bucket_5e51_complete + | 24151, normalizedWeightSixteenCandidateBucket_5e57, systematicWeightSixteen_bucket_5e57_complete + | 24155, normalizedWeightSixteenCandidateBucket_5e5b, systematicWeightSixteen_bucket_5e5b_complete + | 24157, normalizedWeightSixteenCandidateBucket_5e5d, systematicWeightSixteen_bucket_5e5d_complete + | 25185, normalizedWeightSixteenCandidateBucket_6261, systematicWeightSixteen_bucket_6261_complete + | 25697, normalizedWeightSixteenCandidateBucket_6461, systematicWeightSixteen_bucket_6461_complete + | 25698, normalizedWeightSixteenCandidateBucket_6462, systematicWeightSixteen_bucket_6462_complete + | 26721, normalizedWeightSixteenCandidateBucket_6861, systematicWeightSixteen_bucket_6861_complete + | 26722, normalizedWeightSixteenCandidateBucket_6862, systematicWeightSixteen_bucket_6862_complete + | 26724, normalizedWeightSixteenCandidateBucket_6864, systematicWeightSixteen_bucket_6864_complete + | 26727, normalizedWeightSixteenCandidateBucket_6867, systematicWeightSixteen_bucket_6867_complete + | 27492, normalizedWeightSixteenCandidateBucket_6b64, systematicWeightSixteen_bucket_6b64_complete + | 27495, normalizedWeightSixteenCandidateBucket_6b67, systematicWeightSixteen_bucket_6b67_complete + | 28002, normalizedWeightSixteenCandidateBucket_6d62, systematicWeightSixteen_bucket_6d62_complete + | 28007, normalizedWeightSixteenCandidateBucket_6d67, systematicWeightSixteen_bucket_6d67_complete + | 28011, normalizedWeightSixteenCandidateBucket_6d6b, systematicWeightSixteen_bucket_6d6b_complete + | 28257, normalizedWeightSixteenCandidateBucket_6e61, systematicWeightSixteen_bucket_6e61_complete + | 28263, normalizedWeightSixteenCandidateBucket_6e67, systematicWeightSixteen_bucket_6e67_complete + | 28267, normalizedWeightSixteenCandidateBucket_6e6b, systematicWeightSixteen_bucket_6e6b_complete + | 28269, normalizedWeightSixteenCandidateBucket_6e6d, systematicWeightSixteen_bucket_6e6d_complete + | 30067, normalizedWeightSixteenCandidateBucket_7573, systematicWeightSixteen_bucket_7573_complete + | 30323, normalizedWeightSixteenCandidateBucket_7673, systematicWeightSixteen_bucket_7673_complete + | 30325, normalizedWeightSixteenCandidateBucket_7675, systematicWeightSixteen_bucket_7675_complete + | 31353, normalizedWeightSixteenCandidateBucket_7a79, systematicWeightSixteen_bucket_7a79_complete + | 33663, normalizedWeightSixteenCandidateBucket_837f, systematicWeightSixteen_bucket_837f_complete + | 34175, normalizedWeightSixteenCandidateBucket_857f, systematicWeightSixteen_bucket_857f_complete + | 34431, normalizedWeightSixteenCandidateBucket_867f, systematicWeightSixteen_bucket_867f_complete + | 35199, normalizedWeightSixteenCandidateBucket_897f, systematicWeightSixteen_bucket_897f_complete + | 35455, normalizedWeightSixteenCandidateBucket_8a7f, systematicWeightSixteen_bucket_8a7f_complete + | 35967, normalizedWeightSixteenCandidateBucket_8c7f, systematicWeightSixteen_bucket_8c7f_complete + | 36735, normalizedWeightSixteenCandidateBucket_8f7f, systematicWeightSixteen_bucket_8f7f_complete + | 37247, normalizedWeightSixteenCandidateBucket_917f, systematicWeightSixteen_bucket_917f_complete + | 37503, normalizedWeightSixteenCandidateBucket_927f, systematicWeightSixteen_bucket_927f_complete + | 38015, normalizedWeightSixteenCandidateBucket_947f, systematicWeightSixteen_bucket_947f_complete + | 38783, normalizedWeightSixteenCandidateBucket_977f, systematicWeightSixteen_bucket_977f_complete + | 39807, normalizedWeightSixteenCandidateBucket_9b7f, systematicWeightSixteen_bucket_9b7f_complete + | 40319, normalizedWeightSixteenCandidateBucket_9d7f, systematicWeightSixteen_bucket_9d7f_complete + | 41343, normalizedWeightSixteenCandidateBucket_a17f, systematicWeightSixteen_bucket_a17f_complete + | 41599, normalizedWeightSixteenCandidateBucket_a27f, systematicWeightSixteen_bucket_a27f_complete + | 42111, normalizedWeightSixteenCandidateBucket_a47f, systematicWeightSixteen_bucket_a47f_complete + | 42879, normalizedWeightSixteenCandidateBucket_a77f, systematicWeightSixteen_bucket_a77f_complete + | 43903, normalizedWeightSixteenCandidateBucket_ab7f, systematicWeightSixteen_bucket_ab7f_complete + | 44415, normalizedWeightSixteenCandidateBucket_ad7f, systematicWeightSixteen_bucket_ad7f_complete + | 45951, normalizedWeightSixteenCandidateBucket_b37f, systematicWeightSixteen_bucket_b37f_complete + | 46463, normalizedWeightSixteenCandidateBucket_b57f, systematicWeightSixteen_bucket_b57f_complete + | 47487, normalizedWeightSixteenCandidateBucket_b97f, systematicWeightSixteen_bucket_b97f_complete + | 49023, normalizedWeightSixteenCandidateBucket_bf7f, systematicWeightSixteen_bucket_bf7f_complete + +/-- Every systematic orthonormal-column code carries an explicit generated +canonical-class and affine-map certificate. -/ +theorem exists_normalizedWeightSixteenCandidate_of_constraints + (code : BitVec 64) + (hconstraints : SystematicWeightSixteenConstraints code = true) : + ∃ tree candidate, + normalizedWeightSixteenCandidateBucket (code.extractLsb' 0 16) = + some tree ∧ + NormalizedWeightSixteenCandidateTree.Member candidate tree ∧ + candidate.systematicCode = code := + exists_normalizedWeightSixteenCandidate_of_generated code + (systematicWeightSixteen_generated_of_constraints code hconstraints) + +end CryptBoolean diff --git a/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenNormalizedClassifier.lean b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenNormalizedClassifier.lean new file mode 100644 index 0000000..86b9cce --- /dev/null +++ b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenNormalizedClassifier.lean @@ -0,0 +1,825 @@ +/- +Copyright (c) 2026 Asher Yan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Asher Yan with Codex +-/ +module + +public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightSixteenNormalizedCandidates +public meta import Std.Tactic.BVDecide.Reflect + +/-! +# Kernel-checked normalized rank-seven pattern classification + +The affine-basis normalization of a rank-seven weight-sixteen support is a +128-bit set containing zero and the seven standard basis points. Self-duality +is exactly the evenness of its seven linear and twenty-one quadratic coordinate +moments. This file packages the finite classifier that identifies every such +normalized set with an affine image of one of the three canonical patterns. +-/ + +@[expose] public section + +namespace CryptBoolean + +set_option linter.style.setOption false in +/-- Run one finite weight-sixteen certificate with its required local +elaboration budget. -/ +macro "weightSixteenFiniteCertificate" : tactic => + `(tactic| set_option maxHeartbeats 20000000 in bv_decide) + +/-- Coordinate support masks on the low half of the seven-variable cube. -/ +def normalizedCoordinateMaskLow : Fin 7 → BitVec 64 + | 0 => 0xAAAAAAAAAAAAAAAA#64 + | 1 => 0xCCCCCCCCCCCCCCCC#64 + | 2 => 0xF0F0F0F0F0F0F0F0#64 + | 3 => 0xFF00FF00FF00FF00#64 + | 4 => 0xFFFF0000FFFF0000#64 + | 5 => 0xFFFFFFFF00000000#64 + | 6 => 0#64 + +/-- Coordinate support masks on the high half of the seven-variable cube. -/ +def normalizedCoordinateMaskHigh : Fin 7 → BitVec 64 + | 0 => 0xAAAAAAAAAAAAAAAA#64 + | 1 => 0xCCCCCCCCCCCCCCCC#64 + | 2 => 0xF0F0F0F0F0F0F0F0#64 + | 3 => 0xFF00FF00FF00FF00#64 + | 4 => 0xFFFF0000FFFF0000#64 + | 5 => 0xFFFFFFFF00000000#64 + | 6 => 0xFFFFFFFFFFFFFFFF#64 + +/-- Whether a 64-bit intersection has even cardinality. -/ +def normalizedMaskEven (x : BitVec 64) : Bool := + !(x.cpop.getLsbD 0) + +/-- The card-sixteen, affine-basis, and degree-at-most-two parity constraints +on a normalized pair of 64-bit support masks. -/ +def IsNormalizedWeightSixteenMask (low high : BitVec 64) : Bool := + low.cpop + high.cpop == 16#64 && + low &&& 0x0000000100010117#64 == 0x0000000100010117#64 && + high &&& 1#64 == 1#64 && + (List.ofFn fun i : Fin 7 ↦ + normalizedMaskEven (low &&& normalizedCoordinateMaskLow i) == + normalizedMaskEven (high &&& normalizedCoordinateMaskHigh i)).all id && + (List.ofFn fun i : Fin 7 ↦ + (List.ofFn fun j : Fin 7 ↦ + if i < j then + normalizedMaskEven + (low &&& normalizedCoordinateMaskLow i &&& + normalizedCoordinateMaskLow j) == + normalizedMaskEven + (high &&& normalizedCoordinateMaskHigh i &&& + normalizedCoordinateMaskHigh j) + else true).all id).all id + +/-- The `i`th systematic column packed into a 64-bit code. -/ +def systematicWeightSixteenColumn + (code : BitVec 64) (i : ℕ) : BitVec 8 := + code.extractLsb' (8 * i) 8 + +/-- A systematic column is odd and is not one of the eight unit columns already +occupied by the normalized affine basis. -/ +def isSystematicWeightSixteenNonunitOddColumn (column : BitVec 8) : Bool := + column.cpop.getLsbD 0 && column &&& (column - 1) != 0 + +/-- Two systematic columns are orthogonal over the binary field. -/ +def areSystematicWeightSixteenColumnsOrthogonal + (left right : BitVec 8) : Bool := + !((left &&& right).cpop.getLsbD 0) + +/-- The eight sorted columns form an orthonormal basis and avoid the eight +unit columns already occupied by the normalized affine basis. -/ +def SystematicWeightSixteenConstraints (code : BitVec 64) : Bool := + isSystematicWeightSixteenNonunitOddColumn + (systematicWeightSixteenColumn code 0) && + isSystematicWeightSixteenNonunitOddColumn + (systematicWeightSixteenColumn code 1) && + isSystematicWeightSixteenNonunitOddColumn + (systematicWeightSixteenColumn code 2) && + isSystematicWeightSixteenNonunitOddColumn + (systematicWeightSixteenColumn code 3) && + isSystematicWeightSixteenNonunitOddColumn + (systematicWeightSixteenColumn code 4) && + isSystematicWeightSixteenNonunitOddColumn + (systematicWeightSixteenColumn code 5) && + isSystematicWeightSixteenNonunitOddColumn + (systematicWeightSixteenColumn code 6) && + isSystematicWeightSixteenNonunitOddColumn + (systematicWeightSixteenColumn code 7) && + (systematicWeightSixteenColumn code 0).ult + (systematicWeightSixteenColumn code 1) && + (systematicWeightSixteenColumn code 1).ult + (systematicWeightSixteenColumn code 2) && + (systematicWeightSixteenColumn code 2).ult + (systematicWeightSixteenColumn code 3) && + (systematicWeightSixteenColumn code 3).ult + (systematicWeightSixteenColumn code 4) && + (systematicWeightSixteenColumn code 4).ult + (systematicWeightSixteenColumn code 5) && + (systematicWeightSixteenColumn code 5).ult + (systematicWeightSixteenColumn code 6) && + (systematicWeightSixteenColumn code 6).ult + (systematicWeightSixteenColumn code 7) && + areSystematicWeightSixteenColumnsOrthogonal + (systematicWeightSixteenColumn code 0) + (systematicWeightSixteenColumn code 1) && + areSystematicWeightSixteenColumnsOrthogonal + (systematicWeightSixteenColumn code 0) + (systematicWeightSixteenColumn code 2) && + areSystematicWeightSixteenColumnsOrthogonal + (systematicWeightSixteenColumn code 0) + (systematicWeightSixteenColumn code 3) && + areSystematicWeightSixteenColumnsOrthogonal + (systematicWeightSixteenColumn code 0) + (systematicWeightSixteenColumn code 4) && + areSystematicWeightSixteenColumnsOrthogonal + (systematicWeightSixteenColumn code 0) + (systematicWeightSixteenColumn code 5) && + areSystematicWeightSixteenColumnsOrthogonal + (systematicWeightSixteenColumn code 0) + (systematicWeightSixteenColumn code 6) && + areSystematicWeightSixteenColumnsOrthogonal + (systematicWeightSixteenColumn code 0) + (systematicWeightSixteenColumn code 7) && + areSystematicWeightSixteenColumnsOrthogonal + (systematicWeightSixteenColumn code 1) + (systematicWeightSixteenColumn code 2) && + areSystematicWeightSixteenColumnsOrthogonal + (systematicWeightSixteenColumn code 1) + (systematicWeightSixteenColumn code 3) && + areSystematicWeightSixteenColumnsOrthogonal + (systematicWeightSixteenColumn code 1) + (systematicWeightSixteenColumn code 4) && + areSystematicWeightSixteenColumnsOrthogonal + (systematicWeightSixteenColumn code 1) + (systematicWeightSixteenColumn code 5) && + areSystematicWeightSixteenColumnsOrthogonal + (systematicWeightSixteenColumn code 1) + (systematicWeightSixteenColumn code 6) && + areSystematicWeightSixteenColumnsOrthogonal + (systematicWeightSixteenColumn code 1) + (systematicWeightSixteenColumn code 7) && + areSystematicWeightSixteenColumnsOrthogonal + (systematicWeightSixteenColumn code 2) + (systematicWeightSixteenColumn code 3) && + areSystematicWeightSixteenColumnsOrthogonal + (systematicWeightSixteenColumn code 2) + (systematicWeightSixteenColumn code 4) && + areSystematicWeightSixteenColumnsOrthogonal + (systematicWeightSixteenColumn code 2) + (systematicWeightSixteenColumn code 5) && + areSystematicWeightSixteenColumnsOrthogonal + (systematicWeightSixteenColumn code 2) + (systematicWeightSixteenColumn code 6) && + areSystematicWeightSixteenColumnsOrthogonal + (systematicWeightSixteenColumn code 2) + (systematicWeightSixteenColumn code 7) && + areSystematicWeightSixteenColumnsOrthogonal + (systematicWeightSixteenColumn code 3) + (systematicWeightSixteenColumn code 4) && + areSystematicWeightSixteenColumnsOrthogonal + (systematicWeightSixteenColumn code 3) + (systematicWeightSixteenColumn code 5) && + areSystematicWeightSixteenColumnsOrthogonal + (systematicWeightSixteenColumn code 3) + (systematicWeightSixteenColumn code 6) && + areSystematicWeightSixteenColumnsOrthogonal + (systematicWeightSixteenColumn code 3) + (systematicWeightSixteenColumn code 7) && + areSystematicWeightSixteenColumnsOrthogonal + (systematicWeightSixteenColumn code 4) + (systematicWeightSixteenColumn code 5) && + areSystematicWeightSixteenColumnsOrthogonal + (systematicWeightSixteenColumn code 4) + (systematicWeightSixteenColumn code 6) && + areSystematicWeightSixteenColumnsOrthogonal + (systematicWeightSixteenColumn code 4) + (systematicWeightSixteenColumn code 7) && + areSystematicWeightSixteenColumnsOrthogonal + (systematicWeightSixteenColumn code 5) + (systematicWeightSixteenColumn code 6) && + areSystematicWeightSixteenColumnsOrthogonal + (systematicWeightSixteenColumn code 5) + (systematicWeightSixteenColumn code 7) && + areSystematicWeightSixteenColumnsOrthogonal + (systematicWeightSixteenColumn code 6) + (systematicWeightSixteenColumn code 7) + +/-- The finite family of two-column prefixes that extend to a generated +systematic orthonormal basis. -/ +def IsSystematicWeightSixteenPrefixAllowed (code : BitVec 64) : Bool := + ( + ( + ( + ( + ( + ( + ( + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 2823 || + code.extractLsb' 0 16 == BitVec.ofNat 16 3335) || + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 3339 || + code.extractLsb' 0 16 == BitVec.ofNat 16 3591)) || + ( + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 3595 || + code.extractLsb' 0 16 == BitVec.ofNat 16 3597) || + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 4871 || + code.extractLsb' 0 16 == BitVec.ofNat 16 4875))) || + ( + ( + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 5383 || + code.extractLsb' 0 16 == BitVec.ofNat 16 5389) || + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 5395 || + code.extractLsb' 0 16 == BitVec.ofNat 16 5639)) || + ( + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 5646 || + code.extractLsb' 0 16 == BitVec.ofNat 16 5651) || + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 5653 || + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 6411 || + code.extractLsb' 0 16 == BitVec.ofNat 16 6413))))) || + ( + ( + ( + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 6419 || + code.extractLsb' 0 16 == BitVec.ofNat 16 6421) || + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 6667 || + code.extractLsb' 0 16 == BitVec.ofNat 16 6670)) || + ( + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 6675 || + code.extractLsb' 0 16 == BitVec.ofNat 16 6678) || + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 6681 || + code.extractLsb' 0 16 == BitVec.ofNat 16 7181))) || + ( + ( + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 7182 || + code.extractLsb' 0 16 == BitVec.ofNat 16 7189) || + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 7190 || + code.extractLsb' 0 16 == BitVec.ofNat 16 7193)) || + ( + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 7194 || + code.extractLsb' 0 16 == BitVec.ofNat 16 8967) || + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 8971 || + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 8979 || + code.extractLsb' 0 16 == BitVec.ofNat 16 8988)))))) || + ( + ( + ( + ( + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 8991 || + code.extractLsb' 0 16 == BitVec.ofNat 16 9479) || + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 9485 || + code.extractLsb' 0 16 == BitVec.ofNat 16 9493)) || + ( + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 9498 || + code.extractLsb' 0 16 == BitVec.ofNat 16 9503) || + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 9507 || + code.extractLsb' 0 16 == BitVec.ofNat 16 9735))) || + ( + ( + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 9742 || + code.extractLsb' 0 16 == BitVec.ofNat 16 9750) || + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 9753 || + code.extractLsb' 0 16 == BitVec.ofNat 16 9759)) || + ( + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 9763 || + code.extractLsb' 0 16 == BitVec.ofNat 16 9765) || + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 10507 || + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 10509 || + code.extractLsb' 0 16 == BitVec.ofNat 16 10518))))) || + ( + ( + ( + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 10521 || + code.extractLsb' 0 16 == BitVec.ofNat 16 10527) || + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 10531 || + code.extractLsb' 0 16 == BitVec.ofNat 16 10533)) || + ( + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 10763 || + code.extractLsb' 0 16 == BitVec.ofNat 16 10766) || + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 10773 || + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 10778 || + code.extractLsb' 0 16 == BitVec.ofNat 16 10783)))) || + ( + ( + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 10787 || + code.extractLsb' 0 16 == BitVec.ofNat 16 10790) || + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 10793 || + code.extractLsb' 0 16 == BitVec.ofNat 16 11277)) || + ( + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 11278 || + code.extractLsb' 0 16 == BitVec.ofNat 16 11283) || + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 11292 || + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 11295 || + code.extractLsb' 0 16 == BitVec.ofNat 16 11301))))))) || + ( + ( + ( + ( + ( + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 11302 || + code.extractLsb' 0 16 == BitVec.ofNat 16 11305) || + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 11306 || + code.extractLsb' 0 16 == BitVec.ofNat 16 12051)) || + ( + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 12053 || + code.extractLsb' 0 16 == BitVec.ofNat 16 12054) || + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 12057 || + code.extractLsb' 0 16 == BitVec.ofNat 16 12058))) || + ( + ( + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 12060 || + code.extractLsb' 0 16 == BitVec.ofNat 16 12063) || + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 12558 || + code.extractLsb' 0 16 == BitVec.ofNat 16 12563)) || + ( + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 12565 || + code.extractLsb' 0 16 == BitVec.ofNat 16 12569) || + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 12575 || + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 12579 || + code.extractLsb' 0 16 == BitVec.ofNat 16 12581))))) || + ( + ( + ( + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 12585 || + code.extractLsb' 0 16 == BitVec.ofNat 16 12591) || + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 12813 || + code.extractLsb' 0 16 == BitVec.ofNat 16 12819)) || + ( + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 12822 || + code.extractLsb' 0 16 == BitVec.ofNat 16 12826) || + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 12831 || + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 12835 || + code.extractLsb' 0 16 == BitVec.ofNat 16 12838)))) || + ( + ( + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 12842 || + code.extractLsb' 0 16 == BitVec.ofNat 16 12847) || + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 12849 || + code.extractLsb' 0 16 == BitVec.ofNat 16 13323)) || + ( + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 13333 || + code.extractLsb' 0 16 == BitVec.ofNat 16 13334) || + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 13340 || + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 13343 || + code.extractLsb' 0 16 == BitVec.ofNat 16 13349)))))) || + ( + ( + ( + ( + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 13350 || + code.extractLsb' 0 16 == BitVec.ofNat 16 13356) || + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 13359 || + code.extractLsb' 0 16 == BitVec.ofNat 16 13361)) || + ( + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 13362 || + code.extractLsb' 0 16 == BitVec.ofNat 16 14091) || + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 14093 || + code.extractLsb' 0 16 == BitVec.ofNat 16 14094))) || + ( + ( + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 14105 || + code.extractLsb' 0 16 == BitVec.ofNat 16 14106) || + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 14108 || + code.extractLsb' 0 16 == BitVec.ofNat 16 14111)) || + ( + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 14121 || + code.extractLsb' 0 16 == BitVec.ofNat 16 14122) || + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 14124 || + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 14127 || + code.extractLsb' 0 16 == BitVec.ofNat 16 14343))))) || + ( + ( + ( + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 14361 || + code.extractLsb' 0 16 == BitVec.ofNat 16 14362) || + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 14364 || + code.extractLsb' 0 16 == BitVec.ofNat 16 14367)) || + ( + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 14377 || + code.extractLsb' 0 16 == BitVec.ofNat 16 14378) || + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 14380 || + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 14383 || + code.extractLsb' 0 16 == BitVec.ofNat 16 14385)))) || + ( + ( + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 14386 || + code.extractLsb' 0 16 == BitVec.ofNat 16 14388) || + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 14391 || + code.extractLsb' 0 16 == BitVec.ofNat 16 15111)) || + ( + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 15117 || + code.extractLsb' 0 16 == BitVec.ofNat 16 15118) || + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 15125 || + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 15126 || + code.extractLsb' 0 16 == BitVec.ofNat 16 15132)))))))) || + ( + ( + ( + ( + ( + ( + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 15135 || + code.extractLsb' 0 16 == BitVec.ofNat 16 15141) || + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 15142 || + code.extractLsb' 0 16 == BitVec.ofNat 16 15148)) || + ( + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 15151 || + code.extractLsb' 0 16 == BitVec.ofNat 16 15156) || + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 15159 || + code.extractLsb' 0 16 == BitVec.ofNat 16 15623))) || + ( + ( + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 15627 || + code.extractLsb' 0 16 == BitVec.ofNat 16 15630) || + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 15635 || + code.extractLsb' 0 16 == BitVec.ofNat 16 15638)) || + ( + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 15642 || + code.extractLsb' 0 16 == BitVec.ofNat 16 15647) || + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 15651 || + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 15654 || + code.extractLsb' 0 16 == BitVec.ofNat 16 15658))))) || + ( + ( + ( + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 15663 || + code.extractLsb' 0 16 == BitVec.ofNat 16 15666) || + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 15671 || + code.extractLsb' 0 16 == BitVec.ofNat 16 15675)) || + ( + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 15879 || + code.extractLsb' 0 16 == BitVec.ofNat 16 15883) || + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 15885 || + code.extractLsb' 0 16 == BitVec.ofNat 16 15891))) || + ( + ( + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 15893 || + code.extractLsb' 0 16 == BitVec.ofNat 16 15897) || + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 15903 || + code.extractLsb' 0 16 == BitVec.ofNat 16 15907)) || + ( + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 15909 || + code.extractLsb' 0 16 == BitVec.ofNat 16 15913) || + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 15919 || + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 15921 || + code.extractLsb' 0 16 == BitVec.ofNat 16 15927)))))) || + ( + ( + ( + ( + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 15931 || + code.extractLsb' 0 16 == BitVec.ofNat 16 15933) || + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 17731 || + code.extractLsb' 0 16 == BitVec.ofNat 16 17987)) || + ( + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 17989 || + code.extractLsb' 0 16 == BitVec.ofNat 16 18755) || + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 18757 || + code.extractLsb' 0 16 == BitVec.ofNat 16 19011))) || + ( + ( + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 19014 || + code.extractLsb' 0 16 == BitVec.ofNat 16 19017) || + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 19525 || + code.extractLsb' 0 16 == BitVec.ofNat 16 19526)) || + ( + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 19529 || + code.extractLsb' 0 16 == BitVec.ofNat 16 19530) || + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 20803 || + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 20805 || + code.extractLsb' 0 16 == BitVec.ofNat 16 20809))))) || + ( + ( + ( + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 20815 || + code.extractLsb' 0 16 == BitVec.ofNat 16 21059) || + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 21062 || + code.extractLsb' 0 16 == BitVec.ofNat 16 21066)) || + ( + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 21071 || + code.extractLsb' 0 16 == BitVec.ofNat 16 21073) || + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 21573 || + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 21574 || + code.extractLsb' 0 16 == BitVec.ofNat 16 21580)))) || + ( + ( + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 21583 || + code.extractLsb' 0 16 == BitVec.ofNat 16 21585) || + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 21586 || + code.extractLsb' 0 16 == BitVec.ofNat 16 22345)) || + ( + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 22346 || + code.extractLsb' 0 16 == BitVec.ofNat 16 22348) || + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 22351 || + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 22601 || + code.extractLsb' 0 16 == BitVec.ofNat 16 22602))))))) || + ( + ( + ( + ( + ( + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 22604 || + code.extractLsb' 0 16 == BitVec.ofNat 16 22607) || + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 22609 || + code.extractLsb' 0 16 == BitVec.ofNat 16 22610)) || + ( + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 22612 || + code.extractLsb' 0 16 == BitVec.ofNat 16 22615) || + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 23365 || + code.extractLsb' 0 16 == BitVec.ofNat 16 23366))) || + ( + ( + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 23372 || + code.extractLsb' 0 16 == BitVec.ofNat 16 23375) || + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 23380 || + code.extractLsb' 0 16 == BitVec.ofNat 16 23383)) || + ( + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 23875 || + code.extractLsb' 0 16 == BitVec.ofNat 16 23878) || + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 23882 || + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 23887 || + code.extractLsb' 0 16 == BitVec.ofNat 16 23890))))) || + ( + ( + ( + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 23895 || + code.extractLsb' 0 16 == BitVec.ofNat 16 23899) || + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 24131 || + code.extractLsb' 0 16 == BitVec.ofNat 16 24133)) || + ( + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 24137 || + code.extractLsb' 0 16 == BitVec.ofNat 16 24143) || + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 24145 || + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 24151 || + code.extractLsb' 0 16 == BitVec.ofNat 16 24155)))) || + ( + ( + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 24157 || + code.extractLsb' 0 16 == BitVec.ofNat 16 25185) || + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 25697 || + code.extractLsb' 0 16 == BitVec.ofNat 16 25698)) || + ( + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 26721 || + code.extractLsb' 0 16 == BitVec.ofNat 16 26722) || + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 26724 || + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 26727 || + code.extractLsb' 0 16 == BitVec.ofNat 16 27492)))))) || + ( + ( + ( + ( + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 27495 || + code.extractLsb' 0 16 == BitVec.ofNat 16 28002) || + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 28007 || + code.extractLsb' 0 16 == BitVec.ofNat 16 28011)) || + ( + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 28257 || + code.extractLsb' 0 16 == BitVec.ofNat 16 28263) || + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 28267 || + code.extractLsb' 0 16 == BitVec.ofNat 16 28269))) || + ( + ( + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 30067 || + code.extractLsb' 0 16 == BitVec.ofNat 16 30323) || + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 30325 || + code.extractLsb' 0 16 == BitVec.ofNat 16 31353)) || + ( + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 33663 || + code.extractLsb' 0 16 == BitVec.ofNat 16 34175) || + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 34431 || + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 35199 || + code.extractLsb' 0 16 == BitVec.ofNat 16 35455))))) || + ( + ( + ( + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 35967 || + code.extractLsb' 0 16 == BitVec.ofNat 16 36735) || + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 37247 || + code.extractLsb' 0 16 == BitVec.ofNat 16 37503)) || + ( + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 38015 || + code.extractLsb' 0 16 == BitVec.ofNat 16 38783) || + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 39807 || + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 40319 || + code.extractLsb' 0 16 == BitVec.ofNat 16 41343)))) || + ( + ( + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 41599 || + code.extractLsb' 0 16 == BitVec.ofNat 16 42111) || + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 42879 || + code.extractLsb' 0 16 == BitVec.ofNat 16 43903)) || + ( + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 44415 || + code.extractLsb' 0 16 == BitVec.ofNat 16 45951) || + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 46463 || + ( + code.extractLsb' 0 16 == BitVec.ofNat 16 47487 || + code.extractLsb' 0 16 == BitVec.ofNat 16 49023))))))))) + +set_option maxHeartbeats 20000000 in +/-- Every systematic orthonormal-column code has one of the generated +two-column prefixes. -/ +theorem systematicWeightSixteen_prefix_allowed (code : BitVec 64) + (hconstraints : SystematicWeightSixteenConstraints code = true) : + IsSystematicWeightSixteenPrefixAllowed code = true := by + unfold SystematicWeightSixteenConstraints systematicWeightSixteenColumn at hconstraints + unfold isSystematicWeightSixteenNonunitOddColumn at hconstraints + unfold areSystematicWeightSixteenColumnsOrthogonal at hconstraints + unfold IsSystematicWeightSixteenPrefixAllowed + bv_decide + +/-- Boolean membership in the generated systematic-code family. -/ +def isGeneratedSystematicWeightSixteenCode (code : BitVec 64) : Bool := + match normalizedWeightSixteenCandidateBucket (code.extractLsb' 0 16) with + | some tree => tree.containsSystematicCode code + | none => false + +private theorem exists_candidate_of_tree_containsSystematicCode + (tree : NormalizedWeightSixteenCandidateTree) (code : BitVec 64) + (hcontains : tree.containsSystematicCode code = true) : + ∃ candidate, + tree.Member candidate ∧ candidate.systematicCode = code := by + induction tree with + | leaf candidate => + refine ⟨candidate, .leaf, ?_⟩ + simpa [NormalizedWeightSixteenCandidateTree.containsSystematicCode] + using hcontains + | node left right ihLeft ihRight => + have hcases : + left.containsSystematicCode code = true ∨ + right.containsSystematicCode code = true := by + simpa [NormalizedWeightSixteenCandidateTree.containsSystematicCode] + using hcontains + rcases hcases with hleft | hright + · obtain ⟨candidate, hmember, hcode⟩ := ihLeft hleft + exact ⟨candidate, .left hmember, hcode⟩ + · obtain ⟨candidate, hmember, hcode⟩ := ihRight hright + exact ⟨candidate, .right hmember, hcode⟩ + +/-- A successful generated-code test carries an actual class and affine-map +certificate leaf, rather than only a Boolean membership result. -/ +theorem exists_normalizedWeightSixteenCandidate_of_generated + (code : BitVec 64) + (hgenerated : isGeneratedSystematicWeightSixteenCode code = true) : + ∃ tree candidate, + normalizedWeightSixteenCandidateBucket (code.extractLsb' 0 16) = + some tree ∧ + NormalizedWeightSixteenCandidateTree.Member candidate tree ∧ + candidate.systematicCode = code := by + unfold isGeneratedSystematicWeightSixteenCode at hgenerated + split at hgenerated + next tree heq => + obtain ⟨candidate, hmember, hcode⟩ := + exists_candidate_of_tree_containsSystematicCode tree code hgenerated + exact ⟨tree, candidate, heq, hmember, hcode⟩ + next heq => simp at hgenerated + +end CryptBoolean diff --git a/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenOrbitAggregation.lean b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenOrbitAggregation.lean new file mode 100644 index 0000000..b4de71a --- /dev/null +++ b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenOrbitAggregation.lean @@ -0,0 +1,1124 @@ +/- +Copyright (c) 2026 Asher Yan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Asher Yan with Codex +-/ +module + +public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightSixteenPatternOrbitSums +public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightSixteenOrbitSoundness +public import Mathlib.LinearAlgebra.FiniteDimensional.Basic + +/-! +# Rank-seven weight-sixteen orbit aggregation + +Complete canonical affine-map sums are converted into lower bounds for +injective affine maps and then for the corresponding sets of distinct words. +The final classification-facing result takes the rank-seven classification as +an explicit hypothesis. +-/ + +open Finset +open scoped BigOperators BooleanCube + +@[expose] public section + +namespace CryptBoolean + +variable {n : ℕ} + +/-- Injective affine maps from the seven-variable cube into the ambient cube. -/ +noncomputable def rankSevenWeightSixteenInjectiveAffineMapData (n : ℕ) : + Finset (SevenVariableAffineMapData n) := by + classical + exact Finset.univ.filter fun d ↦ LinearIndependent FABL.𝔽₂ d.2 + +theorem mem_rankSevenWeightSixteenInjectiveAffineMapData_iff + (d : SevenVariableAffineMapData n) : + d ∈ rankSevenWeightSixteenInjectiveAffineMapData n ↔ + LinearIndependent FABL.𝔽₂ d.2 := by + simp [rankSevenWeightSixteenInjectiveAffineMapData] + +private theorem injective_union_rankDeficientSevenVariableAffineMapData : + rankSevenWeightSixteenInjectiveAffineMapData n ∪ + rankDeficientSevenVariableAffineMapData n = Finset.univ := by + ext d + simp only [Finset.mem_union, mem_rankSevenWeightSixteenInjectiveAffineMapData_iff, + mem_rankDeficientSevenVariableAffineMapData_iff, Finset.mem_univ, iff_true] + rw [sevenVariableAffinePoint_injective_iff] + exact Classical.em _ + +private theorem disjoint_injective_rankDeficientSevenVariableAffineMapData : + Disjoint (rankSevenWeightSixteenInjectiveAffineMapData n) + (rankDeficientSevenVariableAffineMapData n) := by + rw [Finset.disjoint_left] + intro d hdInjective hdDeficient + rw [mem_rankSevenWeightSixteenInjectiveAffineMapData_iff] at hdInjective + rw [mem_rankDeficientSevenVariableAffineMapData_iff, + sevenVariableAffinePoint_injective_iff] at hdDeficient + exact hdDeficient hdInjective + +private theorem realSignView_eq_one_or_neg_one + (f : BooleanFunction n) (x : FABL.F₂Cube n) : + realSignView f x = 1 ∨ realSignView f x = -1 := by + rcases FABL.signValue_eq_neg_one_or_one (FABL.signEncodedFunction f x) with h | h + · right + simpa [realSignView, FABL.realSignEncodedFunction] using h + · left + simpa [realSignView, FABL.realSignEncodedFunction] using h + +private theorem prod_realSignView_comp_eq_one_or_neg_one + {I : Type*} (f : BooleanFunction n) (s : Finset I) + (g : I → FABL.F₂Cube n) : + (∏ x ∈ s, realSignView f (g x)) = 1 ∨ + (∏ x ∈ s, realSignView f (g x)) = -1 := by + classical + induction s using Finset.induction_on with + | empty => simp + | @insert x s hx ih => + rw [Finset.prod_insert hx] + rcases realSignView_eq_one_or_neg_one f (g x) with hfx | hfx <;> + rcases ih with hs | hs <;> simp [hfx, hs] + +private theorem rankSevenWeightSixteenPatternAffineProduct_le_one + (f : BooleanFunction n) (c : RankSevenWeightSixteenPatternClass) + (d : SevenVariableAffineMapData n) : + rankSevenWeightSixteenPatternAffineProduct (realSignView f) c d ≤ 1 := by + unfold rankSevenWeightSixteenPatternAffineProduct + rcases prod_realSignView_comp_eq_one_or_neg_one f + (rankSevenWeightSixteenPattern c) (sevenVariableAffinePoint d) with h | h + · rw [h] + · rw [h] + norm_num + +/-- The sum over injective affine maps in one canonical pattern class loses +at most the number of rank-deficient affine-map data. -/ +theorem rankSevenWeightSixteenInjectiveAffineMapCharacterSum_ge_neg_card_deficient + (f : BooleanFunction n) (c : RankSevenWeightSixteenPatternClass) : + (∑ d ∈ rankSevenWeightSixteenInjectiveAffineMapData n, + rankSevenWeightSixteenPatternAffineProduct (realSignView f) c d) ≥ + -((rankDeficientSevenVariableAffineMapData n).card : ℝ) := by + have hcomplete : + 0 ≤ rankSevenWeightSixteenPatternCompleteAffineMapCharacterSum + (realSignView f) c := + rankSevenWeightSixteenPatternCompleteAffineMapCharacterSum_nonneg + (realSignView f) c + have hdeficient : + (∑ d ∈ rankDeficientSevenVariableAffineMapData n, + rankSevenWeightSixteenPatternAffineProduct (realSignView f) c d) ≤ + ((rankDeficientSevenVariableAffineMapData n).card : ℝ) := by + calc + (∑ d ∈ rankDeficientSevenVariableAffineMapData n, + rankSevenWeightSixteenPatternAffineProduct (realSignView f) c d) ≤ + ∑ _d ∈ rankDeficientSevenVariableAffineMapData n, (1 : ℝ) := by + apply Finset.sum_le_sum + intro d _hd + exact rankSevenWeightSixteenPatternAffineProduct_le_one f c d + _ = ((rankDeficientSevenVariableAffineMapData n).card : ℝ) := by simp + have hsplit : + rankSevenWeightSixteenPatternCompleteAffineMapCharacterSum + (realSignView f) c = + (∑ d ∈ rankSevenWeightSixteenInjectiveAffineMapData n, + rankSevenWeightSixteenPatternAffineProduct (realSignView f) c d) + + ∑ d ∈ rankDeficientSevenVariableAffineMapData n, + rankSevenWeightSixteenPatternAffineProduct (realSignView f) c d := by + unfold rankSevenWeightSixteenPatternCompleteAffineMapCharacterSum + rw [← Finset.sum_union + disjoint_injective_rankDeficientSevenVariableAffineMapData, + injective_union_rankDeficientSevenVariableAffineMapData] + rw [hsplit] at hcomplete + linarith + +/-- Dimension-free `127 q⁷` lower bound for injective affine-map +characters in each canonical rank-seven pattern class. -/ +theorem rankSevenWeightSixteenInjectiveAffineMapCharacterSum_ge + (f : BooleanFunction n) (c : RankSevenWeightSixteenPatternClass) : + (∑ d ∈ rankSevenWeightSixteenInjectiveAffineMapData n, + rankSevenWeightSixteenPatternAffineProduct (realSignView f) c d) ≥ + -(127 * (2 ^ n : ℝ) ^ 7) := by + have hlower := + rankSevenWeightSixteenInjectiveAffineMapCharacterSum_ge_neg_card_deficient f c + have hcardNat := card_rankDeficientSevenVariableAffineMapData_le n + have hcardReal : + ((rankDeficientSevenVariableAffineMapData n).card : ℝ) ≤ + 127 * (2 ^ n : ℝ) ^ 7 := by + exact_mod_cast hcardNat + linarith + +private theorem binarySign_sum_eq_prod + {I : Type*} + (s : Finset I) (g : I → FABL.𝔽₂) : + FABL.binarySign (∑ x ∈ s, g x) = + ∏ x ∈ s, FABL.binarySign (g x) := by + classical + induction s using Finset.induction_on with + | empty => simp + | @insert x s hx ih => + rw [Finset.sum_insert hx, Finset.prod_insert hx, + AddChar.map_add_eq_mul, ih] + +private theorem booleanFunctionPairing_eq_sum_support_finset + (f h : BooleanFunction n) : + booleanFunctionPairing n f h = ∑ x ∈ support h, f x := by + rw [booleanFunctionPairing_apply] + rw [support, FABL.f₂OneSupport, Finset.sum_filter] + apply Finset.sum_congr rfl + intro x _hx + by_cases hhx : h x = 0 + · simp [hhx] + · have hhxOne : h x = 1 := Fin.eq_one_of_ne_zero _ hhx + simp [hhxOne] + +private theorem realSignView_eq_binarySign + (f : BooleanFunction n) (x : FABL.F₂Cube n) : + realSignView f x = FABL.binarySign (f x) := by + rw [realSignView, FABL.realSignEncodedFunction, FABL.signEncodedFunction, + FABL.signValue_signEncode_eq_binarySign] + +/-- On injective affine maps, the canonical pattern product is exactly the +character of the corresponding distinct support word. -/ +theorem rankSevenWeightSixteenPatternAffineProduct_realSignView + (f : BooleanFunction n) (c : RankSevenWeightSixteenPatternClass) + (d : SevenVariableAffineMapData n) + (hd : LinearIndependent FABL.𝔽₂ d.2) : + rankSevenWeightSixteenPatternAffineProduct (realSignView f) c d = + FABL.binarySign (booleanFunctionPairing n f + (rankSevenWeightSixteenPatternWord c d)) := by + rw [booleanFunctionPairing_eq_sum_support_finset, + support_rankSevenWeightSixteenPatternWord, + binarySign_sum_eq_prod] + unfold rankSevenWeightSixteenPatternAffineProduct + unfold rankSevenWeightSixteenPatternImage + rw [Finset.prod_image + (sevenVariableAffinePoint_injective_iff d |>.2 hd).injOn] + apply Finset.prod_congr rfl + intro x _hx + exact realSignView_eq_binarySign f (sevenVariableAffinePoint d x) + +/-- The distinct support words in one canonical rank-seven affine orbit. -/ +noncomputable def rankSevenWeightSixteenPatternOrbitWords + (n : ℕ) (c : RankSevenWeightSixteenPatternClass) : + Finset (BooleanFunction n) := + (rankSevenWeightSixteenInjectiveAffineMapData n).image + (rankSevenWeightSixteenPatternWord c) + +/-- The injective affine-map fiber over one support word. -/ +noncomputable def rankSevenWeightSixteenPatternWordFiber + (n : ℕ) (c : RankSevenWeightSixteenPatternClass) + (h : BooleanFunction n) : Finset (SevenVariableAffineMapData n) := + (rankSevenWeightSixteenInjectiveAffineMapData n).filter fun d ↦ + rankSevenWeightSixteenPatternWord c d = h + +theorem mem_rankSevenWeightSixteenPatternOrbitWords_iff + (c : RankSevenWeightSixteenPatternClass) (h : BooleanFunction n) : + h ∈ rankSevenWeightSixteenPatternOrbitWords n c ↔ + ∃ d : SevenVariableAffineMapData n, + LinearIndependent FABL.𝔽₂ d.2 ∧ + rankSevenWeightSixteenPatternWord c d = h := by + simp [rankSevenWeightSixteenPatternOrbitWords, + mem_rankSevenWeightSixteenInjectiveAffineMapData_iff] + +theorem mem_rankSevenWeightSixteenPatternWordFiber_iff + (c : RankSevenWeightSixteenPatternClass) (h : BooleanFunction n) + (d : SevenVariableAffineMapData n) : + d ∈ rankSevenWeightSixteenPatternWordFiber n c h ↔ + LinearIndependent FABL.𝔽₂ d.2 ∧ + rankSevenWeightSixteenPatternWord c d = h := by + simp [rankSevenWeightSixteenPatternWordFiber, + mem_rankSevenWeightSixteenInjectiveAffineMapData_iff] + +/-- Postcomposition of affine-map data by an affine automorphism of the +ambient binary cube. -/ +def sevenVariableAffineMapDataPostcomposeEquiv + (g : FABL.F₂Cube n ≃ₗ[FABL.𝔽₂] FABL.F₂Cube n) + (t : FABL.F₂Cube n) : + SevenVariableAffineMapData n ≃ SevenVariableAffineMapData n where + toFun d := (t + g d.1, fun i ↦ g (d.2 i)) + invFun d := (g.symm (t + d.1), fun i ↦ g.symm (d.2 i)) + left_inv := by + rintro ⟨u, v⟩ + apply Prod.ext + · change g.symm (t + (t + g u)) = u + rw [← add_assoc, ZModModule.add_self, zero_add, + LinearEquiv.symm_apply_apply] + · funext i + exact g.symm_apply_apply (v i) + right_inv := by + rintro ⟨u, v⟩ + apply Prod.ext + · change t + g (g.symm (t + u)) = u + rw [LinearEquiv.apply_symm_apply, ← add_assoc, + ZModModule.add_self, zero_add] + · funext i + exact g.apply_symm_apply (v i) + +private theorem sevenVariableAffinePoint_postcompose + (g : FABL.F₂Cube n ≃ₗ[FABL.𝔽₂] FABL.F₂Cube n) + (t : FABL.F₂Cube n) (d : SevenVariableAffineMapData n) + (x : FABL.F₂Cube 7) : + sevenVariableAffinePoint (sevenVariableAffineMapDataPostcomposeEquiv g t d) x = + t + g (sevenVariableAffinePoint d x) := by + change (t + g d.1) + ∑ i, x i • g (d.2 i) = + t + g (d.1 + ∑ i, x i • d.2 i) + rw [map_add, map_sum] + simp only [map_smul] + abel + +private theorem linearIndependent_postcompose_iff + (g : FABL.F₂Cube n ≃ₗ[FABL.𝔽₂] FABL.F₂Cube n) + (t : FABL.F₂Cube n) (d : SevenVariableAffineMapData n) : + LinearIndependent FABL.𝔽₂ + (sevenVariableAffineMapDataPostcomposeEquiv g t d).2 ↔ + LinearIndependent FABL.𝔽₂ d.2 := by + change LinearIndependent FABL.𝔽₂ (fun i ↦ g (d.2 i)) ↔ + LinearIndependent FABL.𝔽₂ d.2 + constructor + · intro h + have hmapped := h.map' g.symm.toLinearMap + (LinearMap.ker_eq_bot.mpr g.symm.injective) + change LinearIndependent FABL.𝔽₂ + (fun i ↦ g.symm (g (d.2 i))) at hmapped + simpa only [LinearEquiv.symm_apply_apply] using hmapped + · intro h + have hmapped := + h.map' g.toLinearMap (LinearMap.ker_eq_bot.mpr g.injective) + change LinearIndependent FABL.𝔽₂ (fun i ↦ g (d.2 i)) at hmapped + exact hmapped + +private theorem rankSevenWeightSixteenPatternImage_postcompose + (g : FABL.F₂Cube n ≃ₗ[FABL.𝔽₂] FABL.F₂Cube n) + (t : FABL.F₂Cube n) (c : RankSevenWeightSixteenPatternClass) + (d : SevenVariableAffineMapData n) : + rankSevenWeightSixteenPatternImage c + (sevenVariableAffineMapDataPostcomposeEquiv g t d) = + (rankSevenWeightSixteenPatternImage c d).image (fun x ↦ t + g x) := by + unfold rankSevenWeightSixteenPatternImage + rw [Finset.image_image] + apply Finset.image_congr + intro x _hx + exact sevenVariableAffinePoint_postcompose g t d x + +private theorem rankSevenWeightSixteenPatternWord_eq_iff_image_eq + (c : RankSevenWeightSixteenPatternClass) + (d e : SevenVariableAffineMapData n) : + rankSevenWeightSixteenPatternWord c d = + rankSevenWeightSixteenPatternWord c e ↔ + rankSevenWeightSixteenPatternImage c d = + rankSevenWeightSixteenPatternImage c e := by + constructor + · intro h + have hs := congrArg support h + simpa only [support_rankSevenWeightSixteenPatternWord] using hs + · intro h + funext x + simp only [rankSevenWeightSixteenPatternWord, h] + +private theorem rankSevenWeightSixteenPatternWord_postcompose_eq_iff + (g : FABL.F₂Cube n ≃ₗ[FABL.𝔽₂] FABL.F₂Cube n) + (t : FABL.F₂Cube n) (c : RankSevenWeightSixteenPatternClass) + (d e : SevenVariableAffineMapData n) : + rankSevenWeightSixteenPatternWord c + (sevenVariableAffineMapDataPostcomposeEquiv g t d) = + rankSevenWeightSixteenPatternWord c + (sevenVariableAffineMapDataPostcomposeEquiv g t e) ↔ + rankSevenWeightSixteenPatternWord c d = + rankSevenWeightSixteenPatternWord c e := by + simp only [rankSevenWeightSixteenPatternWord_eq_iff_image_eq, + rankSevenWeightSixteenPatternImage_postcompose] + exact Finset.image_inj (fun x y hxy ↦ g.injective (add_left_cancel hxy)) + +private noncomputable def sevenDirectionSpanLinearEquiv + (d e : SevenVariableAffineMapData n) + (hd : LinearIndependent FABL.𝔽₂ d.2) + (he : LinearIndependent FABL.𝔽₂ e.2) : + Submodule.span FABL.𝔽₂ (Set.range d.2) ≃ₗ[FABL.𝔽₂] + Submodule.span FABL.𝔽₂ (Set.range e.2) := + hd.linearCombinationEquiv.symm.trans he.linearCombinationEquiv + +private theorem sevenDirectionSpanLinearEquiv_apply + (d e : SevenVariableAffineMapData n) + (hd : LinearIndependent FABL.𝔽₂ d.2) + (he : LinearIndependent FABL.𝔽₂ e.2) (i : Fin 7) : + (sevenDirectionSpanLinearEquiv d e hd he + ⟨d.2 i, Submodule.subset_span (Set.mem_range_self i)⟩ : FABL.F₂Cube n) = + e.2 i := by + have hrepr : hd.repr + ⟨d.2 i, Submodule.subset_span (Set.mem_range_self i)⟩ = + Finsupp.single i 1 := + hd.repr_eq_single i _ rfl + change (he.linearCombinationEquiv + (hd.repr + ⟨d.2 i, Submodule.subset_span (Set.mem_range_self i)⟩) : + FABL.F₂Cube n) = e.2 i + rw [hrepr] + simp + +private noncomputable def rankSevenAmbientLinearEquiv + (d e : SevenVariableAffineMapData n) + (hd : LinearIndependent FABL.𝔽₂ d.2) + (he : LinearIndependent FABL.𝔽₂ e.2) : + FABL.F₂Cube n ≃ₗ[FABL.𝔽₂] FABL.F₂Cube n := + Classical.choose + (Submodule.exists_linearEquiv_restrict_eq + (sevenDirectionSpanLinearEquiv d e hd he)) + +private theorem rankSevenAmbientLinearEquiv_apply_direction + (d e : SevenVariableAffineMapData n) + (hd : LinearIndependent FABL.𝔽₂ d.2) + (he : LinearIndependent FABL.𝔽₂ e.2) (i : Fin 7) : + rankSevenAmbientLinearEquiv d e hd he (d.2 i) = e.2 i := by + let hrestrict := Classical.choose_spec + (Submodule.exists_linearEquiv_restrict_eq + (sevenDirectionSpanLinearEquiv d e hd he)) + have hi := hrestrict + ⟨d.2 i, Submodule.subset_span (Set.mem_range_self i)⟩ + change sevenDirectionSpanLinearEquiv d e hd he + ⟨d.2 i, Submodule.subset_span (Set.mem_range_self i)⟩ = + rankSevenAmbientLinearEquiv d e hd he (d.2 i) at hi + rw [← hi] + exact sevenDirectionSpanLinearEquiv_apply d e hd he i + +private noncomputable def rankSevenAffineDataTransportEquiv + (d e : SevenVariableAffineMapData n) + (hd : LinearIndependent FABL.𝔽₂ d.2) + (he : LinearIndependent FABL.𝔽₂ e.2) : + SevenVariableAffineMapData n ≃ SevenVariableAffineMapData n := + let g := rankSevenAmbientLinearEquiv d e hd he + sevenVariableAffineMapDataPostcomposeEquiv g (e.1 + g d.1) + +private theorem rankSevenAffineDataTransportEquiv_apply + (d e : SevenVariableAffineMapData n) + (hd : LinearIndependent FABL.𝔽₂ d.2) + (he : LinearIndependent FABL.𝔽₂ e.2) : + rankSevenAffineDataTransportEquiv d e hd he d = e := by + apply Prod.ext + · change (e.1 + rankSevenAmbientLinearEquiv d e hd he d.1) + + rankSevenAmbientLinearEquiv d e hd he d.1 = e.1 + rw [add_assoc, ZModModule.add_self, add_zero] + · funext i + exact rankSevenAmbientLinearEquiv_apply_direction d e hd he i + +private theorem image_patternWordFiber_postcompose + (g : FABL.F₂Cube n ≃ₗ[FABL.𝔽₂] FABL.F₂Cube n) + (t : FABL.F₂Cube n) (c : RankSevenWeightSixteenPatternClass) + (d : SevenVariableAffineMapData n) : + (rankSevenWeightSixteenPatternWordFiber n c + (rankSevenWeightSixteenPatternWord c d)).image + (sevenVariableAffineMapDataPostcomposeEquiv g t) = + rankSevenWeightSixteenPatternWordFiber n c + (rankSevenWeightSixteenPatternWord c + (sevenVariableAffineMapDataPostcomposeEquiv g t d)) := by + ext q + constructor + · rw [Finset.mem_image] + rintro ⟨p, hp, rfl⟩ + rw [mem_rankSevenWeightSixteenPatternWordFiber_iff] at hp ⊢ + exact ⟨(linearIndependent_postcompose_iff g t p).2 hp.1, + (rankSevenWeightSixteenPatternWord_postcompose_eq_iff g t c p d).2 hp.2⟩ + · intro hq + rw [mem_rankSevenWeightSixteenPatternWordFiber_iff] at hq + let E := sevenVariableAffineMapDataPostcomposeEquiv g t + let p := E.symm q + have hEp : E p = q := E.apply_symm_apply q + have hpIndependent : LinearIndependent FABL.𝔽₂ p.2 := by + apply (linearIndependent_postcompose_iff g t p).1 + rw [hEp] + exact hq.1 + have hpWord : rankSevenWeightSixteenPatternWord c p = + rankSevenWeightSixteenPatternWord c d := by + apply (rankSevenWeightSixteenPatternWord_postcompose_eq_iff g t c p d).1 + rw [hEp] + exact hq.2 + rw [Finset.mem_image] + exact ⟨p, + (mem_rankSevenWeightSixteenPatternWordFiber_iff c _ p).2 + ⟨hpIndependent, hpWord⟩, + hEp⟩ + +private theorem card_patternWordFiber_eq_of_representatives + (c : RankSevenWeightSixteenPatternClass) + (d e : SevenVariableAffineMapData n) + (hd : LinearIndependent FABL.𝔽₂ d.2) + (he : LinearIndependent FABL.𝔽₂ e.2) : + (rankSevenWeightSixteenPatternWordFiber n c + (rankSevenWeightSixteenPatternWord c d)).card = + (rankSevenWeightSixteenPatternWordFiber n c + (rankSevenWeightSixteenPatternWord c e)).card := by + let g := rankSevenAmbientLinearEquiv d e hd he + let t := e.1 + g d.1 + let E := sevenVariableAffineMapDataPostcomposeEquiv g t + have hEd : E d = e := by + simpa only [g, t, E, rankSevenAffineDataTransportEquiv] using + rankSevenAffineDataTransportEquiv_apply d e hd he + have himage := image_patternWordFiber_postcompose g t c d + rw [hEd] at himage + rw [← himage, Finset.card_image_of_injective _ E.injective] + +/-- All words in one canonical pattern orbit have the same number of +injective affine-map representatives. -/ +theorem card_rankSevenWeightSixteenPatternWordFiber_eq_of_mem_orbit + (c : RankSevenWeightSixteenPatternClass) + {h k : BooleanFunction n} + (hh : h ∈ rankSevenWeightSixteenPatternOrbitWords n c) + (hk : k ∈ rankSevenWeightSixteenPatternOrbitWords n c) : + (rankSevenWeightSixteenPatternWordFiber n c h).card = + (rankSevenWeightSixteenPatternWordFiber n c k).card := by + rw [mem_rankSevenWeightSixteenPatternOrbitWords_iff] at hh hk + obtain ⟨d, hd, rfl⟩ := hh + obtain ⟨e, he, rfl⟩ := hk + exact card_patternWordFiber_eq_of_representatives c d e hd he + +/-- Every word in a canonical pattern orbit has at least one injective +affine-map representative. -/ +theorem card_rankSevenWeightSixteenPatternWordFiber_pos + (c : RankSevenWeightSixteenPatternClass) + {h : BooleanFunction n} + (hh : h ∈ rankSevenWeightSixteenPatternOrbitWords n c) : + 0 < (rankSevenWeightSixteenPatternWordFiber n c h).card := by + rw [mem_rankSevenWeightSixteenPatternOrbitWords_iff] at hh + obtain ⟨d, hd, hword⟩ := hh + apply Finset.card_pos.mpr + refine ⟨d, ?_⟩ + exact (mem_rankSevenWeightSixteenPatternWordFiber_iff c h d).2 + ⟨hd, hword⟩ + +/-- Character sum over the distinct words in one canonical rank-seven +pattern orbit. -/ +noncomputable def rankSevenWeightSixteenPatternOrbitCharacterSum + (f : BooleanFunction n) (c : RankSevenWeightSixteenPatternClass) : ℝ := + ∑ h ∈ rankSevenWeightSixteenPatternOrbitWords n c, + FABL.binarySign (booleanFunctionPairing n f h) + +private theorem injectiveAffineMapCharacterSum_eq_fiber_mul_orbitCharacterSum + (f : BooleanFunction n) (c : RankSevenWeightSixteenPatternClass) + {h₀ : BooleanFunction n} + (hh₀ : h₀ ∈ rankSevenWeightSixteenPatternOrbitWords n c) : + (∑ d ∈ rankSevenWeightSixteenInjectiveAffineMapData n, + rankSevenWeightSixteenPatternAffineProduct (realSignView f) c d) = + ((rankSevenWeightSixteenPatternWordFiber n c h₀).card : ℝ) * + rankSevenWeightSixteenPatternOrbitCharacterSum f c := by + calc + (∑ d ∈ rankSevenWeightSixteenInjectiveAffineMapData n, + rankSevenWeightSixteenPatternAffineProduct (realSignView f) c d) = + ∑ d ∈ rankSevenWeightSixteenInjectiveAffineMapData n, + FABL.binarySign (booleanFunctionPairing n f + (rankSevenWeightSixteenPatternWord c d)) := by + apply Finset.sum_congr rfl + intro d hd + rw [rankSevenWeightSixteenPatternAffineProduct_realSignView f c d + ((mem_rankSevenWeightSixteenInjectiveAffineMapData_iff d).1 hd)] + _ = ∑ h ∈ rankSevenWeightSixteenPatternOrbitWords n c, + ∑ d ∈ rankSevenWeightSixteenPatternWordFiber n c h, + FABL.binarySign (booleanFunctionPairing n f + (rankSevenWeightSixteenPatternWord c d)) := by + symm + unfold rankSevenWeightSixteenPatternWordFiber + apply Finset.sum_fiberwise_of_maps_to + intro d hd + exact Finset.mem_image_of_mem _ hd + _ = ∑ h ∈ rankSevenWeightSixteenPatternOrbitWords n c, + ((rankSevenWeightSixteenPatternWordFiber n c h).card : ℝ) * + FABL.binarySign (booleanFunctionPairing n f h) := by + apply Finset.sum_congr rfl + intro h _hh + calc + (∑ d ∈ rankSevenWeightSixteenPatternWordFiber n c h, + FABL.binarySign (booleanFunctionPairing n f + (rankSevenWeightSixteenPatternWord c d))) = + ∑ _d ∈ rankSevenWeightSixteenPatternWordFiber n c h, + FABL.binarySign (booleanFunctionPairing n f h) := by + apply Finset.sum_congr rfl + intro d hd + rw [(mem_rankSevenWeightSixteenPatternWordFiber_iff c h d).1 hd |>.2] + _ = ((rankSevenWeightSixteenPatternWordFiber n c h).card : ℝ) * + FABL.binarySign (booleanFunctionPairing n f h) := by simp + _ = ((rankSevenWeightSixteenPatternWordFiber n c h₀).card : ℝ) * + rankSevenWeightSixteenPatternOrbitCharacterSum f c := by + unfold rankSevenWeightSixteenPatternOrbitCharacterSum + rw [Finset.mul_sum] + refine Finset.sum_congr rfl ?_ + intro h hh + rw [card_rankSevenWeightSixteenPatternWordFiber_eq_of_mem_orbit c hh hh₀] + +/-- Each distinct canonical rank-seven word orbit inherits the same +`-127 q⁷` lower bound as its injective affine-map sum; the unknown positive +automorphism multiplicity need not be computed. -/ +theorem rankSevenWeightSixteenPatternOrbitCharacterSum_ge + (f : BooleanFunction n) (c : RankSevenWeightSixteenPatternClass) : + rankSevenWeightSixteenPatternOrbitCharacterSum f c ≥ + -(127 * (2 ^ n : ℝ) ^ 7) := by + by_cases hempty : rankSevenWeightSixteenPatternOrbitWords n c = ∅ + · have hbound : 0 ≤ 127 * (2 ^ n : ℝ) ^ 7 := by positivity + unfold rankSevenWeightSixteenPatternOrbitCharacterSum + rw [hempty] + simp only [Finset.sum_empty] + exact neg_nonpos.mpr hbound + · obtain ⟨h₀, hh₀⟩ := Finset.nonempty_iff_ne_empty.mpr hempty + let m : ℝ := + (rankSevenWeightSixteenPatternWordFiber n c h₀).card + let S : ℝ := rankSevenWeightSixteenPatternOrbitCharacterSum f c + have hmNat : 1 ≤ + (rankSevenWeightSixteenPatternWordFiber n c h₀).card := + (Nat.succ_le_iff).2 + (card_rankSevenWeightSixteenPatternWordFiber_pos c hh₀) + have hm : 1 ≤ m := by + dsimp only [m] + exact_mod_cast hmNat + have hdata := rankSevenWeightSixteenInjectiveAffineMapCharacterSum_ge f c + have heq := injectiveAffineMapCharacterSum_eq_fiber_mul_orbitCharacterSum + f c hh₀ + change _ = m * S at heq + rw [heq] at hdata + by_cases hS : 0 ≤ S + · have hneg : -(127 * (2 ^ n : ℝ) ^ 7) ≤ 0 := + neg_nonpos.mpr (by positivity) + exact hneg.trans hS + · have hnonneg : 0 ≤ (m - 1) * (-S) := + mul_nonneg (sub_nonneg.mpr hm) (neg_nonneg.mpr (le_of_not_ge hS)) + change S ≥ -(127 * (2 ^ n : ℝ) ^ 7) + nlinarith + +/-- A weight-sixteen word has support-affine-span rank seven when one +support point exhibits a seven-dimensional difference span. -/ +def HasSupportAffineSpanRankSeven (h : BooleanFunction n) : Prop := + ∃ p : FABL.F₂Cube n, p ∈ support h ∧ + Module.finrank FABL.𝔽₂ (supportDifferenceSpan h p) = 7 + +/-- Every injective canonical pattern image has support-affine-span rank +seven. -/ +theorem hasSupportAffineSpanRankSeven_rankSevenWeightSixteenPatternWord + (c : RankSevenWeightSixteenPatternClass) + (d : SevenVariableAffineMapData n) + (hd : LinearIndependent FABL.𝔽₂ d.2) : + HasSupportAffineSpanRankSeven + (rankSevenWeightSixteenPatternWord c d) := by + refine ⟨d.1, ?_, + finrank_supportDifferenceSpan_rankSevenWeightSixteenPatternWord c d hd⟩ + rw [support_rankSevenWeightSixteenPatternWord] + unfold rankSevenWeightSixteenPatternImage + exact Finset.mem_image.2 ⟨0, zero_mem_rankSevenWeightSixteenPattern c, by + simp [sevenVariableAffinePoint]⟩ + +/-- The rank-seven part of the weight-sixteen dual spectrum. -/ +noncomputable def orderTwoWeightSixteenRankSevenDualWords (n : ℕ) : + Finset (BooleanFunction n) := by + classical + exact (orderTwoWeightSixteenDualWords n).filter + HasSupportAffineSpanRankSeven + +/-- The complementary, rank-at-most-six part of the weight-sixteen dual +spectrum. The rank bound is proved below from the codimension-three +condition. -/ +noncomputable def orderTwoWeightSixteenRankAtMostSixResidualWords (n : ℕ) : + Finset (BooleanFunction n) := by + classical + exact (orderTwoWeightSixteenDualWords n).filter fun h ↦ + ¬HasSupportAffineSpanRankSeven h + +@[simp] theorem mem_orderTwoWeightSixteenRankSevenDualWords_iff + (h : BooleanFunction n) : + h ∈ orderTwoWeightSixteenRankSevenDualWords n ↔ + h ∈ orderTwoWeightSixteenDualWords n ∧ + HasSupportAffineSpanRankSeven h := by + simp [orderTwoWeightSixteenRankSevenDualWords] + +@[simp] theorem mem_orderTwoWeightSixteenRankAtMostSixResidualWords_iff + (h : BooleanFunction n) : + h ∈ orderTwoWeightSixteenRankAtMostSixResidualWords n ↔ + h ∈ orderTwoWeightSixteenDualWords n ∧ + ¬HasSupportAffineSpanRankSeven h := by + simp [orderTwoWeightSixteenRankAtMostSixResidualWords] + +/-- Every residual word really has support-affine-span rank at most six at +each support point. -/ +theorem finrank_supportDifferenceSpan_le_six_of_mem_weightSixteenResidual + (hn : 3 ≤ n) {h : BooleanFunction n} + (hh : h ∈ orderTwoWeightSixteenRankAtMostSixResidualWords n) + (p : FABL.F₂Cube n) (hp : p ∈ support h) : + Module.finrank FABL.𝔽₂ (supportDifferenceSpan h p) ≤ 6 := by + have hhData := + (mem_orderTwoWeightSixteenRankAtMostSixResidualWords_iff h).1 hh + have hdualData : h ∈ reedMuller (n - 3) n ∧ + hammingWeight h = 16 := by + simpa only [orderTwoWeightSixteenDualWords, orderTwoDualWords, + Finset.mem_filter, Finset.mem_univ, true_and] using hhData.1 + have hle := finrank_supportDifferenceSpan_le_seven_of_weight_sixteen + h p hp hn hdualData.1 hdualData.2 + have hne : Module.finrank FABL.𝔽₂ + (supportDifferenceSpan h p) ≠ 7 := by + intro heq + exact hhData.2 ⟨p, hp, heq⟩ + omega + +/-- The union of the three canonical rank-seven affine word orbits. -/ +noncomputable def rankSevenWeightSixteenPatternOrbitUnion (n : ℕ) : + Finset (BooleanFunction n) := + (Finset.univ : Finset RankSevenWeightSixteenPatternClass).biUnion + (rankSevenWeightSixteenPatternOrbitWords n) + +/-- Explicit classification interface: the rank-seven dual words are exactly +the union of the three canonical orbits, and those orbits are pairwise +disjoint. This is an ordinary proposition, not a primitive assumption or typeclass. -/ +def HasRankSevenWeightSixteenOrbitClassification (n : ℕ) : Prop := + (∀ h : BooleanFunction n, + h ∈ orderTwoWeightSixteenRankSevenDualWords n ↔ + ∃ c : RankSevenWeightSixteenPatternClass, + h ∈ rankSevenWeightSixteenPatternOrbitWords n c) ∧ + Set.PairwiseDisjoint + (↑(Finset.univ : Finset RankSevenWeightSixteenPatternClass)) + (rankSevenWeightSixteenPatternOrbitWords n) + +/-- The raw certificate-producing classifier supplies the covering half of +the rank-seven orbit classification. -/ +theorem mem_rankSevenWeightSixteenPatternOrbitUnion_of_certificate + (hcertificate : ∀ h : BooleanFunction n, + h ∈ orderTwoWeightSixteenDualWords n → + HasSupportAffineSpanRankSeven h → + RankSevenWeightSixteenPatternCertificate h) + {h : BooleanFunction n} + (hh : h ∈ orderTwoWeightSixteenRankSevenDualWords n) : + h ∈ rankSevenWeightSixteenPatternOrbitUnion n := by + have hhData := (mem_orderTwoWeightSixteenRankSevenDualWords_iff h).1 hh + let certificate := hcertificate h hhData.1 hhData.2 + rw [rankSevenWeightSixteenPatternOrbitUnion, Finset.mem_biUnion] + refine ⟨certificate.patternClass, Finset.mem_univ _, ?_⟩ + exact (mem_rankSevenWeightSixteenPatternOrbitWords_iff + certificate.patternClass h).2 + ⟨certificate.affineData, certificate.independent, + certificate.word_eq.symm⟩ + +/-- Every word in an injective canonical pattern orbit is a genuine +rank-seven weight-sixteen dual word. -/ +theorem mem_orderTwoWeightSixteenRankSevenDualWords_of_mem_patternOrbitWords + (c : RankSevenWeightSixteenPatternClass) + {h : BooleanFunction n} + (hh : h ∈ rankSevenWeightSixteenPatternOrbitWords n c) : + h ∈ orderTwoWeightSixteenRankSevenDualWords n := by + rw [mem_rankSevenWeightSixteenPatternOrbitWords_iff] at hh + obtain ⟨d, hd, rfl⟩ := hh + rw [mem_orderTwoWeightSixteenRankSevenDualWords_iff] + exact ⟨ + rankSevenWeightSixteenPatternWord_mem_orderTwoWeightSixteenDualWords c d hd, + hasSupportAffineSpanRankSeven_rankSevenWeightSixteenPatternWord c d hd⟩ + +/-- A certificate classifier and orbit disjointness combine +to discharge the complete rank-seven classification interface. -/ +theorem hasRankSevenWeightSixteenOrbitClassification_of_certificate_and_disjointness + (hcertificate : ∀ h : BooleanFunction n, + h ∈ orderTwoWeightSixteenDualWords n → + HasSupportAffineSpanRankSeven h → + RankSevenWeightSixteenPatternCertificate h) + (hdisjoint : Set.PairwiseDisjoint + (↑(Finset.univ : Finset RankSevenWeightSixteenPatternClass)) + (rankSevenWeightSixteenPatternOrbitWords n)) : + HasRankSevenWeightSixteenOrbitClassification n := by + refine ⟨fun h ↦ ⟨?_, ?_⟩, hdisjoint⟩ + · intro hh + have hunion := + mem_rankSevenWeightSixteenPatternOrbitUnion_of_certificate + hcertificate hh + rw [rankSevenWeightSixteenPatternOrbitUnion, + Finset.mem_biUnion] at hunion + obtain ⟨c, _hc, hhOrbit⟩ := hunion + exact ⟨c, hhOrbit⟩ + · rintro ⟨c, hhOrbit⟩ + exact + mem_orderTwoWeightSixteenRankSevenDualWords_of_mem_patternOrbitWords + c hhOrbit + +/-- The Boolean word whose support is the image of an arbitrary mask under a +seven-variable affine map. -/ +def sevenVariableAffineMaskWord + (d : SevenVariableAffineMapData n) + (m : Finset (FABL.F₂Cube 7)) : BooleanFunction n := + fun x ↦ if x ∈ m.image (sevenVariableAffinePoint d) then 1 else 0 + +@[simp] theorem support_sevenVariableAffineMaskWord + (d : SevenVariableAffineMapData n) + (m : Finset (FABL.F₂Cube 7)) : + support (sevenVariableAffineMaskWord d m) = + m.image (sevenVariableAffinePoint d) := by + ext x + simp [support, FABL.f₂OneSupport, sevenVariableAffineMaskWord] + +/-- Rank-deficient affine maps paired with all `2^128` masks on the +seven-variable Boolean cube. -/ +noncomputable def rankDeficientSevenVariableAffineMaskData (n : ℕ) : + Finset (SevenVariableAffineMapData n × Finset (FABL.F₂Cube 7)) := + (rankDeficientSevenVariableAffineMapData n).product + ((Finset.univ : Finset (FABL.F₂Cube 7)).powerset) + +/-- Every word produced by rank-deficient affine data and an arbitrary +seven-variable mask. -/ +noncomputable def rankDeficientSevenVariableAffineMaskImageWords (n : ℕ) : + Finset (BooleanFunction n) := + (rankDeficientSevenVariableAffineMaskData n).image fun dm ↦ + sevenVariableAffineMaskWord dm.1 dm.2 + +/-- There are exactly `2^128` masks on the seven-variable Boolean cube. -/ +theorem card_sevenVariableAffineMasks : + ((Finset.univ : Finset (FABL.F₂Cube 7)).powerset).card = 2 ^ 128 := by + rw [Finset.card_powerset, Finset.card_univ, FABL.card_f₂Cube] + norm_num + +/-- Arbitrary-mask images of rank-deficient affine maps contribute at most +`127 · 2^128 · q⁷` distinct words. -/ +theorem card_rankDeficientSevenVariableAffineMaskImageWords_le (n : ℕ) : + (rankDeficientSevenVariableAffineMaskImageWords n).card ≤ + 127 * 2 ^ 128 * (2 ^ n) ^ 7 := by + calc + (rankDeficientSevenVariableAffineMaskImageWords n).card ≤ + (rankDeficientSevenVariableAffineMaskData n).card := + Finset.card_image_le + _ = (rankDeficientSevenVariableAffineMapData n).card * 2 ^ 128 := by + unfold rankDeficientSevenVariableAffineMaskData + calc + ((rankDeficientSevenVariableAffineMapData n).product + ((Finset.univ : Finset (FABL.F₂Cube 7)).powerset)).card = + (rankDeficientSevenVariableAffineMapData n).card * + ((Finset.univ : Finset (FABL.F₂Cube 7)).powerset).card := + Finset.card_product _ _ + _ = (rankDeficientSevenVariableAffineMapData n).card * 2 ^ 128 := by + rw [card_sevenVariableAffineMasks] + _ ≤ (127 * (2 ^ n) ^ 7) * 2 ^ 128 := + Nat.mul_le_mul_right (2 ^ 128) + (card_rankDeficientSevenVariableAffineMapData_le n) + _ = 127 * 2 ^ 128 * (2 ^ n) ^ 7 := by ring + +/-- Minimal low-rank covering interface: every residual word is an arbitrary +mask image of one rank-deficient seven-variable affine map. -/ +def HasRankAtMostSixWeightSixteenDeficientAffineMaskCover (n : ℕ) : Prop := + ∀ h : BooleanFunction n, + h ∈ orderTwoWeightSixteenRankAtMostSixResidualWords n → + ∃ (d : SevenVariableAffineMapData n) + (m : Finset (FABL.F₂Cube 7)), + d ∈ rankDeficientSevenVariableAffineMapData n ∧ + sevenVariableAffineMaskWord d m = h + +private noncomputable def supportDifferenceSpanPaddedBasis + (h : BooleanFunction n) (p : FABL.F₂Cube n) + (hle : Module.finrank FABL.𝔽₂ + (supportDifferenceSpan h p) ≤ 7) : + Fin 7 → supportDifferenceSpan h p := + Function.extend (Fin.castLE hle) + (Module.finBasis FABL.𝔽₂ (supportDifferenceSpan h p)) + (fun _ ↦ 0) + +private theorem supportDifferenceSpanPaddedBasis_apply + (h : BooleanFunction n) (p : FABL.F₂Cube n) + (hle : Module.finrank FABL.𝔽₂ + (supportDifferenceSpan h p) ≤ 7) + (i : Fin (Module.finrank FABL.𝔽₂ + (supportDifferenceSpan h p))) : + supportDifferenceSpanPaddedBasis h p hle (Fin.castLE hle i) = + Module.finBasis FABL.𝔽₂ (supportDifferenceSpan h p) i := by + unfold supportDifferenceSpanPaddedBasis + exact (Fin.castLE_injective hle).extend_apply + (Module.finBasis FABL.𝔽₂ (supportDifferenceSpan h p)) (fun _ ↦ 0) i + +private theorem span_range_supportDifferenceSpanPaddedBasis_eq_top + (h : BooleanFunction n) (p : FABL.F₂Cube n) + (hle : Module.finrank FABL.𝔽₂ + (supportDifferenceSpan h p) ≤ 7) : + Submodule.span FABL.𝔽₂ + (Set.range (supportDifferenceSpanPaddedBasis h p hle)) = ⊤ := by + apply top_unique + rw [← (Module.finBasis FABL.𝔽₂ + (supportDifferenceSpan h p)).span_eq] + apply Submodule.span_mono + rintro _ ⟨i, rfl⟩ + exact ⟨Fin.castLE hle i, + supportDifferenceSpanPaddedBasis_apply h p hle i⟩ + +private noncomputable def supportDifferenceSpanSevenVariableAffineMapData + (h : BooleanFunction n) (p : FABL.F₂Cube n) + (hle : Module.finrank FABL.𝔽₂ + (supportDifferenceSpan h p) ≤ 7) : + SevenVariableAffineMapData n := + (p, fun i ↦ (supportDifferenceSpanPaddedBasis h p hle i : + FABL.F₂Cube n)) + +private theorem supportDifferenceSpanSevenVariableAffineMapData_mem_deficient + (h : BooleanFunction n) (p : FABL.F₂Cube n) + (hleSix : Module.finrank FABL.𝔽₂ + (supportDifferenceSpan h p) ≤ 6) + (hleSeven : Module.finrank FABL.𝔽₂ + (supportDifferenceSpan h p) ≤ 7) : + supportDifferenceSpanSevenVariableAffineMapData h p hleSeven ∈ + rankDeficientSevenVariableAffineMapData n := by + rw [mem_rankDeficientSevenVariableAffineMapData_iff, + sevenVariableAffinePoint_injective_iff] + intro hindependent + have hindependentSubtype : LinearIndependent FABL.𝔽₂ + (supportDifferenceSpanPaddedBasis h p hleSeven) := by + apply LinearIndependent.of_comp + (supportDifferenceSpan h p).subtype + change LinearIndependent FABL.𝔽₂ (fun i ↦ + (supportDifferenceSpanPaddedBasis h p hleSeven i : + FABL.F₂Cube n)) + simpa only [supportDifferenceSpanSevenVariableAffineMapData] using hindependent + have hcard := + (linearIndependent_iff_card_le_finrank_span).1 hindependentSubtype + rw [Set.finrank, + span_range_supportDifferenceSpanPaddedBasis_eq_top h p hleSeven, + finrank_top] at hcard + simp only [Fintype.card_fin] at hcard + omega + +private theorem supportDifferenceSpanSevenVariableAffinePoint_surjective_on + (h : BooleanFunction n) (p : FABL.F₂Cube n) + (hle : Module.finrank FABL.𝔽₂ + (supportDifferenceSpan h p) ≤ 7) + {x : FABL.F₂Cube n} + (hx : x ∈ FABL.binaryAffineSubspace + (supportDifferenceSpan h p) p) : + ∃ z : FABL.F₂Cube 7, + sevenVariableAffinePoint + (supportDifferenceSpanSevenVariableAffineMapData h p hle) z = x := by + have hxSpan : x + p ∈ supportDifferenceSpan h p := + (FABL.mem_binaryAffineSubspace_iff_add_mem + (supportDifferenceSpan h p) p x).1 hx + have hsurjective : Function.Surjective + (Fintype.linearCombination FABL.𝔽₂ + (supportDifferenceSpanPaddedBasis h p hle)) := + (span_range_eq_top_iff_surjective_fintypeLinearCombination FABL.𝔽₂ + (supportDifferenceSpanPaddedBasis h p hle)).1 + (span_range_supportDifferenceSpanPaddedBasis_eq_top h p hle) + obtain ⟨z, hz⟩ := hsurjective ⟨x + p, hxSpan⟩ + refine ⟨z, ?_⟩ + have hzValue := congrArg Subtype.val hz + simp only [Fintype.linearCombination_apply, Submodule.coe_sum, + Submodule.coe_smul] at hzValue + change p + ∑ i : Fin 7, + z i • (supportDifferenceSpanPaddedBasis h p hle i : + FABL.F₂Cube n) = x + rw [hzValue] + calc + p + (x + p) = x + (p + p) := by abel + _ = x := by rw [ZModModule.add_self, add_zero] + +/-- The mask consisting exactly of the preimages of a Boolean support. -/ +noncomputable def sevenVariableAffineSupportPreimageMask + (h : BooleanFunction n) (d : SevenVariableAffineMapData n) : + Finset (FABL.F₂Cube 7) := + Finset.univ.filter fun z ↦ sevenVariableAffinePoint d z ∈ support h + +private theorem image_sevenVariableAffineSupportPreimageMask_eq_support + (h : BooleanFunction n) (d : SevenVariableAffineMapData n) + (hsurjective : ∀ x ∈ support h, ∃ z : FABL.F₂Cube 7, + sevenVariableAffinePoint d z = x) : + (sevenVariableAffineSupportPreimageMask h d).image + (sevenVariableAffinePoint d) = support h := by + ext x + constructor + · rw [Finset.mem_image] + rintro ⟨z, hz, rfl⟩ + exact (Finset.mem_filter.1 hz).2 + · intro hx + obtain ⟨z, hz⟩ := hsurjective x hx + rw [Finset.mem_image] + exact ⟨z, Finset.mem_filter.2 ⟨Finset.mem_univ _, hz ▸ hx⟩, hz⟩ + +private theorem sevenVariableAffineMaskWord_supportPreimage_eq + (h : BooleanFunction n) (d : SevenVariableAffineMapData n) + (hsurjective : ∀ x ∈ support h, ∃ z : FABL.F₂Cube 7, + sevenVariableAffinePoint d z = x) : + sevenVariableAffineMaskWord d + (sevenVariableAffineSupportPreimageMask h d) = h := by + have himage := image_sevenVariableAffineSupportPreimageMask_eq_support + h d hsurjective + funext x + rw [sevenVariableAffineMaskWord, himage] + by_cases hx : h x = 0 + · simp [support, FABL.f₂OneSupport, hx] + · have hxOne : h x = 1 := Fin.eq_one_of_ne_zero _ hx + simp [support, FABL.f₂OneSupport, hxOne] + +/-- Every rank-at-most-six residual word has an arbitrary-mask +rank-deficient affine representation. -/ +theorem hasRankAtMostSixWeightSixteenDeficientAffineMaskCover + (hn : 3 ≤ n) : + HasRankAtMostSixWeightSixteenDeficientAffineMaskCover n := by + intro h hh + have hhData := + (mem_orderTwoWeightSixteenRankAtMostSixResidualWords_iff h).1 hh + have hdualData : h ∈ reedMuller (n - 3) n ∧ + hammingWeight h = 16 := by + simpa only [orderTwoWeightSixteenDualWords, orderTwoDualWords, + Finset.mem_filter, Finset.mem_univ, true_and] using hhData.1 + have hsupportCard : (support h).card = 16 := by + simpa only [hammingWeight_eq_card_support] using hdualData.2 + obtain ⟨p, hp⟩ : (support h).Nonempty := + Finset.card_pos.mp (by omega) + have hleSix := + finrank_supportDifferenceSpan_le_six_of_mem_weightSixteenResidual + hn hh p hp + have hleSeven : Module.finrank FABL.𝔽₂ + (supportDifferenceSpan h p) ≤ 7 := hleSix.trans (by norm_num) + let d := supportDifferenceSpanSevenVariableAffineMapData h p hleSeven + let m := sevenVariableAffineSupportPreimageMask h d + refine ⟨d, m, ?_, ?_⟩ + · exact supportDifferenceSpanSevenVariableAffineMapData_mem_deficient + h p hleSix hleSeven + · apply sevenVariableAffineMaskWord_supportPreimage_eq + intro x hx + apply supportDifferenceSpanSevenVariableAffinePoint_surjective_on + h p hleSeven + exact support_subset_binaryAffineSubspace_supportDifferenceSpan h p hx + +theorem orderTwoWeightSixteenRankAtMostSixResidualWords_subset_affineMaskImage_of_cover + (hcover : HasRankAtMostSixWeightSixteenDeficientAffineMaskCover n) : + orderTwoWeightSixteenRankAtMostSixResidualWords n ⊆ + rankDeficientSevenVariableAffineMaskImageWords n := by + intro h hh + obtain ⟨d, m, hd, hword⟩ := hcover h hh + rw [rankDeficientSevenVariableAffineMaskImageWords, Finset.mem_image] + refine ⟨(d, m), ?_, hword⟩ + simp [rankDeficientSevenVariableAffineMaskData, hd] + +/-- The residual word set inherits the `127 · 2^128 · q⁷` cardinality +bound from an arbitrary-mask rank-deficient affine cover. -/ +theorem card_orderTwoWeightSixteenRankAtMostSixResidualWords_le_of_cover + (hcover : HasRankAtMostSixWeightSixteenDeficientAffineMaskCover n) : + (orderTwoWeightSixteenRankAtMostSixResidualWords n).card ≤ + 127 * 2 ^ 128 * (2 ^ n) ^ 7 := + (Finset.card_le_card + (orderTwoWeightSixteenRankAtMostSixResidualWords_subset_affineMaskImage_of_cover + hcover)).trans + (card_rankDeficientSevenVariableAffineMaskImageWords_le n) + +/-- Unconditional low-rank residual count obtained from support-affine-span +parameterization. -/ +theorem card_orderTwoWeightSixteenRankAtMostSixResidualWords_le + (hn : 3 ≤ n) : + (orderTwoWeightSixteenRankAtMostSixResidualWords n).card ≤ + 127 * 2 ^ 128 * (2 ^ n) ^ 7 := + card_orderTwoWeightSixteenRankAtMostSixResidualWords_le_of_cover + (hasRankAtMostSixWeightSixteenDeficientAffineMaskCover hn) + +/-- Character sum over the rank-seven part of the weight-sixteen spectrum. -/ +noncomputable def orderTwoWeightSixteenRankSevenCharacterSum + (f : BooleanFunction n) : ℝ := + ∑ h ∈ orderTwoWeightSixteenRankSevenDualWords n, + FABL.binarySign (booleanFunctionPairing n f h) + +/-- Character sum over the complementary rank-at-most-six residual words. -/ +noncomputable def orderTwoWeightSixteenRankAtMostSixResidualCharacterSum + (f : BooleanFunction n) : ℝ := + ∑ h ∈ orderTwoWeightSixteenRankAtMostSixResidualWords n, + FABL.binarySign (booleanFunctionPairing n f h) + +/-- The rank-seven/residual split is an exact partition of the weight-sixteen +dual character sum. -/ +theorem orderTwoWeightSixteenCharacterSum_eq_rankSeven_add_residual + (f : BooleanFunction n) : + orderTwoWeightSixteenCharacterSum f = + orderTwoWeightSixteenRankSevenCharacterSum f + + orderTwoWeightSixteenRankAtMostSixResidualCharacterSum f := by + classical + have hsplit := Finset.sum_filter_add_sum_filter_not + (orderTwoWeightSixteenDualWords n) + HasSupportAffineSpanRankSeven + (fun h ↦ FABL.binarySign (booleanFunctionPairing n f h)) + simpa only [orderTwoWeightSixteenCharacterSum, + orderTwoWeightSixteenRankSevenCharacterSum, + orderTwoWeightSixteenRankAtMostSixResidualCharacterSum, + orderTwoWeightSixteenRankSevenDualWords, + orderTwoWeightSixteenRankAtMostSixResidualWords] using hsplit.symm + +private theorem orderTwoWeightSixteenRankSevenDualWords_eq_orbitUnion + (hclassification : HasRankSevenWeightSixteenOrbitClassification n) : + orderTwoWeightSixteenRankSevenDualWords n = + rankSevenWeightSixteenPatternOrbitUnion n := by + ext h + rw [hclassification.1 h] + simp [rankSevenWeightSixteenPatternOrbitUnion] + +private theorem orderTwoWeightSixteenRankSevenCharacterSum_eq_sum_orbits + (f : BooleanFunction n) + (hclassification : HasRankSevenWeightSixteenOrbitClassification n) : + orderTwoWeightSixteenRankSevenCharacterSum f = + ∑ c : RankSevenWeightSixteenPatternClass, + rankSevenWeightSixteenPatternOrbitCharacterSum f c := by + unfold orderTwoWeightSixteenRankSevenCharacterSum + rw [orderTwoWeightSixteenRankSevenDualWords_eq_orbitUnion + hclassification] + unfold rankSevenWeightSixteenPatternOrbitUnion + rw [Finset.sum_biUnion hclassification.2] + rfl + +/-- The three distinct rank-seven word orbits together lose at most +`3 · 127 q⁷`. -/ +theorem orderTwoWeightSixteenRankSevenCharacterSum_ge + (f : BooleanFunction n) + (hclassification : HasRankSevenWeightSixteenOrbitClassification n) : + orderTwoWeightSixteenRankSevenCharacterSum f ≥ + -(3 * (127 * (2 ^ n : ℝ) ^ 7)) := by + rw [orderTwoWeightSixteenRankSevenCharacterSum_eq_sum_orbits + f hclassification] + calc + -(3 * (127 * (2 ^ n : ℝ) ^ 7)) = + ∑ _c : RankSevenWeightSixteenPatternClass, + -(127 * (2 ^ n : ℝ) ^ 7) := by + rw [Finset.sum_const, Finset.card_univ, + show Fintype.card RankSevenWeightSixteenPatternClass = 3 by decide] + norm_num + _ ≤ ∑ c : RankSevenWeightSixteenPatternClass, + rankSevenWeightSixteenPatternOrbitCharacterSum f c := by + apply Finset.sum_le_sum + intro c _hc + exact rankSevenWeightSixteenPatternOrbitCharacterSum_ge f c + +private theorem binarySign_ge_neg_one (b : FABL.𝔽₂) : + -1 ≤ FABL.binarySign b := by + by_cases hb : b = 0 + · rw [hb] + norm_num + · have hbOne : b = 1 := Fin.eq_one_of_ne_zero _ hb + rw [hbOne, FABL.binarySign_one] + +/-- The covered rank-at-most-six residual character sum loses at most its +`127 · 2^128 · q⁷` arbitrary-mask cardinality bound. -/ +theorem orderTwoWeightSixteenRankAtMostSixResidualCharacterSum_ge + (f : BooleanFunction n) + (hcover : HasRankAtMostSixWeightSixteenDeficientAffineMaskCover n) : + orderTwoWeightSixteenRankAtMostSixResidualCharacterSum f ≥ + -(127 * 2 ^ 128 * (2 ^ n : ℝ) ^ 7) := by + have hterm : + -((orderTwoWeightSixteenRankAtMostSixResidualWords n).card : ℝ) ≤ + orderTwoWeightSixteenRankAtMostSixResidualCharacterSum f := by + calc + -((orderTwoWeightSixteenRankAtMostSixResidualWords n).card : ℝ) = + ∑ _h ∈ orderTwoWeightSixteenRankAtMostSixResidualWords n, + (-1 : ℝ) := by simp + _ ≤ ∑ h ∈ orderTwoWeightSixteenRankAtMostSixResidualWords n, + FABL.binarySign (booleanFunctionPairing n f h) := by + apply Finset.sum_le_sum + intro h _hh + exact binarySign_ge_neg_one (booleanFunctionPairing n f h) + _ = orderTwoWeightSixteenRankAtMostSixResidualCharacterSum f := rfl + have hcardNat := + card_orderTwoWeightSixteenRankAtMostSixResidualWords_le_of_cover hcover + have hcardReal : + ((orderTwoWeightSixteenRankAtMostSixResidualWords n).card : ℝ) ≤ + 127 * 2 ^ 128 * (2 ^ n : ℝ) ^ 7 := by + exact_mod_cast hcardNat + linarith + +/-- Aggregating the three rank-seven pattern orbits and an arbitrary-mask +low-rank cover gives a dimension-free constant times `q⁷` lower bound for +the full weight-sixteen dual character sum. -/ +theorem orderTwoWeightSixteenCharacterSum_ge_of_orbitClassification + (f : BooleanFunction n) + (hclassification : HasRankSevenWeightSixteenOrbitClassification n) + (hcover : HasRankAtMostSixWeightSixteenDeficientAffineMaskCover n) : + orderTwoWeightSixteenCharacterSum f ≥ + -((3 * 127 + 127 * 2 ^ 128) * (2 ^ n : ℝ) ^ 7) := by + rw [orderTwoWeightSixteenCharacterSum_eq_rankSeven_add_residual] + have hrank := orderTwoWeightSixteenRankSevenCharacterSum_ge + f hclassification + have hresidual := + orderTwoWeightSixteenRankAtMostSixResidualCharacterSum_ge f hcover + linarith + +end CryptBoolean diff --git a/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenOrbitDisjointness.lean b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenOrbitDisjointness.lean new file mode 100644 index 0000000..5d5fca9 --- /dev/null +++ b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenOrbitDisjointness.lean @@ -0,0 +1,404 @@ +/- +Copyright (c) 2026 Asher Yan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Asher Yan with Codex +-/ +module + +public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightSixteenRankSevenPatterns + +/-! +# Disjointness of the rank-seven weight-sixteen pattern orbits + +The cardinality of the intersection of a finite binary point set with one of +its nontrivial translates is preserved by injective affine maps. The three +canonical rank-seven patterns have different translation-intersection +profiles, which proves that their affine orbits are pairwise disjoint. +-/ + +open Finset +open scoped BooleanCube + +@[expose] public section + +namespace CryptBoolean + +variable {n : ℕ} + +/-- The number of points of `S` retained by translation through the difference +of two points `x` and `y`. -/ +def affineDifferenceOverlapCard + (S : Finset (FABL.F₂Cube n)) + (x y : FABL.F₂Cube n) : ℕ := + (S.filter fun z ↦ z + x + y ∈ S).card + +/-- A finite binary point set has a nonzero point difference whose translation +overlap has the prescribed cardinality. -/ +abbrev HasAffineDifferenceOverlapCard + (S : Finset (FABL.F₂Cube n)) (k : ℕ) : Prop := + ((S.product S).filter fun p ↦ + p.1 ≠ p.2 ∧ affineDifferenceOverlapCard S p.1 p.2 = k).Nonempty + +private theorem sevenVariableAffinePoint_sum_three + (d : SevenVariableAffineMapData n) + (x y z : FABL.F₂Cube 7) : + sevenVariableAffinePoint d (x + y + z) = + sevenVariableAffinePoint d x + sevenVariableAffinePoint d y + + sevenVariableAffinePoint d z := by + simp only [sevenVariableAffinePoint, Pi.add_apply, add_smul, + Finset.sum_add_distrib] + have htranslation : d.1 = d.1 + d.1 + d.1 := by + rw [ZModModule.add_self, zero_add] + nth_rewrite 1 [htranslation] + abel + +private theorem sum_three_mem_of_sum_three_image_mem + (S : Finset (FABL.F₂Cube 7)) + (d : SevenVariableAffineMapData n) + (hd : LinearIndependent FABL.𝔽₂ d.2) + (a b c : FABL.F₂Cube 7) + (hmem : sevenVariableAffinePoint d a + + sevenVariableAffinePoint d b + sevenVariableAffinePoint d c ∈ + S.image (sevenVariableAffinePoint d)) : + a + b + c ∈ S := by + have hinjective := sevenVariableAffinePoint_injective_iff d |>.2 hd + rw [← sevenVariableAffinePoint_sum_three d a b c] at hmem + rcases Finset.mem_image.1 hmem with ⟨x, hxS, hx⟩ + simpa only [hinjective hx] using hxS + +theorem affineDifferenceOverlapCard_image + (S : Finset (FABL.F₂Cube 7)) + (d : SevenVariableAffineMapData n) + (hd : LinearIndependent FABL.𝔽₂ d.2) + (x y : FABL.F₂Cube 7) : + affineDifferenceOverlapCard (S.image (sevenVariableAffinePoint d)) + (sevenVariableAffinePoint d x) (sevenVariableAffinePoint d y) = + affineDifferenceOverlapCard S x y := by + classical + have hinjective := sevenVariableAffinePoint_injective_iff d |>.2 hd + unfold affineDifferenceOverlapCard + symm + apply Finset.card_bij (fun z _hz ↦ sevenVariableAffinePoint d z) + · intro z hz + simp only [Finset.mem_filter] at hz ⊢ + refine ⟨Finset.mem_image.2 ⟨z, hz.1, rfl⟩, ?_⟩ + exact Finset.mem_image.2 + ⟨z + x + y, hz.2, + sevenVariableAffinePoint_sum_three d z x y⟩ + · intro a _ha b _hb hab + exact hinjective hab + · intro z hz + simp only [Finset.mem_filter] at hz + rcases Finset.mem_image.1 hz.1 with ⟨a, haS, ha⟩ + have hoverlap : a + x + y ∈ S := by + apply sum_three_mem_of_sum_three_image_mem S d hd a x y + rw [ha] + exact hz.2 + refine ⟨a, Finset.mem_filter.2 ⟨haS, hoverlap⟩, ha⟩ + +theorem hasAffineDifferenceOverlapCard_image_iff + (S : Finset (FABL.F₂Cube 7)) + (d : SevenVariableAffineMapData n) + (hd : LinearIndependent FABL.𝔽₂ d.2) + (k : ℕ) : + HasAffineDifferenceOverlapCard + (S.image (sevenVariableAffinePoint d)) k ↔ + HasAffineDifferenceOverlapCard S k := by + classical + have hinjective := sevenVariableAffinePoint_injective_iff d |>.2 hd + constructor + · intro h + change (((S.image (sevenVariableAffinePoint d)).product + (S.image (sevenVariableAffinePoint d))).filter fun p ↦ + p.1 ≠ p.2 ∧ affineDifferenceOverlapCard + (S.image (sevenVariableAffinePoint d)) p.1 p.2 = k).Nonempty at h + rcases h with ⟨p, hp⟩ + rcases Finset.mem_filter.1 hp with ⟨hpProduct, hxy, hoverlap⟩ + rcases Finset.mem_product.1 hpProduct with ⟨hx, hy⟩ + rcases Finset.mem_image.1 hx with ⟨x, hxS, hx⟩ + rcases Finset.mem_image.1 hy with ⟨y, hyS, hy⟩ + have hxy' : x ≠ y := by + intro h + apply hxy + rw [← hx, ← hy, h] + change ((S.product S).filter fun p ↦ + p.1 ≠ p.2 ∧ affineDifferenceOverlapCard S p.1 p.2 = k).Nonempty + refine ⟨(x, y), Finset.mem_filter.2 + ⟨Finset.mem_product.2 ⟨hxS, hyS⟩, hxy', ?_⟩⟩ + rw [← affineDifferenceOverlapCard_image S d hd x y, hx, hy] + exact hoverlap + · intro h + change ((S.product S).filter fun p ↦ + p.1 ≠ p.2 ∧ affineDifferenceOverlapCard S p.1 p.2 = k).Nonempty at h + rcases h with ⟨p, hp⟩ + rcases Finset.mem_filter.1 hp with ⟨hpProduct, hxy, hoverlap⟩ + rcases Finset.mem_product.1 hpProduct with ⟨hx, hy⟩ + change (((S.image (sevenVariableAffinePoint d)).product + (S.image (sevenVariableAffinePoint d))).filter fun p ↦ + p.1 ≠ p.2 ∧ affineDifferenceOverlapCard + (S.image (sevenVariableAffinePoint d)) p.1 p.2 = k).Nonempty + refine ⟨(sevenVariableAffinePoint d p.1, + sevenVariableAffinePoint d p.2), Finset.mem_filter.2 + ⟨Finset.mem_product.2 + ⟨Finset.mem_image.2 ⟨p.1, hx, rfl⟩, + Finset.mem_image.2 ⟨p.2, hy, rfl⟩⟩, + hinjective.ne hxy, ?_⟩⟩ + rw [affineDifferenceOverlapCard_image S d hd p.1 p.2] + exact hoverlap + +theorem hasAffineDifferenceOverlapCard_patternImage_iff + (c : RankSevenWeightSixteenPatternClass) + (d : SevenVariableAffineMapData n) + (hd : LinearIndependent FABL.𝔽₂ d.2) + (k : ℕ) : + HasAffineDifferenceOverlapCard + (rankSevenWeightSixteenPatternImage c d) k ↔ + HasAffineDifferenceOverlapCard + (rankSevenWeightSixteenPattern c) k := by + exact hasAffineDifferenceOverlapCard_image_iff + (rankSevenWeightSixteenPattern c) d hd k + +private def natXorOverlapCard + (S : Finset ℕ) (x y : ℕ) : ℕ := + (S.filter fun z ↦ z ^^^ x ^^^ y ∈ S).card + +private abbrev HasNatXorOverlapCard + (S : Finset ℕ) (k : ℕ) : Prop := + ((S.product S).filter fun p ↦ + p.1 ≠ p.2 ∧ natXorOverlapCard S p.1 p.2 = k).Nonempty + +private theorem f₂CubeOfNat_xor (a b : ℕ) : + f₂CubeOfNat 7 (a ^^^ b) = + f₂CubeOfNat 7 a + f₂CubeOfNat 7 b := by + funext i + simp only [f₂CubeOfNat, Nat.testBit_xor, Pi.add_apply] + cases ha : a.testBit i.val <;> cases hb : b.testBit i.val <;> decide + +private theorem f₂CubeOfNat_xor_three (a b c : ℕ) : + f₂CubeOfNat 7 (a ^^^ b ^^^ c) = + f₂CubeOfNat 7 a + f₂CubeOfNat 7 b + + f₂CubeOfNat 7 c := by + rw [f₂CubeOfNat_xor, f₂CubeOfNat_xor] + +private theorem f₂CubeOfNat_injectiveOn_lt_128 : + Set.InjOn (f₂CubeOfNat 7) {a : ℕ | a < 128} := by + intro a ha b hb hab + apply Nat.eq_of_testBit_eq + intro i + by_cases hi : i < 7 + · have hcoordinate := congrFun hab ⟨i, hi⟩ + cases hai : a.testBit i <;> cases hbi : b.testBit i <;> + simp_all [f₂CubeOfNat] + · have hpow : 2 ^ 7 ≤ 2 ^ i := + Nat.pow_le_pow_right (by omega) (Nat.le_of_not_gt hi) + rw [Nat.testBit_lt_two_pow (lt_of_lt_of_le ha hpow), + Nat.testBit_lt_two_pow (lt_of_lt_of_le hb hpow)] + +private theorem rankSevenWeightSixteenPatternIndex_lt_128 + (c : RankSevenWeightSixteenPatternClass) + (a : ℕ) (ha : a ∈ rankSevenWeightSixteenPatternIndices c) : + a < 128 := by + cases c <;> simp [rankSevenWeightSixteenPatternIndices] at ha <;> omega + +private theorem affineDifferenceOverlapCard_pattern_eq_nat + (c : RankSevenWeightSixteenPatternClass) + (x y : ℕ) + (hx : x ∈ rankSevenWeightSixteenPatternIndices c) + (hy : y ∈ rankSevenWeightSixteenPatternIndices c) : + affineDifferenceOverlapCard (rankSevenWeightSixteenPattern c) + (f₂CubeOfNat 7 x) (f₂CubeOfNat 7 y) = + natXorOverlapCard (rankSevenWeightSixteenPatternIndices c) x y := by + classical + let S := rankSevenWeightSixteenPatternIndices c + have hindex (a : ℕ) (ha : a ∈ S) : a < 128 := + rankSevenWeightSixteenPatternIndex_lt_128 c a ha + have hinjective : Set.InjOn (f₂CubeOfNat 7) S := by + intro a ha b hb hab + exact f₂CubeOfNat_injectiveOn_lt_128 (hindex a ha) (hindex b hb) hab + unfold affineDifferenceOverlapCard natXorOverlapCard + change ((rankSevenWeightSixteenPattern c).filter fun z ↦ + z + f₂CubeOfNat 7 x + f₂CubeOfNat 7 y ∈ + rankSevenWeightSixteenPattern c).card = _ + rw [rankSevenWeightSixteenPattern] + symm + apply Finset.card_bij (fun z _hz ↦ f₂CubeOfNat 7 z) + · intro z hz + simp only [Finset.mem_filter] at hz ⊢ + refine ⟨Finset.mem_image.2 ⟨z, hz.1, rfl⟩, ?_⟩ + exact Finset.mem_image.2 ⟨z ^^^ x ^^^ y, hz.2, + f₂CubeOfNat_xor_three z x y⟩ + · intro a ha b hb hab + exact hinjective (Finset.mem_filter.1 ha).1 + (Finset.mem_filter.1 hb).1 hab + · intro q hq + simp only [Finset.mem_filter] at hq + rcases Finset.mem_image.1 hq.1 with ⟨z, hzS, hz⟩ + rcases Finset.mem_image.1 hq.2 with ⟨w, hwS, hw⟩ + have hwEq : f₂CubeOfNat 7 w = f₂CubeOfNat 7 (z ^^^ x ^^^ y) := by + rw [f₂CubeOfNat_xor_three, hz] + exact hw + have hxLt : x < 128 := hindex x hx + have hyLt : y < 128 := hindex y hy + have hzLt : z < 128 := hindex z hzS + have hzxLt : z ^^^ x < 128 := by + simpa only [show 128 = 2 ^ 7 by norm_num] using + Nat.xor_lt_two_pow hzLt hxLt + have hzxyLt : z ^^^ x ^^^ y < 128 := by + simpa only [show 128 = 2 ^ 7 by norm_num] using + Nat.xor_lt_two_pow hzxLt hyLt + have hwLt : w < 128 := hindex w hwS + have hwValue : w = z ^^^ x ^^^ y := + f₂CubeOfNat_injectiveOn_lt_128 hwLt hzxyLt hwEq + refine ⟨z, Finset.mem_filter.2 ⟨hzS, ?_⟩, hz⟩ + simpa only [← hwValue] using hwS + +private theorem hasAffineDifferenceOverlapCard_pattern_iff_nat + (c : RankSevenWeightSixteenPatternClass) (k : ℕ) : + HasAffineDifferenceOverlapCard + (rankSevenWeightSixteenPattern c) k ↔ + HasNatXorOverlapCard + (rankSevenWeightSixteenPatternIndices c) k := by + classical + let S := rankSevenWeightSixteenPatternIndices c + constructor + · intro h + change (((rankSevenWeightSixteenPattern c).product + (rankSevenWeightSixteenPattern c)).filter fun p ↦ + p.1 ≠ p.2 ∧ affineDifferenceOverlapCard + (rankSevenWeightSixteenPattern c) p.1 p.2 = k).Nonempty at h + rcases h with ⟨p, hp⟩ + rcases Finset.mem_filter.1 hp with ⟨hpProduct, hxy, hoverlap⟩ + rcases Finset.mem_product.1 hpProduct with ⟨hx, hy⟩ + rw [rankSevenWeightSixteenPattern] at hx hy + rcases Finset.mem_image.1 hx with ⟨x, hxS, hx⟩ + rcases Finset.mem_image.1 hy with ⟨y, hyS, hy⟩ + have hxy' : x ≠ y := by + intro h + apply hxy + rw [← hx, ← hy, h] + change ((S.product S).filter fun p ↦ + p.1 ≠ p.2 ∧ natXorOverlapCard S p.1 p.2 = k).Nonempty + refine ⟨(x, y), Finset.mem_filter.2 + ⟨Finset.mem_product.2 ⟨hxS, hyS⟩, hxy', ?_⟩⟩ + rw [← affineDifferenceOverlapCard_pattern_eq_nat c x y hxS hyS, + hx, hy] + exact hoverlap + · intro h + change ((S.product S).filter fun p ↦ + p.1 ≠ p.2 ∧ natXorOverlapCard S p.1 p.2 = k).Nonempty at h + rcases h with ⟨p, hp⟩ + rcases Finset.mem_filter.1 hp with ⟨hpProduct, hxy, hoverlap⟩ + rcases Finset.mem_product.1 hpProduct with ⟨hx, hy⟩ + have hxy' : f₂CubeOfNat 7 p.1 ≠ f₂CubeOfNat 7 p.2 := by + intro h + apply hxy + exact f₂CubeOfNat_injectiveOn_lt_128 + (rankSevenWeightSixteenPatternIndex_lt_128 c p.1 hx) + (rankSevenWeightSixteenPatternIndex_lt_128 c p.2 hy) h + change (((rankSevenWeightSixteenPattern c).product + (rankSevenWeightSixteenPattern c)).filter fun p ↦ + p.1 ≠ p.2 ∧ affineDifferenceOverlapCard + (rankSevenWeightSixteenPattern c) p.1 p.2 = k).Nonempty + refine ⟨(f₂CubeOfNat 7 p.1, f₂CubeOfNat 7 p.2), + Finset.mem_filter.2 ⟨Finset.mem_product.2 + ⟨Finset.mem_image.2 ⟨p.1, hx, rfl⟩, + Finset.mem_image.2 ⟨p.2, hy, rfl⟩⟩, + hxy', ?_⟩⟩ + rw [affineDifferenceOverlapCard_pattern_eq_nat c p.1 p.2 hx hy] + exact hoverlap + +private theorem canonicalNatXorOverlapProfile : + HasNatXorOverlapCard + (rankSevenWeightSixteenPatternIndices .d16Plus) 16 ∧ + ¬HasNatXorOverlapCard + (rankSevenWeightSixteenPatternIndices .twoE8) 16 ∧ + ¬HasNatXorOverlapCard + (rankSevenWeightSixteenPatternIndices .f16) 16 ∧ + HasNatXorOverlapCard + (rankSevenWeightSixteenPatternIndices .f16) 4 ∧ + ¬HasNatXorOverlapCard + (rankSevenWeightSixteenPatternIndices .twoE8) 4 := by + set_option maxRecDepth 100000 in + decide + +theorem hasAffineDifferenceOverlapCard_sixteen_d16Plus : + HasAffineDifferenceOverlapCard + (rankSevenWeightSixteenPattern .d16Plus) 16 := by + exact (hasAffineDifferenceOverlapCard_pattern_iff_nat .d16Plus 16).2 + canonicalNatXorOverlapProfile.1 + +theorem not_hasAffineDifferenceOverlapCard_sixteen_twoE8 : + ¬HasAffineDifferenceOverlapCard + (rankSevenWeightSixteenPattern .twoE8) 16 := by + exact fun h ↦ canonicalNatXorOverlapProfile.2.1 + ((hasAffineDifferenceOverlapCard_pattern_iff_nat .twoE8 16).1 h) + +theorem not_hasAffineDifferenceOverlapCard_sixteen_f16 : + ¬HasAffineDifferenceOverlapCard + (rankSevenWeightSixteenPattern .f16) 16 := by + exact fun h ↦ canonicalNatXorOverlapProfile.2.2.1 + ((hasAffineDifferenceOverlapCard_pattern_iff_nat .f16 16).1 h) + +theorem hasAffineDifferenceOverlapCard_four_f16 : + HasAffineDifferenceOverlapCard + (rankSevenWeightSixteenPattern .f16) 4 := by + exact (hasAffineDifferenceOverlapCard_pattern_iff_nat .f16 4).2 + canonicalNatXorOverlapProfile.2.2.2.1 + +theorem not_hasAffineDifferenceOverlapCard_four_twoE8 : + ¬HasAffineDifferenceOverlapCard + (rankSevenWeightSixteenPattern .twoE8) 4 := by + exact fun h ↦ canonicalNatXorOverlapProfile.2.2.2.2 + ((hasAffineDifferenceOverlapCard_pattern_iff_nat .twoE8 4).1 h) + +/-- An ambient Boolean word belongs to at most one of the three injective +affine rank-seven pattern classes. -/ +theorem rankSevenWeightSixteenPatternClass_unique + {c e : RankSevenWeightSixteenPatternClass} + {h : BooleanFunction n} + (hc : IsRankSevenWeightSixteenPatternClass c h) + (he : IsRankSevenWeightSixteenPatternClass e h) : + c = e := by + rcases hc with ⟨d, hd, hwordD⟩ + rcases he with ⟨q, hq, hwordQ⟩ + have himage : rankSevenWeightSixteenPatternImage c d = + rankSevenWeightSixteenPatternImage e q := by + have hword : rankSevenWeightSixteenPatternWord c d = + rankSevenWeightSixteenPatternWord e q := hwordD.symm.trans hwordQ + have hsupport := congrArg support hword + simpa only [support_rankSevenWeightSixteenPatternWord] using hsupport + have hinvariant (k : ℕ) : + HasAffineDifferenceOverlapCard + (rankSevenWeightSixteenPattern c) k ↔ + HasAffineDifferenceOverlapCard + (rankSevenWeightSixteenPattern e) k := by + rw [← hasAffineDifferenceOverlapCard_patternImage_iff c d hd k, + himage, hasAffineDifferenceOverlapCard_patternImage_iff e q hq k] + cases c <;> cases e + · rfl + · exact False.elim + (not_hasAffineDifferenceOverlapCard_sixteen_twoE8 + ((hinvariant 16).2 + hasAffineDifferenceOverlapCard_sixteen_d16Plus)) + · exact False.elim + (not_hasAffineDifferenceOverlapCard_four_twoE8 + ((hinvariant 4).2 hasAffineDifferenceOverlapCard_four_f16)) + · exact False.elim + (not_hasAffineDifferenceOverlapCard_sixteen_twoE8 + ((hinvariant 16).1 + hasAffineDifferenceOverlapCard_sixteen_d16Plus)) + · rfl + · exact False.elim + (not_hasAffineDifferenceOverlapCard_sixteen_f16 + ((hinvariant 16).1 + hasAffineDifferenceOverlapCard_sixteen_d16Plus)) + · exact False.elim + (not_hasAffineDifferenceOverlapCard_four_twoE8 + ((hinvariant 4).1 hasAffineDifferenceOverlapCard_four_f16)) + · exact False.elim + (not_hasAffineDifferenceOverlapCard_sixteen_f16 + ((hinvariant 16).2 + hasAffineDifferenceOverlapCard_sixteen_d16Plus)) + · rfl + +end CryptBoolean diff --git a/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenOrbitPairwiseDisjoint.lean b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenOrbitPairwiseDisjoint.lean new file mode 100644 index 0000000..e43fab2 --- /dev/null +++ b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenOrbitPairwiseDisjoint.lean @@ -0,0 +1,55 @@ +/- +Copyright (c) 2026 Asher Yan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Asher Yan with Codex +-/ +module + +public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightSixteenOrbitAggregation +public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightSixteenOrbitDisjointness + +/-! +# Pairwise disjointness of the rank-seven weight-sixteen word orbits +-/ + +open Finset +open scoped BooleanCube + +@[expose] public section + +namespace CryptBoolean + +/-- The three finite affine word orbits are pairwise disjoint. -/ +theorem pairwiseDisjoint_rankSevenWeightSixteenPatternOrbitWords + (n : ℕ) : + Set.PairwiseDisjoint + (↑(Finset.univ : Finset RankSevenWeightSixteenPatternClass)) + (rankSevenWeightSixteenPatternOrbitWords n) := by + intro c _hc e _he hce + change Disjoint (rankSevenWeightSixteenPatternOrbitWords n c) + (rankSevenWeightSixteenPatternOrbitWords n e) + rw [Finset.disjoint_left] + intro h hhC hhE + rcases (mem_rankSevenWeightSixteenPatternOrbitWords_iff c h).1 hhC with + ⟨d, hd, hwordD⟩ + rcases (mem_rankSevenWeightSixteenPatternOrbitWords_iff e h).1 hhE with + ⟨q, hq, hwordQ⟩ + apply hce + exact rankSevenWeightSixteenPatternClass_unique + ⟨d, hd, hwordD.symm⟩ ⟨q, hq, hwordQ.symm⟩ + +/-- A certificate-producing rank-seven classifier discharges the complete +orbit classification: soundness and pairwise disjointness are proved by the +library. -/ +theorem hasRankSevenWeightSixteenOrbitClassification_of_certificate + {n : ℕ} + (hcertificate : ∀ h : BooleanFunction n, + h ∈ orderTwoWeightSixteenDualWords n → + HasSupportAffineSpanRankSeven h → + RankSevenWeightSixteenPatternCertificate h) : + HasRankSevenWeightSixteenOrbitClassification n := + hasRankSevenWeightSixteenOrbitClassification_of_certificate_and_disjointness + hcertificate + (pairwiseDisjoint_rankSevenWeightSixteenPatternOrbitWords n) + +end CryptBoolean diff --git a/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenOrbitSoundness.lean b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenOrbitSoundness.lean new file mode 100644 index 0000000..eeacefe --- /dev/null +++ b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenOrbitSoundness.lean @@ -0,0 +1,203 @@ +/- +Copyright (c) 2026 Asher Yan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Asher Yan with Codex +-/ +module + +public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightSixteenRankSevenPatterns +public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightSixteen +public import CryptBoolean.Carlet.Chapter04.AlgebraicImmunityBounds + +/-! +# Soundness of the rank-seven weight-sixteen pattern orbits + +The canonical seven-variable pattern indicators belong to `RM(4,7)`. +Orthogonality with affine pullbacks of ambient quadratic functions then shows +that every injective affine pattern image belongs to the ambient +codimension-three Reed--Muller code. +-/ + +open Finset +open scoped BigOperators BooleanCube + +@[expose] public section + +namespace CryptBoolean + +variable {n : ℕ} + +set_option maxRecDepth 100000 in +set_option maxHeartbeats 3000000 in +/-- Each canonical rank-seven pattern indicator has algebraic degree at most +four. -/ +theorem rankSevenWeightSixteenPatternIndicator_mem_reedMuller_four + (c : RankSevenWeightSixteenPatternClass) : + rankSevenWeightSixteenPatternIndicator c ∈ reedMuller 4 7 := by + cases c <;> rw [mem_reedMuller_iff] <;> decide + +/-- The affine map encoded by a translation and seven ambient directions. -/ +def sevenVariableAffineMap (d : SevenVariableAffineMapData n) : + FABL.F₂Cube 7 →ᵃ[FABL.𝔽₂] FABL.F₂Cube n where + toFun := sevenVariableAffinePoint d + linear := Fintype.linearCombination FABL.𝔽₂ d.2 + map_vadd' x v := by + change d.1 + ∑ i, (v i + x i) • d.2 i = + (∑ i, v i • d.2 i) + (d.1 + ∑ i, x i • d.2 i) + simp only [add_smul, Finset.sum_add_distrib] + abel + +@[simp] theorem sevenVariableAffineMap_apply + (d : SevenVariableAffineMapData n) (x : FABL.F₂Cube 7) : + sevenVariableAffineMap d x = sevenVariableAffinePoint d x := + rfl + +private theorem booleanFunctionPairing_patternWord_eq_patternIndicator + (q : BooleanFunction n) (c : RankSevenWeightSixteenPatternClass) + (d : SevenVariableAffineMapData n) + (hd : LinearIndependent FABL.𝔽₂ d.2) : + booleanFunctionPairing n q (rankSevenWeightSixteenPatternWord c d) = + booleanFunctionPairing 7 (q ∘ sevenVariableAffineMap d) + (rankSevenWeightSixteenPatternIndicator c) := by + classical + have hinjective : Function.Injective (sevenVariableAffinePoint d) := + (sevenVariableAffinePoint_injective_iff d).2 hd + simp only [booleanFunctionPairing_apply, + rankSevenWeightSixteenPatternWord, + rankSevenWeightSixteenPatternIndicator, Function.comp_apply, + sevenVariableAffineMap_apply] + simp only [mul_ite, mul_one, mul_zero] + change Finset.sum Finset.univ (fun x ↦ + if x ∈ rankSevenWeightSixteenPatternImage c d then q x else 0) = + Finset.sum Finset.univ (fun x ↦ + if x ∈ rankSevenWeightSixteenPattern c then + q (sevenVariableAffinePoint d x) else 0) + rw [← Finset.sum_filter, ← Finset.sum_filter, + Finset.filter_mem_eq_inter, Finset.filter_mem_eq_inter, + Finset.univ_inter, Finset.univ_inter] + unfold rankSevenWeightSixteenPatternImage + rw [Finset.sum_image hinjective.injOn] + +/-- Every injective affine image of a canonical rank-seven pattern is a +weight-sixteen word in the ambient dual Reed--Muller code. -/ +theorem rankSevenWeightSixteenPatternWord_mem_orderTwoWeightSixteenDualWords + (c : RankSevenWeightSixteenPatternClass) + (d : SevenVariableAffineMapData n) + (hd : LinearIndependent FABL.𝔽₂ d.2) : + rankSevenWeightSixteenPatternWord c d ∈ + orderTwoWeightSixteenDualWords n := by + have hn : 7 ≤ n := by + have hfinrank := hd.fintype_card_le_finrank + rw [Module.finrank_pi FABL.𝔽₂] at hfinrank + simpa only [Fintype.card_fin] using hfinrank + have hdual : rankSevenWeightSixteenPatternWord c d ∈ + reedMullerDual 2 n := by + rw [reedMullerDual, LinearMap.BilinForm.mem_orthogonal_iff] + intro q hq + have hqDegree : FABL.functionAlgebraicDegree q ≤ 2 := by + simpa only [mem_reedMuller_iff] using hq + have hpullbackDegree : FABL.functionAlgebraicDegree + (q ∘ sevenVariableAffineMap d) ≤ 2 := + (functionAlgebraicDegree_comp_affineMap_le_general q + (sevenVariableAffineMap d)).trans hqDegree + have hpullback : q ∘ sevenVariableAffineMap d ∈ reedMuller 2 7 := by + simpa only [mem_reedMuller_iff] using hpullbackDegree + have hindicatorDual : rankSevenWeightSixteenPatternIndicator c ∈ + reedMullerDual 2 7 := by + rw [reedMullerDual_eq (r := 2) (n := 7) (by omega)] + simpa only using + rankSevenWeightSixteenPatternIndicator_mem_reedMuller_four c + rw [booleanFunctionPairing_patternWord_eq_patternIndicator q c d hd] + exact hindicatorDual (q ∘ sevenVariableAffineMap d) hpullback + have hmem : rankSevenWeightSixteenPatternWord c d ∈ + reedMuller (n - 3) n := by + rw [reedMullerDual_eq (r := 2) (n := n) (by omega)] at hdual + simpa only [show n - 2 - 1 = n - 3 by omega] using hdual + simp only [orderTwoWeightSixteenDualWords, orderTwoDualWords, + Finset.mem_filter, Finset.mem_univ, true_and] + exact ⟨hmem, + hammingWeight_rankSevenWeightSixteenPatternWord_of_independent c d hd⟩ + +/-- The support-affine-span rank of an injective canonical pattern image is +exactly seven. -/ +theorem finrank_supportDifferenceSpan_rankSevenWeightSixteenPatternWord + (c : RankSevenWeightSixteenPatternClass) + (d : SevenVariableAffineMapData n) + (hd : LinearIndependent FABL.𝔽₂ d.2) : + Module.finrank FABL.𝔽₂ + (supportDifferenceSpan (rankSevenWeightSixteenPatternWord c d) d.1) = 7 := by + classical + let L : FABL.F₂Cube 7 →ₗ[FABL.𝔽₂] FABL.F₂Cube n := + (sevenVariableAffineMap d).linear + let b : Fin 7 → FABL.F₂Cube 7 := + rankSevenWeightSixteenPatternAffineBasis c + let w : Fin 7 → FABL.F₂Cube n := fun i ↦ L (b i) + have hpointInjective : Function.Injective (sevenVariableAffinePoint d) := + (sevenVariableAffinePoint_injective_iff d).2 hd + have hLInjective : Function.Injective L := by + intro x y hxy + apply hpointInjective + change d.1 + L x = d.1 + L y + rw [hxy] + have hbIndependent : LinearIndependent FABL.𝔽₂ b := by + exact linearIndependent_rankSevenWeightSixteenPatternAffineBasis c + have hwIndependent : LinearIndependent FABL.𝔽₂ w := by + exact hbIndependent.map' L (LinearMap.ker_eq_bot.mpr hLInjective) + have hp : d.1 ∈ support (rankSevenWeightSixteenPatternWord c d) := by + rw [support_rankSevenWeightSixteenPatternWord] + unfold rankSevenWeightSixteenPatternImage + exact Finset.mem_image.2 ⟨0, zero_mem_rankSevenWeightSixteenPattern c, by + simp [sevenVariableAffinePoint]⟩ + have hwMem (i : Fin 7) : + w i ∈ supportDifferenceSpan + (rankSevenWeightSixteenPatternWord c d) d.1 := by + rw [supportDifferenceSpan_eq_span_supportDifferences] + apply Submodule.subset_span + refine ⟨sevenVariableAffinePoint d (b i), ?_, ?_⟩ + · apply Finset.mem_erase.2 + constructor + · intro hpoint + have hzero : b i = 0 := by + apply hpointInjective + simpa [sevenVariableAffinePoint] using hpoint + exact (hbIndependent.ne_zero i) hzero + · rw [support_rankSevenWeightSixteenPatternWord] + unfold rankSevenWeightSixteenPatternImage + exact Finset.mem_image.2 + ⟨b i, rankSevenWeightSixteenPatternAffineBasis_mem c i, rfl⟩ + · change L (b i) = sevenVariableAffinePoint d (b i) + d.1 + change L (b i) = (d.1 + L (b i)) + d.1 + calc + L (b i) = (d.1 + d.1) + L (b i) := by + rw [ZModModule.add_self, zero_add] + _ = (d.1 + L (b i)) + d.1 := by abel + let ws : Fin 7 → + supportDifferenceSpan (rankSevenWeightSixteenPatternWord c d) d.1 := + fun i ↦ ⟨w i, hwMem i⟩ + have hwsIndependent : LinearIndependent FABL.𝔽₂ ws := by + apply LinearIndependent.of_comp + (supportDifferenceSpan + (rankSevenWeightSixteenPatternWord c d) d.1).subtype + change LinearIndependent FABL.𝔽₂ w + exact hwIndependent + have hlower : 7 ≤ Module.finrank FABL.𝔽₂ + (supportDifferenceSpan + (rankSevenWeightSixteenPatternWord c d) d.1) := by + simpa only [Fintype.card_fin] using hwsIndependent.fintype_card_le_finrank + have hn : 7 ≤ n := by + have hfinrank := hd.fintype_card_le_finrank + rw [Module.finrank_pi FABL.𝔽₂] at hfinrank + simpa only [Fintype.card_fin] using hfinrank + have hdual := + rankSevenWeightSixteenPatternWord_mem_orderTwoWeightSixteenDualWords c d hd + have hdualData : rankSevenWeightSixteenPatternWord c d ∈ + reedMuller (n - 3) n ∧ + hammingWeight (rankSevenWeightSixteenPatternWord c d) = 16 := by + simpa only [orderTwoWeightSixteenDualWords, orderTwoDualWords, + Finset.mem_filter, Finset.mem_univ, true_and] using hdual + have hupper := finrank_supportDifferenceSpan_le_seven_of_weight_sixteen + (rankSevenWeightSixteenPatternWord c d) d.1 hp (by omega) + hdualData.1 hdualData.2 + omega + +end CryptBoolean diff --git a/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenOrbitSums.lean b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenOrbitSums.lean new file mode 100644 index 0000000..6bc1bdc --- /dev/null +++ b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenOrbitSums.lean @@ -0,0 +1,244 @@ +/- +Copyright (c) 2026 Asher Yan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Asher Yan with Codex +-/ +module + +public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightSixteenAffineMaps +public import CryptBoolean.Carlet.Chapter02.FourierOperations + +/-! +# Rank-seven weight-sixteen orbit sums + +Complete affine-map character sums for the two indecomposable rank-seven +weight-sixteen support patterns. +-/ + +open Finset +open scoped BigOperators BooleanCube + +@[expose] public section + +namespace CryptBoolean + +variable {n : ℕ} + +/-- The multiplicative derivative of a real function on the binary cube. -/ +def orbitSignDerivative + (σ : FABL.F₂Cube n → ℝ) (a x : FABL.F₂Cube n) : ℝ := + σ x * σ (x + a) + +/-- The unnormalized fourfold additive convolution of a multiplicative +derivative. -/ +noncomputable def weightSixteenFourfoldConvolution + (σ : FABL.F₂Cube n → ℝ) (a b : FABL.F₂Cube n) : ℝ := + rawConvolution + (rawConvolution (orbitSignDerivative σ a) (orbitSignDerivative σ a)) + (rawConvolution (orbitSignDerivative σ a) (orbitSignDerivative σ a)) b + +/-- The complete affine-map character sum of the `D₁₆⁺` support +pattern, in its fourfold-convolution normal form. -/ +noncomputable def d16CanonicalCompleteAffineMapCharacterSum + (σ : FABL.F₂Cube n → ℝ) : ℝ := + ∑ a, ∑ b, weightSixteenFourfoldConvolution σ a b ^ 2 + +/-- The complete `D₁₆⁺` affine-map character sum is nonnegative. -/ +theorem d16CanonicalCompleteAffineMapCharacterSum_nonneg + (σ : FABL.F₂Cube n → ℝ) : + 0 ≤ d16CanonicalCompleteAffineMapCharacterSum σ := by + unfold d16CanonicalCompleteAffineMapCharacterSum + positivity + +/-- The complete affine-map character sum of the indecomposable Type-I +`F₁₆` support pattern, in its four-cycle normal form. -/ +noncomputable def f16CanonicalCompleteAffineMapCharacterSum + (σ : FABL.F₂Cube n → ℝ) : ℝ := + ∑ a, ∑ b, + weightSixteenFourfoldConvolution σ a b * + weightSixteenFourfoldConvolution σ b a + +/-- The raw Walsh transform of a multiplicative derivative. -/ +noncomputable def orbitDerivativeWalsh + (σ : FABL.F₂Cube n → ℝ) (a ξ : FABL.F₂Cube n) : ℝ := + rawFourierTransform (orbitSignDerivative σ a) ξ + +/-- The four-point block appearing in the `F₁₆` sum-of-squares +decomposition. -/ +def f16FourPointBlock + (σ : FABL.F₂Cube n → ℝ) + (a d e x : FABL.F₂Cube n) : ℝ := + σ x * σ (x + d) * σ (x + e) * σ (x + a + d + e) + +/-- The Walsh transform of the four-point `F₁₆` block. -/ +noncomputable def f16FourPointBlockWalsh + (σ : FABL.F₂Cube n → ℝ) + (a ξ d e : FABL.F₂Cube n) : ℝ := + rawFourierTransform (f16FourPointBlock σ a d e) ξ + +private theorem rawFourierTransform_weightSixteenFourfoldConvolution + (σ : FABL.F₂Cube n → ℝ) (a ξ : FABL.F₂Cube n) : + rawFourierTransform (weightSixteenFourfoldConvolution σ a) ξ = + orbitDerivativeWalsh σ a ξ ^ 4 := by + change rawFourierTransform + (rawConvolution + (rawConvolution (orbitSignDerivative σ a) (orbitSignDerivative σ a)) + (rawConvolution (orbitSignDerivative σ a) (orbitSignDerivative σ a))) ξ = _ + rw [rawFourierTransform_rawConvolution, + rawFourierTransform_rawConvolution] + unfold orbitDerivativeWalsh + ring + +private theorem weightSixteenFourfoldConvolution_eq_sum_rawConvolution_blocks + (σ : FABL.F₂Cube n → ℝ) (a b : FABL.F₂Cube n) : + weightSixteenFourfoldConvolution σ b a = + ∑ d, ∑ e, + rawConvolution (f16FourPointBlock σ a d e) + (f16FourPointBlock σ a d e) b := by + let reindex : + (FABL.F₂Cube n × FABL.F₂Cube n × FABL.F₂Cube n) ≃ + (FABL.F₂Cube n × FABL.F₂Cube n × FABL.F₂Cube n) := + { toFun := fun p ↦ (p.1, p.2.2 + p.2.1, p.2.2) + invFun := fun p ↦ (p.1, p.2.2 + p.2.1, p.2.2) + left_inv := by + rintro ⟨y, z, x⟩ + apply Prod.ext + · rfl + · apply Prod.ext + · simp only [← add_assoc, ZModModule.add_self, zero_add] + · rfl + right_inv := by + rintro ⟨d, e, t⟩ + apply Prod.ext + · rfl + · apply Prod.ext + · simp only [← add_assoc, ZModModule.add_self, zero_add] + · rfl } + change + rawConvolution + (rawConvolution (orbitSignDerivative σ b) (orbitSignDerivative σ b)) + (rawConvolution (orbitSignDerivative σ b) (orbitSignDerivative σ b)) a = _ + simp only [rawConvolution] + simp_rw [Finset.mul_sum, Finset.sum_mul] + calc + (∑ y, ∑ z, ∑ x, + orbitSignDerivative σ b x * orbitSignDerivative σ b (y + x) * + (orbitSignDerivative σ b z * + orbitSignDerivative σ b (a + y + z))) = + ∑ p : FABL.F₂Cube n × FABL.F₂Cube n × FABL.F₂Cube n, + orbitSignDerivative σ b p.2.2 * + orbitSignDerivative σ b (p.1 + p.2.2) * + (orbitSignDerivative σ b p.2.1 * + orbitSignDerivative σ b (a + p.1 + p.2.1)) := by + simp only [Fintype.sum_prod_type] + _ = ∑ p : FABL.F₂Cube n × FABL.F₂Cube n × FABL.F₂Cube n, + f16FourPointBlock σ a p.1 p.2.1 p.2.2 * + f16FourPointBlock σ a p.1 p.2.1 (p.2.2 + b) := by + apply Fintype.sum_equiv reindex + rintro ⟨y, z, x⟩ + rw [show reindex (y, z, x) = (y, x + z, x) by rfl] + simp only [orbitSignDerivative, f16FourPointBlock] + have hxy : x + y = y + x := add_comm _ _ + have hxxz : x + (x + z) = z := by + rw [← add_assoc, ZModModule.add_self, zero_add] + have haxyz : x + a + y + (x + z) = a + y + z := by + calc + x + a + y + (x + z) = (x + x) + (a + y + z) := by abel + _ = a + y + z := by rw [ZModModule.add_self, zero_add] + have hbxy : x + b + y = y + x + b := by abel + have hbxz : x + b + (x + z) = z + b := by + calc + x + b + (x + z) = (x + x) + (z + b) := by abel + _ = z + b := by rw [ZModModule.add_self, zero_add] + have hbaxyz : x + b + a + y + (x + z) = a + y + z + b := by + calc + x + b + a + y + (x + z) = (x + x) + (a + y + z + b) := by abel + _ = a + y + z + b := by rw [ZModModule.add_self, zero_add] + rw [hxy, hxxz, haxyz, hbxy, hbxz, hbaxyz] + ring + _ = ∑ d, ∑ e, ∑ x, + f16FourPointBlock σ a d e x * + f16FourPointBlock σ a d e (b + x) := by + simp only [Fintype.sum_prod_type, add_comm] + +private theorem rawFourierTransform_weightSixteenFourfoldConvolution_swapped + (σ : FABL.F₂Cube n → ℝ) (a ξ : FABL.F₂Cube n) : + rawFourierTransform (fun b ↦ weightSixteenFourfoldConvolution σ b a) ξ = + ∑ d, ∑ e, f16FourPointBlockWalsh σ a ξ d e ^ 2 := by + rw [show (fun b ↦ weightSixteenFourfoldConvolution σ b a) = + fun b ↦ ∑ d, ∑ e, + rawConvolution (f16FourPointBlock σ a d e) + (f16FourPointBlock σ a d e) b by + funext b + exact weightSixteenFourfoldConvolution_eq_sum_rawConvolution_blocks σ a b] + simp only [rawFourierTransform] + simp_rw [Finset.sum_mul] + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro d _ + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro e _ + rw [← rawFourierTransform] + rw [rawFourierTransform_rawConvolution] + simp [f16FourPointBlockWalsh, pow_two] + +/-- The complete `F₁₆` affine-map character sum has a division-free +Fourier sum-of-squares decomposition. -/ +theorem two_pow_mul_f16CanonicalCompleteAffineMapCharacterSum_eq_sum_sq + (σ : FABL.F₂Cube n → ℝ) : + (2 ^ n : ℝ) * f16CanonicalCompleteAffineMapCharacterSum σ = + ∑ a, ∑ ξ, ∑ d, ∑ e, + (orbitDerivativeWalsh σ a ξ ^ 2 * + f16FourPointBlockWalsh σ a ξ d e) ^ 2 := by + unfold f16CanonicalCompleteAffineMapCharacterSum + rw [Finset.mul_sum] + calc + (∑ a, (2 ^ n : ℝ) * ∑ b, + weightSixteenFourfoldConvolution σ a b * + weightSixteenFourfoldConvolution σ b a) = + ∑ a, ∑ ξ, + rawFourierTransform (weightSixteenFourfoldConvolution σ a) ξ * + rawFourierTransform + (fun b ↦ weightSixteenFourfoldConvolution σ b a) ξ := by + apply Finset.sum_congr rfl + intro a _ + exact (sum_rawFourierTransform_mul + (weightSixteenFourfoldConvolution σ a) + (fun b ↦ weightSixteenFourfoldConvolution σ b a)).symm + _ = ∑ a, ∑ ξ, + orbitDerivativeWalsh σ a ξ ^ 4 * + (∑ d, ∑ e, f16FourPointBlockWalsh σ a ξ d e ^ 2) := by + apply Finset.sum_congr rfl + intro a _ + apply Finset.sum_congr rfl + intro ξ _ + rw [rawFourierTransform_weightSixteenFourfoldConvolution, + rawFourierTransform_weightSixteenFourfoldConvolution_swapped] + _ = ∑ a, ∑ ξ, ∑ d, ∑ e, + (orbitDerivativeWalsh σ a ξ ^ 2 * + f16FourPointBlockWalsh σ a ξ d e) ^ 2 := by + apply Finset.sum_congr rfl + intro a _ + apply Finset.sum_congr rfl + intro ξ _ + rw [Finset.mul_sum] + apply Finset.sum_congr rfl + intro d _ + rw [Finset.mul_sum] + apply Finset.sum_congr rfl + intro e _ + ring + +/-- The complete `F₁₆` affine-map character sum is nonnegative. -/ +theorem f16CanonicalCompleteAffineMapCharacterSum_nonneg + (σ : FABL.F₂Cube n → ℝ) : + 0 ≤ f16CanonicalCompleteAffineMapCharacterSum σ := by + have hscaled : + 0 ≤ (2 ^ n : ℝ) * f16CanonicalCompleteAffineMapCharacterSum σ := by + rw [two_pow_mul_f16CanonicalCompleteAffineMapCharacterSum_eq_sum_sq] + positivity + have hpow : 0 < (2 ^ n : ℝ) := by positivity + nlinarith + +end CryptBoolean diff --git a/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenPatternOrbitSums.lean b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenPatternOrbitSums.lean new file mode 100644 index 0000000..3f5704a --- /dev/null +++ b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenPatternOrbitSums.lean @@ -0,0 +1,951 @@ +/- +Copyright (c) 2026 Asher Yan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Asher Yan with Codex +-/ +module + +public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightSixteenRankSevenPatterns +public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightSixteenOrbitSums + +/-! +# Canonical rank-seven pattern orbit sums + +The complete affine-map character sums of the three projective self-dual +length-sixteen support patterns, reduced to explicit nonnegative normal forms. +-/ + +open Finset +open scoped BigOperators BooleanCube + +@[expose] public section + +namespace CryptBoolean + +variable {n : ℕ} + +/-- The character product obtained by mapping a canonical rank-seven pattern +into an ambient binary cube. -/ +noncomputable def rankSevenWeightSixteenPatternAffineProduct + (σ : FABL.F₂Cube n → ℝ) + (c : RankSevenWeightSixteenPatternClass) + (d : SevenVariableAffineMapData n) : ℝ := + ∏ x ∈ rankSevenWeightSixteenPattern c, + σ (sevenVariableAffinePoint d x) + +/-- The complete affine-map character sum of a canonical rank-seven pattern. -/ +noncomputable def rankSevenWeightSixteenPatternCompleteAffineMapCharacterSum + (σ : FABL.F₂Cube n → ℝ) + (c : RankSevenWeightSixteenPatternClass) : ℝ := + ∑ d : SevenVariableAffineMapData n, + rankSevenWeightSixteenPatternAffineProduct σ c d + +/-- The product of a real function on a parametrized affine binary cube. -/ +noncomputable def affineCubeProduct + (σ : FABL.F₂Cube n → ℝ) {k : ℕ} + (u : FABL.F₂Cube n) (v : Fin k → FABL.F₂Cube n) : ℝ := + ∏ x : FABL.F₂Cube k, σ (u + ∑ i, x i • v i) + +/-- Affine-map data for a three-dimensional binary cube. -/ +abbrev ThreeVariableAffineMapData (n : ℕ) := + FABL.F₂Cube n × (Fin 3 → FABL.F₂Cube n) + +/-- The complete affine-map product sum of a three-dimensional cube. -/ +noncomputable def threeVariableCompleteAffineMapProductSum + (σ : FABL.F₂Cube n → ℝ) : ℝ := + ∑ d : ThreeVariableAffineMapData n, affineCubeProduct σ d.1 d.2 + +/-- The `2E₈` complete affine-map character sum in square normal form. -/ +noncomputable def twoE8CanonicalCompleteAffineMapCharacterSum + (σ : FABL.F₂Cube n → ℝ) : ℝ := + threeVariableCompleteAffineMapProductSum σ ^ 2 + +/-- The `2E₈` square normal form is nonnegative. -/ +theorem twoE8CanonicalCompleteAffineMapCharacterSum_nonneg + (σ : FABL.F₂Cube n → ℝ) : + 0 ≤ twoE8CanonicalCompleteAffineMapCharacterSum σ := by + unfold twoE8CanonicalCompleteAffineMapCharacterSum + positivity + +private def twoE8FirstDirections + (d : SevenVariableAffineMapData n) : Fin 3 → FABL.F₂Cube n := + ![d.2 0, d.2 1, d.2 2] + +private def twoE8SecondDirections + (d : SevenVariableAffineMapData n) : Fin 3 → FABL.F₂Cube n := + ![d.2 3, d.2 4, d.2 5] + +private def twoE8PatternPoint + (p : Fin 2 × FABL.F₂Cube 3) : FABL.F₂Cube 7 := + if p.1 = 0 then + ![p.2 0, p.2 1, p.2 2, 0, 0, 0, 0] + else + ![0, 0, 0, p.2 0, p.2 1, p.2 2, 1] + +private theorem image_twoE8PatternPoint : + Finset.univ.image twoE8PatternPoint = + rankSevenWeightSixteenPattern .twoE8 := by + decide + +private theorem injective_twoE8PatternPoint : + Function.Injective twoE8PatternPoint := by + decide + +private theorem sevenVariableAffinePoint_twoE8_first + (d : SevenVariableAffineMapData n) (x : FABL.F₂Cube 3) : + sevenVariableAffinePoint d (twoE8PatternPoint (0, x)) = + d.1 + ∑ i, x i • twoE8FirstDirections d i := by + simp [sevenVariableAffinePoint, twoE8PatternPoint, + twoE8FirstDirections, Fin.sum_univ_succ] + +private theorem sevenVariableAffinePoint_twoE8_second + (d : SevenVariableAffineMapData n) (x : FABL.F₂Cube 3) : + sevenVariableAffinePoint d (twoE8PatternPoint (1, x)) = + (d.1 + d.2 6) + ∑ i, x i • twoE8SecondDirections d i := by + simp [sevenVariableAffinePoint, twoE8PatternPoint, + twoE8SecondDirections, Fin.sum_univ_succ] + abel + +private theorem rankSevenWeightSixteenPatternAffineProduct_twoE8 + (σ : FABL.F₂Cube n → ℝ) (d : SevenVariableAffineMapData n) : + rankSevenWeightSixteenPatternAffineProduct σ .twoE8 d = + affineCubeProduct σ d.1 (twoE8FirstDirections d) * + affineCubeProduct σ (d.1 + d.2 6) (twoE8SecondDirections d) := by + unfold rankSevenWeightSixteenPatternAffineProduct + rw [← image_twoE8PatternPoint, + Finset.prod_image injective_twoE8PatternPoint.injOn] + rw [Fintype.prod_prod_type] + rw [show (Finset.univ : Finset (Fin 2)) = {0, 1} by decide] + simp only [Finset.prod_insert, Finset.mem_singleton, Fin.zero_ne_one, + not_false_eq_true, Finset.prod_singleton] + simp_rw [sevenVariableAffinePoint_twoE8_first, + sevenVariableAffinePoint_twoE8_second] + rfl + +private def twoE8AffineDataEquiv (n : ℕ) : + SevenVariableAffineMapData n ≃ + ThreeVariableAffineMapData n × ThreeVariableAffineMapData n where + toFun d := + ((d.1, twoE8FirstDirections d), + (d.1 + d.2 6, twoE8SecondDirections d)) + invFun p := + (p.1.1, + ![p.1.2 0, p.1.2 1, p.1.2 2, + p.2.2 0, p.2.2 1, p.2.2 2, p.1.1 + p.2.1]) + left_inv := by + rintro ⟨u, v⟩ + apply Prod.ext + · rfl + · funext i + fin_cases i <;> + simp [twoE8FirstDirections, twoE8SecondDirections, + ← add_assoc, ZModModule.add_self] + right_inv := by + rintro ⟨⟨u, v⟩, ⟨w, z⟩⟩ + apply Prod.ext + · apply Prod.ext + · rfl + · funext i + fin_cases i <;> simp [twoE8FirstDirections] + · apply Prod.ext + · simp [← add_assoc, ZModModule.add_self] + · funext i + fin_cases i <;> simp [twoE8SecondDirections] + +/-- The canonical `2E₈` pattern sum is the square of the complete +three-flat affine-map product sum. -/ +theorem rankSevenWeightSixteenPatternCompleteAffineMapCharacterSum_twoE8 + (σ : FABL.F₂Cube n → ℝ) : + rankSevenWeightSixteenPatternCompleteAffineMapCharacterSum σ .twoE8 = + twoE8CanonicalCompleteAffineMapCharacterSum σ := by + unfold rankSevenWeightSixteenPatternCompleteAffineMapCharacterSum + rw [Fintype.sum_equiv (twoE8AffineDataEquiv n) + (fun d ↦ rankSevenWeightSixteenPatternAffineProduct σ .twoE8 d) + (fun p ↦ affineCubeProduct σ p.1.1 p.1.2 * + affineCubeProduct σ p.2.1 p.2.2)] + · rw [Fintype.sum_prod_type] + unfold twoE8CanonicalCompleteAffineMapCharacterSum + unfold threeVariableCompleteAffineMapProductSum + rw [pow_two, Finset.sum_mul] + apply Finset.sum_congr rfl + intro d _ + rw [Finset.mul_sum] + · intro d + exact rankSevenWeightSixteenPatternAffineProduct_twoE8 σ d + +/-- The complete affine-map character sum of the canonical `2E₈` pattern +is nonnegative. -/ +theorem rankSevenWeightSixteenPatternCompleteAffineMapCharacterSum_twoE8_nonneg + (σ : FABL.F₂Cube n → ℝ) : + 0 ≤ rankSevenWeightSixteenPatternCompleteAffineMapCharacterSum σ .twoE8 := by + rw [rankSevenWeightSixteenPatternCompleteAffineMapCharacterSum_twoE8] + exact twoE8CanonicalCompleteAffineMapCharacterSum_nonneg σ + +private def d16DirectionSum + (d : SevenVariableAffineMapData n) : FABL.F₂Cube n := + ∑ i, d.2 i + +private def d16FirstSixDirections + (d : SevenVariableAffineMapData n) : Fin 6 → FABL.F₂Cube n := + ![d.2 0, d.2 1, d.2 2, d.2 3, d.2 4, d.2 5] + +private def d16AffineBasisPoint (i : Fin 8) : FABL.F₂Cube 7 := + Fin.cases 0 (fun j ↦ Pi.single j 1) i + +private def d16PatternPoint + (p : Fin 2 × Fin 8) : FABL.F₂Cube 7 := + if p.1 = 0 then d16AffineBasisPoint p.2 + else 1 + d16AffineBasisPoint p.2 + +private theorem image_d16PatternPoint : + Finset.univ.image d16PatternPoint = + rankSevenWeightSixteenPattern .d16Plus := by + decide + +private theorem injective_d16PatternPoint : + Function.Injective d16PatternPoint := by + decide + +private theorem sevenVariableAffinePoint_add_one + (d : SevenVariableAffineMapData n) (x : FABL.F₂Cube 7) : + sevenVariableAffinePoint d (1 + x) = + sevenVariableAffinePoint d x + d16DirectionSum d := by + simp only [sevenVariableAffinePoint, d16DirectionSum, Pi.add_apply, + Pi.one_apply, add_smul, one_smul, Finset.sum_add_distrib] + abel + +private theorem sevenVariableAffinePoint_d16AffineBasisPoint + (d : SevenVariableAffineMapData n) (i : Fin 8) : + sevenVariableAffinePoint d (d16AffineBasisPoint i) = + Fin.cases d.1 (fun j ↦ d.1 + d.2 j) i := by + refine Fin.cases ?_ (fun j ↦ ?_) i + · simp [sevenVariableAffinePoint, d16AffineBasisPoint] + · simp [sevenVariableAffinePoint, d16AffineBasisPoint] + +private theorem orbitSignDerivative_add_right_self + (σ : FABL.F₂Cube n → ℝ) (a x : FABL.F₂Cube n) : + orbitSignDerivative σ a (x + a) = orbitSignDerivative σ a x := by + unfold orbitSignDerivative + rw [add_assoc, ZModModule.add_self, add_zero] + ring + +private theorem rankSevenWeightSixteenPatternAffineProduct_d16 + (σ : FABL.F₂Cube n → ℝ) (d : SevenVariableAffineMapData n) : + rankSevenWeightSixteenPatternAffineProduct σ .d16Plus d = + orbitSignDerivative σ (d16DirectionSum d) d.1 * + ∏ i, orbitSignDerivative σ (d16DirectionSum d) (d.1 + d.2 i) := by + unfold rankSevenWeightSixteenPatternAffineProduct + rw [← image_d16PatternPoint, + Finset.prod_image injective_d16PatternPoint.injOn] + rw [Fintype.prod_prod_type] + rw [show (Finset.univ : Finset (Fin 2)) = {0, 1} by decide] + simp only [Finset.prod_insert, Finset.mem_singleton, Fin.zero_ne_one, + not_false_eq_true, Finset.prod_singleton] + simp only [d16PatternPoint, show (1 : Fin 2) ≠ 0 by decide, + ↓reduceIte] + simp_rw [sevenVariableAffinePoint_add_one, + sevenVariableAffinePoint_d16AffineBasisPoint] + rw [show + (∏ x : Fin 8, σ (Fin.cases d.1 (fun j ↦ d.1 + d.2 j) x)) = + σ d.1 * ∏ i : Fin 7, σ (d.1 + d.2 i) by + rw [Fin.prod_univ_succ] + rfl] + rw [show + (∏ x : Fin 8, + σ (Fin.cases d.1 (fun j ↦ d.1 + d.2 j) x + + d16DirectionSum d)) = + σ (d.1 + d16DirectionSum d) * + ∏ i : Fin 7, σ (d.1 + d.2 i + d16DirectionSum d) by + rw [Fin.prod_univ_succ] + rfl] + unfold orbitSignDerivative + simp_rw [show ∀ i : Fin 7, + d.1 + d.2 i + d16DirectionSum d = + d.1 + d16DirectionSum d + d.2 i by + intro i + abel] + rw [Finset.prod_mul_distrib] + ring + +private abbrev D16ReducedAffineMapData (n : ℕ) := + FABL.F₂Cube n × FABL.F₂Cube n × (Fin 6 → FABL.F₂Cube n) + +private def d16ReducedAffineMapDataEquiv (n : ℕ) : + SevenVariableAffineMapData n ≃ D16ReducedAffineMapData n where + toFun d := (d16DirectionSum d, d.1, d16FirstSixDirections d) + invFun p := + (p.2.1, + ![p.2.2 0, p.2.2 1, p.2.2 2, p.2.2 3, p.2.2 4, p.2.2 5, + p.1 - ∑ i, p.2.2 i]) + left_inv := by + rintro ⟨u, v⟩ + apply Prod.ext + · rfl + · funext i + fin_cases i <;> + simp [d16DirectionSum, d16FirstSixDirections, Fin.sum_univ_succ] + right_inv := by + rintro ⟨s, u, w⟩ + apply Prod.ext + · simp [d16DirectionSum, Fin.sum_univ_succ] + abel + · apply Prod.ext + · rfl + · funext i + fin_cases i <;> simp [d16FirstSixDirections] + +private noncomputable def d16ReducedFiberCharacterSum + (σ : FABL.F₂Cube n → ℝ) (s : FABL.F₂Cube n) : ℝ := + ∑ u : FABL.F₂Cube n, + ∑ w : Fin 6 → FABL.F₂Cube n, + orbitSignDerivative σ s u * + (∏ i, orbitSignDerivative σ s (u + w i)) * + orbitSignDerivative σ s (u + ∑ i, w i) + +private noncomputable def d16ReducedCompleteAffineMapCharacterSum + (σ : FABL.F₂Cube n → ℝ) : ℝ := + ∑ s, d16ReducedFiberCharacterSum σ s + +private theorem rankSevenWeightSixteenPatternCompleteAffineMapCharacterSum_d16_reduced + (σ : FABL.F₂Cube n → ℝ) : + rankSevenWeightSixteenPatternCompleteAffineMapCharacterSum σ .d16Plus = + d16ReducedCompleteAffineMapCharacterSum σ := by + unfold rankSevenWeightSixteenPatternCompleteAffineMapCharacterSum + rw [Fintype.sum_equiv (d16ReducedAffineMapDataEquiv n) + (fun d ↦ rankSevenWeightSixteenPatternAffineProduct σ .d16Plus d) + (fun p ↦ + orbitSignDerivative σ p.1 p.2.1 * + (∏ i, orbitSignDerivative σ p.1 (p.2.1 + p.2.2 i)) * + orbitSignDerivative σ p.1 (p.2.1 + ∑ i, p.2.2 i))] + · simp only [Fintype.sum_prod_type] + unfold d16ReducedCompleteAffineMapCharacterSum + d16ReducedFiberCharacterSum + rfl + · rintro ⟨u, v⟩ + rw [rankSevenWeightSixteenPatternAffineProduct_d16] + simp only [d16ReducedAffineMapDataEquiv, d16FirstSixDirections, + d16DirectionSum] + rw [Fin.prod_univ_seven, Fin.prod_univ_six, Fin.sum_univ_six] + have hlast : + orbitSignDerivative σ (∑ i, v i) + (u + v 6) = + orbitSignDerivative σ (∑ i, v i) + (u + (v 0 + v 1 + v 2 + v 3 + v 4 + v 5)) := by + have hv6 : v 6 = (∑ i, v i) + + (v 0 + v 1 + v 2 + v 3 + v 4 + v 5) := by + rw [Fin.sum_univ_seven] + let t := v 0 + v 1 + v 2 + v 3 + v 4 + v 5 + change v 6 = (t + v 6) + t + calc + v 6 = (t + t) + v 6 := by + rw [ZModModule.add_self, zero_add] + _ = (t + v 6) + t := by abel + rw [hv6] + convert orbitSignDerivative_add_right_self σ (∑ i, v i) + (u + (v 0 + v 1 + v 2 + v 3 + v 4 + v 5)) using 1 + abel + rw [hlast] + ac_rfl + +private def finThreeArrowEquiv (G : Type*) : + (Fin 3 → G) ≃ G × G × G where + toFun q := (q 0, q 1, q 2) + invFun p := ![p.1, p.2.1, p.2.2] + left_inv := by + intro q + funext i + fin_cases i <;> rfl + right_inv := by + rintro ⟨x, y, z⟩ + rfl + +private def d16FourfoldProduct + (σ : FABL.F₂Cube n → ℝ) + (s b : FABL.F₂Cube n) (q : Fin 3 → FABL.F₂Cube n) : ℝ := + orbitSignDerivative σ s (q 2) * + orbitSignDerivative σ s (q 0 + q 2) * + (orbitSignDerivative σ s (q 1) * + orbitSignDerivative σ s (b + q 0 + q 1)) + +private theorem weightSixteenFourfoldConvolution_eq_sum_d16FourfoldProduct + (σ : FABL.F₂Cube n → ℝ) (s b : FABL.F₂Cube n) : + weightSixteenFourfoldConvolution σ s b = + ∑ q : Fin 3 → FABL.F₂Cube n, d16FourfoldProduct σ s b q := by + change + rawConvolution + (rawConvolution (orbitSignDerivative σ s) (orbitSignDerivative σ s)) + (rawConvolution (orbitSignDerivative σ s) (orbitSignDerivative σ s)) b = _ + simp only [rawConvolution] + simp_rw [Finset.mul_sum, Finset.sum_mul] + rw [Fintype.sum_equiv (finThreeArrowEquiv (FABL.F₂Cube n)) + (fun q ↦ d16FourfoldProduct σ s b q) + (fun p ↦ + orbitSignDerivative σ s p.2.2 * + orbitSignDerivative σ s (p.1 + p.2.2) * + (orbitSignDerivative σ s p.2.1 * + orbitSignDerivative σ s (b + p.1 + p.2.1)))] + · simp only [Fintype.sum_prod_type] + · intro q + rfl + +private abbrev D16ReducedFiberData (n : ℕ) := + FABL.F₂Cube n × (Fin 6 → FABL.F₂Cube n) + +private abbrev D16ConvolutionFiberData (n : ℕ) := + FABL.F₂Cube n × + ((Fin 3 → FABL.F₂Cube n) × (Fin 3 → FABL.F₂Cube n)) + +private def d16ReducedConvolutionFiberEquiv (n : ℕ) : + D16ReducedFiberData n ≃ D16ConvolutionFiberData n where + toFun p := + (p.2 0 + p.2 1 + p.2 2, + (![p.2 0, p.1 + p.2 1, p.1], + ![p.2 3 + p.2 4, p.1 + p.2 5, p.1 + p.2 3])) + invFun p := + (p.2.1 2, + ![p.2.1 0, + p.2.1 1 - p.2.1 2, + p.1 - p.2.1 0 - (p.2.1 1 - p.2.1 2), + p.2.2 2 - p.2.1 2, + p.2.2 0 - (p.2.2 2 - p.2.1 2), + p.2.2 1 - p.2.1 2]) + left_inv := by + rintro ⟨u, w⟩ + apply Prod.ext + · rfl + · funext i + fin_cases i <;> simp + all_goals abel + right_inv := by + rintro ⟨b, q, r⟩ + apply Prod.ext + · simp + · apply Prod.ext + · funext i + fin_cases i <;> simp + · funext i + fin_cases i <;> simp + +private noncomputable def d16ReducedFiberIntegrand + (σ : FABL.F₂Cube n → ℝ) (s : FABL.F₂Cube n) + (p : D16ReducedFiberData n) : ℝ := + orbitSignDerivative σ s p.1 * + (∏ i, orbitSignDerivative σ s (p.1 + p.2 i)) * + orbitSignDerivative σ s (p.1 + ∑ i, p.2 i) + +private def d16ConvolutionFiberIntegrand + (σ : FABL.F₂Cube n → ℝ) (s : FABL.F₂Cube n) + (p : D16ConvolutionFiberData n) : ℝ := + d16FourfoldProduct σ s p.1 p.2.1 * + d16FourfoldProduct σ s p.1 p.2.2 + +private theorem d16ReducedConvolutionFiberEquiv_integrand + (σ : FABL.F₂Cube n → ℝ) (s : FABL.F₂Cube n) + (p : D16ReducedFiberData n) : + d16ReducedFiberIntegrand σ s p = + d16ConvolutionFiberIntegrand σ s + (d16ReducedConvolutionFiberEquiv n p) := by + rcases p with ⟨u, w⟩ + unfold d16ReducedFiberIntegrand d16ConvolutionFiberIntegrand + rw [Fin.prod_univ_six, Fin.sum_univ_six] + have hq0 : w 0 + u = u + w 0 := add_comm _ _ + have hq3 : w 0 + w 1 + w 2 + w 0 + (u + w 1) = u + w 2 := by + calc + w 0 + w 1 + w 2 + w 0 + (u + w 1) = + (w 0 + w 0) + (w 1 + w 1) + (u + w 2) := by abel + _ = u + w 2 := by simp only [ZModModule.add_self, zero_add] + have hr1 : w 3 + w 4 + (u + w 3) = u + w 4 := by + calc + w 3 + w 4 + (u + w 3) = (w 3 + w 3) + (u + w 4) := by abel + _ = u + w 4 := by simp only [ZModModule.add_self, zero_add] + have hr3 : + w 0 + w 1 + w 2 + (w 3 + w 4) + (u + w 5) = + u + (w 0 + w 1 + w 2 + w 3 + w 4 + w 5) := by abel + change + orbitSignDerivative σ s u * + (orbitSignDerivative σ s (u + w 0) * + orbitSignDerivative σ s (u + w 1) * + orbitSignDerivative σ s (u + w 2) * + orbitSignDerivative σ s (u + w 3) * + orbitSignDerivative σ s (u + w 4) * + orbitSignDerivative σ s (u + w 5)) * + orbitSignDerivative σ s + (u + (w 0 + w 1 + w 2 + w 3 + w 4 + w 5)) = + d16FourfoldProduct σ s (w 0 + w 1 + w 2) + ![w 0, u + w 1, u] * + d16FourfoldProduct σ s (w 0 + w 1 + w 2) + ![w 3 + w 4, u + w 5, u + w 3] + simp only [d16FourfoldProduct, Matrix.cons_val_zero, + Matrix.cons_val_one, Matrix.cons_val_two, Matrix.tail_cons, + Matrix.head_cons] + rw [hq0, hq3, hr1, hr3] + ring + +private noncomputable def d16ConvolutionPairCharacterSum + (σ : FABL.F₂Cube n → ℝ) (s : FABL.F₂Cube n) : ℝ := + ∑ b : FABL.F₂Cube n, + ∑ q : Fin 3 → FABL.F₂Cube n, + ∑ r : Fin 3 → FABL.F₂Cube n, + d16FourfoldProduct σ s b q * d16FourfoldProduct σ s b r + +private theorem d16ReducedConvolutionFiberSum_eq + (σ : FABL.F₂Cube n → ℝ) (s : FABL.F₂Cube n) : + (∑ p : D16ReducedFiberData n, d16ReducedFiberIntegrand σ s p) = + ∑ p : D16ConvolutionFiberData n, + d16ConvolutionFiberIntegrand σ s p := by + calc + (∑ p : D16ReducedFiberData n, d16ReducedFiberIntegrand σ s p) = + ∑ p : D16ReducedFiberData n, + d16ConvolutionFiberIntegrand σ s + (d16ReducedConvolutionFiberEquiv n p) := by + apply Finset.sum_congr rfl + intro p _ + exact d16ReducedConvolutionFiberEquiv_integrand σ s p + _ = ∑ p : D16ConvolutionFiberData n, + d16ConvolutionFiberIntegrand σ s p := + (d16ReducedConvolutionFiberEquiv n).sum_comp _ + +private theorem d16ReducedFiberCharacterSum_eq_convolutionPair + (σ : FABL.F₂Cube n → ℝ) (s : FABL.F₂Cube n) : + d16ReducedFiberCharacterSum σ s = + d16ConvolutionPairCharacterSum σ s := by + unfold d16ReducedFiberCharacterSum d16ConvolutionPairCharacterSum + calc + (∑ u : FABL.F₂Cube n, + ∑ w : Fin 6 → FABL.F₂Cube n, + orbitSignDerivative σ s u * + (∏ i, orbitSignDerivative σ s (u + w i)) * + orbitSignDerivative σ s (u + ∑ i, w i)) = + ∑ p : D16ReducedFiberData n, + d16ReducedFiberIntegrand σ s p := by + rw [Fintype.sum_prod_type] + unfold d16ReducedFiberIntegrand + rfl + _ = ∑ p : D16ConvolutionFiberData n, + d16ConvolutionFiberIntegrand σ s p := + d16ReducedConvolutionFiberSum_eq σ s + _ = ∑ b : FABL.F₂Cube n, + ∑ q : Fin 3 → FABL.F₂Cube n, + ∑ r : Fin 3 → FABL.F₂Cube n, + d16FourfoldProduct σ s b q * + d16FourfoldProduct σ s b r := by + unfold d16ConvolutionFiberIntegrand + simp only [Fintype.sum_prod_type] + +private theorem d16ConvolutionPairCharacterSum_eq_squareSum + (σ : FABL.F₂Cube n → ℝ) (s : FABL.F₂Cube n) : + d16ConvolutionPairCharacterSum σ s = + ∑ b, weightSixteenFourfoldConvolution σ s b ^ 2 := by + unfold d16ConvolutionPairCharacterSum + apply Finset.sum_congr rfl + intro b _ + rw [weightSixteenFourfoldConvolution_eq_sum_d16FourfoldProduct] + rw [pow_two, Finset.sum_mul] + apply Finset.sum_congr rfl + intro q _ + rw [Finset.mul_sum] + +private theorem d16ReducedCompleteAffineMapCharacterSum_eq_canonical + (σ : FABL.F₂Cube n → ℝ) : + d16ReducedCompleteAffineMapCharacterSum σ = + d16CanonicalCompleteAffineMapCharacterSum σ := by + unfold d16ReducedCompleteAffineMapCharacterSum + unfold d16CanonicalCompleteAffineMapCharacterSum + apply Finset.sum_congr rfl + intro s _ + rw [d16ReducedFiberCharacterSum_eq_convolutionPair, + d16ConvolutionPairCharacterSum_eq_squareSum] + +/-- The complete affine-map character sum of the canonical `D₁₆⁺` pattern +is the fourfold-convolution square normal form. -/ +theorem rankSevenWeightSixteenPatternCompleteAffineMapCharacterSum_d16Plus + (σ : FABL.F₂Cube n → ℝ) : + rankSevenWeightSixteenPatternCompleteAffineMapCharacterSum σ .d16Plus = + d16CanonicalCompleteAffineMapCharacterSum σ := by + rw [rankSevenWeightSixteenPatternCompleteAffineMapCharacterSum_d16_reduced, + d16ReducedCompleteAffineMapCharacterSum_eq_canonical] + +/-- The complete affine-map character sum of the canonical `D₁₆⁺` pattern +is nonnegative. -/ +theorem rankSevenWeightSixteenPatternCompleteAffineMapCharacterSum_d16Plus_nonneg + (σ : FABL.F₂Cube n → ℝ) : + 0 ≤ rankSevenWeightSixteenPatternCompleteAffineMapCharacterSum σ .d16Plus := by + rw [rankSevenWeightSixteenPatternCompleteAffineMapCharacterSum_d16Plus] + exact d16CanonicalCompleteAffineMapCharacterSum_nonneg σ + +private def f16AffineBasisA : Fin 4 → FABL.F₂Cube 7 := + ![f₂CubeOfNat 7 0, f₂CubeOfNat 7 2, + f₂CubeOfNat 7 4, f₂CubeOfNat 7 17] + +private def f16AffineBasisB : Fin 4 → FABL.F₂Cube 7 := + ![f₂CubeOfNat 7 8, f₂CubeOfNat 7 32, + f₂CubeOfNat 7 64, f₂CubeOfNat 7 105] + +private def f16PatternPoint + (p : Fin 4 × Fin 4) : FABL.F₂Cube 7 := + ![f16AffineBasisA p.1, + f16AffineBasisB p.1, + f16AffineBasisA p.1 + ∑ j, f16AffineBasisB j, + f16AffineBasisB p.1 + ∑ j, f16AffineBasisA j] p.2 + +private theorem image_f16PatternPoint : + Finset.univ.image f16PatternPoint = + rankSevenWeightSixteenPattern .f16 := by + decide + +private theorem injective_f16PatternPoint : + Function.Injective f16PatternPoint := by + decide + +private def f16AffineBasisCoordinates + (d : SevenVariableAffineMapData n) : + (Fin 4 → FABL.F₂Cube n) × (Fin 4 → FABL.F₂Cube n) := + ((fun i ↦ sevenVariableAffinePoint d (f16AffineBasisA i)), + fun i ↦ sevenVariableAffinePoint d (f16AffineBasisB i)) + +private theorem sevenVariableAffinePoint_add_sum_four + (d : SevenVariableAffineMapData n) (x : FABL.F₂Cube 7) + (y : Fin 4 → FABL.F₂Cube 7) : + sevenVariableAffinePoint d (x + ∑ i, y i) = + sevenVariableAffinePoint d x + + ∑ i, sevenVariableAffinePoint d (y i) := by + let L := Fintype.linearCombination FABL.𝔽₂ d.2 + change d.1 + L (x + ∑ i, y i) = + (d.1 + L x) + ∑ i, (d.1 + L (y i)) + rw [map_add, map_sum] + simp_rw [Fin.sum_univ_four] + have hfour : d.1 + d.1 + d.1 + d.1 = 0 := by + calc + d.1 + d.1 + d.1 + d.1 = + (d.1 + d.1) + (d.1 + d.1) := by abel + _ = 0 := by + simp only [ZModModule.add_self] + calc + d.1 + (L x + (L (y 0) + L (y 1) + L (y 2) + L (y 3))) = + (d.1 + d.1 + d.1 + d.1) + + (d.1 + L x + L (y 0) + L (y 1) + L (y 2) + L (y 3)) := by + rw [hfour, zero_add] + abel + _ = (d.1 + L x) + + ((d.1 + L (y 0)) + (d.1 + L (y 1)) + + (d.1 + L (y 2)) + (d.1 + L (y 3))) := by + abel + +private theorem sevenVariableAffinePoint_f16_aCycle + (d : SevenVariableAffineMapData n) (i : Fin 4) : + sevenVariableAffinePoint d + (f16AffineBasisA i + ∑ j, f16AffineBasisB j) = + (f16AffineBasisCoordinates d).1 i + + ∑ j, (f16AffineBasisCoordinates d).2 j := by + simpa only [f16AffineBasisCoordinates] using + sevenVariableAffinePoint_add_sum_four d (f16AffineBasisA i) + f16AffineBasisB + +private theorem sevenVariableAffinePoint_f16_bCycle + (d : SevenVariableAffineMapData n) (i : Fin 4) : + sevenVariableAffinePoint d + (f16AffineBasisB i + ∑ j, f16AffineBasisA j) = + (f16AffineBasisCoordinates d).2 i + + ∑ j, (f16AffineBasisCoordinates d).1 j := by + simpa only [f16AffineBasisCoordinates] using + sevenVariableAffinePoint_add_sum_four d (f16AffineBasisB i) + f16AffineBasisA + +private theorem rankSevenWeightSixteenPatternAffineProduct_f16 + (σ : FABL.F₂Cube n → ℝ) (d : SevenVariableAffineMapData n) : + rankSevenWeightSixteenPatternAffineProduct σ .f16 d = + ∏ i, + σ ((f16AffineBasisCoordinates d).1 i) * + σ ((f16AffineBasisCoordinates d).2 i) * + σ ((f16AffineBasisCoordinates d).1 i + + ∑ j, (f16AffineBasisCoordinates d).2 j) * + σ ((f16AffineBasisCoordinates d).2 i + + ∑ j, (f16AffineBasisCoordinates d).1 j) := by + unfold rankSevenWeightSixteenPatternAffineProduct + rw [← image_f16PatternPoint, + Finset.prod_image injective_f16PatternPoint.injOn] + rw [Fintype.prod_prod_type] + apply Finset.prod_congr rfl + intro i _ + rw [Fin.prod_univ_four] + change + σ (sevenVariableAffinePoint d (f16AffineBasisA i)) * + σ (sevenVariableAffinePoint d (f16AffineBasisB i)) * + σ (sevenVariableAffinePoint d + (f16AffineBasisA i + ∑ j, f16AffineBasisB j)) * + σ (sevenVariableAffinePoint d + (f16AffineBasisB i + ∑ j, f16AffineBasisA j)) = _ + rw [sevenVariableAffinePoint_f16_aCycle, + sevenVariableAffinePoint_f16_bCycle] + rfl + +private def f16AffineDataOfBasisCoordinates + (p : (Fin 4 → FABL.F₂Cube n) × (Fin 4 → FABL.F₂Cube n)) : + SevenVariableAffineMapData n := + let u := p.1 0 + let v₁ := p.1 1 - u + let v₂ := p.1 2 - u + let v₃ := p.2 0 - u + let v₅ := p.2 1 - u + let v₆ := p.2 2 - u + let v₀ := p.2 3 - u - v₃ - v₅ - v₆ + let v₄ := p.1 3 - u - v₀ + (u, ![v₀, v₁, v₂, v₃, v₄, v₅, v₆]) + +private def f16AffineBasisCoordinatesEquiv (n : ℕ) : + SevenVariableAffineMapData n ≃ + ((Fin 4 → FABL.F₂Cube n) × (Fin 4 → FABL.F₂Cube n)) where + toFun := f16AffineBasisCoordinates + invFun := f16AffineDataOfBasisCoordinates + left_inv := by + rintro ⟨u, v⟩ + apply Prod.ext + · simp [f16AffineDataOfBasisCoordinates, f16AffineBasisCoordinates, + f16AffineBasisA, sevenVariableAffinePoint, f₂CubeOfNat] + · funext i + fin_cases i <;> + simp [f16AffineDataOfBasisCoordinates, f16AffineBasisCoordinates, + f16AffineBasisA, f16AffineBasisB, sevenVariableAffinePoint, + f₂CubeOfNat, Fin.sum_univ_succ, Nat.testBit, + ZModModule.add_self] + all_goals abel + right_inv := by + rintro ⟨U, V⟩ + apply Prod.ext + · funext i + fin_cases i <;> + simp [f16AffineDataOfBasisCoordinates, f16AffineBasisCoordinates, + f16AffineBasisA, sevenVariableAffinePoint, f₂CubeOfNat, + Fin.sum_univ_succ, Nat.testBit, ZModModule.add_self] + · funext i + fin_cases i <;> + simp [f16AffineDataOfBasisCoordinates, f16AffineBasisCoordinates, + f16AffineBasisB, sevenVariableAffinePoint, f₂CubeOfNat, + Fin.sum_univ_succ, Nat.testBit, ZModModule.add_self] + all_goals abel + +private noncomputable def f16FourCycleCompleteAffineMapCharacterSum + (σ : FABL.F₂Cube n → ℝ) : ℝ := + ∑ U : Fin 4 → FABL.F₂Cube n, + ∑ V : Fin 4 → FABL.F₂Cube n, + ∏ i, + σ (U i) * σ (V i) * σ (U i + ∑ j, V j) * + σ (V i + ∑ j, U j) + +private theorem rankSevenWeightSixteenPatternCompleteAffineMapCharacterSum_f16_cycle + (σ : FABL.F₂Cube n → ℝ) : + rankSevenWeightSixteenPatternCompleteAffineMapCharacterSum σ .f16 = + f16FourCycleCompleteAffineMapCharacterSum σ := by + unfold rankSevenWeightSixteenPatternCompleteAffineMapCharacterSum + rw [Fintype.sum_equiv (f16AffineBasisCoordinatesEquiv n) + (fun d ↦ rankSevenWeightSixteenPatternAffineProduct σ .f16 d) + (fun p ↦ ∏ i, + σ (p.1 i) * σ (p.2 i) * σ (p.1 i + ∑ j, p.2 j) * + σ (p.2 i + ∑ j, p.1 j))] + · simp only [Fintype.sum_prod_type] + rfl + · exact rankSevenWeightSixteenPatternAffineProduct_f16 σ + +private abbrev F16CycleData (n : ℕ) := + (Fin 4 → FABL.F₂Cube n) × (Fin 4 → FABL.F₂Cube n) + +private abbrev F16ConvolutionData (n : ℕ) := + FABL.F₂Cube n × FABL.F₂Cube n × + ((Fin 3 → FABL.F₂Cube n) × (Fin 3 → FABL.F₂Cube n)) + +private def f16CycleConvolutionDataEquiv (n : ℕ) : + F16CycleData n ≃ F16ConvolutionData n where + toFun p := + (∑ i, p.2 i, ∑ i, p.1 i, + (![p.1 0 + p.1 1, p.1 2, p.1 0], + ![p.2 0 + p.2 1, p.2 2, p.2 0])) + invFun p := + (![p.2.2.1 2, p.2.2.1 0 - p.2.2.1 2, + p.2.2.1 1, p.2.1 - p.2.2.1 0 - p.2.2.1 1], + ![p.2.2.2 2, p.2.2.2 0 - p.2.2.2 2, + p.2.2.2 1, p.1 - p.2.2.2 0 - p.2.2.2 1]) + left_inv := by + rintro ⟨U, V⟩ + apply Prod.ext <;> funext i <;> fin_cases i <;> + simp [Fin.sum_univ_four] + all_goals abel + right_inv := by + rintro ⟨a, b, q, r⟩ + apply Prod.ext + · simp [Fin.sum_univ_four] + · apply Prod.ext + · simp [Fin.sum_univ_four] + · apply Prod.ext <;> funext i <;> fin_cases i <;> + simp + +private theorem f16CycleConvolutionDataEquiv_apply + (U V : Fin 4 → FABL.F₂Cube n) : + f16CycleConvolutionDataEquiv n (U, V) = + (∑ i, V i, ∑ i, U i, + (![U 0 + U 1, U 2, U 0], + ![V 0 + V 1, V 2, V 0])) := + rfl + +private noncomputable def f16CycleIntegrand + (σ : FABL.F₂Cube n → ℝ) (p : F16CycleData n) : ℝ := + ∏ i, σ (p.1 i) * σ (p.2 i) * + σ (p.1 i + ∑ j, p.2 j) * σ (p.2 i + ∑ j, p.1 j) + +private def f16ConvolutionIntegrand + (σ : FABL.F₂Cube n → ℝ) (p : F16ConvolutionData n) : ℝ := + d16FourfoldProduct σ p.1 p.2.1 p.2.2.1 * + d16FourfoldProduct σ p.2.1 p.1 p.2.2.2 + +private theorem f16CycleConvolutionDataEquiv_integrand + (σ : FABL.F₂Cube n → ℝ) + (p : F16CycleData n) : + f16CycleIntegrand σ p = + f16ConvolutionIntegrand σ (f16CycleConvolutionDataEquiv n p) := by + rcases p with ⟨U, V⟩ + unfold f16CycleIntegrand f16ConvolutionIntegrand + rw [Fin.prod_univ_four] + simp_rw [Fin.sum_univ_four] + have hU₁ : U 0 + U 1 + U 0 = U 1 := by + calc + U 0 + U 1 + U 0 = (U 0 + U 0) + U 1 := by abel + _ = U 1 := by simp only [ZModModule.add_self, zero_add] + have hU₃ : + U 0 + U 1 + U 2 + U 3 + (U 0 + U 1) + U 2 = U 3 := by + calc + U 0 + U 1 + U 2 + U 3 + (U 0 + U 1) + U 2 = + (U 0 + U 0) + (U 1 + U 1) + (U 2 + U 2) + U 3 := by + abel + _ = U 3 := by simp only [ZModModule.add_self, zero_add] + have hV₁ : V 0 + V 1 + V 0 = V 1 := by + calc + V 0 + V 1 + V 0 = (V 0 + V 0) + V 1 := by abel + _ = V 1 := by simp only [ZModModule.add_self, zero_add] + have hV₃ : + V 0 + V 1 + V 2 + V 3 + (V 0 + V 1) + V 2 = V 3 := by + calc + V 0 + V 1 + V 2 + V 3 + (V 0 + V 1) + V 2 = + (V 0 + V 0) + (V 1 + V 1) + (V 2 + V 2) + V 3 := by + abel + _ = V 3 := by simp only [ZModModule.add_self, zero_add] + rw [f16CycleConvolutionDataEquiv_apply] + simp only [d16FourfoldProduct, orbitSignDerivative, Fin.sum_univ_four, + Matrix.cons_val_zero, Matrix.cons_val_one, Matrix.cons_val_two, + Matrix.tail_cons, Matrix.head_cons] + rw [hU₁, hU₃, hV₁, hV₃] + ring + +private theorem f16CycleConvolutionSum_eq + (σ : FABL.F₂Cube n → ℝ) : + (∑ p : F16CycleData n, f16CycleIntegrand σ p) = + ∑ p : F16ConvolutionData n, f16ConvolutionIntegrand σ p := by + calc + (∑ p : F16CycleData n, f16CycleIntegrand σ p) = + ∑ p : F16CycleData n, + f16ConvolutionIntegrand σ + (f16CycleConvolutionDataEquiv n p) := by + apply Finset.sum_congr rfl + intro p _ + exact f16CycleConvolutionDataEquiv_integrand σ p + _ = ∑ p : F16ConvolutionData n, f16ConvolutionIntegrand σ p := + (f16CycleConvolutionDataEquiv n).sum_comp _ + +private noncomputable def f16ConvolutionPairCharacterSum + (σ : FABL.F₂Cube n → ℝ) : ℝ := + ∑ a : FABL.F₂Cube n, + ∑ b : FABL.F₂Cube n, + ∑ q : Fin 3 → FABL.F₂Cube n, + ∑ r : Fin 3 → FABL.F₂Cube n, + d16FourfoldProduct σ a b q * d16FourfoldProduct σ b a r + +private theorem f16FourCycleCompleteAffineMapCharacterSum_eq_convolutionPair + (σ : FABL.F₂Cube n → ℝ) : + f16FourCycleCompleteAffineMapCharacterSum σ = + f16ConvolutionPairCharacterSum σ := by + unfold f16FourCycleCompleteAffineMapCharacterSum + f16ConvolutionPairCharacterSum + calc + (∑ U : Fin 4 → FABL.F₂Cube n, + ∑ V : Fin 4 → FABL.F₂Cube n, + ∏ i, σ (U i) * σ (V i) * σ (U i + ∑ j, V j) * + σ (V i + ∑ j, U j)) = + ∑ p : F16CycleData n, f16CycleIntegrand σ p := by + rw [Fintype.sum_prod_type] + unfold f16CycleIntegrand + rfl + _ = ∑ p : F16ConvolutionData n, + f16ConvolutionIntegrand σ p := + f16CycleConvolutionSum_eq σ + _ = ∑ a : FABL.F₂Cube n, + ∑ b : FABL.F₂Cube n, + ∑ q : Fin 3 → FABL.F₂Cube n, + ∑ r : Fin 3 → FABL.F₂Cube n, + d16FourfoldProduct σ a b q * + d16FourfoldProduct σ b a r := by + unfold f16ConvolutionIntegrand + simp only [Fintype.sum_prod_type] + +private theorem f16WeightProduct_eq_convolutionPair + (σ : FABL.F₂Cube n → ℝ) (a b : FABL.F₂Cube n) : + weightSixteenFourfoldConvolution σ a b * + weightSixteenFourfoldConvolution σ b a = + ∑ q : Fin 3 → FABL.F₂Cube n, + ∑ r : Fin 3 → FABL.F₂Cube n, + d16FourfoldProduct σ a b q * d16FourfoldProduct σ b a r := by + rw [weightSixteenFourfoldConvolution_eq_sum_d16FourfoldProduct, + weightSixteenFourfoldConvolution_eq_sum_d16FourfoldProduct, + Finset.sum_mul] + apply Finset.sum_congr rfl + intro q _ + rw [Finset.mul_sum] + +private theorem f16ConvolutionPairCharacterSum_eq_canonical + (σ : FABL.F₂Cube n → ℝ) : + f16ConvolutionPairCharacterSum σ = + f16CanonicalCompleteAffineMapCharacterSum σ := by + unfold f16ConvolutionPairCharacterSum + f16CanonicalCompleteAffineMapCharacterSum + apply Finset.sum_congr rfl + intro a _ + apply Finset.sum_congr rfl + intro b _ + exact (f16WeightProduct_eq_convolutionPair σ a b).symm + +private theorem f16FourCycleCompleteAffineMapCharacterSum_eq_canonical + (σ : FABL.F₂Cube n → ℝ) : + f16FourCycleCompleteAffineMapCharacterSum σ = + f16CanonicalCompleteAffineMapCharacterSum σ := by + rw [f16FourCycleCompleteAffineMapCharacterSum_eq_convolutionPair, + f16ConvolutionPairCharacterSum_eq_canonical] + +/-- The complete affine-map character sum of the canonical `F₁₆` pattern +is its four-cycle convolution normal form. -/ +theorem rankSevenWeightSixteenPatternCompleteAffineMapCharacterSum_f16 + (σ : FABL.F₂Cube n → ℝ) : + rankSevenWeightSixteenPatternCompleteAffineMapCharacterSum σ .f16 = + f16CanonicalCompleteAffineMapCharacterSum σ := by + rw [rankSevenWeightSixteenPatternCompleteAffineMapCharacterSum_f16_cycle, + f16FourCycleCompleteAffineMapCharacterSum_eq_canonical] + +/-- The complete affine-map character sum of the canonical `F₁₆` pattern +is nonnegative. -/ +theorem rankSevenWeightSixteenPatternCompleteAffineMapCharacterSum_f16_nonneg + (σ : FABL.F₂Cube n → ℝ) : + 0 ≤ rankSevenWeightSixteenPatternCompleteAffineMapCharacterSum σ .f16 := by + rw [rankSevenWeightSixteenPatternCompleteAffineMapCharacterSum_f16] + exact f16CanonicalCompleteAffineMapCharacterSum_nonneg σ + +/-- Every canonical rank-seven weight-sixteen pattern has a nonnegative +complete affine-map character sum. -/ +theorem rankSevenWeightSixteenPatternCompleteAffineMapCharacterSum_nonneg + (σ : FABL.F₂Cube n → ℝ) + (c : RankSevenWeightSixteenPatternClass) : + 0 ≤ rankSevenWeightSixteenPatternCompleteAffineMapCharacterSum σ c := by + cases c with + | twoE8 => + exact rankSevenWeightSixteenPatternCompleteAffineMapCharacterSum_twoE8_nonneg σ + | d16Plus => + exact rankSevenWeightSixteenPatternCompleteAffineMapCharacterSum_d16Plus_nonneg σ + | f16 => + exact rankSevenWeightSixteenPatternCompleteAffineMapCharacterSum_f16_nonneg σ + +end CryptBoolean diff --git a/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenRankSevenClassification.lean b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenRankSevenClassification.lean new file mode 100644 index 0000000..5501a08 --- /dev/null +++ b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenRankSevenClassification.lean @@ -0,0 +1,266 @@ +/- +Copyright (c) 2026 Asher Yan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Asher Yan with Codex +-/ +module + +public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightSixteenCandidateSoundnessCertificates +public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightSixteenCharacterBound +public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightSixteenSupportNormalization +public import CryptBoolean.Carlet.Chapter04.HigherOrderSharpAsymptotics + +/-! +# Rank-seven classification of weight-sixteen dual words +-/ + +open Finset +open scoped BigOperators BooleanCube + +@[expose] public section + +namespace CryptBoolean + +variable {n : ℕ} + +/-- Composition of seven-variable affine-map data. -/ +def sevenVariableAffineMapDataComp + (outer : SevenVariableAffineMapData n) + (inner : SevenVariableAffineMapData 7) : + SevenVariableAffineMapData n := + (sevenVariableAffinePoint outer inner.1, + fun i ↦ (sevenVariableAffineMap outer).linear (inner.2 i)) + +/-- Evaluation of composed affine-map data is functional composition. -/ +theorem sevenVariableAffinePoint_comp + (outer : SevenVariableAffineMapData n) + (inner : SevenVariableAffineMapData 7) + (x : FABL.F₂Cube 7) : + sevenVariableAffinePoint (sevenVariableAffineMapDataComp outer inner) x = + sevenVariableAffinePoint outer (sevenVariableAffinePoint inner x) := by + change + (outer.1 + (sevenVariableAffineMap outer).linear inner.1) + + ∑ i, x i • (sevenVariableAffineMap outer).linear (inner.2 i) = + outer.1 + (sevenVariableAffineMap outer).linear + (inner.1 + ∑ i, x i • inner.2 i) + rw [map_add, map_sum] + simp_rw [map_smul] + abel + +/-- Composition preserves independent directions when both affine maps have +independent linear parts. -/ +theorem linearIndependent_sevenVariableAffineMapDataComp + (outer : SevenVariableAffineMapData n) + (inner : SevenVariableAffineMapData 7) + (houter : LinearIndependent FABL.𝔽₂ outer.2) + (hinner : LinearIndependent FABL.𝔽₂ inner.2) : + LinearIndependent FABL.𝔽₂ + (sevenVariableAffineMapDataComp outer inner).2 := by + have hpoint : Function.Injective (sevenVariableAffinePoint outer) := + (sevenVariableAffinePoint_injective_iff outer).2 houter + have hlinear : Function.Injective (sevenVariableAffineMap outer).linear := by + intro x y hxy + apply hpoint + change outer.1 + (sevenVariableAffineMap outer).linear x = + outer.1 + (sevenVariableAffineMap outer).linear y + rw [hxy] + have hmapped := hinner.map' (sevenVariableAffineMap outer).linear + (LinearMap.ker_eq_bot.mpr hlinear) + change LinearIndependent FABL.𝔽₂ + (fun i ↦ (sevenVariableAffineMap outer).linear (inner.2 i)) at hmapped + change LinearIndependent FABL.𝔽₂ + (fun i ↦ (sevenVariableAffineMap outer).linear (inner.2 i)) + exact hmapped + +/-- Canonical pattern images commute with affine-data composition. -/ +theorem rankSevenWeightSixteenPatternImage_comp + (c : RankSevenWeightSixteenPatternClass) + (outer : SevenVariableAffineMapData n) + (inner : SevenVariableAffineMapData 7) : + rankSevenWeightSixteenPatternImage c + (sevenVariableAffineMapDataComp outer inner) = + (rankSevenWeightSixteenPatternImage c inner).image + (sevenVariableAffinePoint outer) := by + unfold rankSevenWeightSixteenPatternImage + rw [Finset.image_image] + apply Finset.image_congr + intro x _hx + exact sevenVariableAffinePoint_comp outer inner x + +private theorem booleanFunction_eq_of_support_eq + {f g : BooleanFunction n} + (hfg : support f = support g) : + f = g := by + funext x + have hx : x ∈ support f ↔ x ∈ support g := by rw [hfg] + have hxOne : f x = 1 ↔ g x = 1 := by + simpa only [mem_support] using hx + by_cases hfx : f x = 0 + · have hgx : g x = 0 := by + by_contra hgx + have hgxOne : g x = 1 := Fin.eq_one_of_ne_zero _ hgx + have hfxOne : f x = 1 := hxOne.mpr hgxOne + exact zero_ne_one (hfx.symm.trans hfxOne) + rw [hfx, hgx] + · have hfxOne : f x = 1 := Fin.eq_one_of_ne_zero _ hfx + have hgxOne : g x = 1 := hxOne.mp hfxOne + rw [hfxOne, hgxOne] + +/-- Compact soundness of every generated normalized candidate yields +nonempty canonical-pattern certificate data for each rank-seven dual word. -/ +theorem nonempty_rankSevenWeightSixteenPatternCertificate_of_mem_of_compactSoundness + (hn : 3 ≤ n) + (hcandidate : HasNormalizedWeightSixteenCompactCandidateSoundness) + {h : BooleanFunction n} + (hh : h ∈ orderTwoWeightSixteenDualWords n) + (hrank : HasSupportAffineSpanRankSeven h) : + Nonempty (RankSevenWeightSixteenPatternCertificate h) := by + have hhData : h ∈ reedMuller (n - 3) n ∧ hammingWeight h = 16 := by + simpa only [orderTwoWeightSixteenDualWords, orderTwoDualWords, + Finset.mem_filter, Finset.mem_univ, true_and] using hh + have hdual : h ∈ reedMullerDual 2 n := by + rw [reedMullerDual_eq (r := 2) (n := n) (by omega)] + simpa only [show n - 2 - 1 = n - 3 by omega] using hhData.1 + obtain ⟨p, hp, hspan⟩ := hrank + obtain ⟨outer, code, _horigin, houter, hconstraints, hsupport⟩ := + exists_systematicWeightSixteenNormalization + h p hp hdual hhData.2 hspan + obtain ⟨candidate, hcode, hcompact⟩ := hcandidate hconstraints + have hpoint : Function.Injective (sevenVariableAffinePoint outer) := + (sevenVariableAffinePoint_injective_iff outer).2 houter + have hsupportCard : (support h).card = 16 := by + simpa only [hammingWeight_eq_card_support] using hhData.2 + have hsystematicCard : + (systematicWeightSixteenSupportOfCode + candidate.systematicCode).card = 16 := by + calc + (systematicWeightSixteenSupportOfCode + candidate.systematicCode).card = + (systematicWeightSixteenSupportOfCode code).card := by rw [hcode] + _ = (support h).card := by + rw [← hsupport, Finset.card_image_of_injective _ hpoint] + _ = 16 := hsupportCard + have hsound : candidate.IsSound := hcompact.isSound hsystematicCard + let inner := normalizedCandidateAffineMapData candidate + have hfixed : systematicWeightSixteenFixedPoints ⊆ + rankSevenWeightSixteenPatternImage candidate.patternClass inner := by + rw [hsound, systematicWeightSixteenSupportOfCode] + exact Finset.subset_union_left + have hinner : LinearIndependent FABL.𝔽₂ inner.2 := + linearIndependent_of_systematicFixedPoints_subset_patternImage + candidate.patternClass inner hfixed + let composed := sevenVariableAffineMapDataComp outer inner + have hcomposed : LinearIndependent FABL.𝔽₂ composed.2 := by + exact linearIndependent_sevenVariableAffineMapDataComp + outer inner houter hinner + have hpatternSupport : + rankSevenWeightSixteenPatternImage candidate.patternClass composed = + support h := by + calc + rankSevenWeightSixteenPatternImage candidate.patternClass composed = + (rankSevenWeightSixteenPatternImage candidate.patternClass inner).image + (sevenVariableAffinePoint outer) := + rankSevenWeightSixteenPatternImage_comp + candidate.patternClass outer inner + _ = (systematicWeightSixteenSupportOfCode + candidate.systematicCode).image + (sevenVariableAffinePoint outer) := by rw [hsound] + _ = (systematicWeightSixteenSupportOfCode code).image + (sevenVariableAffinePoint outer) := by rw [hcode] + _ = support h := hsupport + refine + ⟨RankSevenWeightSixteenPatternCertificate.mk + candidate.patternClass composed hcomposed ?_⟩ + apply booleanFunction_eq_of_support_eq + rw [support_rankSevenWeightSixteenPatternWord, hpatternSupport] + +/-- Compact soundness of every generated normalized candidate selects a +canonical-pattern certificate for each rank-seven dual word. -/ +noncomputable def rankSevenWeightSixteenPatternCertificate_of_mem_of_compactSoundness + (hn : 3 ≤ n) + (hcandidate : HasNormalizedWeightSixteenCompactCandidateSoundness) + {h : BooleanFunction n} + (hh : h ∈ orderTwoWeightSixteenDualWords n) + (hrank : HasSupportAffineSpanRankSeven h) : + RankSevenWeightSixteenPatternCertificate h := + Classical.choice + (nonempty_rankSevenWeightSixteenPatternCertificate_of_mem_of_compactSoundness + hn hcandidate hh hrank) + +/-- Every rank-seven weight-sixteen dual word has a selected canonical-pattern +certificate. -/ +noncomputable def rankSevenWeightSixteenPatternCertificate + (hn : 3 ≤ n) + {h : BooleanFunction n} + (hh : h ∈ orderTwoWeightSixteenDualWords n) + (hrank : HasSupportAffineSpanRankSeven h) : + RankSevenWeightSixteenPatternCertificate h := + rankSevenWeightSixteenPatternCertificate_of_mem_of_compactSoundness + hn normalizedWeightSixteenCompactCandidateSoundness hh hrank + +/-- The rank-seven weight-sixteen dual words are exactly the disjoint union of +the three canonical affine-pattern orbits. -/ +theorem hasRankSevenWeightSixteenOrbitClassification + (n : ℕ) (hn : 3 ≤ n) : + HasRankSevenWeightSixteenOrbitClassification n := + hasRankSevenWeightSixteenOrbitClassification_of_certificate + (fun _h hh hrank ↦ + rankSevenWeightSixteenPatternCertificate hn hh hrank) + +/-- The compact candidate-soundness interface closes the full +weight-sixteen character lower bound. -/ +theorem orderTwoWeightSixteenCharacterSum_ge_of_compactCandidateSoundness + (f : BooleanFunction n) + (hn : 3 ≤ n) + (hcandidate : HasNormalizedWeightSixteenCompactCandidateSoundness) : + orderTwoWeightSixteenCharacterSum f ≥ + -((3 * 127 + 127 * 2 ^ 128) * (2 ^ n : ℝ) ^ 7) := + orderTwoWeightSixteenCharacterSum_ge_of_certificate f hn + (fun _h hh hrank ↦ + rankSevenWeightSixteenPatternCertificate_of_mem_of_compactSoundness + hn hcandidate hh hrank) + +/-- The complete weight-sixteen dual character sum has a uniform seventh-power +lower bound. -/ +theorem orderTwoWeightSixteenCharacterSum_ge_rankSevenClassification + (f : BooleanFunction n) + (hn : 3 ≤ n) : + orderTwoWeightSixteenCharacterSum f ≥ + -((3 * 127 + 127 * 2 ^ 128) * (2 ^ n : ℝ) ^ 7) := + orderTwoWeightSixteenCharacterSum_ge_of_compactCandidateSoundness + f hn normalizedWeightSixteenCompactCandidateSoundness + +/-- Compact soundness of the generated normalized candidates closes the sharp +fixed-order higher-order nonlinearity upper bound. -/ +theorem exists_maximumHigherOrderNonlinearity_cast_le_of_compactCandidateSoundness + (hcandidate : HasNormalizedWeightSixteenCompactCandidateSoundness) + (r : ℕ) (hr : 2 ≤ r) : + ∃ D : ℝ, 0 ≤ D ∧ ∀ n : ℕ, r ≤ n → + (maximumHigherOrderNonlinearity r n : ℝ) ≤ + (2 : ℝ) ^ n / 2 - + ((Real.sqrt 15 / 2) * + (1 + Real.sqrt 2) ^ (r - 2)) * + (Real.sqrt 2) ^ n + + D * (n + 1 : ℝ) ^ (r - 2) := + exists_maximumHigherOrderNonlinearity_cast_le_of_weightSixteenCharacterSum + (fun {n} f hn ↦ by + simpa only [orderTwoWeightSixteenCharacterLoss, neg_mul] using + orderTwoWeightSixteenCharacterSum_ge_of_compactCandidateSoundness + f (by omega) hcandidate) + r hr + +/-- Carlet--Mesnager's sharp fixed-order upper bound for higher-order +nonlinearity. -/ +theorem exists_maximumHigherOrderNonlinearity_cast_le_sharp + (r : ℕ) (hr : 2 ≤ r) : + ∃ D : ℝ, 0 ≤ D ∧ ∀ n : ℕ, r ≤ n → + (maximumHigherOrderNonlinearity r n : ℝ) ≤ + (2 : ℝ) ^ n / 2 - + ((Real.sqrt 15 / 2) * + (1 + Real.sqrt 2) ^ (r - 2)) * + (Real.sqrt 2) ^ n + + D * (n + 1 : ℝ) ^ (r - 2) := + exists_maximumHigherOrderNonlinearity_cast_le_of_compactCandidateSoundness + normalizedWeightSixteenCompactCandidateSoundness r hr + +end CryptBoolean diff --git a/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenRankSevenPatterns.lean b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenRankSevenPatterns.lean new file mode 100644 index 0000000..cf0f35d --- /dev/null +++ b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenRankSevenPatterns.lean @@ -0,0 +1,248 @@ +/- +Copyright (c) 2026 Asher Yan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Asher Yan with Codex +-/ +module + +public import CryptBoolean.Carlet.Chapter03.ReedMullerWeightSixteenSelfDual +public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightSixteenAffineMaps +public import CryptBoolean.Carlet.Chapter04.OddDimensionBestNonlinearity + +/-! +# Canonical rank-seven weight-sixteen patterns + +Projective self-dual binary codes of parameters `[16,8,≥4]` give three +rank-seven point-pattern classes. This file fixes executable representatives +and packages injective affine images as proof-carrying data. Classification is +expressed by a concrete affine-image certificate, not by an unverified global +existence hypothesis. +-/ + +open Finset +open scoped BigOperators BooleanCube + +@[expose] public section + +namespace CryptBoolean + +variable {n : ℕ} + +/-- The three projective self-dual length-sixteen pattern classes. -/ +inductive RankSevenWeightSixteenPatternClass where + | twoE8 + | d16Plus + | f16 + deriving DecidableEq, Fintype + +/-- Little-endian integer representatives of the three canonical +seven-variable point patterns. -/ +def rankSevenWeightSixteenPatternIndices : + RankSevenWeightSixteenPatternClass → Finset ℕ + | .twoE8 => + [0, 1, 2, 3, 4, 5, 6, 7, + 64, 72, 80, 88, 96, 104, 112, 120].toFinset + | .d16Plus => + [0, 1, 2, 4, 8, 16, 32, 64, + 127, 126, 125, 123, 119, 111, 95, 63].toFinset + | .f16 => + [0, 1, 2, 4, 8, 16, 32, 64, + 126, 87, 55, 17, 31, 5, 3, 105].toFinset + +/-- The canonical point set associated with a rank-seven pattern class. -/ +def rankSevenWeightSixteenPattern + (c : RankSevenWeightSixteenPatternClass) : + Finset (FABL.F₂Cube 7) := + (rankSevenWeightSixteenPatternIndices c).image (f₂CubeOfNat 7) + +@[simp] theorem card_rankSevenWeightSixteenPattern + (c : RankSevenWeightSixteenPatternClass) : + (rankSevenWeightSixteenPattern c).card = 16 := by + cases c <;> decide + +theorem rankSevenWeightSixteenPattern_pairwise_ne : + Function.Injective rankSevenWeightSixteenPattern := by + intro c d + cases c <;> cases d <;> decide + +/-- Seven distinguished pattern points whose differences from zero form an +affine basis of the canonical representative. -/ +def rankSevenWeightSixteenPatternAffineBasisIndices : + RankSevenWeightSixteenPatternClass → Fin 7 → ℕ + | .twoE8 => ![1, 2, 4, 64, 72, 80, 96] + | .d16Plus => ![1, 2, 4, 8, 16, 32, 64] + | .f16 => ![1, 2, 4, 8, 16, 32, 64] + +/-- The direction family supplied by the canonical affine basis. -/ +def rankSevenWeightSixteenPatternAffineBasis + (c : RankSevenWeightSixteenPatternClass) : Fin 7 → FABL.F₂Cube 7 := + fun i ↦ f₂CubeOfNat 7 (rankSevenWeightSixteenPatternAffineBasisIndices c i) + +@[simp] theorem zero_mem_rankSevenWeightSixteenPattern + (c : RankSevenWeightSixteenPatternClass) : + 0 ∈ rankSevenWeightSixteenPattern c := by + cases c <;> decide + +theorem rankSevenWeightSixteenPatternAffineBasis_mem + (c : RankSevenWeightSixteenPatternClass) (i : Fin 7) : + rankSevenWeightSixteenPatternAffineBasis c i ∈ + rankSevenWeightSixteenPattern c := by + cases c <;> fin_cases i <;> decide + +theorem linearIndependent_rankSevenWeightSixteenPatternAffineBasis + (c : RankSevenWeightSixteenPatternClass) : + LinearIndependent FABL.𝔽₂ + (rankSevenWeightSixteenPatternAffineBasis c) := by + cases c with + | d16Plus => + have hbasis : + rankSevenWeightSixteenPatternAffineBasis .d16Plus = + fun i : Fin 7 ↦ Pi.single i (1 : FABL.𝔽₂) := by + funext i j + fin_cases i <;> fin_cases j <;> decide + rw [hbasis] + exact Pi.linearIndependent_single_one (Fin 7) FABL.𝔽₂ + | f16 => + have hbasis : + rankSevenWeightSixteenPatternAffineBasis .f16 = + fun i : Fin 7 ↦ Pi.single i (1 : FABL.𝔽₂) := by + funext i j + fin_cases i <;> fin_cases j <;> decide + rw [hbasis] + exact Pi.linearIndependent_single_one (Fin 7) FABL.𝔽₂ + | twoE8 => + rw [Fintype.linearIndependent_iff] + intro g hg i + let e : Fin 7 → FABL.F₂Cube 7 := + fun j ↦ Pi.single j (1 : FABL.𝔽₂) + have hbasis : + rankSevenWeightSixteenPatternAffineBasis .twoE8 = + ![e 0, e 1, e 2, e 6, e 3 + e 6, e 4 + e 6, e 5 + e 6] := by + funext j k + fin_cases j <;> fin_cases k <;> decide + rw [hbasis] at hg + have h0 := congrFun hg (0 : Fin 7) + have h1 := congrFun hg (1 : Fin 7) + have h2 := congrFun hg (2 : Fin 7) + have h3 := congrFun hg (3 : Fin 7) + have h4 := congrFun hg (4 : Fin 7) + have h5 := congrFun hg (5 : Fin 7) + have h6 := congrFun hg (6 : Fin 7) + have h0' : g 0 = 0 := by + simpa [e, Fin.sum_univ_succ] using h0 + have h1' : g 1 = 0 := by + simpa [e, Fin.sum_univ_succ] using h1 + have h2' : g 2 = 0 := by + simpa [e, Fin.sum_univ_succ] using h2 + have h3' : g 4 = 0 := by + simpa [e, Fin.sum_univ_succ] using h3 + have h4' : g 5 = 0 := by + simpa [e, Fin.sum_univ_succ] using h4 + have h5' : g 6 = 0 := by + simpa [e, Fin.sum_univ_succ] using h5 + have h6' : g 3 + (g 4 + (g 5 + g 6)) = 0 := by + simpa [e, Fin.sum_univ_succ] using h6 + fin_cases i + · exact h0' + · exact h1' + · exact h2' + · rw [h3', h4', h5'] at h6' + simpa using h6' + · exact h3' + · exact h4' + · exact h5' + +/-- The Boolean indicator of a canonical rank-seven pattern. -/ +def rankSevenWeightSixteenPatternIndicator + (c : RankSevenWeightSixteenPatternClass) : BooleanFunction 7 := + fun x ↦ if x ∈ rankSevenWeightSixteenPattern c then 1 else 0 + +@[simp] theorem support_rankSevenWeightSixteenPatternIndicator + (c : RankSevenWeightSixteenPatternClass) : + support (rankSevenWeightSixteenPatternIndicator c) = + rankSevenWeightSixteenPattern c := by + ext x + simp [support, FABL.f₂OneSupport, + rankSevenWeightSixteenPatternIndicator] + +@[simp] theorem hammingWeight_rankSevenWeightSixteenPatternIndicator + (c : RankSevenWeightSixteenPatternClass) : + hammingWeight (rankSevenWeightSixteenPatternIndicator c) = 16 := by + rw [hammingWeight_eq_card_support, + support_rankSevenWeightSixteenPatternIndicator, + card_rankSevenWeightSixteenPattern] + +/-- The injective affine image of a canonical rank-seven point pattern. -/ +def rankSevenWeightSixteenPatternImage + (c : RankSevenWeightSixteenPatternClass) + (d : SevenVariableAffineMapData n) : Finset (FABL.F₂Cube n) := + (rankSevenWeightSixteenPattern c).image (sevenVariableAffinePoint d) + +theorem card_rankSevenWeightSixteenPatternImage_of_independent + (c : RankSevenWeightSixteenPatternClass) + (d : SevenVariableAffineMapData n) + (hd : LinearIndependent FABL.𝔽₂ d.2) : + (rankSevenWeightSixteenPatternImage c d).card = 16 := by + rw [rankSevenWeightSixteenPatternImage, + Finset.card_image_of_injective + (rankSevenWeightSixteenPattern c) + (sevenVariableAffinePoint_injective_iff d |>.2 hd), + card_rankSevenWeightSixteenPattern] + +/-- The Boolean word supported on one affine image of a canonical pattern. -/ +def rankSevenWeightSixteenPatternWord + (c : RankSevenWeightSixteenPatternClass) + (d : SevenVariableAffineMapData n) : BooleanFunction n := + fun x ↦ if x ∈ rankSevenWeightSixteenPatternImage c d then 1 else 0 + +@[simp] theorem support_rankSevenWeightSixteenPatternWord + (c : RankSevenWeightSixteenPatternClass) + (d : SevenVariableAffineMapData n) : + support (rankSevenWeightSixteenPatternWord c d) = + rankSevenWeightSixteenPatternImage c d := by + ext x + simp [support, FABL.f₂OneSupport, + rankSevenWeightSixteenPatternWord] + +theorem hammingWeight_rankSevenWeightSixteenPatternWord_of_independent + (c : RankSevenWeightSixteenPatternClass) + (d : SevenVariableAffineMapData n) + (hd : LinearIndependent FABL.𝔽₂ d.2) : + hammingWeight (rankSevenWeightSixteenPatternWord c d) = 16 := by + rw [hammingWeight_eq_card_support, + support_rankSevenWeightSixteenPatternWord, + card_rankSevenWeightSixteenPatternImage_of_independent c d hd] + +/-- Constructive evidence that a word belongs to one of the three rank-seven +affine pattern orbits. -/ +structure RankSevenWeightSixteenPatternCertificate + (h : BooleanFunction n) where + patternClass : RankSevenWeightSixteenPatternClass + affineData : SevenVariableAffineMapData n + independent : LinearIndependent FABL.𝔽₂ affineData.2 + word_eq : h = rankSevenWeightSixteenPatternWord patternClass affineData + +theorem RankSevenWeightSixteenPatternCertificate.hammingWeight_eq_sixteen + {h : BooleanFunction n} + (certificate : RankSevenWeightSixteenPatternCertificate h) : + hammingWeight h = 16 := by + rw [certificate.word_eq] + exact hammingWeight_rankSevenWeightSixteenPatternWord_of_independent + certificate.patternClass certificate.affineData certificate.independent + +/-- Membership in one specified canonical affine orbit. -/ +def IsRankSevenWeightSixteenPatternClass + (c : RankSevenWeightSixteenPatternClass) + (h : BooleanFunction n) : Prop := + ∃ d : SevenVariableAffineMapData n, + LinearIndependent FABL.𝔽₂ d.2 ∧ + h = rankSevenWeightSixteenPatternWord c d + +theorem exists_patternClass_of_certificate + {h : BooleanFunction n} + (certificate : RankSevenWeightSixteenPatternCertificate h) : + ∃ c, IsRankSevenWeightSixteenPatternClass c h := by + exact ⟨certificate.patternClass, certificate.affineData, + certificate.independent, certificate.word_eq⟩ + +end CryptBoolean diff --git a/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenSupportNormalization.lean b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenSupportNormalization.lean new file mode 100644 index 0000000..1d53554 --- /dev/null +++ b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenSupportNormalization.lean @@ -0,0 +1,894 @@ +/- +Copyright (c) 2026 Asher Yan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Asher Yan with Codex +-/ +module + +public import CryptBoolean.Carlet.Chapter03.ReedMullerWeightSixteenSelfDual +public import CryptBoolean.Carlet.Chapter04.AlgebraicImmunityBounds +public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightSixteenSystematicEncoding + +/-! +# Normalize full-span weight-sixteen supports + +A basis of seven actual support differences identifies a full-span +weight-sixteen support with a normalized subset of the seven-variable cube. +The eight points outside the affine basis give a sorted systematic code whose +columns are orthonormal. +-/ + +open Finset +open scoped BigOperators BooleanCube + +@[expose] public section + +namespace CryptBoolean + +variable {n : ℕ} + +/-- The inverse-image support under seven-variable affine-map data. -/ +noncomputable def normalizedRankSevenSupport + (h : BooleanFunction n) (d : SevenVariableAffineMapData n) : + Finset (FABL.F₂Cube 7) := + Finset.univ.filter fun x ↦ sevenVariableAffinePoint d x ∈ support h + +@[simp] theorem mem_normalizedRankSevenSupport + (h : BooleanFunction n) (d : SevenVariableAffineMapData n) + (x : FABL.F₂Cube 7) : + x ∈ normalizedRankSevenSupport h d ↔ + sevenVariableAffinePoint d x ∈ support h := by + simp [normalizedRankSevenSupport] + +/-- If the seven directions span the support-difference space, the normalized +support maps exactly onto the original support. -/ +theorem image_normalizedRankSevenSupport_eq_support + (h : BooleanFunction n) (d : SevenVariableAffineMapData n) + (hspan : Submodule.span FABL.𝔽₂ (Set.range d.2) = + supportDifferenceSpan h d.1) : + (normalizedRankSevenSupport h d).image + (sevenVariableAffinePoint d) = support h := by + classical + ext y + constructor + · intro hy + obtain ⟨x, hx, rfl⟩ := Finset.mem_image.mp hy + exact (mem_normalizedRankSevenSupport h d x).mp hx + · intro hy + have hySpan : y + d.1 ∈ supportDifferenceSpan h d.1 := by + have hyAffine := + support_subset_binaryAffineSubspace_supportDifferenceSpan h d.1 hy + change y ∈ FABL.binaryAffineSubspace + (supportDifferenceSpan h d.1) d.1 at hyAffine + rw [FABL.mem_binaryAffineSubspace_iff_add_mem] at hyAffine + exact hyAffine + rw [← hspan, ← Fintype.range_linearCombination] at hySpan + obtain ⟨x, hx⟩ := hySpan + have hpoint : sevenVariableAffinePoint d x = y := by + rw [sevenVariableAffinePoint, + ← Fintype.linearCombination_apply, hx] + calc + d.1 + (y + d.1) = y + (d.1 + d.1) := by abel + _ = y := by rw [ZModModule.add_self, add_zero] + exact Finset.mem_image.mpr ⟨x, + (mem_normalizedRankSevenSupport h d x).mpr (hpoint ▸ hy), hpoint⟩ + +/-- Pack eight little-endian eight-bit columns into one 64-bit word. -/ +def packSystematicWeightSixteenColumns + (columns : Fin 8 → BitVec 8) : BitVec 64 := + columns 7 ++ (columns 6 ++ (columns 5 ++ (columns 4 ++ + (columns 3 ++ (columns 2 ++ (columns 1 ++ columns 0)))))) + +@[simp] theorem systematicWeightSixteenColumn_pack + (columns : Fin 8 → BitVec 8) (i : Fin 8) : + systematicWeightSixteenColumn + (packSystematicWeightSixteenColumns columns) i = columns i := by + fin_cases i <;> + simp only [systematicWeightSixteenColumn, + packSystematicWeightSixteenColumns] + all_goals + repeat' (rw [BitVec.extractLsb'_append_eq_ite] <;> norm_num) + all_goals simp + +/-- Every point column has odd Hamming weight. -/ +theorem systematicWeightSixteenPointColumn_odd + (x : FABL.F₂Cube 7) : + (systematicWeightSixteenPointColumn x).cpop.getLsbD 0 = true := by + revert x + set_option maxRecDepth 100000 in decide + +/-- A point column is nonunit exactly away from the normalized affine basis. -/ +theorem systematicWeightSixteenPointColumn_nonunit_iff + (x : FABL.F₂Cube 7) : + ((systematicWeightSixteenPointColumn x) &&& + (systematicWeightSixteenPointColumn x - 1) != 0) = + decide (x ∉ systematicWeightSixteenFixedPoints) := by + revert x + set_option maxRecDepth 100000 in decide + +/-- Interpret one Boolean bit as a binary-field element. -/ +def boolF₂ (b : Bool) : FABL.𝔽₂ := + if b then 1 else 0 + +/-- Deciding whether a binary-field element is one recovers that element. -/ +@[simp] theorem boolF₂_decide_eq_one (a : FABL.𝔽₂) : + boolF₂ (decide (a = 1)) = a := by + by_cases ha : a = 0 + · simp [ha, boolF₂] + · have haOne : a = 1 := Fin.eq_one_of_ne_zero a ha + simp [haOne, boolF₂] + +/-- Deciding whether a binary-field element is zero gives its complement. -/ +@[simp] theorem boolF₂_decide_eq_zero (a : FABL.𝔽₂) : + boolF₂ (decide (a = 0)) = 1 + a := by + by_cases ha : a = 0 + · simp [ha, boolF₂] + · have haOne : a = 1 := Fin.eq_one_of_ne_zero a ha + simp [haOne, boolF₂] + +/-- Interpret an eight-bit word as a binary vector. -/ +def bitVecEightF₂ (x : BitVec 8) : FABL.F₂Cube 8 := + fun i ↦ boolF₂ (x.getLsbD i) + +@[simp] theorem boolF₂_and (a b : Bool) : + boolF₂ (a && b) = boolF₂ a * boolF₂ b := by + cases a <;> cases b <;> rfl + +@[simp] theorem boolF₂_xor (a b : Bool) : + boolF₂ (Bool.xor a b) = boolF₂ a + boolF₂ b := by + cases a <;> cases b <;> decide + +/-- The explicit parity of the eight coordinatewise conjunctions. -/ +def bitVecEightAndParity (x y : BitVec 8) : Bool := + Bool.xor (x.getLsbD 0 && y.getLsbD 0) + (Bool.xor (x.getLsbD 1 && y.getLsbD 1) + (Bool.xor (x.getLsbD 2 && y.getLsbD 2) + (Bool.xor (x.getLsbD 3 && y.getLsbD 3) + (Bool.xor (x.getLsbD 4 && y.getLsbD 4) + (Bool.xor (x.getLsbD 5 && y.getLsbD 5) + (Bool.xor (x.getLsbD 6 && y.getLsbD 6) + (x.getLsbD 7 && y.getLsbD 7))))))) + +theorem bitVecEight_cpop_and_lsb_zero + (x y : BitVec 8) : + (x &&& y).cpop.getLsbD 0 = bitVecEightAndParity x y := by + unfold bitVecEightAndParity + bv_decide + +theorem bitVecEight_cpop_and_odd_iff_dotProduct_one + (x y : BitVec 8) : + (x &&& y).cpop.getLsbD 0 = true ↔ + FABL.f₂DotProduct (bitVecEightF₂ x) (bitVecEightF₂ y) = 1 := by + rw [bitVecEight_cpop_and_lsb_zero] + have hdot : + FABL.f₂DotProduct (bitVecEightF₂ x) (bitVecEightF₂ y) = + boolF₂ (bitVecEightAndParity x y) := by + unfold FABL.f₂DotProduct dotProduct bitVecEightF₂ + bitVecEightAndParity + simp only [Fin.sum_univ_succ, Fin.sum_univ_zero, add_zero] + simp only [boolF₂_xor, boolF₂_and] + norm_num + rw [hdot] + unfold boolF₂ + cases bitVecEightAndParity x y <;> simp + +theorem bitVecEight_cpop_and_even_iff_dotProduct_zero + (x y : BitVec 8) : + (x &&& y).cpop.getLsbD 0 = false ↔ + FABL.f₂DotProduct (bitVecEightF₂ x) (bitVecEightF₂ y) = 0 := by + constructor + · intro heven + by_contra hdot + have hdotOne : + FABL.f₂DotProduct (bitVecEightF₂ x) (bitVecEightF₂ y) = 1 := + Fin.eq_one_of_ne_zero _ hdot + have hodd := + (bitVecEight_cpop_and_odd_iff_dotProduct_one x y).mpr hdotOne + rw [heven] at hodd + exact Bool.false_ne_true hodd + · intro hdot + by_contra heven + have hodd : (x &&& y).cpop.getLsbD 0 = true := + Bool.eq_true_of_not_eq_false heven + have hdotOne := + (bitVecEight_cpop_and_odd_iff_dotProduct_one x y).mp hodd + rw [hdot] at hdotOne + exact zero_ne_one hdotOne + +theorem areSystematicWeightSixteenColumnsOrthogonal_iff + (x y : BitVec 8) : + areSystematicWeightSixteenColumnsOrthogonal x y = true ↔ + FABL.f₂DotProduct (bitVecEightF₂ x) (bitVecEightF₂ y) = 0 := by + rw [← bitVecEight_cpop_and_even_iff_dotProduct_zero] + simp [areSystematicWeightSixteenColumnsOrthogonal] + +/-- The normalized support has the original weight when the affine map is +injective and spans all support differences. -/ +theorem card_normalizedRankSevenSupport + (h : BooleanFunction n) (d : SevenVariableAffineMapData n) + (hd : LinearIndependent FABL.𝔽₂ d.2) + (hspan : Submodule.span FABL.𝔽₂ (Set.range d.2) = + supportDifferenceSpan h d.1) : + (normalizedRankSevenSupport h d).card = hammingWeight h := by + have himage := image_normalizedRankSevenSupport_eq_support h d hspan + have hinjective : Function.Injective (sevenVariableAffinePoint d) := + (sevenVariableAffinePoint_injective_iff d).2 hd + have hcard := congrArg Finset.card himage + rw [Finset.card_image_of_injective _ hinjective, + ← hammingWeight_eq_card_support] at hcard + exact hcard + +/-- Actual support-difference basis vectors put zero and the seven coordinate +points into the normalized support. -/ +theorem systematicWeightSixteenFixedPoints_subset_normalizedRankSevenSupport + (h : BooleanFunction n) (p : FABL.F₂Cube n) + (v : Fin 7 → FABL.F₂Cube n) (hp : p ∈ support h) + (hv : ∀ i, v i ∈ supportDifferences h p) : + systematicWeightSixteenFixedPoints ⊆ + normalizedRankSevenSupport h (p, v) := by + intro x hx + simp only [systematicWeightSixteenFixedPoints, Finset.mem_union, + Finset.mem_singleton, Finset.mem_image, Finset.mem_univ, true_and] at hx + obtain rfl | ⟨i, rfl⟩ := hx + · simpa [sevenVariableAffinePoint] using hp + · obtain ⟨y, hy, hvEq⟩ := hv i + have hySupport : y ∈ support h := (Finset.mem_erase.mp hy).2 + rw [mem_normalizedRankSevenSupport] + have hpoint : + sevenVariableAffinePoint (p, v) (Pi.single i (1 : FABL.𝔽₂)) = y := by + change p + Fintype.linearCombination FABL.𝔽₂ v + (Pi.single i (1 : FABL.𝔽₂)) = y + rw [Fintype.linearCombination_apply_single, one_smul] + rw [hvEq] + calc + p + (y + p) = y + (p + p) := by abel + _ = y := by rw [ZModModule.add_self, add_zero] + simpa only [hpoint] using hySupport + +/-- A linear left inverse of the seven selected support directions, translated +to an affine projection sending the selected basepoint to zero. -/ +noncomputable def rankSevenAffineProjection + (d : SevenVariableAffineMapData n) : + FABL.F₂Cube n →ᵃ[FABL.𝔽₂] FABL.F₂Cube 7 where + toFun y := (Fintype.linearCombination FABL.𝔽₂ d.2).leftInverse (y + d.1) + linear := (Fintype.linearCombination FABL.𝔽₂ d.2).leftInverse + map_vadd' y v := by + change (Fintype.linearCombination FABL.𝔽₂ d.2).leftInverse + (v + y + d.1) = + (Fintype.linearCombination FABL.𝔽₂ d.2).leftInverse v + + (Fintype.linearCombination FABL.𝔽₂ d.2).leftInverse (y + d.1) + rw [show v + y + d.1 = v + (y + d.1) by abel, map_add] + +/-- The affine projection is a left inverse to the selected affine embedding. -/ +theorem rankSevenAffineProjection_sevenVariableAffinePoint + (d : SevenVariableAffineMapData n) + (hd : LinearIndependent FABL.𝔽₂ d.2) + (x : FABL.F₂Cube 7) : + rankSevenAffineProjection d (sevenVariableAffinePoint d x) = x := by + have hinjective : Function.Injective + (Fintype.linearCombination FABL.𝔽₂ d.2) := by + intro a b hab + have haffine : sevenVariableAffinePoint d a = + sevenVariableAffinePoint d b := by + change d.1 + Fintype.linearCombination FABL.𝔽₂ d.2 a = + d.1 + Fintype.linearCombination FABL.𝔽₂ d.2 b + rw [hab] + exact (sevenVariableAffinePoint_injective_iff d).2 hd haffine + have hker : LinearMap.ker (Fintype.linearCombination FABL.𝔽₂ d.2) = ⊥ := + LinearMap.ker_eq_bot.mpr hinjective + change (Fintype.linearCombination FABL.𝔽₂ d.2).leftInverse + (d.1 + Fintype.linearCombination FABL.𝔽₂ d.2 x + d.1) = x + rw [show d.1 + Fintype.linearCombination FABL.𝔽₂ d.2 x + d.1 = + Fintype.linearCombination FABL.𝔽₂ d.2 x by + calc + d.1 + Fintype.linearCombination FABL.𝔽₂ d.2 x + d.1 = + Fintype.linearCombination FABL.𝔽₂ d.2 x + (d.1 + d.1) := by + abel + _ = Fintype.linearCombination FABL.𝔽₂ d.2 x := by + rw [ZModModule.add_self, add_zero]] + exact LinearMap.leftInverse_apply_of_inj hker x + +/-- The `i`th binary row of the transformed affine-evaluation matrix. -/ +def systematicWeightSixteenPointCoordinate + (i : Fin 8) : BooleanFunction 7 := + fun x ↦ bitVecEightF₂ (systematicWeightSixteenPointColumn x) i + +@[simp] theorem systematicWeightSixteenPointCoordinate_zero + (x : FABL.F₂Cube 7) : + systematicWeightSixteenPointCoordinate 0 x = + 1 + ∑ j : Fin 7, x j := by + simp [systematicWeightSixteenPointCoordinate, bitVecEightF₂, + systematicWeightSixteenPointColumn] + +@[simp] theorem systematicWeightSixteenPointCoordinate_succ + (j : Fin 7) (x : FABL.F₂Cube 7) : + systematicWeightSixteenPointCoordinate j.succ x = x j := by + have hj : (j : ℕ) + 1 < 8 := by omega + simp [systematicWeightSixteenPointCoordinate, bitVecEightF₂, + systematicWeightSixteenPointColumn, hj] + +/-- Every transformed systematic row is affine. -/ +theorem systematicWeightSixteenPointCoordinate_mem_reedMuller_one + (i : Fin 8) : + systematicWeightSixteenPointCoordinate i ∈ reedMuller 1 7 := by + classical + refine Fin.cases ?_ (fun j ↦ ?_) i + · have hcoordinate : + systematicWeightSixteenPointCoordinate (0 : Fin 8) = + FABL.affineFunction 1 + (fun _ : Fin 7 ↦ (1 : FABL.𝔽₂)) := by + funext x + simp [FABL.affineFunction, FABL.f₂DotProduct, dotProduct] + rw [hcoordinate] + exact affineFunction_mem_reedMuller_one _ _ + · have hcoordinate : + systematicWeightSixteenPointCoordinate j.succ = + FABL.affineFunction 0 + (Pi.single j (1 : FABL.𝔽₂)) := by + funext x + simp [FABL.affineFunction, FABL.f₂DotProduct] + rw [hcoordinate] + exact affineFunction_mem_reedMuller_one _ _ + +private theorem booleanFunctionPairing_eq_sum_support_right + (f h : BooleanFunction n) : + booleanFunctionPairing n f h = ∑ x ∈ support h, f x := by + rw [booleanFunctionPairing_apply] + rw [support, FABL.f₂OneSupport, Finset.sum_filter] + apply Finset.sum_congr rfl + intro x _hx + by_cases hhx : h x = 0 + · simp [hhx] + · have hhxOne : h x = 1 := Fin.eq_one_of_ne_zero _ hhx + simp [hhxOne] + +/-- Orthogonality to ambient quadratics makes every pair of transformed +systematic rows orthogonal on the full normalized support. -/ +theorem normalizedRankSevenSupport_pointCoordinate_gram_zero + (h : BooleanFunction n) (d : SevenVariableAffineMapData n) + (hd : LinearIndependent FABL.𝔽₂ d.2) + (hspan : Submodule.span FABL.𝔽₂ (Set.range d.2) = + supportDifferenceSpan h d.1) + (hdual : h ∈ reedMullerDual 2 n) + (i j : Fin 8) : + (∑ x ∈ normalizedRankSevenSupport h d, + systematicWeightSixteenPointCoordinate i x * + systematicWeightSixteenPointCoordinate j x) = 0 := by + let projection := rankSevenAffineProjection d + let left : BooleanFunction n := + systematicWeightSixteenPointCoordinate i ∘ projection + let right : BooleanFunction n := + systematicWeightSixteenPointCoordinate j ∘ projection + have hleftDegree : FABL.functionAlgebraicDegree left ≤ 1 := by + exact (functionAlgebraicDegree_comp_affineMap_le_general + (systematicWeightSixteenPointCoordinate i) projection).trans + (systematicWeightSixteenPointCoordinate_mem_reedMuller_one i) + have hrightDegree : FABL.functionAlgebraicDegree right ≤ 1 := by + exact (functionAlgebraicDegree_comp_affineMap_le_general + (systematicWeightSixteenPointCoordinate j) projection).trans + (systematicWeightSixteenPointCoordinate_mem_reedMuller_one j) + have hproduct : left * right ∈ reedMuller 2 n := by + rw [mem_reedMuller_iff] + exact (FABL.functionAlgebraicDegree_mul_le_add left right).trans + (by omega) + have hpair : booleanFunctionPairing n (left * right) h = 0 := by + exact hdual (left * right) hproduct + rw [booleanFunctionPairing_eq_sum_support_right] at hpair + have himage := image_normalizedRankSevenSupport_eq_support h d hspan + rw [← himage, Finset.sum_image + ((sevenVariableAffinePoint_injective_iff d).2 hd).injOn] at hpair + simpa only [Pi.mul_apply, Function.comp_apply, left, right, projection, + rankSevenAffineProjection_sevenVariableAffinePoint d hd] using hpair + +/-- The eight normalized points outside the affine basis. -/ +noncomputable def normalizedRankSevenRemainder + (h : BooleanFunction n) (d : SevenVariableAffineMapData n) : + Finset (FABL.F₂Cube 7) := + normalizedRankSevenSupport h d \ systematicWeightSixteenFixedPoints + +/-- Their corresponding systematic columns. -/ +noncomputable def normalizedRankSevenRemainingColumns + (h : BooleanFunction n) (d : SevenVariableAffineMapData n) : + Finset (BitVec 8) := + (normalizedRankSevenRemainder h d).image + systematicWeightSixteenPointColumn + +private def normalizedRankSevenFixedPointFamily + (i : Fin 8) : FABL.F₂Cube 7 := + Fin.cases 0 (fun j ↦ Pi.single j (1 : FABL.𝔽₂)) i + +private theorem image_normalizedRankSevenFixedPointFamily : + (Finset.univ : Finset (Fin 8)).image + normalizedRankSevenFixedPointFamily = + systematicWeightSixteenFixedPoints := by + classical + ext x + constructor + · intro hx + obtain ⟨i, _hi, rfl⟩ := Finset.mem_image.mp hx + refine Fin.cases ?_ (fun j ↦ ?_) i + · simp [normalizedRankSevenFixedPointFamily, + systematicWeightSixteenFixedPoints] + · simp [normalizedRankSevenFixedPointFamily, + systematicWeightSixteenFixedPoints] + · intro hx + simp only [systematicWeightSixteenFixedPoints, Finset.mem_union, + Finset.mem_singleton, Finset.mem_image, Finset.mem_univ, + true_and] at hx + obtain rfl | ⟨j, rfl⟩ := hx + · exact Finset.mem_image.mpr ⟨0, by simp, + by simp [normalizedRankSevenFixedPointFamily]⟩ + · exact Finset.mem_image.mpr ⟨j.succ, by simp, + by simp [normalizedRankSevenFixedPointFamily]⟩ + +@[simp] private theorem + systematicWeightSixteenPointCoordinate_fixedPointFamily + (i k : Fin 8) : + systematicWeightSixteenPointCoordinate i + (normalizedRankSevenFixedPointFamily k) = + if i = k then 1 else 0 := by + classical + have hsumSingle (j : Fin 7) : + (∑ k : Fin 7, (Pi.single j (1 : FABL.𝔽₂)) k) = 1 := by + rw [Fintype.sum_eq_single j] + · simp + · intro k hkj + exact Pi.single_eq_of_ne hkj _ + refine Fin.cases ?_ (fun j ↦ ?_) i + · refine Fin.cases ?_ (fun k ↦ ?_) k + · simp [normalizedRankSevenFixedPointFamily] + · have hne : (0 : Fin 8) ≠ k.succ := + Ne.symm (Fin.succ_ne_zero k) + simp [normalizedRankSevenFixedPointFamily, hsumSingle, hne] + · refine Fin.cases ?_ (fun k ↦ ?_) k + · simp [normalizedRankSevenFixedPointFamily] + · by_cases hjk : j = k + · subst k + simp [normalizedRankSevenFixedPointFamily] + · rw [systematicWeightSixteenPointCoordinate_succ] + simp [normalizedRankSevenFixedPointFamily, hjk] + +private theorem normalizedRankSevenFixedPointFamily_injective : + Function.Injective normalizedRankSevenFixedPointFamily := by + intro i k hik + by_contra hne + have heval := congrArg + (systematicWeightSixteenPointCoordinate i) hik + simp [hne] at heval + +/-- The fixed normalized affine-basis columns contribute the identity Gram +matrix. -/ +theorem systematicWeightSixteenFixedPoints_gram + (i j : Fin 8) : + (∑ x ∈ systematicWeightSixteenFixedPoints, + systematicWeightSixteenPointCoordinate i x * + systematicWeightSixteenPointCoordinate j x) = + (1 : Matrix (Fin 8) (Fin 8) FABL.𝔽₂) i j := by + classical + rw [← image_normalizedRankSevenFixedPointFamily, + Finset.sum_image normalizedRankSevenFixedPointFamily_injective.injOn] + simp only [systematicWeightSixteenPointCoordinate_fixedPointFamily] + rw [Finset.sum_eq_single i] + · simp [Matrix.one_apply, eq_comm] + · intro k _hk hki + simp [Ne.symm hki] + · simp + +/-- The remainder contains exactly eight points. -/ +theorem card_normalizedRankSevenRemainder + (h : BooleanFunction n) (d : SevenVariableAffineMapData n) + (hd : LinearIndependent FABL.𝔽₂ d.2) + (hspan : Submodule.span FABL.𝔽₂ (Set.range d.2) = + supportDifferenceSpan h d.1) + (hweight : hammingWeight h = 16) + (hfixed : systematicWeightSixteenFixedPoints ⊆ + normalizedRankSevenSupport h d) : + (normalizedRankSevenRemainder h d).card = 8 := by + rw [normalizedRankSevenRemainder, + Finset.card_sdiff_of_subset hfixed, + card_normalizedRankSevenSupport h d hd hspan, hweight, + card_systematicWeightSixteenFixedPoints] + +/-- The remainder columns are distinct and hence also number eight. -/ +theorem card_normalizedRankSevenRemainingColumns + (h : BooleanFunction n) (d : SevenVariableAffineMapData n) + (hd : LinearIndependent FABL.𝔽₂ d.2) + (hspan : Submodule.span FABL.𝔽₂ (Set.range d.2) = + supportDifferenceSpan h d.1) + (hweight : hammingWeight h = 16) + (hfixed : systematicWeightSixteenFixedPoints ⊆ + normalizedRankSevenSupport h d) : + (normalizedRankSevenRemainingColumns h d).card = 8 := by + rw [normalizedRankSevenRemainingColumns, + Finset.card_image_of_injective _ + systematicWeightSixteenPointColumn_injective, + card_normalizedRankSevenRemainder h d hd hspan hweight hfixed] + +local instance bitVecEightLinearOrder : LinearOrder (BitVec 8) := + LinearOrder.lift' BitVec.toNat + (fun _ _ h ↦ BitVec.eq_of_toNat_eq h) + +/-- The canonical increasing enumeration of the eight remaining columns. -/ +noncomputable def normalizedRankSevenRemainingColumnOrderEmbedding + (h : BooleanFunction n) (d : SevenVariableAffineMapData n) + (hd : LinearIndependent FABL.𝔽₂ d.2) + (hspan : Submodule.span FABL.𝔽₂ (Set.range d.2) = + supportDifferenceSpan h d.1) + (hweight : hammingWeight h = 16) + (hfixed : systematicWeightSixteenFixedPoints ⊆ + normalizedRankSevenSupport h d) : + Fin 8 ↪o BitVec 8 := + (normalizedRankSevenRemainingColumns h d).orderEmbOfFin + (card_normalizedRankSevenRemainingColumns + h d hd hspan hweight hfixed) + +/-- The canonical remaining-column enumeration is injective. -/ +theorem normalizedRankSevenRemainingColumnOrderEmbedding_injective + (h : BooleanFunction n) (d : SevenVariableAffineMapData n) + (hd : LinearIndependent FABL.𝔽₂ d.2) + (hspan : Submodule.span FABL.𝔽₂ (Set.range d.2) = + supportDifferenceSpan h d.1) + (hweight : hammingWeight h = 16) + (hfixed : systematicWeightSixteenFixedPoints ⊆ + normalizedRankSevenSupport h d) : + Function.Injective + (normalizedRankSevenRemainingColumnOrderEmbedding + h d hd hspan hweight hfixed) := + (normalizedRankSevenRemainingColumnOrderEmbedding + h d hd hspan hweight hfixed).injective + +/-- The canonical remaining-column enumeration is strictly increasing. -/ +theorem normalizedRankSevenRemainingColumnOrderEmbedding_strictMono + (h : BooleanFunction n) (d : SevenVariableAffineMapData n) + (hd : LinearIndependent FABL.𝔽₂ d.2) + (hspan : Submodule.span FABL.𝔽₂ (Set.range d.2) = + supportDifferenceSpan h d.1) + (hweight : hammingWeight h = 16) + (hfixed : systematicWeightSixteenFixedPoints ⊆ + normalizedRankSevenSupport h d) : + StrictMono (normalizedRankSevenRemainingColumnOrderEmbedding + h d hd hspan hweight hfixed) := + (normalizedRankSevenRemainingColumnOrderEmbedding + h d hd hspan hweight hfixed).strictMono + +/-- The canonical enumeration has exactly the remaining columns as its image. -/ +theorem image_normalizedRankSevenRemainingColumnOrderEmbedding_univ + (h : BooleanFunction n) (d : SevenVariableAffineMapData n) + (hd : LinearIndependent FABL.𝔽₂ d.2) + (hspan : Submodule.span FABL.𝔽₂ (Set.range d.2) = + supportDifferenceSpan h d.1) + (hweight : hammingWeight h = 16) + (hfixed : systematicWeightSixteenFixedPoints ⊆ + normalizedRankSevenSupport h d) : + (Finset.univ : Finset (Fin 8)).image + (normalizedRankSevenRemainingColumnOrderEmbedding + h d hd hspan hweight hfixed) = + normalizedRankSevenRemainingColumns h d := by + apply Finset.eq_of_subset_of_card_le + · intro column hcolumn + obtain ⟨i, _hi, rfl⟩ := Finset.mem_image.mp hcolumn + unfold normalizedRankSevenRemainingColumnOrderEmbedding + exact Finset.orderEmbOfFin_mem + (normalizedRankSevenRemainingColumns h d) + (card_normalizedRankSevenRemainingColumns + h d hd hspan hweight hfixed) i + · rw [card_normalizedRankSevenRemainingColumns + h d hd hspan hweight hfixed, + Finset.card_image_of_injective _ + (normalizedRankSevenRemainingColumnOrderEmbedding_injective + h d hd hspan hweight hfixed)] + simp + +/-- Every canonically enumerated column belongs to the remaining-column set. -/ +theorem normalizedRankSevenRemainingColumnOrderEmbedding_mem + (h : BooleanFunction n) (d : SevenVariableAffineMapData n) + (hd : LinearIndependent FABL.𝔽₂ d.2) + (hspan : Submodule.span FABL.𝔽₂ (Set.range d.2) = + supportDifferenceSpan h d.1) + (hweight : hammingWeight h = 16) + (hfixed : systematicWeightSixteenFixedPoints ⊆ + normalizedRankSevenSupport h d) + (i : Fin 8) : + normalizedRankSevenRemainingColumnOrderEmbedding + h d hd hspan hweight hfixed i ∈ + normalizedRankSevenRemainingColumns h d := by + rw [← image_normalizedRankSevenRemainingColumnOrderEmbedding_univ + h d hd hspan hweight hfixed] + exact Finset.mem_image.mpr ⟨i, Finset.mem_univ i, rfl⟩ + +/-- The packed constraints follow from nonunit columns, sorted order, and +pairwise orthogonality. -/ +theorem systematicWeightSixteenConstraints_pack_of + (columns : Fin 8 → BitVec 8) + (hnonunit : ∀ i, + isSystematicWeightSixteenNonunitOddColumn (columns i) = true) + (hstrict : StrictMono columns) + (horthogonal : ∀ i j, i ≠ j → + areSystematicWeightSixteenColumnsOrthogonal + (columns i) (columns j) = true) : + SystematicWeightSixteenConstraints + (packSystematicWeightSixteenColumns columns) = true := by + have hcolumn0 : systematicWeightSixteenColumn + (packSystematicWeightSixteenColumns columns) 0 = columns 0 := by + simpa using systematicWeightSixteenColumn_pack columns (0 : Fin 8) + have hcolumn1 : systematicWeightSixteenColumn + (packSystematicWeightSixteenColumns columns) 1 = columns 1 := by + simpa using systematicWeightSixteenColumn_pack columns (1 : Fin 8) + have hcolumn2 : systematicWeightSixteenColumn + (packSystematicWeightSixteenColumns columns) 2 = columns 2 := by + simpa using systematicWeightSixteenColumn_pack columns (2 : Fin 8) + have hcolumn3 : systematicWeightSixteenColumn + (packSystematicWeightSixteenColumns columns) 3 = columns 3 := by + simpa using systematicWeightSixteenColumn_pack columns (3 : Fin 8) + have hcolumn4 : systematicWeightSixteenColumn + (packSystematicWeightSixteenColumns columns) 4 = columns 4 := by + simpa using systematicWeightSixteenColumn_pack columns (4 : Fin 8) + have hcolumn5 : systematicWeightSixteenColumn + (packSystematicWeightSixteenColumns columns) 5 = columns 5 := by + simpa using systematicWeightSixteenColumn_pack columns (5 : Fin 8) + have hcolumn6 : systematicWeightSixteenColumn + (packSystematicWeightSixteenColumns columns) 6 = columns 6 := by + simpa using systematicWeightSixteenColumn_pack columns (6 : Fin 8) + have hcolumn7 : systematicWeightSixteenColumn + (packSystematicWeightSixteenColumns columns) 7 = columns 7 := by + simpa using systematicWeightSixteenColumn_pack columns (7 : Fin 8) + unfold SystematicWeightSixteenConstraints + simp only [hcolumn0, hcolumn1, hcolumn2, hcolumn3, hcolumn4, hcolumn5, + hcolumn6, hcolumn7] + simp only [hnonunit] + simp only [BitVec.ult_eq_decide_lt] + simp only [hstrict (by decide : (0 : Fin 8) < 1), + hstrict (by decide : (1 : Fin 8) < 2), + hstrict (by decide : (2 : Fin 8) < 3), + hstrict (by decide : (3 : Fin 8) < 4), + hstrict (by decide : (4 : Fin 8) < 5), + hstrict (by decide : (5 : Fin 8) < 6), + hstrict (by decide : (6 : Fin 8) < 7)] + simp only [ + horthogonal 0 1 (by decide), horthogonal 0 2 (by decide), + horthogonal 0 3 (by decide), horthogonal 0 4 (by decide), + horthogonal 0 5 (by decide), horthogonal 0 6 (by decide), + horthogonal 0 7 (by decide), horthogonal 1 2 (by decide), + horthogonal 1 3 (by decide), horthogonal 1 4 (by decide), + horthogonal 1 5 (by decide), horthogonal 1 6 (by decide), + horthogonal 1 7 (by decide), horthogonal 2 3 (by decide), + horthogonal 2 4 (by decide), horthogonal 2 5 (by decide), + horthogonal 2 6 (by decide), horthogonal 2 7 (by decide), + horthogonal 3 4 (by decide), horthogonal 3 5 (by decide), + horthogonal 3 6 (by decide), horthogonal 3 7 (by decide), + horthogonal 4 5 (by decide), horthogonal 4 6 (by decide), + horthogonal 4 7 (by decide), horthogonal 5 6 (by decide), + horthogonal 5 7 (by decide), horthogonal 6 7 (by decide)] + rfl + +/-- Removing the fixed identity columns from the full zero Gram leaves the +identity Gram on the eight remaining points. -/ +theorem normalizedRankSevenRemainder_pointCoordinate_gram_one + (h : BooleanFunction n) (d : SevenVariableAffineMapData n) + (hd : LinearIndependent FABL.𝔽₂ d.2) + (hspan : Submodule.span FABL.𝔽₂ (Set.range d.2) = + supportDifferenceSpan h d.1) + (hdual : h ∈ reedMullerDual 2 n) + (hfixed : systematicWeightSixteenFixedPoints ⊆ + normalizedRankSevenSupport h d) + (i j : Fin 8) : + (∑ x ∈ normalizedRankSevenRemainder h d, + systematicWeightSixteenPointCoordinate i x * + systematicWeightSixteenPointCoordinate j x) = + (1 : Matrix (Fin 8) (Fin 8) FABL.𝔽₂) i j := by + have hfull := normalizedRankSevenSupport_pointCoordinate_gram_zero + h d hd hspan hdual i j + rw [← Finset.union_sdiff_of_subset hfixed] at hfull + rw [Finset.sum_union Finset.disjoint_sdiff] at hfull + rw [systematicWeightSixteenFixedPoints_gram] at hfull + change (∑ x ∈ normalizedRankSevenSupport h d \ + systematicWeightSixteenFixedPoints, + systematicWeightSixteenPointCoordinate i x * + systematicWeightSixteenPointCoordinate j x) = + (1 : Matrix (Fin 8) (Fin 8) FABL.𝔽₂) i j + exact (ZMod.neg_eq_self_mod_two _).symm.trans + (add_eq_zero_iff_eq_neg.mp hfull).symm + +/-- The binary matrix whose columns are the given eight-bit words. -/ +def systematicWeightSixteenColumnMatrix + (columns : Fin 8 → BitVec 8) : + Matrix (Fin 8) (Fin 8) FABL.𝔽₂ := + fun i k ↦ bitVecEightF₂ (columns k) i + +/-- Enumerating the remaining point columns transports their identity row +Gram to the corresponding square binary matrix. -/ +theorem normalizedRankSevenColumnEnumeration_rowGram + (h : BooleanFunction n) (d : SevenVariableAffineMapData n) + (columns : Fin 8 → BitVec 8) + (hinjective : Function.Injective columns) + (henumerates : (Finset.univ : Finset (Fin 8)).image columns = + normalizedRankSevenRemainingColumns h d) + (hgram : ∀ i j : Fin 8, + (∑ x ∈ normalizedRankSevenRemainder h d, + systematicWeightSixteenPointCoordinate i x * + systematicWeightSixteenPointCoordinate j x) = + (1 : Matrix (Fin 8) (Fin 8) FABL.𝔽₂) i j) : + systematicWeightSixteenColumnMatrix columns * + Matrix.transpose (systematicWeightSixteenColumnMatrix columns) = 1 := by + ext i j + simp only [Matrix.mul_apply, Matrix.transpose_apply, + systematicWeightSixteenColumnMatrix] + calc + (∑ k : Fin 8, + bitVecEightF₂ (columns k) i * bitVecEightF₂ (columns k) j) = + Finset.sum (normalizedRankSevenRemainingColumns h d) (fun c ↦ + bitVecEightF₂ c i * bitVecEightF₂ c j) := by + rw [← henumerates, Finset.sum_image hinjective.injOn] + _ = Finset.sum (normalizedRankSevenRemainder h d) (fun x ↦ + systematicWeightSixteenPointCoordinate i x * + systematicWeightSixteenPointCoordinate j x) := by + rw [normalizedRankSevenRemainingColumns, + Finset.sum_image + systematicWeightSixteenPointColumn_injective.injOn] + rfl + _ = (1 : Matrix (Fin 8) (Fin 8) FABL.𝔽₂) i j := hgram i j + +/-- A square binary matrix with identity row Gram also has identity column +Gram, so distinct enumerated columns have zero binary dot product. -/ +theorem normalizedRankSevenColumnEnumeration_dotProduct_zero + (columns : Fin 8 → BitVec 8) + (hrow : systematicWeightSixteenColumnMatrix columns * + Matrix.transpose (systematicWeightSixteenColumnMatrix columns) = 1) + (i j : Fin 8) (hij : i ≠ j) : + FABL.f₂DotProduct (bitVecEightF₂ (columns i)) + (bitVecEightF₂ (columns j)) = 0 := by + have hcolumn := mul_eq_one_symm hrow + have hijEntry := congrFun (congrFun hcolumn i) j + simpa only [Matrix.mul_apply, Matrix.transpose_apply, + systematicWeightSixteenColumnMatrix, FABL.f₂DotProduct, dotProduct, + Matrix.one_apply, hij, + ↓reduceIte] using hijEntry + +/-- Every column arising from a remaining normalized point is odd and avoids +the eight identity columns. -/ +theorem normalizedRankSevenRemainingColumn_nonunitOdd + (h : BooleanFunction n) (d : SevenVariableAffineMapData n) + (column : BitVec 8) + (hcolumn : column ∈ normalizedRankSevenRemainingColumns h d) : + isSystematicWeightSixteenNonunitOddColumn column = true := by + rw [normalizedRankSevenRemainingColumns] at hcolumn + obtain ⟨x, hx, rfl⟩ := Finset.mem_image.mp hcolumn + have hxNotFixed : x ∉ systematicWeightSixteenFixedPoints := + (Finset.mem_sdiff.mp hx).2 + unfold isSystematicWeightSixteenNonunitOddColumn + rw [systematicWeightSixteenPointColumn_odd, + systematicWeightSixteenPointColumn_nonunit_iff] + simp [hxNotFixed] + +/-- Decoding any injective enumeration of all remaining columns recovers the +remaining normalized point set. -/ +theorem normalizedRankSevenColumnEnumeration_decode + (h : BooleanFunction n) (d : SevenVariableAffineMapData n) + (columns : Fin 8 → BitVec 8) + (henumerates : (Finset.univ : Finset (Fin 8)).image columns = + normalizedRankSevenRemainingColumns h d) : + (Finset.univ : Finset (Fin 8)).image (fun i ↦ + systematicWeightSixteenColumnPoint (columns i)) = + normalizedRankSevenRemainder h d := by + calc + (Finset.univ : Finset (Fin 8)).image (fun i ↦ + systematicWeightSixteenColumnPoint (columns i)) = + ((Finset.univ : Finset (Fin 8)).image columns).image + systematicWeightSixteenColumnPoint := by + rw [Finset.image_image] + rfl + _ = (normalizedRankSevenRemainingColumns h d).image + systematicWeightSixteenColumnPoint := by rw [henumerates] + _ = normalizedRankSevenRemainder h d := by + rw [normalizedRankSevenRemainingColumns] + ext x + constructor + · intro hx + obtain ⟨c, hc, rfl⟩ := Finset.mem_image.mp hx + obtain ⟨y, hy, rfl⟩ := Finset.mem_image.mp hc + simpa using hy + · intro hx + exact Finset.mem_image.mpr ⟨systematicWeightSixteenPointColumn x, + Finset.mem_image.mpr ⟨x, hx, rfl⟩, + systematicWeightSixteenColumnPoint_pointColumn x⟩ + +/-- A normalized full-span support produces a sorted systematic code with the +same reconstructed support. -/ +theorem exists_systematicWeightSixteenCode_of_normalizedRankSevenSupport + (h : BooleanFunction n) (d : SevenVariableAffineMapData n) + (hd : LinearIndependent FABL.𝔽₂ d.2) + (hspan : Submodule.span FABL.𝔽₂ (Set.range d.2) = + supportDifferenceSpan h d.1) + (hdual : h ∈ reedMullerDual 2 n) + (hweight : hammingWeight h = 16) + (hfixed : systematicWeightSixteenFixedPoints ⊆ + normalizedRankSevenSupport h d) : + ∃ code : BitVec 64, + SystematicWeightSixteenConstraints code = true ∧ + systematicWeightSixteenSupportOfCode code = + normalizedRankSevenSupport h d := by + classical + let columns : Fin 8 → BitVec 8 := + normalizedRankSevenRemainingColumnOrderEmbedding + h d hd hspan hweight hfixed + let code := packSystematicWeightSixteenColumns columns + have henumerates : (Finset.univ : Finset (Fin 8)).image columns = + normalizedRankSevenRemainingColumns h d := by + simpa only [columns] using + (image_normalizedRankSevenRemainingColumnOrderEmbedding_univ + h d hd hspan hweight hfixed) + have hinjective : Function.Injective columns := by + simpa only [columns] using + (normalizedRankSevenRemainingColumnOrderEmbedding_injective + h d hd hspan hweight hfixed) + have hremainderGram (i j : Fin 8) := + normalizedRankSevenRemainder_pointCoordinate_gram_one + h d hd hspan hdual hfixed i j + have hrow : systematicWeightSixteenColumnMatrix columns * + Matrix.transpose (systematicWeightSixteenColumnMatrix columns) = 1 := + normalizedRankSevenColumnEnumeration_rowGram h d columns + hinjective henumerates hremainderGram + have hdot (i j : Fin 8) (hij : i ≠ j) : + FABL.f₂DotProduct (bitVecEightF₂ (columns i)) + (bitVecEightF₂ (columns j)) = 0 := by + exact normalizedRankSevenColumnEnumeration_dotProduct_zero + columns hrow i j hij + have hnonunit (i : Fin 8) : + isSystematicWeightSixteenNonunitOddColumn (columns i) = true := by + apply normalizedRankSevenRemainingColumn_nonunitOdd h d + simpa only [columns] using + (normalizedRankSevenRemainingColumnOrderEmbedding_mem + h d hd hspan hweight hfixed i) + have hstrict : StrictMono columns := by + simpa only [columns] using + (normalizedRankSevenRemainingColumnOrderEmbedding_strictMono + h d hd hspan hweight hfixed) + have horthogonal (i j : Fin 8) (hij : i ≠ j) : + areSystematicWeightSixteenColumnsOrthogonal + (columns i) (columns j) = true := + (areSystematicWeightSixteenColumnsOrthogonal_iff _ _).mpr + (hdot i j hij) + have hconstraints : SystematicWeightSixteenConstraints code = true := + systematicWeightSixteenConstraints_pack_of + columns hnonunit hstrict horthogonal + have hdecoded : + (Finset.univ : Finset (Fin 8)).image (fun i ↦ + systematicWeightSixteenColumnPoint (columns i)) = + normalizedRankSevenRemainder h d := + normalizedRankSevenColumnEnumeration_decode h d columns henumerates + refine ⟨code, hconstraints, ?_⟩ + rw [systematicWeightSixteenSupportOfCode] + simp only [code, systematicWeightSixteenColumn_pack] + rw [hdecoded] + exact Finset.union_sdiff_of_subset hfixed + +/-- Every rank-seven weight-sixteen dual word has a systematic normalization +whose decoded support maps exactly onto the original word. -/ +theorem exists_systematicWeightSixteenNormalization + (h : BooleanFunction n) (p : FABL.F₂Cube n) + (hp : p ∈ support h) + (hdual : h ∈ reedMullerDual 2 n) + (hweight : hammingWeight h = 16) + (hspan : Module.finrank FABL.𝔽₂ + (supportDifferenceSpan h p) = 7) : + ∃ (d : SevenVariableAffineMapData n) (code : BitVec 64), + d.1 = p ∧ + LinearIndependent FABL.𝔽₂ d.2 ∧ + SystematicWeightSixteenConstraints code = true ∧ + (systematicWeightSixteenSupportOfCode code).image + (sevenVariableAffinePoint d) = support h := by + obtain ⟨v, hv, hvSpan, hvIndependent⟩ := + exists_supportDifferenceBasis_of_finrank_eq h p hspan + let d : SevenVariableAffineMapData n := (p, v) + have hfixed : systematicWeightSixteenFixedPoints ⊆ + normalizedRankSevenSupport h d := by + exact systematicWeightSixteenFixedPoints_subset_normalizedRankSevenSupport + h p v hp hv + obtain ⟨code, hconstraints, hsupport⟩ := + exists_systematicWeightSixteenCode_of_normalizedRankSevenSupport + h d hvIndependent hvSpan hdual hweight hfixed + refine ⟨d, code, rfl, hvIndependent, hconstraints, ?_⟩ + rw [hsupport] + exact image_normalizedRankSevenSupport_eq_support h d hvSpan + +end CryptBoolean diff --git a/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenSystematicEncoding.lean b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenSystematicEncoding.lean new file mode 100644 index 0000000..29317ca --- /dev/null +++ b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenSystematicEncoding.lean @@ -0,0 +1,94 @@ +/- +Copyright (c) 2026 Asher Yan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Asher Yan with Codex +-/ +module + +public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightSixteenNormalizedClassification +public import Mathlib.Data.Finset.Sort + +/-! +# Systematic encoding of normalized rank-seven supports + +A normalized support contains zero and the seven coordinate points. After +the constant row is replaced by its sum with the seven coordinate rows, these +eight points give the identity columns. Every remaining point is encoded by +an odd eight-bit column, and the seven coordinate bits recover the point. +-/ + +open Finset +open scoped BigOperators BooleanCube + +@[expose] public section + +namespace CryptBoolean + +/-- The systematic eight-bit column attached to a seven-variable point. -/ +def systematicWeightSixteenPointColumn + (x : FABL.F₂Cube 7) : BitVec 8 := + BitVec.ofFnLE fun i ↦ + Fin.cases + (decide ((1 + ∑ j : Fin 7, x j) = (1 : FABL.𝔽₂))) + (fun j ↦ decide (x j = 1)) i + +/-- Recover a seven-variable point from the coordinate bits of a systematic +column. -/ +def systematicWeightSixteenColumnPoint + (column : BitVec 8) : FABL.F₂Cube 7 := + fun j ↦ if column.getLsb j.succ then 1 else 0 + +@[simp] theorem systematicWeightSixteenColumnPoint_pointColumn + (x : FABL.F₂Cube 7) : + systematicWeightSixteenColumnPoint + (systematicWeightSixteenPointColumn x) = x := by + funext j + simp only [systematicWeightSixteenColumnPoint, + systematicWeightSixteenPointColumn, BitVec.getLsb_ofFnLE] + by_cases hx : x j = 1 + · simp [hx] + · have hxzero : x j = 0 := by + by_contra hzero + exact hx (Fin.eq_one_of_ne_zero (x j) hzero) + simp [hxzero] + +/-- Distinct normalized points have distinct systematic columns. -/ +theorem systematicWeightSixteenPointColumn_injective : + Function.Injective systematicWeightSixteenPointColumn := by + intro x y hxy + rw [← systematicWeightSixteenColumnPoint_pointColumn x, + ← systematicWeightSixteenColumnPoint_pointColumn y, hxy] + +/-- The normalized affine-basis points already represented by the identity +columns. -/ +def systematicWeightSixteenFixedPoints : Finset (FABL.F₂Cube 7) := + {0} ∪ Finset.univ.image fun i : Fin 7 ↦ + Pi.single i (1 : FABL.𝔽₂) + +@[simp] theorem card_systematicWeightSixteenFixedPoints : + systematicWeightSixteenFixedPoints.card = 8 := by + classical + rw [systematicWeightSixteenFixedPoints, + Finset.card_union_of_disjoint] + · rw [Finset.card_singleton, + Finset.card_image_of_injective Finset.univ + (Pi.linearIndependent_single_one (Fin 7) FABL.𝔽₂).injective] + simp + · rw [Finset.disjoint_left] + intro x hxZero hxImage + simp only [Finset.mem_singleton] at hxZero + subst x + obtain ⟨i, _hi, hzero⟩ := Finset.mem_image.mp hxImage + have hi := congrFun hzero i + simp at hi + +/-- Reconstruct the full normalized support from its eight packed nonidentity +systematic columns. -/ +def systematicWeightSixteenSupportOfCode + (code : BitVec 64) : Finset (FABL.F₂Cube 7) := + systematicWeightSixteenFixedPoints ∪ + Finset.univ.image fun i : Fin 8 ↦ + systematicWeightSixteenColumnPoint + (systematicWeightSixteenColumn code i) + +end CryptBoolean diff --git a/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenTypeA.lean b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenTypeA.lean new file mode 100644 index 0000000..6336e61 --- /dev/null +++ b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenTypeA.lean @@ -0,0 +1,750 @@ +/- +Copyright (c) 2026 Asher Yan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Asher Yan with Codex +-/ +module + +public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightSixteen + +/-! +# Type-a weight-sixteen words + +The thirty ordered affine-hyperplane decompositions of an affine four-flat. +-/ + +open Finset +open scoped BigOperators BooleanCube + +@[expose] public section + +namespace CryptBoolean + +open FABL + +variable {n : ℕ} + +noncomputable local instance weightSixteenTypeAFintypeDual + (C : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) : + Fintype (Module.Dual FABL.𝔽₂ C.direction) := + Module.fintypeOfFintype + (Module.finBasis FABL.𝔽₂ C.direction).dualBasis + +noncomputable local instance weightSixteenTypeAFintypeNonzeroDual + (C : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) : + Fintype { ℓ : Module.Dual FABL.𝔽₂ C.direction // ℓ ≠ 0 } := + Fintype.ofFinite _ + +/-- A nonzero linear functional on the direction of an affine four-flat, +together with the value selecting its first affine hyperplane. -/ +abbrev WeightSixteenTypeAParameter + (C : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) := + { ℓ : Module.Dual FABL.𝔽₂ C.direction // ℓ ≠ 0 } × FABL.𝔽₂ + +/-- The canonical finite parameter space for the ordered hyperplane +decompositions of an affine four-flat. -/ +noncomputable def weightSixteenTypeAParameters + (C : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) : + Finset (WeightSixteenTypeAParameter C) := by + classical + exact Finset.univ + +private theorem card_nonzero_dual_of_finrank_four + (C : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) + (hC : Module.finrank FABL.𝔽₂ C.direction = 4) : + Fintype.card + { ℓ : Module.Dual FABL.𝔽₂ C.direction // ℓ ≠ 0 } = 15 := by + classical + let B : Module.Basis + (Fin (Module.finrank FABL.𝔽₂ C.direction)) FABL.𝔽₂ C.direction := + Module.finBasis FABL.𝔽₂ C.direction + have hcardDual : + Fintype.card (Module.Dual FABL.𝔽₂ C.direction) = 16 := by + calc + Fintype.card (Module.Dual FABL.𝔽₂ C.direction) = + Fintype.card + (Fin (Module.finrank FABL.𝔽₂ C.direction) → FABL.𝔽₂) := + Fintype.card_congr B.dualBasis.equivFun.toEquiv + _ = 16 := by + rw [Fintype.card_fun, Fintype.card_fin, hC] + norm_num + rw [Fintype.card_subtype_compl (fun ℓ : + Module.Dual FABL.𝔽₂ C.direction ↦ ℓ = 0), + Fintype.card_subtype_eq, hcardDual] + +/-- A four-flat has thirty functional/value parameters. -/ +theorem card_weightSixteenTypeAParameters + (C : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) + (hC : C ∈ binaryAffineFlats 4 n) : + (weightSixteenTypeAParameters C).card = 30 := by + classical + have hCrank : Module.finrank FABL.𝔽₂ C.direction = 4 := by + exact (by + simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, + true_and] using hC : + C ≠ ⊥ ∧ Module.finrank FABL.𝔽₂ C.direction = 4).2 + rw [weightSixteenTypeAParameters, Finset.card_univ, + Fintype.card_prod, card_nonzero_dual_of_finrank_four C hCrank] + norm_num + +/-- A chosen basepoint of an affine four-flat. -/ +noncomputable def weightSixteenTypeABasepoint + (C : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) + (hC : C ∈ binaryAffineFlats 4 n) : FABL.F₂Cube n := by + have hCne : C ≠ ⊥ := by + exact (by + simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, + true_and] using hC : + C ≠ ⊥ ∧ Module.finrank FABL.𝔽₂ C.direction = 4).1 + exact Classical.choose ((AffineSubspace.nonempty_iff_ne_bot C).2 hCne) + +private theorem weightSixteenTypeABasepoint_mem + (C : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) + (hC : C ∈ binaryAffineFlats 4 n) : + weightSixteenTypeABasepoint C hC ∈ C := by + unfold weightSixteenTypeABasepoint + exact Classical.choose_spec + ((AffineSubspace.nonempty_iff_ne_bot C).2 (by + exact (by + simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, + true_and] using hC : + C ≠ ⊥ ∧ Module.finrank FABL.𝔽₂ C.direction = 4).1)) + +/-- A chosen direction vector on which a nonzero binary functional is one. -/ +noncomputable def weightSixteenTypeANormal + (C : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) + (ℓ : { ℓ : Module.Dual FABL.𝔽₂ C.direction // ℓ ≠ 0 }) : + C.direction := + Classical.choose ((LinearMap.surjective ℓ.property) (1 : FABL.𝔽₂)) + +@[simp] private theorem weightSixteenTypeANormal_apply + (C : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) + (ℓ : { ℓ : Module.Dual FABL.𝔽₂ C.direction // ℓ ≠ 0 }) : + ℓ.1 (weightSixteenTypeANormal C ℓ) = 1 := + Classical.choose_spec + ((LinearMap.surjective ℓ.property) (1 : FABL.𝔽₂)) + +/-- The ambient hyperplane direction given by the kernel of a functional on +the four-flat direction. -/ +noncomputable def weightSixteenTypeADirection + (C : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) + (ℓ : { ℓ : Module.Dual FABL.𝔽₂ C.direction // ℓ ≠ 0 }) : + Submodule FABL.𝔽₂ (FABL.F₂Cube n) := + (LinearMap.ker ℓ.1).map C.direction.subtype + +/-- The affine hyperplane selected by a functional/value parameter. -/ +noncomputable def weightSixteenTypeAHyperplane + (C : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) + (hC : C ∈ binaryAffineFlats 4 n) + (p : WeightSixteenTypeAParameter C) : + AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) := + FABL.binaryAffineSubspace (weightSixteenTypeADirection C p.1) + (p.2 • (weightSixteenTypeANormal C p.1 : FABL.F₂Cube n) + + weightSixteenTypeABasepoint C hC) + +private theorem weightSixteenTypeADirection_le + (C : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) + (ℓ : { ℓ : Module.Dual FABL.𝔽₂ C.direction // ℓ ≠ 0 }) : + weightSixteenTypeADirection C ℓ ≤ C.direction := by + rintro x ⟨y, _hy, rfl⟩ + exact y.property + +private theorem finrank_weightSixteenTypeADirection + (C : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) + (hC : C ∈ binaryAffineFlats 4 n) + (ℓ : { ℓ : Module.Dual FABL.𝔽₂ C.direction // ℓ ≠ 0 }) : + Module.finrank FABL.𝔽₂ (weightSixteenTypeADirection C ℓ) = 3 := by + have hCrank : Module.finrank FABL.𝔽₂ C.direction = 4 := by + exact (by + simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, + true_and] using hC : + C ≠ ⊥ ∧ Module.finrank FABL.𝔽₂ C.direction = 4).2 + have hker := ℓ.1.finrank_ker_add_one_of_ne_zero ℓ.property + rw [hCrank] at hker + have hkerRank : Module.finrank FABL.𝔽₂ (LinearMap.ker ℓ.1) = 3 := by + omega + rw [weightSixteenTypeADirection, Submodule.finrank_map_subtype_eq] + exact hkerRank + +private theorem weightSixteenTypeAHyperplane_basepoint_mem + (C : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) + (hC : C ∈ binaryAffineFlats 4 n) + (p : WeightSixteenTypeAParameter C) : + p.2 • (weightSixteenTypeANormal C p.1 : FABL.F₂Cube n) + + weightSixteenTypeABasepoint C hC ∈ C := by + have hdirection : p.2 • + (weightSixteenTypeANormal C p.1 : FABL.F₂Cube n) ∈ C.direction := + C.direction.smul_mem p.2 (weightSixteenTypeANormal C p.1).property + simpa only [vadd_eq_add] using AffineSubspace.vadd_mem_of_mem_direction + hdirection (weightSixteenTypeABasepoint_mem C hC) + +private theorem weightSixteenTypeAHyperplane_le + (C : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) + (hC : C ∈ binaryAffineFlats 4 n) + (p : WeightSixteenTypeAParameter C) : + weightSixteenTypeAHyperplane C hC p ≤ C := by + intro x hx + let a := p.2 • + (weightSixteenTypeANormal C p.1 : FABL.F₂Cube n) + + weightSixteenTypeABasepoint C hC + have haC : a ∈ C := weightSixteenTypeAHyperplane_basepoint_mem C hC p + have hxa : x -ᵥ a ∈ (weightSixteenTypeAHyperplane C hC p).direction := + AffineSubspace.vsub_mem_direction hx + (AffineSubspace.self_mem_mk' _ _) + have hxa' : x -ᵥ a ∈ C.direction := by + rw [weightSixteenTypeAHyperplane, + FABL.binaryAffineSubspace_direction] at hxa + exact weightSixteenTypeADirection_le C p.1 hxa + simpa only [vsub_vadd] using + (AffineSubspace.vadd_mem_of_mem_direction hxa' haC) + +private theorem weightSixteenTypeAHyperplane_mem_flats + (C : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) + (hC : C ∈ binaryAffineFlats 4 n) + (p : WeightSixteenTypeAParameter C) : + weightSixteenTypeAHyperplane C hC p ∈ binaryAffineFlats 3 n := by + apply binaryAffineSubspace_mem_binaryAffineFlats + rw [mem_binaryLinearSubspaces] + exact finrank_weightSixteenTypeADirection C hC p.1 + +/-- Exchanging zero and one selects the complementary hyperplane. -/ +def weightSixteenTypeAComplementParameter + {C : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)} + (p : WeightSixteenTypeAParameter C) : + WeightSixteenTypeAParameter C := + (p.1, 1 + p.2) + +/-- The ordered pair of complementary affine hyperplanes selected by a +type-`a` parameter. -/ +noncomputable def weightSixteenTypeARepresentationPair + (C : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) + (hC : C ∈ binaryAffineFlats 4 n) + (p : WeightSixteenTypeAParameter C) : + AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × + AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) := + (weightSixteenTypeAHyperplane C hC p, + weightSixteenTypeAHyperplane C hC + (weightSixteenTypeAComplementParameter p)) + +@[simp] private theorem direction_weightSixteenTypeAHyperplane + (C : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) + (hC : C ∈ binaryAffineFlats 4 n) + (p : WeightSixteenTypeAParameter C) : + (weightSixteenTypeAHyperplane C hC p).direction = + weightSixteenTypeADirection C p.1 := by + rw [weightSixteenTypeAHyperplane, + FABL.binaryAffineSubspace_direction] + +private theorem weightSixteenTypeAComplement_basepoint_add_basepoint + (C : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) + (hC : C ∈ binaryAffineFlats 4 n) + (p : WeightSixteenTypeAParameter C) : + ((weightSixteenTypeAComplementParameter p).2 • + (weightSixteenTypeANormal C p.1 : FABL.F₂Cube n) + + weightSixteenTypeABasepoint C hC) + + (p.2 • (weightSixteenTypeANormal C p.1 : FABL.F₂Cube n) + + weightSixteenTypeABasepoint C hC) = + (weightSixteenTypeANormal C p.1 : FABL.F₂Cube n) := by + let v := (weightSixteenTypeANormal C p.1 : FABL.F₂Cube n) + let u := weightSixteenTypeABasepoint C hC + have hcoefficient : (1 + p.2) + p.2 = 1 := by + calc + (1 + p.2) + p.2 = 1 + (p.2 + p.2) := by abel + _ = 1 := by rw [ZModModule.add_self, add_zero] + change ((1 + p.2) • v + u) + (p.2 • v + u) = v + calc + ((1 + p.2) • v + u) + (p.2 • v + u) = + ((1 + p.2) • v + p.2 • v) + (u + u) := by abel + _ = ((1 + p.2) + p.2) • v + (u + u) := by + rw [← add_smul] + _ = v := by rw [hcoefficient, one_smul, ZModModule.add_self, add_zero] + +private theorem weightSixteenTypeANormal_not_mem_direction + (C : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) + (ℓ : { ℓ : Module.Dual FABL.𝔽₂ C.direction // ℓ ≠ 0 }) : + (weightSixteenTypeANormal C ℓ : FABL.F₂Cube n) ∉ + weightSixteenTypeADirection C ℓ := by + intro hnormal + obtain ⟨y, hy, hyval⟩ := hnormal + have hyEq : y = weightSixteenTypeANormal C ℓ := by + apply Subtype.ext + exact hyval + have hyZero : ℓ.1 y = 0 := by + change ℓ.1 y = 0 at hy + exact hy + rw [hyEq, weightSixteenTypeANormal_apply] at hyZero + exact one_ne_zero hyZero + +private theorem weightSixteenTypeAHyperplanes_ne + (C : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) + (hC : C ∈ binaryAffineFlats 4 n) + (p : WeightSixteenTypeAParameter C) : + weightSixteenTypeAHyperplane C hC p ≠ + weightSixteenTypeAHyperplane C hC + (weightSixteenTypeAComplementParameter p) := by + intro heq + let a := p.2 • + (weightSixteenTypeANormal C p.1 : FABL.F₂Cube n) + + weightSixteenTypeABasepoint C hC + let b := (weightSixteenTypeAComplementParameter p).2 • + (weightSixteenTypeANormal C p.1 : FABL.F₂Cube n) + + weightSixteenTypeABasepoint C hC + have ha : a ∈ weightSixteenTypeAHyperplane C hC p := + AffineSubspace.self_mem_mk' _ _ + have hbComplement : b ∈ weightSixteenTypeAHyperplane C hC + (weightSixteenTypeAComplementParameter p) := + AffineSubspace.self_mem_mk' _ _ + have hb : b ∈ weightSixteenTypeAHyperplane C hC p := by + rw [heq] + exact hbComplement + have hdiff := AffineSubspace.vsub_mem_direction hb ha + have hdiff' : (weightSixteenTypeANormal C p.1 : FABL.F₂Cube n) ∈ + weightSixteenTypeADirection C p.1 := by + rw [direction_weightSixteenTypeAHyperplane] at hdiff + have hba : b -ᵥ a = + (weightSixteenTypeANormal C p.1 : FABL.F₂Cube n) := by + change b - a = _ + have hnega : -a = a := by + funext i + exact ZMod.neg_eq_self_mod_two (a i) + rw [sub_eq_add_neg, hnega] + exact weightSixteenTypeAComplement_basepoint_add_basepoint C hC p + rwa [hba] at hdiff + exact weightSixteenTypeANormal_not_mem_direction C p.1 hdiff' + +private theorem weightSixteenTypeAHyperplanes_inf_eq_bot + (C : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) + (hC : C ∈ binaryAffineFlats 4 n) + (p : WeightSixteenTypeAParameter C) : + weightSixteenTypeAHyperplane C hC p ⊓ + weightSixteenTypeAHyperplane C hC + (weightSixteenTypeAComplementParameter p) = ⊥ := by + by_contra hmeet + obtain ⟨x, hx⟩ := (AffineSubspace.nonempty_iff_ne_bot _).2 hmeet + have hxFirst : x ∈ weightSixteenTypeAHyperplane C hC p := hx.1 + have hxSecond : x ∈ weightSixteenTypeAHyperplane C hC + (weightSixteenTypeAComplementParameter p) := hx.2 + apply weightSixteenTypeAHyperplanes_ne C hC p + apply (AffineSubspace.eq_iff_direction_eq_of_mem hxFirst hxSecond).2 + simp only [direction_weightSixteenTypeAHyperplane, + weightSixteenTypeAComplementParameter] + +/-- Every type-`a` parameter gives an ordered disjoint pair of affine +three-flats. -/ +theorem weightSixteenTypeARepresentationPair_mem + (C : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) + (hC : C ∈ binaryAffineFlats 4 n) + (p : WeightSixteenTypeAParameter C) : + weightSixteenTypeARepresentationPair C hC p ∈ + disjointBinaryAffineThreeFlatPairs n := by + have hproduct : weightSixteenTypeARepresentationPair C hC p ∈ + binaryAffineThreeFlatPairs n := by + change weightSixteenTypeARepresentationPair C hC p ∈ + (binaryAffineFlats 3 n).product (binaryAffineFlats 3 n) + apply Finset.mem_product.mpr + exact ⟨weightSixteenTypeAHyperplane_mem_flats C hC p, + weightSixteenTypeAHyperplane_mem_flats C hC + (weightSixteenTypeAComplementParameter p)⟩ + simp only [disjointBinaryAffineThreeFlatPairs, Finset.mem_filter] + exact ⟨hproduct, weightSixteenTypeAHyperplanes_inf_eq_bot C hC p⟩ + +private theorem weightSixteenTypeAHyperplanePoints_disjoint + (C : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) + (hC : C ∈ binaryAffineFlats 4 n) + (p : WeightSixteenTypeAParameter C) : + Disjoint + (binaryAffineFlatPoints (weightSixteenTypeAHyperplane C hC p)) + (binaryAffineFlatPoints (weightSixteenTypeAHyperplane C hC + (weightSixteenTypeAComplementParameter p))) := by + rw [Finset.disjoint_left] + intro x hxFirst hxSecond + have hxMeet : x ∈ + weightSixteenTypeAHyperplane C hC p ⊓ + weightSixteenTypeAHyperplane C hC + (weightSixteenTypeAComplementParameter p) := + ⟨(mem_binaryAffineFlatPoints _ _).mp hxFirst, + (mem_binaryAffineFlatPoints _ _).mp hxSecond⟩ + rw [weightSixteenTypeAHyperplanes_inf_eq_bot C hC p] at hxMeet + rw [← SetLike.mem_coe, AffineSubspace.bot_coe] at hxMeet + exact hxMeet + +private theorem weightSixteenTypeAHyperplanePoints_union + (C : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) + (hC : C ∈ binaryAffineFlats 4 n) + (p : WeightSixteenTypeAParameter C) : + binaryAffineFlatPoints C = + binaryAffineFlatPoints (weightSixteenTypeAHyperplane C hC p) ∪ + binaryAffineFlatPoints (weightSixteenTypeAHyperplane C hC + (weightSixteenTypeAComplementParameter p)) := by + have hCdata : C ≠ ⊥ ∧ Module.finrank FABL.𝔽₂ C.direction = 4 := by + simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, + true_and] using hC + have hfirstFlat := weightSixteenTypeAHyperplane_mem_flats C hC p + have hsecondFlat := weightSixteenTypeAHyperplane_mem_flats C hC + (weightSixteenTypeAComplementParameter p) + have hfirstData : weightSixteenTypeAHyperplane C hC p ≠ ⊥ ∧ + Module.finrank FABL.𝔽₂ + (weightSixteenTypeAHyperplane C hC p).direction = 3 := by + simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, + true_and] using hfirstFlat + have hsecondData : weightSixteenTypeAHyperplane C hC + (weightSixteenTypeAComplementParameter p) ≠ ⊥ ∧ + Module.finrank FABL.𝔽₂ + (weightSixteenTypeAHyperplane C hC + (weightSixteenTypeAComplementParameter p)).direction = 3 := by + simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, + true_and] using hsecondFlat + symm + apply Finset.eq_of_subset_of_card_le + · intro x hx + rcases Finset.mem_union.mp hx with hxFirst | hxSecond + · exact (mem_binaryAffineFlatPoints C x).mpr + (weightSixteenTypeAHyperplane_le C hC p + ((mem_binaryAffineFlatPoints _ x).mp hxFirst)) + · exact (mem_binaryAffineFlatPoints C x).mpr + (weightSixteenTypeAHyperplane_le C hC + (weightSixteenTypeAComplementParameter p) + ((mem_binaryAffineFlatPoints _ x).mp hxSecond)) + · rw [Finset.card_union_of_disjoint + (weightSixteenTypeAHyperplanePoints_disjoint C hC p), + card_binaryAffineFlatPoints _ hfirstData.1, hfirstData.2, + card_binaryAffineFlatPoints _ hsecondData.1, hsecondData.2, + card_binaryAffineFlatPoints C hCdata.1, hCdata.2] + norm_num + +/-- The two hyperplanes selected by a type-`a` parameter sum to the +indicator of the original affine four-flat. -/ +theorem weightSixteenTypeARepresentationWord_eq_indicator + (C : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) + (hC : C ∈ binaryAffineFlats 4 n) + (p : WeightSixteenTypeAParameter C) : + weightSixteenRepresentationWord + (weightSixteenTypeARepresentationPair C hC p).1 + (weightSixteenTypeARepresentationPair C hC p).2 = + binaryAffineFlatIndicator C := by + have hpoints : binaryAffineFlatPoints C = + binaryAffineFlatPoints + (weightSixteenTypeARepresentationPair C hC p).1 ∪ + binaryAffineFlatPoints + (weightSixteenTypeARepresentationPair C hC p).2 := by + simpa only [weightSixteenTypeARepresentationPair] using + weightSixteenTypeAHyperplanePoints_union C hC p + have hdisjoint : Disjoint + (binaryAffineFlatPoints + (weightSixteenTypeARepresentationPair C hC p).1) + (binaryAffineFlatPoints + (weightSixteenTypeARepresentationPair C hC p).2) := by + simpa only [weightSixteenTypeARepresentationPair] using + weightSixteenTypeAHyperplanePoints_disjoint C hC p + symm + exact binaryAffineFlatIndicator_eq_add_of_points_eq_union + (weightSixteenTypeARepresentationPair C hC p).1 + (weightSixteenTypeARepresentationPair C hC p).2 C + hpoints hdisjoint + +private theorem binaryDual_eq_of_ker_eq + {H : Submodule FABL.𝔽₂ (FABL.F₂Cube n)} + (f g : Module.Dual FABL.𝔽₂ H) + (hker : LinearMap.ker f = LinearMap.ker g) : f = g := by + ext x + by_cases hfx : f x = 0 + · have hxKerF : x ∈ LinearMap.ker f := hfx + have hxKerG : x ∈ LinearMap.ker g := by rwa [← hker] + have hgx : g x = 0 := hxKerG + exact hfx.trans hgx.symm + · have hfxOne : f x = 1 := Fin.eq_one_of_ne_zero _ hfx + have hgx : g x ≠ 0 := by + intro hgx + have hxKerG : x ∈ LinearMap.ker g := hgx + have hxKerF : x ∈ LinearMap.ker f := by rwa [hker] + exact hfx hxKerF + have hgxOne : g x = 1 := Fin.eq_one_of_ne_zero _ hgx + exact hfxOne.trans hgxOne.symm + +private theorem weightSixteenTypeAHyperplane_injective + (C : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) + (hC : C ∈ binaryAffineFlats 4 n) : + Function.Injective (weightSixteenTypeAHyperplane C hC) := by + rintro ⟨ℓ, b⟩ ⟨m, c⟩ hflat + have hdirections := congrArg AffineSubspace.direction hflat + simp only [direction_weightSixteenTypeAHyperplane] at hdirections + have hkers : LinearMap.ker ℓ.1 = LinearMap.ker m.1 := by + apply Submodule.map_injective_of_injective C.direction.subtype_injective + exact hdirections + have hfunctionals : ℓ = m := by + apply Subtype.ext + exact binaryDual_eq_of_ker_eq ℓ.1 m.1 hkers + subst m + let v := weightSixteenTypeANormal C ℓ + let u := weightSixteenTypeABasepoint C hC + let a : FABL.F₂Cube n := b • (v : FABL.F₂Cube n) + u + let d : FABL.F₂Cube n := c • (v : FABL.F₂Cube n) + u + have ha : a ∈ weightSixteenTypeAHyperplane C hC (ℓ, b) := + AffineSubspace.self_mem_mk' _ _ + have ha' : a ∈ weightSixteenTypeAHyperplane C hC (ℓ, c) := by + rw [← hflat] + exact ha + have hd : d ∈ weightSixteenTypeAHyperplane C hC (ℓ, c) := + AffineSubspace.self_mem_mk' _ _ + have hadiff := AffineSubspace.vsub_mem_direction ha' hd + rw [direction_weightSixteenTypeAHyperplane] at hadiff + have hadiffEq : a -ᵥ d = + ((b + c) • v : C.direction) := by + change a - d = (b + c) • (v : FABL.F₂Cube n) + have hnegd : -d = d := by + funext i + exact ZMod.neg_eq_self_mod_two (d i) + rw [sub_eq_add_neg, hnegd] + change (b • (v : FABL.F₂Cube n) + u) + + (c • (v : FABL.F₂Cube n) + u) = + (b + c) • (v : FABL.F₂Cube n) + calc + (b • (v : FABL.F₂Cube n) + u) + + (c • (v : FABL.F₂Cube n) + u) = + (b • (v : FABL.F₂Cube n) + + c • (v : FABL.F₂Cube n)) + (u + u) := by abel + _ = (b + c) • (v : FABL.F₂Cube n) := by + rw [← add_smul, ZModModule.add_self, add_zero] + rw [hadiffEq] at hadiff + obtain ⟨y, hy, hyval⟩ := hadiff + have hyEq : y = (b + c) • v := by + apply Subtype.ext + exact hyval + have hyZero : ℓ.1 y = 0 := by + change ℓ.1 y = 0 at hy + exact hy + have hbc : b + c = 0 := by + rw [hyEq, map_smul, weightSixteenTypeANormal_apply, smul_eq_mul, + mul_one] at hyZero + exact hyZero + have hbcEq : b = c := + (add_eq_zero_iff_eq_neg.mp hbc).trans (ZMod.neg_eq_self_mod_two c) + subst c + rfl + +/-- The affine three-flats contained in a fixed affine four-flat. -/ +noncomputable def affineThreeFlatsInFourFlat + (C : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) : + Finset (AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) := by + classical + exact (binaryAffineFlats 3 n).filter fun A ↦ A ≤ C + +private theorem exists_typeAParameter_eq_hyperplane + (C A : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) + (hC : C ∈ binaryAffineFlats 4 n) + (hA : A ∈ affineThreeFlatsInFourFlat C) : + ∃ p : WeightSixteenTypeAParameter C, + weightSixteenTypeAHyperplane C hC p = A := by + have hCdata : C ≠ ⊥ ∧ Module.finrank FABL.𝔽₂ C.direction = 4 := by + simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, + true_and] using hC + have hAdata : A ∈ binaryAffineFlats 3 n ∧ A ≤ C := by + simpa only [affineThreeFlatsInFourFlat, Finset.mem_filter] using hA + have hAflat : A ≠ ⊥ ∧ Module.finrank FABL.𝔽₂ A.direction = 3 := by + simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, + true_and] using hAdata.1 + have hdirLe : A.direction ≤ C.direction := + AffineSubspace.direction_le hAdata.2 + let K : Submodule FABL.𝔽₂ C.direction := + A.direction.comap C.direction.subtype + have hKmap : K.map C.direction.subtype = A.direction := by + dsimp only [K] + rw [Submodule.map_comap_subtype, inf_of_le_right hdirLe] + have hKrank : Module.finrank FABL.𝔽₂ K = 3 := by + have hmapRank := Submodule.finrank_map_subtype_eq C.direction K + rw [hKmap, hAflat.2] at hmapRank + exact hmapRank.symm + have hKlt : K < ⊤ := + Submodule.lt_of_le_of_finrank_lt_finrank le_top (by + rw [hKrank, finrank_top, hCdata.2] + omega) + obtain ⟨ℓ, hℓne, hKker⟩ := K.exists_le_ker_of_lt_top hKlt + have hkerRank : Module.finrank FABL.𝔽₂ (LinearMap.ker ℓ) = 3 := by + have hker := Module.Dual.finrank_ker_add_one_of_ne_zero + (f := ℓ) hℓne + rw [hCdata.2] at hker + omega + have hKkerEq : K = LinearMap.ker ℓ := + Submodule.eq_of_le_of_finrank_eq hKker (hKrank.trans hkerRank.symm) + let ℓ' : { ℓ : Module.Dual FABL.𝔽₂ C.direction // ℓ ≠ 0 } := ⟨ℓ, hℓne⟩ + obtain ⟨a, ha⟩ := (AffineSubspace.nonempty_iff_ne_bot A).2 hAflat.1 + let u := weightSixteenTypeABasepoint C hC + have haC : a ∈ C := hAdata.2 ha + have hau : a + u ∈ C.direction := by + have hvsub := AffineSubspace.vsub_mem_direction haC + (weightSixteenTypeABasepoint_mem C hC) + change a - u ∈ C.direction at hvsub + have hnegu : -u = u := by + funext i + exact ZMod.neg_eq_self_mod_two (u i) + rwa [sub_eq_add_neg, hnegu] at hvsub + let d : C.direction := ⟨a + u, hau⟩ + let b : FABL.𝔽₂ := ℓ d + let p : WeightSixteenTypeAParameter C := (ℓ', b) + let v := weightSixteenTypeANormal C ℓ' + let y : C.direction := b • v + d + have hℓv : ℓ v = 1 := by + simpa only [v, ℓ'] using weightSixteenTypeANormal_apply C ℓ' + have hyKer : y ∈ LinearMap.ker ℓ := by + change ℓ y = 0 + rw [show ℓ y = b • ℓ v + ℓ d by + simp only [y, map_add, map_smul]] + rw [hℓv] + change b * 1 + ℓ d = 0 + rw [mul_one] + change ℓ d + ℓ d = 0 + exact ZModModule.add_self _ + have hyK : y ∈ K := by + rw [hKkerEq] + exact hyKer + have hyDirection : (y : FABL.F₂Cube n) ∈ A.direction := by + rw [← hKmap] + exact ⟨y, hyK, rfl⟩ + have hbaseA : b • (v : FABL.F₂Cube n) + u ∈ A := by + have hva := AffineSubspace.vadd_mem_of_mem_direction hyDirection ha + change (y : FABL.F₂Cube n) + a ∈ A at hva + have hyadd : (y : FABL.F₂Cube n) + a = + b • (v : FABL.F₂Cube n) + u := by + change (b • (v : FABL.F₂Cube n) + (a + u)) + a = + b • (v : FABL.F₂Cube n) + u + calc + (b • (v : FABL.F₂Cube n) + (a + u)) + a = + b • (v : FABL.F₂Cube n) + (a + a) + u := by abel + _ = b • (v : FABL.F₂Cube n) + u := by + rw [ZModModule.add_self, add_zero] + rwa [hyadd] at hva + refine ⟨p, ?_⟩ + apply (AffineSubspace.eq_iff_direction_eq_of_mem + (AffineSubspace.self_mem_mk' _ _) hbaseA).2 + rw [AffineSubspace.direction_mk'] + change weightSixteenTypeADirection C p.1 = A.direction + dsimp only [p] + rw [weightSixteenTypeADirection, ← hKkerEq, hKmap] + +/-- An affine four-flat contains exactly thirty affine three-flats. -/ +theorem card_affineThreeFlatsInFourFlat + (C : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) + (hC : C ∈ binaryAffineFlats 4 n) : + (affineThreeFlatsInFourFlat C).card = 30 := by + classical + rw [← card_weightSixteenTypeAParameters C hC] + symm + apply Finset.card_bij + (fun p _hp ↦ weightSixteenTypeAHyperplane C hC p) + · intro p _hp + simp only [affineThreeFlatsInFourFlat, Finset.mem_filter] + exact ⟨weightSixteenTypeAHyperplane_mem_flats C hC p, + weightSixteenTypeAHyperplane_le C hC p⟩ + · intro p _hp q _hq heq + exact weightSixteenTypeAHyperplane_injective C hC heq + · intro A hA + obtain ⟨p, hp⟩ := exists_typeAParameter_eq_hyperplane C A hC hA + exact ⟨p, Finset.mem_univ p, hp⟩ + +private theorem weightSixteenDisjointPairData + {p : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × + AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)} + (hp : p ∈ disjointBinaryAffineThreeFlatPairs n) : + p.1 ∈ binaryAffineFlats 3 n ∧ + p.2 ∈ binaryAffineFlats 3 n ∧ p.1 ⊓ p.2 = ⊥ := by + have hp' : p ∈ binaryAffineThreeFlatPairs n ∧ p.1 ⊓ p.2 = ⊥ := by + simpa only [disjointBinaryAffineThreeFlatPairs, + Finset.mem_filter] using hp + have hproduct : p ∈ + (binaryAffineFlats 3 n).product (binaryAffineFlats 3 n) := hp'.1 + exact ⟨(Finset.mem_product.mp hproduct).1, + (Finset.mem_product.mp hproduct).2, hp'.2⟩ + +private theorem weightSixteenDisjointPair_pointSets + {p : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × + AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)} + (hp : p ∈ disjointBinaryAffineThreeFlatPairs n) : + Disjoint (binaryAffineFlatPoints p.1) (binaryAffineFlatPoints p.2) := by + rw [Finset.disjoint_left] + intro x hxFirst hxSecond + have hxMeet : x ∈ p.1 ⊓ p.2 := + ⟨(mem_binaryAffineFlatPoints p.1 x |>.mp hxFirst), + (mem_binaryAffineFlatPoints p.2 x).mp hxSecond⟩ + rw [(weightSixteenDisjointPairData hp).2.2] at hxMeet + rw [← SetLike.mem_coe, AffineSubspace.bot_coe] at hxMeet + exact hxMeet + +/-- A type-`a` affine-four-flat indicator has exactly thirty ordered +disjoint-three-flat representations. -/ +theorem card_weightSixteenRepresentationFiber_typeAIndicator + (C : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) + (hC : C ∈ binaryAffineFlats 4 n) : + (weightSixteenRepresentationFiber + (binaryAffineFlatIndicator C)).card = 30 := by + classical + rw [← card_affineThreeFlatsInFourFlat C hC] + apply Finset.card_bij (fun p _hp ↦ p.1) + · intro p hp + have hp' : p ∈ disjointBinaryAffineThreeFlatPairs n ∧ + weightSixteenRepresentationWord p.1 p.2 = + binaryAffineFlatIndicator C := by + simpa only [weightSixteenRepresentationFiber, + Finset.mem_filter] using hp + have hpdata := weightSixteenDisjointPairData hp'.1 + have hpoints := binaryAffineFlatPoints_eq_union_of_indicator_eq_add + p.1 p.2 C (weightSixteenDisjointPair_pointSets hp'.1) (by + simpa only [weightSixteenRepresentationWord] using hp'.2.symm) + have hfirstLe : p.1 ≤ C := by + intro x hx + apply (mem_binaryAffineFlatPoints C x).mp + rw [hpoints] + exact Finset.mem_union_left _ + ((mem_binaryAffineFlatPoints p.1 x).mpr hx) + simp only [affineThreeFlatsInFourFlat, Finset.mem_filter] + exact ⟨hpdata.1, hfirstLe⟩ + · intro p hp q hq hfirst + have hp' : p ∈ disjointBinaryAffineThreeFlatPairs n ∧ + weightSixteenRepresentationWord p.1 p.2 = + binaryAffineFlatIndicator C := by + simpa only [weightSixteenRepresentationFiber, + Finset.mem_filter] using hp + have hq' : q ∈ disjointBinaryAffineThreeFlatPairs n ∧ + weightSixteenRepresentationWord q.1 q.2 = + binaryAffineFlatIndicator C := by + simpa only [weightSixteenRepresentationFiber, + Finset.mem_filter] using hq + have hsums : binaryAffineFlatIndicator p.1 + + binaryAffineFlatIndicator p.2 = + binaryAffineFlatIndicator q.1 + binaryAffineFlatIndicator q.2 := by + exact hp'.2.trans hq'.2.symm + rw [hfirst] at hsums + have hsecondIndicator : binaryAffineFlatIndicator p.2 = + binaryAffineFlatIndicator q.2 := add_left_cancel hsums + have hpSecondData : p.2 ≠ ⊥ ∧ + Module.finrank FABL.𝔽₂ p.2.direction = 3 := by + simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, + true_and] using (weightSixteenDisjointPairData hp'.1).2.1 + have hqSecondData : q.2 ≠ ⊥ ∧ + Module.finrank FABL.𝔽₂ q.2.direction = 3 := by + simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, + true_and] using (weightSixteenDisjointPairData hq'.1).2.1 + have hsecond : p.2 = q.2 := + binaryAffineFlatIndicator_injective_on_nonempty + hpSecondData.1 hqSecondData.1 hsecondIndicator + exact Prod.ext hfirst hsecond + · intro A hA + obtain ⟨p, hp⟩ := exists_typeAParameter_eq_hyperplane C A hC hA + let pair := weightSixteenTypeARepresentationPair C hC p + have hpairFiber : pair ∈ weightSixteenRepresentationFiber + (binaryAffineFlatIndicator C) := by + simp only [weightSixteenRepresentationFiber, Finset.mem_filter] + exact ⟨weightSixteenTypeARepresentationPair_mem C hC p, + weightSixteenTypeARepresentationWord_eq_indicator C hC p⟩ + refine ⟨pair, hpairFiber, ?_⟩ + simpa only [pair, weightSixteenTypeARepresentationPair] using hp + +/-- Every word in the canonical type-`a` family has representation fiber +cardinality thirty. -/ +theorem card_weightSixteenRepresentationFiber_of_mem_typeAWords + (h : BooleanFunction n) (hh : h ∈ orderTwoWeightSixteenTypeAWords n) : + (weightSixteenRepresentationFiber h).card = 30 := by + classical + obtain ⟨C, hC, rfl⟩ := Finset.mem_image.mp hh + exact card_weightSixteenRepresentationFiber_typeAIndicator C hC + +end CryptBoolean diff --git a/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightTwelve.lean b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightTwelve.lean new file mode 100644 index 0000000..2affa50 --- /dev/null +++ b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightTwelve.lean @@ -0,0 +1,641 @@ +/- +Copyright (c) 2026 Asher Yan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Asher Yan with Codex +-/ +module + +public import CryptBoolean.Carlet.Chapter04.HigherOrderLowWeightFlats +public import Mathlib.LinearAlgebra.AffineSpace.FiniteDimensional + +/-! +# The weight-twelve dual character sum + +The affine-line square-sum argument behind Carlet--Mesnager Proposition +9.2.10(2). A weight-twelve word has twenty ordered affine-flat +decompositions: ten choices of the common affine line and two orders of the +three-flats. Thus the representation sum is normalized by `1 / 20`, not by +the `1 / 2` asserted after the source's incorrect uniqueness argument. +-/ + +open Finset +open scoped BigOperators BooleanCube + +@[expose] public section + +namespace CryptBoolean + +open FABL + +variable {n : ℕ} + +noncomputable local instance weightTwelveAffineSubspaceFintype : Fintype + (AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) := + Fintype.ofFinite _ + +noncomputable local instance weightTwelveAffineSubspaceDecidableEq : DecidableEq + (AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) := + Classical.decEq _ + +abbrev WeightTwelveFlatTriple (n : ℕ) := + AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × + (AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × + AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) + +/-- An affine line together with two affine three-flats containing it. -/ +noncomputable def weightTwelveFlatTriples (n : ℕ) : + Finset (WeightTwelveFlatTriple n) := by + classical + exact ((binaryAffineFlats 1 n).product + ((binaryAffineFlats 3 n).product (binaryAffineFlats 3 n))).filter + fun p ↦ p.1 ≤ p.2.1 ∧ p.1 ≤ p.2.2 + +/-- The triples for which the common direction of the two three-flats is +strictly larger than the displayed line direction. -/ +noncomputable def badWeightTwelveFlatTriples (n : ℕ) : + Finset (WeightTwelveFlatTriple n) := by + classical + exact (weightTwelveFlatTriples n).filter fun p ↦ + p.2.1.direction ⊓ p.2.2.direction ≠ p.1.direction + +private theorem weightTwelveFlatTriple_data + {p : WeightTwelveFlatTriple n} + (hp : p ∈ weightTwelveFlatTriples n) : + p.1 ≠ ⊥ ∧ Module.finrank FABL.𝔽₂ p.1.direction = 1 ∧ + p.2.1 ≠ ⊥ ∧ Module.finrank FABL.𝔽₂ p.2.1.direction = 3 ∧ + p.2.2 ≠ ⊥ ∧ Module.finrank FABL.𝔽₂ p.2.2.direction = 3 ∧ + p.1 ≤ p.2.1 ∧ p.1 ≤ p.2.2 := by + classical + have hpTriple := Finset.mem_filter.mp hp + have hpProduct := Finset.mem_product.mp hpTriple.1 + have hpThree := Finset.mem_product.mp hpProduct.2 + have hline : p.1 ≠ ⊥ ∧ Module.finrank FABL.𝔽₂ p.1.direction = 1 := by + simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, + true_and] using hpProduct.1 + have hfirst : p.2.1 ≠ ⊥ ∧ + Module.finrank FABL.𝔽₂ p.2.1.direction = 3 := by + simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, + true_and] using hpThree.1 + have hsecond : p.2.2 ≠ ⊥ ∧ + Module.finrank FABL.𝔽₂ p.2.2.direction = 3 := by + simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, + true_and] using hpThree.2 + exact ⟨hline.1, hline.2, hfirst.1, hfirst.2, hsecond.1, + hsecond.2, hpTriple.2.1, hpTriple.2.2⟩ + +private theorem badWeightTwelveFlatTriple_data + {p : WeightTwelveFlatTriple n} + (hp : p ∈ badWeightTwelveFlatTriples n) : + p.1 ≠ ⊥ ∧ Module.finrank FABL.𝔽₂ p.1.direction = 1 ∧ + p.2.1 ≠ ⊥ ∧ Module.finrank FABL.𝔽₂ p.2.1.direction = 3 ∧ + p.2.2 ≠ ⊥ ∧ Module.finrank FABL.𝔽₂ p.2.2.direction = 3 ∧ + p.1 ≤ p.2.1 ∧ p.1 ≤ p.2.2 ∧ + p.2.1.direction ⊓ p.2.2.direction ≠ p.1.direction := by + classical + have hpBad := Finset.mem_filter.mp hp + exact ⟨(weightTwelveFlatTriple_data hpBad.1).1, + (weightTwelveFlatTriple_data hpBad.1).2.1, + (weightTwelveFlatTriple_data hpBad.1).2.2.1, + (weightTwelveFlatTriple_data hpBad.1).2.2.2.1, + (weightTwelveFlatTriple_data hpBad.1).2.2.2.2.1, + (weightTwelveFlatTriple_data hpBad.1).2.2.2.2.2.1, + (weightTwelveFlatTriple_data hpBad.1).2.2.2.2.2.2.1, + (weightTwelveFlatTriple_data hpBad.1).2.2.2.2.2.2.2, + hpBad.2⟩ + +private structure BadWeightTwelveFlatTripleWitness + (p : WeightTwelveFlatTriple n) where + u : FABL.F₂Cube n + v : FABL.F₂Cube n + a : FABL.F₂Cube n + b : FABL.F₂Cube n + c : FABL.F₂Cube n + line_eq : FABL.binaryAffineSubspace (FABL.𝔽₂ ∙ v) u = p.1 + first_eq : FABL.binaryAffineSubspace + (((FABL.𝔽₂ ∙ v) ⊔ (FABL.𝔽₂ ∙ a)) ⊔ (FABL.𝔽₂ ∙ b)) u = p.2.1 + second_eq : FABL.binaryAffineSubspace + (((FABL.𝔽₂ ∙ v) ⊔ (FABL.𝔽₂ ∙ a)) ⊔ (FABL.𝔽₂ ∙ c)) u = p.2.2 + +private noncomputable def badWeightTwelveFlatTripleWitness + (p : WeightTwelveFlatTriple n) + (hp : p ∈ badWeightTwelveFlatTriples n) : + BadWeightTwelveFlatTripleWitness p := by + classical + have hdata := badWeightTwelveFlatTriple_data hp + let u := Classical.choose + ((AffineSubspace.nonempty_iff_ne_bot p.1).2 hdata.1) + have hu := Classical.choose_spec + ((AffineSubspace.nonempty_iff_ne_bot p.1).2 hdata.1) + have hlinePos : ⊥ < p.1.direction := by + apply bot_lt_iff_ne_bot.mpr + intro hbot + have hrank : Module.finrank FABL.𝔽₂ p.1.direction = 0 := by + rw [hbot, finrank_bot] + omega + let v' := Classical.choose (Submodule.nonzero_mem_of_bot_lt hlinePos) + have hv := Classical.choose_spec (Submodule.nonzero_mem_of_bot_lt hlinePos) + let v : FABL.F₂Cube n := v' + have hv0 : v ≠ 0 := by + intro hvzero + apply hv + apply Subtype.ext + exact hvzero + have hspanV : FABL.𝔽₂ ∙ v = p.1.direction := by + apply Submodule.eq_of_le_of_finrank_eq + · exact Submodule.span_le.2 (Set.singleton_subset_iff.2 v'.2) + · rw [finrank_span_singleton hv0, hdata.2.1] + have hlineFirstDirection : p.1.direction ≤ p.2.1.direction := + AffineSubspace.direction_le hdata.2.2.2.2.2.2.1 + have hlineSecondDirection : p.1.direction ≤ p.2.2.direction := + AffineSubspace.direction_le hdata.2.2.2.2.2.2.2.1 + have hlineIntersection : + p.1.direction ≤ p.2.1.direction ⊓ p.2.2.direction := + le_inf hlineFirstDirection hlineSecondDirection + have hlineLt : + p.1.direction < p.2.1.direction ⊓ p.2.2.direction := + lt_of_le_of_ne hlineIntersection hdata.2.2.2.2.2.2.2.2.symm + let a' := Classical.choose (SetLike.exists_of_lt hlineLt) + have ha := Classical.choose_spec (SetLike.exists_of_lt hlineLt) + let a : FABL.F₂Cube n := a' + let P : Submodule FABL.𝔽₂ (FABL.F₂Cube n) := + p.1.direction ⊔ (FABL.𝔽₂ ∙ a) + have hPrank : Module.finrank FABL.𝔽₂ P = 2 := by + dsimp only [P] + rw [Submodule.finrank_sup_span_singleton ha.2, hdata.2.1] + have hPFirst : P ≤ p.2.1.direction := by + exact sup_le hlineFirstDirection + (Submodule.span_le.2 (Set.singleton_subset_iff.2 ha.1.1)) + have hPSecond : P ≤ p.2.2.direction := by + exact sup_le hlineSecondDirection + (Submodule.span_le.2 (Set.singleton_subset_iff.2 ha.1.2)) + have hfirstRank : Module.finrank FABL.𝔽₂ p.2.1.direction = 3 := + hdata.2.2.2.1 + have hsecondRank : Module.finrank FABL.𝔽₂ p.2.2.direction = 3 := + hdata.2.2.2.2.2.1 + have hPFirstRankLt : Module.finrank FABL.𝔽₂ P < + Module.finrank FABL.𝔽₂ p.2.1.direction := by omega + have hPSecondRankLt : Module.finrank FABL.𝔽₂ P < + Module.finrank FABL.𝔽₂ p.2.2.direction := by omega + have hPFirstLt : P < p.2.1.direction := + Submodule.lt_of_le_of_finrank_lt_finrank hPFirst hPFirstRankLt + have hPSecondLt : P < p.2.2.direction := + Submodule.lt_of_le_of_finrank_lt_finrank hPSecond hPSecondRankLt + let b' := Classical.choose (SetLike.exists_of_lt hPFirstLt) + have hb := Classical.choose_spec (SetLike.exists_of_lt hPFirstLt) + let b : FABL.F₂Cube n := b' + let c' := Classical.choose (SetLike.exists_of_lt hPSecondLt) + have hc := Classical.choose_spec (SetLike.exists_of_lt hPSecondLt) + let c : FABL.F₂Cube n := c' + have hfirstDirection : + P ⊔ (FABL.𝔽₂ ∙ b) = p.2.1.direction := by + apply Submodule.eq_of_le_of_finrank_eq + · exact sup_le hPFirst + (Submodule.span_le.2 (Set.singleton_subset_iff.2 hb.1)) + · rw [Submodule.finrank_sup_span_singleton hb.2, hPrank, + hfirstRank] + have hsecondDirection : + P ⊔ (FABL.𝔽₂ ∙ c) = p.2.2.direction := by + apply Submodule.eq_of_le_of_finrank_eq + · exact sup_le hPSecond + (Submodule.span_le.2 (Set.singleton_subset_iff.2 hc.1)) + · rw [Submodule.finrank_sup_span_singleton hc.2, hPrank, + hsecondRank] + have huFirst : u ∈ p.2.1 := hdata.2.2.2.2.2.2.1 hu + have huSecond : u ∈ p.2.2 := hdata.2.2.2.2.2.2.2.1 hu + refine ⟨u, v, a, b, c, ?_, ?_, ?_⟩ + · apply (AffineSubspace.eq_iff_direction_eq_of_mem + (AffineSubspace.self_mem_mk' _ _) hu).2 + rw [AffineSubspace.direction_mk', hspanV] + · apply (AffineSubspace.eq_iff_direction_eq_of_mem + (AffineSubspace.self_mem_mk' _ _) huFirst).2 + rw [AffineSubspace.direction_mk'] + simpa only [P, hspanV] using hfirstDirection + · apply (AffineSubspace.eq_iff_direction_eq_of_mem + (AffineSubspace.self_mem_mk' _ _) huSecond).2 + rw [AffineSubspace.direction_mk'] + simpa only [P, hspanV] using hsecondDirection + +private noncomputable def chosenBadWeightTwelveFlatTripleWitness + (p : WeightTwelveFlatTriple n) + (hp : p ∈ badWeightTwelveFlatTriples n) : + BadWeightTwelveFlatTripleWitness p := + badWeightTwelveFlatTripleWitness p hp + +private def badWeightTwelveFlatTripleWitnessCode + {p : WeightTwelveFlatTriple n} + (w : BadWeightTwelveFlatTripleWitness p) : + Fin 5 → FABL.F₂Cube n := + ![w.u, w.v, w.a, w.b, w.c] + +private noncomputable def badWeightTwelveFlatTripleCode + (p : WeightTwelveFlatTriple n) : Fin 5 → FABL.F₂Cube n := by + classical + exact if hp : p ∈ badWeightTwelveFlatTriples n then + badWeightTwelveFlatTripleWitnessCode + (chosenBadWeightTwelveFlatTripleWitness p hp) + else 0 + +private theorem badWeightTwelveFlatTripleCode_injective_on : + Set.InjOn (badWeightTwelveFlatTripleCode (n := n)) + (badWeightTwelveFlatTriples n : Set (WeightTwelveFlatTriple n)) := by + intro p hp q hq hcode + have hpFin : p ∈ badWeightTwelveFlatTriples n := hp + have hqFin : q ∈ badWeightTwelveFlatTriples n := hq + have hcode' : + badWeightTwelveFlatTripleWitnessCode + (chosenBadWeightTwelveFlatTripleWitness p hp) = + badWeightTwelveFlatTripleWitnessCode + (chosenBadWeightTwelveFlatTripleWitness q hq) := by + unfold badWeightTwelveFlatTripleCode at hcode + rw [dif_pos hpFin, dif_pos hqFin] at hcode + simpa only using hcode + have h0 := congrFun hcode' (0 : Fin 5) + have h1 := congrFun hcode' (1 : Fin 5) + have h2 := congrFun hcode' (2 : Fin 5) + have h3 := congrFun hcode' (3 : Fin 5) + have h4 := congrFun hcode' (4 : Fin 5) + have h0' : (chosenBadWeightTwelveFlatTripleWitness p hp).u = + (chosenBadWeightTwelveFlatTripleWitness q hq).u := by + simpa [badWeightTwelveFlatTripleWitnessCode] using h0 + have h1' : (chosenBadWeightTwelveFlatTripleWitness p hp).v = + (chosenBadWeightTwelveFlatTripleWitness q hq).v := by + simpa [badWeightTwelveFlatTripleWitnessCode] using h1 + have h2' : (chosenBadWeightTwelveFlatTripleWitness p hp).a = + (chosenBadWeightTwelveFlatTripleWitness q hq).a := by + simpa [badWeightTwelveFlatTripleWitnessCode] using h2 + have h3' : (chosenBadWeightTwelveFlatTripleWitness p hp).b = + (chosenBadWeightTwelveFlatTripleWitness q hq).b := by + simpa [badWeightTwelveFlatTripleWitnessCode] using h3 + have h4' : (chosenBadWeightTwelveFlatTripleWitness p hp).c = + (chosenBadWeightTwelveFlatTripleWitness q hq).c := by + simpa [badWeightTwelveFlatTripleWitnessCode] using h4 + apply Prod.ext + · rw [← (chosenBadWeightTwelveFlatTripleWitness p hp).line_eq, + ← (chosenBadWeightTwelveFlatTripleWitness q hq).line_eq, + h0', h1'] + · apply Prod.ext + · rw [← (chosenBadWeightTwelveFlatTripleWitness p hp).first_eq, + ← (chosenBadWeightTwelveFlatTripleWitness q hq).first_eq, + h0', h1', h2', h3'] + · rw [← (chosenBadWeightTwelveFlatTripleWitness p hp).second_eq, + ← (chosenBadWeightTwelveFlatTripleWitness q hq).second_eq, + h0', h1', h2', h4'] + +/-- Bad affine-line representations inject into five ambient vectors, hence +contribute at most `(2^n)^5` terms. -/ +theorem card_badWeightTwelveFlatTriples_le (n : ℕ) : + (badWeightTwelveFlatTriples n).card ≤ (2 ^ n) ^ 5 := by + classical + calc + (badWeightTwelveFlatTriples n).card ≤ + (Finset.univ : Finset (Fin 5 → FABL.F₂Cube n)).card := by + apply Finset.card_le_card_of_injOn + (badWeightTwelveFlatTripleCode (n := n)) + · intro p _hp + exact Finset.mem_univ _ + · exact badWeightTwelveFlatTripleCode_injective_on + _ = (2 ^ n) ^ 5 := by + rw [Finset.card_univ, Fintype.card_fun, Fintype.card_fin, card_f₂Cube] + +/-- The affine-line representations whose two three-flats have precisely the +displayed common direction. -/ +noncomputable def goodWeightTwelveFlatTriples (n : ℕ) : + Finset (WeightTwelveFlatTriple n) := by + classical + exact (weightTwelveFlatTriples n).filter fun p ↦ + p.2.1.direction ⊓ p.2.2.direction = p.1.direction + +private theorem goodWeightTwelveFlatTriple_data + {p : WeightTwelveFlatTriple n} + (hp : p ∈ goodWeightTwelveFlatTriples n) : + p.1 ≠ ⊥ ∧ Module.finrank FABL.𝔽₂ p.1.direction = 1 ∧ + p.2.1 ≠ ⊥ ∧ Module.finrank FABL.𝔽₂ p.2.1.direction = 3 ∧ + p.2.2 ≠ ⊥ ∧ Module.finrank FABL.𝔽₂ p.2.2.direction = 3 ∧ + p.1 ≤ p.2.1 ∧ p.1 ≤ p.2.2 ∧ + p.2.1.direction ⊓ p.2.2.direction = p.1.direction := by + classical + have hpGood := Finset.mem_filter.mp hp + exact ⟨(weightTwelveFlatTriple_data hpGood.1).1, + (weightTwelveFlatTriple_data hpGood.1).2.1, + (weightTwelveFlatTriple_data hpGood.1).2.2.1, + (weightTwelveFlatTriple_data hpGood.1).2.2.2.1, + (weightTwelveFlatTriple_data hpGood.1).2.2.2.2.1, + (weightTwelveFlatTriple_data hpGood.1).2.2.2.2.2.1, + (weightTwelveFlatTriple_data hpGood.1).2.2.2.2.2.2.1, + (weightTwelveFlatTriple_data hpGood.1).2.2.2.2.2.2.2, + hpGood.2⟩ + +/-- The Boolean word represented by a pair of affine three-flats. -/ +noncomputable def weightTwelveRepresentationWord + (p : WeightTwelveFlatTriple n) : BooleanFunction n := + binaryAffineFlatIndicator p.2.1 + binaryAffineFlatIndicator p.2.2 + +noncomputable def weightTwelveFlatTripleCharacter + (f : BooleanFunction n) (p : WeightTwelveFlatTriple n) : ℝ := + binaryAffineFlatCharacter f p.2.1 * + binaryAffineFlatCharacter f p.2.2 + +/-- The weight-twelve words in the dual Reed--Muller code. -/ +noncomputable def orderTwoWeightTwelveDualWords (n : ℕ) : + Finset (BooleanFunction n) := by + classical + exact (orderTwoDualWords n).filter fun h ↦ hammingWeight h = 12 + +/-- Carlet--Mesnager's `M_f^(12)`, as a canonical dual-code character +sum. -/ +noncomputable def orderTwoWeightTwelveCharacterSum + (f : BooleanFunction n) : ℝ := + ∑ h ∈ orderTwoWeightTwelveDualWords n, + FABL.binarySign (booleanFunctionPairing n f h) + +/-- The character of a represented weight-twelve word is the product of the +two affine-flat characters. -/ +theorem weightTwelveRepresentationWord_character + (f : BooleanFunction n) (p : WeightTwelveFlatTriple n) : + FABL.binarySign + (booleanFunctionPairing n f (weightTwelveRepresentationWord p)) = + weightTwelveFlatTripleCharacter f p := by + rw [weightTwelveRepresentationWord, map_add, AddChar.map_add_eq_mul] + rfl + +private theorem binaryAffineFlatPoints_inter_eq_line + {p : WeightTwelveFlatTriple n} + (hp : p ∈ goodWeightTwelveFlatTriples n) : + binaryAffineFlatPoints p.2.1 ∩ binaryAffineFlatPoints p.2.2 = + binaryAffineFlatPoints p.1 := by + classical + have hdata := goodWeightTwelveFlatTriple_data hp + obtain ⟨u, hu⟩ := (AffineSubspace.nonempty_iff_ne_bot p.1).2 hdata.1 + have huFirst : u ∈ p.2.1 := hdata.2.2.2.2.2.2.1 hu + have huSecond : u ∈ p.2.2 := hdata.2.2.2.2.2.2.2.1 hu + have huInf : u ∈ p.2.1 ⊓ p.2.2 := by + exact (AffineSubspace.mem_inf_iff u p.2.1 p.2.2).2 + ⟨huFirst, huSecond⟩ + have hinf : p.2.1 ⊓ p.2.2 = p.1 := by + apply (AffineSubspace.eq_iff_direction_eq_of_mem huInf hu).2 + rw [AffineSubspace.direction_inf_of_mem_inf huInf] + exact hdata.2.2.2.2.2.2.2.2 + ext x + simp only [Finset.mem_inter, mem_binaryAffineFlatPoints] + rw [← AffineSubspace.mem_inf_iff, hinf] + +/-- A precise affine-line representation has Hamming weight twelve. -/ +theorem hammingWeight_weightTwelveRepresentationWord + {p : WeightTwelveFlatTriple n} + (hp : p ∈ goodWeightTwelveFlatTriples n) : + hammingWeight (weightTwelveRepresentationWord p) = 12 := by + have hdata := goodWeightTwelveFlatTriple_data hp + have hintersection := binaryAffineFlatPoints_inter_eq_line hp + have hidentity := hammingWeight_add_add_two_mul_card_support_inter + (binaryAffineFlatIndicator p.2.1) (binaryAffineFlatIndicator p.2.2) + rw [support_binaryAffineFlatIndicator, + support_binaryAffineFlatIndicator, hintersection, + hammingWeight_binaryAffineFlatIndicator p.2.1 hdata.2.2.1, + hammingWeight_binaryAffineFlatIndicator p.2.2 hdata.2.2.2.2.1, + card_binaryAffineFlatPoints p.1 hdata.1, + hdata.2.1, hdata.2.2.2.1, hdata.2.2.2.2.2.1] at hidentity + norm_num at hidentity + change hammingWeight + (binaryAffineFlatIndicator p.2.1 + binaryAffineFlatIndicator p.2.2) = 12 + omega + +/-- Every precise affine-line representation produces a weight-twelve word +of the dual Reed--Muller code. -/ +theorem weightTwelveRepresentationWord_mem_dualWords + {p : WeightTwelveFlatTriple n} + (hp : p ∈ goodWeightTwelveFlatTriples n) : + weightTwelveRepresentationWord p ∈ orderTwoWeightTwelveDualWords n := by + classical + have hpGood := Finset.mem_filter.mp hp + have hpTriple := Finset.mem_filter.mp hpGood.1 + have hpProduct := Finset.mem_product.mp hpTriple.1 + have hpThree := Finset.mem_product.mp hpProduct.2 + have hfirst := binaryAffineFlatIndicator_mem_reedMuller p.2.1 hpThree.1 + have hsecond := binaryAffineFlatIndicator_mem_reedMuller p.2.2 hpThree.2 + have hsum : weightTwelveRepresentationWord p ∈ reedMuller (n - 3) n := by + simpa only [weightTwelveRepresentationWord] using + (reedMuller (n - 3) n).add_mem hfirst hsecond + simp only [orderTwoWeightTwelveDualWords, orderTwoDualWords, + Finset.mem_filter, Finset.mem_univ, true_and] + exact ⟨hsum, hammingWeight_weightTwelveRepresentationWord hp⟩ + +/-- The finite-fiber interface supplied by the Kasami--Tokura weight-twelve +classification together with the exact count of affine-flat decompositions. -/ +def HasWeightTwelveFlatPairClassification (n : ℕ) : Prop := + ∀ h : BooleanFunction n, + ((goodWeightTwelveFlatTriples n).filter fun p ↦ + weightTwelveRepresentationWord p = h).card = + if h ∈ orderTwoWeightTwelveDualWords n then 20 else 0 + +/-- The low-weight spectrum interface needed to group the seventh and eighth +moments; in particular it excludes weight ten. -/ +def HasOrderTwoLowWeightSpectrum (n : ℕ) : Prop := + ∀ h ∈ orderTwoDualWords n, Even (hammingWeight h) → + hammingWeight h ≤ 16 → + hammingWeight h = 0 ∨ hammingWeight h = 8 ∨ + hammingWeight h = 12 ∨ hammingWeight h = 14 ∨ + hammingWeight h = 16 + +private noncomputable def binaryThreeFlatsContaining + (L : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) : + Finset (AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) := by + classical + exact (binaryAffineFlats 3 n).filter fun A ↦ L ≤ A + +/-- The normalized character sum of the affine-line representations used for +the weight-twelve term. -/ +noncomputable def weightTwelveRepresentationCharacterSum + (f : BooleanFunction n) : ℝ := + (1 / 20 : ℝ) * + ∑ p ∈ goodWeightTwelveFlatTriples n, + weightTwelveFlatTripleCharacter f p + +private theorem sum_weightTwelveFlatTriples_eq_sum_sq + (f : BooleanFunction n) : + (∑ p ∈ weightTwelveFlatTriples n, + weightTwelveFlatTripleCharacter f p) = + ∑ L ∈ binaryAffineFlats 1 n, + (∑ A ∈ binaryThreeFlatsContaining L, + binaryAffineFlatCharacter f A) ^ 2 := by + classical + calc + (∑ p ∈ weightTwelveFlatTriples n, + weightTwelveFlatTripleCharacter f p) = + ∑ L ∈ binaryAffineFlats 1 n, + ∑ A ∈ binaryThreeFlatsContaining L, + ∑ B ∈ binaryThreeFlatsContaining L, + binaryAffineFlatCharacter f A * + binaryAffineFlatCharacter f B := by + rw [weightTwelveFlatTriples, Finset.sum_filter] + calc + (∑ p ∈ (binaryAffineFlats 1 n).product + ((binaryAffineFlats 3 n).product (binaryAffineFlats 3 n)), + if p.1 ≤ p.2.1 ∧ p.1 ≤ p.2.2 then + weightTwelveFlatTripleCharacter f p else 0) = + ∑ L ∈ binaryAffineFlats 1 n, + ∑ q ∈ (binaryAffineFlats 3 n).product + (binaryAffineFlats 3 n), + if L ≤ q.1 ∧ L ≤ q.2 then + weightTwelveFlatTripleCharacter f (L, q) else 0 := by + exact Finset.sum_product _ _ _ + _ = ∑ L ∈ binaryAffineFlats 1 n, + ∑ A ∈ binaryThreeFlatsContaining L, + ∑ B ∈ binaryThreeFlatsContaining L, + binaryAffineFlatCharacter f A * + binaryAffineFlatCharacter f B := by + apply Finset.sum_congr rfl + intro L _hL + rw [show (∑ q ∈ (binaryAffineFlats 3 n).product + (binaryAffineFlats 3 n), + if L ≤ q.1 ∧ L ≤ q.2 then + weightTwelveFlatTripleCharacter f (L, q) else 0) = + ∑ A ∈ binaryAffineFlats 3 n, + ∑ B ∈ binaryAffineFlats 3 n, + if L ≤ A ∧ L ≤ B then + weightTwelveFlatTripleCharacter f (L, (A, B)) else 0 by + exact Finset.sum_product _ _ _] + simp only [binaryThreeFlatsContaining, Finset.sum_filter] + apply Finset.sum_congr rfl + intro A _hA + by_cases hLA : L ≤ A + · simp only [hLA, true_and, if_true] + apply Finset.sum_congr rfl + intro B _hB + by_cases hLB : L ≤ B <;> + simp [hLB, weightTwelveFlatTripleCharacter] + · simp [hLA] + _ = ∑ L ∈ binaryAffineFlats 1 n, + (∑ A ∈ binaryThreeFlatsContaining L, + binaryAffineFlatCharacter f A) ^ 2 := by + apply Finset.sum_congr rfl + intro L _hL + rw [pow_two] + simp only [Finset.sum_mul, Finset.mul_sum] + simp only [mul_comm] + +private theorem sum_weightTwelveFlatTriples_nonneg + (f : BooleanFunction n) : + 0 ≤ ∑ p ∈ weightTwelveFlatTriples n, + weightTwelveFlatTripleCharacter f p := by + rw [sum_weightTwelveFlatTriples_eq_sum_sq] + positivity + +private theorem weightTwelveFlatTripleCharacter_le_one + (f : BooleanFunction n) (p : WeightTwelveFlatTriple n) : + weightTwelveFlatTripleCharacter f p ≤ 1 := by + rcases binaryAffineFlatCharacter_eq_one_or_neg_one f p.2.1 with hA | hA <;> + rcases binaryAffineFlatCharacter_eq_one_or_neg_one f p.2.2 with hB | hB <;> + simp only [weightTwelveFlatTripleCharacter, hA, hB] <;> norm_num + +private theorem sum_badWeightTwelveFlatTriples_le + (f : BooleanFunction n) : + (∑ p ∈ badWeightTwelveFlatTriples n, + weightTwelveFlatTripleCharacter f p) ≤ (2 ^ n : ℝ) ^ 5 := by + calc + (∑ p ∈ badWeightTwelveFlatTriples n, + weightTwelveFlatTripleCharacter f p) ≤ + ∑ _p ∈ badWeightTwelveFlatTriples n, (1 : ℝ) := by + apply Finset.sum_le_sum + intro p _hp + exact weightTwelveFlatTripleCharacter_le_one f p + _ = ((badWeightTwelveFlatTriples n).card : ℝ) := by simp + _ ≤ ((2 ^ n) ^ 5 : ℕ) := by + exact_mod_cast card_badWeightTwelveFlatTriples_le n + _ = (2 ^ n : ℝ) ^ 5 := by norm_num + +private theorem sum_goodWeightTwelveFlatTriples_ge + (f : BooleanFunction n) : + (∑ p ∈ goodWeightTwelveFlatTriples n, + weightTwelveFlatTripleCharacter f p) ≥ -(2 ^ n : ℝ) ^ 5 := by + have hsplit := Finset.sum_filter_add_sum_filter_not + (weightTwelveFlatTriples n) + (fun p : WeightTwelveFlatTriple n ↦ + p.2.1.direction ⊓ p.2.2.direction ≠ p.1.direction) + (weightTwelveFlatTripleCharacter f) + have hgoodFilter : + (weightTwelveFlatTriples n).filter (fun p ↦ + ¬p.2.1.direction ⊓ p.2.2.direction ≠ p.1.direction) = + goodWeightTwelveFlatTriples n := by + classical + ext p + simp [goodWeightTwelveFlatTriples] + rw [show (weightTwelveFlatTriples n).filter (fun p ↦ + p.2.1.direction ⊓ p.2.2.direction ≠ p.1.direction) = + badWeightTwelveFlatTriples n by rfl, hgoodFilter] at hsplit + have htotal := sum_weightTwelveFlatTriples_nonneg f + have hbad := sum_badWeightTwelveFlatTriples_le f + linarith + +/-- The affine representation form of the weight-twelve character sum is at +least `-(2^n)^5 / 20`. -/ +theorem weightTwelveRepresentationCharacterSum_ge + (f : BooleanFunction n) : + weightTwelveRepresentationCharacterSum f ≥ + -(2 ^ n : ℝ) ^ 5 / 20 := by + rw [weightTwelveRepresentationCharacterSum] + have hgood := sum_goodWeightTwelveFlatTriples_ge f + linarith + +private theorem sum_goodWeightTwelveFlatTriples_eq_twenty_mul + (f : BooleanFunction n) + (hclassification : HasWeightTwelveFlatPairClassification n) : + (∑ p ∈ goodWeightTwelveFlatTriples n, + weightTwelveFlatTripleCharacter f p) = + 20 * orderTwoWeightTwelveCharacterSum f := by + classical + calc + (∑ p ∈ goodWeightTwelveFlatTriples n, + weightTwelveFlatTripleCharacter f p) = + ∑ h ∈ orderTwoWeightTwelveDualWords n, + ∑ p ∈ (goodWeightTwelveFlatTriples n).filter + (fun p ↦ weightTwelveRepresentationWord p = h), + weightTwelveFlatTripleCharacter f p := by + symm + apply Finset.sum_fiberwise_of_maps_to + intro p hp + exact weightTwelveRepresentationWord_mem_dualWords hp + _ = ∑ h ∈ orderTwoWeightTwelveDualWords n, + 20 * FABL.binarySign (booleanFunctionPairing n f h) := by + apply Finset.sum_congr rfl + intro h hh + calc + (∑ p ∈ (goodWeightTwelveFlatTriples n).filter + (fun p ↦ weightTwelveRepresentationWord p = h), + weightTwelveFlatTripleCharacter f p) = + ∑ _p ∈ (goodWeightTwelveFlatTriples n).filter + (fun p ↦ weightTwelveRepresentationWord p = h), + FABL.binarySign (booleanFunctionPairing n f h) := by + apply Finset.sum_congr rfl + intro p hp + have hpWord := (Finset.mem_filter.mp hp).2 + rw [← hpWord, weightTwelveRepresentationWord_character] + _ = (((goodWeightTwelveFlatTriples n).filter fun p ↦ + weightTwelveRepresentationWord p = h).card : ℝ) * + FABL.binarySign (booleanFunctionPairing n f h) := by simp + _ = 20 * FABL.binarySign (booleanFunctionPairing n f h) := by + rw [hclassification h, if_pos hh] + norm_num + _ = 20 * orderTwoWeightTwelveCharacterSum f := by + rw [orderTwoWeightTwelveCharacterSum, Finset.mul_sum] + +/-- Under the Kasami--Tokura finite-fiber classification, the canonical +weight-twelve character sum is the affine representation sum. -/ +theorem orderTwoWeightTwelveCharacterSum_eq_representation + (f : BooleanFunction n) + (hclassification : HasWeightTwelveFlatPairClassification n) : + orderTwoWeightTwelveCharacterSum f = + weightTwelveRepresentationCharacterSum f := by + rw [weightTwelveRepresentationCharacterSum, + sum_goodWeightTwelveFlatTriples_eq_twenty_mul f hclassification] + ring + +/-- A reusable `O((2^n)^5)` lower bound for the weight-twelve contribution, +conditional only on the cited Kasami--Tokura classification. -/ +theorem orderTwoWeightTwelveCharacterSum_ge + (f : BooleanFunction n) + (hclassification : HasWeightTwelveFlatPairClassification n) : + orderTwoWeightTwelveCharacterSum f ≥ -(2 ^ n : ℝ) ^ 5 / 20 := by + rw [orderTwoWeightTwelveCharacterSum_eq_representation f hclassification] + exact weightTwelveRepresentationCharacterSum_ge f + +end CryptBoolean diff --git a/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightTwelveClassification.lean b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightTwelveClassification.lean new file mode 100644 index 0000000..ab90f7f --- /dev/null +++ b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightTwelveClassification.lean @@ -0,0 +1,2957 @@ +/- +Copyright (c) 2026 Asher Yan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Asher Yan with Codex +-/ +module + +public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightTwelve +public import CryptBoolean.Carlet.Chapter03.ReedMullerLowWeightAffineSpan +public import FABL.Chapter06.FoolingF₂Polynomials.DirectionalDerivatives +public import Mathlib.LinearAlgebra.BilinearForm.Orthogonal + +/-! +# The corrected weight-twelve affine-flat classification + +The five-variable quadratic core of the Kasami--Tokura classification and +the exact twenty-element fiber of ordered affine-flat decompositions. +-/ + +open Finset +open scoped BigOperators BooleanCube + +@[expose] public section + +namespace CryptBoolean + +open FABL + +variable {n : ℕ} + +noncomputable local instance weightTwelveQuadraticRadicalFintype + (S : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) : Fintype S := + Fintype.ofFinite S + +noncomputable local instance weightTwelveQuotientDecidableEq + (S : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) : + DecidableEq (FABL.F₂Cube n ⧸ S) := + Classical.decEq _ + +noncomputable local instance weightTwelveClassificationAffineSubspaceDecidableEq : + DecidableEq (AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) := + Classical.decEq _ + +theorem goodWeightTwelveFlatTriple_geometry + {p : WeightTwelveFlatTriple n} + (hp : p ∈ goodWeightTwelveFlatTriples n) : + p.1 ≠ ⊥ ∧ Module.finrank FABL.𝔽₂ p.1.direction = 1 ∧ + p.2.1 ≠ ⊥ ∧ Module.finrank FABL.𝔽₂ p.2.1.direction = 3 ∧ + p.2.2 ≠ ⊥ ∧ Module.finrank FABL.𝔽₂ p.2.2.direction = 3 ∧ + p.1 ≤ p.2.1 ∧ p.1 ≤ p.2.2 ∧ + p.2.1.direction ⊓ p.2.2.direction = p.1.direction := by + classical + have hpGood := Finset.mem_filter.mp hp + have hpTriple := Finset.mem_filter.mp hpGood.1 + have hpProduct := Finset.mem_product.mp hpTriple.1 + have hpThree := Finset.mem_product.mp hpProduct.2 + have hline : p.1 ≠ ⊥ ∧ + Module.finrank FABL.𝔽₂ p.1.direction = 1 := by + simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, + true_and] using hpProduct.1 + have hfirst : p.2.1 ≠ ⊥ ∧ + Module.finrank FABL.𝔽₂ p.2.1.direction = 3 := by + simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, + true_and] using hpThree.1 + have hsecond : p.2.2 ≠ ⊥ ∧ + Module.finrank FABL.𝔽₂ p.2.2.direction = 3 := by + simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, + true_and] using hpThree.2 + exact ⟨hline.1, hline.2, hfirst.1, hfirst.2, + hsecond.1, hsecond.2, hpTriple.2.1, hpTriple.2.2, hpGood.2⟩ + +theorem binaryAffineFlatIndicator_add_period_of_mem_direction + (A : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) + (a : FABL.F₂Cube n) (ha : a ∈ A.direction) + (x : FABL.F₂Cube n) : + binaryAffineFlatIndicator A (x + a) = + binaryAffineFlatIndicator A x := by + classical + have hmem : x + a ∈ A ↔ x ∈ A := by + simpa only [vadd_eq_add, add_comm] using + (AffineSubspace.vadd_mem_iff_mem_of_mem_direction ha (p := x)) + simp only [binaryAffineFlatIndicator] + by_cases hx : x ∈ A + · rw [if_pos hx, if_pos (hmem.mpr hx)] + · rw [if_neg hx, if_neg (fun h ↦ hx (hmem.mp h))] + +theorem weightTwelveRepresentationWord_add_period_of_mem_line_direction + {p : WeightTwelveFlatTriple n} + (hp : p ∈ goodWeightTwelveFlatTriples n) + (a : FABL.F₂Cube n) (ha : a ∈ p.1.direction) + (x : FABL.F₂Cube n) : + weightTwelveRepresentationWord p (x + a) = + weightTwelveRepresentationWord p x := by + have hdata := goodWeightTwelveFlatTriple_geometry hp + have haFirst : a ∈ p.2.1.direction := + (AffineSubspace.direction_le hdata.2.2.2.2.2.2.1) ha + have haSecond : a ∈ p.2.2.direction := + (AffineSubspace.direction_le hdata.2.2.2.2.2.2.2.1) ha + simp only [weightTwelveRepresentationWord, Pi.add_apply] + rw [binaryAffineFlatIndicator_add_period_of_mem_direction + p.2.1 a haFirst x, + binaryAffineFlatIndicator_add_period_of_mem_direction + p.2.2 a haSecond x] + +def quadraticPolarKernel + (f : BooleanFunction n) (a b : FABL.F₂Cube n) : FABL.𝔽₂ := + FABL.booleanDerivative f a b + FABL.booleanDerivative f a 0 + +theorem quadraticPolarKernel_eq + (f : BooleanFunction n) (a b : FABL.F₂Cube n) : + quadraticPolarKernel f a b = + f (a + b) + f a + f b + f 0 := by + simp only [quadraticPolarKernel, FABL.booleanDerivative] + abel + +theorem quadraticPolarKernel_comm + (f : BooleanFunction n) (a b : FABL.F₂Cube n) : + quadraticPolarKernel f a b = quadraticPolarKernel f b a := by + rw [quadraticPolarKernel_eq, quadraticPolarKernel_eq, add_comm a b] + abel + +theorem quadraticPolarKernel_eq_dotProduct_of_derivative_eq_affine + (f : BooleanFunction n) (a b : FABL.F₂Cube n) + (d : FABL.𝔽₂) (u : FABL.F₂Cube n) + (hderivative : FABL.booleanDerivative f a = + FABL.affineFunction d u) : + quadraticPolarKernel f a b = FABL.f₂DotProduct u b := by + simp only [quadraticPolarKernel, hderivative, FABL.affineFunction, + FABL.f₂DotProduct, dotProduct_zero] + calc + (d + dotProduct u b) + (d + 0) = + (d + d) + dotProduct u b := by abel + _ = dotProduct u b := by + rw [ZModModule.add_self, zero_add] + +theorem quadraticPolarKernel_add_right + (f : BooleanFunction n) + (hdegree : FABL.functionAlgebraicDegree f ≤ 2) + (a b c : FABL.F₂Cube n) : + quadraticPolarKernel f a (b + c) = + quadraticPolarKernel f a b + quadraticPolarKernel f a c := by + have hderivative : FABL.functionAlgebraicDegree + (FABL.booleanDerivative f a) ≤ 1 := by + exact (FABL.functionAlgebraicDegree_booleanDerivative_le f a).trans + (by omega) + obtain ⟨d, u, hu⟩ := + FABL.exists_affineFunction_of_functionAlgebraicDegree_le_one + (FABL.booleanDerivative f a) hderivative + rw [quadraticPolarKernel_eq_dotProduct_of_derivative_eq_affine + f a (b + c) d u hu, + quadraticPolarKernel_eq_dotProduct_of_derivative_eq_affine + f a b d u hu, + quadraticPolarKernel_eq_dotProduct_of_derivative_eq_affine + f a c d u hu] + exact dotProduct_add u b c + +theorem quadraticPolarKernel_smul_right + (f : BooleanFunction n) + (hdegree : FABL.functionAlgebraicDegree f ≤ 2) + (a b : FABL.F₂Cube n) (c : FABL.𝔽₂) : + quadraticPolarKernel f a (c • b) = + c • quadraticPolarKernel f a b := by + have hderivative : FABL.functionAlgebraicDegree + (FABL.booleanDerivative f a) ≤ 1 := by + exact (FABL.functionAlgebraicDegree_booleanDerivative_le f a).trans + (by omega) + obtain ⟨d, u, hu⟩ := + FABL.exists_affineFunction_of_functionAlgebraicDegree_le_one + (FABL.booleanDerivative f a) hderivative + rw [quadraticPolarKernel_eq_dotProduct_of_derivative_eq_affine + f a (c • b) d u hu, + quadraticPolarKernel_eq_dotProduct_of_derivative_eq_affine + f a b d u hu] + simp only [FABL.f₂DotProduct, dotProduct_smul] + +theorem quadraticPolarKernel_add_left + (f : BooleanFunction n) + (hdegree : FABL.functionAlgebraicDegree f ≤ 2) + (a b c : FABL.F₂Cube n) : + quadraticPolarKernel f (a + b) c = + quadraticPolarKernel f a c + quadraticPolarKernel f b c := by + rw [quadraticPolarKernel_comm f (a + b) c, + quadraticPolarKernel_add_right f hdegree, + quadraticPolarKernel_comm f c a, + quadraticPolarKernel_comm f c b] + +theorem quadraticPolarKernel_smul_left + (f : BooleanFunction n) + (hdegree : FABL.functionAlgebraicDegree f ≤ 2) + (a b : FABL.F₂Cube n) (c : FABL.𝔽₂) : + quadraticPolarKernel f (c • a) b = + c • quadraticPolarKernel f a b := by + rw [quadraticPolarKernel_comm f (c • a) b, + quadraticPolarKernel_smul_right f hdegree, + quadraticPolarKernel_comm f b a] + +noncomputable def quadraticPolar + (f : BooleanFunction n) + (hdegree : FABL.functionAlgebraicDegree f ≤ 2) : + LinearMap.BilinForm FABL.𝔽₂ (FABL.F₂Cube n) := + LinearMap.mk₂ FABL.𝔽₂ + (quadraticPolarKernel f) + (quadraticPolarKernel_add_left f hdegree) + (fun c a b ↦ quadraticPolarKernel_smul_left f hdegree a b c) + (quadraticPolarKernel_add_right f hdegree) + (fun c a b ↦ quadraticPolarKernel_smul_right f hdegree a b c) + +@[simp] theorem quadraticPolar_apply + (f : BooleanFunction n) + (hdegree : FABL.functionAlgebraicDegree f ≤ 2) + (a b : FABL.F₂Cube n) : + quadraticPolar f hdegree a b = quadraticPolarKernel f a b := + rfl + +theorem quadraticPolar_isSymm + (f : BooleanFunction n) + (hdegree : FABL.functionAlgebraicDegree f ≤ 2) : + (quadraticPolar f hdegree).IsSymm := by + constructor + exact quadraticPolarKernel_comm f + +theorem quadraticPolar_isAlt + (f : BooleanFunction n) + (hdegree : FABL.functionAlgebraicDegree f ≤ 2) : + (quadraticPolar f hdegree).IsAlt := by + intro a + rw [quadraticPolar_apply] + simp only [quadraticPolarKernel, FABL.booleanDerivative, + ZModModule.add_self, zero_add] + calc + (f a + f 0) + (f 0 + f a) = + (f a + f a) + (f 0 + f 0) := by abel + _ = 0 := by + rw [ZModModule.add_self, ZModModule.add_self, add_zero] + +/-- The radical of the polar form of a quadratic Boolean function. -/ +noncomputable def quadraticRadical + (f : BooleanFunction n) + (hdegree : FABL.functionAlgebraicDegree f ≤ 2) : + Submodule FABL.𝔽₂ (FABL.F₂Cube n) := + LinearMap.ker (quadraticPolar f hdegree) + +@[simp] theorem mem_quadraticRadical_iff + (f : BooleanFunction n) + (hdegree : FABL.functionAlgebraicDegree f ≤ 2) + (a : FABL.F₂Cube n) : + a ∈ quadraticRadical f hdegree ↔ + ∀ b, quadraticPolarKernel f a b = 0 := by + rw [quadraticRadical, LinearMap.mem_ker] + constructor + · intro ha b + exact DFunLike.congr_fun ha b + · intro ha + apply LinearMap.ext + intro b + exact ha b + +theorem booleanDerivative_eq_const_of_mem_quadraticRadical + (f : BooleanFunction n) + (hdegree : FABL.functionAlgebraicDegree f ≤ 2) + (a : FABL.F₂Cube n) + (ha : a ∈ quadraticRadical f hdegree) : + FABL.booleanDerivative f a = fun _ ↦ f a + f 0 := by + funext b + have hpolar := (mem_quadraticRadical_iff f hdegree a).mp ha b + rw [quadraticPolarKernel_eq] at hpolar + simp only [FABL.booleanDerivative] + rw [add_comm b a] + apply eq_of_sub_eq_zero + rw [sub_eq_add_neg, ZModModule.neg_eq_self] + calc + f b + f (a + b) + (f a + f 0) = + f (a + b) + f a + f b + f 0 := by abel + _ = 0 := hpolar + +theorem isBalanced_booleanDerivative_of_not_mem_quadraticRadical + (f : BooleanFunction n) + (hdegree : FABL.functionAlgebraicDegree f ≤ 2) + (a : FABL.F₂Cube n) + (ha : a ∉ quadraticRadical f hdegree) : + IsBalanced (FABL.booleanDerivative f a) := by + have hderivativeDegree : FABL.functionAlgebraicDegree + (FABL.booleanDerivative f a) ≤ 1 := by + exact (FABL.functionAlgebraicDegree_booleanDerivative_le f a).trans + (by omega) + obtain ⟨d, u, hu⟩ := + FABL.exists_affineFunction_of_functionAlgebraicDegree_le_one + (FABL.booleanDerivative f a) hderivativeDegree + rw [hu] + apply isBalanced_affineFunction_of_ne_zero + intro huZero + apply ha + rw [mem_quadraticRadical_iff] + intro b + rw [quadraticPolarKernel_eq_dotProduct_of_derivative_eq_affine + f a b d u hu, huZero] + rw [FABL.f₂DotProduct, dotProduct_comm, dotProduct_zero] + +theorem autocorrelation_eq_zero_of_not_mem_quadraticRadical + (f : BooleanFunction n) + (hdegree : FABL.functionAlgebraicDegree f ≤ 2) + (a : FABL.F₂Cube n) + (ha : a ∉ quadraticRadical f hdegree) : + autocorrelation f a = 0 := by + rw [autocorrelation_eq_walshTransform_booleanDerivative_zero] + norm_cast + exact (isBalanced_iff_walshTransform_zero_eq_zero + (FABL.booleanDerivative f a)).mp + (isBalanced_booleanDerivative_of_not_mem_quadraticRadical + f hdegree a ha) + +theorem autocorrelation_eq_card_mul_sign_of_mem_quadraticRadical + (f : BooleanFunction n) + (hdegree : FABL.functionAlgebraicDegree f ≤ 2) + (a : FABL.F₂Cube n) + (ha : a ∈ quadraticRadical f hdegree) : + autocorrelation f a = + (2 ^ n : ℝ) * FABL.binarySign (f a + f 0) := by + rw [autocorrelation, + booleanDerivative_eq_const_of_mem_quadraticRadical f hdegree a ha] + simp only [realSignView, FABL.realSignEncodedFunction, + FABL.signEncodedFunction, FABL.signValue_signEncode_eq_binarySign, + Finset.sum_const, Finset.card_univ, nsmul_eq_mul] + rw [card_f₂Cube] + norm_cast + +/-- On the radical, the translated quadratic function is an additive +character after applying the binary sign. -/ +noncomputable def quadraticRadicalSignCharacter + (f : BooleanFunction n) + (hdegree : FABL.functionAlgebraicDegree f ≤ 2) : + AddChar (quadraticRadical f hdegree) ℝ where + toFun a := FABL.binarySign (f a.1 + f 0) + map_zero_eq_one' := by + rw [Submodule.coe_zero, ZModModule.add_self, + AddChar.map_zero_eq_one] + map_add_eq_mul' := by + intro a b + rw [Submodule.coe_add, ← AddChar.map_add_eq_mul FABL.binarySign] + congr 1 + have hpolar := + (mem_quadraticRadical_iff f hdegree a.1).mp a.2 b.1 + rw [quadraticPolarKernel_eq] at hpolar + apply eq_of_sub_eq_zero + rw [sub_eq_add_neg, ZModModule.neg_eq_self] + calc + f (a.1 + b.1) + f 0 + + ((f a.1 + f 0) + (f b.1 + f 0)) = + (f (a.1 + b.1) + f a.1 + f b.1 + f 0) + + (f 0 + f 0) := by abel + _ = f (a.1 + b.1) + f a.1 + f b.1 + f 0 := by + rw [ZModModule.add_self, add_zero] + _ = 0 := hpolar + +theorem sum_autocorrelation_eq_card_mul_sum_quadraticRadicalSignCharacter + (f : BooleanFunction n) + (hdegree : FABL.functionAlgebraicDegree f ≤ 2) : + ∑ a, autocorrelation f a = + (2 ^ n : ℝ) * + ∑ a : quadraticRadical f hdegree, + quadraticRadicalSignCharacter f hdegree a := by + classical + let R := quadraticRadical f hdegree + have hpoint (a : FABL.F₂Cube n) : + autocorrelation f a = + if a ∈ R then + (2 ^ n : ℝ) * FABL.binarySign (f a + f 0) + else 0 := by + by_cases ha : a ∈ R + · rw [if_pos ha] + exact autocorrelation_eq_card_mul_sign_of_mem_quadraticRadical + f hdegree a ha + · rw [if_neg ha] + exact autocorrelation_eq_zero_of_not_mem_quadraticRadical + f hdegree a ha + calc + ∑ a, autocorrelation f a = + ∑ a, if a ∈ R then + (2 ^ n : ℝ) * FABL.binarySign (f a + f 0) + else 0 := by + apply Finset.sum_congr rfl + intro a _ + exact hpoint a + _ = ∑ a with a ∈ R, + (2 ^ n : ℝ) * FABL.binarySign (f a + f 0) := by + rw [Finset.sum_filter] + _ = ∑ a : R, + (2 ^ n : ℝ) * FABL.binarySign (f a.1 + f 0) := by + exact Finset.sum_subtype + (Finset.univ.filter fun a ↦ a ∈ R) + (by simp) _ + _ = (2 ^ n : ℝ) * + ∑ a : R, FABL.binarySign (f a.1 + f 0) := by + rw [Finset.mul_sum] + _ = (2 ^ n : ℝ) * + ∑ a : quadraticRadical f hdegree, + quadraticRadicalSignCharacter f hdegree a := by + rfl + +theorem sum_quadraticRadicalSignCharacter_eq_two_of_weight_eq_twelve + (f : BooleanFunction 5) + (hdegree : FABL.functionAlgebraicDegree f ≤ 2) + (hweight : hammingWeight f = 12) : + ∑ a : quadraticRadical f hdegree, + quadraticRadicalSignCharacter f hdegree a = 2 := by + have hsum := sum_autocorrelation_eq_walshTransform_zero_sq f + rw [sum_autocorrelation_eq_card_mul_sum_quadraticRadicalSignCharacter + f hdegree, + walshTransform_zero_eq_two_pow_sub_two_weight, hweight] at hsum + norm_num at hsum ⊢ + linarith + +theorem quadraticRadicalSignCharacter_eq_zero_of_weight_eq_twelve + (f : BooleanFunction 5) + (hdegree : FABL.functionAlgebraicDegree f ≤ 2) + (hweight : hammingWeight f = 12) : + quadraticRadicalSignCharacter f hdegree = 0 := by + classical + by_contra hnonzero + have horthogonality := + AddChar.sum_eq_ite (quadraticRadicalSignCharacter f hdegree) + rw [if_neg hnonzero, + sum_quadraticRadicalSignCharacter_eq_two_of_weight_eq_twelve + f hdegree hweight] at horthogonality + norm_num at horthogonality + +theorem natCard_quadraticRadical_eq_two_of_weight_eq_twelve + (f : BooleanFunction 5) + (hdegree : FABL.functionAlgebraicDegree f ≤ 2) + (hweight : hammingWeight f = 12) : + Nat.card (quadraticRadical f hdegree) = 2 := by + classical + have horthogonality := + AddChar.sum_eq_ite (quadraticRadicalSignCharacter f hdegree) + rw [if_pos + (quadraticRadicalSignCharacter_eq_zero_of_weight_eq_twelve + f hdegree hweight), + sum_quadraticRadicalSignCharacter_eq_two_of_weight_eq_twelve + f hdegree hweight] at horthogonality + rw [Nat.card_eq_fintype_card] + exact_mod_cast horthogonality.symm + +theorem finrank_quadraticRadical_eq_one_of_weight_eq_twelve + (f : BooleanFunction 5) + (hdegree : FABL.functionAlgebraicDegree f ≤ 2) + (hweight : hammingWeight f = 12) : + Module.finrank FABL.𝔽₂ (quadraticRadical f hdegree) = 1 := by + have hcard := FABL.card_submodule_eq_two_pow_finrank + (quadraticRadical f hdegree) + rw [natCard_quadraticRadical_eq_two_of_weight_eq_twelve + f hdegree hweight] at hcard + exact Nat.pow_right_injective (by norm_num : 2 ≤ 2) + (by simpa using hcard.symm) + +theorem mem_quadraticRadical_of_add_period + (f : BooleanFunction n) + (hdegree : FABL.functionAlgebraicDegree f ≤ 2) + (a : FABL.F₂Cube n) + (hperiod : ∀ x, f (x + a) = f x) : + a ∈ quadraticRadical f hdegree := by + rw [mem_quadraticRadical_iff] + intro b + rw [quadraticPolarKernel_eq] + have hba : f (b + a) = f b := hperiod b + have ha : f a = f 0 := by + simpa only [zero_add] using hperiod 0 + rw [show f (a + b) = f b by simpa only [add_comm] using hba, ha] + calc + f b + f 0 + f b + f 0 = + (f b + f b) + (f 0 + f 0) := by abel + _ = 0 := by + rw [ZModModule.add_self, ZModModule.add_self, add_zero] + +theorem goodWeightTwelveFlatTriple_line_direction_le_quadraticRadical + (f : BooleanFunction n) + (hdegree : FABL.functionAlgebraicDegree f ≤ 2) + {p : WeightTwelveFlatTriple n} + (hp : p ∈ goodWeightTwelveFlatTriples n) + (hrepresentation : weightTwelveRepresentationWord p = f) : + p.1.direction ≤ quadraticRadical f hdegree := by + intro a ha + apply mem_quadraticRadical_of_add_period f hdegree a + intro x + rw [← hrepresentation] + exact weightTwelveRepresentationWord_add_period_of_mem_line_direction + hp a ha x + +theorem goodWeightTwelveFlatTriple_line_direction_eq_quadraticRadical_five + (f : BooleanFunction 5) + (hdegree : FABL.functionAlgebraicDegree f ≤ 2) + (hweight : hammingWeight f = 12) + {p : WeightTwelveFlatTriple 5} + (hp : p ∈ goodWeightTwelveFlatTriples 5) + (hrepresentation : weightTwelveRepresentationWord p = f) : + p.1.direction = quadraticRadical f hdegree := by + apply Submodule.eq_of_le_of_finrank_eq + · exact goodWeightTwelveFlatTriple_line_direction_le_quadraticRadical + f hdegree hp hrepresentation + · rw [(goodWeightTwelveFlatTriple_geometry hp).2.1, + finrank_quadraticRadical_eq_one_of_weight_eq_twelve + f hdegree hweight] + +theorem goodWeightTwelveFlatTriple_line_value_eq_zero + (f : BooleanFunction n) + {p : WeightTwelveFlatTriple n} + (hp : p ∈ goodWeightTwelveFlatTriples n) + (hrepresentation : weightTwelveRepresentationWord p = f) + (x : FABL.F₂Cube n) (hx : x ∈ p.1) : + f x = 0 := by + have hdata := goodWeightTwelveFlatTriple_geometry hp + have hxFirst : x ∈ p.2.1 := hdata.2.2.2.2.2.2.1 hx + have hxSecond : x ∈ p.2.2 := hdata.2.2.2.2.2.2.2.1 hx + have happ := congrFun hrepresentation x + simp only [weightTwelveRepresentationWord, Pi.add_apply, + binaryAffineFlatIndicator] at happ + rw [if_pos hxFirst, if_pos hxSecond, + ZModModule.add_self] at happ + exact happ.symm + +theorem goodWeightTwelveFlatTriple_inf_eq_line + {p : WeightTwelveFlatTriple n} + (hp : p ∈ goodWeightTwelveFlatTriples n) : + p.2.1 ⊓ p.2.2 = p.1 := by + have hdata := goodWeightTwelveFlatTriple_geometry hp + obtain ⟨u, hu⟩ := + (AffineSubspace.nonempty_iff_ne_bot p.1).2 hdata.1 + have huFirst : u ∈ p.2.1 := hdata.2.2.2.2.2.2.1 hu + have huSecond : u ∈ p.2.2 := hdata.2.2.2.2.2.2.2.1 hu + have huInf : u ∈ p.2.1 ⊓ p.2.2 := + (AffineSubspace.mem_inf_iff u p.2.1 p.2.2).2 + ⟨huFirst, huSecond⟩ + apply (AffineSubspace.eq_iff_direction_eq_of_mem huInf hu).2 + rw [AffineSubspace.direction_inf_of_mem_inf huInf] + exact hdata.2.2.2.2.2.2.2.2 + +theorem mem_first_or_second_iff_representation_one_or_line + {p : WeightTwelveFlatTriple n} + (hp : p ∈ goodWeightTwelveFlatTriples n) + (x : FABL.F₂Cube n) : + x ∈ p.2.1 ∨ x ∈ p.2.2 ↔ + weightTwelveRepresentationWord p x = 1 ∨ x ∈ p.1 := by + have hdata := goodWeightTwelveFlatTriple_geometry hp + have hinf := goodWeightTwelveFlatTriple_inf_eq_line hp + constructor + · intro hx + rcases hx with hxFirst | hxSecond + · by_cases hxSecond : x ∈ p.2.2 + · right + rw [← hinf, AffineSubspace.mem_inf_iff] + exact ⟨hxFirst, hxSecond⟩ + · left + simp [weightTwelveRepresentationWord, Pi.add_apply, + binaryAffineFlatIndicator, hxFirst, hxSecond] + · by_cases hxFirst : x ∈ p.2.1 + · right + rw [← hinf, AffineSubspace.mem_inf_iff] + exact ⟨hxFirst, hxSecond⟩ + · left + simp [weightTwelveRepresentationWord, Pi.add_apply, + binaryAffineFlatIndicator, hxFirst, hxSecond] + · rintro (hword | hline) + · by_cases hxFirst : x ∈ p.2.1 + · exact Or.inl hxFirst + · by_cases hxSecond : x ∈ p.2.2 + · exact Or.inr hxSecond + · simp [weightTwelveRepresentationWord, Pi.add_apply, + binaryAffineFlatIndicator, hxFirst, hxSecond] at hword + · exact Or.inl (hdata.2.2.2.2.2.2.1 hline) + +theorem weightTwelveFlatPair_eq_or_swap_of_same_line + (f : BooleanFunction n) + {p q : WeightTwelveFlatTriple n} + (hp : p ∈ goodWeightTwelveFlatTriples n) + (hq : q ∈ goodWeightTwelveFlatTriples n) + (hpRepresentation : weightTwelveRepresentationWord p = f) + (hqRepresentation : weightTwelveRepresentationWord q = f) + (hline : p.1 = q.1) : + (p.2.1 = q.2.1 ∧ p.2.2 = q.2.2) ∨ + (p.2.1 = q.2.2 ∧ p.2.2 = q.2.1) := by + have hpData := goodWeightTwelveFlatTriple_geometry hp + have hqData := goodWeightTwelveFlatTriple_geometry hq + obtain ⟨u, huPLine⟩ := + (AffineSubspace.nonempty_iff_ne_bot p.1).2 hpData.1 + have huQLine : u ∈ q.1 := by + rw [← hline] + exact huPLine + have huPFirst : u ∈ p.2.1 := hpData.2.2.2.2.2.2.1 huPLine + have huPSecond : u ∈ p.2.2 := hpData.2.2.2.2.2.2.2.1 huPLine + have huQFirst : u ∈ q.2.1 := hqData.2.2.2.2.2.2.1 huQLine + have huQSecond : u ∈ q.2.2 := hqData.2.2.2.2.2.2.2.1 huQLine + have hunionAffine : ∀ x, + x ∈ p.2.1 ∨ x ∈ p.2.2 ↔ x ∈ q.2.1 ∨ x ∈ q.2.2 := by + intro x + rw [mem_first_or_second_iff_representation_one_or_line hp, + mem_first_or_second_iff_representation_one_or_line hq, + hpRepresentation, hqRepresentation, hline] + have hunionDirections : ∀ a, + a ∈ p.2.1.direction ∨ a ∈ p.2.2.direction ↔ + a ∈ q.2.1.direction ∨ a ∈ q.2.2.direction := by + intro a + constructor + · intro ha + have hua : u + a ∈ p.2.1 ∨ u + a ∈ p.2.2 := by + rcases ha with ha | ha + · left + have := AffineSubspace.vadd_mem_of_mem_direction ha huPFirst + simpa only [vadd_eq_add, add_comm] using this + · right + have := AffineSubspace.vadd_mem_of_mem_direction ha huPSecond + simpa only [vadd_eq_add, add_comm] using this + rcases (hunionAffine (u + a)).mp hua with hua | hua + · left + apply (AffineSubspace.vadd_mem_iff_mem_direction a huQFirst).mp + simpa only [vadd_eq_add, add_comm] using hua + · right + apply (AffineSubspace.vadd_mem_iff_mem_direction a huQSecond).mp + simpa only [vadd_eq_add, add_comm] using hua + · intro ha + have hua : u + a ∈ q.2.1 ∨ u + a ∈ q.2.2 := by + rcases ha with ha | ha + · left + have := AffineSubspace.vadd_mem_of_mem_direction ha huQFirst + simpa only [vadd_eq_add, add_comm] using this + · right + have := AffineSubspace.vadd_mem_of_mem_direction ha huQSecond + simpa only [vadd_eq_add, add_comm] using this + rcases (hunionAffine (u + a)).mpr hua with hua | hua + · left + apply (AffineSubspace.vadd_mem_iff_mem_direction a huPFirst).mp + simpa only [vadd_eq_add, add_comm] using hua + · right + apply (AffineSubspace.vadd_mem_iff_mem_direction a huPSecond).mp + simpa only [vadd_eq_add, add_comm] using hua + have hpDirectionsNe : p.2.1.direction ≠ p.2.2.direction := by + intro heq + have hintersection := hpData.2.2.2.2.2.2.2.2 + rw [heq, inf_idem] at hintersection + have hrank := congrArg + (fun S : Submodule FABL.𝔽₂ (FABL.F₂Cube n) ↦ + Module.finrank FABL.𝔽₂ S) hintersection + rw [hpData.2.2.2.2.2.1, hpData.2.1] at hrank + omega + have hdirections := unordered_submodule_pair_eq_of_union_eq + p.2.1.direction p.2.2.direction q.2.1.direction q.2.2.direction + (hpData.2.2.2.1.trans hqData.2.2.2.1.symm) + (hpData.2.2.2.1.trans hqData.2.2.2.2.2.1.symm) + (hpData.2.2.2.2.2.1.trans hqData.2.2.2.1.symm) + (hpData.2.2.2.2.2.1.trans hqData.2.2.2.2.2.1.symm) + hpDirectionsNe hunionDirections + rcases hdirections with hsame | hswap + · left + exact ⟨(AffineSubspace.eq_iff_direction_eq_of_mem + huPFirst huQFirst).2 hsame.1, + (AffineSubspace.eq_iff_direction_eq_of_mem + huPSecond huQSecond).2 hsame.2⟩ + · right + exact ⟨(AffineSubspace.eq_iff_direction_eq_of_mem + huPFirst huQSecond).2 hswap.1, + (AffineSubspace.eq_iff_direction_eq_of_mem + huPSecond huQFirst).2 hswap.2⟩ + +theorem goodWeightTwelveFlatTriple_line_eq_radicalCoset_five + (f : BooleanFunction 5) + (hdegree : FABL.functionAlgebraicDegree f ≤ 2) + (hweight : hammingWeight f = 12) + {p : WeightTwelveFlatTriple 5} + (hp : p ∈ goodWeightTwelveFlatTriples 5) + (hrepresentation : weightTwelveRepresentationWord p = f) + (u : FABL.F₂Cube 5) (hu : u ∈ p.1) : + p.1 = FABL.binaryAffineSubspace (quadraticRadical f hdegree) u := by + rw [← goodWeightTwelveFlatTriple_line_direction_eq_quadraticRadical_five + f hdegree hweight hp hrepresentation] + exact (AffineSubspace.mk'_eq hu).symm + +theorem eq_zero_value_of_mem_quadraticRadical_of_weight_eq_twelve + (f : BooleanFunction 5) + (hdegree : FABL.functionAlgebraicDegree f ≤ 2) + (hweight : hammingWeight f = 12) + (a : FABL.F₂Cube 5) + (ha : a ∈ quadraticRadical f hdegree) : + f a = f 0 := by + have hcharacter := congrArg + (fun ψ : AddChar (quadraticRadical f hdegree) ℝ ↦ + ψ (⟨a, ha⟩ : quadraticRadical f hdegree)) + (quadraticRadicalSignCharacter_eq_zero_of_weight_eq_twelve + f hdegree hweight) + change FABL.binarySign (f a + f 0) = 1 at hcharacter + have hsumZero := (FABL.binarySign_eq_one_iff (f a + f 0)).mp + hcharacter + rw [add_eq_zero_iff_eq_neg, ZModModule.neg_eq_self] at hsumZero + exact hsumZero + +theorem add_mem_quadraticRadical_is_period_of_weight_eq_twelve + (f : BooleanFunction 5) + (hdegree : FABL.functionAlgebraicDegree f ≤ 2) + (hweight : hammingWeight f = 12) + (a : FABL.F₂Cube 5) + (ha : a ∈ quadraticRadical f hdegree) + (x : FABL.F₂Cube 5) : + f (x + a) = f x := by + have hpolar := (mem_quadraticRadical_iff f hdegree a).mp ha x + rw [quadraticPolarKernel_eq, add_comm a x] at hpolar + have haValue := + eq_zero_value_of_mem_quadraticRadical_of_weight_eq_twelve + f hdegree hweight a ha + rw [haValue] at hpolar + apply eq_of_sub_eq_zero + rw [sub_eq_add_neg, ZModModule.neg_eq_self] + calc + f (x + a) + f x = + (f (x + a) + f x) + (f 0 + f 0) := by + rw [ZModModule.add_self, add_zero] + _ = f (x + a) + f 0 + f x + f 0 := by abel + _ = 0 := hpolar + +/-- A weight-twelve quadratic descends to the quotient by its one-dimensional +radical. -/ +noncomputable def quadraticRadicalQuotientFunction + (f : BooleanFunction 5) + (hdegree : FABL.functionAlgebraicDegree f ≤ 2) + (hweight : hammingWeight f = 12) : + (FABL.F₂Cube 5 ⧸ quadraticRadical f hdegree) → FABL.𝔽₂ := + fun q ↦ Quotient.liftOn' q f (by + intro a b hab + have hquotient : + (quadraticRadical f hdegree).mkQ a = + (quadraticRadical f hdegree).mkQ b := + Quotient.sound' hab + have habRadical : a + b ∈ quadraticRadical f hdegree := by + have hdifference := + (Submodule.Quotient.eq (quadraticRadical f hdegree)).mp + hquotient + simpa only [sub_eq_add_neg, ZModModule.neg_eq_self] using hdifference + have hperiod := + add_mem_quadraticRadical_is_period_of_weight_eq_twelve + f hdegree hweight (a + b) habRadical a + simpa only [← add_assoc, ZModModule.add_self, zero_add] using hperiod.symm) + +@[simp] theorem quadraticRadicalQuotientFunction_mkQ + (f : BooleanFunction 5) + (hdegree : FABL.functionAlgebraicDegree f ≤ 2) + (hweight : hammingWeight f = 12) + (x : FABL.F₂Cube 5) : + quadraticRadicalQuotientFunction f hdegree hweight + ((quadraticRadical f hdegree).mkQ x) = f x := by + rfl + +theorem card_submodule_mkQ_fiber + (S : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) + (q : FABL.F₂Cube n ⧸ S) : + ((Finset.univ : Finset (FABL.F₂Cube n)).filter fun x ↦ + S.mkQ x = q).card = Nat.card S := by + classical + rw [← Fintype.card_subtype] + calc + Fintype.card {x : FABL.F₂Cube n // S.mkQ x = q} = + Fintype.card S.mkQ.toAddMonoidHom.ker := by + apply Fintype.card_congr + exact AddMonoidHom.fiberEquivKerOfSurjective + (f := S.mkQ.toAddMonoidHom) S.mkQ_surjective q + _ = Nat.card S := by + rw [← Nat.card_eq_fintype_card] + have hker : S.mkQ.toAddMonoidHom.ker = S.toAddSubgroup := by + rw [← LinearMap.ker_toAddSubgroup, Submodule.ker_mkQ] + rw [hker] + congr + +theorem card_filter_mkQ_eq_card_mul_card_filter + (S : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) + (P : (FABL.F₂Cube n ⧸ S) → Prop) [DecidablePred P] : + ((Finset.univ : Finset (FABL.F₂Cube n)).filter fun x ↦ + P (S.mkQ x)).card = + Nat.card S * + ((Finset.univ : Finset (FABL.F₂Cube n ⧸ S)).filter P).card := by + classical + have hfiber := Finset.sum_card_fiberwise_eq_card_filter + (s := (Finset.univ : Finset (FABL.F₂Cube n))) + (t := (Finset.univ : Finset (FABL.F₂Cube n ⧸ S)).filter P) + (g := S.mkQ) + rw [Finset.sum_const_nat] at hfiber + · calc + ((Finset.univ : Finset (FABL.F₂Cube n)).filter fun x ↦ + P (S.mkQ x)).card = + ((Finset.univ : Finset (FABL.F₂Cube n ⧸ S)).filter P).card * + Nat.card S := by + simpa only [Finset.mem_filter, Finset.mem_univ, true_and] using + hfiber.symm + _ = Nat.card S * + ((Finset.univ : Finset (FABL.F₂Cube n ⧸ S)).filter P).card := + Nat.mul_comm _ _ + · intro q hq + exact card_submodule_mkQ_fiber S q + +theorem card_one_add_add_two_mul_card_one_inter + {X : Type*} [Fintype X] (g h : X → FABL.𝔽₂) : + ((Finset.univ : Finset X).filter fun x ↦ g x + h x = 1).card + + 2 * ((Finset.univ : Finset X).filter fun x ↦ + g x = 1 ∧ h x = 1).card = + ((Finset.univ : Finset X).filter fun x ↦ g x = 1).card + + ((Finset.univ : Finset X).filter fun x ↦ h x = 1).card := by + classical + simp only [Finset.card_filter] + rw [Finset.mul_sum] + rw [← Finset.sum_add_distrib, ← Finset.sum_add_distrib] + apply Finset.sum_congr rfl + intro x _hx + by_cases hg : g x = 0 + · by_cases hh : h x = 0 + · norm_num [hg, hh] + · have hhOne : h x = 1 := Fin.eq_one_of_ne_zero _ hh + norm_num [hg, hhOne] + · have hgOne : g x = 1 := Fin.eq_one_of_ne_zero _ hg + by_cases hh : h x = 0 + · norm_num [hgOne, hh] + · have hhOne : h x = 1 := Fin.eq_one_of_ne_zero _ hh + norm_num [hgOne, hhOne] + +theorem card_one_translate_add + {X : Type*} [Fintype X] [AddGroup X] + (g : X → FABL.𝔽₂) (a : X) : + ((Finset.univ : Finset X).filter fun x ↦ g (x + a) = 1).card = + ((Finset.univ : Finset X).filter fun x ↦ g x = 1).card := by + classical + apply Finset.card_equiv (Equiv.addRight a) + intro x + simp only [Finset.mem_filter, Finset.mem_univ, true_and] + rfl + +noncomputable def binaryOneSupport + {X : Type*} [Fintype X] (g : X → FABL.𝔽₂) : Finset X := by + classical + exact Finset.univ.filter fun x ↦ g x = 1 + +noncomputable def binarySupportNeighbors + {X : Type*} [Fintype X] [Add X] + (g : X → FABL.𝔽₂) (x : X) : Finset X := by + classical + exact (binaryOneSupport g).filter fun y ↦ g (y + x) = 1 + +@[simp] theorem mem_binaryOneSupport + {X : Type*} [Fintype X] (g : X → FABL.𝔽₂) (x : X) : + x ∈ binaryOneSupport g ↔ g x = 1 := by + classical + simp [binaryOneSupport] + +@[simp] theorem mem_binarySupportNeighbors + {X : Type*} [Fintype X] [Add X] + (g : X → FABL.𝔽₂) (x y : X) : + y ∈ binarySupportNeighbors g x ↔ + g y = 1 ∧ g (y + x) = 1 := by + classical + simp [binarySupportNeighbors] + +theorem exists_binarySupportNeighbor_pair + {X : Type*} [Fintype X] [DecidableEq X] [AddCommGroup X] + [Module FABL.𝔽₂ X] + (g : X → FABL.𝔽₂) + (hzero : g 0 = 0) (x : X) (hx : g x = 1) + (hneighbors : (binarySupportNeighbors g x).card = 2) : + ∃ y, g y = 1 ∧ g (x + y) = 1 ∧ y ≠ x ∧ + binarySupportNeighbors g x = {y, x + y} := by + classical + have hnonempty : (binarySupportNeighbors g x).Nonempty := by + rw [Finset.nonempty_iff_ne_empty] + intro hempty + rw [hempty] at hneighbors + norm_num at hneighbors + obtain ⟨y, hyNeighbor⟩ := hnonempty + have hyData := (mem_binarySupportNeighbors g x y).mp hyNeighbor + have hxNonzero : x ≠ 0 := by + intro hxZero + rw [hxZero, hzero] at hx + exact zero_ne_one hx + have hyNeX : y ≠ x := by + intro hyx + subst y + have := hyData.2 + rw [ZModModule.add_self, hzero] at this + exact zero_ne_one this + have hyNeSum : y ≠ x + y := by + intro heq + apply hxNonzero + have h := congrArg (fun z ↦ z + y) heq + simpa only [add_assoc, ZModModule.add_self, add_zero] using h.symm + have hsumNeighbor : x + y ∈ binarySupportNeighbors g x := by + rw [mem_binarySupportNeighbors] + constructor + · simpa only [add_comm] using hyData.2 + · have harg : (x + y) + x = y := by + calc + (x + y) + x = y + (x + x) := by abel + _ = y := by rw [ZModModule.add_self, add_zero] + rw [harg] + exact hyData.1 + have hpairSubset : ({y, x + y} : Finset X) ⊆ + binarySupportNeighbors g x := by + intro z hz + simp only [Finset.mem_insert, Finset.mem_singleton] at hz + exact hz.elim (fun h ↦ h ▸ hyNeighbor) (fun h ↦ h ▸ hsumNeighbor) + have hpairEq : ({y, x + y} : Finset X) = + binarySupportNeighbors g x := by + apply Finset.eq_of_subset_of_card_le hpairSubset + rw [hneighbors, Finset.card_pair hyNeSum] + exact ⟨y, hyData.1, by simpa only [add_comm] using hyData.2, + hyNeX, hpairEq.symm⟩ + +theorem binarySupportNeighbors_eq_pair_of_mem + {X : Type*} [Fintype X] [DecidableEq X] [AddCommGroup X] + [Module FABL.𝔽₂ X] + (g : X → FABL.𝔽₂) + (hzero : g 0 = 0) (x y : X) (hx : g x = 1) + (hyNeighbor : y ∈ binarySupportNeighbors g x) + (hneighbors : (binarySupportNeighbors g x).card = 2) : + binarySupportNeighbors g x = {y, x + y} := by + have hyData := (mem_binarySupportNeighbors g x y).mp hyNeighbor + have hxNonzero : x ≠ 0 := by + intro hxZero + rw [hxZero, hzero] at hx + exact zero_ne_one hx + have hyNeSum : y ≠ x + y := by + intro heq + apply hxNonzero + have h := congrArg (fun z ↦ z + y) heq + simpa only [add_assoc, ZModModule.add_self, add_zero] using h.symm + have hsumNeighbor : x + y ∈ binarySupportNeighbors g x := by + rw [mem_binarySupportNeighbors] + constructor + · simpa only [add_comm] using hyData.2 + · have harg : (x + y) + x = y := by + calc + (x + y) + x = y + (x + x) := by abel + _ = y := by rw [ZModModule.add_self, add_zero] + rw [harg] + exact hyData.1 + have hpairSubset : ({y, x + y} : Finset X) ⊆ + binarySupportNeighbors g x := by + intro z hz + simp only [Finset.mem_insert, Finset.mem_singleton] at hz + exact hz.elim (fun h ↦ h ▸ hyNeighbor) (fun h ↦ h ▸ hsumNeighbor) + symm + apply Finset.eq_of_subset_of_card_le hpairSubset + rw [hneighbors, Finset.card_pair hyNeSum] + +noncomputable def binarySupportTriangle + {X : Type*} [Fintype X] [Add X] + (g : X → FABL.𝔽₂) (x : X) : Finset X := by + classical + exact insert x (binarySupportNeighbors g x) + +@[simp] theorem mem_binarySupportTriangle + {X : Type*} [Fintype X] [Add X] + (g : X → FABL.𝔽₂) (x y : X) : + y ∈ binarySupportTriangle g x ↔ + y = x ∨ (g y = 1 ∧ g (y + x) = 1) := by + classical + simp [binarySupportTriangle] + +theorem card_binarySupportTriangle + {X : Type*} [Fintype X] [AddCommGroup X] + [Module FABL.𝔽₂ X] + (g : X → FABL.𝔽₂) + (hzero : g 0 = 0) (x : X) (_hx : g x = 1) + (hneighbors : (binarySupportNeighbors g x).card = 2) : + (binarySupportTriangle g x).card = 3 := by + classical + rw [binarySupportTriangle, Finset.card_insert_of_notMem] + · rw [hneighbors] + · rw [mem_binarySupportNeighbors] + intro hself + rw [ZModModule.add_self, hzero] at hself + exact zero_ne_one hself.2 + +theorem binarySupportTriangle_subset_oneSupport + {X : Type*} [Fintype X] [Add X] + (g : X → FABL.𝔽₂) (x : X) (hx : g x = 1) : + binarySupportTriangle g x ⊆ binaryOneSupport g := by + classical + intro y hy + rw [mem_binarySupportTriangle] at hy + rw [mem_binaryOneSupport] + exact hy.elim (fun h ↦ by simpa only [h] using hx) (fun h ↦ h.1) + +theorem binarySupportTriangle_eq_of_mem + {X : Type*} [Fintype X] [AddCommGroup X] + [Module FABL.𝔽₂ X] + (g : X → FABL.𝔽₂) + (hzero : g 0 = 0) + (hneighbors : ∀ x, g x = 1 → + (binarySupportNeighbors g x).card = 2) + (x y : X) (hx : g x = 1) (hy : g y = 1) + (hyTriangle : y ∈ binarySupportTriangle g x) : + binarySupportTriangle g y = binarySupportTriangle g x := by + classical + rw [mem_binarySupportTriangle] at hyTriangle + rcases hyTriangle with rfl | hyNeighbor + · rfl + · have hNx := binarySupportNeighbors_eq_pair_of_mem + g hzero x y hx + ((mem_binarySupportNeighbors g x y).mpr hyNeighbor) + (hneighbors x hx) + have hxNeighborY : x ∈ binarySupportNeighbors g y := by + rw [mem_binarySupportNeighbors] + exact ⟨hx, by simpa only [add_comm] using hyNeighbor.2⟩ + have hNy := binarySupportNeighbors_eq_pair_of_mem + g hzero y x hy hxNeighborY (hneighbors y hy) + rw [binarySupportTriangle, binarySupportTriangle, hNx, hNy] + ext z + simp only [Finset.mem_insert, Finset.mem_singleton] + rw [add_comm y x] + tauto + +theorem exists_disjoint_binarySupportTriangles + {X : Type*} [Fintype X] [DecidableEq X] [AddCommGroup X] + [Module FABL.𝔽₂ X] + (g : X → FABL.𝔽₂) + (hzero : g 0 = 0) + (hsupport : (binaryOneSupport g).card = 6) + (hneighbors : ∀ x, g x = 1 → + (binarySupportNeighbors g x).card = 2) : + ∃ x w : X, + g x = 1 ∧ g w = 1 ∧ + Disjoint (binarySupportTriangle g x) + (binarySupportTriangle g w) ∧ + binarySupportTriangle g x ∪ binarySupportTriangle g w = + binaryOneSupport g := by + classical + have hsupportNonempty : (binaryOneSupport g).Nonempty := by + rw [Finset.nonempty_iff_ne_empty] + intro hempty + rw [hempty] at hsupport + norm_num at hsupport + obtain ⟨x, hxSupport⟩ := hsupportNonempty + have hx : g x = 1 := (mem_binaryOneSupport g x).mp hxSupport + have htriangleXSubset := + binarySupportTriangle_subset_oneSupport g x hx + have htriangleXCard : (binarySupportTriangle g x).card = 3 := + card_binarySupportTriangle g hzero x hx (hneighbors x hx) + have htriangleXStrict : + binarySupportTriangle g x ⊂ binaryOneSupport g := by + rw [Finset.ssubset_iff_subset_ne] + refine ⟨htriangleXSubset, ?_⟩ + intro heq + rw [heq, hsupport] at htriangleXCard + norm_num at htriangleXCard + obtain ⟨w, hwSupport, hwNotTriangleX⟩ := + Finset.exists_of_ssubset htriangleXStrict + have hw : g w = 1 := (mem_binaryOneSupport g w).mp hwSupport + have htriangleWSubset := + binarySupportTriangle_subset_oneSupport g w hw + have htriangleWCard : (binarySupportTriangle g w).card = 3 := + card_binarySupportTriangle g hzero w hw (hneighbors w hw) + have hdisjoint : Disjoint (binarySupportTriangle g x) + (binarySupportTriangle g w) := by + rw [Finset.disjoint_left] + intro z hzX hzW + have hz : g z = 1 := + (mem_binaryOneSupport g z).mp (htriangleXSubset hzX) + have htriangleZX := binarySupportTriangle_eq_of_mem + g hzero hneighbors x z hx hz hzX + have htriangleZW := binarySupportTriangle_eq_of_mem + g hzero hneighbors w z hw hz hzW + apply hwNotTriangleX + rw [← htriangleZX, htriangleZW] + simp only [mem_binarySupportTriangle] + exact Or.inl trivial + refine ⟨x, w, hx, hw, hdisjoint, ?_⟩ + apply Finset.eq_of_subset_of_card_le + · exact Finset.union_subset htriangleXSubset htriangleWSubset + · rw [hsupport, Finset.card_union_of_disjoint hdisjoint, + htriangleXCard, htriangleWCard] + +theorem mem_binarySpanPair_iff + {X : Type*} [AddCommGroup X] [Module FABL.𝔽₂ X] + (x y z : X) : + z ∈ Submodule.span FABL.𝔽₂ ({x, y} : Set X) ↔ + z = 0 ∨ z = x ∨ z = y ∨ z = x + y := by + rw [Submodule.mem_span_pair] + constructor + · rintro ⟨a, b, rfl⟩ + by_cases ha : a = 0 + · subst a + by_cases hb : b = 0 + · subst b + exact Or.inl (by simp) + · have hbOne : b = 1 := Fin.eq_one_of_ne_zero _ hb + subst b + exact Or.inr (Or.inr (Or.inl (by simp))) + · have haOne : a = 1 := Fin.eq_one_of_ne_zero _ ha + subst a + by_cases hb : b = 0 + · subst b + exact Or.inr (Or.inl (by simp)) + · have hbOne : b = 1 := Fin.eq_one_of_ne_zero _ hb + subst b + exact Or.inr (Or.inr (Or.inr (by simp))) + · intro hz + rcases hz with rfl | rfl | rfl | rfl + · exact ⟨0, 0, by simp⟩ + · exact ⟨1, 0, by simp⟩ + · exact ⟨0, 1, by simp⟩ + · exact ⟨1, 1, by simp⟩ + +theorem mem_binarySpanSingleton_iff + {X : Type*} [AddCommGroup X] [Module FABL.𝔽₂ X] + (x z : X) : + z ∈ FABL.𝔽₂ ∙ x ↔ z = 0 ∨ z = x := by + rw [Submodule.mem_span_singleton] + constructor + · rintro ⟨a, rfl⟩ + by_cases ha : a = 0 + · subst a + exact Or.inl (by simp) + · have haOne : a = 1 := Fin.eq_one_of_ne_zero _ ha + subst a + exact Or.inr (by simp) + · rintro (rfl | rfl) + · exact ⟨0, by simp⟩ + · exact ⟨1, by simp⟩ + +noncomputable def binarySpanPairNonzero + {X : Type*} [Fintype X] [AddCommGroup X] + [Module FABL.𝔽₂ X] + (x y : X) : Finset X := by + classical + exact Finset.univ.filter fun z ↦ + z ≠ 0 ∧ z ∈ Submodule.span FABL.𝔽₂ ({x, y} : Set X) + +@[simp] theorem mem_binarySpanPairNonzero + {X : Type*} [Fintype X] [AddCommGroup X] + [Module FABL.𝔽₂ X] + (x y z : X) : + z ∈ binarySpanPairNonzero x y ↔ + z ≠ 0 ∧ z ∈ Submodule.span FABL.𝔽₂ ({x, y} : Set X) := by + classical + simp [binarySpanPairNonzero] + +theorem binarySupportTriangle_eq_binarySpanPairNonzero + {X : Type*} [Fintype X] [DecidableEq X] [AddCommGroup X] + [Module FABL.𝔽₂ X] + (g : X → FABL.𝔽₂) (hzero : g 0 = 0) + (x y : X) (hx : g x = 1) (hy : g y = 1) + (hxy : g (x + y) = 1) + (hneighbors : binarySupportNeighbors g x = {y, x + y}) : + binarySupportTriangle g x = binarySpanPairNonzero x y := by + classical + have hx0 : x ≠ 0 := by + intro h + rw [h, hzero] at hx + exact zero_ne_one hx + have hy0 : y ≠ 0 := by + intro h + rw [h, hzero] at hy + exact zero_ne_one hy + have hxy0 : x + y ≠ 0 := by + intro h + rw [h, hzero] at hxy + exact zero_ne_one hxy + rw [binarySupportTriangle, hneighbors] + ext z + rw [mem_binarySpanPairNonzero, mem_binarySpanPair_iff] + simp only [Finset.mem_insert, Finset.mem_singleton] + constructor + · intro hz + constructor + · rcases hz with hz | hz | hz + · simpa only [hz] using hx0 + · simpa only [hz] using hy0 + · simpa only [hz] using hxy0 + · exact Or.inr hz + · rintro ⟨hz0, hz | hz⟩ + · exact (hz0 hz).elim + · exact hz + +theorem finrank_binarySpanPair_eq_two + {X : Type*} [AddCommGroup X] [Module FABL.𝔽₂ X] + [Module.Finite FABL.𝔽₂ X] + (x y : X) (hx0 : x ≠ 0) (hy0 : y ≠ 0) (hyx : y ≠ x) : + Module.finrank FABL.𝔽₂ + (Submodule.span FABL.𝔽₂ ({x, y} : Set X)) = 2 := by + have hyNotSpan : y ∉ FABL.𝔽₂ ∙ x := by + rw [mem_binarySpanSingleton_iff] + tauto + rw [Submodule.span_insert, + Submodule.finrank_sup_span_singleton hyNotSpan, + finrank_span_singleton hx0] + +theorem finrank_comap_mkQ_eq_add + {K X : Type*} [Field K] [AddCommGroup X] [Module K X] + [FiniteDimensional K X] + (R : Submodule K X) (E : Submodule K (X ⧸ R)) : + Module.finrank K (Submodule.comap R.mkQ E) = + Module.finrank K R + Module.finrank K E := by + let P := Submodule.comap R.mkQ E + let φ : P →ₗ[K] E := + R.mkQ.restrict (fun x hx ↦ hx) + have hRleP : R ≤ P := Submodule.le_comap_mkQ R E + have hφSurjective : Function.Surjective φ := by + intro q + obtain ⟨x, hx⟩ := R.mkQ_surjective q + have hxP : x ∈ P := by + change R.mkQ x ∈ E + rw [hx] + exact q.2 + refine ⟨⟨x, hxP⟩, Subtype.ext ?_⟩ + exact hx + have hφRange : LinearMap.range φ = ⊤ := + LinearMap.range_eq_top.mpr hφSurjective + have hφKer : LinearMap.ker φ = + Submodule.comap P.subtype R := by + ext z + simp only [LinearMap.mem_ker, φ, LinearMap.coe_restrict_apply, + Subtype.ext_iff, + Submodule.mem_comap, Submodule.coe_subtype] + rw [Submodule.mkQ_apply] + change (Submodule.Quotient.mk (z : X) : X ⧸ R) = 0 ↔ + (z : X) ∈ R + exact Submodule.Quotient.mk_eq_zero (p := R) (x := (z : X)) + have hφKerRank : Module.finrank K (LinearMap.ker φ) = + Module.finrank K R := by + rw [hφKer] + exact (Submodule.comapSubtypeEquivOfLe hRleP).finrank_eq + have hrank := LinearMap.finrank_range_add_finrank_ker φ + rw [hφRange, finrank_top, hφKerRank] at hrank + simpa only [P, add_comm] using hrank.symm + +theorem exists_transverse_binaryPlanes_of_six_support + {X : Type*} [Fintype X] [AddCommGroup X] + [Module FABL.𝔽₂ X] + (g : X → FABL.𝔽₂) + (hzero : g 0 = 0) + (hsupport : (binaryOneSupport g).card = 6) + (hneighbors : ∀ x, g x = 1 → + (binarySupportNeighbors g x).card = 2) : + ∃ E F : Submodule FABL.𝔽₂ X, + Module.finrank FABL.𝔽₂ E = 2 ∧ + Module.finrank FABL.𝔽₂ F = 2 ∧ + E ⊓ F = ⊥ ∧ + ∀ z, g z = 1 ↔ z ≠ 0 ∧ (z ∈ E ∨ z ∈ F) := by + classical + obtain ⟨x, w, hx, hw, htrianglesDisjoint, htrianglesUnion⟩ := + exists_disjoint_binarySupportTriangles g hzero hsupport hneighbors + obtain ⟨y, hy, hxy, hyx, hneighborsX⟩ := + exists_binarySupportNeighbor_pair + g hzero x hx (hneighbors x hx) + obtain ⟨v, hv, hwv, hvw, hneighborsW⟩ := + exists_binarySupportNeighbor_pair + g hzero w hw (hneighbors w hw) + let E := Submodule.span FABL.𝔽₂ ({x, y} : Set X) + let F := Submodule.span FABL.𝔽₂ ({w, v} : Set X) + have hx0 : x ≠ 0 := by + intro h + rw [h, hzero] at hx + exact zero_ne_one hx + have hy0 : y ≠ 0 := by + intro h + rw [h, hzero] at hy + exact zero_ne_one hy + have hw0 : w ≠ 0 := by + intro h + rw [h, hzero] at hw + exact zero_ne_one hw + have hv0 : v ≠ 0 := by + intro h + rw [h, hzero] at hv + exact zero_ne_one hv + have htriangleX : + binarySupportTriangle g x = binarySpanPairNonzero x y := + binarySupportTriangle_eq_binarySpanPairNonzero + g hzero x y hx hy hxy hneighborsX + have htriangleW : + binarySupportTriangle g w = binarySpanPairNonzero w v := + binarySupportTriangle_eq_binarySpanPairNonzero + g hzero w v hw hv hwv hneighborsW + have hErank : Module.finrank FABL.𝔽₂ E = 2 := by + exact finrank_binarySpanPair_eq_two x y hx0 hy0 hyx + have hFrank : Module.finrank FABL.𝔽₂ F = 2 := by + exact finrank_binarySpanPair_eq_two w v hw0 hv0 hvw + have htransverse : E ⊓ F = ⊥ := by + apply le_antisymm + · intro z hz + rw [Submodule.mem_bot] + by_contra hz0 + have hzTriangleX : z ∈ binarySupportTriangle g x := by + rw [htriangleX, mem_binarySpanPairNonzero] + exact ⟨hz0, hz.1⟩ + have hzTriangleW : z ∈ binarySupportTriangle g w := by + rw [htriangleW, mem_binarySpanPairNonzero] + exact ⟨hz0, hz.2⟩ + exact (Finset.disjoint_left.mp htrianglesDisjoint) + hzTriangleX hzTriangleW + · exact bot_le + refine ⟨E, F, hErank, hFrank, htransverse, ?_⟩ + intro z + change g z = 1 ↔ z ≠ 0 ∧ + (z ∈ Submodule.span FABL.𝔽₂ ({x, y} : Set X) ∨ + z ∈ Submodule.span FABL.𝔽₂ ({w, v} : Set X)) + rw [← mem_binaryOneSupport, ← htrianglesUnion, + Finset.mem_union, htriangleX, htriangleW, + mem_binarySpanPairNonzero, mem_binarySpanPairNonzero] + tauto + +theorem card_binarySupportNeighbors_eq_two_of_six_support + {X : Type*} [Fintype X] [AddCommGroup X] + (g : X → FABL.𝔽₂) + (hzero : g 0 = 0) + (hsupport : (binaryOneSupport g).card = 6) + (hderivative : ∀ a ≠ 0, + ((Finset.univ : Finset X).filter fun x ↦ + g x + g (x + a) = 1).card = 8) + (a : X) (ha : g a = 1) : + (binarySupportNeighbors g a).card = 2 := by + classical + have ha0 : a ≠ 0 := by + intro h + rw [h, hzero] at ha + exact zero_ne_one ha + have htranslated : + ((Finset.univ : Finset X).filter fun x ↦ + g (x + a) = 1).card = 6 := by + rw [card_one_translate_add] + simpa only [binaryOneSupport] using hsupport + have hidentity := card_one_add_add_two_mul_card_one_inter + g (fun x ↦ g (x + a)) + have hsupport' : + ((Finset.univ : Finset X).filter fun x ↦ g x = 1).card = 6 := by + simpa only [binaryOneSupport] using hsupport + rw [hderivative a ha0, hsupport', htranslated] at hidentity + change + ((binaryOneSupport g).filter fun x ↦ g (x + a) = 1).card = 2 + simpa only [binaryOneSupport, Finset.filter_filter, + and_assoc] using (show + ((Finset.univ : Finset X).filter fun x ↦ + g x = 1 ∧ g (x + a) = 1).card = 2 by omega) + +/-- There are ten radical cosets on which a weight-twelve quadratic vanishes. -/ +theorem card_zero_quadraticRadicalQuotientFunction + (f : BooleanFunction 5) + (hdegree : FABL.functionAlgebraicDegree f ≤ 2) + (hweight : hammingWeight f = 12) : + ((Finset.univ : Finset + (FABL.F₂Cube 5 ⧸ quadraticRadical f hdegree)).filter fun q ↦ + quadraticRadicalQuotientFunction f hdegree hweight q = 0).card = 10 := by + classical + let R := quadraticRadical f hdegree + let qf := quadraticRadicalQuotientFunction f hdegree hweight + let zeroCosets : Set (FABL.F₂Cube 5 ⧸ R) := {q | qf q = 0} + have hzeroPoints : + ((Finset.univ : Finset (FABL.F₂Cube 5)).filter fun x ↦ + f x = 0).card = 20 := by + have hsupport : + ((Finset.univ : Finset (FABL.F₂Cube 5)).filter fun x ↦ + f x = 1).card = 12 := by + simpa only [support, FABL.f₂OneSupport, + hammingWeight_eq_card_support] using hweight + have hpartition := Finset.card_filter_add_card_filter_not + (s := (Finset.univ : Finset (FABL.F₂Cube 5))) + (p := fun x ↦ f x = 1) + have hnotOne : + ((Finset.univ : Finset (FABL.F₂Cube 5)).filter fun x ↦ + ¬f x = 1).card = + ((Finset.univ : Finset (FABL.F₂Cube 5)).filter fun x ↦ + f x = 0).card := by + congr 1 + ext x + simp only [Finset.mem_filter, Finset.mem_univ, true_and] + constructor + · intro hnotOne + by_contra hnotZero + exact hnotOne (Fin.eq_one_of_ne_zero _ hnotZero) + · intro hzero hone + rw [hzero] at hone + norm_num at hone + rw [hsupport, hnotOne, Finset.card_univ, card_f₂Cube] at hpartition + norm_num at hpartition ⊢ + omega + have hpreimageCard : + Nat.card {x : FABL.F₂Cube 5 // R.mkQ x ∈ zeroCosets} = 20 := by + rw [Nat.card_eq_fintype_card, Fintype.card_subtype] + calc + ((Finset.univ : Finset (FABL.F₂Cube 5)).filter fun x ↦ + R.mkQ x ∈ zeroCosets).card = + ((Finset.univ : Finset (FABL.F₂Cube 5)).filter fun x ↦ + f x = 0).card := by + congr 1 + _ = 20 := hzeroPoints + have hequiv := + QuotientAddGroup.preimageMkEquivAddSubgroupProdSet + R.toAddSubgroup zeroCosets + have hproductCard : + Nat.card {x : FABL.F₂Cube 5 // R.mkQ x ∈ zeroCosets} = + Nat.card R * Nat.card zeroCosets := by + calc + Nat.card {x : FABL.F₂Cube 5 // R.mkQ x ∈ zeroCosets} = + Nat.card (R.toAddSubgroup × zeroCosets) := + Nat.card_congr hequiv + _ = Nat.card R * Nat.card zeroCosets := by + rw [Nat.card_prod] + congr 1 + have hRCard : Nat.card R = 2 := by + exact natCard_quadraticRadical_eq_two_of_weight_eq_twelve + f hdegree hweight + have hzeroCosetsCard : Nat.card zeroCosets = 10 := by + rw [hpreimageCard, hRCard] at hproductCard + omega + simpa [zeroCosets, qf, Nat.card_eq_fintype_card, + Fintype.card_subtype] using hzeroCosetsCard + +theorem card_one_quadraticRadicalQuotientFunction + (f : BooleanFunction 5) + (hdegree : FABL.functionAlgebraicDegree f ≤ 2) + (hweight : hammingWeight f = 12) : + ((Finset.univ : Finset + (FABL.F₂Cube 5 ⧸ quadraticRadical f hdegree)).filter fun q ↦ + quadraticRadicalQuotientFunction f hdegree hweight q = 1).card = 6 := by + classical + let R := quadraticRadical f hdegree + let qf := quadraticRadicalQuotientFunction f hdegree hweight + have hfactor := card_filter_mkQ_eq_card_mul_card_filter + R (fun q ↦ qf q = 1) + have hleft : + ((Finset.univ : Finset (FABL.F₂Cube 5)).filter fun x ↦ + qf (R.mkQ x) = 1).card = 12 := by + simpa only [R, qf, quadraticRadicalQuotientFunction_mkQ, + support, FABL.f₂OneSupport, hammingWeight_eq_card_support] + using hweight + have hRCard : Nat.card R = 2 := + natCard_quadraticRadical_eq_two_of_weight_eq_twelve + f hdegree hweight + rw [hleft, hRCard] at hfactor + change 12 = 2 * + ((Finset.univ : Finset + (FABL.F₂Cube 5 ⧸ quadraticRadical f hdegree)).filter fun q ↦ + quadraticRadicalQuotientFunction f hdegree hweight q = 1).card at hfactor + omega + +theorem card_one_quadraticRadicalQuotientDerivative_of_ne_zero + (f : BooleanFunction 5) + (hdegree : FABL.functionAlgebraicDegree f ≤ 2) + (hweight : hammingWeight f = 12) + (a : FABL.F₂Cube 5 ⧸ quadraticRadical f hdegree) + (ha : a ≠ 0) : + ((Finset.univ : Finset + (FABL.F₂Cube 5 ⧸ quadraticRadical f hdegree)).filter fun x ↦ + quadraticRadicalQuotientFunction f hdegree hweight x + + quadraticRadicalQuotientFunction f hdegree hweight (x + a) = 1).card = 8 := by + classical + let R := quadraticRadical f hdegree + let qf := quadraticRadicalQuotientFunction f hdegree hweight + obtain ⟨v, rfl⟩ := R.mkQ_surjective a + have hvNotRadical : v ∉ R := by + intro hv + apply ha + have hvKer : v ∈ LinearMap.ker R.mkQ := by + simpa only [Submodule.ker_mkQ] using hv + exact LinearMap.mem_ker.mp hvKer + have hbalanced := + isBalanced_booleanDerivative_of_not_mem_quadraticRadical + f hdegree v hvNotRadical + have hderivativeWeight : + hammingWeight (FABL.booleanDerivative f v) = 16 := by + change 2 * hammingWeight (FABL.booleanDerivative f v) = 2 ^ 5 at hbalanced + norm_num at hbalanced ⊢ + omega + have hfactor := card_filter_mkQ_eq_card_mul_card_filter + R (fun x ↦ qf x + qf (x + R.mkQ v) = 1) + have hleft : + ((Finset.univ : Finset (FABL.F₂Cube 5)).filter fun x ↦ + qf (R.mkQ x) + qf (R.mkQ x + R.mkQ v) = 1).card = 16 := by + simpa only [R, qf, ← map_add, + quadraticRadicalQuotientFunction_mkQ, + FABL.booleanDerivative, support, FABL.f₂OneSupport, + hammingWeight_eq_card_support] using hderivativeWeight + have hRCard : Nat.card R = 2 := + natCard_quadraticRadical_eq_two_of_weight_eq_twelve + f hdegree hweight + rw [hleft, hRCard] at hfactor + change 16 = 2 * + ((Finset.univ : Finset + (FABL.F₂Cube 5 ⧸ quadraticRadical f hdegree)).filter fun x ↦ + quadraticRadicalQuotientFunction f hdegree hweight x + + quadraticRadicalQuotientFunction f hdegree hweight + (x + (quadraticRadical f hdegree).mkQ v) = 1).card at hfactor + apply Eq.symm + refine Nat.mul_left_cancel (n := 2) (by norm_num) ?_ + norm_num + exact hfactor + +theorem card_quadraticRadicalQuotient_support_neighbors + (f : BooleanFunction 5) + (hdegree : FABL.functionAlgebraicDegree f ≤ 2) + (hweight : hammingWeight f = 12) + (hzero : f 0 = 0) + (a : FABL.F₂Cube 5 ⧸ quadraticRadical f hdegree) + (ha : quadraticRadicalQuotientFunction f hdegree hweight a = 1) : + ((Finset.univ : Finset + (FABL.F₂Cube 5 ⧸ quadraticRadical f hdegree)).filter fun x ↦ + quadraticRadicalQuotientFunction f hdegree hweight x = 1 ∧ + quadraticRadicalQuotientFunction f hdegree hweight (x + a) = 1).card = 2 := by + classical + let Q := FABL.F₂Cube 5 ⧸ quadraticRadical f hdegree + let qf : Q → FABL.𝔽₂ := + quadraticRadicalQuotientFunction f hdegree hweight + have haNonzero : a ≠ 0 := by + intro haZero + subst a + have hqzero : qf 0 = 0 := by + change quadraticRadicalQuotientFunction f hdegree hweight + ((quadraticRadical f hdegree).mkQ 0) = 0 + rw [quadraticRadicalQuotientFunction_mkQ] + exact hzero + exact zero_ne_one (hqzero.symm.trans ha) + have hderivative := + card_one_quadraticRadicalQuotientDerivative_of_ne_zero + f hdegree hweight a haNonzero + have hsupport := + card_one_quadraticRadicalQuotientFunction f hdegree hweight + have htranslated : + ((Finset.univ : Finset Q).filter fun x ↦ qf (x + a) = 1).card = 6 := by + rw [card_one_translate_add] + simpa only [Q, qf] using hsupport + have hidentity := card_one_add_add_two_mul_card_one_inter + qf (fun x ↦ qf (x + a)) + change + ((Finset.univ : Finset Q).filter fun x ↦ + qf x + qf (x + a) = 1).card = 8 at hderivative + change ((Finset.univ : Finset Q).filter fun x ↦ qf x = 1).card = 6 + at hsupport + rw [hderivative, hsupport, htranslated] at hidentity + change + ((Finset.univ : Finset Q).filter fun x ↦ + qf x = 1 ∧ qf (x + a) = 1).card = 2 + omega + +theorem exists_transverse_quadraticRadicalQuotientPlanes + (f : BooleanFunction 5) + (hdegree : FABL.functionAlgebraicDegree f ≤ 2) + (hweight : hammingWeight f = 12) + (hzero : f 0 = 0) : + ∃ E F : Submodule FABL.𝔽₂ + (FABL.F₂Cube 5 ⧸ quadraticRadical f hdegree), + Module.finrank FABL.𝔽₂ E = 2 ∧ + Module.finrank FABL.𝔽₂ F = 2 ∧ + E ⊓ F = ⊥ ∧ + ∀ q, + quadraticRadicalQuotientFunction f hdegree hweight q = 1 ↔ + q ≠ 0 ∧ (q ∈ E ∨ q ∈ F) := by + classical + let Q := FABL.F₂Cube 5 ⧸ quadraticRadical f hdegree + let qf : Q → FABL.𝔽₂ := + quadraticRadicalQuotientFunction f hdegree hweight + have hqzero : qf 0 = 0 := by + change quadraticRadicalQuotientFunction f hdegree hweight + ((quadraticRadical f hdegree).mkQ 0) = 0 + rw [quadraticRadicalQuotientFunction_mkQ] + exact hzero + have hsupport : (binaryOneSupport qf).card = 6 := by + simpa only [binaryOneSupport] using + card_one_quadraticRadicalQuotientFunction f hdegree hweight + have hneighbors : ∀ q, qf q = 1 → + (binarySupportNeighbors qf q).card = 2 := by + intro q hq + have h := card_quadraticRadicalQuotient_support_neighbors + f hdegree hweight hzero q hq + simpa only [binarySupportNeighbors, binaryOneSupport, + Finset.filter_filter, and_assoc] using h + simpa only [Q, qf] using + exists_transverse_binaryPlanes_of_six_support + qf hqzero hsupport hneighbors + +theorem exists_transverse_translated_quadraticRadicalQuotientPlanes + (f : BooleanFunction 5) + (hdegree : FABL.functionAlgebraicDegree f ≤ 2) + (hweight : hammingWeight f = 12) + (q₀ : FABL.F₂Cube 5 ⧸ quadraticRadical f hdegree) + (hq₀ : quadraticRadicalQuotientFunction f hdegree hweight q₀ = 0) : + ∃ E F : Submodule FABL.𝔽₂ + (FABL.F₂Cube 5 ⧸ quadraticRadical f hdegree), + Module.finrank FABL.𝔽₂ E = 2 ∧ + Module.finrank FABL.𝔽₂ F = 2 ∧ + E ⊓ F = ⊥ ∧ + ∀ q, + quadraticRadicalQuotientFunction f hdegree hweight (q + q₀) = 1 ↔ + q ≠ 0 ∧ (q ∈ E ∨ q ∈ F) := by + classical + let Q := FABL.F₂Cube 5 ⧸ quadraticRadical f hdegree + let qf : Q → FABL.𝔽₂ := + quadraticRadicalQuotientFunction f hdegree hweight + let g : Q → FABL.𝔽₂ := fun q ↦ qf (q + q₀) + have hgzero : g 0 = 0 := by + simpa only [g, zero_add, qf] using hq₀ + have hqfSupport : (binaryOneSupport qf).card = 6 := by + simpa only [binaryOneSupport, qf, Q] using + card_one_quadraticRadicalQuotientFunction f hdegree hweight + have hgSupport : (binaryOneSupport g).card = 6 := by + have htranslate := card_one_translate_add qf q₀ + simpa only [binaryOneSupport, g] using htranslate.trans hqfSupport + have hgDerivative : ∀ a ≠ 0, + ((Finset.univ : Finset Q).filter fun x ↦ + g x + g (x + a) = 1).card = 8 := by + intro a ha + let d : Q → FABL.𝔽₂ := fun x ↦ qf x + qf (x + a) + have hd := card_one_quadraticRadicalQuotientDerivative_of_ne_zero + f hdegree hweight a ha + have htranslate := card_one_translate_add d q₀ + have htranslatedDerivative : + ((Finset.univ : Finset Q).filter fun x ↦ + d (x + q₀) = 1).card = 8 := by + exact htranslate.trans hd + simpa only [g, d, add_assoc, add_left_comm, add_comm] using + htranslatedDerivative + have hgNeighbors : ∀ a, g a = 1 → + (binarySupportNeighbors g a).card = 2 := by + exact fun a ha ↦ card_binarySupportNeighbors_eq_two_of_six_support + g hgzero hgSupport hgDerivative a ha + simpa only [Q, qf, g] using + exists_transverse_binaryPlanes_of_six_support + g hgzero hgSupport hgNeighbors + +theorem exists_weightTwelveSubmodulePair_over_zeroCoset + (f : BooleanFunction 5) + (hdegree : FABL.functionAlgebraicDegree f ≤ 2) + (hweight : hammingWeight f = 12) + (q₀ : FABL.F₂Cube 5 ⧸ quadraticRadical f hdegree) + (hq₀ : quadraticRadicalQuotientFunction f hdegree hweight q₀ = 0) : + ∃ u : FABL.F₂Cube 5, + ∃ H K : Submodule FABL.𝔽₂ (FABL.F₂Cube 5), + (quadraticRadical f hdegree).mkQ u = q₀ ∧ + Module.finrank FABL.𝔽₂ H = 3 ∧ + Module.finrank FABL.𝔽₂ K = 3 ∧ + H ⊓ K = quadraticRadical f hdegree ∧ + f = binaryAffineFlatIndicator (FABL.binaryAffineSubspace H u) + + binaryAffineFlatIndicator (FABL.binaryAffineSubspace K u) := by + classical + let R := quadraticRadical f hdegree + obtain ⟨E, F, hErank, hFrank, hEF, hquotientSupport⟩ := + exists_transverse_translated_quadraticRadicalQuotientPlanes + f hdegree hweight q₀ hq₀ + obtain ⟨u, hu⟩ := R.mkQ_surjective q₀ + let H := Submodule.comap R.mkQ E + let K := Submodule.comap R.mkQ F + have hRrank : Module.finrank FABL.𝔽₂ R = 1 := + finrank_quadraticRadical_eq_one_of_weight_eq_twelve + f hdegree hweight + have hHrank : Module.finrank FABL.𝔽₂ H = 3 := by + change Module.finrank FABL.𝔽₂ (Submodule.comap R.mkQ E) = 3 + rw [finrank_comap_mkQ_eq_add R E, hRrank, hErank] + have hKrank : Module.finrank FABL.𝔽₂ K = 3 := by + change Module.finrank FABL.𝔽₂ (Submodule.comap R.mkQ F) = 3 + rw [finrank_comap_mkQ_eq_add R F, hRrank, hFrank] + have hHK : H ⊓ K = R := by + change Submodule.comap R.mkQ E ⊓ Submodule.comap R.mkQ F = R + rw [← Submodule.comap_inf, hEF, + Submodule.comap_bot, Submodule.ker_mkQ] + refine ⟨u, H, K, hu, hHrank, hKrank, hHK, ?_⟩ + funext x + let q : FABL.F₂Cube 5 ⧸ R := R.mkQ x + q₀ + have hsupportX := hquotientSupport q + have hqarg : q + q₀ = R.mkQ x := by + dsimp only [q] + calc + (R.mkQ x + q₀) + q₀ = R.mkQ x + (q₀ + q₀) := by abel + _ = R.mkQ x := by rw [ZModModule.add_self, add_zero] + rw [hqarg, quadraticRadicalQuotientFunction_mkQ] at hsupportX + have hxH : x ∈ FABL.binaryAffineSubspace H u ↔ q ∈ E := by + rw [FABL.mem_binaryAffineSubspace_iff_add_mem] + change R.mkQ (x + u) ∈ E ↔ q ∈ E + rw [map_add, hu] + have hxK : x ∈ FABL.binaryAffineSubspace K u ↔ q ∈ F := by + rw [FABL.mem_binaryAffineSubspace_iff_add_mem] + change R.mkQ (x + u) ∈ F ↔ q ∈ F + rw [map_add, hu] + by_cases hxA : x ∈ FABL.binaryAffineSubspace H u + · by_cases hxB : x ∈ FABL.binaryAffineSubspace K u + · have hqInf : q ∈ E ⊓ F := ⟨hxH.mp hxA, hxK.mp hxB⟩ + have hqzero : q = 0 := by + rw [hEF, Submodule.mem_bot] at hqInf + exact hqInf + have hfx : f x = 0 := by + by_contra hfx0 + have hfx1 : f x = 1 := Fin.eq_one_of_ne_zero _ hfx0 + exact (hsupportX.mp hfx1).1 hqzero + simp [Pi.add_apply, binaryAffineFlatIndicator, hxA, hxB, hfx] + · have hqE : q ∈ E := hxH.mp hxA + have hqzero : q ≠ 0 := by + intro hq + apply hxB + apply hxK.mpr + rw [hq] + exact F.zero_mem + have hfx : f x = 1 := + hsupportX.mpr ⟨hqzero, Or.inl hqE⟩ + simp [Pi.add_apply, binaryAffineFlatIndicator, hxA, hxB, hfx] + · by_cases hxB : x ∈ FABL.binaryAffineSubspace K u + · have hqF : q ∈ F := hxK.mp hxB + have hqzero : q ≠ 0 := by + intro hq + apply hxA + apply hxH.mpr + rw [hq] + exact E.zero_mem + have hfx : f x = 1 := + hsupportX.mpr ⟨hqzero, Or.inr hqF⟩ + simp [Pi.add_apply, binaryAffineFlatIndicator, hxA, hxB, hfx] + · have hfx : f x = 0 := by + by_contra hfx0 + have hfx1 : f x = 1 := Fin.eq_one_of_ne_zero _ hfx0 + rcases (hsupportX.mp hfx1).2 with hqE | hqF + · exact hxA (hxH.mpr hqE) + · exact hxB (hxK.mpr hqF) + simp [Pi.add_apply, binaryAffineFlatIndicator, hxA, hxB, hfx] + +noncomputable def quadraticRadicalCosetRepresentative + (f : BooleanFunction 5) + (hdegree : FABL.functionAlgebraicDegree f ≤ 2) + (q : FABL.F₂Cube 5 ⧸ quadraticRadical f hdegree) : + FABL.F₂Cube 5 := + Classical.choose ((quadraticRadical f hdegree).mkQ_surjective q) + +@[simp] theorem quadraticRadicalCosetRepresentative_mkQ + (f : BooleanFunction 5) + (hdegree : FABL.functionAlgebraicDegree f ≤ 2) + (q : FABL.F₂Cube 5 ⧸ quadraticRadical f hdegree) : + (quadraticRadical f hdegree).mkQ + (quadraticRadicalCosetRepresentative f hdegree q) = q := + Classical.choose_spec ((quadraticRadical f hdegree).mkQ_surjective q) + +noncomputable def quadraticRadicalCoset + (f : BooleanFunction 5) + (hdegree : FABL.functionAlgebraicDegree f ≤ 2) + (q : FABL.F₂Cube 5 ⧸ quadraticRadical f hdegree) : + AffineSubspace FABL.𝔽₂ (FABL.F₂Cube 5) := + FABL.binaryAffineSubspace (quadraticRadical f hdegree) + (quadraticRadicalCosetRepresentative f hdegree q) + +@[simp] theorem mem_quadraticRadicalCoset_iff_mkQ_eq + (f : BooleanFunction 5) + (hdegree : FABL.functionAlgebraicDegree f ≤ 2) + (q : FABL.F₂Cube 5 ⧸ quadraticRadical f hdegree) + (x : FABL.F₂Cube 5) : + x ∈ quadraticRadicalCoset f hdegree q ↔ + (quadraticRadical f hdegree).mkQ x = q := by + let R := quadraticRadical f hdegree + let u := quadraticRadicalCosetRepresentative f hdegree q + have hu : R.mkQ u = q := + quadraticRadicalCosetRepresentative_mkQ f hdegree q + rw [quadraticRadicalCoset, + FABL.mem_binaryAffineSubspace_iff_add_mem] + constructor + · intro hx + have hker : R.mkQ (x + u) = 0 := by + rw [← LinearMap.mem_ker, Submodule.ker_mkQ] + exact hx + rw [map_add, hu, add_eq_zero_iff_eq_neg, + ZModModule.neg_eq_self] at hker + exact hker + · intro hx + have hker : R.mkQ (x + u) = 0 := by + rw [map_add, hu, hx, ZModModule.add_self] + have hmemKer : x + u ∈ LinearMap.ker R.mkQ := + LinearMap.mem_ker.mpr hker + simpa only [Submodule.ker_mkQ] using hmemKer + +theorem quadraticRadicalCoset_injective + (f : BooleanFunction 5) + (hdegree : FABL.functionAlgebraicDegree f ≤ 2) : + Function.Injective (quadraticRadicalCoset f hdegree) := by + intro q r hqr + let u := quadraticRadicalCosetRepresentative f hdegree q + have huQ : u ∈ quadraticRadicalCoset f hdegree q := by + rw [mem_quadraticRadicalCoset_iff_mkQ_eq] + exact quadraticRadicalCosetRepresentative_mkQ f hdegree q + have huR : u ∈ quadraticRadicalCoset f hdegree r := by + rw [← hqr] + exact huQ + have hmkQ := (mem_quadraticRadicalCoset_iff_mkQ_eq + f hdegree r u).mp huR + exact (quadraticRadicalCosetRepresentative_mkQ + f hdegree q).symm.trans hmkQ + +theorem quadraticRadicalCoset_eq_binaryAffineSubspace_of_mkQ_eq + (f : BooleanFunction 5) + (hdegree : FABL.functionAlgebraicDegree f ≤ 2) + (q : FABL.F₂Cube 5 ⧸ quadraticRadical f hdegree) + (u : FABL.F₂Cube 5) + (hu : (quadraticRadical f hdegree).mkQ u = q) : + quadraticRadicalCoset f hdegree q = + FABL.binaryAffineSubspace (quadraticRadical f hdegree) u := by + have huLeft : u ∈ quadraticRadicalCoset f hdegree q := + (mem_quadraticRadicalCoset_iff_mkQ_eq f hdegree q u).mpr hu + have huRight : u ∈ FABL.binaryAffineSubspace + (quadraticRadical f hdegree) u := + AffineSubspace.self_mem_mk' u (quadraticRadical f hdegree) + apply (AffineSubspace.eq_iff_direction_eq_of_mem huLeft huRight).2 + rw [quadraticRadicalCoset, FABL.binaryAffineSubspace_direction, + FABL.binaryAffineSubspace_direction] + +noncomputable def zeroQuadraticRadicalCosets + (f : BooleanFunction 5) + (hdegree : FABL.functionAlgebraicDegree f ≤ 2) + (hweight : hammingWeight f = 12) : + Finset (FABL.F₂Cube 5 ⧸ quadraticRadical f hdegree) := by + classical + exact Finset.univ.filter fun q ↦ + quadraticRadicalQuotientFunction f hdegree hweight q = 0 + +noncomputable def weightTwelveZeroRadicalLines + (f : BooleanFunction 5) + (hdegree : FABL.functionAlgebraicDegree f ≤ 2) + (hweight : hammingWeight f = 12) : + Finset (AffineSubspace FABL.𝔽₂ (FABL.F₂Cube 5)) := by + classical + exact (zeroQuadraticRadicalCosets f hdegree hweight).image + (quadraticRadicalCoset f hdegree) + +theorem card_weightTwelveZeroRadicalLines + (f : BooleanFunction 5) + (hdegree : FABL.functionAlgebraicDegree f ≤ 2) + (hweight : hammingWeight f = 12) : + (weightTwelveZeroRadicalLines f hdegree hweight).card = 10 := by + classical + rw [weightTwelveZeroRadicalLines, + Finset.card_image_of_injective _ + (quadraticRadicalCoset_injective f hdegree)] + simpa only [zeroQuadraticRadicalCosets] using + card_zero_quadraticRadicalQuotientFunction f hdegree hweight + +theorem weightTwelveRepresentation_line_mem_zeroRadicalLines + (f : BooleanFunction 5) + (hdegree : FABL.functionAlgebraicDegree f ≤ 2) + (hweight : hammingWeight f = 12) + {p : WeightTwelveFlatTriple 5} + (hp : p ∈ goodWeightTwelveFlatTriples 5) + (hrepresentation : weightTwelveRepresentationWord p = f) : + p.1 ∈ weightTwelveZeroRadicalLines f hdegree hweight := by + classical + have hdata := goodWeightTwelveFlatTriple_geometry hp + obtain ⟨u, hu⟩ := + (AffineSubspace.nonempty_iff_ne_bot p.1).2 hdata.1 + let q := (quadraticRadical f hdegree).mkQ u + have hqzero : + quadraticRadicalQuotientFunction f hdegree hweight q = 0 := by + change quadraticRadicalQuotientFunction f hdegree hweight + ((quadraticRadical f hdegree).mkQ u) = 0 + rw [quadraticRadicalQuotientFunction_mkQ] + exact goodWeightTwelveFlatTriple_line_value_eq_zero + f hp hrepresentation u hu + have huCoset : u ∈ quadraticRadicalCoset f hdegree q := by + rw [mem_quadraticRadicalCoset_iff_mkQ_eq] + have hlineEq : p.1 = quadraticRadicalCoset f hdegree q := by + apply (AffineSubspace.eq_iff_direction_eq_of_mem hu huCoset).2 + rw [goodWeightTwelveFlatTriple_line_direction_eq_quadraticRadical_five + f hdegree hweight hp hrepresentation, + quadraticRadicalCoset, FABL.binaryAffineSubspace_direction] + rw [weightTwelveZeroRadicalLines, Finset.mem_image] + refine ⟨q, ?_, hlineEq.symm⟩ + simp only [zeroQuadraticRadicalCosets, Finset.mem_filter, + Finset.mem_univ, true_and] + exact hqzero + +theorem submodulePair_weightTwelveFlatTriple_mem_good + (R H K : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) + (u : FABL.F₂Cube n) + (hRrank : Module.finrank FABL.𝔽₂ R = 1) + (hHrank : Module.finrank FABL.𝔽₂ H = 3) + (hKrank : Module.finrank FABL.𝔽₂ K = 3) + (hHK : H ⊓ K = R) : + (FABL.binaryAffineSubspace R u, + (FABL.binaryAffineSubspace H u, + FABL.binaryAffineSubspace K u)) ∈ + goodWeightTwelveFlatTriples n := by + classical + have hLmem : FABL.binaryAffineSubspace R u ∈ + binaryAffineFlats 1 n := + binaryAffineSubspace_mem_binaryAffineFlats R u + ((mem_binaryLinearSubspaces R).mpr hRrank) + have hAmem : FABL.binaryAffineSubspace H u ∈ + binaryAffineFlats 3 n := + binaryAffineSubspace_mem_binaryAffineFlats H u + ((mem_binaryLinearSubspaces H).mpr hHrank) + have hBmem : FABL.binaryAffineSubspace K u ∈ + binaryAffineFlats 3 n := + binaryAffineSubspace_mem_binaryAffineFlats K u + ((mem_binaryLinearSubspaces K).mpr hKrank) + have hRleH : R ≤ H := by + rw [← hHK] + exact inf_le_left + have hRleK : R ≤ K := by + rw [← hHK] + exact inf_le_right + have hLA : FABL.binaryAffineSubspace R u ≤ + FABL.binaryAffineSubspace H u := by + intro x hx + rw [FABL.mem_binaryAffineSubspace_iff_add_mem] at hx ⊢ + exact hRleH hx + have hLB : FABL.binaryAffineSubspace R u ≤ + FABL.binaryAffineSubspace K u := by + intro x hx + rw [FABL.mem_binaryAffineSubspace_iff_add_mem] at hx ⊢ + exact hRleK hx + rw [show goodWeightTwelveFlatTriples n = + (weightTwelveFlatTriples n).filter (fun p ↦ + p.2.1.direction ⊓ p.2.2.direction = p.1.direction) by rfl] + refine Finset.mem_filter.mpr ⟨?_, ?_⟩ + · rw [show weightTwelveFlatTriples n = + (((binaryAffineFlats 1 n).product + ((binaryAffineFlats 3 n).product (binaryAffineFlats 3 n))).filter + fun p ↦ p.1 ≤ p.2.1 ∧ p.1 ≤ p.2.2) by rfl] + refine Finset.mem_filter.mpr ⟨?_, ⟨hLA, hLB⟩⟩ + exact Finset.mem_product.mpr + ⟨hLmem, Finset.mem_product.mpr ⟨hAmem, hBmem⟩⟩ + · simpa only [FABL.binaryAffineSubspace_direction] using hHK + +theorem exists_exactly_two_weightTwelveRepresentations_over_zeroCoset + (f : BooleanFunction 5) + (hdegree : FABL.functionAlgebraicDegree f ≤ 2) + (hweight : hammingWeight f = 12) + (q : FABL.F₂Cube 5 ⧸ quadraticRadical f hdegree) + (hq : quadraticRadicalQuotientFunction f hdegree hweight q = 0) : + ∃ p₁ p₂ : WeightTwelveFlatTriple 5, + p₁ ≠ p₂ ∧ + p₁ ∈ goodWeightTwelveFlatTriples 5 ∧ + weightTwelveRepresentationWord p₁ = f ∧ + p₁.1 = quadraticRadicalCoset f hdegree q ∧ + p₂ ∈ goodWeightTwelveFlatTriples 5 ∧ + weightTwelveRepresentationWord p₂ = f ∧ + p₂.1 = quadraticRadicalCoset f hdegree q ∧ + ∀ p : WeightTwelveFlatTriple 5, + p ∈ goodWeightTwelveFlatTriples 5 → + weightTwelveRepresentationWord p = f → + p.1 = quadraticRadicalCoset f hdegree q → + p = p₁ ∨ p = p₂ := by + classical + let R := quadraticRadical f hdegree + obtain ⟨u, H, K, hu, hHrank, hKrank, hHK, hrepresentation⟩ := + exists_weightTwelveSubmodulePair_over_zeroCoset + f hdegree hweight q hq + let L := quadraticRadicalCoset f hdegree q + let A := FABL.binaryAffineSubspace H u + let B := FABL.binaryAffineSubspace K u + let p₁ : WeightTwelveFlatTriple 5 := (L, (A, B)) + let p₂ : WeightTwelveFlatTriple 5 := (L, (B, A)) + have hRrank : Module.finrank FABL.𝔽₂ R = 1 := + finrank_quadraticRadical_eq_one_of_weight_eq_twelve + f hdegree hweight + have hline : L = FABL.binaryAffineSubspace R u := + quadraticRadicalCoset_eq_binaryAffineSubspace_of_mkQ_eq + f hdegree q u hu + have hKH : K ⊓ H = R := by + rw [inf_comm, hHK] + have hp₁Good : p₁ ∈ goodWeightTwelveFlatTriples 5 := by + dsimp only [p₁, A, B] + rw [hline] + exact submodulePair_weightTwelveFlatTriple_mem_good + R H K u hRrank hHrank hKrank hHK + have hp₂Good : p₂ ∈ goodWeightTwelveFlatTriples 5 := by + dsimp only [p₂, A, B] + rw [hline] + exact submodulePair_weightTwelveFlatTriple_mem_good + R K H u hRrank hKrank hHrank hKH + have hp₁Representation : weightTwelveRepresentationWord p₁ = f := by + simpa only [p₁, A, B, weightTwelveRepresentationWord] using + hrepresentation.symm + have hp₂Representation : weightTwelveRepresentationWord p₂ = f := by + simpa only [p₂, A, B, weightTwelveRepresentationWord, add_comm] using + hrepresentation.symm + have hHKne : H ≠ K := by + intro heq + have hintersection := hHK + rw [heq, inf_idem] at hintersection + have hrank := congrArg + (fun S : Submodule FABL.𝔽₂ (FABL.F₂Cube 5) ↦ + Module.finrank FABL.𝔽₂ S) hintersection + rw [hKrank, hRrank] at hrank + omega + have hABne : A ≠ B := by + intro heq + apply hHKne + have hdirection := congrArg + (fun C : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube 5) ↦ C.direction) heq + simpa only [A, B, FABL.binaryAffineSubspace_direction] using hdirection + have hpne : p₁ ≠ p₂ := by + intro heq + apply hABne + have hfirst := congrArg + (fun p : WeightTwelveFlatTriple 5 ↦ p.2.1) heq + simpa only [p₁, p₂] using hfirst + refine ⟨p₁, p₂, hpne, hp₁Good, hp₁Representation, + rfl, hp₂Good, hp₂Representation, rfl, ?_⟩ + intro p hpGood hpRepresentation hpLine + have hpLine₁ : p.1 = p₁.1 := by + simpa only [p₁, L] using hpLine + rcases weightTwelveFlatPair_eq_or_swap_of_same_line + f hpGood hp₁Good hpRepresentation hp₁Representation hpLine₁ with + hsame | hswap + · left + apply Prod.ext + · exact hpLine₁ + · exact Prod.ext hsame.1 hsame.2 + · right + apply Prod.ext + · simpa only [p₂, L] using hpLine + · exact Prod.ext hswap.1 hswap.2 + +theorem card_weightTwelveRepresentations_over_zeroRadicalLine + (f : BooleanFunction 5) + (hdegree : FABL.functionAlgebraicDegree f ≤ 2) + (hweight : hammingWeight f = 12) + (L : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube 5)) + (hL : L ∈ weightTwelveZeroRadicalLines f hdegree hweight) : + (((goodWeightTwelveFlatTriples 5).filter fun p ↦ + weightTwelveRepresentationWord p = f).filter fun + p : WeightTwelveFlatTriple 5 ↦ + p.1 = L).card = 2 := by + classical + rw [weightTwelveZeroRadicalLines, Finset.mem_image] at hL + obtain ⟨q, hqZero, hqLine⟩ := hL + have hq : quadraticRadicalQuotientFunction f hdegree hweight q = 0 := by + simpa only [zeroQuadraticRadicalCosets, Finset.mem_filter, + Finset.mem_univ, true_and] using hqZero + obtain ⟨p₁, p₂, hpne, hp₁Good, hp₁Representation, hp₁Line, + hp₂Good, hp₂Representation, hp₂Line, hunique⟩ := + exists_exactly_two_weightTwelveRepresentations_over_zeroCoset + f hdegree hweight q hq + have hp₁LineL : p₁.1 = L := hp₁Line.trans hqLine + have hp₂LineL : p₂.1 = L := hp₂Line.trans hqLine + have hfiber : + ((goodWeightTwelveFlatTriples 5).filter fun p ↦ + weightTwelveRepresentationWord p = f).filter (fun p ↦ p.1 = L) = + {p₁, p₂} := by + ext p + simp only [Finset.mem_filter, Finset.mem_insert, Finset.mem_singleton] + constructor + · rintro ⟨⟨hpGood, hpRepresentation⟩, hpLine⟩ + exact hunique p hpGood hpRepresentation + (hpLine.trans hqLine.symm) + · intro hp + rcases hp with rfl | rfl + · exact ⟨⟨hp₁Good, hp₁Representation⟩, hp₁LineL⟩ + · exact ⟨⟨hp₂Good, hp₂Representation⟩, hp₂LineL⟩ + rw [hfiber, Finset.card_pair hpne] + +theorem card_weightTwelveRepresentationFiber_eq_twenty_five + (f : BooleanFunction 5) + (hdegree : FABL.functionAlgebraicDegree f ≤ 2) + (hweight : hammingWeight f = 12) : + ((goodWeightTwelveFlatTriples 5).filter fun p ↦ + weightTwelveRepresentationWord p = f).card = 20 := by + classical + let representations := (goodWeightTwelveFlatTriples 5).filter fun p ↦ + weightTwelveRepresentationWord p = f + let lines := weightTwelveZeroRadicalLines f hdegree hweight + have hmaps : (representations : Set (WeightTwelveFlatTriple 5)).MapsTo + (fun p ↦ p.1) lines := by + intro p hp + have hpData := Finset.mem_filter.mp hp + exact weightTwelveRepresentation_line_mem_zeroRadicalLines + f hdegree hweight hpData.1 hpData.2 + calc + representations.card = + ∑ L ∈ lines, + (representations.filter fun p ↦ p.1 = L).card := + Finset.card_eq_sum_card_fiberwise hmaps + _ = lines.card * 2 := by + apply Finset.sum_const_nat + intro L hL + exact card_weightTwelveRepresentations_over_zeroRadicalLine + f hdegree hweight L hL + _ = 20 := by + rw [card_weightTwelveZeroRadicalLines f hdegree hweight] + +set_option maxRecDepth 2000 in +private theorem card_weightTwelveRepresentationFiber_eq_twenty_of_mem + (f : BooleanFunction 5) + (hf : f ∈ orderTwoWeightTwelveDualWords 5) : + ((goodWeightTwelveFlatTriples 5).filter fun p ↦ + weightTwelveRepresentationWord p = f).card = 20 := by + have hfData : f ∈ reedMuller 2 5 ∧ hammingWeight f = 12 := by + simpa only [orderTwoWeightTwelveDualWords, orderTwoDualWords, + Finset.mem_filter, Finset.mem_univ, true_and] using hf + have hdegree : FABL.functionAlgebraicDegree f ≤ 2 := by + simpa only [mem_reedMuller_iff] using hfData.1 + exact card_weightTwelveRepresentationFiber_eq_twenty_five + f hdegree hfData.2 + +set_option maxRecDepth 2000 in +private theorem card_weightTwelveRepresentationFiber_eq_zero_of_not_mem + {n : ℕ} (f : BooleanFunction n) + (hf : f ∉ orderTwoWeightTwelveDualWords n) : + ((goodWeightTwelveFlatTriples n).filter fun p ↦ + weightTwelveRepresentationWord p = f).card = 0 := by + classical + apply Finset.card_eq_zero.mpr + apply Finset.filter_eq_empty_iff.mpr + intro p hpGood hpRepresentation + apply hf + exact hpRepresentation ▸ + weightTwelveRepresentationWord_mem_dualWords hpGood + +set_option maxRecDepth 2000 in +theorem hasWeightTwelveFlatPairClassification_five : + HasWeightTwelveFlatPairClassification 5 := by + intro f + by_cases hf : f ∈ orderTwoWeightTwelveDualWords 5 + · rw [if_pos hf] + exact card_weightTwelveRepresentationFiber_eq_twenty_of_mem f hf + · rw [if_neg hf] + exact card_weightTwelveRepresentationFiber_eq_zero_of_not_mem f hf + +theorem mem_goodWeightTwelveFlatTriples_iff_geometry + (p : WeightTwelveFlatTriple n) : + p ∈ goodWeightTwelveFlatTriples n ↔ + p.1 ≠ ⊥ ∧ Module.finrank FABL.𝔽₂ p.1.direction = 1 ∧ + p.2.1 ≠ ⊥ ∧ Module.finrank FABL.𝔽₂ p.2.1.direction = 3 ∧ + p.2.2 ≠ ⊥ ∧ Module.finrank FABL.𝔽₂ p.2.2.direction = 3 ∧ + p.1 ≤ p.2.1 ∧ p.1 ≤ p.2.2 ∧ + p.2.1.direction ⊓ p.2.2.direction = p.1.direction := by + classical + constructor + · exact goodWeightTwelveFlatTriple_geometry + · intro h + apply Finset.mem_filter.mpr + constructor + · apply Finset.mem_filter.mpr + constructor + · apply Finset.mem_product.mpr + constructor + · simp only [binaryAffineFlats, Finset.mem_filter, + Finset.mem_univ, true_and] + exact ⟨h.1, h.2.1⟩ + · apply Finset.mem_product.mpr + constructor + · simp only [binaryAffineFlats, Finset.mem_filter, + Finset.mem_univ, true_and] + exact ⟨h.2.2.1, h.2.2.2.1⟩ + · simp only [binaryAffineFlats, Finset.mem_filter, + Finset.mem_univ, true_and] + exact ⟨h.2.2.2.2.1, h.2.2.2.2.2.1⟩ + · exact ⟨h.2.2.2.2.2.2.1, h.2.2.2.2.2.2.2.1⟩ + · exact h.2.2.2.2.2.2.2.2 + +private theorem exists_superSubmodule_finrank_eq + {X : Type*} [AddCommGroup X] [Module FABL.𝔽₂ X] + [FiniteDimensional FABL.𝔽₂ X] + (E : Submodule FABL.𝔽₂ X) (k : ℕ) + (hE : Module.finrank FABL.𝔽₂ E ≤ k) + (hk : k ≤ Module.finrank FABL.𝔽₂ X) : + ∃ H : Submodule FABL.𝔽₂ X, + E ≤ H ∧ Module.finrank FABL.𝔽₂ H = k := by + induction k generalizing E with + | zero => + exact ⟨E, le_rfl, Nat.eq_zero_of_le_zero hE⟩ + | succ k ih => + by_cases hErank : Module.finrank FABL.𝔽₂ E = k + 1 + · exact ⟨E, le_rfl, hErank⟩ + · have hErankLe : Module.finrank FABL.𝔽₂ E ≤ k := by omega + have hkLe : k ≤ Module.finrank FABL.𝔽₂ X := by omega + obtain ⟨H, hEH, hHrank⟩ := ih E hErankLe hkLe + have hHlt : Module.finrank FABL.𝔽₂ H < + Module.finrank FABL.𝔽₂ X := by omega + obtain ⟨v, hv⟩ := H.exists_of_finrank_lt hHlt + have hvNotMem : v ∉ H := by + intro hvMem + exact hv 1 one_ne_zero (by simpa only [one_smul] using hvMem) + refine ⟨H ⊔ FABL.𝔽₂ ∙ v, hEH.trans le_sup_left, ?_⟩ + rw [Submodule.finrank_sup_span_singleton hvNotMem, hHrank] + +private noncomputable def weightTwelveFiveFlatLinearEmbedding + (H : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) + (e : FABL.F₂Cube 5 ≃ₗ[FABL.𝔽₂] H) : + FABL.F₂Cube 5 →ₗ[FABL.𝔽₂] FABL.F₂Cube n := + H.subtype.comp e.toLinearMap + +private theorem weightTwelveFiveFlatLinearEmbedding_injective + (H : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) + (e : FABL.F₂Cube 5 ≃ₗ[FABL.𝔽₂] H) : + Function.Injective (weightTwelveFiveFlatLinearEmbedding H e) := + Subtype.val_injective.comp e.injective + +private noncomputable def weightTwelveFiveFlatEmbedding + (u : FABL.F₂Cube n) + (H : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) + (e : FABL.F₂Cube 5 ≃ₗ[FABL.𝔽₂] H) : + FABL.F₂Cube 5 →ᵃ[FABL.𝔽₂] FABL.F₂Cube n where + toFun x := u + weightTwelveFiveFlatLinearEmbedding H e x + linear := weightTwelveFiveFlatLinearEmbedding H e + map_vadd' x v := by + change u + weightTwelveFiveFlatLinearEmbedding H e (v + x) = + weightTwelveFiveFlatLinearEmbedding H e v + + (u + weightTwelveFiveFlatLinearEmbedding H e x) + rw [map_add] + abel + +private theorem weightTwelveFiveFlatEmbedding_injective + (u : FABL.F₂Cube n) + (H : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) + (e : FABL.F₂Cube 5 ≃ₗ[FABL.𝔽₂] H) : + Function.Injective (weightTwelveFiveFlatEmbedding u H e) := by + intro x y hxy + apply weightTwelveFiveFlatLinearEmbedding_injective H e + exact add_left_cancel hxy + +private noncomputable def weightTwelveFiveFlatProjection + (u : FABL.F₂Cube n) + (H : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) + (e : FABL.F₂Cube 5 ≃ₗ[FABL.𝔽₂] H) : + FABL.F₂Cube n →ᵃ[FABL.𝔽₂] FABL.F₂Cube 5 where + toFun x := (weightTwelveFiveFlatLinearEmbedding H e).leftInverse (x + u) + linear := (weightTwelveFiveFlatLinearEmbedding H e).leftInverse + map_vadd' x v := by + change (weightTwelveFiveFlatLinearEmbedding H e).leftInverse + (v + x + u) = + (weightTwelveFiveFlatLinearEmbedding H e).leftInverse v + + (weightTwelveFiveFlatLinearEmbedding H e).leftInverse (x + u) + rw [show v + x + u = v + (x + u) by abel, map_add] + +private theorem weightTwelveFiveFlatProjection_embedding + (u : FABL.F₂Cube n) + (H : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) + (e : FABL.F₂Cube 5 ≃ₗ[FABL.𝔽₂] H) + (x : FABL.F₂Cube 5) : + weightTwelveFiveFlatProjection u H e + (weightTwelveFiveFlatEmbedding u H e x) = x := by + have hker : LinearMap.ker (weightTwelveFiveFlatLinearEmbedding H e) = ⊥ := + LinearMap.ker_eq_bot.mpr + (weightTwelveFiveFlatLinearEmbedding_injective H e) + change (weightTwelveFiveFlatLinearEmbedding H e).leftInverse + ((u + weightTwelveFiveFlatLinearEmbedding H e x) + u) = x + rw [show (u + weightTwelveFiveFlatLinearEmbedding H e x) + u = + weightTwelveFiveFlatLinearEmbedding H e x by + rw [add_assoc, add_comm + (weightTwelveFiveFlatLinearEmbedding H e x) u, + ← add_assoc, ZModModule.add_self, zero_add]] + exact LinearMap.leftInverse_apply_of_inj hker x + +private theorem weightTwelveFiveFlatEmbedding_projection_of_mem_range + (u : FABL.F₂Cube n) + (H : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) + (e : FABL.F₂Cube 5 ≃ₗ[FABL.𝔽₂] H) + (x : FABL.F₂Cube n) + (hx : x ∈ (⊤ : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube 5)).map + (weightTwelveFiveFlatEmbedding u H e)) : + weightTwelveFiveFlatEmbedding u H e + (weightTwelveFiveFlatProjection u H e x) = x := by + rw [AffineSubspace.mem_map] at hx + obtain ⟨y, _hy, rfl⟩ := hx + rw [weightTwelveFiveFlatProjection_embedding] + +private theorem functionAlgebraicDegree_affineMap_coordinate_le_one_of_dims + {m n : ℕ} (L : FABL.F₂Cube n →ᵃ[FABL.𝔽₂] FABL.F₂Cube m) + (i : Fin m) : + FABL.functionAlgebraicDegree (fun x ↦ L x i) ≤ 1 := by + have hlinear : FABL.IsF₂Linear (fun x ↦ L.linear x i) := by + intro x y + exact congrArg (fun z ↦ z i) (L.linear.map_add x y) + obtain ⟨a, ha⟩ := (FABL.isF₂Linear_iff_exists_dotProduct _).mp hlinear + have hcoordinate : (fun x ↦ L x i) = + FABL.affineFunction (L 0 i) a := by + funext x + have hdecomp : L x = L.linear x + L 0 := by + simpa using congrFun (AffineMap.decomp L) x + calc + L x i = L.linear x i + L 0 i := by + simpa using congrArg (fun z ↦ z i) hdecomp + _ = FABL.f₂DotProduct a x + L 0 i := by rw [ha x] + _ = L 0 i + FABL.f₂DotProduct a x := add_comm _ _ + _ = FABL.affineFunction (L 0 i) a x := rfl + rw [hcoordinate] + exact FABL.functionAlgebraicDegree_affineFunction_le_one (L 0 i) a + +private theorem functionAlgebraicDegree_anfMonomial_comp_affineMap_le_card_of_dims + {m n : ℕ} (L : FABL.F₂Cube n →ᵃ[FABL.𝔽₂] FABL.F₂Cube m) + (S : Finset (Fin m)) : + FABL.functionAlgebraicDegree (fun x ↦ FABL.anfMonomial S (L x)) ≤ + S.card := by + calc + FABL.functionAlgebraicDegree + (fun x ↦ FABL.anfMonomial S (L x)) ≤ + ∑ i ∈ S, FABL.functionAlgebraicDegree (fun x ↦ L x i) := by + have hfunctions : (∏ i ∈ S, (fun x ↦ L x i)) = + (fun x ↦ FABL.anfMonomial S (L x)) := by + funext x + simp [FABL.anfMonomial, Finset.prod_apply] + rw [← hfunctions] + exact FABL.functionAlgebraicDegree_finset_prod_le S + (fun i x ↦ L x i) + _ ≤ ∑ _i ∈ S, 1 := by + apply Finset.sum_le_sum + intro i _ + exact functionAlgebraicDegree_affineMap_coordinate_le_one_of_dims L i + _ = S.card := by simp + +private theorem functionAlgebraicDegree_comp_affineMap_le_of_dims + {m n : ℕ} (f : BooleanFunction m) + (L : FABL.F₂Cube n →ᵃ[FABL.𝔽₂] FABL.F₂Cube m) : + FABL.functionAlgebraicDegree (f ∘ L) ≤ + FABL.functionAlgebraicDegree f := by + classical + let term : Finset (Fin m) → BooleanFunction n := + fun S x ↦ FABL.anfCoeff f S * FABL.anfMonomial S (L x) + have hsum : f ∘ L = ∑ S, term S := by + funext x + simp only [Function.comp_apply, Fintype.sum_apply, term] + exact (congrFun (FABL.anfEval_anfCoeff f) (L x)).symm + rw [hsum] + exact FABL.functionAlgebraicDegree_finset_sum_le Finset.univ term + (FABL.functionAlgebraicDegree f) (by + intro S _ + by_cases hS : FABL.anfCoeff f S = 0 + · have hterm : term S = 0 := by + funext x + simp [term, hS] + rw [hterm, FABL.functionAlgebraicDegree_zero] + exact Nat.zero_le _ + · have hSone : FABL.anfCoeff f S = 1 := Fin.eq_one_of_ne_zero _ hS + have hterm : term S = fun x ↦ FABL.anfMonomial S (L x) := by + funext x + simp [term, hSone] + rw [hterm] + apply (functionAlgebraicDegree_anfMonomial_comp_affineMap_le_card_of_dims + L S).trans + exact (FABL.algebraicDegree_le_iff (FABL.anfCoeff f) + (FABL.functionAlgebraicDegree f)).mp (by rfl) S hS) + +private noncomputable def weightTwelveFiveFlatRestriction + (h : BooleanFunction n) (u : FABL.F₂Cube n) + (H : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) + (e : FABL.F₂Cube 5 ≃ₗ[FABL.𝔽₂] H) : BooleanFunction 5 := + h ∘ weightTwelveFiveFlatEmbedding u H e + +private noncomputable def weightTwelveFiveFlatSupportEquiv + (h : BooleanFunction n) (u : FABL.F₂Cube n) + (H : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) + (e : FABL.F₂Cube 5 ≃ₗ[FABL.𝔽₂] H) + (hsupport : (support h : Set (FABL.F₂Cube n)) ⊆ + (⊤ : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube 5)).map + (weightTwelveFiveFlatEmbedding u H e)) : + {x // x ∈ support (weightTwelveFiveFlatRestriction h u H e)} ≃ + {x // x ∈ support h} where + toFun x := ⟨weightTwelveFiveFlatEmbedding u H e x, by + apply (mem_support h _).mpr + exact (mem_support (weightTwelveFiveFlatRestriction h u H e) _).mp x.2⟩ + invFun x := ⟨weightTwelveFiveFlatProjection u H e x, by + apply (mem_support (weightTwelveFiveFlatRestriction h u H e) _).mpr + change h (weightTwelveFiveFlatEmbedding u H e + (weightTwelveFiveFlatProjection u H e x)) = 1 + rw [weightTwelveFiveFlatEmbedding_projection_of_mem_range + u H e x (hsupport x.2)] + exact (mem_support h _).mp x.2⟩ + left_inv x := Subtype.ext + (weightTwelveFiveFlatProjection_embedding u H e x) + right_inv x := Subtype.ext + (weightTwelveFiveFlatEmbedding_projection_of_mem_range + u H e x (hsupport x.2)) + +private theorem hammingWeight_weightTwelveFiveFlatRestriction + (h : BooleanFunction n) (u : FABL.F₂Cube n) + (H : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) + (e : FABL.F₂Cube 5 ≃ₗ[FABL.𝔽₂] H) + (hsupport : (support h : Set (FABL.F₂Cube n)) ⊆ + (⊤ : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube 5)).map + (weightTwelveFiveFlatEmbedding u H e)) : + hammingWeight (weightTwelveFiveFlatRestriction h u H e) = + hammingWeight h := by + rw [hammingWeight_eq_card_support, hammingWeight_eq_card_support] + simpa only [Fintype.card_coe] using + Fintype.card_congr + (weightTwelveFiveFlatSupportEquiv h u H e hsupport) + +private theorem booleanFunctionPairing_eq_sum_support + (q h : BooleanFunction n) : + booleanFunctionPairing n q h = ∑ x : {x // x ∈ support h}, q x := by + rw [booleanFunctionPairing_apply] + calc + (∑ x : FABL.F₂Cube n, q x * h x) = + ∑ x ∈ support h, q x := by + rw [support, FABL.f₂OneSupport, Finset.sum_filter] + apply Finset.sum_congr rfl + intro x _hx + by_cases hx : h x = 0 + · simp [hx] + · have hxOne : h x = 1 := Fin.eq_one_of_ne_zero _ hx + simp [hxOne] + _ = ∑ x : {x // x ∈ support h}, q x := by + exact Finset.sum_subtype (support h) (fun x ↦ by simp) q + +private theorem booleanFunctionPairing_fiveFlatRestriction + (h : BooleanFunction n) (q : BooleanFunction 5) + (u : FABL.F₂Cube n) + (H : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) + (e : FABL.F₂Cube 5 ≃ₗ[FABL.𝔽₂] H) + (hsupport : (support h : Set (FABL.F₂Cube n)) ⊆ + (⊤ : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube 5)).map + (weightTwelveFiveFlatEmbedding u H e)) : + booleanFunctionPairing 5 q + (weightTwelveFiveFlatRestriction h u H e) = + booleanFunctionPairing n + (q ∘ weightTwelveFiveFlatProjection u H e) h := by + rw [booleanFunctionPairing_eq_sum_support, + booleanFunctionPairing_eq_sum_support] + exact Fintype.sum_equiv + (weightTwelveFiveFlatSupportEquiv h u H e hsupport) + (fun x : {x // x ∈ support + (weightTwelveFiveFlatRestriction h u H e)} ↦ q x) + (fun x : {x // x ∈ support h} ↦ + (q ∘ weightTwelveFiveFlatProjection u H e) x) + (fun x ↦ by + change q x = q (weightTwelveFiveFlatProjection u H e + ((weightTwelveFiveFlatSupportEquiv h u H e hsupport x).1)) + change q x = q (weightTwelveFiveFlatProjection u H e + (weightTwelveFiveFlatEmbedding u H e x)) + rw [weightTwelveFiveFlatProjection_embedding]) + +private theorem weightTwelveFiveFlatRestriction_mem_reedMuller_two + (h : BooleanFunction n) (hn : 5 ≤ n) + (hmem : h ∈ reedMuller (n - 3) n) + (u : FABL.F₂Cube n) + (H : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) + (e : FABL.F₂Cube 5 ≃ₗ[FABL.𝔽₂] H) + (hsupport : (support h : Set (FABL.F₂Cube n)) ⊆ + (⊤ : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube 5)).map + (weightTwelveFiveFlatEmbedding u H e)) : + weightTwelveFiveFlatRestriction h u H e ∈ reedMuller 2 5 := by + have hdual : h ∈ reedMullerDual 2 n := by + rw [reedMullerDual_eq (r := 2) (n := n) (by omega)] + simpa only [show n - 2 - 1 = n - 3 by omega] using hmem + have hlocalDual : weightTwelveFiveFlatRestriction h u H e ∈ + reedMullerDual 2 5 := by + rw [reedMullerDual, LinearMap.BilinForm.mem_orthogonal_iff] + intro q hq + let Q : BooleanFunction n := + q ∘ weightTwelveFiveFlatProjection u H e + have hqDegree : FABL.functionAlgebraicDegree q ≤ 2 := by + simpa only [mem_reedMuller_iff] using hq + have hQDegree : FABL.functionAlgebraicDegree Q ≤ 2 := by + exact (functionAlgebraicDegree_comp_affineMap_le_of_dims q + (weightTwelveFiveFlatProjection u H e)).trans hqDegree + have hQ : Q ∈ reedMuller 2 n := by + simpa only [mem_reedMuller_iff] using hQDegree + rw [booleanFunctionPairing_fiveFlatRestriction h q u H e hsupport] + exact hdual Q hQ + rw [reedMullerDual_eq (r := 2) (n := 5) (by omega)] at hlocalDual + simpa only using hlocalDual + +private def weightTwelveFlatTripleMap + {m n : ℕ} (L : FABL.F₂Cube m →ᵃ[FABL.𝔽₂] FABL.F₂Cube n) + (p : WeightTwelveFlatTriple m) : WeightTwelveFlatTriple n := + (p.1.map L, (p.2.1.map L, p.2.2.map L)) + +private def weightTwelveFlatTripleComap + {m n : ℕ} (L : FABL.F₂Cube m →ᵃ[FABL.𝔽₂] FABL.F₂Cube n) + (p : WeightTwelveFlatTriple n) : WeightTwelveFlatTriple m := + (p.1.comap L, (p.2.1.comap L, p.2.2.comap L)) + +private theorem affineSubspaceMap_injective + {m n : ℕ} (L : FABL.F₂Cube m →ᵃ[FABL.𝔽₂] FABL.F₂Cube n) + (hL : Function.Injective L) : + Function.Injective (AffineSubspace.map L) := by + intro A B hAB + have hcomap := congrArg (AffineSubspace.comap L) hAB + simpa only [AffineSubspace.comap_map_eq_of_injective hL] using hcomap + +private theorem weightTwelveFlatTripleMap_injective + {m n : ℕ} (L : FABL.F₂Cube m →ᵃ[FABL.𝔽₂] FABL.F₂Cube n) + (hL : Function.Injective L) : + Function.Injective (weightTwelveFlatTripleMap L) := by + intro p q hpq + apply Prod.ext + · apply affineSubspaceMap_injective L hL + exact congrArg Prod.fst hpq + · apply Prod.ext + · apply affineSubspaceMap_injective L hL + exact congrArg (fun r ↦ r.2.1) hpq + · apply affineSubspaceMap_injective L hL + exact congrArg (fun r ↦ r.2.2) hpq + +private theorem finrank_direction_map_eq_of_linear_injective + {m n : ℕ} (L : FABL.F₂Cube m →ᵃ[FABL.𝔽₂] FABL.F₂Cube n) + (hlinear : Function.Injective L.linear) + (A : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube m)) : + Module.finrank FABL.𝔽₂ (A.map L).direction = + Module.finrank FABL.𝔽₂ A.direction := by + rw [AffineSubspace.map_direction, ← LinearMap.range_domRestrict] + exact LinearMap.finrank_range_of_inj + (hlinear.comp Subtype.val_injective) + +private theorem weightTwelveFlatTripleMap_mem_good_iff + {m n : ℕ} (L : FABL.F₂Cube m →ᵃ[FABL.𝔽₂] FABL.F₂Cube n) + (hL : Function.Injective L) + (hlinear : Function.Injective L.linear) + (p : WeightTwelveFlatTriple m) : + weightTwelveFlatTripleMap L p ∈ goodWeightTwelveFlatTriples n ↔ + p ∈ goodWeightTwelveFlatTriples m := by + constructor + · intro hpMap + have hmapData := + (mem_goodWeightTwelveFlatTriples_iff_geometry + (weightTwelveFlatTripleMap L p)).mp hpMap + have hlineNe : p.1 ≠ ⊥ := by + intro hbot + apply hmapData.1 + change p.1.map L = ⊥ + rw [hbot, AffineSubspace.map_bot] + have hfirstNe : p.2.1 ≠ ⊥ := by + intro hbot + apply hmapData.2.2.1 + change p.2.1.map L = ⊥ + rw [hbot, AffineSubspace.map_bot] + have hsecondNe : p.2.2 ≠ ⊥ := by + intro hbot + apply hmapData.2.2.2.2.1 + change p.2.2.map L = ⊥ + rw [hbot, AffineSubspace.map_bot] + have hlineRank : Module.finrank FABL.𝔽₂ p.1.direction = 1 := by + rw [← finrank_direction_map_eq_of_linear_injective L hlinear] + exact hmapData.2.1 + have hfirstRank : Module.finrank FABL.𝔽₂ p.2.1.direction = 3 := by + rw [← finrank_direction_map_eq_of_linear_injective L hlinear] + exact hmapData.2.2.2.1 + have hsecondRank : Module.finrank FABL.𝔽₂ p.2.2.direction = 3 := by + rw [← finrank_direction_map_eq_of_linear_injective L hlinear] + exact hmapData.2.2.2.2.2.1 + have hlineFirst : p.1 ≤ p.2.1 := by + intro x hx + have hxMap : L x ∈ p.1.map L := + AffineSubspace.mem_map_of_mem L hx + have hxFirstMap : L x ∈ p.2.1.map L := + hmapData.2.2.2.2.2.2.1 hxMap + exact (AffineSubspace.mem_map_iff_mem_of_injective hL).mp hxFirstMap + have hlineSecond : p.1 ≤ p.2.2 := by + intro x hx + have hxMap : L x ∈ p.1.map L := + AffineSubspace.mem_map_of_mem L hx + have hxSecondMap : L x ∈ p.2.2.map L := + hmapData.2.2.2.2.2.2.2.1 hxMap + exact (AffineSubspace.mem_map_iff_mem_of_injective hL).mp hxSecondMap + have hmapInf := goodWeightTwelveFlatTriple_inf_eq_line hpMap + have hmapInf' : p.2.1.map L ⊓ p.2.2.map L = p.1.map L := by + simpa only [weightTwelveFlatTripleMap] using hmapInf + have hinf : p.2.1 ⊓ p.2.2 = p.1 := by + apply affineSubspaceMap_injective L hL + rw [AffineSubspace.map_inf_eq L hL, hmapInf'] + obtain ⟨x, hxLine⟩ := + (AffineSubspace.nonempty_iff_ne_bot p.1).2 hlineNe + have hxInf : x ∈ p.2.1 ⊓ p.2.2 := by + rw [hinf] + exact hxLine + have hdirection : p.2.1.direction ⊓ p.2.2.direction = + p.1.direction := by + calc + p.2.1.direction ⊓ p.2.2.direction = + (p.2.1 ⊓ p.2.2).direction := + (AffineSubspace.direction_inf_of_mem_inf hxInf).symm + _ = p.1.direction := congrArg AffineSubspace.direction hinf + exact (mem_goodWeightTwelveFlatTriples_iff_geometry p).mpr + ⟨hlineNe, hlineRank, hfirstNe, hfirstRank, + hsecondNe, hsecondRank, hlineFirst, hlineSecond, hdirection⟩ + · intro hp + have hpData := (mem_goodWeightTwelveFlatTriples_iff_geometry p).mp hp + have hlineNe : p.1.map L ≠ ⊥ := by + intro hbot + exact hpData.1 ((AffineSubspace.map_eq_bot_iff (f := L)).mp hbot) + have hfirstNe : p.2.1.map L ≠ ⊥ := by + intro hbot + exact hpData.2.2.1 + ((AffineSubspace.map_eq_bot_iff (f := L)).mp hbot) + have hsecondNe : p.2.2.map L ≠ ⊥ := by + intro hbot + exact hpData.2.2.2.2.1 + ((AffineSubspace.map_eq_bot_iff (f := L)).mp hbot) + have hlineRank : Module.finrank FABL.𝔽₂ (p.1.map L).direction = 1 := by + rw [finrank_direction_map_eq_of_linear_injective L hlinear] + exact hpData.2.1 + have hfirstRank : Module.finrank FABL.𝔽₂ (p.2.1.map L).direction = 3 := by + rw [finrank_direction_map_eq_of_linear_injective L hlinear] + exact hpData.2.2.2.1 + have hsecondRank : Module.finrank FABL.𝔽₂ (p.2.2.map L).direction = 3 := by + rw [finrank_direction_map_eq_of_linear_injective L hlinear] + exact hpData.2.2.2.2.2.1 + have hlineFirst : p.1.map L ≤ p.2.1.map L := + AffineSubspace.map_mono L hpData.2.2.2.2.2.2.1 + have hlineSecond : p.1.map L ≤ p.2.2.map L := + AffineSubspace.map_mono L hpData.2.2.2.2.2.2.2.1 + have hsourceInf := goodWeightTwelveFlatTriple_inf_eq_line hp + have htargetInf : p.2.1.map L ⊓ p.2.2.map L = p.1.map L := by + rw [← AffineSubspace.map_inf_eq L hL, hsourceInf] + obtain ⟨x, hxLine⟩ := + (AffineSubspace.nonempty_iff_ne_bot p.1).2 hpData.1 + have hxTargetInf : L x ∈ p.2.1.map L ⊓ p.2.2.map L := by + rw [htargetInf] + exact AffineSubspace.mem_map_of_mem L hxLine + have hdirection : (p.2.1.map L).direction ⊓ + (p.2.2.map L).direction = (p.1.map L).direction := by + calc + (p.2.1.map L).direction ⊓ (p.2.2.map L).direction = + (p.2.1.map L ⊓ p.2.2.map L).direction := + (AffineSubspace.direction_inf_of_mem_inf hxTargetInf).symm + _ = (p.1.map L).direction := + congrArg AffineSubspace.direction htargetInf + exact (mem_goodWeightTwelveFlatTriples_iff_geometry + (weightTwelveFlatTripleMap L p)).mpr + ⟨hlineNe, hlineRank, hfirstNe, hfirstRank, + hsecondNe, hsecondRank, hlineFirst, hlineSecond, hdirection⟩ + +private theorem binaryAffineFlatIndicator_map_apply + {m n : ℕ} (L : FABL.F₂Cube m →ᵃ[FABL.𝔽₂] FABL.F₂Cube n) + (hL : Function.Injective L) + (A : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube m)) + (x : FABL.F₂Cube m) : + binaryAffineFlatIndicator (A.map L) (L x) = + binaryAffineFlatIndicator A x := by + classical + simp only [binaryAffineFlatIndicator, + AffineSubspace.mem_map_iff_mem_of_injective hL] + +private theorem weightTwelveRepresentationWord_map_apply + {m n : ℕ} (L : FABL.F₂Cube m →ᵃ[FABL.𝔽₂] FABL.F₂Cube n) + (hL : Function.Injective L) + (p : WeightTwelveFlatTriple m) (x : FABL.F₂Cube m) : + weightTwelveRepresentationWord (weightTwelveFlatTripleMap L p) (L x) = + weightTwelveRepresentationWord p x := by + simp only [weightTwelveRepresentationWord, weightTwelveFlatTripleMap, + Pi.add_apply] + rw [binaryAffineFlatIndicator_map_apply L hL, + binaryAffineFlatIndicator_map_apply L hL] + +private theorem affineSubspace_map_comap_eq_of_le_range + {m n : ℕ} (L : FABL.F₂Cube m →ᵃ[FABL.𝔽₂] FABL.F₂Cube n) + (A : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) + (hA : A ≤ (⊤ : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube m)).map L) : + (A.comap L).map L = A := by + apply le_antisymm (AffineSubspace.map_comap_le L A) + intro x hx + have hxRange := hA hx + rw [AffineSubspace.mem_map] at hxRange + obtain ⟨y, _hy, rfl⟩ := hxRange + exact AffineSubspace.mem_map_of_mem L + (show y ∈ A.comap L from hx) + +private theorem weightTwelveFlatTriple_map_comap_eq_of_le_range + {m n : ℕ} (L : FABL.F₂Cube m →ᵃ[FABL.𝔽₂] FABL.F₂Cube n) + (p : WeightTwelveFlatTriple n) + (hline : p.1 ≤ + (⊤ : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube m)).map L) + (hfirst : p.2.1 ≤ + (⊤ : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube m)).map L) + (hsecond : p.2.2 ≤ + (⊤ : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube m)).map L) : + weightTwelveFlatTripleMap L (weightTwelveFlatTripleComap L p) = p := by + apply Prod.ext + · exact affineSubspace_map_comap_eq_of_le_range L p.1 hline + · apply Prod.ext + · exact affineSubspace_map_comap_eq_of_le_range L p.2.1 hfirst + · exact affineSubspace_map_comap_eq_of_le_range L p.2.2 hsecond + +private theorem card_first_sdiff_line_eq_six + {p : WeightTwelveFlatTriple n} + (hp : p ∈ goodWeightTwelveFlatTriples n) : + (binaryAffineFlatPoints p.2.1 \ binaryAffineFlatPoints p.1).card = 6 := by + have hpData := goodWeightTwelveFlatTriple_geometry hp + have hsubset : binaryAffineFlatPoints p.1 ⊆ + binaryAffineFlatPoints p.2.1 := by + intro x hx + exact (mem_binaryAffineFlatPoints p.2.1 x).mpr + (hpData.2.2.2.2.2.2.1 + ((mem_binaryAffineFlatPoints p.1 x).mp hx)) + rw [Finset.card_sdiff_of_subset hsubset, + card_binaryAffineFlatPoints p.2.1 hpData.2.2.1, + card_binaryAffineFlatPoints p.1 hpData.1, + hpData.2.2.2.1, hpData.2.1] + norm_num + +private theorem card_second_sdiff_line_eq_six + {p : WeightTwelveFlatTriple n} + (hp : p ∈ goodWeightTwelveFlatTriples n) : + (binaryAffineFlatPoints p.2.2 \ binaryAffineFlatPoints p.1).card = 6 := by + have hpData := goodWeightTwelveFlatTriple_geometry hp + have hsubset : binaryAffineFlatPoints p.1 ⊆ + binaryAffineFlatPoints p.2.2 := by + intro x hx + exact (mem_binaryAffineFlatPoints p.2.2 x).mpr + (hpData.2.2.2.2.2.2.2.1 + ((mem_binaryAffineFlatPoints p.1 x).mp hx)) + rw [Finset.card_sdiff_of_subset hsubset, + card_binaryAffineFlatPoints p.2.2 hpData.2.2.2.2.1, + card_binaryAffineFlatPoints p.1 hpData.1, + hpData.2.2.2.2.2.1, hpData.2.1] + norm_num + +private theorem affineThreeFlat_le_of_six_points_subset + (F A : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) + (_hFne : F ≠ ⊥) + (hFrank : Module.finrank FABL.𝔽₂ F.direction = 3) + (s : Finset (FABL.F₂Cube n)) (hscard : s.card = 6) + (hsF : ∀ x ∈ s, x ∈ F) (hsA : ∀ x ∈ s, x ∈ A) : + F ≤ A := by + have hsNonempty : s.Nonempty := by + apply Finset.card_pos.mp + omega + obtain ⟨x, hx⟩ := hsNonempty + have hxInf : x ∈ F ⊓ A := + (AffineSubspace.mem_inf_iff x F A).mpr ⟨hsF x hx, hsA x hx⟩ + have hInfNe : F ⊓ A ≠ ⊥ := + (AffineSubspace.nonempty_iff_ne_bot _).mp ⟨x, hxInf⟩ + have hsInf : s ⊆ binaryAffineFlatPoints (F ⊓ A) := by + intro y hy + exact (mem_binaryAffineFlatPoints (F ⊓ A) y).mpr + ((AffineSubspace.mem_inf_iff y F A).mpr ⟨hsF y hy, hsA y hy⟩) + have hcardInf := card_binaryAffineFlatPoints (F ⊓ A) hInfNe + have hlower : 6 ≤ 2 ^ Module.finrank FABL.𝔽₂ (F ⊓ A).direction := by + rw [← hcardInf, ← hscard] + exact Finset.card_mono hsInf + have hdirectionLe : (F ⊓ A).direction ≤ F.direction := + AffineSubspace.direction_le inf_le_left + have hrankUpper : Module.finrank FABL.𝔽₂ (F ⊓ A).direction ≤ 3 := by + rw [← hFrank] + exact Submodule.finrank_mono hdirectionLe + have hrankInf : Module.finrank FABL.𝔽₂ (F ⊓ A).direction = 3 := by + interval_cases h : Module.finrank FABL.𝔽₂ (F ⊓ A).direction + all_goals norm_num [h] at hlower + all_goals omega + have hinfEq : F ⊓ A = F := by + apply (AffineSubspace.eq_iff_direction_eq_of_mem hxInf (hsF x hx)).2 + apply Submodule.eq_of_le_of_finrank_eq hdirectionLe + rw [hrankInf, hFrank] + rw [← hinfEq] + exact inf_le_right + +private theorem goodWeightTwelveFlatTriple_components_le_of_support_subset + (f : BooleanFunction n) + {p : WeightTwelveFlatTriple n} + (hp : p ∈ goodWeightTwelveFlatTriples n) + (hrepresentation : weightTwelveRepresentationWord p = f) + (A : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) + (hsupport : (support f : Set (FABL.F₂Cube n)) ⊆ A) : + p.1 ≤ A ∧ p.2.1 ≤ A ∧ p.2.2 ≤ A := by + have hpData := goodWeightTwelveFlatTriple_geometry hp + let firstAway := + binaryAffineFlatPoints p.2.1 \ binaryAffineFlatPoints p.1 + let secondAway := + binaryAffineFlatPoints p.2.2 \ binaryAffineFlatPoints p.1 + have hfirstCard : firstAway.card = 6 := + card_first_sdiff_line_eq_six hp + have hsecondCard : secondAway.card = 6 := + card_second_sdiff_line_eq_six hp + have hfirstF : ∀ x ∈ firstAway, x ∈ p.2.1 := by + intro x hx + exact (mem_binaryAffineFlatPoints p.2.1 x).mp + (Finset.mem_sdiff.mp hx).1 + have hsecondF : ∀ x ∈ secondAway, x ∈ p.2.2 := by + intro x hx + exact (mem_binaryAffineFlatPoints p.2.2 x).mp + (Finset.mem_sdiff.mp hx).1 + have hfirstA : ∀ x ∈ firstAway, x ∈ A := by + intro x hx + have hxData := Finset.mem_sdiff.mp hx + have hxFirst := (mem_binaryAffineFlatPoints p.2.1 x).mp hxData.1 + have hxNotLine : x ∉ p.1 := fun hxLine ↦ hxData.2 + ((mem_binaryAffineFlatPoints p.1 x).mpr hxLine) + have hxWord : weightTwelveRepresentationWord p x = 1 := + ((mem_first_or_second_iff_representation_one_or_line hp x).mp + (Or.inl hxFirst)).resolve_right hxNotLine + apply hsupport + apply (mem_support f x).mpr + rw [← hrepresentation] + exact hxWord + have hsecondA : ∀ x ∈ secondAway, x ∈ A := by + intro x hx + have hxData := Finset.mem_sdiff.mp hx + have hxSecond := (mem_binaryAffineFlatPoints p.2.2 x).mp hxData.1 + have hxNotLine : x ∉ p.1 := fun hxLine ↦ hxData.2 + ((mem_binaryAffineFlatPoints p.1 x).mpr hxLine) + have hxWord : weightTwelveRepresentationWord p x = 1 := + ((mem_first_or_second_iff_representation_one_or_line hp x).mp + (Or.inr hxSecond)).resolve_right hxNotLine + apply hsupport + apply (mem_support f x).mpr + rw [← hrepresentation] + exact hxWord + have hfirstLe : p.2.1 ≤ A := + affineThreeFlat_le_of_six_points_subset p.2.1 A + hpData.2.2.1 hpData.2.2.2.1 firstAway hfirstCard hfirstF hfirstA + have hsecondLe : p.2.2 ≤ A := + affineThreeFlat_le_of_six_points_subset p.2.2 A + hpData.2.2.2.2.1 hpData.2.2.2.2.2.1 + secondAway hsecondCard hsecondF hsecondA + exact ⟨hpData.2.2.2.2.2.2.1.trans hfirstLe, hfirstLe, hsecondLe⟩ + +set_option maxRecDepth 2000 in +theorem card_weightTwelveRepresentationFiber_eq_twenty_of_five_le + (n : ℕ) (hn : 5 ≤ n) + (f : BooleanFunction n) + (hf : f ∈ orderTwoWeightTwelveDualWords n) : + ((goodWeightTwelveFlatTriples n).filter fun p ↦ + weightTwelveRepresentationWord p = f).card = 20 := by + classical + have hfData : f ∈ reedMuller (n - 3) n ∧ hammingWeight f = 12 := by + simpa only [orderTwoWeightTwelveDualWords, orderTwoDualWords, + Finset.mem_filter, Finset.mem_univ, true_and] using hf + have hsupportCard : (support f).card = 12 := by + simpa only [hammingWeight_eq_card_support] using hfData.2 + have hsupportNonempty : (support f).Nonempty := by + apply Finset.card_pos.mp + omega + obtain ⟨u, hu⟩ := hsupportNonempty + let E := supportDifferenceSpan f u + have hErank : Module.finrank FABL.𝔽₂ E ≤ 5 := by + exact finrank_supportDifferenceSpan_le_five_of_weight_twelve + f u hu (by omega) hfData.1 hfData.2 + have hambientRank : Module.finrank FABL.𝔽₂ (FABL.F₂Cube n) = n := by + rw [Module.finrank_fintype_fun_eq_card] + simp + obtain ⟨H, hEH, hHrank⟩ := exists_superSubmodule_finrank_eq E 5 + hErank (by rw [hambientRank]; exact hn) + let e : FABL.F₂Cube 5 ≃ₗ[FABL.𝔽₂] H := + LinearEquiv.ofFinrankEq _ _ (by + rw [Module.finrank_fintype_fun_eq_card, hHrank] + simp) + let L := weightTwelveFiveFlatEmbedding u H e + let g := weightTwelveFiveFlatRestriction f u H e + let localFiber := (goodWeightTwelveFlatTriples 5).filter fun p ↦ + weightTwelveRepresentationWord p = g + let ambientFiber := (goodWeightTwelveFlatTriples n).filter fun p ↦ + weightTwelveRepresentationWord p = f + have hLinj : Function.Injective L := by + exact weightTwelveFiveFlatEmbedding_injective u H e + have hLlinear : Function.Injective L.linear := by + change Function.Injective (weightTwelveFiveFlatLinearEmbedding H e) + exact weightTwelveFiveFlatLinearEmbedding_injective H e + have hsupportRange : (support f : Set (FABL.F₂Cube n)) ⊆ + (⊤ : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube 5)).map L := by + intro x hx + have hxE := support_subset_binaryAffineSubspace_supportDifferenceSpan + f u hx + change x ∈ FABL.binaryAffineSubspace E u at hxE + rw [FABL.mem_binaryAffineSubspace_iff_add_mem] at hxE + change x ∈ + (⊤ : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube 5)).map L + rw [AffineSubspace.mem_map] + let y : FABL.F₂Cube 5 := e.symm ⟨x + u, hEH hxE⟩ + refine ⟨y, by simp, ?_⟩ + change u + (e y : FABL.F₂Cube n) = x + rw [show e y = (⟨x + u, hEH hxE⟩ : H) by + exact e.apply_symm_apply _] + change u + (x + u) = x + calc + u + (x + u) = (u + u) + x := by abel + _ = x := by rw [ZModModule.add_self, zero_add] + have hgMem : g ∈ reedMuller 2 5 := by + exact weightTwelveFiveFlatRestriction_mem_reedMuller_two + f hn hfData.1 u H e hsupportRange + have hgWeight : hammingWeight g = 12 := by + exact (hammingWeight_weightTwelveFiveFlatRestriction + f u H e hsupportRange).trans hfData.2 + have hg : g ∈ orderTwoWeightTwelveDualWords 5 := by + simp only [orderTwoWeightTwelveDualWords, orderTwoDualWords, + Finset.mem_filter, Finset.mem_univ, true_and] + exact ⟨hgMem, hgWeight⟩ + have hlocalCard : localFiber.card = 20 := by + exact card_weightTwelveRepresentationFiber_eq_twenty_of_mem g hg + have hforward : (localFiber : Set (WeightTwelveFlatTriple 5)).MapsTo + (weightTwelveFlatTripleMap L) ambientFiber := by + intro p hp + have hpData := Finset.mem_filter.mp hp + apply Finset.mem_filter.mpr + constructor + · exact (weightTwelveFlatTripleMap_mem_good_iff + L hLinj hLlinear p).mpr hpData.1 + · funext x + by_cases hxRange : x ∈ + (⊤ : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube 5)).map L + · rw [AffineSubspace.mem_map] at hxRange + obtain ⟨y, _hy, rfl⟩ := hxRange + rw [weightTwelveRepresentationWord_map_apply L hLinj, + hpData.2] + rfl + · have hxFirst : x ∉ p.2.1.map L := by + intro hx + exact hxRange (AffineSubspace.map_mono L le_top hx) + have hxSecond : x ∉ p.2.2.map L := by + intro hx + exact hxRange (AffineSubspace.map_mono L le_top hx) + have hxZero : f x = 0 := by + by_contra hxNe + have hxOne : f x = 1 := Fin.eq_one_of_ne_zero _ hxNe + exact hxRange (hsupportRange ((mem_support f x).mpr hxOne)) + simp only [weightTwelveRepresentationWord, + weightTwelveFlatTripleMap, Pi.add_apply, + binaryAffineFlatIndicator, if_neg hxFirst, if_neg hxSecond, + zero_add, hxZero] + have hforwardInj : Set.InjOn (weightTwelveFlatTripleMap L) + (localFiber : Set (WeightTwelveFlatTriple 5)) := + (weightTwelveFlatTripleMap_injective L hLinj).injOn + have hlocalLeAmbient : localFiber.card ≤ ambientFiber.card := + Finset.card_le_card_of_injOn (weightTwelveFlatTripleMap L) + hforward hforwardInj + have hbackward : (ambientFiber : Set (WeightTwelveFlatTriple n)).MapsTo + (weightTwelveFlatTripleComap L) localFiber := by + intro p hp + have hpData := Finset.mem_filter.mp hp + obtain ⟨hline, hfirst, hsecond⟩ := + goodWeightTwelveFlatTriple_components_le_of_support_subset + f hpData.1 hpData.2 + ((⊤ : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube 5)).map L) + hsupportRange + let q := weightTwelveFlatTripleComap L p + have hmapq : weightTwelveFlatTripleMap L q = p := + weightTwelveFlatTriple_map_comap_eq_of_le_range + L p hline hfirst hsecond + apply Finset.mem_filter.mpr + constructor + · apply (weightTwelveFlatTripleMap_mem_good_iff + L hLinj hLlinear q).mp + rw [hmapq] + exact hpData.1 + · funext y + rw [← weightTwelveRepresentationWord_map_apply L hLinj q y, + hmapq, hpData.2] + rfl + have hbackwardInj : Set.InjOn (weightTwelveFlatTripleComap L) + (ambientFiber : Set (WeightTwelveFlatTriple n)) := by + intro p hp q hq hpq + have hpData := Finset.mem_filter.mp hp + have hqData := Finset.mem_filter.mp hq + obtain ⟨hpLine, hpFirst, hpSecond⟩ := + goodWeightTwelveFlatTriple_components_le_of_support_subset + f hpData.1 hpData.2 + ((⊤ : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube 5)).map L) + hsupportRange + obtain ⟨hqLine, hqFirst, hqSecond⟩ := + goodWeightTwelveFlatTriple_components_le_of_support_subset + f hqData.1 hqData.2 + ((⊤ : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube 5)).map L) + hsupportRange + have hpInverse := weightTwelveFlatTriple_map_comap_eq_of_le_range + L p hpLine hpFirst hpSecond + have hqInverse := weightTwelveFlatTriple_map_comap_eq_of_le_range + L q hqLine hqFirst hqSecond + rw [← hpInverse, ← hqInverse, hpq] + have hambientLeLocal : ambientFiber.card ≤ localFiber.card := + Finset.card_le_card_of_injOn (weightTwelveFlatTripleComap L) + hbackward hbackwardInj + have hcard : ambientFiber.card = localFiber.card := + Nat.le_antisymm hambientLeLocal hlocalLeAmbient + exact hcard.trans hlocalCard + +theorem hasWeightTwelveFlatPairClassification + (n : ℕ) (hn : 5 ≤ n) : + HasWeightTwelveFlatPairClassification n := by + intro f + by_cases hf : f ∈ orderTwoWeightTwelveDualWords n + · rw [if_pos hf] + exact card_weightTwelveRepresentationFiber_eq_twenty_of_five_le + n hn f hf + · rw [if_neg hf] + exact card_weightTwelveRepresentationFiber_eq_zero_of_not_mem f hf + +end CryptBoolean diff --git a/CryptBoolean/Carlet/Chapter04/HigherOrderSharpAsymptotics.lean b/CryptBoolean/Carlet/Chapter04/HigherOrderSharpAsymptotics.lean new file mode 100644 index 0000000..93e8609 --- /dev/null +++ b/CryptBoolean/Carlet/Chapter04/HigherOrderSharpAsymptotics.lean @@ -0,0 +1,77 @@ +/- +Copyright (c) 2026 Asher Yan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Asher Yan with Codex +-/ +module + +public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoMomentDifference +public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoAsymptotics +public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightTwelveClassification +public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightFourteenClassification + +/-! +# Sharp higher-order nonlinearity asymptotics + +The final composition layer of the Carlet--Mesnager argument. A uniform +`q⁷` lower bound for the weight-sixteen dual character sum combines with +the exact weight-twelve and weight-fourteen classifications, the +seventh/eighth moment comparison, and Plotkin propagation. +-/ + +open scoped BigOperators BooleanCube + +@[expose] public section + +namespace CryptBoolean + +/-- The dimension-free loss contributed by the three rank-seven orbits and +the rank-at-most-six residual cover. -/ +def orderTwoWeightSixteenCharacterLoss : ℝ := + 3 * 127 + 127 * 2 ^ 128 + +/-- The resulting uniform constant in the seventh/eighth moment difference. -/ +def orderTwoMomentDifferenceLoss : ℝ := + 133000020000000 + + 21000000000000 * orderTwoWeightSixteenCharacterLoss + +/-- A uniform weight-sixteen character-sum estimate closes the sharp +Carlet--Mesnager upper bound in every fixed order. -/ +theorem exists_maximumHigherOrderNonlinearity_cast_le_of_weightSixteenCharacterSum + (hweightSixteen : ∀ {n : ℕ} (f : BooleanFunction n), 7 ≤ n → + -orderTwoWeightSixteenCharacterLoss * ((2 : ℝ) ^ n) ^ 7 ≤ + orderTwoWeightSixteenCharacterSum f) + (r : ℕ) (hr : 2 ≤ r) : + ∃ D : ℝ, 0 ≤ D ∧ ∀ n : ℕ, r ≤ n → + (maximumHigherOrderNonlinearity r n : ℝ) ≤ + (2 : ℝ) ^ n / 2 - + ((Real.sqrt 15 / 2) * + (1 + Real.sqrt 2) ^ (r - 2)) * + (Real.sqrt 2) ^ n + + D * (n + 1 : ℝ) ^ (r - 2) := by + apply exists_maximumHigherOrderNonlinearity_cast_le_of_card_scaled_moment_difference + orderTwoMomentDifferenceLoss (by + unfold orderTwoMomentDifferenceLoss orderTwoWeightSixteenCharacterLoss + positivity) _ r hr + filter_upwards [Filter.eventually_ge_atTop 7] with n hn + intro f + have hdifference := + orderTwoCorrelationPowerSum_difference_ge_of_weightSixteenCharacterSum + f hn (hasWeightTwelveFlatPairClassification n (by omega)) + (hasWeightFourteenFlatPairClassification n) + orderTwoWeightSixteenCharacterLoss (by + unfold orderTwoWeightSixteenCharacterLoss + positivity) + (hweightSixteen f hn) + have hconverted := (le_sub_iff_add_le).mp hdifference + calc + 15 * (2 : ℝ) ^ n * orderTwoCorrelationPowerSum 7 f - + orderTwoMomentDifferenceLoss * + ((Nat.card (reedMuller 2 n) : ℝ) * ((2 : ℝ) ^ n) ^ 7) = + (-orderTwoMomentDifferenceLoss) * + ((Nat.card (reedMuller 2 n) : ℝ) * ((2 : ℝ) ^ n) ^ 7) + + 15 * (2 : ℝ) ^ n * orderTwoCorrelationPowerSum 7 f := by ring + _ ≤ orderTwoCorrelationPowerSum 8 f := by + simpa only [orderTwoMomentDifferenceLoss] using hconverted + +end CryptBoolean diff --git a/CryptBoolean/Carlet/Chapter04/HigherOrderTupleCountDifferences.lean b/CryptBoolean/Carlet/Chapter04/HigherOrderTupleCountDifferences.lean new file mode 100644 index 0000000..9a3b9e2 --- /dev/null +++ b/CryptBoolean/Carlet/Chapter04/HigherOrderTupleCountDifferences.lean @@ -0,0 +1,309 @@ +/- +Copyright (c) 2026 Asher Yan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Asher Yan with Codex +-/ +module + +public import CryptBoolean.Carlet.Chapter04.HigherOrderTupleCounts + +/-! +# Consecutive tuple-count differences + +Exact coefficients and dimension-free polynomial bounds for the seventh and +eighth moments in the Carlet--Mesnager argument. +-/ + +open scoped BooleanCube + +@[expose] public section + +namespace CryptBoolean + +/-- The coefficient of a dual word of weight `w` in +`S₈(f) - 15 · 2ⁿ · S₇(f)` after the common Reed--Muller cardinality is +factored out. -/ +noncomputable def tuplePointParityMomentDifference (n w : ℕ) : ℝ := + (tuplePointParityMultiplicityByWeight 8 n w : ℝ) - + 15 * (2 : ℝ) ^ n * + (tuplePointParityMultiplicityByWeight 7 n w : ℝ) + +private theorem two_pow_mul_eq_pow_two_pow (n k : ℕ) : + (2 : ℝ) ^ (k * n) = ((2 : ℝ) ^ n) ^ k := by + rw [mul_comm, ← pow_mul] + +/-- Exact null-word coefficient in the seventh/eighth moment difference. -/ +theorem tuplePointParityMomentDifference_zero + (n : ℕ) (hn : 4 ≤ n) : + tuplePointParityMomentDifference n 0 = + -9459450 * ((2 : ℝ) ^ n) ^ 7 + + 139999860 * ((2 : ℝ) ^ n) ^ 6 - + 877476600 * ((2 : ℝ) ^ n) ^ 5 + + 2931168240 * ((2 : ℝ) ^ n) ^ 4 - + 5409855360 * ((2 : ℝ) ^ n) ^ 3 + + 5129380608 * ((2 : ℝ) ^ n) ^ 2 - + 1903757312 * (2 : ℝ) ^ n := by + have hsevenInt := tuplePointParityMultiplicityByWeight_seven_zero n hn + have heightInt := tuplePointParityMultiplicityByWeight_eight_zero n hn + have hseven : + (tuplePointParityMultiplicityByWeight 7 n 0 : ℝ) = + 135135 * (2 : ℝ) ^ (7 * n) - + 1891890 * (2 : ℝ) ^ (6 * n) + + 11351340 * (2 : ℝ) ^ (5 * n) - + 36636600 * (2 : ℝ) ^ (4 * n) + + 65825760 * (2 : ℝ) ^ (3 * n) - + 61152000 * (2 : ℝ) ^ (2 * n) + + 22368256 * (2 : ℝ) ^ n := by + exact_mod_cast hsevenInt + have height : + (tuplePointParityMultiplicityByWeight 8 n 0 : ℝ) = + 2027025 * (2 : ℝ) ^ (8 * n) - + 37837800 * (2 : ℝ) ^ (7 * n) + + 310269960 * (2 : ℝ) ^ (6 * n) - + 1427025600 * (2 : ℝ) ^ (5 * n) + + 3918554640 * (2 : ℝ) ^ (4 * n) - + 6327135360 * (2 : ℝ) ^ (3 * n) + + 5464904448 * (2 : ℝ) ^ (2 * n) - + 1903757312 * (2 : ℝ) ^ n := by + exact_mod_cast heightInt + unfold tuplePointParityMomentDifference + rw [hseven, height] + simp_rw [two_pow_mul_eq_pow_two_pow n] + ring + +/-- Exact weight-eight coefficient in the seventh/eighth moment difference. -/ +theorem tuplePointParityMomentDifference_eight + (n : ℕ) (hn : 4 ≤ n) : + tuplePointParityMomentDifference n 8 = + 27243216000 * ((2 : ℝ) ^ n) ^ 4 - + 889945056000 * ((2 : ℝ) ^ n) ^ 3 + + 10504984089600 * ((2 : ℝ) ^ n) ^ 2 - + 54385415884800 * (2 : ℝ) ^ n + + 105309161717760 := by + have hsevenInt := tuplePointParityMultiplicityByWeight_seven_eight n hn + have heightInt := tuplePointParityMultiplicityByWeight_eight_eight n hn + have hseven : + (tuplePointParityMultiplicityByWeight 7 n 8 : ℝ) = + 1816214400 * (2 : ℝ) ^ (3 * n) - + 32691859200 * (2 : ℝ) ^ (2 * n) + + 203416012800 * (2 : ℝ) ^ n - 435430195200 := by + exact_mod_cast hsevenInt + have height : + (tuplePointParityMultiplicityByWeight 8 n 8 : ℝ) = + 54486432000 * (2 : ℝ) ^ (4 * n) - + 1380322944000 * (2 : ℝ) ^ (3 * n) + + 13556224281600 * (2 : ℝ) ^ (2 * n) - + 60916868812800 * (2 : ℝ) ^ n + 105309161717760 := by + exact_mod_cast heightInt + unfold tuplePointParityMomentDifference + rw [hseven, height] + simp_rw [two_pow_mul_eq_pow_two_pow n] + ring + +/-- Exact weight-twelve coefficient in the seventh/eighth moment +difference. -/ +theorem tuplePointParityMomentDifference_twelve + (n : ℕ) (hn : 4 ≤ n) : + tuplePointParityMomentDifference n 12 = + 1961511552000 * ((2 : ℝ) ^ n) ^ 2 - + 38358448128000 * (2 : ℝ) ^ n + + 186910256332800 := by + have hsevenInt := tuplePointParityMultiplicityByWeight_seven_twelve n hn + have heightInt := tuplePointParityMultiplicityByWeight_eight_twelve n hn + have hseven : + (tuplePointParityMultiplicityByWeight 7 n 12 : ℝ) = + 43589145600 * (2 : ℝ) ^ n - 348713164800 := by + exact_mod_cast hsevenInt + have height : + (tuplePointParityMultiplicityByWeight 8 n 12 : ℝ) = + 2615348736000 * (2 : ℝ) ^ (2 * n) - + 43589145600000 * (2 : ℝ) ^ n + 186910256332800 := by + exact_mod_cast heightInt + unfold tuplePointParityMomentDifference + rw [hseven, height] + simp_rw [two_pow_mul_eq_pow_two_pow n] + ring + +/-- Exact weight-fourteen coefficient in the seventh/eighth moment +difference. -/ +theorem tuplePointParityMomentDifference_fourteen + (n : ℕ) (hn : 4 ≤ n) : + tuplePointParityMomentDifference n 14 = + 9153720576000 * (2 : ℝ) ^ n - 97639686144000 := by + have hsevenInt := tuplePointParityMultiplicityByWeight_seven_fourteen n hn + have heightInt := tuplePointParityMultiplicityByWeight_eight_fourteen n hn + have hseven : + (tuplePointParityMultiplicityByWeight 7 n 14 : ℝ) = + 87178291200 := by + exact_mod_cast hsevenInt + have height : + (tuplePointParityMultiplicityByWeight 8 n 14 : ℝ) = + 10461394944000 * (2 : ℝ) ^ n - 97639686144000 := by + exact_mod_cast heightInt + unfold tuplePointParityMomentDifference + rw [hseven, height] + ring + +/-- Exact weight-sixteen coefficient in the seventh/eighth moment +difference. -/ +theorem tuplePointParityMomentDifference_sixteen + (n : ℕ) (hn : 4 ≤ n) : + tuplePointParityMomentDifference n 16 = 20922789888000 := by + rw [tuplePointParityMomentDifference, + tuplePointParityMultiplicityByWeight_seven_sixteen n hn] + norm_num only [Nat.cast_zero, mul_zero, sub_zero] + exact_mod_cast tuplePointParityMultiplicityByWeight_eight_sixteen n hn + +/-- The null-word coefficient has magnitude `O((2^n)^7)` in the direction +needed for the lower moment bound. -/ +theorem tuplePointParityMomentDifference_zero_ge + (n : ℕ) (hn : 7 ≤ n) : + tuplePointParityMomentDifference n 0 ≥ + -20000000 * ((2 : ℝ) ^ n) ^ 7 := by + rw [tuplePointParityMomentDifference_zero n (by omega)] + have hq : (128 : ℝ) ≤ (2 : ℝ) ^ n := by + have hpowNat : (2 : ℕ) ^ 7 ≤ 2 ^ n := + Nat.pow_le_pow_right (by norm_num) hn + norm_num at hpowNat + exact_mod_cast hpowNat + let t : ℝ := (2 : ℝ) ^ n - 128 + have ht : 0 ≤ t := by dsimp only [t]; linarith + have hidentity : + (-9459450 * ((2 : ℝ) ^ n) ^ 7 + + 139999860 * ((2 : ℝ) ^ n) ^ 6 - + 877476600 * ((2 : ℝ) ^ n) ^ 5 + + 2931168240 * ((2 : ℝ) ^ n) ^ 4 - + 5409855360 * ((2 : ℝ) ^ n) ^ 3 + + 5129380608 * ((2 : ℝ) ^ n) ^ 2 - + 1903757312 * (2 : ℝ) ^ n) + + 20000000 * ((2 : ℝ) ^ n) ^ 7 = + 10540550 * t ^ 7 + 9584332660 * t ^ 6 + + 3733266211080 * t ^ 5 + 807527454713840 * t ^ 4 + + 104760756411041920 * t ^ 3 + + 8151179294477968128 * t ^ 2 + + 352213550106363426816 * t + + 6520153728953236586496 := by + dsimp only [t] + ring + have hnonneg : + 0 ≤ 10540550 * t ^ 7 + 9584332660 * t ^ 6 + + 3733266211080 * t ^ 5 + 807527454713840 * t ^ 4 + + 104760756411041920 * t ^ 3 + + 8151179294477968128 * t ^ 2 + + 352213550106363426816 * t + + 6520153728953236586496 := by positivity + linarith + +/-- The weight-eight coefficient is nonnegative and at most a fixed multiple +of `(2^n)^4`. -/ +theorem tuplePointParityMomentDifference_eight_bounds + (n : ℕ) (hn : 7 ≤ n) : + 0 ≤ tuplePointParityMomentDifference n 8 ∧ + tuplePointParityMomentDifference n 8 ≤ + 120000000000000 * ((2 : ℝ) ^ n) ^ 4 := by + rw [tuplePointParityMomentDifference_eight n (by omega)] + have hq : (128 : ℝ) ≤ (2 : ℝ) ^ n := by + have hpowNat : (2 : ℕ) ^ 7 ≤ 2 ^ n := + Nat.pow_le_pow_right (by norm_num) hn + norm_num at hpowNat + exact_mod_cast hpowNat + let t : ℝ := (2 : ℝ) ^ n - 128 + have ht : 0 ≤ t := by dsimp only [t]; linarith + constructor + · have hidentity : + 27243216000 * ((2 : ℝ) ^ n) ^ 4 - + 889945056000 * ((2 : ℝ) ^ n) ^ 3 + + 10504984089600 * ((2 : ℝ) ^ n) ^ 2 - + 54385415884800 * (2 : ℝ) ^ n + + 105309161717760 = + 27243216000 * t ^ 4 + 13058581536000 * t ^ 3 + + 2346883188249600 * t ^ 2 + + 187424970801868800 * t + + 5611952691038453760 := by + dsimp only [t] + ring + rw [hidentity] + positivity + · have hidentity : + 120000000000000 * ((2 : ℝ) ^ n) ^ 4 - + (27243216000 * ((2 : ℝ) ^ n) ^ 4 - + 889945056000 * ((2 : ℝ) ^ n) ^ 3 + + 10504984089600 * ((2 : ℝ) ^ n) ^ 2 - + 54385415884800 * (2 : ℝ) ^ n + + 105309161717760) = + 119972756784000 * t ^ 4 + 61426941418464000 * t ^ 3 + + 11794133116811750400 * t ^ 2 + + 1006445535029198131200 * t + + 32206642767308961546240 := by + dsimp only [t] + ring + have hnonneg : + 0 ≤ 119972756784000 * t ^ 4 + 61426941418464000 * t ^ 3 + + 11794133116811750400 * t ^ 2 + + 1006445535029198131200 * t + + 32206642767308961546240 := by positivity + linarith + +/-- The weight-twelve coefficient is nonnegative and at most a fixed +multiple of `(2^n)^2`. -/ +theorem tuplePointParityMomentDifference_twelve_bounds + (n : ℕ) (hn : 7 ≤ n) : + 0 ≤ tuplePointParityMomentDifference n 12 ∧ + tuplePointParityMomentDifference n 12 ≤ + 3000000000000 * ((2 : ℝ) ^ n) ^ 2 := by + rw [tuplePointParityMomentDifference_twelve n (by omega)] + have hq : (128 : ℝ) ≤ (2 : ℝ) ^ n := by + have hpowNat : (2 : ℕ) ^ 7 ≤ 2 ^ n := + Nat.pow_le_pow_right (by norm_num) hn + norm_num at hpowNat + exact_mod_cast hpowNat + let t : ℝ := (2 : ℝ) ^ n - 128 + have ht : 0 ≤ t := by dsimp only [t]; linarith + constructor + · have hidentity : + 1961511552000 * ((2 : ℝ) ^ n) ^ 2 - + 38358448128000 * (2 : ℝ) ^ n + 186910256332800 = + 1961511552000 * t ^ 2 + 463788509184000 * t + + 27414434163916800 := by + dsimp only [t] + ring + rw [hidentity] + positivity + · have hidentity : + 3000000000000 * ((2 : ℝ) ^ n) ^ 2 - + (1961511552000 * ((2 : ℝ) ^ n) ^ 2 - + 38358448128000 * (2 : ℝ) ^ n + 186910256332800) = + 1038488448000 * t ^ 2 + 304211490816000 * t + + 21737565836083200 := by + dsimp only [t] + ring + have hnonneg : + 0 ≤ 1038488448000 * t ^ 2 + 304211490816000 * t + + 21737565836083200 := by positivity + linarith + +/-- The weight-fourteen coefficient is nonnegative and at most a fixed +multiple of `2^n`. -/ +theorem tuplePointParityMomentDifference_fourteen_bounds + (n : ℕ) (hn : 7 ≤ n) : + 0 ≤ tuplePointParityMomentDifference n 14 ∧ + tuplePointParityMomentDifference n 14 ≤ + 10000000000000 * (2 : ℝ) ^ n := by + rw [tuplePointParityMomentDifference_fourteen n (by omega)] + have hq : (128 : ℝ) ≤ (2 : ℝ) ^ n := by + have hpowNat : (2 : ℕ) ^ 7 ≤ 2 ^ n := + Nat.pow_le_pow_right (by norm_num) hn + norm_num at hpowNat + exact_mod_cast hpowNat + constructor <;> nlinarith + +/-- The weight-sixteen coefficient is positive and bounded by a fixed +constant. -/ +theorem tuplePointParityMomentDifference_sixteen_bounds + (n : ℕ) (hn : 7 ≤ n) : + 0 ≤ tuplePointParityMomentDifference n 16 ∧ + tuplePointParityMomentDifference n 16 ≤ 21000000000000 := by + rw [tuplePointParityMomentDifference_sixteen n (by omega)] + norm_num + +end CryptBoolean diff --git a/CryptBoolean/Carlet/Chapter04/HigherOrderTupleCounts.lean b/CryptBoolean/Carlet/Chapter04/HigherOrderTupleCounts.lean new file mode 100644 index 0000000..ee7be96 --- /dev/null +++ b/CryptBoolean/Carlet/Chapter04/HigherOrderTupleCounts.lean @@ -0,0 +1,966 @@ +/- +Copyright (c) 2026 Asher Yan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Asher Yan with Codex +-/ +module + +public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwo +public import FABL.Chapter06.F₂Polynomials.Interpolation + +/-! +# Exact tuple counts for the second-order moment argument + +The two-point recurrence and the instances of Carlet--Mesnager Corollary 9.2.8 +needed for the consecutive seventh and eighth moments. +-/ + +open Finset +open scoped BigOperators BooleanCube + +@[expose] public section + +namespace CryptBoolean + +variable {n m l k : ℕ} + +private theorem tuplePointParity_append + (x : Fin m → FABL.F₂Cube n) (y : Fin l → FABL.F₂Cube n) : + tuplePointParity (Fin.append x y) = + tuplePointParity x + tuplePointParity y := by + classical + funext z + simp only [tuplePointParity, Pi.add_apply] + rw [Fin.sum_univ_add] + simp only [Fin.append_left, Fin.append_right] + +private theorem tuplePointParity_pair + (a b : FABL.F₂Cube n) : + tuplePointParity ![a, b] = + FABL.f₂PointIndicator a + FABL.f₂PointIndicator b := by + classical + funext z + simp only [tuplePointParity, Pi.add_apply, Fin.sum_univ_two] + simp [FABL.f₂PointIndicator_eq_ite, eq_comm] + +private theorem tuplePointParity_append_pair + (x : Fin (2 * k) → FABL.F₂Cube n) (a b : FABL.F₂Cube n) : + tuplePointParity (Fin.append x ![a, b]) = + tuplePointParity x + FABL.f₂PointIndicator a + + FABL.f₂PointIndicator b := by + rw [tuplePointParity_append, tuplePointParity_pair] + ac_rfl + +private theorem tuplePointParity_append_pair_eq_iff + (x : Fin (2 * k) → FABL.F₂Cube n) (a b : FABL.F₂Cube n) + (h : BooleanFunction n) : + tuplePointParity (Fin.append x ![a, b]) = h ↔ + tuplePointParity x = + h + FABL.f₂PointIndicator a + FABL.f₂PointIndicator b := by + rw [tuplePointParity_append_pair] + constructor + · intro heq + rw [← heq] + funext z + simp only [Pi.add_apply] + calc + tuplePointParity x z = tuplePointParity x z + + (FABL.f₂PointIndicator a z + FABL.f₂PointIndicator a z) + + (FABL.f₂PointIndicator b z + FABL.f₂PointIndicator b z) := by + rw [CharTwo.add_self_eq_zero, CharTwo.add_self_eq_zero, add_zero, + add_zero] + _ = tuplePointParity x z + FABL.f₂PointIndicator a z + + FABL.f₂PointIndicator b z + FABL.f₂PointIndicator a z + + FABL.f₂PointIndicator b z := by abel + · intro heq + rw [heq] + funext z + simp only [Pi.add_apply] + calc + h z + FABL.f₂PointIndicator a z + FABL.f₂PointIndicator b z + + FABL.f₂PointIndicator a z + FABL.f₂PointIndicator b z = + h z + + (FABL.f₂PointIndicator a z + FABL.f₂PointIndicator a z) + + (FABL.f₂PointIndicator b z + FABL.f₂PointIndicator b z) := by abel + _ = h z := by + rw [CharTwo.add_self_eq_zero, CharTwo.add_self_eq_zero, add_zero, + add_zero] + +private theorem tuplePointParityMultiplicity_eq_sum_indicator + (k : ℕ) (h : BooleanFunction n) : + tuplePointParityMultiplicity k h = + ∑ x : Fin (2 * k) → FABL.F₂Cube n, + if tuplePointParity x = h then 1 else 0 := by + classical + simp [tuplePointParityMultiplicity, tuplePointParityFiber] + +/-- Appending two entries expresses a point-parity fiber as the sum of the +fibers obtained by toggling the two selected points. -/ +theorem tuplePointParityMultiplicity_succ + (k : ℕ) (h : BooleanFunction n) : + tuplePointParityMultiplicity (k + 1) h = + ∑ a : FABL.F₂Cube n, ∑ b : FABL.F₂Cube n, + tuplePointParityMultiplicity k + (h + FABL.f₂PointIndicator a + FABL.f₂PointIndicator b) := by + classical + rw [tuplePointParityMultiplicity_eq_sum_indicator] + calc + (∑ z : Fin (2 * k + 2) → FABL.F₂Cube n, + if tuplePointParity z = h then 1 else 0) = + ∑ p : (Fin (2 * k) → FABL.F₂Cube n) × + (Fin 2 → FABL.F₂Cube n), + if tuplePointParity (Fin.append p.1 p.2) = h then 1 else 0 := by + exact (Fintype.sum_equiv (Fin.appendEquiv (2 * k) 2) + (fun p ↦ if tuplePointParity (Fin.append p.1 p.2) = h then 1 else 0) + (fun z ↦ if tuplePointParity z = h then 1 else 0) + (fun _ ↦ rfl)).symm + _ = ∑ x : Fin (2 * k) → FABL.F₂Cube n, + ∑ y : Fin 2 → FABL.F₂Cube n, + if tuplePointParity (Fin.append x y) = h then 1 else 0 := by + rw [Fintype.sum_prod_type] + _ = ∑ x : Fin (2 * k) → FABL.F₂Cube n, + ∑ a : FABL.F₂Cube n, ∑ b : FABL.F₂Cube n, + if tuplePointParity (Fin.append x ![a, b]) = h then 1 else 0 := by + apply Finset.sum_congr rfl + intro x _hx + calc + (∑ y : Fin 2 → FABL.F₂Cube n, + if tuplePointParity (Fin.append x y) = h then 1 else 0) = + ∑ p : FABL.F₂Cube n × FABL.F₂Cube n, + if tuplePointParity (Fin.append x ![p.1, p.2]) = h then 1 else 0 := by + exact Fintype.sum_equiv (finTwoArrowEquiv (FABL.F₂Cube n)) + (fun y ↦ if tuplePointParity (Fin.append x y) = h then 1 else 0) + (fun p ↦ if tuplePointParity (Fin.append x ![p.1, p.2]) = h then 1 else 0) + (fun y ↦ by + have hy : + ![((finTwoArrowEquiv (FABL.F₂Cube n)) y).1, + ((finTwoArrowEquiv (FABL.F₂Cube n)) y).2] = y := by + simpa only [finTwoArrowEquiv_symm_apply] using + (finTwoArrowEquiv (FABL.F₂Cube n)).symm_apply_apply y + rw [hy]) + _ = _ := by rw [Fintype.sum_prod_type] + _ = ∑ a : FABL.F₂Cube n, ∑ b : FABL.F₂Cube n, + ∑ x : Fin (2 * k) → FABL.F₂Cube n, + if tuplePointParity x = + h + FABL.f₂PointIndicator a + FABL.f₂PointIndicator b + then 1 else 0 := by + simp_rw [tuplePointParity_append_pair_eq_iff] + rw [Finset.sum_comm] + congr 1 + funext a + rw [Finset.sum_comm] + _ = _ := by + apply Finset.sum_congr rfl + intro a _ha + apply Finset.sum_congr rfl + intro b _hb + rw [← tuplePointParityMultiplicity_eq_sum_indicator] + +private theorem support_add_pointIndicator_of_eq_zero + (h : BooleanFunction n) (a : FABL.F₂Cube n) (ha : h a = 0) : + support (h + FABL.f₂PointIndicator a) = insert a (support h) := by + classical + ext x + by_cases hxa : x = a + · subst x + simp [mem_support, FABL.f₂PointIndicator_eq_ite, ha] + · rw [mem_support, Pi.add_apply, FABL.f₂PointIndicator_eq_ite, + if_neg hxa, add_zero, mem_insert] + constructor + · intro hx + exact Or.inr ((mem_support h x).2 hx) + · rintro (hxa' | hx) + · exact (hxa hxa').elim + · exact (mem_support h x).1 hx + +private theorem support_add_pointIndicator_of_eq_one + (h : BooleanFunction n) (a : FABL.F₂Cube n) (ha : h a = 1) : + support (h + FABL.f₂PointIndicator a) = (support h).erase a := by + classical + ext x + by_cases hxa : x = a + · subst x + simp [mem_support, FABL.f₂PointIndicator_eq_ite, ha] + · rw [mem_support, Pi.add_apply, FABL.f₂PointIndicator_eq_ite, + if_neg hxa, add_zero, Finset.mem_erase] + constructor + · intro hx + exact ⟨hxa, (mem_support h x).2 hx⟩ + · intro hx + exact (mem_support h x).1 hx.2 + +private theorem hammingWeight_add_pointIndicator_eq_add_one_of_eq_zero + (h : BooleanFunction n) (a : FABL.F₂Cube n) (ha : h a = 0) : + hammingWeight (h + FABL.f₂PointIndicator a) = hammingWeight h + 1 := by + rw [hammingWeight_eq_card_support, hammingWeight_eq_card_support, + support_add_pointIndicator_of_eq_zero h a ha] + rw [Finset.card_insert_of_notMem] + intro hmem + have hone := (mem_support h a).mp hmem + exact zero_ne_one (ha.symm.trans hone) + +private theorem hammingWeight_add_pointIndicator_add_one_of_eq_one + (h : BooleanFunction n) (a : FABL.F₂Cube n) (ha : h a = 1) : + hammingWeight (h + FABL.f₂PointIndicator a) + 1 = hammingWeight h := by + rw [hammingWeight_eq_card_support, hammingWeight_eq_card_support, + support_add_pointIndicator_of_eq_one h a ha] + exact Finset.card_erase_add_one ((mem_support h a).2 ha) + +private theorem add_pointIndicator_apply_of_ne + (h : BooleanFunction n) (a b : FABL.F₂Cube n) (hab : a ≠ b) : + (h + FABL.f₂PointIndicator a) b = h b := by + rw [Pi.add_apply, FABL.f₂PointIndicator_eq_ite, + if_neg (Ne.symm hab), add_zero] + +private theorem hammingWeight_add_two_pointIndicators_of_both_one + (h : BooleanFunction n) (a b : FABL.F₂Cube n) + (hab : a ≠ b) (ha : h a = 1) (hb : h b = 1) : + hammingWeight + (h + FABL.f₂PointIndicator a + FABL.f₂PointIndicator b) + 2 = + hammingWeight h := by + have hfirst := hammingWeight_add_pointIndicator_add_one_of_eq_one h a ha + have hb' : (h + FABL.f₂PointIndicator a) b = 1 := by + rw [add_pointIndicator_apply_of_ne h a b hab] + exact hb + have hsecond := hammingWeight_add_pointIndicator_add_one_of_eq_one + (h + FABL.f₂PointIndicator a) b hb' + omega + +private theorem hammingWeight_add_two_pointIndicators_of_mixed + (h : BooleanFunction n) (a b : FABL.F₂Cube n) + (hab : a ≠ b) (ha : h a = 1) (hb : h b = 0) : + hammingWeight + (h + FABL.f₂PointIndicator a + FABL.f₂PointIndicator b) = + hammingWeight h := by + have hfirst := hammingWeight_add_pointIndicator_add_one_of_eq_one h a ha + have hb' : (h + FABL.f₂PointIndicator a) b = 0 := by + rw [add_pointIndicator_apply_of_ne h a b hab] + exact hb + have hsecond := hammingWeight_add_pointIndicator_eq_add_one_of_eq_zero + (h + FABL.f₂PointIndicator a) b hb' + omega + +private theorem hammingWeight_add_two_pointIndicators_of_both_zero + (h : BooleanFunction n) (a b : FABL.F₂Cube n) + (hab : a ≠ b) (ha : h a = 0) (hb : h b = 0) : + hammingWeight + (h + FABL.f₂PointIndicator a + FABL.f₂PointIndicator b) = + hammingWeight h + 2 := by + have hfirst := hammingWeight_add_pointIndicator_eq_add_one_of_eq_zero h a ha + have hb' : (h + FABL.f₂PointIndicator a) b = 0 := by + rw [add_pointIndicator_apply_of_ne h a b hab] + exact hb + have hsecond := hammingWeight_add_pointIndicator_eq_add_one_of_eq_zero + (h + FABL.f₂PointIndicator a) b hb' + omega + +private theorem f₂_eq_zero_of_ne_one (x : FABL.𝔽₂) (hx : x ≠ 1) : + x = 0 := by + by_contra hzero + exact hx (Fin.eq_one_of_ne_zero x hzero) + +private theorem add_pointIndicator_self + (h : BooleanFunction n) (a : FABL.F₂Cube n) : + h + FABL.f₂PointIndicator a + FABL.f₂PointIndicator a = h := by + funext x + simp only [Pi.add_apply] + calc + h x + FABL.f₂PointIndicator a x + FABL.f₂PointIndicator a x = + h x + (FABL.f₂PointIndicator a x + FABL.f₂PointIndicator a x) := by + abel + _ = h x := by rw [CharTwo.add_self_eq_zero, add_zero] + +private theorem tuplePointParityMultiplicity_toggle_pair + (k : ℕ) (h : BooleanFunction n) (a b : FABL.F₂Cube n) : + tuplePointParityMultiplicity k + (h + FABL.f₂PointIndicator a + FABL.f₂PointIndicator b) = + if a = b then + tuplePointParityMultiplicityByWeight k n (hammingWeight h) + else if h a = 1 then + if h b = 1 then + tuplePointParityMultiplicityByWeight k n (hammingWeight h - 2) + else + tuplePointParityMultiplicityByWeight k n (hammingWeight h) + else if h b = 1 then + tuplePointParityMultiplicityByWeight k n (hammingWeight h) + else + tuplePointParityMultiplicityByWeight k n (hammingWeight h + 2) := by + by_cases hab : a = b + · subst b + rw [if_pos rfl, add_pointIndicator_self, + tuplePointParityMultiplicity_eq_byWeight] + · rw [if_neg hab] + by_cases ha : h a = 1 + · rw [if_pos ha] + by_cases hb : h b = 1 + · rw [if_pos hb, tuplePointParityMultiplicity_eq_byWeight] + have hweight : + hammingWeight + (h + FABL.f₂PointIndicator a + FABL.f₂PointIndicator b) = + hammingWeight h - 2 := by + have hrelation := hammingWeight_add_two_pointIndicators_of_both_one + h a b hab ha hb + omega + rw [hweight] + · have hbzero : h b = 0 := f₂_eq_zero_of_ne_one (h b) hb + rw [if_neg hb, tuplePointParityMultiplicity_eq_byWeight, + hammingWeight_add_two_pointIndicators_of_mixed h a b hab ha hbzero] + · have hazero : h a = 0 := f₂_eq_zero_of_ne_one (h a) ha + rw [if_neg ha] + by_cases hb : h b = 1 + · rw [if_pos hb, tuplePointParityMultiplicity_eq_byWeight] + have hweight := hammingWeight_add_two_pointIndicators_of_mixed + h b a (Ne.symm hab) hb hazero + rw [show h + FABL.f₂PointIndicator a + FABL.f₂PointIndicator b = + h + FABL.f₂PointIndicator b + FABL.f₂PointIndicator a by + ac_rfl] + exact congrArg + (fun w ↦ tuplePointParityMultiplicityByWeight k n w) hweight + · have hbzero : h b = 0 := f₂_eq_zero_of_ne_one (h b) hb + rw [if_neg hb, tuplePointParityMultiplicity_eq_byWeight, + hammingWeight_add_two_pointIndicators_of_both_zero + h a b hab hazero hbzero] + +private theorem sum_ite_eq_filter_card_mul + {X : Type*} + (s : Finset X) (p : X → Prop) [DecidablePred p] (A B : ℕ) : + (∑ x ∈ s, if p x then A else B) = + (s.filter p).card * A + (s.filter fun x ↦ ¬p x).card * B := by + rw [Finset.sum_ite] + simp + +private theorem card_erase_filter_one_of_eq_one + (h : BooleanFunction n) (a : FABL.F₂Cube n) (ha : h a = 1) : + (((Finset.univ : Finset (FABL.F₂Cube n)).erase a).filter + (fun b ↦ h b = 1)).card = hammingWeight h - 1 := by + have heq : + ((Finset.univ : Finset (FABL.F₂Cube n)).erase a).filter + (fun b ↦ h b = 1) = (support h).erase a := by + ext b + simp only [Finset.mem_filter, Finset.mem_erase, Finset.mem_univ, + mem_support] + tauto + rw [heq, Finset.card_erase_of_mem ((mem_support h a).2 ha), + ← hammingWeight_eq_card_support] + +private theorem card_erase_filter_one_of_eq_zero + (h : BooleanFunction n) (a : FABL.F₂Cube n) (ha : h a = 0) : + (((Finset.univ : Finset (FABL.F₂Cube n)).erase a).filter + (fun b ↦ h b = 1)).card = hammingWeight h := by + have heq : + ((Finset.univ : Finset (FABL.F₂Cube n)).erase a).filter + (fun b ↦ h b = 1) = support h := by + ext b + simp only [Finset.mem_filter, Finset.mem_erase, Finset.mem_univ, + mem_support] + constructor + · exact fun hb ↦ hb.2 + · intro hb + refine ⟨⟨?_, trivial⟩, hb⟩ + rintro rfl + exact zero_ne_one (ha.symm.trans hb) + rw [heq, ← hammingWeight_eq_card_support] + +private theorem card_erase_filter_not_one_of_eq_one + (h : BooleanFunction n) (a : FABL.F₂Cube n) (ha : h a = 1) : + (((Finset.univ : Finset (FABL.F₂Cube n)).erase a).filter + (fun b ↦ h b ≠ 1)).card = 2 ^ n - hammingWeight h := by + have heq : + ((Finset.univ : Finset (FABL.F₂Cube n)).erase a).filter + (fun b ↦ h b ≠ 1) = + (Finset.univ : Finset (FABL.F₂Cube n)) \ support h := by + ext b + constructor + · intro hb + have hbparts := Finset.mem_filter.mp hb + have hbnotone := hbparts.2 + exact Finset.mem_sdiff.mpr + ⟨Finset.mem_univ b, fun hbsupport ↦ + hbnotone ((mem_support h b).1 hbsupport)⟩ + · intro hb + have hbparts := Finset.mem_sdiff.mp hb + have hbnotone : h b ≠ 1 := fun hbOne ↦ + hbparts.2 ((mem_support h b).2 hbOne) + have hbne : b ≠ a := by + rintro rfl + exact hbnotone ha + exact Finset.mem_filter.mpr + ⟨Finset.mem_erase.mpr ⟨hbne, Finset.mem_univ b⟩, hbnotone⟩ + rw [heq, Finset.card_sdiff, + Finset.inter_eq_left.mpr (Finset.subset_univ (support h)), + Finset.card_univ, card_f₂Cube, ← hammingWeight_eq_card_support] + +private theorem card_erase_filter_not_one_of_eq_zero + (h : BooleanFunction n) (a : FABL.F₂Cube n) (ha : h a = 0) : + (((Finset.univ : Finset (FABL.F₂Cube n)).erase a).filter + (fun b ↦ h b ≠ 1)).card = 2 ^ n - hammingWeight h - 1 := by + have heq : + ((Finset.univ : Finset (FABL.F₂Cube n)).erase a).filter + (fun b ↦ h b ≠ 1) = + ((Finset.univ : Finset (FABL.F₂Cube n)) \ support h).erase a := by + ext b + constructor + · intro hb + have hbparts := Finset.mem_filter.mp hb + have hberase := Finset.mem_erase.mp hbparts.1 + have hbnotone := hbparts.2 + exact Finset.mem_erase.mpr + ⟨hberase.1, Finset.mem_sdiff.mpr + ⟨Finset.mem_univ b, fun hbsupport ↦ + hbnotone ((mem_support h b).1 hbsupport)⟩⟩ + · intro hb + have hbparts := Finset.mem_erase.mp hb + have hbsdiff := Finset.mem_sdiff.mp hbparts.2 + exact Finset.mem_filter.mpr + ⟨Finset.mem_erase.mpr ⟨hbparts.1, Finset.mem_univ b⟩, + fun hbOne ↦ hbsdiff.2 ((mem_support h b).2 hbOne)⟩ + have haMem : a ∈ + (Finset.univ : Finset (FABL.F₂Cube n)) \ support h := by + apply Finset.mem_sdiff.mpr + refine ⟨Finset.mem_univ a, ?_⟩ + intro haSupport + exact zero_ne_one (ha.symm.trans ((mem_support h a).1 haSupport)) + rw [heq, Finset.card_erase_of_mem haMem, + Finset.card_sdiff, + Finset.inter_eq_left.mpr (Finset.subset_univ (support h)), + Finset.card_univ, card_f₂Cube, ← hammingWeight_eq_card_support] + +private theorem sum_toggle_pair_fixed_left + (k : ℕ) (h : BooleanFunction n) (a : FABL.F₂Cube n) : + (∑ b : FABL.F₂Cube n, + tuplePointParityMultiplicity k + (h + FABL.f₂PointIndicator a + FABL.f₂PointIndicator b)) = + if h a = 1 then + tuplePointParityMultiplicityByWeight k n (hammingWeight h) + + (hammingWeight h - 1) * + tuplePointParityMultiplicityByWeight k n (hammingWeight h - 2) + + (2 ^ n - hammingWeight h) * + tuplePointParityMultiplicityByWeight k n (hammingWeight h) + else + tuplePointParityMultiplicityByWeight k n (hammingWeight h) + + hammingWeight h * + tuplePointParityMultiplicityByWeight k n (hammingWeight h) + + (2 ^ n - hammingWeight h - 1) * + tuplePointParityMultiplicityByWeight k n (hammingWeight h + 2) := by + classical + rw [← Finset.add_sum_erase (Finset.univ : Finset (FABL.F₂Cube n)) + (fun b ↦ tuplePointParityMultiplicity k + (h + FABL.f₂PointIndicator a + FABL.f₂PointIndicator b)) + (Finset.mem_univ a)] + rw [tuplePointParityMultiplicity_toggle_pair, if_pos rfl] + by_cases ha : h a = 1 + · rw [if_pos ha] + have hinner : + (∑ b ∈ (Finset.univ : Finset (FABL.F₂Cube n)).erase a, + tuplePointParityMultiplicity k + (h + FABL.f₂PointIndicator a + FABL.f₂PointIndicator b)) = + (hammingWeight h - 1) * + tuplePointParityMultiplicityByWeight k n (hammingWeight h - 2) + + (2 ^ n - hammingWeight h) * + tuplePointParityMultiplicityByWeight k n (hammingWeight h) := by + calc + (∑ b ∈ (Finset.univ : Finset (FABL.F₂Cube n)).erase a, + tuplePointParityMultiplicity k + (h + FABL.f₂PointIndicator a + FABL.f₂PointIndicator b)) = + ∑ b ∈ (Finset.univ : Finset (FABL.F₂Cube n)).erase a, + if h b = 1 then + tuplePointParityMultiplicityByWeight k n (hammingWeight h - 2) + else + tuplePointParityMultiplicityByWeight k n (hammingWeight h) := by + apply Finset.sum_congr rfl + intro b hb + have hab : a ≠ b := Ne.symm (Finset.mem_erase.mp hb).1 + rw [tuplePointParityMultiplicity_toggle_pair, if_neg hab, if_pos ha] + _ = _ := by + rw [sum_ite_eq_filter_card_mul, + card_erase_filter_one_of_eq_one h a ha, + card_erase_filter_not_one_of_eq_one h a ha] + rw [hinner] + ac_rfl + · have hazero : h a = 0 := f₂_eq_zero_of_ne_one (h a) ha + rw [if_neg ha] + have hinner : + (∑ b ∈ (Finset.univ : Finset (FABL.F₂Cube n)).erase a, + tuplePointParityMultiplicity k + (h + FABL.f₂PointIndicator a + FABL.f₂PointIndicator b)) = + hammingWeight h * + tuplePointParityMultiplicityByWeight k n (hammingWeight h) + + (2 ^ n - hammingWeight h - 1) * + tuplePointParityMultiplicityByWeight k n (hammingWeight h + 2) := by + calc + (∑ b ∈ (Finset.univ : Finset (FABL.F₂Cube n)).erase a, + tuplePointParityMultiplicity k + (h + FABL.f₂PointIndicator a + FABL.f₂PointIndicator b)) = + ∑ b ∈ (Finset.univ : Finset (FABL.F₂Cube n)).erase a, + if h b = 1 then + tuplePointParityMultiplicityByWeight k n (hammingWeight h) + else + tuplePointParityMultiplicityByWeight k n (hammingWeight h + 2) := by + apply Finset.sum_congr rfl + intro b hb + have hab : a ≠ b := Ne.symm (Finset.mem_erase.mp hb).1 + rw [tuplePointParityMultiplicity_toggle_pair, if_neg hab, if_neg ha] + _ = _ := by + rw [sum_ite_eq_filter_card_mul, + card_erase_filter_one_of_eq_zero h a hazero, + card_erase_filter_not_one_of_eq_zero h a hazero] + rw [hinner] + ac_rfl + +private theorem card_filter_one + (h : BooleanFunction n) : + ((Finset.univ : Finset (FABL.F₂Cube n)).filter + (fun a ↦ h a = 1)).card = hammingWeight h := by + have heq : + (Finset.univ : Finset (FABL.F₂Cube n)).filter + (fun a ↦ h a = 1) = support h := by + ext a + simp only [Finset.mem_filter, Finset.mem_univ, true_and, mem_support] + rw [heq, ← hammingWeight_eq_card_support] + +private theorem card_filter_not_one + (h : BooleanFunction n) : + ((Finset.univ : Finset (FABL.F₂Cube n)).filter + (fun a ↦ h a ≠ 1)).card = 2 ^ n - hammingWeight h := by + have heq : + (Finset.univ : Finset (FABL.F₂Cube n)).filter + (fun a ↦ h a ≠ 1) = + (Finset.univ : Finset (FABL.F₂Cube n)) \ support h := by + ext a + constructor + · intro ha + have hanotone := (Finset.mem_filter.mp ha).2 + exact Finset.mem_sdiff.mpr + ⟨Finset.mem_univ a, fun haSupport ↦ + hanotone ((mem_support h a).1 haSupport)⟩ + · intro ha + have haparts := Finset.mem_sdiff.mp ha + exact Finset.mem_filter.mpr + ⟨Finset.mem_univ a, fun haOne ↦ + haparts.2 ((mem_support h a).2 haOne)⟩ + rw [heq, Finset.card_sdiff, + Finset.inter_eq_left.mpr (Finset.subset_univ (support h)), + Finset.card_univ, card_f₂Cube, ← hammingWeight_eq_card_support] + +private theorem tuplePointParityMultiplicityByWeight_succ_decomposed + (k : ℕ) (h : BooleanFunction n) : + tuplePointParityMultiplicityByWeight (k + 1) n (hammingWeight h) = + (hammingWeight h + (2 ^ n - hammingWeight h) + + 2 * hammingWeight h * (2 ^ n - hammingWeight h)) * + tuplePointParityMultiplicityByWeight k n (hammingWeight h) + + hammingWeight h * (hammingWeight h - 1) * + tuplePointParityMultiplicityByWeight k n (hammingWeight h - 2) + + (2 ^ n - hammingWeight h) * (2 ^ n - hammingWeight h - 1) * + tuplePointParityMultiplicityByWeight k n (hammingWeight h + 2) := by + classical + rw [← tuplePointParityMultiplicity_eq_byWeight (k + 1) h, + tuplePointParityMultiplicity_succ] + calc + (∑ a : FABL.F₂Cube n, ∑ b : FABL.F₂Cube n, + tuplePointParityMultiplicity k + (h + FABL.f₂PointIndicator a + FABL.f₂PointIndicator b)) = + ∑ a : FABL.F₂Cube n, + if h a = 1 then + tuplePointParityMultiplicityByWeight k n (hammingWeight h) + + (hammingWeight h - 1) * + tuplePointParityMultiplicityByWeight k n (hammingWeight h - 2) + + (2 ^ n - hammingWeight h) * + tuplePointParityMultiplicityByWeight k n (hammingWeight h) + else + tuplePointParityMultiplicityByWeight k n (hammingWeight h) + + hammingWeight h * + tuplePointParityMultiplicityByWeight k n (hammingWeight h) + + (2 ^ n - hammingWeight h - 1) * + tuplePointParityMultiplicityByWeight k n (hammingWeight h + 2) := by + apply Finset.sum_congr rfl + intro a _ha + rw [sum_toggle_pair_fixed_left] + _ = hammingWeight h * + (tuplePointParityMultiplicityByWeight k n (hammingWeight h) + + (hammingWeight h - 1) * + tuplePointParityMultiplicityByWeight k n (hammingWeight h - 2) + + (2 ^ n - hammingWeight h) * + tuplePointParityMultiplicityByWeight k n (hammingWeight h)) + + (2 ^ n - hammingWeight h) * + (tuplePointParityMultiplicityByWeight k n (hammingWeight h) + + hammingWeight h * + tuplePointParityMultiplicityByWeight k n (hammingWeight h) + + (2 ^ n - hammingWeight h - 1) * + tuplePointParityMultiplicityByWeight k n (hammingWeight h + 2)) := by + rw [sum_ite_eq_filter_card_mul, card_filter_one, card_filter_not_one] + _ = _ := by ring + +/-- Carlet--Mesnager's two-point recurrence for the multiplicity of a +point-parity word, expressed only through its Hamming weight. -/ +theorem tuplePointParityMultiplicityByWeight_succ + (k : ℕ) (h : BooleanFunction n) : + tuplePointParityMultiplicityByWeight (k + 1) n (hammingWeight h) = + (2 ^ n + 2 * hammingWeight h * (2 ^ n - hammingWeight h)) * + tuplePointParityMultiplicityByWeight k n (hammingWeight h) + + hammingWeight h * (hammingWeight h - 1) * + tuplePointParityMultiplicityByWeight k n (hammingWeight h - 2) + + (2 ^ n - hammingWeight h) * (2 ^ n - hammingWeight h - 1) * + tuplePointParityMultiplicityByWeight k n (hammingWeight h + 2) := by + have hweightLe : hammingWeight h ≤ 2 ^ n := by + rw [← card_f₂Cube n] + exact hammingNorm_le_card_fintype + simpa only [Nat.add_sub_of_le hweightLe] using + tuplePointParityMultiplicityByWeight_succ_decomposed k h + +private theorem exists_booleanFunction_hammingWeight_eq + {w : ℕ} (hw : w ≤ 2 ^ n) : + ∃ h : BooleanFunction n, hammingWeight h = w := by + classical + have hw' : w ≤ (Finset.univ : Finset (FABL.F₂Cube n)).card := by + simpa only [Finset.card_univ, card_f₂Cube] using hw + obtain ⟨s, _hs, hcard⟩ := Finset.exists_subset_card_eq hw' + let h : BooleanFunction n := fun x ↦ if x ∈ s then 1 else 0 + refine ⟨h, ?_⟩ + rw [hammingWeight_eq_card_support] + have hsupport : support h = s := by + ext x + simp [h, mem_support] + rw [hsupport, hcard] + +private theorem tuplePointParityMultiplicityByWeight_succ_of_le + (k n w : ℕ) (hw : w ≤ 2 ^ n) : + tuplePointParityMultiplicityByWeight (k + 1) n w = + (2 ^ n + 2 * w * (2 ^ n - w)) * + tuplePointParityMultiplicityByWeight k n w + + w * (w - 1) * tuplePointParityMultiplicityByWeight k n (w - 2) + + (2 ^ n - w) * (2 ^ n - w - 1) * + tuplePointParityMultiplicityByWeight k n (w + 2) := by + obtain ⟨h, hweight⟩ := + exists_booleanFunction_hammingWeight_eq (n := n) hw + simpa only [hweight] using tuplePointParityMultiplicityByWeight_succ k h + +private theorem tuplePointParityMultiplicity_zero + (h : BooleanFunction n) : + tuplePointParityMultiplicity 0 h = if h = 0 then 1 else 0 := by + classical + have hparity : ∀ x : Fin 0 → FABL.F₂Cube n, tuplePointParity x = 0 := by + intro x + funext y + simp [tuplePointParity] + by_cases hh : h = 0 + · subst h + rw [tuplePointParityMultiplicity, tuplePointParityFiber] + have hfilter : + (Finset.univ : Finset (Fin 0 → FABL.F₂Cube n)).filter + (fun x ↦ tuplePointParity x = 0) = Finset.univ := by + apply Finset.filter_eq_self.mpr + intro x _hx + exact hparity x + rw [hfilter] + simp + · rw [tuplePointParityMultiplicity, tuplePointParityFiber] + have hfilter : + (Finset.univ : Finset (Fin 0 → FABL.F₂Cube n)).filter + (fun x ↦ tuplePointParity x = h) = ∅ := by + ext x + simp only [Finset.mem_filter, Finset.mem_univ, true_and, + Finset.notMem_empty, iff_false] + intro hx + apply hh + rw [← hx] + exact hparity x + rw [hfilter, Finset.card_empty, if_neg hh] + +private theorem tuplePointParityMultiplicityByWeight_zero + (n w : ℕ) : + tuplePointParityMultiplicityByWeight 0 n w = if w = 0 then 1 else 0 := by + classical + rw [tuplePointParityMultiplicityByWeight] + by_cases hexists : ∃ h : BooleanFunction n, hammingWeight h = w + · rw [dif_pos hexists, tuplePointParityMultiplicity_zero] + by_cases hwzero : w = 0 + · rw [if_pos hwzero] + have hchosen : (Classical.choose hexists : BooleanFunction n) = 0 := by + apply hammingNorm_eq_zero.mp + simpa only [hwzero] using Classical.choose_spec hexists + rw [if_pos hchosen] + · rw [if_neg hwzero, if_neg] + intro hchosen + have hweight := Classical.choose_spec hexists + rw [hchosen] at hweight + change hammingNorm (0 : BooleanFunction n) = w at hweight + rw [hammingNorm_zero] at hweight + exact hwzero hweight.symm + · rw [dif_neg hexists] + have hwzero : w ≠ 0 := by + intro hwzero + apply hexists + refine ⟨0, ?_⟩ + change hammingNorm (0 : BooleanFunction n) = w + rw [hammingNorm_zero, hwzero] + rw [if_neg hwzero] + +private def tuplePointParityCountRecurrence + (q : ℕ) : ℕ → ℕ → ℕ + | 0, 0 => 1 + | 0, _ + 1 => 0 + | k + 1, j => + (q + 2 * (2 * j) * (q - 2 * j)) * + tuplePointParityCountRecurrence q k j + + (2 * j) * (2 * j - 1) * + tuplePointParityCountRecurrence q k (j - 1) + + (q - 2 * j) * (q - 2 * j - 1) * + tuplePointParityCountRecurrence q k (j + 1) + +private def tuplePointParityCountPolynomial + (q : ℤ) : ℕ → ℕ → ℤ + | 0, 0 => 1 + | 0, _ + 1 => 0 + | k + 1, j => + (q + 2 * (2 * (j : ℤ)) * (q - 2 * (j : ℤ))) * + tuplePointParityCountPolynomial q k j + + (2 * (j : ℤ)) * (2 * (j : ℤ) - 1) * + tuplePointParityCountPolynomial q k (j - 1) + + (q - 2 * (j : ℤ)) * (q - 2 * (j : ℤ) - 1) * + tuplePointParityCountPolynomial q k (j + 1) + +private theorem tuplePointParityCountRecurrence_cast + (q k j : ℕ) (hbound : 2 * (j + k) ≤ q) : + (tuplePointParityCountRecurrence q k j : ℤ) = + tuplePointParityCountPolynomial q k j := by + induction k generalizing j with + | zero => + cases j <;> simp [tuplePointParityCountRecurrence, + tuplePointParityCountPolynomial] + | succ k ih => + rw [tuplePointParityCountRecurrence, tuplePointParityCountPolynomial] + have hcurrent : 2 * j ≤ q := by omega + have hcurrentOne : 1 ≤ q - 2 * j := by omega + have hsame : 2 * (j + k) ≤ q := by omega + have hlower : 2 * (j - 1 + k) ≤ q := by omega + have hupper : 2 * (j + 1 + k) ≤ q := by omega + rw [Nat.cast_add, Nat.cast_add, Nat.cast_mul, Nat.cast_mul, + Nat.cast_mul, Nat.cast_mul, Nat.cast_mul, Nat.cast_mul, + Nat.cast_sub hcurrentOne, Nat.cast_sub hcurrent, + ih j hsame, ih (j - 1) hlower, ih (j + 1) hupper] + by_cases hjzero : j = 0 + · subst j + norm_num + · rw [Nat.cast_sub (by omega : 1 ≤ 2 * j)] + push_cast [Nat.cast_sub hcurrent] + ring + +private theorem tuplePointParityMultiplicityByWeight_even_eq_recurrence + (n k j : ℕ) (hj : 2 * j ≤ 2 ^ n) : + tuplePointParityMultiplicityByWeight k n (2 * j) = + tuplePointParityCountRecurrence (2 ^ n) k j := by + induction k generalizing j with + | zero => + rw [tuplePointParityMultiplicityByWeight_zero] + cases j <;> rfl + | succ k ih => + rw [tuplePointParityMultiplicityByWeight_succ_of_le k n (2 * j) hj, + tuplePointParityCountRecurrence, ih j hj] + by_cases hjzero : j = 0 + · subst j + simp only [Nat.mul_zero, Nat.sub_zero, zero_mul, add_zero] + by_cases hupper : 2 ≤ 2 ^ n + · rw [ih 1 (by omega)] + · have hqpos : 0 < 2 ^ n := pow_pos (by omega) n + have hq : 2 ^ n = 1 := by omega + rw [hq] + norm_num + · have hlower : 2 * (j - 1) ≤ 2 ^ n := by omega + have hlowerIndex : 2 * j - 2 = 2 * (j - 1) := by omega + rw [hlowerIndex, ih (j - 1) hlower] + by_cases hupper : 2 * (j + 1) ≤ 2 ^ n + · have hupperIndex : 2 * j + 2 = 2 * (j + 1) := by omega + rw [hupperIndex, ih (j + 1) hupper] + · have hcoefficient : + (2 ^ n - 2 * j) * (2 ^ n - 2 * j - 1) = 0 := by + have hdiff : + 2 ^ n - 2 * j = 0 ∨ 2 ^ n - 2 * j = 1 := by + omega + rcases hdiff with hdiff | hdiff + · rw [hdiff] + · rw [hdiff] + rw [hcoefficient, zero_mul, zero_mul] + +private theorem tuplePointParityMultiplicityByWeight_even_eq_polynomial + (n k j : ℕ) (hbound : 2 * (j + k) ≤ 2 ^ n) : + (tuplePointParityMultiplicityByWeight k n (2 * j) : ℤ) = + tuplePointParityCountPolynomial ((2 ^ n : ℕ) : ℤ) k j := by + rw [tuplePointParityMultiplicityByWeight_even_eq_recurrence n k j (by omega), + tuplePointParityCountRecurrence_cast (2 ^ n) k j hbound] + +/-- Carlet--Mesnager Corollary 9.2.8: the exact seventh null-word +point-parity multiplicity. -/ +theorem tuplePointParityMultiplicityByWeight_seven_zero + (n : ℕ) (hn : 4 ≤ n) : + (tuplePointParityMultiplicityByWeight 7 n 0 : ℤ) = + 135135 * (2 : ℤ) ^ (7 * n) - + 1891890 * (2 : ℤ) ^ (6 * n) + + 11351340 * (2 : ℤ) ^ (5 * n) - + 36636600 * (2 : ℤ) ^ (4 * n) + + 65825760 * (2 : ℤ) ^ (3 * n) - + 61152000 * (2 : ℤ) ^ (2 * n) + + 22368256 * (2 : ℤ) ^ n := by + have hpow : 2 ^ 4 ≤ 2 ^ n := Nat.pow_le_pow_right (by norm_num) hn + rw [tuplePointParityMultiplicityByWeight_even_eq_polynomial n 7 0 (by omega)] + norm_num [tuplePointParityCountPolynomial] + ring + +/-- Carlet--Mesnager Corollary 9.2.8: the exact eighth null-word +point-parity multiplicity. -/ +theorem tuplePointParityMultiplicityByWeight_eight_zero + (n : ℕ) (hn : 4 ≤ n) : + (tuplePointParityMultiplicityByWeight 8 n 0 : ℤ) = + 2027025 * (2 : ℤ) ^ (8 * n) - + 37837800 * (2 : ℤ) ^ (7 * n) + + 310269960 * (2 : ℤ) ^ (6 * n) - + 1427025600 * (2 : ℤ) ^ (5 * n) + + 3918554640 * (2 : ℤ) ^ (4 * n) - + 6327135360 * (2 : ℤ) ^ (3 * n) + + 5464904448 * (2 : ℤ) ^ (2 * n) - + 1903757312 * (2 : ℤ) ^ n := by + have hpow : 2 ^ 4 ≤ 2 ^ n := Nat.pow_le_pow_right (by norm_num) hn + rw [tuplePointParityMultiplicityByWeight_even_eq_polynomial n 8 0 (by omega)] + norm_num [tuplePointParityCountPolynomial] + ring + +/-- Carlet--Mesnager Corollary 9.2.8: the exact seventh point-parity +multiplicity at weight eight. -/ +theorem tuplePointParityMultiplicityByWeight_seven_eight + (n : ℕ) (hn : 4 ≤ n) : + (tuplePointParityMultiplicityByWeight 7 n 8 : ℤ) = + 1816214400 * (2 : ℤ) ^ (3 * n) - + 32691859200 * (2 : ℤ) ^ (2 * n) + + 203416012800 * (2 : ℤ) ^ n - + 435430195200 := by + by_cases hnfive : 5 ≤ n + · have hpow : 2 ^ 5 ≤ 2 ^ n := + Nat.pow_le_pow_right (by norm_num) hnfive + rw [tuplePointParityMultiplicityByWeight_even_eq_polynomial n 7 4 (by omega)] + norm_num [tuplePointParityCountPolynomial] + ring + · have hnfour : n = 4 := by omega + subst n + rw [tuplePointParityMultiplicityByWeight_even_eq_recurrence 4 7 4 (by norm_num)] + norm_num [tuplePointParityCountRecurrence] + +/-- Carlet--Mesnager Corollary 9.2.8: the exact seventh point-parity +multiplicity at weight twelve. -/ +theorem tuplePointParityMultiplicityByWeight_seven_twelve + (n : ℕ) (hn : 4 ≤ n) : + (tuplePointParityMultiplicityByWeight 7 n 12 : ℤ) = + 43589145600 * (2 : ℤ) ^ n - 348713164800 := by + by_cases hnfive : 5 ≤ n + · have hpow : 2 ^ 5 ≤ 2 ^ n := + Nat.pow_le_pow_right (by norm_num) hnfive + rw [tuplePointParityMultiplicityByWeight_even_eq_polynomial n 7 6 (by omega)] + norm_num [tuplePointParityCountPolynomial] + ring + · have hnfour : n = 4 := by omega + subst n + rw [tuplePointParityMultiplicityByWeight_even_eq_recurrence 4 7 6 (by norm_num)] + norm_num [tuplePointParityCountRecurrence] + +/-- Carlet--Mesnager Corollary 9.2.8: the exact seventh point-parity +multiplicity at weight fourteen. -/ +theorem tuplePointParityMultiplicityByWeight_seven_fourteen + (n : ℕ) (hn : 4 ≤ n) : + (tuplePointParityMultiplicityByWeight 7 n 14 : ℤ) = 87178291200 := by + by_cases hnfive : 5 ≤ n + · have hpow : 2 ^ 5 ≤ 2 ^ n := + Nat.pow_le_pow_right (by norm_num) hnfive + rw [tuplePointParityMultiplicityByWeight_even_eq_polynomial n 7 7 (by omega)] + norm_num [tuplePointParityCountPolynomial] + · have hnfour : n = 4 := by omega + subst n + rw [tuplePointParityMultiplicityByWeight_even_eq_recurrence 4 7 7 (by norm_num)] + norm_num [tuplePointParityCountRecurrence] + +/-- Seven pairs cannot have point parity of weight sixteen. -/ +theorem tuplePointParityMultiplicityByWeight_seven_sixteen + (n : ℕ) (hn : 4 ≤ n) : + tuplePointParityMultiplicityByWeight 7 n 16 = 0 := by + by_cases hnfive : 5 ≤ n + · have hpow : 2 ^ 5 ≤ 2 ^ n := + Nat.pow_le_pow_right (by norm_num) hnfive + have hformula := + tuplePointParityMultiplicityByWeight_even_eq_polynomial n 7 8 (by omega) + norm_num [tuplePointParityCountPolynomial] at hformula + exact_mod_cast hformula + · have hnfour : n = 4 := by omega + subst n + rw [tuplePointParityMultiplicityByWeight_even_eq_recurrence 4 7 8 (by norm_num)] + norm_num [tuplePointParityCountRecurrence] + +/-- Carlet--Mesnager Corollary 9.2.8: the exact eighth point-parity +multiplicity at weight eight. -/ +theorem tuplePointParityMultiplicityByWeight_eight_eight + (n : ℕ) (hn : 4 ≤ n) : + (tuplePointParityMultiplicityByWeight 8 n 8 : ℤ) = + 54486432000 * (2 : ℤ) ^ (4 * n) - + 1380322944000 * (2 : ℤ) ^ (3 * n) + + 13556224281600 * (2 : ℤ) ^ (2 * n) - + 60916868812800 * (2 : ℤ) ^ n + + 105309161717760 := by + by_cases hnfive : 5 ≤ n + · have hpow : 2 ^ 5 ≤ 2 ^ n := + Nat.pow_le_pow_right (by norm_num) hnfive + rw [tuplePointParityMultiplicityByWeight_even_eq_polynomial n 8 4 (by omega)] + norm_num [tuplePointParityCountPolynomial] + ring + · have hnfour : n = 4 := by omega + subst n + rw [tuplePointParityMultiplicityByWeight_even_eq_recurrence 4 8 4 (by norm_num)] + norm_num [tuplePointParityCountRecurrence] + +/-- Carlet--Mesnager Corollary 9.2.8: the exact eighth point-parity +multiplicity at weight twelve. -/ +theorem tuplePointParityMultiplicityByWeight_eight_twelve + (n : ℕ) (hn : 4 ≤ n) : + (tuplePointParityMultiplicityByWeight 8 n 12 : ℤ) = + 2615348736000 * (2 : ℤ) ^ (2 * n) - + 43589145600000 * (2 : ℤ) ^ n + + 186910256332800 := by + by_cases hnfive : 5 ≤ n + · have hpow : 2 ^ 5 ≤ 2 ^ n := + Nat.pow_le_pow_right (by norm_num) hnfive + rw [tuplePointParityMultiplicityByWeight_even_eq_polynomial n 8 6 (by omega)] + norm_num [tuplePointParityCountPolynomial] + ring + · have hnfour : n = 4 := by omega + subst n + rw [tuplePointParityMultiplicityByWeight_even_eq_recurrence 4 8 6 (by norm_num)] + norm_num [tuplePointParityCountRecurrence] + +/-- Carlet--Mesnager Corollary 9.2.8: the exact eighth point-parity +multiplicity at weight fourteen. -/ +theorem tuplePointParityMultiplicityByWeight_eight_fourteen + (n : ℕ) (hn : 4 ≤ n) : + (tuplePointParityMultiplicityByWeight 8 n 14 : ℤ) = + 10461394944000 * (2 : ℤ) ^ n - 97639686144000 := by + by_cases hnfive : 5 ≤ n + · have hpow : 2 ^ 5 ≤ 2 ^ n := + Nat.pow_le_pow_right (by norm_num) hnfive + rw [tuplePointParityMultiplicityByWeight_even_eq_polynomial n 8 7 (by omega)] + norm_num [tuplePointParityCountPolynomial] + ring + · have hnfour : n = 4 := by omega + subst n + rw [tuplePointParityMultiplicityByWeight_even_eq_recurrence 4 8 7 (by norm_num)] + norm_num [tuplePointParityCountRecurrence] + +/-- Carlet--Mesnager Corollary 9.2.8: the exact eighth point-parity +multiplicity at weight sixteen. -/ +theorem tuplePointParityMultiplicityByWeight_eight_sixteen + (n : ℕ) (hn : 4 ≤ n) : + (tuplePointParityMultiplicityByWeight 8 n 16 : ℤ) = 20922789888000 := by + by_cases hnfive : 5 ≤ n + · have hpow : 2 ^ 5 ≤ 2 ^ n := + Nat.pow_le_pow_right (by norm_num) hnfive + rw [tuplePointParityMultiplicityByWeight_even_eq_polynomial n 8 8 (by omega)] + norm_num [tuplePointParityCountPolynomial] + · have hnfour : n = 4 := by omega + subst n + rw [tuplePointParityMultiplicityByWeight_even_eq_recurrence 4 8 8 (by norm_num)] + norm_num [tuplePointParityCountRecurrence] + +end CryptBoolean diff --git a/CryptBoolean/Carlet/Chapter04/IndicatorSpectralBounds.lean b/CryptBoolean/Carlet/Chapter04/IndicatorSpectralBounds.lean new file mode 100644 index 0000000..1168da6 --- /dev/null +++ b/CryptBoolean/Carlet/Chapter04/IndicatorSpectralBounds.lean @@ -0,0 +1,667 @@ +/- +Copyright (c) 2026 Asher Yan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Asher Yan with Codex +-/ +module + +public import CryptBoolean.Carlet.Chapter04.AutocorrelationIdentities +public import CryptBoolean.Carlet.Chapter04.LinearStructureSpectrum +public import CryptBoolean.Carlet.Chapter04.Nonlinearity +import Mathlib.Algebra.Order.Chebyshev + +/-! +# Carlet Chapter 4 indicator and Walsh-support bounds + +The fourth Walsh moment controls nonlinearity and the product of the sum-of-squares indicator +with Walsh-support size. Equality characterizes plateaued and bent functions. +-/ + +open Finset +open scoped BigOperators BooleanCube + +@[expose] public section + +namespace CryptBoolean + +variable {n : ℕ} + +/-- A Boolean function is plateaued when all nonzero raw Walsh coefficients have one magnitude. -/ +def HasPlateauedWalshSpectrum (f : BooleanFunction n) : Prop := + ∃ c : ℝ, 0 < c ∧ ∀ a, |(walshTransform f a : ℝ)| = 0 ∨ + |(walshTransform f a : ℝ)| = c + +/-- Every raw Walsh coefficient is bounded by Carlet's maximum Walsh magnitude. -/ +theorem abs_walshTransform_le_maxWalshMagnitude + (f : BooleanFunction n) (a : FABL.F₂Cube n) : + |(walshTransform f a : ℝ)| ≤ (maxWalshMagnitude f : ℝ) := by + have hnat : (walshTransform f a).natAbs ≤ maxWalshMagnitude f := by + unfold maxWalshMagnitude + exact Finset.le_sup' + (fun u : FABL.F₂Cube n ↦ (walshTransform f u).natAbs) + (Finset.mem_univ a) + have hreal : ((walshTransform f a).natAbs : ℝ) ≤ + (maxWalshMagnitude f : ℝ) := by exact_mod_cast hnat + simpa only [Nat.cast_natAbs, Int.cast_abs] using hreal + +private theorem exists_walshTransform_ne_zero (f : BooleanFunction n) : + ∃ a, walshTransform f a ≠ 0 := by + by_contra h + push Not at h + have hparseval := sum_walshTransform_sq_eq_two_pow_sq f + have hsum : (∑ a, (walshTransform f a : ℝ) ^ 2) = 0 := by + simp [h] + rw [hsum] at hparseval + have hpos : 0 < ((2 : ℝ) ^ n) ^ 2 := by positivity + linarith + +private theorem maxWalshMagnitude_pos (f : BooleanFunction n) : + 0 < (maxWalshMagnitude f : ℝ) := by + obtain ⟨a, ha⟩ := exists_walshTransform_ne_zero f + have hpos : 0 < |(walshTransform f a : ℝ)| := abs_pos.mpr (by exact_mod_cast ha) + exact hpos.trans_le (abs_walshTransform_le_maxWalshMagnitude f a) + +private theorem exists_abs_walshTransform_eq_maxWalshMagnitude + (f : BooleanFunction n) : + ∃ a, |(walshTransform f a : ℝ)| = (maxWalshMagnitude f : ℝ) := by + unfold maxWalshMagnitude + obtain ⟨a, _ha, hmax⟩ := Finset.exists_mem_eq_sup' + (s := (Finset.univ : Finset (FABL.F₂Cube n))) Finset.univ_nonempty + (fun u ↦ (walshTransform f u).natAbs) + refine ⟨a, ?_⟩ + rw [hmax, Nat.cast_natAbs, Int.cast_abs] + +private theorem walshTransform_fourth_le_maxWalshMagnitude_fourth + (f : BooleanFunction n) (a : FABL.F₂Cube n) : + (walshTransform f a : ℝ) ^ 4 ≤ (maxWalshMagnitude f : ℝ) ^ 4 := by + have habs := abs_walshTransform_le_maxWalshMagnitude f a + have hsq : (walshTransform f a : ℝ) ^ 2 ≤ + (maxWalshMagnitude f : ℝ) ^ 2 := by + simpa only [sq_abs] using + (sq_le_sq₀ (abs_nonneg (walshTransform f a : ℝ)) + (Nat.cast_nonneg (maxWalshMagnitude f))).mpr habs + nlinarith [sq_nonneg (walshTransform f a : ℝ), + sq_nonneg (maxWalshMagnitude f : ℝ)] + +/-- The fourth Walsh moment is bounded by the second moment times the squared peak magnitude. -/ +theorem sum_walshTransform_fourth_le_sum_sq_mul_maxWalshMagnitude_sq + (f : BooleanFunction n) : + (∑ a, (walshTransform f a : ℝ) ^ 4) ≤ + (∑ a, (walshTransform f a : ℝ) ^ 2) * + (maxWalshMagnitude f : ℝ) ^ 2 := by + calc + (∑ a, (walshTransform f a : ℝ) ^ 4) ≤ + ∑ a, (walshTransform f a : ℝ) ^ 2 * + (maxWalshMagnitude f : ℝ) ^ 2 := by + apply Finset.sum_le_sum + intro a _ha + have habs := abs_walshTransform_le_maxWalshMagnitude f a + have hsq : (walshTransform f a : ℝ) ^ 2 ≤ + (maxWalshMagnitude f : ℝ) ^ 2 := by + simpa only [sq_abs] using + (sq_le_sq₀ (abs_nonneg (walshTransform f a : ℝ)) + (Nat.cast_nonneg (maxWalshMagnitude f))).mpr habs + nlinarith [sq_nonneg (walshTransform f a : ℝ)] + _ = (∑ a, (walshTransform f a : ℝ) ^ 2) * + (maxWalshMagnitude f : ℝ) ^ 2 := by rw [Finset.sum_mul] + +/-- The fourth Walsh moment is bounded by the cube cardinality times the fourth power of its +peak magnitude. -/ +theorem sum_walshTransform_fourth_le_two_pow_mul_maxWalshMagnitude_fourth + (f : BooleanFunction n) : + (∑ a, (walshTransform f a : ℝ) ^ 4) ≤ + (2 : ℝ) ^ n * (maxWalshMagnitude f : ℝ) ^ 4 := by + calc + (∑ a, (walshTransform f a : ℝ) ^ 4) ≤ + ∑ _a : FABL.F₂Cube n, (maxWalshMagnitude f : ℝ) ^ 4 := by + apply Finset.sum_le_sum + intro a _ha + exact walshTransform_fourth_le_maxWalshMagnitude_fourth f a + _ = (2 : ℝ) ^ n * (maxWalshMagnitude f : ℝ) ^ 4 := by + rw [Finset.sum_const, Finset.card_univ, card_f₂Cube, nsmul_eq_mul] + push_cast + rfl + +private theorem sumOfSquaresIndicator_pos (f : BooleanFunction n) : + 0 < sumOfSquaresIndicator f := by + exact (by positivity : 0 < (2 : ℝ) ^ (2 * n)).trans_le + (sumOfSquaresIndicator_lower_bound f) + +/-- The squared peak Walsh magnitude is at least `V(f) / 2^n`. -/ +theorem sumOfSquaresIndicator_div_two_pow_le_maxWalshMagnitude_sq + (f : BooleanFunction n) : + sumOfSquaresIndicator f / (2 : ℝ) ^ n ≤ + (maxWalshMagnitude f : ℝ) ^ 2 := by + have hmoment := sum_walshTransform_fourth_le_sum_sq_mul_maxWalshMagnitude_sq f + rw [sum_walshTransform_fourth_eq_two_pow_mul_sumOfSquaresIndicator, + sum_walshTransform_sq_eq_two_pow_sq] at hmoment + have hpow : 0 < (2 : ℝ) ^ n := by positivity + rw [div_le_iff₀ hpow] + apply le_of_mul_le_mul_left _ hpow + calc + (2 : ℝ) ^ n * sumOfSquaresIndicator f ≤ + ((2 : ℝ) ^ n) ^ 2 * (maxWalshMagnitude f : ℝ) ^ 2 := hmoment + _ = (2 : ℝ) ^ n * + ((maxWalshMagnitude f : ℝ) ^ 2 * (2 : ℝ) ^ n) := by ring + +/-- The fourth power of the peak Walsh magnitude is at least `V(f)`. -/ +theorem sumOfSquaresIndicator_le_maxWalshMagnitude_fourth + (f : BooleanFunction n) : + sumOfSquaresIndicator f ≤ (maxWalshMagnitude f : ℝ) ^ 4 := by + have hmoment := sum_walshTransform_fourth_le_two_pow_mul_maxWalshMagnitude_fourth f + rw [sum_walshTransform_fourth_eq_two_pow_mul_sumOfSquaresIndicator] at hmoment + exact le_of_mul_le_mul_left hmoment (by positivity : 0 < (2 : ℝ) ^ n) + +/-- The peak Walsh magnitude dominates the square-root expression in Carlet's first indicator +bound. -/ +theorem inv_sqrt_two_pow_mul_sqrt_sumOfSquaresIndicator_le_maxWalshMagnitude + (f : BooleanFunction n) : + (Real.sqrt ((2 : ℝ) ^ n))⁻¹ * Real.sqrt (sumOfSquaresIndicator f) ≤ + (maxWalshMagnitude f : ℝ) := by + have hV : 0 ≤ sumOfSquaresIndicator f := (sumOfSquaresIndicator_pos f).le + have hpow : 0 < (2 : ℝ) ^ n := by positivity + calc + (Real.sqrt ((2 : ℝ) ^ n))⁻¹ * Real.sqrt (sumOfSquaresIndicator f) = + Real.sqrt (sumOfSquaresIndicator f / (2 : ℝ) ^ n) := by + rw [Real.sqrt_div hV, div_eq_inv_mul] + _ ≤ (maxWalshMagnitude f : ℝ) := by + exact Real.sqrt_le_iff.mpr + ⟨Nat.cast_nonneg (maxWalshMagnitude f), + sumOfSquaresIndicator_div_two_pow_le_maxWalshMagnitude_sq f⟩ + +private theorem fourthRoot_eq_sqrt_sqrt (x : ℝ) (hx : 0 ≤ x) : + x ^ (1 / 4 : ℝ) = Real.sqrt (Real.sqrt x) := by + rw [Real.sqrt_eq_rpow, Real.sqrt_eq_rpow, ← Real.rpow_mul hx] + congr 1 + norm_num + +/-- The peak Walsh magnitude dominates the real fourth root of `V(f)`. -/ +theorem rpow_one_fourth_sumOfSquaresIndicator_le_maxWalshMagnitude + (f : BooleanFunction n) : + sumOfSquaresIndicator f ^ (1 / 4 : ℝ) ≤ + (maxWalshMagnitude f : ℝ) := by + have hV : 0 ≤ sumOfSquaresIndicator f := (sumOfSquaresIndicator_pos f).le + rw [fourthRoot_eq_sqrt_sqrt _ hV] + apply Real.sqrt_le_iff.mpr + refine ⟨Nat.cast_nonneg (maxWalshMagnitude f), ?_⟩ + apply Real.sqrt_le_iff.mpr + refine ⟨sq_nonneg (maxWalshMagnitude f : ℝ), ?_⟩ + convert sumOfSquaresIndicator_le_maxWalshMagnitude_fourth f using 1 + ring + +/-- Carlet's first fourth-moment nonlinearity bound. -/ +theorem nonlinearity_cast_le_sqrt_sumOfSquaresIndicator_bound + (f : BooleanFunction n) : + (nonlinearity f : ℝ) ≤ + (2 : ℝ) ^ n / 2 - + (Real.sqrt ((2 : ℝ) ^ n))⁻¹ * + Real.sqrt (sumOfSquaresIndicator f) / 2 := by + rw [nonlinearity_cast_eq_relation_35] + linarith [inv_sqrt_two_pow_mul_sqrt_sumOfSquaresIndicator_le_maxWalshMagnitude f] + +/-- Carlet's second fourth-moment nonlinearity bound. -/ +theorem nonlinearity_cast_le_fourthRoot_sumOfSquaresIndicator_bound + (f : BooleanFunction n) : + (nonlinearity f : ℝ) ≤ + (2 : ℝ) ^ n / 2 - + sumOfSquaresIndicator f ^ (1 / 4 : ℝ) / 2 := by + rw [nonlinearity_cast_eq_relation_35] + linarith [rpow_one_fourth_sumOfSquaresIndicator_le_maxWalshMagnitude f] + +private theorem hasPlateauedWalshSpectrum_iff_pointwise_fourth_eq + (f : BooleanFunction n) : + HasPlateauedWalshSpectrum f ↔ + ∀ a, (walshTransform f a : ℝ) ^ 4 = + (walshTransform f a : ℝ) ^ 2 * + (maxWalshMagnitude f : ℝ) ^ 2 := by + constructor + · rintro ⟨c, hc, hplateaued⟩ + obtain ⟨u, hu⟩ := exists_abs_walshTransform_eq_maxWalshMagnitude f + have hu_pos : 0 < |(walshTransform f u : ℝ)| := by + rw [hu] + exact maxWalshMagnitude_pos f + have hmax_eq_c : (maxWalshMagnitude f : ℝ) = c := by + rcases hplateaued u with hzero | hc_u + · linarith + · linarith + intro a + rcases hplateaued a with hzero | hc_a + · have hwa : (walshTransform f a : ℝ) = 0 := abs_eq_zero.mp hzero + rw [hwa] + norm_num + · have habs : |(walshTransform f a : ℝ)| = + (maxWalshMagnitude f : ℝ) := by rw [hc_a, hmax_eq_c] + have hsq : (walshTransform f a : ℝ) ^ 2 = + (maxWalshMagnitude f : ℝ) ^ 2 := by + calc + (walshTransform f a : ℝ) ^ 2 = |(walshTransform f a : ℝ)| ^ 2 := + (sq_abs _).symm + _ = (maxWalshMagnitude f : ℝ) ^ 2 := + congrArg (fun x : ℝ ↦ x ^ 2) habs + nlinarith + · intro hpointwise + refine ⟨(maxWalshMagnitude f : ℝ), maxWalshMagnitude_pos f, ?_⟩ + intro a + have hfactor : (walshTransform f a : ℝ) ^ 2 * + ((walshTransform f a : ℝ) ^ 2 - + (maxWalshMagnitude f : ℝ) ^ 2) = 0 := by + nlinarith [hpointwise a] + rcases mul_eq_zero.mp hfactor with hzero | heq + · left + rw [sq_eq_zero_iff.mp hzero, abs_zero] + · right + have hsq : (walshTransform f a : ℝ) ^ 2 = + (maxWalshMagnitude f : ℝ) ^ 2 := sub_eq_zero.mp heq + exact (sq_eq_sq₀ (abs_nonneg (walshTransform f a : ℝ)) + (by positivity : 0 ≤ (maxWalshMagnitude f : ℝ))).mp (by + calc + |(walshTransform f a : ℝ)| ^ 2 = + (walshTransform f a : ℝ) ^ 2 := sq_abs _ + _ = (maxWalshMagnitude f : ℝ) ^ 2 := hsq) + +/-- Equality in the first fourth-moment estimate is equivalent to plateauedness. -/ +theorem sum_walshTransform_fourth_eq_sum_sq_mul_maxWalshMagnitude_sq_iff_plateaued + (f : BooleanFunction n) : + (∑ a, (walshTransform f a : ℝ) ^ 4) = + (∑ a, (walshTransform f a : ℝ) ^ 2) * + (maxWalshMagnitude f : ℝ) ^ 2 ↔ + HasPlateauedWalshSpectrum f := by + rw [hasPlateauedWalshSpectrum_iff_pointwise_fourth_eq] + constructor + · intro hsum a + have hnonneg (u : FABL.F₂Cube n) : + 0 ≤ (walshTransform f u : ℝ) ^ 2 * + (maxWalshMagnitude f : ℝ) ^ 2 - + (walshTransform f u : ℝ) ^ 4 := by + have habs := abs_walshTransform_le_maxWalshMagnitude f u + have hsq : (walshTransform f u : ℝ) ^ 2 ≤ + (maxWalshMagnitude f : ℝ) ^ 2 := by + simpa only [sq_abs] using + (sq_le_sq₀ (abs_nonneg (walshTransform f u : ℝ)) + (Nat.cast_nonneg (maxWalshMagnitude f))).mpr habs + nlinarith [sq_nonneg (walshTransform f u : ℝ)] + have hgap : + (∑ u, ((walshTransform f u : ℝ) ^ 2 * + (maxWalshMagnitude f : ℝ) ^ 2 - + (walshTransform f u : ℝ) ^ 4)) = 0 := by + rw [Finset.sum_sub_distrib, ← Finset.sum_mul, hsum] + ring + have ha := (Finset.sum_eq_zero_iff_of_nonneg + (fun u _hu ↦ hnonneg u)).mp hgap a (Finset.mem_univ a) + linarith + · intro hpointwise + rw [Finset.sum_mul] + exact Finset.sum_congr rfl (fun a _ha ↦ hpointwise a) + +private theorem all_abs_walshTransform_eq_max_iff_flat + (f : BooleanFunction n) : + (∀ a, |(walshTransform f a : ℝ)| = (maxWalshMagnitude f : ℝ)) ↔ + HasFlatWalshSpectrum f := by + constructor + · intro hall + have hparseval := sum_walshTransform_sq_eq_two_pow_sq f + have hsum : (∑ a, (walshTransform f a : ℝ) ^ 2) = + ∑ _a : FABL.F₂Cube n, (maxWalshMagnitude f : ℝ) ^ 2 := by + apply Finset.sum_congr rfl + intro a _ha + calc + (walshTransform f a : ℝ) ^ 2 = |(walshTransform f a : ℝ)| ^ 2 := + (sq_abs _).symm + _ = (maxWalshMagnitude f : ℝ) ^ 2 := + congrArg (fun x : ℝ ↦ x ^ 2) (hall a) + rw [hsum, Finset.sum_const, Finset.card_univ, card_f₂Cube, + nsmul_eq_mul] at hparseval + push_cast at hparseval + have hpow : 0 < (2 : ℝ) ^ n := by positivity + have hmax_sq : (maxWalshMagnitude f : ℝ) ^ 2 = (2 : ℝ) ^ n := by + apply le_antisymm + · apply le_of_mul_le_mul_left _ hpow + nlinarith + · apply le_of_mul_le_mul_left _ hpow + nlinarith + have hmax : (maxWalshMagnitude f : ℝ) = Real.sqrt ((2 : ℝ) ^ n) := + (sq_eq_sq₀ (Nat.cast_nonneg (maxWalshMagnitude f)) + (Real.sqrt_nonneg _)).mp (by rw [Real.sq_sqrt hpow.le]; exact hmax_sq) + intro a + rw [hall a, hmax] + · intro hflat + obtain ⟨u, hu⟩ := exists_abs_walshTransform_eq_maxWalshMagnitude f + have hmax : (maxWalshMagnitude f : ℝ) = Real.sqrt ((2 : ℝ) ^ n) := by + rw [← hu, hflat u] + intro a + rw [hflat a, hmax] + +/-- Equality in the second fourth-moment estimate is equivalent to a flat Walsh spectrum. -/ +theorem sum_walshTransform_fourth_eq_two_pow_mul_maxWalshMagnitude_fourth_iff_flat + (f : BooleanFunction n) : + (∑ a, (walshTransform f a : ℝ) ^ 4) = + (2 : ℝ) ^ n * (maxWalshMagnitude f : ℝ) ^ 4 ↔ + HasFlatWalshSpectrum f := by + rw [← all_abs_walshTransform_eq_max_iff_flat] + constructor + · intro hsum a + have hgap : + (∑ u : FABL.F₂Cube n, + ((maxWalshMagnitude f : ℝ) ^ 4 - + (walshTransform f u : ℝ) ^ 4)) = 0 := by + rw [Finset.sum_sub_distrib, Finset.sum_const, Finset.card_univ, + card_f₂Cube, nsmul_eq_mul] + push_cast + linarith + have ha := (Finset.sum_eq_zero_iff_of_nonneg + (fun u _hu ↦ sub_nonneg.mpr + (walshTransform_fourth_le_maxWalshMagnitude_fourth f u))).mp + hgap a (Finset.mem_univ a) + have hfourth : (walshTransform f a : ℝ) ^ 4 = + (maxWalshMagnitude f : ℝ) ^ 4 := by linarith + have habsFourth : |(walshTransform f a : ℝ)| ^ 4 = + |(maxWalshMagnitude f : ℝ)| ^ 4 := by + simpa only [abs_pow] using congrArg abs hfourth + have habs := (pow_left_inj₀ (abs_nonneg (walshTransform f a : ℝ)) + (abs_nonneg (maxWalshMagnitude f : ℝ)) (by norm_num : (4 : ℕ) ≠ 0)).mp + habsFourth + simpa only [abs_of_nonneg (by positivity : 0 ≤ (maxWalshMagnitude f : ℝ))] using habs + · intro hall + calc + (∑ a, (walshTransform f a : ℝ) ^ 4) = + ∑ _a : FABL.F₂Cube n, (maxWalshMagnitude f : ℝ) ^ 4 := by + apply Finset.sum_congr rfl + intro a _ha + calc + (walshTransform f a : ℝ) ^ 4 = |(walshTransform f a : ℝ)| ^ 4 := by + rw [← abs_pow, abs_of_nonneg (by positivity : + 0 ≤ (walshTransform f a : ℝ) ^ 4)] + _ = (maxWalshMagnitude f : ℝ) ^ 4 := by rw [hall a] + _ = (2 : ℝ) ^ n * (maxWalshMagnitude f : ℝ) ^ 4 := by + rw [Finset.sum_const, Finset.card_univ, card_f₂Cube, nsmul_eq_mul] + push_cast + rfl + +private theorem inv_sqrt_two_pow_mul_sqrt_indicator_sq + (f : BooleanFunction n) : + ((Real.sqrt ((2 : ℝ) ^ n))⁻¹ * + Real.sqrt (sumOfSquaresIndicator f)) ^ 2 = + sumOfSquaresIndicator f / (2 : ℝ) ^ n := by + have hpow : 0 ≤ (2 : ℝ) ^ n := by positivity + have hV : 0 ≤ sumOfSquaresIndicator f := (sumOfSquaresIndicator_pos f).le + rw [mul_pow, inv_pow, Real.sq_sqrt hpow, Real.sq_sqrt hV] + field_simp + +private theorem maxWalshMagnitude_eq_indicatorSqrt_iff_plateaued + (f : BooleanFunction n) : + (maxWalshMagnitude f : ℝ) = + (Real.sqrt ((2 : ℝ) ^ n))⁻¹ * + Real.sqrt (sumOfSquaresIndicator f) ↔ + HasPlateauedWalshSpectrum f := by + rw [← sum_walshTransform_fourth_eq_sum_sq_mul_maxWalshMagnitude_sq_iff_plateaued] + have hpow : 0 < (2 : ℝ) ^ n := by positivity + constructor + · intro hmax + rw [sum_walshTransform_fourth_eq_two_pow_mul_sumOfSquaresIndicator, + sum_walshTransform_sq_eq_two_pow_sq, hmax, + inv_sqrt_two_pow_mul_sqrt_indicator_sq] + field_simp + · intro hmoment + rw [sum_walshTransform_fourth_eq_two_pow_mul_sumOfSquaresIndicator, + sum_walshTransform_sq_eq_two_pow_sq] at hmoment + apply (sq_eq_sq₀ (Nat.cast_nonneg (maxWalshMagnitude f)) + (mul_nonneg (inv_nonneg.mpr (Real.sqrt_nonneg _)) + (Real.sqrt_nonneg _))).mp + rw [inv_sqrt_two_pow_mul_sqrt_indicator_sq] + have hVeq : sumOfSquaresIndicator f = + (2 : ℝ) ^ n * (maxWalshMagnitude f : ℝ) ^ 2 := by + apply mul_left_cancel₀ hpow.ne' + calc + (2 : ℝ) ^ n * sumOfSquaresIndicator f = + ((2 : ℝ) ^ n) ^ 2 * (maxWalshMagnitude f : ℝ) ^ 2 := hmoment + _ = (2 : ℝ) ^ n * + ((2 : ℝ) ^ n * (maxWalshMagnitude f : ℝ) ^ 2) := by ring + rw [hVeq] + field_simp + +/-- Equality in Carlet's first indicator nonlinearity bound holds exactly for plateaued +functions. -/ +theorem nonlinearity_cast_eq_sqrt_sumOfSquaresIndicator_bound_iff_plateaued + (f : BooleanFunction n) : + (nonlinearity f : ℝ) = + (2 : ℝ) ^ n / 2 - + (Real.sqrt ((2 : ℝ) ^ n))⁻¹ * + Real.sqrt (sumOfSquaresIndicator f) / 2 ↔ + HasPlateauedWalshSpectrum f := by + rw [nonlinearity_cast_eq_relation_35, + ← maxWalshMagnitude_eq_indicatorSqrt_iff_plateaued] + constructor <;> intro h <;> linarith + +private theorem fourthRoot_pow_four (x : ℝ) (hx : 0 ≤ x) : + (x ^ (1 / 4 : ℝ)) ^ 4 = x := by + rw [← Real.rpow_natCast, ← Real.rpow_mul hx] + norm_num + +private theorem maxWalshMagnitude_eq_indicatorFourthRoot_iff_bent + (f : BooleanFunction n) : + (maxWalshMagnitude f : ℝ) = sumOfSquaresIndicator f ^ (1 / 4 : ℝ) ↔ + IsBent f := by + rw [← hasFlatWalshSpectrum_iff_isBent, + ← sum_walshTransform_fourth_eq_two_pow_mul_maxWalshMagnitude_fourth_iff_flat] + have hpow : 0 < (2 : ℝ) ^ n := by positivity + have hV : 0 ≤ sumOfSquaresIndicator f := (sumOfSquaresIndicator_pos f).le + constructor + · intro hmax + rw [sum_walshTransform_fourth_eq_two_pow_mul_sumOfSquaresIndicator, hmax, + fourthRoot_pow_four _ hV] + · intro hmoment + rw [sum_walshTransform_fourth_eq_two_pow_mul_sumOfSquaresIndicator] at hmoment + have hfourth : (maxWalshMagnitude f : ℝ) ^ 4 = sumOfSquaresIndicator f := by + apply le_antisymm + · apply le_of_mul_le_mul_left _ hpow + nlinarith + · apply le_of_mul_le_mul_left _ hpow + nlinarith + apply (pow_left_inj₀ (Nat.cast_nonneg (maxWalshMagnitude f)) + (Real.rpow_nonneg hV _) (by norm_num : (4 : ℕ) ≠ 0)).mp + rw [fourthRoot_pow_four _ hV] + exact hfourth + +/-- Equality in Carlet's fourth-root nonlinearity bound holds exactly for bent functions. -/ +theorem nonlinearity_cast_eq_fourthRoot_sumOfSquaresIndicator_bound_iff_bent + (f : BooleanFunction n) : + (nonlinearity f : ℝ) = + (2 : ℝ) ^ n / 2 - + sumOfSquaresIndicator f ^ (1 / 4 : ℝ) / 2 ↔ + IsBent f := by + rw [nonlinearity_cast_eq_relation_35, + ← maxWalshMagnitude_eq_indicatorFourthRoot_iff_bent] + constructor <;> intro h <;> linarith + +private theorem sum_walshSupport_pow_eq_sum + (f : BooleanFunction n) (k : ℕ) (hk : k ≠ 0) : + (∑ a ∈ walshSupport f, (walshTransform f a : ℝ) ^ k) = + ∑ a, (walshTransform f a : ℝ) ^ k := by + apply Finset.sum_subset (Finset.subset_univ _) + intro a _ha hnot + have hzero : walshTransform f a = 0 := by + exact not_ne_iff.mp (by simpa only [mem_walshSupport] using hnot) + simp [hzero, hk] + +/-- Carlet's Walsh-support product bound `2^(3n) ≤ V(f) |supp(W_f)|`. -/ +theorem two_pow_three_mul_n_le_sumOfSquaresIndicator_mul_card_walshSupport + (f : BooleanFunction n) : + (2 : ℝ) ^ (3 * n) ≤ + sumOfSquaresIndicator f * ((walshSupport f).card : ℝ) := by + have hcauchy := sq_sum_le_card_mul_sum_sq + (s := walshSupport f) (f := fun a ↦ (walshTransform f a : ℝ) ^ 2) + have hmoment : + (((2 : ℝ) ^ n) ^ 2) ^ 2 ≤ + ((walshSupport f).card : ℝ) * + ((2 : ℝ) ^ n * sumOfSquaresIndicator f) := by + calc + (((2 : ℝ) ^ n) ^ 2) ^ 2 = + ((∑ a ∈ walshSupport f, (walshTransform f a : ℝ) ^ 2)) ^ 2 := by + rw [sum_walshSupport_pow_eq_sum f 2 (by norm_num), + sum_walshTransform_sq_eq_two_pow_sq] + _ ≤ ((walshSupport f).card : ℝ) * + ∑ a ∈ walshSupport f, ((walshTransform f a : ℝ) ^ 2) ^ 2 := hcauchy + _ = ((walshSupport f).card : ℝ) * + ((2 : ℝ) ^ n * sumOfSquaresIndicator f) := by + congr 1 + calc + (∑ a ∈ walshSupport f, ((walshTransform f a : ℝ) ^ 2) ^ 2) = + ∑ a ∈ walshSupport f, (walshTransform f a : ℝ) ^ 4 := by + apply Finset.sum_congr rfl + intro a _ha + ring + _ = ∑ a, (walshTransform f a : ℝ) ^ 4 := + sum_walshSupport_pow_eq_sum f 4 (by norm_num) + _ = (2 : ℝ) ^ n * sumOfSquaresIndicator f := + sum_walshTransform_fourth_eq_two_pow_mul_sumOfSquaresIndicator f + have hpow : 0 < (2 : ℝ) ^ n := by positivity + apply le_of_mul_le_mul_left _ hpow + calc + (2 : ℝ) ^ n * (2 : ℝ) ^ (3 * n) = (2 : ℝ) ^ (4 * n) := by + rw [← pow_add] + congr 1 + omega + _ = (((2 : ℝ) ^ n) ^ 2) ^ 2 := by + rw [show 4 * n = n * 4 by omega, ← pow_mul] + ring + _ ≤ ((walshSupport f).card : ℝ) * + ((2 : ℝ) ^ n * sumOfSquaresIndicator f) := hmoment + _ = (2 : ℝ) ^ n * + (sumOfSquaresIndicator f * ((walshSupport f).card : ℝ)) := by ring + +private theorem sum_card_mul_sub_sum_sq + {ι : Type*} (s : Finset ι) (y : ι → ℝ) : + (∑ i ∈ s, (((s.card : ℝ) * y i) - ∑ j ∈ s, y j) ^ 2) = + (s.card : ℝ) * + ((s.card : ℝ) * ∑ i ∈ s, y i ^ 2 - (∑ i ∈ s, y i) ^ 2) := by + classical + let S : ℝ := ∑ i ∈ s, y i + let K : ℝ := s.card + calc + (∑ i ∈ s, (((s.card : ℝ) * y i) - ∑ j ∈ s, y j) ^ 2) = + ∑ i ∈ s, (K ^ 2 * y i ^ 2 - 2 * K * S * y i + S ^ 2) := by + apply Finset.sum_congr rfl + intro i _hi + dsimp [K, S] + ring + _ = K ^ 2 * (∑ i ∈ s, y i ^ 2) - + 2 * K * S * (∑ i ∈ s, y i) + (s.card : ℝ) * S ^ 2 := by + rw [Finset.sum_add_distrib, Finset.sum_sub_distrib, + ← Finset.mul_sum, ← Finset.mul_sum] + rw [Finset.sum_const, nsmul_eq_mul] + _ = (s.card : ℝ) * + ((s.card : ℝ) * ∑ i ∈ s, y i ^ 2 - (∑ i ∈ s, y i) ^ 2) := by + dsimp [K, S] + ring + +private theorem walshSupport_cauchy_equality_iff_plateaued + (f : BooleanFunction n) : + ((∑ a ∈ walshSupport f, (walshTransform f a : ℝ) ^ 2) ^ 2 = + ((walshSupport f).card : ℝ) * + ∑ a ∈ walshSupport f, (walshTransform f a : ℝ) ^ 4) ↔ + HasPlateauedWalshSpectrum f := by + classical + constructor + · intro heq + obtain ⟨u, hu_nonzero⟩ := exists_walshTransform_ne_zero f + have hu : u ∈ walshSupport f := (mem_walshSupport f u).2 hu_nonzero + let y : FABL.F₂Cube n → ℝ := fun a ↦ (walshTransform f a : ℝ) ^ 2 + let S : ℝ := ∑ a ∈ walshSupport f, y a + let K : ℝ := (walshSupport f).card + have hcauchy : S ^ 2 = K * ∑ a ∈ walshSupport f, y a ^ 2 := by + dsimp [S, K, y] + calc + (∑ a ∈ walshSupport f, (walshTransform f a : ℝ) ^ 2) ^ 2 = + ((walshSupport f).card : ℝ) * + ∑ a ∈ walshSupport f, (walshTransform f a : ℝ) ^ 4 := heq + _ = ((walshSupport f).card : ℝ) * + ∑ a ∈ walshSupport f, ((walshTransform f a : ℝ) ^ 2) ^ 2 := by + congr 1 + apply Finset.sum_congr rfl + intro a _ha + ring + have hdeviation : + (∑ a ∈ walshSupport f, (K * y a - S) ^ 2) = 0 := by + rw [show (∑ a ∈ walshSupport f, (K * y a - S) ^ 2) = + K * (K * ∑ a ∈ walshSupport f, y a ^ 2 - S ^ 2) by + simpa [K, S] using + sum_card_mul_sub_sum_sq (walshSupport f) y] + rw [hcauchy] + ring + have hconstant (a : FABL.F₂Cube n) (ha : a ∈ walshSupport f) : + y a = y u := by + have hzero (v : FABL.F₂Cube n) (hv : v ∈ walshSupport f) : + (K * y v - S) ^ 2 = 0 := + (Finset.sum_eq_zero_iff_of_nonneg + (fun w _hw ↦ sq_nonneg (K * y w - S))).mp hdeviation v hv + have ha_eq : K * y a = S := by nlinarith [hzero a ha] + have hu_eq : K * y u = S := by nlinarith [hzero u hu] + have hK : 0 < K := by + have hcard : 0 < (walshSupport f).card := Finset.card_pos.mpr ⟨u, hu⟩ + have hcardReal : (0 : ℝ) < ((walshSupport f).card : ℝ) := by + exact_mod_cast hcard + simpa [K] using hcardReal + exact (mul_left_cancel₀ hK.ne' (ha_eq.trans hu_eq.symm)) + refine ⟨|(walshTransform f u : ℝ)|, + abs_pos.mpr (by exact_mod_cast hu_nonzero), ?_⟩ + intro a + by_cases ha : a ∈ walshSupport f + · right + apply (sq_eq_sq₀ (abs_nonneg (walshTransform f a : ℝ)) + (abs_nonneg (walshTransform f u : ℝ))).mp + simpa only [sq_abs, y] using hconstant a ha + · left + have hzero : walshTransform f a = 0 := + not_ne_iff.mp (by simpa only [mem_walshSupport] using ha) + simp [hzero] + · rintro ⟨c, hc, hplateaued⟩ + have hvalue (a : FABL.F₂Cube n) (ha : a ∈ walshSupport f) : + (walshTransform f a : ℝ) ^ 2 = c ^ 2 := by + rcases hplateaued a with hzero | heq + · have hne : walshTransform f a ≠ 0 := (mem_walshSupport f a).1 ha + exact (hne (by exact_mod_cast (abs_eq_zero.mp hzero))).elim + · calc + (walshTransform f a : ℝ) ^ 2 = |(walshTransform f a : ℝ)| ^ 2 := + (sq_abs _).symm + _ = c ^ 2 := congrArg (fun x : ℝ ↦ x ^ 2) heq + calc + (∑ a ∈ walshSupport f, (walshTransform f a : ℝ) ^ 2) ^ 2 = + (∑ _a ∈ walshSupport f, c ^ 2) ^ 2 := by + congr 1 + exact Finset.sum_congr rfl (fun a ha ↦ hvalue a ha) + _ = ((walshSupport f).card : ℝ) * + ∑ _a ∈ walshSupport f, c ^ 4 := by + rw [Finset.sum_const, Finset.sum_const, nsmul_eq_mul, nsmul_eq_mul] + ring + _ = ((walshSupport f).card : ℝ) * + ∑ a ∈ walshSupport f, (walshTransform f a : ℝ) ^ 4 := by + congr 1 + apply Finset.sum_congr rfl + intro a ha + rw [show (walshTransform f a : ℝ) ^ 4 = c ^ 4 by + have := hvalue a ha + nlinarith] + +/-- Equality in the Walsh-support product bound holds exactly for plateaued functions. -/ +theorem sumOfSquaresIndicator_mul_card_walshSupport_eq_two_pow_three_mul_n_iff_plateaued + (f : BooleanFunction n) : + sumOfSquaresIndicator f * ((walshSupport f).card : ℝ) = + (2 : ℝ) ^ (3 * n) ↔ + HasPlateauedWalshSpectrum f := by + rw [← walshSupport_cauchy_equality_iff_plateaued] + have hpow3 : (2 : ℝ) ^ (3 * n) = ((2 : ℝ) ^ n) ^ 3 := by + rw [← pow_mul] + congr 1 + omega + rw [sum_walshSupport_pow_eq_sum f 2 (by norm_num), + sum_walshSupport_pow_eq_sum f 4 (by norm_num), + sum_walshTransform_sq_eq_two_pow_sq, + sum_walshTransform_fourth_eq_two_pow_mul_sumOfSquaresIndicator, hpow3] + have hpow : (2 : ℝ) ^ n ≠ 0 := by positivity + constructor <;> intro h + · apply mul_left_cancel₀ hpow + nlinarith + · apply mul_left_cancel₀ hpow + nlinarith + +end CryptBoolean diff --git a/CryptBoolean/Carlet/Chapter04/KthNonhomomorphicity.lean b/CryptBoolean/Carlet/Chapter04/KthNonhomomorphicity.lean new file mode 100644 index 0000000..f3d0594 --- /dev/null +++ b/CryptBoolean/Carlet/Chapter04/KthNonhomomorphicity.lean @@ -0,0 +1,748 @@ +/- +Copyright (c) 2026 Asher Yan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Asher Yan with Codex +-/ +module + +public import CryptBoolean.Carlet.Chapter04.IndicatorSpectralBounds +import Mathlib.Analysis.Convex.Jensen +import Mathlib.Analysis.Convex.SpecificFunctions.Deriv + +/-! +# Carlet Chapter 4 kth-order nonhomomorphicity + +The ordered zero-sum tuples with even output parity are expressed by a raw Walsh moment. For +even orders at least four, affine functions uniquely maximize this count and bent functions +uniquely minimize it. +-/ + +open Finset +open scoped BigOperators BooleanCube + +@[expose] public section + +namespace CryptBoolean + +variable {n k : ℕ} + +/-- The coordinate sum of an ordered tuple in the binary cube. -/ +def booleanTupleSum (x : Fin k → FABL.F₂Cube n) : FABL.F₂Cube n := + ∑ i, x i + +/-- The output parity of a Boolean function on an ordered tuple. -/ +def booleanTupleOutputSum + (f : BooleanFunction n) (x : Fin k → FABL.F₂Cube n) : FABL.𝔽₂ := + ∑ i, f (x i) + +/-- Carlet's p.67 count: ordered zero-sum tuples having even output parity. + +The cited Zhang--Zheng paper calls this the kth homomorphicity; Carlet calls the same even-output +count the kth-order nonhomomorphicity. -/ +noncomputable def kthNonhomomorphicity + (f : BooleanFunction n) (k : ℕ) : ℕ := + ((Finset.univ : Finset (Fin k → FABL.F₂Cube n)).filter fun x ↦ + booleanTupleSum x = 0 ∧ booleanTupleOutputSum f x = 0).card + +private theorem addChar_sum_eq_prod + {ι A M : Type*} [AddCommMonoid A] [CommMonoid M] + (ψ : AddChar A M) (s : Finset ι) (g : ι → A) : + ψ (∑ i ∈ s, g i) = ∏ i ∈ s, ψ (g i) := by + classical + induction s using Finset.induction_on with + | empty => simp + | @insert i s hi ih => + rw [Finset.sum_insert hi, Finset.prod_insert hi, AddChar.map_add_eq_mul, ih] + +private theorem product_realSignView_eq_binarySign_outputSum + (f : BooleanFunction n) (x : Fin k → FABL.F₂Cube n) : + ∏ i, realSignView f (x i) = FABL.binarySign (booleanTupleOutputSum f x) := by + rw [booleanTupleOutputSum, + addChar_sum_eq_prod FABL.binarySign Finset.univ (fun i ↦ f (x i))] + apply Finset.prod_congr rfl + intro i _hi + rw [realSignView, FABL.realSignEncodedFunction, FABL.signEncodedFunction, + FABL.signValue_signEncode_eq_binarySign] + +private theorem product_vectorWalshCharacter_eq_character_tupleSum + (a : FABL.F₂Cube n) (x : Fin k → FABL.F₂Cube n) : + ∏ i, FABL.vectorWalshCharacter a (x i) = + FABL.vectorWalshCharacter a (booleanTupleSum x) := by + rw [booleanTupleSum, + addChar_sum_eq_prod (FABL.vectorWalshCharacter a) Finset.univ x] + +private theorem sum_vectorWalshCharacter_frequency + (x : FABL.F₂Cube n) : + ∑ a, FABL.vectorWalshCharacter a x = + if x = 0 then (2 : ℝ) ^ n else 0 := by + classical + by_cases hx : x = 0 + · subst x + simp + · rw [if_neg hx] + have hexpect := FABL.expect_vectorWalshCharacter x + rw [if_neg hx, Fintype.expect_eq_sum_div_card] at hexpect + have h : ∑ a, FABL.vectorWalshCharacter x a = 0 := + (div_eq_zero_iff.mp hexpect).resolve_right (by positivity) + rw [← h] + apply Finset.sum_congr rfl + intro a _ha + rw [FABL.vectorWalshCharacter_apply, FABL.vectorWalshCharacter_apply] + exact congrArg FABL.binarySign (dotProduct_comm a x) + +private theorem indicator_zero_tupleSum_mul_two_pow + (x : Fin k → FABL.F₂Cube n) : + (if booleanTupleSum x = 0 then (2 : ℝ) ^ n else 0) = + ∑ a, FABL.vectorWalshCharacter a (booleanTupleSum x) := by + rw [sum_vectorWalshCharacter_frequency] + +private theorem two_pow_mul_zeroSumTupleCount + (hk : 0 < k) : + (2 : ℝ) ^ n * + (((Finset.univ : Finset (Fin k → FABL.F₂Cube n)).filter fun x ↦ + booleanTupleSum x = 0).card : ℝ) = + ((2 : ℝ) ^ n) ^ k := by + classical + rw [show + ((((Finset.univ : Finset (Fin k → FABL.F₂Cube n)).filter fun x ↦ + booleanTupleSum x = 0).card : ℕ) : ℝ) = + ∑ x ∈ (Finset.univ : Finset (Fin k → FABL.F₂Cube n)).filter + (fun x ↦ booleanTupleSum x = 0), (1 : ℝ) by simp] + rw [Finset.sum_filter] + rw [Finset.mul_sum] + simp_rw [mul_ite, mul_one, mul_zero] + calc + (∑ x : (Fin k → FABL.F₂Cube n), + if booleanTupleSum x = 0 then (2 : ℝ) ^ n else 0) = + ∑ x : (Fin k → FABL.F₂Cube n), + ∑ a, FABL.vectorWalshCharacter a (booleanTupleSum x) := by + apply Finset.sum_congr rfl + intro x _hx + exact indicator_zero_tupleSum_mul_two_pow x + _ = ∑ a : FABL.F₂Cube n, + ∑ x : (Fin k → FABL.F₂Cube n), + ∏ i, FABL.vectorWalshCharacter a (x i) := by + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro a _ha + apply Finset.sum_congr rfl + intro x _hx + exact (product_vectorWalshCharacter_eq_character_tupleSum a x).symm + _ = ∑ a : FABL.F₂Cube n, + (∑ y, FABL.vectorWalshCharacter a y) ^ k := by + apply Finset.sum_congr rfl + intro a _ha + rw [Fintype.sum_pow] + _ = ((2 : ℝ) ^ n) ^ k := by + calc + ∑ a : FABL.F₂Cube n, + (∑ y, FABL.vectorWalshCharacter a y) ^ k = + ((∑ y, FABL.vectorWalshCharacter (0 : FABL.F₂Cube n) y) ^ k) := by + rw [Finset.sum_eq_single 0] + · intro a _ha ha + have hexpect := FABL.expect_vectorWalshCharacter a + rw [if_neg ha, Fintype.expect_eq_sum_div_card] at hexpect + have hzero : ∑ y, FABL.vectorWalshCharacter a y = 0 := + (div_eq_zero_iff.mp hexpect).resolve_right (by positivity) + rw [hzero, zero_pow hk.ne'] + · simp + _ = ((2 : ℝ) ^ n) ^ k := by simp + +private theorem two_pow_mul_signedZeroSumTupleSum + (f : BooleanFunction n) : + (2 : ℝ) ^ n * + (∑ x : (Fin k → FABL.F₂Cube n), + if booleanTupleSum x = 0 then + ∏ i, realSignView f (x i) + else 0) = + ∑ a, (walshTransform f a : ℝ) ^ k := by + classical + rw [Finset.mul_sum] + calc + ∑ x : (Fin k → FABL.F₂Cube n), + (2 : ℝ) ^ n * + (if booleanTupleSum x = 0 then + ∏ i, realSignView f (x i) + else 0) = + ∑ x : (Fin k → FABL.F₂Cube n), + (∑ a, FABL.vectorWalshCharacter a (booleanTupleSum x)) * + ∏ i, realSignView f (x i) := by + apply Finset.sum_congr rfl + intro x _hx + rw [← indicator_zero_tupleSum_mul_two_pow] + by_cases hx : booleanTupleSum x = 0 <;> simp [hx] + _ = ∑ a : FABL.F₂Cube n, + ∑ x : (Fin k → FABL.F₂Cube n), + ∏ i, (realSignView f (x i) * + FABL.vectorWalshCharacter a (x i)) := by + simp_rw [Finset.sum_mul] + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro a _ha + apply Finset.sum_congr rfl + intro x _hx + rw [← product_vectorWalshCharacter_eq_character_tupleSum] + rw [← Finset.prod_mul_distrib] + apply Finset.prod_congr rfl + intro i _hi + ring + _ = ∑ a : FABL.F₂Cube n, + (∑ y, realSignView f y * FABL.vectorWalshCharacter a y) ^ k := by + apply Finset.sum_congr rfl + intro a _ha + rw [Fintype.sum_pow] + _ = ∑ a, (walshTransform f a : ℝ) ^ k := by + apply Finset.sum_congr rfl + intro a _ha + rw [walshTransform_cast_eq_sum_realSignView_mul_character] + +private theorem two_mul_kthNonhomomorphicity_eq_zeroSum_add_signed + (f : BooleanFunction n) : + 2 * (kthNonhomomorphicity f k : ℝ) = + (((Finset.univ : Finset (Fin k → FABL.F₂Cube n)).filter fun x ↦ + booleanTupleSum x = 0).card : ℝ) + + ∑ x : (Fin k → FABL.F₂Cube n), + if booleanTupleSum x = 0 then + ∏ i, realSignView f (x i) + else 0 := by + classical + rw [kthNonhomomorphicity] + rw [show + ((((Finset.univ : Finset (Fin k → FABL.F₂Cube n)).filter fun x ↦ + booleanTupleSum x = 0 ∧ booleanTupleOutputSum f x = 0).card : ℕ) : ℝ) = + ∑ x ∈ (Finset.univ : Finset (Fin k → FABL.F₂Cube n)).filter + (fun x ↦ booleanTupleSum x = 0 ∧ booleanTupleOutputSum f x = 0), + (1 : ℝ) by simp] + rw [Finset.sum_filter] + rw [show + ((((Finset.univ : Finset (Fin k → FABL.F₂Cube n)).filter fun x ↦ + booleanTupleSum x = 0).card : ℕ) : ℝ) = + ∑ x ∈ (Finset.univ : Finset (Fin k → FABL.F₂Cube n)).filter + (fun x ↦ booleanTupleSum x = 0), (1 : ℝ) by simp] + rw [Finset.sum_filter] + rw [Finset.mul_sum] + simp_rw [mul_ite, mul_one, mul_zero] + rw [← Finset.sum_add_distrib] + apply Finset.sum_congr rfl + intro x _hx + by_cases hsum : booleanTupleSum x = 0 + · rw [product_realSignView_eq_binarySign_outputSum] + by_cases hout : booleanTupleOutputSum f x = 0 + · norm_num [hsum, hout] + · have hout_one : booleanTupleOutputSum f x = 1 := + Fin.eq_one_of_ne_zero _ hout + simp [hsum, hout_one] + · simp [hsum] + +/-- Division-free Walsh-moment identity for Carlet's kth-order count. -/ +theorem two_mul_two_pow_mul_kthNonhomomorphicity + (f : BooleanFunction n) (hk : 0 < k) : + 2 * (2 : ℝ) ^ n * (kthNonhomomorphicity f k : ℝ) = + ((2 : ℝ) ^ n) ^ k + + ∑ a, (walshTransform f a : ℝ) ^ k := by + have hcount := two_mul_kthNonhomomorphicity_eq_zeroSum_add_signed + (n := n) (k := k) f + have hzero := two_pow_mul_zeroSumTupleCount (n := n) hk + have hsigned := two_pow_mul_signedZeroSumTupleSum (n := n) (k := k) f + calc + 2 * (2 : ℝ) ^ n * (kthNonhomomorphicity f k : ℝ) = + (2 : ℝ) ^ n * (2 * (kthNonhomomorphicity f k : ℝ)) := by ring + _ = (2 : ℝ) ^ n * + ((((Finset.univ : Finset (Fin k → FABL.F₂Cube n)).filter fun x ↦ + booleanTupleSum x = 0).card : ℝ) + + ∑ x : (Fin k → FABL.F₂Cube n), + if booleanTupleSum x = 0 then + ∏ i, realSignView f (x i) + else 0) := by rw [hcount] + _ = ((2 : ℝ) ^ n) ^ k + + ∑ a, (walshTransform f a : ℝ) ^ k := by + rw [mul_add, hzero, hsigned] + +/-- Carlet's p.67 Walsh-moment formula, written with positive denominators. -/ +theorem kthNonhomomorphicity_cast_eq_walshMoment + (f : BooleanFunction n) (hk : 0 < k) : + (kthNonhomomorphicity f k : ℝ) = + ((2 : ℝ) ^ n) ^ (k - 1) / 2 + + (∑ a, (walshTransform f a : ℝ) ^ k) / + (2 * (2 : ℝ) ^ n) := by + have h := two_mul_two_pow_mul_kthNonhomomorphicity (n := n) (k := k) f hk + obtain ⟨r, hk_eq⟩ := Nat.exists_eq_succ_of_ne_zero hk.ne' + subst k + simp only [Nat.succ_sub_one] + rw [pow_succ] at h + have hpow : (2 : ℝ) ^ n ≠ 0 := by positivity + field_simp + nlinarith + +/-- Carlet's printed p.67 formula, with the negative power written as a positive denominator. -/ +theorem kthNonhomomorphicity_cast_eq_carlet_formula + (f : BooleanFunction n) (hk : 0 < k) : + (kthNonhomomorphicity f k : ℝ) = + (2 : ℝ) ^ ((k - 1) * n) / 2 + + (∑ a, (walshTransform f a : ℝ) ^ k) / + (2 : ℝ) ^ (n + 1) := by + simpa [pow_mul, pow_succ, Nat.mul_comm, mul_comm] using + kthNonhomomorphicity_cast_eq_walshMoment (n := n) (k := k) f hk + +/-- A Boolean function is affine when it is one of FABL's canonical affine functions. -/ +def IsAffineBooleanFunction (f : BooleanFunction n) : Prop := + ∃ b a, f = FABL.affineFunction b a + +/-- A Boolean function is affine exactly when its Carlet nonlinearity vanishes. -/ +theorem isAffineBooleanFunction_iff_nonlinearity_eq_zero + (f : BooleanFunction n) : + IsAffineBooleanFunction f ↔ nonlinearity f = 0 := by + classical + constructor + · rintro ⟨b, a, rfl⟩ + unfold nonlinearity + apply Nat.eq_zero_of_le_zero + calc + (Finset.univ : Finset (FABL.𝔽₂ × FABL.F₂Cube n)).inf' + Finset.univ_nonempty + (fun p ↦ hammingDistance (FABL.affineFunction b a) + (FABL.affineFunction p.1 p.2)) ≤ + hammingDistance (FABL.affineFunction b a) + (FABL.affineFunction b a) := + Finset.inf'_le + (fun p : FABL.𝔽₂ × FABL.F₂Cube n ↦ + hammingDistance (FABL.affineFunction b a) + (FABL.affineFunction p.1 p.2)) + (Finset.mem_univ (b, a)) + _ = 0 := hammingDist_eq_zero.mpr rfl + · intro hzero + unfold nonlinearity at hzero + obtain ⟨p, _hp, hmin⟩ := Finset.exists_mem_eq_inf' + (s := (Finset.univ : Finset (FABL.𝔽₂ × FABL.F₂Cube n))) + Finset.univ_nonempty + (fun q ↦ hammingDistance f (FABL.affineFunction q.1 q.2)) + refine ⟨p.1, p.2, ?_⟩ + apply hammingDist_eq_zero.mp + change hammingDistance f (FABL.affineFunction p.1 p.2) = 0 + rw [← hmin] + exact hzero + +/-- Every raw Walsh coefficient is bounded by the binary-cube cardinality. -/ +theorem abs_walshTransform_le_two_pow + (f : BooleanFunction n) (a : FABL.F₂Cube n) : + |(walshTransform f a : ℝ)| ≤ (2 : ℝ) ^ n := by + have hnat : maxWalshMagnitude f ≤ 2 ^ n := by + have hrelation := two_mul_nonlinearity_add_maxWalshMagnitude f + omega + exact (abs_walshTransform_le_maxWalshMagnitude f a).trans (by exact_mod_cast hnat) + +private theorem sum_walshTransform_evenMoment_le_peak + (f : BooleanFunction n) (r : ℕ) (hr : 0 < r) : + (∑ a, (walshTransform f a : ℝ) ^ (2 * r)) ≤ + (maxWalshMagnitude f : ℝ) ^ (2 * (r - 1)) * + ((2 : ℝ) ^ n) ^ 2 := by + calc + (∑ a, (walshTransform f a : ℝ) ^ (2 * r)) = + ∑ a, ((walshTransform f a : ℝ) ^ 2) ^ r := by + apply Finset.sum_congr rfl + intro a _ha + rw [pow_mul] + _ ≤ ∑ a, (maxWalshMagnitude f : ℝ) ^ (2 * (r - 1)) * + (walshTransform f a : ℝ) ^ 2 := by + apply Finset.sum_le_sum + intro a _ha + have hsq : (walshTransform f a : ℝ) ^ 2 ≤ + (maxWalshMagnitude f : ℝ) ^ 2 := by + simpa only [sq_abs] using + (sq_le_sq₀ (abs_nonneg (walshTransform f a : ℝ)) + (Nat.cast_nonneg (maxWalshMagnitude f))).mpr + (abs_walshTransform_le_maxWalshMagnitude f a) + have hpow : + ((walshTransform f a : ℝ) ^ 2) ^ (r - 1) ≤ + ((maxWalshMagnitude f : ℝ) ^ 2) ^ (r - 1) := + pow_le_pow_left₀ (sq_nonneg _) hsq _ + have hr_eq : r = (r - 1) + 1 := by omega + calc + ((walshTransform f a : ℝ) ^ 2) ^ r = + ((walshTransform f a : ℝ) ^ 2) ^ (r - 1) * + (walshTransform f a : ℝ) ^ 2 := by + conv_lhs => rw [hr_eq] + rw [pow_succ] + _ ≤ ((maxWalshMagnitude f : ℝ) ^ 2) ^ (r - 1) * + (walshTransform f a : ℝ) ^ 2 := + mul_le_mul_of_nonneg_right hpow (sq_nonneg _) + _ = (maxWalshMagnitude f : ℝ) ^ (2 * (r - 1)) * + (walshTransform f a : ℝ) ^ 2 := by rw [pow_mul] + _ = (maxWalshMagnitude f : ℝ) ^ (2 * (r - 1)) * + ∑ a, (walshTransform f a : ℝ) ^ 2 := by + rw [Finset.mul_sum] + _ = (maxWalshMagnitude f : ℝ) ^ (2 * (r - 1)) * + ((2 : ℝ) ^ n) ^ 2 := by + rw [sum_walshTransform_sq_eq_two_pow_sq] + +/-- The even raw Walsh moment is at most the corresponding power of the cube cardinality. -/ +theorem sum_walshTransform_evenMoment_le + (f : BooleanFunction n) (r : ℕ) (hr : 0 < r) : + (∑ a, (walshTransform f a : ℝ) ^ (2 * r)) ≤ + ((2 : ℝ) ^ n) ^ (2 * r) := by + have hpeak := sum_walshTransform_evenMoment_le_peak f r hr + have hmax : (maxWalshMagnitude f : ℝ) ≤ (2 : ℝ) ^ n := by + have hnat : maxWalshMagnitude f ≤ 2 ^ n := by + have hrelation := two_mul_nonlinearity_add_maxWalshMagnitude f + omega + exact_mod_cast hnat + calc + (∑ a, (walshTransform f a : ℝ) ^ (2 * r)) ≤ + (maxWalshMagnitude f : ℝ) ^ (2 * (r - 1)) * + ((2 : ℝ) ^ n) ^ 2 := hpeak + _ ≤ ((2 : ℝ) ^ n) ^ (2 * (r - 1)) * + ((2 : ℝ) ^ n) ^ 2 := by + gcongr + _ = ((2 : ℝ) ^ n) ^ (2 * r) := by + rw [← pow_add] + congr 1 + omega + +private theorem isAffineBooleanFunction_of_evenMoment_eq_max + (f : BooleanFunction n) (r : ℕ) (hr : 2 ≤ r) + (hmoment : + (∑ a, (walshTransform f a : ℝ) ^ (2 * r)) = + ((2 : ℝ) ^ n) ^ (2 * r)) : + IsAffineBooleanFunction f := by + have hpeak := sum_walshTransform_evenMoment_le_peak f r (by omega) + rw [hmoment] at hpeak + have hpower : + ((2 : ℝ) ^ n) ^ (2 * r) = + ((2 : ℝ) ^ n) ^ (2 * (r - 1)) * ((2 : ℝ) ^ n) ^ 2 := by + rw [← pow_add] + congr 1 + omega + rw [hpower] at hpeak + have hpows : + ((2 : ℝ) ^ n) ^ (2 * (r - 1)) ≤ + (maxWalshMagnitude f : ℝ) ^ (2 * (r - 1)) := by + exact le_of_mul_le_mul_right hpeak (by positivity) + have hexponent : 2 * (r - 1) ≠ 0 := by omega + have hcard_le_max : + (2 : ℝ) ^ n ≤ (maxWalshMagnitude f : ℝ) := + (pow_le_pow_iff_left₀ (by positivity) (Nat.cast_nonneg _) hexponent).mp hpows + have hmax_le_card : (maxWalshMagnitude f : ℝ) ≤ (2 : ℝ) ^ n := by + have hnat : maxWalshMagnitude f ≤ 2 ^ n := by + have hrelation := two_mul_nonlinearity_add_maxWalshMagnitude f + omega + exact_mod_cast hnat + have hmax : maxWalshMagnitude f = 2 ^ n := by + exact_mod_cast le_antisymm hmax_le_card hcard_le_max + apply (isAffineBooleanFunction_iff_nonlinearity_eq_zero f).2 + have hrelation := two_mul_nonlinearity_add_maxWalshMagnitude f + omega + +private theorem booleanTupleOutputSum_affineFunction + (b : FABL.𝔽₂) (a : FABL.F₂Cube n) + (x : Fin k → FABL.F₂Cube n) : + booleanTupleOutputSum (FABL.affineFunction b a) x = + k • b + FABL.f₂DotProduct a (booleanTupleSum x) := by + classical + unfold booleanTupleOutputSum booleanTupleSum FABL.affineFunction FABL.f₂DotProduct + simp only [dotProduct, Finset.sum_add_distrib, Finset.sum_const, nsmul_eq_mul, + Finset.sum_apply] + rw [Finset.sum_comm] + rw [Finset.card_univ, Fintype.card_fin] + apply congrArg₂ (· + ·) rfl + apply Finset.sum_congr rfl + intro i _hi + rw [Finset.mul_sum] + +private theorem even_nsmul_f₂_eq_zero + (b : FABL.𝔽₂) (hk : Even k) : + k • b = 0 := by + obtain ⟨r, rfl⟩ := hk + rw [add_nsmul] + exact CharTwo.add_self_eq_zero (r • b) + +/-- An affine function attains Carlet's maximum kth-order count. -/ +theorem kthNonhomomorphicity_affineFunction + (b : FABL.𝔽₂) (a : FABL.F₂Cube n) + (hkEven : Even k) (hk : 0 < k) : + (kthNonhomomorphicity (FABL.affineFunction b a) k : ℝ) = + ((2 : ℝ) ^ n) ^ (k - 1) := by + classical + have hfilters : + ((Finset.univ : Finset (Fin k → FABL.F₂Cube n)).filter fun x ↦ + booleanTupleSum x = 0 ∧ + booleanTupleOutputSum (FABL.affineFunction b a) x = 0) = + (Finset.univ : Finset (Fin k → FABL.F₂Cube n)).filter fun x ↦ + booleanTupleSum x = 0 := by + ext x + simp only [Finset.mem_filter, Finset.mem_univ, true_and] + constructor + · exact And.left + · intro hsum + refine ⟨hsum, ?_⟩ + rw [booleanTupleOutputSum_affineFunction, even_nsmul_f₂_eq_zero b hkEven, + hsum] + simp [FABL.f₂DotProduct] + rw [kthNonhomomorphicity, hfilters] + have hzero := two_pow_mul_zeroSumTupleCount (n := n) hk + obtain ⟨r, hk_eq⟩ := Nat.exists_eq_succ_of_ne_zero hk.ne' + subst k + simp only [Nat.succ_sub_one] + rw [pow_succ] at hzero + apply mul_left_cancel₀ (by positivity : (2 : ℝ) ^ n ≠ 0) + simpa [mul_comm] using hzero + +/-- For even order at least four, Carlet's kth-order count is at most the number of +zero-sum tuples. -/ +theorem kthNonhomomorphicity_cast_le_max + (f : BooleanFunction n) (hkEven : Even k) (hkFour : 4 ≤ k) : + (kthNonhomomorphicity f k : ℝ) ≤ + ((2 : ℝ) ^ n) ^ (k - 1) := by + obtain ⟨r, hk_eq⟩ := hkEven + subst k + have hr : 2 ≤ r := by omega + have hkpos : 0 < r + r := by omega + have hformula := + kthNonhomomorphicity_cast_eq_walshMoment (n := n) (k := r + r) f hkpos + have hmoment := sum_walshTransform_evenMoment_le f r (by omega) + have htwo : r + r = 2 * r := by omega + rw [← htwo] at hmoment + rw [hformula] + have hpower : + ((2 : ℝ) ^ n) ^ (r + r) = + ((2 : ℝ) ^ n) ^ (r + r - 1) * (2 : ℝ) ^ n := by + conv_lhs => rw [show r + r = (r + r - 1) + 1 by omega] + rw [pow_succ] + calc + ((2 : ℝ) ^ n) ^ (r + r - 1) / 2 + + (∑ a, (walshTransform f a : ℝ) ^ (r + r)) / + (2 * (2 : ℝ) ^ n) ≤ + ((2 : ℝ) ^ n) ^ (r + r - 1) / 2 + + ((2 : ℝ) ^ n) ^ (r + r) / (2 * (2 : ℝ) ^ n) := by + gcongr + _ = ((2 : ℝ) ^ n) ^ (r + r - 1) := by + rw [hpower] + field_simp + ring + +/-- Equality in Carlet's maximum kth-order bound characterizes affine Boolean functions. -/ +theorem kthNonhomomorphicity_cast_eq_max_iff_isAffine + (f : BooleanFunction n) (hkEven : Even k) (hkFour : 4 ≤ k) : + (kthNonhomomorphicity f k : ℝ) = + ((2 : ℝ) ^ n) ^ (k - 1) ↔ + IsAffineBooleanFunction f := by + constructor + · intro hcount + obtain ⟨r, hk_eq⟩ := hkEven + subst k + have hr : 2 ≤ r := by omega + have hkpos : 0 < r + r := by omega + have hformula := + kthNonhomomorphicity_cast_eq_walshMoment (n := n) (k := r + r) f hkpos + have hpower : + ((2 : ℝ) ^ n) ^ (r + r) = + ((2 : ℝ) ^ n) ^ (r + r - 1) * (2 : ℝ) ^ n := by + conv_lhs => rw [show r + r = (r + r - 1) + 1 by omega] + rw [pow_succ] + have hmoment : + (∑ a, (walshTransform f a : ℝ) ^ (r + r)) = + ((2 : ℝ) ^ n) ^ (r + r) := by + rw [hcount] at hformula + rw [hpower] + have hN : (2 : ℝ) ^ n ≠ 0 := by positivity + field_simp at hformula ⊢ + nlinarith + have htwo : r + r = 2 * r := by omega + rw [htwo] at hmoment + exact isAffineBooleanFunction_of_evenMoment_eq_max f r hr hmoment + · intro haffine + obtain ⟨b, a, rfl⟩ := haffine + exact kthNonhomomorphicity_affineFunction b a hkEven (by omega) + +/-- Carlet's source-range maximum theorem, including the printed upper bound on the order. -/ +theorem carlet_kthNonhomomorphicity_cast_eq_max_iff_isAffine + (f : BooleanFunction n) (hkEven : Even k) (hkFour : 4 ≤ k) + (_hkCard : k ≤ 2 ^ n) : + (kthNonhomomorphicity f k : ℝ) = + ((2 : ℝ) ^ n) ^ (k - 1) ↔ + IsAffineBooleanFunction f := + kthNonhomomorphicity_cast_eq_max_iff_isAffine f hkEven hkFour + +private theorem sum_inv_two_pow_eq_one : + (∑ _a : FABL.F₂Cube n, ((2 : ℝ) ^ n)⁻¹) = 1 := by + rw [Finset.sum_const, Finset.card_univ, card_f₂Cube, nsmul_eq_mul] + push_cast + field_simp + +private theorem weightedMean_walshTransform_sq + (f : BooleanFunction n) : + (∑ a, ((2 : ℝ) ^ n)⁻¹ • (walshTransform f a : ℝ) ^ 2) = + (2 : ℝ) ^ n := by + simp only [smul_eq_mul] + rw [← Finset.mul_sum, sum_walshTransform_sq_eq_two_pow_sq] + field_simp + +private theorem weightedMean_walshTransform_sq_pow + (f : BooleanFunction n) (r : ℕ) : + (∑ a, ((2 : ℝ) ^ n)⁻¹ • ((walshTransform f a : ℝ) ^ 2) ^ r) = + ((2 : ℝ) ^ n)⁻¹ * + ∑ a, (walshTransform f a : ℝ) ^ (2 * r) := by + simp only [smul_eq_mul] + rw [Finset.mul_sum] + apply Finset.sum_congr rfl + intro a _ha + rw [pow_mul] + +/-- The even raw Walsh moment has the power-mean lower bound. -/ +theorem two_pow_pow_succ_le_sum_walshTransform_evenMoment + (f : BooleanFunction n) (r : ℕ) (hr : 2 ≤ r) : + ((2 : ℝ) ^ n) ^ (r + 1) ≤ + ∑ a, (walshTransform f a : ℝ) ^ (2 * r) := by + have hjensen := + (strictConvexOn_pow hr).convexOn.map_sum_le + (t := (Finset.univ : Finset (FABL.F₂Cube n))) + (w := fun _a ↦ ((2 : ℝ) ^ n)⁻¹) + (p := fun a ↦ (walshTransform f a : ℝ) ^ 2) + (fun _a _ha ↦ by positivity) + (sum_inv_two_pow_eq_one (n := n)) + (fun a _ha ↦ + show (0 : ℝ) ≤ (walshTransform f a : ℝ) ^ 2 from sq_nonneg _) + rw [weightedMean_walshTransform_sq, + weightedMean_walshTransform_sq_pow] at hjensen + rw [pow_succ] + have hN : 0 < (2 : ℝ) ^ n := by positivity + apply (le_mul_inv_iff₀ hN).mp + simpa [mul_comm] using hjensen + +private theorem walshTransform_evenMoment_eq_min_iff_constant_sq + (f : BooleanFunction n) (r : ℕ) (hr : 2 ≤ r) : + (∑ a, (walshTransform f a : ℝ) ^ (2 * r)) = + ((2 : ℝ) ^ n) ^ (r + 1) ↔ + ∀ a, (walshTransform f a : ℝ) ^ 2 = (2 : ℝ) ^ n := by + have hjensen := + (strictConvexOn_pow hr).map_sum_eq_iff + (t := (Finset.univ : Finset (FABL.F₂Cube n))) + (w := fun _a ↦ ((2 : ℝ) ^ n)⁻¹) + (p := fun a ↦ (walshTransform f a : ℝ) ^ 2) + (fun _a _ha ↦ by positivity) + (sum_inv_two_pow_eq_one (n := n)) + (fun a _ha ↦ + show (0 : ℝ) ≤ (walshTransform f a : ℝ) ^ 2 from sq_nonneg _) + rw [weightedMean_walshTransform_sq, + weightedMean_walshTransform_sq_pow] at hjensen + have hN : 0 < (2 : ℝ) ^ n := by positivity + constructor + · intro hmoment a + apply (hjensen.mp ?_) a (Finset.mem_univ a) + rw [hmoment, pow_succ] + field_simp + · intro hconstant + have hj := hjensen.mpr fun a _ha ↦ hconstant a + field_simp at hj + rw [pow_succ] + simpa [mul_comm] using hj.symm + +private theorem walshTransform_sq_eq_two_pow_iff_abs_eq_sqrt + (z : ℝ) : + z ^ 2 = (2 : ℝ) ^ n ↔ + |z| = Real.sqrt ((2 : ℝ) ^ n) := by + constructor + · intro hz + have hsqrt : (Real.sqrt ((2 : ℝ) ^ n)) ^ 2 = (2 : ℝ) ^ n := + Real.sq_sqrt (by positivity) + have habsSq : |z| ^ 2 = z ^ 2 := sq_abs z + nlinarith [abs_nonneg z, Real.sqrt_nonneg ((2 : ℝ) ^ n)] + · intro hz + have hsquares := congrArg (fun x : ℝ ↦ x ^ 2) hz + rw [sq_abs, Real.sq_sqrt (by positivity)] at hsquares + exact hsquares + +/-- Equality in the even Walsh power-mean bound is equivalent to bentness. -/ +theorem sum_walshTransform_evenMoment_eq_min_iff_isBent + (f : BooleanFunction n) (r : ℕ) (hr : 2 ≤ r) : + (∑ a, (walshTransform f a : ℝ) ^ (2 * r)) = + ((2 : ℝ) ^ n) ^ (r + 1) ↔ + IsBent f := by + rw [walshTransform_evenMoment_eq_min_iff_constant_sq f r hr, + ← hasFlatWalshSpectrum_iff_isBent] + constructor + · intro h a + exact (walshTransform_sq_eq_two_pow_iff_abs_eq_sqrt + (n := n) (walshTransform f a : ℝ)).1 (h a) + · intro h a + exact (walshTransform_sq_eq_two_pow_iff_abs_eq_sqrt + (n := n) (walshTransform f a : ℝ)).2 (h a) + +/-- For even order at least four, Carlet's kth-order count has the bent-function lower bound. -/ +theorem kthNonhomomorphicity_cast_min_le + (f : BooleanFunction n) (hkEven : Even k) (hkFour : 4 ≤ k) : + ((2 : ℝ) ^ n) ^ (k - 1) / 2 + + ((2 : ℝ) ^ n) ^ (k / 2) / 2 ≤ + (kthNonhomomorphicity f k : ℝ) := by + obtain ⟨r, hk_eq⟩ := hkEven + subst k + have hr : 2 ≤ r := by omega + have hkpos : 0 < r + r := by omega + have hformula := + kthNonhomomorphicity_cast_eq_walshMoment (n := n) (k := r + r) f hkpos + have hmoment := + two_pow_pow_succ_le_sum_walshTransform_evenMoment f r hr + have htwo : r + r = 2 * r := by omega + rw [← htwo] at hmoment + have hhalf : (r + r) / 2 = r := by omega + rw [hhalf, hformula] + have hscaled : + ((2 : ℝ) ^ n) ^ r / 2 ≤ + (∑ a, (walshTransform f a : ℝ) ^ (r + r)) / + (2 * (2 : ℝ) ^ n) := by + calc + ((2 : ℝ) ^ n) ^ r / 2 = + ((2 : ℝ) ^ n) ^ (r + 1) / (2 * (2 : ℝ) ^ n) := by + rw [pow_succ] + field_simp + _ ≤ (∑ a, (walshTransform f a : ℝ) ^ (r + r)) / + (2 * (2 : ℝ) ^ n) := by + gcongr + linarith + +/-- Equality in Carlet's minimum kth-order bound characterizes bent Boolean functions. -/ +theorem kthNonhomomorphicity_cast_eq_min_iff_isBent + (f : BooleanFunction n) (hkEven : Even k) (hkFour : 4 ≤ k) : + (kthNonhomomorphicity f k : ℝ) = + ((2 : ℝ) ^ n) ^ (k - 1) / 2 + + ((2 : ℝ) ^ n) ^ (k / 2) / 2 ↔ + IsBent f := by + obtain ⟨r, hk_eq⟩ := hkEven + subst k + have hr : 2 ≤ r := by omega + have hkpos : 0 < r + r := by omega + have hformula := + kthNonhomomorphicity_cast_eq_walshMoment (n := n) (k := r + r) f hkpos + have hhalf : (r + r) / 2 = r := by omega + rw [hhalf] + constructor + · intro hcount + have hmoment : + (∑ a, (walshTransform f a : ℝ) ^ (r + r)) = + ((2 : ℝ) ^ n) ^ (r + 1) := by + rw [hcount] at hformula + rw [pow_succ] + have hN : (2 : ℝ) ^ n ≠ 0 := by positivity + field_simp at hformula ⊢ + nlinarith + have htwo : r + r = 2 * r := by omega + rw [htwo] at hmoment + exact (sum_walshTransform_evenMoment_eq_min_iff_isBent f r hr).1 hmoment + · intro hbent + have hmoment := + (sum_walshTransform_evenMoment_eq_min_iff_isBent f r hr).2 hbent + have htwo : r + r = 2 * r := by omega + rw [← htwo] at hmoment + rw [hformula, hmoment, pow_succ] + field_simp + +/-- Carlet's source-range minimum theorem, including the printed upper bound on the order. -/ +theorem carlet_kthNonhomomorphicity_cast_eq_min_iff_isBent + (f : BooleanFunction n) (hkEven : Even k) (hkFour : 4 ≤ k) + (_hkCard : k ≤ 2 ^ n) : + (kthNonhomomorphicity f k : ℝ) = + ((2 : ℝ) ^ n) ^ (k - 1) / 2 + + ((2 : ℝ) ^ n) ^ (k / 2) / 2 ↔ + IsBent f := + kthNonhomomorphicity_cast_eq_min_iff_isBent f hkEven hkFour + +end CryptBoolean diff --git a/CryptBoolean/Carlet/Chapter04/LinearKernelNonlinearity.lean b/CryptBoolean/Carlet/Chapter04/LinearKernelNonlinearity.lean new file mode 100644 index 0000000..5a81f4f --- /dev/null +++ b/CryptBoolean/Carlet/Chapter04/LinearKernelNonlinearity.lean @@ -0,0 +1,208 @@ +/- +Copyright (c) 2026 Asher Yan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Asher Yan with Codex +-/ +module + +public import CryptBoolean.Carlet.Chapter04.LinearStructureNormalForm +public import CryptBoolean.Carlet.Chapter04.Nonlinearity +public import FABL.Chapter06.Constructions.BentFunctions + +/-! +# Nonlinearity bounds from linear structures + +Carlet Proposition 14 separates the linear-kernel coordinates. Their affine contribution cancels +against a matching affine approximant, so every mismatch on the complementary cube has exactly one +copy for each point of the linear-kernel cube. Relation (36) then gives Carlet's refined bound. +-/ + +open Finset +open scoped BooleanCube + +@[expose] public section + +namespace CryptBoolean + +variable {m k : ℕ} + +private def separatedLinearFunction + (g : BooleanFunction m) (ε : FABL.F₂Cube k) : BooleanFunction (m + k) := + fun z ↦ + let p := (Fin.appendEquiv m k).symm z + g p.1 + FABL.f₂DotProduct ε p.2 + +@[simp] private theorem separatedLinearFunction_append + (g : BooleanFunction m) (ε : FABL.F₂Cube k) + (x : FABL.F₂Cube m) (y : FABL.F₂Cube k) : + separatedLinearFunction g ε (Fin.append x y) = + g x + FABL.f₂DotProduct ε y := by + simp [separatedLinearFunction] + +private theorem separatedLinearFunction_ne_affineFunction_append_iff + (g : BooleanFunction m) (ε : FABL.F₂Cube k) + (c : FABL.𝔽₂) (a : FABL.F₂Cube m) + (x : FABL.F₂Cube m) (y : FABL.F₂Cube k) : + separatedLinearFunction g ε (Fin.append x y) ≠ + FABL.affineFunction c (Fin.append a ε) (Fin.append x y) ↔ + g x ≠ FABL.affineFunction c a x := by + rw [separatedLinearFunction_append] + simp only [FABL.affineFunction, FABL.f₂DotProduct_append] + constructor + · intro hne heq + apply hne + rw [heq] + abel + · intro hne heq + apply hne + apply add_right_cancel (b := FABL.f₂DotProduct ε y) + simpa only [add_assoc] using heq + +private theorem hammingDistance_separatedLinearFunction_affineFunction + (g : BooleanFunction m) (ε : FABL.F₂Cube k) + (c : FABL.𝔽₂) (a : FABL.F₂Cube m) : + hammingDistance (separatedLinearFunction g ε) + (FABL.affineFunction c (Fin.append a ε)) = + 2 ^ k * hammingDistance g (FABL.affineFunction c a) := by + classical + unfold hammingDistance hammingDist + calc + #((Finset.univ : Finset (FABL.F₂Cube (m + k))).filter fun z ↦ + separatedLinearFunction g ε z ≠ + FABL.affineFunction c (Fin.append a ε) z) = + #(((Finset.univ : Finset (FABL.F₂Cube m)).filter fun x ↦ + g x ≠ FABL.affineFunction c a x) ×ˢ + (Finset.univ : Finset (FABL.F₂Cube k))) := by + apply Finset.card_bij + (fun z _hz ↦ (Fin.appendEquiv m k).symm z) + · intro z hz + let p := (Fin.appendEquiv m k).symm z + have hz' : z = Fin.append p.1 p.2 := + ((Fin.appendEquiv m k).apply_symm_apply z).symm + have hmismatch := (Finset.mem_filter.mp hz).2 + rw [hz'] at hmismatch + apply Finset.mem_product.mpr + refine ⟨Finset.mem_filter.mpr ⟨Finset.mem_univ _, ?_⟩, Finset.mem_univ _⟩ + exact (separatedLinearFunction_ne_affineFunction_append_iff + g ε c a p.1 p.2).1 hmismatch + · intro z _hz w _hw hzw + exact (Fin.appendEquiv m k).symm.injective hzw + · intro p hp + refine ⟨Fin.append p.1 p.2, ?_, ?_⟩ + · have hp' := Finset.mem_product.mp hp + have hmismatch := (Finset.mem_filter.mp hp'.1).2 + apply Finset.mem_filter.mpr + refine ⟨Finset.mem_univ _, ?_⟩ + exact (separatedLinearFunction_ne_affineFunction_append_iff + g ε c a p.1 p.2).2 hmismatch + · exact (Fin.appendEquiv m k).symm_apply_apply p + _ = #((Finset.univ : Finset (FABL.F₂Cube m)).filter fun x ↦ + g x ≠ FABL.affineFunction c a x) * + #(Finset.univ : Finset (FABL.F₂Cube k)) := Finset.card_product _ _ + _ = 2 ^ k * + #((Finset.univ : Finset (FABL.F₂Cube m)).filter fun x ↦ + g x ≠ FABL.affineFunction c a x) := by + rw [Finset.card_univ, card_f₂Cube] + exact Nat.mul_comm _ _ + +private theorem nonlinearity_separatedLinearFunction_le + (g : BooleanFunction m) (ε : FABL.F₂Cube k) : + nonlinearity (separatedLinearFunction g ε) ≤ + 2 ^ k * nonlinearity g := by + classical + unfold nonlinearity + obtain ⟨p, _hp, hmin⟩ := Finset.exists_mem_eq_inf' + (s := (Finset.univ : Finset (FABL.𝔽₂ × FABL.F₂Cube m))) + Finset.univ_nonempty + (fun q ↦ hammingDistance g (FABL.affineFunction q.1 q.2)) + calc + (Finset.univ : Finset (FABL.𝔽₂ × FABL.F₂Cube (m + k))).inf' + Finset.univ_nonempty + (fun q ↦ hammingDistance (separatedLinearFunction g ε) + (FABL.affineFunction q.1 q.2)) ≤ + hammingDistance (separatedLinearFunction g ε) + (FABL.affineFunction p.1 (Fin.append p.2 ε)) := + Finset.inf'_le _ (Finset.mem_univ (p.1, Fin.append p.2 ε)) + _ = 2 ^ k * hammingDistance g (FABL.affineFunction p.1 p.2) := + hammingDistance_separatedLinearFunction_affineFunction g ε p.1 p.2 + _ = 2 ^ k * + (Finset.univ : Finset (FABL.𝔽₂ × FABL.F₂Cube m)).inf' + Finset.univ_nonempty + (fun q ↦ hammingDistance g (FABL.affineFunction q.1 q.2)) := by + rw [hmin.symm] + +private theorem two_pow_mul_relation_36_eq (m k : ℕ) : + (2 : ℝ) ^ k * + ((2 : ℝ) ^ ((m : ℝ) - 1) - + (2 : ℝ) ^ ((m : ℝ) / 2 - 1)) = + (2 : ℝ) ^ (((m + k : ℕ) : ℝ) - 1) - + (2 : ℝ) ^ ((((m + k : ℕ) : ℝ) + (k : ℝ) - 2) / 2) := by + rw [← Real.rpow_natCast, mul_sub, + ← Real.rpow_add (by positivity), ← Real.rpow_add (by positivity)] + push_cast + congr 1 <;> ring_nf + +private theorem nonlinearity_cast_le_of_finrank_linearKernel_ge + (f : BooleanFunction (m + k)) + (hk : k ≤ Module.finrank FABL.𝔽₂ (linearKernel f)) : + (nonlinearity f : ℝ) ≤ + (2 : ℝ) ^ (((m + k : ℕ) : ℝ) - 1) - + (2 : ℝ) ^ ((((m + k : ℕ) : ℝ) + (k : ℝ) - 2) / 2) := by + obtain ⟨L, g, ε, hnormal⟩ := + (finrank_linearKernel_ge_iff_hasSeparatedLinearStructureNormalForm f).mp hk + have hcomp : f ∘ L = separatedLinearFunction g ε := by + funext z + let p := (Fin.appendEquiv m k).symm z + have hz : z = Fin.append p.1 p.2 := + ((Fin.appendEquiv m k).apply_symm_apply z).symm + rw [hz] + simpa [Function.comp_apply] using hnormal p.1 p.2 + have hinvariant : nonlinearity (f ∘ L) = nonlinearity f := by + simpa using nonlinearity_comp_affineEquiv f L.toAffineEquiv + have hnlNat : nonlinearity f ≤ 2 ^ k * nonlinearity g := by + rw [← hinvariant, hcomp] + exact nonlinearity_separatedLinearFunction_le g ε + have hnlReal : + (nonlinearity f : ℝ) ≤ (2 : ℝ) ^ k * (nonlinearity g : ℝ) := by + exact_mod_cast hnlNat + calc + (nonlinearity f : ℝ) ≤ + (2 : ℝ) ^ k * (nonlinearity g : ℝ) := hnlReal + _ ≤ (2 : ℝ) ^ k * + ((2 : ℝ) ^ ((m : ℝ) - 1) - + (2 : ℝ) ^ ((m : ℝ) / 2 - 1)) := + mul_le_mul_of_nonneg_left (nonlinearity_cast_le_relation_36 g) (by positivity) + _ = (2 : ℝ) ^ (((m + k : ℕ) : ℝ) - 1) - + (2 : ℝ) ^ ((((m + k : ℕ) : ℝ) + (k : ℝ) - 2) / 2) := + two_pow_mul_relation_36_eq m k + +/-- If the linear kernel has dimension `k`, Carlet Relation (36) improves to +`nl(f) ≤ 2^(n-1) - 2^((n+k-2)/2)` for `n = m + k`. -/ +theorem nonlinearity_cast_le_of_finrank_linearKernel_eq + (f : BooleanFunction (m + k)) + (hker : Module.finrank FABL.𝔽₂ (linearKernel f) = k) : + (nonlinearity f : ℝ) ≤ + (2 : ℝ) ^ (((m + k : ℕ) : ℝ) - 1) - + (2 : ℝ) ^ ((((m + k : ℕ) : ℝ) + (k : ℝ) - 2) / 2) := by + apply nonlinearity_cast_le_of_finrank_linearKernel_ge f + omega + +/-- A nonzero linear structure gives Carlet's bound +`nl(f) ≤ 2^(n-1) - 2^((n-1)/2)` in dimension `n = m + 1`. -/ +theorem nonlinearity_cast_le_of_exists_nonzero_linearStructure + (f : BooleanFunction (m + 1)) + (hstructure : ∃ e : FABL.F₂Cube (m + 1), e ≠ 0 ∧ IsLinearStructure f e) : + (nonlinearity f : ℝ) ≤ + (2 : ℝ) ^ (((m + 1 : ℕ) : ℝ) - 1) - + (2 : ℝ) ^ ((((m + 1 : ℕ) : ℝ) - 1) / 2) := by + have hk : 1 ≤ Module.finrank FABL.𝔽₂ (linearKernel f) := by + rw [Submodule.one_le_finrank_iff, Submodule.ne_bot_iff] + obtain ⟨e, he, hlinear⟩ := hstructure + exact ⟨e, hlinear, he⟩ + have hbound := + nonlinearity_cast_le_of_finrank_linearKernel_ge (m := m) (k := 1) f hk + push_cast at hbound ⊢ + ring_nf at hbound ⊢ + exact hbound + +end CryptBoolean diff --git a/CryptBoolean/Carlet/Chapter04/LinearStructureNormalForm.lean b/CryptBoolean/Carlet/Chapter04/LinearStructureNormalForm.lean new file mode 100644 index 0000000..9e40107 --- /dev/null +++ b/CryptBoolean/Carlet/Chapter04/LinearStructureNormalForm.lean @@ -0,0 +1,274 @@ +/- +Copyright (c) 2026 Asher Yan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Asher Yan with Codex +-/ +module + +public import CryptBoolean.Carlet.Chapter04.LinearStructures +public import Mathlib.LinearAlgebra.FiniteDimensional.Lemmas +public import Mathlib.LinearAlgebra.Prod + +/-! +# Carlet Proposition 14: linear-structure normal forms + +Linear structures can be moved to the final coordinate block by an invertible linear change of +variables. On that block the function is a linear form, while all remaining dependence is confined +to the complementary coordinates. +-/ + +open Module +open scoped BooleanCube + +@[expose] public section + +namespace CryptBoolean + +variable {m k : ℕ} + +private def cubeAppendLinearEquiv (m k : ℕ) : + FABL.F₂Cube (m + k) ≃ₗ[FABL.𝔽₂] + (FABL.F₂Cube m × FABL.F₂Cube k) where + __ := (Fin.appendEquiv m k).symm + map_add' _ _ := by + apply Prod.ext <;> funext i <;> rfl + map_smul' _ _ := by + apply Prod.ext <;> funext i <;> rfl + +private def tailEmbeddingLinearMap (m k : ℕ) : + FABL.F₂Cube k →ₗ[FABL.𝔽₂] FABL.F₂Cube (m + k) := + (cubeAppendLinearEquiv m k).symm.toLinearMap.comp + (LinearMap.inr FABL.𝔽₂ (FABL.F₂Cube m) (FABL.F₂Cube k)) + +@[simp] private theorem tailEmbeddingLinearMap_apply + (y : FABL.F₂Cube k) : + tailEmbeddingLinearMap m k y = Fin.append 0 y := + rfl + +private theorem tailEmbeddingLinearMap_injective : + Function.Injective (tailEmbeddingLinearMap m k) := by + intro y z h + funext i + simpa using congrFun h (Fin.natAdd m i) + +private theorem append_head_add_tail + (x : FABL.F₂Cube m) (y : FABL.F₂Cube k) : + Fin.append x 0 + tailEmbeddingLinearMap m k y = Fin.append x y := by + apply (cubeAppendLinearEquiv m k).injective + simp [cubeAppendLinearEquiv] + +private theorem append_add_tail + (x : FABL.F₂Cube m) (z y : FABL.F₂Cube k) : + Fin.append x z + tailEmbeddingLinearMap m k y = Fin.append x (z + y) := by + apply (cubeAppendLinearEquiv m k).injective + simp [cubeAppendLinearEquiv] + +private theorem isLinearStructure_comp_linearEquiv_iff + (f : BooleanFunction (m + k)) + (L : FABL.F₂Cube (m + k) ≃ₗ[FABL.𝔽₂] FABL.F₂Cube (m + k)) + (e : FABL.F₂Cube (m + k)) : + IsLinearStructure (f ∘ L) e ↔ IsLinearStructure f (L e) := by + constructor + · rintro ⟨ε, hε⟩ + refine ⟨ε, fun x ↦ ?_⟩ + have h := hε (L.symm x) + simpa only [FABL.booleanDerivative, Function.comp_apply, L.apply_symm_apply, + L.map_add, L.symm_apply_apply] using h + · rintro ⟨ε, hε⟩ + refine ⟨ε, fun x ↦ ?_⟩ + simpa only [FABL.booleanDerivative, Function.comp_apply, L.map_add] using hε (L x) + +private theorem exists_linearEquiv_tail_mem_submodule + (U : Submodule FABL.𝔽₂ (FABL.F₂Cube (m + k))) + (hk : k ≤ Module.finrank FABL.𝔽₂ U) : + ∃ L : FABL.F₂Cube (m + k) ≃ₗ[FABL.𝔽₂] FABL.F₂Cube (m + k), + ∀ y : FABL.F₂Cube k, L (tailEmbeddingLinearMap m k y) ∈ U := by + let B : Basis (Fin (Module.finrank FABL.𝔽₂ U)) FABL.𝔽₂ U := + Module.finBasis FABL.𝔽₂ U + let v : Fin k → U := fun i ↦ B (Fin.castLE hk i) + have hv : LinearIndependent FABL.𝔽₂ v := + B.linearIndependent.comp (fun i ↦ Fin.castLE hk i) (Fin.castLE_injective hk) + let uU : FABL.F₂Cube k →ₗ[FABL.𝔽₂] U := + Fintype.linearCombination FABL.𝔽₂ v + have huU : Function.Injective uU := by + exact linearIndependent_iff_injective_fintypeLinearCombination.mp hv + let u : FABL.F₂Cube k →ₗ[FABL.𝔽₂] FABL.F₂Cube (m + k) := + U.subtype.comp uU + have hu : Function.Injective u := (Submodule.subtype_injective U).comp huU + let e : LinearMap.range (tailEmbeddingLinearMap m k) ≃ₗ[FABL.𝔽₂] + LinearMap.range u := + (LinearEquiv.ofInjective (tailEmbeddingLinearMap m k) + tailEmbeddingLinearMap_injective).symm.trans + (LinearEquiv.ofInjective u hu) + obtain ⟨L, hL⟩ := Submodule.exists_linearEquiv_restrict_eq e + refine ⟨L, fun y ↦ ?_⟩ + let z : LinearMap.range (tailEmbeddingLinearMap m k) := + ⟨tailEmbeddingLinearMap m k y, LinearMap.mem_range_self _ y⟩ + have hpreimage : + (LinearEquiv.ofInjective (tailEmbeddingLinearMap m k) + tailEmbeddingLinearMap_injective).symm z = y := by + apply tailEmbeddingLinearMap_injective + simpa [z] using + (LinearEquiv.ofInjective_symm_apply (tailEmbeddingLinearMap m k) z) + have hz : L (tailEmbeddingLinearMap m k y) = u y := by + have hz' := (hL z).symm + change L (tailEmbeddingLinearMap m k y) = + u ((LinearEquiv.ofInjective (tailEmbeddingLinearMap m k) + tailEmbeddingLinearMap_injective).symm z) at hz' + simpa [hpreimage] using hz' + rw [hz] + exact (uU y).property + +/-- The source-facing separated-coordinate normal form in Carlet Proposition 14. -/ +def HasSeparatedLinearStructureNormalForm + (f : BooleanFunction (m + k)) : Prop := + ∃ (L : FABL.F₂Cube (m + k) ≃ₗ[FABL.𝔽₂] FABL.F₂Cube (m + k)) + (g : BooleanFunction m) (ε : FABL.F₂Cube k), + ∀ (x : FABL.F₂Cube m) (y : FABL.F₂Cube k), + f (L (Fin.append x y)) = g x + FABL.f₂DotProduct ε y + +/-- Carlet Proposition 14, general form: `k` linear-kernel dimensions are exactly `k` +separated affine coordinates after an invertible linear change of variables. -/ +theorem finrank_linearKernel_ge_iff_hasSeparatedLinearStructureNormalForm + (f : BooleanFunction (m + k)) : + k ≤ Module.finrank FABL.𝔽₂ (linearKernel f) ↔ + HasSeparatedLinearStructureNormalForm f := by + constructor + · intro hk + obtain ⟨L, hL⟩ := exists_linearEquiv_tail_mem_submodule (linearKernel f) hk + let h : BooleanFunction (m + k) := f ∘ L + have htail (y : FABL.F₂Cube k) : + IsLinearStructure h (tailEmbeddingLinearMap m k y) := + (isLinearStructure_comp_linearEquiv_iff f L _).2 (hL y) + let q : FABL.F₂Cube k → FABL.𝔽₂ := + fun y ↦ h (tailEmbeddingLinearMap m k y) + h 0 + have hq : FABL.IsF₂Linear q := by + intro y z + obtain ⟨δ, hδ⟩ := htail z + have hd := (hδ (tailEmbeddingLinearMap m k y)).trans + (hδ 0).symm + rw [FABL.booleanDerivative, FABL.booleanDerivative] at hd + simp only [zero_add] at hd + change q (y + z) = q y + q z + change h (tailEmbeddingLinearMap m k (y + z)) + h 0 = + (h (tailEmbeddingLinearMap m k y) + h 0) + + (h (tailEmbeddingLinearMap m k z) + h 0) + rw [(tailEmbeddingLinearMap m k).map_add] + calc + h (tailEmbeddingLinearMap m k y + tailEmbeddingLinearMap m k z) + h 0 = + h (tailEmbeddingLinearMap m k y) + h (tailEmbeddingLinearMap m k z) := by + calc + _ = + (h (tailEmbeddingLinearMap m k y) + + h (tailEmbeddingLinearMap m k y)) + + (h (tailEmbeddingLinearMap m k y + tailEmbeddingLinearMap m k z) + + h 0) := by rw [ZModModule.add_self, zero_add] + _ = h (tailEmbeddingLinearMap m k y) + + (h (tailEmbeddingLinearMap m k y) + + h (tailEmbeddingLinearMap m k y + tailEmbeddingLinearMap m k z)) + + h 0 := by abel + _ = h (tailEmbeddingLinearMap m k y) + + (h 0 + h (tailEmbeddingLinearMap m k z)) + h 0 := by rw [hd] + _ = h (tailEmbeddingLinearMap m k y) + h (tailEmbeddingLinearMap m k z) + + (h 0 + h 0) := by abel + _ = _ := by rw [ZModModule.add_self, add_zero] + _ = (h (tailEmbeddingLinearMap m k y) + h 0) + + (h (tailEmbeddingLinearMap m k z) + h 0) := by + calc + h (tailEmbeddingLinearMap m k y) + h (tailEmbeddingLinearMap m k z) = + (h (tailEmbeddingLinearMap m k y) + + h (tailEmbeddingLinearMap m k z)) + (h 0 + h 0) := by + rw [ZModModule.add_self, add_zero] + _ = (h (tailEmbeddingLinearMap m k y) + h 0) + + (h (tailEmbeddingLinearMap m k z) + h 0) := by abel + obtain ⟨ε, hε⟩ := (FABL.isF₂Linear_iff_exists_dotProduct q).1 hq + refine ⟨L, fun x ↦ h (Fin.append x 0), ε, fun x y ↦ ?_⟩ + obtain ⟨δ, hδ⟩ := htail y + have hd := (hδ (Fin.append x 0)).trans (hδ 0).symm + rw [FABL.booleanDerivative, FABL.booleanDerivative] at hd + simp only [zero_add] at hd + change h (Fin.append x y) = h (Fin.append x 0) + FABL.f₂DotProduct ε y + rw [← hε y] + change h (Fin.append x y) = h (Fin.append x 0) + + (h (tailEmbeddingLinearMap m k y) + h 0) + rw [append_head_add_tail] at hd + calc + h (Fin.append x y) = + (h (Fin.append x 0) + h (Fin.append x 0)) + h (Fin.append x y) := by + rw [ZModModule.add_self, zero_add] + _ = h (Fin.append x 0) + + (h (Fin.append x 0) + h (Fin.append x y)) := by abel + _ = h (Fin.append x 0) + (h 0 + h (tailEmbeddingLinearMap m k y)) := by + rw [hd] + _ = _ := by abel + · rintro ⟨L, g, ε, hnormal⟩ + let uAmbient : FABL.F₂Cube k →ₗ[FABL.𝔽₂] FABL.F₂Cube (m + k) := + L.toLinearMap.comp (tailEmbeddingLinearMap m k) + have huMem (y : FABL.F₂Cube k) : uAmbient y ∈ linearKernel f := by + apply (isLinearStructure_comp_linearEquiv_iff f L _).1 + refine ⟨FABL.f₂DotProduct ε y, fun z ↦ ?_⟩ + let p := (Fin.appendEquiv m k).symm z + have hz : z = Fin.append p.1 p.2 := by + exact ((Fin.appendEquiv m k).apply_symm_apply z).symm + rw [FABL.booleanDerivative, hz, append_add_tail] + change f (L (Fin.append p.1 p.2)) + + f (L (Fin.append p.1 (p.2 + y))) = FABL.f₂DotProduct ε y + rw [hnormal, hnormal] + simp only [FABL.f₂DotProduct, dotProduct, Pi.add_apply] + simp_rw [mul_add] + rw [Finset.sum_add_distrib] + calc + g p.1 + ∑ i, ε i * p.2 i + + (g p.1 + ((∑ i, ε i * p.2 i) + ∑ i, ε i * y i)) = + (g p.1 + g p.1) + + ((∑ i, ε i * p.2 i) + ∑ i, ε i * p.2 i) + + ∑ i, ε i * y i := by abel + _ = ∑ i, ε i * y i := by + rw [ZModModule.add_self, zero_add, ZModModule.add_self, zero_add] + let u : FABL.F₂Cube k →ₗ[FABL.𝔽₂] linearKernel f := + LinearMap.codRestrict (linearKernel f) uAmbient huMem + have hu : Function.Injective u := by + intro y z hyz + apply tailEmbeddingLinearMap_injective + apply L.injective + exact congrArg Subtype.val hyz + have hfin := LinearMap.finrank_le_finrank_of_injective hu + simpa [Module.finrank_fintype_fun_eq_card] using hfin + +/-- Carlet Proposition 14, one-direction form: a nonzero linear structure is equivalent to +separating the final coordinate as `g(x₁,…,xₙ₋₁) + ε xₙ`. -/ +theorem exists_nonzero_linearStructure_iff_exists_single_coordinate_normalForm + (f : BooleanFunction (m + 1)) : + (∃ e : FABL.F₂Cube (m + 1), e ≠ 0 ∧ IsLinearStructure f e) ↔ + ∃ (L : FABL.F₂Cube (m + 1) ≃ₗ[FABL.𝔽₂] FABL.F₂Cube (m + 1)) + (g : BooleanFunction m) (ε : FABL.𝔽₂), + ∀ (x : FABL.F₂Cube m) (a : FABL.𝔽₂), + f (L (Fin.append x ![a])) = g x + ε * a := by + have hnonzero : + (∃ e : FABL.F₂Cube (m + 1), e ≠ 0 ∧ IsLinearStructure f e) ↔ + 1 ≤ Module.finrank FABL.𝔽₂ (linearKernel f) := by + rw [Submodule.one_le_finrank_iff, Submodule.ne_bot_iff] + constructor + · rintro ⟨e, he, hstructure⟩ + exact ⟨e, hstructure, he⟩ + · rintro ⟨e, hekernel, he⟩ + exact ⟨e, he, hekernel⟩ + constructor + · intro hstructure + have hfin := hnonzero.mp hstructure + obtain ⟨L, g, ε, hnormal⟩ := + (finrank_linearKernel_ge_iff_hasSeparatedLinearStructureNormalForm f).mp hfin + refine ⟨L, g, ε 0, fun x a ↦ ?_⟩ + simpa [FABL.f₂DotProduct, dotProduct, Fin.sum_univ_succ] using hnormal x ![a] + · rintro ⟨L, g, ε, hnormal⟩ + apply hnonzero.mpr + apply (finrank_linearKernel_ge_iff_hasSeparatedLinearStructureNormalForm f).mpr + refine ⟨L, g, ![ε], fun x y ↦ ?_⟩ + have hy : y = ![y 0] := by + funext i + fin_cases i + rfl + rw [hy] + simpa [FABL.f₂DotProduct, dotProduct, Fin.sum_univ_succ] using hnormal x (y 0) + +end CryptBoolean diff --git a/CryptBoolean/Carlet/Chapter04/LinearStructureSpectrum.lean b/CryptBoolean/Carlet/Chapter04/LinearStructureSpectrum.lean new file mode 100644 index 0000000..1516c79 --- /dev/null +++ b/CryptBoolean/Carlet/Chapter04/LinearStructureSpectrum.lean @@ -0,0 +1,442 @@ +/- +Copyright (c) 2026 Asher Yan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Asher Yan with Codex +-/ +module + +public import CryptBoolean.Carlet.Chapter02.SpectralSupport +public import CryptBoolean.Carlet.Chapter04.AutocorrelationBounds + +/-! +# Carlet Chapter 4 spectral characterization of linear structures + +The raw Poisson formula and Wiener--Khintchine identity relate squared Walsh coefficients on a +hyperplane coset to one autocorrelation coefficient. This yields the Walsh-support +characterization of constant derivatives. +-/ + +open Finset +open scoped BigOperators BooleanCube + +@[expose] public section + +namespace CryptBoolean + +variable {n : ℕ} + +noncomputable local instance linearStructureSpectrumSubmoduleFintype + (E : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) : Fintype E := + Fintype.ofFinite E + +/-- The Walsh hyperplane perpendicular to the direction `e`. -/ +noncomputable def walshHyperplane (e : FABL.F₂Cube n) : + Submodule FABL.𝔽₂ (FABL.F₂Cube n) := + FABL.perpendicularSubspace (Submodule.span FABL.𝔽₂ {e}) + +/-- Membership in the Walsh hyperplane is the vanishing dot-product condition. -/ +theorem mem_walshHyperplane_iff (e u : FABL.F₂Cube n) : + u ∈ walshHyperplane e ↔ FABL.f₂DotProduct u e = 0 := by + rw [walshHyperplane, FABL.mem_perpendicularSubspace_iff] + constructor + · intro h + exact h e (Submodule.mem_span_singleton_self e) + · intro h x hx + obtain ⟨c, rfl⟩ := Submodule.mem_span_singleton.mp hx + change dotProduct u (c • e) = 0 + rw [dotProduct_smul] + change c * FABL.f₂DotProduct u e = 0 + rw [h, mul_zero] + +/-- The cardinality of a nondegenerate Walsh hyperplane is `2^(n-1)`. -/ +theorem natCard_walshHyperplane (e : FABL.F₂Cube n) (he : e ≠ 0) : + Nat.card (walshHyperplane e) = 2 ^ (n - 1) := by + rw [walshHyperplane, FABL.card_submodule_eq_two_pow_finrank, + FABL.finrank_perpendicularSubspace, finrank_span_singleton he] + +private theorem sum_span_singleton + (e : FABL.F₂Cube n) (he : e ≠ 0) (g : FABL.F₂Cube n → ℝ) : + ∑ x : Submodule.span FABL.𝔽₂ {e}, g x.1 = g 0 + g e := by + let φ := LinearEquiv.toSpanNonzeroSingleton FABL.𝔽₂ (FABL.F₂Cube n) e he + rw [← Fintype.sum_equiv φ.toEquiv + (fun c : FABL.𝔽₂ ↦ g (φ c).1) (fun x ↦ g x.1) (fun _ ↦ rfl)] + have huniv : (Finset.univ : Finset FABL.𝔽₂) = {0, 1} := rfl + rw [huniv] + simp [φ, LinearEquiv.toSpanNonzeroSingleton_apply] + +/-- Carlet's hyperplane Walsh--autocorrelation identity: for `e ≠ 0`, the squared raw +Walsh spectrum on `a + {0,e}ᵖ` has the displayed unnormalized sum. -/ +theorem sum_walshTransform_sq_hyperplane_coset + (f : BooleanFunction n) (e a : FABL.F₂Cube n) (he : e ≠ 0) : + (∑ u : walshHyperplane e, + (walshTransform f (a + u.1) : ℝ) ^ 2) = + (2 : ℝ) ^ (n - 1) * + ((2 : ℝ) ^ n + + FABL.vectorWalshCharacter a e * autocorrelation f e) := by + classical + let E := walshHyperplane e + have hpoisson := rawPoissonSummationFormula (autocorrelation f) E a 0 + have hperp : FABL.perpendicularSubspace E = + Submodule.span FABL.𝔽₂ {e} := by + simp [E, walshHyperplane, + FABL.perpendicularSubspace_perpendicularSubspace] + have hsum : + (∑ x : FABL.perpendicularSubspace E, + FABL.vectorWalshCharacter a x.1 * autocorrelation f x.1) = + (2 : ℝ) ^ n + + FABL.vectorWalshCharacter a e * autocorrelation f e := by + rw [hperp] + simpa [autocorrelation_zero] using + sum_span_singleton e he + (fun x ↦ FABL.vectorWalshCharacter a x * autocorrelation f x) + have hcard : (Nat.card E : ℝ) = (2 : ℝ) ^ (n - 1) := by + rw [show E = walshHyperplane e from rfl, natCard_walshHyperplane e he] + norm_num + simp only [zero_add, FABL.vectorWalshCharacter_zero, AddChar.one_apply, + one_mul, rawFourierTransform_autocorrelation] at hpoisson + rw [hcard, hsum] at hpoisson + simpa using hpoisson + +/-- Carlet's raw Walsh support. -/ +noncomputable def walshSupport (f : BooleanFunction n) : Finset (FABL.F₂Cube n) := + rawFourierSupport (realSignView f) + +/-- Membership in Carlet's Walsh support is nonvanishing of the raw integer coefficient. -/ +@[simp] theorem mem_walshSupport (f : BooleanFunction n) (u : FABL.F₂Cube n) : + u ∈ walshSupport f ↔ walshTransform f u ≠ 0 := by + rw [walshSupport, mem_rawFourierSupport] + rw [show rawFourierTransform (realSignView f) u = + (walshTransform f u : ℝ) by + exact (walshTransform_cast_eq_sum_realSignView_mul_character f u).symm] + exact_mod_cast (Iff.rfl : walshTransform f u ≠ 0 ↔ walshTransform f u ≠ 0) + +private theorem hammingWeight_eq_two_pow_iff_eq_one (g : BooleanFunction n) : + hammingWeight g = 2 ^ n ↔ g = 1 := by + rw [hammingWeight_eq_card_support, ← card_f₂Cube n] + constructor + · intro hcard + have hsupport : support g = Finset.univ := + Finset.eq_of_subset_of_card_le (Finset.subset_univ _) + (by rw [Finset.card_univ, hcard]) + funext x + exact (mem_support g x).mp (by rw [hsupport]; exact Finset.mem_univ x) + · rintro rfl + have hsupport : support (1 : BooleanFunction n) = Finset.univ := by + ext x + simp [mem_support] + rw [hsupport, Finset.card_univ] + +private theorem autocorrelation_eq_two_pow_iff_derivative_eq_zero + (f : BooleanFunction n) (e : FABL.F₂Cube n) : + autocorrelation f e = (2 : ℝ) ^ n ↔ + FABL.booleanDerivative f e = 0 := by + rw [autocorrelation_eq_two_pow_sub_two_derivative_weight] + constructor + · intro h + have hweight : hammingWeight (FABL.booleanDerivative f e) = 0 := by + exact_mod_cast (by linarith : + (hammingWeight (FABL.booleanDerivative f e) : ℝ) = 0) + exact hammingNorm_eq_zero.mp hweight + · intro h + rw [h] + simp + +private theorem autocorrelation_eq_neg_two_pow_iff_derivative_eq_one + (f : BooleanFunction n) (e : FABL.F₂Cube n) : + autocorrelation f e = -((2 : ℝ) ^ n) ↔ + FABL.booleanDerivative f e = 1 := by + rw [autocorrelation_eq_two_pow_sub_two_derivative_weight] + constructor + · intro h + have hweight : hammingWeight (FABL.booleanDerivative f e) = 2 ^ n := by + exact_mod_cast (by linarith : + (hammingWeight (FABL.booleanDerivative f e) : ℝ) = (2 : ℝ) ^ n) + exact (hammingWeight_eq_two_pow_iff_eq_one _).mp hweight + · intro h + have hweight := (hammingWeight_eq_two_pow_iff_eq_one + (FABL.booleanDerivative f e)).mpr h + rw [hweight] + push_cast + ring + +private theorem positive_dimension_of_ne_zero + (e : FABL.F₂Cube n) (he : e ≠ 0) : 0 < n := by + by_contra hn + have hnzero : n = 0 := Nat.eq_zero_of_not_pos hn + subst n + exact he (Subsingleton.elim e 0) + +private theorem two_pow_eq_two_mul_two_pow_pred (hn : 0 < n) : + (2 : ℝ) ^ n = 2 * (2 : ℝ) ^ (n - 1) := by + calc + (2 : ℝ) ^ n = (2 : ℝ) ^ ((n - 1) + 1) := by + congr 1 + omega + _ = (2 : ℝ) ^ (n - 1) * 2 := by rw [pow_succ] + _ = 2 * (2 : ℝ) ^ (n - 1) := by ring + +private theorem walshCoefficient_eq_zero_of_mem_coset_sum_eq_zero + (f : BooleanFunction n) (e a : FABL.F₂Cube n) (v : walshHyperplane e) + (hsum : (∑ u : walshHyperplane e, + (walshTransform f (a + u.1) : ℝ) ^ 2) = 0) : + walshTransform f (a + v.1) = 0 := by + have hterm := (Finset.sum_eq_zero_iff_of_nonneg + (fun (u : walshHyperplane e) _ ↦ sq_nonneg + (walshTransform f (a + u.1) : ℝ))).mp hsum + v (Finset.mem_univ _) + exact_mod_cast (sq_eq_zero_iff.mp hterm) + +/-- Carlet Proposition 15, null-derivative case: for a nonzero direction, the derivative is +zero exactly when the raw Walsh support lies in the perpendicular hyperplane. -/ +theorem booleanDerivative_eq_zero_iff_walshSupport_subset_hyperplane + (f : BooleanFunction n) (e : FABL.F₂Cube n) (he : e ≠ 0) : + FABL.booleanDerivative f e = 0 ↔ + (↑(walshSupport f) : Set (FABL.F₂Cube n)) ⊆ + (walshHyperplane e : Set (FABL.F₂Cube n)) := by + classical + constructor + · intro hderivative u hu + by_contra huperp + have hdot : FABL.f₂DotProduct u e = 1 := + Fin.eq_one_of_ne_zero _ + (fun hzero ↦ huperp ((mem_walshHyperplane_iff e u).mpr hzero)) + have hcharacter : FABL.vectorWalshCharacter u e = -1 := by + rw [FABL.vectorWalshCharacter_apply, hdot, FABL.binarySign_one] + have hsum := sum_walshTransform_sq_hyperplane_coset f e u he + have hautocorrelation := + (autocorrelation_eq_two_pow_iff_derivative_eq_zero f e).mpr hderivative + rw [hautocorrelation, hcharacter] at hsum + have hsumzero : + (∑ v : walshHyperplane e, + (walshTransform f (u + v.1) : ℝ) ^ 2) = 0 := by + nlinarith + exact (mem_walshSupport f u).mp hu + (by simpa using + (walshCoefficient_eq_zero_of_mem_coset_sum_eq_zero + f e u (0 : walshHyperplane e) hsumzero)) + · intro hsupport + have houtside (u : FABL.F₂Cube n) (hu : u ∉ walshHyperplane e) : + walshTransform f u = 0 := by + by_contra hnonzero + exact hu (hsupport ((mem_walshSupport f u).mpr hnonzero)) + have hsubtype : + (∑ u : walshHyperplane e, + (walshTransform f u.1 : ℝ) ^ 2) = + ∑ u ∈ Finset.univ.filter (fun u : FABL.F₂Cube n ↦ + u ∈ walshHyperplane e), (walshTransform f u : ℝ) ^ 2 := by + apply Finset.sum_bij (fun u _ ↦ u.1) + · intro u _ + simp [u.2] + · intro u _ v _ huv + exact Subtype.ext huv + · intro u hu + have huperp : u ∈ walshHyperplane e := by simpa using hu + exact ⟨⟨u, huperp⟩, Finset.mem_univ _, rfl⟩ + · intro _ _ + rfl + have hinside : + (∑ u : walshHyperplane e, + (walshTransform f u.1 : ℝ) ^ 2) = + ∑ u : FABL.F₂Cube n, (walshTransform f u : ℝ) ^ 2 := by + rw [hsubtype] + apply Finset.sum_subset (Finset.filter_subset _ _) + intro u _ hu + have hunot : u ∉ walshHyperplane e := by simpa using hu + rw [houtside u hunot] + norm_num + have hcoset := sum_walshTransform_sq_hyperplane_coset f e 0 he + simp only [zero_add, FABL.vectorWalshCharacter_zero, AddChar.one_apply, + one_mul] at hcoset + rw [hinside, sum_walshTransform_sq_eq_two_pow_sq] at hcoset + have hn := positive_dimension_of_ne_zero e he + have hpow := two_pow_eq_two_mul_two_pow_pred (n := n) hn + have hpositive : 0 < (2 : ℝ) ^ (n - 1) := by positivity + apply (autocorrelation_eq_two_pow_iff_derivative_eq_zero f e).mp + nlinarith + +/-- Carlet Proposition 15, one-derivative case: for a nonzero direction, the derivative is +one exactly when the raw Walsh support lies in the complementary hyperplane coset. -/ +theorem booleanDerivative_eq_one_iff_walshSupport_subset_hyperplane_compl + (f : BooleanFunction n) (e : FABL.F₂Cube n) (he : e ≠ 0) : + FABL.booleanDerivative f e = 1 ↔ + (↑(walshSupport f) : Set (FABL.F₂Cube n)) ⊆ + (walshHyperplane e : Set (FABL.F₂Cube n))ᶜ := by + classical + constructor + · intro hderivative u hu + change u ∉ walshHyperplane e + intro huperp + have hsum := sum_walshTransform_sq_hyperplane_coset f e 0 he + have hautocorrelation := + (autocorrelation_eq_neg_two_pow_iff_derivative_eq_one f e).mpr hderivative + simp only [zero_add, FABL.vectorWalshCharacter_zero, AddChar.one_apply, + one_mul, hautocorrelation, add_neg_cancel, mul_zero] at hsum + have hsum' : + (∑ w : walshHyperplane e, + (walshTransform f (0 + w.1) : ℝ) ^ 2) = 0 := by + simpa using hsum + let v : walshHyperplane e := ⟨u, huperp⟩ + exact (mem_walshSupport f u).mp hu + (by simpa [v] using + (walshCoefficient_eq_zero_of_mem_coset_sum_eq_zero f e 0 v hsum')) + · intro hsupport + have hinsideZero (u : walshHyperplane e) : walshTransform f u.1 = 0 := by + by_contra hnonzero + have hcompl := hsupport ((mem_walshSupport f u.1).mpr hnonzero) + exact hcompl u.2 + have hsumzero : + (∑ u : walshHyperplane e, + (walshTransform f u.1 : ℝ) ^ 2) = 0 := by + apply Finset.sum_eq_zero + intro u _ + rw [hinsideZero u] + norm_num + have hcoset := sum_walshTransform_sq_hyperplane_coset f e 0 he + simp only [zero_add, FABL.vectorWalshCharacter_zero, AddChar.one_apply, + one_mul] at hcoset + rw [hsumzero] at hcoset + have hpositive : 0 < (2 : ℝ) ^ (n - 1) := by positivity + apply (autocorrelation_eq_neg_two_pow_iff_derivative_eq_one f e).mp + nlinarith + +/-- A derivative equal to one pairs the inputs of `f` into opposite-valued translates, so `f` +is balanced. -/ +theorem isBalanced_of_booleanDerivative_eq_one + (f : BooleanFunction n) (e : FABL.F₂Cube n) + (hderivative : FABL.booleanDerivative f e = 1) : IsBalanced f := by + have he : e ≠ 0 := by + intro hezero + subst e + have hvalue := congrFun hderivative 0 + simp only [FABL.booleanDerivative, add_zero, Pi.one_apply] at hvalue + rw [ZModModule.add_self] at hvalue + exact zero_ne_one hvalue + have hsupport := + (booleanDerivative_eq_one_iff_walshSupport_subset_hyperplane_compl + f e he).mp hderivative + apply (isBalanced_iff_walshTransform_zero_eq_zero f).mpr + by_contra hnonzero + have hzeroCompl := hsupport ((mem_walshSupport f 0).mpr hnonzero) + exact hzeroCompl (by simp) + +/-- For a non-balanced function, a direction is a linear structure exactly when its derivative +is the null function. -/ +theorem isLinearStructure_iff_booleanDerivative_eq_zero_of_not_balanced + (f : BooleanFunction n) (e : FABL.F₂Cube n) (hf : ¬ IsBalanced f) : + IsLinearStructure f e ↔ FABL.booleanDerivative f e = 0 := by + constructor + · rintro ⟨ε, hε⟩ + by_cases hzero : ε = 0 + · funext x + simpa [hzero] using hε x + · have hone : ε = 1 := Fin.eq_one_of_ne_zero ε hzero + apply False.elim + apply hf + apply isBalanced_of_booleanDerivative_eq_one f e + funext x + simpa [hone] using hε x + · intro h + exact ⟨0, fun x ↦ congrFun h x⟩ + +/-- The linear span of the raw Walsh support. -/ +noncomputable def walshSupportSpan (f : BooleanFunction n) : + Submodule FABL.𝔽₂ (FABL.F₂Cube n) := + Submodule.span FABL.𝔽₂ (↑(walshSupport f) : Set (FABL.F₂Cube n)) + +/-- Carlet's rank of the raw Walsh support. -/ +noncomputable def walshSupportRank (f : BooleanFunction n) : ℕ := + Module.finrank FABL.𝔽₂ (walshSupportSpan f) + +private theorem walshHyperplane_ne_top + (e : FABL.F₂Cube n) (he : e ≠ 0) : walshHyperplane e ≠ ⊤ := by + intro htop + have hfinrank := congrArg + (fun S : Submodule FABL.𝔽₂ (FABL.F₂Cube n) ↦ + Module.finrank FABL.𝔽₂ S) htop + have hn := positive_dimension_of_ne_zero e he + have : n - 1 = n := by + rw [walshHyperplane, FABL.finrank_perpendicularSubspace, + finrank_span_singleton he] at hfinrank + simpa using hfinrank + omega + +private theorem exists_nonzero_walshHyperplane_of_ne_top + (S : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) (hS : S ≠ ⊤) : + ∃ e : FABL.F₂Cube n, e ≠ 0 ∧ S ≤ walshHyperplane e := by + have hlt : Module.finrank FABL.𝔽₂ S < n := by + simpa using S.finrank_lt hS + have hperpPositive : + 0 < Module.finrank FABL.𝔽₂ (FABL.perpendicularSubspace S) := by + rw [FABL.finrank_perpendicularSubspace] + omega + obtain ⟨e, he⟩ := + Module.finrank_pos_iff_exists_ne_zero.mp hperpPositive + refine ⟨e.1, ?_, ?_⟩ + · intro hzero + exact he (Subtype.ext hzero) + · intro u hu + apply (mem_walshHyperplane_iff e.1 u).mpr + have hdot := + (FABL.mem_perpendicularSubspace_iff S e.1).mp e.2 u hu + simpa [FABL.f₂DotProduct, dotProduct_comm] using hdot + +/-- The Walsh support spans the full cube exactly when no nonzero direction has null +derivative. -/ +theorem no_nonzero_null_derivative_iff_walshSupportSpan_eq_top + (f : BooleanFunction n) : + (∀ e : FABL.F₂Cube n, e ≠ 0 → FABL.booleanDerivative f e ≠ 0) ↔ + walshSupportSpan f = ⊤ := by + constructor + · intro hnull + by_contra hspan + obtain ⟨e, he, hle⟩ := + exists_nonzero_walshHyperplane_of_ne_top (walshSupportSpan f) hspan + have hsupport : + (↑(walshSupport f) : Set (FABL.F₂Cube n)) ⊆ + (walshHyperplane e : Set (FABL.F₂Cube n)) := by + intro u hu + exact hle (Submodule.subset_span hu) + exact hnull e he + ((booleanDerivative_eq_zero_iff_walshSupport_subset_hyperplane + f e he).mpr hsupport) + · intro hspan e he hderivative + have hsupport := + (booleanDerivative_eq_zero_iff_walshSupport_subset_hyperplane + f e he).mp hderivative + have hle : walshSupportSpan f ≤ walshHyperplane e := + Submodule.span_le.mpr hsupport + have htop : walshHyperplane e = ⊤ := by + apply top_unique + simpa [hspan] using hle + exact walshHyperplane_ne_top e he htop + +/-- Full Walsh-support rank is equivalent to spanning the binary cube. -/ +theorem walshSupportRank_eq_n_iff (f : BooleanFunction n) : + walshSupportRank f = n ↔ walshSupportSpan f = ⊤ := by + constructor + · intro hrank + apply Submodule.eq_top_of_finrank_eq + simpa [walshSupportRank] using hrank + · intro hspan + rw [walshSupportRank, hspan] + simp + +/-- Carlet's full-rank consequence of Proposition 15: a non-balanced function has no nonzero +linear structure exactly when its Walsh support has rank `n`. -/ +theorem no_nonzero_linearStructure_iff_walshSupportRank_eq_n_of_not_balanced + (f : BooleanFunction n) (hf : ¬ IsBalanced f) : + (∀ e : FABL.F₂Cube n, e ≠ 0 → ¬ IsLinearStructure f e) ↔ + walshSupportRank f = n := by + rw [walshSupportRank_eq_n_iff, + ← no_nonzero_null_derivative_iff_walshSupportSpan_eq_top] + constructor + · intro hlinear e he hderivative + exact hlinear e he + ((isLinearStructure_iff_booleanDerivative_eq_zero_of_not_balanced + f e hf).mpr hderivative) + · intro hnull e he hlinear + exact hnull e he + ((isLinearStructure_iff_booleanDerivative_eq_zero_of_not_balanced + f e hf).mp hlinear) + +end CryptBoolean diff --git a/CryptBoolean/Carlet/Chapter04/LinearStructures.lean b/CryptBoolean/Carlet/Chapter04/LinearStructures.lean new file mode 100644 index 0000000..fa18ac9 --- /dev/null +++ b/CryptBoolean/Carlet/Chapter04/LinearStructures.lean @@ -0,0 +1,85 @@ +/- +Copyright (c) 2026 Asher Yan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Asher Yan with Codex +-/ +module + +public import CryptBoolean.Carlet.Chapter02.Derivatives + +/-! +# Carlet Chapter 4 linear structures + +Linear structures are the directions in which a binary derivative is constant. They form the +linear kernel of the function. +-/ + +open scoped BooleanCube + +@[expose] public section + +namespace CryptBoolean + +variable {n : ℕ} + +/-- A direction is a linear structure when the corresponding binary derivative is constant. -/ +def IsLinearStructure (f : BooleanFunction n) (e : FABL.F₂Cube n) : Prop := + ∃ ε : FABL.𝔽₂, ∀ x, FABL.booleanDerivative f e x = ε + +/-- The zero direction is a linear structure of every Boolean function. -/ +theorem isLinearStructure_zero (f : BooleanFunction n) : + IsLinearStructure f 0 := by + refine ⟨0, ?_⟩ + intro x + rw [FABL.booleanDerivative, add_zero, ZModModule.add_self] + +/-- The derivative in a sum of directions is the sum of two translated derivatives. -/ +theorem booleanDerivative_add_direction + (f : BooleanFunction n) (e d x : FABL.F₂Cube n) : + FABL.booleanDerivative f (e + d) x = + FABL.booleanDerivative f e (x + d) + FABL.booleanDerivative f d x := by + rw [FABL.booleanDerivative, FABL.booleanDerivative, FABL.booleanDerivative] + have harg : (x + d) + e = x + (e + d) := by + abel + rw [harg] + symm + calc + (f (x + d) + f (x + (e + d))) + (f x + f (x + d)) = + (f (x + d) + f (x + d)) + (f (x + (e + d)) + f x) := by + abel + _ = f (x + (e + d)) + f x := by + rw [ZModModule.add_self, zero_add] + _ = f x + f (x + (e + d)) := add_comm _ _ + +/-- The sum of two linear structures is a linear structure. -/ +theorem IsLinearStructure.add {f : BooleanFunction n} {e d : FABL.F₂Cube n} + (he : IsLinearStructure f e) (hd : IsLinearStructure f d) : + IsLinearStructure f (e + d) := by + obtain ⟨ε, hε⟩ := he + obtain ⟨δ, hδ⟩ := hd + refine ⟨ε + δ, ?_⟩ + intro x + rw [booleanDerivative_add_direction, hε, hδ] + +/-- Scalar multiples of linear structures are linear structures. -/ +theorem IsLinearStructure.smul {f : BooleanFunction n} {e : FABL.F₂Cube n} + (he : IsLinearStructure f e) (c : FABL.𝔽₂) : + IsLinearStructure f (c • e) := by + by_cases hc : c = 0 + · simpa [hc] using isLinearStructure_zero f + · have hc_one : c = 1 := Fin.eq_one_of_ne_zero c hc + simpa [hc_one] using he + +/-- Carlet's linear kernel, consisting of all linear structures of a Boolean function. -/ +def linearKernel (f : BooleanFunction n) : Submodule FABL.𝔽₂ (FABL.F₂Cube n) where + carrier := {e | IsLinearStructure f e} + zero_mem' := isLinearStructure_zero f + add_mem' he hd := he.add hd + smul_mem' c _ he := he.smul c + +/-- Membership in the linear kernel is exactly the linear-structure condition. -/ +@[simp] theorem mem_linearKernel (f : BooleanFunction n) (e : FABL.F₂Cube n) : + e ∈ linearKernel f ↔ IsLinearStructure f e := + Iff.rfl + +end CryptBoolean diff --git a/CryptBoolean/Carlet/Chapter04/MaximumCorrelation.lean b/CryptBoolean/Carlet/Chapter04/MaximumCorrelation.lean new file mode 100644 index 0000000..372951f --- /dev/null +++ b/CryptBoolean/Carlet/Chapter04/MaximumCorrelation.lean @@ -0,0 +1,778 @@ +/- +Copyright (c) 2026 Asher Yan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Asher Yan with Codex +-/ +module + +public import CryptBoolean.Carlet.Chapter04.HigherOrderJuntaDistance +public import CryptBoolean.Carlet.Chapter04.Resiliency +public import FABL.Chapter06.Pseudorandomness.RestrictionMeanVariance + +/-! +# Carlet Chapter 4 maximum correlation + +Maximum correlation with functions depending on a prescribed coordinate set, +its restriction formula, and the Walsh-square bounds in Relation (40). +-/ + +open Finset Set +open scoped BigOperators BooleanCube + +@[expose] public section + +namespace CryptBoolean + +variable {n : ℕ} + +/-- Sign choices indexed by assignments to the coordinates in `I`. FABL's +restriction convention makes these the fixed coordinates of the free set `Iᶜ`. -/ +abbrev CoordinateSignChoice (I : Finset (Fin n)) := + FABL.FixedSignCube Iᶜ → FABL.Sign + +/-- The Boolean function depending on `I` induced by one sign choice for each +assignment to those coordinates. -/ +def coordinateBooleanFunction (I : Finset (Fin n)) + (g : CoordinateSignChoice I) : BooleanFunction n := + fun x ↦ FABL.binarySignEquiv.symm + (g ((FABL.signCubeSplitEquiv Iᶜ (FABL.binaryCubeSignEquiv n x)).2)) + +/-- Every function represented by `coordinateBooleanFunction I` depends only +on the coordinates in `I`. -/ +theorem coordinateBooleanFunction_dependsOn (I : Finset (Fin n)) + (g : CoordinateSignChoice I) : + DependsOn (coordinateBooleanFunction I g) (I : Set (Fin n)) := by + intro x y hxy + apply FABL.binarySignEquiv.injective + simp only [coordinateBooleanFunction, FABL.binarySignEquiv.apply_symm_apply] + congr 1 + funext i + have hiI : (i : Fin n) ∈ I := by + simpa using i.property + exact congrArg FABL.binarySignEquiv (hxy i hiI) + +/-- The coordinate-sign representation is exactly the class of Boolean +functions depending only on `I`. -/ +theorem exists_coordinateSignChoice_iff_dependsOn + (I : Finset (Fin n)) (g : BooleanFunction n) : + (∃ q : CoordinateSignChoice I, coordinateBooleanFunction I q = g) ↔ + DependsOn g (I : Set (Fin n)) := by + constructor + · rintro ⟨q, rfl⟩ + exact coordinateBooleanFunction_dependsOn I q + · intro hdepends + let q : CoordinateSignChoice I := fun z ↦ + FABL.signEncode + (g ((FABL.binaryCubeSignEquiv n).symm + (FABL.combineSignCube Iᶜ (fun _ ↦ 1) z))) + refine ⟨q, funext fun x ↦ ?_⟩ + let s : {−1,1}^[n] := FABL.binaryCubeSignEquiv n x + let z : FABL.FixedSignCube Iᶜ := + ((FABL.signCubeSplitEquiv Iᶜ) s).2 + let x₀ : FABL.F₂Cube n := + (FABL.binaryCubeSignEquiv n).symm + (FABL.combineSignCube Iᶜ (fun _ ↦ 1) z) + have hx₀x : ∀ i ∈ (I : Set (Fin n)), x₀ i = x i := by + intro i hiI + have hiFixed : i ∉ Iᶜ := by simpa using hiI + apply FABL.binarySignEquiv.injective + change FABL.signEncode (x₀ i) = FABL.signEncode (x i) + rw [← FABL.binaryCubeSignEquiv_apply, + ← FABL.binaryCubeSignEquiv_apply] + have hx₀sign : FABL.binaryCubeSignEquiv n x₀ = + FABL.combineSignCube Iᶜ (fun _ ↦ 1) z := by + dsimp [x₀] + exact (FABL.binaryCubeSignEquiv n).apply_symm_apply _ + rw [hx₀sign] + rw [show FABL.combineSignCube Iᶜ (fun _ ↦ 1) z i = + z ⟨i, hiFixed⟩ by + exact FABL.combineSignCube_apply_fixed Iᶜ (fun _ ↦ 1) z + ⟨i, hiFixed⟩] + have hreconstruct : + FABL.combineSignCube Iᶜ + ((FABL.signCubeSplitEquiv Iᶜ s).1) + ((FABL.signCubeSplitEquiv Iᶜ s).2) = s := + (FABL.signCubeSplitEquiv Iᶜ).symm_apply_apply s + have hi := congrFun hreconstruct i + rw [show FABL.combineSignCube Iᶜ + ((FABL.signCubeSplitEquiv Iᶜ s).1) + ((FABL.signCubeSplitEquiv Iᶜ s).2) i = + ((FABL.signCubeSplitEquiv Iᶜ s).2) ⟨i, hiFixed⟩ by + exact FABL.combineSignCube_apply_fixed Iᶜ + ((FABL.signCubeSplitEquiv Iᶜ s).1) + ((FABL.signCubeSplitEquiv Iᶜ s).2) ⟨i, hiFixed⟩] at hi + exact hi + have hg : g x₀ = g x := hdepends hx₀x + change FABL.binarySignEquiv.symm + (FABL.signEncode (g x₀)) = g x + rw [show FABL.signEncode (g x₀) = FABL.binarySignEquiv (g x₀) by rfl, + FABL.binarySignEquiv.symm_apply_apply, hg] + +/-- A normalized correlation, with Carlet's raw zero-frequency Walsh sum made +explicit before division by the cube cardinality. -/ +noncomputable def normalizedCorrelation + (f g : BooleanFunction n) : ℝ := + (walshTransform (f + g) 0 : ℝ) / (2 : ℝ) ^ n + +/-- Normalized correlation is one minus twice relative Hamming distance. -/ +theorem normalizedCorrelation_eq_one_sub_two_mul_hammingDistance + (f g : BooleanFunction n) : + normalizedCorrelation f g = + 1 - 2 * (hammingDistance f g : ℝ) / (2 : ℝ) ^ n := by + rw [normalizedCorrelation, walshTransform_zero_eq_two_pow_sub_two_weight, + ← hammingDistance_eq_hammingWeight_add] + push_cast + field_simp + +/-- Carlet's `BF_{I,n}` distance: minimum raw Hamming distance to a Boolean +function depending only on the coordinates in `I`. -/ +noncomputable def distanceToCoordinateFunctions + (f : BooleanFunction n) (I : Finset (Fin n)) : ℕ := + (Finset.univ : Finset (CoordinateSignChoice I)).inf' + Finset.univ_nonempty fun g ↦ + hammingDistance f (coordinateBooleanFunction I g) + +/-- Carlet's maximum correlation `C_f(I)`, as the maximum normalized raw +correlation with a Boolean function depending only on `I`. -/ +noncomputable def maximumCorrelation + (f : BooleanFunction n) (I : Finset (Fin n)) : ℝ := + (Finset.univ : Finset (CoordinateSignChoice I)).sup' + Finset.univ_nonempty fun g ↦ + normalizedCorrelation f (coordinateBooleanFunction I g) + +/-- The source distance formula `d_H(f,BF_{I,n}) = 2^(n-1)(1-C_f(I))`, +written as `2^n / 2` so that it also has the intended meaning at `n = 0`. -/ +theorem distanceToCoordinateFunctions_cast_eq + (f : BooleanFunction n) (I : Finset (Fin n)) : + (distanceToCoordinateFunctions f I : ℝ) = + (2 : ℝ) ^ n / 2 * (1 - maximumCorrelation f I) := by + classical + have hpow : 0 < (2 : ℝ) ^ n := by positivity + apply le_antisymm + · have hmaximum : + maximumCorrelation f I ≤ + 1 - 2 * (distanceToCoordinateFunctions f I : ℝ) / + (2 : ℝ) ^ n := by + unfold maximumCorrelation + apply Finset.sup'_le Finset.univ_nonempty + intro g _hg + rw [normalizedCorrelation_eq_one_sub_two_mul_hammingDistance] + have hdist := Finset.inf'_le + (fun q : CoordinateSignChoice I ↦ + hammingDistance f (coordinateBooleanFunction I q)) + (Finset.mem_univ g) + have hdistReal : + (distanceToCoordinateFunctions f I : ℝ) ≤ + (hammingDistance f (coordinateBooleanFunction I g) : ℝ) := by + exact_mod_cast hdist + have hscaled := + (div_le_div_iff_of_pos_right hpow).mpr + (mul_le_mul_of_nonneg_left hdistReal (by norm_num : (0 : ℝ) ≤ 2)) + linarith + calc + (distanceToCoordinateFunctions f I : ℝ) = + (2 : ℝ) ^ n / 2 * + (1 - (1 - 2 * (distanceToCoordinateFunctions f I : ℝ) / + (2 : ℝ) ^ n)) := by + field_simp + ring + _ ≤ (2 : ℝ) ^ n / 2 * (1 - maximumCorrelation f I) := + mul_le_mul_of_nonneg_left (sub_le_sub_left hmaximum 1) (by positivity) + · obtain ⟨g, _hg, hmin⟩ := Finset.exists_mem_eq_inf' + (s := (Finset.univ : Finset (CoordinateSignChoice I))) + Finset.univ_nonempty + (fun g ↦ hammingDistance f (coordinateBooleanFunction I g)) + have hmin' : distanceToCoordinateFunctions f I = + hammingDistance f (coordinateBooleanFunction I g) := by + simpa [distanceToCoordinateFunctions] using hmin + have hsup := Finset.le_sup' + (fun q : CoordinateSignChoice I ↦ + normalizedCorrelation f (coordinateBooleanFunction I q)) + (Finset.mem_univ g) + have hsup' : + normalizedCorrelation f (coordinateBooleanFunction I g) ≤ + maximumCorrelation f I := by + simpa [maximumCorrelation] using hsup + rw [normalizedCorrelation_eq_one_sub_two_mul_hammingDistance, + ← hmin'] at hsup' + calc + (2 : ℝ) ^ n / 2 * (1 - maximumCorrelation f I) ≤ + (2 : ℝ) ^ n / 2 * + (1 - (1 - 2 * (distanceToCoordinateFunctions f I : ℝ) / + (2 : ℝ) ^ n)) := + mul_le_mul_of_nonneg_left (sub_le_sub_left hsup' 1) (by positivity) + _ = (distanceToCoordinateFunctions f I : ℝ) := by + field_simp + ring + +/-- Distance to functions on a prescribed `r`-coordinate set is at least the +order-`r` nonlinearity. -/ +theorem higherOrderNonlinearity_le_distanceToCoordinateFunctions + (f : BooleanFunction n) (I : Finset (Fin n)) : + higherOrderNonlinearity I.card f ≤ distanceToCoordinateFunctions f I := by + classical + unfold distanceToCoordinateFunctions + apply Finset.le_inf' + intro g _hg + exact higherOrderNonlinearity_le_hammingDistance_of_dependsOn + I.card f (coordinateBooleanFunction I g) I rfl + (coordinateBooleanFunction_dependsOn I g) + +/-- The normalized absolute imbalance of the restrictions obtained by fixing +the coordinates in `I`. -/ +noncomputable def restrictionMaximumCorrelation + (f : BooleanFunction n) (I : Finset (Fin n)) : ℝ := + 𝔼 z : FABL.FixedSignCube Iᶜ, + |FABL.mean + (FABL.signRestriction (signCubeView f).toReal Iᶜ z)| + +private theorem realSignView_coordinateBooleanFunction_add + (f : BooleanFunction n) (I : Finset (Fin n)) + (g : CoordinateSignChoice I) (x : FABL.F₂Cube n) : + realSignView (f + coordinateBooleanFunction I g) x = + realSignView f x * + FABL.signValue + (g ((FABL.signCubeSplitEquiv Iᶜ + (FABL.binaryCubeSignEquiv n x)).2)) := by + unfold realSignView FABL.realSignEncodedFunction FABL.signEncodedFunction + coordinateBooleanFunction + rw [Pi.add_apply, FABL.signEncode_add] + have hdecode : + FABL.signEncode + (FABL.binarySignEquiv.symm + (g ((FABL.signCubeSplitEquiv Iᶜ + (FABL.binaryCubeSignEquiv n x)).2))) = + g ((FABL.signCubeSplitEquiv Iᶜ + (FABL.binaryCubeSignEquiv n x)).2) := by + exact FABL.binarySignEquiv.apply_symm_apply _ + rw [hdecode] + simp [FABL.signValue] + +private theorem normalizedCorrelation_coordinateBooleanFunction_eq + (f : BooleanFunction n) (I : Finset (Fin n)) + (g : CoordinateSignChoice I) : + normalizedCorrelation f (coordinateBooleanFunction I g) = + 𝔼 z : FABL.FixedSignCube Iᶜ, + FABL.signValue (g z) * + FABL.mean + (FABL.signRestriction (signCubeView f).toReal Iᶜ z) := by + classical + rw [normalizedCorrelation, + walshTransform_eq_two_pow_mul_vectorFourierCoeff] + have hpow : (2 : ℝ) ^ n ≠ 0 := by positivity + rw [mul_div_cancel_left₀ _ hpow] + rw [FABL.vectorFourierCoeff_eq_expect] + have hcharacter (x : FABL.F₂Cube n) : + FABL.vectorWalshCharacter 0 x = 1 := by + rw [FABL.vectorWalshCharacter_apply] + simp [FABL.f₂DotProduct, dotProduct] + simp_rw [hcharacter, mul_one] + let e : FABL.F₂Cube n ≃ + FABL.FreeSignCube Iᶜ × FABL.FixedSignCube Iᶜ := + (FABL.binaryCubeSignEquiv n).trans (FABL.signCubeSplitEquiv Iᶜ) + calc + (𝔼 x : FABL.F₂Cube n, + realSignView (f + coordinateBooleanFunction I g) x) = + 𝔼 yz : FABL.FreeSignCube Iᶜ × FABL.FixedSignCube Iᶜ, + FABL.signValue (g yz.2) * + (signCubeView f).toReal + (FABL.combineSignCube Iᶜ yz.1 yz.2) := by + apply Fintype.expect_equiv e + intro x + rw [realSignView_coordinateBooleanFunction_add] + change realSignView f x * FABL.signValue (g (e x).2) = + FABL.signValue (g (e x).2) * + (signCubeView f).toReal + (FABL.combineSignCube Iᶜ (e x).1 (e x).2) + rw [mul_comm] + congr 1 + rw [signCubeView_toReal] + change realSignView f x = + realSignView f + ((FABL.binaryCubeSignEquiv n).symm + (FABL.combineSignCube Iᶜ (e x).1 (e x).2)) + congr 1 + apply (FABL.binaryCubeSignEquiv n).injective + rw [(FABL.binaryCubeSignEquiv n).apply_symm_apply] + change FABL.binaryCubeSignEquiv n x = + (FABL.signCubeSplitEquiv Iᶜ).symm + ((FABL.signCubeSplitEquiv Iᶜ) + (FABL.binaryCubeSignEquiv n x)) + exact ((FABL.signCubeSplitEquiv Iᶜ).symm_apply_apply _).symm + _ = 𝔼 z : FABL.FixedSignCube Iᶜ, + 𝔼 y : FABL.FreeSignCube Iᶜ, + FABL.signValue (g z) * + (signCubeView f).toReal + (FABL.combineSignCube Iᶜ y z) := by + calc + (𝔼 yz : FABL.FreeSignCube Iᶜ × FABL.FixedSignCube Iᶜ, + FABL.signValue (g yz.2) * + (signCubeView f).toReal + (FABL.combineSignCube Iᶜ yz.1 yz.2)) = + 𝔼 y : FABL.FreeSignCube Iᶜ, + 𝔼 z : FABL.FixedSignCube Iᶜ, + FABL.signValue (g z) * + (signCubeView f).toReal + (FABL.combineSignCube Iᶜ y z) := by + simpa only [Finset.univ_product_univ] using + (Finset.expect_product' + (Finset.univ : Finset (FABL.FreeSignCube Iᶜ)) + (Finset.univ : Finset (FABL.FixedSignCube Iᶜ)) + (fun y z ↦ FABL.signValue (g z) * + (signCubeView f).toReal + (FABL.combineSignCube Iᶜ y z))) + _ = 𝔼 z : FABL.FixedSignCube Iᶜ, + 𝔼 y : FABL.FreeSignCube Iᶜ, + FABL.signValue (g z) * + (signCubeView f).toReal + (FABL.combineSignCube Iᶜ y z) := + Finset.expect_comm Finset.univ Finset.univ _ + _ = 𝔼 z : FABL.FixedSignCube Iᶜ, + FABL.signValue (g z) * + FABL.mean + (FABL.signRestriction (signCubeView f).toReal Iᶜ z) := by + apply Finset.expect_congr rfl + intro z _hz + rw [← Finset.mul_expect] + rfl + +private noncomputable def maximizingCoordinateSignChoice + (f : BooleanFunction n) (I : Finset (Fin n)) : CoordinateSignChoice I := + fun z ↦ + if 0 ≤ FABL.mean + (FABL.signRestriction (signCubeView f).toReal Iᶜ z) + then 1 else -1 + +private theorem maximizingCoordinateSignChoice_mul_mean + (f : BooleanFunction n) (I : Finset (Fin n)) + (z : FABL.FixedSignCube Iᶜ) : + FABL.signValue (maximizingCoordinateSignChoice f I z) * + FABL.mean (FABL.signRestriction (signCubeView f).toReal Iᶜ z) = + |FABL.mean + (FABL.signRestriction (signCubeView f).toReal Iᶜ z)| := by + by_cases h : 0 ≤ FABL.mean + (FABL.signRestriction (signCubeView f).toReal Iᶜ z) + · simp [maximizingCoordinateSignChoice, h, abs_of_nonneg h] + · have hneg : FABL.mean + (FABL.signRestriction (signCubeView f).toReal Iᶜ z) < 0 := + lt_of_not_ge h + simp [maximizingCoordinateSignChoice, h, abs_of_neg hneg] + +/-- The maximum correlation is the average absolute imbalance of all +restrictions obtained by fixing the coordinates in `I`. -/ +theorem maximumCorrelation_eq_restrictionMaximumCorrelation + (f : BooleanFunction n) (I : Finset (Fin n)) : + maximumCorrelation f I = restrictionMaximumCorrelation f I := by + classical + unfold maximumCorrelation restrictionMaximumCorrelation + apply le_antisymm + · apply Finset.sup'_le + intro g _hg + rw [normalizedCorrelation_coordinateBooleanFunction_eq] + apply Finset.expect_le_expect + intro z _hz + rcases Int.units_eq_one_or (g z) with hz | hz + · simp [hz, le_abs_self] + · simp [hz, neg_le_abs] + · have hle := Finset.le_sup' + (fun g : CoordinateSignChoice I ↦ + normalizedCorrelation f (coordinateBooleanFunction I g)) + (Finset.mem_univ (maximizingCoordinateSignChoice f I)) + rw [normalizedCorrelation_coordinateBooleanFunction_eq] at hle + simpa only [maximizingCoordinateSignChoice_mul_mean] using hle + +/-- The unnormalized sign imbalance of the restriction obtained by fixing +the coordinates in `I` to `z`. -/ +noncomputable def restrictionRawImbalance + (f : BooleanFunction n) (I : Finset (Fin n)) + (z : FABL.FixedSignCube Iᶜ) : ℝ := + ∑ y : FABL.FreeSignCube Iᶜ, + (signCubeView f).toReal (FABL.combineSignCube Iᶜ y z) + +/-- Carlet's displayed restriction formula: +`C_f(I) = 2⁻ⁿ ∑_z |ℱ(f|_z)|`. -/ +theorem maximumCorrelation_eq_sum_abs_restrictionRawImbalance_div_two_pow + (f : BooleanFunction n) (I : Finset (Fin n)) : + maximumCorrelation f I = + (∑ z : FABL.FixedSignCube Iᶜ, |restrictionRawImbalance f I z|) / + (2 : ℝ) ^ n := by + classical + rw [maximumCorrelation_eq_restrictionMaximumCorrelation] + unfold restrictionMaximumCorrelation restrictionRawImbalance FABL.mean + simp_rw [Fintype.expect_eq_sum_div_card] + have hfreePos : + (0 : ℝ) < Fintype.card (FABL.FreeSignCube Iᶜ) := by positivity + have hfixedPos : + (0 : ℝ) < Fintype.card (FABL.FixedSignCube Iᶜ) := by positivity + have hcard : + (Fintype.card (FABL.FreeSignCube Iᶜ) : ℝ) * + Fintype.card (FABL.FixedSignCube Iᶜ) = + (2 : ℝ) ^ n := by + have hcardNat := Fintype.card_congr + ((FABL.binaryCubeSignEquiv n).trans (FABL.signCubeSplitEquiv Iᶜ)) + rw [Fintype.card_prod, card_f₂Cube] at hcardNat + exact_mod_cast hcardNat.symm + simp_rw [FABL.signRestriction_apply] + simp_rw [abs_div, abs_of_pos hfreePos] + rw [← Finset.sum_div] + calc + ((∑ z : FABL.FixedSignCube Iᶜ, + |∑ y : FABL.FreeSignCube Iᶜ, + (signCubeView f).toReal (FABL.combineSignCube Iᶜ y z)|) / + Fintype.card (FABL.FreeSignCube Iᶜ)) / + Fintype.card (FABL.FixedSignCube Iᶜ) = + (∑ z : FABL.FixedSignCube Iᶜ, + |∑ y : FABL.FreeSignCube Iᶜ, + (signCubeView f).toReal (FABL.combineSignCube Iᶜ y z)|) / + ((Fintype.card (FABL.FreeSignCube Iᶜ) : ℝ) * + Fintype.card (FABL.FixedSignCube Iᶜ)) := by + field_simp + _ = (∑ z : FABL.FixedSignCube Iᶜ, + |∑ y : FABL.FreeSignCube Iᶜ, + (signCubeView f).toReal (FABL.combineSignCube Iᶜ y z)|) / + (2 : ℝ) ^ n := by rw [hcard] + +/-- Maximum correlation vanishes exactly when every restriction obtained by +fixing `I` is balanced. -/ +theorem maximumCorrelation_eq_zero_iff_restrictions_balanced + (f : BooleanFunction n) (I : Finset (Fin n)) : + maximumCorrelation f I = 0 ↔ + ∀ z : FABL.FixedSignCube Iᶜ, + FABL.IsBalanced + (FABL.signRestriction (signCubeView f).toReal Iᶜ z) := by + rw [maximumCorrelation_eq_restrictionMaximumCorrelation] + unfold restrictionMaximumCorrelation + constructor + · intro h z + rw [FABL.IsBalanced] + have hfun : + (fun z : FABL.FixedSignCube Iᶜ ↦ + |FABL.mean + (FABL.signRestriction (signCubeView f).toReal Iᶜ z)|) = 0 := + (Fintype.expect_eq_zero_iff_of_nonneg + (fun z ↦ abs_nonneg _)).mp h + have hz := congrFun hfun z + exact abs_eq_zero.mp hz + · intro h + apply Finset.expect_eq_zero + intro z _hz + rw [h z, abs_zero] + +/-- The raw Walsh square mass on frequencies supported inside `I`. -/ +noncomputable def restrictedWalshSquareSum + (f : BooleanFunction n) (I : Finset (Fin n)) : ℝ := + ∑ u : {u : FABL.F₂Cube n // FABL.f₂Support u ⊆ I}, + (walshTransform f u.1 : ℝ) ^ 2 + +/-- The subtype-indexed definition is exactly Carlet's displayed filtered +sum over ambient frequencies. -/ +theorem restrictedWalshSquareSum_eq_sum_filter + (f : BooleanFunction n) (I : Finset (Fin n)) : + restrictedWalshSquareSum f I = + ∑ u ∈ (Finset.univ.filter + fun u : FABL.F₂Cube n ↦ FABL.f₂Support u ⊆ I), + (walshTransform f u : ℝ) ^ 2 := by + classical + unfold restrictedWalshSquareSum + symm + exact Finset.sum_subtype + (Finset.univ.filter + fun u : FABL.F₂Cube n ↦ FABL.f₂Support u ⊆ I) + (fun u ↦ by simp) (fun u ↦ (walshTransform f u : ℝ) ^ 2) + +private theorem liftFixedFrequency_subset_coordinates + (I : Finset (Fin n)) (T : Finset (FABL.FixedIndex Iᶜ)) : + FABL.liftFixedFrequency T ⊆ I := by + intro i hi + obtain ⟨j, _hj, rfl⟩ := Finset.mem_map.mp hi + simpa using j.property + +private theorem fixedFrequencyPart_liftFixedFrequency + (J : Finset (Fin n)) (T : Finset (FABL.FixedIndex J)) : + FABL.fixedFrequencyPart J (FABL.liftFixedFrequency T) = T := by + ext i + constructor + · intro hi + have hilift : (i : Fin n) ∈ FABL.liftFixedFrequency T := + (FABL.mem_fixedFrequencyPart J (FABL.liftFixedFrequency T) i).mp hi + obtain ⟨j, hjT, hji⟩ := Finset.mem_map.mp hilift + have hji' : j = i := Subtype.ext hji + simpa [hji'] using hjT + · intro hi + apply (FABL.mem_fixedFrequencyPart J (FABL.liftFixedFrequency T) i).mpr + exact Finset.mem_map.mpr ⟨i, hi, rfl⟩ + +private theorem liftFixedFrequency_fixedFrequencyPart_eq_of_subset + (I S : Finset (Fin n)) (hSI : S ⊆ I) : + FABL.liftFixedFrequency (FABL.fixedFrequencyPart Iᶜ S) = S := by + have hfree : FABL.freeFrequencyPart Iᶜ S = ∅ := by + apply Finset.eq_empty_iff_forall_notMem.mpr + intro i hi + have hiS : (i : Fin n) ∈ S := + (FABL.mem_freeFrequencyPart Iᶜ S i).mp hi + exact (Finset.mem_compl.mp i.property) (hSI hiS) + have hsplit := + FABL.liftFreeFrequencyPart_union_liftFixedFrequencyPart Iᶜ S + rw [hfree] at hsplit + simpa [FABL.liftFreeFrequency] using hsplit + +private noncomputable def fixedFrequencyEquivSupportedCube + (I : Finset (Fin n)) : + Finset (FABL.FixedIndex Iᶜ) ≃ + {u : FABL.F₂Cube n // FABL.f₂Support u ⊆ I} where + toFun T := + ⟨FABL.f₂CubeOfFinset (FABL.liftFixedFrequency T), by + rw [← FABL.f₂CubeEquivFinset_apply, + ← FABL.f₂CubeEquivFinset_symm_apply, + (FABL.f₂CubeEquivFinset n).apply_symm_apply] + exact liftFixedFrequency_subset_coordinates I T⟩ + invFun u := FABL.fixedFrequencyPart Iᶜ (FABL.f₂Support u.1) + left_inv T := by + change FABL.fixedFrequencyPart Iᶜ + (FABL.f₂Support + (FABL.f₂CubeOfFinset (FABL.liftFixedFrequency T))) = T + rw [← FABL.f₂CubeEquivFinset_apply, + ← FABL.f₂CubeEquivFinset_symm_apply, + (FABL.f₂CubeEquivFinset n).apply_symm_apply] + exact fixedFrequencyPart_liftFixedFrequency Iᶜ T + right_inv u := by + apply Subtype.ext + change FABL.f₂CubeOfFinset + (FABL.liftFixedFrequency + (FABL.fixedFrequencyPart Iᶜ (FABL.f₂Support u.1))) = u.1 + apply (FABL.f₂CubeEquivFinset n).injective + change (FABL.f₂CubeEquivFinset n) + ((FABL.f₂CubeEquivFinset n).symm + (FABL.liftFixedFrequency + (FABL.fixedFrequencyPart Iᶜ (FABL.f₂Support u.1)))) = + (FABL.f₂CubeEquivFinset n) u.1 + rw [(FABL.f₂CubeEquivFinset n).apply_symm_apply, + FABL.f₂CubeEquivFinset_apply] + exact liftFixedFrequency_fixedFrequencyPart_eq_of_subset + I (FABL.f₂Support u.1) u.2 + +private theorem restrictedWalshSquareSum_eq_sum_fixedFrequency + (f : BooleanFunction n) (I : Finset (Fin n)) : + restrictedWalshSquareSum f I = + ∑ T : Finset (FABL.FixedIndex Iᶜ), + (walshTransform f + (FABL.f₂CubeOfFinset (FABL.liftFixedFrequency T)) : ℝ) ^ 2 := by + classical + unfold restrictedWalshSquareSum + symm + apply Fintype.sum_equiv (fixedFrequencyEquivSupportedCube I) + intro T + rfl + +private theorem walshTransform_f₂CubeOfFinset_liftFixedFrequency + (f : BooleanFunction n) (I : Finset (Fin n)) + (T : Finset (FABL.FixedIndex Iᶜ)) : + (walshTransform f + (FABL.f₂CubeOfFinset (FABL.liftFixedFrequency T)) : ℝ) = + (2 : ℝ) ^ n * + FABL.fourierCoeff (signCubeView f).toReal + (FABL.liftFixedFrequency T) := by + rw [walshTransform_eq_two_pow_mul_vectorFourierCoeff, + FABL.vectorFourierCoeff_eq_fourierCoeff_binaryFunctionOnSignCube, + ← signCubeView_toReal] + rw [← FABL.f₂CubeEquivFinset_apply, + ← FABL.f₂CubeEquivFinset_symm_apply, + (FABL.f₂CubeEquivFinset n).apply_symm_apply] + +/-- The Walsh square mass on `I` is the cube-cardinality square times the +second moment of the corresponding restriction imbalances. -/ +theorem two_pow_sq_mul_expect_restrictionMean_sq_eq_restrictedWalshSquareSum + (f : BooleanFunction n) (I : Finset (Fin n)) : + ((2 : ℝ) ^ n) ^ 2 * + (𝔼 z : FABL.FixedSignCube Iᶜ, + FABL.mean + (FABL.signRestriction (signCubeView f).toReal Iᶜ z) ^ 2) = + restrictedWalshSquareSum f I := by + classical + rw [restrictedWalshSquareSum_eq_sum_fixedFrequency] + have hmean : + (𝔼 z : FABL.FixedSignCube Iᶜ, + FABL.mean + (FABL.signRestriction (signCubeView f).toReal Iᶜ z) ^ 2) = + ∑ T : Finset (FABL.FixedIndex Iᶜ), + FABL.fourierCoeff (signCubeView f).toReal + (FABL.liftFixedFrequency T) ^ 2 := by + simp_rw [FABL.mean_signRestriction_eq_restrictionFourierCoeff_empty] + simpa [FABL.liftFreeFrequency] using + FABL.expect_sq_restrictionFourierCoeff + (signCubeView f).toReal Iᶜ + (∅ : Finset (Iᶜ : Finset (Fin n))) + rw [hmean, Finset.mul_sum] + apply Finset.sum_congr rfl + intro T _hT + rw [walshTransform_f₂CubeOfFinset_liftFixedFrequency] + ring + +private theorem expect_abs_le_sqrt_expect_sq + {X : Type*} [Fintype X] [Nonempty X] (q : X → ℝ) : + (𝔼 x, |q x|) ≤ Real.sqrt (𝔼 x, q x ^ 2) := by + have hcs := Finset.expect_mul_sq_le_sq_mul_sq + (Finset.univ : Finset X) (fun x ↦ |q x|) (fun _ ↦ (1 : ℝ)) + have hsq : (𝔼 x, |q x|) ^ 2 ≤ 𝔼 x, q x ^ 2 := by + simpa [sq_abs] using hcs + have hleft : 0 ≤ 𝔼 x, |q x| := + Finset.expect_nonneg fun x _ ↦ abs_nonneg (q x) + have hright : 0 ≤ 𝔼 x, q x ^ 2 := + Finset.expect_nonneg fun x _ ↦ sq_nonneg (q x) + apply (sq_le_sq₀ hleft (Real.sqrt_nonneg _)).mp + rw [Real.sq_sqrt hright] + exact hsq + +/-- The first inequality in Carlet Relation (40). -/ +theorem maximumCorrelation_le_sqrt_restrictedWalshSquareSum_div + (f : BooleanFunction n) (I : Finset (Fin n)) : + maximumCorrelation f I ≤ + Real.sqrt (restrictedWalshSquareSum f I) / (2 : ℝ) ^ n := by + rw [maximumCorrelation_eq_restrictionMaximumCorrelation] + unfold restrictionMaximumCorrelation + let q : FABL.FixedSignCube Iᶜ → ℝ := fun z ↦ + FABL.mean (FABL.signRestriction (signCubeView f).toReal Iᶜ z) + have hcauchy : (𝔼 z, |q z|) ≤ Real.sqrt (𝔼 z, q z ^ 2) := + expect_abs_le_sqrt_expect_sq q + have hscaled := + two_pow_sq_mul_expect_restrictionMean_sq_eq_restrictedWalshSquareSum f I + change ((2 : ℝ) ^ n) ^ 2 * (𝔼 z, q z ^ 2) = + restrictedWalshSquareSum f I at hscaled + have hpow : 0 < (2 : ℝ) ^ n := by positivity + apply (le_div_iff₀ hpow).mpr + calc + (𝔼 z, |q z|) * (2 : ℝ) ^ n ≤ + Real.sqrt (𝔼 z, q z ^ 2) * (2 : ℝ) ^ n := + mul_le_mul_of_nonneg_right hcauchy hpow.le + _ = Real.sqrt (restrictedWalshSquareSum f I) := by + rw [← hscaled, Real.sqrt_mul (sq_nonneg ((2 : ℝ) ^ n)), + Real.sqrt_sq_eq_abs, abs_of_pos hpow] + ring + +private theorem walshTransform_abs_le_maxWalshMagnitude + (f : BooleanFunction n) (u : FABL.F₂Cube n) : + |(walshTransform f u : ℝ)| ≤ (maxWalshMagnitude f : ℝ) := by + have hnat := Finset.le_sup' + (fun a : FABL.F₂Cube n ↦ (walshTransform f a).natAbs) + (Finset.mem_univ u) + change (walshTransform f u).natAbs ≤ maxWalshMagnitude f at hnat + have hcast : ((walshTransform f u).natAbs : ℝ) ≤ + (maxWalshMagnitude f : ℝ) := by + exact_mod_cast hnat + simpa [Nat.cast_natAbs, Int.cast_abs] using hcast + +/-- The supported Walsh square mass is at most the number of supported +frequencies times the square of the largest Walsh magnitude. -/ +theorem restrictedWalshSquareSum_le_card_mul_maxWalshMagnitude_sq + (f : BooleanFunction n) (I : Finset (Fin n)) : + restrictedWalshSquareSum f I ≤ + (2 : ℝ) ^ I.card * (maxWalshMagnitude f : ℝ) ^ 2 := by + classical + rw [restrictedWalshSquareSum_eq_sum_fixedFrequency] + calc + (∑ T : Finset (FABL.FixedIndex Iᶜ), + (walshTransform f + (FABL.f₂CubeOfFinset (FABL.liftFixedFrequency T)) : ℝ) ^ 2) ≤ + ∑ _T : Finset (FABL.FixedIndex Iᶜ), + (maxWalshMagnitude f : ℝ) ^ 2 := by + apply Finset.sum_le_sum + intro T _hT + have habs := walshTransform_abs_le_maxWalshMagnitude f + (FABL.f₂CubeOfFinset (FABL.liftFixedFrequency T)) + have hsquare := + (sq_le_sq₀ (abs_nonneg _) (by positivity)).mpr habs + simpa only [sq_abs] using hsquare + _ = (2 : ℝ) ^ I.card * (maxWalshMagnitude f : ℝ) ^ 2 := by + rw [Finset.sum_const, Finset.card_univ, nsmul_eq_mul, + Fintype.card_finset] + simp [FABL.FixedIndex] + +/-- The square-root form of the second inequality in Relation (40). -/ +theorem sqrt_restrictedWalshSquareSum_le + (f : BooleanFunction n) (I : Finset (Fin n)) : + Real.sqrt (restrictedWalshSquareSum f I) ≤ + Real.sqrt ((2 : ℝ) ^ I.card) * (maxWalshMagnitude f : ℝ) := by + have hsqrt := Real.sqrt_le_sqrt + (restrictedWalshSquareSum_le_card_mul_maxWalshMagnitude_sq f I) + rw [Real.sqrt_mul (by positivity), Real.sqrt_sq_eq_abs, + abs_of_nonneg (by positivity : (0 : ℝ) ≤ maxWalshMagnitude f)] at hsqrt + exact hsqrt + +/-- Both maximum-correlation bounds in Carlet Relation (40), with the second +one written in its printed real-exponent and nonlinearity form. -/ +theorem relation_40_maximumCorrelation_bound + (f : BooleanFunction n) (I : Finset (Fin n)) : + maximumCorrelation f I ≤ + Real.sqrt (restrictedWalshSquareSum f I) / (2 : ℝ) ^ n ∧ + maximumCorrelation f I ≤ + (2 : ℝ) ^ (-(n : ℝ) + (I.card : ℝ) / 2) * + ((2 : ℝ) ^ n - 2 * (nonlinearity f : ℝ)) := by + refine ⟨maximumCorrelation_le_sqrt_restrictedWalshSquareSum_div f I, ?_⟩ + calc + maximumCorrelation f I ≤ + Real.sqrt (restrictedWalshSquareSum f I) / (2 : ℝ) ^ n := + maximumCorrelation_le_sqrt_restrictedWalshSquareSum_div f I + _ ≤ (Real.sqrt ((2 : ℝ) ^ I.card) * + (maxWalshMagnitude f : ℝ)) / (2 : ℝ) ^ n := + div_le_div_of_nonneg_right + (sqrt_restrictedWalshSquareSum_le f I) (by positivity) + _ = (2 : ℝ) ^ (-(n : ℝ) + (I.card : ℝ) / 2) * + ((2 : ℝ) ^ n - 2 * (nonlinearity f : ℝ)) := by + rw [sqrt_two_pow_eq_rpow] + have hrelation := congrArg (fun k : ℕ ↦ (k : ℝ)) + (two_mul_nonlinearity_add_maxWalshMagnitude f) + push_cast at hrelation + rw [show (maxWalshMagnitude f : ℝ) = + (2 : ℝ) ^ n - 2 * (nonlinearity f : ℝ) by linarith] + rw [show -(n : ℝ) + (I.card : ℝ) / 2 = + (I.card : ℝ) / 2 - (n : ℝ) by ring, + Real.rpow_sub (by norm_num : (0 : ℝ) < 2), + Real.rpow_natCast] + ring + +/-- The first equivalent distance bound in Relation (40). -/ +theorem distanceToCoordinateFunctions_cast_ge_walshSquare + (f : BooleanFunction n) (I : Finset (Fin n)) : + (2 : ℝ) ^ n / 2 - + Real.sqrt (restrictedWalshSquareSum f I) / 2 ≤ + (distanceToCoordinateFunctions f I : ℝ) := by + rw [distanceToCoordinateFunctions_cast_eq] + have hcorrelation := + maximumCorrelation_le_sqrt_restrictedWalshSquareSum_div f I + have hpow : 0 < (2 : ℝ) ^ n := by positivity + calc + (2 : ℝ) ^ n / 2 - + Real.sqrt (restrictedWalshSquareSum f I) / 2 = + (2 : ℝ) ^ n / 2 * + (1 - Real.sqrt (restrictedWalshSquareSum f I) / + (2 : ℝ) ^ n) := by + field_simp + _ ≤ (2 : ℝ) ^ n / 2 * (1 - maximumCorrelation f I) := + mul_le_mul_of_nonneg_left + (sub_le_sub_left hcorrelation 1) (by positivity) + +/-- The second equivalent distance bound in Relation (40). -/ +theorem distanceToCoordinateFunctions_cast_ge_maxWalshMagnitude + (f : BooleanFunction n) (I : Finset (Fin n)) : + (2 : ℝ) ^ n / 2 - + (2 : ℝ) ^ ((I.card : ℝ) / 2 - 1) * + (maxWalshMagnitude f : ℝ) ≤ + (distanceToCoordinateFunctions f I : ℝ) := by + calc + (2 : ℝ) ^ n / 2 - + (2 : ℝ) ^ ((I.card : ℝ) / 2 - 1) * + (maxWalshMagnitude f : ℝ) = + (2 : ℝ) ^ n / 2 - + (Real.sqrt ((2 : ℝ) ^ I.card) * + (maxWalshMagnitude f : ℝ)) / 2 := by + rw [sqrt_two_pow_eq_rpow, + Real.rpow_sub (by norm_num : (0 : ℝ) < 2), Real.rpow_one] + ring + _ ≤ (2 : ℝ) ^ n / 2 - + Real.sqrt (restrictedWalshSquareSum f I) / 2 := by + have hsqrt := sqrt_restrictedWalshSquareSum_le f I + linarith + _ ≤ (distanceToCoordinateFunctions f I : ℝ) := + distanceToCoordinateFunctions_cast_ge_walshSquare f I + +end CryptBoolean diff --git a/CryptBoolean/Carlet/Chapter04/Nonlinearity.lean b/CryptBoolean/Carlet/Chapter04/Nonlinearity.lean new file mode 100644 index 0000000..b154271 --- /dev/null +++ b/CryptBoolean/Carlet/Chapter04/Nonlinearity.lean @@ -0,0 +1,653 @@ +/- +Copyright (c) 2026 Asher Yan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Asher Yan with Codex +-/ +module + +public import CryptBoolean.Carlet.Chapter02.Affine +public import FABL.Chapter06.LearningAndTesting.DerandomizedBLR + +/-! +# Carlet Chapter 4 nonlinearity + +Raw Hamming nonlinearity, its exact normalized FABL bridge, and Carlet's +Walsh-spectrum formula. +-/ + +open Finset +open scoped BigOperators BooleanCube + +@[expose] public section + +namespace CryptBoolean + +variable {n : ℕ} + +/-- The minimum raw Hamming distance from a Boolean function to an affine function. -/ +noncomputable def nonlinearity (f : BooleanFunction n) : ℕ := + (Finset.univ : Finset (FABL.𝔽₂ × FABL.F₂Cube n)).inf' + Finset.univ_nonempty fun p ↦ + hammingDistance f (FABL.affineFunction p.1 p.2) + +/-- The largest absolute value in Carlet's unnormalized integer Walsh spectrum. -/ +noncomputable def maxWalshMagnitude (f : BooleanFunction n) : ℕ := + (Finset.univ : Finset (FABL.F₂Cube n)).sup' + Finset.univ_nonempty fun a ↦ (walshTransform f a).natAbs + +/-- Raw distance from an affine Boolean function is the cube size times the +relative distance from the corresponding affine sign. -/ +theorem hammingDistance_cast_affineFunction + (f : BooleanFunction n) (b : FABL.𝔽₂) (a : FABL.F₂Cube n) : + (hammingDistance f (FABL.affineFunction b a) : ℝ) = + (2 ^ n : ℝ) * FABL.relativeHammingDist (realSignView f) + (FABL.affineSignFunction (FABL.signEncode b) a) := by + rw [hammingDistance_eq_two_pow_mul_relativeHammingDist] + rw [← FABL.relativeHammingDist_realSignEncodedFunction] + rw [FABL.realSignEncodedFunction_affineFunction] + +/-- The real cast of Carlet's integer bit sign is FABL's additive character. -/ +theorem bitSignInt_cast (b : FABL.𝔽₂) : + (bitSignInt b : ℝ) = FABL.binarySign b := by + rw [← FABL.signValue_signEncode_eq_binarySign] + rfl + +/-- Raw distance to an affine function in terms of its signed Walsh coefficient. -/ +theorem hammingDistance_cast_affineFunction_eq + (f : BooleanFunction n) (b : FABL.𝔽₂) (a : FABL.F₂Cube n) : + (hammingDistance f (FABL.affineFunction b a) : ℝ) = + (2 ^ n : ℝ) / 2 - + (bitSignInt b : ℝ) * (walshTransform f a : ℝ) / 2 := by + rw [hammingDistance_cast_affineFunction] + rw [FABL.relativeHammingDist_affineSignFunction + (FABL.isSignValued_realSignEncodedFunction f)] + rw [walshTransform_eq_two_pow_mul_vectorFourierCoeff, bitSignInt_cast] + rw [FABL.signValue_signEncode_eq_binarySign] + ring + +/-- Distance from a linear function is `2^n/2-W_f(a)/2`. -/ +theorem hammingDistance_cast_linearFunction_eq + (f : BooleanFunction n) (a : FABL.F₂Cube n) : + (hammingDistance f (FABL.affineFunction 0 a) : ℝ) = + (2 ^ n : ℝ) / 2 - (walshTransform f a : ℝ) / 2 := by + simpa [bitSignInt] using hammingDistance_cast_affineFunction_eq f 0 a + +/-- Distance from the complement of a linear function is `2^n/2+W_f(a)/2`. -/ +theorem hammingDistance_cast_complementLinearFunction_eq + (f : BooleanFunction n) (a : FABL.F₂Cube n) : + (hammingDistance f (FABL.affineFunction 1 a) : ℝ) = + (2 ^ n : ℝ) / 2 + (walshTransform f a : ℝ) / 2 := by + rw [hammingDistance_cast_affineFunction_eq] + simp [bitSignInt] + ring + +/-- Carlet's raw nonlinearity is exactly the scaled FABL distance to affine signs. -/ +theorem nonlinearity_cast_eq_distanceToAffineSigns + (f : BooleanFunction n) : + (nonlinearity f : ℝ) = + (2 ^ n : ℝ) * FABL.distanceToAffineSigns (realSignView f) := by + classical + rw [nonlinearity, Nat.cast_finsetInf'] + unfold FABL.distanceToAffineSigns + have hpow : 0 ≤ (2 ^ n : ℝ) := by positivity + rw [Finset.apply_inf'_eq_inf'_comp Finset.univ_nonempty + (fun x : ℝ ↦ (2 ^ n : ℝ) * x) + (fun x y ↦ mul_min_of_nonneg x y hpow)] + apply le_antisymm + · apply Finset.le_inf' + intro p _hp + obtain ⟨b, hb⟩ := FABL.binarySignEquiv.surjective p.1 + change FABL.signEncode b = p.1 at hb + have hle := Finset.inf'_le + (fun q : FABL.𝔽₂ × FABL.F₂Cube n ↦ + (hammingDistance f (FABL.affineFunction q.1 q.2) : ℝ)) + (Finset.mem_univ (b, p.2)) + calc + (Finset.univ : Finset (FABL.𝔽₂ × FABL.F₂Cube n)).inf' + Finset.univ_nonempty + (fun q ↦ (hammingDistance f (FABL.affineFunction q.1 q.2) : ℝ)) ≤ + (hammingDistance f (FABL.affineFunction b p.2) : ℝ) := hle + _ = (2 ^ n : ℝ) * FABL.relativeHammingDist (realSignView f) + (FABL.affineSignFunction p.1 p.2) := by + rw [hammingDistance_cast_affineFunction, hb] + · apply Finset.le_inf' + intro p _hp + have hle := Finset.inf'_le + (fun q : FABL.Sign × FABL.F₂Cube n ↦ + (2 ^ n : ℝ) * FABL.relativeHammingDist (realSignView f) + (FABL.affineSignFunction q.1 q.2)) + (Finset.mem_univ (FABL.signEncode p.1, p.2)) + calc + (Finset.univ : Finset (FABL.Sign × FABL.F₂Cube n)).inf' + Finset.univ_nonempty + (fun q ↦ (2 ^ n : ℝ) * FABL.relativeHammingDist (realSignView f) + (FABL.affineSignFunction q.1 q.2)) ≤ + (2 ^ n : ℝ) * FABL.relativeHammingDist (realSignView f) + (FABL.affineSignFunction (FABL.signEncode p.1) p.2) := hle + _ = (hammingDistance f (FABL.affineFunction p.1 p.2) : ℝ) := by + rw [hammingDistance_cast_affineFunction] + +/-- The raw maximum Walsh magnitude is the cube size times FABL's normalized +spectral infinity norm. -/ +theorem maxWalshMagnitude_cast_eq_spectralInfinityNorm + (f : BooleanFunction n) : + (maxWalshMagnitude f : ℝ) = + (2 ^ n : ℝ) * FABL.spectralInfinityNorm (realSignView f) := by + classical + rw [maxWalshMagnitude, Nat.cast_finsetSup'] + unfold FABL.spectralInfinityNorm + have hpow : 0 ≤ (2 ^ n : ℝ) := by positivity + rw [Finset.apply_sup'_eq_sup'_comp Finset.univ_nonempty + (fun x : ℝ ↦ (2 ^ n : ℝ) * x) + (fun x y ↦ mul_max_of_nonneg x y hpow)] + apply Finset.sup'_congr Finset.univ_nonempty rfl + intro a _ha + rw [Nat.cast_natAbs, Int.cast_abs] + simp only [Function.comp_apply] + rw [walshTransform_eq_two_pow_mul_vectorFourierCoeff] + rw [abs_mul, abs_of_nonneg hpow] + +/-- Division-free form of Carlet's Relation (35). -/ +theorem two_mul_nonlinearity_add_maxWalshMagnitude + (f : BooleanFunction n) : + 2 * nonlinearity f + maxWalshMagnitude f = 2 ^ n := by + apply Nat.cast_injective (R := ℝ) + push_cast + rw [nonlinearity_cast_eq_distanceToAffineSigns, + maxWalshMagnitude_cast_eq_spectralInfinityNorm, + FABL.distanceToAffineSigns_eq + (FABL.isSignValued_realSignEncodedFunction f)] + ring + +/-- Carlet Relation (35), written over the reals to preserve the factor one half +in every dimension. -/ +theorem nonlinearity_cast_eq_relation_35 + (f : BooleanFunction n) : + (nonlinearity f : ℝ) = + (2 ^ n : ℝ) / 2 - (maxWalshMagnitude f : ℝ) / 2 := by + have h := congrArg (fun k : ℕ ↦ (k : ℝ)) + (two_mul_nonlinearity_add_maxWalshMagnitude f) + push_cast at h + linarith + +/-- Hamming distance is invariant under a simultaneous affine reindexing of +its two arguments. -/ +theorem hammingDistance_comp_affineEquiv + (f g : BooleanFunction n) + (L : FABL.F₂Cube n ≃ᵃ[FABL.𝔽₂] FABL.F₂Cube n) : + hammingDistance (f ∘ L) (g ∘ L) = hammingDistance f g := by + classical + unfold hammingDistance hammingDist + apply Finset.card_bij (fun x _hx ↦ L x) + · intro x hx + simpa only [Finset.mem_filter, Finset.mem_univ, true_and, + Function.comp_apply] using hx + · intro x _hx y _hy hxy + exact L.injective hxy + · intro y hy + refine ⟨L.symm y, ?_, ?_⟩ + · simpa only [Finset.mem_filter, Finset.mem_univ, true_and, + Function.comp_apply, L.apply_symm_apply] using hy + · exact L.apply_symm_apply y + +/-- Precomposition of an affine Boolean function by an affine equivalence is +again affine. -/ +theorem exists_affineFunction_comp_affineEquiv + (b : FABL.𝔽₂) (a : FABL.F₂Cube n) + (L : FABL.F₂Cube n ≃ᵃ[FABL.𝔽₂] FABL.F₂Cube n) : + ∃ c d, FABL.affineFunction b a ∘ L = FABL.affineFunction c d := by + apply FABL.exists_affineFunction_of_functionAlgebraicDegree_le_one + exact (FABL.functionAlgebraicDegree_comp_affineMap_le + (FABL.affineFunction b a) L.toAffineMap).trans + (FABL.functionAlgebraicDegree_affineFunction_le_one b a) + +/-- Affine reindexing cannot increase nonlinearity. -/ +theorem nonlinearity_comp_affineEquiv_le + (f : BooleanFunction n) + (L : FABL.F₂Cube n ≃ᵃ[FABL.𝔽₂] FABL.F₂Cube n) : + nonlinearity (f ∘ L) ≤ nonlinearity f := by + classical + unfold nonlinearity + obtain ⟨p, _hp, hmin⟩ := Finset.exists_mem_eq_inf' + (s := (Finset.univ : Finset (FABL.𝔽₂ × FABL.F₂Cube n))) + Finset.univ_nonempty + (fun q ↦ hammingDistance f (FABL.affineFunction q.1 q.2)) + obtain ⟨c, d, haffine⟩ := + exists_affineFunction_comp_affineEquiv p.1 p.2 L + calc + (Finset.univ : Finset (FABL.𝔽₂ × FABL.F₂Cube n)).inf' + Finset.univ_nonempty + (fun q ↦ hammingDistance (f ∘ L) + (FABL.affineFunction q.1 q.2)) ≤ + hammingDistance (f ∘ L) (FABL.affineFunction c d) := + Finset.inf'_le _ (Finset.mem_univ (c, d)) + _ = hammingDistance (f ∘ L) + (FABL.affineFunction p.1 p.2 ∘ L) := by rw [haffine] + _ = hammingDistance f (FABL.affineFunction p.1 p.2) := + hammingDistance_comp_affineEquiv f + (FABL.affineFunction p.1 p.2) L + _ = (Finset.univ : Finset (FABL.𝔽₂ × FABL.F₂Cube n)).inf' + Finset.univ_nonempty + (fun q ↦ hammingDistance f + (FABL.affineFunction q.1 q.2)) := hmin.symm + +/-- Carlet's nonlinearity is invariant under affine automorphisms of the +binary cube. -/ +theorem nonlinearity_comp_affineEquiv + (f : BooleanFunction n) + (L : FABL.F₂Cube n ≃ᵃ[FABL.𝔽₂] FABL.F₂Cube n) : + nonlinearity (f ∘ L) = nonlinearity f := by + apply Nat.le_antisymm (nonlinearity_comp_affineEquiv_le f L) + have h := nonlinearity_comp_affineEquiv_le (f ∘ L) L.symm + simpa [Function.comp_def] using h + +/-- Some normalized Fourier coefficient of a sign-valued function has +magnitude at least the reciprocal square root of the cube cardinality. -/ +theorem exists_inv_sqrt_card_le_vectorFourierCoeff_abs + {f : FABL.F₂Cube n → ℝ} (hf : FABL.IsSignValued f) : + ∃ γ, (Real.sqrt ((2 : ℝ) ^ n))⁻¹ ≤ + |FABL.vectorFourierCoeff f γ| := by + obtain ⟨γ, hγ⟩ := FABL.exists_inv_card_le_sq_vectorFourierCoeff hf + refine ⟨γ, ?_⟩ + have hsqrt := Real.sqrt_le_sqrt hγ + rwa [Real.sqrt_inv, Real.sqrt_sq_eq_abs] at hsqrt + +/-- The Fourier infinity norm of a sign-valued function is at least the +reciprocal square root of the cube cardinality. -/ +theorem spectralInfinityNorm_ge_inv_sqrt_card + {f : FABL.F₂Cube n → ℝ} (hf : FABL.IsSignValued f) : + (Real.sqrt ((2 : ℝ) ^ n))⁻¹ ≤ FABL.spectralInfinityNorm f := by + obtain ⟨γ, hγ⟩ := + exists_inv_sqrt_card_le_vectorFourierCoeff_abs hf + exact hγ.trans (Finset.le_sup' + (fun δ : FABL.F₂Cube n ↦ |FABL.vectorFourierCoeff f δ|) + (Finset.mem_univ γ)) + +/-- No sign-valued function is farther from affine signs than the flat-spectrum +bound, in arbitrary dimension. -/ +theorem distanceToAffineSigns_le_coveringRadius + {f : FABL.F₂Cube n → ℝ} (hf : FABL.IsSignValued f) : + FABL.distanceToAffineSigns f ≤ + 1 / 2 - (Real.sqrt ((2 : ℝ) ^ n))⁻¹ / 2 := by + rw [FABL.distanceToAffineSigns_eq hf] + have hspectral := spectralInfinityNorm_ge_inv_sqrt_card hf + linarith + +/-- Multiplying the reciprocal square root of the cube cardinality by the +cardinality recovers its square root. -/ +theorem two_pow_mul_inv_sqrt : + (2 : ℝ) ^ n * (Real.sqrt ((2 : ℝ) ^ n))⁻¹ = + Real.sqrt ((2 : ℝ) ^ n) := by + have hsqrt_ne : Real.sqrt ((2 : ℝ) ^ n) ≠ 0 := by positivity + calc + (2 : ℝ) ^ n * (Real.sqrt ((2 : ℝ) ^ n))⁻¹ = + Real.sqrt ((2 : ℝ) ^ n) ^ 2 * + (Real.sqrt ((2 : ℝ) ^ n))⁻¹ := by + rw [Real.sq_sqrt (by positivity)] + _ = Real.sqrt ((2 : ℝ) ^ n) := by + rw [pow_two] + field_simp + +/-- The square root of the cube cardinality is `2^(n/2)` with a real +exponent. -/ +theorem sqrt_two_pow_eq_rpow : + Real.sqrt ((2 : ℝ) ^ n) = (2 : ℝ) ^ ((n : ℝ) / 2) := by + rw [Real.sqrt_eq_rpow, ← Real.rpow_natCast, + ← Real.rpow_mul (by positivity)] + congr 1 + ring + +/-- The square-root covering-radius expression is the printed form of +Carlet's Relation (36). -/ +theorem coveringRadius_eq_relation_36 : + (2 : ℝ) ^ n / 2 - Real.sqrt ((2 : ℝ) ^ n) / 2 = + (2 : ℝ) ^ ((n : ℝ) - 1) - + (2 : ℝ) ^ ((n : ℝ) / 2 - 1) := by + rw [Real.rpow_sub (by norm_num : (0 : ℝ) < 2), + Real.rpow_sub (by norm_num : (0 : ℝ) < 2), Real.rpow_one, + Real.rpow_natCast, ← sqrt_two_pow_eq_rpow] + +/-- The raw nonlinearity covering-radius bound in a dimension-zero-safe +square-root form. -/ +theorem nonlinearity_cast_le_coveringRadius + (f : BooleanFunction n) : + (nonlinearity f : ℝ) ≤ + (2 : ℝ) ^ n / 2 - Real.sqrt ((2 : ℝ) ^ n) / 2 := by + rw [nonlinearity_cast_eq_distanceToAffineSigns] + calc + (2 : ℝ) ^ n * FABL.distanceToAffineSigns (realSignView f) ≤ + (2 : ℝ) ^ n * + (1 / 2 - (Real.sqrt ((2 : ℝ) ^ n))⁻¹ / 2) := + mul_le_mul_of_nonneg_left + (distanceToAffineSigns_le_coveringRadius + (FABL.isSignValued_realSignEncodedFunction f)) (by positivity) + _ = (2 : ℝ) ^ n / 2 - + ((2 : ℝ) ^ n * (Real.sqrt ((2 : ℝ) ^ n))⁻¹) / 2 := by ring + _ = (2 : ℝ) ^ n / 2 - Real.sqrt ((2 : ℝ) ^ n) / 2 := by + rw [two_pow_mul_inv_sqrt] + +/-- Carlet Relation (36): every Boolean function satisfies +`nl(f) ≤ 2^(n-1) - 2^(n/2-1)`. -/ +theorem nonlinearity_cast_le_relation_36 + (f : BooleanFunction n) : + (nonlinearity f : ℝ) ≤ + (2 : ℝ) ^ ((n : ℝ) - 1) - + (2 : ℝ) ^ ((n : ℝ) / 2 - 1) := by + rw [← coveringRadius_eq_relation_36] + exact nonlinearity_cast_le_coveringRadius f + +/-- Equality in the Fourier-infinity lower bound forces every Fourier +magnitude to equal the reciprocal square root of the cube cardinality. -/ +theorem vectorFourierCoeff_abs_eq_inv_sqrt_of_spectralInfinityNorm_eq + {f : FABL.F₂Cube n → ℝ} (hf : FABL.IsSignValued f) + (hspectral : FABL.spectralInfinityNorm f = + (Real.sqrt ((2 : ℝ) ^ n))⁻¹) : + ∀ γ, |FABL.vectorFourierCoeff f γ| = + (Real.sqrt ((2 : ℝ) ^ n))⁻¹ := by + classical + intro γ + let c : ℝ := (Real.sqrt ((2 : ℝ) ^ n))⁻¹ + have hc_nonneg : 0 ≤ c := by positivity + have habs_le : |FABL.vectorFourierCoeff f γ| ≤ c := by + have hle := Finset.le_sup' + (fun δ : FABL.F₂Cube n ↦ |FABL.vectorFourierCoeff f δ|) + (Finset.mem_univ γ) + change |FABL.vectorFourierCoeff f γ| ≤ + FABL.spectralInfinityNorm f at hle + simpa [c, hspectral] using hle + apply le_antisymm habs_le + by_contra hnot + have habs_lt : |FABL.vectorFourierCoeff f γ| < c := + lt_of_not_ge hnot + have hsq_le (δ : FABL.F₂Cube n) : + FABL.vectorFourierCoeff f δ ^ 2 ≤ c ^ 2 := by + have hδ : |FABL.vectorFourierCoeff f δ| ≤ c := by + have hle := Finset.le_sup' + (fun ε : FABL.F₂Cube n ↦ |FABL.vectorFourierCoeff f ε|) + (Finset.mem_univ δ) + change |FABL.vectorFourierCoeff f δ| ≤ + FABL.spectralInfinityNorm f at hle + simpa [c, hspectral] using hle + have hsquare := + (sq_le_sq₀ (abs_nonneg (FABL.vectorFourierCoeff f δ)) hc_nonneg).mpr hδ + simpa only [sq_abs] using hsquare + have hsq_lt : FABL.vectorFourierCoeff f γ ^ 2 < c ^ 2 := by + have hsquare := + (sq_lt_sq₀ (abs_nonneg (FABL.vectorFourierCoeff f γ)) hc_nonneg).mpr habs_lt + simpa only [sq_abs] using hsquare + have hsum_lt : + (∑ δ : FABL.F₂Cube n, FABL.vectorFourierCoeff f δ ^ 2) < + ∑ _δ : FABL.F₂Cube n, c ^ 2 := + Finset.sum_lt_sum (fun δ _ ↦ hsq_le δ) + ⟨γ, Finset.mem_univ γ, hsq_lt⟩ + have hconstant : (∑ _δ : FABL.F₂Cube n, c ^ 2) = 1 := by + rw [Finset.sum_const, Finset.card_univ, card_f₂Cube, + nsmul_eq_mul, Nat.cast_pow, Nat.cast_ofNat] + dsimp [c] + rw [inv_pow] + have hsqrt_pos : 0 < Real.sqrt ((2 : ℝ) ^ n) := + Real.sqrt_pos.2 (by positivity) + have hsquare : Real.sqrt ((2 : ℝ) ^ n) ^ 2 = (2 : ℝ) ^ n := + Real.sq_sqrt (by positivity) + calc + (2 : ℝ) ^ n * (Real.sqrt ((2 : ℝ) ^ n) ^ 2)⁻¹ = + Real.sqrt ((2 : ℝ) ^ n) ^ 2 * + (Real.sqrt ((2 : ℝ) ^ n) ^ 2)⁻¹ := by rw [hsquare] + _ = 1 := mul_inv_cancel₀ (pow_ne_zero 2 hsqrt_pos.ne') + rw [FABL.sum_sq_vectorFourierCoeff_eq_one hf, hconstant] at hsum_lt + exact (lt_irrefl 1 hsum_lt) + +/-- A flat normalized Fourier spectrum attains the Fourier-infinity lower +bound. -/ +theorem spectralInfinityNorm_eq_inv_sqrt_of_forall_abs + {f : FABL.F₂Cube n → ℝ} + (hflat : ∀ γ, |FABL.vectorFourierCoeff f γ| = + (Real.sqrt ((2 : ℝ) ^ n))⁻¹) : + FABL.spectralInfinityNorm f = + (Real.sqrt ((2 : ℝ) ^ n))⁻¹ := by + unfold FABL.spectralInfinityNorm + apply Finset.sup'_eq_of_forall + intro γ _hγ + exact hflat γ + +/-- Equality in the normalized covering-radius bound is equivalent to a flat +normalized Fourier spectrum. -/ +theorem distanceToAffineSigns_eq_coveringRadius_iff + {f : FABL.F₂Cube n → ℝ} (hf : FABL.IsSignValued f) : + FABL.distanceToAffineSigns f = + 1 / 2 - (Real.sqrt ((2 : ℝ) ^ n))⁻¹ / 2 ↔ + ∀ γ, |FABL.vectorFourierCoeff f γ| = + (Real.sqrt ((2 : ℝ) ^ n))⁻¹ := by + rw [FABL.distanceToAffineSigns_eq hf] + constructor + · intro h + apply vectorFourierCoeff_abs_eq_inv_sqrt_of_spectralInfinityNorm_eq hf + linarith + · intro h + rw [spectralInfinityNorm_eq_inv_sqrt_of_forall_abs h] + +/-- Carlet's flat raw Walsh-spectrum condition. -/ +def HasFlatWalshSpectrum (f : BooleanFunction n) : Prop := + ∀ a, |(walshTransform f a : ℝ)| = Real.sqrt ((2 : ℝ) ^ n) + +/-- Flatness of Carlet's raw Walsh spectrum is equivalent to flatness of +FABL's normalized vector Fourier spectrum. -/ +theorem hasFlatWalshSpectrum_iff_vectorFourierCoeff + (f : BooleanFunction n) : + HasFlatWalshSpectrum f ↔ + ∀ a, |FABL.vectorFourierCoeff (realSignView f) a| = + (Real.sqrt ((2 : ℝ) ^ n))⁻¹ := by + have hpow_pos : 0 < (2 : ℝ) ^ n := by positivity + constructor + · intro hflat a + have ha := hflat a + rw [walshTransform_eq_two_pow_mul_vectorFourierCoeff, + abs_mul, abs_of_pos hpow_pos] at ha + apply mul_left_cancel₀ hpow_pos.ne' + calc + (2 : ℝ) ^ n * |FABL.vectorFourierCoeff (realSignView f) a| = + Real.sqrt ((2 : ℝ) ^ n) := ha + _ = (2 : ℝ) ^ n * (Real.sqrt ((2 : ℝ) ^ n))⁻¹ := by + rw [two_pow_mul_inv_sqrt] + · intro hflat a + rw [walshTransform_eq_two_pow_mul_vectorFourierCoeff, + abs_mul, abs_of_pos hpow_pos, hflat a, + two_pow_mul_inv_sqrt] + +/-- Equality in the raw covering-radius bound is equivalent to a flat raw +Walsh spectrum. -/ +theorem nonlinearity_eq_coveringRadius_iff_flatWalshSpectrum + (f : BooleanFunction n) : + (nonlinearity f : ℝ) = + (2 : ℝ) ^ n / 2 - Real.sqrt ((2 : ℝ) ^ n) / 2 ↔ + HasFlatWalshSpectrum f := by + rw [hasFlatWalshSpectrum_iff_vectorFourierCoeff] + rw [← distanceToAffineSigns_eq_coveringRadius_iff + (FABL.isSignValued_realSignEncodedFunction f)] + have hpow_ne : (2 : ℝ) ^ n ≠ 0 := by positivity + constructor <;> intro h + · apply mul_left_cancel₀ hpow_ne + calc + (2 : ℝ) ^ n * FABL.distanceToAffineSigns (realSignView f) = + (nonlinearity f : ℝ) := + (nonlinearity_cast_eq_distanceToAffineSigns f).symm + _ = (2 : ℝ) ^ n / 2 - Real.sqrt ((2 : ℝ) ^ n) / 2 := h + _ = (2 : ℝ) ^ n / 2 - + ((2 : ℝ) ^ n * (Real.sqrt ((2 : ℝ) ^ n))⁻¹) / 2 := by + rw [two_pow_mul_inv_sqrt] + _ = (2 : ℝ) ^ n * + (1 / 2 - (Real.sqrt ((2 : ℝ) ^ n))⁻¹ / 2) := by ring + · calc + (nonlinearity f : ℝ) = + (2 : ℝ) ^ n * FABL.distanceToAffineSigns (realSignView f) := + nonlinearity_cast_eq_distanceToAffineSigns f + _ = (2 : ℝ) ^ n * + (1 / 2 - (Real.sqrt ((2 : ℝ) ^ n))⁻¹ / 2) := by rw [h] + _ = (2 : ℝ) ^ n / 2 - + ((2 : ℝ) ^ n * (Real.sqrt ((2 : ℝ) ^ n))⁻¹) / 2 := by ring + _ = (2 : ℝ) ^ n / 2 - Real.sqrt ((2 : ℝ) ^ n) / 2 := by + rw [two_pow_mul_inv_sqrt] + +/-- Equality in Carlet's printed Relation (36) is equivalent to a flat raw +Walsh spectrum. -/ +theorem nonlinearity_cast_eq_relation_36_iff_flatWalshSpectrum + (f : BooleanFunction n) : + (nonlinearity f : ℝ) = + (2 : ℝ) ^ ((n : ℝ) - 1) - + (2 : ℝ) ^ ((n : ℝ) / 2 - 1) ↔ + HasFlatWalshSpectrum f := by + rw [← coveringRadius_eq_relation_36] + exact nonlinearity_eq_coveringRadius_iff_flatWalshSpectrum f + +/-- A flat integer Walsh spectrum can occur only in even dimension. -/ +theorem even_of_hasFlatWalshSpectrum + (f : BooleanFunction n) (hflat : HasFlatWalshSpectrum f) : + Even n := by + have hzero := hflat 0 + have hsquareReal := congrArg (fun x : ℝ ↦ x ^ 2) hzero + rw [sq_abs, Real.sq_sqrt (by positivity)] at hsquareReal + have hsquareInt : walshTransform f 0 ^ 2 = (2 ^ n : ℤ) := by + exact_mod_cast hsquareReal + have hsquareNat : (walshTransform f 0).natAbs ^ 2 = 2 ^ n := by + simpa [Int.natAbs_pow] using congrArg Int.natAbs hsquareInt + have hfactor := congrArg (fun k : ℕ ↦ k.factorization 2) hsquareNat + rw [Nat.factorization_pow, Nat.factorization_pow_self (by norm_num)] at hfactor + change 2 * (walshTransform f 0).natAbs.factorization 2 = n at hfactor + exact ⟨(walshTransform f 0).natAbs.factorization 2, by omega⟩ + +/-- A cryptographic Boolean function is bent when its real sign view satisfies +FABL's canonical bent predicate. -/ +abbrev IsBent (f : BooleanFunction n) : Prop := + FABL.IsBent (realSignView f) + +/-- In even dimension the square root of the cube cardinality is the integer +power indexed by half the dimension. -/ +theorem sqrt_two_pow_eq_pow_half (hn : Even n) : + Real.sqrt ((2 : ℝ) ^ n) = (2 : ℝ) ^ (n / 2) := by + obtain ⟨k, rfl⟩ := hn + have hhalf : (k + k) / 2 = k := by omega + rw [hhalf, pow_add, ← pow_two, Real.sqrt_sq (by positivity)] + +/-- Every bent Boolean function has even dimension. -/ +theorem even_of_isBent + (f : BooleanFunction n) (hf : IsBent f) : Even n := by + have hparseval := FABL.sum_sq_vectorFourierCoeff_eq_one + (FABL.isSignValued_realSignEncodedFunction f) + have hsum : + (∑ a : FABL.F₂Cube n, + (((2 : ℝ) ^ (n / 2))⁻¹) ^ 2) = 1 := by + calc + (∑ a : FABL.F₂Cube n, (((2 : ℝ) ^ (n / 2))⁻¹) ^ 2) = + ∑ a : FABL.F₂Cube n, + FABL.vectorFourierCoeff (realSignView f) a ^ 2 := by + apply Finset.sum_congr rfl + intro a _ha + rw [← hf a, sq_abs] + _ = 1 := hparseval + rw [Finset.sum_const, Finset.card_univ, card_f₂Cube, + nsmul_eq_mul, Nat.cast_pow, Nat.cast_ofNat] at hsum + have hpowersReal : (2 : ℝ) ^ n = (2 : ℝ) ^ (2 * (n / 2)) := by + field_simp at hsum + calc + (2 : ℝ) ^ n = (2 : ℝ) ^ (n / 2) * (2 : ℝ) ^ (n / 2) := by + simpa [pow_two] using hsum + _ = (2 : ℝ) ^ (2 * (n / 2)) := by + rw [← pow_add] + congr 1 + omega + have hpowersNat : 2 ^ n = 2 ^ (2 * (n / 2)) := by + exact_mod_cast hpowersReal + have hn_eq : n = 2 * (n / 2) := + Nat.pow_right_injective (by omega : 2 ≤ 2) hpowersNat + exact ⟨n / 2, by omega⟩ + +/-- Carlet's raw flat-spectrum characterization is equivalent to FABL +bentness. -/ +theorem hasFlatWalshSpectrum_iff_isBent + (f : BooleanFunction n) : + HasFlatWalshSpectrum f ↔ IsBent f := by + constructor + · intro hflat + have hn := even_of_hasFlatWalshSpectrum f hflat + rw [hasFlatWalshSpectrum_iff_vectorFourierCoeff] at hflat + intro a + rw [hflat a, sqrt_two_pow_eq_pow_half hn] + · intro hbent + have hn := even_of_isBent f hbent + rw [hasFlatWalshSpectrum_iff_vectorFourierCoeff] + intro a + rw [hbent a, sqrt_two_pow_eq_pow_half hn] + +/-- Bent Boolean functions can exist only in even dimension. -/ +theorem even_of_exists_isBent + (h : ∃ f : BooleanFunction n, IsBent f) : Even n := by + obtain ⟨f, hf⟩ := h + exact even_of_isBent f hf + +/-- A bent Boolean function is not balanced. -/ +theorem not_isBalanced_of_isBent + (f : BooleanFunction n) (hf : IsBent f) : ¬ IsBalanced f := by + rw [isBalanced_iff_walshTransform_zero_eq_zero] + intro hzero + have hflat := (hasFlatWalshSpectrum_iff_isBent f).2 hf + have h := hflat 0 + rw [hzero, Int.cast_zero, abs_zero] at h + have hsqrt_pos : 0 < Real.sqrt ((2 : ℝ) ^ n) := + Real.sqrt_pos.2 (by positivity) + linarith + +/-- In even dimension, FABL's bent-distance theorem is exactly Carlet +Relation (36) after the raw-distance normalization bridge. -/ +theorem isBent_iff_nonlinearity_cast_eq_relation_36_of_even + (f : BooleanFunction n) (hn : Even n) : + IsBent f ↔ + (nonlinearity f : ℝ) = + (2 : ℝ) ^ ((n : ℝ) - 1) - + (2 : ℝ) ^ ((n : ℝ) / 2 - 1) := by + rw [← coveringRadius_eq_relation_36] + have hfab := FABL.isBent_iff_distanceToAffineSigns_eq hn + (FABL.isSignValued_realSignEncodedFunction f) + change FABL.IsBent (realSignView f) ↔ _ + rw [hfab] + rw [nonlinearity_cast_eq_distanceToAffineSigns] + have hsqrt := sqrt_two_pow_eq_pow_half hn + constructor + · intro hdistance + rw [hdistance] + calc + (2 : ℝ) ^ n * + (1 / 2 - ((2 : ℝ) ^ (n / 2))⁻¹ / 2) = + (2 : ℝ) ^ n / 2 - + ((2 : ℝ) ^ n * ((2 : ℝ) ^ (n / 2))⁻¹) / 2 := by ring + _ = (2 : ℝ) ^ n / 2 - Real.sqrt ((2 : ℝ) ^ n) / 2 := by + rw [← hsqrt, two_pow_mul_inv_sqrt] + · intro hscaled + apply mul_left_cancel₀ (by positivity : (2 : ℝ) ^ n ≠ 0) + calc + (2 : ℝ) ^ n * FABL.distanceToAffineSigns (realSignView f) = + (2 : ℝ) ^ n / 2 - Real.sqrt ((2 : ℝ) ^ n) / 2 := hscaled + _ = (2 : ℝ) ^ n / 2 - + ((2 : ℝ) ^ n * ((2 : ℝ) ^ (n / 2))⁻¹) / 2 := by + rw [← hsqrt, two_pow_mul_inv_sqrt] + _ = (2 : ℝ) ^ n * + (1 / 2 - ((2 : ℝ) ^ (n / 2))⁻¹ / 2) := by ring + +/-- Equality in Carlet Relation (36) holds exactly for bent Boolean +functions. -/ +theorem nonlinearity_cast_eq_relation_36_iff_isBent + (f : BooleanFunction n) : + (nonlinearity f : ℝ) = + (2 : ℝ) ^ ((n : ℝ) - 1) - + (2 : ℝ) ^ ((n : ℝ) / 2 - 1) ↔ + IsBent f := by + constructor + · intro h + have hflat := + (nonlinearity_cast_eq_relation_36_iff_flatWalshSpectrum f).1 h + have hn := even_of_hasFlatWalshSpectrum f hflat + exact (isBent_iff_nonlinearity_cast_eq_relation_36_of_even f hn).2 h + · intro hf + have hn := even_of_isBent f hf + exact (isBent_iff_nonlinearity_cast_eq_relation_36_of_even f hn).1 hf + +end CryptBoolean diff --git a/CryptBoolean/Carlet/Chapter04/OddDimensionBestNonlinearity.lean b/CryptBoolean/Carlet/Chapter04/OddDimensionBestNonlinearity.lean new file mode 100644 index 0000000..490e5b5 --- /dev/null +++ b/CryptBoolean/Carlet/Chapter04/OddDimensionBestNonlinearity.lean @@ -0,0 +1,3077 @@ +/- +Copyright (c) 2026 Asher Yan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Asher Yan with Codex +-/ +module + +public import CryptBoolean.Carlet.Chapter03.ReedMullerDuality +public import CryptBoolean.Carlet.Chapter04.Nonlinearity +public import FABL.Chapter06.Constructions.BentFunctions + +/-! +# Best nonlinearity in odd dimension + +Explicit Kavut--Yücel and balanced Maitra--Kavut--Yücel functions, their +kernel-checked Walsh certificates, and their extensions by direct sums with +complete bent blocks. +-/ + +open Finset +open scoped BigOperators BooleanCube + +@[expose] public section + +namespace CryptBoolean + +variable {n : ℕ} + +/-- The largest nonlinearity among Boolean functions in dimension `n`. -/ +noncomputable def maximumNonlinearity (n : ℕ) : ℕ := + (Finset.univ : Finset (BooleanFunction n)).sup' + Finset.univ_nonempty nonlinearity + +/-- Every Boolean function is bounded by the maximum nonlinearity in its dimension. -/ +theorem nonlinearity_le_maximumNonlinearity (f : BooleanFunction n) : + nonlinearity f ≤ maximumNonlinearity n := by + exact Finset.le_sup' nonlinearity (Finset.mem_univ f) + +/-- The finite Boolean-function space contains a function attaining the +maximum nonlinearity. -/ +theorem exists_nonlinearity_eq_maximumNonlinearity (n : ℕ) : + ∃ f : BooleanFunction n, nonlinearity f = maximumNonlinearity n := by + classical + unfold maximumNonlinearity + obtain ⟨f, _hf, hmax⟩ := Finset.exists_mem_eq_sup' + (s := (Finset.univ : Finset (BooleanFunction n))) + Finset.univ_nonempty nonlinearity + exact ⟨f, hmax.symm⟩ + +/-- Interpret a binary cube point as a little-endian natural number. -/ +def f₂CubeNatIndex (x : FABL.F₂Cube n) : ℕ := + ∑ i, (x i).val * 2 ^ i.val + +/-- Interpret the low `n` bits of a natural number as a binary cube point. -/ +def f₂CubeOfNat (n k : ℕ) : FABL.F₂Cube n := + fun i ↦ if k.testBit i.val then 1 else 0 + +/-- Kavut--Yücel ePrint 2007/308, p. 6, first 512-bit truth table. -/ +def kavutYucelTruthTable : ℕ := + 0x68B7EF2DA03B0D3EA00DB6A96DD99AEAFDB9C842B6D5DC8C4526CE0DD29020DB * 2 ^ 256 + + 0xB75FE3314568344E73688FF0CB2482E065231869E1AA4583765CC491F8A8DB12 + +/-- The nine-variable function printed by Kavut and Yücel, with source bits +read left-to-right. -/ +def kavutYucelFunction9 : BooleanFunction 9 := + fun x ↦ if kavutYucelTruthTable.testBit (511 - f₂CubeNatIndex x) then 1 else 0 + +private inductive WalshCertificateTree : ℕ → Type + | leaf (value : ℤ) : WalshCertificateTree 0 + | branch {n : ℕ} (zero one : WalshCertificateTree n) : + WalshCertificateTree (n + 1) + +private def WalshCertificateTree.eval : + {n : ℕ} → WalshCertificateTree n → FABL.F₂Cube n → ℤ + | 0, .leaf value, _ => value + | _ + 1, .branch zero one, a => + if a 0 = 0 then zero.eval (Fin.tail a) else one.eval (Fin.tail a) + +private def WalshCertificateTree.butterfly : + {n : ℕ} → WalshCertificateTree n → WalshCertificateTree n → + WalshCertificateTree n × WalshCertificateTree n + | 0, .leaf x, .leaf y => (.leaf (x + y), .leaf (x - y)) + | _ + 1, .branch x₀ x₁, .branch y₀ y₁ => + let zero := butterfly x₀ y₀ + let one := butterfly x₁ y₁ + (.branch zero.1 one.1, .branch zero.2 one.2) + +private def WalshCertificateTree.allNatAbsLe (bound : ℕ) : + {n : ℕ} → WalshCertificateTree n → Bool + | 0, .leaf value => decide (value.natAbs ≤ bound) + | _ + 1, .branch zero one => + zero.allNatAbsLe bound && one.allNatAbsLe bound + +private def WalshCertificateTree.allFrequencies : + {n : ℕ} → WalshCertificateTree n → + (FABL.F₂Cube n → ℤ → Bool) → Bool + | 0, .leaf value, predicate => predicate 0 value + | _ + 1, .branch zero one, predicate => + zero.allFrequencies (fun a value ↦ predicate (Fin.cons 0 a) value) && + one.allFrequencies (fun a value ↦ predicate (Fin.cons 1 a) value) + +private theorem WalshCertificateTree.allFrequencies_sound + {n : ℕ} (tree : WalshCertificateTree n) + (predicate : FABL.F₂Cube n → ℤ → Bool) + (h : tree.allFrequencies predicate = true) + (a : FABL.F₂Cube n) : predicate a (tree.eval a) = true := by + induction n with + | zero => + cases tree with + | leaf value => + have ha : a = 0 := Subsingleton.elim _ _ + subst a + exact h + | succ n ih => + cases tree with + | branch zero one => + have hparts := Bool.and_eq_true_iff.mp h + by_cases ha : a 0 = 0 + · rw [WalshCertificateTree.eval, if_pos ha] + have hzero := ih zero + (fun tail value ↦ predicate (Fin.cons 0 tail) value) + hparts.1 (Fin.tail a) + have hcons := Fin.cons_self_tail a + rw [ha] at hcons + simpa only [hcons] using hzero + · rw [WalshCertificateTree.eval, if_neg ha] + have ha_one : a 0 = 1 := Fin.eq_one_of_ne_zero _ ha + have hone := ih one + (fun tail value ↦ predicate (Fin.cons 1 tail) value) + hparts.2 (Fin.tail a) + have hcons := Fin.cons_self_tail a + rw [ha_one] at hcons + simpa only [hcons] using hone + +private theorem WalshCertificateTree.eval_butterfly + {n : ℕ} (x y : WalshCertificateTree n) (a : FABL.F₂Cube n) : + ((x.butterfly y).1.eval a, (x.butterfly y).2.eval a) = + (x.eval a + y.eval a, x.eval a - y.eval a) := by + induction n with + | zero => + cases x with + | leaf x => + cases y with + | leaf y => simp [butterfly, eval] + | succ n ih => + cases x with + | branch x₀ x₁ => + cases y with + | branch y₀ y₁ => + by_cases ha : a 0 = 0 + · simpa [butterfly, eval, ha] using + ih x₀ y₀ (Fin.tail a) + · simpa [butterfly, eval, ha] using + ih x₁ y₁ (Fin.tail a) + +private theorem WalshCertificateTree.natAbs_eval_le_of_allNatAbsLe + {n bound : ℕ} (tree : WalshCertificateTree n) + (h : tree.allNatAbsLe bound = true) (a : FABL.F₂Cube n) : + (tree.eval a).natAbs ≤ bound := by + induction n with + | zero => + cases tree with + | leaf value => + change decide (value.natAbs ≤ bound) = true at h + simpa [eval] using of_decide_eq_true h + | succ n ih => + cases tree with + | branch zero one => + have hparts := Bool.and_eq_true_iff.mp h + by_cases ha : a 0 = 0 + · simpa [eval, ha] using ih zero hparts.1 (Fin.tail a) + · simpa [eval, ha] using ih one hparts.2 (Fin.tail a) + +private def fastWalshCertificateTree : + (n : ℕ) → BooleanFunction n → WalshCertificateTree n + | 0, f => .leaf (bitSignInt (f 0)) + | n + 1, f => + let lower := fastWalshCertificateTree n (fun x ↦ f (Fin.cons 0 x)) + let upper := fastWalshCertificateTree n (fun x ↦ f (Fin.cons 1 x)) + let transformed := lower.butterfly upper + .branch transformed.1 transformed.2 + +private theorem walshTransform_succ + (f : BooleanFunction (n + 1)) (a : FABL.F₂Cube (n + 1)) : + walshTransform f a = + if a 0 = 0 then + walshTransform (fun x ↦ f (Fin.cons 0 x)) (Fin.tail a) + + walshTransform (fun x ↦ f (Fin.cons 1 x)) (Fin.tail a) + else + walshTransform (fun x ↦ f (Fin.cons 0 x)) (Fin.tail a) - + walshTransform (fun x ↦ f (Fin.cons 1 x)) (Fin.tail a) := by + classical + unfold walshTransform + rw [← Equiv.sum_comp (Fin.consEquiv + (fun _ : Fin (n + 1) ↦ FABL.𝔽₂))] + rw [Fintype.sum_prod_type] + change (∑ b : FABL.𝔽₂, ∑ x : FABL.F₂Cube n, + walshTerm f a (Fin.cons b x)) = _ + rw [show (Finset.univ : Finset FABL.𝔽₂) = {0, 1} by rfl] + simp only [Finset.sum_insert, Finset.mem_singleton, zero_ne_one, + not_false_eq_true, Finset.sum_singleton] + by_cases ha : a 0 = 0 + · rw [if_pos ha] + congr 1 + · apply Finset.sum_congr rfl + intro x _hx + simp [walshTerm, FABL.f₂DotProduct, dotProduct, Fin.sum_univ_succ, + ha, Fin.tail] + · apply Finset.sum_congr rfl + intro x _hx + simp [walshTerm, FABL.f₂DotProduct, dotProduct, Fin.sum_univ_succ, + ha, Fin.tail] + · rw [if_neg ha] + have ha_one : a 0 = 1 := Fin.eq_one_of_ne_zero _ ha + congr 1 + · apply Finset.sum_congr rfl + intro x _hx + simp [walshTerm, FABL.f₂DotProduct, dotProduct, Fin.sum_univ_succ, + ha_one, Fin.tail] + · rw [← Finset.sum_neg_distrib] + apply Finset.sum_congr rfl + intro x _hx + rw [show walshTerm f a (Fin.cons 1 x) = + bitSignInt + ((f (Fin.cons 1 x) + FABL.f₂DotProduct (Fin.tail a) x) + 1) by + simp [walshTerm, FABL.f₂DotProduct, dotProduct, + Fin.sum_univ_succ, ha_one, Fin.tail] + ring_nf] + rw [show bitSignInt + ((f (Fin.cons 1 x) + FABL.f₂DotProduct (Fin.tail a) x) + 1) = + bitSignInt + (f (Fin.cons 1 x) + FABL.f₂DotProduct (Fin.tail a) x) * + bitSignInt 1 by + exact show bitSignInt (_ + _) = _ from by + unfold bitSignInt + rw [FABL.signEncode_add] + rfl] + simp [walshTerm, bitSignInt] + +private theorem fastWalshCertificateTree_correct + (n : ℕ) (f : BooleanFunction n) (a : FABL.F₂Cube n) : + (fastWalshCertificateTree n f).eval a = walshTransform f a := by + induction n with + | zero => + have ha : a = 0 := Subsingleton.elim _ _ + subst a + rw [fastWalshCertificateTree, WalshCertificateTree.eval, + walshTransform, Fintype.sum_unique] + unfold walshTerm + have hdot (x y : FABL.F₂Cube 0) : FABL.f₂DotProduct x y = 0 := by + simp [FABL.f₂DotProduct, dotProduct] + rw [hdot] + rw [add_zero] + exact congrArg (fun x ↦ bitSignInt (f x)) (Subsingleton.elim _ _) + | succ n ih => + rw [walshTransform_succ] + simp only [fastWalshCertificateTree, WalshCertificateTree.eval] + let lower := fastWalshCertificateTree n + (fun x ↦ f (Fin.cons 0 x)) + let upper := fastWalshCertificateTree n + (fun x ↦ f (Fin.cons 1 x)) + have hbutterfly := lower.eval_butterfly upper (Fin.tail a) + by_cases ha : a 0 = 0 + · rw [if_pos ha, if_pos ha] + have hzero := congrArg Prod.fst hbutterfly + simpa [lower, upper, ih] using hzero + · rw [if_neg ha, if_neg ha] + have hone := congrArg Prod.snd hbutterfly + simpa [lower, upper, ih] using hone + +private theorem kavutYucelFunction9_reflection_certificate : + (fastWalshCertificateTree 9 kavutYucelFunction9).allNatAbsLe 28 = true := by + decide + +/-- Kernel-checked exhaustive certificate for the Walsh upper bound of the +Kavut--Yücel truth table. -/ +theorem kavutYucelFunction9_walsh_bound + (a : FABL.F₂Cube 9) : + (walshTransform kavutYucelFunction9 a).natAbs ≤ 28 := by + rw [← fastWalshCertificateTree_correct] + exact WalshCertificateTree.natAbs_eval_le_of_allNatAbsLe + (fastWalshCertificateTree 9 kavutYucelFunction9) + kavutYucelFunction9_reflection_certificate a + +private theorem kavutYucelFunction9_witness_certificate : + (fastWalshCertificateTree 9 kavutYucelFunction9).eval + (f₂CubeOfNat 9 7) = 28 := by + decide + +/-- Frequency seven witnesses that the certified Walsh upper bound is sharp. -/ +theorem kavutYucelFunction9_walsh_witness : + walshTransform kavutYucelFunction9 (f₂CubeOfNat 9 7) = 28 := by + rw [← fastWalshCertificateTree_correct] + exact kavutYucelFunction9_witness_certificate + +/-- The Kavut--Yücel function has maximum Walsh magnitude exactly 28. -/ +theorem maxWalshMagnitude_kavutYucelFunction9 : + maxWalshMagnitude kavutYucelFunction9 = 28 := by + apply Nat.le_antisymm + · exact Finset.sup'_le Finset.univ_nonempty + (fun a : FABL.F₂Cube 9 ↦ + (walshTransform kavutYucelFunction9 a).natAbs) + fun a _ha ↦ kavutYucelFunction9_walsh_bound a + · have hw := Finset.le_sup' + (fun a : FABL.F₂Cube 9 ↦ (walshTransform kavutYucelFunction9 a).natAbs) + (Finset.mem_univ (f₂CubeOfNat 9 7)) + simpa [maxWalshMagnitude, kavutYucelFunction9_walsh_witness] using hw + +/-- The Kavut--Yücel truth table has nonlinearity 242. -/ +theorem nonlinearity_kavutYucelFunction9 : + nonlinearity kavutYucelFunction9 = 242 := by + have h := two_mul_nonlinearity_add_maxWalshMagnitude kavutYucelFunction9 + rw [maxWalshMagnitude_kavutYucelFunction9] at h + omega + +/-- The Boolean direct sum on two disjoint coordinate blocks. -/ +def booleanDirectSum {k l : ℕ} + (f : BooleanFunction k) (g : BooleanFunction l) : + BooleanFunction (k + l) := + fun z ↦ + let p := (Fin.appendEquiv k l).symm z + f p.1 + g p.2 + +/-- The sign view of a Boolean direct sum is FABL's direct product. -/ +theorem realSignView_booleanDirectSum + {k l : ℕ} (f : BooleanFunction k) (g : BooleanFunction l) : + realSignView (booleanDirectSum f g) = + FABL.bentDirectProduct (realSignView f) (realSignView g) := by + funext z + unfold booleanDirectSum FABL.bentDirectProduct + realSignView FABL.realSignEncodedFunction FABL.signEncodedFunction + rw [FABL.signEncode_add] + simp [FABL.signValue] + +/-- Raw Walsh transforms multiply under Boolean direct sums. -/ +theorem walshTransform_booleanDirectSum_append + {k l : ℕ} (f : BooleanFunction k) (g : BooleanFunction l) + (a : FABL.F₂Cube k) (b : FABL.F₂Cube l) : + walshTransform (booleanDirectSum f g) (Fin.append a b) = + walshTransform f a * walshTransform g b := by + apply Int.cast_injective (α := ℝ) + push_cast + rw [walshTransform_eq_two_pow_mul_vectorFourierCoeff, + walshTransform_eq_two_pow_mul_vectorFourierCoeff, + walshTransform_eq_two_pow_mul_vectorFourierCoeff, + realSignView_booleanDirectSum, + FABL.vectorFourierCoeff_bentDirectProduct_append] + rw [pow_add] + ring + +/-- Extend a Boolean function by a complete even-dimensional inner-product bent block. -/ +def completeBentExtension {k : ℕ} (f : BooleanFunction k) (m : ℕ) : + BooleanFunction (k + (m + m)) := + booleanDirectSum f FABL.innerProductModTwoBit + +/-- The sign view of a complete bent extension is FABL's direct product. -/ +theorem realSignView_completeBentExtension + {k : ℕ} (f : BooleanFunction k) (m : ℕ) : + realSignView (completeBentExtension f m) = + FABL.bentDirectProduct (realSignView f) + (FABL.innerProductModTwo m) := by + rw [← show realSignView FABL.innerProductModTwoBit = + FABL.innerProductModTwo m by rfl] + exact realSignView_booleanDirectSum f FABL.innerProductModTwoBit + +/-- The raw Walsh transform of a complete bent extension factors over the two blocks. -/ +theorem walshTransform_completeBentExtension_append + {k : ℕ} (f : BooleanFunction k) (m : ℕ) + (a : FABL.F₂Cube k) (b : FABL.F₂Cube (m + m)) : + (walshTransform (completeBentExtension f m) (Fin.append a b) : ℝ) = + (walshTransform f a : ℝ) * + (walshTransform FABL.innerProductModTwoBit b : ℝ) := by + exact_mod_cast walshTransform_booleanDirectSum_append + f FABL.innerProductModTwoBit a b + +/-- The Kavut--Yücel function extended by a complete `2m`-variable bent block. -/ +def kavutYucelBentExtension (m : ℕ) : + BooleanFunction (9 + (m + m)) := + completeBentExtension kavutYucelFunction9 m + +/-- The sign view of the Kavut--Yücel extension is FABL's direct product. -/ +theorem realSignView_kavutYucelBentExtension (m : ℕ) : + realSignView (kavutYucelBentExtension m) = + FABL.bentDirectProduct (realSignView kavutYucelFunction9) + (FABL.innerProductModTwo m) := by + simpa [kavutYucelBentExtension] using + realSignView_completeBentExtension kavutYucelFunction9 m + +/-- The raw Walsh transform of the Kavut--Yücel extension factors over the two blocks. -/ +theorem walshTransform_kavutYucelBentExtension_append + (m : ℕ) (a : FABL.F₂Cube 9) (b : FABL.F₂Cube (m + m)) : + (walshTransform (kavutYucelBentExtension m) (Fin.append a b) : ℝ) = + (walshTransform kavutYucelFunction9 a : ℝ) * + (walshTransform FABL.innerProductModTwoBit b : ℝ) := by + simpa [kavutYucelBentExtension] using + walshTransform_completeBentExtension_append + kavutYucelFunction9 m a b + +/-- The complete `2m`-variable inner-product block has raw Walsh magnitude `2^m`. -/ +theorem natAbs_walshTransform_innerProductModTwoBit + (m : ℕ) (b : FABL.F₂Cube (m + m)) : + (walshTransform FABL.innerProductModTwoBit b).natAbs = 2 ^ m := by + apply Nat.cast_injective (R := ℝ) + rw [Nat.cast_natAbs, Int.cast_abs, + walshTransform_eq_two_pow_mul_vectorFourierCoeff] + rw [show realSignView FABL.innerProductModTwoBit = + FABL.innerProductModTwo m by rfl] + rw [abs_mul, abs_of_nonneg (by positivity), + FABL.abs_vectorFourierCoeff_innerProductModTwo] + rw [pow_add] + field_simp + norm_cast + +/-- Raw Walsh magnitudes of a complete bent extension are the seed magnitudes +scaled by `2^m`. -/ +theorem natAbs_walshTransform_completeBentExtension_append + {k : ℕ} (f : BooleanFunction k) (m : ℕ) + (a : FABL.F₂Cube k) (b : FABL.F₂Cube (m + m)) : + (walshTransform (completeBentExtension f m) (Fin.append a b)).natAbs = + (walshTransform f a).natAbs * 2 ^ m := by + apply Nat.cast_injective (R := ℝ) + push_cast + rw [Nat.cast_natAbs, Nat.cast_natAbs, Int.cast_abs, Int.cast_abs] + rw [walshTransform_completeBentExtension_append] + rw [abs_mul] + congr 1 + have hipCast := congrArg (fun q : ℕ ↦ (q : ℝ)) + (natAbs_walshTransform_innerProductModTwoBit m b) + rw [Nat.cast_natAbs, Int.cast_abs] at hipCast + simpa only [Nat.cast_pow, Nat.cast_ofNat] using hipCast + +/-- A complete bent extension scales the seed's maximum raw Walsh magnitude +by `2^m`. -/ +theorem maxWalshMagnitude_completeBentExtension + {k : ℕ} (f : BooleanFunction k) (m : ℕ) : + maxWalshMagnitude (completeBentExtension f m) = + maxWalshMagnitude f * 2 ^ m := by + unfold maxWalshMagnitude + apply Nat.le_antisymm + · apply Finset.sup'_le Finset.univ_nonempty + (fun γ : FABL.F₂Cube (k + (m + m)) ↦ + (walshTransform (completeBentExtension f m) γ).natAbs) + intro γ _hγ + let p := (Fin.appendEquiv k (m + m)).symm γ + have hγ : Fin.append p.1 p.2 = γ := + (Fin.appendEquiv k (m + m)).apply_symm_apply γ + rw [← hγ, natAbs_walshTransform_completeBentExtension_append] + exact Nat.mul_le_mul_right (2 ^ m) + (Finset.le_sup' + (fun a : FABL.F₂Cube k ↦ (walshTransform f a).natAbs) + (Finset.mem_univ p.1)) + · obtain ⟨a, _ha, ha⟩ := Finset.exists_mem_eq_sup' + (s := (Finset.univ : Finset (FABL.F₂Cube k))) + Finset.univ_nonempty + (fun a : FABL.F₂Cube k ↦ (walshTransform f a).natAbs) + have hw := Finset.le_sup' + (fun γ : FABL.F₂Cube (k + (m + m)) ↦ + (walshTransform (completeBentExtension f m) γ).natAbs) + (Finset.mem_univ + (Fin.append a (0 : FABL.F₂Cube (m + m)))) + rw [natAbs_walshTransform_completeBentExtension_append, ← ha] at hw + exact hw + +/-- Complete bent extension preserves balancedness of the seed. -/ +theorem isBalanced_completeBentExtension + {k : ℕ} (f : BooleanFunction k) (m : ℕ) (hf : IsBalanced f) : + IsBalanced (completeBentExtension f m) := by + rw [isBalanced_iff_walshTransform_zero_eq_zero] at hf ⊢ + have hzero : + Fin.append (0 : FABL.F₂Cube k) (0 : FABL.F₂Cube (m + m)) = + (0 : FABL.F₂Cube (k + (m + m))) := by + funext i + refine Fin.addCases (fun l ↦ ?_) (fun r ↦ ?_) i <;> simp + have hreal : + (walshTransform (completeBentExtension f m) 0 : ℝ) = 0 := by + calc + (walshTransform (completeBentExtension f m) 0 : ℝ) = + (walshTransform (completeBentExtension f m) + (Fin.append (0 : FABL.F₂Cube k) + (0 : FABL.F₂Cube (m + m))) : ℝ) := by rw [hzero] + _ = + (walshTransform f 0 : ℝ) * + (walshTransform FABL.innerProductModTwoBit + (0 : FABL.F₂Cube (m + m)) : ℝ) := by + exact walshTransform_completeBentExtension_append + f m (0 : FABL.F₂Cube k) (0 : FABL.F₂Cube (m + m)) + _ = 0 := by rw [hf]; norm_num + exact_mod_cast hreal + +/-- The quadratic odd-dimensional construction: a complete inner-product +block together with one dummy coordinate. -/ +def oddQuadraticFunction (m : ℕ) : BooleanFunction ((m + m) + 1) := + fun z ↦ FABL.innerProductModTwoBit (Fin.tail z) + +/-- The dummy coordinate doubles the inner-product Walsh transform at zero +frequency and annihilates it at frequency one. -/ +theorem walshTransform_oddQuadraticFunction + (m : ℕ) (a : FABL.F₂Cube ((m + m) + 1)) : + walshTransform (oddQuadraticFunction m) a = + if a 0 = 0 then + 2 * walshTransform FABL.innerProductModTwoBit (Fin.tail a) + else 0 := by + rw [walshTransform_succ] + by_cases ha : a 0 = 0 + · simp [ha, oddQuadraticFunction, two_mul] + · simp [ha, oddQuadraticFunction] + +/-- The quadratic odd-dimensional construction has maximum raw Walsh +magnitude `2^(m+1)`. -/ +theorem maxWalshMagnitude_oddQuadraticFunction (m : ℕ) : + maxWalshMagnitude (oddQuadraticFunction m) = 2 ^ (m + 1) := by + unfold maxWalshMagnitude + apply Nat.le_antisymm + · apply Finset.sup'_le Finset.univ_nonempty + (fun a : FABL.F₂Cube ((m + m) + 1) ↦ + (walshTransform (oddQuadraticFunction m) a).natAbs) + intro a _ha + rw [walshTransform_oddQuadraticFunction] + by_cases ha : a 0 = 0 + · rw [if_pos ha, Int.natAbs_mul, + natAbs_walshTransform_innerProductModTwoBit] + simp [pow_succ, Nat.mul_comm] + · simp [ha] + · have hw := Finset.le_sup' + (fun a : FABL.F₂Cube ((m + m) + 1) ↦ + (walshTransform (oddQuadraticFunction m) a).natAbs) + (Finset.mem_univ (0 : FABL.F₂Cube ((m + m) + 1))) + rw [walshTransform_oddQuadraticFunction, if_pos (by simp), + Int.natAbs_mul, natAbs_walshTransform_innerProductModTwoBit] at hw + simpa [pow_succ, Nat.mul_comm] using hw + +/-- The quadratic odd-dimensional construction attains the quadratic +nonlinearity bound. -/ +theorem nonlinearity_oddQuadraticFunction (m : ℕ) : + nonlinearity (oddQuadraticFunction m) = 2 ^ (m + m) - 2 ^ m := by + have h := two_mul_nonlinearity_add_maxWalshMagnitude + (oddQuadraticFunction m) + rw [maxWalshMagnitude_oddQuadraticFunction] at h + have hdim : 2 ^ ((m + m) + 1) = 2 * 2 ^ (m + m) := by + rw [pow_succ] + ring + have hmag : 2 ^ (m + 1) = 2 * 2 ^ m := by + rw [pow_succ] + ring + rw [hdim, hmag] at h + omega + +/-- In every odd dimension, the maximum nonlinearity is at least the +quadratic bound. -/ +theorem quadraticBound_le_maximumNonlinearity_of_odd + (hn : Odd n) : + 2 ^ (n - 1) - 2 ^ ((n - 1) / 2) ≤ maximumNonlinearity n := by + obtain ⟨m, hm⟩ := hn + have hnform : n = (m + m) + 1 := by omega + rw [hnform] + have hsub : (m + m) + 1 - 1 = m + m := by omega + have hhalf : (m + m) / 2 = m := by omega + simpa only [hsub, hhalf, nonlinearity_oddQuadraticFunction] using + nonlinearity_le_maximumNonlinearity (oddQuadraticFunction m) + +/-- The maximum nonlinearity satisfies Carlet's covering-radius bound in +every dimension. -/ +theorem maximumNonlinearity_cast_le_relation_36 (n : ℕ) : + (maximumNonlinearity n : ℝ) ≤ + (2 : ℝ) ^ ((n : ℝ) - 1) - + (2 : ℝ) ^ ((n : ℝ) / 2 - 1) := by + obtain ⟨f, hf⟩ := exists_nonlinearity_eq_maximumNonlinearity n + rw [← hf] + exact nonlinearity_cast_le_relation_36 f + +/-- Carlet's lower quadratic bound and upper covering-radius bound for the +best nonlinearity in odd dimension. -/ +theorem maximumNonlinearity_odd_bounds + (hn : Odd n) : + 2 ^ (n - 1) - 2 ^ ((n - 1) / 2) ≤ maximumNonlinearity n ∧ + (maximumNonlinearity n : ℝ) ≤ + (2 : ℝ) ^ ((n : ℝ) - 1) - + (2 : ℝ) ^ ((n : ℝ) / 2 - 1) := + ⟨quadraticBound_le_maximumNonlinearity_of_odd hn, + maximumNonlinearity_cast_le_relation_36 n⟩ + +/-- The best one-variable nonlinearity is the quadratic-bound value zero. -/ +theorem maximumNonlinearity_one : maximumNonlinearity 1 = 0 := by + obtain ⟨f, hf⟩ := exists_nonlinearity_eq_maximumNonlinearity 1 + have hupper := nonlinearity_cast_le_coveringRadius f + rw [hf] at hupper + have hpow : (2 : ℝ) ^ (1 : ℕ) = 2 := by norm_num + rw [hpow] at hupper + have hsqrt : 0 < Real.sqrt 2 := Real.sqrt_pos.2 (by norm_num) + have hlt : (maximumNonlinearity 1 : ℝ) < 1 := by + linarith + have hnat : maximumNonlinearity 1 < 1 := by + exact_mod_cast hlt + omega + +/-- The best three-variable nonlinearity is the quadratic-bound value two. -/ +theorem maximumNonlinearity_three : maximumNonlinearity 3 = 2 := by + have hlower := quadraticBound_le_maximumNonlinearity_of_odd + (n := 3) (by decide) + obtain ⟨f, hf⟩ := exists_nonlinearity_eq_maximumNonlinearity 3 + have hupper := nonlinearity_cast_le_coveringRadius f + rw [hf] at hupper + have hpow : (2 : ℝ) ^ (3 : ℕ) = 8 := by norm_num + rw [hpow] at hupper + have hsqrt : 2 < Real.sqrt 8 := by + calc + (2 : ℝ) = Real.sqrt 4 := by norm_num + _ < Real.sqrt 8 := Real.sqrt_lt_sqrt (by norm_num) (by norm_num) + have hlt : (maximumNonlinearity 3 : ℝ) < 3 := by + linarith + have hnat : maximumNonlinearity 3 < 3 := by + exact_mod_cast hlt + norm_num at hlower + omega + +/-- Raw Walsh magnitudes of the extension are the base magnitudes scaled by `2^m`. -/ +theorem natAbs_walshTransform_kavutYucelBentExtension_append + (m : ℕ) (a : FABL.F₂Cube 9) (b : FABL.F₂Cube (m + m)) : + (walshTransform (kavutYucelBentExtension m) + (Fin.append a b)).natAbs = + (walshTransform kavutYucelFunction9 a).natAbs * 2 ^ m := by + simpa [kavutYucelBentExtension] using + natAbs_walshTransform_completeBentExtension_append + kavutYucelFunction9 m a b + +/-- The extended function has maximum raw Walsh magnitude `28 * 2^m`. -/ +theorem maxWalshMagnitude_kavutYucelBentExtension (m : ℕ) : + maxWalshMagnitude (kavutYucelBentExtension m) = 28 * 2 ^ m := by + rw [kavutYucelBentExtension, + maxWalshMagnitude_completeBentExtension, + maxWalshMagnitude_kavutYucelFunction9] + +/-- The exact nonlinearity of the direct-product extension. -/ +theorem nonlinearity_kavutYucelBentExtension (m : ℕ) : + nonlinearity (kavutYucelBentExtension m) = + 2 ^ (8 + (m + m)) - 14 * 2 ^ m := by + have h := two_mul_nonlinearity_add_maxWalshMagnitude + (kavutYucelBentExtension m) + rw [maxWalshMagnitude_kavutYucelBentExtension] at h + have hpow : 2 ^ (9 + (m + m)) = 2 * 2 ^ (8 + (m + m)) := by + rw [show 9 + (m + m) = (8 + (m + m)) + 1 by omega, pow_succ] + ring + rw [hpow] at h + omega + +/-- Every member of the direct-product family strictly exceeds the odd-dimensional +quadratic nonlinearity bound. -/ +theorem quadraticBound_lt_nonlinearity_kavutYucelBentExtension (m : ℕ) : + 2 ^ (8 + (m + m)) - 2 ^ (4 + m) < + nonlinearity (kavutYucelBentExtension m) := by + rw [nonlinearity_kavutYucelBentExtension] + have hsmall : 14 * 2 ^ m < 16 * 2 ^ m := by + have hpositive : 0 < 2 ^ m := Nat.pow_pos (by omega) + omega + have hfour : 2 ^ (4 + m) = 16 * 2 ^ m := by + rw [pow_add] + norm_num + have hlarge : 16 * 2 ^ m ≤ 2 ^ (8 + (m + m)) := by + rw [← hfour] + exact Nat.pow_le_pow_right (by omega) (by omega) + rw [hfour] + exact Nat.sub_lt_sub_left (hsmall.trans_le hlarge) hsmall + +/-- In every odd dimension above seven, some Boolean function strictly exceeds +the quadratic nonlinearity bound. -/ +theorem exists_nonlinearity_gt_quadraticBound_of_odd + (hn : Odd n) (hn7 : 7 < n) : + ∃ f : BooleanFunction n, + 2 ^ (n - 1) - 2 ^ ((n - 1) / 2) < nonlinearity f := by + obtain ⟨k, hk⟩ := hn + have hk4 : 4 ≤ k := by omega + let m := k - 4 + have hnform : n = 9 + (m + m) := by + dsimp [m] + omega + rw [hnform] + refine ⟨kavutYucelBentExtension m, ?_⟩ + have hsub : 9 + (m + m) - 1 = 8 + (m + m) := by omega + have hhalf : (8 + (m + m)) / 2 = 4 + m := by omega + simpa only [hsub, hhalf] using + quadraticBound_lt_nonlinearity_kavutYucelBentExtension m + +/-- In every odd dimension above seven, the maximum nonlinearity strictly +exceeds the quadratic bound. -/ +theorem quadraticBound_lt_maximumNonlinearity_of_odd + (hn : Odd n) (hn7 : 7 < n) : + 2 ^ (n - 1) - 2 ^ ((n - 1) / 2) < maximumNonlinearity n := by + obtain ⟨f, hf⟩ := exists_nonlinearity_gt_quadraticBound_of_odd hn hn7 + exact hf.trans_le (nonlinearity_le_maximumNonlinearity f) + +/-! ### Balanced Maitra--Kavut--Yücel family -/ + +/-- Toggle a finite set of truth-table positions. -/ +def flipOn {k : ℕ} + (f : BooleanFunction k) (points : Finset (FABL.F₂Cube k)) : + BooleanFunction k := + fun x ↦ f x + if x ∈ points then 1 else 0 + +namespace MaitraKavutYucel + +/-- BFCA 2008, p. 114: the nine-variable seed truth table. -/ +def seedTruthTable : ℕ := + 0x125425D30A398F36508C06817BEE122E250D973314F976AED58A3EA9120DA4FE * 2 ^ 256 + + 0x0E4D4575C42DD0426365EBA7FC5F45BE9B2F336981B5E1863618F49474F6FE00 + +/-- The nine-variable seed, with source bits read left-to-right. -/ +def seedFunction9 : BooleanFunction 9 := + fun x ↦ + if seedTruthTable.testBit (511 - f₂CubeNatIndex x) then 1 else 0 + +/-- The paper's linear shift `w₁ = (0,0,0,0,1,1,0,1,1)`. -/ +def shiftFrequency9 : FABL.F₂Cube 9 := + f₂CubeOfNat 9 27 + +/-- The shifted seed `f₁(x) = f(x) ⊕ ⟨w₁,x⟩`. -/ +def shiftedSeedFunction9 : BooleanFunction 9 := + fun x ↦ + seedFunction9 x + FABL.f₂DotProduct shiftFrequency9 x + +/-- BFCA 2008, p. 115: the four-variable bent truth table. -/ +def bentTruthTable : ℕ := + 0x0356 + +/-- The four-variable bent component, with source bits read left-to-right. -/ +def bentFunction4 : BooleanFunction 4 := + fun y ↦ + if bentTruthTable.testBit (15 - f₂CubeNatIndex y) then 1 else 0 + +/-- The initial thirteen-variable direct sum, of nonlinearity `4040`. -/ +def initialFunction13 : BooleanFunction (9 + 4) := + booleanDirectSum shiftedSeedFunction9 bentFunction4 + +/-- BFCA 2008, p. 114: the eight toggled truth-table positions. -/ +def flipPointList13 : + List (FABL.F₂Cube (9 + 4)) := + [ f₂CubeOfNat 13 4667, + f₂CubeOfNat 13 4758, + f₂CubeOfNat 13 4807, + f₂CubeOfNat 13 4823, + f₂CubeOfNat 13 4913, + f₂CubeOfNat 13 5042, + f₂CubeOfNat 13 8133, + f₂CubeOfNat 13 8187 ] + +/-- The finite set of the eight published toggle positions. -/ +def flipPoints13 : + Finset (FABL.F₂Cube (9 + 4)) := + flipPointList13.toFinset + +end MaitraKavutYucel + +/-- Maitra--Kavut--Yücel's balanced thirteen-variable function from BFCA 2008: +the direct sum printed in Section 3, with the eight published positions toggled. -/ +def maitraKavutYucelFunction13 : BooleanFunction 13 := + flipOn MaitraKavutYucel.initialFunction13 MaitraKavutYucel.flipPoints13 + +private def walshCharacterInt {k : ℕ} + (a x : FABL.F₂Cube k) : ℤ := + bitSignInt (FABL.f₂DotProduct a x) + +private def maitraKavutYucelPointsSix9 : List (FABL.F₂Cube 9) := + [59, 150, 199, 215, 305, 434].map (f₂CubeOfNat 9) + +private def maitraKavutYucelPointsTwo9 : List (FABL.F₂Cube 9) := + [453, 507].map (f₂CubeOfNat 9) + +private def walshCharacterSum + {k : ℕ} (a : FABL.F₂Cube k) (points : List (FABL.F₂Cube k)) : ℤ := + (points.map (walshCharacterInt a)).sum + +private def maitraKavutYucelSeedSpectrumCondition + (a : FABL.F₂Cube 9) (value : ℤ) : Bool := + decide (value.natAbs ≤ 20 ∨ + (value.natAbs = 28 ∧ + (walshCharacterSum a maitraKavutYucelPointsSix9 + + walshCharacterSum a maitraKavutYucelPointsTwo9).natAbs ≤ 4 ∧ + (walshCharacterSum a maitraKavutYucelPointsSix9 - + walshCharacterSum a maitraKavutYucelPointsTwo9).natAbs ≤ 4)) + +private theorem maitraKavutYucelSeedSpectrum_certificate : + (fastWalshCertificateTree 9 + MaitraKavutYucel.shiftedSeedFunction9).allFrequencies + maitraKavutYucelSeedSpectrumCondition = true := by + decide + +private theorem maitraKavutYucelSeedSpectrum + (a : FABL.F₂Cube 9) : + (walshTransform MaitraKavutYucel.shiftedSeedFunction9 a).natAbs ≤ 20 ∨ + ((walshTransform MaitraKavutYucel.shiftedSeedFunction9 a).natAbs = 28 ∧ + (walshCharacterSum a maitraKavutYucelPointsSix9 + + walshCharacterSum a maitraKavutYucelPointsTwo9).natAbs ≤ 4 ∧ + (walshCharacterSum a maitraKavutYucelPointsSix9 - + walshCharacterSum a maitraKavutYucelPointsTwo9).natAbs ≤ 4) := by + have h := WalshCertificateTree.allFrequencies_sound + (fastWalshCertificateTree 9 MaitraKavutYucel.shiftedSeedFunction9) + maitraKavutYucelSeedSpectrumCondition + maitraKavutYucelSeedSpectrum_certificate a + rw [fastWalshCertificateTree_correct] at h + exact of_decide_eq_true h + +private theorem maitraKavutYucelBentSpectrum_certificate : + (fastWalshCertificateTree 4 + MaitraKavutYucel.bentFunction4).allFrequencies + (fun _ value ↦ decide (value.natAbs = 4)) = true := by + decide + +private theorem maitraKavutYucelBentSpectrum (b : FABL.F₂Cube 4) : + (walshTransform MaitraKavutYucel.bentFunction4 b).natAbs = 4 := by + have h := WalshCertificateTree.allFrequencies_sound + (fastWalshCertificateTree 4 MaitraKavutYucel.bentFunction4) + (fun _ value ↦ decide (value.natAbs = 4)) + maitraKavutYucelBentSpectrum_certificate b + rw [fastWalshCertificateTree_correct] at h + exact of_decide_eq_true h + +private theorem maitraKavutYucelBitSignInt_add_one (b : FABL.𝔽₂) : + bitSignInt (b + 1) = -bitSignInt b := by + fin_cases b <;> rfl + +private theorem maitraKavutYucelWalshTerm_flipOn + {n : ℕ} (f : BooleanFunction n) (points : Finset (FABL.F₂Cube n)) + (a x : FABL.F₂Cube n) : + walshTerm (flipOn f points) a x = + if x ∈ points then -walshTerm f a x else walshTerm f a x := by + by_cases hx : x ∈ points + · rw [if_pos hx] + unfold walshTerm flipOn + rw [if_pos hx] + rw [show f x + 1 + FABL.f₂DotProduct a x = + (f x + FABL.f₂DotProduct a x) + 1 by abel] + exact maitraKavutYucelBitSignInt_add_one _ + · rw [if_neg hx] + simp [walshTerm, flipOn, hx] + +private theorem maitraKavutYucelWalshTransform_flipOn + {n : ℕ} (f : BooleanFunction n) (points : Finset (FABL.F₂Cube n)) + (a : FABL.F₂Cube n) : + walshTransform (flipOn f points) a = + walshTransform f a - 2 * ∑ x ∈ points, walshTerm f a x := by + classical + unfold walshTransform + rw [show (∑ x, walshTerm (flipOn f points) a x) = + ∑ x, if x ∈ points then -walshTerm f a x else walshTerm f a x by + apply Finset.sum_congr rfl + intro x _hx + exact maitraKavutYucelWalshTerm_flipOn f points a x] + rw [Finset.sum_ite] + simp only [Finset.filter_mem_eq_inter, Finset.univ_inter, + Finset.filter_notMem_eq_sdiff, Finset.sum_neg_distrib] + have hsplit := Finset.sum_sdiff + (f := fun x ↦ walshTerm f a x) + (show points ⊆ (Finset.univ : Finset (FABL.F₂Cube n)) by simp) + calc + -∑ x ∈ points, walshTerm f a x + + ∑ x ∈ (Finset.univ : Finset (FABL.F₂Cube n)) \ points, + walshTerm f a x = + ((∑ x ∈ (Finset.univ : Finset (FABL.F₂Cube n)) \ points, + walshTerm f a x) + + ∑ x ∈ points, walshTerm f a x) - + 2 * ∑ x ∈ points, walshTerm f a x := by ring + _ = (∑ x : FABL.F₂Cube n, walshTerm f a x) - + 2 * ∑ x ∈ points, walshTerm f a x := by rw [hsplit] + +private theorem walshCharacterInt_append + {n m : ℕ} (a x : FABL.F₂Cube n) (b y : FABL.F₂Cube m) : + walshCharacterInt (Fin.append a b) (Fin.append x y) = + walshCharacterInt a x * walshCharacterInt b y := by + unfold walshCharacterInt bitSignInt + rw [FABL.f₂DotProduct_append, FABL.signEncode_add] + rfl + +private theorem maitraKavutYucelInitialFunction13_zero_on_flipPoints + (p : FABL.F₂Cube (9 + 4)) (hp : p ∈ MaitraKavutYucel.flipPoints13) : + MaitraKavutYucel.initialFunction13 p = 0 := by + have hp' : + p = f₂CubeOfNat 13 4667 ∨ + p = f₂CubeOfNat 13 4758 ∨ + p = f₂CubeOfNat 13 4807 ∨ + p = f₂CubeOfNat 13 4823 ∨ + p = f₂CubeOfNat 13 4913 ∨ + p = f₂CubeOfNat 13 5042 ∨ + p = f₂CubeOfNat 13 8133 ∨ + p = f₂CubeOfNat 13 8187 := by + simpa only [MaitraKavutYucel.flipPoints13, List.mem_toFinset, + MaitraKavutYucel.flipPointList13, List.mem_cons, List.mem_nil_iff, + or_false] using hp + rcases hp' with h | h | h | h | h | h | h | h <;> subst p <;> decide + +private theorem maitraKavutYucelFlipWalshTerm_eq_character + (a p : FABL.F₂Cube (9 + 4)) (hp : p ∈ MaitraKavutYucel.flipPoints13) : + walshTerm MaitraKavutYucel.initialFunction13 a p = walshCharacterInt a p := by + rw [walshTerm, maitraKavutYucelInitialFunction13_zero_on_flipPoints p hp, zero_add] + rfl + +private theorem maitraKavutYucelFlipCharacterSum + (a : FABL.F₂Cube 9) (b : FABL.F₂Cube 4) : + (∑ p ∈ MaitraKavutYucel.flipPoints13, + walshCharacterInt (Fin.append a b) p) = + walshCharacterInt b (f₂CubeOfNat 4 9) * + walshCharacterSum a maitraKavutYucelPointsSix9 + + walshCharacterInt b (f₂CubeOfNat 4 15) * + walshCharacterSum a maitraKavutYucelPointsTwo9 := by + have hnodup : MaitraKavutYucel.flipPointList13.Nodup := by decide + have h4667 : f₂CubeOfNat 13 4667 = + Fin.append (f₂CubeOfNat 9 59) (f₂CubeOfNat 4 9) := by decide + have h4758 : f₂CubeOfNat 13 4758 = + Fin.append (f₂CubeOfNat 9 150) (f₂CubeOfNat 4 9) := by decide + have h4807 : f₂CubeOfNat 13 4807 = + Fin.append (f₂CubeOfNat 9 199) (f₂CubeOfNat 4 9) := by decide + have h4823 : f₂CubeOfNat 13 4823 = + Fin.append (f₂CubeOfNat 9 215) (f₂CubeOfNat 4 9) := by decide + have h4913 : f₂CubeOfNat 13 4913 = + Fin.append (f₂CubeOfNat 9 305) (f₂CubeOfNat 4 9) := by decide + have h5042 : f₂CubeOfNat 13 5042 = + Fin.append (f₂CubeOfNat 9 434) (f₂CubeOfNat 4 9) := by decide + have h8133 : f₂CubeOfNat 13 8133 = + Fin.append (f₂CubeOfNat 9 453) (f₂CubeOfNat 4 15) := by decide + have h8187 : f₂CubeOfNat 13 8187 = + Fin.append (f₂CubeOfNat 9 507) (f₂CubeOfNat 4 15) := by decide + rw [show (∑ p ∈ MaitraKavutYucel.flipPoints13, + walshCharacterInt (Fin.append a b) p) = + (MaitraKavutYucel.flipPointList13.map + (walshCharacterInt (Fin.append a b))).sum by + exact List.sum_toFinset _ hnodup] + simp [MaitraKavutYucel.flipPointList13, h4667, h4758, h4807, h4823, + h4913, h5042, h8133, h8187, walshCharacterInt_append, + walshCharacterSum, maitraKavutYucelPointsSix9, maitraKavutYucelPointsTwo9] + ring + +private theorem maitraKavutYucelFlipWalshTermSum + (a : FABL.F₂Cube 9) (b : FABL.F₂Cube 4) : + (∑ p ∈ MaitraKavutYucel.flipPoints13, + walshTerm MaitraKavutYucel.initialFunction13 (Fin.append a b) p) = + walshCharacterInt b (f₂CubeOfNat 4 9) * + walshCharacterSum a maitraKavutYucelPointsSix9 + + walshCharacterInt b (f₂CubeOfNat 4 15) * + walshCharacterSum a maitraKavutYucelPointsTwo9 := by + calc + (∑ p ∈ MaitraKavutYucel.flipPoints13, + walshTerm MaitraKavutYucel.initialFunction13 (Fin.append a b) p) = + ∑ p ∈ MaitraKavutYucel.flipPoints13, + walshCharacterInt (Fin.append a b) p := by + apply Finset.sum_congr rfl + intro p hp + exact maitraKavutYucelFlipWalshTerm_eq_character (Fin.append a b) p hp + _ = _ := maitraKavutYucelFlipCharacterSum a b + +private theorem walshTransform_maitraKavutYucelFunction13_append + (a : FABL.F₂Cube 9) (b : FABL.F₂Cube 4) : + walshTransform maitraKavutYucelFunction13 (Fin.append a b) = + walshTransform MaitraKavutYucel.shiftedSeedFunction9 a * + walshTransform MaitraKavutYucel.bentFunction4 b - + 2 * (walshCharacterInt b (f₂CubeOfNat 4 9) * + walshCharacterSum a maitraKavutYucelPointsSix9 + + walshCharacterInt b (f₂CubeOfNat 4 15) * + walshCharacterSum a maitraKavutYucelPointsTwo9) := by + rw [maitraKavutYucelFunction13, maitraKavutYucelWalshTransform_flipOn, + maitraKavutYucelFlipWalshTermSum, MaitraKavutYucel.initialFunction13, + walshTransform_booleanDirectSum_append] + +private theorem walshCharacterInt_natAbs + {n : ℕ} (a x : FABL.F₂Cube n) : + (walshCharacterInt a x).natAbs = 1 := by + unfold walshCharacterInt + generalize FABL.f₂DotProduct a x = b + fin_cases b <;> rfl + +private theorem walshCharacterSum_natAbs_le_length + {n : ℕ} (a : FABL.F₂Cube n) (points : List (FABL.F₂Cube n)) : + (walshCharacterSum a points).natAbs ≤ points.length := by + unfold walshCharacterSum + induction points with + | nil => simp + | cons point points ih => + simp only [List.map_cons, List.sum_cons, List.length_cons] + calc + (walshCharacterInt a point + + (points.map (walshCharacterInt a)).sum).natAbs ≤ + (walshCharacterInt a point).natAbs + + ((points.map (walshCharacterInt a)).sum).natAbs := + Int.natAbs_add_le _ _ + _ = 1 + ((points.map (walshCharacterInt a)).sum).natAbs := by + rw [walshCharacterInt_natAbs] + _ ≤ 1 + points.length := Nat.add_le_add_left ih 1 + _ = points.length + 1 := by omega + +private theorem maitraKavutYucelBitSignCombination_natAbs_le + (u v : FABL.𝔽₂) (s t : ℤ) + (hplus : (s + t).natAbs ≤ 4) + (hminus : (s - t).natAbs ≤ 4) : + (bitSignInt u * s + bitSignInt v * t).natAbs ≤ 4 := by + by_cases hu : u = 0 + · subst u + by_cases hv : v = 0 + · subst v + simpa [bitSignInt] using hplus + · have hv_one : v = 1 := Fin.eq_one_of_ne_zero v hv + subst v + simpa [sub_eq_add_neg, bitSignInt] using hminus + · have hu_one : u = 1 := Fin.eq_one_of_ne_zero u hu + subst u + by_cases hv : v = 0 + · subst v + rw [show bitSignInt 1 * s + bitSignInt 0 * t = -(s - t) by + simp [bitSignInt] + ring, + Int.natAbs_neg] + exact hminus + · have hv_one : v = 1 := Fin.eq_one_of_ne_zero v hv + subst v + rw [show bitSignInt 1 * s + bitSignInt 1 * t = -(s + t) by + simp [bitSignInt] + ring, + Int.natAbs_neg] + exact hplus + +private theorem walshCharacterIntCombination_natAbs_le + (b : FABL.F₂Cube 4) (s t : ℤ) + (hplus : (s + t).natAbs ≤ 4) + (hminus : (s - t).natAbs ≤ 4) : + (walshCharacterInt b (f₂CubeOfNat 4 9) * s + + walshCharacterInt b (f₂CubeOfNat 4 15) * t).natAbs ≤ 4 := by + exact maitraKavutYucelBitSignCombination_natAbs_le + (FABL.f₂DotProduct b (f₂CubeOfNat 4 9)) + (FABL.f₂DotProduct b (f₂CubeOfNat 4 15)) s t hplus hminus + +private theorem maitraKavutYucelFlipCorrection_natAbs_le_eight + (a : FABL.F₂Cube 9) (b : FABL.F₂Cube 4) : + (walshCharacterInt b (f₂CubeOfNat 4 9) * + walshCharacterSum a maitraKavutYucelPointsSix9 + + walshCharacterInt b (f₂CubeOfNat 4 15) * + walshCharacterSum a maitraKavutYucelPointsTwo9).natAbs ≤ 8 := by + calc + (walshCharacterInt b (f₂CubeOfNat 4 9) * + walshCharacterSum a maitraKavutYucelPointsSix9 + + walshCharacterInt b (f₂CubeOfNat 4 15) * + walshCharacterSum a maitraKavutYucelPointsTwo9).natAbs ≤ + (walshCharacterInt b (f₂CubeOfNat 4 9) * + walshCharacterSum a maitraKavutYucelPointsSix9).natAbs + + (walshCharacterInt b (f₂CubeOfNat 4 15) * + walshCharacterSum a maitraKavutYucelPointsTwo9).natAbs := + Int.natAbs_add_le _ _ + _ = (walshCharacterSum a maitraKavutYucelPointsSix9).natAbs + + (walshCharacterSum a maitraKavutYucelPointsTwo9).natAbs := by + simp [Int.natAbs_mul, walshCharacterInt_natAbs] + _ ≤ maitraKavutYucelPointsSix9.length + maitraKavutYucelPointsTwo9.length := + Nat.add_le_add + (walshCharacterSum_natAbs_le_length a maitraKavutYucelPointsSix9) + (walshCharacterSum_natAbs_le_length a maitraKavutYucelPointsTwo9) + _ = 8 := by decide + +private theorem maitraKavutYucelFunction13_walsh_bound_append + (a : FABL.F₂Cube 9) (b : FABL.F₂Cube 4) : + (walshTransform maitraKavutYucelFunction13 (Fin.append a b)).natAbs ≤ 120 := by + rw [walshTransform_maitraKavutYucelFunction13_append] + have hb := maitraKavutYucelBentSpectrum b + rcases maitraKavutYucelSeedSpectrum a with hsmall | ⟨hmax, hplus, hminus⟩ + · have hcorrection := maitraKavutYucelFlipCorrection_natAbs_le_eight a b + calc + (walshTransform MaitraKavutYucel.shiftedSeedFunction9 a * + walshTransform MaitraKavutYucel.bentFunction4 b - + 2 * (walshCharacterInt b (f₂CubeOfNat 4 9) * + walshCharacterSum a maitraKavutYucelPointsSix9 + + walshCharacterInt b (f₂CubeOfNat 4 15) * + walshCharacterSum a maitraKavutYucelPointsTwo9)).natAbs ≤ + (walshTransform MaitraKavutYucel.shiftedSeedFunction9 a * + walshTransform MaitraKavutYucel.bentFunction4 b).natAbs + + (2 * (walshCharacterInt b (f₂CubeOfNat 4 9) * + walshCharacterSum a maitraKavutYucelPointsSix9 + + walshCharacterInt b (f₂CubeOfNat 4 15) * + walshCharacterSum a maitraKavutYucelPointsTwo9)).natAbs := + Int.natAbs_sub_le _ _ + _ = (walshTransform MaitraKavutYucel.shiftedSeedFunction9 a).natAbs * 4 + + 2 * (walshCharacterInt b (f₂CubeOfNat 4 9) * + walshCharacterSum a maitraKavutYucelPointsSix9 + + walshCharacterInt b (f₂CubeOfNat 4 15) * + walshCharacterSum a maitraKavutYucelPointsTwo9).natAbs := by + rw [Int.natAbs_mul, Int.natAbs_mul, hb] + norm_num + _ ≤ 120 := by omega + · have hcorrection := walshCharacterIntCombination_natAbs_le b + (walshCharacterSum a maitraKavutYucelPointsSix9) + (walshCharacterSum a maitraKavutYucelPointsTwo9) hplus hminus + calc + (walshTransform MaitraKavutYucel.shiftedSeedFunction9 a * + walshTransform MaitraKavutYucel.bentFunction4 b - + 2 * (walshCharacterInt b (f₂CubeOfNat 4 9) * + walshCharacterSum a maitraKavutYucelPointsSix9 + + walshCharacterInt b (f₂CubeOfNat 4 15) * + walshCharacterSum a maitraKavutYucelPointsTwo9)).natAbs ≤ + (walshTransform MaitraKavutYucel.shiftedSeedFunction9 a * + walshTransform MaitraKavutYucel.bentFunction4 b).natAbs + + (2 * (walshCharacterInt b (f₂CubeOfNat 4 9) * + walshCharacterSum a maitraKavutYucelPointsSix9 + + walshCharacterInt b (f₂CubeOfNat 4 15) * + walshCharacterSum a maitraKavutYucelPointsTwo9)).natAbs := + Int.natAbs_sub_le _ _ + _ = (walshTransform MaitraKavutYucel.shiftedSeedFunction9 a).natAbs * 4 + + 2 * (walshCharacterInt b (f₂CubeOfNat 4 9) * + walshCharacterSum a maitraKavutYucelPointsSix9 + + walshCharacterInt b (f₂CubeOfNat 4 15) * + walshCharacterSum a maitraKavutYucelPointsTwo9).natAbs := by + rw [Int.natAbs_mul, Int.natAbs_mul, hb] + norm_num + _ ≤ 120 := by omega + +theorem maitraKavutYucelFunction13_walsh_bound + (frequency : FABL.F₂Cube (9 + 4)) : + (walshTransform maitraKavutYucelFunction13 frequency).natAbs ≤ 120 := by + let p := (Fin.appendEquiv 9 4).symm frequency + have hfrequency : Fin.append p.1 p.2 = frequency := + (Fin.appendEquiv 9 4).apply_symm_apply frequency + rw [← hfrequency] + exact maitraKavutYucelFunction13_walsh_bound_append p.1 p.2 + +private theorem maitraKavutYucelSeedZero_certificate : + (fastWalshCertificateTree 9 MaitraKavutYucel.shiftedSeedFunction9).eval 0 = 4 := by + decide + +private theorem maitraKavutYucelSeedZero : + walshTransform MaitraKavutYucel.shiftedSeedFunction9 0 = 4 := by + rw [← fastWalshCertificateTree_correct] + exact maitraKavutYucelSeedZero_certificate + +private theorem maitraKavutYucelBentZero_certificate : + (fastWalshCertificateTree 4 MaitraKavutYucel.bentFunction4).eval 0 = 4 := by + decide + +private theorem maitraKavutYucelBentZero : + walshTransform MaitraKavutYucel.bentFunction4 0 = 4 := by + rw [← fastWalshCertificateTree_correct] + exact maitraKavutYucelBentZero_certificate + +private theorem walshCharacterIntZeroAtNine : + walshCharacterInt (0 : FABL.F₂Cube 4) (f₂CubeOfNat 4 9) = 1 := by + decide + +private theorem walshCharacterIntZeroAtFifteen : + walshCharacterInt (0 : FABL.F₂Cube 4) (f₂CubeOfNat 4 15) = 1 := by + decide + +private theorem walshCharacterSumZeroSix : + walshCharacterSum (0 : FABL.F₂Cube 9) maitraKavutYucelPointsSix9 = 6 := by + decide + +private theorem walshCharacterSumZeroTwo : + walshCharacterSum (0 : FABL.F₂Cube 9) maitraKavutYucelPointsTwo9 = 2 := by + decide + +private theorem walshCharacterSumWitnessSix : + walshCharacterSum (f₂CubeOfNat 9 1) maitraKavutYucelPointsSix9 = -2 := by + decide + +private theorem walshCharacterSumWitnessTwo : + walshCharacterSum (f₂CubeOfNat 9 1) maitraKavutYucelPointsTwo9 = -2 := by + decide + +private theorem maitraKavutYucelFunction13_zero : + walshTransform maitraKavutYucelFunction13 0 = 0 := by + have happend : Fin.append (0 : FABL.F₂Cube 9) (0 : FABL.F₂Cube 4) = + (0 : FABL.F₂Cube (9 + 4)) := by + funext i + refine Fin.addCases (fun l ↦ ?_) (fun r ↦ ?_) i <;> simp + rw [← happend, walshTransform_maitraKavutYucelFunction13_append, + maitraKavutYucelSeedZero, maitraKavutYucelBentZero, walshCharacterIntZeroAtNine, + walshCharacterIntZeroAtFifteen, walshCharacterSumZeroSix, + walshCharacterSumZeroTwo] + norm_num + +theorem isBalanced_maitraKavutYucelFunction13 : + IsBalanced maitraKavutYucelFunction13 := by + rw [isBalanced_iff_walshTransform_zero_eq_zero] + exact maitraKavutYucelFunction13_zero + +private theorem maitraKavutYucelSeedWitness_certificate : + (fastWalshCertificateTree 9 MaitraKavutYucel.shiftedSeedFunction9).eval + (f₂CubeOfNat 9 1) = 28 := by + decide + +private theorem maitraKavutYucelSeedWitness : + walshTransform MaitraKavutYucel.shiftedSeedFunction9 + (f₂CubeOfNat 9 1) = 28 := by + rw [← fastWalshCertificateTree_correct] + exact maitraKavutYucelSeedWitness_certificate + +theorem maitraKavutYucelFunction13_walsh_witness : + walshTransform maitraKavutYucelFunction13 (f₂CubeOfNat 13 1) = 120 := by + have hfrequency : f₂CubeOfNat 13 1 = + Fin.append (f₂CubeOfNat 9 1) (0 : FABL.F₂Cube 4) := by decide + rw [hfrequency, walshTransform_maitraKavutYucelFunction13_append, + maitraKavutYucelSeedWitness, maitraKavutYucelBentZero, walshCharacterIntZeroAtNine, + walshCharacterIntZeroAtFifteen, walshCharacterSumWitnessSix, + walshCharacterSumWitnessTwo] + norm_num + +theorem maxWalshMagnitude_maitraKavutYucelFunction13 : + maxWalshMagnitude maitraKavutYucelFunction13 = 120 := by + apply Nat.le_antisymm + · exact Finset.sup'_le Finset.univ_nonempty + (fun frequency : FABL.F₂Cube (9 + 4) ↦ + (walshTransform maitraKavutYucelFunction13 frequency).natAbs) + fun frequency _hfrequency ↦ + maitraKavutYucelFunction13_walsh_bound frequency + · have hwitness := Finset.le_sup' + (fun frequency : FABL.F₂Cube (9 + 4) ↦ + (walshTransform maitraKavutYucelFunction13 frequency).natAbs) + (Finset.mem_univ (f₂CubeOfNat 13 1)) + simpa [maxWalshMagnitude, + maitraKavutYucelFunction13_walsh_witness] using hwitness + +theorem nonlinearity_maitraKavutYucelFunction13 : + nonlinearity maitraKavutYucelFunction13 = 4036 := by + have h := two_mul_nonlinearity_add_maxWalshMagnitude + maitraKavutYucelFunction13 + rw [maxWalshMagnitude_maitraKavutYucelFunction13] at h + norm_num at h ⊢ + omega + +/-- Extend the balanced Maitra--Kavut--Yücel seed by a complete bent block. -/ +def maitraKavutYucelBentExtension (m : ℕ) : + BooleanFunction (13 + (m + m)) := + completeBentExtension maitraKavutYucelFunction13 m + +/-- Every complete bent extension of the Maitra--Kavut--Yücel seed is balanced. -/ +theorem isBalanced_maitraKavutYucelBentExtension (m : ℕ) : + IsBalanced (maitraKavutYucelBentExtension m) := by + exact isBalanced_completeBentExtension maitraKavutYucelFunction13 m + isBalanced_maitraKavutYucelFunction13 + +/-- The extended balanced family has maximum Walsh magnitude `120 * 2^m`. -/ +theorem maxWalshMagnitude_maitraKavutYucelBentExtension (m : ℕ) : + maxWalshMagnitude (maitraKavutYucelBentExtension m) = 120 * 2 ^ m := by + rw [maitraKavutYucelBentExtension, + maxWalshMagnitude_completeBentExtension, + maxWalshMagnitude_maitraKavutYucelFunction13] + +/-- The extended balanced family has nonlinearity +`2^(12+2m) - 60 * 2^m`. -/ +theorem nonlinearity_maitraKavutYucelBentExtension (m : ℕ) : + nonlinearity (maitraKavutYucelBentExtension m) = + 2 ^ (12 + (m + m)) - 60 * 2 ^ m := by + have h := two_mul_nonlinearity_add_maxWalshMagnitude + (maitraKavutYucelBentExtension m) + rw [maxWalshMagnitude_maitraKavutYucelBentExtension] at h + have hpow : 2 ^ (13 + (m + m)) = 2 * 2 ^ (12 + (m + m)) := by + rw [show 13 + (m + m) = (12 + (m + m)) + 1 by omega, pow_succ] + ring + rw [hpow] at h + omega + +/-- Every member of the balanced family strictly exceeds the odd-dimensional +quadratic nonlinearity bound. -/ +theorem quadraticBound_lt_nonlinearity_maitraKavutYucelBentExtension + (m : ℕ) : + 2 ^ (12 + (m + m)) - 2 ^ (6 + m) < + nonlinearity (maitraKavutYucelBentExtension m) := by + rw [nonlinearity_maitraKavutYucelBentExtension] + have hsmall : 60 * 2 ^ m < 64 * 2 ^ m := by + have hpositive : 0 < 2 ^ m := Nat.pow_pos (by omega) + omega + have hsix : 2 ^ (6 + m) = 64 * 2 ^ m := by + rw [pow_add] + norm_num + have hlarge : 64 * 2 ^ m ≤ 2 ^ (12 + (m + m)) := by + rw [← hsix] + exact Nat.pow_le_pow_right (by omega) (by omega) + rw [hsix] + exact Nat.sub_lt_sub_left (hsmall.trans_le hlarge) hsmall + +/-- In every odd dimension at least thirteen, a balanced Boolean function +strictly exceeds the quadratic nonlinearity bound. -/ +theorem exists_isBalanced_nonlinearity_gt_quadraticBound_of_odd + (hn : Odd n) (hn13 : 13 ≤ n) : + ∃ f : BooleanFunction n, IsBalanced f ∧ + 2 ^ (n - 1) - 2 ^ ((n - 1) / 2) < nonlinearity f := by + obtain ⟨k, hk⟩ := hn + have hk6 : 6 ≤ k := by omega + let m := k - 6 + have hnform : n = 13 + (m + m) := by + dsimp [m] + omega + rw [hnform] + refine ⟨maitraKavutYucelBentExtension m, + isBalanced_maitraKavutYucelBentExtension m, ?_⟩ + have hsub : 13 + (m + m) - 1 = 12 + (m + m) := by omega + have hhalf : (12 + (m + m)) / 2 = 6 + m := by omega + simpa only [hsub, hhalf] using + quadraticBound_lt_nonlinearity_maitraKavutYucelBentExtension m + +private theorem hammingWeight_add_add_two_mul_card_inter + (f g : BooleanFunction n) : + hammingWeight (f + g) + 2 * (support f ∩ support g).card = + hammingWeight f + hammingWeight g := by + classical + rw [hammingWeight_eq_card_support, hammingWeight_eq_card_support, + hammingWeight_eq_card_support] + have hinter : + support f ∩ support g = + Finset.univ.filter fun x : FABL.F₂Cube n ↦ f x = 1 ∧ g x = 1 := by + ext x + simp [mem_support] + rw [hinter] + simp only [support, FABL.f₂OneSupport, Pi.add_apply] + simp only [Finset.card_filter] + rw [Finset.mul_sum] + rw [← Finset.sum_add_distrib, ← Finset.sum_add_distrib] + apply Finset.sum_congr rfl + intro x _hx + by_cases hfx : f x = 0 + · by_cases hgx : g x = 0 + · norm_num [hfx, hgx] + · have hgx_one : g x = 1 := Fin.eq_one_of_ne_zero _ hgx + norm_num [hfx, hgx_one] + · have hfx_one : f x = 1 := Fin.eq_one_of_ne_zero _ hfx + by_cases hgx : g x = 0 + · norm_num [hfx_one, hgx] + · have hgx_one : g x = 1 := Fin.eq_one_of_ne_zero _ hgx + norm_num [hfx_one, hgx_one] + +private theorem four_dvd_hammingWeight_affineFunction_six + (b : FABL.𝔽₂) (a : FABL.F₂Cube 6) : + 4 ∣ hammingWeight (FABL.affineFunction b a) := by + by_cases ha : a = 0 + · subst a + by_cases hb : b = 0 + · subst b + have hzero : + FABL.affineFunction (0 : FABL.𝔽₂) (0 : FABL.F₂Cube 6) = 0 := by + funext x + simp [FABL.affineFunction, FABL.f₂DotProduct] + rw [hzero] + simp + · have hb_one : b = 1 := Fin.eq_one_of_ne_zero _ hb + subst b + rw [hammingWeight_affineFunction_one_zero] + norm_num + · rw [hammingWeight_affineFunction_of_ne_zero b a ha] + norm_num + +private theorem even_support_inter_affineFunction_of_degree_le_four + (f : BooleanFunction 6) (hf : FABL.functionAlgebraicDegree f ≤ 4) + (b : FABL.𝔽₂) (a : FABL.F₂Cube 6) : + Even (support f ∩ support (FABL.affineFunction b a)).card := by + have hfmem : f ∈ reedMuller 4 6 := hf + have hfdual : f ∈ reedMullerDual 1 6 := by + rw [reedMullerDual_eq (r := 1) (n := 6) (by omega)] + norm_num + exact hfmem + rw [reedMullerDual, LinearMap.BilinForm.mem_orthogonal_iff] at hfdual + have hpair := hfdual (FABL.affineFunction b a) + (affineFunction_mem_reedMuller_one b a) + exact even_card_support_inter_of_pairing_eq_zero f + (FABL.affineFunction b a) (by + rw [booleanFunctionPairing_apply] + calc + ∑ x, f x * FABL.affineFunction b a x = + ∑ x, FABL.affineFunction b a x * f x := by + apply Finset.sum_congr rfl + intro x _hx + exact mul_comm _ _ + _ = 0 := hpair) + +private theorem hammingDistance_affineFunction_mod_four_eq_weight_mod_four + (f : BooleanFunction 6) (hf : FABL.functionAlgebraicDegree f ≤ 4) + (b : FABL.𝔽₂) (a : FABL.F₂Cube 6) : + hammingDistance f (FABL.affineFunction b a) % 4 = hammingWeight f % 4 := by + rw [hammingDistance_eq_hammingWeight_add] + have hidentity := hammingWeight_add_add_two_mul_card_inter f + (FABL.affineFunction b a) + obtain ⟨k, hk⟩ := + even_support_inter_affineFunction_of_degree_le_four f hf b a + obtain ⟨q, hq⟩ := four_dvd_hammingWeight_affineFunction_six b a + omega + +private theorem exists_affineFunction_hammingDistance_eq_nonlinearity + (f : BooleanFunction n) : + ∃ b a, hammingDistance f (FABL.affineFunction b a) = nonlinearity f := by + classical + unfold nonlinearity + obtain ⟨p, _hp, hmin⟩ := Finset.exists_mem_eq_inf' + (s := (Finset.univ : Finset (FABL.𝔽₂ × FABL.F₂Cube n))) + Finset.univ_nonempty + (fun q ↦ hammingDistance f (FABL.affineFunction q.1 q.2)) + exact ⟨p.1, p.2, hmin.symm⟩ + +private theorem walshTransform_eq_sixty_four_sub_two_mul_distance + (f : BooleanFunction 6) (a : FABL.F₂Cube 6) : + walshTransform f a = + 64 - 2 * (hammingDistance f (FABL.affineFunction 0 a) : ℤ) := by + apply (Int.cast_injective : Function.Injective (fun z : ℤ ↦ (z : ℝ))) + push_cast + have hdistance := hammingDistance_cast_linearFunction_eq f a + norm_num at hdistance ⊢ + linarith + +private theorem natAbs_walshTransform_eq_four_or_twelve_of_degree_le_four + (f : BooleanFunction 6) (hdegree : FABL.functionAlgebraicDegree f ≤ 4) + (hf : nonlinearity f = 26) (a : FABL.F₂Cube 6) : + (walshTransform f a).natAbs = 4 ∨ + (walshTransform f a).natAbs = 12 := by + obtain ⟨bmin, amin, hmin⟩ := + exists_affineFunction_hammingDistance_eq_nonlinearity f + have hminimumMod := + hammingDistance_affineFunction_mod_four_eq_weight_mod_four + f hdegree bmin amin + rw [hmin, hf] at hminimumMod + norm_num at hminimumMod + have hlinearMod := + hammingDistance_affineFunction_mod_four_eq_weight_mod_four + f hdegree 0 a + have hdistanceMod : + hammingDistance f (FABL.affineFunction 0 a) % 4 = 2 := by + omega + have hrelation := two_mul_nonlinearity_add_maxWalshMagnitude f + rw [hf] at hrelation + norm_num at hrelation + have hmaximum : maxWalshMagnitude f = 12 := by omega + have hbound : (walshTransform f a).natAbs ≤ 12 := by + have hle := Finset.le_sup' + (fun u : FABL.F₂Cube 6 ↦ (walshTransform f u).natAbs) + (Finset.mem_univ a) + change (walshTransform f a).natAbs ≤ maxWalshMagnitude f at hle + rwa [hmaximum] at hle + have hwalsh := walshTransform_eq_sixty_four_sub_two_mul_distance f a + rcases Int.natAbs_eq (walshTransform f a) with hpositive | hnegative + · rw [hpositive] at hwalsh + omega + · rw [hnegative] at hwalsh + omega + +private theorem card_walshTransform_natAbs_eq_twelve_of_degree_le_four + (f : BooleanFunction 6) (hdegree : FABL.functionAlgebraicDegree f ≤ 4) + (hf : nonlinearity f = 26) : + ((Finset.univ : Finset (FABL.F₂Cube 6)).filter + fun a ↦ (walshTransform f a).natAbs = 12).card = 24 := by + let high := (Finset.univ : Finset (FABL.F₂Cube 6)).filter + fun a ↦ (walshTransform f a).natAbs = 12 + let low := (Finset.univ : Finset (FABL.F₂Cube 6)).filter + fun a ↦ ¬(walshTransform f a).natAbs = 12 + have hparsevalReal := sum_walshTransform_sq_eq_two_pow_sq f + have hparseval : + ∑ a : FABL.F₂Cube 6, walshTransform f a ^ 2 = (4096 : ℤ) := by + apply (Int.cast_injective : Function.Injective (fun z : ℤ ↦ (z : ℝ))) + push_cast + norm_num at hparsevalReal ⊢ + exact hparsevalReal + have hsquareHigh (a : FABL.F₂Cube 6) + (ha : (walshTransform f a).natAbs = 12) : + walshTransform f a ^ 2 = (144 : ℤ) := by + rcases Int.natAbs_eq (walshTransform f a) with hpositive | hnegative + · rw [ha] at hpositive + rw [hpositive] + norm_num + · rw [ha] at hnegative + rw [hnegative] + norm_num + have hsquareLow (a : FABL.F₂Cube 6) + (ha : ¬(walshTransform f a).natAbs = 12) : + walshTransform f a ^ 2 = (16 : ℤ) := by + rcases natAbs_walshTransform_eq_four_or_twelve_of_degree_le_four + f hdegree hf a with hfour | htwelve + · rcases Int.natAbs_eq (walshTransform f a) with hpositive | hnegative + · rw [hfour] at hpositive + rw [hpositive] + norm_num + · rw [hfour] at hnegative + rw [hnegative] + norm_num + · exact False.elim (ha htwelve) + have hsumHigh : + ∑ a ∈ high, walshTransform f a ^ 2 = (high.card : ℤ) * 144 := by + calc + ∑ a ∈ high, walshTransform f a ^ 2 = ∑ _a ∈ high, (144 : ℤ) := by + apply Finset.sum_congr rfl + intro a ha + exact hsquareHigh a (by simpa [high] using ha) + _ = (high.card : ℤ) * 144 := by simp + have hsumLow : + ∑ a ∈ low, walshTransform f a ^ 2 = (low.card : ℤ) * 16 := by + calc + ∑ a ∈ low, walshTransform f a ^ 2 = ∑ _a ∈ low, (16 : ℤ) := by + apply Finset.sum_congr rfl + intro a ha + exact hsquareLow a (by simpa [low] using ha) + _ = (low.card : ℤ) * 16 := by simp + have hsplitSum := Finset.sum_filter_add_sum_filter_not + (Finset.univ : Finset (FABL.F₂Cube 6)) + (fun a ↦ (walshTransform f a).natAbs = 12) + (fun a ↦ walshTransform f a ^ 2) + change (∑ a ∈ high, walshTransform f a ^ 2) + + (∑ a ∈ low, walshTransform f a ^ 2) = + ∑ a : FABL.F₂Cube 6, walshTransform f a ^ 2 at hsplitSum + rw [hsumHigh, hsumLow, hparseval] at hsplitSum + have hsplitCard := Finset.card_filter_add_card_filter_not + (s := (Finset.univ : Finset (FABL.F₂Cube 6))) + (fun a : FABL.F₂Cube 6 ↦ (walshTransform f a).natAbs = 12) + change high.card + low.card = Fintype.card (FABL.F₂Cube 6) at hsplitCard + rw [card_f₂Cube] at hsplitCard + norm_num at hsplitCard + change high.card = 24 + omega + +private theorem sum_walshTransform_mul_walshTerm_eq_two_pow + (f : BooleanFunction n) (x : FABL.F₂Cube n) : + ∑ a, walshTransform f a * walshTerm f a x = (2 ^ n : ℤ) := by + apply (Int.cast_injective : Function.Injective (fun z : ℤ ↦ (z : ℝ))) + push_cast + calc + ∑ a, (walshTransform f a : ℝ) * (walshTerm f a x : ℝ) = + realSignView f x * + ∑ a, (walshTransform f a : ℝ) * FABL.vectorWalshCharacter a x := by + rw [Finset.mul_sum] + apply Finset.sum_congr rfl + intro a _ha + rw [walshTerm_cast_eq_realSignView_mul_character] + ring + _ = realSignView f x * ((2 : ℝ) ^ n * realSignView f x) := by + rw [two_pow_mul_realSignView_eq_sum_walshTransform_mul_character] + _ = (2 : ℝ) ^ n := by + calc + realSignView f x * ((2 : ℝ) ^ n * realSignView f x) = + (2 : ℝ) ^ n * (realSignView f x * realSignView f x) := by ring + _ = (2 : ℝ) ^ n := by rw [realSignView_mul_self]; ring + +private theorem walshTerm_eq_one_or_neg_one + (f : BooleanFunction n) (a x : FABL.F₂Cube n) : + walshTerm f a x = 1 ∨ walshTerm f a x = -1 := by + rw [walshTerm, bitSignInt_eq_if_one] + split <;> simp + +private theorem natAbs_walshTransform_eq_eight_of_nonlinearity_eq_28 + (f : BooleanFunction 6) (hf : nonlinearity f = 28) + (a : FABL.F₂Cube 6) : + (walshTransform f a).natAbs = 8 := by + have hcover : + (nonlinearity f : ℝ) = + (2 : ℝ) ^ 6 / 2 - Real.sqrt ((2 : ℝ) ^ 6) / 2 := by + rw [hf] + norm_num + have hflat := + (nonlinearity_eq_coveringRadius_iff_flatWalshSpectrum f).mp hcover a + norm_num at hflat + have hcast : ((walshTransform f a).natAbs : ℝ) = 8 := by + simpa using hflat + exact_mod_cast hcast + +/-- A six-variable coset at covering radius has, through every coordinate, +a minimum-weight representative modulo the first-order Reed--Muller code. -/ +theorem exists_minimum_affine_error_one_at_of_nonlinearity_eq_28 + (f : BooleanFunction 6) (hf : nonlinearity f = 28) + (x : FABL.F₂Cube 6) : + ∃ b a, hammingDistance f (FABL.affineFunction b a) = 28 ∧ + (f + FABL.affineFunction b a) x = 1 := by + have hinversion := sum_walshTransform_mul_walshTerm_eq_two_pow f x + have hexists : + ∃ a : FABL.F₂Cube 6, + walshTransform f a * walshTerm f a x = -8 := by + by_contra hnone + push Not at hnone + have hproduct (a : FABL.F₂Cube 6) : + walshTransform f a * walshTerm f a x = 8 := by + have hne := hnone a + have habs := natAbs_walshTransform_eq_eight_of_nonlinearity_eq_28 f hf a + rcases Int.natAbs_eq (walshTransform f a) with hwalsh | hwalsh + · rw [habs] at hwalsh + rcases walshTerm_eq_one_or_neg_one f a x with hterm | hterm + · rw [hwalsh, hterm] + norm_num + · exfalso + apply hne + rw [hwalsh, hterm] + norm_num + · rw [habs] at hwalsh + rcases walshTerm_eq_one_or_neg_one f a x with hterm | hterm + · exfalso + apply hne + rw [hwalsh, hterm] + norm_num + · rw [hwalsh, hterm] + norm_num + simp_rw [hproduct] at hinversion + norm_num at hinversion + obtain ⟨a, ha⟩ := hexists + have habs := natAbs_walshTransform_eq_eight_of_nonlinearity_eq_28 f hf a + rcases Int.natAbs_eq (walshTransform f a) with hwalsh | hwalsh <;> + rw [habs] at hwalsh + · refine ⟨0, a, ?_, ?_⟩ + · have hdistance := hammingDistance_cast_linearFunction_eq f a + rw [hwalsh] at hdistance + norm_num at hdistance + exact_mod_cast hdistance + · rw [hwalsh] at ha + have hterm : walshTerm f a x = -1 := by omega + have hbit : f x + FABL.f₂DotProduct a x = 1 := by + by_contra hne + have hzero : f x + FABL.f₂DotProduct a x = 0 := by + by_contra hnz + exact hne (Fin.eq_one_of_ne_zero _ hnz) + rw [walshTerm, bitSignInt_eq_if_one, if_neg (by simp [hzero])] at hterm + omega + change f x + (0 + FABL.f₂DotProduct a x) = 1 + simpa using hbit + · refine ⟨1, a, ?_, ?_⟩ + · have hdistance := hammingDistance_cast_affineFunction_eq f 1 a + rw [hwalsh] at hdistance + norm_num [bitSignInt] at hdistance + exact_mod_cast hdistance + · rw [hwalsh] at ha + have hterm : walshTerm f a x = 1 := by omega + have hbit : f x + FABL.f₂DotProduct a x = 0 := by + by_contra hne + have hone : f x + FABL.f₂DotProduct a x = 1 := + Fin.eq_one_of_ne_zero _ hne + rw [walshTerm, bitSignInt_eq_if_one, if_pos hone] at hterm + omega + change f x + (1 + FABL.f₂DotProduct a x) = 1 + calc + f x + (1 + FABL.f₂DotProduct a x) = + 1 + (f x + FABL.f₂DotProduct a x) := by ac_rfl + _ = 1 := by rw [hbit]; simp + +/-- A degree-at-most-four six-variable coset of nonlinearity `26` has, +through every coordinate, a minimum-weight representative modulo the +first-order Reed--Muller code. -/ +theorem exists_minimum_affine_error_one_at_of_degree_le_four_nonlinearity_eq_26 + (f : BooleanFunction 6) (hdegree : FABL.functionAlgebraicDegree f ≤ 4) + (hf : nonlinearity f = 26) (x : FABL.F₂Cube 6) : + ∃ b a, hammingDistance f (FABL.affineFunction b a) = 26 ∧ + (f + FABL.affineFunction b a) x = 1 := by + let high := (Finset.univ : Finset (FABL.F₂Cube 6)).filter + fun a ↦ (walshTransform f a).natAbs = 12 + let low := (Finset.univ : Finset (FABL.F₂Cube 6)).filter + fun a ↦ ¬(walshTransform f a).natAbs = 12 + have hhighCard : high.card = 24 := by + simpa [high] using + card_walshTransform_natAbs_eq_twelve_of_degree_le_four f hdegree hf + have hcardSplit := Finset.card_filter_add_card_filter_not + (s := (Finset.univ : Finset (FABL.F₂Cube 6))) + (fun a : FABL.F₂Cube 6 ↦ (walshTransform f a).natAbs = 12) + change high.card + low.card = Fintype.card (FABL.F₂Cube 6) at hcardSplit + rw [card_f₂Cube] at hcardSplit + norm_num at hcardSplit + have hlowCard : low.card = 40 := by omega + have hinversion := sum_walshTransform_mul_walshTerm_eq_two_pow f x + have hexists : + ∃ a : FABL.F₂Cube 6, + (walshTransform f a).natAbs = 12 ∧ + walshTransform f a * walshTerm f a x = -12 := by + by_contra hnone + push Not at hnone + have hhighProduct (a : FABL.F₂Cube 6) + (ha : (walshTransform f a).natAbs = 12) : + walshTransform f a * walshTerm f a x = 12 := by + have hne := hnone a ha + rcases Int.natAbs_eq (walshTransform f a) with hwalsh | hwalsh + · rw [ha] at hwalsh + rcases walshTerm_eq_one_or_neg_one f a x with hterm | hterm + · rw [hwalsh, hterm] + norm_num + · exfalso + apply hne + rw [hwalsh, hterm] + norm_num + · rw [ha] at hwalsh + rcases walshTerm_eq_one_or_neg_one f a x with hterm | hterm + · exfalso + apply hne + rw [hwalsh, hterm] + norm_num + · rw [hwalsh, hterm] + norm_num + have hlowProduct (a : FABL.F₂Cube 6) + (ha : ¬(walshTransform f a).natAbs = 12) : + (-4 : ℤ) ≤ walshTransform f a * walshTerm f a x := by + rcases natAbs_walshTransform_eq_four_or_twelve_of_degree_le_four + f hdegree hf a with hfour | htwelve + · rcases Int.natAbs_eq (walshTransform f a) with hwalsh | hwalsh + · rw [hfour] at hwalsh + rcases walshTerm_eq_one_or_neg_one f a x with hterm | hterm <;> + rw [hwalsh, hterm] <;> norm_num + · rw [hfour] at hwalsh + rcases walshTerm_eq_one_or_neg_one f a x with hterm | hterm <;> + rw [hwalsh, hterm] <;> norm_num + · exact False.elim (ha htwelve) + have hsumHigh : + ∑ a ∈ high, (if (walshTransform f a).natAbs = 12 then + (12 : ℤ) else -4) = (high.card : ℤ) * 12 := by + calc + ∑ a ∈ high, (if (walshTransform f a).natAbs = 12 then + (12 : ℤ) else -4) = ∑ _a ∈ high, (12 : ℤ) := by + apply Finset.sum_congr rfl + intro a ha + rw [if_pos (by simpa [high] using ha)] + _ = (high.card : ℤ) * 12 := by simp + have hsumLow : + ∑ a ∈ low, (if (walshTransform f a).natAbs = 12 then + (12 : ℤ) else -4) = (low.card : ℤ) * (-4) := by + calc + ∑ a ∈ low, (if (walshTransform f a).natAbs = 12 then + (12 : ℤ) else -4) = ∑ _a ∈ low, (-4 : ℤ) := by + apply Finset.sum_congr rfl + intro a ha + rw [if_neg (by simpa [low] using ha)] + _ = (low.card : ℤ) * (-4) := by simp + have hbenchmarkSplit := Finset.sum_filter_add_sum_filter_not + (Finset.univ : Finset (FABL.F₂Cube 6)) + (fun a ↦ (walshTransform f a).natAbs = 12) + (fun a ↦ if (walshTransform f a).natAbs = 12 then (12 : ℤ) else -4) + change + (∑ a ∈ high, (if (walshTransform f a).natAbs = 12 then + (12 : ℤ) else -4)) + + (∑ a ∈ low, (if (walshTransform f a).natAbs = 12 then + (12 : ℤ) else -4)) = + ∑ a : FABL.F₂Cube 6, + (if (walshTransform f a).natAbs = 12 then (12 : ℤ) else -4) + at hbenchmarkSplit + rw [hsumHigh, hsumLow, hhighCard, hlowCard] at hbenchmarkSplit + norm_num at hbenchmarkSplit + have hpointwise (a : FABL.F₂Cube 6) : + (if (walshTransform f a).natAbs = 12 then (12 : ℤ) else -4) ≤ + walshTransform f a * walshTerm f a x := by + by_cases ha : (walshTransform f a).natAbs = 12 + · rw [if_pos ha, hhighProduct a ha] + · rw [if_neg ha] + exact hlowProduct a ha + have hsumLower := Finset.sum_le_sum + (s := (Finset.univ : Finset (FABL.F₂Cube 6))) + (fun a _ha ↦ hpointwise a) + change + (∑ a : FABL.F₂Cube 6, + (if (walshTransform f a).natAbs = 12 then (12 : ℤ) else -4)) ≤ + ∑ a : FABL.F₂Cube 6, walshTransform f a * walshTerm f a x + at hsumLower + rw [← hbenchmarkSplit, hinversion] at hsumLower + norm_num at hsumLower + obtain ⟨a, habs, ha⟩ := hexists + rcases Int.natAbs_eq (walshTransform f a) with hwalsh | hwalsh <;> + rw [habs] at hwalsh + · refine ⟨0, a, ?_, ?_⟩ + · have hdistance := hammingDistance_cast_linearFunction_eq f a + rw [hwalsh] at hdistance + norm_num at hdistance + exact_mod_cast hdistance + · rw [hwalsh] at ha + have hterm : walshTerm f a x = -1 := by omega + have hbit : f x + FABL.f₂DotProduct a x = 1 := by + by_contra hne + have hzero : f x + FABL.f₂DotProduct a x = 0 := by + by_contra hnz + exact hne (Fin.eq_one_of_ne_zero _ hnz) + rw [walshTerm, bitSignInt_eq_if_one, if_neg (by simp [hzero])] at hterm + omega + change f x + (0 + FABL.f₂DotProduct a x) = 1 + simpa using hbit + · refine ⟨1, a, ?_, ?_⟩ + · have hdistance := hammingDistance_cast_affineFunction_eq f 1 a + rw [hwalsh] at hdistance + norm_num [bitSignInt] at hdistance + exact_mod_cast hdistance + · rw [hwalsh] at ha + have hterm : walshTerm f a x = 1 := by omega + have hbit : f x + FABL.f₂DotProduct a x = 0 := by + by_contra hne + have hone : f x + FABL.f₂DotProduct a x = 1 := + Fin.eq_one_of_ne_zero _ hne + rw [walshTerm, bitSignInt_eq_if_one, if_pos hone] at hterm + omega + change f x + (1 + FABL.f₂DotProduct a x) = 1 + calc + f x + (1 + FABL.f₂DotProduct a x) = + 1 + (f x + FABL.f₂DotProduct a x) := by ac_rfl + _ = 1 := by rw [hbit]; simp + +private def skewLiftSeven + (A : Matrix (Fin 7) (Fin 7) FABL.𝔽₂) : Matrix (Fin 7) (Fin 7) ℤ := + fun i j ↦ + if i < j then (A i j).val + else if j < i then -((A j i).val : ℤ) + else 0 + +private theorem skewLiftSeven_transpose + (A : Matrix (Fin 7) (Fin 7) FABL.𝔽₂) : + (skewLiftSeven A).transpose = -(skewLiftSeven A) := by + ext i j + rcases lt_trichotomy i j with hij | hij | hij + · simp [skewLiftSeven, hij, asymm hij] + · subst j + simp [skewLiftSeven] + · simp [skewLiftSeven, hij, asymm hij] + +private theorem skewLiftSeven_det_eq_zero + (A : Matrix (Fin 7) (Fin 7) FABL.𝔽₂) : + (skewLiftSeven A).det = 0 := by + have hneg : (-(skewLiftSeven A)).det = -(skewLiftSeven A).det := by + rw [Matrix.det_neg] + norm_num + have hselfneg : (skewLiftSeven A).det = -(skewLiftSeven A).det := by + calc + (skewLiftSeven A).det = (skewLiftSeven A).transpose.det := + (Matrix.det_transpose _).symm + _ = (-(skewLiftSeven A)).det := by rw [skewLiftSeven_transpose] + _ = -(skewLiftSeven A).det := hneg + linarith + +private theorem map_skewLiftSeven_eq + (A : Matrix (Fin 7) (Fin 7) FABL.𝔽₂) + (hsymm : A.transpose = A) (hdiag : ∀ i, A i i = 0) : + (skewLiftSeven A).map (Int.castRingHom FABL.𝔽₂) = A := by + ext i j + rcases lt_trichotomy i j with hij | hij | hij + · simp [skewLiftSeven, hij] + · subst j + simp [skewLiftSeven, hdiag] + · have hsymm_apply : A j i = A i j := by + have := congr_fun (congr_fun hsymm i) j + simpa using this + simp [skewLiftSeven, hij, asymm hij, hsymm_apply] + +private theorem exists_nonzero_mulVec_eq_zero_of_symmetric_zero_diagonal_seven + (A : Matrix (Fin 7) (Fin 7) FABL.𝔽₂) + (hsymm : A.transpose = A) (hdiag : ∀ i, A i i = 0) : + ∃ u : FABL.F₂Cube 7, u ≠ 0 ∧ A.mulVec u = 0 := by + apply Matrix.exists_mulVec_eq_zero_iff.mpr + calc + A.det = ((skewLiftSeven A).map (Int.castRingHom FABL.𝔽₂)).det := by + rw [map_skewLiftSeven_eq A hsymm hdiag] + _ = Int.castRingHom FABL.𝔽₂ (skewLiftSeven A).det := + (RingHom.map_det _ _).symm + _ = 0 := by rw [skewLiftSeven_det_eq_zero]; simp + +private def swapZeroLinearEquiv (k : Fin 7) : + FABL.F₂Cube 7 ≃ₗ[FABL.𝔽₂] FABL.F₂Cube 7 where + toFun x i := x (Equiv.swap 0 k i) + map_add' _ _ := rfl + map_smul' _ _ := rfl + invFun x i := x (Equiv.swap 0 k i) + left_inv x := by + funext i + simp + right_inv x := by + funext i + simp + +private def pivotShearLinearEquiv + (u : FABL.F₂Cube 7) (k : Fin 7) (huk : u k = 1) : + FABL.F₂Cube 7 ≃ₗ[FABL.𝔽₂] FABL.F₂Cube 7 where + toFun x := x + x k • (u + (Pi.single k 1 : FABL.F₂Cube 7)) + map_add' x y := by + funext i + simp [add_smul] + ring + map_smul' c x := by + funext i + simp [smul_add] + ring + invFun x := x + x k • (u + (Pi.single k 1 : FABL.F₂Cube 7)) + left_inv x := by + have hwk : (u + (Pi.single k 1 : FABL.F₂Cube 7)) k = 0 := by simp [huk] + funext i + change (x i + x k * (u + (Pi.single k 1 : FABL.F₂Cube 7)) i) + + (x k + x k * (u + (Pi.single k 1 : FABL.F₂Cube 7)) k) * + (u + (Pi.single k 1 : FABL.F₂Cube 7)) i = x i + rw [hwk] + simp only [mul_zero, add_zero] + rw [add_assoc, CharTwo.add_self_eq_zero, add_zero] + right_inv x := by + have hwk : (u + (Pi.single k 1 : FABL.F₂Cube 7)) k = 0 := by simp [huk] + funext i + change (x i + x k * (u + (Pi.single k 1 : FABL.F₂Cube 7)) i) + + (x k + x k * (u + (Pi.single k 1 : FABL.F₂Cube 7)) k) * + (u + (Pi.single k 1 : FABL.F₂Cube 7)) i = x i + rw [hwk] + simp only [mul_zero, add_zero] + rw [add_assoc, CharTwo.add_self_eq_zero, add_zero] + +private theorem single_zero_swap (k i : Fin 7) : + (Pi.single 0 (1 : FABL.𝔽₂) : FABL.F₂Cube 7) (Equiv.swap 0 k i) = + (Pi.single k 1 : FABL.F₂Cube 7) i := by + have h := Pi.single_comp_equiv (Equiv.swap 0 k) 0 (1 : FABL.𝔽₂) + exact congrFun h i + +private theorem exists_linearEquiv_single_zero_eq + (u : FABL.F₂Cube 7) (hu : u ≠ 0) : + ∃ L : FABL.F₂Cube 7 ≃ₗ[FABL.𝔽₂] FABL.F₂Cube 7, + L (Pi.single 0 1) = u := by + have hexists : ∃ k, u k ≠ 0 := by + by_contra h + push Not at h + apply hu + funext k + exact h k + obtain ⟨k, hk⟩ := hexists + have huk : u k = 1 := Fin.eq_one_of_ne_zero (u k) hk + refine ⟨(swapZeroLinearEquiv k).trans (pivotShearLinearEquiv u k huk), ?_⟩ + ext i + simp [swapZeroLinearEquiv, pivotShearLinearEquiv, single_zero_swap, + add_left_comm, CharTwo.add_self_eq_zero] + +private def quadraticPairingSevenKernel + (f : BooleanFunction 7) (a b : FABL.F₂Cube 7) : FABL.𝔽₂ := + ∑ x, f x * FABL.f₂DotProductBilin 7 a x * + FABL.f₂DotProductBilin 7 b x + +private def quadraticPairingSeven (f : BooleanFunction 7) : + LinearMap.BilinForm FABL.𝔽₂ (FABL.F₂Cube 7) := + LinearMap.mk₂ FABL.𝔽₂ + (quadraticPairingSevenKernel f) + (by + intro a₁ a₂ b + simp only [quadraticPairingSevenKernel] + simp_rw [map_add, LinearMap.add_apply] + rw [← Finset.sum_add_distrib] + apply Finset.sum_congr rfl + intro x _ + ring) + (by + intro c a b + simp only [quadraticPairingSevenKernel] + simp_rw [map_smul, LinearMap.smul_apply, smul_eq_mul] + rw [Finset.mul_sum] + apply Finset.sum_congr rfl + intro x _ + ring) + (by + intro a b₁ b₂ + simp only [quadraticPairingSevenKernel] + simp_rw [map_add, LinearMap.add_apply] + rw [← Finset.sum_add_distrib] + apply Finset.sum_congr rfl + intro x _ + ring) + (by + intro c a b + simp only [quadraticPairingSevenKernel] + simp_rw [map_smul, LinearMap.smul_apply, smul_eq_mul] + rw [Finset.mul_sum] + apply Finset.sum_congr rfl + intro x _ + ring) + +private theorem quadraticPairingSeven_apply + (f : BooleanFunction 7) (a b : FABL.F₂Cube 7) : + quadraticPairingSeven f a b = quadraticPairingSevenKernel f a b := + rfl + +private theorem quadraticPairingSeven_isSymm (f : BooleanFunction 7) : + (quadraticPairingSeven f).IsSymm := by + constructor + intro a b + rw [quadraticPairingSeven_apply, quadraticPairingSeven_apply] + simp only [quadraticPairingSevenKernel, FABL.f₂DotProductBilin_apply] + apply Finset.sum_congr rfl + intro x _ + ac_rfl + +private theorem quadraticPairingSeven_isAlt_of_degree_le_five + (f : BooleanFunction 7) (hf : FABL.functionAlgebraicDegree f ≤ 5) : + (quadraticPairingSeven f).IsAlt := by + intro a + have hfdual : f ∈ reedMullerDual 1 7 := by + rw [reedMullerDual_eq (r := 1) (n := 7) (by omega)] + norm_num + exact hf + rw [reedMullerDual, LinearMap.BilinForm.mem_orthogonal_iff] at hfdual + have hpair := hfdual (FABL.affineFunction 0 a) + (affineFunction_mem_reedMuller_one 0 a) + rw [booleanFunctionPairing_apply] at hpair + rw [quadraticPairingSeven_apply] + simp only [quadraticPairingSevenKernel, FABL.f₂DotProductBilin_apply] + calc + (∑ x, f x * FABL.f₂DotProduct a x * FABL.f₂DotProduct a x) = + ∑ x, FABL.affineFunction 0 a x * f x := by + apply Finset.sum_congr rfl + intro x _ + simp [FABL.affineFunction] + by_cases hx : FABL.f₂DotProduct a x = 0 + · simp [hx] + · have hxone : FABL.f₂DotProduct a x = 1 := + Fin.eq_one_of_ne_zero _ hx + simp [hxone] + _ = 0 := hpair + +private theorem exists_nonzero_radical_quadraticPairingSeven + (f : BooleanFunction 7) (hf : FABL.functionAlgebraicDegree f ≤ 5) : + ∃ u : FABL.F₂Cube 7, u ≠ 0 ∧ ∀ v, quadraticPairingSeven f u v = 0 := by + let B := quadraticPairingSeven f + let A : Matrix (Fin 7) (Fin 7) FABL.𝔽₂ := B.toMatrix' + have hAsymm : A.transpose = A := by + exact ((LinearMap.BilinForm.isSymm_toMatrix'_iff_isSymm).mpr + (quadraticPairingSeven_isSymm f)).eq + have hAdiag : ∀ i, A i i = 0 := by + intro i + rw [show A i i = B (Pi.single i 1) (Pi.single i 1) by + exact LinearMap.BilinForm.toMatrix'_apply B i i] + exact quadraticPairingSeven_isAlt_of_degree_le_five f hf _ + obtain ⟨u, hu, hAu⟩ := + exists_nonzero_mulVec_eq_zero_of_symmetric_zero_diagonal_seven + A hAsymm hAdiag + refine ⟨u, hu, ?_⟩ + intro v + have hvu : B v u = 0 := by + calc + B v u = Matrix.toBilin' A v u := by + change B v u = Matrix.toBilin' B.toMatrix' v u + rw [Matrix.toBilin'_toMatrix'] + _ = v ⬝ᵥ A.mulVec u := Matrix.toBilin'_apply' A v u + _ = 0 := by rw [hAu, dotProduct_zero] + exact (quadraticPairingSeven_isSymm f).eq v u |>.symm.trans hvu + +private noncomputable def dotAdjointLinearEquiv + (Q : FABL.F₂Cube 7 ≃ₗ[FABL.𝔽₂] FABL.F₂Cube 7) : + FABL.F₂Cube 7 ≃ₗ[FABL.𝔽₂] FABL.F₂Cube 7 := + (dotProductEquiv FABL.𝔽₂ (Fin 7)).trans + (Q.dualMap.trans (dotProductEquiv FABL.𝔽₂ (Fin 7)).symm) + +private theorem f₂DotProduct_dotAdjointLinearEquiv + (Q : FABL.F₂Cube 7 ≃ₗ[FABL.𝔽₂] FABL.F₂Cube 7) + (a x : FABL.F₂Cube 7) : + FABL.f₂DotProduct (dotAdjointLinearEquiv Q a) x = + FABL.f₂DotProduct a (Q x) := by + change dotProduct (dotAdjointLinearEquiv Q a) x = dotProduct a (Q x) + calc + dotProduct (dotAdjointLinearEquiv Q a) x = + (dotProductEquiv FABL.𝔽₂ (Fin 7)) (dotAdjointLinearEquiv Q a) x := + (dotProductEquiv_apply_apply FABL.𝔽₂ (Fin 7) _ _).symm + _ = ((dotProductEquiv FABL.𝔽₂ (Fin 7)) a).comp Q.toLinearMap x := by + exact DFunLike.congr_fun + ((dotProductEquiv FABL.𝔽₂ (Fin 7)).apply_symm_apply + (((dotProductEquiv FABL.𝔽₂ (Fin 7)) a).comp Q.toLinearMap)) x + _ = dotProduct a (Q x) := + dotProductEquiv_apply_apply FABL.𝔽₂ (Fin 7) _ _ + +/-- The six-variable slice of a seven-variable Boolean function at a fixed +first coordinate. -/ +def firstCoordinateSliceSeven + (f : BooleanFunction 7) (c : FABL.𝔽₂) : BooleanFunction 6 := + fun y ↦ f (Fin.cons c y) + +private def firstCoordinateFrequencyLiftSix + (a : FABL.F₂Cube 6) : FABL.F₂Cube 7 := + Fin.cons 0 a + +private theorem f₂DotProduct_firstCoordinateFrequencyLiftSix + (a : FABL.F₂Cube 6) (x : FABL.F₂Cube 7) : + FABL.f₂DotProduct (firstCoordinateFrequencyLiftSix a) x = + FABL.f₂DotProduct a (Fin.tail x) := by + change dotProduct (Fin.cons 0 a) x = dotProduct a (Fin.tail x) + rw [dotProduct, Fin.sum_univ_succ] + simp only [Fin.cons_zero, Fin.cons_succ, zero_mul, zero_add] + rfl + +private theorem f₂DotProduct_single_zero_seven + (x : FABL.F₂Cube 7) : + FABL.f₂DotProduct (Pi.single 0 1) x = x 0 := by + simp [FABL.f₂DotProduct, dotProduct, Pi.single_apply] + +private def firstCoordinateAffineExtension + (c d : FABL.𝔽₂) (a : FABL.F₂Cube 6) : BooleanFunction 7 := + fun x ↦ if x 0 = c then FABL.affineFunction d a (Fin.tail x) else 0 + +private theorem firstCoordinateAffineExtension_decomposition + (c d : FABL.𝔽₂) (a : FABL.F₂Cube 6) : + firstCoordinateAffineExtension c d a = + FABL.affineFunction ((1 + c) * d) + ((1 + c) • firstCoordinateFrequencyLiftSix a + + d • (Pi.single 0 1 : FABL.F₂Cube 7)) + + fun x ↦ + FABL.f₂DotProduct (Pi.single 0 1) x * + FABL.f₂DotProduct (firstCoordinateFrequencyLiftSix a) x := by + funext x + simp only [Pi.add_apply] + rw [f₂DotProduct_firstCoordinateFrequencyLiftSix, + f₂DotProduct_single_zero_seven] + simp only [firstCoordinateAffineExtension, FABL.affineFunction] + have hdot : + FABL.f₂DotProduct + ((1 + c) • firstCoordinateFrequencyLiftSix a + + d • (Pi.single 0 1 : FABL.F₂Cube 7)) x = + (1 + c) * FABL.f₂DotProduct (firstCoordinateFrequencyLiftSix a) x + + d * FABL.f₂DotProduct (Pi.single 0 1) x := by + simp only [FABL.f₂DotProduct, add_dotProduct, smul_dotProduct, + smul_eq_mul] + rw [hdot] + rw [f₂DotProduct_firstCoordinateFrequencyLiftSix, + f₂DotProduct_single_zero_seven] + generalize x 0 = x₀ + generalize FABL.f₂DotProduct a (Fin.tail x) = z + fin_cases c <;> fin_cases d <;> fin_cases x₀ <;> fin_cases z <;> decide + +private theorem booleanFunctionPairing_firstCoordinateAffineExtension + (f : BooleanFunction 7) (c d : FABL.𝔽₂) (a : FABL.F₂Cube 6) : + booleanFunctionPairing 7 f (firstCoordinateAffineExtension c d a) = + booleanFunctionPairing 6 (firstCoordinateSliceSeven f c) + (FABL.affineFunction d a) := by + classical + rw [booleanFunctionPairing_apply, booleanFunctionPairing_apply] + rw [← Equiv.sum_comp (Fin.consEquiv + (fun _ : Fin 7 ↦ FABL.𝔽₂)), Fintype.sum_prod_type] + change (∑ c' : FABL.𝔽₂, ∑ y : FABL.F₂Cube 6, + f (Fin.cons c' y) * firstCoordinateAffineExtension c d a (Fin.cons c' y)) = _ + fin_cases c <;> + simp [firstCoordinateAffineExtension, firstCoordinateSliceSeven] + +private theorem firstCoordinateSliceSeven_degree_le_four_of_radical + (f : BooleanFunction 7) (hf : FABL.functionAlgebraicDegree f ≤ 5) + (hradical : ∀ a, quadraticPairingSeven f (Pi.single 0 1) a = 0) + (c : FABL.𝔽₂) : + FABL.functionAlgebraicDegree (firstCoordinateSliceSeven f c) ≤ 4 := by + have hfdual : f ∈ reedMullerDual 1 7 := by + rw [reedMullerDual_eq (r := 1) (n := 7) (by omega)] + norm_num + exact hf + rw [reedMullerDual, LinearMap.BilinForm.mem_orthogonal_iff] at hfdual + have hsliceDual : firstCoordinateSliceSeven f c ∈ reedMullerDual 1 6 := by + rw [reedMullerDual, LinearMap.BilinForm.mem_orthogonal_iff] + intro q hq + rw [mem_reedMuller_iff] at hq + obtain ⟨d, a, rfl⟩ := + FABL.exists_affineFunction_of_functionAlgebraicDegree_le_one q hq + have hpairingComm : + booleanFunctionPairing 6 (FABL.affineFunction d a) + (firstCoordinateSliceSeven f c) = + booleanFunctionPairing 6 (firstCoordinateSliceSeven f c) + (FABL.affineFunction d a) := by + rw [booleanFunctionPairing_apply, booleanFunctionPairing_apply] + apply Finset.sum_congr rfl + intro x _ + exact mul_comm _ _ + rw [hpairingComm] + rw [← booleanFunctionPairing_firstCoordinateAffineExtension] + rw [firstCoordinateAffineExtension_decomposition] + rw [map_add] + have haffine := hfdual + (FABL.affineFunction ((1 + c) * d) + ((1 + c) • firstCoordinateFrequencyLiftSix a + + d • (Pi.single 0 1 : FABL.F₂Cube 7))) + (affineFunction_mem_reedMuller_one _ _) + have haffine' : + booleanFunctionPairing 7 f + (FABL.affineFunction ((1 + c) * d) + ((1 + c) • firstCoordinateFrequencyLiftSix a + + d • (Pi.single 0 1 : FABL.F₂Cube 7))) = 0 := by + calc + booleanFunctionPairing 7 f + (FABL.affineFunction ((1 + c) * d) + ((1 + c) • firstCoordinateFrequencyLiftSix a + + d • (Pi.single 0 1 : FABL.F₂Cube 7))) = + booleanFunctionPairing 7 + (FABL.affineFunction ((1 + c) * d) + ((1 + c) • firstCoordinateFrequencyLiftSix a + + d • (Pi.single 0 1 : FABL.F₂Cube 7))) f := by + rw [booleanFunctionPairing_apply, booleanFunctionPairing_apply] + apply Finset.sum_congr rfl + intro x _ + exact mul_comm _ _ + _ = 0 := haffine + rw [haffine', zero_add] + rw [booleanFunctionPairing_apply] + have hrad := hradical (firstCoordinateFrequencyLiftSix a) + rw [quadraticPairingSeven_apply] at hrad + simp only [quadraticPairingSevenKernel, FABL.f₂DotProductBilin_apply] at hrad + calc + (∑ x, f x * (FABL.f₂DotProduct (Pi.single 0 1) x * + FABL.f₂DotProduct (firstCoordinateFrequencyLiftSix a) x)) = + ∑ x, f x * FABL.f₂DotProduct (Pi.single 0 1) x * + FABL.f₂DotProduct (firstCoordinateFrequencyLiftSix a) x := by + apply Finset.sum_congr rfl + intro x _ + ring + _ = 0 := hrad + rw [reedMullerDual_eq (r := 1) (n := 6) (by omega)] at hsliceDual + norm_num at hsliceDual + exact hsliceDual + +private theorem f₂DotProduct_map_dotAdjoint_symm + (Q : FABL.F₂Cube 7 ≃ₗ[FABL.𝔽₂] FABL.F₂Cube 7) + (a y : FABL.F₂Cube 7) : + FABL.f₂DotProduct (Q a) (dotAdjointLinearEquiv Q.symm y) = + FABL.f₂DotProduct a y := by + calc + FABL.f₂DotProduct (Q a) (dotAdjointLinearEquiv Q.symm y) = + FABL.f₂DotProduct (dotAdjointLinearEquiv Q.symm y) (Q a) := + dotProduct_comm _ _ + _ = FABL.f₂DotProduct y (Q.symm (Q a)) := + f₂DotProduct_dotAdjointLinearEquiv Q.symm y (Q a) + _ = FABL.f₂DotProduct y a := by rw [Q.symm_apply_apply] + _ = FABL.f₂DotProduct a y := dotProduct_comm _ _ + +private theorem quadraticPairingSeven_comp_dotAdjoint_symm + (f : BooleanFunction 7) + (Q : FABL.F₂Cube 7 ≃ₗ[FABL.𝔽₂] FABL.F₂Cube 7) + (a b : FABL.F₂Cube 7) : + quadraticPairingSeven (f ∘ dotAdjointLinearEquiv Q.symm) a b = + quadraticPairingSeven f (Q a) (Q b) := by + classical + rw [quadraticPairingSeven_apply, quadraticPairingSeven_apply] + simp only [quadraticPairingSevenKernel, FABL.f₂DotProductBilin_apply] + apply Fintype.sum_equiv (dotAdjointLinearEquiv Q.symm).toEquiv + intro y + simp only [Function.comp_apply] + change f (dotAdjointLinearEquiv Q.symm y) * + FABL.f₂DotProduct a y * FABL.f₂DotProduct b y = + f (dotAdjointLinearEquiv Q.symm y) * + FABL.f₂DotProduct (Q a) (dotAdjointLinearEquiv Q.symm y) * + FABL.f₂DotProduct (Q b) (dotAdjointLinearEquiv Q.symm y) + rw [f₂DotProduct_map_dotAdjoint_symm, + f₂DotProduct_map_dotAdjoint_symm] + +/-- Hou's odd-dimensional degree-five normal form: after an invertible +linear change of variables, both six-variable coordinate slices have degree +at most four. -/ +theorem exists_linearEquiv_firstCoordinateSlices_degree_le_four + (f : BooleanFunction 7) (hf : FABL.functionAlgebraicDegree f ≤ 5) : + ∃ P : FABL.F₂Cube 7 ≃ₗ[FABL.𝔽₂] FABL.F₂Cube 7, + FABL.functionAlgebraicDegree + (firstCoordinateSliceSeven (f ∘ P) 0) ≤ 4 ∧ + FABL.functionAlgebraicDegree + (firstCoordinateSliceSeven (f ∘ P) 1) ≤ 4 := by + obtain ⟨u, hu, huradical⟩ := + exists_nonzero_radical_quadraticPairingSeven f hf + obtain ⟨Q, hQ⟩ := exists_linearEquiv_single_zero_eq u hu + let P := dotAdjointLinearEquiv Q.symm + have hdegree : FABL.functionAlgebraicDegree (f ∘ P) ≤ 5 := by + have hcomp : (f ∘ P : BooleanFunction 7) = f ∘ P.toAffineEquiv := rfl + rw [hcomp, FABL.functionAlgebraicDegree_comp_affineEquiv] + exact hf + have hradical : ∀ a, + quadraticPairingSeven (f ∘ P) (Pi.single 0 1) a = 0 := by + intro a + rw [show quadraticPairingSeven (f ∘ P) (Pi.single 0 1) a = + quadraticPairingSeven f (Q (Pi.single 0 1)) (Q a) by + exact quadraticPairingSeven_comp_dotAdjoint_symm f Q _ _] + rw [hQ] + exact huradical (Q a) + exact ⟨P, + firstCoordinateSliceSeven_degree_le_four_of_radical + (f ∘ P) hdegree hradical 0, + firstCoordinateSliceSeven_degree_le_four_of_radical + (f ∘ P) hdegree hradical 1⟩ + + +private theorem nonlinearity_le_affineFunction_distance + (f : BooleanFunction n) (b : FABL.𝔽₂) (a : FABL.F₂Cube n) : + nonlinearity f ≤ hammingDistance f (FABL.affineFunction b a) := by + unfold nonlinearity + exact Finset.inf'_le _ (Finset.mem_univ (b, a)) + +private theorem nonlinearity_six_le_twenty_eight + (f : BooleanFunction 6) : nonlinearity f ≤ 28 := by + have hbound := nonlinearity_cast_le_coveringRadius f + have hvalue : + (2 : ℝ) ^ (6 : ℕ) / 2 - Real.sqrt ((2 : ℝ) ^ (6 : ℕ)) / 2 = 28 := by + norm_num + rw [hvalue] at hbound + exact_mod_cast hbound + +private theorem nonlinearity_seven_le_fifty_eight + (f : BooleanFunction 7) : nonlinearity f ≤ 58 := by + have hbound := nonlinearity_cast_le_coveringRadius f + have hpow : (2 : ℝ) ^ (7 : ℕ) = 128 := by norm_num + rw [hpow] at hbound + have hsqrt : (10 : ℝ) < Real.sqrt 128 := by + calc + (10 : ℝ) = Real.sqrt 100 := by norm_num + _ < Real.sqrt 128 := Real.sqrt_lt_sqrt (by norm_num) (by norm_num) + have hlt : (nonlinearity f : ℝ) < 59 := by linarith + have hnat : nonlinearity f < 59 := by exact_mod_cast hlt + omega + +private theorem exists_affineFunction_same_slope_distance_le_thirty_two + (f : BooleanFunction 6) (a : FABL.F₂Cube 6) : + ∃ b, hammingDistance f (FABL.affineFunction b a) ≤ 32 := by + by_cases hwalsh : 0 ≤ walshTransform f a + · refine ⟨0, ?_⟩ + have hdistance := hammingDistance_cast_linearFunction_eq f a + norm_num at hdistance + have hwalshReal : 0 ≤ (walshTransform f a : ℝ) := by + exact_mod_cast hwalsh + have hcast : + (hammingDistance f (FABL.affineFunction 0 a) : ℝ) ≤ 32 := by + linarith + exact_mod_cast hcast + · refine ⟨1, ?_⟩ + have hdistance := hammingDistance_cast_complementLinearFunction_eq f a + norm_num at hdistance + have hwalshReal : (walshTransform f a : ℝ) < 0 := by + exact_mod_cast (lt_of_not_ge hwalsh) + have hcast : + (hammingDistance f (FABL.affineFunction 1 a) : ℝ) ≤ 32 := by + linarith + exact_mod_cast hcast + +private theorem exists_affineFunction_same_slope_distance_eq_twenty_eight + (f : BooleanFunction 6) (hf : nonlinearity f = 28) + (a : FABL.F₂Cube 6) : + ∃ b, hammingDistance f (FABL.affineFunction b a) = 28 := by + have habs := natAbs_walshTransform_eq_eight_of_nonlinearity_eq_28 f hf a + rcases Int.natAbs_eq (walshTransform f a) with hwalsh | hwalsh <;> + rw [habs] at hwalsh + · refine ⟨0, ?_⟩ + have hdistance := hammingDistance_cast_linearFunction_eq f a + rw [hwalsh] at hdistance + norm_num at hdistance + exact_mod_cast hdistance + · refine ⟨1, ?_⟩ + have hdistance := hammingDistance_cast_complementLinearFunction_eq f a + rw [hwalsh] at hdistance + norm_num at hdistance + exact_mod_cast hdistance + +private def pairedAffineFunctionSeven + (bzero bone : FABL.𝔽₂) (a : FABL.F₂Cube 6) : BooleanFunction 7 := + FABL.affineFunction bzero (Fin.cons (bzero + bone) a) + +private theorem firstCoordinateSliceSeven_pairedAffineFunction_zero + (bzero bone : FABL.𝔽₂) (a : FABL.F₂Cube 6) : + firstCoordinateSliceSeven (pairedAffineFunctionSeven bzero bone a) 0 = + FABL.affineFunction bzero a := by + funext x + simp [firstCoordinateSliceSeven, pairedAffineFunctionSeven, + FABL.affineFunction, FABL.f₂DotProduct, dotProduct, Fin.sum_univ_succ] + +private theorem firstCoordinateSliceSeven_pairedAffineFunction_one + (bzero bone : FABL.𝔽₂) (a : FABL.F₂Cube 6) : + firstCoordinateSliceSeven (pairedAffineFunctionSeven bzero bone a) 1 = + FABL.affineFunction bone a := by + funext x + simp only [firstCoordinateSliceSeven, pairedAffineFunctionSeven, + FABL.affineFunction] + have hdot : + FABL.f₂DotProduct (Fin.cons (bzero + bone) a) (Fin.cons 1 x) = + (bzero + bone) * 1 + FABL.f₂DotProduct a x := by + exact Matrix.cons_dotProduct_cons (bzero + bone) a 1 x + rw [hdot] + simp only [mul_one] + rw [add_assoc bzero bone, ← add_assoc bzero bzero, + CharTwo.add_self_eq_zero, zero_add] + +private theorem hammingDistance_firstCoordinateSlicesSeven + (f g : BooleanFunction 7) : + hammingDistance f g = + hammingDistance (firstCoordinateSliceSeven f 0) + (firstCoordinateSliceSeven g 0) + + hammingDistance (firstCoordinateSliceSeven f 1) + (firstCoordinateSliceSeven g 1) := by + classical + unfold hammingDistance hammingDist + rw [Finset.card_filter, Finset.card_filter, Finset.card_filter] + change (∑ x : FABL.F₂Cube 7, if f x ≠ g x then 1 else 0) = _ + rw [← Equiv.sum_comp (Fin.consEquiv + (fun _ : Fin 7 ↦ FABL.𝔽₂)), Fintype.sum_prod_type] + change (∑ b : FABL.𝔽₂, ∑ x : FABL.F₂Cube 6, + if f (Fin.cons b x) ≠ g (Fin.cons b x) then 1 else 0) = _ + rw [show (Finset.univ : Finset FABL.𝔽₂) = {0, 1} by rfl] + simp only [Finset.sum_insert, Finset.mem_singleton, zero_ne_one, + not_false_eq_true, Finset.sum_singleton] + rfl + +private theorem hammingDistance_pairedAffineFunctionSeven + (f : BooleanFunction 7) (bzero bone : FABL.𝔽₂) + (a : FABL.F₂Cube 6) : + hammingDistance f (pairedAffineFunctionSeven bzero bone a) = + hammingDistance (firstCoordinateSliceSeven f 0) + (FABL.affineFunction bzero a) + + hammingDistance (firstCoordinateSliceSeven f 1) + (FABL.affineFunction bone a) := by + rw [hammingDistance_firstCoordinateSlicesSeven, + firstCoordinateSliceSeven_pairedAffineFunction_zero, + firstCoordinateSliceSeven_pairedAffineFunction_one] + +private theorem firstCoordinateSliceSeven_affineFunction_zero + (b : FABL.𝔽₂) (a : FABL.F₂Cube 7) : + firstCoordinateSliceSeven (FABL.affineFunction b a) 0 = + FABL.affineFunction b (Fin.tail a) := by + funext x + simp only [firstCoordinateSliceSeven, FABL.affineFunction] + have hdot : FABL.f₂DotProduct a (Fin.cons 0 x) = + a 0 * 0 + FABL.f₂DotProduct (Fin.tail a) x := by + exact Matrix.dotProduct_cons a 0 x + rw [hdot] + simp + +private theorem firstCoordinateSliceSeven_affineFunction_one + (b : FABL.𝔽₂) (a : FABL.F₂Cube 7) : + firstCoordinateSliceSeven (FABL.affineFunction b a) 1 = + FABL.affineFunction (b + a 0) (Fin.tail a) := by + funext x + simp only [firstCoordinateSliceSeven, FABL.affineFunction] + have hdot : FABL.f₂DotProduct a (Fin.cons 1 x) = + a 0 * 1 + FABL.f₂DotProduct (Fin.tail a) x := by + exact Matrix.dotProduct_cons a 1 x + rw [hdot] + simp only [Fin.isValue, mul_one, Nat.reduceAdd] + rw [add_assoc] + +private theorem slice_nonlinearity_sum_le_nonlinearity_seven + (f : BooleanFunction 7) : + nonlinearity (firstCoordinateSliceSeven f 0) + + nonlinearity (firstCoordinateSliceSeven f 1) ≤ nonlinearity f := by + obtain ⟨b, a, haffine⟩ := + exists_affineFunction_hammingDistance_eq_nonlinearity f + have hzero := nonlinearity_le_affineFunction_distance + (firstCoordinateSliceSeven f 0) b (Fin.tail a) + have hone := nonlinearity_le_affineFunction_distance + (firstCoordinateSliceSeven f 1) (b + a 0) (Fin.tail a) + calc + nonlinearity (firstCoordinateSliceSeven f 0) + + nonlinearity (firstCoordinateSliceSeven f 1) ≤ + hammingDistance (firstCoordinateSliceSeven f 0) + (FABL.affineFunction b (Fin.tail a)) + + hammingDistance (firstCoordinateSliceSeven f 1) + (FABL.affineFunction (b + a 0) (Fin.tail a)) := + Nat.add_le_add hzero hone + _ = hammingDistance f (FABL.affineFunction b a) := by + rw [hammingDistance_firstCoordinateSlicesSeven] + rw [firstCoordinateSliceSeven_affineFunction_zero, + firstCoordinateSliceSeven_affineFunction_one] + _ = nonlinearity f := haffine + +private theorem nonlinearity_seven_le_slice_affine_distances + (f : BooleanFunction 7) (bzero bone : FABL.𝔽₂) + (a : FABL.F₂Cube 6) : + nonlinearity f ≤ + hammingDistance (firstCoordinateSliceSeven f 0) + (FABL.affineFunction bzero a) + + hammingDistance (firstCoordinateSliceSeven f 1) + (FABL.affineFunction bone a) := by + calc + nonlinearity f ≤ + hammingDistance f (pairedAffineFunctionSeven bzero bone a) := + nonlinearity_le_affineFunction_distance f bzero + (Fin.cons (bzero + bone) a) + _ = _ := hammingDistance_pairedAffineFunctionSeven f bzero bone a + +private theorem nonlinearity_seven_eq_twenty_eight_add_slice_one + (f : BooleanFunction 7) + (hzero : nonlinearity (firstCoordinateSliceSeven f 0) = 28) : + nonlinearity f = 28 + nonlinearity (firstCoordinateSliceSeven f 1) := by + apply Nat.le_antisymm + · obtain ⟨bone, a, hone⟩ := + exists_affineFunction_hammingDistance_eq_nonlinearity + (firstCoordinateSliceSeven f 1) + obtain ⟨bzero, hzeroDistance⟩ := + exists_affineFunction_same_slope_distance_eq_twenty_eight + (firstCoordinateSliceSeven f 0) hzero a + calc + nonlinearity f ≤ + hammingDistance (firstCoordinateSliceSeven f 0) + (FABL.affineFunction bzero a) + + hammingDistance (firstCoordinateSliceSeven f 1) + (FABL.affineFunction bone a) := + nonlinearity_seven_le_slice_affine_distances f bzero bone a + _ = 28 + nonlinearity (firstCoordinateSliceSeven f 1) := by + rw [hzeroDistance, hone] + · rw [← hzero] + exact slice_nonlinearity_sum_le_nonlinearity_seven f + +private theorem nonlinearity_seven_eq_slice_zero_add_twenty_eight + (f : BooleanFunction 7) + (hone : nonlinearity (firstCoordinateSliceSeven f 1) = 28) : + nonlinearity f = nonlinearity (firstCoordinateSliceSeven f 0) + 28 := by + apply Nat.le_antisymm + · obtain ⟨bzero, a, hzero⟩ := + exists_affineFunction_hammingDistance_eq_nonlinearity + (firstCoordinateSliceSeven f 0) + obtain ⟨bone, honeDistance⟩ := + exists_affineFunction_same_slope_distance_eq_twenty_eight + (firstCoordinateSliceSeven f 1) hone a + calc + nonlinearity f ≤ + hammingDistance (firstCoordinateSliceSeven f 0) + (FABL.affineFunction bzero a) + + hammingDistance (firstCoordinateSliceSeven f 1) + (FABL.affineFunction bone a) := + nonlinearity_seven_le_slice_affine_distances f bzero bone a + _ = nonlinearity (firstCoordinateSliceSeven f 0) + 28 := by + rw [hzero, honeDistance] + · rw [← hone] + exact slice_nonlinearity_sum_le_nonlinearity_seven f + +private theorem four_dvd_hammingWeight_affineFunction_seven + (b : FABL.𝔽₂) (a : FABL.F₂Cube 7) : + 4 ∣ hammingWeight (FABL.affineFunction b a) := by + by_cases ha : a = 0 + · subst a + by_cases hb : b = 0 + · subst b + have hzero : + FABL.affineFunction (0 : FABL.𝔽₂) (0 : FABL.F₂Cube 7) = 0 := by + funext x + simp [FABL.affineFunction, FABL.f₂DotProduct] + rw [hzero] + simp + · have hb_one : b = 1 := Fin.eq_one_of_ne_zero _ hb + subst b + rw [hammingWeight_affineFunction_one_zero] + norm_num + · rw [hammingWeight_affineFunction_of_ne_zero b a ha] + norm_num + +private theorem even_support_inter_affineFunction_of_degree_le_five + (f : BooleanFunction 7) (hf : FABL.functionAlgebraicDegree f ≤ 5) + (b : FABL.𝔽₂) (a : FABL.F₂Cube 7) : + Even (support f ∩ support (FABL.affineFunction b a)).card := by + have hfmem : f ∈ reedMuller 5 7 := hf + have hfdual : f ∈ reedMullerDual 1 7 := by + rw [reedMullerDual_eq (r := 1) (n := 7) (by omega)] + norm_num + exact hfmem + rw [reedMullerDual, LinearMap.BilinForm.mem_orthogonal_iff] at hfdual + have hpair := hfdual (FABL.affineFunction b a) + (affineFunction_mem_reedMuller_one b a) + exact even_card_support_inter_of_pairing_eq_zero f + (FABL.affineFunction b a) (by + rw [booleanFunctionPairing_apply] + calc + ∑ x, f x * FABL.affineFunction b a x = + ∑ x, FABL.affineFunction b a x * f x := by + apply Finset.sum_congr rfl + intro x _hx + exact mul_comm _ _ + _ = 0 := hpair) + +private theorem hammingDistance_affineFunction_mod_four_eq_weight_mod_four_seven + (f : BooleanFunction 7) (hf : FABL.functionAlgebraicDegree f ≤ 5) + (b : FABL.𝔽₂) (a : FABL.F₂Cube 7) : + hammingDistance f (FABL.affineFunction b a) % 4 = hammingWeight f % 4 := by + rw [hammingDistance_eq_hammingWeight_add] + have hidentity := hammingWeight_add_add_two_mul_card_inter f + (FABL.affineFunction b a) + obtain ⟨k, hk⟩ := + even_support_inter_affineFunction_of_degree_le_five f hf b a + obtain ⟨q, hq⟩ := four_dvd_hammingWeight_affineFunction_seven b a + omega + +private theorem even_hammingWeight_of_degree_le_four_six + (f : BooleanFunction 6) (hf : FABL.functionAlgebraicDegree f ≤ 4) : + Even (hammingWeight f) := by + have heven := even_support_inter_affineFunction_of_degree_le_four + f hf 1 0 + have hone : + FABL.affineFunction (1 : FABL.𝔽₂) (0 : FABL.F₂Cube 6) = 1 := by + funext x + simp [FABL.affineFunction, FABL.f₂DotProduct] + rw [hone] at heven + simpa [hammingWeight_eq_card_support, support, FABL.f₂OneSupport] using heven + +private theorem even_hammingWeight_of_degree_le_five_seven + (f : BooleanFunction 7) (hf : FABL.functionAlgebraicDegree f ≤ 5) : + Even (hammingWeight f) := by + have heven := even_support_inter_affineFunction_of_degree_le_five + f hf 1 0 + have hone : + FABL.affineFunction (1 : FABL.𝔽₂) (0 : FABL.F₂Cube 7) = 1 := by + funext x + simp [FABL.affineFunction, FABL.f₂DotProduct] + rw [hone] at heven + simpa [hammingWeight_eq_card_support, support, FABL.f₂OneSupport] using heven + +private theorem even_nonlinearity_of_degree_le_four_six + (f : BooleanFunction 6) (hf : FABL.functionAlgebraicDegree f ≤ 4) : + Even (nonlinearity f) := by + obtain ⟨b, a, hminimum⟩ := + exists_affineFunction_hammingDistance_eq_nonlinearity f + have hmod := hammingDistance_affineFunction_mod_four_eq_weight_mod_four + f hf b a + obtain ⟨k, hk⟩ := even_hammingWeight_of_degree_le_four_six f hf + rw [hminimum, hk] at hmod + exact ⟨nonlinearity f / 2, by omega⟩ + +private theorem even_nonlinearity_of_degree_le_five_seven + (f : BooleanFunction 7) (hf : FABL.functionAlgebraicDegree f ≤ 5) : + Even (nonlinearity f) := by + obtain ⟨b, a, hminimum⟩ := + exists_affineFunction_hammingDistance_eq_nonlinearity f + have hmod := + hammingDistance_affineFunction_mod_four_eq_weight_mod_four_seven + f hf b a + obtain ⟨k, hk⟩ := even_hammingWeight_of_degree_le_five_seven f hf + rw [hminimum, hk] at hmod + exact ⟨nonlinearity f / 2, by omega⟩ + +private theorem hammingDistance_affineFunction_add_one_sum_six + (f : BooleanFunction 6) (b : FABL.𝔽₂) (a : FABL.F₂Cube 6) : + hammingDistance f (FABL.affineFunction b a) + + hammingDistance f (FABL.affineFunction (b + 1) a) = 64 := by + by_cases hb : b = 0 + · subst b + change hammingDistance f (FABL.affineFunction 0 a) + + hammingDistance f (FABL.affineFunction 1 a) = 64 + apply (Nat.cast_injective : Function.Injective (fun k : ℕ ↦ (k : ℝ))) + push_cast + have hzero := hammingDistance_cast_linearFunction_eq f a + have hone := hammingDistance_cast_complementLinearFunction_eq f a + norm_num at hzero hone + linarith + · have hb_one : b = 1 := Fin.eq_one_of_ne_zero _ hb + subst b + change hammingDistance f (FABL.affineFunction 1 a) + + hammingDistance f (FABL.affineFunction 0 a) = 64 + apply (Nat.cast_injective : Function.Injective (fun k : ℕ ↦ (k : ℝ))) + push_cast + have hone := hammingDistance_cast_complementLinearFunction_eq f a + have hzero := hammingDistance_cast_linearFunction_eq f a + norm_num at hzero hone + linarith + +private theorem nonlinearity_le_fifty_six_of_slices_degree_le_four + (f : BooleanFunction 7) + (hf : FABL.functionAlgebraicDegree f ≤ 5) + (hzeroDegree : + FABL.functionAlgebraicDegree (firstCoordinateSliceSeven f 0) ≤ 4) + (honeDegree : + FABL.functionAlgebraicDegree (firstCoordinateSliceSeven f 1) ≤ 4) : + nonlinearity f ≤ 56 := by + by_contra hbound + have hgreater : 56 < nonlinearity f := Nat.lt_of_not_ge hbound + have hupper := nonlinearity_seven_le_fifty_eight f + obtain ⟨k, hk⟩ := even_nonlinearity_of_degree_le_five_seven f hf + have hnonlinearity : nonlinearity f = 58 := by omega + have hzeroUpper := + nonlinearity_six_le_twenty_eight (firstCoordinateSliceSeven f 0) + obtain ⟨j, hj⟩ := even_nonlinearity_of_degree_le_four_six + (firstCoordinateSliceSeven f 0) hzeroDegree + have hzeroCases : + nonlinearity (firstCoordinateSliceSeven f 0) = 28 ∨ + nonlinearity (firstCoordinateSliceSeven f 0) = 26 ∨ + nonlinearity (firstCoordinateSliceSeven f 0) ≤ 24 := by + omega + rcases hzeroCases with hzero | hzero | hzero + · have hequality := + nonlinearity_seven_eq_twenty_eight_add_slice_one f hzero + have honeUpper := + nonlinearity_six_le_twenty_eight (firstCoordinateSliceSeven f 1) + omega + · obtain ⟨bzero, a, hzeroDistance⟩ := + exists_affineFunction_hammingDistance_eq_nonlinearity + (firstCoordinateSliceSeven f 0) + rw [hzero] at hzeroDistance + obtain ⟨bone, honeDistance⟩ := + exists_affineFunction_same_slope_distance_le_thirty_two + (firstCoordinateSliceSeven f 1) a + have hcandidate := + nonlinearity_seven_le_slice_affine_distances f bzero bone a + rw [hnonlinearity, hzeroDistance] at hcandidate + have honeDistanceEq : + hammingDistance (firstCoordinateSliceSeven f 1) + (FABL.affineFunction bone a) = 32 := by + omega + have honeDistanceMod := + hammingDistance_affineFunction_mod_four_eq_weight_mod_four + (firstCoordinateSliceSeven f 1) honeDegree bone a + obtain ⟨boneMin, aMin, honeMin⟩ := + exists_affineFunction_hammingDistance_eq_nonlinearity + (firstCoordinateSliceSeven f 1) + have honeMinMod := + hammingDistance_affineFunction_mod_four_eq_weight_mod_four + (firstCoordinateSliceSeven f 1) honeDegree boneMin aMin + rw [honeDistanceEq] at honeDistanceMod + rw [honeMin] at honeMinMod + have honeMod : nonlinearity (firstCoordinateSliceSeven f 1) % 4 = 0 := by + omega + have honeUpper := + nonlinearity_six_le_twenty_eight (firstCoordinateSliceSeven f 1) + by_cases hone : nonlinearity (firstCoordinateSliceSeven f 1) = 28 + · have hequality := + nonlinearity_seven_eq_slice_zero_add_twenty_eight f hone + omega + · have honeLe : nonlinearity (firstCoordinateSliceSeven f 1) ≤ 24 := by + omega + obtain ⟨boneMin, aMin, honeMin⟩ := + exists_affineFunction_hammingDistance_eq_nonlinearity + (firstCoordinateSliceSeven f 1) + obtain ⟨bzeroNear, hzeroNear⟩ := + exists_affineFunction_same_slope_distance_le_thirty_two + (firstCoordinateSliceSeven f 0) aMin + have hcandidate' := + nonlinearity_seven_le_slice_affine_distances + f bzeroNear boneMin aMin + rw [honeMin] at hcandidate' + omega + · obtain ⟨bzero, a, hzeroDistance⟩ := + exists_affineFunction_hammingDistance_eq_nonlinearity + (firstCoordinateSliceSeven f 0) + obtain ⟨bone, honeDistance⟩ := + exists_affineFunction_same_slope_distance_le_thirty_two + (firstCoordinateSliceSeven f 1) a + have hcandidate := + nonlinearity_seven_le_slice_affine_distances f bzero bone a + rw [hzeroDistance] at hcandidate + omega + +/-- Every seven-variable Boolean function of algebraic degree at most five +has nonlinearity at most `56`. -/ +theorem nonlinearity_le_56_of_degree_le_five_seven + (f : BooleanFunction 7) (hf : FABL.functionAlgebraicDegree f ≤ 5) : + nonlinearity f ≤ 56 := by + obtain ⟨P, hzero, hone⟩ := + exists_linearEquiv_firstCoordinateSlices_degree_le_four f hf + let g : BooleanFunction 7 := f ∘ P + have hgDegree : FABL.functionAlgebraicDegree g ≤ 5 := by + have hcomp : g = f ∘ P.toAffineEquiv := rfl + rw [hcomp, FABL.functionAlgebraicDegree_comp_affineEquiv] + exact hf + have hg := nonlinearity_le_fifty_six_of_slices_degree_le_four + g hgDegree (by simpa [g] using hzero) (by simpa [g] using hone) + have hinvariant := nonlinearity_comp_affineEquiv f P.toAffineEquiv + change nonlinearity g = nonlinearity f at hinvariant + rwa [hinvariant] at hg + +private theorem hammingDistance_affineFunction_mod_four_eq_nonlinearity_mod_four_six + (f : BooleanFunction 6) (hf : FABL.functionAlgebraicDegree f ≤ 4) + (b : FABL.𝔽₂) (a : FABL.F₂Cube 6) : + hammingDistance f (FABL.affineFunction b a) % 4 = nonlinearity f % 4 := by + obtain ⟨bmin, amin, hminimum⟩ := + exists_affineFunction_hammingDistance_eq_nonlinearity f + have hcandidate := hammingDistance_affineFunction_mod_four_eq_weight_mod_four + f hf b a + have hminimumMod := hammingDistance_affineFunction_mod_four_eq_weight_mod_four + f hf bmin amin + rw [hminimum] at hminimumMod + omega + +private theorem hammingDistance_affineFunction_mod_four_eq_nonlinearity_mod_four_seven + (f : BooleanFunction 7) (hf : FABL.functionAlgebraicDegree f ≤ 5) + (b : FABL.𝔽₂) (a : FABL.F₂Cube 7) : + hammingDistance f (FABL.affineFunction b a) % 4 = nonlinearity f % 4 := by + obtain ⟨bmin, amin, hminimum⟩ := + exists_affineFunction_hammingDistance_eq_nonlinearity f + have hcandidate := + hammingDistance_affineFunction_mod_four_eq_weight_mod_four_seven + f hf b a + have hminimumMod := + hammingDistance_affineFunction_mod_four_eq_weight_mod_four_seven + f hf bmin amin + rw [hminimum] at hminimumMod + omega + +private theorem pairedAffineFunctionSeven_error_zero_slice + (f : BooleanFunction 7) (bzero bone : FABL.𝔽₂) + (a : FABL.F₂Cube 6) (x : FABL.F₂Cube 6) : + (f + pairedAffineFunctionSeven bzero bone a) (Fin.cons 0 x) = + (firstCoordinateSliceSeven f 0 + FABL.affineFunction bzero a) x := by + simp only [Pi.add_apply, firstCoordinateSliceSeven] + rw [show pairedAffineFunctionSeven bzero bone a (Fin.cons 0 x) = + FABL.affineFunction bzero a x by + exact congrFun + (firstCoordinateSliceSeven_pairedAffineFunction_zero bzero bone a) x] + +private theorem exists_minimum_pairedAffineFunction_error_one_at_zero_slice + (f : BooleanFunction 7) + (hf : FABL.functionAlgebraicDegree f ≤ 5) + (hzeroDegree : + FABL.functionAlgebraicDegree (firstCoordinateSliceSeven f 0) ≤ 4) + (honeDegree : + FABL.functionAlgebraicDegree (firstCoordinateSliceSeven f 1) ≤ 4) + (hnonlinearity : nonlinearity f = 56) + (x : FABL.F₂Cube 6) : + ∃ bzero bone a, + hammingDistance f (pairedAffineFunctionSeven bzero bone a) = 56 ∧ + (f + pairedAffineFunctionSeven bzero bone a) (Fin.cons 0 x) = 1 := by + have hzeroUpper := + nonlinearity_six_le_twenty_eight (firstCoordinateSliceSeven f 0) + obtain ⟨k, hk⟩ := even_nonlinearity_of_degree_le_four_six + (firstCoordinateSliceSeven f 0) hzeroDegree + have hzeroCases : + nonlinearity (firstCoordinateSliceSeven f 0) = 28 ∨ + nonlinearity (firstCoordinateSliceSeven f 0) = 26 ∨ + nonlinearity (firstCoordinateSliceSeven f 0) ≤ 24 := by + omega + rcases hzeroCases with hzero | hzero | hzero + · have hequality := + nonlinearity_seven_eq_twenty_eight_add_slice_one f hzero + have hone : nonlinearity (firstCoordinateSliceSeven f 1) = 28 := by + omega + obtain ⟨bzero, a, hzeroDistance, hzeroPoint⟩ := + exists_minimum_affine_error_one_at_of_nonlinearity_eq_28 + (firstCoordinateSliceSeven f 0) hzero x + obtain ⟨bone, honeDistance⟩ := + exists_affineFunction_same_slope_distance_eq_twenty_eight + (firstCoordinateSliceSeven f 1) hone a + refine ⟨bzero, bone, a, ?_, ?_⟩ + · rw [hammingDistance_pairedAffineFunctionSeven, + hzeroDistance, honeDistance] + · rw [pairedAffineFunctionSeven_error_zero_slice] + exact hzeroPoint + · obtain ⟨bzero, a, hzeroDistance, hzeroPoint⟩ := + exists_minimum_affine_error_one_at_of_degree_le_four_nonlinearity_eq_26 + (firstCoordinateSliceSeven f 0) hzeroDegree hzero x + obtain ⟨bone, honeDistance⟩ := + exists_affineFunction_same_slope_distance_le_thirty_two + (firstCoordinateSliceSeven f 1) a + have hcandidateLower := + nonlinearity_le_affineFunction_distance f bzero + (Fin.cons (bzero + bone) a) + have hcandidateMod := + hammingDistance_affineFunction_mod_four_eq_nonlinearity_mod_four_seven + f hf bzero (Fin.cons (bzero + bone) a) + have hcandidateDistance : + hammingDistance f (pairedAffineFunctionSeven bzero bone a) = 56 := by + rw [hammingDistance_pairedAffineFunctionSeven, hzeroDistance] + have hpaired : + hammingDistance f (pairedAffineFunctionSeven bzero bone a) = + 26 + hammingDistance (firstCoordinateSliceSeven f 1) + (FABL.affineFunction bone a) := by + rw [hammingDistance_pairedAffineFunctionSeven, hzeroDistance] + change hammingDistance f (pairedAffineFunctionSeven bzero bone a) % 4 = + nonlinearity f % 4 at hcandidateMod + rw [hpaired, hnonlinearity] at hcandidateMod + rw [hnonlinearity] at hcandidateLower + change 56 ≤ hammingDistance f (pairedAffineFunctionSeven bzero bone a) + at hcandidateLower + rw [hpaired] at hcandidateLower + omega + exact ⟨bzero, bone, a, hcandidateDistance, + pairedAffineFunctionSeven_error_zero_slice f bzero bone a x |>.trans + hzeroPoint⟩ + · have hzeroEq : nonlinearity (firstCoordinateSliceSeven f 0) = 24 := by + obtain ⟨bzero, a, hzeroDistance⟩ := + exists_affineFunction_hammingDistance_eq_nonlinearity + (firstCoordinateSliceSeven f 0) + obtain ⟨bone, honeDistance⟩ := + exists_affineFunction_same_slope_distance_le_thirty_two + (firstCoordinateSliceSeven f 1) a + have hcandidate := + nonlinearity_seven_le_slice_affine_distances f bzero bone a + rw [hnonlinearity, hzeroDistance] at hcandidate + omega + have honeLower : 24 ≤ nonlinearity (firstCoordinateSliceSeven f 1) := by + obtain ⟨bone, a, honeDistance⟩ := + exists_affineFunction_hammingDistance_eq_nonlinearity + (firstCoordinateSliceSeven f 1) + obtain ⟨bzero, hzeroDistance⟩ := + exists_affineFunction_same_slope_distance_le_thirty_two + (firstCoordinateSliceSeven f 0) a + have hcandidate := + nonlinearity_seven_le_slice_affine_distances f bzero bone a + rw [hnonlinearity, honeDistance] at hcandidate + omega + have honeMod : nonlinearity (firstCoordinateSliceSeven f 1) % 4 = 0 := by + obtain ⟨bzero, a, hzeroDistance⟩ := + exists_affineFunction_hammingDistance_eq_nonlinearity + (firstCoordinateSliceSeven f 0) + rw [hzeroEq] at hzeroDistance + obtain ⟨bone, honeDistance⟩ := + exists_affineFunction_same_slope_distance_le_thirty_two + (firstCoordinateSliceSeven f 1) a + have hcandidate := + nonlinearity_seven_le_slice_affine_distances f bzero bone a + rw [hnonlinearity, hzeroDistance] at hcandidate + have honeDistanceEq : + hammingDistance (firstCoordinateSliceSeven f 1) + (FABL.affineFunction bone a) = 32 := by + omega + have hmod := + hammingDistance_affineFunction_mod_four_eq_nonlinearity_mod_four_six + (firstCoordinateSliceSeven f 1) honeDegree bone a + rw [honeDistanceEq] at hmod + omega + have honeUpper := + nonlinearity_six_le_twenty_eight (firstCoordinateSliceSeven f 1) + have honeEq : nonlinearity (firstCoordinateSliceSeven f 1) = 24 := by + by_cases hone : nonlinearity (firstCoordinateSliceSeven f 1) = 28 + · have hequality := + nonlinearity_seven_eq_slice_zero_add_twenty_eight f hone + omega + · omega + obtain ⟨bone, a, honeDistance⟩ := + exists_affineFunction_hammingDistance_eq_nonlinearity + (firstCoordinateSliceSeven f 1) + rw [honeEq] at honeDistance + obtain ⟨bzero, hzeroDistance⟩ := + exists_affineFunction_same_slope_distance_le_thirty_two + (firstCoordinateSliceSeven f 0) a + have hcandidate := + nonlinearity_seven_le_slice_affine_distances f bzero bone a + rw [hnonlinearity, honeDistance] at hcandidate + have hzeroDistanceEq : + hammingDistance (firstCoordinateSliceSeven f 0) + (FABL.affineFunction bzero a) = 32 := by + omega + by_cases hpoint : + (firstCoordinateSliceSeven f 0 + FABL.affineFunction bzero a) x = 1 + · refine ⟨bzero, bone, a, ?_, ?_⟩ + · rw [hammingDistance_pairedAffineFunctionSeven, + hzeroDistanceEq, honeDistance] + · rw [pairedAffineFunctionSeven_error_zero_slice] + exact hpoint + · have hpointZero : + (firstCoordinateSliceSeven f 0 + FABL.affineFunction bzero a) x = 0 := by + by_contra hne + exact hpoint (Fin.eq_one_of_ne_zero _ hne) + have hcomplementSum := hammingDistance_affineFunction_add_one_sum_six + (firstCoordinateSliceSeven f 0) bzero a + have hcomplementDistance : + hammingDistance (firstCoordinateSliceSeven f 0) + (FABL.affineFunction (bzero + 1) a) = 32 := by + omega + refine ⟨bzero + 1, bone, a, ?_, ?_⟩ + · rw [hammingDistance_pairedAffineFunctionSeven, + hcomplementDistance, honeDistance] + · rw [pairedAffineFunctionSeven_error_zero_slice] + change firstCoordinateSliceSeven f 0 x + + ((bzero + 1) + FABL.f₂DotProduct a x) = 1 + change firstCoordinateSliceSeven f 0 x + + (bzero + FABL.f₂DotProduct a x) = 0 at hpointZero + calc + firstCoordinateSliceSeven f 0 x + + ((bzero + 1) + FABL.f₂DotProduct a x) = + (firstCoordinateSliceSeven f 0 x + + (bzero + FABL.f₂DotProduct a x)) + 1 := by ring + _ = 1 := by rw [hpointZero]; simp + +private theorem transport_minimum_affine_error_one_of_comp_affineEquiv + (f : BooleanFunction 7) + (L : FABL.F₂Cube 7 ≃ᵃ[FABL.𝔽₂] FABL.F₂Cube 7) + (x : FABL.F₂Cube 7) (b : FABL.𝔽₂) (a : FABL.F₂Cube 7) + (hdistance : + hammingDistance (f ∘ L) (FABL.affineFunction b a) = 56) + (hpoint : + ((f ∘ L) + FABL.affineFunction b a) (L.symm x) = 1) : + ∃ c d, hammingDistance f (FABL.affineFunction c d) = 56 ∧ + (f + FABL.affineFunction c d) x = 1 := by + obtain ⟨c, d, haffine⟩ := + exists_affineFunction_comp_affineEquiv b a L.symm + refine ⟨c, d, ?_, ?_⟩ + · rw [← haffine] + have hcancel : (f ∘ L) ∘ L.symm = f := by + funext y + simp + have hinvariant := hammingDistance_comp_affineEquiv + (f ∘ L) (FABL.affineFunction b a) L.symm + rw [← hcancel] + exact hinvariant.trans hdistance + · rw [← haffine] + simpa only [Pi.add_apply, Function.comp_apply, L.apply_symm_apply] using hpoint + +private def firstCoordinateToggleSeven : + FABL.F₂Cube 7 ≃ᵃ[FABL.𝔽₂] FABL.F₂Cube 7 := + AffineEquiv.constVAdd FABL.𝔽₂ (FABL.F₂Cube 7) + (Pi.single 0 1 : FABL.F₂Cube 7) + +private theorem firstCoordinateToggleSeven_apply + (x : FABL.F₂Cube 7) : + firstCoordinateToggleSeven x = x + Pi.single 0 1 := by + funext i + simp [firstCoordinateToggleSeven, add_comm] + +private theorem firstCoordinateToggleSeven_symm_apply + (x : FABL.F₂Cube 7) : + firstCoordinateToggleSeven.symm x = x + Pi.single 0 1 := by + funext i + simp [firstCoordinateToggleSeven, add_comm] + +private theorem firstCoordinateSliceSeven_comp_toggle_zero + (f : BooleanFunction 7) : + firstCoordinateSliceSeven (f ∘ firstCoordinateToggleSeven) 0 = + firstCoordinateSliceSeven f 1 := by + funext x + change f (firstCoordinateToggleSeven (Fin.cons 0 x)) = f (Fin.cons 1 x) + rw [firstCoordinateToggleSeven_apply] + apply congrArg f + funext i + refine Fin.cases ?_ (fun j ↦ ?_) i + · simp + · simp + +private theorem firstCoordinateSliceSeven_comp_toggle_one + (f : BooleanFunction 7) : + firstCoordinateSliceSeven (f ∘ firstCoordinateToggleSeven) 1 = + firstCoordinateSliceSeven f 0 := by + funext x + change f (firstCoordinateToggleSeven (Fin.cons 1 x)) = f (Fin.cons 0 x) + rw [firstCoordinateToggleSeven_apply] + apply congrArg f + funext i + refine Fin.cases ?_ (fun j ↦ ?_) i + · simp + · simp + +private theorem exists_minimum_affine_error_one_at_of_slices_degree_le_four + (f : BooleanFunction 7) + (hf : FABL.functionAlgebraicDegree f ≤ 5) + (hzeroDegree : + FABL.functionAlgebraicDegree (firstCoordinateSliceSeven f 0) ≤ 4) + (honeDegree : + FABL.functionAlgebraicDegree (firstCoordinateSliceSeven f 1) ≤ 4) + (hnonlinearity : nonlinearity f = 56) + (x : FABL.F₂Cube 7) : + ∃ b a, hammingDistance f (FABL.affineFunction b a) = 56 ∧ + (f + FABL.affineFunction b a) x = 1 := by + by_cases hxzero : x 0 = 0 + · have hxcons : Fin.cons 0 (Fin.tail x) = x := by + funext i + refine Fin.cases ?_ (fun j ↦ ?_) i + · exact hxzero.symm + · rfl + obtain ⟨bzero, bone, a, hdistance, hpoint⟩ := + exists_minimum_pairedAffineFunction_error_one_at_zero_slice + f hf hzeroDegree honeDegree hnonlinearity (Fin.tail x) + refine ⟨bzero, Fin.cons (bzero + bone) a, ?_, ?_⟩ + · exact hdistance + · simpa only [pairedAffineFunctionSeven, hxcons] using hpoint + · have hxone : x 0 = 1 := Fin.eq_one_of_ne_zero _ hxzero + let g : BooleanFunction 7 := f ∘ firstCoordinateToggleSeven + let y : FABL.F₂Cube 7 := firstCoordinateToggleSeven.symm x + have hyzero : y 0 = 0 := by + rw [show y = x + Pi.single 0 1 by + exact firstCoordinateToggleSeven_symm_apply x] + simp [hxone] + have hycons : Fin.cons 0 (Fin.tail y) = y := by + funext i + refine Fin.cases ?_ (fun j ↦ ?_) i + · exact hyzero.symm + · rfl + have hgDegree : FABL.functionAlgebraicDegree g ≤ 5 := by + have hcomp : g = f ∘ firstCoordinateToggleSeven := rfl + rw [hcomp, FABL.functionAlgebraicDegree_comp_affineEquiv] + exact hf + have hgzeroDegree : + FABL.functionAlgebraicDegree (firstCoordinateSliceSeven g 0) ≤ 4 := by + rw [show firstCoordinateSliceSeven g 0 = + firstCoordinateSliceSeven f 1 by + exact firstCoordinateSliceSeven_comp_toggle_zero f] + exact honeDegree + have hgoneDegree : + FABL.functionAlgebraicDegree (firstCoordinateSliceSeven g 1) ≤ 4 := by + rw [show firstCoordinateSliceSeven g 1 = + firstCoordinateSliceSeven f 0 by + exact firstCoordinateSliceSeven_comp_toggle_one f] + exact hzeroDegree + have hgNonlinearity : nonlinearity g = 56 := by + have hinvariant := + nonlinearity_comp_affineEquiv f firstCoordinateToggleSeven + change nonlinearity g = nonlinearity f at hinvariant + rwa [hnonlinearity] at hinvariant + obtain ⟨bzero, bone, a, hdistance, hpoint⟩ := + exists_minimum_pairedAffineFunction_error_one_at_zero_slice + g hgDegree hgzeroDegree hgoneDegree hgNonlinearity (Fin.tail y) + have hpointY : + (g + pairedAffineFunctionSeven bzero bone a) y = 1 := by + simpa only [hycons] using hpoint + exact transport_minimum_affine_error_one_of_comp_affineEquiv + f firstCoordinateToggleSeven x bzero (Fin.cons (bzero + bone) a) + (by simpa [g, pairedAffineFunctionSeven] using hdistance) + (by simpa [g, y, pairedAffineFunctionSeven] using hpointY) + +/-- A seven-variable degree-at-most-five coset at nonlinearity `56` has, +through every coordinate, a minimum-weight representative modulo the +first-order Reed--Muller code. -/ +theorem exists_minimum_affine_error_one_at_of_degree_le_five_nonlinearity_eq_56_seven + (f : BooleanFunction 7) (hf : FABL.functionAlgebraicDegree f ≤ 5) + (hnonlinearity : nonlinearity f = 56) (x : FABL.F₂Cube 7) : + ∃ b a, hammingDistance f (FABL.affineFunction b a) = 56 ∧ + (f + FABL.affineFunction b a) x = 1 := by + obtain ⟨P, hzero, hone⟩ := + exists_linearEquiv_firstCoordinateSlices_degree_le_four f hf + let g : BooleanFunction 7 := f ∘ P + let y : FABL.F₂Cube 7 := P.toAffineEquiv.symm x + have hgDegree : FABL.functionAlgebraicDegree g ≤ 5 := by + have hcomp : g = f ∘ P.toAffineEquiv := rfl + rw [hcomp, FABL.functionAlgebraicDegree_comp_affineEquiv] + exact hf + have hgNonlinearity : nonlinearity g = 56 := by + have hinvariant := nonlinearity_comp_affineEquiv f P.toAffineEquiv + change nonlinearity g = nonlinearity f at hinvariant + rwa [hnonlinearity] at hinvariant + obtain ⟨b, a, hdistance, hpoint⟩ := + exists_minimum_affine_error_one_at_of_slices_degree_le_four + g hgDegree (by simpa [g] using hzero) (by simpa [g] using hone) + hgNonlinearity y + exact transport_minimum_affine_error_one_of_comp_affineEquiv + f P.toAffineEquiv x b a + (by simpa [g] using hdistance) + (by simpa [g, y] using hpoint) + +end CryptBoolean diff --git a/CryptBoolean/Carlet/Chapter04/OddWeightingNonlinearity.lean b/CryptBoolean/Carlet/Chapter04/OddWeightingNonlinearity.lean new file mode 100644 index 0000000..3fd07e0 --- /dev/null +++ b/CryptBoolean/Carlet/Chapter04/OddWeightingNonlinearity.lean @@ -0,0 +1,279 @@ +/- +Copyright (c) 2026 Asher Yan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Asher Yan with Codex +-/ +module + +public import CryptBoolean.Carlet.Chapter04.Nonlinearity + +import Mathlib.LinearAlgebra.Dimension.Free +import Mathlib.LinearAlgebra.Dimension.RankNullity + +/-! +# Carlet Chapter 4 odd-weighting subspaces + +Maximal odd-weighting subspaces are represented by Carlet's equivalent coset condition: every +affine coset has odd restriction weight. This formulation applies to arbitrary binary subspaces. +-/ + +open Finset +open scoped BigOperators BooleanCube + +@[expose] public section + +namespace CryptBoolean + +variable {n d : ℕ} + +/-- The weight of the restriction of `f` to the affine coset `a + E`, parameterized by `E`. -/ +noncomputable def subspaceCosetWeight + (f : BooleanFunction n) (E : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) + (a : FABL.F₂Cube n) : ℕ := + Nat.card {e : E // f (a + e.1) = 1} + +/-- A maximal odd-weighting subspace in Carlet's equivalent all-cosets formulation. -/ +def IsMaximalOddWeightingSubspace + (f : BooleanFunction n) (E : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) : Prop := + ∀ a, Odd (subspaceCosetWeight f E a) + +private theorem subspaceCosetWeight_cast + (f : BooleanFunction n) (E : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) + [Fintype E] + (a : FABL.F₂Cube n) : + (subspaceCosetWeight f E a : FABL.𝔽₂) = + ∑ e : E, f (a + e.1) := by + classical + rw [subspaceCosetWeight, Nat.card_eq_fintype_card, + Fintype.card_subtype] + calc + ((Finset.univ.filter fun e : E ↦ f (a + e.1) = 1).card : FABL.𝔽₂) = + ∑ e : E, if f (a + e.1) = 1 then 1 else 0 := by + simp + _ = ∑ e : E, f (a + e.1) := by + apply Finset.sum_congr rfl + intro e _ + by_cases h : f (a + e.1) = 1 + · simp [h] + · have hz : f (a + e.1) = 0 := by + by_contra hnz + exact h (Fin.eq_one_of_ne_zero _ hnz) + simp [hz] + +/-- Carlet Chapter 3, Remark 2: a maximal odd-weighting subspace forces a weight lower bound. -/ +theorem hammingWeight_lower_bound_of_isMaximalOddWeightingSubspace + (f : BooleanFunction n) (E : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) + (hE : IsMaximalOddWeightingSubspace f E) : + 2 ^ (n - Module.finrank FABL.𝔽₂ E) ≤ hammingWeight f := by + letI : Fintype ((FABL.F₂Cube n) ⧸ E) := Fintype.ofFinite _ + let π : ↥(support f) → (FABL.F₂Cube n) ⧸ E := + fun x ↦ E.mkQ x.1 + have hπ : Function.Surjective π := by + intro q + obtain ⟨a, rfl⟩ := E.mkQ_surjective q + have hpositive : 0 < subspaceCosetWeight f E a := + (hE a).pos + have hnonempty : Nonempty {e : E // f (a + e.1) = 1} := by + rw [← Finite.card_pos_iff] + exact hpositive + obtain ⟨⟨e, hvalue⟩⟩ := hnonempty + refine ⟨⟨a + e.1, (mem_support f (a + e.1)).mpr hvalue⟩, ?_⟩ + change E.mkQ (a + e.1) = E.mkQ a + simp + have hcard_le : + Fintype.card ((FABL.F₂Cube n) ⧸ E) ≤ Fintype.card ↥(support f) := + Fintype.card_le_of_surjective π hπ + rw [Fintype.card_coe] at hcard_le + rw [hammingWeight_eq_card_support] + calc + 2 ^ (n - Module.finrank FABL.𝔽₂ E) = + Fintype.card ((FABL.F₂Cube n) ⧸ E) := by + rw [← Nat.card_eq_fintype_card, + Module.natCard_eq_pow_finrank (K := FABL.𝔽₂), Nat.card_zmod] + have htotal : + Module.finrank FABL.𝔽₂ (FABL.F₂Cube n) = n := by + rw [Module.finrank_fintype_fun_eq_card] + simp + have hquotient := E.finrank_quotient_add_finrank + rw [htotal] at hquotient + have hquotient' : + Module.finrank FABL.𝔽₂ ((FABL.F₂Cube n) ⧸ E) = + n - Module.finrank FABL.𝔽₂ E := by + omega + rw [hquotient'] + _ ≤ (support f).card := by simpa using hcard_le + +private noncomputable def subspaceCoordinateEquiv + (E : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) : + FABL.F₂Cube (Module.finrank FABL.𝔽₂ E) ≃ₗ[FABL.𝔽₂] E := + LinearEquiv.ofFinrankEq _ _ (by + rw [Module.finrank_fintype_fun_eq_card] + simp) + +private noncomputable def restrictedAffineFrequency + (E : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) (c : FABL.F₂Cube n) : + FABL.F₂Cube (Module.finrank FABL.𝔽₂ E) := + (dotProductEquiv FABL.𝔽₂ (Fin (Module.finrank FABL.𝔽₂ E))).symm + (((dotProductEquiv FABL.𝔽₂ (Fin n)) c).comp + (E.subtype.comp (subspaceCoordinateEquiv E).toLinearMap)) + +private theorem f₂DotProduct_restrictedAffineFrequency + (E : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) (c : FABL.F₂Cube n) + (y : FABL.F₂Cube (Module.finrank FABL.𝔽₂ E)) : + FABL.f₂DotProduct (restrictedAffineFrequency E c) y = + FABL.f₂DotProduct c ((subspaceCoordinateEquiv E y).1) := by + change + dotProduct (restrictedAffineFrequency E c) y = + dotProduct c ((subspaceCoordinateEquiv E y).1) + calc + dotProduct (restrictedAffineFrequency E c) y = + ((dotProductEquiv FABL.𝔽₂ + (Fin (Module.finrank FABL.𝔽₂ E))) + (restrictedAffineFrequency E c)) y := + (dotProductEquiv_apply_apply FABL.𝔽₂ _ _ _).symm + _ = (((dotProductEquiv FABL.𝔽₂ (Fin n)) c).comp + (E.subtype.comp (subspaceCoordinateEquiv E).toLinearMap)) y := by + exact DFunLike.congr_fun + ((dotProductEquiv FABL.𝔽₂ + (Fin (Module.finrank FABL.𝔽₂ E))).apply_symm_apply _) y + _ = ((dotProductEquiv FABL.𝔽₂ (Fin n)) c) + ((subspaceCoordinateEquiv E y).1) := rfl + _ = dotProduct c ((subspaceCoordinateEquiv E y).1) := + dotProductEquiv_apply_apply FABL.𝔽₂ _ _ _ + +private theorem affineFunction_subspaceCoordinate + (E : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) + (a c : FABL.F₂Cube n) (b : FABL.𝔽₂) + (y : FABL.F₂Cube (Module.finrank FABL.𝔽₂ E)) : + FABL.affineFunction b c (a + (subspaceCoordinateEquiv E y).1) = + FABL.affineFunction (FABL.affineFunction b c a) + (restrictedAffineFrequency E c) y := by + rw [FABL.affineFunction, FABL.affineFunction, + FABL.affineFunction, f₂DotProduct_restrictedAffineFrequency] + change b + dotProduct c (a + (subspaceCoordinateEquiv E y).1) = + (b + dotProduct c a) + dotProduct c (subspaceCoordinateEquiv E y).1 + rw [dotProduct_add] + ac_rfl + +private theorem subspaceCosetWeight_affineFunction_eq_hammingWeight + (E : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) + (a c : FABL.F₂Cube n) (b : FABL.𝔽₂) : + subspaceCosetWeight (FABL.affineFunction b c) E a = + hammingWeight + (FABL.affineFunction (FABL.affineFunction b c a) + (restrictedAffineFrequency E c)) := by + classical + let q : BooleanFunction (Module.finrank FABL.𝔽₂ E) := + FABL.affineFunction (FABL.affineFunction b c a) + (restrictedAffineFrequency E c) + let e : + {x : E // FABL.affineFunction b c (a + x.1) = 1} ≃ + {y : FABL.F₂Cube (Module.finrank FABL.𝔽₂ E) // q y = 1} := + Equiv.subtypeEquiv (subspaceCoordinateEquiv E).symm.toEquiv fun x ↦ by + have h := affineFunction_subspaceCoordinate E a c b + ((subspaceCoordinateEquiv E).symm x) + rw [LinearEquiv.apply_symm_apply] at h + simpa [q] using congrArg (fun z ↦ z = 1) h + rw [subspaceCosetWeight] + calc + Nat.card {x : E // FABL.affineFunction b c (a + x.1) = 1} = + Nat.card + {y : FABL.F₂Cube (Module.finrank FABL.𝔽₂ E) // q y = 1} := + Nat.card_congr e + _ = hammingWeight q := by + rw [Nat.card_eq_fintype_card, Fintype.card_subtype, + hammingWeight_eq_card_support] + rfl + +private theorem even_hammingWeight_affineFunction + {m : ℕ} (hm : 2 ≤ m) (b : FABL.𝔽₂) (c : FABL.F₂Cube m) : + Even (hammingWeight (FABL.affineFunction b c)) := by + by_cases hc : c = 0 + · subst c + by_cases hb : b = 0 + · subst b + simp [hammingWeight_eq_card_support, support, + FABL.f₂OneSupport, FABL.affineFunction, FABL.f₂DotProduct] + · have hb_one : b = 1 := Fin.eq_one_of_ne_zero b hb + subst b + have hweight : + hammingWeight + (FABL.affineFunction (1 : FABL.𝔽₂) (0 : FABL.F₂Cube m)) = + 2 ^ m := by + rw [hammingWeight_eq_card_support] + simp [support, FABL.f₂OneSupport, FABL.affineFunction, + FABL.f₂DotProduct] + rw [hweight] + exact Even.pow_of_ne_zero (by norm_num : Even (2 : ℕ)) (by omega) + · rw [hammingWeight_affineFunction_of_ne_zero b c hc] + exact Even.pow_of_ne_zero (by norm_num : Even (2 : ℕ)) (by omega) + +private theorem even_subspaceCosetWeight_affineFunction + (E : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) + (hE : 2 ≤ Module.finrank FABL.𝔽₂ E) + (a c : FABL.F₂Cube n) (b : FABL.𝔽₂) : + Even (subspaceCosetWeight (FABL.affineFunction b c) E a) := by + rw [subspaceCosetWeight_affineFunction_eq_hammingWeight] + exact even_hammingWeight_affineFunction hE _ _ + +private theorem odd_subspaceCosetWeight_add_of_odd_even + (f g : BooleanFunction n) + (E : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) (a : FABL.F₂Cube n) + (hf : Odd (subspaceCosetWeight f E a)) + (hg : Even (subspaceCosetWeight g E a)) : + Odd (subspaceCosetWeight (f + g) E a) := by + classical + letI : Fintype E := Fintype.ofFinite _ + rw [← ZMod.natCast_eq_one_iff_odd] + rw [subspaceCosetWeight_cast (f + g) E a] + simp only [Pi.add_apply, Finset.sum_add_distrib] + rw [← subspaceCosetWeight_cast f E a, + ← subspaceCosetWeight_cast g E a, + (ZMod.natCast_eq_one_iff_odd.mpr hf), + (ZMod.natCast_eq_zero_iff_even.mpr hg), add_zero] + +/-- Adding an affine function preserves a maximal odd-weighting subspace of dimension at least +two. -/ +theorem isMaximalOddWeightingSubspace_add_affineFunction + (f : BooleanFunction n) + (E : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) + (hfinrank : 2 ≤ Module.finrank FABL.𝔽₂ E) + (hE : IsMaximalOddWeightingSubspace f E) + (b : FABL.𝔽₂) (c : FABL.F₂Cube n) : + IsMaximalOddWeightingSubspace (f + FABL.affineFunction b c) E := by + intro a + exact odd_subspaceCosetWeight_add_of_odd_even f + (FABL.affineFunction b c) E a (hE a) + (even_subspaceCosetWeight_affineFunction E hfinrank a c b) + +/-- The dimension-indexed form of Carlet Chapter 3, Remark 2. -/ +theorem hammingWeight_lower_bound_of_maximalOddWeightingSubspace + (f : BooleanFunction n) + (E : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) + (hdim : Module.finrank FABL.𝔽₂ E = d) + (hE : IsMaximalOddWeightingSubspace f E) : + 2 ^ (n - d) ≤ hammingWeight f := by + simpa [hdim] using + hammingWeight_lower_bound_of_isMaximalOddWeightingSubspace f E hE + +/-- Carlet Chapter 4: a `d`-dimensional maximal odd-weighting subspace with `d ≥ 2` +forces nonlinearity at least `2^(n-d)`. -/ +theorem nonlinearity_lower_bound_of_maximalOddWeightingSubspace + (f : BooleanFunction n) + (E : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) + (hdim : Module.finrank FABL.𝔽₂ E = d) + (hd : 2 ≤ d) + (hE : IsMaximalOddWeightingSubspace f E) : + 2 ^ (n - d) ≤ nonlinearity f := by + classical + rw [nonlinearity] + apply Finset.le_inf' + intro p _hp + rw [hammingDistance_eq_hammingWeight_add] + apply hammingWeight_lower_bound_of_maximalOddWeightingSubspace + (f + FABL.affineFunction p.1 p.2) E hdim + apply isMaximalOddWeightingSubspace_add_affineFunction f E + · simpa [hdim] using hd + · exact hE + +end CryptBoolean diff --git a/CryptBoolean/Carlet/Chapter04/OtherComplexity.lean b/CryptBoolean/Carlet/Chapter04/OtherComplexity.lean new file mode 100644 index 0000000..48db627 --- /dev/null +++ b/CryptBoolean/Carlet/Chapter04/OtherComplexity.lean @@ -0,0 +1,117 @@ +/- +Copyright (c) 2026 Asher Yan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Asher Yan with Codex +-/ +module + +public import CryptBoolean.Carlet.Chapter02.Affine +public import CryptBoolean.Carlet.Chapter02.SpectralSupport + +/-! +# Carlet Chapter 4 auxiliary cryptographic complexity measures + +Algebraic thickness, normality, weak normality, and spectral complexity. +-/ + +open Finset +open scoped BooleanCube + +@[expose] public section + +namespace CryptBoolean + +variable {n : ℕ} + +noncomputable local instance affineEquivFintype : + Fintype (FABL.F₂Cube n ≃ᵃ[FABL.𝔽₂] FABL.F₂Cube n) := + Fintype.ofInjective AffineEquiv.toEquiv AffineEquiv.toEquiv_injective + +/-- Carlet's algebraic thickness: the least number of nonzero ANF terms in the affine orbit. -/ +noncomputable def algebraicThickness (f : BooleanFunction n) : ℕ := + (Finset.univ : Finset (FABL.F₂Cube n ≃ᵃ[FABL.𝔽₂] FABL.F₂Cube n)).inf' + (by simp) + (fun L ↦ (FABL.anfSupport (FABL.anfCoeff (f ∘ L))).card) + +/-- Algebraic thickness is attained by an affine reindexing. -/ +theorem exists_affineEquiv_anfSupport_card_eq_algebraicThickness + (f : BooleanFunction n) : + ∃ L : FABL.F₂Cube n ≃ᵃ[FABL.𝔽₂] FABL.F₂Cube n, + (FABL.anfSupport (FABL.anfCoeff (f ∘ L))).card = + algebraicThickness f := by + classical + obtain ⟨L, _hL, hcard⟩ := Finset.exists_mem_eq_inf' + (s := (Finset.univ : + Finset (FABL.F₂Cube n ≃ᵃ[FABL.𝔽₂] FABL.F₂Cube n))) + (by simp) + (fun L ↦ (FABL.anfSupport (FABL.anfCoeff (f ∘ L))).card) + exact ⟨L, hcard.symm⟩ + +/-- A Boolean function is constant on the affine flat `a + H`. -/ +def IsConstantOnAffineFlat + (f : BooleanFunction n) (H : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) + (a : FABL.F₂Cube n) : Prop := + ∃ b : FABL.𝔽₂, ∀ x ∈ FABL.binaryAffineSubspace H a, f x = b + +/-- A Boolean function restricts to an affine function on the affine flat `a + H`. -/ +def IsAffineOnAffineFlat + (f : BooleanFunction n) (H : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) + (a : FABL.F₂Cube n) : Prop := + ∃ b : FABL.𝔽₂, ∃ c : FABL.F₂Cube n, + ∀ x ∈ FABL.binaryAffineSubspace H a, f x = FABL.affineFunction b c x + +/-- A constant affine-flat restriction is an affine affine-flat restriction. -/ +theorem IsConstantOnAffineFlat.isAffineOnAffineFlat + {f : BooleanFunction n} {H : Submodule FABL.𝔽₂ (FABL.F₂Cube n)} + {a : FABL.F₂Cube n} (h : IsConstantOnAffineFlat f H a) : + IsAffineOnAffineFlat f H a := by + obtain ⟨b, hb⟩ := h + refine ⟨b, 0, ?_⟩ + intro x hx + rw [hb x hx] + simp [FABL.affineFunction, FABL.f₂DotProduct, dotProduct] + +/-- Carlet's normality parameter: the largest dimension of an affine flat on which `f` is +constant. -/ +noncomputable def normality (f : BooleanFunction n) : ℕ := by + classical + exact + ((Finset.univ : Finset + (Submodule FABL.𝔽₂ (FABL.F₂Cube n) × FABL.F₂Cube n)).filter + (fun p : Submodule FABL.𝔽₂ (FABL.F₂Cube n) × FABL.F₂Cube n ↦ + IsConstantOnAffineFlat f p.1 p.2)).sup + (fun p ↦ Module.finrank FABL.𝔽₂ p.1) + +/-- Carlet's weak normality parameter: the largest dimension of an affine flat on which `f` +restricts to an affine function. -/ +noncomputable def weakNormality (f : BooleanFunction n) : ℕ := by + classical + exact + ((Finset.univ : Finset + (Submodule FABL.𝔽₂ (FABL.F₂Cube n) × FABL.F₂Cube n)).filter + (fun p : Submodule FABL.𝔽₂ (FABL.F₂Cube n) × FABL.F₂Cube n ↦ + IsAffineOnAffineFlat f p.1 p.2)).sup + (fun p ↦ Module.finrank FABL.𝔽₂ p.1) + +/-- Every normal affine flat is weakly normal, so normality is bounded by weak normality. -/ +theorem normality_le_weakNormality (f : BooleanFunction n) : + normality f ≤ weakNormality f := by + classical + rw [normality, weakNormality] + apply Finset.sup_le + intro p hp + rw [Finset.mem_filter] at hp + have hpweak : p ∈ + ((Finset.univ : Finset + (Submodule FABL.𝔽₂ (FABL.F₂Cube n) × FABL.F₂Cube n)).filter + (fun q : Submodule FABL.𝔽₂ (FABL.F₂Cube n) × FABL.F₂Cube n ↦ + IsAffineOnAffineFlat f q.1 q.2)) := by + rw [Finset.mem_filter] + exact ⟨Finset.mem_univ p, hp.2.isAffineOnAffineFlat⟩ + exact Finset.le_sup (f := fun q ↦ Module.finrank FABL.𝔽₂ q.1) hpweak + +/-- Carlet's spectral complexity: the number of nonzero raw Walsh coefficients. -/ +noncomputable def spectralComplexity (f : BooleanFunction n) : ℕ := + (rawFourierSupport (realSignView f)).card + +end CryptBoolean diff --git a/CryptBoolean/Carlet/Chapter04/PropagationCriteria.lean b/CryptBoolean/Carlet/Chapter04/PropagationCriteria.lean new file mode 100644 index 0000000..4224de2 --- /dev/null +++ b/CryptBoolean/Carlet/Chapter04/PropagationCriteria.lean @@ -0,0 +1,567 @@ +/- +Copyright (c) 2026 Asher Yan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Asher Yan with Codex +-/ +module + +public import CryptBoolean.Carlet.Chapter02.Derivatives +public import CryptBoolean.Carlet.Chapter04.Resiliency +public import FABL.Chapter04.Switching +public import FABL.Chapter06.F₂Polynomials.Encoding + +/-! +# Carlet Chapter 4 propagation criteria + +Propagation criteria, strict avalanche, coordinate-restriction orders, and extended +propagation criteria. +-/ + +open Finset +open scoped BigOperators BooleanCube + +@[expose] public section + +namespace CryptBoolean + +variable {n : ℕ} + +/-- The nonzero directions of Hamming weight at most `l`. -/ +def lowWeightNonzeroDirections (l : ℕ) : Set (FABL.F₂Cube n) := + {a | a ≠ 0 ∧ (FABL.f₂Support a).card ≤ l} + +/-- Carlet's propagation criterion with respect to a set of directions. -/ +def SatisfiesPropagationCriterionOn + (E : Set (FABL.F₂Cube n)) (f : BooleanFunction n) : Prop := + ∀ a ∈ E, IsBalanced (FABL.booleanDerivative f a) + +/-- Carlet's propagation criterion `PC(l)`. -/ +def SatisfiesPropagationCriterion (l : ℕ) (f : BooleanFunction n) : Prop := + SatisfiesPropagationCriterionOn (lowWeightNonzeroDirections l) f + +/-- `PC(l)` is propagation with respect to exactly the nonzero directions of weight at most +`l`. -/ +theorem satisfiesPropagationCriterion_iff_on_lowWeightNonzeroDirections + (l : ℕ) (f : BooleanFunction n) : + SatisfiesPropagationCriterion l f ↔ + SatisfiesPropagationCriterionOn (lowWeightNonzeroDirections l) f := by + rfl + +/-- Balancedness of a directional derivative is equivalent to vanishing autocorrelation in +that direction. -/ +theorem isBalanced_booleanDerivative_iff_autocorrelation_eq_zero + (f : BooleanFunction n) (a : FABL.F₂Cube n) : + IsBalanced (FABL.booleanDerivative f a) ↔ autocorrelation f a = 0 := by + rw [isBalanced_iff_walshTransform_zero_eq_zero] + have hcast : + autocorrelation f a = + (walshTransform (FABL.booleanDerivative f a) 0 : ℝ) := by + rw [autocorrelation, walshTransform_cast_eq_sum_realSignView_mul_character] + simp + constructor + · intro h + rw [hcast] + exact_mod_cast h + · intro h + rw [hcast] at h + exact_mod_cast h + +/-- Carlet's autocorrelation form of `PC(l)`. -/ +theorem satisfiesPropagationCriterion_iff_autocorrelation_eq_zero + (l : ℕ) (f : BooleanFunction n) : + SatisfiesPropagationCriterion l f ↔ + ∀ a : FABL.F₂Cube n, a ≠ 0 → + (FABL.f₂Support a).card ≤ l → autocorrelation f a = 0 := by + rw [SatisfiesPropagationCriterion, SatisfiesPropagationCriterionOn] + constructor + · intro h a ha hweight + exact isBalanced_booleanDerivative_iff_autocorrelation_eq_zero f a |>.mp + (h a ⟨ha, hweight⟩) + · intro h a ha + exact isBalanced_booleanDerivative_iff_autocorrelation_eq_zero f a |>.mpr + (h a ha.1 ha.2) + +/-- The strict avalanche criterion is `PC(1)`. -/ +def SatisfiesStrictAvalancheCriterion (f : BooleanFunction n) : Prop := + SatisfiesPropagationCriterion 1 f + +/-- SAC is definitionally the first propagation criterion. -/ +theorem satisfiesStrictAvalancheCriterion_iff_pc_one + (f : BooleanFunction n) : + SatisfiesStrictAvalancheCriterion f ↔ SatisfiesPropagationCriterion 1 f := by + rfl + +/-- Lowering the propagation parameter preserves the criterion. -/ +theorem SatisfiesPropagationCriterion.mono + {l l' : ℕ} {f : BooleanFunction n} + (hf : SatisfiesPropagationCriterion l f) (hll' : l' ≤ l) : + SatisfiesPropagationCriterion l' f := by + intro a ha + exact hf a ⟨ha.1, ha.2.trans hll'⟩ + +/-- A coordinate restriction, canonically reindexed by `Fin J.card`, built from FABL's +restriction and Boolean-encoding APIs. -/ +noncomputable def coordinateRestriction + (f : BooleanFunction n) (J : Finset (Fin n)) (z : FABL.FixedSignCube J) : + BooleanFunction J.card := + FABL.booleanFunctionF₂Encoding + (FABL.reindexedSignRestriction (signCubeView f) J z) + +private noncomputable def fixedBinaryAssignment + (J : Finset (Fin n)) (z : FABL.FixedSignCube J) : FABL.F₂Cube n := + fun i ↦ if hi : i ∈ J then 0 else FABL.binarySignEquiv.symm (z ⟨i, hi⟩) + +/-- Evaluation of a coordinate restriction as extension along FABL's canonical free-coordinate +embedding. -/ +private theorem coordinateRestriction_apply + (f : BooleanFunction n) (J : Finset (Fin n)) (z : FABL.FixedSignCube J) + (x : FABL.F₂Cube J.card) : + coordinateRestriction f J z x = + f (Function.extend (FABL.freeCoordinateEmbedding J) x + (fixedBinaryAssignment J z)) := by + classical + unfold coordinateRestriction FABL.booleanFunctionF₂Encoding + FABL.reindexedSignRestriction signCubeView + rw [FABL.signRestriction_apply] + let y : FABL.F₂Cube n := + (FABL.binaryCubeSignEquiv n).symm + (FABL.combineSignCube J + (fun i ↦ FABL.binaryCubeSignEquiv J.card x (J.equivFin i)) z) + change FABL.binarySignEquiv.symm (FABL.binarySignEquiv (f y)) = _ + rw [FABL.binarySignEquiv.symm_apply_apply] + dsimp [y] + congr 1 + apply (FABL.binaryCubeSignEquiv n).injective + rw [(FABL.binaryCubeSignEquiv n).apply_symm_apply] + funext i + by_cases hi : i ∈ J + · let q : Fin J.card := J.equivFin ⟨i, hi⟩ + have hqi : FABL.freeCoordinateEmbedding J q = i := by + dsimp [q] + exact FABL.freeCoordinateEmbedding_equivFin J ⟨i, hi⟩ + have hvalue : + Function.extend (FABL.freeCoordinateEmbedding J) x + (fixedBinaryAssignment J z) i = x q := by + rw [← hqi, (FABL.freeCoordinateEmbedding J).injective.extend_apply] + have hleft : + FABL.combineSignCube J + (fun i ↦ FABL.signEncode (x (J.equivFin i))) z i = + FABL.signEncode (x q) := by + change FABL.combineSignCube J + (fun i ↦ FABL.signEncode (x (J.equivFin i))) z + ((⟨i, hi⟩ : J) : Fin n) = _ + rw [FABL.combineSignCube_apply_free] + rw [hleft, FABL.binaryCubeSignEquiv_apply, hvalue] + · have hnotImage : ¬ ∃ q, FABL.freeCoordinateEmbedding J q = i := by + rintro ⟨q, hqi⟩ + exact hi (by + rw [← hqi] + change (J.equivFin.symm q : Fin n) ∈ J + exact (J.equivFin.symm q).property) + have hleft : + FABL.combineSignCube J + (fun i ↦ FABL.signEncode (x (J.equivFin i))) z i = z ⟨i, hi⟩ := by + change FABL.combineSignCube J + (fun i ↦ FABL.signEncode (x (J.equivFin i))) z + ((⟨i, hi⟩ : FABL.FixedIndex J) : Fin n) = _ + rw [FABL.combineSignCube_apply_fixed] + rw [hleft, FABL.binaryCubeSignEquiv_apply, + Function.extend_apply' x (fixedBinaryAssignment J z) i hnotImage] + simp only [fixedBinaryAssignment, hi, dite_false] + change z ⟨i, hi⟩ = FABL.binarySignEquiv (FABL.binarySignEquiv.symm (z ⟨i, _⟩)) + rw [FABL.binarySignEquiv.apply_symm_apply] + +/-- Extend a direction on the free coordinates by zero on the fixed coordinates. -/ +private noncomputable def liftRestrictionDirection + (J : Finset (Fin n)) (a : FABL.F₂Cube J.card) : FABL.F₂Cube n := + Function.extend (FABL.freeCoordinateEmbedding J) a 0 + +@[simp] private theorem liftRestrictionDirection_apply_free + (J : Finset (Fin n)) (a : FABL.F₂Cube J.card) (i : Fin J.card) : + liftRestrictionDirection J a (FABL.freeCoordinateEmbedding J i) = a i := by + rw [liftRestrictionDirection, + (FABL.freeCoordinateEmbedding J).injective.extend_apply] + +private theorem liftRestrictionDirection_apply_fixed + (J : Finset (Fin n)) (a : FABL.F₂Cube J.card) (i : Fin n) + (hi : i ∉ J) : liftRestrictionDirection J a i = 0 := by + rw [liftRestrictionDirection] + apply Function.extend_apply' + rintro ⟨q, hqi⟩ + apply hi + rw [← hqi] + change (J.equivFin.symm q : Fin n) ∈ J + exact (J.equivFin.symm q).property + +private theorem liftRestrictionDirection_injective (J : Finset (Fin n)) : + Function.Injective (liftRestrictionDirection J) := by + intro a b hab + funext i + have hi := congrFun hab (FABL.freeCoordinateEmbedding J i) + simpa using hi + +@[simp] private theorem liftRestrictionDirection_eq_zero_iff + (J : Finset (Fin n)) (a : FABL.F₂Cube J.card) : + liftRestrictionDirection J a = 0 ↔ a = 0 := by + have hzero : liftRestrictionDirection J (0 : FABL.F₂Cube J.card) = 0 := by + funext i + by_cases hi : i ∈ J + · let q : Fin J.card := J.equivFin ⟨i, hi⟩ + have hqi : FABL.freeCoordinateEmbedding J q = i := by + dsimp [q] + exact FABL.freeCoordinateEmbedding_equivFin J ⟨i, hi⟩ + rw [← hqi, liftRestrictionDirection_apply_free] + rfl + · rw [liftRestrictionDirection_apply_fixed J 0 i hi] + rfl + constructor + · intro h + apply liftRestrictionDirection_injective J + exact h.trans hzero.symm + · rintro rfl + exact hzero + +private theorem f₂Support_liftRestrictionDirection + (J : Finset (Fin n)) (a : FABL.F₂Cube J.card) : + FABL.f₂Support (liftRestrictionDirection J a) = + (FABL.f₂Support a).map (FABL.freeCoordinateEmbedding J) := by + classical + ext i + rw [FABL.mem_f₂Support, Finset.mem_map] + constructor + · intro hi + by_cases himage : ∃ q, FABL.freeCoordinateEmbedding J q = i + · obtain ⟨q, hqi⟩ := himage + refine ⟨q, ?_, hqi⟩ + rw [FABL.mem_f₂Support] + rw [← hqi] at hi + simpa using hi + · exact False.elim (hi (liftRestrictionDirection_apply_fixed J a i (by + intro hiJ + let q : Fin J.card := J.equivFin ⟨i, hiJ⟩ + apply himage + exact ⟨q, by + dsimp [q] + exact FABL.freeCoordinateEmbedding_equivFin J ⟨i, hiJ⟩⟩))) + · rintro ⟨q, hq, rfl⟩ + rw [liftRestrictionDirection_apply_free] + exact (FABL.mem_f₂Support a q).mp hq + +@[simp] private theorem card_f₂Support_liftRestrictionDirection + (J : Finset (Fin n)) (a : FABL.F₂Cube J.card) : + (FABL.f₂Support (liftRestrictionDirection J a)).card = + (FABL.f₂Support a).card := by + rw [f₂Support_liftRestrictionDirection, Finset.card_map] + +/-- Restrict an ambient direction to the canonically enumerated free coordinates. -/ +private noncomputable def restrictToFreeDirection + (J : Finset (Fin n)) (a : FABL.F₂Cube n) : FABL.F₂Cube J.card := + fun i ↦ a (FABL.freeCoordinateEmbedding J i) + +/-- Extending a direction supported on the free coordinates recovers the ambient direction. -/ +private theorem liftRestrictionDirection_restrictToFreeDirection + (J : Finset (Fin n)) (a : FABL.F₂Cube n) + (ha : FABL.f₂Support a ⊆ J) : + liftRestrictionDirection J (restrictToFreeDirection J a) = a := by + funext i + by_cases hi : i ∈ J + · let q : Fin J.card := J.equivFin ⟨i, hi⟩ + have hqi : FABL.freeCoordinateEmbedding J q = i := by + dsimp [q] + exact FABL.freeCoordinateEmbedding_equivFin J ⟨i, hi⟩ + rw [← hqi, liftRestrictionDirection_apply_free] + rfl + · rw [liftRestrictionDirection_apply_fixed J _ i hi] + symm + by_contra hai + exact hi (ha ((FABL.mem_f₂Support a i).mpr hai)) + +/-- A direction extended by zero is supported on the free coordinates. -/ +private theorem f₂Support_liftRestrictionDirection_subset + (J : Finset (Fin n)) (a : FABL.F₂Cube J.card) : + FABL.f₂Support (liftRestrictionDirection J a) ⊆ J := by + rw [f₂Support_liftRestrictionDirection] + intro i hi + obtain ⟨q, _hq, rfl⟩ := Finset.mem_map.mp hi + change (J.equivFin.symm q : Fin n) ∈ J + exact (J.equivFin.symm q).property + +private theorem restrictionInput_add_liftRestrictionDirection + (J : Finset (Fin n)) (z : FABL.FixedSignCube J) + (x a : FABL.F₂Cube J.card) : + Function.extend (FABL.freeCoordinateEmbedding J) (x + a) + (fixedBinaryAssignment J z) = + Function.extend (FABL.freeCoordinateEmbedding J) x + (fixedBinaryAssignment J z) + liftRestrictionDirection J a := by + classical + funext i + by_cases himage : ∃ q, FABL.freeCoordinateEmbedding J q = i + · obtain ⟨q, rfl⟩ := himage + simp [liftRestrictionDirection, + (FABL.freeCoordinateEmbedding J).injective.extend_apply] + · rw [Function.extend_apply' (x + a) (fixedBinaryAssignment J z) i himage] + change fixedBinaryAssignment J z i = + Function.extend (FABL.freeCoordinateEmbedding J) x + (fixedBinaryAssignment J z) i + liftRestrictionDirection J a i + rw [Function.extend_apply' x (fixedBinaryAssignment J z) i himage] + have hi : i ∉ J := by + intro hiJ + apply himage + let q : Fin J.card := J.equivFin ⟨i, hiJ⟩ + exact ⟨q, by + dsimp [q] + exact FABL.freeCoordinateEmbedding_equivFin J ⟨i, hiJ⟩⟩ + rw [liftRestrictionDirection_apply_fixed J a i hi] + simp + +/-- Directional differentiation commutes with coordinate restriction when the direction is +supported on the free coordinates. -/ +private theorem coordinateRestriction_booleanDerivative + (f : BooleanFunction n) (J : Finset (Fin n)) (z : FABL.FixedSignCube J) + (a : FABL.F₂Cube J.card) : + coordinateRestriction (FABL.booleanDerivative f (liftRestrictionDirection J a)) J z = + FABL.booleanDerivative (coordinateRestriction f J z) a := by + funext x + simp only [FABL.booleanDerivative] + rw [coordinateRestriction_apply, coordinateRestriction_apply, + coordinateRestriction_apply, + restrictionInput_add_liftRestrictionDirection] + rfl + +/-- Encoding a sign-valued Boolean function and returning to the sign cube is the identity. -/ +private theorem signCubeView_booleanFunctionF₂Encoding + (g : FABL.BooleanFunction n) : + signCubeView (FABL.booleanFunctionF₂Encoding g) = g := by + funext x + unfold signCubeView FABL.booleanFunctionF₂Encoding + rw [(FABL.binaryCubeSignEquiv n).apply_symm_apply] + change FABL.binarySignEquiv (FABL.binarySignEquiv.symm (g x)) = g x + rw [FABL.binarySignEquiv.apply_symm_apply] + +/-- The sign view of the canonical bit-valued coordinate restriction is FABL's reindexed +sign restriction. -/ +private theorem signCubeView_coordinateRestriction + (f : BooleanFunction n) (J : Finset (Fin n)) (z : FABL.FixedSignCube J) : + signCubeView (coordinateRestriction f J z) = + FABL.reindexedSignRestriction (signCubeView f) J z := by + rw [coordinateRestriction, signCubeView_booleanFunctionF₂Encoding] + +private theorem mean_reindexedSignRestriction_toReal + (g : FABL.BooleanFunction n) (J : Finset (Fin n)) + (z : FABL.FixedSignCube J) : + FABL.mean (FABL.reindexedSignRestriction g J z).toReal = + FABL.mean (FABL.signRestriction g.toReal J z) := by + classical + unfold FABL.mean + let e : {−1,1}^[J.card] ≃ FABL.FreeSignCube J := + Equiv.arrowCongr J.equivFin.symm (Equiv.refl FABL.Sign) + apply Fintype.expect_equiv e + intro y + simp [FABL.BooleanFunction.toReal, FABL.reindexedSignRestriction, + FABL.signRestriction, e, Equiv.arrowCongr, Function.comp_def] + +/-- Balancedness of the canonical bit-valued restriction is exactly balancedness of FABL's +subtype-indexed sign restriction. -/ +private theorem isBalanced_coordinateRestriction_iff + (f : BooleanFunction n) (J : Finset (Fin n)) (z : FABL.FixedSignCube J) : + IsBalanced (coordinateRestriction f J z) ↔ + FABL.IsBalanced + (FABL.signRestriction (signCubeView f).toReal J z) := by + rw [isBalanced_iff_fabl, FABL.IsBalanced, FABL.IsBalanced, + signCubeView_coordinateRestriction] + exact Eq.congr_left (mean_reindexedSignRestriction_toReal (signCubeView f) J z) + +private theorem isBalanced_coordinateRestriction_of_isResilient + (k : ℕ) (f : BooleanFunction n) (J : Finset (Fin n)) + (z : FABL.FixedSignCube J) (hf : IsResilient k f) + (hcard : Fintype.card (FABL.FixedIndex J) = k) : + IsBalanced (coordinateRestriction f J z) := by + rw [isBalanced_coordinateRestriction_iff] + rw [FABL.IsBalanced] + exact (hf.1 J z hcard.le).trans + (isBalanced_iff_fabl f |>.mp hf.2) + +private theorem liftFixedFrequency_fixedFrequencyPart_eq_of_subset_compl + (J S : Finset (Fin n)) (hSJ : S ⊆ Jᶜ) : + FABL.liftFixedFrequency (FABL.fixedFrequencyPart J S) = S := by + have hfree : FABL.freeFrequencyPart J S = ∅ := by + apply Finset.eq_empty_iff_forall_notMem.mpr + intro i hi + have hiS : (i : Fin n) ∈ S := (FABL.mem_freeFrequencyPart J S i).mp hi + exact (Finset.mem_compl.mp (hSJ hiS)) i.property + have hsplit := FABL.liftFreeFrequencyPart_union_liftFixedFrequencyPart J S + rw [hfree] at hsplit + simpa [FABL.liftFreeFrequency] using hsplit + +private theorem fourierCoeff_eq_zero_of_all_coordinateRestrictions_balanced + (g : BooleanFunction n) (J : Finset (Fin n)) + (hbalanced : ∀ z : FABL.FixedSignCube J, + IsBalanced (coordinateRestriction g J z)) + (S : Finset (Fin n)) (hSJ : S ⊆ Jᶜ) : + FABL.fourierCoeff (signCubeView g).toReal S = 0 := by + let T : Finset (FABL.FixedIndex J) := FABL.fixedFrequencyPart J S + have hlift : FABL.liftFixedFrequency T = S := by + exact liftFixedFrequency_fixedFrequencyPart_eq_of_subset_compl J S hSJ + have hrestriction : + FABL.restrictionFourierCoeff (signCubeView g).toReal J ∅ = 0 := by + funext z + change FABL.indexedFourierCoeff + (FABL.signRestriction (signCubeView g).toReal J z) ∅ = 0 + rw [← FABL.expect_eq_indexedFourierCoeff_empty] + exact isBalanced_coordinateRestriction_iff g J z |>.mp (hbalanced z) + have hcoefficient := + FABL.indexedFourierCoeff_restrictionFourierCoeff + (signCubeView g).toReal J (∅ : Finset J) T + rw [hrestriction] at hcoefficient + simpa [FABL.indexedFourierCoeff, FABL.liftFreeFrequency, hlift] using hcoefficient.symm + +private theorem isBalanced_coordinateRestriction_of_fourierCoeff_zero + (g : BooleanFunction n) (J : Finset (Fin n)) (z : FABL.FixedSignCube J) + (hzero : ∀ S : Finset (Fin n), S ⊆ Jᶜ → + FABL.fourierCoeff (signCubeView g).toReal S = 0) : + IsBalanced (coordinateRestriction g J z) := by + rw [isBalanced_coordinateRestriction_iff, FABL.IsBalanced, FABL.mean, + FABL.expect_eq_indexedFourierCoeff_empty] + change FABL.restrictionFourierCoeff (signCubeView g).toReal J ∅ z = 0 + rw [FABL.restrictionFourierCoeff_eq_sum] + apply Finset.sum_eq_zero + intro T _hT + have hsubset : FABL.liftFixedFrequency T ⊆ Jᶜ := by + intro i hi + obtain ⟨j, _hj, hji⟩ := Finset.mem_map.mp hi + rw [← hji] + exact Finset.mem_compl.mpr j.property + rw [show FABL.liftFreeFrequency (∅ : Finset J) ∪ + FABL.liftFixedFrequency T = FABL.liftFixedFrequency T by + simp [FABL.liftFreeFrequency], + hzero (FABL.liftFixedFrequency T) hsubset, zero_mul] + +/-- The order-`k` propagation criterion: every restriction fixing exactly `k` +coordinates satisfies `PC(l)`. -/ +def SatisfiesPropagationCriterionOfOrder + (l k : ℕ) (f : BooleanFunction n) : Prop := + ∀ (J : Finset (Fin n)) (z : FABL.FixedSignCube J), + Fintype.card (FABL.FixedIndex J) = k → + SatisfiesPropagationCriterion l (coordinateRestriction f J z) + +private theorem isBalanced_coordinateDerivative_of_order + {l k : ℕ} {f : BooleanFunction n} + (hf : SatisfiesPropagationCriterionOfOrder l k f) + (a : FABL.F₂Cube n) (ha0 : a ≠ 0) + (haw : (FABL.f₂Support a).card ≤ l) + (J : Finset (Fin n)) (z : FABL.FixedSignCube J) + (hcard : Fintype.card (FABL.FixedIndex J) = k) + (hasupport : FABL.f₂Support a ⊆ J) : + IsBalanced (coordinateRestriction (FABL.booleanDerivative f a) J z) := by + let b : FABL.F₂Cube J.card := restrictToFreeDirection J a + have hlift : liftRestrictionDirection J b = a := + liftRestrictionDirection_restrictToFreeDirection J a hasupport + have hb0 : b ≠ 0 := by + intro hb + apply ha0 + rw [← hlift, hb] + exact (liftRestrictionDirection_eq_zero_iff J 0).mpr rfl + have hbw : (FABL.f₂Support b).card ≤ l := by + rw [← card_f₂Support_liftRestrictionDirection J b, hlift] + exact haw + have hbalanced := hf J z hcard b ⟨hb0, hbw⟩ + rw [← coordinateRestriction_booleanDerivative, hlift] at hbalanced + exact hbalanced + +/-- Carlet's order monotonicity: in the source range `k ≤ n - l`, order `k` +implies every lower restriction order. -/ +theorem SatisfiesPropagationCriterionOfOrder.mono_order + {l k k' : ℕ} {f : BooleanFunction n} + (hf : SatisfiesPropagationCriterionOfOrder l k f) + (hknl : k ≤ n - l) (hk'k : k' ≤ k) : + SatisfiesPropagationCriterionOfOrder l k' f := by + intro J' z' hcard' a ha + rw [← coordinateRestriction_booleanDerivative] + let A : FABL.F₂Cube n := liftRestrictionDirection J' a + have hA0 : A ≠ 0 := by + simpa [A] using ha.1 + have hAw : (FABL.f₂Support A).card ≤ l := by + simpa [A] using ha.2 + have hAsupport : FABL.f₂Support A ⊆ J' := by + exact f₂Support_liftRestrictionDirection_subset J' a + let K' : Finset (Fin n) := J'ᶜ + have hK'card : K'.card = k' := by + dsimp [K'] + rw [Finset.card_compl] + simpa [FABL.FixedIndex] using hcard' + have hK'subset : K' ⊆ (FABL.f₂Support A)ᶜ := by + intro i hiK' + apply Finset.mem_compl.mpr + intro hiA + apply (Finset.mem_compl.mp (show i ∈ J'ᶜ by simpa [K'] using hiK')) + exact hAsupport hiA + have hk_available : k ≤ ((FABL.f₂Support A)ᶜ).card := by + rw [Finset.card_compl] + simp only [Fintype.card_fin] + omega + obtain ⟨K, hK'subsetK, hKsubset, hKcard⟩ := + Finset.exists_subsuperset_card_eq hK'subset + (by simpa [hK'card] using hk'k) hk_available + let J : Finset (Fin n) := Kᶜ + have hJcard : Fintype.card (FABL.FixedIndex J) = k := by + simp [J, FABL.FixedIndex, hKcard] + have hAsubsetJ : FABL.f₂Support A ⊆ J := by + intro i hiA + apply Finset.mem_compl.mpr + intro hiK + exact (Finset.mem_compl.mp (hKsubset hiK)) hiA + apply isBalanced_coordinateRestriction_of_fourierCoeff_zero + intro S hSJ' + apply fourierCoeff_eq_zero_of_all_coordinateRestrictions_balanced + (FABL.booleanDerivative f A) J + · intro z + exact isBalanced_coordinateDerivative_of_order + hf A hA0 hAw J z hJcard hAsubsetJ + · have hSK' : S ⊆ K' := by + simpa [K'] using hSJ' + have hSK : S ⊆ K := hSK'.trans hK'subsetK + simpa [J] using hSK + +/-- Lowering the propagation parameter preserves every fixed-coordinate order. -/ +theorem SatisfiesPropagationCriterionOfOrder.mono_level + {l l' k : ℕ} {f : BooleanFunction n} + (hf : SatisfiesPropagationCriterionOfOrder l k f) (hl'l : l' ≤ l) : + SatisfiesPropagationCriterionOfOrder l' k f := by + intro J z hcard + exact (hf J z hcard).mono hl'l + +/-- SAC of order `k` is `PC(1)` of order `k`. -/ +def SatisfiesStrictAvalancheCriterionOfOrder + (k : ℕ) (f : BooleanFunction n) : Prop := + SatisfiesPropagationCriterionOfOrder 1 k f + +/-- SAC of order `k` is exactly `PC(1)` of order `k`. -/ +theorem satisfiesStrictAvalancheCriterionOfOrder_iff_pc_one + (k : ℕ) (f : BooleanFunction n) : + SatisfiesStrictAvalancheCriterionOfOrder k f ↔ + SatisfiesPropagationCriterionOfOrder 1 k f := by + rfl + +/-- The extended propagation criterion `EPC(l)` of order `k`: each derivative in a +nonzero direction of weight at most `l` is `k`-resilient. -/ +def SatisfiesExtendedPropagationCriterion + (l k : ℕ) (f : BooleanFunction n) : Prop := + ∀ a : FABL.F₂Cube n, a ≠ 0 → + (FABL.f₂Support a).card ≤ l → + IsResilient k (FABL.booleanDerivative f a) + +/-- The extended criterion is stronger than the corresponding order-`k` propagation +criterion. -/ +theorem SatisfiesExtendedPropagationCriterion.toPropagationCriterionOfOrder + {l k : ℕ} {f : BooleanFunction n} + (hf : SatisfiesExtendedPropagationCriterion l k f) : + SatisfiesPropagationCriterionOfOrder l k f := by + intro J z hcard a ha + rw [← coordinateRestriction_booleanDerivative] + apply isBalanced_coordinateRestriction_of_isResilient k + · apply hf (liftRestrictionDirection J a) + · simpa using ha.1 + · simpa using ha.2 + · exact hcard + +end CryptBoolean diff --git a/CryptBoolean/Carlet/Chapter04/PropagationNonlinearity.lean b/CryptBoolean/Carlet/Chapter04/PropagationNonlinearity.lean new file mode 100644 index 0000000..e593955 --- /dev/null +++ b/CryptBoolean/Carlet/Chapter04/PropagationNonlinearity.lean @@ -0,0 +1,1011 @@ +/- +Copyright (c) 2026 Asher Yan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Asher Yan with Codex +-/ +module + +public import CryptBoolean.Carlet.Chapter04.OddDimensionBestNonlinearity +public import CryptBoolean.Carlet.Chapter04.PropagationCriteria +public import CryptBoolean.Carlet.Chapter04.AutocorrelationIndicators +public import CryptBoolean.Carlet.Chapter04.HigherOrderNonlinearity +public import CryptBoolean.Carlet.Chapter04.DistanceToLinearStructures +public import Mathlib.LinearAlgebra.FiniteDimensional.Lemmas + +/-! +# Propagation criterion with high nonlinearity + +An explicit basis of zero-autocorrelation directions for the balanced +Maitra--Kavut--Yücel seed yields a linearly equivalent function satisfying +the first propagation criterion. Complete bent extensions preserve the +criterion and the strict improvement over the odd-dimensional quadratic bound. +-/ + +open Finset Module +open scoped BigOperators BooleanCube + +@[expose] public section + +namespace CryptBoolean + +variable {n : ℕ} + +/-- Thirteen independent zero-autocorrelation directions for the +Maitra--Kavut--Yücel seed. -/ +def maitraKavutYucelZeroAutocorrelationBasis : + Fin 13 → FABL.F₂Cube 13 := + ![FABL.f₂CubeOfFinset {0, 5}, + FABL.f₂CubeOfFinset {2, 6}, + FABL.f₂CubeOfFinset {0, 1, 2, 3, 6}, + FABL.f₂CubeOfFinset {0, 2, 3, 5, 6}, + FABL.f₂CubeOfFinset {0, 1, 4, 5, 6}, + FABL.f₂CubeOfFinset {1, 2, 4, 5, 6}, + FABL.f₂CubeOfFinset {3, 7}, + FABL.f₂CubeOfFinset {1, 3, 7}, + FABL.f₂CubeOfFinset {3, 8}, + FABL.f₂CubeOfFinset {0, 9}, + FABL.f₂CubeOfFinset {0, 10}, + FABL.f₂CubeOfFinset {0, 11}, + FABL.f₂CubeOfFinset {0, 12}] + +/-- The thirteen certified directions form a basis of the binary cube. -/ +theorem maitraKavutYucelZeroAutocorrelationBasis_independent : + LinearIndependent FABL.𝔽₂ maitraKavutYucelZeroAutocorrelationBasis := by + rw [Fintype.linearIndependent_iff] + intro g hg i + have h0 := congrFun hg (0 : Fin 13) + have h1 := congrFun hg (1 : Fin 13) + have h2 := congrFun hg (2 : Fin 13) + have h3 := congrFun hg (3 : Fin 13) + have h4 := congrFun hg (4 : Fin 13) + have h5 := congrFun hg (5 : Fin 13) + have h6 := congrFun hg (6 : Fin 13) + have h7 := congrFun hg (7 : Fin 13) + have h8 := congrFun hg (8 : Fin 13) + have h9 := congrFun hg (9 : Fin 13) + have h10 := congrFun hg (10 : Fin 13) + have h11 := congrFun hg (11 : Fin 13) + have h12 := congrFun hg (12 : Fin 13) + simp +decide [Finset.sum_apply, Pi.smul_apply, smul_eq_mul, + maitraKavutYucelZeroAutocorrelationBasis, FABL.f₂CubeOfFinset, + Fin.sum_univ_succ] at h0 + simp +decide [Finset.sum_apply, Pi.smul_apply, smul_eq_mul, + maitraKavutYucelZeroAutocorrelationBasis, FABL.f₂CubeOfFinset, + Fin.sum_univ_succ] at h1 + simp +decide [Finset.sum_apply, Pi.smul_apply, smul_eq_mul, + maitraKavutYucelZeroAutocorrelationBasis, FABL.f₂CubeOfFinset, + Fin.sum_univ_succ] at h2 + simp +decide [Finset.sum_apply, Pi.smul_apply, smul_eq_mul, + maitraKavutYucelZeroAutocorrelationBasis, FABL.f₂CubeOfFinset, + Fin.sum_univ_succ] at h3 + simp +decide [Finset.sum_apply, Pi.smul_apply, smul_eq_mul, + maitraKavutYucelZeroAutocorrelationBasis, FABL.f₂CubeOfFinset, + Fin.sum_univ_succ] at h4 + simp +decide [Finset.sum_apply, Pi.smul_apply, smul_eq_mul, + maitraKavutYucelZeroAutocorrelationBasis, FABL.f₂CubeOfFinset, + Fin.sum_univ_succ] at h5 + simp +decide [Finset.sum_apply, Pi.smul_apply, smul_eq_mul, + maitraKavutYucelZeroAutocorrelationBasis, FABL.f₂CubeOfFinset, + Fin.sum_univ_succ] at h6 + simp +decide [Finset.sum_apply, Pi.smul_apply, smul_eq_mul, + maitraKavutYucelZeroAutocorrelationBasis, FABL.f₂CubeOfFinset, + Fin.sum_univ_succ] at h7 + simp +decide [Finset.sum_apply, Pi.smul_apply, smul_eq_mul, + maitraKavutYucelZeroAutocorrelationBasis, FABL.f₂CubeOfFinset, + Fin.sum_univ_succ] at h8 + simp +decide [Finset.sum_apply, Pi.smul_apply, smul_eq_mul, + maitraKavutYucelZeroAutocorrelationBasis, FABL.f₂CubeOfFinset, + Fin.sum_univ_succ] at h9 + simp +decide [Finset.sum_apply, Pi.smul_apply, smul_eq_mul, + maitraKavutYucelZeroAutocorrelationBasis, FABL.f₂CubeOfFinset, + Fin.sum_univ_succ] at h10 + simp +decide [Finset.sum_apply, Pi.smul_apply, smul_eq_mul, + maitraKavutYucelZeroAutocorrelationBasis, FABL.f₂CubeOfFinset, + Fin.sum_univ_succ] at h11 + simp +decide [Finset.sum_apply, Pi.smul_apply, smul_eq_mul, + maitraKavutYucelZeroAutocorrelationBasis, FABL.f₂CubeOfFinset, + Fin.sum_univ_succ] at h12 + fin_cases i + · change g 0 = 0 + linear_combination (norm := (ring_nf; simp [CharTwo.two_eq_zero, + show (4 : FABL.𝔽₂) = 0 by decide])) + h0 + h2 + h3 + h6 + h7 + h8 + h9 + h10 + h11 + h12 + · change g 1 = 0 + linear_combination (norm := (ring_nf; simp [CharTwo.two_eq_zero])) + h3 + h4 + h6 + h7 + h8 + · change g 2 = 0 + linear_combination (norm := (ring_nf; simp [CharTwo.two_eq_zero, + show (4 : FABL.𝔽₂) = 0 by decide])) + h0 + h2 + h4 + h5 + h6 + h9 + h10 + h11 + h12 + · change g 3 = 0 + linear_combination (norm := (ring_nf; simp [CharTwo.two_eq_zero, + show (4 : FABL.𝔽₂) = 0 by decide])) + h0 + h2 + h3 + h4 + h5 + h6 + h7 + h8 + h9 + h10 + h11 + h12 + · change g 4 = 0 + linear_combination (norm := (ring_nf; simp [CharTwo.two_eq_zero])) h2 + h6 + · change g 5 = 0 + linear_combination (norm := (ring_nf; simp [CharTwo.two_eq_zero])) + h2 + h4 + h6 + · change g 6 = 0 + linear_combination (norm := (ring_nf; simp [CharTwo.two_eq_zero, + show (4 : FABL.𝔽₂) = 0 by decide])) + h0 + h1 + h2 + h5 + h6 + h7 + h9 + h10 + h11 + h12 + · change g 7 = 0 + linear_combination (norm := (ring_nf; simp [CharTwo.two_eq_zero, + show (4 : FABL.𝔽₂) = 0 by decide])) + h0 + h1 + h2 + h5 + h6 + h9 + h10 + h11 + h12 + · change g 8 = 0 + linear_combination (norm := norm_num) h8 + · change g 9 = 0 + linear_combination (norm := norm_num) h9 + · change g 10 = 0 + linear_combination (norm := norm_num) h10 + · change g 11 = 0 + linear_combination (norm := norm_num) h11 + · change g 12 = 0 + linear_combination (norm := norm_num) h12 + +private theorem booleanDerivative_booleanDirectSum_append + {k l : ℕ} (f : BooleanFunction k) (g : BooleanFunction l) + (a : FABL.F₂Cube k) (b : FABL.F₂Cube l) : + FABL.booleanDerivative (booleanDirectSum f g) (Fin.append a b) = + booleanDirectSum (FABL.booleanDerivative f a) + (FABL.booleanDerivative g b) := by + funext z + let p := (Fin.appendEquiv k l).symm z + have hz : Fin.append p.1 p.2 = z := + (Fin.appendEquiv k l).apply_symm_apply z + rw [← hz] + simp [FABL.booleanDerivative, booleanDirectSum] + abel + +/-- Autocorrelation factors over Boolean direct sums on disjoint coordinate blocks. -/ +theorem autocorrelation_booleanDirectSum_append + {k l : ℕ} (f : BooleanFunction k) (g : BooleanFunction l) + (a : FABL.F₂Cube k) (b : FABL.F₂Cube l) : + autocorrelation (booleanDirectSum f g) (Fin.append a b) = + autocorrelation f a * autocorrelation g b := by + classical + rw [autocorrelation, booleanDerivative_booleanDirectSum_append, + realSignView_booleanDirectSum] + unfold FABL.bentDirectProduct + calc + (∑ x : FABL.F₂Cube (k + l), + realSignView (FABL.booleanDerivative f a) + ((Fin.appendEquiv k l).symm x).1 * + realSignView (FABL.booleanDerivative g b) + ((Fin.appendEquiv k l).symm x).2) = + ∑ p : FABL.F₂Cube k × FABL.F₂Cube l, + realSignView (FABL.booleanDerivative f a) p.1 * + realSignView (FABL.booleanDerivative g b) p.2 := by + exact Equiv.sum_comp (Fin.appendEquiv k l).symm + (fun p : FABL.F₂Cube k × FABL.F₂Cube l ↦ + realSignView (FABL.booleanDerivative f a) p.1 * + realSignView (FABL.booleanDerivative g b) p.2) + _ = _ := by + rw [Fintype.sum_prod_type] + rw [← Finset.sum_mul_sum] + rfl + +private def autocorrelationSummand {k : ℕ} + (f : BooleanFunction k) (a x : FABL.F₂Cube k) : ℝ := + realSignView f x * realSignView f (x + a) + +private theorem realSignView_flipOn {k : ℕ} + (f : BooleanFunction k) (P : Finset (FABL.F₂Cube k)) + (x : FABL.F₂Cube k) : + realSignView (flipOn f P) x = + if x ∈ P then -realSignView f x else realSignView f x := by + by_cases hx : x ∈ P + · rw [if_pos hx] + change FABL.signValue (FABL.signEncode (f x + if x ∈ P then 1 else 0)) = + -FABL.signValue (FABL.signEncode (f x)) + rw [if_pos hx] + rw [FABL.signValue_signEncode_eq_binarySign, + FABL.signValue_signEncode_eq_binarySign, AddChar.map_add_eq_mul, + FABL.binarySign_one] + ring + · rw [if_neg hx] + change FABL.signValue (FABL.signEncode (f x + if x ∈ P then 1 else 0)) = + FABL.signValue (FABL.signEncode (f x)) + rw [if_neg hx, add_zero] + +private theorem autocorrelationSummand_add_self {k : ℕ} + (f : BooleanFunction k) (a x : FABL.F₂Cube k) : + autocorrelationSummand f a (x + a) = autocorrelationSummand f a x := by + rw [autocorrelationSummand, autocorrelationSummand, add_assoc, + ZModModule.add_self, add_zero, mul_comm] + +private theorem autocorrelation_flipOn_of_isolated {k : ℕ} + (f : BooleanFunction k) (P : Finset (FABL.F₂Cube k)) + (a : FABL.F₂Cube k) + (hisolated : ∀ p ∈ P, p + a ∉ P) : + autocorrelation (flipOn f P) a = + autocorrelation f a - + 4 * ∑ p ∈ P, autocorrelationSummand f a p := by + have hpoint (x : FABL.F₂Cube k) : + realSignView (FABL.booleanDerivative (flipOn f P) a) x = + autocorrelationSummand f a x - + 2 * (if x ∈ P then autocorrelationSummand f a x else 0) - + 2 * (if x + a ∈ P then autocorrelationSummand f a x else 0) := by + rw [realSignView_booleanDerivative, realSignView_flipOn, + realSignView_flipOn] + by_cases hx : x ∈ P + · have hxa := hisolated x hx + simp [hx, hxa, autocorrelationSummand] + ring + · by_cases hxa : x + a ∈ P + · simp [hx, hxa, autocorrelationSummand] + ring + · simp [hx, hxa, autocorrelationSummand] + have htranslate : + (∑ x : FABL.F₂Cube k, + if x + a ∈ P then autocorrelationSummand f a x else 0) = + ∑ x : FABL.F₂Cube k, + if x ∈ P then autocorrelationSummand f a x else 0 := by + rw [← Equiv.sum_comp (Equiv.addRight a)] + apply Finset.sum_congr rfl + intro x _hx + change (if (x + a) + a ∈ P then + autocorrelationSummand f a (x + a) else 0) = + if x ∈ P then autocorrelationSummand f a x else 0 + rw [add_assoc, ZModModule.add_self, add_zero] + rw [autocorrelationSummand_add_self] + have hfilter : + (∑ x : FABL.F₂Cube k, + if x ∈ P then autocorrelationSummand f a x else 0) = + ∑ p ∈ P, autocorrelationSummand f a p := by + simp + unfold autocorrelation + rw [show (∑ x : FABL.F₂Cube k, + realSignView (FABL.booleanDerivative (flipOn f P) a) x) = + ∑ x : FABL.F₂Cube k, + (autocorrelationSummand f a x - + 2 * (if x ∈ P then autocorrelationSummand f a x else 0) - + 2 * (if x + a ∈ P then autocorrelationSummand f a x else 0)) by + apply Finset.sum_congr rfl + intro x _hx + exact hpoint x] + rw [Finset.sum_sub_distrib, Finset.sum_sub_distrib, + ← Finset.mul_sum, ← Finset.mul_sum, htranslate, hfilter] + rw [show (∑ x : FABL.F₂Cube k, autocorrelationSummand f a x) = + ∑ x, realSignView (FABL.booleanDerivative f a) x by + apply Finset.sum_congr rfl + intro x _hx + rw [realSignView_booleanDerivative] + rfl] + ring + +private def maitraKavutYucelIsolatedDirectionCertificate + (a : FABL.F₂Cube 13) : Bool := + MaitraKavutYucel.flipPointList13.all fun p ↦ + decide (p + a ∉ MaitraKavutYucel.flipPoints13) + +private theorem maitraKavutYucelIsolatedDirectionCertificate_sound + (a : FABL.F₂Cube 13) + (hcertificate : maitraKavutYucelIsolatedDirectionCertificate a = true) : + ∀ p ∈ MaitraKavutYucel.flipPoints13, + p + a ∉ + MaitraKavutYucel.flipPoints13 := by + intro p hp + have hpList : p ∈ MaitraKavutYucel.flipPointList13 := by + simpa [MaitraKavutYucel.flipPoints13] using hp + exact of_decide_eq_true + (List.all_eq_true.mp hcertificate p hpList) + +private theorem maitraKavutYucelIsolatedDirectionCertificate_zero : + maitraKavutYucelIsolatedDirectionCertificate + (maitraKavutYucelZeroAutocorrelationBasis 0) = true := by decide + +private theorem maitraKavutYucelIsolatedDirectionCertificate_one : + maitraKavutYucelIsolatedDirectionCertificate + (maitraKavutYucelZeroAutocorrelationBasis 1) = true := by decide + +private theorem maitraKavutYucelIsolatedDirectionCertificate_two : + maitraKavutYucelIsolatedDirectionCertificate + (maitraKavutYucelZeroAutocorrelationBasis 2) = true := by decide + +private theorem maitraKavutYucelIsolatedDirectionCertificate_three : + maitraKavutYucelIsolatedDirectionCertificate + (maitraKavutYucelZeroAutocorrelationBasis 3) = true := by decide + +private theorem maitraKavutYucelIsolatedDirectionCertificate_four : + maitraKavutYucelIsolatedDirectionCertificate + (maitraKavutYucelZeroAutocorrelationBasis 4) = true := by decide + +private theorem maitraKavutYucelIsolatedDirectionCertificate_five : + maitraKavutYucelIsolatedDirectionCertificate + (maitraKavutYucelZeroAutocorrelationBasis 5) = true := by decide + +private theorem maitraKavutYucelIsolatedDirectionCertificate_six : + maitraKavutYucelIsolatedDirectionCertificate + (maitraKavutYucelZeroAutocorrelationBasis 6) = true := by decide + +private theorem maitraKavutYucelIsolatedDirectionCertificate_seven : + maitraKavutYucelIsolatedDirectionCertificate + (maitraKavutYucelZeroAutocorrelationBasis 7) = true := by decide + +private theorem maitraKavutYucelIsolatedDirectionCertificate_eight : + maitraKavutYucelIsolatedDirectionCertificate + (maitraKavutYucelZeroAutocorrelationBasis 8) = true := by decide + +private theorem maitraKavutYucelIsolatedDirectionCertificate_nine : + maitraKavutYucelIsolatedDirectionCertificate + (maitraKavutYucelZeroAutocorrelationBasis 9) = true := by decide + +private theorem maitraKavutYucelIsolatedDirectionCertificate_ten : + maitraKavutYucelIsolatedDirectionCertificate + (maitraKavutYucelZeroAutocorrelationBasis 10) = true := by decide + +private theorem maitraKavutYucelIsolatedDirectionCertificate_eleven : + maitraKavutYucelIsolatedDirectionCertificate + (maitraKavutYucelZeroAutocorrelationBasis 11) = true := by decide + +private theorem maitraKavutYucelIsolatedDirectionCertificate_twelve : + maitraKavutYucelIsolatedDirectionCertificate + (maitraKavutYucelZeroAutocorrelationBasis 12) = true := by decide + +private theorem maitraKavutYucelZeroAutocorrelationBasis_isolated (i : Fin 13) : + ∀ p ∈ MaitraKavutYucel.flipPoints13, + p + maitraKavutYucelZeroAutocorrelationBasis i ∉ + MaitraKavutYucel.flipPoints13 := by + fin_cases i + · exact maitraKavutYucelIsolatedDirectionCertificate_sound _ + maitraKavutYucelIsolatedDirectionCertificate_zero + · exact maitraKavutYucelIsolatedDirectionCertificate_sound _ + maitraKavutYucelIsolatedDirectionCertificate_one + · exact maitraKavutYucelIsolatedDirectionCertificate_sound _ + maitraKavutYucelIsolatedDirectionCertificate_two + · exact maitraKavutYucelIsolatedDirectionCertificate_sound _ + maitraKavutYucelIsolatedDirectionCertificate_three + · exact maitraKavutYucelIsolatedDirectionCertificate_sound _ + maitraKavutYucelIsolatedDirectionCertificate_four + · exact maitraKavutYucelIsolatedDirectionCertificate_sound _ + maitraKavutYucelIsolatedDirectionCertificate_five + · exact maitraKavutYucelIsolatedDirectionCertificate_sound _ + maitraKavutYucelIsolatedDirectionCertificate_six + · exact maitraKavutYucelIsolatedDirectionCertificate_sound _ + maitraKavutYucelIsolatedDirectionCertificate_seven + · exact maitraKavutYucelIsolatedDirectionCertificate_sound _ + maitraKavutYucelIsolatedDirectionCertificate_eight + · exact maitraKavutYucelIsolatedDirectionCertificate_sound _ + maitraKavutYucelIsolatedDirectionCertificate_nine + · exact maitraKavutYucelIsolatedDirectionCertificate_sound _ + maitraKavutYucelIsolatedDirectionCertificate_ten + · exact maitraKavutYucelIsolatedDirectionCertificate_sound _ + maitraKavutYucelIsolatedDirectionCertificate_eleven + · exact maitraKavutYucelIsolatedDirectionCertificate_sound _ + maitraKavutYucelIsolatedDirectionCertificate_twelve + +private def maitraKavutYucelFlipCorrectionInt + (a : FABL.F₂Cube 13) : ℤ := + ∑ p ∈ MaitraKavutYucel.flipPoints13, + bitSignInt (FABL.booleanDerivative MaitraKavutYucel.initialFunction13 a p) + +private theorem autocorrelationSummand_eq_bitSignInt_cast + {k : ℕ} (f : BooleanFunction k) (a x : FABL.F₂Cube k) : + autocorrelationSummand f a x = + (bitSignInt (FABL.booleanDerivative f a x) : ℝ) := by + rw [autocorrelationSummand, ← realSignView_booleanDerivative, bitSignInt_cast] + exact FABL.signValue_signEncode_eq_binarySign _ + +private theorem maitraKavutYucelFlipCorrection_eq_cast + (a : FABL.F₂Cube 13) : + (∑ p ∈ MaitraKavutYucel.flipPoints13, + autocorrelationSummand MaitraKavutYucel.initialFunction13 + a p) = (maitraKavutYucelFlipCorrectionInt a : ℝ) := by + rw [maitraKavutYucelFlipCorrectionInt, Int.cast_sum] + apply Finset.sum_congr rfl + intro p _hp + exact autocorrelationSummand_eq_bitSignInt_cast _ _ _ + +private theorem maitraKavutYucelFlipCorrectionInt_zero : + maitraKavutYucelFlipCorrectionInt + (maitraKavutYucelZeroAutocorrelationBasis 0) = 0 := by decide + +private theorem maitraKavutYucelFlipCorrectionInt_one : + maitraKavutYucelFlipCorrectionInt + (maitraKavutYucelZeroAutocorrelationBasis 1) = 0 := by decide + +private theorem maitraKavutYucelFlipCorrectionInt_two : + maitraKavutYucelFlipCorrectionInt + (maitraKavutYucelZeroAutocorrelationBasis 2) = 0 := by decide + +private theorem maitraKavutYucelFlipCorrectionInt_three : + maitraKavutYucelFlipCorrectionInt + (maitraKavutYucelZeroAutocorrelationBasis 3) = 0 := by decide + +private theorem maitraKavutYucelFlipCorrectionInt_four : + maitraKavutYucelFlipCorrectionInt + (maitraKavutYucelZeroAutocorrelationBasis 4) = 0 := by decide + +private theorem maitraKavutYucelFlipCorrectionInt_five : + maitraKavutYucelFlipCorrectionInt + (maitraKavutYucelZeroAutocorrelationBasis 5) = 0 := by decide + +private theorem maitraKavutYucelFlipCorrectionInt_six : + maitraKavutYucelFlipCorrectionInt + (maitraKavutYucelZeroAutocorrelationBasis 6) = 0 := by decide + +private theorem maitraKavutYucelFlipCorrectionInt_seven : + maitraKavutYucelFlipCorrectionInt + (maitraKavutYucelZeroAutocorrelationBasis 7) = 0 := by decide + +private theorem maitraKavutYucelFlipCorrectionInt_eight : + maitraKavutYucelFlipCorrectionInt + (maitraKavutYucelZeroAutocorrelationBasis 8) = 0 := by decide + +private theorem maitraKavutYucelFlipCorrectionInt_nine : + maitraKavutYucelFlipCorrectionInt + (maitraKavutYucelZeroAutocorrelationBasis 9) = 0 := by decide + +private theorem maitraKavutYucelFlipCorrectionInt_ten : + maitraKavutYucelFlipCorrectionInt + (maitraKavutYucelZeroAutocorrelationBasis 10) = 0 := by decide + +private theorem maitraKavutYucelFlipCorrectionInt_eleven : + maitraKavutYucelFlipCorrectionInt + (maitraKavutYucelZeroAutocorrelationBasis 11) = 0 := by decide + +private theorem maitraKavutYucelFlipCorrectionInt_twelve : + maitraKavutYucelFlipCorrectionInt + (maitraKavutYucelZeroAutocorrelationBasis 12) = 0 := by decide + +private theorem maitraKavutYucelZeroAutocorrelationBasis_flipCorrection + (i : Fin 13) : + (∑ p ∈ MaitraKavutYucel.flipPoints13, + autocorrelationSummand MaitraKavutYucel.initialFunction13 + (maitraKavutYucelZeroAutocorrelationBasis i) p) = 0 := by + rw [maitraKavutYucelFlipCorrection_eq_cast] + fin_cases i + · simpa [maitraKavutYucelZeroAutocorrelationBasis] using + congrArg (fun z : ℤ ↦ (z : ℝ)) maitraKavutYucelFlipCorrectionInt_zero + · simpa [maitraKavutYucelZeroAutocorrelationBasis] using + congrArg (fun z : ℤ ↦ (z : ℝ)) maitraKavutYucelFlipCorrectionInt_one + · simpa [maitraKavutYucelZeroAutocorrelationBasis] using + congrArg (fun z : ℤ ↦ (z : ℝ)) maitraKavutYucelFlipCorrectionInt_two + · simpa [maitraKavutYucelZeroAutocorrelationBasis] using + congrArg (fun z : ℤ ↦ (z : ℝ)) maitraKavutYucelFlipCorrectionInt_three + · simpa [maitraKavutYucelZeroAutocorrelationBasis] using + congrArg (fun z : ℤ ↦ (z : ℝ)) maitraKavutYucelFlipCorrectionInt_four + · simpa [maitraKavutYucelZeroAutocorrelationBasis] using + congrArg (fun z : ℤ ↦ (z : ℝ)) maitraKavutYucelFlipCorrectionInt_five + · simpa [maitraKavutYucelZeroAutocorrelationBasis] using + congrArg (fun z : ℤ ↦ (z : ℝ)) maitraKavutYucelFlipCorrectionInt_six + · simpa [maitraKavutYucelZeroAutocorrelationBasis] using + congrArg (fun z : ℤ ↦ (z : ℝ)) maitraKavutYucelFlipCorrectionInt_seven + · simpa [maitraKavutYucelZeroAutocorrelationBasis] using + congrArg (fun z : ℤ ↦ (z : ℝ)) maitraKavutYucelFlipCorrectionInt_eight + · simpa [maitraKavutYucelZeroAutocorrelationBasis] using + congrArg (fun z : ℤ ↦ (z : ℝ)) maitraKavutYucelFlipCorrectionInt_nine + · simpa [maitraKavutYucelZeroAutocorrelationBasis] using + congrArg (fun z : ℤ ↦ (z : ℝ)) maitraKavutYucelFlipCorrectionInt_ten + · simpa [maitraKavutYucelZeroAutocorrelationBasis] using + congrArg (fun z : ℤ ↦ (z : ℝ)) maitraKavutYucelFlipCorrectionInt_eleven + · simpa [maitraKavutYucelZeroAutocorrelationBasis] using + congrArg (fun z : ℤ ↦ (z : ℝ)) maitraKavutYucelFlipCorrectionInt_twelve + +private def fastWeight : (k : ℕ) → BooleanFunction k → ℕ + | 0, f => if f 0 = 1 then 1 else 0 + | k + 1, f => + fastWeight k (fun x ↦ f (Fin.cons 0 x)) + + fastWeight k (fun x ↦ f (Fin.cons 1 x)) + +private theorem fastWeight_eq_sum (k : ℕ) (f : BooleanFunction k) : + fastWeight k f = ∑ x, if f x = 1 then 1 else 0 := by + induction k with + | zero => + let c := f 0 + have hf : f = fun _ ↦ c := by + funext x + simp only [c] + rw [Subsingleton.elim x 0] + rw [hf] + simp [fastWeight] + | succ k ih => + rw [fastWeight, ih, ih] + rw [← Equiv.sum_comp (Fin.consEquiv + (fun _ : Fin (k + 1) ↦ FABL.𝔽₂)), Fintype.sum_prod_type] + change (∑ b : FABL.𝔽₂, ∑ x : FABL.F₂Cube k, + (if f (Fin.cons b x) = 1 then 1 else 0)) = _ + rw [show (Finset.univ : Finset FABL.𝔽₂) = {0, 1} by rfl] + simp only [Finset.sum_insert, Finset.mem_singleton, zero_ne_one, + not_false_eq_true, Finset.sum_singleton] + change + ((∑ x, if f (Fin.cons 0 x) = 1 then 1 else 0) + + ∑ x, if f (Fin.cons 1 x) = 1 then 1 else 0) = _ + rfl + +private theorem hammingWeight_eq_fastWeight + (k : ℕ) (f : BooleanFunction k) : + hammingWeight f = fastWeight k f := by + rw [hammingWeight_eq_card_support, fastWeight_eq_sum, ← Finset.sum_filter] + simp [support, FABL.f₂OneSupport] + +private theorem seed33_certificate : + fastWeight 9 (FABL.booleanDerivative + MaitraKavutYucel.shiftedSeedFunction9 (f₂CubeOfNat 9 33)) = 256 := by decide +private theorem seed68_certificate : + fastWeight 9 (FABL.booleanDerivative + MaitraKavutYucel.shiftedSeedFunction9 (f₂CubeOfNat 9 68)) = 256 := by decide +private theorem seed79_certificate : + fastWeight 9 (FABL.booleanDerivative + MaitraKavutYucel.shiftedSeedFunction9 (f₂CubeOfNat 9 79)) = 256 := by decide +private theorem seed109_certificate : + fastWeight 9 (FABL.booleanDerivative + MaitraKavutYucel.shiftedSeedFunction9 (f₂CubeOfNat 9 109)) = 256 := by decide +private theorem seed115_certificate : + fastWeight 9 (FABL.booleanDerivative + MaitraKavutYucel.shiftedSeedFunction9 (f₂CubeOfNat 9 115)) = 256 := by decide +private theorem seed118_certificate : + fastWeight 9 (FABL.booleanDerivative + MaitraKavutYucel.shiftedSeedFunction9 (f₂CubeOfNat 9 118)) = 256 := by decide +private theorem seed136_certificate : + fastWeight 9 (FABL.booleanDerivative + MaitraKavutYucel.shiftedSeedFunction9 (f₂CubeOfNat 9 136)) = 256 := by decide +private theorem seed138_certificate : + fastWeight 9 (FABL.booleanDerivative + MaitraKavutYucel.shiftedSeedFunction9 (f₂CubeOfNat 9 138)) = 256 := by decide +private theorem seed264_certificate : + fastWeight 9 (FABL.booleanDerivative + MaitraKavutYucel.shiftedSeedFunction9 (f₂CubeOfNat 9 264)) = 256 := by decide +private theorem bent1_certificate : + fastWeight 4 (FABL.booleanDerivative + MaitraKavutYucel.bentFunction4 (f₂CubeOfNat 4 1)) = 8 := by decide +private theorem bent2_certificate : + fastWeight 4 (FABL.booleanDerivative + MaitraKavutYucel.bentFunction4 (f₂CubeOfNat 4 2)) = 8 := by decide +private theorem bent4_certificate : + fastWeight 4 (FABL.booleanDerivative + MaitraKavutYucel.bentFunction4 (f₂CubeOfNat 4 4)) = 8 := by decide +private theorem bent8_certificate : + fastWeight 4 (FABL.booleanDerivative + MaitraKavutYucel.bentFunction4 (f₂CubeOfNat 4 8)) = 8 := by decide + +private def maitraKavutYucelZeroAutocorrelationBasisNatIndex : Fin 13 → ℕ := + ![33, 68, 79, 109, 115, 118, 136, 138, 264, 513, 1025, 2049, 4097] + +private theorem maitraKavutYucelZeroAutocorrelationBasis_eq_f₂CubeOfNat + (i : Fin 13) : + maitraKavutYucelZeroAutocorrelationBasis i = + f₂CubeOfNat 13 (maitraKavutYucelZeroAutocorrelationBasisNatIndex i) := by + fin_cases i <;> decide + +private theorem direction33_append : f₂CubeOfNat 13 33 = + Fin.append (f₂CubeOfNat 9 33) (0 : FABL.F₂Cube 4) := by decide +private theorem direction68_append : f₂CubeOfNat 13 68 = + Fin.append (f₂CubeOfNat 9 68) (0 : FABL.F₂Cube 4) := by decide +private theorem direction79_append : f₂CubeOfNat 13 79 = + Fin.append (f₂CubeOfNat 9 79) (0 : FABL.F₂Cube 4) := by decide +private theorem direction109_append : f₂CubeOfNat 13 109 = + Fin.append (f₂CubeOfNat 9 109) (0 : FABL.F₂Cube 4) := by decide +private theorem direction115_append : f₂CubeOfNat 13 115 = + Fin.append (f₂CubeOfNat 9 115) (0 : FABL.F₂Cube 4) := by decide +private theorem direction118_append : f₂CubeOfNat 13 118 = + Fin.append (f₂CubeOfNat 9 118) (0 : FABL.F₂Cube 4) := by decide +private theorem direction136_append : f₂CubeOfNat 13 136 = + Fin.append (f₂CubeOfNat 9 136) (0 : FABL.F₂Cube 4) := by decide +private theorem direction138_append : f₂CubeOfNat 13 138 = + Fin.append (f₂CubeOfNat 9 138) (0 : FABL.F₂Cube 4) := by decide +private theorem direction264_append : f₂CubeOfNat 13 264 = + Fin.append (f₂CubeOfNat 9 264) (0 : FABL.F₂Cube 4) := by decide +private theorem direction513_append : f₂CubeOfNat 13 513 = + Fin.append (f₂CubeOfNat 9 1) (f₂CubeOfNat 4 1) := by decide +private theorem direction1025_append : f₂CubeOfNat 13 1025 = + Fin.append (f₂CubeOfNat 9 1) (f₂CubeOfNat 4 2) := by decide +private theorem direction2049_append : f₂CubeOfNat 13 2049 = + Fin.append (f₂CubeOfNat 9 1) (f₂CubeOfNat 4 4) := by decide +private theorem direction4097_append : f₂CubeOfNat 13 4097 = + Fin.append (f₂CubeOfNat 9 1) (f₂CubeOfNat 4 8) := by decide + +private theorem bentAutocorrelation1 : + autocorrelation MaitraKavutYucel.bentFunction4 (f₂CubeOfNat 4 1) = 0 := by + rw [autocorrelation_eq_two_pow_sub_two_derivative_weight, + hammingWeight_eq_fastWeight, bent1_certificate] + norm_num + +private theorem bentAutocorrelation2 : + autocorrelation MaitraKavutYucel.bentFunction4 (f₂CubeOfNat 4 2) = 0 := by + rw [autocorrelation_eq_two_pow_sub_two_derivative_weight, + hammingWeight_eq_fastWeight, bent2_certificate] + norm_num + +private theorem bentAutocorrelation4 : + autocorrelation MaitraKavutYucel.bentFunction4 (f₂CubeOfNat 4 4) = 0 := by + rw [autocorrelation_eq_two_pow_sub_two_derivative_weight, + hammingWeight_eq_fastWeight, bent4_certificate] + norm_num + +private theorem bentAutocorrelation8 : + autocorrelation MaitraKavutYucel.bentFunction4 (f₂CubeOfNat 4 8) = 0 := by + rw [autocorrelation_eq_two_pow_sub_two_derivative_weight, + hammingWeight_eq_fastWeight, bent8_certificate] + norm_num + +private theorem initialAutocorrelation33 : + autocorrelation MaitraKavutYucel.initialFunction13 (f₂CubeOfNat 13 33) = 0 := by + rw [direction33_append, MaitraKavutYucel.initialFunction13, + autocorrelation_booleanDirectSum_append, + autocorrelation_eq_two_pow_sub_two_derivative_weight, + hammingWeight_eq_fastWeight, seed33_certificate] + norm_num + +private theorem initialAutocorrelation68 : + autocorrelation MaitraKavutYucel.initialFunction13 (f₂CubeOfNat 13 68) = 0 := by + rw [direction68_append, MaitraKavutYucel.initialFunction13, + autocorrelation_booleanDirectSum_append, + autocorrelation_eq_two_pow_sub_two_derivative_weight, + hammingWeight_eq_fastWeight, seed68_certificate] + norm_num + +private theorem initialAutocorrelation79 : + autocorrelation MaitraKavutYucel.initialFunction13 (f₂CubeOfNat 13 79) = 0 := by + rw [direction79_append, MaitraKavutYucel.initialFunction13, + autocorrelation_booleanDirectSum_append, + autocorrelation_eq_two_pow_sub_two_derivative_weight, + hammingWeight_eq_fastWeight, seed79_certificate] + norm_num + +private theorem initialAutocorrelation109 : + autocorrelation MaitraKavutYucel.initialFunction13 (f₂CubeOfNat 13 109) = 0 := by + rw [direction109_append, MaitraKavutYucel.initialFunction13, + autocorrelation_booleanDirectSum_append, + autocorrelation_eq_two_pow_sub_two_derivative_weight, + hammingWeight_eq_fastWeight, seed109_certificate] + norm_num + +private theorem initialAutocorrelation115 : + autocorrelation MaitraKavutYucel.initialFunction13 (f₂CubeOfNat 13 115) = 0 := by + rw [direction115_append, MaitraKavutYucel.initialFunction13, + autocorrelation_booleanDirectSum_append, + autocorrelation_eq_two_pow_sub_two_derivative_weight, + hammingWeight_eq_fastWeight, seed115_certificate] + norm_num + +private theorem initialAutocorrelation118 : + autocorrelation MaitraKavutYucel.initialFunction13 (f₂CubeOfNat 13 118) = 0 := by + rw [direction118_append, MaitraKavutYucel.initialFunction13, + autocorrelation_booleanDirectSum_append, + autocorrelation_eq_two_pow_sub_two_derivative_weight, + hammingWeight_eq_fastWeight, seed118_certificate] + norm_num + +private theorem initialAutocorrelation136 : + autocorrelation MaitraKavutYucel.initialFunction13 (f₂CubeOfNat 13 136) = 0 := by + rw [direction136_append, MaitraKavutYucel.initialFunction13, + autocorrelation_booleanDirectSum_append, + autocorrelation_eq_two_pow_sub_two_derivative_weight, + hammingWeight_eq_fastWeight, seed136_certificate] + norm_num + +private theorem initialAutocorrelation138 : + autocorrelation MaitraKavutYucel.initialFunction13 (f₂CubeOfNat 13 138) = 0 := by + rw [direction138_append, MaitraKavutYucel.initialFunction13, + autocorrelation_booleanDirectSum_append, + autocorrelation_eq_two_pow_sub_two_derivative_weight, + hammingWeight_eq_fastWeight, seed138_certificate] + norm_num + +private theorem initialAutocorrelation264 : + autocorrelation MaitraKavutYucel.initialFunction13 (f₂CubeOfNat 13 264) = 0 := by + rw [direction264_append, MaitraKavutYucel.initialFunction13, + autocorrelation_booleanDirectSum_append, + autocorrelation_eq_two_pow_sub_two_derivative_weight, + hammingWeight_eq_fastWeight, seed264_certificate] + norm_num + +private theorem initialAutocorrelation513 : + autocorrelation MaitraKavutYucel.initialFunction13 (f₂CubeOfNat 13 513) = 0 := by + rw [direction513_append, MaitraKavutYucel.initialFunction13, + autocorrelation_booleanDirectSum_append, bentAutocorrelation1] + norm_num + +private theorem initialAutocorrelation1025 : + autocorrelation MaitraKavutYucel.initialFunction13 (f₂CubeOfNat 13 1025) = 0 := by + rw [direction1025_append, MaitraKavutYucel.initialFunction13, + autocorrelation_booleanDirectSum_append, bentAutocorrelation2] + norm_num + +private theorem initialAutocorrelation2049 : + autocorrelation MaitraKavutYucel.initialFunction13 (f₂CubeOfNat 13 2049) = 0 := by + rw [direction2049_append, MaitraKavutYucel.initialFunction13, + autocorrelation_booleanDirectSum_append, bentAutocorrelation4] + norm_num + +private theorem initialAutocorrelation4097 : + autocorrelation MaitraKavutYucel.initialFunction13 (f₂CubeOfNat 13 4097) = 0 := by + rw [direction4097_append, MaitraKavutYucel.initialFunction13, + autocorrelation_booleanDirectSum_append, bentAutocorrelation8] + norm_num + +private theorem initialAutocorrelation_basisNatIndex (i : Fin 13) : + autocorrelation MaitraKavutYucel.initialFunction13 + (f₂CubeOfNat 13 (maitraKavutYucelZeroAutocorrelationBasisNatIndex i)) = 0 := by + fin_cases i + · simpa [maitraKavutYucelZeroAutocorrelationBasisNatIndex] using + initialAutocorrelation33 + · simpa [maitraKavutYucelZeroAutocorrelationBasisNatIndex] using + initialAutocorrelation68 + · simpa [maitraKavutYucelZeroAutocorrelationBasisNatIndex] using + initialAutocorrelation79 + · simpa [maitraKavutYucelZeroAutocorrelationBasisNatIndex] using + initialAutocorrelation109 + · simpa [maitraKavutYucelZeroAutocorrelationBasisNatIndex] using + initialAutocorrelation115 + · simpa [maitraKavutYucelZeroAutocorrelationBasisNatIndex] using + initialAutocorrelation118 + · simpa [maitraKavutYucelZeroAutocorrelationBasisNatIndex] using + initialAutocorrelation136 + · simpa [maitraKavutYucelZeroAutocorrelationBasisNatIndex] using + initialAutocorrelation138 + · simpa [maitraKavutYucelZeroAutocorrelationBasisNatIndex] using + initialAutocorrelation264 + · simpa [maitraKavutYucelZeroAutocorrelationBasisNatIndex] using + initialAutocorrelation513 + · simpa [maitraKavutYucelZeroAutocorrelationBasisNatIndex] using + initialAutocorrelation1025 + · simpa [maitraKavutYucelZeroAutocorrelationBasisNatIndex] using + initialAutocorrelation2049 + · simpa [maitraKavutYucelZeroAutocorrelationBasisNatIndex] using + initialAutocorrelation4097 + +private theorem maitraKavutYucelInitialAutocorrelation_zero (i : Fin 13) : + autocorrelation MaitraKavutYucel.initialFunction13 + (maitraKavutYucelZeroAutocorrelationBasis i) = 0 := by + rw [maitraKavutYucelZeroAutocorrelationBasis_eq_f₂CubeOfNat] + exact initialAutocorrelation_basisNatIndex i + +private theorem maitraKavutYucelZeroAutocorrelationBasis_zero (i : Fin 13) : + autocorrelation maitraKavutYucelFunction13 + (maitraKavutYucelZeroAutocorrelationBasis i) = 0 := by + rw [maitraKavutYucelFunction13, + autocorrelation_flipOn_of_isolated + MaitraKavutYucel.initialFunction13 MaitraKavutYucel.flipPoints13 + (maitraKavutYucelZeroAutocorrelationBasis i) + (maitraKavutYucelZeroAutocorrelationBasis_isolated i), + maitraKavutYucelInitialAutocorrelation_zero i, + maitraKavutYucelZeroAutocorrelationBasis_flipCorrection i] + norm_num + +/-- The linear input reindexing determined by the certified +zero-autocorrelation basis. -/ +noncomputable def maitraKavutYucelPCOneReindex : + FABL.F₂Cube 13 ≃ₗ[FABL.𝔽₂] FABL.F₂Cube 13 := + (Pi.basisFun FABL.𝔽₂ (Fin 13)).equiv + (basisOfLinearIndependentOfCardEqFinrank' + maitraKavutYucelZeroAutocorrelationBasis + maitraKavutYucelZeroAutocorrelationBasis_independent (by + simp [Module.finrank_fintype_fun_eq_card])) + (Equiv.refl (Fin 13)) + +private theorem maitraKavutYucelPCOneReindex_single (i : Fin 13) : + maitraKavutYucelPCOneReindex (FABL.f₂CubeOfFinset {i}) = + maitraKavutYucelZeroAutocorrelationBasis i := by + have hsingle : FABL.f₂CubeOfFinset {i} = + (Pi.basisFun FABL.𝔽₂ (Fin 13)) i := by + ext j + simp [FABL.f₂CubeOfFinset, Pi.single_apply] + rw [hsingle] + unfold maitraKavutYucelPCOneReindex + rw [Basis.equiv_apply] + simp + +/-- The reindexed thirteen-variable seed. -/ +noncomputable def maitraKavutYucelPCOneFunction13 : BooleanFunction 13 := + maitraKavutYucelFunction13 ∘ maitraKavutYucelPCOneReindex + +private theorem f₂Support_nonempty_of_ne_zero + (u : FABL.F₂Cube n) (hu : u ≠ 0) : + (FABL.f₂Support u).Nonempty := by + rw [Finset.nonempty_iff_ne_empty] + intro hsupport + apply hu + apply (FABL.f₂CubeEquivFinset n).injective + change FABL.f₂Support u = FABL.f₂Support (0 : FABL.F₂Cube n) + rw [hsupport] + ext i + simp [FABL.f₂Support] + +/-- The reindexed thirteen-variable seed satisfies `PC(1)`. -/ +theorem satisfiesPropagationCriterion_one_maitraKavutYucelPCOneFunction13 : + SatisfiesPropagationCriterion 1 maitraKavutYucelPCOneFunction13 := by + rw [satisfiesPropagationCriterion_iff_autocorrelation_eq_zero] + intro a ha hweight + have hcard : (FABL.f₂Support a).card = 1 := + Nat.le_antisymm hweight + (Finset.card_pos.mpr (f₂Support_nonempty_of_ne_zero a ha)) + obtain ⟨i, hi⟩ := Finset.card_eq_one.mp hcard + have ha_single : a = FABL.f₂CubeOfFinset {i} := by + apply (FABL.f₂CubeEquivFinset 13).injective + simpa [hi] using + ((FABL.f₂CubeEquivFinset 13).right_inv ({i} : Finset (Fin 13))).symm + subst a + rw [maitraKavutYucelPCOneFunction13] + change autocorrelation + (maitraKavutYucelFunction13 ∘ maitraKavutYucelPCOneReindex.toAffineEquiv) + (FABL.f₂CubeOfFinset {i}) = 0 + rw [ + autocorrelation_comp_affineEquiv maitraKavutYucelFunction13 + maitraKavutYucelPCOneReindex.toAffineEquiv] + change autocorrelation maitraKavutYucelFunction13 + (maitraKavutYucelPCOneReindex (FABL.f₂CubeOfFinset {i})) = 0 + rw [maitraKavutYucelPCOneReindex_single] + exact maitraKavutYucelZeroAutocorrelationBasis_zero i + +/-- Linear reindexing preserves the seed's nonlinearity. -/ +theorem nonlinearity_maitraKavutYucelPCOneFunction13 : + nonlinearity maitraKavutYucelPCOneFunction13 = 4036 := by + rw [maitraKavutYucelPCOneFunction13] + change nonlinearity + (maitraKavutYucelFunction13 ∘ maitraKavutYucelPCOneReindex.toAffineEquiv) = 4036 + rw [ + nonlinearity_comp_affineEquiv maitraKavutYucelFunction13 + maitraKavutYucelPCOneReindex.toAffineEquiv, + nonlinearity_maitraKavutYucelFunction13] + +private theorem card_f₂Support_left_le_append + {k l : ℕ} (a : FABL.F₂Cube k) (b : FABL.F₂Cube l) : + (FABL.f₂Support a).card ≤ + (FABL.f₂Support (Fin.append a b)).card := by + apply Finset.card_le_card_of_injOn (Fin.castAdd l) + · intro i hi + exact (FABL.mem_f₂Support _ _).2 (by + rw [Fin.append_left] + exact (FABL.mem_f₂Support _ _).1 hi) + · exact (Fin.castAdd_injective k l).injOn + +private theorem card_f₂Support_right_le_append + {k l : ℕ} (a : FABL.F₂Cube k) (b : FABL.F₂Cube l) : + (FABL.f₂Support b).card ≤ + (FABL.f₂Support (Fin.append a b)).card := by + apply Finset.card_le_card_of_injOn (Fin.natAdd k) + · intro i hi + exact (FABL.mem_f₂Support _ _).2 (by + rw [Fin.append_right] + exact (FABL.mem_f₂Support _ _).1 hi) + · exact (Fin.natAdd_injective l k).injOn + +/-- Boolean direct sums preserve `PC(1)`. -/ +theorem satisfiesPropagationCriterion_one_booleanDirectSum + {k l : ℕ} (f : BooleanFunction k) (g : BooleanFunction l) + (hf : SatisfiesPropagationCriterion 1 f) + (hg : SatisfiesPropagationCriterion 1 g) : + SatisfiesPropagationCriterion 1 (booleanDirectSum f g) := by + rw [satisfiesPropagationCriterion_iff_autocorrelation_eq_zero] + intro d hd hweight + let p := (Fin.appendEquiv k l).symm d + have hp : Fin.append p.1 p.2 = d := + (Fin.appendEquiv k l).apply_symm_apply d + rw [← hp, autocorrelation_booleanDirectSum_append] + rw [satisfiesPropagationCriterion_iff_autocorrelation_eq_zero] at hf hg + by_cases hleft : p.1 = 0 + · have hright : p.2 ≠ 0 := by + intro hright + apply hd + rw [← hp, hleft, hright] + funext i + exact Fin.addCases (fun j ↦ by simp) (fun j ↦ by simp) i + have hrightWeight : (FABL.f₂Support p.2).card ≤ 1 := + (card_f₂Support_right_le_append p.1 p.2).trans (by + simpa [hp] using hweight) + rw [hg p.2 hright hrightWeight, mul_zero] + · have hleftWeight : (FABL.f₂Support p.1).card ≤ 1 := + (card_f₂Support_left_le_append p.1 p.2).trans (by + simpa [hp] using hweight) + rw [hf p.1 hleft hleftWeight, zero_mul] + +private theorem satisfiesPropagationCriterion_one_innerProductModTwoBit + (m : ℕ) : + SatisfiesPropagationCriterion 1 + (FABL.innerProductModTwoBit : BooleanFunction (m + m)) := by + rw [satisfiesPropagationCriterion_iff_autocorrelation_eq_zero] + intro a ha _hweight + have hbent : + IsBent (FABL.innerProductModTwoBit : BooleanFunction (m + m)) := by + change FABL.IsBent (FABL.innerProductModTwo m) + exact FABL.isBent_innerProductModTwo m + have hindicator : + absoluteIndicator + (FABL.innerProductModTwoBit : BooleanFunction (m + m)) = 0 := + (absoluteIndicator_eq_zero_iff_isBent _).2 hbent + have hle := abs_autocorrelation_le_absoluteIndicator + (FABL.innerProductModTwoBit : BooleanFunction (m + m)) ha + rw [hindicator] at hle + exact abs_eq_zero.mp (le_antisymm hle (abs_nonneg _)) + +/-- Complete inner-product bent extensions preserve `PC(1)`. -/ +theorem satisfiesPropagationCriterion_one_completeBentExtension + {k : ℕ} (f : BooleanFunction k) (m : ℕ) + (hf : SatisfiesPropagationCriterion 1 f) : + SatisfiesPropagationCriterion 1 (completeBentExtension f m) := by + exact satisfiesPropagationCriterion_one_booleanDirectSum + f FABL.innerProductModTwoBit hf + (satisfiesPropagationCriterion_one_innerProductModTwoBit m) + +/-- The `PC(1)` Maitra--Kavut--Yücel seed completed by `m` inner-product +bent pairs. -/ +noncomputable def maitraKavutYucelPCOneBentExtension (m : ℕ) : + BooleanFunction (13 + (m + m)) := + completeBentExtension maitraKavutYucelPCOneFunction13 m + +/-- Every complete bent extension of the reindexed seed satisfies `PC(1)`. -/ +theorem satisfiesPropagationCriterion_one_maitraKavutYucelPCOneBentExtension + (m : ℕ) : + SatisfiesPropagationCriterion 1 + (maitraKavutYucelPCOneBentExtension m) := by + exact satisfiesPropagationCriterion_one_completeBentExtension + maitraKavutYucelPCOneFunction13 m + satisfiesPropagationCriterion_one_maitraKavutYucelPCOneFunction13 + +private theorem maxWalshMagnitude_maitraKavutYucelPCOneFunction13 : + maxWalshMagnitude maitraKavutYucelPCOneFunction13 = 120 := by + have hrelation := + two_mul_nonlinearity_add_maxWalshMagnitude + maitraKavutYucelPCOneFunction13 + rw [nonlinearity_maitraKavutYucelPCOneFunction13] at hrelation + norm_num at hrelation ⊢ + omega + +/-- The exact maximum Walsh magnitude of every complete bent extension. -/ +theorem maxWalshMagnitude_maitraKavutYucelPCOneBentExtension + (m : ℕ) : + maxWalshMagnitude (maitraKavutYucelPCOneBentExtension m) = + 120 * 2 ^ m := by + rw [maitraKavutYucelPCOneBentExtension, + maxWalshMagnitude_completeBentExtension, + maxWalshMagnitude_maitraKavutYucelPCOneFunction13] + +/-- The exact nonlinearity of every complete bent extension. -/ +theorem nonlinearity_maitraKavutYucelPCOneBentExtension + (m : ℕ) : + nonlinearity (maitraKavutYucelPCOneBentExtension m) = + 2 ^ (12 + (m + m)) - 60 * 2 ^ m := by + have hrelation := two_mul_nonlinearity_add_maxWalshMagnitude + (maitraKavutYucelPCOneBentExtension m) + rw [maxWalshMagnitude_maitraKavutYucelPCOneBentExtension] at hrelation + have hpow : 2 ^ (13 + (m + m)) = 2 * 2 ^ (12 + (m + m)) := by + rw [show 13 + (m + m) = (12 + (m + m)) + 1 by omega, pow_succ] + ring + rw [hpow] at hrelation + omega + +/-- The complete bent extensions strictly exceed the odd-dimensional +quadratic nonlinearity bound. -/ +theorem quadraticBound_lt_nonlinearity_maitraKavutYucelPCOneBentExtension + (m : ℕ) : + 2 ^ (12 + (m + m)) - 2 ^ (6 + m) < + nonlinearity (maitraKavutYucelPCOneBentExtension m) := by + rw [nonlinearity_maitraKavutYucelPCOneBentExtension] + have hsmall : 60 * 2 ^ m < 64 * 2 ^ m := by + have hpositive : 0 < 2 ^ m := Nat.pow_pos (by omega) + omega + have hsix : 2 ^ (6 + m) = 64 * 2 ^ m := by + rw [pow_add] + norm_num + have hlarge : 64 * 2 ^ m ≤ 2 ^ (12 + (m + m)) := by + rw [← hsix] + exact Nat.pow_le_pow_right (by omega) (by omega) + rw [hsix] + exact Nat.sub_lt_sub_left (hsmall.trans_le hlarge) hsmall + +/-- For every odd dimension at least thirteen, some Boolean function satisfies +`PC(1)` and has nonlinearity strictly above the quadratic bound. -/ +theorem exists_pc_one_nonlinearity_gt_quadraticBound_of_odd + {n : ℕ} (hn : Odd n) (hn13 : 13 ≤ n) : + ∃ f : BooleanFunction n, SatisfiesPropagationCriterion 1 f ∧ + 2 ^ (n - 1) - 2 ^ ((n - 1) / 2) < nonlinearity f := by + obtain ⟨k, hk⟩ := hn + have hk6 : 6 ≤ k := by omega + let m := k - 6 + have hnform : n = 13 + (m + m) := by + dsimp [m] + omega + rw [hnform] + refine ⟨maitraKavutYucelPCOneBentExtension m, + satisfiesPropagationCriterion_one_maitraKavutYucelPCOneBentExtension m, ?_⟩ + have hsub : 13 + (m + m) - 1 = 12 + (m + m) := by omega + have hhalf : (12 + (m + m)) / 2 = 6 + m := by omega + simpa only [hsub, hhalf] using + quadraticBound_lt_nonlinearity_maitraKavutYucelPCOneBentExtension m + +end CryptBoolean diff --git a/CryptBoolean/Carlet/Chapter04/RandomNonlinearityAsymptotics.lean b/CryptBoolean/Carlet/Chapter04/RandomNonlinearityAsymptotics.lean new file mode 100644 index 0000000..0a14ab6 --- /dev/null +++ b/CryptBoolean/Carlet/Chapter04/RandomNonlinearityAsymptotics.lean @@ -0,0 +1,707 @@ +/- +Copyright (c) 2026 Asher Yan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Asher Yan with Codex +-/ +module + +public import CryptBoolean.Carlet.Chapter04.Nonlinearity +public import FABL.Chapter05.RandomBooleanFourierMaximum +public import FABL.Chapter06.F₂Polynomials.Encoding +public import Mathlib.Analysis.SpecificLimits.Normed + +/-! +# Carlet Chapter 4 random nonlinearity asymptotics + +The Olejár--Stanek asymptotic lower bound and the Hoeffding side of Rodier's +sharp random-function interval. +-/ + +open Finset MeasureTheory ProbabilityTheory Set +open scoped BigOperators BooleanCube ENNReal Topology + +@[expose] public section + +namespace CryptBoolean + +variable {n : ℕ} + +local instance randomNonlinearitySignMeasurableSpace : MeasurableSpace FABL.Sign := ⊤ + +local instance randomNonlinearitySignMeasurableSingletonClass : + MeasurableSingletonClass FABL.Sign where + measurableSet_singleton _ := by simp + +/-- The normalized Fourier threshold corresponding to Carlet's displayed +nonlinearity threshold. -/ +noncomputable def carletRandomFourierThreshold (n : ℕ) : ℝ := + Real.sqrt (2 * (n : ℝ)) * (2 : ℝ) ^ (-(n : ℝ) / 2) + +/-- Carlet's displayed lower threshold +`2^(n-1) - sqrt(n) * 2^((n-1)/2)`, in an algebraically convenient form. -/ +noncomputable def carletRandomNonlinearityThreshold (n : ℕ) : ℝ := + (2 : ℝ) ^ n / 2 - + (2 : ℝ) ^ n * carletRandomFourierThreshold n / 2 + +/-- The implementation threshold is exactly Carlet's typography +`2^(n-1) - sqrt(n) * 2^((n-1)/2)`. -/ +theorem carletRandomNonlinearityThreshold_eq_displayed (n : ℕ) : + carletRandomNonlinearityThreshold n = + (2 : ℝ) ^ ((n : ℝ) - 1) - + Real.sqrt (n : ℝ) * (2 : ℝ) ^ (((n : ℝ) - 1) / 2) := by + have hfirst : + (2 : ℝ) ^ n / 2 = (2 : ℝ) ^ ((n : ℝ) - 1) := by + rw [← Real.rpow_natCast] + simpa using + (Real.rpow_sub (x := (2 : ℝ)) (by norm_num : (0 : ℝ) < 2) + (n : ℝ) 1).symm + have hsqrt : + Real.sqrt (2 * (n : ℝ)) = + (2 : ℝ) ^ (1 / 2 : ℝ) * Real.sqrt (n : ℝ) := by + calc + Real.sqrt (2 * (n : ℝ)) = + Real.sqrt 2 * Real.sqrt (n : ℝ) := + Real.sqrt_mul (by norm_num : (0 : ℝ) ≤ 2) _ + _ = (2 : ℝ) ^ (1 / 2 : ℝ) * Real.sqrt (n : ℝ) := by + rw [Real.sqrt_eq_rpow] + have hpow : + (2 : ℝ) ^ (n : ℝ) * (2 : ℝ) ^ (1 / 2 : ℝ) * + (2 : ℝ) ^ (-(n : ℝ) / 2) * (2 : ℝ) ^ (-1 : ℝ) = + (2 : ℝ) ^ (((n : ℝ) - 1) / 2) := by + rw [← Real.rpow_add (by norm_num : (0 : ℝ) < 2), + ← Real.rpow_add (by norm_num : (0 : ℝ) < 2), + ← Real.rpow_add (by norm_num : (0 : ℝ) < 2)] + congr 1 + ring + have hdelta : + (2 : ℝ) ^ n * carletRandomFourierThreshold n / 2 = + Real.sqrt (n : ℝ) * (2 : ℝ) ^ (((n : ℝ) - 1) / 2) := by + rw [carletRandomFourierThreshold, hsqrt, ← Real.rpow_natCast, + div_eq_mul_inv, ← Real.rpow_neg_one] + calc + (2 : ℝ) ^ (n : ℝ) * + ((2 : ℝ) ^ (1 / 2 : ℝ) * Real.sqrt (n : ℝ) * + (2 : ℝ) ^ (-(n : ℝ) / 2)) * + (2 : ℝ) ^ (-1 : ℝ) = + Real.sqrt (n : ℝ) * + ((2 : ℝ) ^ (n : ℝ) * (2 : ℝ) ^ (1 / 2 : ℝ) * + (2 : ℝ) ^ (-(n : ℝ) / 2) * (2 : ℝ) ^ (-1 : ℝ)) := by + ring + _ = Real.sqrt (n : ℝ) * + (2 : ℝ) ^ (((n : ℝ) - 1) / 2) := by + rw [hpow] + rw [carletRandomNonlinearityThreshold, hfirst, hdelta] + +private def randomNonlinearityParitySign + (S : Finset (Fin n)) (x : {−1,1}^[n]) : FABL.Sign := + ∏ i ∈ S, x i + +private theorem signValue_randomNonlinearityParitySign + (S : Finset (Fin n)) (x : {−1,1}^[n]) : + FABL.signValue (randomNonlinearityParitySign S x) = FABL.monomial S x := by + simp [randomNonlinearityParitySign, FABL.monomial, FABL.signValue] + +private theorem signValue_mul (a b : FABL.Sign) : + FABL.signValue (a * b) = FABL.signValue a * FABL.signValue b := by + simp [FABL.signValue] + +private noncomputable def randomNonlinearityCoefficientSampleEquiv + (n : ℕ) (S : Finset (Fin n)) : + FABL.BooleanFunction n ≃ + (Fin (Fintype.card ({−1,1}^[n])) → FABL.Sign) := + (Equiv.arrowCongr + (Fintype.equivFin ({−1,1}^[n])) (Equiv.refl FABL.Sign)).trans + (Equiv.mulRight fun i ↦ + randomNonlinearityParitySign S + ((Fintype.equivFin ({−1,1}^[n])).symm i)) + +private theorem finiteUniformEmpiricalMean_randomNonlinearityCoefficientSampleEquiv + (S : Finset (Fin n)) (f : FABL.BooleanFunction n) : + FABL.finiteUniformEmpiricalMean FABL.signValue + (randomNonlinearityCoefficientSampleEquiv n S f) = + FABL.fourierCoeff f.toReal S := by + classical + rw [FABL.fourierCoeff, Fintype.expect_eq_sum_div_card] + unfold FABL.finiteUniformEmpiricalMean + congr 1 + symm + apply Fintype.sum_equiv (Fintype.equivFin ({−1,1}^[n])) + intro x + simp [randomNonlinearityCoefficientSampleEquiv, Equiv.arrowCongr, + FABL.BooleanFunction.toReal, signValue_mul, + signValue_randomNonlinearityParitySign] + +private theorem expect_signValue_eq_zero : + Finset.expect Finset.univ FABL.signValue = 0 := by + rw [Fintype.expect_eq_sum_div_card] + norm_num [FABL.Sign, FABL.signValue] + +private theorem signValue_mem_Icc (s : FABL.Sign) : + FABL.signValue s ∈ Set.Icc (-1 : ℝ) 1 := by + rcases Int.units_eq_one_or s with rfl | rfl <;> simp [FABL.signValue] + +private theorem measure_fourierCoeff_ge_le + (S : Finset (Fin n)) (ε : ℝ) (hε : 0 ≤ ε) : + (FABL.uniformPMF (FABL.BooleanFunction n)).toMeasure.real + {f | ε ≤ |FABL.fourierCoeff f.toReal S|} ≤ + 2 * Real.exp + (-(Fintype.card ({−1,1}^[n]) : ℝ) * ε ^ 2 / 2) := by + classical + let m := Fintype.card ({−1,1}^[n]) + let e := randomNonlinearityCoefficientSampleEquiv n S + let failure : Set (Fin m → FABL.Sign) := + {samples | ε ≤ |FABL.finiteUniformEmpiricalMean FABL.signValue samples|} + have h := + FABL.measure_finiteUniformEmpiricalMean_sub_expect_ge_le + FABL.signValue signValue_mem_Icc (m := m) Fintype.card_pos ε hε + rw [expect_signValue_eq_zero] at h + simp only [sub_zero] at h + change (FABL.uniformPMF (Fin m → FABL.Sign)).toMeasure.real failure ≤ _ at h + have hmap : + (FABL.uniformPMF (FABL.BooleanFunction n)).map e = + FABL.uniformPMF (Fin m → FABL.Sign) := + FABL.map_uniformPMF_equiv e + rw [← hmap] at h + have hmeasure : + ((FABL.uniformPMF (FABL.BooleanFunction n)).map e).toMeasure.real failure = + (FABL.uniformPMF (FABL.BooleanFunction n)).toMeasure.real (e ⁻¹' failure) := by + exact congrArg ENNReal.toReal + (PMF.toMeasure_map_apply e _ failure (measurable_of_finite e) + (Set.toFinite failure).measurableSet) + rw [hmeasure] at h + simpa [m, e, failure, + finiteUniformEmpiricalMean_randomNonlinearityCoefficientSampleEquiv] using h + +theorem carletRandomFourierThreshold_nonneg (n : ℕ) : + 0 ≤ carletRandomFourierThreshold n := by + unfold carletRandomFourierThreshold + exact mul_nonneg (Real.sqrt_nonneg _) + (Real.rpow_nonneg (by norm_num) _) + +theorem card_mul_carletRandomFourierThreshold_sq_div_two (n : ℕ) : + (Fintype.card ({−1,1}^[n]) : ℝ) * + carletRandomFourierThreshold n ^ 2 / 2 = (n : ℝ) := by + have hcard : + (Fintype.card ({−1,1}^[n]) : ℝ) = (2 : ℝ) ^ n := by + norm_num [Fintype.card_pi, FABL.Sign] + have hsqrt : Real.sqrt (2 * (n : ℝ)) ^ 2 = 2 * (n : ℝ) := + Real.sq_sqrt (by positivity) + have hrpow : + ((2 : ℝ) ^ (-(n : ℝ) / 2)) ^ 2 = ((2 : ℝ) ^ n)⁻¹ := by + calc + ((2 : ℝ) ^ (-(n : ℝ) / 2)) ^ 2 = + (2 : ℝ) ^ ((-(n : ℝ) / 2) * (2 : ℕ)) := + (Real.rpow_mul_natCast (x := (2 : ℝ)) + (by norm_num : (0 : ℝ) ≤ 2) (-(n : ℝ) / 2) 2).symm + _ = (2 : ℝ) ^ (-(n : ℝ)) := by + congr 1 + norm_num + _ = ((2 : ℝ) ^ n)⁻¹ := by + simpa only [Real.rpow_natCast] using + (Real.rpow_neg (x := (2 : ℝ)) + (by norm_num : (0 : ℝ) ≤ 2) (n : ℝ)) + rw [hcard, carletRandomFourierThreshold, mul_pow, hsqrt, hrpow] + field_simp + +private theorem fourierMaximumBad_subset (n : ℕ) (ε : ℝ) : + {f : FABL.BooleanFunction n | ε ≤ FABL.fourierInfinityNorm f.toReal} ⊆ + ⋃ S : Finset (Fin n), + {f : FABL.BooleanFunction n | + ε ≤ |FABL.fourierCoeff f.toReal S|} := by + intro f hf + change ε ≤ + Finset.univ.sup' Finset.univ_nonempty + (fun S : Finset (Fin n) ↦ |FABL.fourierCoeff f.toReal S|) at hf + rw [Finset.le_sup'_iff] at hf + obtain ⟨S, _, hS⟩ := hf + exact Set.mem_iUnion.2 ⟨S, hS⟩ + +private theorem measure_fourierInfinityNorm_ge_le + (n : ℕ) (ε : ℝ) (hε : 0 ≤ ε) : + (FABL.uniformPMF (FABL.BooleanFunction n)).toMeasure.real + {f | ε ≤ FABL.fourierInfinityNorm f.toReal} ≤ + (2 : ℝ) ^ n * + (2 * Real.exp + (-(Fintype.card ({−1,1}^[n]) : ℝ) * ε ^ 2 / 2)) := by + have hcard : + (Fintype.card (Finset (Fin n)) : ℝ) = (2 : ℝ) ^ n := by + norm_num [Fintype.card_finset] + calc + (FABL.uniformPMF (FABL.BooleanFunction n)).toMeasure.real + {f | ε ≤ FABL.fourierInfinityNorm f.toReal} ≤ + (FABL.uniformPMF (FABL.BooleanFunction n)).toMeasure.real + (⋃ S : Finset (Fin n), + {f : FABL.BooleanFunction n | + ε ≤ |FABL.fourierCoeff f.toReal S|}) := + measureReal_mono (fourierMaximumBad_subset n ε) + _ ≤ ∑ S : Finset (Fin n), + (FABL.uniformPMF (FABL.BooleanFunction n)).toMeasure.real + {f : FABL.BooleanFunction n | + ε ≤ |FABL.fourierCoeff f.toReal S|} := + measureReal_iUnion_fintype_le _ + _ ≤ ∑ _S : Finset (Fin n), + 2 * Real.exp + (-(Fintype.card ({−1,1}^[n]) : ℝ) * ε ^ 2 / 2) := by + apply Finset.sum_le_sum + intro S _ + exact measure_fourierCoeff_ge_le S ε hε + _ = (Fintype.card (Finset (Fin n)) : ℝ) * + (2 * Real.exp + (-(Fintype.card ({−1,1}^[n]) : ℝ) * ε ^ 2 / 2)) := by + simp [nsmul_eq_mul] + _ = (2 : ℝ) ^ n * + (2 * Real.exp + (-(Fintype.card ({−1,1}^[n]) : ℝ) * ε ^ 2 / 2)) := by + rw [hcard] + +/-- The finite Hoeffding--union-bound estimate at the exact threshold needed by +Carlet's asymptotic nonlinearity statement. -/ +theorem measure_fourierInfinityNorm_ge_carletThreshold_le (n : ℕ) : + (FABL.uniformPMF (FABL.BooleanFunction n)).toMeasure.real + {f | carletRandomFourierThreshold n ≤ + FABL.fourierInfinityNorm f.toReal} ≤ + (2 : ℝ) ^ n * (2 * Real.exp (-(n : ℝ))) := by + have h := measure_fourierInfinityNorm_ge_le n + (carletRandomFourierThreshold n) + (carletRandomFourierThreshold_nonneg n) + rw [show + -(Fintype.card ({−1,1}^[n]) : ℝ) * + carletRandomFourierThreshold n ^ 2 / 2 = -(n : ℝ) by + rw [show + -(Fintype.card ({−1,1}^[n]) : ℝ) * + carletRandomFourierThreshold n ^ 2 / 2 = + -((Fintype.card ({−1,1}^[n]) : ℝ) * + carletRandomFourierThreshold n ^ 2 / 2) by ring, + card_mul_carletRandomFourierThreshold_sq_div_two]] at h + exact h + +/-- Rodier's upper spectral-amplitude threshold, normalized as a FABL Fourier +coefficient. -/ +noncomputable def rodierRandomFourierUpperThreshold (n : ℕ) : ℝ := + Real.sqrt (n : ℝ) * + (Real.sqrt (2 * Real.log 2) + + 4 * Real.log (n : ℝ) / (n : ℝ)) * + (2 : ℝ) ^ (-(n : ℝ) / 2) + +/-- The lower endpoint of Rodier's nonlinearity interval. -/ +noncomputable def rodierRandomNonlinearityLowerThreshold (n : ℕ) : ℝ := + (2 : ℝ) ^ n / 2 - + (2 : ℝ) ^ n * rodierRandomFourierUpperThreshold n / 2 + +/-- Rodier's lower nonlinearity endpoint in the displayed source +normalization. -/ +theorem rodierRandomNonlinearityLowerThreshold_eq_displayed (n : ℕ) : + rodierRandomNonlinearityLowerThreshold n = + (2 : ℝ) ^ ((n : ℝ) - 1) - + (2 : ℝ) ^ ((n : ℝ) / 2 - 1) * Real.sqrt (n : ℝ) * + (Real.sqrt (2 * Real.log 2) + + 4 * Real.log (n : ℝ) / (n : ℝ)) := by + have hfirst : + (2 : ℝ) ^ n / 2 = (2 : ℝ) ^ ((n : ℝ) - 1) := by + rw [← Real.rpow_natCast] + simpa using + (Real.rpow_sub (x := (2 : ℝ)) (by norm_num : (0 : ℝ) < 2) + (n : ℝ) 1).symm + have hscale : + (2 : ℝ) ^ n * (2 : ℝ) ^ (-(n : ℝ) / 2) / 2 = + (2 : ℝ) ^ ((n : ℝ) / 2 - 1) := by + rw [← Real.rpow_natCast, div_eq_mul_inv, ← Real.rpow_neg_one, + ← Real.rpow_add (by norm_num : (0 : ℝ) < 2), + ← Real.rpow_add (by norm_num : (0 : ℝ) < 2)] + congr 1 + ring + rw [rodierRandomNonlinearityLowerThreshold, + rodierRandomFourierUpperThreshold, hfirst] + rw [show + (2 : ℝ) ^ n * + (Real.sqrt (n : ℝ) * + (Real.sqrt (2 * Real.log 2) + + 4 * Real.log (n : ℝ) / (n : ℝ)) * + (2 : ℝ) ^ (-(n : ℝ) / 2)) / + 2 = + ((2 : ℝ) ^ n * (2 : ℝ) ^ (-(n : ℝ) / 2) / 2) * + Real.sqrt (n : ℝ) * + (Real.sqrt (2 * Real.log 2) + + 4 * Real.log (n : ℝ) / (n : ℝ)) by ring, + hscale] + +theorem rodierRandomFourierUpperThreshold_nonneg (n : ℕ) : + 0 ≤ rodierRandomFourierUpperThreshold n := by + unfold rodierRandomFourierUpperThreshold + positivity + +theorem card_mul_rodierRandomFourierUpperThreshold_sq_div_two_ge + {n : ℕ} (hn : 1 ≤ n) : + (n : ℝ) * Real.log 2 + Real.log (n : ℝ) ≤ + (Fintype.card ({−1,1}^[n]) : ℝ) * + rodierRandomFourierUpperThreshold n ^ 2 / 2 := by + have hnpos : (0 : ℝ) < n := by + exact_mod_cast (Nat.zero_lt_of_lt hn) + have hnone : (1 : ℝ) ≤ n := by + exact_mod_cast hn + have hlog : 0 ≤ Real.log (n : ℝ) := Real.log_nonneg hnone + have hc : 1 ≤ Real.sqrt (2 * Real.log 2) := by + rw [Real.one_le_sqrt] + nlinarith [Real.log_two_gt_d9] + have hc' : 1 ≤ Real.sqrt (Real.log 2 * 2) := by + simpa [mul_comm] using hc + have hcard : + (Fintype.card ({−1,1}^[n]) : ℝ) = (2 : ℝ) ^ n := by + norm_num [Fintype.card_pi, FABL.Sign] + have hsqrt : Real.sqrt (n : ℝ) ^ 2 = (n : ℝ) := + Real.sq_sqrt hnpos.le + have hlogsqrt : + Real.sqrt (Real.log 2 * 2) ^ 2 = Real.log 2 * 2 := by + simpa [mul_comm] using + (Real.sq_sqrt (show 0 ≤ 2 * Real.log 2 by positivity)) + have hrpow : + ((2 : ℝ) ^ (-(n : ℝ) / 2)) ^ 2 = ((2 : ℝ) ^ n)⁻¹ := by + calc + ((2 : ℝ) ^ (-(n : ℝ) / 2)) ^ 2 = + (2 : ℝ) ^ ((-(n : ℝ) / 2) * (2 : ℕ)) := + (Real.rpow_mul_natCast (x := (2 : ℝ)) + (by norm_num : (0 : ℝ) ≤ 2) (-(n : ℝ) / 2) 2).symm + _ = (2 : ℝ) ^ (-(n : ℝ)) := by + congr 1 + norm_num + _ = ((2 : ℝ) ^ n)⁻¹ := by + simpa only [Real.rpow_natCast] using + (Real.rpow_neg (x := (2 : ℝ)) + (by norm_num : (0 : ℝ) ≤ 2) (n : ℝ)) + rw [hcard, rodierRandomFourierUpperThreshold, mul_pow, mul_pow, + hsqrt, hrpow] + have hpowpos : (0 : ℝ) < (2 : ℝ) ^ n := by positivity + field_simp + have hcorr : + 0 ≤ 8 * Real.sqrt (Real.log 2 * 2) - 2 := by + nlinarith + have hmain : + 0 ≤ (n : ℝ) * Real.log (n : ℝ) * + (8 * Real.sqrt (Real.log 2 * 2) - 2) + + 16 * Real.log (n : ℝ) ^ 2 := + add_nonneg + (mul_nonneg (mul_nonneg hnpos.le hlog) hcorr) + (mul_nonneg (by norm_num) (sq_nonneg _)) + have hid : + ((n : ℝ) * Real.sqrt (Real.log 2 * 2) + + Real.log (n : ℝ) * 4) ^ 2 - + (n : ℝ) * ((n : ℝ) * Real.log 2 + Real.log (n : ℝ)) * 2 = + (n : ℝ) * Real.log (n : ℝ) * + (8 * Real.sqrt (Real.log 2 * 2) - 2) + + 16 * Real.log (n : ℝ) ^ 2 := by + calc + _ = (n : ℝ) ^ 2 * + (Real.sqrt (Real.log 2 * 2) ^ 2 - Real.log 2 * 2) + + (n : ℝ) * Real.log (n : ℝ) * + (8 * Real.sqrt (Real.log 2 * 2) - 2) + + 16 * Real.log (n : ℝ) ^ 2 := by ring + _ = _ := by rw [hlogsqrt]; ring + exact sub_nonneg.mp (by rw [hid]; exact hmain) + +/-- A finite Hoeffding--union-bound estimate for the easy side of Rodier's +sharp interval. -/ +theorem measure_fourierInfinityNorm_ge_rodierUpperThreshold_le + {n : ℕ} (hn : 1 ≤ n) : + (FABL.uniformPMF (FABL.BooleanFunction n)).toMeasure.real + {f | rodierRandomFourierUpperThreshold n ≤ + FABL.fourierInfinityNorm f.toReal} ≤ + 2 * (n : ℝ)⁻¹ := by + have hnpos : (0 : ℝ) < n := by + exact_mod_cast (Nat.zero_lt_of_lt hn) + have hpow : (2 : ℝ) ^ n = Real.exp ((n : ℝ) * Real.log 2) := by + calc + (2 : ℝ) ^ n = Real.exp (Real.log 2) ^ n := by + rw [Real.exp_log (by norm_num)] + _ = Real.exp ((n : ℝ) * Real.log 2) := + (Real.exp_nat_mul (Real.log 2) n).symm + calc + (FABL.uniformPMF (FABL.BooleanFunction n)).toMeasure.real + {f | rodierRandomFourierUpperThreshold n ≤ + FABL.fourierInfinityNorm f.toReal} ≤ + (2 : ℝ) ^ n * + (2 * Real.exp + (-(Fintype.card ({−1,1}^[n]) : ℝ) * + rodierRandomFourierUpperThreshold n ^ 2 / 2)) := + measure_fourierInfinityNorm_ge_le n + (rodierRandomFourierUpperThreshold n) + (rodierRandomFourierUpperThreshold_nonneg n) + _ ≤ (2 : ℝ) ^ n * + (2 * Real.exp + (-((n : ℝ) * Real.log 2 + Real.log (n : ℝ)))) := by + gcongr + rw [show + -(Fintype.card ({−1,1}^[n]) : ℝ) * + rodierRandomFourierUpperThreshold n ^ 2 / 2 = + -((Fintype.card ({−1,1}^[n]) : ℝ) * + rodierRandomFourierUpperThreshold n ^ 2 / 2) by ring] + exact neg_le_neg <| + card_mul_rodierRandomFourierUpperThreshold_sq_div_two_ge hn + _ = 2 * (n : ℝ)⁻¹ := by + rw [hpow] + calc + Real.exp ((n : ℝ) * Real.log 2) * + (2 * Real.exp + (-((n : ℝ) * Real.log 2 + Real.log (n : ℝ)))) = + 2 * Real.exp + ((n : ℝ) * Real.log 2 - + ((n : ℝ) * Real.log 2 + Real.log (n : ℝ))) := by + rw [show + (n : ℝ) * Real.log 2 - + ((n : ℝ) * Real.log 2 + Real.log (n : ℝ)) = + (n : ℝ) * Real.log 2 + + -((n : ℝ) * Real.log 2 + Real.log (n : ℝ)) by ring, + Real.exp_add] + ring + _ = 2 * (n : ℝ)⁻¹ := by + rw [show + (n : ℝ) * Real.log 2 - + ((n : ℝ) * Real.log 2 + Real.log (n : ℝ)) = + -Real.log (n : ℝ) by ring, + Real.exp_neg, Real.exp_log hnpos] + +/-- A summable-rate surrogate is unnecessary for convergence in probability; +this explicit bound already vanishes. -/ +noncomputable def rodierRandomNonlinearityLowerFailureBound (n : ℕ) : ℝ := + 2 * (n : ℝ)⁻¹ + +theorem tendsto_rodierRandomNonlinearityLowerFailureBound : + Filter.Tendsto rodierRandomNonlinearityLowerFailureBound + Filter.atTop (nhds 0) := by + unfold rodierRandomNonlinearityLowerFailureBound + simpa using + (tendsto_inv_atTop_nhds_zero_nat (𝕜 := ℝ)).const_mul 2 + +/-- The finite failure bound in geometric form. -/ +noncomputable def carletRandomNonlinearityFailureBound (n : ℕ) : ℝ := + 2 * (2 / Real.exp 1) ^ n + +theorem fourier_union_bound_eq_failureBound (n : ℕ) : + (2 : ℝ) ^ n * (2 * Real.exp (-(n : ℝ))) = + carletRandomNonlinearityFailureBound n := by + rw [carletRandomNonlinearityFailureBound] + have hneg : (-(n : ℝ)) = (n : ℝ) * (-1) := by ring + rw [hneg, Real.exp_nat_mul, Real.exp_neg, div_pow] + ring + +theorem tendsto_carletRandomNonlinearityFailureBound : + Filter.Tendsto carletRandomNonlinearityFailureBound + Filter.atTop (nhds 0) := by + have hbase_nonneg : 0 ≤ (2 : ℝ) / Real.exp 1 := by positivity + have hbase_lt : (2 : ℝ) / Real.exp 1 < 1 := by + rw [div_lt_one (Real.exp_pos 1)] + exact Real.exp_one_gt_two + have hpow := tendsto_pow_atTop_nhds_zero_of_lt_one hbase_nonneg hbase_lt + unfold carletRandomNonlinearityFailureBound + simpa using hpow.const_mul 2 + +private theorem binaryFunctionOnSignCube_realSignView_encoding + (g : FABL.BooleanFunction n) : + FABL.binaryFunctionOnSignCube + (realSignView (FABL.booleanFunctionF₂Encoding g)) = g.toReal := by + funext x + unfold FABL.binaryFunctionOnSignCube realSignView + FABL.realSignEncodedFunction FABL.signEncodedFunction + FABL.booleanFunctionF₂Encoding FABL.BooleanFunction.toReal + rw [(FABL.binaryCubeSignEquiv n).apply_symm_apply] + change FABL.signValue + (FABL.binarySignEquiv (FABL.binarySignEquiv.symm (g x))) = + FABL.signValue (g x) + rw [FABL.binarySignEquiv.apply_symm_apply] + +/-- The vector- and subset-indexed Fourier infinity norms agree across the +canonical Boolean-function encoding. -/ +theorem spectralInfinityNorm_encoding_eq_fourierInfinityNorm + (g : FABL.BooleanFunction n) : + FABL.spectralInfinityNorm + (realSignView (FABL.booleanFunctionF₂Encoding g)) = + FABL.fourierInfinityNorm g.toReal := by + classical + unfold FABL.spectralInfinityNorm FABL.fourierInfinityNorm + have hview := binaryFunctionOnSignCube_realSignView_encoding g + apply le_antisymm + · apply Finset.sup'_le + intro γ _ + rw [FABL.vectorFourierCoeff_eq_fourierCoeff_binaryFunctionOnSignCube, + hview] + exact Finset.le_sup' + (fun S : Finset (Fin n) ↦ |FABL.fourierCoeff g.toReal S|) + (Finset.mem_univ (FABL.f₂Support γ)) + · apply Finset.sup'_le + intro S _ + let γ : FABL.F₂Cube n := (FABL.f₂CubeEquivFinset n).symm S + have hsupport : FABL.f₂Support γ = S := + (FABL.f₂CubeEquivFinset n).apply_symm_apply S + calc + |FABL.fourierCoeff g.toReal S| = + |FABL.vectorFourierCoeff + (realSignView (FABL.booleanFunctionF₂Encoding g)) γ| := by + rw [FABL.vectorFourierCoeff_eq_fourierCoeff_binaryFunctionOnSignCube, + hview, hsupport] + _ ≤ Finset.univ.sup' Finset.univ_nonempty + (fun δ : FABL.F₂Cube n ↦ + |FABL.vectorFourierCoeff + (realSignView (FABL.booleanFunctionF₂Encoding g)) δ|) := + Finset.le_sup' + (fun δ : FABL.F₂Cube n ↦ + |FABL.vectorFourierCoeff + (realSignView (FABL.booleanFunctionF₂Encoding g)) δ|) + (Finset.mem_univ γ) + +/-- Relation (35), transported to the uniform sign-cube model used by FABL's +concentration theorem. -/ +theorem nonlinearity_encoding_eq_fourierInfinityNorm + (g : FABL.BooleanFunction n) : + (nonlinearity (FABL.booleanFunctionF₂Encoding g) : ℝ) = + (2 : ℝ) ^ n / 2 - + (2 : ℝ) ^ n * FABL.fourierInfinityNorm g.toReal / 2 := by + rw [nonlinearity_cast_eq_relation_35, + maxWalshMagnitude_cast_eq_spectralInfinityNorm, + spectralInfinityNorm_encoding_eq_fourierInfinityNorm] + +private theorem randomNonlinearityThreshold_lt_of_fourierInfinityNorm_lt + (g : FABL.BooleanFunction n) (ε : ℝ) + (h : FABL.fourierInfinityNorm g.toReal < ε) : + (2 : ℝ) ^ n / 2 - (2 : ℝ) ^ n * ε / 2 < + (nonlinearity (FABL.booleanFunctionF₂Encoding g) : ℝ) := by + rw [nonlinearity_encoding_eq_fourierInfinityNorm] + have hmul := mul_lt_mul_of_pos_left h + (show 0 < (2 : ℝ) ^ n / 2 by positivity) + have hmul' : + (2 : ℝ) ^ n * FABL.fourierInfinityNorm g.toReal / 2 < + (2 : ℝ) ^ n * ε / 2 := by + simpa [div_eq_mul_inv, mul_assoc, mul_left_comm, mul_comm] using hmul + exact sub_lt_sub_left hmul' ((2 : ℝ) ^ n / 2) + +theorem carletRandomNonlinearityThreshold_lt_of_fourierInfinityNorm_lt + (g : FABL.BooleanFunction n) + (h : FABL.fourierInfinityNorm g.toReal < + carletRandomFourierThreshold n) : + carletRandomNonlinearityThreshold n < + (nonlinearity (FABL.booleanFunctionF₂Encoding g) : ℝ) := by + rw [carletRandomNonlinearityThreshold] + exact randomNonlinearityThreshold_lt_of_fourierInfinityNorm_lt g + (carletRandomFourierThreshold n) h + +theorem rodierRandomNonlinearityLowerThreshold_lt_of_fourierInfinityNorm_lt + (g : FABL.BooleanFunction n) + (h : FABL.fourierInfinityNorm g.toReal < + rodierRandomFourierUpperThreshold n) : + rodierRandomNonlinearityLowerThreshold n < + (nonlinearity (FABL.booleanFunctionF₂Encoding g) : ℝ) := by + rw [rodierRandomNonlinearityLowerThreshold] + exact randomNonlinearityThreshold_lt_of_fourierInfinityNorm_lt g + (rodierRandomFourierUpperThreshold n) h + +private theorem one_sub_bound_le_measureReal_of_compl_subset + {α : Type*} [Finite α] [MeasurableSpace α] + [MeasurableSingletonClass α] + (μ : Measure α) [IsProbabilityMeasure μ] + (bad good : Set α) (bound : ℝ) + (hbad : μ.real bad ≤ bound) (hcompl : badᶜ ⊆ good) : + 1 - bound ≤ μ.real good := by + calc + 1 - bound ≤ 1 - μ.real bad := sub_le_sub_left hbad 1 + _ = μ.real badᶜ := by + rw [measureReal_compl (Set.toFinite bad).measurableSet] + simp + _ ≤ μ.real good := measureReal_mono hcompl + +/-- The uniform probability that an `n`-variable Boolean function exceeds +Carlet's random-function nonlinearity threshold. -/ +noncomputable def carletRandomNonlinearityProbability (n : ℕ) : ℝ := + (FABL.uniformPMF (FABL.BooleanFunction n)).toMeasure.real + {g | carletRandomNonlinearityThreshold n < + (nonlinearity (FABL.booleanFunctionF₂Encoding g) : ℝ)} + +/-- The finite failure estimate underlying the almost-all theorem. -/ +theorem one_sub_failureBound_le_carletRandomNonlinearityProbability (n : ℕ) : + 1 - carletRandomNonlinearityFailureBound n ≤ + carletRandomNonlinearityProbability n := by + let μ := (FABL.uniformPMF (FABL.BooleanFunction n)).toMeasure + let bad : Set (FABL.BooleanFunction n) := + {g | carletRandomFourierThreshold n ≤ + FABL.fourierInfinityNorm g.toReal} + let good : Set (FABL.BooleanFunction n) := + {g | carletRandomNonlinearityThreshold n < + (nonlinearity (FABL.booleanFunctionF₂Encoding g) : ℝ)} + have hbad : μ.real bad ≤ carletRandomNonlinearityFailureBound n := by + dsimp only [μ, bad] + rw [← fourier_union_bound_eq_failureBound] + exact measure_fourierInfinityNorm_ge_carletThreshold_le n + have hcompl : badᶜ ⊆ good := by + intro g hg + apply carletRandomNonlinearityThreshold_lt_of_fourierInfinityNorm_lt g + simpa [bad] using hg + change 1 - carletRandomNonlinearityFailureBound n ≤ μ.real good + exact one_sub_bound_le_measureReal_of_compl_subset μ bad good + (carletRandomNonlinearityFailureBound n) hbad hcompl + +/-- The uniform probability that the nonlinearity exceeds Rodier's lower +endpoint. -/ +noncomputable def rodierRandomNonlinearityLowerProbability (n : ℕ) : ℝ := + (FABL.uniformPMF (FABL.BooleanFunction n)).toMeasure.real + {g | rodierRandomNonlinearityLowerThreshold n < + (nonlinearity (FABL.booleanFunctionF₂Encoding g) : ℝ)} + +/-- The finite failure estimate for the Hoeffding side of Rodier's interval. -/ +theorem one_sub_rodierLowerFailureBound_le_probability + {n : ℕ} (hn : 1 ≤ n) : + 1 - rodierRandomNonlinearityLowerFailureBound n ≤ + rodierRandomNonlinearityLowerProbability n := by + let μ := (FABL.uniformPMF (FABL.BooleanFunction n)).toMeasure + let bad : Set (FABL.BooleanFunction n) := + {g | rodierRandomFourierUpperThreshold n ≤ + FABL.fourierInfinityNorm g.toReal} + let good : Set (FABL.BooleanFunction n) := + {g | rodierRandomNonlinearityLowerThreshold n < + (nonlinearity (FABL.booleanFunctionF₂Encoding g) : ℝ)} + have hbad : + μ.real bad ≤ rodierRandomNonlinearityLowerFailureBound n := by + dsimp only [μ, bad, rodierRandomNonlinearityLowerFailureBound] + exact measure_fourierInfinityNorm_ge_rodierUpperThreshold_le hn + have hcompl : badᶜ ⊆ good := by + intro g hg + apply + rodierRandomNonlinearityLowerThreshold_lt_of_fourierInfinityNorm_lt g + simpa [bad] using hg + change + 1 - rodierRandomNonlinearityLowerFailureBound n ≤ μ.real good + exact one_sub_bound_le_measureReal_of_compl_subset μ bad good + (rodierRandomNonlinearityLowerFailureBound n) hbad hcompl + +/-- The Hoeffding side of Rodier's sharp interval: with probability tending +to one, random nonlinearity exceeds the displayed lower endpoint. -/ +theorem tendsto_rodierRandomNonlinearityLowerProbability : + Filter.Tendsto rodierRandomNonlinearityLowerProbability + Filter.atTop (nhds 1) := by + have hlower : + Filter.Tendsto + (fun n ↦ 1 - rodierRandomNonlinearityLowerFailureBound n) + Filter.atTop (nhds 1) := by + simpa only [sub_zero] using + tendsto_rodierRandomNonlinearityLowerFailureBound.const_sub 1 + apply tendsto_of_tendsto_of_tendsto_of_le_of_le' hlower tendsto_const_nhds + · filter_upwards [Filter.eventually_ge_atTop 1] with n hn + exact one_sub_rodierLowerFailureBound_le_probability hn + · filter_upwards with n + unfold rodierRandomNonlinearityLowerProbability + exact measureReal_le_one + +/-- Olejár--Stanek/Carlet: the proportion of Boolean functions whose +nonlinearity exceeds the displayed threshold tends to one. -/ +theorem tendsto_carletRandomNonlinearityProbability : + Filter.Tendsto carletRandomNonlinearityProbability + Filter.atTop (nhds 1) := by + have hlower : + Filter.Tendsto + (fun n ↦ 1 - carletRandomNonlinearityFailureBound n) + Filter.atTop (nhds 1) := by + simpa only [sub_zero] using + tendsto_carletRandomNonlinearityFailureBound.const_sub 1 + apply tendsto_of_tendsto_of_tendsto_of_le_of_le hlower tendsto_const_nhds + · exact one_sub_failureBound_le_carletRandomNonlinearityProbability + · intro n + unfold carletRandomNonlinearityProbability + exact measureReal_le_one + +end CryptBoolean diff --git a/CryptBoolean/Carlet/Chapter04/ReedMullerCosetDistance.lean b/CryptBoolean/Carlet/Chapter04/ReedMullerCosetDistance.lean new file mode 100644 index 0000000..23426e7 --- /dev/null +++ b/CryptBoolean/Carlet/Chapter04/ReedMullerCosetDistance.lean @@ -0,0 +1,390 @@ +/- +Copyright (c) 2026 Asher Yan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Asher Yan with Codex +-/ +module + +public import CryptBoolean.Carlet.Chapter04.HigherOrderNonlinearity + +/-! +# Distances of unions of first-order Reed--Muller cosets + +The corrected finite-family form of Carlet's distance identity, with the +necessary hypothesis that distinct representatives define distinct cosets. +-/ + +open Finset +open scoped BigOperators BooleanCube + +@[expose] public section + +namespace CryptBoolean + +variable {n : ℕ} + +/-- The minimum Hamming distance between distinct functions in a finite code, +with value zero for a code having fewer than two words. -/ +noncomputable def minimumHammingDistance + (C : Finset (BooleanFunction n)) : ℕ := + if hC : C.offDiag.Nonempty then + C.offDiag.inf' hC fun p ↦ hammingDistance p.1 p.2 + else 0 + +/-- The union of the first-order Reed--Muller cosets represented by `F`. -/ +noncomputable def firstOrderCosetUnion + (F : Finset (BooleanFunction n)) : Finset (BooleanFunction n) := + by + classical + exact Finset.univ.filter fun c ↦ ∃ f ∈ F, c + f ∈ reedMuller 1 n + +/-- The first-order Reed--Muller coset represented by `f`, as a finite code. -/ +noncomputable def firstOrderReedMullerCoset + (f : BooleanFunction n) : Finset (BooleanFunction n) := + by + classical + exact Finset.univ.filter fun c ↦ c + f ∈ reedMuller 1 n + +/-- Distinct members of `F` represent distinct first-order Reed--Muller cosets. -/ +def HasDistinctFirstOrderCosets + (F : Finset (BooleanFunction n)) : Prop := + ∀ ⦃f⦄, f ∈ F → ∀ ⦃g⦄, g ∈ F → f ≠ g → + f + g ∉ reedMuller 1 n + +/-- The minimum nonlinearity of a sum of two distinct representatives, with +value zero for a family having fewer than two representatives. -/ +noncomputable def minimumPairNonlinearity + (F : Finset (BooleanFunction n)) : ℕ := + if hF : F.offDiag.Nonempty then + F.offDiag.inf' hF fun p ↦ nonlinearity (p.1 + p.2) + else 0 + +@[simp] theorem mem_firstOrderCosetUnion_iff + {F : Finset (BooleanFunction n)} {c : BooleanFunction n} : + c ∈ firstOrderCosetUnion F ↔ + ∃ f ∈ F, c + f ∈ reedMuller 1 n := by + classical + simp [firstOrderCosetUnion] + +@[simp] theorem mem_firstOrderReedMullerCoset_iff + {f c : BooleanFunction n} : + c ∈ firstOrderReedMullerCoset f ↔ c + f ∈ reedMuller 1 n := by + classical + simp [firstOrderReedMullerCoset] + +/-- A two-representative union is the union of the corresponding two cosets. -/ +theorem firstOrderCosetUnion_pair + (f g : BooleanFunction n) : + firstOrderCosetUnion {f, g} = + firstOrderReedMullerCoset f ∪ firstOrderReedMullerCoset g := by + classical + ext c + simp + +theorem minimumHammingDistance_le + {C : Finset (BooleanFunction n)} (hC : C.offDiag.Nonempty) + {f g : BooleanFunction n} (hf : f ∈ C) (hg : g ∈ C) (hfg : f ≠ g) : + minimumHammingDistance C ≤ hammingDistance f g := by + classical + rw [minimumHammingDistance, dif_pos hC] + have hp : (f, g) ∈ C.offDiag := by simp [hf, hg, hfg] + exact Finset.inf'_le _ hp + +theorem le_minimumHammingDistance + {C : Finset (BooleanFunction n)} (hC : C.offDiag.Nonempty) {d : ℕ} + (h : ∀ ⦃f⦄, f ∈ C → ∀ ⦃g⦄, g ∈ C → f ≠ g → + d ≤ hammingDistance f g) : + d ≤ minimumHammingDistance C := by + classical + rw [minimumHammingDistance, dif_pos hC] + apply Finset.le_inf' + intro p hp + exact h (Finset.mem_offDiag.mp hp).1 + (Finset.mem_offDiag.mp hp).2.1 (Finset.mem_offDiag.mp hp).2.2 + +theorem minimumPairNonlinearity_le + {F : Finset (BooleanFunction n)} (hF : F.offDiag.Nonempty) + {f g : BooleanFunction n} (hf : f ∈ F) (hg : g ∈ F) (hfg : f ≠ g) : + minimumPairNonlinearity F ≤ nonlinearity (f + g) := by + classical + rw [minimumPairNonlinearity, dif_pos hF] + have hp : (f, g) ∈ F.offDiag := by simp [hf, hg, hfg] + exact Finset.inf'_le _ hp + +theorem le_minimumPairNonlinearity + {F : Finset (BooleanFunction n)} (hF : F.offDiag.Nonempty) {d : ℕ} + (h : ∀ ⦃f⦄, f ∈ F → ∀ ⦃g⦄, g ∈ F → f ≠ g → + d ≤ nonlinearity (f + g)) : + d ≤ minimumPairNonlinearity F := by + classical + rw [minimumPairNonlinearity, dif_pos hF] + apply Finset.le_inf' + intro p hp + exact h (Finset.mem_offDiag.mp hp).1 + (Finset.mem_offDiag.mp hp).2.1 (Finset.mem_offDiag.mp hp).2.2 + +/-- Adding the same Boolean function to both endpoints preserves Hamming distance. -/ +theorem hammingDistance_add_right + (f g h : BooleanFunction n) : + hammingDistance (f + h) (g + h) = hammingDistance f g := by + rw [hammingDistance_eq_hammingWeight_add, + hammingDistance_eq_hammingWeight_add] + congr 1 + funext x + simp only [Pi.add_apply] + calc + (f x + h x) + (g x + h x) = + (f x + g x) + (h x + h x) := by ac_rfl + _ = f x + g x := by rw [CharTwo.add_self_eq_zero, add_zero] + +/-- Distances between two coset words are distances from the sum of their +representatives to a first-order Reed--Muller word. -/ +theorem hammingDistance_eq_cosetDifference + (c d f g : BooleanFunction n) : + hammingDistance c d = + hammingDistance (f + g) ((c + f) + (d + g)) := by + rw [hammingDistance_eq_hammingWeight_add, + hammingDistance_eq_hammingWeight_add] + congr 1 + funext x + simp only [Pi.add_apply] + symm + calc + (f x + g x) + ((c x + f x) + (d x + g x)) = + (c x + d x) + (f x + f x) + (g x + g x) := by ac_rfl + _ = c x + d x := by + rw [CharTwo.add_self_eq_zero, CharTwo.add_self_eq_zero] + simp + +/-- The representative-sum nonlinearity lower-bounds every distance between +the corresponding first-order Reed--Muller cosets. -/ +theorem nonlinearity_le_hammingDistance_of_mem_cosets + {c d f g : BooleanFunction n} + (hc : c + f ∈ reedMuller 1 n) (hd : d + g ∈ reedMuller 1 n) : + nonlinearity (f + g) ≤ hammingDistance c d := by + rw [nonlinearity_eq_higherOrderNonlinearity_one] + calc + higherOrderNonlinearity 1 (f + g) ≤ + hammingDistance (f + g) ((c + f) + (d + g)) := + higherOrderNonlinearity_le_hammingDistance 1 (f + g) + ((c + f) + (d + g)) ((reedMuller 1 n).add_mem hc hd) + _ = hammingDistance c d := + (hammingDistance_eq_cosetDifference c d f g).symm + +/-- Ordinary nonlinearity never exceeds half the cube size in positive dimension. -/ +theorem nonlinearity_le_two_pow_sub_one + (hn : 0 < n) (f : BooleanFunction n) : + nonlinearity f ≤ 2 ^ (n - 1) := by + have h := two_mul_higherOrderNonlinearity_le_two_pow 1 (by omega) f + rw [← nonlinearity_eq_higherOrderNonlinearity_one] at h + have hpow : 2 ^ n = 2 * 2 ^ (n - 1) := by + obtain ⟨m, rfl⟩ := Nat.exists_eq_succ_of_ne_zero (by omega : n ≠ 0) + simp [pow_succ, Nat.mul_comm] + rw [hpow] at h + omega + +/-- A nontrivial finite representative family has a pair attaining its minimum +pair nonlinearity. -/ +theorem exists_pair_nonlinearity_eq_minimumPairNonlinearity + {F : Finset (BooleanFunction n)} (hF : F.offDiag.Nonempty) : + ∃ f ∈ F, ∃ g ∈ F, f ≠ g ∧ + nonlinearity (f + g) = minimumPairNonlinearity F := by + classical + obtain ⟨p, hp, hmin⟩ := Finset.exists_mem_eq_inf' hF + (fun p : BooleanFunction n × BooleanFunction n ↦ + nonlinearity (p.1 + p.2)) + have hmem := Finset.mem_offDiag.mp hp + refine ⟨p.1, hmem.1, p.2, hmem.2.1, hmem.2.2, ?_⟩ + rw [minimumPairNonlinearity, dif_pos hF] + exact hmin.symm + +/-- A nontrivial family of representatives yields at least two words in its +union of first-order Reed--Muller cosets. -/ +theorem firstOrderCosetUnion_offDiag_nonempty + {F : Finset (BooleanFunction n)} (hF : F.offDiag.Nonempty) : + (firstOrderCosetUnion F).offDiag.Nonempty := by + classical + obtain ⟨p, hp⟩ := hF + have hmem := Finset.mem_offDiag.mp hp + refine ⟨(p.1, p.2), Finset.mem_offDiag.mpr ⟨?_, ?_, hmem.2.2⟩⟩ + · rw [mem_firstOrderCosetUnion_iff] + have hzero : p.1 + p.1 = 0 := by + funext x + exact CharTwo.add_self_eq_zero _ + exact ⟨p.1, hmem.1, by rw [hzero]; exact (reedMuller 1 n).zero_mem⟩ + · rw [mem_firstOrderCosetUnion_iff] + have hzero : p.2 + p.2 = 0 := by + funext x + exact CharTwo.add_self_eq_zero _ + exact ⟨p.2, hmem.2.1, by rw [hzero]; exact (reedMuller 1 n).zero_mem⟩ + +/-- Distinct first-order Reed--Muller cosets cannot occur in dimension zero. -/ +theorem dimension_pos_of_hasDistinctFirstOrderCosets + {F : Finset (BooleanFunction n)} (hF : F.offDiag.Nonempty) + (hcosets : HasDistinctFirstOrderCosets F) : + 0 < n := by + by_contra hn + have hnzero : n = 0 := by omega + obtain ⟨p, hp⟩ := hF + have hmem := Finset.mem_offDiag.mp hp + apply hcosets hmem.1 hmem.2.1 hmem.2.2 + rw [mem_reedMuller_iff] + exact (FABL.functionAlgebraicDegree_le_dimension (p.1 + p.2)).trans + (by omega) + +/-- Distinct words in the same first-order Reed--Muller coset have distance at +least half the cube size. -/ +theorem two_pow_sub_one_le_hammingDistance_of_mem_same_coset + {c d f : BooleanFunction n} + (hc : c + f ∈ reedMuller 1 n) (hd : d + f ∈ reedMuller 1 n) + (hcd : c ≠ d) : + 2 ^ (n - 1) ≤ hammingDistance c d := by + have haddne : c + f ≠ d + f := fun h ↦ hcd (add_right_cancel h) + have hbound := reedMuller_one_distance_lower_bound hc hd haddne + rwa [hammingDistance_add_right] at hbound + +/-- The minimum pair nonlinearity of distinct coset representatives is at +most half the cube size. -/ +theorem minimumPairNonlinearity_le_two_pow_sub_one + {F : Finset (BooleanFunction n)} (hF : F.offDiag.Nonempty) (hn : 0 < n) : + minimumPairNonlinearity F ≤ 2 ^ (n - 1) := by + obtain ⟨f, hf, g, hg, hfg, _hmin⟩ := + exists_pair_nonlinearity_eq_minimumPairNonlinearity hF + exact (minimumPairNonlinearity_le hF hf hg hfg).trans + (nonlinearity_le_two_pow_sub_one hn (f + g)) + +/-- The corrected finite-family form of Carlet's Reed--Muller coset identity: +the cosets represented by distinct members of `F` must themselves be distinct. -/ +theorem minimumHammingDistance_firstOrderCosetUnion + {F : Finset (BooleanFunction n)} (hF : F.offDiag.Nonempty) + (hcosets : HasDistinctFirstOrderCosets F) : + minimumHammingDistance (firstOrderCosetUnion F) = + minimumPairNonlinearity F := by + classical + have hC := firstOrderCosetUnion_offDiag_nonempty hF + have hn := dimension_pos_of_hasDistinctFirstOrderCosets hF hcosets + apply le_antisymm + · obtain ⟨f, hf, g, hg, hfg, hpair⟩ := + exists_pair_nonlinearity_eq_minimumPairNonlinearity hF + obtain ⟨ℓ, hℓ, hdist⟩ := + exists_reedMuller_hammingDistance_eq_higherOrderNonlinearity 1 (f + g) + have hzeroF : f + f = 0 := by + funext x + exact CharTwo.add_self_eq_zero _ + have hzeroG : g + g = 0 := by + funext x + exact CharTwo.add_self_eq_zero _ + have hfC : f ∈ firstOrderCosetUnion F := by + rw [mem_firstOrderCosetUnion_iff] + exact ⟨f, hf, by rw [hzeroF]; exact (reedMuller 1 n).zero_mem⟩ + have hgℓC : g + ℓ ∈ firstOrderCosetUnion F := by + rw [mem_firstOrderCosetUnion_iff] + refine ⟨g, hg, ?_⟩ + have hcancel : (g + ℓ) + g = ℓ := by + funext x + calc + (g x + ℓ x) + g x = g x + (g x + ℓ x) := by ac_rfl + _ = ℓ x := CharTwo.add_cancel_left _ _ + rwa [hcancel] + have hfgℓ : f ≠ g + ℓ := by + intro heq + apply hcosets hf hg hfg + have hsum : f + g = ℓ := by + calc + f + g = (g + ℓ) + g := congrArg (fun h ↦ h + g) heq + _ = ℓ := by + funext x + calc + (g x + ℓ x) + g x = g x + (g x + ℓ x) := by ac_rfl + _ = ℓ x := CharTwo.add_cancel_left _ _ + rwa [hsum] + calc + minimumHammingDistance (firstOrderCosetUnion F) ≤ + hammingDistance f (g + ℓ) := + minimumHammingDistance_le hC hfC hgℓC hfgℓ + _ = hammingDistance (f + g) ℓ := by + have htranslate := hammingDistance_add_right (f + g) ℓ g + have hcancel : (f + g) + g = f := by + funext x + exact CharTwo.add_cancel_right _ _ + have hcomm : ℓ + g = g + ℓ := add_comm ℓ g + rwa [hcancel, hcomm] at htranslate + _ = higherOrderNonlinearity 1 (f + g) := hdist + _ = nonlinearity (f + g) := + (nonlinearity_eq_higherOrderNonlinearity_one (f + g)).symm + _ = minimumPairNonlinearity F := hpair + · apply le_minimumHammingDistance hC + intro c hc d hd hcd + rw [mem_firstOrderCosetUnion_iff] at hc hd + obtain ⟨f, hf, hcf⟩ := hc + obtain ⟨g, hg, hdg⟩ := hd + by_cases hfg : f = g + · subst g + exact (minimumPairNonlinearity_le_two_pow_sub_one hF hn).trans + (two_pow_sub_one_le_hammingDistance_of_mem_same_coset hcf hdg hcd) + · exact (minimumPairNonlinearity_le hF hf hg hfg).trans + (nonlinearity_le_hammingDistance_of_mem_cosets hcf hdg) + +/-- The pair `{0,f}` represents distinct first-order Reed--Muller cosets +exactly when `f` is not affine. -/ +theorem hasDistinctFirstOrderCosets_pair_zero + {f : BooleanFunction n} (hf : f ∉ reedMuller 1 n) : + HasDistinctFirstOrderCosets ({0, f} : Finset (BooleanFunction n)) := by + classical + intro a ha b hb hab + simp only [Finset.mem_insert, Finset.mem_singleton] at ha hb + rcases ha with rfl | rfl <;> rcases hb with rfl | rfl + · exact (hab rfl).elim + · simpa using hf + · simpa [add_comm] using hf + · exact (hab rfl).elim + +/-- For a non-affine `f`, the only representative-pair nonlinearity of +`{0,f}` is the nonlinearity of `f`. -/ +theorem minimumPairNonlinearity_pair_zero + {f : BooleanFunction n} (hf : f ∉ reedMuller 1 n) : + minimumPairNonlinearity ({0, f} : Finset (BooleanFunction n)) = + nonlinearity f := by + classical + have hfzero : f ≠ 0 := by + intro hzero + apply hf + rw [hzero] + exact (reedMuller 1 n).zero_mem + have hF : ({0, f} : Finset (BooleanFunction n)).offDiag.Nonempty := by + refine ⟨(0, f), Finset.mem_offDiag.mpr ⟨by simp, by simp, ?_⟩⟩ + exact hfzero.symm + apply le_antisymm + · simpa using minimumPairNonlinearity_le hF + (f := (0 : BooleanFunction n)) (g := f) (by simp) (by simp) hfzero.symm + · apply le_minimumPairNonlinearity hF + intro a ha b hb hab + simp only [Finset.mem_insert, Finset.mem_singleton] at ha hb + rcases ha with rfl | rfl <;> rcases hb with rfl | rfl + · exact (hab rfl).elim + · simp + · simp + · exact (hab rfl).elim + +/-- Corrected two-coset identity: if `f` is non-affine, its nonlinearity is +the minimum distance of `R(1,n) ∪ (f + R(1,n))`. -/ +theorem minimumHammingDistance_two_firstOrderReedMullerCosets + {f : BooleanFunction n} (hf : f ∉ reedMuller 1 n) : + minimumHammingDistance + (firstOrderReedMullerCoset 0 ∪ firstOrderReedMullerCoset f) = + nonlinearity f := by + classical + have hfzero : f ≠ 0 := by + intro hzero + apply hf + rw [hzero] + exact (reedMuller 1 n).zero_mem + have hF : ({0, f} : Finset (BooleanFunction n)).offDiag.Nonempty := by + refine ⟨(0, f), Finset.mem_offDiag.mpr ⟨by simp, by simp, ?_⟩⟩ + exact hfzero.symm + rw [← firstOrderCosetUnion_pair] + exact (minimumHammingDistance_firstOrderCosetUnion hF + (hasDistinctFirstOrderCosets_pair_zero hf)).trans + (minimumPairNonlinearity_pair_zero hf) + +end CryptBoolean diff --git a/CryptBoolean/Carlet/Chapter04/Resiliency.lean b/CryptBoolean/Carlet/Chapter04/Resiliency.lean new file mode 100644 index 0000000..c32965b --- /dev/null +++ b/CryptBoolean/Carlet/Chapter04/Resiliency.lean @@ -0,0 +1,408 @@ +/- +Copyright (c) 2026 Asher Yan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Asher Yan with Codex +-/ +module + +public import CryptBoolean.Carlet.Chapter02.FourierOperations +public import FABL.Chapter06.Pseudorandomness.CorrelationImmunity +public import FABL.Chapter06.Pseudorandomness.RegularityCharacterizations + +/-! +# Carlet Chapter 4 resiliency and correlation immunity + +Coordinate-restriction definitions and their exact Walsh-zero characterizations. +-/ + +open Finset +open scoped BigOperators BooleanCube + +@[expose] public section + +namespace CryptBoolean + +variable {n : ℕ} + +/-- The sign-cube view of a bit-valued Boolean function. -/ +def signCubeView (f : BooleanFunction n) : FABL.BooleanFunction n := + fun x ↦ FABL.signEncode (f ((FABL.binaryCubeSignEquiv n).symm x)) + +/-- The real view of `signCubeView` is the canonical binary sign encoding transported +across FABL's cube equivalence. -/ +theorem signCubeView_toReal (f : BooleanFunction n) : + (signCubeView f).toReal = + FABL.binaryFunctionOnSignCube (realSignView f) := by + funext x + simp [signCubeView, FABL.BooleanFunction.toReal, + FABL.binaryFunctionOnSignCube, realSignView, + FABL.realSignEncodedFunction, FABL.signEncodedFunction] + +/-- A bit-valued Boolean function is correlation immune of order `m` when fixing at most +`m` input coordinates leaves its output distribution unchanged. -/ +def IsCorrelationImmune (m : ℕ) (f : BooleanFunction n) : Prop := + ∀ (J : Finset (Fin n)) (z : FABL.FixedSignCube J), + Fintype.card (FABL.FixedIndex J) ≤ m → + FABL.mean + (FABL.signRestriction + (signCubeView f).toReal J z) = + FABL.mean (signCubeView f).toReal + +/-- A bit-valued Boolean function is resilient of order `m` when it is correlation immune +of order `m` and balanced. -/ +def IsResilient (m : ℕ) (f : BooleanFunction n) : Prop := + IsCorrelationImmune m f ∧ IsBalanced f + +private theorem mean_signRestriction_univ + (g : {−1,1}^[n] → ℝ) + (z : FABL.FixedSignCube (Finset.univ : Finset (Fin n))) : + FABL.mean (FABL.signRestriction g Finset.univ z) = FABL.mean g := by + have h := FABL.mean_signRestriction_sub_mean_eq_sum_nonempty + g (Finset.univ : Finset (Fin n)) z + have hempty + (T : Finset (FABL.FixedIndex (Finset.univ : Finset (Fin n)))) : + T = ∅ := by + apply Finset.eq_empty_iff_forall_notMem.mpr + intro i hi + exact i.property (Finset.mem_univ (i : Fin n)) + simp_rw [hempty] at h + exact sub_eq_zero.mp (by simpa using h) + +/-- The coordinate-restriction definition of correlation immunity is exactly FABL's +zero low-degree Fourier regularity predicate after decoding to the sign cube. -/ +theorem isCorrelationImmune_iff_fabl + (m : ℕ) (f : BooleanFunction n) : + IsCorrelationImmune m f ↔ + FABL.IsCorrelationImmune m (signCubeView f) := by + rw [IsCorrelationImmune, FABL.IsCorrelationImmune] + exact FABL.isLowDegreeFourierRegular_zero_iff_forall_mean_signRestriction_eq + (signCubeView f).toReal m |>.symm + +/-- A raw Walsh coefficient vanishes exactly when the corresponding normalized FABL +vector-Fourier coefficient vanishes. -/ +theorem walshTransform_eq_zero_iff_vectorFourierCoeff_eq_zero + (f : BooleanFunction n) (u : FABL.F₂Cube n) : + walshTransform f u = 0 ↔ + FABL.vectorFourierCoeff (realSignView f) u = 0 := by + constructor + · intro h + have hreal : (walshTransform f u : ℝ) = 0 := by + exact_mod_cast h + rw [walshTransform_eq_two_pow_mul_vectorFourierCoeff] at hreal + exact (mul_eq_zero.mp hreal).resolve_left (by positivity) + · intro h + apply Int.cast_injective (α := ℝ) + rw [Int.cast_zero, walshTransform_eq_two_pow_mul_vectorFourierCoeff, h, + mul_zero] + +/-- Carlet balancedness agrees with FABL balancedness after decoding to the sign cube. -/ +theorem isBalanced_iff_fabl (f : BooleanFunction n) : + IsBalanced f ↔ + FABL.IsBalanced (signCubeView f).toReal := by + rw [isBalanced_iff_walshTransform_zero_eq_zero, + walshTransform_eq_zero_iff_vectorFourierCoeff_eq_zero, + FABL.IsBalanced, signCubeView_toReal, + FABL.mean_eq_fourierCoeff_empty] + have hsupport : FABL.f₂Support (0 : FABL.F₂Cube n) = ∅ := by + ext i + simp [FABL.f₂Support] + rw [← hsupport, + ← FABL.vectorFourierCoeff_eq_fourierCoeff_binaryFunctionOnSignCube] + +/-- Carlet resiliency agrees with FABL resiliency after decoding to the sign cube. -/ +theorem isResilient_iff_fabl (m : ℕ) (f : BooleanFunction n) : + IsResilient m f ↔ + FABL.IsResilient m (signCubeView f) := by + rw [IsResilient, FABL.IsResilient, isCorrelationImmune_iff_fabl, + isBalanced_iff_fabl] + +/-- Carlet Definition 3: when `n > 0` and `m < n`, resiliency is equivalent to +balancedness of every restriction obtained by fixing at most `m` coordinates. -/ +theorem isResilient_iff_forall_coordinateRestriction_balanced + (m : ℕ) (f : BooleanFunction n) (_hn : 0 < n) (_hm : m < n) : + IsResilient m f ↔ + ∀ (J : Finset (Fin n)) (z : FABL.FixedSignCube J), + Fintype.card (FABL.FixedIndex J) ≤ m → + FABL.IsBalanced + (FABL.signRestriction + (signCubeView f).toReal J z) := by + constructor + · rintro ⟨himmune, hbalanced⟩ J z hcard + rw [FABL.IsBalanced, himmune J z hcard] + exact isBalanced_iff_fabl f |>.mp hbalanced + · intro hrestrictions + let z : FABL.FixedSignCube (Finset.univ : Finset (Fin n)) := + fun i ↦ False.elim (i.property (Finset.mem_univ (i : Fin n))) + have huniv := hrestrictions (Finset.univ : Finset (Fin n)) z + (by simp [FABL.FixedIndex]) + have hmean : FABL.mean (signCubeView f).toReal = 0 := by + rw [← mean_signRestriction_univ + (signCubeView f).toReal z] + exact huniv + refine ⟨?_, isBalanced_iff_fabl f |>.mpr hmean⟩ + intro J z hcard + exact (hrestrictions J z hcard).trans hmean.symm + +private theorem liftFixedFrequency_fixedFrequencyPart_eq_of_subset_compl + (J S : Finset (Fin n)) (hSJ : S ⊆ Jᶜ) : + FABL.liftFixedFrequency (FABL.fixedFrequencyPart J S) = S := by + have hfree : FABL.freeFrequencyPart J S = ∅ := by + apply Finset.eq_empty_iff_forall_notMem.mpr + intro i hi + have hiS : (i : Fin n) ∈ S := (FABL.mem_freeFrequencyPart J S i).mp hi + have hiCompl : (i : Fin n) ∈ Jᶜ := hSJ hiS + exact (Finset.mem_compl.mp hiCompl) i.property + have hsplit := FABL.liftFreeFrequencyPart_union_liftFixedFrequencyPart J S + rw [hfree] at hsplit + simpa [FABL.liftFreeFrequency] using hsplit + +private theorem fourierCoeff_eq_indexedFourierCoeff_mean_restrictions + (g : {−1,1}^[n] → ℝ) (J S : Finset (Fin n)) (hSJ : S ⊆ Jᶜ) : + FABL.fourierCoeff g S = + FABL.indexedFourierCoeff + (fun z : FABL.FixedSignCube J ↦ + FABL.mean (FABL.signRestriction g J z)) + (FABL.fixedFrequencyPart J S) := by + let T : Finset (FABL.FixedIndex J) := FABL.fixedFrequencyPart J S + have hlift : FABL.liftFixedFrequency T = S := by + simpa [T] using + liftFixedFrequency_fixedFrequencyPart_eq_of_subset_compl J S hSJ + have hmean : + (fun z : FABL.FixedSignCube J ↦ + FABL.mean (FABL.signRestriction g J z)) = + FABL.restrictionFourierCoeff g J ∅ := by + funext z + change (𝔼 y, FABL.signRestriction g J z y) = + FABL.indexedFourierCoeff (FABL.signRestriction g J z) ∅ + exact FABL.expect_eq_indexedFourierCoeff_empty _ + rw [hmean, FABL.indexedFourierCoeff_restrictionFourierCoeff] + simp [T, FABL.liftFreeFrequency, hlift] + +/-- Carlet Definition 3, footnote 24: for `n > 0` and `m < n`, requiring +unchanged output distribution after fixing exactly `m` coordinates is equivalent +to correlation immunity under all restrictions fixing at most `m` coordinates. -/ +theorem isCorrelationImmune_iff_fixing_exactly + (m : ℕ) (f : BooleanFunction n) (_hn : 0 < n) (hm : m < n) : + IsCorrelationImmune m f ↔ + ∀ (J : Finset (Fin n)) (z : FABL.FixedSignCube J), + Fintype.card (FABL.FixedIndex J) = m → + FABL.mean (FABL.signRestriction (signCubeView f).toReal J z) = + FABL.mean (signCubeView f).toReal := by + constructor + · intro h J z hcard + exact h J z hcard.le + · intro hexact + apply isCorrelationImmune_iff_fabl m f |>.mpr + rw [FABL.IsCorrelationImmune, FABL.IsLowDegreeFourierRegular] + intro S hS hSm + have hm_le_n : m ≤ Fintype.card (Fin n) := by + simpa using (Nat.le_of_lt hm) + obtain ⟨K, hSK, hKcard⟩ := + Finset.exists_superset_card_eq hSm hm_le_n + let J : Finset (Fin n) := Kᶜ + have hfixed : Fintype.card (FABL.FixedIndex J) = m := by + simp [J, FABL.FixedIndex, hKcard] + have hSJ : S ⊆ Jᶜ := by + simpa [J] using hSK + let T : Finset (FABL.FixedIndex J) := FABL.fixedFrequencyPart J S + have hcoefficient := + fourierCoeff_eq_indexedFourierCoeff_mean_restrictions + (signCubeView f).toReal J S hSJ + change FABL.fourierCoeff (signCubeView f).toReal S = + FABL.indexedFourierCoeff + (fun z : FABL.FixedSignCube J ↦ + FABL.mean (FABL.signRestriction (signCubeView f).toReal J z)) T + at hcoefficient + have hmeanfun : + (fun z : FABL.FixedSignCube J ↦ + FABL.mean (FABL.signRestriction (signCubeView f).toReal J z)) = + fun _ ↦ FABL.mean (signCubeView f).toReal := by + funext z + exact hexact J z hfixed + rw [hmeanfun] at hcoefficient + have hlift : FABL.liftFixedFrequency T = S := by + simpa [T] using + liftFixedFrequency_fixedFrequencyPart_eq_of_subset_compl J S hSJ + have hT : T.Nonempty := by + rw [Finset.nonempty_iff_ne_empty] + intro hTempty + have : S = ∅ := by + rw [← hlift, hTempty] + simp [FABL.liftFixedFrequency] + exact hS.ne_empty this + have hexpect : + (𝔼 z : FABL.FixedSignCube J, FABL.indexedMonomial T z) = 0 := by + have horthogonal := + FABL.expect_indexedMonomial_mul T + (∅ : Finset (FABL.FixedIndex J)) + simpa [FABL.indexedMonomial, hT.ne_empty] using horthogonal + have hconstant : + FABL.indexedFourierCoeff + (fun _ : FABL.FixedSignCube J ↦ + FABL.mean (signCubeView f).toReal) T = 0 := by + rw [FABL.indexedFourierCoeff] + change (𝔼 z : FABL.FixedSignCube J, + FABL.mean (signCubeView f).toReal * FABL.indexedMonomial T z) = 0 + rw [← Finset.mul_expect, hexpect, mul_zero] + rw [hconstant] at hcoefficient + simp [hcoefficient] + +/-- Carlet Definition 3, footnote 25: for `n > 0` and `m < n`, requiring +balancedness after fixing exactly `m` coordinates is equivalent to resiliency +under all restrictions fixing at most `m` coordinates. -/ +theorem isResilient_iff_fixing_exactly + (m : ℕ) (f : BooleanFunction n) (hn : 0 < n) (hm : m < n) : + IsResilient m f ↔ + ∀ (J : Finset (Fin n)) (z : FABL.FixedSignCube J), + Fintype.card (FABL.FixedIndex J) = m → + FABL.IsBalanced + (FABL.signRestriction (signCubeView f).toReal J z) := by + constructor + · intro hresilient J z hcard + exact (isResilient_iff_forall_coordinateRestriction_balanced + m f hn hm |>.mp hresilient) J z hcard.le + · intro hexact + have hm_le_n : m ≤ Fintype.card (Fin n) := by + simpa using (Nat.le_of_lt hm) + obtain ⟨K, _hK, hKcard⟩ := + Finset.exists_superset_card_eq + (s := (∅ : Finset (Fin n))) (by simp) hm_le_n + let J : Finset (Fin n) := Kᶜ + have hfixed : Fintype.card (FABL.FixedIndex J) = m := by + simp [J, FABL.FixedIndex, hKcard] + have hcoefficient := + fourierCoeff_eq_indexedFourierCoeff_mean_restrictions + (signCubeView f).toReal J ∅ (by simp) + have hmeanfun : + (fun z : FABL.FixedSignCube J ↦ + FABL.mean (FABL.signRestriction (signCubeView f).toReal J z)) = + fun _ ↦ 0 := by + funext z + exact hexact J z hfixed + rw [hmeanfun] at hcoefficient + have hmean : FABL.mean (signCubeView f).toReal = 0 := by + rw [FABL.mean_eq_fourierCoeff_empty, hcoefficient] + simp [FABL.indexedFourierCoeff] + refine ⟨isCorrelationImmune_iff_fixing_exactly m f hn hm |>.mpr ?_, + isBalanced_iff_fabl f |>.mpr hmean⟩ + intro J z hcard + exact (hexact J z hcard).trans hmean.symm + +private theorem f₂Support_nonempty_iff_ne_zero (u : FABL.F₂Cube n) : + (FABL.f₂Support u).Nonempty ↔ u ≠ 0 := by + constructor + · intro h hu + subst u + have hzero : FABL.f₂Support (0 : FABL.F₂Cube n) = ∅ := by + ext i + simp [FABL.f₂Support] + rw [hzero] at h + exact h.ne_empty rfl + · intro hu + rw [Finset.nonempty_iff_ne_empty] + intro hsupport + apply hu + apply (FABL.f₂CubeEquivFinset n).injective + change FABL.f₂Support u = FABL.f₂Support (0 : FABL.F₂Cube n) + rw [hsupport] + ext i + simp [FABL.f₂Support] + +/-- Carlet Theorem 3, correlation-immunity form: for `n > 0` and `m < n`, +correlation immunity of order `m` is equivalent to vanishing of every nonzero +raw Walsh coefficient whose frequency has Hamming weight at most `m`. -/ +theorem theorem_3_correlationImmune_iff_walshTransform_eq_zero + (m : ℕ) (f : BooleanFunction n) (_hn : 0 < n) (_hm : m < n) : + IsCorrelationImmune m f ↔ + ∀ u : FABL.F₂Cube n, u ≠ 0 → + (FABL.f₂Support u).card ≤ m → walshTransform f u = 0 := by + constructor + · intro himmune u hu hweight + have hfab : + FABL.IsCorrelationImmune m (signCubeView f) := + isCorrelationImmune_iff_fabl m f |>.mp himmune + rw [FABL.IsCorrelationImmune, FABL.IsLowDegreeFourierRegular] at hfab + have hbound := hfab (FABL.f₂Support u) + (f₂Support_nonempty_iff_ne_zero u |>.mpr hu) hweight + have hcoeff : + FABL.fourierCoeff (signCubeView f).toReal + (FABL.f₂Support u) = 0 := + abs_eq_zero.mp (le_antisymm hbound (abs_nonneg _)) + rw [signCubeView_toReal] at hcoeff + apply walshTransform_eq_zero_iff_vectorFourierCoeff_eq_zero f u |>.mpr + exact (FABL.vectorFourierCoeff_eq_fourierCoeff_binaryFunctionOnSignCube + (realSignView f) u).trans hcoeff + · intro hwalsh + apply isCorrelationImmune_iff_fabl m f |>.mpr + rw [FABL.IsCorrelationImmune, FABL.IsLowDegreeFourierRegular] + intro S hS hcard + let u : FABL.F₂Cube n := FABL.f₂CubeOfFinset S + have hsupport : FABL.f₂Support u = S := by + exact (FABL.f₂CubeEquivFinset n).right_inv S + have hu : u ≠ 0 := by + apply f₂Support_nonempty_iff_ne_zero u |>.mp + simpa [hsupport] using hS + have hvector : FABL.vectorFourierCoeff (realSignView f) u = 0 := + walshTransform_eq_zero_iff_vectorFourierCoeff_eq_zero f u |>.mp + (hwalsh u hu (by simpa [hsupport] using hcard)) + have hcoeff : + FABL.fourierCoeff (signCubeView f).toReal S = 0 := by + rw [signCubeView_toReal, ← hsupport] + exact (FABL.vectorFourierCoeff_eq_fourierCoeff_binaryFunctionOnSignCube + (realSignView f) u).symm.trans hvector + simp [hcoeff] + +/-- Carlet Theorem 3, resilient form: for `n > 0` and `m < n`, resiliency of +order `m` is equivalent to vanishing of every raw Walsh coefficient whose +frequency has Hamming weight at most `m`, including the zero frequency. -/ +theorem theorem_3_resilient_iff_walshTransform_eq_zero + (m : ℕ) (f : BooleanFunction n) (hn : 0 < n) (hm : m < n) : + IsResilient m f ↔ + ∀ u : FABL.F₂Cube n, (FABL.f₂Support u).card ≤ m → + walshTransform f u = 0 := by + constructor + · rintro ⟨himmune, hbalanced⟩ u hweight + by_cases hu : u = 0 + · subst u + exact isBalanced_iff_walshTransform_zero_eq_zero f |>.mp hbalanced + · exact theorem_3_correlationImmune_iff_walshTransform_eq_zero + m f hn hm |>.mp himmune u hu hweight + · intro hwalsh + refine ⟨theorem_3_correlationImmune_iff_walshTransform_eq_zero + m f hn hm |>.mpr ?_, ?_⟩ + · intro u _hu hweight + exact hwalsh u hweight + · apply isBalanced_iff_walshTransform_zero_eq_zero f |>.mpr + apply hwalsh 0 + simp [FABL.f₂Support] + +/-- Translating the input multiplies a raw Walsh coefficient by the corresponding +Walsh character value. -/ +theorem walshTransform_domainTranslate_cast + (f : BooleanFunction n) (b u : FABL.F₂Cube n) : + (walshTransform (FABL.domainTranslate f b) u : ℝ) = + FABL.vectorWalshCharacter u b * (walshTransform f u : ℝ) := by + rw [walshTransform_eq_two_pow_mul_vectorFourierCoeff, + walshTransform_eq_two_pow_mul_vectorFourierCoeff] + change (2 ^ n : ℝ) * + FABL.vectorFourierCoeff (fun x ↦ realSignView f (x + b)) u = _ + rw [FABL.vectorFourierCoeff_translate_add] + ring + +/-- Carlet's translation invariance of resiliency: an additive input translation +preserves every resilient order in the source range `n > 0`, `m < n`. -/ +theorem isResilient_domainTranslate + (m : ℕ) (f : BooleanFunction n) (b : FABL.F₂Cube n) + (hn : 0 < n) (hm : m < n) (hf : IsResilient m f) : + IsResilient m (FABL.domainTranslate f b) := by + rw [theorem_3_resilient_iff_walshTransform_eq_zero m f hn hm] at hf + rw [theorem_3_resilient_iff_walshTransform_eq_zero + m (FABL.domainTranslate f b) hn hm] + intro u hweight + apply Int.cast_injective (α := ℝ) + rw [Int.cast_zero, walshTransform_domainTranslate_cast] + have hzero : (walshTransform f u : ℝ) = 0 := by + exact_mod_cast hf u hweight + rw [hzero, mul_zero] + +end CryptBoolean diff --git a/CryptBoolean/Carlet/Chapter04/RodierGaussianMainTerm.lean b/CryptBoolean/Carlet/Chapter04/RodierGaussianMainTerm.lean new file mode 100644 index 0000000..b2b895f --- /dev/null +++ b/CryptBoolean/Carlet/Chapter04/RodierGaussianMainTerm.lean @@ -0,0 +1,1070 @@ +/- +Copyright (c) 2026 Asher Yan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Asher Yan with Codex +-/ +module + +public import CryptBoolean.Carlet.Chapter04.RodierLowerTail +public import Mathlib.Probability.Distributions.Gaussian.CharFun + +/-! +# The Gaussian main term in Rodier's lower-tail argument + +Rodier's Fourier--Stieltjes main term as a Gaussian cutoff expectation and +its explicit interval lower bound. +-/ + +open MeasureTheory ProbabilityTheory +open scoped ENNReal FourierTransform NNReal ProbabilityTheory Topology + +@[expose] public section + +namespace CryptBoolean + +variable {n : ℕ} + +/-- The centered Gaussian measure whose variance is the Boolean-cube size. -/ +noncomputable def rodierGaussianMeasure (n : ℕ) : Measure ℝ := + gaussianReal 0 (2 ^ n) + +/-- Rodier's Gaussian Fourier main term is the expectation of his cutoff +under the centered Gaussian of variance `2^n`. -/ +theorem rodierCutoffGaussianIntegral_eq_gaussianExpectation + (n : ℕ) (M Δ : ℝ) (hM : 0 < M) (hΔ : 0 < Δ) : + rodierCutoffGaussianIntegral n M Δ hM hΔ = + ∫ x : ℝ, (rodierCutoff M Δ x : ℂ) ∂rodierGaussianMeasure n := by + let q : ℝ := (2 : ℝ) ^ n + let γ : Measure ℝ := rodierGaussianMeasure n + let v : ℝ → ℂ := rodierCutoffFourierDensity M Δ hM hΔ + let F : ℝ → ℝ → ℂ := fun x t => + Complex.exp ((((t * x : ℝ) : ℂ) * Complex.I)) * v t + letI : IsProbabilityMeasure γ := by + dsimp [γ, rodierGaussianMeasure] + infer_instance + have hv : Integrable v := + rodierCutoffFourierDensity_integrable M Δ hM hΔ + have hvcont : Continuous v := by + dsimp [v, rodierCutoffFourierDensity] + exact continuous_const.mul + ((rodierCutoffUnitFourierDensity M Δ hM hΔ).continuous.comp (by fun_prop)) + have hprod : Integrable (Function.uncurry F) (γ.prod volume) := by + have hdom : Integrable (fun z : ℝ × ℝ => (1 : ℝ) * ‖v z.2‖) + (γ.prod volume) := + (integrable_const (μ := γ) (1 : ℝ)).mul_prod hv.norm + apply hdom.mono + · apply Continuous.aestronglyMeasurable + dsimp [F] + exact (Complex.continuous_exp.comp (by fun_prop)).mul + (hvcont.comp continuous_snd) + · filter_upwards [] with z + change ‖Complex.exp ((((z.2 * z.1 : ℝ) : ℂ) * Complex.I)) * v z.2‖ ≤ + |(1 : ℝ) * ‖v z.2‖| + rw [norm_mul, Complex.norm_exp] + simp + have hswap : + (∫ x : ℝ, (∫ t : ℝ, F x t) ∂γ) = + ∫ t : ℝ, ∫ x : ℝ, F x t ∂γ := + integral_integral_swap hprod + have hchar (t : ℝ) : + (∫ x : ℝ, + Complex.exp ((((t * x : ℝ) : ℂ) * Complex.I)) ∂γ) = + (Real.exp (-(q * t ^ 2 / 2)) : ℂ) := by + change charFun γ t = _ + rw [show γ = gaussianReal 0 (2 ^ n) from rfl, + charFun_gaussianReal] + push_cast + congr 1 + simp only [mul_zero, zero_mul, zero_sub] + dsimp [q] + norm_cast + push_cast + ring + have houter : Integrable (fun x : ℝ => ∫ t : ℝ, F x t) γ := by + simpa using hprod.integral_prod_left + rw [rodierCutoffGaussianIntegral] + simp_rw [rodierCutoff_fourierDensity_inversion M Δ hM hΔ] + change 1 + ∫ t : ℝ, (Real.exp (-(q * t ^ 2 / 2)) : ℂ) * v t = + ∫ x : ℝ, + (1 + ∫ t : ℝ, F x t) ∂γ + rw [integral_add (μ := γ) (integrable_const 1) houter, + integral_const] + simp only [probReal_univ, one_smul] + rw [hswap] + congr 1 + apply integral_congr_ae + filter_upwards [] with t + calc + (Real.exp (-(q * t ^ 2 / 2)) : ℂ) * v t = + (∫ x : ℝ, + Complex.exp ((((t * x : ℝ) : ℂ) * Complex.I)) ∂γ) * v t := by + rw [hchar] + _ = ∫ x : ℝ, F x t ∂γ := by + rw [← integral_mul_const] + +/-- The real part of Rodier's Gaussian main term is the ordinary Gaussian +density integral of the cutoff. -/ +theorem rodierCutoffGaussianIntegral_re_eq_gaussianDensityIntegral + (n : ℕ) (M Δ : ℝ) (hM : 0 < M) (hΔ : 0 < Δ) : + (rodierCutoffGaussianIntegral n M Δ hM hΔ).re = + ∫ x : ℝ, + gaussianPDFReal 0 (2 ^ n) x * rodierCutoff M Δ x := by + rw [rodierCutoffGaussianIntegral_eq_gaussianExpectation] + unfold rodierGaussianMeasure + rw [integral_gaussianReal_eq_integral_smul + (by positivity : (2 ^ n : ℝ≥0) ≠ 0)] + simp_rw [Complex.real_smul] + simp only [← Complex.ofReal_mul] + rw [integral_complex_ofReal] + simp + +private theorem integrable_gaussianPDFReal_mul_rodierCutoff + (n : ℕ) (M Δ : ℝ) (hM : 0 < M) (hΔ : 0 < Δ) : + Integrable (fun x : ℝ => + gaussianPDFReal 0 (2 ^ n) x * rodierCutoff M Δ x) := by + apply (integrable_gaussianPDFReal 0 (2 ^ n)).mul_bdd + · exact (rodierCutoff_contDiff M Δ hM hΔ).continuous.aestronglyMeasurable + · filter_upwards [] with x + rw [Real.norm_eq_abs, abs_of_nonneg (rodierCutoff_nonneg M Δ hM hΔ x)] + exact rodierCutoff_le_one M Δ hM hΔ x + +/-- The Fourier transform of the centered Gaussian density, in Mathlib's +unit-frequency convention. -/ +theorem fourier_gaussianPDFReal_zero_powTwo + (n : ℕ) (ξ : ℝ) : + 𝓕 (fun x : ℝ => (gaussianPDFReal 0 (2 ^ n) x : ℂ)) ξ = + (Real.exp (-((2 : ℝ) ^ n * (2 * Real.pi * ξ) ^ 2 / 2)) : ℂ) := by + let γ : Measure ℝ := gaussianReal 0 (2 ^ n) + have hv : (2 ^ n : ℝ≥0) ≠ 0 := by positivity + calc + 𝓕 (fun x : ℝ => (gaussianPDFReal 0 (2 ^ n) x : ℂ)) ξ = + charFun γ (-2 * Real.pi * ξ) := by + rw [Real.fourier_real_eq_integral_exp_smul, charFun_apply_real] + unfold γ + rw [integral_gaussianReal_eq_integral_smul hv] + apply integral_congr_ae + filter_upwards [] with x + simp only [smul_eq_mul, Complex.real_smul] + rw [mul_comm] + congr 1 + push_cast + ring + _ = (Real.exp (-((2 : ℝ) ^ n * (2 * Real.pi * ξ) ^ 2 / 2)) : ℂ) := by + dsimp [γ] + rw [charFun_gaussianReal] + push_cast + congr 1 + ring + +private theorem integrable_fourier_gaussianPDFReal_zero_powTwo + (n : ℕ) : + Integrable (𝓕 (fun x : ℝ => + (gaussianPDFReal 0 (2 ^ n) x : ℂ))) := by + let q : ℝ := (2 : ℝ) ^ n + let b : ℝ := q * (2 * Real.pi) ^ 2 / 2 + have hb : 0 < b := by + dsimp [b, q] + positivity + have hg : Integrable (fun ξ : ℝ => + (Real.exp (-b * ξ ^ 2) : ℂ)) := + (integrable_exp_neg_mul_sq hb).ofReal + apply hg.congr + filter_upwards [] with ξ + rw [fourier_gaussianPDFReal_zero_powTwo] + congr 2 + dsimp [b, q] + ring + +private theorem fourier_fourier_gaussianPDFReal_zero_powTwo + (n : ℕ) (x : ℝ) : + 𝓕 (𝓕 (fun y : ℝ => + (gaussianPDFReal 0 (2 ^ n) y : ℂ))) x = + (gaussianPDFReal 0 (2 ^ n) (-x) : ℂ) := by + let f : ℝ → ℂ := fun y => (gaussianPDFReal 0 (2 ^ n) y : ℂ) + have hf : Integrable f := (integrable_gaussianPDFReal 0 (2 ^ n)).ofReal + have hF : Integrable (𝓕 f) := + integrable_fourier_gaussianPDFReal_zero_powTwo n + have hinv := hf.fourierInv_fourier_eq hF + (show ContinuousAt f (-x) by + dsimp [f, gaussianPDFReal] + fun_prop) + rw [Real.fourierInv_eq_fourier_neg] at hinv + simpa [f] using hinv + +private theorem integrable_iteratedDeriv_rodierCutoffRemainder + (p : ℕ) (M Δ : ℝ) (hM : 0 < M) (hΔ : 0 < Δ) : + Integrable (iteratedDeriv p + (rodierCutoffRemainderSchwartz M Δ hM hΔ : ℝ → ℂ)) := by + let f := rodierCutoffRemainderSchwartz M Δ hM hΔ + have hfd : ContDiff ℝ p (f : ℝ → ℂ) := f.smooth p + have hcont : Continuous (iteratedDeriv p (f : ℝ → ℂ)) := + hfd.continuous_iteratedDeriv' p + have hsch : Integrable (fun x : ℝ => ‖x‖ ^ (0 : ℕ) * + ‖iteratedFDeriv ℝ p (f : ℝ → ℂ) x‖) := by + simpa using f.integrable_pow_mul_iteratedFDeriv volume 0 p + have hfderiv : Integrable (fun x : ℝ => + ‖iteratedFDeriv ℝ p (f : ℝ → ℂ) x‖) := by + simpa using hsch + have hnorm : Integrable (fun x : ℝ => + ‖iteratedDeriv p (f : ℝ → ℂ) x‖) := by + convert hfderiv using 1 + funext x + exact (norm_iteratedFDeriv_eq_norm_iteratedDeriv + (𝕜 := ℝ) (F := ℂ) (n := p) (f := (f : ℝ → ℂ)) (x := x)).symm + exact (integrable_norm_iff hcont.aestronglyMeasurable).mp hnorm + +private theorem iteratedDeriv_rodierCutoffRemainder_eq_ofReal + {p : ℕ} (hp : 0 < p) (M Δ : ℝ) (hM : 0 < M) (hΔ : 0 < Δ) + (x : ℝ) : + iteratedDeriv p + (rodierCutoffRemainderSchwartz M Δ hM hΔ : ℝ → ℂ) x = + Complex.ofReal (iteratedDeriv p (rodierCutoff M Δ) x) := by + rw [show (rodierCutoffRemainderSchwartz M Δ hM hΔ : ℝ → ℂ) = + fun y => (rodierCutoff M Δ y - 1 : ℝ) • (1 : ℂ) by + funext y + rw [rodierCutoffRemainderSchwartz_apply] + simp] + have horder : ((p : ℕ∞) : WithTop ℕ∞) ≤ + ((⊤ : ℕ∞) : WithTop ℕ∞) := WithTop.coe_le_coe.mpr le_top + have hf : ContDiffAt ℝ p (fun y => rodierCutoff M Δ y - 1) x := + (((rodierCutoff_contDiff M Δ hM hΔ).sub contDiff_const).of_le + horder).contDiffAt + rw [iteratedDeriv_smul_const hf] + have hsub : + iteratedDeriv p (fun y => rodierCutoff M Δ y - 1) x = + iteratedDeriv p (rodierCutoff M Δ) x := by + have hu : ContDiffAt ℝ p (rodierCutoff M Δ) x := + ((rodierCutoff_contDiff M Δ hM hΔ).of_le horder).contDiffAt + change iteratedDeriv p (rodierCutoff M Δ - fun _ => 1) x = _ + rw [iteratedDeriv_sub hu contDiffAt_const] + rw [iteratedDeriv_const, if_neg hp.ne'] + simp + rw [hsub] + simp + +private theorem fourier_iteratedDeriv_rodierCutoffRemainder + (p : ℕ) (M Δ : ℝ) (hM : 0 < M) (hΔ : 0 < Δ) : + 𝓕 (iteratedDeriv p + (rodierCutoffRemainderSchwartz M Δ hM hΔ : ℝ → ℂ)) = + fun ξ : ℝ => (2 * Real.pi * Complex.I * ξ) ^ p • + rodierCutoffUnitFourierDensity M Δ hM hΔ ξ := by + exact Real.fourier_iteratedDeriv (N := ⊤) (n := p) + ((rodierCutoffRemainderSchwartz M Δ hM hΔ).smooth ⊤) + (fun k _ => + integrable_iteratedDeriv_rodierCutoffRemainder k M Δ hM hΔ) + le_top + +private theorem integral_fourier_iteratedDeriv_mul_fourier_gaussianPDF + {p : ℕ} (hp : 0 < p) (n : ℕ) + (M Δ : ℝ) (hM : 0 < M) (hΔ : 0 < Δ) : + (∫ ξ : ℝ, + 𝓕 (iteratedDeriv p + (rodierCutoffRemainderSchwartz M Δ hM hΔ : ℝ → ℂ)) ξ * + 𝓕 (fun y : ℝ => + (gaussianPDFReal 0 (2 ^ n) y : ℂ)) ξ) = + ∫ x : ℝ, + ((iteratedDeriv p (rodierCutoff M Δ) x : ℝ) : ℂ) * + (gaussianPDFReal 0 (2 ^ n) x : ℂ) := by + let d : ℝ → ℂ := iteratedDeriv p + (rodierCutoffRemainderSchwartz M Δ hM hΔ : ℝ → ℂ) + let g : ℝ → ℂ := fun y => (gaussianPDFReal 0 (2 ^ n) y : ℂ) + have hd : Integrable d := + integrable_iteratedDeriv_rodierCutoffRemainder p M Δ hM hΔ + have hg : Integrable (𝓕 g) := + integrable_fourier_gaussianPDFReal_zero_powTwo n + have hswap := VectorFourier.integral_fourierIntegral_smul_eq_flip + (μ := volume) (ν := volume) (L := innerₗ ℝ) + Real.continuous_fourierChar continuous_inner hd hg + have hswap' : + (∫ ξ : ℝ, 𝓕 d ξ * 𝓕 g ξ) = + ∫ x : ℝ, d x * 𝓕 (𝓕 g) x := by + calc + _ = ∫ ξ : ℝ, + VectorFourier.fourierIntegral Real.fourierChar volume + (innerₗ ℝ) d ξ • 𝓕 g ξ := by + apply integral_congr_ae + filter_upwards [] with ξ + change + VectorFourier.fourierIntegral Real.fourierChar volume + (innerₗ ℝ) d ξ * 𝓕 g ξ = + VectorFourier.fourierIntegral Real.fourierChar volume + (innerₗ ℝ) d ξ • 𝓕 g ξ + simp only [smul_eq_mul] + _ = ∫ x : ℝ, d x • + VectorFourier.fourierIntegral Real.fourierChar volume + (innerₗ ℝ).flip (𝓕 g) x := hswap + _ = _ := by + apply integral_congr_ae + filter_upwards [] with x + rw [flip_innerₗ] + change d x • 𝓕 (𝓕 g) x = d x * 𝓕 (𝓕 g) x + simp only [smul_eq_mul] + rw [show (fun x : ℝ => d x * 𝓕 (𝓕 g) x) = + fun x => ((iteratedDeriv p (rodierCutoff M Δ) x : ℝ) : ℂ) * + (gaussianPDFReal 0 (2 ^ n) x : ℂ) by + funext x + rw [show d x = + Complex.ofReal (iteratedDeriv p (rodierCutoff M Δ) x) by + exact iteratedDeriv_rodierCutoffRemainder_eq_ofReal hp M Δ hM hΔ x] + rw [show 𝓕 (𝓕 g) x = + (gaussianPDFReal 0 (2 ^ n) (-x) : ℂ) by + exact fourier_fourier_gaussianPDFReal_zero_powTwo n x] + rw [show gaussianPDFReal 0 (2 ^ n) (-x) = + gaussianPDFReal 0 (2 ^ n) x by + simp [gaussianPDFReal]] + ] at hswap' + simpa [d, g, smul_eq_mul] using hswap' + +private theorem rodierGaussianWeightedDensityMoment_eq_unitFourierIntegral + (n p : ℕ) (M Δ : ℝ) (hM : 0 < M) (hΔ : 0 < Δ) : + rodierGaussianWeightedDensityMoment n p M Δ hM hΔ = + ∫ ξ : ℝ, + (((((2 * Real.pi : ℝ) * ξ) ^ p * + Real.exp (-((2 : ℝ) ^ n * + ((2 * Real.pi : ℝ) * ξ) ^ 2 / 2)) : ℝ) : ℂ) * + rodierCutoffUnitFourierDensity M Δ hM hΔ ξ) := by + let a : ℝ := 2 * Real.pi + let w : ℝ → ℂ := fun ξ => + ((((a * ξ) ^ p * + Real.exp (-((2 : ℝ) ^ n * (a * ξ) ^ 2 / 2)) : ℝ) : ℂ) * + ((a : ℂ)⁻¹ * + rodierCutoffUnitFourierDensity M Δ hM hΔ ξ)) + have ha : 0 < a := by + dsimp [a] + positivity + have hscale := Measure.integral_comp_div w a + rw [abs_of_pos ha] at hscale + rw [rodierGaussianWeightedDensityMoment] + calc + (∫ t : ℝ, + ((t ^ p * Real.exp (-((2 : ℝ) ^ n * t ^ 2 / 2)) : ℝ) : ℂ) * + rodierCutoffFourierDensity M Δ hM hΔ t) = + ∫ t : ℝ, w (t / a) := by + apply integral_congr_ae + filter_upwards [] with t + dsimp [w, a, rodierCutoffFourierDensity] + congr 3 <;> field_simp + _ = a • ∫ ξ : ℝ, w ξ := hscale + _ = ∫ ξ : ℝ, + (((((2 * Real.pi : ℝ) * ξ) ^ p * + Real.exp (-((2 : ℝ) ^ n * + ((2 * Real.pi : ℝ) * ξ) ^ 2 / 2)) : ℝ) : ℂ) * + rodierCutoffUnitFourierDensity M Δ hM hΔ ξ) := by + rw [← integral_smul] + apply integral_congr_ae + filter_upwards [] with ξ + dsimp [w, a] + push_cast + field_simp + +/-- Positive Gaussian-weighted density moments are Gaussian pairings with +the corresponding cutoff derivative. -/ +theorem complex_I_pow_mul_rodierGaussianWeightedDensityMoment_eq + {p : ℕ} (hp : 0 < p) (n : ℕ) + (M Δ : ℝ) (hM : 0 < M) (hΔ : 0 < Δ) : + Complex.I ^ p * + rodierGaussianWeightedDensityMoment n p M Δ hM hΔ = + ∫ x : ℝ, + ((iteratedDeriv p (rodierCutoff M Δ) x : ℝ) : ℂ) * + (gaussianPDFReal 0 (2 ^ n) x : ℂ) := by + rw [rodierGaussianWeightedDensityMoment_eq_unitFourierIntegral] + calc + Complex.I ^ p * + (∫ ξ : ℝ, + (((((2 * Real.pi : ℝ) * ξ) ^ p * + Real.exp (-((2 : ℝ) ^ n * + ((2 * Real.pi : ℝ) * ξ) ^ 2 / 2)) : ℝ) : ℂ) * + rodierCutoffUnitFourierDensity M Δ hM hΔ ξ)) = + ∫ ξ : ℝ, + 𝓕 (iteratedDeriv p + (rodierCutoffRemainderSchwartz M Δ hM hΔ : ℝ → ℂ)) ξ * + 𝓕 (fun y : ℝ => + (gaussianPDFReal 0 (2 ^ n) y : ℂ)) ξ := by + rw [← integral_const_mul] + apply integral_congr_ae + filter_upwards [] with ξ + rw [congrFun (fourier_iteratedDeriv_rodierCutoffRemainder + p M Δ hM hΔ) ξ] + rw [fourier_gaussianPDFReal_zero_powTwo] + simp only [smul_eq_mul] + push_cast + ring + _ = _ := + integral_fourier_iteratedDeriv_mul_fourier_gaussianPDF + hp n M Δ hM hΔ + +private theorem iteratedDeriv_rodierCutoff_eq_zero_of_abs_lt + {p : ℕ} {M Δ x : ℝ} + (hM : 0 < M) (hΔ : 0 < Δ) (hx : |x| < M) : + iteratedDeriv p (rodierCutoff M Δ) x = 0 := by + have hnhds : {y : ℝ | |y| < M} ∈ 𝓝 x := + (isOpen_lt continuous_abs continuous_const).mem_nhds hx + have heq : rodierCutoff M Δ =ᶠ[𝓝 x] (fun _ : ℝ => 0) := by + filter_upwards [hnhds] with y hy + exact rodierCutoff_eq_zero_of_abs_le hM hΔ hy.le + rw [heq.iteratedDeriv_eq p] + simp + +/-- A centered Gaussian with variance `2^n` has the elementary two-sided +Chernoff tail bound used in the signed-moment estimate. -/ +theorem gaussianReal_zero_powTwo_measureReal_abs_ge_le + (n : ℕ) (M : ℝ) (hM : 0 < M) : + (gaussianReal 0 (2 ^ n)).real {x : ℝ | M ≤ |x|} ≤ + 2 * Real.exp (-(M ^ 2) / (2 * (2 : ℝ) ^ n)) := by + let q : ℝ := (2 : ℝ) ^ n + let γ : Measure ℝ := gaussianReal 0 (2 ^ n) + have hq : 0 < q := by + dsimp [q] + positivity + have htpos : 0 ≤ M / q := div_nonneg hM.le hq.le + have htneg : -M / q ≤ 0 := div_nonpos_of_nonpos_of_nonneg + (neg_nonpos.mpr hM.le) hq.le + have hup₀ := measure_ge_le_exp_mul_mgf + (μ := γ) (X := id) (t := M / q) M htpos + (by + dsimp [γ] + exact integrable_exp_mul_gaussianReal (M / q)) + have hlo₀ := measure_le_le_exp_mul_mgf + (μ := γ) (X := id) (t := -M / q) (-M) htneg + (by + dsimp [γ] + exact integrable_exp_mul_gaussianReal (-M / q)) + have hmgfpos : mgf id γ (M / q) = + Real.exp (q * (M / q) ^ 2 / 2) := by + dsimp [γ] + rw [congrFun mgf_id_gaussianReal (M / q)] + simp only [zero_mul, zero_add] + congr 1 + have hmgfneg : mgf id γ (-M / q) = + Real.exp (q * (-M / q) ^ 2 / 2) := by + dsimp [γ] + rw [congrFun mgf_id_gaussianReal (-M / q)] + simp only [zero_mul, zero_add] + congr 1 + have hrhspos : + Real.exp (-(M / q) * M) * mgf id γ (M / q) = + Real.exp (-(M ^ 2) / (2 * q)) := by + rw [hmgfpos, ← Real.exp_add] + congr 1 + field_simp + ring + have hrhsneg : + Real.exp (-(-M / q) * (-M)) * mgf id γ (-M / q) = + Real.exp (-(M ^ 2) / (2 * q)) := by + rw [hmgfneg, ← Real.exp_add] + congr 1 + field_simp + ring + have hup : γ.real {x : ℝ | M ≤ x} ≤ + Real.exp (-(M ^ 2) / (2 * q)) := by + rw [← hrhspos] + simpa [id] using hup₀ + have hlo : γ.real {x : ℝ | x ≤ -M} ≤ + Real.exp (-(M ^ 2) / (2 * q)) := by + rw [← hrhsneg] + simpa [id] using hlo₀ + have hsubset : {x : ℝ | M ≤ |x|} ⊆ + {x : ℝ | M ≤ x} ∪ {x : ℝ | x ≤ -M} := by + intro x hx + change M ≤ |x| at hx + change M ≤ x ∨ x ≤ -M + rcases le_total 0 x with hx0 | hx0 + · exact Or.inl (by simpa [abs_of_nonneg hx0] using hx) + · rw [abs_of_nonpos hx0] at hx + exact Or.inr (by linarith) + calc + γ.real {x : ℝ | M ≤ |x|} ≤ + γ.real ({x : ℝ | M ≤ x} ∪ {x : ℝ | x ≤ -M}) := + measureReal_mono hsubset + _ ≤ γ.real {x : ℝ | M ≤ x} + γ.real {x : ℝ | x ≤ -M} := + measureReal_union_le _ _ + _ ≤ Real.exp (-(M ^ 2) / (2 * q)) + + Real.exp (-(M ^ 2) / (2 * q)) := add_le_add hup hlo + _ = 2 * Real.exp (-(M ^ 2) / (2 * (2 : ℝ) ^ n)) := by + dsimp [q] + ring + +/-- Rodier Proposition 4.1(7), in the slightly coarser Chernoff form sufficient +for the random-nonlinearity argument. The crucial Gaussian tail factor is +retained uniformly in the moment order. -/ +theorem exists_rodierGaussianWeightedDensityMoment_exponential_bound + {p : ℕ} (hp : 0 < p) : + ∃ C : ℝ, 0 ≤ C ∧ + ∀ (n : ℕ) (M Δ : ℝ) (hM : 0 < M) (hΔ : 0 < Δ), + ‖rodierGaussianWeightedDensityMoment n p M Δ hM hΔ‖ ≤ + C * Δ⁻¹ ^ p * + Real.exp (-(M ^ 2) / (2 * (2 : ℝ) ^ n)) := by + obtain ⟨C₀, hC₀, hderiv⟩ := + exists_iteratedDeriv_rodierCutoff_bound hp + refine ⟨2 * C₀, mul_nonneg (by norm_num) hC₀, ?_⟩ + intro n M Δ hM hΔ + let γ : Measure ℝ := gaussianReal 0 (2 ^ n) + let d : ℝ → ℝ := fun x => iteratedDeriv p (rodierCutoff M Δ) x + let s : Set ℝ := {x | M ≤ |x|} + let K : ℝ := C₀ * Δ⁻¹ ^ p + have hv : (2 ^ n : ℝ≥0) ≠ 0 := by positivity + have hs : MeasurableSet s := by + dsimp [s] + exact measurableSet_le measurable_const continuous_abs.measurable + have hK : 0 ≤ K := by + dsimp [K] + positivity + have hgauss : + (∫ x : ℝ, ((d x : ℝ) : ℂ) * + (gaussianPDFReal 0 (2 ^ n) x : ℂ)) = + ∫ x : ℝ, ((d x : ℝ) : ℂ) ∂γ := by + dsimp [γ] + rw [integral_gaussianReal_eq_integral_smul hv] + apply integral_congr_ae + filter_upwards [] with x + simp only [Complex.real_smul] + ring + have henv : Integrable (s.indicator (fun _ : ℝ => K)) γ := + (integrable_const K).indicator hs + have hpoint (x : ℝ) : |d x| ≤ s.indicator (fun _ : ℝ => K) x := by + by_cases hx : M ≤ |x| + · have hxs : x ∈ s := by simpa [s] using hx + rw [Set.indicator_of_mem hxs] + dsimp [d, K] + exact hderiv hΔ + · have hxlt : |x| < M := lt_of_not_ge hx + have hxns : x ∉ s := by simpa [s] using hx + rw [Set.indicator_of_notMem hxns] + dsimp [d] + rw [iteratedDeriv_rodierCutoff_eq_zero_of_abs_lt hM hΔ hxlt] + simp + have hnormIntegral : + ‖∫ x : ℝ, ((d x : ℝ) : ℂ) ∂γ‖ ≤ + K * γ.real s := by + calc + ‖∫ x : ℝ, ((d x : ℝ) : ℂ) ∂γ‖ ≤ + ∫ x : ℝ, ‖((d x : ℝ) : ℂ)‖ ∂γ := + norm_integral_le_integral_norm _ + _ = ∫ x : ℝ, |d x| ∂γ := by + apply integral_congr_ae + filter_upwards [] with x + rw [Complex.norm_real, Real.norm_eq_abs] + _ ≤ ∫ x : ℝ, s.indicator (fun _ : ℝ => K) x ∂γ := + integral_mono_of_nonneg + (Filter.Eventually.of_forall fun _ => abs_nonneg _) + henv (Filter.Eventually.of_forall hpoint) + _ = K * γ.real s := by + rw [integral_indicator_const K hs, smul_eq_mul] + ring + have htail : γ.real s ≤ + 2 * Real.exp (-(M ^ 2) / (2 * (2 : ℝ) ^ n)) := by + simpa [γ, s] using + gaussianReal_zero_powTwo_measureReal_abs_ge_le n M hM + calc + ‖rodierGaussianWeightedDensityMoment n p M Δ hM hΔ‖ = + ‖Complex.I ^ p * + rodierGaussianWeightedDensityMoment n p M Δ hM hΔ‖ := by + simp + _ = ‖∫ x : ℝ, ((d x : ℝ) : ℂ) * + (gaussianPDFReal 0 (2 ^ n) x : ℂ)‖ := by + rw [complex_I_pow_mul_rodierGaussianWeightedDensityMoment_eq + hp n M Δ hM hΔ] + _ = ‖∫ x : ℝ, ((d x : ℝ) : ℂ) ∂γ‖ := by rw [hgauss] + _ ≤ K * γ.real s := hnormIntegral + _ ≤ K * (2 * Real.exp (-(M ^ 2) / (2 * (2 : ℝ) ^ n))) := + mul_le_mul_of_nonneg_left htail hK + _ = (2 * C₀) * Δ⁻¹ ^ p * + Real.exp (-(M ^ 2) / (2 * (2 : ℝ) ^ n)) := by + dsimp [K] + ring + +theorem exists_rodierGaussianWeightedDensityMoment_second_exponential_bound : + ∃ C : ℝ, 0 ≤ C ∧ + ∀ (n : ℕ) (M Δ : ℝ) (hM : 0 < M) (hΔ : 0 < Δ), + ‖rodierGaussianWeightedDensityMoment n 2 M Δ hM hΔ‖ ≤ + C * Δ⁻¹ ^ 2 * + Real.exp (-(M ^ 2) / (2 * (2 : ℝ) ^ n)) := by + simpa using + (exists_rodierGaussianWeightedDensityMoment_exponential_bound + (by norm_num : 0 < 2)) + +theorem exists_rodierGaussianWeightedDensityMoment_fourth_exponential_bound : + ∃ C : ℝ, 0 ≤ C ∧ + ∀ (n : ℕ) (M Δ : ℝ) (hM : 0 < M) (hΔ : 0 < Δ), + ‖rodierGaussianWeightedDensityMoment n 4 M Δ hM hΔ‖ ≤ + C * Δ⁻¹ ^ 4 * + Real.exp (-(M ^ 2) / (2 * (2 : ℝ) ^ n)) := by + simpa using + (exists_rodierGaussianWeightedDensityMoment_exponential_bound + (by norm_num : 0 < 4)) + +/-- A one-sided interval already gives an explicit positive lower bound for +Rodier's Gaussian main term. -/ +theorem rodierCutoffGaussianIntegral_re_lower_bound_oneSide + (n : ℕ) (M Δ : ℝ) (hM : 0 < M) (hΔ : 0 < Δ) : + (Real.sqrt (2 * Real.pi * (2 : ℝ) ^ n))⁻¹ * + Real.exp (-((M + 2 * Δ) ^ 2) / (2 * (2 : ℝ) ^ n)) * Δ ≤ + (rodierCutoffGaussianIntegral n M Δ hM hΔ).re := by + let q : ℝ := (2 : ℝ) ^ n + let a : ℝ := M + Δ + let b : ℝ := M + 2 * Δ + let c : ℝ := (Real.sqrt (2 * Real.pi * q))⁻¹ * + Real.exp (-(b ^ 2) / (2 * q)) + let f : ℝ → ℝ := fun x => + gaussianPDFReal 0 (2 ^ n) x * rodierCutoff M Δ x + have hq : 0 < q := by + dsimp [q] + positivity + have ha : 0 < a := by + dsimp [a] + linarith + have hab : a ≤ b := by + dsimp [a, b] + linarith + have hf : Integrable f := by + exact integrable_gaussianPDFReal_mul_rodierCutoff n M Δ hM hΔ + have hfnn (x : ℝ) : 0 ≤ f x := by + exact mul_nonneg (gaussianPDFReal_nonneg 0 (2 ^ n) x) + (rodierCutoff_nonneg M Δ hM hΔ x) + have hinterval (x : ℝ) (hx : x ∈ Set.Icc a b) : c ≤ f x := by + have hax : a ≤ x := hx.1 + have hxb : x ≤ b := hx.2 + have hx0 : 0 ≤ x := ha.le.trans hax + have hb0 : 0 ≤ b := hx0.trans hxb + have hsquare : x ^ 2 ≤ b ^ 2 := by + nlinarith + have hexp : Real.exp (-(b ^ 2) / (2 * q)) ≤ + Real.exp (-(x ^ 2) / (2 * q)) := by + apply Real.exp_le_exp.mpr + apply (div_le_div_iff_of_pos_right (by positivity : 0 < 2 * q)).2 + linarith + have hpdf : c ≤ gaussianPDFReal 0 (2 ^ n) x := by + have hscale : 0 ≤ (Real.sqrt (2 * Real.pi * q))⁻¹ := by positivity + have hmul := mul_le_mul_of_nonneg_left hexp hscale + simpa [c, b, q, gaussianPDFReal] using hmul + have hcutoff : rodierCutoff M Δ x = 1 := by + apply rodierCutoff_eq_one_of_add_le_abs hM hΔ + rw [abs_of_nonneg hx0] + exact hax + dsimp [f] + rw [hcutoff, mul_one] + exact hpdf + calc + (Real.sqrt (2 * Real.pi * (2 : ℝ) ^ n))⁻¹ * + Real.exp (-((M + 2 * Δ) ^ 2) / (2 * (2 : ℝ) ^ n)) * Δ = + c * volume.real (Set.Icc a b) := by + rw [Real.volume_real_Icc_of_le hab] + dsimp [c, a, b, q] + ring + _ ≤ ∫ x in Set.Icc a b, f x := by + exact setIntegral_ge_of_const_le_real measurableSet_Icc + isCompact_Icc.measure_ne_top hinterval hf.integrableOn + _ ≤ ∫ x, f x := by + exact setIntegral_le_integral hf (Filter.Eventually.of_forall hfnn) + _ = (rodierCutoffGaussianIntegral n M Δ hM hΔ).re := by + exact (rodierCutoffGaussianIntegral_re_eq_gaussianDensityIntegral + n M Δ hM hΔ).symm + +/-- The cube cardinality in Rodier's asymptotic parameterization. -/ +noncomputable def rodierAsymptoticQ (n : ℕ) : ℝ := + (2 : ℝ) ^ n + +/-- A transition width of order `sqrt(2^n / n)`, sufficient for the sharp +lower spectral tail. -/ +noncomputable def rodierAsymptoticDelta (n : ℕ) : ℝ := + Real.sqrt (rodierAsymptoticQ n) / Real.sqrt (n : ℝ) + +/-- The raw-Walsh form of Rodier's lower spectral threshold. -/ +noncomputable def rodierAsymptoticM (n : ℕ) : ℝ := + Real.sqrt (rodierAsymptoticQ n) * Real.sqrt (n : ℝ) * + (Real.sqrt (2 * Real.log 2) - + 5 * Real.log (n : ℝ) / (n : ℝ)) + +theorem rodierAsymptoticQ_pos (n : ℕ) : + 0 < rodierAsymptoticQ n := by + unfold rodierAsymptoticQ + positivity + +theorem rodierAsymptoticDelta_pos {n : ℕ} (hn : 0 < n) : + 0 < rodierAsymptoticDelta n := by + unfold rodierAsymptoticDelta + have hnℝ : (0 : ℝ) < n := by exact_mod_cast hn + exact div_pos (Real.sqrt_pos.2 (rodierAsymptoticQ_pos n)) + (Real.sqrt_pos.2 hnℝ) + +/-- The raw cutoff center is exactly `2^n` times the normalized threshold +used in the final Fourier-infinity event. -/ +theorem rodierAsymptoticM_eq_q_mul_threshold (n : ℕ) : + rodierAsymptoticM n = + rodierAsymptoticQ n * rodierRandomFourierLowerThreshold n := by + rw [rodierAsymptoticM, rodierAsymptoticQ, + rodierRandomFourierLowerThreshold, sqrt_two_pow_eq_rpow] + have hscale : + (2 : ℝ) ^ n * (2 : ℝ) ^ (-(n : ℝ) / 2) = + (2 : ℝ) ^ ((n : ℝ) / 2) := by + rw [← Real.rpow_natCast, ← Real.rpow_add (by norm_num : (0 : ℝ) < 2)] + congr 1 + ring + rw [← hscale] + ring + +/-- The dimension-scale numerator appearing after normalizing Rodier's +Gaussian exponent. -/ +noncomputable def rodierAsymptoticExponentNumerator (n : ℕ) : ℝ := + (n : ℝ) * Real.sqrt (2 * Real.log 2) - + 5 * Real.log (n : ℝ) + 2 + +theorem rodierAsymptoticM_add_two_delta_eq + {n : ℕ} (hn : 0 < n) : + rodierAsymptoticM n + 2 * rodierAsymptoticDelta n = + Real.sqrt (rodierAsymptoticQ n) / Real.sqrt (n : ℝ) * + rodierAsymptoticExponentNumerator n := by + have hnℝ : (0 : ℝ) < n := by exact_mod_cast hn + have hnne : (n : ℝ) ≠ 0 := ne_of_gt hnℝ + have hsqrtne : Real.sqrt (n : ℝ) ≠ 0 := ne_of_gt (Real.sqrt_pos.2 hnℝ) + have hsqrt : Real.sqrt (n : ℝ) ^ 2 = (n : ℝ) := + Real.sq_sqrt hnℝ.le + unfold rodierAsymptoticM rodierAsymptoticDelta + rodierAsymptoticExponentNumerator + field_simp [hnne, hsqrtne] + rw [hsqrt] + ring + +theorem rodierAsymptotic_gaussianExponent_eq + {n : ℕ} (hn : 0 < n) : + (rodierAsymptoticM n + 2 * rodierAsymptoticDelta n) ^ 2 / + (2 * rodierAsymptoticQ n) = + rodierAsymptoticExponentNumerator n ^ 2 / (2 * (n : ℝ)) := by + have hnℝ : (0 : ℝ) < n := by exact_mod_cast hn + have hnne : (n : ℝ) ≠ 0 := ne_of_gt hnℝ + have hqne : rodierAsymptoticQ n ≠ 0 := + ne_of_gt (rodierAsymptoticQ_pos n) + have hsqrtnne : Real.sqrt (n : ℝ) ≠ 0 := + ne_of_gt (Real.sqrt_pos.2 hnℝ) + have hsqrtn : Real.sqrt (n : ℝ) ^ 2 = (n : ℝ) := + Real.sq_sqrt hnℝ.le + have hsqrtq : Real.sqrt (rodierAsymptoticQ n) ^ 2 = + rodierAsymptoticQ n := + Real.sq_sqrt (rodierAsymptoticQ_pos n).le + rw [rodierAsymptoticM_add_two_delta_eq hn] + field_simp [hnne, hqne, hsqrtnne] + rw [hsqrtn, hsqrtq] + ring + +private theorem tendsto_rodierLogSqDivNat : + Filter.Tendsto + (fun n : ℕ => Real.log (n : ℝ) ^ 2 / (n : ℝ)) + Filter.atTop (nhds 0) := by + have h := (Real.isLittleO_pow_log_id_atTop (n := 2)).comp_tendsto + (tendsto_natCast_atTop_atTop (R := ℝ)) + simpa [Function.comp_def] using h.tendsto_div_nhds_zero + +private theorem tendsto_rodierLogDivNat : + Filter.Tendsto + (fun n : ℕ => Real.log (n : ℝ) / (n : ℝ)) + Filter.atTop (nhds 0) := by + have h := Real.isLittleO_log_id_atTop.comp_tendsto + (tendsto_natCast_atTop_atTop (R := ℝ)) + simpa [Function.comp_def] using h.tendsto_div_nhds_zero + +private theorem tendsto_rodierInvNat : + Filter.Tendsto (fun n : ℕ => (1 : ℝ) / (n : ℝ)) + Filter.atTop (nhds 0) := by + have h := (Real.isLittleO_pow_log_id_atTop (n := 0)).comp_tendsto + (tendsto_natCast_atTop_atTop (R := ℝ)) + simpa [Function.comp_def] using h.tendsto_div_nhds_zero + +private theorem eventually_rodierExponentRemainder_le_one : + ∀ᶠ n : ℕ in Filter.atTop, + (25 * Real.log (n : ℝ) ^ 2 - 20 * Real.log (n : ℝ) + 4) / + (2 * (n : ℝ)) ≤ 1 := by + have hmajor : Filter.Tendsto + (fun n : ℕ => + (25 / 2 : ℝ) * (Real.log (n : ℝ) ^ 2 / (n : ℝ)) + + 2 * ((1 : ℝ) / (n : ℝ))) + Filter.atTop (nhds 0) := by + simpa using + (tendsto_rodierLogSqDivNat.const_mul (25 / 2)).add + (tendsto_rodierInvNat.const_mul 2) + have hsmall : ∀ᶠ n : ℕ in Filter.atTop, + (25 / 2 : ℝ) * (Real.log (n : ℝ) ^ 2 / (n : ℝ)) + + 2 * ((1 : ℝ) / (n : ℝ)) < 1 := + hmajor.eventually (Iio_mem_nhds (by norm_num : (0 : ℝ) < 1)) + filter_upwards [hsmall, Filter.eventually_ge_atTop 1] with n hnsmall hn + have hnℝ : (0 : ℝ) < n := by exact_mod_cast hn + have hlog : 0 ≤ Real.log (n : ℝ) := + Real.log_nonneg (by exact_mod_cast hn) + have hremMajor : + (25 * Real.log (n : ℝ) ^ 2 - 20 * Real.log (n : ℝ) + 4) / + (2 * (n : ℝ)) ≤ + (25 / 2 : ℝ) * (Real.log (n : ℝ) ^ 2 / (n : ℝ)) + + 2 * ((1 : ℝ) / (n : ℝ)) := by + calc + _ ≤ (25 * Real.log (n : ℝ) ^ 2 + 4) / (2 * (n : ℝ)) := by + apply (div_le_div_iff_of_pos_right + (by positivity : (0 : ℝ) < 2 * n)).2 + nlinarith + _ = _ := by + field_simp + ring + exact hremMajor.trans hnsmall.le + +/-- At Rodier's threshold and transition scale, the normalized Gaussian +exponent loses at most five logarithmic powers and a fixed constant. -/ +theorem eventually_rodierAsymptotic_gaussianExponent_le : + ∀ᶠ n : ℕ in Filter.atTop, + (rodierAsymptoticM n + 2 * rodierAsymptoticDelta n) ^ 2 / + (2 * rodierAsymptoticQ n) ≤ + (n : ℝ) * Real.log 2 - 5 * Real.log (n : ℝ) + 5 := by + filter_upwards [eventually_rodierExponentRemainder_le_one, + Filter.eventually_ge_atTop 1] with n hrem hn + have hnpos : 0 < n := Nat.zero_lt_of_lt hn + have hnℝ : (0 : ℝ) < n := by exact_mod_cast hnpos + have hnne : (n : ℝ) ≠ 0 := ne_of_gt hnℝ + have hlog : 0 ≤ Real.log (n : ℝ) := + Real.log_nonneg (by exact_mod_cast hn) + let c : ℝ := Real.sqrt (2 * Real.log 2) + have hc₁ : 1 ≤ c := by + dsimp [c] + rw [Real.one_le_sqrt] + nlinarith [Real.log_two_gt_d9] + have hc₂ : c ≤ 2 := by + dsimp [c] + rw [Real.sqrt_le_iff] + constructor + · norm_num + · nlinarith [Real.log_two_lt_d9] + have hcsq : c ^ 2 = 2 * Real.log 2 := by + dsimp [c] + exact Real.sq_sqrt (by positivity) + have hclog : Real.log (n : ℝ) ≤ c * Real.log (n : ℝ) := + by simpa using mul_le_mul_of_nonneg_right hc₁ hlog + rw [rodierAsymptotic_gaussianExponent_eq hnpos] + have hexpand : + rodierAsymptoticExponentNumerator n ^ 2 / (2 * (n : ℝ)) = + (n : ℝ) * Real.log 2 - + 5 * c * Real.log (n : ℝ) + 2 * c + + (25 * Real.log (n : ℝ) ^ 2 - + 20 * Real.log (n : ℝ) + 4) / (2 * (n : ℝ)) := by + unfold rodierAsymptoticExponentNumerator + change + ((n : ℝ) * c - 5 * Real.log (n : ℝ) + 2) ^ 2 / + (2 * (n : ℝ)) = _ + calc + _ = (((n : ℝ) ^ 2 * c ^ 2 - + 10 * (n : ℝ) * c * Real.log (n : ℝ) + + 4 * (n : ℝ) * c + + 25 * Real.log (n : ℝ) ^ 2 - + 20 * Real.log (n : ℝ) + 4) / + (2 * (n : ℝ))) := by ring + _ = _ := by + rw [hcsq] + field_simp [hnne] + ring + rw [hexpand] + nlinarith + +/-- Rodier's asymptotic cutoff parameters are eventually admissible. -/ +theorem eventually_rodierAsymptotic_parameters : + ∀ᶠ n : ℕ in Filter.atTop, + 0 < n ∧ 0 < rodierAsymptoticM n ∧ + 0 < rodierAsymptoticDelta n ∧ + rodierAsymptoticDelta n ≤ rodierAsymptoticM n := by + have hscaled : Filter.Tendsto + (fun n : ℕ => 5 * (Real.log (n : ℝ) / (n : ℝ))) + Filter.atTop (nhds 0) := by + simpa using tendsto_rodierLogDivNat.const_mul 5 + have hsmall : ∀ᶠ n : ℕ in Filter.atTop, + 5 * (Real.log (n : ℝ) / (n : ℝ)) < (1 / 2 : ℝ) := + hscaled.eventually (Iio_mem_nhds (by norm_num : (0 : ℝ) < 1 / 2)) + filter_upwards [hsmall, Filter.eventually_ge_atTop 2] with n hsmall hn + have hnpos : 0 < n := Nat.zero_lt_of_lt (hn.trans' (by omega : 0 < 2)) + have hnℝ : (0 : ℝ) < n := by exact_mod_cast hnpos + have hnℝTwo : (2 : ℝ) ≤ n := by exact_mod_cast hn + have hsqrtnpos : 0 < Real.sqrt (n : ℝ) := Real.sqrt_pos.2 hnℝ + have hsqrtn : Real.sqrt (n : ℝ) ^ 2 = (n : ℝ) := + Real.sq_sqrt hnℝ.le + have hsqrtqpos : 0 < Real.sqrt (rodierAsymptoticQ n) := + Real.sqrt_pos.2 (rodierAsymptoticQ_pos n) + have hc : 1 ≤ Real.sqrt (2 * Real.log 2) := by + rw [Real.one_le_sqrt] + nlinarith [Real.log_two_gt_d9] + let a : ℝ := Real.sqrt (2 * Real.log 2) - + 5 * Real.log (n : ℝ) / (n : ℝ) + have hsmall' : + 5 * Real.log (n : ℝ) / (n : ℝ) < (1 / 2 : ℝ) := by + calc + _ = 5 * (Real.log (n : ℝ) / (n : ℝ)) := by ring + _ < _ := hsmall + have ha : (1 / 2 : ℝ) < a := by + dsimp [a] + nlinarith [hsmall'] + have hna : 1 ≤ (n : ℝ) * a := by + nlinarith + have hM : 0 < rodierAsymptoticM n := by + unfold rodierAsymptoticM + change 0 < Real.sqrt (rodierAsymptoticQ n) * Real.sqrt (n : ℝ) * a + exact mul_pos (mul_pos hsqrtqpos hsqrtnpos) (by linarith [ha]) + have hΔ : 0 < rodierAsymptoticDelta n := + rodierAsymptoticDelta_pos hnpos + have hΔM : rodierAsymptoticDelta n ≤ rodierAsymptoticM n := by + rw [rodierAsymptoticDelta] + apply (div_le_iff₀ hsqrtnpos).2 + calc + Real.sqrt (rodierAsymptoticQ n) = + Real.sqrt (rodierAsymptoticQ n) * 1 := by ring + _ ≤ Real.sqrt (rodierAsymptoticQ n) * ((n : ℝ) * a) := + mul_le_mul_of_nonneg_left hna hsqrtqpos.le + _ = rodierAsymptoticM n * Real.sqrt (n : ℝ) := by + unfold rodierAsymptoticM + change Real.sqrt (rodierAsymptoticQ n) * ((n : ℝ) * a) = + Real.sqrt (rodierAsymptoticQ n) * Real.sqrt (n : ℝ) * a * + Real.sqrt (n : ℝ) + calc + _ = Real.sqrt (rodierAsymptoticQ n) * + (Real.sqrt (n : ℝ) ^ 2 * a) := by rw [hsqrtn] + _ = _ := by ring + exact ⟨hnpos, hM, hΔ, hΔM⟩ + +/-- The Gaussian factor at Rodier's cutoff center retains five powers of the +dimension beyond the cube-cardinality decay. -/ +theorem eventually_rodierAsymptotic_exp_lower_bound : + ∀ᶠ n : ℕ in Filter.atTop, + Real.exp (-5) * (n : ℝ) ^ 5 / rodierAsymptoticQ n ≤ + Real.exp + (-((rodierAsymptoticM n + 2 * rodierAsymptoticDelta n) ^ 2) / + (2 * rodierAsymptoticQ n)) := by + filter_upwards [eventually_rodierAsymptotic_gaussianExponent_le, + Filter.eventually_ge_atTop 1] with n hexponent hn + have hnpos : 0 < n := Nat.zero_lt_of_lt hn + have hnℝ : (0 : ℝ) < n := by exact_mod_cast hnpos + have hidentity : + Real.exp + (-((n : ℝ) * Real.log 2 - 5 * Real.log (n : ℝ) + 5)) = + Real.exp (-5) * (n : ℝ) ^ 5 / rodierAsymptoticQ n := by + rw [rodierAsymptoticQ] + calc + _ = Real.exp (-5) * Real.exp (5 * Real.log (n : ℝ)) * + Real.exp (-((n : ℝ) * Real.log 2)) := by + rw [← Real.exp_add, ← Real.exp_add] + congr 1 + ring + _ = Real.exp (-5) * (n : ℝ) ^ 5 * ((2 : ℝ) ^ n)⁻¹ := by + rw [show 5 * Real.log (n : ℝ) = + (5 : ℕ) * Real.log (n : ℝ) by norm_num, + Real.exp_nat_mul, Real.exp_log hnℝ, + Real.exp_neg ((n : ℝ) * Real.log 2), + Real.exp_nat_mul, Real.exp_log (by norm_num : (0 : ℝ) < 2)] + _ = _ := by rw [div_eq_mul_inv] + rw [← hidentity] + apply Real.exp_le_exp.mpr + simpa [neg_div] using neg_le_neg hexponent + +/-- The Gaussian main term, multiplied by the number of Walsh characters, +eventually dominates a fixed positive multiple of `n⁵ / sqrt n`. -/ +theorem eventually_rodierCutoffGaussianIntegral_scaled_lower_bound : + ∀ᶠ n : ℕ in Filter.atTop, + ∀ (hM : 0 < rodierAsymptoticM n) + (hΔ : 0 < rodierAsymptoticDelta n), + Real.exp (-5) * (n : ℝ) ^ 5 / + (Real.sqrt (2 * Real.pi) * Real.sqrt (n : ℝ)) ≤ + rodierAsymptoticQ n * + (rodierCutoffGaussianIntegral n + (rodierAsymptoticM n) (rodierAsymptoticDelta n) hM hΔ).re := by + filter_upwards [eventually_rodierAsymptotic_exp_lower_bound, + Filter.eventually_ge_atTop 1] with n hexp hn + intro hM hΔ + have hnpos : 0 < n := Nat.zero_lt_of_lt hn + have hnℝ : (0 : ℝ) < n := by exact_mod_cast hnpos + have hq : 0 < rodierAsymptoticQ n := rodierAsymptoticQ_pos n + have hqne : rodierAsymptoticQ n ≠ 0 := ne_of_gt hq + have hsqrtqne : Real.sqrt (rodierAsymptoticQ n) ≠ 0 := + ne_of_gt (Real.sqrt_pos.2 hq) + have hsqrtnne : Real.sqrt (n : ℝ) ≠ 0 := + ne_of_gt (Real.sqrt_pos.2 hnℝ) + have hmain := rodierCutoffGaussianIntegral_re_lower_bound_oneSide n + (rodierAsymptoticM n) (rodierAsymptoticDelta n) hM hΔ + have hpref : 0 ≤ + (Real.sqrt (2 * Real.pi * rodierAsymptoticQ n))⁻¹ := by positivity + have hΔnonneg : 0 ≤ rodierAsymptoticDelta n := hΔ.le + have hreplace : + (Real.sqrt (2 * Real.pi * rodierAsymptoticQ n))⁻¹ * + (Real.exp (-5) * (n : ℝ) ^ 5 / rodierAsymptoticQ n) * + rodierAsymptoticDelta n ≤ + (Real.sqrt (2 * Real.pi * rodierAsymptoticQ n))⁻¹ * + Real.exp + (-((rodierAsymptoticM n + 2 * rodierAsymptoticDelta n) ^ 2) / + (2 * rodierAsymptoticQ n)) * + rodierAsymptoticDelta n := by + exact mul_le_mul_of_nonneg_right + (mul_le_mul_of_nonneg_left hexp hpref) hΔnonneg + have hmain' : + (Real.sqrt (2 * Real.pi * rodierAsymptoticQ n))⁻¹ * + Real.exp + (-((rodierAsymptoticM n + 2 * rodierAsymptoticDelta n) ^ 2) / + (2 * rodierAsymptoticQ n)) * + rodierAsymptoticDelta n ≤ + (rodierCutoffGaussianIntegral n + (rodierAsymptoticM n) (rodierAsymptoticDelta n) hM hΔ).re := by + simpa [rodierAsymptoticQ] using hmain + calc + Real.exp (-5) * (n : ℝ) ^ 5 / + (Real.sqrt (2 * Real.pi) * Real.sqrt (n : ℝ)) = + rodierAsymptoticQ n * + ((Real.sqrt (2 * Real.pi * rodierAsymptoticQ n))⁻¹ * + (Real.exp (-5) * (n : ℝ) ^ 5 / rodierAsymptoticQ n) * + rodierAsymptoticDelta n) := by + rw [rodierAsymptoticDelta, + show 2 * Real.pi * rodierAsymptoticQ n = + (2 * Real.pi) * rodierAsymptoticQ n by ring, + Real.sqrt_mul (by positivity : (0 : ℝ) ≤ 2 * Real.pi)] + field_simp [hqne, hsqrtqne, hsqrtnne] + _ ≤ rodierAsymptoticQ n * + ((Real.sqrt (2 * Real.pi * rodierAsymptoticQ n))⁻¹ * + Real.exp + (-((rodierAsymptoticM n + 2 * rodierAsymptoticDelta n) ^ 2) / + (2 * rodierAsymptoticQ n)) * + rodierAsymptoticDelta n) := + mul_le_mul_of_nonneg_left hreplace hq.le + _ ≤ _ := mul_le_mul_of_nonneg_left hmain' hq.le + +theorem tendsto_rodierScaledGaussianLower_atTop : + Filter.Tendsto + (fun n : ℕ => Real.exp (-5) * (n : ℝ) ^ 5 / + (Real.sqrt (2 * Real.pi) * Real.sqrt (n : ℝ))) + Filter.atTop Filter.atTop := by + let C : ℝ := Real.exp (-5) / Real.sqrt (2 * Real.pi) + have hC : 0 < C := by + dsimp [C] + positivity + have hnTop : Filter.Tendsto (fun n : ℕ => (n : ℝ)) + Filter.atTop Filter.atTop := tendsto_natCast_atTop_atTop + have hnFour : Filter.Tendsto (fun n : ℕ => (n : ℝ) ^ 4) + Filter.atTop Filter.atTop := by + rw [Filter.tendsto_atTop] + intro b + filter_upwards [hnTop.eventually (Filter.eventually_ge_atTop b), + Filter.eventually_ge_atTop 1] with n hnb hn + have hnℝ : (1 : ℝ) ≤ n := by exact_mod_cast hn + exact hnb.trans (by nlinarith [sq_nonneg ((n : ℝ) ^ 2 - n)]) + have hpoly : Filter.Tendsto (fun n : ℕ => C * (n : ℝ) ^ 4) + Filter.atTop Filter.atTop := hnFour.const_mul_atTop hC + apply Filter.tendsto_atTop_mono' Filter.atTop _ hpoly + filter_upwards [Filter.eventually_ge_atTop 1] with n hn + have hnℝ : (1 : ℝ) ≤ n := by exact_mod_cast hn + have hsqrtPos : 0 < Real.sqrt (n : ℝ) := by positivity + have hsqrtLe : Real.sqrt (n : ℝ) ≤ (n : ℝ) := by + rw [Real.sqrt_le_iff] + constructor + · exact hnℝ.trans' (by norm_num) + · nlinarith + dsimp [C] + rw [show Real.exp (-5) * (n : ℝ) ^ 5 / + (Real.sqrt (2 * Real.pi) * Real.sqrt (n : ℝ)) = + (Real.exp (-5) / Real.sqrt (2 * Real.pi)) * (n : ℝ) ^ 5 / + Real.sqrt (n : ℝ) by ring] + rw [le_div_iff₀ hsqrtPos] + have hconst : 0 ≤ Real.exp (-5) / Real.sqrt (2 * Real.pi) := by positivity + calc + (Real.exp (-5) / Real.sqrt (2 * Real.pi)) * (n : ℝ) ^ 4 * + Real.sqrt (n : ℝ) ≤ + (Real.exp (-5) / Real.sqrt (2 * Real.pi)) * (n : ℝ) ^ 4 * + (n : ℝ) := by gcongr + _ = (Real.exp (-5) / Real.sqrt (2 * Real.pi)) * (n : ℝ) ^ 5 := by ring + +end CryptBoolean diff --git a/CryptBoolean/Carlet/Chapter04/RodierLowerTail.lean b/CryptBoolean/Carlet/Chapter04/RodierLowerTail.lean new file mode 100644 index 0000000..300e141 --- /dev/null +++ b/CryptBoolean/Carlet/Chapter04/RodierLowerTail.lean @@ -0,0 +1,4010 @@ +/- +Copyright (c) 2026 Asher Yan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Asher Yan with Codex +-/ +module + +public import CryptBoolean.Carlet.Chapter04.RandomNonlinearityAsymptotics +public import Mathlib.Analysis.Distribution.SchwartzSpace.Fourier +public import Mathlib.Analysis.SpecialFunctions.ImproperIntegrals +public import Mathlib.Analysis.SpecialFunctions.SmoothTransition +public import Mathlib.MeasureTheory.Measure.Complex +public import Mathlib.MeasureTheory.VectorMeasure.WithDensityVec +public import Mathlib.Probability.Moments.Variance + +/-! +# Rodier's lower spectral-amplitude tail + +Exact two-character moment identities used in Rodier's second-moment argument. +-/ + +open Finset MeasureTheory +open scoped BigOperators BooleanCube ENNReal FourierTransform Topology + +@[expose] public section + +namespace CryptBoolean + +variable {n : ℕ} + +local instance rodierLowerTailSignMeasurableSpace : MeasurableSpace FABL.Sign := ⊤ + +local instance rodierLowerTailSignMeasurableSingletonClass : + MeasurableSingletonClass FABL.Sign where + measurableSet_singleton _ := by simp + +/-- Rodier's lower spectral-amplitude threshold in FABL's normalized Fourier +scale. -/ +noncomputable def rodierRandomFourierLowerThreshold (n : ℕ) : ℝ := + Real.sqrt (n : ℝ) * + (Real.sqrt (2 * Real.log 2) - + 5 * Real.log (n : ℝ) / (n : ℝ)) * + (2 : ℝ) ^ (-(n : ℝ) / 2) + +/-- The upper endpoint of Rodier's random-nonlinearity interval. -/ +noncomputable def rodierRandomNonlinearityUpperThreshold (n : ℕ) : ℝ := + (2 : ℝ) ^ n / 2 - + (2 : ℝ) ^ n * rodierRandomFourierLowerThreshold n / 2 + +/-- Rodier's upper nonlinearity endpoint in Carlet's displayed normalization. -/ +theorem rodierRandomNonlinearityUpperThreshold_eq_displayed (n : ℕ) : + rodierRandomNonlinearityUpperThreshold n = + (2 : ℝ) ^ ((n : ℝ) - 1) - + (2 : ℝ) ^ ((n : ℝ) / 2 - 1) * Real.sqrt (n : ℝ) * + (Real.sqrt (2 * Real.log 2) - + 5 * Real.log (n : ℝ) / (n : ℝ)) := by + have hfirst : + (2 : ℝ) ^ n / 2 = (2 : ℝ) ^ ((n : ℝ) - 1) := by + rw [← Real.rpow_natCast] + simpa using + (Real.rpow_sub (x := (2 : ℝ)) (by norm_num : (0 : ℝ) < 2) + (n : ℝ) 1).symm + have hscale : + (2 : ℝ) ^ n * (2 : ℝ) ^ (-(n : ℝ) / 2) / 2 = + (2 : ℝ) ^ ((n : ℝ) / 2 - 1) := by + rw [← Real.rpow_natCast, div_eq_mul_inv, ← Real.rpow_neg_one, + ← Real.rpow_add (by norm_num : (0 : ℝ) < 2), + ← Real.rpow_add (by norm_num : (0 : ℝ) < 2)] + congr 1 + ring + rw [rodierRandomNonlinearityUpperThreshold, + rodierRandomFourierLowerThreshold, hfirst] + rw [show + (2 : ℝ) ^ n * + (Real.sqrt (n : ℝ) * + (Real.sqrt (2 * Real.log 2) - + 5 * Real.log (n : ℝ) / (n : ℝ)) * + (2 : ℝ) ^ (-(n : ℝ) / 2)) / + 2 = + ((2 : ℝ) ^ n * (2 : ℝ) ^ (-(n : ℝ) / 2) / 2) * + Real.sqrt (n : ℝ) * + (Real.sqrt (2 * Real.log 2) - + 5 * Real.log (n : ℝ) / (n : ℝ)) by ring, + hscale] + +/-- Relation (35) converts a strict lower bound for the normalized spectral +maximum into the matching upper bound for nonlinearity. -/ +theorem nonlinearity_lt_rodierRandomNonlinearityUpperThreshold + (g : FABL.BooleanFunction n) + (h : rodierRandomFourierLowerThreshold n < + FABL.fourierInfinityNorm g.toReal) : + (nonlinearity (FABL.booleanFunctionF₂Encoding g) : ℝ) < + rodierRandomNonlinearityUpperThreshold n := by + rw [nonlinearity_encoding_eq_fourierInfinityNorm, + rodierRandomNonlinearityUpperThreshold] + have hmul := mul_lt_mul_of_pos_left h + (show 0 < (2 : ℝ) ^ n / 2 by positivity) + have hmul' : + (2 : ℝ) ^ n * rodierRandomFourierLowerThreshold n / 2 < + (2 : ℝ) ^ n * FABL.fourierInfinityNorm g.toReal / 2 := by + simpa [div_eq_mul_inv, mul_assoc, mul_left_comm, mul_comm] using hmul + exact sub_lt_sub_left hmul' ((2 : ℝ) ^ n / 2) + +/-- The uniform probability of Rodier's lower spectral-amplitude event. -/ +noncomputable def rodierRandomFourierLowerProbability (n : ℕ) : ℝ := + (FABL.uniformPMF (FABL.BooleanFunction n)).toMeasure.real + {g | rodierRandomFourierLowerThreshold n < + FABL.fourierInfinityNorm g.toReal} + +/-- The uniform probability that nonlinearity lies below Rodier's displayed +upper endpoint. -/ +noncomputable def rodierRandomNonlinearityUpperProbability (n : ℕ) : ℝ := + (FABL.uniformPMF (FABL.BooleanFunction n)).toMeasure.real + {g | (nonlinearity (FABL.booleanFunctionF₂Encoding g) : ℝ) < + rodierRandomNonlinearityUpperThreshold n} + +/-- Relation (35) transports the lower spectral-amplitude event into the +upper nonlinearity event. -/ +theorem rodierRandomFourierLowerProbability_le_nonlinearityUpperProbability + (n : ℕ) : + rodierRandomFourierLowerProbability n ≤ + rodierRandomNonlinearityUpperProbability n := by + unfold rodierRandomFourierLowerProbability + rodierRandomNonlinearityUpperProbability + apply measureReal_mono (h₂ := measure_ne_top _ _) + intro g hg + exact nonlinearity_lt_rodierRandomNonlinearityUpperThreshold g hg + +/-- The missing analytic lower-tail limit is sufficient for Rodier's upper +nonlinearity endpoint. -/ +theorem tendsto_rodierRandomNonlinearityUpperProbability_of_fourierLower + (h : Filter.Tendsto rodierRandomFourierLowerProbability + Filter.atTop (nhds 1)) : + Filter.Tendsto rodierRandomNonlinearityUpperProbability + Filter.atTop (nhds 1) := by + apply tendsto_of_tendsto_of_tendsto_of_le_of_le h tendsto_const_nhds + · exact rodierRandomFourierLowerProbability_le_nonlinearityUpperProbability + · intro n + unfold rodierRandomNonlinearityUpperProbability + exact measureReal_le_one + + +/-- The right transition in Rodier's cutoff. -/ +noncomputable def rodierRightCutoff (M Δ x : ℝ) : ℝ := + Real.smoothTransition ((x - M) / Δ) + +/-- Rodier's smooth cutoff `u_{M,Δ}`. -/ +noncomputable def rodierCutoff (M Δ x : ℝ) : ℝ := + rodierRightCutoff M Δ x + rodierRightCutoff M Δ (-x) + +theorem rodierCutoff_nonneg (M Δ : ℝ) (_hM : 0 < M) (_hΔ : 0 < Δ) + (x : ℝ) : + 0 ≤ rodierCutoff M Δ x := by + exact add_nonneg (Real.smoothTransition.nonneg _) + (Real.smoothTransition.nonneg _) + +theorem rodierCutoff_le_one (M Δ : ℝ) (hM : 0 < M) (hΔ : 0 < Δ) + (x : ℝ) : + rodierCutoff M Δ x ≤ 1 := by + rcases le_or_gt x M with hx | hx + · have hz : rodierRightCutoff M Δ x = 0 := by + apply Real.smoothTransition.zero_of_nonpos + exact div_nonpos_of_nonpos_of_nonneg (sub_nonpos.mpr hx) hΔ.le + rw [rodierCutoff, hz, zero_add] + exact Real.smoothTransition.le_one _ + · have hz : rodierRightCutoff M Δ (-x) = 0 := by + apply Real.smoothTransition.zero_of_nonpos + apply div_nonpos_of_nonpos_of_nonneg + · linarith + · exact hΔ.le + rw [rodierCutoff, hz, add_zero] + exact Real.smoothTransition.le_one _ + +theorem rodierCutoff_eq_zero_of_abs_le + {M Δ x : ℝ} (_hM : 0 < M) (hΔ : 0 < Δ) (hx : |x| ≤ M) : + rodierCutoff M Δ x = 0 := by + have hx₁ : x ≤ M := (abs_le.mp hx).2 + have hx₂ : -x ≤ M := by linarith [(abs_le.mp hx).1] + unfold rodierCutoff rodierRightCutoff + rw [Real.smoothTransition.zero_of_nonpos + (div_nonpos_of_nonpos_of_nonneg (sub_nonpos.mpr hx₁) hΔ.le), + Real.smoothTransition.zero_of_nonpos + (div_nonpos_of_nonpos_of_nonneg (sub_nonpos.mpr hx₂) hΔ.le), + add_zero] + +theorem rodierCutoff_eq_one_of_add_le_abs + {M Δ x : ℝ} (hM : 0 < M) (hΔ : 0 < Δ) (hx : M + Δ ≤ |x|) : + rodierCutoff M Δ x = 1 := by + rcases le_total 0 x with hx0 | hx0 + · have hpos : M + Δ ≤ x := by simpa [abs_of_nonneg hx0] using hx + have hone : rodierRightCutoff M Δ x = 1 := by + apply Real.smoothTransition.one_of_one_le + rw [one_le_div hΔ] + linarith + have hzero : rodierRightCutoff M Δ (-x) = 0 := by + apply Real.smoothTransition.zero_of_nonpos + apply div_nonpos_of_nonpos_of_nonneg + · linarith + · exact hΔ.le + rw [rodierCutoff, hone, hzero, add_zero] + · have hneg : M + Δ ≤ -x := by simpa [abs_of_nonpos hx0] using hx + have hone : rodierRightCutoff M Δ (-x) = 1 := by + apply Real.smoothTransition.one_of_one_le + rw [one_le_div hΔ] + linarith + have hzero : rodierRightCutoff M Δ x = 0 := by + apply Real.smoothTransition.zero_of_nonpos + apply div_nonpos_of_nonpos_of_nonneg + · linarith + · exact hΔ.le + rw [rodierCutoff, hone, hzero, zero_add] + +private theorem rodierRightCutoff_contDiff {m : ℕ∞} (M Δ : ℝ) : + ContDiff ℝ m (rodierRightCutoff M Δ) := by + unfold rodierRightCutoff + fun_prop + +theorem rodierCutoff_contDiff + (M Δ : ℝ) (_hM : 0 < M) (_hΔ : 0 < Δ) : + ContDiff ℝ (⊤ : ℕ∞) (rodierCutoff M Δ) := by + exact (rodierRightCutoff_contDiff M Δ).add + ((rodierRightCutoff_contDiff M Δ).comp (by fun_prop)) + +/-- The `p`th derivative of Rodier's cutoff has the exact `Δ⁻ᵖ` scaling. -/ +theorem iteratedDeriv_rodierCutoff (p : ℕ) (M Δ x : ℝ) : + iteratedDeriv p (rodierCutoff M Δ) x = + Δ⁻¹ ^ p * + (iteratedDeriv p Real.smoothTransition ((x - M) / Δ) + + (-1 : ℝ) ^ p * + iteratedDeriv p Real.smoothTransition ((-x - M) / Δ)) := by + have hright (y : ℝ) : + iteratedDeriv p (rodierRightCutoff M Δ) y = + Δ⁻¹ ^ p * + iteratedDeriv p Real.smoothTransition ((y - M) / Δ) := by + unfold rodierRightCutoff + rw [show (fun z : ℝ => Real.smoothTransition ((z - M) / Δ)) = + fun z => (fun w => Real.smoothTransition (Δ⁻¹ * w)) (z - M) by + funext z + simp [div_eq_mul_inv, mul_comm]] + rw [congrFun (iteratedDeriv_comp_sub_const p + (fun w => Real.smoothTransition (Δ⁻¹ * w)) M) y] + rw [congrFun (iteratedDeriv_comp_const_mul + (Real.smoothTransition.contDiff : ContDiff ℝ p Real.smoothTransition) + Δ⁻¹) (y - M)] + simp [div_eq_mul_inv, mul_comm] + change iteratedDeriv p + (rodierRightCutoff M Δ + fun z => rodierRightCutoff M Δ (-z)) x = _ + rw [iteratedDeriv_add (n := p) (f := rodierRightCutoff M Δ) + (g := fun z => rodierRightCutoff M Δ (-z)) + (rodierRightCutoff_contDiff (m := p) M Δ).contDiffAt + ((rodierRightCutoff_contDiff (m := p) M Δ).comp (by fun_prop)).contDiffAt] + rw [hright, iteratedDeriv_comp_neg, hright] + ring + +private theorem smoothTransition_iteratedDeriv_hasCompactSupport + {p : ℕ} (hp : 0 < p) : + HasCompactSupport (iteratedDeriv p Real.smoothTransition) := by + refine HasCompactSupport.intro (K := Set.Icc (0 : ℝ) 1) isCompact_Icc ?_ + intro x hx + have hx' : x < 0 ∨ 1 < x := by + simp only [Set.mem_Icc, not_and_or, not_le] at hx + exact hx + rcases hx' with hxneg | hxpos + · have heq : Real.smoothTransition =ᶠ[𝓝 x] (fun _ : ℝ => 0) := by + filter_upwards [Iio_mem_nhds hxneg] with y hy + exact Real.smoothTransition.zero_of_nonpos hy.le + rw [heq.iteratedDeriv_eq p] + simp + · have heq : Real.smoothTransition =ᶠ[𝓝 x] (fun _ : ℝ => 1) := by + filter_upwards [Ioi_mem_nhds hxpos] with y hy + exact Real.smoothTransition.one_of_one_le hy.le + rw [heq.iteratedDeriv_eq p] + simp [iteratedDeriv_const, hp.ne'] + +private theorem exists_smoothTransition_iteratedDeriv_bound + {p : ℕ} (hp : 0 < p) : + ∃ C : ℝ, 0 ≤ C ∧ + ∀ x : ℝ, |iteratedDeriv p Real.smoothTransition x| ≤ C := by + have hcont : Continuous (fun x => |iteratedDeriv p Real.smoothTransition x|) := + (Real.smoothTransition.contDiff : ContDiff ℝ p Real.smoothTransition) + |>.continuous_iteratedDeriv' p |>.abs + have hcompact : + HasCompactSupport (fun x => |iteratedDeriv p Real.smoothTransition x|) := + (smoothTransition_iteratedDeriv_hasCompactSupport hp).abs + obtain ⟨x₀, hx₀⟩ := hcont.exists_forall_ge_of_hasCompactSupport hcompact + exact ⟨|iteratedDeriv p Real.smoothTransition x₀|, abs_nonneg _, hx₀⟩ + +/-- Uniform `Δ⁻ᵖ` control of the positive-order derivatives used in Rodier's +Fourier estimates. -/ +theorem exists_iteratedDeriv_rodierCutoff_bound + {p : ℕ} (hp : 0 < p) : + ∃ C : ℝ, 0 ≤ C ∧ ∀ {M Δ x : ℝ}, 0 < Δ → + |iteratedDeriv p (rodierCutoff M Δ) x| ≤ C * Δ⁻¹ ^ p := by + obtain ⟨C, hC, hbound⟩ := exists_smoothTransition_iteratedDeriv_bound hp + refine ⟨2 * C, mul_nonneg (by norm_num) hC, ?_⟩ + intro M Δ x hΔ + rw [iteratedDeriv_rodierCutoff, abs_mul] + rw [abs_of_nonneg (by positivity : 0 ≤ Δ⁻¹ ^ p)] + calc + Δ⁻¹ ^ p * + |iteratedDeriv p Real.smoothTransition ((x - M) / Δ) + + (-1 : ℝ) ^ p * + iteratedDeriv p Real.smoothTransition ((-x - M) / Δ)| + ≤ Δ⁻¹ ^ p * (C + C) := by + gcongr + calc + _ ≤ |iteratedDeriv p Real.smoothTransition ((x - M) / Δ)| + + |(-1 : ℝ) ^ p * + iteratedDeriv p Real.smoothTransition ((-x - M) / Δ)| := + abs_add_le _ _ + _ ≤ C + C := by + rw [abs_mul, abs_pow, abs_neg, abs_one, one_pow, one_mul] + exact add_le_add (hbound ((x - M) / Δ)) + (hbound ((-x - M) / Δ)) + _ = (2 * C) * Δ⁻¹ ^ p := by ring + +private theorem rodier_shift_scale_integral + (g : ℝ → ℝ) {M Δ : ℝ} (hΔ : 0 < Δ) : + (∫ x : ℝ, g ((x - M) / Δ)) = Δ * ∫ y : ℝ, g y := by + calc + (∫ x : ℝ, g ((x - M) / Δ)) = + ∫ x : ℝ, (fun z => g (z / Δ)) (x + (-M)) := by + congr with x + _ = ∫ x : ℝ, g (x / Δ) := by + exact integral_add_right_eq_self (fun z : ℝ => g (z / Δ)) (-M) + _ = |Δ| • ∫ y : ℝ, g y := Measure.integral_comp_div g Δ + _ = Δ * ∫ y : ℝ, g y := by rw [abs_of_pos hΔ]; rfl + +private theorem rodier_neg_shift_scale_integral + (g : ℝ → ℝ) {M Δ : ℝ} (hΔ : 0 < Δ) : + (∫ x : ℝ, g ((-x - M) / Δ)) = Δ * ∫ y : ℝ, g y := by + calc + (∫ x : ℝ, g ((-x - M) / Δ)) = + ∫ x : ℝ, (fun z => g ((z - M) / Δ)) (-x) := by rfl + _ = ∫ x : ℝ, g ((x - M) / Δ) := by + exact integral_neg_eq_self (fun z : ℝ => g ((z - M) / Δ)) volume + _ = Δ * ∫ y : ℝ, g y := rodier_shift_scale_integral g hΔ + +/-- The `L¹` norm of the `p`th positive-order cutoff derivative scales as +`Δ^(1-p)`. -/ +theorem exists_integral_abs_iteratedDeriv_rodierCutoff_bound + {p : ℕ} (hp : 0 < p) : + ∃ C : ℝ, 0 ≤ C ∧ ∀ {M Δ : ℝ}, 0 < Δ → + (∫ x : ℝ, |iteratedDeriv p (rodierCutoff M Δ) x|) ≤ + C * Δ⁻¹ ^ p * Δ := by + let g : ℝ → ℝ := fun y => |iteratedDeriv p Real.smoothTransition y| + have hgcont : Continuous g := + (Real.smoothTransition.contDiff : ContDiff ℝ p Real.smoothTransition) + |>.continuous_iteratedDeriv' p |>.abs + have hgsupp : HasCompactSupport g := + (smoothTransition_iteratedDeriv_hasCompactSupport hp).abs + have hg : Integrable g := hgcont.integrable_of_hasCompactSupport hgsupp + let C : ℝ := 2 * ∫ y : ℝ, g y + refine ⟨C, mul_nonneg (by norm_num) (integral_nonneg fun _ => abs_nonneg _), ?_⟩ + intro M Δ hΔ + have h₁ : Integrable (fun x : ℝ => g ((x - M) / Δ)) := by + simpa only [sub_eq_add_neg] using + (hg.comp_div hΔ.ne').comp_add_right (-M) + have h₂ : Integrable (fun x : ℝ => g ((-x - M) / Δ)) := by + convert h₁.comp_neg using 1 + have hrhs : Integrable (fun x : ℝ => + Δ⁻¹ ^ p * (g ((x - M) / Δ) + g ((-x - M) / Δ))) := + (h₁.add h₂).const_mul _ + have hpoint (x : ℝ) : + |iteratedDeriv p (rodierCutoff M Δ) x| ≤ + Δ⁻¹ ^ p * (g ((x - M) / Δ) + g ((-x - M) / Δ)) := by + rw [iteratedDeriv_rodierCutoff, abs_mul, + abs_of_nonneg (by positivity : 0 ≤ Δ⁻¹ ^ p)] + gcongr + calc + _ ≤ |iteratedDeriv p Real.smoothTransition ((x - M) / Δ)| + + |(-1 : ℝ) ^ p * + iteratedDeriv p Real.smoothTransition ((-x - M) / Δ)| := + abs_add_le _ _ + _ = g ((x - M) / Δ) + g ((-x - M) / Δ) := by + simp [g] + calc + _ ≤ ∫ x : ℝ, + Δ⁻¹ ^ p * (g ((x - M) / Δ) + g ((-x - M) / Δ)) := + integral_mono_of_nonneg (Filter.Eventually.of_forall fun _ => abs_nonneg _) + hrhs (Filter.Eventually.of_forall hpoint) + _ = Δ⁻¹ ^ p * + ((∫ x : ℝ, g ((x - M) / Δ)) + + ∫ x : ℝ, g ((-x - M) / Δ)) := by + rw [integral_const_mul, integral_add h₁ h₂] + _ = C * Δ⁻¹ ^ p * Δ := by + rw [rodier_shift_scale_integral g hΔ, + rodier_neg_shift_scale_integral g hΔ] + ring + +theorem rodierCutoff_sub_one_contDiff + (M Δ : ℝ) (hM : 0 < M) (hΔ : 0 < Δ) : + ContDiff ℝ (⊤ : ℕ∞) (fun x ↦ rodierCutoff M Δ x - 1) := + (rodierCutoff_contDiff M Δ hM hΔ).sub contDiff_const + +theorem rodierCutoff_sub_one_hasCompactSupport + (M Δ : ℝ) (hM : 0 < M) (hΔ : 0 < Δ) : + HasCompactSupport (fun x ↦ rodierCutoff M Δ x - 1) := by + refine HasCompactSupport.intro (isCompact_closedBall (0 : ℝ) (M + Δ)) ?_ + intro x hx + have hx' : M + Δ ≤ |x| := by + have : M + Δ < |x| := by + simpa [Metric.mem_closedBall, Real.dist_eq] using hx + exact this.le + rw [rodierCutoff_eq_one_of_add_le_abs hM hΔ hx'] + simp + +/-- The compactly supported part `u_{M,Δ} - 1`, bundled as a complex-valued +Schwartz function. -/ +noncomputable def rodierCutoffRemainderSchwartz + (M Δ : ℝ) (hM : 0 < M) (hΔ : 0 < Δ) : SchwartzMap ℝ ℂ := + ((rodierCutoff_sub_one_hasCompactSupport M Δ hM hΔ).comp_left rfl).toSchwartzMap + (Complex.ofRealCLM.contDiff.comp + (rodierCutoff_sub_one_contDiff M Δ hM hΔ)) + +@[simp] +theorem rodierCutoffRemainderSchwartz_apply + (M Δ : ℝ) (hM : 0 < M) (hΔ : 0 < Δ) (x : ℝ) : + rodierCutoffRemainderSchwartz M Δ hM hΔ x = + ((rodierCutoff M Δ x - 1 : ℝ) : ℂ) := + rfl + +private theorem iteratedDeriv_rodierCutoffRemainderSchwartz + {p : ℕ} (hp : 0 < p) (M Δ : ℝ) (hM : 0 < M) (hΔ : 0 < Δ) (x : ℝ) : + iteratedDeriv p + (rodierCutoffRemainderSchwartz M Δ hM hΔ : ℝ → ℂ) x = + Complex.ofReal (iteratedDeriv p (rodierCutoff M Δ) x) := by + rw [show (rodierCutoffRemainderSchwartz M Δ hM hΔ : ℝ → ℂ) = + fun y => (rodierCutoff M Δ y - 1 : ℝ) • (1 : ℂ) by + funext y + rw [rodierCutoffRemainderSchwartz_apply] + simp] + have horder : ((p : ℕ∞) : WithTop ℕ∞) ≤ + ((⊤ : ℕ∞) : WithTop ℕ∞) := WithTop.coe_le_coe.mpr le_top + have hf : ContDiffAt ℝ p (fun y => rodierCutoff M Δ y - 1) x := + (((rodierCutoff_contDiff M Δ hM hΔ).sub contDiff_const).of_le + horder).contDiffAt + rw [iteratedDeriv_smul_const hf] + have hsub : + iteratedDeriv p (fun y => rodierCutoff M Δ y - 1) x = + iteratedDeriv p (rodierCutoff M Δ) x := by + have hu : ContDiffAt ℝ p (rodierCutoff M Δ) x := + ((rodierCutoff_contDiff M Δ hM hΔ).of_le horder).contDiffAt + change iteratedDeriv p (rodierCutoff M Δ - fun _ => 1) x = _ + rw [iteratedDeriv_sub hu contDiffAt_const] + rw [iteratedDeriv_const, if_neg hp.ne'] + simp + rw [hsub] + simp + +private theorem schwartz_iteratedDeriv_integrable + (f : SchwartzMap ℝ ℂ) (p : ℕ) : + Integrable (iteratedDeriv p (f : ℝ → ℂ)) := by + have hfd : ContDiff ℝ p (f : ℝ → ℂ) := f.smooth p + have hcont : Continuous (iteratedDeriv p (f : ℝ → ℂ)) := + hfd.continuous_iteratedDeriv' p + have hsch : Integrable (fun x : ℝ => ‖x‖ ^ (0 : ℕ) * + ‖iteratedFDeriv ℝ p (f : ℝ → ℂ) x‖) := by + simpa using f.integrable_pow_mul_iteratedFDeriv volume 0 p + have hfderiv : Integrable (fun x : ℝ => + ‖iteratedFDeriv ℝ p (f : ℝ → ℂ) x‖) := by + simpa using hsch + have hnorm : Integrable (fun x : ℝ => + ‖iteratedDeriv p (f : ℝ → ℂ) x‖) := by + convert hfderiv using 1 + funext x + exact (norm_iteratedFDeriv_eq_norm_iteratedDeriv + (𝕜 := ℝ) (F := ℂ) (n := p) (f := (f : ℝ → ℂ)) (x := x)).symm + exact (integrable_norm_iff hcont.aestronglyMeasurable).mp hnorm + +/-- The unit-frequency Fourier density of `u_{M,Δ} - 1`, using Mathlib's +`exp (-2π i x ξ)` convention. -/ +noncomputable def rodierCutoffUnitFourierDensity + (M Δ : ℝ) (hM : 0 < M) (hΔ : 0 < Δ) : SchwartzMap ℝ ℂ := + 𝓕 (rodierCutoffRemainderSchwartz M Δ hM hΔ) + +theorem rodierCutoffRemainder_fourierInv_unitDensity + (M Δ : ℝ) (hM : 0 < M) (hΔ : 0 < Δ) : + 𝓕⁻ (rodierCutoffUnitFourierDensity M Δ hM hΔ) = + rodierCutoffRemainderSchwartz M Δ hM hΔ := by + exact FourierPair.fourierInv_fourier_eq _ + +private theorem fourier_iteratedDeriv_rodierCutoffRemainder + {p : ℕ} (M Δ : ℝ) (hM : 0 < M) (hΔ : 0 < Δ) : + 𝓕 (iteratedDeriv p + (rodierCutoffRemainderSchwartz M Δ hM hΔ : ℝ → ℂ)) = + fun ξ : ℝ => (2 * Real.pi * Complex.I * ξ) ^ p • + rodierCutoffUnitFourierDensity M Δ hM hΔ ξ := by + exact Real.fourier_iteratedDeriv (N := ⊤) (n := p) + ((rodierCutoffRemainderSchwartz M Δ hM hΔ).smooth ⊤) + (fun q _ => schwartz_iteratedDeriv_integrable _ q) le_top + +/-- Rodier's angular-frequency density +`v(t) = (2π)⁻¹ 𝓕(u_{M,Δ} - 1)(t / (2π))`. -/ +noncomputable def rodierCutoffFourierDensity + (M Δ : ℝ) (hM : 0 < M) (hΔ : 0 < Δ) (t : ℝ) : ℂ := + ((2 * Real.pi : ℝ) : ℂ)⁻¹ * + rodierCutoffUnitFourierDensity M Δ hM hΔ (t / (2 * Real.pi)) + +theorem rodierCutoffFourierDensity_integrable + (M Δ : ℝ) (hM : 0 < M) (hΔ : 0 < Δ) : + Integrable (rodierCutoffFourierDensity M Δ hM hΔ) := by + unfold rodierCutoffFourierDensity + exact ((rodierCutoffUnitFourierDensity M Δ hM hΔ).integrable.comp_div + (by positivity : 2 * Real.pi ≠ 0)).const_mul + (((2 * Real.pi : ℝ) : ℂ)⁻¹) + +private theorem integral_abs_rodierCutoff_sub_one_le + (M Δ : ℝ) (hM : 0 < M) (hΔ : 0 < Δ) : + (∫ x : ℝ, |rodierCutoff M Δ x - 1|) ≤ 2 * (M + Δ) := by + let R : ℝ := M + Δ + have hR : 0 < R := add_pos hM hΔ + let g : ℝ → ℝ := Set.indicator (Set.Icc (-R) R) (fun _ => 1) + have hg : Integrable g := + continuous_const.integrableOn_Icc.integrable_indicator measurableSet_Icc + have hpoint (x : ℝ) : |rodierCutoff M Δ x - 1| ≤ g x := by + by_cases hx : x ∈ Set.Icc (-R) R + · rw [show g x = 1 by simp [g, hx]] + have hu0 := rodierCutoff_nonneg M Δ hM hΔ x + have hu1 := rodierCutoff_le_one M Δ hM hΔ x + rw [abs_of_nonpos (sub_nonpos.mpr hu1)] + linarith + · rw [show g x = 0 by simp [g, hx]] + have hout : R ≤ |x| := by + simp only [Set.mem_Icc, not_and_or, not_le] at hx + rcases hx with hx | hx + · rw [abs_of_neg (lt_of_lt_of_le hx (neg_nonpos.mpr hR.le))] + linarith + · exact le_trans hx.le (le_abs_self x) + rw [rodierCutoff_eq_one_of_add_le_abs hM hΔ hout] + simp + calc + _ ≤ ∫ x : ℝ, g x := + integral_mono_of_nonneg (Filter.Eventually.of_forall fun _ => abs_nonneg _) + hg (Filter.Eventually.of_forall hpoint) + _ = 2 * R := by + change (∫ x : ℝ, + Set.indicator (Set.Icc (-R) R) (1 : ℝ → ℝ) x) = 2 * R + rw [integral_indicator_one measurableSet_Icc, + Real.volume_real_Icc_of_le (by linarith)] + ring + _ = 2 * (M + Δ) := rfl + +private theorem norm_rodierCutoffFourierDensity_le + (M Δ : ℝ) (hM : 0 < M) (hΔ : 0 < Δ) (t : ℝ) : + ‖rodierCutoffFourierDensity M Δ hM hΔ t‖ ≤ + Real.pi⁻¹ * (M + Δ) := by + let f : ℝ → ℂ := rodierCutoffRemainderSchwartz M Δ hM hΔ + have hfourier : + ‖rodierCutoffUnitFourierDensity M Δ hM hΔ (t / (2 * Real.pi))‖ ≤ + ∫ x : ℝ, ‖f x‖ := by + rw [show rodierCutoffUnitFourierDensity M Δ hM hΔ + (t / (2 * Real.pi)) = 𝓕 f (t / (2 * Real.pi)) from rfl, + Real.fourier_eq] + apply (norm_integral_le_integral_norm _).trans_eq + apply integral_congr_ae + filter_upwards [] with x + simp + have hintegral : + (∫ x : ℝ, ‖f x‖) = ∫ x : ℝ, |rodierCutoff M Δ x - 1| := by + apply integral_congr_ae + filter_upwards [] with x + rw [show f x = ((rodierCutoff M Δ x - 1 : ℝ) : ℂ) from rfl] + exact Complex.norm_real _ + calc + ‖rodierCutoffFourierDensity M Δ hM hΔ t‖ = + (2 * Real.pi)⁻¹ * + ‖rodierCutoffUnitFourierDensity M Δ hM hΔ + (t / (2 * Real.pi))‖ := by + simp only [rodierCutoffFourierDensity, norm_mul, norm_inv, + Complex.norm_real, Real.norm_eq_abs] + rw [abs_of_pos (by norm_num : (0 : ℝ) < 2), abs_of_pos Real.pi_pos] + _ ≤ (2 * Real.pi)⁻¹ * ∫ x : ℝ, ‖f x‖ := by + exact mul_le_mul_of_nonneg_left hfourier (by positivity) + _ = (2 * Real.pi)⁻¹ * ∫ x : ℝ, |rodierCutoff M Δ x - 1| := by + rw [hintegral] + _ ≤ (2 * Real.pi)⁻¹ * (2 * (M + Δ)) := by + exact mul_le_mul_of_nonneg_left + (integral_abs_rodierCutoff_sub_one_le M Δ hM hΔ) (by positivity) + _ = Real.pi⁻¹ * (M + Δ) := by field_simp + +/-- Fourier integration by parts converts the cutoff's `L¹` derivative bound +into angular-frequency decay. -/ +theorem exists_rodierCutoffFourierDensity_decay_bound + {p : ℕ} (hp : 0 < p) : + ∃ C : ℝ, 0 ≤ C ∧ ∀ (M Δ : ℝ) (hM : 0 < M) (hΔ : 0 < Δ) (t : ℝ), + |t| ^ p * ‖rodierCutoffFourierDensity M Δ hM hΔ t‖ ≤ + C * Δ⁻¹ ^ p * Δ := by + obtain ⟨C, hC, hL1⟩ := + exists_integral_abs_iteratedDeriv_rodierCutoff_bound hp + let a : ℝ := 2 * Real.pi + have ha : 0 < a := by + dsimp [a] + positivity + refine ⟨a⁻¹ * C, mul_nonneg (inv_nonneg.mpr ha.le) hC, ?_⟩ + intro M Δ hM hΔ t + let f : ℝ → ℂ := + iteratedDeriv p + (rodierCutoffRemainderSchwartz M Δ hM hΔ : ℝ → ℂ) + have hfourier := congrFun + (fourier_iteratedDeriv_rodierCutoffRemainder + (p := p) M Δ hM hΔ) (t / a) + have hfourierNorm : + ‖𝓕 f (t / a)‖ ≤ ∫ x : ℝ, ‖f x‖ := by + rw [Real.fourier_eq] + apply (norm_integral_le_integral_norm _).trans_eq + apply integral_congr_ae + filter_upwards [] with x + simp + have hintegral : + (∫ x : ℝ, ‖f x‖) = + ∫ x : ℝ, |iteratedDeriv p (rodierCutoff M Δ) x| := by + apply integral_congr_ae + filter_upwards [] with x + rw [show f x = Complex.ofReal + (iteratedDeriv p (rodierCutoff M Δ) x) from + iteratedDeriv_rodierCutoffRemainderSchwartz hp M Δ hM hΔ x] + exact Complex.norm_real _ + calc + |t| ^ p * ‖rodierCutoffFourierDensity M Δ hM hΔ t‖ = + a⁻¹ * ‖𝓕 f (t / a)‖ := by + rw [hfourier] + simp only [rodierCutoffFourierDensity, a, norm_mul, norm_inv, + Complex.norm_real, norm_smul, norm_pow, Complex.norm_I, + Real.norm_eq_abs] + rw [abs_of_pos (by norm_num : (0 : ℝ) < 2), + abs_of_pos Real.pi_pos, abs_div, abs_of_pos ha] + norm_num + dsimp [a] + field_simp + _ ≤ a⁻¹ * ∫ x : ℝ, ‖f x‖ := by gcongr + _ = a⁻¹ * ∫ x : ℝ, + |iteratedDeriv p (rodierCutoff M Δ) x| := by rw [hintegral] + _ ≤ a⁻¹ * (C * Δ⁻¹ ^ p * Δ) := by + gcongr + exact hL1 hΔ + _ = (a⁻¹ * C) * Δ⁻¹ ^ p * Δ := by ring + +private theorem exists_rodierCutoffFourierDensity_scaled_bound (k : ℕ) : + ∃ C : ℝ, 0 ≤ C ∧ + ∀ (M Δ : ℝ) (_hM : 0 < M) (hΔ : 0 < Δ), Δ ≤ M → ∀ t : ℝ, + |t| ^ k * ‖rodierCutoffFourierDensity M Δ _hM hΔ t‖ ≤ + C * M * Δ⁻¹ ^ k := by + rcases k with _ | k + · refine ⟨2 * Real.pi⁻¹, mul_nonneg (by norm_num) (by positivity), ?_⟩ + intro M Δ hM hΔ hΔM t + simp only [pow_zero, one_mul] + calc + ‖rodierCutoffFourierDensity M Δ hM hΔ t‖ ≤ + Real.pi⁻¹ * (M + Δ) := + norm_rodierCutoffFourierDensity_le M Δ hM hΔ t + _ ≤ Real.pi⁻¹ * (2 * M) := by + gcongr + linarith + _ = (2 * Real.pi⁻¹) * M * Δ⁻¹ ^ 0 := by ring + · obtain ⟨C, hC, hdecay⟩ := + exists_rodierCutoffFourierDensity_decay_bound (Nat.succ_pos k) + refine ⟨C, hC, ?_⟩ + intro M Δ hM hΔ hΔM t + calc + |t| ^ (k + 1) * ‖rodierCutoffFourierDensity M Δ hM hΔ t‖ ≤ + C * Δ⁻¹ ^ (k + 1) * Δ := hdecay M Δ hM hΔ t + _ ≤ C * M * Δ⁻¹ ^ (k + 1) := by + have hscale : 0 ≤ C * Δ⁻¹ ^ (k + 1) := + mul_nonneg hC (by positivity) + nlinarith + +private theorem exists_rodierCutoffFourierDensity_moment_bound (k : ℕ) : + ∃ C : ℝ, 0 ≤ C ∧ + ∀ (M Δ : ℝ) (hM : 0 < M) (hΔ : 0 < Δ), Δ ≤ M → + Integrable (fun t : ℝ => + |t| ^ k * ‖rodierCutoffFourierDensity M Δ hM hΔ t‖) ∧ + (∫ t : ℝ, |t| ^ k * + ‖rodierCutoffFourierDensity M Δ hM hΔ t‖) ≤ + C * M * Δ⁻¹ ^ (k + 1) := by + obtain ⟨A, hA, hbase⟩ := + exists_rodierCutoffFourierDensity_scaled_bound k + obtain ⟨B, hB, hdecay⟩ := + exists_rodierCutoffFourierDensity_decay_bound + (show 0 < k + 2 by omega) + refine ⟨(A + B) * Real.pi, + mul_nonneg (add_nonneg hA hB) Real.pi_pos.le, ?_⟩ + intro M Δ hM hΔ hΔM + let w : ℝ → ℝ := fun t => + |t| ^ k * ‖rodierCutoffFourierDensity M Δ hM hΔ t‖ + let K : ℝ → ℝ := fun t => (1 + (Δ * t) ^ 2)⁻¹ + let S : ℝ := (A + B) * M * Δ⁻¹ ^ k + have hbase' (t : ℝ) : w t ≤ A * M * Δ⁻¹ ^ k := + hbase M Δ hM hΔ hΔM t + have hscaled (t : ℝ) : (Δ * t) ^ 2 * w t ≤ B * M * Δ⁻¹ ^ k := by + calc + (Δ * t) ^ 2 * w t = + Δ ^ 2 * (|t| ^ (k + 2) * + ‖rodierCutoffFourierDensity M Δ hM hΔ t‖) := by + simp only [w, mul_pow] + rw [pow_add] + rw [sq_abs] + ring + _ ≤ Δ ^ 2 * (B * Δ⁻¹ ^ (k + 2) * Δ) := by + exact mul_le_mul_of_nonneg_left (hdecay M Δ hM hΔ t) (sq_nonneg Δ) + _ = B * Δ * Δ⁻¹ ^ k := by + rw [pow_add] + field_simp + _ ≤ B * M * Δ⁻¹ ^ k := by + have hscale : 0 ≤ B * Δ⁻¹ ^ k := mul_nonneg hB (by positivity) + nlinarith + have hpoint (t : ℝ) : w t ≤ S * K t := by + have hden : 0 < 1 + (Δ * t) ^ 2 := by positivity + have hsum : (1 + (Δ * t) ^ 2) * w t ≤ S := by + dsimp [S] + nlinarith [hbase' t, hscaled t] + calc + w t = ((1 + (Δ * t) ^ 2) * w t) * (1 + (Δ * t) ^ 2)⁻¹ := by + field_simp + _ ≤ S * (1 + (Δ * t) ^ 2)⁻¹ := + mul_le_mul_of_nonneg_right hsum (inv_nonneg.mpr hden.le) + _ = S * K t := rfl + have hK : Integrable K := by + have h := integrable_inv_one_add_sq.comp_div (inv_ne_zero hΔ.ne') + convert h using 1 + funext t + dsimp [K] + congr 2 + field_simp + have hKint : (∫ t : ℝ, K t) = Δ⁻¹ * Real.pi := by + have h := Measure.integral_comp_div + (fun x : ℝ => (1 + x ^ 2)⁻¹) Δ⁻¹ + rw [abs_of_pos (inv_pos.mpr hΔ)] at h + simpa [K, div_eq_mul_inv, hΔ.ne', mul_comm] using h + have henv : Integrable (fun t => S * K t) := hK.const_mul S + have hwcont : Continuous w := by + dsimp [w, rodierCutoffFourierDensity] + fun_prop + have hw : Integrable w := by + apply MeasureTheory.Integrable.mono' henv hwcont.aestronglyMeasurable + filter_upwards [] with t + have hwt : 0 ≤ w t := mul_nonneg (pow_nonneg (abs_nonneg t) k) + (norm_nonneg _) + rw [Real.norm_eq_abs, abs_of_nonneg hwt] + exact hpoint t + refine ⟨hw, ?_⟩ + calc + (∫ t : ℝ, w t) ≤ ∫ t : ℝ, S * K t := + integral_mono hw henv hpoint + _ = S * (Δ⁻¹ * Real.pi) := by rw [integral_const_mul, hKint] + _ = ((A + B) * Real.pi) * M * Δ⁻¹ ^ (k + 1) := by + dsimp [S] + rw [pow_succ] + ring + +private theorem exists_rodierCutoffFourierDensity_positiveMoment_bound + {k : ℕ} (hk : 0 < k) : + ∃ C : ℝ, 0 ≤ C ∧ + ∀ (M Δ : ℝ) (hM : 0 < M) (hΔ : 0 < Δ), + Integrable (fun t : ℝ => + |t| ^ k * ‖rodierCutoffFourierDensity M Δ hM hΔ t‖) ∧ + (∫ t : ℝ, |t| ^ k * + ‖rodierCutoffFourierDensity M Δ hM hΔ t‖) ≤ + C * Δ⁻¹ ^ k := by + obtain ⟨A, hA, hbase⟩ := + exists_rodierCutoffFourierDensity_decay_bound hk + obtain ⟨B, hB, hdecay⟩ := + exists_rodierCutoffFourierDensity_decay_bound + (show 0 < k + 2 by omega) + refine ⟨(A + B) * Real.pi, + mul_nonneg (add_nonneg hA hB) Real.pi_pos.le, ?_⟩ + intro M Δ hM hΔ + let w : ℝ → ℝ := fun t => + |t| ^ k * ‖rodierCutoffFourierDensity M Δ hM hΔ t‖ + let K : ℝ → ℝ := fun t => (1 + (Δ * t) ^ 2)⁻¹ + let S : ℝ := (A + B) * Δ⁻¹ ^ k * Δ + have hbase' (t : ℝ) : w t ≤ A * Δ⁻¹ ^ k * Δ := + hbase M Δ hM hΔ t + have hscaled (t : ℝ) : + (Δ * t) ^ 2 * w t ≤ B * Δ⁻¹ ^ k * Δ := by + calc + (Δ * t) ^ 2 * w t = + Δ ^ 2 * (|t| ^ (k + 2) * + ‖rodierCutoffFourierDensity M Δ hM hΔ t‖) := by + simp only [w, mul_pow] + rw [pow_add, sq_abs] + ring + _ ≤ Δ ^ 2 * (B * Δ⁻¹ ^ (k + 2) * Δ) := by + exact mul_le_mul_of_nonneg_left (hdecay M Δ hM hΔ t) (sq_nonneg Δ) + _ = B * Δ⁻¹ ^ k * Δ := by + rw [show k + 2 = k + 2 by rfl, pow_add] + field_simp + have hpoint (t : ℝ) : w t ≤ S * K t := by + have hden : 0 < 1 + (Δ * t) ^ 2 := by positivity + have hsum : (1 + (Δ * t) ^ 2) * w t ≤ S := by + dsimp [S] + nlinarith [hbase' t, hscaled t] + calc + w t = ((1 + (Δ * t) ^ 2) * w t) * (1 + (Δ * t) ^ 2)⁻¹ := by + field_simp + _ ≤ S * (1 + (Δ * t) ^ 2)⁻¹ := + mul_le_mul_of_nonneg_right hsum (inv_nonneg.mpr hden.le) + _ = S * K t := rfl + have hK : Integrable K := by + have h := integrable_inv_one_add_sq.comp_div (inv_ne_zero hΔ.ne') + convert h using 1 + funext t + dsimp [K] + congr 2 + field_simp + have hKint : (∫ t : ℝ, K t) = Δ⁻¹ * Real.pi := by + have h := Measure.integral_comp_div + (fun x : ℝ => (1 + x ^ 2)⁻¹) Δ⁻¹ + rw [abs_of_pos (inv_pos.mpr hΔ)] at h + simpa [K, div_eq_mul_inv, hΔ.ne', mul_comm] using h + have henv : Integrable (fun t => S * K t) := hK.const_mul S + have hwcont : Continuous w := by + dsimp [w, rodierCutoffFourierDensity] + fun_prop + have hw : Integrable w := by + apply MeasureTheory.Integrable.mono' henv hwcont.aestronglyMeasurable + filter_upwards [] with t + have hwt : 0 ≤ w t := mul_nonneg (pow_nonneg (abs_nonneg t) k) + (norm_nonneg _) + rw [Real.norm_eq_abs, abs_of_nonneg hwt] + exact hpoint t + refine ⟨hw, ?_⟩ + calc + (∫ t : ℝ, w t) ≤ ∫ t : ℝ, S * K t := + integral_mono hw henv hpoint + _ = S * (Δ⁻¹ * Real.pi) := by rw [integral_const_mul, hKint] + _ = ((A + B) * Real.pi) * Δ⁻¹ ^ k := by + dsimp [S] + field_simp + +/-- Rodier's cutoff density has total mass `O(M / Δ)` when `0 < Δ ≤ M`. -/ +theorem exists_rodierCutoffFourierDensity_totalMass_bound : + ∃ C : ℝ, 0 ≤ C ∧ + ∀ (M Δ : ℝ) (hM : 0 < M) (hΔ : 0 < Δ), Δ ≤ M → + Integrable (fun t : ℝ => + ‖rodierCutoffFourierDensity M Δ hM hΔ t‖) ∧ + (∫ t : ℝ, ‖rodierCutoffFourierDensity M Δ hM hΔ t‖) ≤ + C * M * Δ⁻¹ := by + simpa using exists_rodierCutoffFourierDensity_moment_bound 0 + +/-- The fourth absolute moment of Rodier's cutoff density is +`O(M / Δ⁵)`. -/ +theorem exists_rodierCutoffFourierDensity_fourthMoment_bound : + ∃ C : ℝ, 0 ≤ C ∧ + ∀ (M Δ : ℝ) (hM : 0 < M) (hΔ : 0 < Δ), Δ ≤ M → + Integrable (fun t : ℝ => + |t| ^ 4 * ‖rodierCutoffFourierDensity M Δ hM hΔ t‖) ∧ + (∫ t : ℝ, |t| ^ 4 * + ‖rodierCutoffFourierDensity M Δ hM hΔ t‖) ≤ + C * M * Δ⁻¹ ^ 5 := by + simpa using exists_rodierCutoffFourierDensity_moment_bound 4 + +/-- The sixth absolute moment of Rodier's cutoff density is +`O(M / Δ⁷)`. -/ +theorem exists_rodierCutoffFourierDensity_sixthMoment_bound : + ∃ C : ℝ, 0 ≤ C ∧ + ∀ (M Δ : ℝ) (hM : 0 < M) (hΔ : 0 < Δ), Δ ≤ M → + Integrable (fun t : ℝ => + |t| ^ 6 * ‖rodierCutoffFourierDensity M Δ hM hΔ t‖) ∧ + (∫ t : ℝ, |t| ^ 6 * + ‖rodierCutoffFourierDensity M Δ hM hΔ t‖) ≤ + C * M * Δ⁻¹ ^ 7 := by + simpa using exists_rodierCutoffFourierDensity_moment_bound 6 + +/-- The eighth absolute moment of Rodier's cutoff density is +`O(M / Δ⁹)`. -/ +theorem exists_rodierCutoffFourierDensity_eighthMoment_bound : + ∃ C : ℝ, 0 ≤ C ∧ + ∀ (M Δ : ℝ) (hM : 0 < M) (hΔ : 0 < Δ), Δ ≤ M → + Integrable (fun t : ℝ => + |t| ^ 8 * ‖rodierCutoffFourierDensity M Δ hM hΔ t‖) ∧ + (∫ t : ℝ, |t| ^ 8 * + ‖rodierCutoffFourierDensity M Δ hM hΔ t‖) ≤ + C * M * Δ⁻¹ ^ 9 := by + simpa using exists_rodierCutoffFourierDensity_moment_bound 8 + +/-- The sharp second absolute-moment estimate in Rodier Proposition 4.1 is +`O(Δ⁻²)`, uniformly in the cutoff center. -/ +theorem exists_rodierCutoffFourierDensity_secondMoment_sharp_bound : + ∃ C : ℝ, 0 ≤ C ∧ + ∀ (M Δ : ℝ) (hM : 0 < M) (hΔ : 0 < Δ), + Integrable (fun t : ℝ => + |t| ^ 2 * ‖rodierCutoffFourierDensity M Δ hM hΔ t‖) ∧ + (∫ t : ℝ, |t| ^ 2 * + ‖rodierCutoffFourierDensity M Δ hM hΔ t‖) ≤ + C * Δ⁻¹ ^ 2 := by + simpa using exists_rodierCutoffFourierDensity_positiveMoment_bound + (by norm_num : 0 < 2) + +/-- The sharp fourth absolute-moment estimate in Rodier Proposition 4.1 is +`O(Δ⁻⁴)`, uniformly in the cutoff center. -/ +theorem exists_rodierCutoffFourierDensity_fourthMoment_sharp_bound : + ∃ C : ℝ, 0 ≤ C ∧ + ∀ (M Δ : ℝ) (hM : 0 < M) (hΔ : 0 < Δ), + Integrable (fun t : ℝ => + |t| ^ 4 * ‖rodierCutoffFourierDensity M Δ hM hΔ t‖) ∧ + (∫ t : ℝ, |t| ^ 4 * + ‖rodierCutoffFourierDensity M Δ hM hΔ t‖) ≤ + C * Δ⁻¹ ^ 4 := by + simpa using exists_rodierCutoffFourierDensity_positiveMoment_bound + (by norm_num : 0 < 4) + +/-- The sharp sixth absolute-moment estimate in Rodier Proposition 4.1 is +`O(Δ⁻⁶)`, uniformly in the cutoff center. -/ +theorem exists_rodierCutoffFourierDensity_sixthMoment_sharp_bound : + ∃ C : ℝ, 0 ≤ C ∧ + ∀ (M Δ : ℝ) (hM : 0 < M) (hΔ : 0 < Δ), + Integrable (fun t : ℝ => + |t| ^ 6 * ‖rodierCutoffFourierDensity M Δ hM hΔ t‖) ∧ + (∫ t : ℝ, |t| ^ 6 * + ‖rodierCutoffFourierDensity M Δ hM hΔ t‖) ≤ + C * Δ⁻¹ ^ 6 := by + simpa using exists_rodierCutoffFourierDensity_positiveMoment_bound + (by norm_num : 0 < 6) + +/-- The sharp eighth absolute-moment estimate in Rodier Proposition 4.1 is +`O(Δ⁻⁸)`, uniformly in the cutoff center. -/ +theorem exists_rodierCutoffFourierDensity_eighthMoment_sharp_bound : + ∃ C : ℝ, 0 ≤ C ∧ + ∀ (M Δ : ℝ) (hM : 0 < M) (hΔ : 0 < Δ), + Integrable (fun t : ℝ => + |t| ^ 8 * ‖rodierCutoffFourierDensity M Δ hM hΔ t‖) ∧ + (∫ t : ℝ, |t| ^ 8 * + ‖rodierCutoffFourierDensity M Δ hM hΔ t‖) ≤ + C * Δ⁻¹ ^ 8 := by + simpa using exists_rodierCutoffFourierDensity_positiveMoment_bound + (by norm_num : 0 < 8) + +/-- Rodier's Fourier--Stieltjes complex measure +`U = δ₀ + v(t) dt`. -/ +noncomputable def rodierCutoffFourierMeasure + (M Δ : ℝ) (hM : 0 < M) (hΔ : 0 < Δ) : ComplexMeasure ℝ := + VectorMeasure.dirac 0 1 + + volume.withDensityᵥ (rodierCutoffFourierDensity M Δ hM hΔ) + +theorem rodierCutoffFourierMeasure_apply + (M Δ : ℝ) (hM : 0 < M) (hΔ : 0 < Δ) + {s : Set ℝ} (hs : MeasurableSet s) : + rodierCutoffFourierMeasure M Δ hM hΔ s = + VectorMeasure.dirac 0 1 s + + ∫ t in s, rodierCutoffFourierDensity M Δ hM hΔ t := by + unfold rodierCutoffFourierMeasure + rw [add_apply, withDensityᵥ_apply + (rodierCutoffFourierDensity_integrable M Δ hM hΔ) hs] + +/-- The variation of Rodier's measure is dominated by its Dirac mass plus the +absolute density. -/ +theorem rodierCutoffFourierMeasure_variation_le + (M Δ : ℝ) (hM : 0 < M) (hΔ : 0 < Δ) : + (rodierCutoffFourierMeasure M Δ hM hΔ).variation ≤ + Measure.dirac 0 + volume.withDensity + (fun t => ‖rodierCutoffFourierDensity M Δ hM hΔ t‖ₑ) := by + unfold rodierCutoffFourierMeasure + calc + (VectorMeasure.dirac (M := ℂ) 0 1 + + volume.withDensityᵥ (rodierCutoffFourierDensity M Δ hM hΔ)).variation ≤ + (VectorMeasure.dirac (M := ℂ) 0 1).variation + + (volume.withDensityᵥ + (rodierCutoffFourierDensity M Δ hM hΔ)).variation := + VectorMeasure.variation_add_le + _ = _ := by + rw [VectorMeasure.variation_dirac, + Measure.variation_withDensityᵥ + (rodierCutoffFourierDensity_integrable M Δ hM hΔ)] + simp + +private theorem rodierCutoffFourierMeasure_variation_real_univ_le + (M Δ : ℝ) (hM : 0 < M) (hΔ : 0 < Δ) : + (rodierCutoffFourierMeasure M Δ hM hΔ).variation.real Set.univ ≤ + 1 + ∫ t : ℝ, ‖rodierCutoffFourierDensity M Δ hM hΔ t‖ := by + let v : ℝ → ℂ := rodierCutoffFourierDensity M Δ hM hΔ + have hv : Integrable v := rodierCutoffFourierDensity_integrable M Δ hM hΔ + let ν : Measure ℝ := Measure.dirac 0 + + volume.withDensity (fun t => ‖v t‖ₑ) + have hle : (rodierCutoffFourierMeasure M Δ hM hΔ).variation Set.univ ≤ + ν Set.univ := rodierCutoffFourierMeasure_variation_le M Δ hM hΔ Set.univ + have hν : ν Set.univ = ENNReal.ofReal + (1 + ∫ t : ℝ, ‖v t‖) := by + rw [show ν Set.univ = Measure.dirac (0 : ℝ) Set.univ + + (volume.withDensity fun t => ‖v t‖ₑ) Set.univ by + simp only [ν, Measure.add_apply], + withDensity_apply _ MeasurableSet.univ] + simp only [Measure.restrict_univ, + Measure.dirac_apply_of_mem (Set.mem_univ _)] + rw [← MeasureTheory.ofReal_integral_norm_eq_lintegral_enorm hv] + rw [ENNReal.ofReal_add (by positivity : 0 ≤ (1 : ℝ)) + (integral_nonneg fun _ => norm_nonneg _)] + simp + have hνtop : ν Set.univ ≠ ∞ := by + rw [hν] + exact ENNReal.ofReal_ne_top + calc + _ ≤ (ν Set.univ).toReal := ENNReal.toReal_mono hνtop hle + _ = 1 + ∫ t : ℝ, ‖v t‖ := by + rw [hν, ENNReal.toReal_ofReal] + positivity + _ = _ := rfl + +/-- Rodier's Fourier--Stieltjes measure has total variation `O(M / Δ)` when +`0 < Δ ≤ M`. -/ +theorem exists_rodierCutoffFourierMeasure_variation_bound : + ∃ C : ℝ, 0 ≤ C ∧ + ∀ (M Δ : ℝ) (hM : 0 < M) (hΔ : 0 < Δ), Δ ≤ M → + (rodierCutoffFourierMeasure M Δ hM hΔ).variation.real Set.univ ≤ + C * M * Δ⁻¹ := by + obtain ⟨C, hC, hmass⟩ := + exists_rodierCutoffFourierDensity_totalMass_bound + refine ⟨1 + C, add_nonneg zero_le_one hC, ?_⟩ + intro M Δ hM hΔ hΔM + have hratio : 1 ≤ M * Δ⁻¹ := by + rw [le_mul_inv_iff₀ hΔ] + simpa using hΔM + calc + _ ≤ 1 + ∫ t : ℝ, ‖rodierCutoffFourierDensity M Δ hM hΔ t‖ := + rodierCutoffFourierMeasure_variation_real_univ_le M Δ hM hΔ + _ ≤ 1 + C * M * Δ⁻¹ := by + gcongr + exact (hmass M Δ hM hΔ hΔM).2 + _ ≤ (1 + C) * M * Δ⁻¹ := by + nlinarith [mul_nonneg hC (le_trans zero_le_one hratio)] + +private theorem rodierCutoffFourierMeasure_variation_moment_le_density + {k : ℕ} (hk : 0 < k) + (M Δ : ℝ) (hM : 0 < M) (hΔ : 0 < Δ) + (hweight : Integrable (fun t : ℝ => + |t| ^ k * ‖rodierCutoffFourierDensity M Δ hM hΔ t‖)) : + Integrable (fun t : ℝ => |t| ^ k) + (rodierCutoffFourierMeasure M Δ hM hΔ).variation ∧ + (∫ t : ℝ, |t| ^ k ∂ + (rodierCutoffFourierMeasure M Δ hM hΔ).variation) ≤ + ∫ t : ℝ, |t| ^ k * + ‖rodierCutoffFourierDensity M Δ hM hΔ t‖ := by + let v : ℝ → ℂ := rodierCutoffFourierDensity M Δ hM hΔ + let ρ : ℝ → ℝ≥0∞ := fun t => ‖v t‖ₑ + let ν : Measure ℝ := Measure.dirac 0 + volume.withDensity ρ + have hρ : Measurable ρ := by + apply Continuous.measurable + apply Continuous.enorm + dsimp [v, rodierCutoffFourierDensity] + exact continuous_const.mul + ((rodierCutoffUnitFourierDensity M Δ hM hΔ).continuous.comp (by fun_prop)) + have hρtop : ∀ᵐ t : ℝ ∂volume, ρ t < ∞ := by + filter_upwards [] with t + simp [ρ] + have hdens : Integrable (fun t : ℝ => |t| ^ k) (volume.withDensity ρ) := by + rw [integrable_withDensity_iff_integrable_smul' hρ hρtop] + simpa [ρ, v, mul_comm] using hweight + have hdirac : Integrable (fun t : ℝ => |t| ^ k) (Measure.dirac 0) := + integrable_dirac (by simp) + have hν : Integrable (fun t : ℝ => |t| ^ k) ν := + integrable_add_measure.mpr ⟨hdirac, hdens⟩ + have hle : (rodierCutoffFourierMeasure M Δ hM hΔ).variation ≤ ν := + rodierCutoffFourierMeasure_variation_le M Δ hM hΔ + refine ⟨hν.mono_measure hle, ?_⟩ + calc + _ ≤ ∫ t : ℝ, |t| ^ k ∂ν := + integral_mono_measure hle + (Filter.Eventually.of_forall fun _ => pow_nonneg (abs_nonneg _) _) + hν + _ = (∫ t : ℝ, |t| ^ k ∂Measure.dirac 0) + + ∫ t : ℝ, |t| ^ k ∂volume.withDensity ρ := by + exact integral_add_measure hdirac hdens + _ = ∫ t : ℝ, |t| ^ k * ‖v t‖ := by + rw [integral_dirac, + integral_withDensity_eq_integral_toReal_smul hρ hρtop] + simp [ρ, v, hk.ne', mul_comm] + _ = _ := rfl + +/-- The fourth absolute moment of the variation of Rodier's measure is +`O(M / Δ⁵)`. -/ +theorem exists_rodierCutoffFourierMeasure_fourthMoment_bound : + ∃ C : ℝ, 0 ≤ C ∧ + ∀ (M Δ : ℝ) (hM : 0 < M) (hΔ : 0 < Δ), Δ ≤ M → + Integrable (fun t : ℝ => |t| ^ 4) + (rodierCutoffFourierMeasure M Δ hM hΔ).variation ∧ + (∫ t : ℝ, |t| ^ 4 ∂ + (rodierCutoffFourierMeasure M Δ hM hΔ).variation) ≤ + C * M * Δ⁻¹ ^ 5 := by + obtain ⟨C, hC, hmoment⟩ := + exists_rodierCutoffFourierDensity_fourthMoment_bound + refine ⟨C, hC, ?_⟩ + intro M Δ hM hΔ hΔM + have hdensity := hmoment M Δ hM hΔ hΔM + have hvariation := + rodierCutoffFourierMeasure_variation_moment_le_density + (by norm_num : 0 < 4) M Δ hM hΔ hdensity.1 + exact ⟨hvariation.1, hvariation.2.trans hdensity.2⟩ + +/-- The sixth absolute moment of the variation of Rodier's measure is +`O(M / Δ⁷)`. -/ +theorem exists_rodierCutoffFourierMeasure_sixthMoment_bound : + ∃ C : ℝ, 0 ≤ C ∧ + ∀ (M Δ : ℝ) (hM : 0 < M) (hΔ : 0 < Δ), Δ ≤ M → + Integrable (fun t : ℝ => |t| ^ 6) + (rodierCutoffFourierMeasure M Δ hM hΔ).variation ∧ + (∫ t : ℝ, |t| ^ 6 ∂ + (rodierCutoffFourierMeasure M Δ hM hΔ).variation) ≤ + C * M * Δ⁻¹ ^ 7 := by + obtain ⟨C, hC, hmoment⟩ := + exists_rodierCutoffFourierDensity_sixthMoment_bound + refine ⟨C, hC, ?_⟩ + intro M Δ hM hΔ hΔM + have hdensity := hmoment M Δ hM hΔ hΔM + have hvariation := + rodierCutoffFourierMeasure_variation_moment_le_density + (by norm_num : 0 < 6) M Δ hM hΔ hdensity.1 + exact ⟨hvariation.1, hvariation.2.trans hdensity.2⟩ + +/-- The eighth absolute moment of the variation of Rodier's measure is +`O(M / Δ⁹)`. -/ +theorem exists_rodierCutoffFourierMeasure_eighthMoment_bound : + ∃ C : ℝ, 0 ≤ C ∧ + ∀ (M Δ : ℝ) (hM : 0 < M) (hΔ : 0 < Δ), Δ ≤ M → + Integrable (fun t : ℝ => |t| ^ 8) + (rodierCutoffFourierMeasure M Δ hM hΔ).variation ∧ + (∫ t : ℝ, |t| ^ 8 ∂ + (rodierCutoffFourierMeasure M Δ hM hΔ).variation) ≤ + C * M * Δ⁻¹ ^ 9 := by + obtain ⟨C, hC, hmoment⟩ := + exists_rodierCutoffFourierDensity_eighthMoment_bound + refine ⟨C, hC, ?_⟩ + intro M Δ hM hΔ hΔM + have hdensity := hmoment M Δ hM hΔ hΔM + have hvariation := + rodierCutoffFourierMeasure_variation_moment_le_density + (by norm_num : 0 < 8) M Δ hM hΔ hdensity.1 + exact ⟨hvariation.1, hvariation.2.trans hdensity.2⟩ + +/-- The fourth absolute moment of the variation satisfies Rodier's sharp +`O(Δ⁻⁴)` estimate. -/ +theorem exists_rodierCutoffFourierMeasure_fourthMoment_sharp_bound : + ∃ C : ℝ, 0 ≤ C ∧ + ∀ (M Δ : ℝ) (hM : 0 < M) (hΔ : 0 < Δ), + Integrable (fun t : ℝ => |t| ^ 4) + (rodierCutoffFourierMeasure M Δ hM hΔ).variation ∧ + (∫ t : ℝ, |t| ^ 4 ∂ + (rodierCutoffFourierMeasure M Δ hM hΔ).variation) ≤ + C * Δ⁻¹ ^ 4 := by + obtain ⟨C, hC, hmoment⟩ := + exists_rodierCutoffFourierDensity_fourthMoment_sharp_bound + refine ⟨C, hC, ?_⟩ + intro M Δ hM hΔ + have hdensity := hmoment M Δ hM hΔ + have hvariation := + rodierCutoffFourierMeasure_variation_moment_le_density + (by norm_num : 0 < 4) M Δ hM hΔ hdensity.1 + exact ⟨hvariation.1, hvariation.2.trans hdensity.2⟩ + +/-- The sixth absolute moment of the variation satisfies Rodier's sharp +`O(Δ⁻⁶)` estimate. -/ +theorem exists_rodierCutoffFourierMeasure_sixthMoment_sharp_bound : + ∃ C : ℝ, 0 ≤ C ∧ + ∀ (M Δ : ℝ) (hM : 0 < M) (hΔ : 0 < Δ), + Integrable (fun t : ℝ => |t| ^ 6) + (rodierCutoffFourierMeasure M Δ hM hΔ).variation ∧ + (∫ t : ℝ, |t| ^ 6 ∂ + (rodierCutoffFourierMeasure M Δ hM hΔ).variation) ≤ + C * Δ⁻¹ ^ 6 := by + obtain ⟨C, hC, hmoment⟩ := + exists_rodierCutoffFourierDensity_sixthMoment_sharp_bound + refine ⟨C, hC, ?_⟩ + intro M Δ hM hΔ + have hdensity := hmoment M Δ hM hΔ + have hvariation := + rodierCutoffFourierMeasure_variation_moment_le_density + (by norm_num : 0 < 6) M Δ hM hΔ hdensity.1 + exact ⟨hvariation.1, hvariation.2.trans hdensity.2⟩ + +/-- The eighth absolute moment of the variation satisfies Rodier's sharp +`O(Δ⁻⁸)` estimate. -/ +theorem exists_rodierCutoffFourierMeasure_eighthMoment_sharp_bound : + ∃ C : ℝ, 0 ≤ C ∧ + ∀ (M Δ : ℝ) (hM : 0 < M) (hΔ : 0 < Δ), + Integrable (fun t : ℝ => |t| ^ 8) + (rodierCutoffFourierMeasure M Δ hM hΔ).variation ∧ + (∫ t : ℝ, |t| ^ 8 ∂ + (rodierCutoffFourierMeasure M Δ hM hΔ).variation) ≤ + C * Δ⁻¹ ^ 8 := by + obtain ⟨C, hC, hmoment⟩ := + exists_rodierCutoffFourierDensity_eighthMoment_sharp_bound + refine ⟨C, hC, ?_⟩ + intro M Δ hM hΔ + have hdensity := hmoment M Δ hM hΔ + have hvariation := + rodierCutoffFourierMeasure_variation_moment_le_density + (by norm_num : 0 < 8) M Δ hM hΔ hdensity.1 + exact ⟨hvariation.1, hvariation.2.trans hdensity.2⟩ + +theorem rodierCutoff_eq_one_add_fourierInv_unitDensity + (M Δ : ℝ) (hM : 0 < M) (hΔ : 0 < Δ) (x : ℝ) : + ((rodierCutoff M Δ x : ℝ) : ℂ) = + 1 + 𝓕⁻ (rodierCutoffUnitFourierDensity M Δ hM hΔ) x := by + rw [rodierCutoffRemainder_fourierInv_unitDensity] + simp + +private theorem rodierCutoff_fourierInv_unitDensity_eq_angularIntegral + (M Δ : ℝ) (hM : 0 < M) (hΔ : 0 < Δ) (x : ℝ) : + 𝓕⁻ (rodierCutoffUnitFourierDensity M Δ hM hΔ) x = + ∫ t : ℝ, Complex.exp (((t * x : ℝ) : ℂ) * Complex.I) * + rodierCutoffFourierDensity M Δ hM hΔ t := by + rw [SchwartzMap.fourierInv_coe, Real.fourierInv_eq'] + let a : ℝ := 2 * Real.pi + have ha : 0 < a := by + dsimp [a] + positivity + have hscale := Measure.integral_comp_div + (fun y : ℝ => Complex.exp (((a * y * x : ℝ) : ℂ) * Complex.I) * + ((a : ℂ)⁻¹ * rodierCutoffUnitFourierDensity M Δ hM hΔ y)) a + rw [abs_of_pos ha] at hscale + calc + _ = a • ∫ y : ℝ, + Complex.exp (((a * y * x : ℝ) : ℂ) * Complex.I) * + ((a : ℂ)⁻¹ * rodierCutoffUnitFourierDensity M Δ hM hΔ y) := by + rw [← integral_smul] + apply integral_congr_ae + filter_upwards [] with y + rw [show inner ℝ y x = y * x by simp [mul_comm]] + simp only [smul_eq_mul, Complex.real_smul] + dsimp [a] + push_cast + field_simp + _ = ∫ t : ℝ, + Complex.exp (((a * (t / a) * x : ℝ) : ℂ) * Complex.I) * + ((a : ℂ)⁻¹ * + rodierCutoffUnitFourierDensity M Δ hM hΔ (t / a)) := hscale.symm + _ = _ := by + apply integral_congr_ae + filter_upwards [] with t + simp only [rodierCutoffFourierDensity, a] + congr 2 + push_cast + field_simp + +/-- Fourier inversion in Rodier's angular-frequency convention. Equivalently, +the cutoff is represented by the complex measure `δ₀ + v(t) dt`. -/ +theorem rodierCutoff_fourierDensity_inversion + (M Δ : ℝ) (hM : 0 < M) (hΔ : 0 < Δ) (x : ℝ) : + ((rodierCutoff M Δ x : ℝ) : ℂ) = + 1 + ∫ t : ℝ, Complex.exp (((t * x : ℝ) : ℂ) * Complex.I) * + rodierCutoffFourierDensity M Δ hM hΔ t := by + rw [rodierCutoff_eq_one_add_fourierInv_unitDensity M Δ hM hΔ x, + rodierCutoff_fourierInv_unitDensity_eq_angularIntegral M Δ hM hΔ x] + +private theorem expect_pi_prod_complex + {ι α : Type*} [Fintype ι] [Fintype α] [DecidableEq ι] + (g : ι → α → ℂ) : + Finset.expect Finset.univ (fun f : ι → α ↦ ∏ i, g i (f i)) = + ∏ i, Finset.expect Finset.univ (fun a : α ↦ g i a) := by + classical + rw [Fintype.expect_eq_sum_div_card, ← Fintype.prod_sum, Fintype.card_pi] + simp_rw [Fintype.expect_eq_sum_div_card] + rw [Finset.prod_div_distrib] + norm_cast + +private theorem expect_sign_cexp_eq_cos (a : ℝ) : + Finset.expect Finset.univ (fun s : FABL.Sign ↦ + Complex.exp (Complex.I * (FABL.signValue s * a : ℝ))) = + (Real.cos a : ℂ) := by + rw [Fintype.expect_eq_sum_div_card] + norm_num [FABL.Sign, FABL.signValue] + rw [mul_comm Complex.I (a : ℂ)] + calc + (Complex.exp ((a : ℂ) * Complex.I) + + Complex.exp (-((a : ℂ) * Complex.I))) / 2 = + (2 * Complex.cos (a : ℂ)) / 2 := by + rw [Complex.two_cos] + ring_nf + _ = Complex.cos (a : ℂ) := by ring + +/-- The linear combination of two Walsh characters occurring in Rodier's +bivariate characteristic-function calculation. -/ +noncomputable def rodierPairPhase + (S T : Finset (Fin n)) (t r : ℝ) (x : {−1,1}^[n]) : ℝ := + t * FABL.monomial S x + r * FABL.monomial T x + +private theorem abs_rodierPairPhase_le + (S T : Finset (Fin n)) (t r : ℝ) (x : {−1,1}^[n]) : + |rodierPairPhase S T t r x| ≤ |t| + |r| := by + have hS : |FABL.monomial S x| = 1 := by + rcases sq_eq_one_iff.mp (FABL.monomial_sq S x) with h | h <;> simp [h] + have hT : |FABL.monomial T x| = 1 := by + rcases sq_eq_one_iff.mp (FABL.monomial_sq T x) with h | h <;> simp [h] + rw [rodierPairPhase] + calc + |t * FABL.monomial S x + r * FABL.monomial T x| ≤ + |t * FABL.monomial S x| + |r * FABL.monomial T x| := abs_add_le _ _ + _ = |t| + |r| := by simp [abs_mul, hS, hT] + +/-- The joint characteristic function of two raw Walsh coefficients. -/ +noncomputable def rodierPairCharacteristic + (S T : Finset (Fin n)) (t r : ℝ) : ℂ := + Finset.expect Finset.univ (fun f : FABL.BooleanFunction n ↦ + Complex.exp + (Complex.I * + (∑ x : {−1,1}^[n], + FABL.signValue (f x) * rodierPairPhase S T t r x : ℝ))) + +/-- The exact independent-coordinate product underlying Rodier Lemma 6.4. -/ +theorem rodierPairCharacteristic_eq_prod_cos + (S T : Finset (Fin n)) (t r : ℝ) : + rodierPairCharacteristic S T t r = + ∏ x : {−1,1}^[n], (Real.cos (rodierPairPhase S T t r x) : ℂ) := by + rw [rodierPairCharacteristic] + have hexp (f : FABL.BooleanFunction n) : + Complex.exp + (Complex.I * + (∑ x : {−1,1}^[n], + FABL.signValue (f x) * rodierPairPhase S T t r x : ℝ)) = + ∏ x : {−1,1}^[n], + Complex.exp + (Complex.I * + (FABL.signValue (f x) * rodierPairPhase S T t r x : ℝ)) := by + rw [Complex.ofReal_sum, Finset.mul_sum, Complex.exp_sum] + simp_rw [hexp] + let g : {−1,1}^[n] → FABL.Sign → ℂ := fun x s ↦ + Complex.exp + (Complex.I * + (FABL.signValue s * rodierPairPhase S T t r x : ℝ)) + change Finset.expect Finset.univ + (fun f : FABL.BooleanFunction n ↦ ∏ x, g x (f x)) = _ + rw [expect_pi_prod_complex g] + apply Finset.prod_congr rfl + intro x _ + exact expect_sign_cexp_eq_cos (rodierPairPhase S T t r x) + +/-- The raw Walsh coefficient indexed by the sign character `S`. -/ +noncomputable def rodierRawWalshCoefficient + (S : Finset (Fin n)) (f : FABL.BooleanFunction n) : ℝ := + ∑ x : {−1,1}^[n], FABL.signValue (f x) * FABL.monomial S x + +/-- The characteristic function of one raw Walsh coefficient. -/ +noncomputable def rodierSingleCharacteristic + (S : Finset (Fin n)) (t : ℝ) : ℂ := + Finset.expect Finset.univ (fun f : FABL.BooleanFunction n ↦ + Complex.exp + (((t * rodierRawWalshCoefficient S f : ℝ) : ℂ) * Complex.I)) + +theorem rodierSingleCharacteristic_eq_pair + (S T : Finset (Fin n)) (t : ℝ) : + rodierSingleCharacteristic S t = rodierPairCharacteristic S T t 0 := by + unfold rodierSingleCharacteristic rodierPairCharacteristic + rodierRawWalshCoefficient rodierPairPhase + congr 1 + funext f + apply congrArg Complex.exp + have hsum : + t * ∑ x : {−1,1}^[n], FABL.signValue (f x) * FABL.monomial S x = + ∑ x : {−1,1}^[n], + FABL.signValue (f x) * + (t * FABL.monomial S x + 0 * FABL.monomial T x) := by + rw [Finset.mul_sum] + apply Finset.sum_congr rfl + intro x _ + ring + rw [hsum] + push_cast + ring + +/-- Every raw Walsh coefficient has characteristic function +`cos(t)^(2^n)`. -/ +theorem rodierSingleCharacteristic_eq_cos_pow + (S : Finset (Fin n)) (t : ℝ) : + rodierSingleCharacteristic S t = (Real.cos t : ℂ) ^ (2 ^ n) := by + rw [rodierSingleCharacteristic_eq_pair S S t, + rodierPairCharacteristic_eq_prod_cos] + calc + ∏ x : {−1,1}^[n], (Real.cos (rodierPairPhase S S t 0 x) : ℂ) = + ∏ _x : {−1,1}^[n], (Real.cos t : ℂ) := by + apply Finset.prod_congr rfl + intro x _ + unfold rodierPairPhase + rcases sq_eq_one_iff.mp (FABL.monomial_sq S x) with h | h <;> + simp [h] + _ = (Real.cos t : ℂ) ^ (2 ^ n) := by + simp [Fintype.card_pi, FABL.Sign] + +/-- The uniform expectation of Rodier's smooth cutoff at one raw Walsh +coefficient. -/ +noncomputable def rodierSingleCutoffExpectation + (S : Finset (Fin n)) (M Δ : ℝ) : ℂ := + Finset.expect Finset.univ (fun f : FABL.BooleanFunction n ↦ + (rodierCutoff M Δ (rodierRawWalshCoefficient S f) : ℂ)) + +/-- Fourier inversion and finite averaging express the one-coefficient cutoff +expectation through its exact characteristic function. -/ +theorem rodierSingleCutoffExpectation_eq_characteristicIntegral + (S : Finset (Fin n)) (M Δ : ℝ) (hM : 0 < M) (hΔ : 0 < Δ) : + rodierSingleCutoffExpectation S M Δ = + 1 + ∫ t : ℝ, rodierSingleCharacteristic S t * + rodierCutoffFourierDensity M Δ hM hΔ t := by + let v : ℝ → ℂ := rodierCutoffFourierDensity M Δ hM hΔ + have hv : Integrable v := rodierCutoffFourierDensity_integrable M Δ hM hΔ + have hint (f : FABL.BooleanFunction n) : + Integrable (fun t : ℝ => + Complex.exp + (((t * rodierRawWalshCoefficient S f : ℝ) : ℂ) * Complex.I) * v t) := by + apply hv.bdd_mul (c := 1) + · fun_prop + · filter_upwards [] with t + simp [Complex.norm_exp] + rw [rodierSingleCutoffExpectation, Fintype.expect_eq_sum_div_card] + simp_rw [rodierCutoff_fourierDensity_inversion M Δ hM hΔ] + simp_rw [rodierSingleCharacteristic, Fintype.expect_eq_sum_div_card] + have hright : + (∫ t : ℝ, + (∑ f : FABL.BooleanFunction n, + Complex.exp + (((t * rodierRawWalshCoefficient S f : ℝ) : ℂ) * Complex.I)) / + (Fintype.card (FABL.BooleanFunction n) : ℂ) * + rodierCutoffFourierDensity M Δ hM hΔ t) = + (∑ f : FABL.BooleanFunction n, + ∫ t : ℝ, + Complex.exp + (((t * rodierRawWalshCoefficient S f : ℝ) : ℂ) * Complex.I) * + rodierCutoffFourierDensity M Δ hM hΔ t) / + (Fintype.card (FABL.BooleanFunction n) : ℂ) := by + calc + _ = ∫ t : ℝ, + (∑ f : FABL.BooleanFunction n, + Complex.exp + (((t * rodierRawWalshCoefficient S f : ℝ) : ℂ) * Complex.I) * + rodierCutoffFourierDensity M Δ hM hΔ t) / + (Fintype.card (FABL.BooleanFunction n) : ℂ) := by + apply integral_congr_ae + filter_upwards [] with t + rw [← Finset.sum_mul] + ring + _ = _ := by + rw [integral_div, + MeasureTheory.integral_finsetSum Finset.univ (fun f _ ↦ hint f)] + rw [hright] + simp only [Finset.sum_add_distrib, Finset.sum_const, Finset.card_univ, + nsmul_eq_mul] + field_simp + congr 1 + apply Finset.sum_congr rfl + intro f _ + apply integral_congr_ae + filter_upwards [] with t + congr 2 + ring + +/-- Distinct Walsh characters have zero raw correlation on the sign cube. -/ +theorem sum_monomial_mul_eq_zero_of_ne + {S T : Finset (Fin n)} (hST : S ≠ T) : + ∑ x : {−1,1}^[n], FABL.monomial S x * FABL.monomial T x = 0 := by + have h := FABL.expect_monomial_mul S T + rw [if_neg hST, Fintype.expect_eq_sum_div_card] at h + have hcard : (Fintype.card ({−1,1}^[n]) : ℝ) ≠ 0 := by + positivity + exact (div_eq_zero_iff).mp h |>.resolve_right hcard + +/-- The exact quadratic character sum in Rodier Lemma 6.4. -/ +theorem sum_rodierPairPhase_sq + {S T : Finset (Fin n)} (hST : S ≠ T) (t r : ℝ) : + ∑ x : {−1,1}^[n], rodierPairPhase S T t r x ^ 2 = + (2 : ℝ) ^ n * (t ^ 2 + r ^ 2) := by + have hcross := sum_monomial_mul_eq_zero_of_ne hST + calc + ∑ x : {−1,1}^[n], rodierPairPhase S T t r x ^ 2 = + ∑ x : {−1,1}^[n], + (t ^ 2 + r ^ 2 + + 2 * t * r * (FABL.monomial S x * FABL.monomial T x)) := by + apply Finset.sum_congr rfl + intro x _ + have hS := FABL.monomial_sq S x + have hT := FABL.monomial_sq T x + rw [rodierPairPhase] + ring_nf + rw [hS, hT] + ring + _ = (2 : ℝ) ^ n * (t ^ 2 + r ^ 2) := by + rw [Finset.sum_add_distrib, ← Finset.mul_sum, hcross] + simp + ring + +/-- The exact quartic character sum in Rodier Lemma 6.4. -/ +theorem sum_rodierPairPhase_fourth + {S T : Finset (Fin n)} (hST : S ≠ T) (t r : ℝ) : + ∑ x : {−1,1}^[n], rodierPairPhase S T t r x ^ 4 = + (2 : ℝ) ^ n * + (t ^ 4 + 6 * t ^ 2 * r ^ 2 + r ^ 4) := by + have hcross := sum_monomial_mul_eq_zero_of_ne hST + calc + ∑ x : {−1,1}^[n], rodierPairPhase S T t r x ^ 4 = + ∑ x : {−1,1}^[n], + (t ^ 4 + 6 * t ^ 2 * r ^ 2 + r ^ 4 + + (4 * t ^ 3 * r + 4 * t * r ^ 3) * + (FABL.monomial S x * FABL.monomial T x)) := by + apply Finset.sum_congr rfl + intro x _ + have hS := FABL.monomial_sq S x + have hT := FABL.monomial_sq T x + have hS3 : FABL.monomial S x ^ 3 = FABL.monomial S x := by + calc + FABL.monomial S x ^ 3 = FABL.monomial S x ^ 2 * FABL.monomial S x := by + ring + _ = FABL.monomial S x := by rw [hS]; ring + have hT3 : FABL.monomial T x ^ 3 = FABL.monomial T x := by + calc + FABL.monomial T x ^ 3 = FABL.monomial T x ^ 2 * FABL.monomial T x := by + ring + _ = FABL.monomial T x := by rw [hT]; ring + have hS4 : FABL.monomial S x ^ 4 = 1 := by + calc + FABL.monomial S x ^ 4 = (FABL.monomial S x ^ 2) ^ 2 := by ring + _ = 1 := by rw [hS]; norm_num + have hT4 : FABL.monomial T x ^ 4 = 1 := by + calc + FABL.monomial T x ^ 4 = (FABL.monomial T x ^ 2) ^ 2 := by ring + _ = 1 := by rw [hT]; norm_num + rw [rodierPairPhase] + ring_nf + rw [hS, hT, hS3, hT3, hS4, hT4] + ring + _ = (2 : ℝ) ^ n * + (t ^ 4 + 6 * t ^ 2 * r ^ 2 + r ^ 4) := by + rw [Finset.sum_add_distrib, ← Finset.mul_sum, hcross] + simp + ring + +private theorem abs_cos_sub_quartic_le + {t : ℝ} (ht : |t| ≤ 1) : + |Real.cos t - (1 - t ^ 2 / 2 + t ^ 4 / 24)| ≤ + |t| ^ 6 * (7 / 4320) := by + rw [← Real.norm_eq_abs, ← Complex.norm_real] + calc + ‖((Real.cos t - (1 - t ^ 2 / 2 + t ^ 4 / 24) : ℝ) : ℂ)‖ = + ‖Complex.cos (t : ℂ) - + (1 - (t : ℂ) ^ 2 / 2 + (t : ℂ) ^ 4 / 24)‖ := by + simp + _ = + ‖(Complex.exp (-(t : ℂ) * Complex.I) - + ∑ m ∈ Finset.range 6, + (-(t : ℂ) * Complex.I) ^ m / m.factorial) / 2 + + (Complex.exp ((t : ℂ) * Complex.I) - + ∑ m ∈ Finset.range 6, + ((t : ℂ) * Complex.I) ^ m / m.factorial) / 2‖ := by + simp [Complex.cos, field, Finset.sum_range_succ, Nat.factorial] + grind [Complex.I_sq, two_ne_zero] + _ ≤ + ‖Complex.exp (-(t : ℂ) * Complex.I) - + ∑ m ∈ Finset.range 6, + (-(t : ℂ) * Complex.I) ^ m / m.factorial‖ / 2 + + ‖Complex.exp ((t : ℂ) * Complex.I) - + ∑ m ∈ Finset.range 6, + ((t : ℂ) * Complex.I) ^ m / m.factorial‖ / 2 := by + grw [norm_add_le] + simp + _ ≤ + ‖-(t : ℂ) * Complex.I‖ ^ 6 * + (Nat.succ 6 * (Nat.factorial 6 * (6 : ℕ) : ℝ)⁻¹) / 2 + + ‖(t : ℂ) * Complex.I‖ ^ 6 * + (Nat.succ 6 * (Nat.factorial 6 * (6 : ℕ) : ℝ)⁻¹) / 2 := by + grw [Complex.exp_bound (by simpa) (by simp), + Complex.exp_bound (by simpa) (by simp)] + _ = |t| ^ 6 * (7 / 4320) := by norm_num + +/-- Rodier Relation (10), with an explicit uniform quadratic remainder on the +nonnegative half-line. -/ +theorem abs_exp_neg_sub_exp_neg_sub_linear_le_sq_div_two + (a b : ℝ) (ha : 0 ≤ a) (hb : 0 ≤ b) : + |Real.exp (-a) - Real.exp (-b) - (b - a) * Real.exp (-b)| ≤ + (a - b) ^ 2 / 2 := by + by_cases hab : a = b + · subst a + simp + have hcont : ContDiff ℝ 2 (fun s : ℝ ↦ Real.exp (-s)) := by fun_prop + obtain ⟨c, hc, hrem⟩ := + taylor_mean_remainder_lagrange_iteratedDeriv + (f := fun s : ℝ ↦ Real.exp (-s)) (x := a) (x₀ := b) (n := 1) + (Ne.symm hab) hcont.contDiffOn + have hderiv : + derivWithin (fun s : ℝ ↦ Real.exp (-s)) (Set.uIcc b a) b = + -Real.exp (-b) := by + simpa [Function.comp_def] using + ((Real.hasDerivAt_exp (-b)).comp b + (hasDerivAt_neg b)).hasDerivWithinAt.derivWithin + ((uniqueDiffOn_uIcc (Ne.symm hab)) b Set.left_mem_uIcc) + have hiteratedDeriv : + iteratedDeriv 2 (fun s : ℝ ↦ Real.exp (-s)) c = + Real.exp (-c) := by + convert congrFun (iteratedDeriv_exp_const_mul 2 (-1)) c using 1 <;> norm_num + have hremainder : + Real.exp (-a) - + (Real.exp (-b) + (a - b) * (-Real.exp (-b))) = + Real.exp (-c) * (a - b) ^ 2 / 2 := by + simpa [taylorWithinEval_succ, hderiv, hiteratedDeriv] using hrem + have hcNonneg : 0 ≤ c := by + grind [Set.uIoo] + calc + |Real.exp (-a) - Real.exp (-b) - (b - a) * Real.exp (-b)| = + |Real.exp (-c) * (a - b) ^ 2 / 2| := by + congr 1 + rw [← hremainder] + ring + _ = Real.exp (-c) * (a - b) ^ 2 / 2 := by + rw [abs_of_nonneg] + positivity + _ ≤ 1 * (a - b) ^ 2 / 2 := by + gcongr + exact Real.exp_le_one_iff.mpr (by linarith) + _ = (a - b) ^ 2 / 2 := by ring + +/-- Uniform sixth-order remainder for the logarithm of cosine on Rodier's +cutoff interval. -/ +theorem abs_log_cos_add_sq_div_two_add_pow_four_div_twelve_le + (t : ℝ) (ht : |t| ≤ 1) : + |Real.log (Real.cos t) + t ^ 2 / 2 + t ^ 4 / 12| ≤ |t| ^ 6 := by + let x : ℝ := 1 - Real.cos t + let q : ℝ := Real.cos t - (1 - t ^ 2 / 2 + t ^ 4 / 24) + have htSq : t ^ 2 ≤ 1 := by + rw [← sq_abs] + exact pow_le_one₀ (abs_nonneg t) ht + have hcosHalf : (1 / 2 : ℝ) ≤ Real.cos t := by + nlinarith [Real.one_sub_sq_div_two_le_cos (x := t)] + have hxNonneg : 0 ≤ x := by + dsimp [x] + linarith [Real.cos_le_one t] + have hxHalf : x ≤ 1 / 2 := by + dsimp [x] + linarith + have hxAbsLt : |x| < 1 := by + rw [abs_of_nonneg hxNonneg] + linarith + have hxLe : x ≤ |t| ^ 2 / 2 := by + dsimp [x] + rw [sq_abs] + linarith [Real.one_sub_sq_div_two_le_cos (x := t)] + have hlogTaylor : + |x + x ^ 2 / 2 + Real.log (1 - x)| ≤ + |x| ^ 3 / (1 - |x|) := by + have h := Real.abs_log_sub_add_sum_range_le (x := x) hxAbsLt 2 + norm_num [Finset.sum_range_succ] at h + exact h + have hlog : + |Real.log (Real.cos t) + x + x ^ 2 / 2| ≤ |t| ^ 6 / 4 := by + calc + |Real.log (Real.cos t) + x + x ^ 2 / 2| = + |x + x ^ 2 / 2 + Real.log (1 - x)| := by + congr 1 + dsimp [x] + ring_nf + _ ≤ |x| ^ 3 / (1 - |x|) := hlogTaylor + _ = x ^ 3 / (1 - x) := by rw [abs_of_nonneg hxNonneg] + _ ≤ (|t| ^ 2 / 2) ^ 3 / (1 / 2) := by + gcongr + linarith + _ = |t| ^ 6 / 4 := by ring + have hq : |q| ≤ |t| ^ 6 / 100 := by + apply (abs_cos_sub_quartic_le ht).trans + nlinarith [pow_nonneg (abs_nonneg t) 6] + have htAbsSq : |t| ^ 2 ≤ 1 := pow_le_one₀ (abs_nonneg t) ht + have htPowSixLePowFour : |t| ^ 6 ≤ |t| ^ 4 := by + calc + |t| ^ 6 = |t| ^ 4 * |t| ^ 2 := by ring + _ ≤ |t| ^ 4 * 1 := by + gcongr + _ = |t| ^ 4 := by ring + have hdifference : |t ^ 2 / 2 - x| ≤ |t| ^ 4 / 10 := by + calc + |t ^ 2 / 2 - x| = |t ^ 4 / 24 + q| := by + congr 1 + dsimp [x, q] + ring + _ ≤ |t ^ 4 / 24| + |q| := abs_add_le _ _ + _ ≤ |t| ^ 4 / 24 + |t| ^ 6 / 100 := by + gcongr + simp [abs_div, abs_pow] + _ ≤ |t| ^ 4 / 10 := by + nlinarith [pow_nonneg (abs_nonneg t) 4] + have hsum : |t ^ 2 / 2 + x| ≤ |t| ^ 2 := by + rw [abs_of_nonneg (by positivity)] + calc + t ^ 2 / 2 + x ≤ t ^ 2 / 2 + |t| ^ 2 / 2 := by gcongr + _ = |t| ^ 2 := by rw [sq_abs]; ring + have hproduct : + |(t ^ 2 / 2 - x) * (t ^ 2 / 2 + x) / 2| ≤ |t| ^ 6 / 20 := by + rw [abs_div, abs_mul] + norm_num + calc + |t ^ 2 / 2 - x| * |t ^ 2 / 2 + x| / 2 ≤ + (|t| ^ 4 / 10) * |t| ^ 2 / 2 := by gcongr + _ = |t| ^ 6 / 20 := by ring + have hpolynomial : + |-x - x ^ 2 / 2 + t ^ 2 / 2 + t ^ 4 / 12| ≤ |t| ^ 6 / 4 := by + calc + |-x - x ^ 2 / 2 + t ^ 2 / 2 + t ^ 4 / 12| = + |q + (t ^ 2 / 2 - x) * (t ^ 2 / 2 + x) / 2| := by + congr 1 + dsimp [x, q] + ring + _ ≤ |q| + |(t ^ 2 / 2 - x) * (t ^ 2 / 2 + x) / 2| := + abs_add_le _ _ + _ ≤ |t| ^ 6 / 100 + |t| ^ 6 / 20 := add_le_add hq hproduct + _ ≤ |t| ^ 6 / 4 := by + nlinarith [pow_nonneg (abs_nonneg t) 6] + calc + |Real.log (Real.cos t) + t ^ 2 / 2 + t ^ 4 / 12| = + |(Real.log (Real.cos t) + x + x ^ 2 / 2) + + (-x - x ^ 2 / 2 + t ^ 2 / 2 + t ^ 4 / 12)| := by ring_nf + _ ≤ |Real.log (Real.cos t) + x + x ^ 2 / 2| + + |-x - x ^ 2 / 2 + t ^ 2 / 2 + t ^ 4 / 12| := abs_add_le _ _ + _ ≤ |t| ^ 6 / 4 + |t| ^ 6 / 4 := add_le_add hlog hpolynomial + _ ≤ |t| ^ 6 := by + nlinarith [pow_nonneg (abs_nonneg t) 6] + +/-- The summed logarithmic remainder in Rodier's two-character expansion is +uniformly sixth order on the cutoff square. -/ +theorem abs_sum_log_cos_rodierPairPhase_add_moments_le + {S T : Finset (Fin n)} (hST : S ≠ T) (t r : ℝ) + (htr : |t| + |r| ≤ 1) : + |∑ x : {−1,1}^[n], Real.log (Real.cos (rodierPairPhase S T t r x)) + + (2 : ℝ) ^ n * (t ^ 2 + r ^ 2) / 2 + + (2 : ℝ) ^ n * (t ^ 4 + 6 * t ^ 2 * r ^ 2 + r ^ 4) / 12| ≤ + (2 : ℝ) ^ n * (|t| + |r|) ^ 6 := by + have hsum : + |∑ x : {−1,1}^[n], + (Real.log (Real.cos (rodierPairPhase S T t r x)) + + rodierPairPhase S T t r x ^ 2 / 2 + + rodierPairPhase S T t r x ^ 4 / 12)| ≤ + (2 : ℝ) ^ n * (|t| + |r|) ^ 6 := by + calc + |∑ x : {−1,1}^[n], + (Real.log (Real.cos (rodierPairPhase S T t r x)) + + rodierPairPhase S T t r x ^ 2 / 2 + + rodierPairPhase S T t r x ^ 4 / 12)| ≤ + ∑ x : {−1,1}^[n], + |Real.log (Real.cos (rodierPairPhase S T t r x)) + + rodierPairPhase S T t r x ^ 2 / 2 + + rodierPairPhase S T t r x ^ 4 / 12| := + Finset.abs_sum_le_sum_abs _ _ + _ ≤ ∑ x : {−1,1}^[n], |rodierPairPhase S T t r x| ^ 6 := by + gcongr with x + exact abs_log_cos_add_sq_div_two_add_pow_four_div_twelve_le _ + ((abs_rodierPairPhase_le S T t r x).trans htr) + _ ≤ ∑ _x : {−1,1}^[n], (|t| + |r|) ^ 6 := by + gcongr with x + exact abs_rodierPairPhase_le S T t r x + _ = (2 : ℝ) ^ n * (|t| + |r|) ^ 6 := by + simp [Fintype.card_pi, FABL.Sign, nsmul_eq_mul] + rw [← sum_rodierPairPhase_sq hST t r, + ← sum_rodierPairPhase_fourth hST t r, + Finset.sum_div, Finset.sum_div, + ← Finset.sum_add_distrib, ← Finset.sum_add_distrib] + exact hsum + +/-- On the cutoff square, the exact cosine product is the exponential of its +real logarithmic sum. -/ +theorem rodierPairCharacteristic_eq_exp_sum_log_cos + (S T : Finset (Fin n)) (t r : ℝ) (htr : |t| + |r| ≤ 1) : + rodierPairCharacteristic S T t r = + (Real.exp + (∑ x : {−1,1}^[n], + Real.log (Real.cos (rodierPairPhase S T t r x))) : ℂ) := by + rw [rodierPairCharacteristic_eq_prod_cos] + norm_cast + rw [Real.exp_sum] + apply Finset.prod_congr rfl + intro x _ + exact (Real.exp_log + (Real.cos_pos_of_le_one + ((abs_rodierPairPhase_le S T t r x).trans htr))).symm + +/-- Explicit additive-error form of Rodier Lemma 6.4 after exponentiating the +quadratic and quartic logarithmic expansion. -/ +theorem abs_exp_sum_log_cos_rodierPairPhase_sub_quarticGaussian_le + {S T : Finset (Fin n)} (hST : S ≠ T) (t r : ℝ) + (htr : |t| + |r| ≤ 1) : + |Real.exp + (∑ x : {−1,1}^[n], + Real.log (Real.cos (rodierPairPhase S T t r x))) - + (Real.exp (-((2 : ℝ) ^ n * (t ^ 2 + r ^ 2) / 2)) - + ((2 : ℝ) ^ n * + (t ^ 4 + 6 * t ^ 2 * r ^ 2 + r ^ 4) / 12) * + Real.exp (-((2 : ℝ) ^ n * (t ^ 2 + r ^ 2) / 2)))| ≤ + (2 : ℝ) ^ n * (|t| + |r|) ^ 6 + + ((2 : ℝ) ^ n * (|t| + |r|) ^ 6) ^ 2 / 2 + + ((2 : ℝ) ^ n * + (t ^ 4 + 6 * t ^ 2 * r ^ 2 + r ^ 4) / 12) ^ 2 / 2 := by + let L : ℝ := + ∑ x : {−1,1}^[n], Real.log (Real.cos (rodierPairPhase S T t r x)) + let A : ℝ := (2 : ℝ) ^ n * (t ^ 2 + r ^ 2) / 2 + let Q : ℝ := + (2 : ℝ) ^ n * (t ^ 4 + 6 * t ^ 2 * r ^ 2 + r ^ 4) / 12 + let E : ℝ := (2 : ℝ) ^ n * (|t| + |r|) ^ 6 + have hLNonpos : L ≤ 0 := by + dsimp [L] + apply Finset.sum_nonpos + intro x _ + apply Real.log_nonpos + · exact (Real.cos_pos_of_le_one + ((abs_rodierPairPhase_le S T t r x).trans htr)).le + · exact Real.cos_le_one _ + have hANonneg : 0 ≤ A := by + dsimp [A] + positivity + have hQNonneg : 0 ≤ Q := by + dsimp [Q] + positivity + have hENonneg : 0 ≤ E := by + dsimp [E] + positivity + have hdelta : |(A + Q) - (-L)| ≤ E := by + calc + |(A + Q) - (-L)| = |L + A + Q| := by ring_nf + _ ≤ E := by + simpa [L, A, Q, E] using + abs_sum_log_cos_rodierPairPhase_add_moments_le hST t r htr + have hdeltaSq : ((A + Q) - (-L)) ^ 2 ≤ E ^ 2 := by + calc + ((A + Q) - (-L)) ^ 2 = |(A + Q) - (-L)| ^ 2 := by rw [sq_abs] + _ ≤ E ^ 2 := pow_le_pow_left₀ (abs_nonneg _) hdelta 2 + have hfirstTaylor := + abs_exp_neg_sub_exp_neg_sub_linear_le_sq_div_two + (-L) (A + Q) (neg_nonneg.mpr hLNonpos) (add_nonneg hANonneg hQNonneg) + have hfirst : + |Real.exp L - + (Real.exp (-(A + Q)) + + ((A + Q) - (-L)) * Real.exp (-(A + Q)))| ≤ + E ^ 2 / 2 := by + calc + |Real.exp L - + (Real.exp (-(A + Q)) + + ((A + Q) - (-L)) * Real.exp (-(A + Q)))| = + |Real.exp (-(-L)) - Real.exp (-(A + Q)) - + ((A + Q) - (-L)) * Real.exp (-(A + Q))| := by ring_nf + _ ≤ ((-L) - (A + Q)) ^ 2 / 2 := hfirstTaylor + _ ≤ E ^ 2 / 2 := by + nlinarith [hdeltaSq] + have hexpBLeOne : Real.exp (-(A + Q)) ≤ 1 := + Real.exp_le_one_iff.mpr (by linarith) + have hlinear : + |((A + Q) - (-L)) * Real.exp (-(A + Q))| ≤ E := by + rw [abs_mul, abs_of_pos (Real.exp_pos _)] + calc + |(A + Q) - (-L)| * Real.exp (-(A + Q)) ≤ E * 1 := by + gcongr + _ = E := by ring + have htoQuartic : + |Real.exp L - Real.exp (-(A + Q))| ≤ E ^ 2 / 2 + E := by + calc + |Real.exp L - Real.exp (-(A + Q))| = + |(Real.exp L - + (Real.exp (-(A + Q)) + + ((A + Q) - (-L)) * Real.exp (-(A + Q)))) + + ((A + Q) - (-L)) * Real.exp (-(A + Q))| := by ring_nf + _ ≤ + |Real.exp L - + (Real.exp (-(A + Q)) + + ((A + Q) - (-L)) * Real.exp (-(A + Q)))| + + |((A + Q) - (-L)) * Real.exp (-(A + Q))| := abs_add_le _ _ + _ ≤ E ^ 2 / 2 + E := add_le_add hfirst hlinear + have hsecondTaylor := + abs_exp_neg_sub_exp_neg_sub_linear_le_sq_div_two + (A + Q) A (add_nonneg hANonneg hQNonneg) hANonneg + have hquartic : + |Real.exp (-(A + Q)) - + (Real.exp (-A) - Q * Real.exp (-A))| ≤ Q ^ 2 / 2 := by + calc + |Real.exp (-(A + Q)) - + (Real.exp (-A) - Q * Real.exp (-A))| = + |Real.exp (-(A + Q)) - Real.exp (-A) - + (A - (A + Q)) * Real.exp (-A)| := by ring_nf + _ ≤ ((A + Q) - A) ^ 2 / 2 := hsecondTaylor + _ = Q ^ 2 / 2 := by ring + calc + |Real.exp + (∑ x : {−1,1}^[n], + Real.log (Real.cos (rodierPairPhase S T t r x))) - + (Real.exp (-((2 : ℝ) ^ n * (t ^ 2 + r ^ 2) / 2)) - + ((2 : ℝ) ^ n * + (t ^ 4 + 6 * t ^ 2 * r ^ 2 + r ^ 4) / 12) * + Real.exp (-((2 : ℝ) ^ n * (t ^ 2 + r ^ 2) / 2)))| = + |Real.exp L - (Real.exp (-A) - Q * Real.exp (-A))| := by + rfl + _ ≤ |Real.exp L - Real.exp (-(A + Q))| + + |Real.exp (-(A + Q)) - + (Real.exp (-A) - Q * Real.exp (-A))| := by + exact (abs_sub_le _ _ _) + _ ≤ (E ^ 2 / 2 + E) + Q ^ 2 / 2 := add_le_add htoQuartic hquartic + _ = E + E ^ 2 / 2 + Q ^ 2 / 2 := by ring + _ = + (2 : ℝ) ^ n * (|t| + |r|) ^ 6 + + ((2 : ℝ) ^ n * (|t| + |r|) ^ 6) ^ 2 / 2 + + ((2 : ℝ) ^ n * + (t ^ 4 + 6 * t ^ 2 * r ^ 2 + r ^ 4) / 12) ^ 2 / 2 := by + rfl + +/-- Rodier Lemma 6.4 with explicit sixth- and eighth-order additive errors for +the exact joint characteristic function. -/ +theorem norm_rodierPairCharacteristic_sub_quarticGaussian_le + {S T : Finset (Fin n)} (hST : S ≠ T) (t r : ℝ) + (htr : |t| + |r| ≤ 1) : + ‖rodierPairCharacteristic S T t r - + ((Real.exp (-((2 : ℝ) ^ n * (t ^ 2 + r ^ 2) / 2)) - + ((2 : ℝ) ^ n * + (t ^ 4 + 6 * t ^ 2 * r ^ 2 + r ^ 4) / 12) * + Real.exp (-((2 : ℝ) ^ n * (t ^ 2 + r ^ 2) / 2)) : ℝ) : ℂ)‖ ≤ + (2 : ℝ) ^ n * (|t| + |r|) ^ 6 + + ((2 : ℝ) ^ n * (|t| + |r|) ^ 6) ^ 2 / 2 + + ((2 : ℝ) ^ n * + (t ^ 4 + 6 * t ^ 2 * r ^ 2 + r ^ 4) / 12) ^ 2 / 2 := by + rw [rodierPairCharacteristic_eq_exp_sum_log_cos S T t r htr, + ← Complex.ofReal_sub, Complex.norm_real, Real.norm_eq_abs] + exact abs_exp_sum_log_cos_rodierPairPhase_sub_quarticGaussian_le hST t r htr + +private theorem rodier_finset_ne_compl + {a : Type*} [Fintype a] [DecidableEq a] [Nonempty a] + (s : Finset a) : s ≠ sᶜ := by + intro h + let i : a := Classical.choice (inferInstance : Nonempty a) + by_cases hi : i ∈ s + · have hic : i ∈ sᶜ := by rw [← h]; exact hi + exact (Finset.mem_compl.mp hic) hi + · have hic : i ∈ sᶜ := Finset.mem_compl.mpr hi + have his : i ∈ s := by rw [h]; exact hic + exact hi his + +/-- The one-variable specialization of Rodier's quartic characteristic +expansion on the unit interval. -/ +theorem norm_rodierSingleCharacteristic_sub_quarticGaussian_le + (hn : 0 < n) (S : Finset (Fin n)) (t : ℝ) (ht : |t| ≤ 1) : + ‖rodierSingleCharacteristic S t - + ((Real.exp (-((2 : ℝ) ^ n * t ^ 2 / 2)) - + ((2 : ℝ) ^ n * t ^ 4 / 12) * + Real.exp (-((2 : ℝ) ^ n * t ^ 2 / 2)) : ℝ) : ℂ)‖ ≤ + (2 : ℝ) ^ n * |t| ^ 6 + ((2 : ℝ) ^ n) ^ 2 * |t| ^ 8 := by + let T : Finset (Fin n) := Sᶜ + haveI : Nonempty (Fin n) := Fin.pos_iff_nonempty.mp hn + have hST : S ≠ T := rodier_finset_ne_compl S + have h := norm_rodierPairCharacteristic_sub_quarticGaussian_le + hST t 0 (by simpa using ht) + rw [← rodierSingleCharacteristic_eq_pair S T t] at h + norm_num at h + have ht0 : 0 ≤ |t| := abs_nonneg t + have ht12le8 : |t| ^ 12 ≤ |t| ^ 8 := by + calc + |t| ^ 12 = |t| ^ 8 * |t| ^ 4 := by ring + _ ≤ |t| ^ 8 * 1 := by + gcongr + exact pow_le_one₀ ht0 ht + _ = |t| ^ 8 := by ring + have hpow : + (((2 : ℝ) ^ n * |t| ^ 6) ^ 2 / 2) ≤ + (((2 : ℝ) ^ n) ^ 2 * |t| ^ 8) / 2 := by + calc + _ = (((2 : ℝ) ^ n) ^ 2 * |t| ^ 12) / 2 := by ring + _ ≤ (((2 : ℝ) ^ n) ^ 2 * |t| ^ 8) / 2 := by gcongr + have hquartic : + (((2 : ℝ) ^ n * t ^ 4 / 12) ^ 2 / 2) ≤ + (((2 : ℝ) ^ n) ^ 2 * |t| ^ 8) / 288 := by + rw [show t ^ 4 = |t| ^ 4 by + calc + t ^ 4 = |t ^ 4| := (abs_of_nonneg (by positivity)).symm + _ = |t| ^ 4 := abs_pow t 4] + ring_nf + exact le_rfl + calc + _ ≤ (2 : ℝ) ^ n * |t| ^ 6 + + ((2 : ℝ) ^ n * |t| ^ 6) ^ 2 / 2 + + ((2 : ℝ) ^ n * t ^ 4 / 12) ^ 2 / 2 := by + convert h using 1 + all_goals norm_num + _ ≤ (2 : ℝ) ^ n * |t| ^ 6 + + (((2 : ℝ) ^ n) ^ 2 * |t| ^ 8) / 2 + + (((2 : ℝ) ^ n) ^ 2 * |t| ^ 8) / 288 := by gcongr + _ ≤ (2 : ℝ) ^ n * |t| ^ 6 + + ((2 : ℝ) ^ n) ^ 2 * |t| ^ 8 := by + nlinarith [mul_nonneg (sq_nonneg ((2 : ℝ) ^ n)) + (pow_nonneg ht0 8)] + +/-- A global one-variable remainder bound. Outside Rodier's unit interval, +the sixth and eighth moments absorb the bounded characteristic function. -/ +theorem norm_rodierSingleCharacteristic_sub_quarticGaussian_global_le + (hn : 0 < n) (S : Finset (Fin n)) (t : ℝ) : + ‖rodierSingleCharacteristic S t - + ((Real.exp (-((2 : ℝ) ^ n * t ^ 2 / 2)) - + ((2 : ℝ) ^ n * t ^ 4 / 12) * + Real.exp (-((2 : ℝ) ^ n * t ^ 2 / 2)) : ℝ) : ℂ)‖ ≤ + 3 * ((2 : ℝ) ^ n * |t| ^ 6 + + ((2 : ℝ) ^ n) ^ 2 * |t| ^ 8) := by + by_cases ht : |t| ≤ 1 + · exact (norm_rodierSingleCharacteristic_sub_quarticGaussian_le hn S t ht).trans (by + have hnonneg : 0 ≤ (2 : ℝ) ^ n * |t| ^ 6 + + ((2 : ℝ) ^ n) ^ 2 * |t| ^ 8 := by positivity + nlinarith) + · have ht1 : 1 ≤ |t| := (lt_of_not_ge ht).le + let q : ℝ := (2 : ℝ) ^ n + let A : ℝ := q * t ^ 2 / 2 + let Q : ℝ := q * t ^ 4 / 12 + let G : ℝ := Real.exp (-A) + have hq : 1 ≤ q := by + dsimp [q] + exact one_le_pow₀ (by norm_num) + have hA : 0 ≤ A := by dsimp [A, q]; positivity + have hQ : 0 ≤ Q := by dsimp [Q, q]; positivity + have hG0 : 0 ≤ G := (Real.exp_pos _).le + have hG1 : G ≤ 1 := by + dsimp [G] + exact Real.exp_le_one_iff.mpr (neg_nonpos.mpr hA) + have hchar : ‖rodierSingleCharacteristic S t‖ ≤ 1 := by + rw [rodierSingleCharacteristic_eq_cos_pow, norm_pow, + Complex.norm_real, Real.norm_eq_abs] + exact pow_le_one₀ (abs_nonneg _) (Real.abs_cos_le_one _) + have happ : ‖((G - Q * G : ℝ) : ℂ)‖ ≤ 1 + Q := by + rw [Complex.norm_real, Real.norm_eq_abs] + calc + |G - Q * G| ≤ |G| + |Q * G| := abs_sub _ _ + _ = G + Q * G := by rw [abs_of_nonneg hG0, abs_mul, + abs_of_nonneg hQ, abs_of_nonneg hG0] + _ ≤ 1 + Q := by nlinarith [mul_le_mul_of_nonneg_left hG1 hQ] + have hqpow : 1 ≤ q ^ 2 * |t| ^ 8 := by + have hq2 : 1 ≤ q ^ 2 := one_le_pow₀ hq + have ht8 : 1 ≤ |t| ^ 8 := one_le_pow₀ ht1 + nlinarith [mul_le_mul hq2 ht8 zero_le_one + (by positivity : 0 ≤ q ^ 2)] + have hQbound : Q ≤ q * |t| ^ 6 := by + have ht46 : |t| ^ 4 ≤ |t| ^ 6 := by + have ht2 : 1 ≤ |t| ^ 2 := one_le_pow₀ ht1 + calc + |t| ^ 4 = |t| ^ 4 * 1 := by ring + _ ≤ |t| ^ 4 * |t| ^ 2 := + mul_le_mul_of_nonneg_left ht2 (by positivity) + _ = |t| ^ 6 := by ring + dsimp [Q] + have hq0 : 0 ≤ q := le_trans zero_le_one hq + calc + q * t ^ 4 / 12 = q * |t| ^ 4 / 12 := by + congr 2 + calc + t ^ 4 = |t ^ 4| := (abs_of_nonneg (by positivity)).symm + _ = |t| ^ 4 := abs_pow t 4 + _ ≤ q * |t| ^ 4 := by + have : 0 ≤ q * |t| ^ 4 := by positivity + nlinarith + _ ≤ q * |t| ^ 6 := mul_le_mul_of_nonneg_left ht46 hq0 + calc + _ ≤ ‖rodierSingleCharacteristic S t‖ + + ‖((G - Q * G : ℝ) : ℂ)‖ := norm_sub_le _ _ + _ ≤ 1 + (1 + Q) := add_le_add hchar happ + _ ≤ 3 * (q * |t| ^ 6 + q ^ 2 * |t| ^ 8) := by + have hq6 : 0 ≤ q * |t| ^ 6 := by positivity + nlinarith + _ = _ := by rfl + +/-- The Gaussian main term integrated against Rodier's Fourier--Stieltjes +measure `U = δ₀ + v(t)dt`. -/ +noncomputable def rodierCutoffGaussianIntegral + (n : ℕ) (M Δ : ℝ) (hM : 0 < M) (hΔ : 0 < Δ) : ℂ := + 1 + ∫ t : ℝ, (Real.exp (-((2 : ℝ) ^ n * t ^ 2 / 2)) : ℂ) * + rodierCutoffFourierDensity M Δ hM hΔ t + +/-- The `p`th Gaussian-weighted moment of the density part of Rodier's +Fourier--Stieltjes measure. For positive `p`, the omitted Dirac contribution +vanishes. -/ +noncomputable def rodierGaussianWeightedDensityMoment (n p : ℕ) + (M Δ : ℝ) (hM : 0 < M) (hΔ : 0 < Δ) : ℂ := + ∫ t : ℝ, ((t ^ p * Real.exp (-((2 : ℝ) ^ n * t ^ 2 / 2)) : ℝ) : ℂ) * + rodierCutoffFourierDensity M Δ hM hΔ t + +/-- The quartic Gaussian correction leaves only the sixth- and eighth-order +remainders in the one-coefficient cutoff expectation. -/ +theorem norm_rodierSingleCutoffExpectation_sub_quarticGaussianIntegral_le + (hn : 0 < n) (S : Finset (Fin n)) + (M Δ : ℝ) (hM : 0 < M) (hΔ : 0 < Δ) (hΔM : Δ ≤ M) : + ‖rodierSingleCutoffExpectation S M Δ - + (rodierCutoffGaussianIntegral n M Δ hM hΔ - + ((2 : ℝ) ^ n / 12 : ℝ) * + rodierGaussianWeightedDensityMoment n 4 M Δ hM hΔ)‖ ≤ + (3 * (2 : ℝ) ^ n) * + (∫ t : ℝ, |t| ^ 6 * + ‖rodierCutoffFourierDensity M Δ hM hΔ t‖) + + (3 * ((2 : ℝ) ^ n) ^ 2) * + (∫ t : ℝ, |t| ^ 8 * + ‖rodierCutoffFourierDensity M Δ hM hΔ t‖) := by + let q : ℝ := (2 : ℝ) ^ n + let v : ℝ → ℂ := rodierCutoffFourierDensity M Δ hM hΔ + let g : ℝ → ℂ := fun t => (Real.exp (-(q * t ^ 2 / 2)) : ℂ) + obtain ⟨C₄, hC₄, hm₄⟩ := + exists_rodierCutoffFourierDensity_fourthMoment_bound + obtain ⟨C₆, hC₆, hm₆⟩ := + exists_rodierCutoffFourierDensity_sixthMoment_bound + obtain ⟨C₈, hC₈, hm₈⟩ := + exists_rodierCutoffFourierDensity_eighthMoment_bound + have h₄ := (hm₄ M Δ hM hΔ hΔM).1 + have h₆ := (hm₆ M Δ hM hΔ hΔM).1 + have h₈ := (hm₈ M Δ hM hΔ hΔM).1 + have hv : Integrable v := + rodierCutoffFourierDensity_integrable M Δ hM hΔ + have hcharCont : Continuous (rodierSingleCharacteristic S) := by + rw [show rodierSingleCharacteristic S = + fun t : ℝ => (Real.cos t : ℂ) ^ (2 ^ n) by + funext t + exact rodierSingleCharacteristic_eq_cos_pow S t] + fun_prop + have hcharNorm (t : ℝ) : ‖rodierSingleCharacteristic S t‖ ≤ 1 := by + rw [rodierSingleCharacteristic_eq_cos_pow, norm_pow, + Complex.norm_real, Real.norm_eq_abs] + exact pow_le_one₀ (abs_nonneg _) (Real.abs_cos_le_one _) + have hcharInt : Integrable (fun t => rodierSingleCharacteristic S t * v t) := by + apply hv.bdd_mul (c := 1) hcharCont.aestronglyMeasurable + exact Filter.Eventually.of_forall hcharNorm + have hgCont : Continuous g := by + dsimp [g] + fun_prop + have hgNorm (t : ℝ) : ‖g t‖ ≤ 1 := by + dsimp [g] + rw [Complex.norm_real, Real.norm_eq_abs, + abs_of_pos (Real.exp_pos _)] + apply Real.exp_le_one_iff.mpr + have : 0 ≤ q * t ^ 2 / 2 := by dsimp [q]; positivity + linarith + have hgInt : Integrable (fun t => g t * v t) := by + apply hv.bdd_mul (c := 1) hgCont.aestronglyMeasurable + exact Filter.Eventually.of_forall hgNorm + have h4gInt : Integrable (fun t : ℝ => + (((t ^ 4 * Real.exp (-(q * t ^ 2 / 2)) : ℝ) : ℂ) * v t)) := by + apply h₄.mono' + · fun_prop + · filter_upwards [] with t + rw [norm_mul, Complex.norm_real, Real.norm_eq_abs, abs_mul, + abs_of_nonneg (by positivity : 0 ≤ t ^ 4), + abs_of_pos (Real.exp_pos _)] + have heg : Real.exp (-(q * t ^ 2 / 2)) ≤ 1 := by + apply Real.exp_le_one_iff.mpr + have : 0 ≤ q * t ^ 2 / 2 := by dsimp [q]; positivity + linarith + rw [show t ^ 4 = |t| ^ 4 by + calc + t ^ 4 = |t ^ 4| := (abs_of_nonneg (by positivity)).symm + _ = |t| ^ 4 := abs_pow t 4] + exact mul_le_mul_of_nonneg_right + (mul_le_of_le_one_right (by positivity) heg) (norm_nonneg _) + have happInt : Integrable (fun t : ℝ => + (g t - ((q / 12 : ℝ) : ℂ) * + ((t ^ 4 * Real.exp (-(q * t ^ 2 / 2)) : ℝ) : ℂ)) * v t) := by + refine (hgInt.sub (h4gInt.const_mul ((q / 12 : ℝ) : ℂ))).congr ?_ + filter_upwards [] with t + simp only [Pi.sub_apply, sub_mul, mul_assoc] + have hpoint (t : ℝ) : + ‖(rodierSingleCharacteristic S t - + (g t - ((q / 12 : ℝ) : ℂ) * + ((t ^ 4 * Real.exp (-(q * t ^ 2 / 2)) : ℝ) : ℂ))) * v t‖ ≤ + (3 * q * |t| ^ 6 + 3 * q ^ 2 * |t| ^ 8) * ‖v t‖ := by + have hrem := + norm_rodierSingleCharacteristic_sub_quarticGaussian_global_le hn S t + have happ : + g t - ((q / 12 : ℝ) : ℂ) * + ((t ^ 4 * Real.exp (-(q * t ^ 2 / 2)) : ℝ) : ℂ) = + (((Real.exp (-(q * t ^ 2 / 2)) - + (q * t ^ 4 / 12) * Real.exp (-(q * t ^ 2 / 2)) : ℝ) : ℂ)) := by + dsimp [g] + push_cast + ring + rw [norm_mul] + apply mul_le_mul_of_nonneg_right _ (norm_nonneg _) + rw [happ] + calc + _ ≤ 3 * (q * |t| ^ 6 + q ^ 2 * |t| ^ 8) := by + simpa [q] using hrem + _ = _ := by ring + have h₆' : Integrable (fun t : ℝ => + (3 * q) * (|t| ^ 6 * ‖v t‖)) := h₆.const_mul _ + have h₈' : Integrable (fun t : ℝ => + (3 * q ^ 2) * (|t| ^ 8 * ‖v t‖)) := h₈.const_mul _ + have henv : Integrable (fun t : ℝ => + (3 * q * |t| ^ 6 + 3 * q ^ 2 * |t| ^ 8) * ‖v t‖) := by + refine (h₆'.add h₈').congr ?_ + filter_upwards [] with t + simp only [Pi.add_apply] + ring + have happIntegral : + (∫ t : ℝ, (g t - ((q / 12 : ℝ) : ℂ) * + ((t ^ 4 * Real.exp (-(q * t ^ 2 / 2)) : ℝ) : ℂ)) * v t) = + (∫ t : ℝ, g t * v t) - ((q / 12 : ℝ) : ℂ) * + ∫ t : ℝ, + (((t ^ 4 * Real.exp (-(q * t ^ 2 / 2)) : ℝ) : ℂ) * v t) := by + rw [show (fun t : ℝ => (g t - ((q / 12 : ℝ) : ℂ) * + ((t ^ 4 * Real.exp (-(q * t ^ 2 / 2)) : ℝ) : ℂ)) * v t) = + fun t => g t * v t - ((q / 12 : ℝ) : ℂ) * + (((t ^ 4 * Real.exp (-(q * t ^ 2 / 2)) : ℝ) : ℂ) * v t) by + funext t + rw [sub_mul] + rw [mul_assoc], + integral_sub hgInt (h4gInt.const_mul _), integral_const_mul] + rw [rodierSingleCutoffExpectation_eq_characteristicIntegral S M Δ hM hΔ, + rodierCutoffGaussianIntegral, rodierGaussianWeightedDensityMoment] + change ‖(1 + ∫ t : ℝ, rodierSingleCharacteristic S t * v t) - + ((1 + ∫ t : ℝ, g t * v t) - + ((q / 12 : ℝ) : ℂ) * ∫ t : ℝ, + (((t ^ 4 * Real.exp (-(q * t ^ 2 / 2)) : ℝ) : ℂ) * v t))‖ ≤ _ + rw [show (1 + ∫ t : ℝ, rodierSingleCharacteristic S t * v t) - + ((1 + ∫ t : ℝ, g t * v t) - + ((q / 12 : ℝ) : ℂ) * ∫ t : ℝ, + (((t ^ 4 * Real.exp (-(q * t ^ 2 / 2)) : ℝ) : ℂ) * v t)) = + (∫ t : ℝ, rodierSingleCharacteristic S t * v t) - + ∫ t : ℝ, (g t - ((q / 12 : ℝ) : ℂ) * + ((t ^ 4 * Real.exp (-(q * t ^ 2 / 2)) : ℝ) : ℂ)) * v t by + rw [happIntegral] + ring, + ← integral_sub hcharInt happInt] + rw [show (fun t : ℝ => rodierSingleCharacteristic S t * v t - + (g t - ((q / 12 : ℝ) : ℂ) * + ((t ^ 4 * Real.exp (-(q * t ^ 2 / 2)) : ℝ) : ℂ)) * v t) = + fun t => (rodierSingleCharacteristic S t - + (g t - ((q / 12 : ℝ) : ℂ) * + ((t ^ 4 * Real.exp (-(q * t ^ 2 / 2)) : ℝ) : ℂ))) * v t by + funext t + ring] + calc + _ ≤ ∫ t : ℝ, ‖(rodierSingleCharacteristic S t - + (g t - ((q / 12 : ℝ) : ℂ) * + ((t ^ 4 * Real.exp (-(q * t ^ 2 / 2)) : ℝ) : ℂ))) * v t‖ := + norm_integral_le_integral_norm _ + _ ≤ ∫ t : ℝ, + (3 * q * |t| ^ 6 + 3 * q ^ 2 * |t| ^ 8) * ‖v t‖ := + integral_mono_of_nonneg + (Filter.Eventually.of_forall fun _ => norm_nonneg _) henv + (Filter.Eventually.of_forall hpoint) + _ = (3 * q) * (∫ t : ℝ, |t| ^ 6 * ‖v t‖) + + (3 * q ^ 2) * (∫ t : ℝ, |t| ^ 8 * ‖v t‖) := by + rw [show (fun t : ℝ => + (3 * q * |t| ^ 6 + 3 * q ^ 2 * |t| ^ 8) * ‖v t‖) = + fun t => (3 * q) * (|t| ^ 6 * ‖v t‖) + + (3 * q ^ 2) * (|t| ^ 8 * ‖v t‖) by + funext t + ring, + integral_add h₆' h₈', integral_const_mul, integral_const_mul] + _ = _ := by rfl + +/-- Rodier equation (12): the one-coefficient cutoff expectation differs from +its Gaussian `U`-integral by the fourth, sixth, and eighth absolute moments of +the Fourier density. -/ +theorem norm_rodierSingleCutoffExpectation_sub_gaussianIntegral_le + (hn : 0 < n) (S : Finset (Fin n)) + (M Δ : ℝ) (hM : 0 < M) (hΔ : 0 < Δ) (hΔM : Δ ≤ M) : + ‖rodierSingleCutoffExpectation S M Δ - + rodierCutoffGaussianIntegral n M Δ hM hΔ‖ ≤ + ((2 : ℝ) ^ n / 12) * + (∫ t : ℝ, |t| ^ 4 * + ‖rodierCutoffFourierDensity M Δ hM hΔ t‖) + + (3 * (2 : ℝ) ^ n) * + (∫ t : ℝ, |t| ^ 6 * + ‖rodierCutoffFourierDensity M Δ hM hΔ t‖) + + (3 * ((2 : ℝ) ^ n) ^ 2) * + (∫ t : ℝ, |t| ^ 8 * + ‖rodierCutoffFourierDensity M Δ hM hΔ t‖) := by + let q : ℝ := (2 : ℝ) ^ n + let v : ℝ → ℂ := rodierCutoffFourierDensity M Δ hM hΔ + let g : ℝ → ℂ := fun t => + (Real.exp (-(q * t ^ 2 / 2)) : ℂ) + obtain ⟨C₄, hC₄, hm₄⟩ := + exists_rodierCutoffFourierDensity_fourthMoment_bound + obtain ⟨C₆, hC₆, hm₆⟩ := + exists_rodierCutoffFourierDensity_sixthMoment_bound + obtain ⟨C₈, hC₈, hm₈⟩ := + exists_rodierCutoffFourierDensity_eighthMoment_bound + have h₄ := (hm₄ M Δ hM hΔ hΔM).1 + have h₆ := (hm₆ M Δ hM hΔ hΔM).1 + have h₈ := (hm₈ M Δ hM hΔ hΔM).1 + have hv : Integrable v := rodierCutoffFourierDensity_integrable M Δ hM hΔ + have hcharCont : Continuous (rodierSingleCharacteristic S) := by + rw [show rodierSingleCharacteristic S = + fun t : ℝ => (Real.cos t : ℂ) ^ (2 ^ n) by + funext t + exact rodierSingleCharacteristic_eq_cos_pow S t] + fun_prop + have hcharNorm (t : ℝ) : ‖rodierSingleCharacteristic S t‖ ≤ 1 := by + rw [rodierSingleCharacteristic_eq_cos_pow, norm_pow, + Complex.norm_real, Real.norm_eq_abs] + exact pow_le_one₀ (abs_nonneg _) (Real.abs_cos_le_one _) + have hcharInt : Integrable (fun t => rodierSingleCharacteristic S t * v t) := by + apply hv.bdd_mul (c := 1) hcharCont.aestronglyMeasurable + exact Filter.Eventually.of_forall hcharNorm + have hgCont : Continuous g := by + dsimp [g] + fun_prop + have hgNorm (t : ℝ) : ‖g t‖ ≤ 1 := by + dsimp [g] + rw [Complex.norm_real, Real.norm_eq_abs, + abs_of_pos (Real.exp_pos _)] + apply Real.exp_le_one_iff.mpr + have hnonneg : 0 ≤ q * t ^ 2 / 2 := by + dsimp [q] + positivity + linarith + have hgInt : Integrable (fun t => g t * v t) := by + apply hv.bdd_mul (c := 1) hgCont.aestronglyMeasurable + exact Filter.Eventually.of_forall hgNorm + have hpoint (t : ℝ) : + ‖(rodierSingleCharacteristic S t - g t) * v t‖ ≤ + (q / 12 * |t| ^ 4 + 3 * q * |t| ^ 6 + + 3 * q ^ 2 * |t| ^ 8) * ‖v t‖ := by + let G : ℝ := Real.exp (-(q * t ^ 2 / 2)) + let Q : ℝ := q * t ^ 4 / 12 + have hG0 : 0 ≤ G := (Real.exp_pos _).le + have hG1 : G ≤ 1 := by + apply Real.exp_le_one_iff.mpr + have hnonneg : 0 ≤ q * t ^ 2 / 2 := by + dsimp [q] + positivity + linarith + have hQ0 : 0 ≤ Q := by dsimp [Q, q]; positivity + have hrem := + norm_rodierSingleCharacteristic_sub_quarticGaussian_global_le hn S t + have hquartic : ‖((Q * G : ℝ) : ℂ)‖ ≤ q / 12 * |t| ^ 4 := by + rw [Complex.norm_real, Real.norm_eq_abs, abs_mul, + abs_of_nonneg hQ0, abs_of_nonneg hG0] + have hQeq : Q = q / 12 * |t| ^ 4 := by + dsimp [Q] + rw [show t ^ 4 = |t| ^ 4 by + calc + t ^ 4 = |t ^ 4| := (abs_of_nonneg (by positivity)).symm + _ = |t| ^ 4 := abs_pow t 4] + ring + rw [hQeq] + exact mul_le_of_le_one_right (by positivity) hG1 + have hdiff : + ‖rodierSingleCharacteristic S t - g t‖ ≤ + q / 12 * |t| ^ 4 + 3 * q * |t| ^ 6 + + 3 * q ^ 2 * |t| ^ 8 := by + calc + _ = ‖(rodierSingleCharacteristic S t - + ((G - Q * G : ℝ) : ℂ)) - ((Q * G : ℝ) : ℂ)‖ := by + apply congrArg norm + dsimp [g, G] + push_cast + ring + _ ≤ ‖rodierSingleCharacteristic S t - + ((G - Q * G : ℝ) : ℂ)‖ + ‖((Q * G : ℝ) : ℂ)‖ := + norm_sub_le _ _ + _ ≤ 3 * (q * |t| ^ 6 + q ^ 2 * |t| ^ 8) + + q / 12 * |t| ^ 4 := by + have hrem' : + ‖rodierSingleCharacteristic S t - + ((G - Q * G : ℝ) : ℂ)‖ ≤ + 3 * (q * |t| ^ 6 + q ^ 2 * |t| ^ 8) := by + simpa [q, G, Q] using hrem + exact add_le_add hrem' hquartic + _ = _ := by ring + rw [norm_mul] + exact mul_le_mul_of_nonneg_right hdiff (norm_nonneg _) + have h₄' : Integrable (fun t : ℝ => q / 12 * (|t| ^ 4 * ‖v t‖)) := + h₄.const_mul _ + have h₆' : Integrable (fun t : ℝ => (3 * q) * (|t| ^ 6 * ‖v t‖)) := + h₆.const_mul _ + have h₈' : Integrable (fun t : ℝ => (3 * q ^ 2) * (|t| ^ 8 * ‖v t‖)) := + h₈.const_mul _ + have henv : Integrable (fun t : ℝ => + (q / 12 * |t| ^ 4 + 3 * q * |t| ^ 6 + + 3 * q ^ 2 * |t| ^ 8) * ‖v t‖) := by + refine ((h₄'.add h₆').add h₈').congr ?_ + filter_upwards [] with t + simp only [Pi.add_apply] + ring + rw [rodierSingleCutoffExpectation_eq_characteristicIntegral, + rodierCutoffGaussianIntegral] + change ‖(1 + ∫ t : ℝ, rodierSingleCharacteristic S t * v t) - + (1 + ∫ t : ℝ, g t * v t)‖ ≤ _ + rw [show (1 + ∫ t : ℝ, rodierSingleCharacteristic S t * v t) - + (1 + ∫ t : ℝ, g t * v t) = + (∫ t : ℝ, rodierSingleCharacteristic S t * v t) - + ∫ t : ℝ, g t * v t by ring, + ← integral_sub hcharInt hgInt] + rw [show (fun t : ℝ => rodierSingleCharacteristic S t * v t - g t * v t) = + fun t => (rodierSingleCharacteristic S t - g t) * v t by + funext t + ring] + calc + _ ≤ ∫ t : ℝ, ‖(rodierSingleCharacteristic S t - g t) * v t‖ := + norm_integral_le_integral_norm _ + _ ≤ ∫ t : ℝ, + (q / 12 * |t| ^ 4 + 3 * q * |t| ^ 6 + + 3 * q ^ 2 * |t| ^ 8) * ‖v t‖ := + integral_mono_of_nonneg + (Filter.Eventually.of_forall fun _ => norm_nonneg _) + henv (Filter.Eventually.of_forall hpoint) + _ = q / 12 * (∫ t : ℝ, |t| ^ 4 * ‖v t‖) + + (3 * q) * (∫ t : ℝ, |t| ^ 6 * ‖v t‖) + + (3 * q ^ 2) * (∫ t : ℝ, |t| ^ 8 * ‖v t‖) := by + rw [show (fun t : ℝ => + (q / 12 * |t| ^ 4 + 3 * q * |t| ^ 6 + + 3 * q ^ 2 * |t| ^ 8) * ‖v t‖) = + fun t => q / 12 * (|t| ^ 4 * ‖v t‖) + + (3 * q) * (|t| ^ 6 * ‖v t‖) + + (3 * q ^ 2) * (|t| ^ 8 * ‖v t‖) by + funext t + ring] + calc + _ = (∫ t : ℝ, q / 12 * (|t| ^ 4 * ‖v t‖) + + (3 * q) * (|t| ^ 6 * ‖v t‖)) + + ∫ t : ℝ, (3 * q ^ 2) * (|t| ^ 8 * ‖v t‖) := + integral_add (h₄'.add h₆') h₈' + _ = ((∫ t : ℝ, q / 12 * (|t| ^ 4 * ‖v t‖)) + + ∫ t : ℝ, (3 * q) * (|t| ^ 6 * ‖v t‖)) + + ∫ t : ℝ, (3 * q ^ 2) * (|t| ^ 8 * ‖v t‖) := by + rw [integral_add h₄' h₆'] + _ = _ := by + rw [integral_const_mul, integral_const_mul, integral_const_mul] + _ = _ := by rfl + +private theorem rodier_even_pow_four (x : ℝ) : x ^ 4 = |x| ^ 4 := by + calc + x ^ 4 = |x ^ 4| := (abs_of_nonneg (by positivity)).symm + _ = |x| ^ 4 := abs_pow x 4 + +private theorem rodier_even_pow_two (x : ℝ) : x ^ 2 = |x| ^ 2 := by + rw [sq_abs] + +private theorem rodierPairQuartic_le_abs_add_pow_four + (t r : ℝ) : + t ^ 4 + 6 * t ^ 2 * r ^ 2 + r ^ 4 ≤ (|t| + |r|) ^ 4 := by + rw [rodier_even_pow_four t, rodier_even_pow_four r, + rodier_even_pow_two t, rodier_even_pow_two r] + have ht := abs_nonneg t + have hr := abs_nonneg r + nlinarith [mul_nonneg (mul_nonneg ht hr) + (add_nonneg (sq_nonneg |t|) (sq_nonneg |r|))] + +/-- Global off-diagonal form of Rodier Lemma 6.4. The sixth- and eighth-order +moments absorb the complement of the local Fourier square. -/ +theorem norm_rodierPairCharacteristic_sub_quarticGaussian_global_le + {S T : Finset (Fin n)} (hST : S ≠ T) (t r : ℝ) : + ‖rodierPairCharacteristic S T t r - + ((Real.exp (-((2 : ℝ) ^ n * (t ^ 2 + r ^ 2) / 2)) - + ((2 : ℝ) ^ n * + (t ^ 4 + 6 * t ^ 2 * r ^ 2 + r ^ 4) / 12) * + Real.exp (-((2 : ℝ) ^ n * (t ^ 2 + r ^ 2) / 2)) : ℝ) : ℂ)‖ ≤ + 3 * ((2 : ℝ) ^ n * (|t| + |r|) ^ 6 + + ((2 : ℝ) ^ n) ^ 2 * (|t| + |r|) ^ 8) := by + let q : ℝ := (2 : ℝ) ^ n + let a : ℝ := |t| + |r| + let P : ℝ := t ^ 4 + 6 * t ^ 2 * r ^ 2 + r ^ 4 + have hq : 1 ≤ q := by + dsimp [q] + exact one_le_pow₀ (by norm_num) + have ha0 : 0 ≤ a := by dsimp [a]; positivity + have hP0 : 0 ≤ P := by dsimp [P]; positivity + have hP : P ≤ a ^ 4 := by + simpa [P, a] using rodierPairQuartic_le_abs_add_pow_four t r + by_cases ha : a ≤ 1 + · have h := norm_rodierPairCharacteristic_sub_quarticGaussian_le + hST t r (by simpa [a] using ha) + have ha12le8 : a ^ 12 ≤ a ^ 8 := by + calc + a ^ 12 = a ^ 8 * a ^ 4 := by ring + _ ≤ a ^ 8 * 1 := by + gcongr + exact pow_le_one₀ ha0 ha + _ = a ^ 8 := by ring + have hpow : (q * a ^ 6) ^ 2 / 2 ≤ q ^ 2 * a ^ 8 / 2 := by + calc + _ = q ^ 2 * a ^ 12 / 2 := by ring + _ ≤ q ^ 2 * a ^ 8 / 2 := by gcongr + have hQ : q * P / 12 ≤ q * a ^ 4 / 12 := by + gcongr + have hQ0 : 0 ≤ q * P / 12 := by positivity + have hQa0 : 0 ≤ q * a ^ 4 / 12 := by positivity + have hquartic : (q * P / 12) ^ 2 / 2 ≤ q ^ 2 * a ^ 8 / 288 := by + have hsq := (sq_le_sq₀ hQ0 hQa0).mpr hQ + calc + _ ≤ (q * a ^ 4 / 12) ^ 2 / 2 := by + exact div_le_div_of_nonneg_right hsq (by norm_num) + _ = _ := by ring + calc + _ ≤ q * a ^ 6 + (q * a ^ 6) ^ 2 / 2 + + (q * P / 12) ^ 2 / 2 := by + simpa [q, a, P] using h + _ ≤ q * a ^ 6 + q ^ 2 * a ^ 8 / 2 + q ^ 2 * a ^ 8 / 288 := by + gcongr + _ ≤ 3 * (q * a ^ 6 + q ^ 2 * a ^ 8) := by + have hq6 : 0 ≤ q * a ^ 6 := by positivity + have hq8 : 0 ≤ q ^ 2 * a ^ 8 := by positivity + nlinarith + _ = _ := by rfl + · have ha1 : 1 ≤ a := (lt_of_not_ge ha).le + let A : ℝ := q * (t ^ 2 + r ^ 2) / 2 + let Q : ℝ := q * P / 12 + let G : ℝ := Real.exp (-A) + have hA : 0 ≤ A := by dsimp [A, q]; positivity + have hQ0 : 0 ≤ Q := by dsimp [Q]; positivity + have hG0 : 0 ≤ G := (Real.exp_pos _).le + have hG1 : G ≤ 1 := Real.exp_le_one_iff.mpr (neg_nonpos.mpr hA) + have hchar : ‖rodierPairCharacteristic S T t r‖ ≤ 1 := by + rw [rodierPairCharacteristic_eq_prod_cos, norm_prod] + apply Finset.prod_le_one + · intro x _ + exact norm_nonneg _ + · intro x _ + rw [Complex.norm_real, Real.norm_eq_abs] + exact Real.abs_cos_le_one _ + have happ : ‖((G - Q * G : ℝ) : ℂ)‖ ≤ 1 + Q := by + rw [Complex.norm_real, Real.norm_eq_abs] + calc + |G - Q * G| ≤ |G| + |Q * G| := abs_sub _ _ + _ = G + Q * G := by rw [abs_of_nonneg hG0, abs_mul, + abs_of_nonneg hQ0, abs_of_nonneg hG0] + _ ≤ 1 + Q := by nlinarith [mul_le_mul_of_nonneg_left hG1 hQ0] + have hqpow : 1 ≤ q ^ 2 * a ^ 8 := by + have hq2 : 1 ≤ q ^ 2 := one_le_pow₀ hq + have ha8 : 1 ≤ a ^ 8 := one_le_pow₀ ha1 + nlinarith [mul_le_mul hq2 ha8 zero_le_one + (by positivity : 0 ≤ q ^ 2)] + have hQbound : Q ≤ q * a ^ 6 := by + have ha46 : a ^ 4 ≤ a ^ 6 := by + have ha2 : 1 ≤ a ^ 2 := one_le_pow₀ ha1 + calc + a ^ 4 = a ^ 4 * 1 := by ring + _ ≤ a ^ 4 * a ^ 2 := mul_le_mul_of_nonneg_left ha2 (by positivity) + _ = a ^ 6 := by ring + dsimp [Q] + calc + q * P / 12 ≤ q * a ^ 4 / 12 := by + gcongr + _ ≤ q * a ^ 4 := by + have : 0 ≤ q * a ^ 4 := by positivity + nlinarith + _ ≤ q * a ^ 6 := + mul_le_mul_of_nonneg_left ha46 (le_trans zero_le_one hq) + calc + _ ≤ ‖rodierPairCharacteristic S T t r‖ + + ‖((G - Q * G : ℝ) : ℂ)‖ := norm_sub_le _ _ + _ ≤ 1 + (1 + Q) := add_le_add hchar happ + _ ≤ 3 * (q * a ^ 6 + q ^ 2 * a ^ 8) := by + have hq6 : 0 ≤ q * a ^ 6 := by positivity + nlinarith + _ = _ := by rfl + +/-- The pair characteristic function written directly in terms of the two raw +Walsh coefficients. -/ +theorem rodierPairCharacteristic_eq_rawWalsh + (S T : Finset (Fin n)) (t r : ℝ) : + rodierPairCharacteristic S T t r = + Finset.expect Finset.univ (fun f : FABL.BooleanFunction n ↦ + Complex.exp + (((t * rodierRawWalshCoefficient S f + + r * rodierRawWalshCoefficient T f : ℝ) : ℂ) * Complex.I)) := by + unfold rodierPairCharacteristic rodierRawWalshCoefficient rodierPairPhase + congr 1 + funext f + apply congrArg Complex.exp + have hsum : + t * ∑ x : {−1,1}^[n], FABL.signValue (f x) * FABL.monomial S x + + r * ∑ x : {−1,1}^[n], FABL.signValue (f x) * FABL.monomial T x = + ∑ x : {−1,1}^[n], FABL.signValue (f x) * + (t * FABL.monomial S x + r * FABL.monomial T x) := by + rw [Finset.mul_sum, Finset.mul_sum, ← Finset.sum_add_distrib] + apply Finset.sum_congr rfl + intro x _ + ring + rw [← hsum] + push_cast + ring + +/-- The joint cutoff expectation at two raw Walsh coefficients. -/ +noncomputable def rodierPairCutoffExpectation + (S T : Finset (Fin n)) (M Δ : ℝ) : ℂ := + Finset.expect Finset.univ (fun f : FABL.BooleanFunction n ↦ + (rodierCutoff M Δ (rodierRawWalshCoefficient S f) : ℂ) * + (rodierCutoff M Δ (rodierRawWalshCoefficient T f) : ℂ)) + +/-- The full `(δ₀ + v dt) ⊗ (δ₀ + v dt)` Fourier representation of +the joint cutoff expectation. -/ +noncomputable def rodierPairFourierIntegral + (S T : Finset (Fin n)) (M Δ : ℝ) (hM : 0 < M) (hΔ : 0 < Δ) : ℂ := + 1 + + (∫ t : ℝ, rodierSingleCharacteristic S t * + rodierCutoffFourierDensity M Δ hM hΔ t) + + (∫ r : ℝ, rodierSingleCharacteristic T r * + rodierCutoffFourierDensity M Δ hM hΔ r) + + (∫ t : ℝ, ∫ r : ℝ, rodierPairCharacteristic S T t r * + rodierCutoffFourierDensity M Δ hM hΔ t * + rodierCutoffFourierDensity M Δ hM hΔ r) + +/-- Two applications of Fourier inversion identify the joint cutoff +expectation with the full pair Fourier integral. -/ +theorem rodierPairCutoffExpectation_eq_fourierIntegral + (S T : Finset (Fin n)) (M Δ : ℝ) (hM : 0 < M) (hΔ : 0 < Δ) : + rodierPairCutoffExpectation S T M Δ = + rodierPairFourierIntegral S T M Δ hM hΔ := by + let v : ℝ → ℂ := rodierCutoffFourierDensity M Δ hM hΔ + let e : FABL.BooleanFunction n → Finset (Fin n) → ℝ → ℂ := + fun f A t ↦ Complex.exp + (((t * rodierRawWalshCoefficient A f : ℝ) : ℂ) * Complex.I) + have hv : Integrable v := rodierCutoffFourierDensity_integrable M Δ hM hΔ + have heNorm (f : FABL.BooleanFunction n) (A : Finset (Fin n)) (t : ℝ) : + ‖e f A t‖ = 1 := by + simp [e, Complex.norm_exp] + have hei (f : FABL.BooleanFunction n) (A : Finset (Fin n)) : + Integrable (fun t ↦ e f A t * v t) := by + apply hv.bdd_mul (c := 1) + · dsimp [e] + fun_prop + · filter_upwards [] with t + rw [heNorm] + have hpairPoint (f : FABL.BooleanFunction n) (t r : ℝ) : + Complex.exp + ((((t * rodierRawWalshCoefficient S f + + r * rodierRawWalshCoefficient T f : ℝ) : ℂ) * Complex.I)) * + v t * v r = + (e f S t * v t) * (e f T r * v r) := by + have hexp : + Complex.exp + ((((t * rodierRawWalshCoefficient S f + + r * rodierRawWalshCoefficient T f : ℝ) : ℂ) * Complex.I)) = + e f S t * e f T r := by + dsimp [e] + rw [← Complex.exp_add] + congr 1 + push_cast + ring + rw [hexp] + ring + have hri (f : FABL.BooleanFunction n) (t : ℝ) : + Integrable (fun r : ℝ ↦ + Complex.exp + ((((t * rodierRawWalshCoefficient S f + + r * rodierRawWalshCoefficient T f : ℝ) : ℂ) * Complex.I)) * + v t * v r) := by + rw [show (fun r : ℝ ↦ + Complex.exp + ((((t * rodierRawWalshCoefficient S f + + r * rodierRawWalshCoefficient T f : ℝ) : ℂ) * Complex.I)) * + v t * v r) = + fun r ↦ (e f S t * v t) * (e f T r * v r) by + funext r + exact hpairPoint f t r] + exact (hei f T).const_mul _ + have hinner (f : FABL.BooleanFunction n) (t : ℝ) : + (∫ r : ℝ, + Complex.exp + ((((t * rodierRawWalshCoefficient S f + + r * rodierRawWalshCoefficient T f : ℝ) : ℂ) * Complex.I)) * + v t * v r) = + e f S t * v t * (∫ r : ℝ, e f T r * v r) := by + rw [← integral_const_mul] + apply integral_congr_ae + filter_upwards [] with r + exact hpairPoint f t r + have hdoubleIntegrable (f : FABL.BooleanFunction n) : + Integrable (fun t : ℝ ↦ + ∫ r : ℝ, + Complex.exp + ((((t * rodierRawWalshCoefficient S f + + r * rodierRawWalshCoefficient T f : ℝ) : ℂ) * Complex.I)) * + v t * v r) := by + rw [show (fun t : ℝ ↦ + ∫ r : ℝ, + Complex.exp + ((((t * rodierRawWalshCoefficient S f + + r * rodierRawWalshCoefficient T f : ℝ) : ℂ) * Complex.I)) * + v t * v r) = + fun t ↦ e f S t * v t * (∫ r : ℝ, e f T r * v r) by + funext t + exact hinner f t] + exact (hei f S).mul_const _ + have hproduct (f : FABL.BooleanFunction n) : + (∫ t : ℝ, e f S t * v t) * (∫ r : ℝ, e f T r * v r) = + ∫ t : ℝ, ∫ r : ℝ, + Complex.exp + ((((t * rodierRawWalshCoefficient S f + + r * rodierRawWalshCoefficient T f : ℝ) : ℂ) * Complex.I)) * + v t * v r := by + rw [← integral_mul_const] + apply integral_congr_ae + filter_upwards [] with t + exact (hinner f t).symm + let N : ℂ := Fintype.card (FABL.BooleanFunction n) + have hmarg (A : Finset (Fin n)) : + (∫ t : ℝ, (∑ f : FABL.BooleanFunction n, e f A t) / N * v t) = + (∫ t : ℝ, ∑ f : FABL.BooleanFunction n, e f A t * v t) / N := by + calc + _ = ∫ t : ℝ, + (∑ f : FABL.BooleanFunction n, e f A t * v t) / N := by + apply integral_congr_ae + filter_upwards [] with t + rw [← Finset.sum_mul] + ring + _ = _ := integral_div N _ + have hcross : + (∫ t : ℝ, ∫ r : ℝ, + ((∑ f : FABL.BooleanFunction n, + Complex.exp + ((((t * rodierRawWalshCoefficient S f + + r * rodierRawWalshCoefficient T f : ℝ) : ℂ) * Complex.I))) / N) * + v t * v r) = + (∫ t : ℝ, ∑ f : FABL.BooleanFunction n, ∫ r : ℝ, + Complex.exp + ((((t * rodierRawWalshCoefficient S f + + r * rodierRawWalshCoefficient T f : ℝ) : ℂ) * Complex.I)) * + v t * v r) / N := by + calc + _ = ∫ t : ℝ, + (∑ f : FABL.BooleanFunction n, ∫ r : ℝ, + Complex.exp + ((((t * rodierRawWalshCoefficient S f + + r * rodierRawWalshCoefficient T f : ℝ) : ℂ) * Complex.I)) * + v t * v r) / N := by + apply integral_congr_ae + filter_upwards [] with t + calc + _ = ∫ r : ℝ, + (∑ f : FABL.BooleanFunction n, + Complex.exp + ((((t * rodierRawWalshCoefficient S f + + r * rodierRawWalshCoefficient T f : ℝ) : ℂ) * Complex.I)) * + v t * v r) / N := by + apply integral_congr_ae + filter_upwards [] with r + rw [← Finset.sum_mul] + rw [← Finset.sum_mul] + simp only [div_eq_mul_inv] + ac_rfl + _ = (∫ r : ℝ, + ∑ f : FABL.BooleanFunction n, + Complex.exp + ((((t * rodierRawWalshCoefficient S f + + r * rodierRawWalshCoefficient T f : ℝ) : ℂ) * Complex.I)) * + v t * v r) / N := integral_div N _ + _ = _ := by + rw [MeasureTheory.integral_finsetSum Finset.univ + (fun f _ ↦ hri f t)] + _ = _ := integral_div N _ + rw [rodierPairCutoffExpectation, Fintype.expect_eq_sum_div_card] + simp_rw [rodierCutoff_fourierDensity_inversion M Δ hM hΔ] + change (∑ f : FABL.BooleanFunction n, + (1 + ∫ t : ℝ, e f S t * v t) * + (1 + ∫ r : ℝ, e f T r * v r)) / + (Fintype.card (FABL.BooleanFunction n) : ℂ) = _ + simp_rw [mul_add, add_mul, hproduct] + simp only [one_mul, mul_one] + rw [Finset.sum_add_distrib, Finset.sum_add_distrib, + Finset.sum_add_distrib] + rw [← MeasureTheory.integral_finsetSum Finset.univ + (fun f _ ↦ hei f S), + ← MeasureTheory.integral_finsetSum Finset.univ + (fun f _ ↦ hei f T), + ← MeasureTheory.integral_finsetSum Finset.univ + (fun f _ ↦ hdoubleIntegrable f)] + rw [rodierPairFourierIntegral] + simp_rw [rodierSingleCharacteristic, Fintype.expect_eq_sum_div_card, + rodierPairCharacteristic_eq_rawWalsh, Fintype.expect_eq_sum_div_card] + rw [hmarg S, hmarg T, hcross] + simp only [Finset.sum_const, Finset.card_univ, nsmul_eq_mul, N] + field_simp + ring_nf + simp only [mul_comm Complex.I] + +private theorem rodierDoubleDensityAbsAddMoment_integrable_and_le + (k : ℕ) (v : ℝ → ℂ) (hv : Continuous v) + (h0 : Integrable (fun t : ℝ => ‖v t‖)) + (hk : Integrable (fun t : ℝ => |t| ^ k * ‖v t‖)) : + Integrable (fun z : ℝ × ℝ => + (|z.1| + |z.2|) ^ k * ‖v z.1‖ * ‖v z.2‖) + (volume.prod volume) ∧ + Integrable (fun t : ℝ => ∫ r : ℝ, + (|t| + |r|) ^ k * ‖v t‖ * ‖v r‖) ∧ + (∫ t : ℝ, ∫ r : ℝ, + (|t| + |r|) ^ k * ‖v t‖ * ‖v r‖) ≤ + (2 : ℝ) ^ (k - 1) * + (2 * (∫ t : ℝ, |t| ^ k * ‖v t‖) * + ∫ t : ℝ, ‖v t‖) := by + let C : ℝ := (2 : ℝ) ^ (k - 1) + let F : ℝ × ℝ → ℝ := fun z => + (|z.1| + |z.2|) ^ k * ‖v z.1‖ * ‖v z.2‖ + let E : ℝ × ℝ → ℝ := fun z => C * + ((|z.1| ^ k * ‖v z.1‖) * ‖v z.2‖ + + ‖v z.1‖ * (|z.2| ^ k * ‖v z.2‖)) + have hprod₁ : Integrable (fun z : ℝ × ℝ => + (|z.1| ^ k * ‖v z.1‖) * ‖v z.2‖) (volume.prod volume) := + hk.mul_prod h0 + have hprod₂ : Integrable (fun z : ℝ × ℝ => + ‖v z.1‖ * (|z.2| ^ k * ‖v z.2‖)) (volume.prod volume) := + h0.mul_prod hk + have hE : Integrable E (volume.prod volume) := by + exact (hprod₁.add hprod₂).const_mul C + have hpoint (z : ℝ × ℝ) : F z ≤ E z := by + have hadd := add_pow_le (abs_nonneg z.1) (abs_nonneg z.2) k + dsimp [F, E, C] + calc + _ ≤ (2 : ℝ) ^ (k - 1) * (|z.1| ^ k + |z.2| ^ k) * + ‖v z.1‖ * ‖v z.2‖ := by gcongr + _ = _ := by ring + have hFcont : Continuous F := by + dsimp [F] + fun_prop + have hF : Integrable F (volume.prod volume) := by + apply Integrable.mono' hE hFcont.aestronglyMeasurable + filter_upwards [] with z + rw [Real.norm_eq_abs, abs_of_nonneg (by dsimp [F]; positivity)] + exact hpoint z + have hprodInt₁ : + (∫ z : ℝ × ℝ, + (|z.1| ^ k * ‖v z.1‖) * ‖v z.2‖ ∂volume.prod volume) = + (∫ t : ℝ, |t| ^ k * ‖v t‖) * (∫ t : ℝ, ‖v t‖) := by + simpa using (integral_prod_mul (μ := volume) (ν := volume) + (fun t : ℝ => |t| ^ k * ‖v t‖) (fun t : ℝ => ‖v t‖)) + have hprodInt₂ : + (∫ z : ℝ × ℝ, + ‖v z.1‖ * (|z.2| ^ k * ‖v z.2‖) ∂volume.prod volume) = + (∫ t : ℝ, ‖v t‖) * (∫ t : ℝ, |t| ^ k * ‖v t‖) := by + simpa using (integral_prod_mul (μ := volume) (ν := volume) + (fun t : ℝ => ‖v t‖) (fun t : ℝ => |t| ^ k * ‖v t‖)) + refine ⟨hF, hF.integral_prod_left, ?_⟩ + calc + (∫ t : ℝ, ∫ r : ℝ, + (|t| + |r|) ^ k * ‖v t‖ * ‖v r‖) = + ∫ z : ℝ × ℝ, F z ∂volume.prod volume := by + rw [integral_prod F hF] + _ ≤ ∫ z : ℝ × ℝ, E z ∂volume.prod volume := + integral_mono hF hE hpoint + _ = C * + ((∫ t : ℝ, |t| ^ k * ‖v t‖) * (∫ t : ℝ, ‖v t‖) + + (∫ t : ℝ, ‖v t‖) * (∫ t : ℝ, |t| ^ k * ‖v t‖)) := by + rw [show E = fun z : ℝ × ℝ => C * + (((|z.1| ^ k * ‖v z.1‖) * ‖v z.2‖) + + (‖v z.1‖ * (|z.2| ^ k * ‖v z.2‖))) by rfl, + integral_const_mul, integral_add hprod₁ hprod₂, + hprodInt₁, hprodInt₂] + _ = (2 : ℝ) ^ (k - 1) * + (2 * (∫ t : ℝ, |t| ^ k * ‖v t‖) * + ∫ t : ℝ, ‖v t‖) := by + dsimp [C] + ring + +/-- The off-diagonal pair Fourier integral differs from the square of its +Gaussian main term by the fourth, sixth, and eighth double density moments. -/ +theorem norm_rodierPairCharacteristicIntegral_sub_gaussianSquare_le + {S T : Finset (Fin n)} (hST : S ≠ T) + (M Δ : ℝ) (hM : 0 < M) (hΔ : 0 < Δ) (hΔM : Δ ≤ M) : + ‖(∫ t : ℝ, ∫ r : ℝ, + rodierPairCharacteristic S T t r * + rodierCutoffFourierDensity M Δ hM hΔ t * + rodierCutoffFourierDensity M Δ hM hΔ r) - + (∫ t : ℝ, + (Real.exp (-((2 : ℝ) ^ n * t ^ 2 / 2)) : ℂ) * + rodierCutoffFourierDensity M Δ hM hΔ t) ^ 2‖ ≤ + ((2 : ℝ) ^ n / 12) * + (∫ t : ℝ, ∫ r : ℝ, + (|t| + |r|) ^ 4 * + ‖rodierCutoffFourierDensity M Δ hM hΔ t‖ * + ‖rodierCutoffFourierDensity M Δ hM hΔ r‖) + + (3 * (2 : ℝ) ^ n) * + (∫ t : ℝ, ∫ r : ℝ, + (|t| + |r|) ^ 6 * + ‖rodierCutoffFourierDensity M Δ hM hΔ t‖ * + ‖rodierCutoffFourierDensity M Δ hM hΔ r‖) + + (3 * ((2 : ℝ) ^ n) ^ 2) * + (∫ t : ℝ, ∫ r : ℝ, + (|t| + |r|) ^ 8 * + ‖rodierCutoffFourierDensity M Δ hM hΔ t‖ * + ‖rodierCutoffFourierDensity M Δ hM hΔ r‖) := by + let q : ℝ := (2 : ℝ) ^ n + let v : ℝ → ℂ := rodierCutoffFourierDensity M Δ hM hΔ + let g : ℝ → ℂ := fun t => (Real.exp (-(q * t ^ 2 / 2)) : ℂ) + have hv : Integrable v := + rodierCutoffFourierDensity_integrable M Δ hM hΔ + have hvcont : Continuous v := by + dsimp [v, rodierCutoffFourierDensity] + exact continuous_const.mul + ((rodierCutoffUnitFourierDensity M Δ hM hΔ).continuous.comp (by fun_prop)) + obtain ⟨C₄, hC₄, hm₄⟩ := + exists_rodierCutoffFourierDensity_fourthMoment_bound + obtain ⟨C₆, hC₆, hm₆⟩ := + exists_rodierCutoffFourierDensity_sixthMoment_bound + obtain ⟨C₈, hC₈, hm₈⟩ := + exists_rodierCutoffFourierDensity_eighthMoment_bound + have h₄ := (hm₄ M Δ hM hΔ hΔM).1 + have h₆ := (hm₆ M Δ hM hΔ hΔM).1 + have h₈ := (hm₈ M Δ hM hΔ hΔM).1 + have h0 : Integrable (fun t : ℝ => ‖v t‖) := hv.norm + have hD₄ := rodierDoubleDensityAbsAddMoment_integrable_and_le 4 v hvcont h0 h₄ + have hD₆ := rodierDoubleDensityAbsAddMoment_integrable_and_le 6 v hvcont h0 h₆ + have hD₈ := rodierDoubleDensityAbsAddMoment_integrable_and_le 8 v hvcont h0 h₈ + have hpairCont : Continuous (fun z : ℝ × ℝ => + rodierPairCharacteristic S T z.1 z.2) := by + rw [show (fun z : ℝ × ℝ => rodierPairCharacteristic S T z.1 z.2) = + fun z => ∏ x : {−1,1}^[n], + (Real.cos (rodierPairPhase S T z.1 z.2 x) : ℂ) by + funext z + exact rodierPairCharacteristic_eq_prod_cos S T z.1 z.2] + unfold rodierPairPhase + fun_prop + have hpairNorm (t r : ℝ) : ‖rodierPairCharacteristic S T t r‖ ≤ 1 := by + rw [rodierPairCharacteristic_eq_prod_cos, norm_prod] + apply Finset.prod_le_one + · intro x _ + exact norm_nonneg _ + · intro x _ + rw [Complex.norm_real, Real.norm_eq_abs] + exact Real.abs_cos_le_one _ + have hgCont : Continuous g := by + dsimp [g] + fun_prop + have hgNorm (t : ℝ) : ‖g t‖ ≤ 1 := by + dsimp [g] + rw [Complex.norm_real, Real.norm_eq_abs, + abs_of_pos (Real.exp_pos _)] + apply Real.exp_le_one_iff.mpr + have : 0 ≤ q * t ^ 2 / 2 := by dsimp [q]; positivity + linarith + have hvprod : Integrable (fun z : ℝ × ℝ => v z.1 * v z.2) + (volume.prod volume) := hv.mul_prod hv + have hpairProd : Integrable (fun z : ℝ × ℝ => + rodierPairCharacteristic S T z.1 z.2 * v z.1 * v z.2) + (volume.prod volume) := by + have h := hvprod.bdd_mul (c := 1) hpairCont.aestronglyMeasurable + (Filter.Eventually.of_forall fun z => hpairNorm z.1 z.2) + simpa only [mul_assoc] using h + have hgaussProd : Integrable (fun z : ℝ × ℝ => + g z.1 * g z.2 * v z.1 * v z.2) (volume.prod volume) := by + have hbound : ∀ᵐ z : ℝ × ℝ ∂volume.prod volume, + ‖g z.1 * g z.2‖ ≤ 1 := by + filter_upwards [] with z + rw [norm_mul] + exact mul_le_one₀ (hgNorm z.1) (norm_nonneg _) (hgNorm z.2) + have h := hvprod.bdd_mul (c := 1) + ((hgCont.comp continuous_fst).mul + (hgCont.comp continuous_snd)).aestronglyMeasurable hbound + refine h.congr ?_ + filter_upwards [] with z + dsimp + ring + have hgaussMul (t r : ℝ) : + ((Real.exp (-(q * (t ^ 2 + r ^ 2) / 2)) : ℝ) : ℂ) = + g t * g r := by + dsimp [g] + rw [← Complex.ofReal_mul, ← Real.exp_add] + congr 1 + ring + have hpointDiff (t r : ℝ) : + ‖rodierPairCharacteristic S T t r - g t * g r‖ ≤ + q / 12 * (|t| + |r|) ^ 4 + + 3 * q * (|t| + |r|) ^ 6 + + 3 * q ^ 2 * (|t| + |r|) ^ 8 := by + let P : ℝ := t ^ 4 + 6 * t ^ 2 * r ^ 2 + r ^ 4 + let G : ℝ := Real.exp (-(q * (t ^ 2 + r ^ 2) / 2)) + let Q : ℝ := q * P / 12 + have hG0 : 0 ≤ G := (Real.exp_pos _).le + have hG1 : G ≤ 1 := by + apply Real.exp_le_one_iff.mpr + have : 0 ≤ q * (t ^ 2 + r ^ 2) / 2 := by dsimp [q]; positivity + linarith + have hQ0 : 0 ≤ Q := by + dsimp [Q, P, q] + positivity + have hP : P ≤ (|t| + |r|) ^ 4 := by + exact rodierPairQuartic_le_abs_add_pow_four t r + have hquartic : ‖((Q * G : ℝ) : ℂ)‖ ≤ + q / 12 * (|t| + |r|) ^ 4 := by + rw [Complex.norm_real, Real.norm_eq_abs, abs_mul, + abs_of_nonneg hQ0, abs_of_nonneg hG0] + have hq0 : 0 ≤ q := by dsimp [q]; positivity + calc + Q * G ≤ Q := mul_le_of_le_one_right hQ0 hG1 + _ ≤ q / 12 * (|t| + |r|) ^ 4 := by + dsimp [Q] + nlinarith [mul_le_mul_of_nonneg_left hP hq0] + have hrem := + norm_rodierPairCharacteristic_sub_quarticGaussian_global_le + hST t r + calc + _ = ‖(rodierPairCharacteristic S T t r - + (((G - Q * G : ℝ) : ℂ))) - (((Q * G : ℝ) : ℂ))‖ := by + apply congrArg norm + rw [← hgaussMul] + dsimp [G] + push_cast + ring + _ ≤ ‖rodierPairCharacteristic S T t r - + (((G - Q * G : ℝ) : ℂ))‖ + ‖(((Q * G : ℝ) : ℂ))‖ := + norm_sub_le _ _ + _ ≤ 3 * (q * (|t| + |r|) ^ 6 + + q ^ 2 * (|t| + |r|) ^ 8) + + q / 12 * (|t| + |r|) ^ 4 := by + have hrem' : + ‖rodierPairCharacteristic S T t r - + (((G - Q * G : ℝ) : ℂ))‖ ≤ + 3 * (q * (|t| + |r|) ^ 6 + + q ^ 2 * (|t| + |r|) ^ 8) := by + simpa [q, G, Q, P] using hrem + exact add_le_add hrem' hquartic + _ = _ := by ring + let E : ℝ × ℝ → ℝ := fun z => + (q / 12 * (|z.1| + |z.2|) ^ 4 + + 3 * q * (|z.1| + |z.2|) ^ 6 + + 3 * q ^ 2 * (|z.1| + |z.2|) ^ 8) * ‖v z.1‖ * ‖v z.2‖ + have hE : Integrable E (volume.prod volume) := by + have h₄' := hD₄.1.const_mul (q / 12) + have h₆' := hD₆.1.const_mul (3 * q) + have h₈' := hD₈.1.const_mul (3 * q ^ 2) + refine ((h₄'.add h₆').add h₈').congr ?_ + filter_upwards [] with z + dsimp [E] + ring + have hpoint (z : ℝ × ℝ) : + ‖rodierPairCharacteristic S T z.1 z.2 * v z.1 * v z.2 - + g z.1 * g z.2 * v z.1 * v z.2‖ ≤ E z := by + rw [show rodierPairCharacteristic S T z.1 z.2 * v z.1 * v z.2 - + g z.1 * g z.2 * v z.1 * v z.2 = + (rodierPairCharacteristic S T z.1 z.2 - g z.1 * g z.2) * + v z.1 * v z.2 by ring, + norm_mul, norm_mul] + dsimp [E] + exact mul_le_mul_of_nonneg_right + (mul_le_mul_of_nonneg_right (hpointDiff z.1 z.2) (norm_nonneg _)) + (norm_nonneg _) + have hgaussSquare : + (∫ t : ℝ, ∫ r : ℝ, g t * g r * v t * v r) = + (∫ t : ℝ, g t * v t) ^ 2 := by + calc + _ = ∫ z : ℝ × ℝ, + (g z.1 * v z.1) * (g z.2 * v z.2) ∂volume.prod volume := by + rw [← integral_prod (fun z : ℝ × ℝ => + g z.1 * g z.2 * v z.1 * v z.2) hgaussProd] + apply integral_congr_ae + filter_upwards [] with z + ring + _ = (∫ t : ℝ, g t * v t) * (∫ t : ℝ, g t * v t) := by + simpa using (integral_prod_mul (μ := volume) (ν := volume) + (fun t : ℝ => g t * v t) (fun t : ℝ => g t * v t)) + _ = _ := by ring + change ‖(∫ t : ℝ, ∫ r : ℝ, + rodierPairCharacteristic S T t r * v t * v r) - + (∫ t : ℝ, g t * v t) ^ 2‖ ≤ _ + rw [← hgaussSquare, + ← integral_prod (fun z : ℝ × ℝ => + rodierPairCharacteristic S T z.1 z.2 * v z.1 * v z.2) hpairProd, + ← integral_prod (fun z : ℝ × ℝ => + g z.1 * g z.2 * v z.1 * v z.2) hgaussProd, + ← integral_sub hpairProd hgaussProd] + calc + _ ≤ ∫ z : ℝ × ℝ, + ‖rodierPairCharacteristic S T z.1 z.2 * v z.1 * v z.2 - + g z.1 * g z.2 * v z.1 * v z.2‖ ∂volume.prod volume := + norm_integral_le_integral_norm _ + _ ≤ ∫ z : ℝ × ℝ, E z ∂volume.prod volume := + integral_mono_of_nonneg + (Filter.Eventually.of_forall fun _ => norm_nonneg _) hE + (Filter.Eventually.of_forall hpoint) + _ = q / 12 * + (∫ t : ℝ, ∫ r : ℝ, + (|t| + |r|) ^ 4 * ‖v t‖ * ‖v r‖) + + (3 * q) * + (∫ t : ℝ, ∫ r : ℝ, + (|t| + |r|) ^ 6 * ‖v t‖ * ‖v r‖) + + (3 * q ^ 2) * + (∫ t : ℝ, ∫ r : ℝ, + (|t| + |r|) ^ 8 * ‖v t‖ * ‖v r‖) := by + let F₄ : ℝ × ℝ → ℝ := fun z => + (|z.1| + |z.2|) ^ 4 * ‖v z.1‖ * ‖v z.2‖ + let F₆ : ℝ × ℝ → ℝ := fun z => + (|z.1| + |z.2|) ^ 6 * ‖v z.1‖ * ‖v z.2‖ + let F₈ : ℝ × ℝ → ℝ := fun z => + (|z.1| + |z.2|) ^ 8 * ‖v z.1‖ * ‖v z.2‖ + have hF₄ : Integrable F₄ (volume.prod volume) := hD₄.1 + have hF₆ : Integrable F₆ (volume.prod volume) := hD₆.1 + have hF₈ : Integrable F₈ (volume.prod volume) := hD₈.1 + calc + _ = ∫ z : ℝ × ℝ, + q / 12 * F₄ z + (3 * q) * F₆ z + (3 * q ^ 2) * F₈ z + ∂volume.prod volume := by + apply integral_congr_ae + filter_upwards [] with z + dsimp [E, F₄, F₆, F₈] + ring + _ = (∫ z : ℝ × ℝ, q / 12 * F₄ z ∂volume.prod volume) + + (∫ z : ℝ × ℝ, (3 * q) * F₆ z ∂volume.prod volume) + + ∫ z : ℝ × ℝ, (3 * q ^ 2) * F₈ z ∂volume.prod volume := by + calc + _ = (∫ z : ℝ × ℝ, + q / 12 * F₄ z + (3 * q) * F₆ z ∂volume.prod volume) + + ∫ z : ℝ × ℝ, (3 * q ^ 2) * F₈ z ∂volume.prod volume := + integral_add ((hF₄.const_mul _).add (hF₆.const_mul _)) + (hF₈.const_mul _) + _ = _ := by + rw [integral_add (hF₄.const_mul _) (hF₆.const_mul _)] + _ = q / 12 * (∫ z : ℝ × ℝ, F₄ z ∂volume.prod volume) + + (3 * q) * (∫ z : ℝ × ℝ, F₆ z ∂volume.prod volume) + + (3 * q ^ 2) * (∫ z : ℝ × ℝ, F₈ z ∂volume.prod volume) := by + rw [integral_const_mul, integral_const_mul, integral_const_mul] + _ = _ := by + rw [integral_prod F₄ hF₄, integral_prod F₆ hF₆, + integral_prod F₈ hF₈] + _ = _ := by rfl + +/-- The off-diagonal pair Fourier integral with its quartic Gaussian correction retained. +Only the sixth- and eighth-order double density moments enter the remainder. -/ +theorem norm_rodierPairCharacteristicIntegral_sub_quarticGaussian_le + {n : ℕ} {S T : Finset (Fin n)} (hST : S ≠ T) + (M Δ : ℝ) (hM : 0 < M) (hΔ : 0 < Δ) : + ‖(∫ t : ℝ, ∫ r : ℝ, + rodierPairCharacteristic S T t r * + rodierCutoffFourierDensity M Δ hM hΔ t * + rodierCutoffFourierDensity M Δ hM hΔ r) - + ((∫ t : ℝ, + (Real.exp (-((2 : ℝ) ^ n * t ^ 2 / 2)) : ℂ) * + rodierCutoffFourierDensity M Δ hM hΔ t) ^ 2 - + (((2 : ℝ) ^ n / 12 : ℝ) : ℂ) * + (2 * rodierGaussianWeightedDensityMoment n 4 M Δ hM hΔ * + (∫ t : ℝ, + (Real.exp (-((2 : ℝ) ^ n * t ^ 2 / 2)) : ℂ) * + rodierCutoffFourierDensity M Δ hM hΔ t) + + 6 * (rodierGaussianWeightedDensityMoment n 2 M Δ hM hΔ) ^ 2))‖ ≤ + (3 * (2 : ℝ) ^ n) * + (∫ t : ℝ, ∫ r : ℝ, + (|t| + |r|) ^ 6 * + ‖rodierCutoffFourierDensity M Δ hM hΔ t‖ * + ‖rodierCutoffFourierDensity M Δ hM hΔ r‖) + + (3 * ((2 : ℝ) ^ n) ^ 2) * + (∫ t : ℝ, ∫ r : ℝ, + (|t| + |r|) ^ 8 * + ‖rodierCutoffFourierDensity M Δ hM hΔ t‖ * + ‖rodierCutoffFourierDensity M Δ hM hΔ r‖) := by + let q : ℝ := (2 : ℝ) ^ n + let v : ℝ → ℂ := rodierCutoffFourierDensity M Δ hM hΔ + let g : ℝ → ℂ := fun t => (Real.exp (-(q * t ^ 2 / 2)) : ℂ) + let F₀ : ℝ → ℂ := fun t => g t * v t + let F₂ : ℝ → ℂ := fun t => + ((t ^ 2 * Real.exp (-(q * t ^ 2 / 2)) : ℝ) : ℂ) * v t + let F₄ : ℝ → ℂ := fun t => + ((t ^ 4 * Real.exp (-(q * t ^ 2 / 2)) : ℝ) : ℂ) * v t + let A₂ : ℂ := ∫ t : ℝ, F₂ t + let A₄ : ℂ := ∫ t : ℝ, F₄ t + let J : ℂ := ∫ t : ℝ, F₀ t + let H : ℝ × ℝ → ℂ := fun z => + (((Real.exp (-(q * (z.1 ^ 2 + z.2 ^ 2) / 2)) - + (q * (z.1 ^ 4 + 6 * z.1 ^ 2 * z.2 ^ 2 + z.2 ^ 4) / 12) * + Real.exp (-(q * (z.1 ^ 2 + z.2 ^ 2) / 2)) : ℝ) : ℂ)) * + v z.1 * v z.2 + have hv : Integrable v := + rodierCutoffFourierDensity_integrable M Δ hM hΔ + obtain ⟨C₂, hC₂, hm₂⟩ := + exists_rodierCutoffFourierDensity_secondMoment_sharp_bound + obtain ⟨C₄, hC₄, hm₄⟩ := + exists_rodierCutoffFourierDensity_fourthMoment_sharp_bound + obtain ⟨C₆, hC₆, hm₆⟩ := + exists_rodierCutoffFourierDensity_sixthMoment_sharp_bound + obtain ⟨C₈, hC₈, hm₈⟩ := + exists_rodierCutoffFourierDensity_eighthMoment_sharp_bound + have h₂ := (hm₂ M Δ hM hΔ).1 + have h₄ := (hm₄ M Δ hM hΔ).1 + have h₆ := (hm₆ M Δ hM hΔ).1 + have h₈ := (hm₈ M Δ hM hΔ).1 + have hgNorm (t : ℝ) : ‖g t‖ ≤ 1 := by + dsimp [g] + rw [Complex.norm_real, Real.norm_eq_abs, abs_of_pos (Real.exp_pos _)] + apply Real.exp_le_one_iff.mpr + have : 0 ≤ q * t ^ 2 / 2 := by dsimp [q]; positivity + linarith + have hF₀ : Integrable F₀ := by + apply hv.bdd_mul (c := 1) + · dsimp [g] + fun_prop + · exact Filter.Eventually.of_forall hgNorm + have hweighted (p : ℕ) + (hp : Integrable (fun t : ℝ => |t| ^ p * ‖v t‖)) : + Integrable (fun t : ℝ => + ((t ^ p * Real.exp (-(q * t ^ 2 / 2)) : ℝ) : ℂ) * v t) := by + apply hp.mono' + · fun_prop + · filter_upwards [] with t + rw [norm_mul, Complex.norm_real, Real.norm_eq_abs, abs_mul, + abs_pow, abs_of_pos (Real.exp_pos _)] + have heg : Real.exp (-(q * t ^ 2 / 2)) ≤ 1 := by + apply Real.exp_le_one_iff.mpr + have : 0 ≤ q * t ^ 2 / 2 := by dsimp [q]; positivity + linarith + exact mul_le_mul_of_nonneg_right + (mul_le_of_le_one_right (by positivity) heg) (norm_nonneg _) + have hF₂ : Integrable F₂ := hweighted 2 h₂ + have hF₄ : Integrable F₄ := hweighted 4 h₄ + have hprod₀₀ : Integrable (fun z : ℝ × ℝ => F₀ z.1 * F₀ z.2) + (volume.prod volume) := hF₀.mul_prod hF₀ + have hprod₄₀ : Integrable (fun z : ℝ × ℝ => F₄ z.1 * F₀ z.2) + (volume.prod volume) := hF₄.mul_prod hF₀ + have hprod₂₂ : Integrable (fun z : ℝ × ℝ => F₂ z.1 * F₂ z.2) + (volume.prod volume) := hF₂.mul_prod hF₂ + have hprod₀₄ : Integrable (fun z : ℝ × ℝ => F₀ z.1 * F₄ z.2) + (volume.prod volume) := hF₀.mul_prod hF₄ + let E : ℝ × ℝ → ℂ := fun z => + F₀ z.1 * F₀ z.2 - ((q / 12 : ℝ) : ℂ) * + (F₄ z.1 * F₀ z.2 + 6 * (F₂ z.1 * F₂ z.2) + F₀ z.1 * F₄ z.2) + have hE : Integrable E (volume.prod volume) := by + exact hprod₀₀.sub (((hprod₄₀.add (hprod₂₂.const_mul 6)).add hprod₀₄).const_mul _) + have hHEq (z : ℝ × ℝ) : H z = E z := by + dsimp [H, E, F₀, F₂, F₄, g] + push_cast + rw [show Complex.exp (-(q * (z.1 ^ 2 + z.2 ^ 2) / 2)) = + Complex.exp (-(q * z.1 ^ 2 / 2)) * + Complex.exp (-(q * z.2 ^ 2 / 2)) by + rw [← Complex.exp_add] + congr 1 + ring] + ring + have hH : Integrable H (volume.prod volume) := + hE.congr (Filter.Eventually.of_forall fun z => (hHEq z).symm) + have hpairCont : Continuous (fun z : ℝ × ℝ => + rodierPairCharacteristic S T z.1 z.2) := by + rw [show (fun z : ℝ × ℝ => rodierPairCharacteristic S T z.1 z.2) = + fun z => ∏ x : {−1,1}^[n], + (Real.cos (rodierPairPhase S T z.1 z.2 x) : ℂ) by + funext z + exact rodierPairCharacteristic_eq_prod_cos S T z.1 z.2] + unfold rodierPairPhase + fun_prop + have hpairNorm (t r : ℝ) : ‖rodierPairCharacteristic S T t r‖ ≤ 1 := by + rw [rodierPairCharacteristic_eq_prod_cos, norm_prod] + apply Finset.prod_le_one + · intro x _ + exact norm_nonneg _ + · intro x _ + rw [Complex.norm_real, Real.norm_eq_abs] + exact Real.abs_cos_le_one _ + have hvprod : Integrable (fun z : ℝ × ℝ => v z.1 * v z.2) + (volume.prod volume) := hv.mul_prod hv + have hpairProd : Integrable (fun z : ℝ × ℝ => + rodierPairCharacteristic S T z.1 z.2 * v z.1 * v z.2) + (volume.prod volume) := by + have h := hvprod.bdd_mul (c := 1) hpairCont.aestronglyMeasurable + (Filter.Eventually.of_forall fun z => hpairNorm z.1 z.2) + simpa only [mul_assoc] using h + have hvcont : Continuous v := by + dsimp [v, rodierCutoffFourierDensity] + exact continuous_const.mul + ((rodierCutoffUnitFourierDensity M Δ hM hΔ).continuous.comp (by fun_prop)) + have hD₆ : Integrable (fun z : ℝ × ℝ => + (|z.1| + |z.2|) ^ 6 * ‖v z.1‖ * ‖v z.2‖) + (volume.prod volume) := by + let C : ℝ := (2 : ℝ) ^ 5 + let B : ℝ × ℝ → ℝ := fun z => C * + ((|z.1| ^ 6 * ‖v z.1‖) * ‖v z.2‖ + + ‖v z.1‖ * (|z.2| ^ 6 * ‖v z.2‖)) + have hB : Integrable B (volume.prod volume) := + ((h₆.mul_prod hv.norm).add (hv.norm.mul_prod h₆)).const_mul C + apply hB.mono' + · have hcont : Continuous (fun z : ℝ × ℝ => + (|z.1| + |z.2|) ^ 6 * ‖v z.1‖ * ‖v z.2‖) := by + fun_prop + exact hcont.aestronglyMeasurable + · filter_upwards [] with z + rw [Real.norm_eq_abs, + abs_of_nonneg (by positivity : 0 ≤ (|z.1| + |z.2|) ^ 6 * ‖v z.1‖ * ‖v z.2‖)] + have hadd := add_pow_le (abs_nonneg z.1) (abs_nonneg z.2) 6 + dsimp [B, C] + calc + _ ≤ (2 : ℝ) ^ 5 * (|z.1| ^ 6 + |z.2| ^ 6) * + ‖v z.1‖ * ‖v z.2‖ := by gcongr + _ = _ := by ring + have hD₈ : Integrable (fun z : ℝ × ℝ => + (|z.1| + |z.2|) ^ 8 * ‖v z.1‖ * ‖v z.2‖) + (volume.prod volume) := by + let C : ℝ := (2 : ℝ) ^ 7 + let B : ℝ × ℝ → ℝ := fun z => C * + ((|z.1| ^ 8 * ‖v z.1‖) * ‖v z.2‖ + + ‖v z.1‖ * (|z.2| ^ 8 * ‖v z.2‖)) + have hB : Integrable B (volume.prod volume) := + ((h₈.mul_prod hv.norm).add (hv.norm.mul_prod h₈)).const_mul C + apply hB.mono' + · have hcont : Continuous (fun z : ℝ × ℝ => + (|z.1| + |z.2|) ^ 8 * ‖v z.1‖ * ‖v z.2‖) := by + fun_prop + exact hcont.aestronglyMeasurable + · filter_upwards [] with z + rw [Real.norm_eq_abs, + abs_of_nonneg (by positivity : 0 ≤ (|z.1| + |z.2|) ^ 8 * ‖v z.1‖ * ‖v z.2‖)] + have hadd := add_pow_le (abs_nonneg z.1) (abs_nonneg z.2) 8 + dsimp [B, C] + calc + _ ≤ (2 : ℝ) ^ 7 * (|z.1| ^ 8 + |z.2| ^ 8) * + ‖v z.1‖ * ‖v z.2‖ := by gcongr + _ = _ := by ring + let R : ℝ × ℝ → ℝ := fun z => + (3 * q * (|z.1| + |z.2|) ^ 6 + + 3 * q ^ 2 * (|z.1| + |z.2|) ^ 8) * ‖v z.1‖ * ‖v z.2‖ + have hR : Integrable R (volume.prod volume) := by + refine ((hD₆.const_mul (3 * q)).add + (hD₈.const_mul (3 * q ^ 2))).congr ?_ + filter_upwards [] with z + dsimp [R] + ring + have hpoint (z : ℝ × ℝ) : + ‖rodierPairCharacteristic S T z.1 z.2 * v z.1 * v z.2 - H z‖ ≤ R z := by + have hrem := + norm_rodierPairCharacteristic_sub_quarticGaussian_global_le + hST z.1 z.2 + rw [show rodierPairCharacteristic S T z.1 z.2 * v z.1 * v z.2 - H z = + (rodierPairCharacteristic S T z.1 z.2 - + (((Real.exp (-(q * (z.1 ^ 2 + z.2 ^ 2) / 2)) - + (q * (z.1 ^ 4 + 6 * z.1 ^ 2 * z.2 ^ 2 + z.2 ^ 4) / 12) * + Real.exp (-(q * (z.1 ^ 2 + z.2 ^ 2) / 2)) : ℝ) : ℂ))) * + v z.1 * v z.2 by dsimp [H]; ring, + norm_mul, norm_mul] + dsimp [R] + apply mul_le_mul_of_nonneg_right _ (norm_nonneg _) + apply mul_le_mul_of_nonneg_right _ (norm_nonneg _) + calc + _ ≤ 3 * ((2 : ℝ) ^ n * (|z.1| + |z.2|) ^ 6 + + ((2 : ℝ) ^ n) ^ 2 * (|z.1| + |z.2|) ^ 8) := hrem + _ = _ := by dsimp [q]; ring + have hEIntegral : + (∫ z : ℝ × ℝ, E z ∂volume.prod volume) = + J ^ 2 - (((q / 12 : ℝ) : ℂ) * + (2 * A₄ * J + 6 * A₂ ^ 2)) := by + have h00 : (∫ z : ℝ × ℝ, F₀ z.1 * F₀ z.2 ∂volume.prod volume) = J ^ 2 := by + simpa [J, pow_two] using (integral_prod_mul (μ := volume) (ν := volume) F₀ F₀) + have h40 : (∫ z : ℝ × ℝ, F₄ z.1 * F₀ z.2 ∂volume.prod volume) = A₄ * J := by + simpa [A₄, J] using (integral_prod_mul (μ := volume) (ν := volume) F₄ F₀) + have h22 : (∫ z : ℝ × ℝ, F₂ z.1 * F₂ z.2 ∂volume.prod volume) = A₂ ^ 2 := by + simpa [A₂, pow_two] using (integral_prod_mul (μ := volume) (ν := volume) F₂ F₂) + have h04 : (∫ z : ℝ × ℝ, F₀ z.1 * F₄ z.2 ∂volume.prod volume) = J * A₄ := by + simpa [A₄, J] using (integral_prod_mul (μ := volume) (ν := volume) F₀ F₄) + have hsum : Integrable (fun z : ℝ × ℝ => + F₄ z.1 * F₀ z.2 + 6 * (F₂ z.1 * F₂ z.2) + F₀ z.1 * F₄ z.2) + (volume.prod volume) := + (hprod₄₀.add (hprod₂₂.const_mul 6)).add hprod₀₄ + have hsumIntegral : + (∫ z : ℝ × ℝ, + F₄ z.1 * F₀ z.2 + 6 * (F₂ z.1 * F₂ z.2) + + F₀ z.1 * F₄ z.2 ∂volume.prod volume) = + ((∫ z : ℝ × ℝ, F₄ z.1 * F₀ z.2 ∂volume.prod volume) + + ∫ z : ℝ × ℝ, 6 * (F₂ z.1 * F₂ z.2) ∂volume.prod volume) + + ∫ z : ℝ × ℝ, F₀ z.1 * F₄ z.2 ∂volume.prod volume := by + calc + _ = (∫ z : ℝ × ℝ, + F₄ z.1 * F₀ z.2 + 6 * (F₂ z.1 * F₂ z.2) + ∂volume.prod volume) + + ∫ z : ℝ × ℝ, F₀ z.1 * F₄ z.2 ∂volume.prod volume := by + simpa only [Pi.add_apply] using + integral_add (hprod₄₀.add (hprod₂₂.const_mul 6)) hprod₀₄ + _ = _ := by + rw [show (∫ z : ℝ × ℝ, + F₄ z.1 * F₀ z.2 + 6 * (F₂ z.1 * F₂ z.2) + ∂volume.prod volume) = + (∫ z : ℝ × ℝ, F₄ z.1 * F₀ z.2 ∂volume.prod volume) + + ∫ z : ℝ × ℝ, 6 * (F₂ z.1 * F₂ z.2) ∂volume.prod volume by + simpa only [Pi.add_apply] using + integral_add hprod₄₀ (hprod₂₂.const_mul 6)] + change (∫ z : ℝ × ℝ, + F₀ z.1 * F₀ z.2 - ((q / 12 : ℝ) : ℂ) * + (F₄ z.1 * F₀ z.2 + 6 * (F₂ z.1 * F₂ z.2) + + F₀ z.1 * F₄ z.2) ∂volume.prod volume) = _ + calc + _ = (∫ z : ℝ × ℝ, F₀ z.1 * F₀ z.2 ∂volume.prod volume) - + ∫ z : ℝ × ℝ, ((q / 12 : ℝ) : ℂ) * + (F₄ z.1 * F₀ z.2 + 6 * (F₂ z.1 * F₂ z.2) + + F₀ z.1 * F₄ z.2) ∂volume.prod volume := + integral_sub hprod₀₀ (hsum.const_mul _) + _ = (∫ z : ℝ × ℝ, F₀ z.1 * F₀ z.2 ∂volume.prod volume) - + ((q / 12 : ℝ) : ℂ) * + ∫ z : ℝ × ℝ, + F₄ z.1 * F₀ z.2 + 6 * (F₂ z.1 * F₂ z.2) + + F₀ z.1 * F₄ z.2 ∂volume.prod volume := by + rw [integral_const_mul] + _ = (∫ z : ℝ × ℝ, F₀ z.1 * F₀ z.2 ∂volume.prod volume) - + ((q / 12 : ℝ) : ℂ) * + (((∫ z : ℝ × ℝ, F₄ z.1 * F₀ z.2 ∂volume.prod volume) + + ∫ z : ℝ × ℝ, 6 * (F₂ z.1 * F₂ z.2) ∂volume.prod volume) + + ∫ z : ℝ × ℝ, F₀ z.1 * F₄ z.2 ∂volume.prod volume) := by + rw [hsumIntegral] + _ = _ := by + rw [integral_const_mul, h00, h40, h22, h04] + ring + have hHIntegral : + (∫ z : ℝ × ℝ, H z ∂volume.prod volume) = + J ^ 2 - (((q / 12 : ℝ) : ℂ) * + (2 * A₄ * J + 6 * A₂ ^ 2)) := by + rw [integral_congr_ae (Filter.Eventually.of_forall hHEq), hEIntegral] + change ‖(∫ t : ℝ, ∫ r : ℝ, + rodierPairCharacteristic S T t r * v t * v r) - + (J ^ 2 - (((q / 12 : ℝ) : ℂ) * + (2 * A₄ * J + 6 * A₂ ^ 2)))‖ ≤ _ + rw [← hHIntegral, + ← integral_prod (fun z : ℝ × ℝ => + rodierPairCharacteristic S T z.1 z.2 * v z.1 * v z.2) hpairProd, + ← integral_sub hpairProd hH] + calc + _ ≤ ∫ z : ℝ × ℝ, + ‖rodierPairCharacteristic S T z.1 z.2 * v z.1 * v z.2 - H z‖ + ∂volume.prod volume := norm_integral_le_integral_norm _ + _ ≤ ∫ z : ℝ × ℝ, R z ∂volume.prod volume := + integral_mono_of_nonneg + (Filter.Eventually.of_forall fun _ => norm_nonneg _) hR + (Filter.Eventually.of_forall hpoint) + _ = (3 * q) * + (∫ t : ℝ, ∫ r : ℝ, + (|t| + |r|) ^ 6 * ‖v t‖ * ‖v r‖) + + (3 * q ^ 2) * + (∫ t : ℝ, ∫ r : ℝ, + (|t| + |r|) ^ 8 * ‖v t‖ * ‖v r‖) := by + rw [show R = fun z : ℝ × ℝ => + (3 * q) * ((|z.1| + |z.2|) ^ 6 * ‖v z.1‖ * ‖v z.2‖) + + (3 * q ^ 2) * ((|z.1| + |z.2|) ^ 8 * ‖v z.1‖ * ‖v z.2‖) by + funext z + dsimp [R] + ring] + calc + _ = (∫ z : ℝ × ℝ, + (3 * q) * ((|z.1| + |z.2|) ^ 6 * ‖v z.1‖ * ‖v z.2‖) + ∂volume.prod volume) + + ∫ z : ℝ × ℝ, + (3 * q ^ 2) * ((|z.1| + |z.2|) ^ 8 * ‖v z.1‖ * ‖v z.2‖) + ∂volume.prod volume := + integral_add (hD₆.const_mul _) (hD₈.const_mul _) + _ = (3 * q) * (∫ z : ℝ × ℝ, + (|z.1| + |z.2|) ^ 6 * ‖v z.1‖ * ‖v z.2‖ ∂volume.prod volume) + + (3 * q ^ 2) * (∫ z : ℝ × ℝ, + (|z.1| + |z.2|) ^ 8 * ‖v z.1‖ * ‖v z.2‖ ∂volume.prod volume) := by + rw [integral_const_mul, integral_const_mul] + _ = _ := by + rw [integral_prod _ hD₆, integral_prod _ hD₈] + _ = _ := by rfl + + +/-- Rodier's off-diagonal cutoff estimate with the quartic Gaussian correction +retained. The remaining error uses only sixth- and eighth-order density moments. -/ +theorem norm_rodierPairCutoffExpectation_sub_quarticGaussianIntegral_sq_le + (hn : 0 < n) {S T : Finset (Fin n)} (hST : S ≠ T) + (M Δ : ℝ) (hM : 0 < M) (hΔ : 0 < Δ) (hΔM : Δ ≤ M) : + ‖rodierPairCutoffExpectation S T M Δ - + ((rodierCutoffGaussianIntegral n M Δ hM hΔ) ^ 2 - + (((2 : ℝ) ^ n / 12 : ℝ) : ℂ) * + (2 * rodierGaussianWeightedDensityMoment n 4 M Δ hM hΔ * + rodierCutoffGaussianIntegral n M Δ hM hΔ + + 6 * (rodierGaussianWeightedDensityMoment n 2 M Δ hM hΔ) ^ 2))‖ ≤ + 2 * ((3 * (2 : ℝ) ^ n) * + (∫ t : ℝ, |t| ^ 6 * + ‖rodierCutoffFourierDensity M Δ hM hΔ t‖) + + (3 * ((2 : ℝ) ^ n) ^ 2) * + (∫ t : ℝ, |t| ^ 8 * + ‖rodierCutoffFourierDensity M Δ hM hΔ t‖)) + + (3 * (2 : ℝ) ^ n) * + (∫ t : ℝ, ∫ r : ℝ, + (|t| + |r|) ^ 6 * + ‖rodierCutoffFourierDensity M Δ hM hΔ t‖ * + ‖rodierCutoffFourierDensity M Δ hM hΔ r‖) + + (3 * ((2 : ℝ) ^ n) ^ 2) * + (∫ t : ℝ, ∫ r : ℝ, + (|t| + |r|) ^ 8 * + ‖rodierCutoffFourierDensity M Δ hM hΔ t‖ * + ‖rodierCutoffFourierDensity M Δ hM hΔ r‖) := by + let q : ℝ := (2 : ℝ) ^ n + let v : ℝ → ℂ := rodierCutoffFourierDensity M Δ hM hΔ + let g : ℝ → ℂ := fun t => (Real.exp (-(q * t ^ 2 / 2)) : ℂ) + let G : ℂ := rodierCutoffGaussianIntegral n M Δ hM hΔ + let J : ℂ := ∫ t : ℝ, g t * v t + let A₂ : ℂ := rodierGaussianWeightedDensityMoment n 2 M Δ hM hΔ + let A₄ : ℂ := rodierGaussianWeightedDensityMoment n 4 M Δ hM hΔ + let K : ℂ := ∫ t : ℝ, ∫ r : ℝ, + rodierPairCharacteristic S T t r * v t * v r + let c : ℂ := (((2 : ℝ) ^ n / 12 : ℝ) : ℂ) + have hS := norm_rodierSingleCutoffExpectation_sub_quarticGaussianIntegral_le + hn S M Δ hM hΔ hΔM + have hT := norm_rodierSingleCutoffExpectation_sub_quarticGaussianIntegral_le + hn T M Δ hM hΔ hΔM + have hK := norm_rodierPairCharacteristicIntegral_sub_quarticGaussian_le + hST M Δ hM hΔ + have hGJ : G = 1 + J := by + rfl + have hdecomp : + rodierPairCutoffExpectation S T M Δ - + (G ^ 2 - c * (2 * A₄ * G + 6 * A₂ ^ 2)) = + (rodierSingleCutoffExpectation S M Δ - (G - c * A₄)) + + (rodierSingleCutoffExpectation T M Δ - (G - c * A₄)) + + (K - (J ^ 2 - c * (2 * A₄ * J + 6 * A₂ ^ 2))) := by + rw [rodierPairCutoffExpectation_eq_fourierIntegral S T M Δ hM hΔ, + rodierPairFourierIntegral, + rodierSingleCutoffExpectation_eq_characteristicIntegral S M Δ hM hΔ, + rodierSingleCutoffExpectation_eq_characteristicIntegral T M Δ hM hΔ] + dsimp [G, J, K, A₂, A₄, c, g, v, q, + rodierCutoffGaussianIntegral] + ring + rw [hdecomp] + calc + _ ≤ ‖(rodierSingleCutoffExpectation S M Δ - (G - c * A₄)) + + (rodierSingleCutoffExpectation T M Δ - (G - c * A₄))‖ + + ‖K - (J ^ 2 - c * (2 * A₄ * J + 6 * A₂ ^ 2))‖ := + norm_add_le _ _ + _ ≤ (‖rodierSingleCutoffExpectation S M Δ - (G - c * A₄)‖ + + ‖rodierSingleCutoffExpectation T M Δ - (G - c * A₄)‖) + + ‖K - (J ^ 2 - c * (2 * A₄ * J + 6 * A₂ ^ 2))‖ := by + gcongr + exact norm_add_le _ _ + _ ≤ + (((3 * (2 : ℝ) ^ n) * (∫ t : ℝ, |t| ^ 6 * ‖v t‖) + + (3 * ((2 : ℝ) ^ n) ^ 2) * (∫ t : ℝ, |t| ^ 8 * ‖v t‖)) + + ((3 * (2 : ℝ) ^ n) * (∫ t : ℝ, |t| ^ 6 * ‖v t‖) + + (3 * ((2 : ℝ) ^ n) ^ 2) * (∫ t : ℝ, |t| ^ 8 * ‖v t‖))) + + ((3 * (2 : ℝ) ^ n) * + (∫ t : ℝ, ∫ r : ℝ, + (|t| + |r|) ^ 6 * ‖v t‖ * ‖v r‖) + + (3 * ((2 : ℝ) ^ n) ^ 2) * + (∫ t : ℝ, ∫ r : ℝ, + (|t| + |r|) ^ 8 * ‖v t‖ * ‖v r‖)) := by + apply add_le_add + · exact add_le_add (by simpa [G, A₄, c, v] using hS) + (by simpa [G, A₄, c, v] using hT) + · simpa [K, J, A₂, A₄, c, g, v, q] using hK + _ = _ := by + dsimp [v] + ring + +/-- The refined off-diagonal cutoff remainder factors through the sharp +sixth and eighth density moments and the total density mass. -/ +theorem norm_rodierPairCutoffExpectation_sub_quarticGaussianIntegral_sq_le_moments + (hn : 0 < n) {S T : Finset (Fin n)} (hST : S ≠ T) + (M Δ : ℝ) (hM : 0 < M) (hΔ : 0 < Δ) (hΔM : Δ ≤ M) : + ‖rodierPairCutoffExpectation S T M Δ - + ((rodierCutoffGaussianIntegral n M Δ hM hΔ) ^ 2 - + (((2 : ℝ) ^ n / 12 : ℝ) : ℂ) * + (2 * rodierGaussianWeightedDensityMoment n 4 M Δ hM hΔ * + rodierCutoffGaussianIntegral n M Δ hM hΔ + + 6 * (rodierGaussianWeightedDensityMoment n 2 M Δ hM hΔ) ^ 2))‖ ≤ + 2 * ((3 * (2 : ℝ) ^ n) * + (∫ t : ℝ, |t| ^ 6 * + ‖rodierCutoffFourierDensity M Δ hM hΔ t‖) + + (3 * ((2 : ℝ) ^ n) ^ 2) * + (∫ t : ℝ, |t| ^ 8 * + ‖rodierCutoffFourierDensity M Δ hM hΔ t‖)) + + (3 * (2 : ℝ) ^ n) * + (64 * (∫ t : ℝ, |t| ^ 6 * + ‖rodierCutoffFourierDensity M Δ hM hΔ t‖) * + ∫ t : ℝ, ‖rodierCutoffFourierDensity M Δ hM hΔ t‖) + + (3 * ((2 : ℝ) ^ n) ^ 2) * + (256 * (∫ t : ℝ, |t| ^ 8 * + ‖rodierCutoffFourierDensity M Δ hM hΔ t‖) * + ∫ t : ℝ, ‖rodierCutoffFourierDensity M Δ hM hΔ t‖) := by + let v : ℝ → ℂ := rodierCutoffFourierDensity M Δ hM hΔ + have hv : Integrable v := + rodierCutoffFourierDensity_integrable M Δ hM hΔ + have hvcont : Continuous v := by + dsimp [v, rodierCutoffFourierDensity] + exact continuous_const.mul + ((rodierCutoffUnitFourierDensity M Δ hM hΔ).continuous.comp (by fun_prop)) + obtain ⟨C₆, hC₆, hm₆⟩ := + exists_rodierCutoffFourierDensity_sixthMoment_sharp_bound + obtain ⟨C₈, hC₈, hm₈⟩ := + exists_rodierCutoffFourierDensity_eighthMoment_sharp_bound + have h₆ := (hm₆ M Δ hM hΔ).1 + have h₈ := (hm₈ M Δ hM hΔ).1 + have h₀ : Integrable (fun t : ℝ => ‖v t‖) := hv.norm + have hD₆ := rodierDoubleDensityAbsAddMoment_integrable_and_le 6 v hvcont h₀ h₆ + have hD₈ := rodierDoubleDensityAbsAddMoment_integrable_and_le 8 v hvcont h₀ h₈ + have hpair := + norm_rodierPairCutoffExpectation_sub_quarticGaussianIntegral_sq_le + hn hST M Δ hM hΔ hΔM + change _ ≤ + 2 * ((3 * (2 : ℝ) ^ n) * (∫ t : ℝ, |t| ^ 6 * ‖v t‖) + + (3 * ((2 : ℝ) ^ n) ^ 2) * (∫ t : ℝ, |t| ^ 8 * ‖v t‖)) + + (3 * (2 : ℝ) ^ n) * + (64 * (∫ t : ℝ, |t| ^ 6 * ‖v t‖) * ∫ t : ℝ, ‖v t‖) + + (3 * ((2 : ℝ) ^ n) ^ 2) * + (256 * (∫ t : ℝ, |t| ^ 8 * ‖v t‖) * ∫ t : ℝ, ‖v t‖) + calc + _ ≤ 2 * ((3 * (2 : ℝ) ^ n) * (∫ t : ℝ, |t| ^ 6 * ‖v t‖) + + (3 * ((2 : ℝ) ^ n) ^ 2) * (∫ t : ℝ, |t| ^ 8 * ‖v t‖)) + + (3 * (2 : ℝ) ^ n) * + (∫ t : ℝ, ∫ r : ℝ, + (|t| + |r|) ^ 6 * ‖v t‖ * ‖v r‖) + + (3 * ((2 : ℝ) ^ n) ^ 2) * + (∫ t : ℝ, ∫ r : ℝ, + (|t| + |r|) ^ 8 * ‖v t‖ * ‖v r‖) := by + simpa [v] using hpair + _ ≤ 2 * ((3 * (2 : ℝ) ^ n) * (∫ t : ℝ, |t| ^ 6 * ‖v t‖) + + (3 * ((2 : ℝ) ^ n) ^ 2) * (∫ t : ℝ, |t| ^ 8 * ‖v t‖)) + + (3 * (2 : ℝ) ^ n) * + ((2 : ℝ) ^ (6 - 1) * + (2 * (∫ t : ℝ, |t| ^ 6 * ‖v t‖) * ∫ t : ℝ, ‖v t‖)) + + (3 * ((2 : ℝ) ^ n) ^ 2) * + ((2 : ℝ) ^ (8 - 1) * + (2 * (∫ t : ℝ, |t| ^ 8 * ‖v t‖) * ∫ t : ℝ, ‖v t‖)) := by + gcongr + · exact hD₆.2.2 + · exact hD₈.2.2 + _ = _ := by + norm_num + ring + + +/-- The double moments in the off-diagonal pair estimate factor into the +corresponding one-variable density moment and total mass. -/ +theorem norm_rodierPairCharacteristicIntegral_sub_gaussianSquare_le_moments + {S T : Finset (Fin n)} (hST : S ≠ T) + (M Δ : ℝ) (hM : 0 < M) (hΔ : 0 < Δ) (hΔM : Δ ≤ M) : + ‖(∫ t : ℝ, ∫ r : ℝ, + rodierPairCharacteristic S T t r * + rodierCutoffFourierDensity M Δ hM hΔ t * + rodierCutoffFourierDensity M Δ hM hΔ r) - + (∫ t : ℝ, + (Real.exp (-((2 : ℝ) ^ n * t ^ 2 / 2)) : ℂ) * + rodierCutoffFourierDensity M Δ hM hΔ t) ^ 2‖ ≤ + ((2 : ℝ) ^ n / 12) * + (16 * (∫ t : ℝ, |t| ^ 4 * + ‖rodierCutoffFourierDensity M Δ hM hΔ t‖) * + ∫ t : ℝ, ‖rodierCutoffFourierDensity M Δ hM hΔ t‖) + + (3 * (2 : ℝ) ^ n) * + (64 * (∫ t : ℝ, |t| ^ 6 * + ‖rodierCutoffFourierDensity M Δ hM hΔ t‖) * + ∫ t : ℝ, ‖rodierCutoffFourierDensity M Δ hM hΔ t‖) + + (3 * ((2 : ℝ) ^ n) ^ 2) * + (256 * (∫ t : ℝ, |t| ^ 8 * + ‖rodierCutoffFourierDensity M Δ hM hΔ t‖) * + ∫ t : ℝ, ‖rodierCutoffFourierDensity M Δ hM hΔ t‖) := by + let v : ℝ → ℂ := rodierCutoffFourierDensity M Δ hM hΔ + have hv : Integrable v := + rodierCutoffFourierDensity_integrable M Δ hM hΔ + have hvcont : Continuous v := by + dsimp [v, rodierCutoffFourierDensity] + exact continuous_const.mul + ((rodierCutoffUnitFourierDensity M Δ hM hΔ).continuous.comp (by fun_prop)) + obtain ⟨C₄, hC₄, hm₄⟩ := + exists_rodierCutoffFourierDensity_fourthMoment_bound + obtain ⟨C₆, hC₆, hm₆⟩ := + exists_rodierCutoffFourierDensity_sixthMoment_bound + obtain ⟨C₈, hC₈, hm₈⟩ := + exists_rodierCutoffFourierDensity_eighthMoment_bound + have h₄ := (hm₄ M Δ hM hΔ hΔM).1 + have h₆ := (hm₆ M Δ hM hΔ hΔM).1 + have h₈ := (hm₈ M Δ hM hΔ hΔM).1 + have h0 : Integrable (fun t : ℝ => ‖v t‖) := hv.norm + have hD₄ := rodierDoubleDensityAbsAddMoment_integrable_and_le 4 v hvcont h0 h₄ + have hD₆ := rodierDoubleDensityAbsAddMoment_integrable_and_le 6 v hvcont h0 h₆ + have hD₈ := rodierDoubleDensityAbsAddMoment_integrable_and_le 8 v hvcont h0 h₈ + have hcross := norm_rodierPairCharacteristicIntegral_sub_gaussianSquare_le + hST M Δ hM hΔ hΔM + change _ ≤ ((2 : ℝ) ^ n / 12) * + (16 * (∫ t : ℝ, |t| ^ 4 * ‖v t‖) * ∫ t : ℝ, ‖v t‖) + + (3 * (2 : ℝ) ^ n) * + (64 * (∫ t : ℝ, |t| ^ 6 * ‖v t‖) * ∫ t : ℝ, ‖v t‖) + + (3 * ((2 : ℝ) ^ n) ^ 2) * + (256 * (∫ t : ℝ, |t| ^ 8 * ‖v t‖) * ∫ t : ℝ, ‖v t‖) + calc + _ ≤ ((2 : ℝ) ^ n / 12) * + (∫ t : ℝ, ∫ r : ℝ, + (|t| + |r|) ^ 4 * ‖v t‖ * ‖v r‖) + + (3 * (2 : ℝ) ^ n) * + (∫ t : ℝ, ∫ r : ℝ, + (|t| + |r|) ^ 6 * ‖v t‖ * ‖v r‖) + + (3 * ((2 : ℝ) ^ n) ^ 2) * + (∫ t : ℝ, ∫ r : ℝ, + (|t| + |r|) ^ 8 * ‖v t‖ * ‖v r‖) := by + simpa [v] using hcross + _ ≤ ((2 : ℝ) ^ n / 12) * + ((2 : ℝ) ^ (4 - 1) * + (2 * (∫ t : ℝ, |t| ^ 4 * ‖v t‖) * ∫ t : ℝ, ‖v t‖)) + + (3 * (2 : ℝ) ^ n) * + ((2 : ℝ) ^ (6 - 1) * + (2 * (∫ t : ℝ, |t| ^ 6 * ‖v t‖) * ∫ t : ℝ, ‖v t‖)) + + (3 * ((2 : ℝ) ^ n) ^ 2) * + ((2 : ℝ) ^ (8 - 1) * + (2 * (∫ t : ℝ, |t| ^ 8 * ‖v t‖) * ∫ t : ℝ, ‖v t‖)) := by + gcongr + · exact hD₄.2.2 + · exact hD₆.2.2 + · exact hD₈.2.2 + _ = _ := by + norm_num + ring + +/-- Rodier Lemma 6.5 in cutoff-expectation form: for distinct Walsh +coefficients, the joint cutoff expectation is controlled by the square of the +Gaussian main term and the one- and two-variable density moments. -/ +theorem norm_rodierPairCutoffExpectation_sub_gaussianIntegral_sq_le + (hn : 0 < n) {S T : Finset (Fin n)} (hST : S ≠ T) + (M Δ : ℝ) (hM : 0 < M) (hΔ : 0 < Δ) (hΔM : Δ ≤ M) : + ‖rodierPairCutoffExpectation S T M Δ - + (rodierCutoffGaussianIntegral n M Δ hM hΔ) ^ 2‖ ≤ + 2 * (((2 : ℝ) ^ n / 12) * + (∫ t : ℝ, |t| ^ 4 * + ‖rodierCutoffFourierDensity M Δ hM hΔ t‖) + + (3 * (2 : ℝ) ^ n) * + (∫ t : ℝ, |t| ^ 6 * + ‖rodierCutoffFourierDensity M Δ hM hΔ t‖) + + (3 * ((2 : ℝ) ^ n) ^ 2) * + (∫ t : ℝ, |t| ^ 8 * + ‖rodierCutoffFourierDensity M Δ hM hΔ t‖)) + + ((2 : ℝ) ^ n / 12) * + (16 * (∫ t : ℝ, |t| ^ 4 * + ‖rodierCutoffFourierDensity M Δ hM hΔ t‖) * + ∫ t : ℝ, ‖rodierCutoffFourierDensity M Δ hM hΔ t‖) + + (3 * (2 : ℝ) ^ n) * + (64 * (∫ t : ℝ, |t| ^ 6 * + ‖rodierCutoffFourierDensity M Δ hM hΔ t‖) * + ∫ t : ℝ, ‖rodierCutoffFourierDensity M Δ hM hΔ t‖) + + (3 * ((2 : ℝ) ^ n) ^ 2) * + (256 * (∫ t : ℝ, |t| ^ 8 * + ‖rodierCutoffFourierDensity M Δ hM hΔ t‖) * + ∫ t : ℝ, ‖rodierCutoffFourierDensity M Δ hM hΔ t‖) := by + let q : ℝ := (2 : ℝ) ^ n + let v : ℝ → ℂ := rodierCutoffFourierDensity M Δ hM hΔ + let g : ℝ → ℂ := fun t => (Real.exp (-(q * t ^ 2 / 2)) : ℂ) + let G : ℂ := rodierCutoffGaussianIntegral n M Δ hM hΔ + let J : ℂ := ∫ t : ℝ, g t * v t + let K : ℂ := ∫ t : ℝ, ∫ r : ℝ, + rodierPairCharacteristic S T t r * v t * v r + have hS := norm_rodierSingleCutoffExpectation_sub_gaussianIntegral_le + hn S M Δ hM hΔ hΔM + have hT := norm_rodierSingleCutoffExpectation_sub_gaussianIntegral_le + hn T M Δ hM hΔ hΔM + have hK := + norm_rodierPairCharacteristicIntegral_sub_gaussianSquare_le_moments + hST M Δ hM hΔ hΔM + have hdecomp : + rodierPairCutoffExpectation S T M Δ - G ^ 2 = + (rodierSingleCutoffExpectation S M Δ - G) + + (rodierSingleCutoffExpectation T M Δ - G) + + (K - J ^ 2) := by + rw [rodierPairCutoffExpectation_eq_fourierIntegral S T M Δ hM hΔ, + rodierPairFourierIntegral, + rodierSingleCutoffExpectation_eq_characteristicIntegral S M Δ hM hΔ, + rodierSingleCutoffExpectation_eq_characteristicIntegral T M Δ hM hΔ] + dsimp [G, J, K, g, v, q, rodierCutoffGaussianIntegral] + ring + rw [hdecomp] + calc + _ ≤ ‖(rodierSingleCutoffExpectation S M Δ - G) + + (rodierSingleCutoffExpectation T M Δ - G)‖ + ‖K - J ^ 2‖ := + norm_add_le _ _ + _ ≤ (‖rodierSingleCutoffExpectation S M Δ - G‖ + + ‖rodierSingleCutoffExpectation T M Δ - G‖) + ‖K - J ^ 2‖ := by + gcongr + exact norm_add_le _ _ + _ ≤ + ((((2 : ℝ) ^ n / 12) * + (∫ t : ℝ, |t| ^ 4 * ‖v t‖) + + (3 * (2 : ℝ) ^ n) * (∫ t : ℝ, |t| ^ 6 * ‖v t‖) + + (3 * ((2 : ℝ) ^ n) ^ 2) * (∫ t : ℝ, |t| ^ 8 * ‖v t‖)) + + (((2 : ℝ) ^ n / 12) * + (∫ t : ℝ, |t| ^ 4 * ‖v t‖) + + (3 * (2 : ℝ) ^ n) * (∫ t : ℝ, |t| ^ 6 * ‖v t‖) + + (3 * ((2 : ℝ) ^ n) ^ 2) * (∫ t : ℝ, |t| ^ 8 * ‖v t‖))) + + (((2 : ℝ) ^ n / 12) * + (16 * (∫ t : ℝ, |t| ^ 4 * ‖v t‖) * ∫ t : ℝ, ‖v t‖) + + (3 * (2 : ℝ) ^ n) * + (64 * (∫ t : ℝ, |t| ^ 6 * ‖v t‖) * ∫ t : ℝ, ‖v t‖) + + (3 * ((2 : ℝ) ^ n) ^ 2) * + (256 * (∫ t : ℝ, |t| ^ 8 * ‖v t‖) * ∫ t : ℝ, ‖v t‖)) := by + apply add_le_add + · exact add_le_add (by simpa [G, v] using hS) (by simpa [G, v] using hT) + · simpa [K, J, g, v, q] using hK + _ = _ := by + dsimp [v] + ring + +/-- Rodier's smoothed fraction of Walsh coefficients outside the cutoff window. -/ +noncomputable def rodierCutoffFrequencyAverage + (M Δ : ℝ) (f : FABL.BooleanFunction n) : ℝ := + Finset.expect Finset.univ (fun S : Finset (Fin n) ↦ + rodierCutoff M Δ (rodierRawWalshCoefficient S f)) + +/-- The real finite expectation underlying the complex single-cutoff expectation. -/ +theorem ofReal_expect_rodierCutoff_eq_singleCutoffExpectation + (S : Finset (Fin n)) (M Δ : ℝ) : + ((Finset.expect Finset.univ (fun f : FABL.BooleanFunction n ↦ + rodierCutoff M Δ (rodierRawWalshCoefficient S f)) : ℝ) : ℂ) = + rodierSingleCutoffExpectation S M Δ := by + rw [rodierSingleCutoffExpectation, Fintype.expect_eq_sum_div_card, + Fintype.expect_eq_sum_div_card] + push_cast + rfl + +/-- The real finite expectation underlying the complex pair-cutoff expectation. -/ +theorem ofReal_expect_rodierCutoff_mul_eq_pairCutoffExpectation + (S T : Finset (Fin n)) (M Δ : ℝ) : + ((Finset.expect Finset.univ (fun f : FABL.BooleanFunction n ↦ + rodierCutoff M Δ (rodierRawWalshCoefficient S f) * + rodierCutoff M Δ (rodierRawWalshCoefficient T f)) : ℝ) : ℂ) = + rodierPairCutoffExpectation S T M Δ := by + rw [rodierPairCutoffExpectation, Fintype.expect_eq_sum_div_card, + Fintype.expect_eq_sum_div_card] + push_cast + rfl + +/-- All Walsh coordinates have the same single-cutoff expectation. -/ +theorem rodierSingleCutoffExpectation_eq_of_indices (S T : Finset (Fin n)) + (M Δ : ℝ) (hM : 0 < M) (hΔ : 0 < Δ) : + rodierSingleCutoffExpectation S M Δ = + rodierSingleCutoffExpectation T M Δ := by + rw [rodierSingleCutoffExpectation_eq_characteristicIntegral S M Δ hM hΔ, + rodierSingleCutoffExpectation_eq_characteristicIntegral T M Δ hM hΔ] + apply congrArg (fun z : ℂ => 1 + z) + apply integral_congr_ae + filter_upwards [] with t + rw [rodierSingleCharacteristic_eq_cos_pow, + rodierSingleCharacteristic_eq_cos_pow] + +/-- The mean of the smoothed Walsh exceedance fraction is any one-coordinate mean. -/ +theorem expect_rodierCutoffFrequencyAverage (S₀ : Finset (Fin n)) + (M Δ : ℝ) (hM : 0 < M) (hΔ : 0 < Δ) : + Finset.expect Finset.univ (fun f : FABL.BooleanFunction n ↦ + rodierCutoffFrequencyAverage M Δ f) = + (rodierSingleCutoffExpectation S₀ M Δ).re := by + rw [show Finset.expect Finset.univ (fun f : FABL.BooleanFunction n ↦ + rodierCutoffFrequencyAverage M Δ f) = + Finset.expect Finset.univ (fun S : Finset (Fin n) ↦ + Finset.expect Finset.univ (fun f : FABL.BooleanFunction n ↦ + rodierCutoff M Δ (rodierRawWalshCoefficient S f))) by + unfold rodierCutoffFrequencyAverage + exact Finset.expect_comm Finset.univ Finset.univ _] + calc + _ = Finset.expect Finset.univ (fun _S : Finset (Fin n) ↦ + (rodierSingleCutoffExpectation S₀ M Δ).re) := by + apply Finset.expect_congr rfl + intro S _ + calc + _ = (rodierSingleCutoffExpectation S M Δ).re := by + have h := congrArg Complex.re + (ofReal_expect_rodierCutoff_eq_singleCutoffExpectation S M Δ) + simpa using h + _ = _ := congrArg Complex.re + (rodierSingleCutoffExpectation_eq_of_indices S S₀ M Δ hM hΔ) + _ = _ := Fintype.expect_const _ + +/-- The exact finite second moment is the average of all pair-cutoff expectations. -/ +theorem expect_sq_rodierCutoffFrequencyAverage (M Δ : ℝ) : + Finset.expect Finset.univ (fun f : FABL.BooleanFunction n ↦ + (rodierCutoffFrequencyAverage M Δ f) ^ 2) = + Finset.expect Finset.univ (fun S : Finset (Fin n) ↦ + Finset.expect Finset.univ (fun T : Finset (Fin n) ↦ + (rodierPairCutoffExpectation S T M Δ).re)) := by + rw [show Finset.expect Finset.univ (fun f : FABL.BooleanFunction n ↦ + (rodierCutoffFrequencyAverage M Δ f) ^ 2) = + Finset.expect Finset.univ (fun f : FABL.BooleanFunction n ↦ + Finset.expect Finset.univ (fun S : Finset (Fin n) ↦ + Finset.expect Finset.univ (fun T : Finset (Fin n) ↦ + rodierCutoff M Δ (rodierRawWalshCoefficient S f) * + rodierCutoff M Δ (rodierRawWalshCoefficient T f)))) by + apply Finset.expect_congr rfl + intro f _ + rw [pow_two] + unfold rodierCutoffFrequencyAverage + exact Finset.expect_mul_expect _ _ _ _] + calc + _ = Finset.expect Finset.univ (fun S : Finset (Fin n) ↦ + Finset.expect Finset.univ (fun f : FABL.BooleanFunction n ↦ + Finset.expect Finset.univ (fun T : Finset (Fin n) ↦ + rodierCutoff M Δ (rodierRawWalshCoefficient S f) * + rodierCutoff M Δ (rodierRawWalshCoefficient T f)))) := by + exact Finset.expect_comm Finset.univ Finset.univ _ + _ = Finset.expect Finset.univ (fun S : Finset (Fin n) ↦ + Finset.expect Finset.univ (fun T : Finset (Fin n) ↦ + Finset.expect Finset.univ (fun f : FABL.BooleanFunction n ↦ + rodierCutoff M Δ (rodierRawWalshCoefficient S f) * + rodierCutoff M Δ (rodierRawWalshCoefficient T f)))) := by + apply Finset.expect_congr rfl + intro S _ + exact Finset.expect_comm Finset.univ Finset.univ _ + _ = _ := by + apply Finset.expect_congr rfl + intro S _ + apply Finset.expect_congr rfl + intro T _ + have h := congrArg Complex.re + (ofReal_expect_rodierCutoff_mul_eq_pairCutoffExpectation S T M Δ) + simpa using h + +/-- A uniform off-diagonal pair error gives the finite second-moment bound +used in Rodier's lower-tail argument. -/ +theorem expect_sq_rodierCutoffFrequencyAverage_le (S₀ : Finset (Fin n)) + (M Δ ε : ℝ) (hM : 0 < M) (hΔ : 0 < Δ) (hε : 0 ≤ ε) + (hpair : ∀ S T : Finset (Fin n), S ≠ T → + (rodierPairCutoffExpectation S T M Δ).re ≤ + (rodierSingleCutoffExpectation S₀ M Δ).re ^ 2 + ε) : + Finset.expect Finset.univ (fun f : FABL.BooleanFunction n ↦ + (rodierCutoffFrequencyAverage M Δ f) ^ 2) ≤ + (rodierSingleCutoffExpectation S₀ M Δ).re / (2 : ℝ) ^ n + + (rodierSingleCutoffExpectation S₀ M Δ).re ^ 2 + ε := by + let e : ℝ := (rodierSingleCutoffExpectation S₀ M Δ).re + let B : ℝ := e ^ 2 + ε + have hB : 0 ≤ B := by dsimp [B]; positivity + have hdiag (S : Finset (Fin n)) : + (rodierPairCutoffExpectation S S M Δ).re ≤ e := by + have hp := congrArg Complex.re + (ofReal_expect_rodierCutoff_mul_eq_pairCutoffExpectation S S M Δ) + have hs := congrArg Complex.re + (ofReal_expect_rodierCutoff_eq_singleCutoffExpectation S M Δ) + have hse := congrArg Complex.re + (rodierSingleCutoffExpectation_eq_of_indices S S₀ M Δ hM hΔ) + have hpoint (f : FABL.BooleanFunction n) : + rodierCutoff M Δ (rodierRawWalshCoefficient S f) ^ 2 ≤ + rodierCutoff M Δ (rodierRawWalshCoefficient S f) := by + have h0 := rodierCutoff_nonneg M Δ hM hΔ + (rodierRawWalshCoefficient S f) + have h1 := rodierCutoff_le_one M Δ hM hΔ + (rodierRawWalshCoefficient S f) + nlinarith + dsimp [e] + rw [← hse] + have hp' : (rodierPairCutoffExpectation S S M Δ).re = + Finset.expect Finset.univ (fun f : FABL.BooleanFunction n ↦ + rodierCutoff M Δ (rodierRawWalshCoefficient S f) ^ 2) := by + simpa [pow_two] using hp.symm + have hs' : (rodierSingleCutoffExpectation S M Δ).re = + Finset.expect Finset.univ (fun f : FABL.BooleanFunction n ↦ + rodierCutoff M Δ (rodierRawWalshCoefficient S f)) := by + simpa using hs.symm + rw [hp', hs', Fintype.expect_eq_sum_div_card, + Fintype.expect_eq_sum_div_card] + gcongr with f + exact hpoint f + have hinner (S : Finset (Fin n)) : + Finset.expect Finset.univ (fun T : Finset (Fin n) ↦ + (rodierPairCutoffExpectation S T M Δ).re) ≤ + e / (2 : ℝ) ^ n + B := by + rw [Fintype.expect_eq_sum_div_card] + rw [show (Fintype.card (Finset (Fin n)) : ℝ) = (2 : ℝ) ^ n by + norm_num] + calc + (∑ T : Finset (Fin n), (rodierPairCutoffExpectation S T M Δ).re) / + (2 : ℝ) ^ n ≤ + (∑ T : Finset (Fin n), + ((if T = S then e else 0) + B)) / (2 : ℝ) ^ n := by + apply div_le_div_of_nonneg_right _ (by positivity) + apply Finset.sum_le_sum + intro T _ + by_cases hTS : T = S + · subst T + simpa using (hdiag S).trans (le_add_of_nonneg_right hB) + · simp only [if_neg hTS, zero_add] + exact hpair S T (fun h => hTS h.symm) + _ = e / (2 : ℝ) ^ n + B := by + simp only [Finset.sum_add_distrib] + simp only [Finset.sum_const, Finset.card_univ, nsmul_eq_mul] + rw [show (∑ T : Finset (Fin n), if T = S then e else 0) = e by simp] + rw [show (Fintype.card (Finset (Fin n)) : ℝ) = (2 : ℝ) ^ n by norm_num] + field_simp + rw [expect_sq_rodierCutoffFrequencyAverage] + calc + _ ≤ Finset.expect Finset.univ (fun _S : Finset (Fin n) ↦ + e / (2 : ℝ) ^ n + B) := by + rw [Fintype.expect_eq_sum_div_card, Fintype.expect_eq_sum_div_card] + gcongr with S + exact hinner S + _ = e / (2 : ℝ) ^ n + B := Fintype.expect_const _ + _ = _ := by dsimp [e, B]; ring + +/-- Chebyshev's inequality turns the finite second-moment estimate into a +bound for the probability that the smoothed exceedance fraction vanishes. -/ +theorem measure_rodierCutoffFrequencyAverage_eq_zero_le (S₀ : Finset (Fin n)) + (M Δ ε : ℝ) (hM : 0 < M) (hΔ : 0 < Δ) (hε : 0 ≤ ε) + (he : 0 < (rodierSingleCutoffExpectation S₀ M Δ).re) + (hpair : ∀ S T : Finset (Fin n), S ≠ T → + (rodierPairCutoffExpectation S T M Δ).re ≤ + (rodierSingleCutoffExpectation S₀ M Δ).re ^ 2 + ε) : + (FABL.uniformPMF (FABL.BooleanFunction n)).toMeasure.real + {f | rodierCutoffFrequencyAverage M Δ f = 0} ≤ + ((rodierSingleCutoffExpectation S₀ M Δ).re / (2 : ℝ) ^ n + ε) / + (rodierSingleCutoffExpectation S₀ M Δ).re ^ 2 := by + let μ : Measure (FABL.BooleanFunction n) := + (FABL.uniformPMF (FABL.BooleanFunction n)).toMeasure + let X : FABL.BooleanFunction n → ℝ := rodierCutoffFrequencyAverage M Δ + let e : ℝ := (rodierSingleCutoffExpectation S₀ M Δ).re + have hXbounds (f : FABL.BooleanFunction n) : X f ∈ Set.Icc (0 : ℝ) 1 := by + dsimp [X, rodierCutoffFrequencyAverage] + rw [Fintype.expect_eq_sum_div_card] + have hcard : (0 : ℝ) < Fintype.card (Finset (Fin n)) := by positivity + constructor + · exact div_nonneg (Finset.sum_nonneg fun S _ => + rodierCutoff_nonneg M Δ hM hΔ (rodierRawWalshCoefficient S f)) hcard.le + · apply (div_le_one hcard).mpr + calc + (∑ S : Finset (Fin n), + rodierCutoff M Δ (rodierRawWalshCoefficient S f)) ≤ + ∑ _S : Finset (Fin n), (1 : ℝ) := by + apply Finset.sum_le_sum + intro S _ + exact rodierCutoff_le_one M Δ hM hΔ + (rodierRawWalshCoefficient S f) + _ = Fintype.card (Finset (Fin n)) := by simp + have hXmeas : AEStronglyMeasurable X μ := + (measurable_of_finite X).aestronglyMeasurable + have hXlp : MemLp X 2 μ := + memLp_of_bounded (Filter.Eventually.of_forall hXbounds) hXmeas 2 + have hmean : ∫ f, X f ∂μ = e := by + dsimp [μ, X, e] + rw [FABL.integral_uniformPMF_eq_expect, + expect_rodierCutoffFrequencyAverage S₀ M Δ hM hΔ] + have hsecond : + (∫ f, (X ^ 2) f ∂μ) ≤ e / (2 : ℝ) ^ n + e ^ 2 + ε := by + dsimp [μ] + rw [FABL.integral_uniformPMF_eq_expect] + simpa [X, e] using + expect_sq_rodierCutoffFrequencyAverage_le S₀ M Δ ε hM hΔ hε hpair + have hvar : ProbabilityTheory.variance X μ ≤ e / (2 : ℝ) ^ n + ε := by + rw [ProbabilityTheory.variance_eq_sub hXlp, hmean] + calc + _ ≤ (e / (2 : ℝ) ^ n + e ^ 2 + ε) - e ^ 2 := + sub_le_sub_right hsecond _ + _ = _ := by ring + have hdev := ProbabilityTheory.meas_ge_le_variance_div_sq hXlp + (show 0 < e by exact he) + rw [hmean] at hdev + have hsubset : {f | X f = 0} ⊆ {f | e ≤ |X f - e|} := by + intro f hf + simp only [Set.mem_setOf_eq] at hf ⊢ + rw [hf, zero_sub, abs_neg, abs_of_pos he] + have hmono : μ.real {f | X f = 0} ≤ μ.real {f | e ≤ |X f - e|} := + measureReal_mono hsubset + have hdevReal : μ.real {f | e ≤ |X f - e|} ≤ + ProbabilityTheory.variance X μ / e ^ 2 := by + have htoReal := ENNReal.toReal_mono (by simp) hdev + simpa [Measure.real, ENNReal.toReal_ofReal + (div_nonneg (ProbabilityTheory.variance_nonneg X μ) (sq_nonneg e))] + using htoReal + change μ.real {f | X f = 0} ≤ (e / (2 : ℝ) ^ n + ε) / e ^ 2 + exact hmono.trans (hdevReal.trans (div_le_div_of_nonneg_right hvar (sq_nonneg e))) + + +end CryptBoolean diff --git a/CryptBoolean/Carlet/Chapter04/RodierSharpAsymptotics.lean b/CryptBoolean/Carlet/Chapter04/RodierSharpAsymptotics.lean new file mode 100644 index 0000000..66043ca --- /dev/null +++ b/CryptBoolean/Carlet/Chapter04/RodierSharpAsymptotics.lean @@ -0,0 +1,988 @@ +/- +Copyright (c) 2026 Asher Yan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Asher Yan with Codex +-/ +module + +public import CryptBoolean.Carlet.Chapter04.RodierSharpInterval + +/-! +# Rodier's sharp random-nonlinearity asymptotics + +The asymptotic estimates closing Rodier's second-moment argument and the +simultaneous two-sided random-nonlinearity interval. +-/ + +@[expose] public section + +open Finset MeasureTheory ProbabilityTheory Set +open scoped BigOperators BooleanCube ENNReal Topology + +namespace CryptBoolean + +local instance rodierSharpAsymptoticsSignMeasurableSpace : MeasurableSpace FABL.Sign := ⊤ + +local instance rodierSharpAsymptoticsSignMeasurableSingletonClass : + MeasurableSingletonClass FABL.Sign where + measurableSet_singleton _ := by simp + +private theorem tendsto_rodierSharpLogDivNat : + Filter.Tendsto + (fun n : ℕ => Real.log (n : ℝ) / (n : ℝ)) + Filter.atTop (nhds 0) := by + have h := Real.isLittleO_log_id_atTop.comp_tendsto + (tendsto_natCast_atTop_atTop (R := ℝ)) + simpa [Function.comp_def] using h.tendsto_div_nhds_zero + +private theorem rodierAsymptoticDelta_inv_sq {n : ℕ} (hn : 0 < n) : + (rodierAsymptoticDelta n)⁻¹ ^ 2 = + (n : ℝ) / rodierAsymptoticQ n := by + have hnℝ : (0 : ℝ) < n := by exact_mod_cast hn + have hnne : Real.sqrt (n : ℝ) ≠ 0 := + ne_of_gt (Real.sqrt_pos.2 hnℝ) + have hqne : Real.sqrt (rodierAsymptoticQ n) ≠ 0 := + ne_of_gt (Real.sqrt_pos.2 (rodierAsymptoticQ_pos n)) + unfold rodierAsymptoticDelta + rw [inv_div, div_pow, Real.sq_sqrt hnℝ.le, + Real.sq_sqrt (rodierAsymptoticQ_pos n).le] + +private theorem rodierAsymptoticDelta_inv_fourth {n : ℕ} (hn : 0 < n) : + (rodierAsymptoticDelta n)⁻¹ ^ 4 = + ((n : ℝ) / rodierAsymptoticQ n) ^ 2 := by + rw [show 4 = 2 * 2 by norm_num, pow_mul, rodierAsymptoticDelta_inv_sq hn] + +private theorem rodierAsymptoticDelta_inv_sixth {n : ℕ} (hn : 0 < n) : + (rodierAsymptoticDelta n)⁻¹ ^ 6 = + ((n : ℝ) / rodierAsymptoticQ n) ^ 3 := by + rw [show 6 = 2 * 3 by norm_num, pow_mul, rodierAsymptoticDelta_inv_sq hn] + +private theorem rodierAsymptoticDelta_inv_eighth {n : ℕ} (hn : 0 < n) : + (rodierAsymptoticDelta n)⁻¹ ^ 8 = + ((n : ℝ) / rodierAsymptoticQ n) ^ 4 := by + rw [show 8 = 2 * 4 by norm_num, pow_mul, rodierAsymptoticDelta_inv_sq hn] + +private theorem eventually_rodierAsymptoticCenter_lower : + ∀ᶠ n : ℕ in Filter.atTop, + Real.sqrt (rodierAsymptoticQ n) * Real.sqrt (n : ℝ) ≤ + rodierAsymptoticM n := by + have hscaled : Filter.Tendsto + (fun n : ℕ => 5 * (Real.log (n : ℝ) / (n : ℝ))) + Filter.atTop (nhds 0) := by + simpa using tendsto_rodierSharpLogDivNat.const_mul 5 + have hsmall : ∀ᶠ n : ℕ in Filter.atTop, + 5 * (Real.log (n : ℝ) / (n : ℝ)) < (1 / 10 : ℝ) := + hscaled.eventually (Iio_mem_nhds (by norm_num : (0 : ℝ) < 1 / 10)) + filter_upwards [hsmall] with n hn + have hc : (11 / 10 : ℝ) < Real.sqrt (2 * Real.log 2) := by + rw [Real.lt_sqrt (by norm_num : (0 : ℝ) ≤ 11 / 10)] + nlinarith [Real.log_two_gt_d9] + have ha : (1 : ℝ) ≤ Real.sqrt (2 * Real.log 2) - + 5 * Real.log (n : ℝ) / (n : ℝ) := by + have hn' : 5 * Real.log (n : ℝ) / (n : ℝ) < (1 / 10 : ℝ) := by + calc + _ = 5 * (Real.log (n : ℝ) / (n : ℝ)) := by ring + _ < _ := hn + linarith + unfold rodierAsymptoticM + calc + _ = Real.sqrt (rodierAsymptoticQ n) * Real.sqrt (n : ℝ) * 1 := by ring + _ ≤ _ := mul_le_mul_of_nonneg_left ha (by positivity) + +private theorem rodierAsymptoticCenter_exp_upper {n : ℕ} (hn : 0 < n) + (hcenter : Real.sqrt (rodierAsymptoticQ n) * Real.sqrt (n : ℝ) ≤ + rodierAsymptoticM n) : + Real.exp (-(rodierAsymptoticM n ^ 2) / + (2 * rodierAsymptoticQ n)) ≤ + Real.exp (-(n : ℝ) / 2) := by + have hnℝ : (0 : ℝ) < n := by exact_mod_cast hn + have hq : 0 < rodierAsymptoticQ n := rodierAsymptoticQ_pos n + have hbase : 0 ≤ + Real.sqrt (rodierAsymptoticQ n) * Real.sqrt (n : ℝ) := by positivity + have hMnonneg : 0 ≤ rodierAsymptoticM n := hbase.trans hcenter + have hsq : rodierAsymptoticQ n * (n : ℝ) ≤ + rodierAsymptoticM n ^ 2 := by + have h := (sq_le_sq₀ hbase hMnonneg).2 hcenter + rw [mul_pow, Real.sq_sqrt hq.le, Real.sq_sqrt hnℝ.le] at h + exact h + apply Real.exp_le_exp.mpr + have hdiv : (n : ℝ) / 2 ≤ + rodierAsymptoticM n ^ 2 / (2 * rodierAsymptoticQ n) := by + exact (div_le_div_iff₀ (by norm_num : (0 : ℝ) < 2) + (by positivity : (0 : ℝ) < 2 * rodierAsymptoticQ n)).2 (by + nlinarith [hsq]) + simpa [neg_div] using neg_le_neg hdiv + +private theorem rodierAsymptoticM_mul_delta_inv_le {n : ℕ} (hn : 0 < n) : + rodierAsymptoticM n * (rodierAsymptoticDelta n)⁻¹ ≤ + 2 * (n : ℝ) := by + have hnℝ : (0 : ℝ) < n := by exact_mod_cast hn + have hlog : 0 ≤ Real.log (n : ℝ) := + Real.log_nonneg (by exact_mod_cast hn) + have hc : Real.sqrt (2 * Real.log 2) ≤ 2 := by + rw [Real.sqrt_le_iff] + constructor + · norm_num + · nlinarith [Real.log_two_lt_d9] + have ha : Real.sqrt (2 * Real.log 2) - + 5 * Real.log (n : ℝ) / (n : ℝ) ≤ 2 := by + have : 0 ≤ 5 * Real.log (n : ℝ) / (n : ℝ) := by positivity + linarith + have hnroot : Real.sqrt (n : ℝ) ≠ 0 := + ne_of_gt (Real.sqrt_pos.2 hnℝ) + have hqroot : Real.sqrt (rodierAsymptoticQ n) ≠ 0 := + ne_of_gt (Real.sqrt_pos.2 (rodierAsymptoticQ_pos n)) + have hid : rodierAsymptoticM n * (rodierAsymptoticDelta n)⁻¹ = + (n : ℝ) * (Real.sqrt (2 * Real.log 2) - + 5 * Real.log (n : ℝ) / (n : ℝ)) := by + unfold rodierAsymptoticM rodierAsymptoticDelta + rw [inv_div] + field_simp [hnroot, hqroot] + rw [Real.sq_sqrt hnℝ.le] + rw [hid] + nlinarith + +private theorem rodierAsymptoticOffDiagonalPairError_algebra + (x q z C₂ C₄ K₁ K₂ Kᵣ R₁ R₂ a₂ a₄ d : ℝ) + (hx : 1 ≤ x) (hq : 0 < q) (hxq : x ≤ q) + (hzdef : z = Real.exp (-x / 2)) (hz0 : 0 ≤ z) (hz1 : z ≤ 1) + (_hC₂ : 0 ≤ C₂) (_hC₄ : 0 ≤ C₄) + (hK₁ : 0 ≤ K₁) (hK₂ : 0 ≤ K₂) (hKᵣ : 0 ≤ Kᵣ) + (hR₁nonneg : 0 ≤ R₁) (ha₂ : 0 ≤ a₂) (ha₄ : 0 ≤ a₄) + (hd : 0 ≤ d) + (hR₁ : R₁ ≤ K₁ * x ^ 4 / q ^ 2) + (hR₂ : R₂ ≤ K₂ * x ^ 5 / q ^ 2) + (ha₂bound : a₂ ≤ C₂ * (x / q) * z) + (ha₄bound : a₄ ≤ C₄ * (x / q) ^ 2 * z) + (hdbound : d ≤ Kᵣ * x ^ 2) : + R₂ + 6 * (q / 12) * a₂ ^ 2 + (q / 12) ^ 2 * a₄ ^ 2 + + R₁ * (2 * d + R₁) ≤ + (K₂ + C₄ ^ 2 + 2 * K₁ * Kᵣ + K₁ ^ 2 + C₂ ^ 2) * + (x ^ 6 / q ^ 2 + (x ^ 4 / q) * Real.exp (-x)) := by + have hx0 : 0 ≤ x := zero_le_one.trans hx + have hx2q2 : x ^ 2 ≤ q ^ 2 := (sq_le_sq₀ hx0 hq.le).2 hxq + have hzsq : z ^ 2 = Real.exp (-x) := by + rw [hzdef, pow_two, ← Real.exp_add] + congr 1 + ring + have hA₂term : 6 * (q / 12) * a₂ ^ 2 ≤ + C₂ ^ 2 * (x ^ 4 / q) * Real.exp (-x) := by + calc + 6 * (q / 12) * a₂ ^ 2 ≤ q * a₂ ^ 2 := by + gcongr + nlinarith [hq.le] + _ ≤ q * (C₂ * (x / q) * z) ^ 2 := by gcongr + _ = C₂ ^ 2 * (x ^ 2 / q) * Real.exp (-x) := by + rw [show (C₂ * (x / q) * z) ^ 2 = + (C₂ * (x / q)) ^ 2 * z ^ 2 by ring, hzsq] + field_simp + _ ≤ C₂ ^ 2 * (x ^ 4 / q) * Real.exp (-x) := by + gcongr + nlinarith [sq_nonneg x] + have hA₄term : (q / 12) ^ 2 * a₄ ^ 2 ≤ + C₄ ^ 2 * x ^ 6 / q ^ 2 := by + calc + (q / 12) ^ 2 * a₄ ^ 2 ≤ + q ^ 2 * (C₄ * (x / q) ^ 2 * z) ^ 2 := by + gcongr + exact div_le_self hq.le (by norm_num : (1 : ℝ) ≤ 12) + _ = C₄ ^ 2 * x ^ 4 / q ^ 2 * z ^ 2 := by + field_simp + _ ≤ C₄ ^ 2 * x ^ 6 / q ^ 2 := by + have hx2 : 1 ≤ x ^ 2 := one_le_pow₀ hx + have hx46 : x ^ 4 ≤ x ^ 6 := by + calc + x ^ 4 = x ^ 4 * 1 := by ring + _ ≤ x ^ 4 * x ^ 2 := + mul_le_mul_of_nonneg_left hx2 (by positivity) + _ = x ^ 6 := by ring + have hzsq1 : z ^ 2 ≤ 1 := by nlinarith [sq_nonneg z] + calc + C₄ ^ 2 * x ^ 4 / q ^ 2 * z ^ 2 ≤ + C₄ ^ 2 * x ^ 6 / q ^ 2 * z ^ 2 := by gcongr + _ ≤ C₄ ^ 2 * x ^ 6 / q ^ 2 * 1 := by + gcongr + _ = _ := by ring + have hR₁square : R₁ * (2 * d + R₁) ≤ + (2 * K₁ * Kᵣ + K₁ ^ 2) * x ^ 6 / q ^ 2 := by + calc + R₁ * (2 * d + R₁) ≤ + (K₁ * x ^ 4 / q ^ 2) * + (2 * (Kᵣ * x ^ 2) + K₁ * x ^ 4 / q ^ 2) := by + gcongr + _ = 2 * K₁ * Kᵣ * x ^ 6 / q ^ 2 + + K₁ ^ 2 * x ^ 8 / q ^ 4 := by ring + _ ≤ 2 * K₁ * Kᵣ * x ^ 6 / q ^ 2 + + K₁ ^ 2 * x ^ 6 / q ^ 2 := by + have hratio : x ^ 8 / q ^ 4 ≤ x ^ 6 / q ^ 2 := by + calc + x ^ 8 / q ^ 4 = (x ^ 6 / q ^ 2) * (x ^ 2 / q ^ 2) := by + field_simp + _ ≤ (x ^ 6 / q ^ 2) * 1 := by + apply mul_le_mul_of_nonneg_left _ (by positivity) + exact (div_le_one (sq_pos_of_pos hq)).2 hx2q2 + _ = _ := by ring + have hmul : K₁ ^ 2 * x ^ 8 / q ^ 4 ≤ + K₁ ^ 2 * x ^ 6 / q ^ 2 := by + calc + K₁ ^ 2 * x ^ 8 / q ^ 4 = K₁ ^ 2 * (x ^ 8 / q ^ 4) := by ring + _ ≤ K₁ ^ 2 * (x ^ 6 / q ^ 2) := + mul_le_mul_of_nonneg_left hratio (sq_nonneg K₁) + _ = K₁ ^ 2 * x ^ 6 / q ^ 2 := by ring + exact add_le_add (le_refl _) hmul + _ = _ := by ring + have hx56 : x ^ 5 ≤ x ^ 6 := by + calc + x ^ 5 = x ^ 5 * 1 := by ring + _ ≤ x ^ 5 * x := mul_le_mul_of_nonneg_left hx (by positivity) + _ = x ^ 6 := by ring + have hpoly : 0 ≤ x ^ 6 / q ^ 2 := by positivity + have hexpnonneg : 0 ≤ (x ^ 4 / q) * Real.exp (-x) := by positivity + calc + _ ≤ K₂ * x ^ 5 / q ^ 2 + + C₂ ^ 2 * (x ^ 4 / q) * Real.exp (-x) + + C₄ ^ 2 * x ^ 6 / q ^ 2 + + (2 * K₁ * Kᵣ + K₁ ^ 2) * x ^ 6 / q ^ 2 := by + gcongr + _ ≤ K₂ * (x ^ 6 / q ^ 2) + + C₂ ^ 2 * ((x ^ 4 / q) * Real.exp (-x)) + + C₄ ^ 2 * (x ^ 6 / q ^ 2) + + (2 * K₁ * Kᵣ + K₁ ^ 2) * (x ^ 6 / q ^ 2) := by + have hfirst : K₂ * x ^ 5 / q ^ 2 ≤ + K₂ * (x ^ 6 / q ^ 2) := by + calc + K₂ * x ^ 5 / q ^ 2 = K₂ * (x ^ 5 / q ^ 2) := by ring + _ ≤ K₂ * (x ^ 6 / q ^ 2) := by gcongr + let B : ℝ := C₂ ^ 2 * ((x ^ 4 / q) * Real.exp (-x)) + + C₄ ^ 2 * (x ^ 6 / q ^ 2) + + (2 * K₁ * Kᵣ + K₁ ^ 2) * (x ^ 6 / q ^ 2) + calc + _ = K₂ * x ^ 5 / q ^ 2 + B := by dsimp [B]; ring + _ ≤ K₂ * (x ^ 6 / q ^ 2) + B := + add_le_add hfirst (le_refl B) + _ = _ := by dsimp [B]; ring + _ ≤ (K₂ + C₄ ^ 2 + 2 * K₁ * Kᵣ + K₁ ^ 2 + C₂ ^ 2) * + (x ^ 6 / q ^ 2 + (x ^ 4 / q) * Real.exp (-x)) := by + rw [show + (K₂ + C₄ ^ 2 + 2 * K₁ * Kᵣ + K₁ ^ 2 + C₂ ^ 2) * + (x ^ 6 / q ^ 2 + (x ^ 4 / q) * Real.exp (-x)) = + (K₂ * (x ^ 6 / q ^ 2) + + C₂ ^ 2 * ((x ^ 4 / q) * Real.exp (-x)) + + C₄ ^ 2 * (x ^ 6 / q ^ 2) + + (2 * K₁ * Kᵣ + K₁ ^ 2) * (x ^ 6 / q ^ 2)) + + ((K₂ + C₄ ^ 2 + 2 * K₁ * Kᵣ + K₁ ^ 2) * + ((x ^ 4 / q) * Real.exp (-x)) + + C₂ ^ 2 * (x ^ 6 / q ^ 2)) by ring] + exact le_add_of_nonneg_right (add_nonneg (mul_nonneg (by positivity) hexpnonneg) + (mul_nonneg (sq_nonneg C₂) hpoly)) + +/-- Rodier's off-diagonal pair error has a uniform polynomial-exponential +majorant at the sharp cutoff scale. -/ +theorem exists_rodierAsymptoticOffDiagonalPairError_bound : + ∃ C : ℝ, 0 ≤ C ∧ + ∀ᶠ n : ℕ in Filter.atTop, + ∀ (hM : 0 < rodierAsymptoticM n) + (hΔ : 0 < rodierAsymptoticDelta n), + rodierOffDiagonalPairError n + (rodierAsymptoticM n) (rodierAsymptoticDelta n) hM hΔ ≤ + C * (((n : ℝ) ^ 6 / rodierAsymptoticQ n ^ 2) + + ((n : ℝ) ^ 4 / rodierAsymptoticQ n) * + Real.exp (-(n : ℝ))) := by + obtain ⟨C₀, hC₀, hm₀⟩ := exists_rodierCutoffFourierDensity_totalMass_bound + obtain ⟨C₂, hC₂, hm₂⟩ := + exists_rodierGaussianWeightedDensityMoment_second_exponential_bound + obtain ⟨C₄, hC₄, hm₄⟩ := + exists_rodierGaussianWeightedDensityMoment_fourth_exponential_bound + obtain ⟨C₆, hC₆, hm₆⟩ := + exists_rodierCutoffFourierDensity_sixthMoment_sharp_bound + obtain ⟨C₈, hC₈, hm₈⟩ := + exists_rodierCutoffFourierDensity_eighthMoment_sharp_bound + let K₁ : ℝ := 3 * C₆ + 3 * C₈ + let K₂ : ℝ := 2 * K₁ + 384 * C₀ * C₆ + 1536 * C₀ * C₈ + let Kᵣ : ℝ := 1 + K₁ + let C : ℝ := K₂ + C₄ ^ 2 + 2 * K₁ * Kᵣ + K₁ ^ 2 + C₂ ^ 2 + have hK₁ : 0 ≤ K₁ := by dsimp [K₁]; positivity + have hK₂ : 0 ≤ K₂ := by dsimp [K₂]; positivity + have hKᵣ : 0 ≤ Kᵣ := by dsimp [Kᵣ]; positivity + have hC : 0 ≤ C := by dsimp [C]; positivity + refine ⟨C, hC, ?_⟩ + filter_upwards [eventually_rodierAsymptotic_parameters, + eventually_rodierAsymptoticCenter_lower] with n hp hcenter + intro hM hΔ + let x : ℝ := n + let q : ℝ := rodierAsymptoticQ n + let z : ℝ := Real.exp (-x / 2) + let I₀ : ℝ := ∫ t : ℝ, + ‖rodierCutoffFourierDensity (rodierAsymptoticM n) + (rodierAsymptoticDelta n) hM hΔ t‖ + let I₆ : ℝ := ∫ t : ℝ, |t| ^ 6 * + ‖rodierCutoffFourierDensity (rodierAsymptoticM n) + (rodierAsymptoticDelta n) hM hΔ t‖ + let I₈ : ℝ := ∫ t : ℝ, |t| ^ 8 * + ‖rodierCutoffFourierDensity (rodierAsymptoticM n) + (rodierAsymptoticDelta n) hM hΔ t‖ + let A₂ : ℂ := rodierGaussianWeightedDensityMoment n 2 + (rodierAsymptoticM n) (rodierAsymptoticDelta n) hM hΔ + let A₄ : ℂ := rodierGaussianWeightedDensityMoment n 4 + (rodierAsymptoticM n) (rodierAsymptoticDelta n) hM hΔ + let G : ℂ := rodierCutoffGaussianIntegral n + (rodierAsymptoticM n) (rodierAsymptoticDelta n) hM hΔ + let R₁ : ℝ := rodierSingleQuarticRemainder n + (rodierAsymptoticM n) (rodierAsymptoticDelta n) hM hΔ + let R₂ : ℝ := rodierPairQuarticRemainder n + (rodierAsymptoticM n) (rodierAsymptoticDelta n) hM hΔ + have hn : 0 < n := hp.1 + have hx : (1 : ℝ) ≤ x := by + have : 1 ≤ n := hn + dsimp [x] + exact_mod_cast this + have hx0 : 0 ≤ x := zero_le_one.trans hx + have hq : 0 < q := by exact rodierAsymptoticQ_pos n + have hq1 : 1 ≤ q := by + dsimp [q, rodierAsymptoticQ] + exact one_le_pow₀ (by norm_num) + have hxq : x ≤ q := by + dsimp [x, q, rodierAsymptoticQ] + exact_mod_cast (Nat.le_of_lt n.lt_two_pow_self) + have hz0 : 0 ≤ z := by dsimp [z]; positivity + have hz1 : z ≤ 1 := by + dsimp [z] + exact Real.exp_le_one_iff.mpr (by dsimp [x] at hx0 ⊢; nlinarith) + have hexp := rodierAsymptoticCenter_exp_upper hn hcenter + have hI₀ : I₀ ≤ 2 * C₀ * x := by + calc + I₀ ≤ C₀ * rodierAsymptoticM n * + (rodierAsymptoticDelta n)⁻¹ := + (hm₀ (rodierAsymptoticM n) (rodierAsymptoticDelta n) + hM hΔ hp.2.2.2).2 + _ = C₀ * (rodierAsymptoticM n * + (rodierAsymptoticDelta n)⁻¹) := by ring + _ ≤ C₀ * (2 * x) := mul_le_mul_of_nonneg_left + (by simpa [x] using rodierAsymptoticM_mul_delta_inv_le hn) hC₀ + _ = _ := by ring + have hI₆ : I₆ ≤ C₆ * (x / q) ^ 3 := by + calc + I₆ ≤ C₆ * (rodierAsymptoticDelta n)⁻¹ ^ 6 := + (hm₆ (rodierAsymptoticM n) (rodierAsymptoticDelta n) hM hΔ).2 + _ = _ := by rw [rodierAsymptoticDelta_inv_sixth hn] + have hI₈ : I₈ ≤ C₈ * (x / q) ^ 4 := by + calc + I₈ ≤ C₈ * (rodierAsymptoticDelta n)⁻¹ ^ 8 := + (hm₈ (rodierAsymptoticM n) (rodierAsymptoticDelta n) hM hΔ).2 + _ = _ := by rw [rodierAsymptoticDelta_inv_eighth hn] + have hA₂ : ‖A₂‖ ≤ C₂ * (x / q) * z := by + calc + ‖A₂‖ ≤ C₂ * (rodierAsymptoticDelta n)⁻¹ ^ 2 * + Real.exp (-(rodierAsymptoticM n ^ 2) / + (2 * rodierAsymptoticQ n)) := + hm₂ n (rodierAsymptoticM n) (rodierAsymptoticDelta n) hM hΔ + _ ≤ C₂ * (rodierAsymptoticDelta n)⁻¹ ^ 2 * z := by + exact mul_le_mul_of_nonneg_left (by simpa [z, x] using hexp) + (mul_nonneg hC₂ (by positivity)) + _ = _ := by rw [rodierAsymptoticDelta_inv_sq hn] + have hA₄ : ‖A₄‖ ≤ C₄ * (x / q) ^ 2 * z := by + calc + ‖A₄‖ ≤ C₄ * (rodierAsymptoticDelta n)⁻¹ ^ 4 * + Real.exp (-(rodierAsymptoticM n ^ 2) / + (2 * rodierAsymptoticQ n)) := + hm₄ n (rodierAsymptoticM n) (rodierAsymptoticDelta n) hM hΔ + _ ≤ C₄ * (rodierAsymptoticDelta n)⁻¹ ^ 4 * z := by + exact mul_le_mul_of_nonneg_left (by simpa [z, x] using hexp) + (mul_nonneg hC₄ (by positivity)) + _ = _ := by rw [rodierAsymptoticDelta_inv_fourth hn] + have hR₁ : R₁ ≤ K₁ * x ^ 4 / q ^ 2 := by + dsimp [R₁, rodierSingleQuarticRemainder, I₆, I₈] + calc + 3 * q * I₆ + 3 * q ^ 2 * I₈ ≤ + 3 * q * (C₆ * (x / q) ^ 3) + + 3 * q ^ 2 * (C₈ * (x / q) ^ 4) := by gcongr + _ = (3 * C₆ * x ^ 3 + 3 * C₈ * x ^ 4) / q ^ 2 := by + field_simp + _ ≤ K₁ * x ^ 4 / q ^ 2 := by + apply div_le_div_of_nonneg_right _ (sq_nonneg q) + dsimp [K₁] + have hx34 : x ^ 3 ≤ x ^ 4 := by nlinarith [mul_self_nonneg (x ^ 2)] + nlinarith + have hR₁nonneg : 0 ≤ R₁ := by + dsimp [R₁, rodierSingleQuarticRemainder] + positivity + have hR₂ : R₂ ≤ K₂ * x ^ 5 / q ^ 2 := by + have hR₂def : R₂ = 2 * R₁ + 192 * q * I₆ * I₀ + + 768 * q ^ 2 * I₈ * I₀ := by + dsimp [R₂, R₁, I₆, I₈, I₀, + rodierPairQuarticRemainder, rodierSingleQuarticRemainder, + q, rodierAsymptoticQ] + ring + rw [hR₂def] + calc + 2 * R₁ + 192 * q * I₆ * I₀ + 768 * q ^ 2 * I₈ * I₀ ≤ + 2 * (K₁ * x ^ 4 / q ^ 2) + + 192 * q * (C₆ * (x / q) ^ 3) * (2 * C₀ * x) + + 768 * q ^ 2 * (C₈ * (x / q) ^ 4) * (2 * C₀ * x) := by + gcongr + _ = (2 * K₁ * x ^ 4 + 384 * C₀ * C₆ * x ^ 4 + + 1536 * C₀ * C₈ * x ^ 5) / q ^ 2 := by + field_simp + ring + _ ≤ K₂ * x ^ 5 / q ^ 2 := by + apply div_le_div_of_nonneg_right _ (sq_nonneg q) + dsimp [K₂] + have hx45 : x ^ 4 ≤ x ^ 5 := by nlinarith [mul_self_nonneg (x ^ 2)] + calc + 2 * K₁ * x ^ 4 + 384 * C₀ * C₆ * x ^ 4 + + 1536 * C₀ * C₈ * x ^ 5 ≤ + 2 * K₁ * x ^ 5 + 384 * C₀ * C₆ * x ^ 5 + + 1536 * C₀ * C₈ * x ^ 5 := by gcongr + _ = (2 * K₁ + 384 * C₀ * C₆ + 1536 * C₀ * C₈) * + x ^ 5 := by ring + let E : ℂ := rodierSingleCutoffExpectation (∅ : Finset (Fin n)) + (rodierAsymptoticM n) (rodierAsymptoticDelta n) + let Eᵣ : ℝ := Finset.expect Finset.univ + (fun f : FABL.BooleanFunction n ↦ + rodierCutoff (rodierAsymptoticM n) (rodierAsymptoticDelta n) + (rodierRawWalshCoefficient (∅ : Finset (Fin n)) f)) + let D : ℂ := G - (q / 12 : ℝ) * A₄ + have hEeq : (Eᵣ : ℂ) = E := by + dsimp [Eᵣ, E] + exact ofReal_expect_rodierCutoff_eq_singleCutoffExpectation + (∅ : Finset (Fin n)) (rodierAsymptoticM n) (rodierAsymptoticDelta n) + have hEᵣnonneg : 0 ≤ Eᵣ := by + dsimp [Eᵣ] + rw [Fintype.expect_eq_sum_div_card] + exact div_nonneg (Finset.sum_nonneg fun f _ => + rodierCutoff_nonneg _ _ hM hΔ _) (by positivity) + have hEᵣone : Eᵣ ≤ 1 := by + dsimp [Eᵣ] + rw [Fintype.expect_eq_sum_div_card] + have hcard : (0 : ℝ) < Fintype.card (FABL.BooleanFunction n) := by positivity + apply (div_le_one hcard).2 + calc + (∑ f : FABL.BooleanFunction n, + rodierCutoff (rodierAsymptoticM n) (rodierAsymptoticDelta n) + (rodierRawWalshCoefficient (∅ : Finset (Fin n)) f)) ≤ + ∑ _f : FABL.BooleanFunction n, (1 : ℝ) := by + apply Finset.sum_le_sum + intro f _ + exact rodierCutoff_le_one _ _ hM hΔ _ + _ = Fintype.card (FABL.BooleanFunction n) := by simp + have hEnorm : ‖E‖ ≤ 1 := by + rw [← hEeq, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg hEᵣnonneg] + exact hEᵣone + have hED : ‖E - D‖ ≤ R₁ := by + have hsingle := + norm_rodierSingleCutoffExpectation_sub_quarticGaussianIntegral_le + hn (∅ : Finset (Fin n)) (rodierAsymptoticM n) + (rodierAsymptoticDelta n) hM hΔ hp.2.2.2 + simpa [E, D, G, A₄, q, rodierAsymptoticQ, R₁, + rodierSingleQuarticRemainder] using hsingle + have hx2q2 : x ^ 2 ≤ q ^ 2 := (sq_le_sq₀ hx0 hq.le).2 hxq + have hx4q2 : x ^ 4 / q ^ 2 ≤ x ^ 2 := by + apply (div_le_iff₀ (sq_pos_of_pos hq)).2 + calc + x ^ 4 = x ^ 2 * x ^ 2 := by ring + _ ≤ x ^ 2 * q ^ 2 := + mul_le_mul_of_nonneg_left hx2q2 (sq_nonneg x) + have hDnorm : ‖D‖ ≤ Kᵣ * x ^ 2 := by + calc + ‖D‖ = ‖E - (E - D)‖ := by ring_nf + _ ≤ ‖E‖ + ‖E - D‖ := norm_sub_le _ _ + _ ≤ 1 + R₁ := add_le_add hEnorm hED + _ ≤ 1 + K₁ * x ^ 2 := by + apply add_le_add (le_refl 1) + refine hR₁.trans ?_ + calc + K₁ * x ^ 4 / q ^ 2 = K₁ * (x ^ 4 / q ^ 2) := by ring + _ ≤ K₁ * x ^ 2 := mul_le_mul_of_nonneg_left hx4q2 hK₁ + _ ≤ Kᵣ * x ^ 2 := by + dsimp [Kᵣ] + nlinarith [sq_nonneg x] + change R₂ + 6 * (q / 12) * ‖A₂‖ ^ 2 + + (q / 12) ^ 2 * ‖A₄‖ ^ 2 + + R₁ * (2 * ‖D‖ + R₁) ≤ _ + dsimp [C] + exact rodierAsymptoticOffDiagonalPairError_algebra x q z C₂ C₄ K₁ K₂ Kᵣ R₁ R₂ + ‖A₂‖ ‖A₄‖ ‖D‖ hx hq hxq (by rfl) hz0 hz1 hC₂ hC₄ + hK₁ hK₂ hKᵣ hR₁nonneg (norm_nonneg _) (norm_nonneg _) + (norm_nonneg _) hR₁ hR₂ hA₂ hA₄ hDnorm + +private theorem exists_rodierAsymptoticSingleCorrection_bound : + ∃ C : ℝ, 0 ≤ C ∧ + ∀ᶠ n : ℕ in Filter.atTop, + ∀ (hM : 0 < rodierAsymptoticM n) + (hΔ : 0 < rodierAsymptoticDelta n), + rodierAsymptoticQ n * + (rodierAsymptoticQ n / 12 * + ‖rodierGaussianWeightedDensityMoment n 4 + (rodierAsymptoticM n) (rodierAsymptoticDelta n) hM hΔ‖ + + rodierSingleQuarticRemainder n + (rodierAsymptoticM n) (rodierAsymptoticDelta n) hM hΔ) ≤ + C * (((n : ℝ) ^ 4 / rodierAsymptoticQ n) + + (n : ℝ) ^ 2 * Real.exp (-(n : ℝ) / 2)) := by + obtain ⟨C₄, hC₄, hm₄⟩ := + exists_rodierGaussianWeightedDensityMoment_fourth_exponential_bound + obtain ⟨C₆, hC₆, hm₆⟩ := + exists_rodierCutoffFourierDensity_sixthMoment_sharp_bound + obtain ⟨C₈, hC₈, hm₈⟩ := + exists_rodierCutoffFourierDensity_eighthMoment_sharp_bound + let K₁ : ℝ := 3 * C₆ + 3 * C₈ + let C : ℝ := C₄ + K₁ + have hK₁ : 0 ≤ K₁ := by dsimp [K₁]; positivity + have hC : 0 ≤ C := by dsimp [C]; positivity + refine ⟨C, hC, ?_⟩ + filter_upwards [eventually_rodierAsymptotic_parameters, + eventually_rodierAsymptoticCenter_lower] with n hp hcenter + intro hM hΔ + let x : ℝ := n + let q : ℝ := rodierAsymptoticQ n + let z : ℝ := Real.exp (-x / 2) + let I₆ : ℝ := ∫ t : ℝ, |t| ^ 6 * + ‖rodierCutoffFourierDensity (rodierAsymptoticM n) + (rodierAsymptoticDelta n) hM hΔ t‖ + let I₈ : ℝ := ∫ t : ℝ, |t| ^ 8 * + ‖rodierCutoffFourierDensity (rodierAsymptoticM n) + (rodierAsymptoticDelta n) hM hΔ t‖ + let A₄ : ℂ := rodierGaussianWeightedDensityMoment n 4 + (rodierAsymptoticM n) (rodierAsymptoticDelta n) hM hΔ + let R₁ : ℝ := rodierSingleQuarticRemainder n + (rodierAsymptoticM n) (rodierAsymptoticDelta n) hM hΔ + have hn : 0 < n := hp.1 + have hx : (1 : ℝ) ≤ x := by + have : 1 ≤ n := hn + dsimp [x] + exact_mod_cast this + have hq : 0 < q := rodierAsymptoticQ_pos n + have hz0 : 0 ≤ z := by dsimp [z]; positivity + have hexp := rodierAsymptoticCenter_exp_upper hn hcenter + have hI₆ : I₆ ≤ C₆ * (x / q) ^ 3 := by + calc + I₆ ≤ C₆ * (rodierAsymptoticDelta n)⁻¹ ^ 6 := + (hm₆ (rodierAsymptoticM n) (rodierAsymptoticDelta n) hM hΔ).2 + _ = _ := by rw [rodierAsymptoticDelta_inv_sixth hn] + have hI₈ : I₈ ≤ C₈ * (x / q) ^ 4 := by + calc + I₈ ≤ C₈ * (rodierAsymptoticDelta n)⁻¹ ^ 8 := + (hm₈ (rodierAsymptoticM n) (rodierAsymptoticDelta n) hM hΔ).2 + _ = _ := by rw [rodierAsymptoticDelta_inv_eighth hn] + have hA₄ : ‖A₄‖ ≤ C₄ * (x / q) ^ 2 * z := by + calc + ‖A₄‖ ≤ C₄ * (rodierAsymptoticDelta n)⁻¹ ^ 4 * + Real.exp (-(rodierAsymptoticM n ^ 2) / + (2 * rodierAsymptoticQ n)) := + hm₄ n (rodierAsymptoticM n) (rodierAsymptoticDelta n) hM hΔ + _ ≤ C₄ * (rodierAsymptoticDelta n)⁻¹ ^ 4 * z := by + exact mul_le_mul_of_nonneg_left (by simpa [z, x] using hexp) + (mul_nonneg hC₄ (by positivity)) + _ = _ := by rw [rodierAsymptoticDelta_inv_fourth hn] + have hR₁ : R₁ ≤ K₁ * x ^ 4 / q ^ 2 := by + dsimp [R₁, rodierSingleQuarticRemainder, I₆, I₈] + calc + 3 * q * I₆ + 3 * q ^ 2 * I₈ ≤ + 3 * q * (C₆ * (x / q) ^ 3) + + 3 * q ^ 2 * (C₈ * (x / q) ^ 4) := by gcongr + _ = (3 * C₆ * x ^ 3 + 3 * C₈ * x ^ 4) / q ^ 2 := by + field_simp + _ ≤ K₁ * x ^ 4 / q ^ 2 := by + apply div_le_div_of_nonneg_right _ (sq_nonneg q) + dsimp [K₁] + have hx34 : x ^ 3 ≤ x ^ 4 := by + calc + x ^ 3 = x ^ 3 * 1 := by ring + _ ≤ x ^ 3 * x := mul_le_mul_of_nonneg_left hx (by positivity) + _ = x ^ 4 := by ring + calc + 3 * C₆ * x ^ 3 + 3 * C₈ * x ^ 4 ≤ + 3 * C₆ * x ^ 4 + 3 * C₈ * x ^ 4 := by gcongr + _ = (3 * C₆ + 3 * C₈) * x ^ 4 := by ring + change q * (q / 12 * ‖A₄‖ + R₁) ≤ + C * (x ^ 4 / q + x ^ 2 * Real.exp (-x / 2)) + calc + q * (q / 12 * ‖A₄‖ + R₁) ≤ + q * (q * (C₄ * (x / q) ^ 2 * z) + K₁ * x ^ 4 / q ^ 2) := by + gcongr + exact div_le_self hq.le (by norm_num : (1 : ℝ) ≤ 12) + _ = C₄ * x ^ 2 * z + K₁ * x ^ 4 / q := by + field_simp + _ ≤ C * (x ^ 4 / q + x ^ 2 * Real.exp (-x / 2)) := by + dsimp [C, z] + rw [show (C₄ + K₁) * (x ^ 4 / q + x ^ 2 * Real.exp (-x / 2)) = + C₄ * x ^ 2 * Real.exp (-x / 2) + K₁ * x ^ 4 / q + + (C₄ * (x ^ 4 / q) + K₁ * (x ^ 2 * Real.exp (-x / 2))) by ring] + exact le_add_of_nonneg_right (add_nonneg (by positivity) (by positivity)) + +private theorem tendsto_natPow_div_rodierAsymptoticQ (k : ℕ) : + Filter.Tendsto + (fun n : ℕ => (n : ℝ) ^ k / rodierAsymptoticQ n) + Filter.atTop (nhds 0) := by + have h := ((isLittleO_pow_exp_pos_mul_atTop k + (Real.log_pos (by norm_num : (1 : ℝ) < 2))).tendsto_div_nhds_zero).comp + (tendsto_natCast_atTop_atTop (R := ℝ)) + simpa only [Function.comp_def, mul_comm, Real.exp_nat_mul, + Real.exp_log (by norm_num : (0 : ℝ) < 2), + rodierAsymptoticQ] using h + +private theorem tendsto_natPow_mul_exp_neg_mul + (k : ℕ) (b : ℝ) (hb : 0 < b) : + Filter.Tendsto + (fun n : ℕ => (n : ℝ) ^ k * Real.exp (-b * (n : ℝ))) + Filter.atTop (nhds 0) := by + have h := (tendsto_rpow_mul_exp_neg_mul_atTop_nhds_zero (k : ℝ) b hb).comp + (tendsto_natCast_atTop_atTop (R := ℝ)) + simpa only [Function.comp_def, Real.rpow_natCast] using h + +private noncomputable def rodierAsymptoticSingleCorrectionEnvelope (n : ℕ) : ℝ := + (n : ℝ) ^ 4 / rodierAsymptoticQ n + + (n : ℝ) ^ 2 * Real.exp (-(n : ℝ) / 2) + +private theorem tendsto_rodierAsymptoticSingleCorrectionEnvelope : + Filter.Tendsto rodierAsymptoticSingleCorrectionEnvelope Filter.atTop (nhds 0) := by + have h₁ := tendsto_natPow_div_rodierAsymptoticQ 4 + have h₂ := tendsto_natPow_mul_exp_neg_mul 2 (1 / 2 : ℝ) (by norm_num) + have heq : (fun n : ℕ => (n : ℝ) ^ 4 / rodierAsymptoticQ n + + (n : ℝ) ^ 2 * Real.exp (-(1 / 2 : ℝ) * (n : ℝ))) =ᶠ[Filter.atTop] + rodierAsymptoticSingleCorrectionEnvelope := by + filter_upwards [] with n + dsimp [rodierAsymptoticSingleCorrectionEnvelope] + congr 2 + ring + simpa only [zero_add] using (h₁.add h₂).congr' heq + +private noncomputable def rodierAsymptoticOffDiagonalPairEnvelope (n : ℕ) : ℝ := + (n : ℝ) ^ 6 / rodierAsymptoticQ n ^ 2 + + ((n : ℝ) ^ 4 / rodierAsymptoticQ n) * Real.exp (-(n : ℝ)) + +private noncomputable def rodierAsymptoticGaussianLower (n : ℕ) : ℝ := + Real.exp (-5) * (n : ℝ) ^ 5 / + (Real.sqrt (2 * Real.pi) * Real.sqrt (n : ℝ)) + +private theorem rodierAsymptoticQ_mul_exp_neg (n : ℕ) : + rodierAsymptoticQ n * Real.exp (-(n : ℝ)) = + Real.exp (-(1 - Real.log 2) * (n : ℝ)) := by + have hpow : (2 : ℝ) ^ n = Real.exp ((n : ℝ) * Real.log 2) := by + rw [Real.exp_nat_mul, Real.exp_log (by norm_num : (0 : ℝ) < 2)] + rw [rodierAsymptoticQ, hpow, ← Real.exp_add] + congr 1 + ring + +private theorem tendsto_rodierAsymptoticOffDiagonalPairEnvelope_scaled : + Filter.Tendsto + (fun n : ℕ => rodierAsymptoticQ n ^ 2 * rodierAsymptoticOffDiagonalPairEnvelope n / + rodierAsymptoticGaussianLower n ^ 2) + Filter.atTop (nhds 0) := by + let c : ℝ := Real.exp (-5) / Real.sqrt (2 * Real.pi) + have hc : 0 < c := by dsimp [c]; positivity + have hInvThree : Filter.Tendsto + (fun n : ℕ => ((n : ℝ) ^ 3)⁻¹) Filter.atTop (nhds 0) := by + have hinv := tendsto_inv_atTop_zero.comp + (tendsto_natCast_atTop_atTop (R := ℝ)) + simpa [inv_pow] using hinv.pow 3 + have hExp : Filter.Tendsto + (fun n : ℕ => rodierAsymptoticQ n * Real.exp (-(n : ℝ))) + Filter.atTop (nhds 0) := by + have h := tendsto_natPow_mul_exp_neg_mul 0 + (1 - Real.log 2) (by nlinarith [Real.log_two_lt_d9]) + apply h.congr' + filter_upwards [] with n + rw [pow_zero, one_mul, rodierAsymptoticQ_mul_exp_neg] + have hInvFive : Filter.Tendsto + (fun n : ℕ => ((n : ℝ) ^ 5)⁻¹) Filter.atTop (nhds 0) := by + have hinv := tendsto_inv_atTop_zero.comp + (tendsto_natCast_atTop_atTop (R := ℝ)) + simpa [inv_pow] using hinv.pow 5 + have hExpDiv : Filter.Tendsto + (fun n : ℕ => rodierAsymptoticQ n * Real.exp (-(n : ℝ)) / + (n : ℝ) ^ 5) Filter.atTop (nhds 0) := by + simpa [div_eq_mul_inv] using hExp.mul hInvFive + have hmodel : Filter.Tendsto + (fun n : ℕ => (c ^ 2)⁻¹ * + (((n : ℝ) ^ 3)⁻¹ + + rodierAsymptoticQ n * Real.exp (-(n : ℝ)) / (n : ℝ) ^ 5)) + Filter.atTop (nhds 0) := by + simpa using (hInvThree.add hExpDiv).const_mul (c ^ 2)⁻¹ + apply hmodel.congr' + filter_upwards [Filter.eventually_ge_atTop 1] with n hn + have hnℝ : (0 : ℝ) < n := by exact_mod_cast hn + have hsqrt : Real.sqrt (n : ℝ) ^ 2 = (n : ℝ) := Real.sq_sqrt hnℝ.le + have hcne : c ≠ 0 := ne_of_gt hc + have hqne : rodierAsymptoticQ n ≠ 0 := ne_of_gt (rodierAsymptoticQ_pos n) + dsimp [rodierAsymptoticOffDiagonalPairEnvelope, rodierAsymptoticGaussianLower, c] + rw [show Real.exp (-5) * (n : ℝ) ^ 5 / + (Real.sqrt (2 * Real.pi) * Real.sqrt (n : ℝ)) = + (Real.exp (-5) / Real.sqrt (2 * Real.pi)) * (n : ℝ) ^ 5 / + Real.sqrt (n : ℝ) by ring] + field_simp [hcne, hqne, hsqrt, hnℝ.ne'] + rw [hsqrt] + ring + +private noncomputable def rodierAsymptoticSingleCutoffMean (n : ℕ) : ℝ := + (rodierSingleCutoffExpectation (∅ : Finset (Fin n)) + (rodierAsymptoticM n) (rodierAsymptoticDelta n)).re + +private theorem eventually_rodierAsymptoticSingleCutoffMean_lower : + ∀ᶠ n : ℕ in Filter.atTop, + rodierAsymptoticGaussianLower n / 2 ≤ + rodierAsymptoticQ n * rodierAsymptoticSingleCutoffMean n := by + obtain ⟨C, hC, hcorrection⟩ := exists_rodierAsymptoticSingleCorrection_bound + have hsmall : ∀ᶠ n : ℕ in Filter.atTop, + C * rodierAsymptoticSingleCorrectionEnvelope n < 1 := by + have ht : Filter.Tendsto (fun n => C * rodierAsymptoticSingleCorrectionEnvelope n) + Filter.atTop (nhds 0) := by + simpa only [mul_zero] using tendsto_rodierAsymptoticSingleCorrectionEnvelope.const_mul C + exact ht.eventually (Iio_mem_nhds (by norm_num : (0 : ℝ) < 1)) + have hlarge : ∀ᶠ n : ℕ in Filter.atTop, 2 ≤ rodierAsymptoticGaussianLower n := by + exact tendsto_rodierScaledGaussianLower_atTop.eventually + (Filter.eventually_ge_atTop 2) + filter_upwards [eventually_rodierAsymptotic_parameters, + eventually_rodierCutoffGaussianIntegral_scaled_lower_bound, + hcorrection, hsmall, hlarge] with n hp hmain hcorr hsmalln hlargen + let q : ℝ := rodierAsymptoticQ n + let E : ℂ := rodierSingleCutoffExpectation (∅ : Finset (Fin n)) + (rodierAsymptoticM n) (rodierAsymptoticDelta n) + let G : ℂ := rodierCutoffGaussianIntegral n + (rodierAsymptoticM n) (rodierAsymptoticDelta n) hp.2.1 hp.2.2.1 + let A₄ : ℂ := rodierGaussianWeightedDensityMoment n 4 + (rodierAsymptoticM n) (rodierAsymptoticDelta n) hp.2.1 hp.2.2.1 + let R₁ : ℝ := rodierSingleQuarticRemainder n + (rodierAsymptoticM n) (rodierAsymptoticDelta n) hp.2.1 hp.2.2.1 + let D : ℂ := G - (q / 12 : ℝ) * A₄ + have hq : 0 < q := rodierAsymptoticQ_pos n + have hED : ‖E - D‖ ≤ R₁ := by + have hsingle := + norm_rodierSingleCutoffExpectation_sub_quarticGaussianIntegral_le + hp.1 (∅ : Finset (Fin n)) (rodierAsymptoticM n) + (rodierAsymptoticDelta n) hp.2.1 hp.2.2.1 hp.2.2.2 + simpa [E, D, G, A₄, q, rodierAsymptoticQ, R₁, + rodierSingleQuarticRemainder] using hsingle + have hEDre : D.re - R₁ ≤ E.re := by + have habs : |(E - D).re| ≤ R₁ := + (Complex.abs_re_le_norm _).trans hED + have := (abs_le.mp habs).1 + change -R₁ ≤ E.re - D.re at this + linarith + have hA₄re : A₄.re ≤ ‖A₄‖ := + (le_abs_self _).trans (Complex.abs_re_le_norm _) + have hDre : G.re - q / 12 * ‖A₄‖ ≤ D.re := by + dsimp [D] + simp only [Complex.mul_re, Complex.ofReal_re, + Complex.ofReal_im, zero_mul, sub_zero] + have hscale : 0 ≤ q / 12 := by positivity + have hmul := mul_le_mul_of_nonneg_left hA₄re hscale + exact sub_le_sub_left hmul G.re + have hE : G.re - q / 12 * ‖A₄‖ - R₁ ≤ E.re := + (sub_le_sub_right hDre R₁).trans hEDre + have hcorr' : q * (q / 12 * ‖A₄‖ + R₁) < 1 := by + exact (hcorr hp.2.1 hp.2.2.1).trans_lt (by + simpa [rodierAsymptoticSingleCorrectionEnvelope] using hsmalln) + have hmain' : rodierAsymptoticGaussianLower n ≤ q * G.re := by + simpa [rodierAsymptoticGaussianLower, q] using hmain hp.2.1 hp.2.2.1 + change rodierAsymptoticGaussianLower n / 2 ≤ q * E.re + have hscaledE : q * G.re - q * (q / 12 * ‖A₄‖ + R₁) ≤ + q * E.re := by + have := mul_le_mul_of_nonneg_left hE hq.le + nlinarith + nlinarith + +private theorem tendsto_rodierAsymptoticSecondMomentFailureBound + (C : ℝ) (hC : 0 ≤ C) : + Filter.Tendsto + (rodierAsymptoticSecondMomentFailureBound + (fun n ↦ C * rodierAsymptoticOffDiagonalPairEnvelope n)) + Filter.atTop (nhds 0) := by + have hInvLower : Filter.Tendsto + (fun n : ℕ ↦ (rodierAsymptoticGaussianLower n)⁻¹) + Filter.atTop (nhds 0) := + tendsto_inv_atTop_zero.comp tendsto_rodierScaledGaussianLower_atTop + have hFirst : Filter.Tendsto + (fun n : ℕ ↦ 2 / rodierAsymptoticGaussianLower n) + Filter.atTop (nhds 0) := by + simpa only [div_eq_mul_inv, mul_zero] using hInvLower.const_mul 2 + have hSecond : Filter.Tendsto + (fun n : ℕ ↦ 4 * C * + (rodierAsymptoticQ n ^ 2 * rodierAsymptoticOffDiagonalPairEnvelope n / + rodierAsymptoticGaussianLower n ^ 2)) + Filter.atTop (nhds 0) := by + simpa only [mul_zero] using + tendsto_rodierAsymptoticOffDiagonalPairEnvelope_scaled.const_mul (4 * C) + have hmodel : Filter.Tendsto + (fun n : ℕ ↦ 2 / rodierAsymptoticGaussianLower n + 4 * C * + (rodierAsymptoticQ n ^ 2 * rodierAsymptoticOffDiagonalPairEnvelope n / + rodierAsymptoticGaussianLower n ^ 2)) + Filter.atTop (nhds 0) := by + simpa only [zero_add] using hFirst.add hSecond + apply tendsto_of_tendsto_of_tendsto_of_le_of_le' + tendsto_const_nhds hmodel + · filter_upwards [eventually_rodierAsymptotic_parameters, + eventually_rodierAsymptoticSingleCutoffMean_lower] with n hp hmean + let q : ℝ := rodierAsymptoticQ n + let e : ℝ := rodierAsymptoticSingleCutoffMean n + let ε : ℝ := C * rodierAsymptoticOffDiagonalPairEnvelope n + have hq : 0 < q := rodierAsymptoticQ_pos n + have hL : 0 < rodierAsymptoticGaussianLower n := by + have hnℝ : (0 : ℝ) < n := by exact_mod_cast hp.1 + dsimp [rodierAsymptoticGaussianLower] + positivity + have he : 0 < e := by + have hprod : 0 < q * e := lt_of_lt_of_le + (half_pos hL) hmean + exact pos_of_mul_pos_right hprod hq.le + have hpairEnvelope : 0 ≤ rodierAsymptoticOffDiagonalPairEnvelope n := by + dsimp [rodierAsymptoticOffDiagonalPairEnvelope] + positivity + have hε : 0 ≤ ε := mul_nonneg hC hpairEnvelope + dsimp [rodierAsymptoticSecondMomentFailureBound, + rodierSecondMomentFailureBound] + exact div_nonneg (add_nonneg (div_nonneg he.le hq.le) hε) + (sq_nonneg e) + · filter_upwards [eventually_rodierAsymptotic_parameters, + eventually_rodierAsymptoticSingleCutoffMean_lower] with n hp hmean + let q : ℝ := rodierAsymptoticQ n + let e : ℝ := rodierAsymptoticSingleCutoffMean n + let ε : ℝ := C * rodierAsymptoticOffDiagonalPairEnvelope n + let L : ℝ := rodierAsymptoticGaussianLower n + have hq : 0 < q := rodierAsymptoticQ_pos n + have hL : 0 < L := by + have hnℝ : (0 : ℝ) < n := by exact_mod_cast hp.1 + dsimp [L, rodierAsymptoticGaussianLower] + positivity + have he : 0 < e := by + have hprod : 0 < q * e := lt_of_lt_of_le + (half_pos hL) hmean + exact pos_of_mul_pos_right hprod hq.le + have hpairEnvelope : 0 ≤ rodierAsymptoticOffDiagonalPairEnvelope n := by + dsimp [rodierAsymptoticOffDiagonalPairEnvelope] + positivity + have hε : 0 ≤ ε := mul_nonneg hC hpairEnvelope + have hscaled : L ≤ 2 * (q * e) := by + dsimp [L, q, e] + nlinarith + have htermOne : (e / q) / e ^ 2 ≤ 2 / L := by + calc + (e / q) / e ^ 2 = 1 / (q * e) := by field_simp + _ ≤ 2 / L := + (div_le_div_iff₀ (mul_pos hq he) hL).2 (by simpa using hscaled) + have hsquare : L ^ 2 ≤ 4 * q ^ 2 * e ^ 2 := by + nlinarith [sq_nonneg (2 * q * e - L)] + have hinvSquare : 1 / e ^ 2 ≤ 4 * q ^ 2 / L ^ 2 := + (div_le_div_iff₀ (sq_pos_of_pos he) (sq_pos_of_pos hL)).2 (by + simpa [mul_assoc] using hsquare) + have htermTwo : ε / e ^ 2 ≤ 4 * q ^ 2 * ε / L ^ 2 := by + calc + ε / e ^ 2 = ε * (1 / e ^ 2) := by ring + _ ≤ ε * (4 * q ^ 2 / L ^ 2) := + mul_le_mul_of_nonneg_left hinvSquare hε + _ = 4 * q ^ 2 * ε / L ^ 2 := by ring + change ((e / q + ε) / e ^ 2) ≤ _ + calc + (e / q + ε) / e ^ 2 = (e / q) / e ^ 2 + ε / e ^ 2 := by + rw [add_div] + _ ≤ 2 / L + 4 * q ^ 2 * ε / L ^ 2 := + add_le_add htermOne htermTwo + _ = 2 / rodierAsymptoticGaussianLower n + 4 * C * + (rodierAsymptoticQ n ^ 2 * rodierAsymptoticOffDiagonalPairEnvelope n / + rodierAsymptoticGaussianLower n ^ 2) := by + dsimp [L, q, ε] + ring + +/-- Rodier's sharp lower spectral-amplitude event has probability tending to +one for uniformly random Boolean functions. -/ +theorem tendsto_rodierRandomFourierLowerProbability : + Filter.Tendsto rodierRandomFourierLowerProbability + Filter.atTop (nhds 1) := by + obtain ⟨C, hC, herror⟩ := exists_rodierAsymptoticOffDiagonalPairError_bound + let ε : ℕ → ℝ := fun n ↦ C * rodierAsymptoticOffDiagonalPairEnvelope n + apply tendsto_rodierRandomFourierLowerProbability_of_secondMoment ε + · filter_upwards [eventually_rodierAsymptotic_parameters] with n hp + exact hp.2.1 + · filter_upwards with n + exact mul_nonneg hC (by + dsimp [rodierAsymptoticOffDiagonalPairEnvelope] + exact add_nonneg + (div_nonneg (by positivity) (sq_nonneg _)) + (mul_nonneg + (div_nonneg (by positivity) (rodierAsymptoticQ_pos n).le) + (Real.exp_pos _).le)) + · filter_upwards [eventually_rodierAsymptotic_parameters, + eventually_rodierAsymptoticSingleCutoffMean_lower] with n hp hmean + have hL : 0 < rodierAsymptoticGaussianLower n := by + have hnℝ : (0 : ℝ) < n := by exact_mod_cast hp.1 + dsimp [rodierAsymptoticGaussianLower] + positivity + have hprod : 0 < rodierAsymptoticQ n * rodierAsymptoticSingleCutoffMean n := + lt_of_lt_of_le (half_pos hL) hmean + have he : 0 < rodierAsymptoticSingleCutoffMean n := + pos_of_mul_pos_right hprod (rodierAsymptoticQ_pos n).le + simpa [rodierAsymptoticSingleCutoffMean] using he + · filter_upwards [eventually_rodierAsymptotic_parameters, + herror] with n hp herr + intro S T hST + have hfinite := + rodierPairCutoffExpectation_re_le_single_sq_add_offDiagonalPairError + hp.1 (n := n) (S₀ := (∅ : Finset (Fin n))) hST + (rodierAsymptoticM n) (rodierAsymptoticDelta n) + hp.2.1 hp.2.2.1 hp.2.2.2 + calc + _ ≤ (rodierSingleCutoffExpectation (∅ : Finset (Fin n)) + (rodierAsymptoticM n) (rodierAsymptoticDelta n)).re ^ 2 + + rodierOffDiagonalPairError n + (rodierAsymptoticM n) (rodierAsymptoticDelta n) + hp.2.1 hp.2.2.1 := hfinite + _ ≤ (rodierSingleCutoffExpectation (∅ : Finset (Fin n)) + (rodierAsymptoticM n) (rodierAsymptoticDelta n)).re ^ 2 + + C * rodierAsymptoticOffDiagonalPairEnvelope n := by + gcongr + simpa [rodierAsymptoticOffDiagonalPairEnvelope] using herr hp.2.1 hp.2.2.1 + _ = _ := by rfl + · simpa [ε] using tendsto_rodierAsymptoticSecondMomentFailureBound C hC + +/-- The probability that a uniformly random Boolean function lies strictly +between both endpoints of Rodier's sharp nonlinearity interval. -/ +noncomputable def rodierSharpRandomNonlinearityIntervalProbability (n : ℕ) : ℝ := + (FABL.uniformPMF (FABL.BooleanFunction n)).toMeasure.real + {g | rodierRandomNonlinearityLowerThreshold n < + (nonlinearity (FABL.booleanFunctionF₂Encoding g) : ℝ) ∧ + (nonlinearity (FABL.booleanFunctionF₂Encoding g) : ℝ) < + rodierRandomNonlinearityUpperThreshold n} + +private theorem sum_rodierRandomNonlinearityProbabilities_sub_one_le_sharpInterval + (n : ℕ) : + rodierRandomNonlinearityLowerProbability n + + rodierRandomNonlinearityUpperProbability n - 1 ≤ + rodierSharpRandomNonlinearityIntervalProbability n := by + let μ := (FABL.uniformPMF (FABL.BooleanFunction n)).toMeasure + let lower : Set (FABL.BooleanFunction n) := + {g | rodierRandomNonlinearityLowerThreshold n < + (nonlinearity (FABL.booleanFunctionF₂Encoding g) : ℝ)} + let upper : Set (FABL.BooleanFunction n) := + {g | (nonlinearity (FABL.booleanFunctionF₂Encoding g) : ℝ) < + rodierRandomNonlinearityUpperThreshold n} + have hunion : μ.real (lower ∪ upper) ≤ 1 := measureReal_le_one + have hadd : μ.real (lower ∪ upper) + μ.real (lower ∩ upper) = + μ.real lower + μ.real upper := + measureReal_union_add_inter (Set.toFinite upper).measurableSet + unfold rodierRandomNonlinearityLowerProbability + rodierRandomNonlinearityUpperProbability rodierSharpRandomNonlinearityIntervalProbability + change μ.real lower + μ.real upper - 1 ≤ μ.real (lower ∩ upper) + linarith + +/-- The proportion of Boolean functions in Rodier's simultaneous sharp +two-sided nonlinearity interval tends to one. -/ +theorem tendsto_rodierSharpRandomNonlinearityIntervalProbability : + Filter.Tendsto rodierSharpRandomNonlinearityIntervalProbability Filter.atTop (nhds 1) := by + have hupper : Filter.Tendsto rodierRandomNonlinearityUpperProbability + Filter.atTop (nhds 1) := + tendsto_rodierRandomNonlinearityUpperProbability_of_fourierLower + tendsto_rodierRandomFourierLowerProbability + have hlower := tendsto_rodierRandomNonlinearityLowerProbability + have hmodel : Filter.Tendsto + (fun n ↦ rodierRandomNonlinearityLowerProbability n + + rodierRandomNonlinearityUpperProbability n - 1) + Filter.atTop (nhds 1) := by + simpa using (hlower.add hupper).sub_const 1 + apply tendsto_of_tendsto_of_tendsto_of_le_of_le' + hmodel tendsto_const_nhds + · exact Filter.Eventually.of_forall + sum_rodierRandomNonlinearityProbabilities_sub_one_le_sharpInterval + · exact Filter.Eventually.of_forall fun n ↦ by + unfold rodierSharpRandomNonlinearityIntervalProbability + exact measureReal_le_one + +end CryptBoolean diff --git a/CryptBoolean/Carlet/Chapter04/RodierSharpInterval.lean b/CryptBoolean/Carlet/Chapter04/RodierSharpInterval.lean new file mode 100644 index 0000000..6cbe729 --- /dev/null +++ b/CryptBoolean/Carlet/Chapter04/RodierSharpInterval.lean @@ -0,0 +1,321 @@ +/- +Copyright (c) 2026 Asher Yan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Asher Yan with Codex +-/ +module + +public import CryptBoolean.Carlet.Chapter04.RodierGaussianMainTerm + +/-! +# Rodier's sharp random-nonlinearity interval + +Finite second-moment and no-hit bridges from the smoothed cutoff estimates to +Rodier's lower spectral-amplitude probability. +-/ + +@[expose] public section + +open Finset MeasureTheory ProbabilityTheory Set +open scoped BigOperators BooleanCube ENNReal Topology + +namespace CryptBoolean + +variable {n : ℕ} + +local instance rodierSharpSignMeasurableSpace : MeasurableSpace FABL.Sign := ⊤ + +local instance rodierSharpSignMeasurableSingletonClass : + MeasurableSingletonClass FABL.Sign where + measurableSet_singleton _ := by simp + +/-- A raw Walsh coefficient is `2^n` times FABL's normalized coefficient. -/ +theorem rodierRawWalshCoefficient_eq_card_mul_fourierCoeff + (S : Finset (Fin n)) (f : FABL.BooleanFunction n) : + rodierRawWalshCoefficient S f = + (2 : ℝ) ^ n * FABL.fourierCoeff f.toReal S := by + rw [rodierRawWalshCoefficient, FABL.fourierCoeff, + Fintype.expect_eq_sum_div_card] + have hcard : (Fintype.card ({−1,1}^[n]) : ℝ) = (2 : ℝ) ^ n := by + norm_num [Fintype.card_pi, FABL.Sign] + rw [hcard] + simp only [FABL.BooleanFunction.toReal] + field_simp + +/-- If every normalized Fourier coefficient is at most `M / 2^n`, Rodier's +smoothed exceedance fraction vanishes. -/ +theorem fourierInfinityNorm_le_rawCutoff_subset_average_eq_zero + (M Δ : ℝ) (hM : 0 < M) (hΔ : 0 < Δ) : + {f : FABL.BooleanFunction n | + FABL.fourierInfinityNorm f.toReal ≤ M / (2 : ℝ) ^ n} ⊆ + {f | rodierCutoffFrequencyAverage M Δ f = 0} := by + intro f hf + change rodierCutoffFrequencyAverage M Δ f = 0 + rw [rodierCutoffFrequencyAverage, Fintype.expect_eq_sum_div_card] + have hq : 0 < (2 : ℝ) ^ n := by positivity + have hzero (S : Finset (Fin n)) : + rodierCutoff M Δ (rodierRawWalshCoefficient S f) = 0 := by + apply rodierCutoff_eq_zero_of_abs_le hM hΔ + rw [rodierRawWalshCoefficient_eq_card_mul_fourierCoeff, + abs_mul, abs_of_pos hq] + calc + (2 : ℝ) ^ n * |FABL.fourierCoeff f.toReal S| ≤ + (2 : ℝ) ^ n * FABL.fourierInfinityNorm f.toReal := by + gcongr + unfold FABL.fourierInfinityNorm + exact Finset.le_sup' (fun T : Finset (Fin n) ↦ + |FABL.fourierCoeff f.toReal T|) (Finset.mem_univ S) + _ ≤ (2 : ℝ) ^ n * (M / (2 : ℝ) ^ n) := by + apply mul_le_mul_of_nonneg_left _ hq.le + simpa only [Set.mem_setOf_eq] using hf + _ = M := by field_simp + simp_rw [hzero] + simp + +/-- The one-coordinate remainder after retaining the quartic Gaussian +correction. -/ +noncomputable def rodierSingleQuarticRemainder + (n : ℕ) (M Δ : ℝ) (hM : 0 < M) (hΔ : 0 < Δ) : ℝ := + (3 * (2 : ℝ) ^ n) * + (∫ t : ℝ, |t| ^ 6 * ‖rodierCutoffFourierDensity M Δ hM hΔ t‖) + + (3 * ((2 : ℝ) ^ n) ^ 2) * + (∫ t : ℝ, |t| ^ 8 * ‖rodierCutoffFourierDensity M Δ hM hΔ t‖) + +/-- The two-coordinate remainder after retaining the quartic Gaussian +correction. -/ +noncomputable def rodierPairQuarticRemainder + (n : ℕ) (M Δ : ℝ) (hM : 0 < M) (hΔ : 0 < Δ) : ℝ := + 2 * rodierSingleQuarticRemainder n M Δ hM hΔ + + (3 * (2 : ℝ) ^ n) * + (64 * (∫ t : ℝ, |t| ^ 6 * + ‖rodierCutoffFourierDensity M Δ hM hΔ t‖) * + ∫ t : ℝ, ‖rodierCutoffFourierDensity M Δ hM hΔ t‖) + + (3 * ((2 : ℝ) ^ n) ^ 2) * + (256 * (∫ t : ℝ, |t| ^ 8 * + ‖rodierCutoffFourierDensity M Δ hM hΔ t‖) * + ∫ t : ℝ, ‖rodierCutoffFourierDensity M Δ hM hΔ t‖) + +/-- A uniform off-diagonal error combining the pair remainder, the two +quartic cross terms, and the single-coordinate square error. -/ +noncomputable def rodierOffDiagonalPairError + (n : ℕ) (M Δ : ℝ) (hM : 0 < M) (hΔ : 0 < Δ) : ℝ := + let c : ℝ := (2 : ℝ) ^ n / 12 + let A₂ := rodierGaussianWeightedDensityMoment n 2 M Δ hM hΔ + let A₄ := rodierGaussianWeightedDensityMoment n 4 M Δ hM hΔ + let G := rodierCutoffGaussianIntegral n M Δ hM hΔ + let R₁ := rodierSingleQuarticRemainder n M Δ hM hΔ + rodierPairQuarticRemainder n M Δ hM hΔ + + 6 * c * ‖A₂‖ ^ 2 + c ^ 2 * ‖A₄‖ ^ 2 + + R₁ * (2 * ‖G - (c : ℂ) * A₄‖ + R₁) + +/-- The refined single- and pair-cutoff estimates give a uniform +off-diagonal pair bound. -/ +theorem rodierPairCutoffExpectation_re_le_single_sq_add_offDiagonalPairError + (hn : 0 < n) (S₀ : Finset (Fin n)) {S T : Finset (Fin n)} (hST : S ≠ T) + (M Δ : ℝ) (hM : 0 < M) (hΔ : 0 < Δ) (hΔM : Δ ≤ M) : + (rodierPairCutoffExpectation S T M Δ).re ≤ + (rodierSingleCutoffExpectation S₀ M Δ).re ^ 2 + + rodierOffDiagonalPairError n M Δ hM hΔ := by + let q : ℝ := (2 : ℝ) ^ n + let c : ℝ := q / 12 + let G : ℂ := rodierCutoffGaussianIntegral n M Δ hM hΔ + let A₂ : ℂ := rodierGaussianWeightedDensityMoment n 2 M Δ hM hΔ + let A₄ : ℂ := rodierGaussianWeightedDensityMoment n 4 M Δ hM hΔ + let C : ℂ := G - (c : ℂ) * A₄ + let P : ℂ := rodierPairCutoffExpectation S T M Δ + let E : ℂ := rodierSingleCutoffExpectation S₀ M Δ + let R₁ : ℝ := rodierSingleQuarticRemainder n M Δ hM hΔ + let R₂ : ℝ := rodierPairQuarticRemainder n M Δ hM hΔ + let center : ℂ := G ^ 2 - (c : ℂ) * + (2 * A₄ * G + 6 * A₂ ^ 2) + have hc : 0 ≤ c := by dsimp [c, q]; positivity + have hR₁ : 0 ≤ R₁ := by + dsimp [R₁, rodierSingleQuarticRemainder] + positivity + have hpair := + norm_rodierPairCutoffExpectation_sub_quarticGaussianIntegral_sq_le_moments + hn hST M Δ hM hΔ hΔM + have hP : ‖P - center‖ ≤ R₂ := by + simpa [P, center, R₂, rodierPairQuarticRemainder, + rodierSingleQuarticRemainder, q, c, G, A₂, A₄] using hpair + have hsingle := + norm_rodierSingleCutoffExpectation_sub_quarticGaussianIntegral_le + hn S₀ M Δ hM hΔ hΔM + have hE : ‖E - C‖ ≤ R₁ := by + simpa [E, C, R₁, rodierSingleQuarticRemainder, q, c, G, A₄] using hsingle + have hcenterEq : center - C ^ 2 = + -(6 : ℂ) * (c : ℂ) * A₂ ^ 2 - (c : ℂ) ^ 2 * A₄ ^ 2 := by + dsimp [center, C] + ring + have hcenter : ‖center - C ^ 2‖ ≤ + 6 * c * ‖A₂‖ ^ 2 + c ^ 2 * ‖A₄‖ ^ 2 := by + rw [hcenterEq] + calc + _ ≤ ‖-(6 : ℂ) * (c : ℂ) * A₂ ^ 2‖ + + ‖(c : ℂ) ^ 2 * A₄ ^ 2‖ := norm_sub_le _ _ + _ = _ := by + simp only [norm_mul, norm_neg, norm_pow, Complex.norm_real, + Real.norm_eq_abs, abs_of_nonneg hc] + norm_num + have hEnorm : ‖E‖ ≤ ‖C‖ + R₁ := by + calc + ‖E‖ = ‖C + (E - C)‖ := by ring_nf + _ ≤ ‖C‖ + ‖E - C‖ := norm_add_le _ _ + _ ≤ ‖C‖ + R₁ := add_le_add (le_refl _) hE + have hsquare : ‖C ^ 2 - E ^ 2‖ ≤ + R₁ * (2 * ‖C‖ + R₁) := by + rw [show C ^ 2 - E ^ 2 = (C - E) * (C + E) by ring, norm_mul] + calc + ‖C - E‖ * ‖C + E‖ ≤ R₁ * (‖C‖ + ‖E‖) := by + gcongr + · simpa [norm_sub_rev] using hE + · exact norm_add_le _ _ + _ ≤ R₁ * (‖C‖ + (‖C‖ + R₁)) := by gcongr + _ = _ := by ring + have htotal : ‖P - E ^ 2‖ ≤ + R₂ + (6 * c * ‖A₂‖ ^ 2 + c ^ 2 * ‖A₄‖ ^ 2) + + R₁ * (2 * ‖C‖ + R₁) := by + calc + ‖P - E ^ 2‖ = + ‖(P - center) + ((center - C ^ 2) + (C ^ 2 - E ^ 2))‖ := by + ring_nf + _ ≤ ‖P - center‖ + ‖(center - C ^ 2) + (C ^ 2 - E ^ 2)‖ := + norm_add_le _ _ + _ ≤ ‖P - center‖ + + (‖center - C ^ 2‖ + ‖C ^ 2 - E ^ 2‖) := by + gcongr + exact norm_add_le _ _ + _ ≤ R₂ + + ((6 * c * ‖A₂‖ ^ 2 + c ^ 2 * ‖A₄‖ ^ 2) + + R₁ * (2 * ‖C‖ + R₁)) := by + gcongr + _ = _ := by ring + have hEreal : ((E.re : ℝ) : ℂ) = E := by + dsimp [E] + rw [← ofReal_expect_rodierCutoff_eq_singleCutoffExpectation S₀ M Δ] + simp + have hre : P.re - E.re ^ 2 ≤ ‖P - E ^ 2‖ := by + calc + P.re - E.re ^ 2 = (P - E ^ 2).re := by + rw [← hEreal] + norm_cast + _ ≤ |(P - E ^ 2).re| := le_abs_self _ + _ ≤ ‖P - E ^ 2‖ := Complex.abs_re_le_norm _ + change (rodierPairCutoffExpectation S T M Δ).re ≤ + (rodierSingleCutoffExpectation S₀ M Δ).re ^ 2 + + rodierOffDiagonalPairError n M Δ hM hΔ + rw [show rodierOffDiagonalPairError n M Δ hM hΔ = + R₂ + 6 * c * ‖A₂‖ ^ 2 + c ^ 2 * ‖A₄‖ ^ 2 + + R₁ * (2 * ‖C‖ + R₁) by + dsimp [rodierOffDiagonalPairError, R₂, R₁, C, G, A₂, A₄, c, q]] + linarith + +/-- The Chebyshev failure ratio attached to a one-coordinate mean and a +uniform off-diagonal pair error. -/ +noncomputable def rodierSecondMomentFailureBound + (n : ℕ) (S₀ : Finset (Fin n)) (M Δ ε : ℝ) : ℝ := + ((rodierSingleCutoffExpectation S₀ M Δ).re / (2 : ℝ) ^ n + ε) / + (rodierSingleCutoffExpectation S₀ M Δ).re ^ 2 + +/-- The finite second-moment estimate bounds the lower spectral event. -/ +theorem measure_fourierInfinityNorm_le_rawCutoff_le_secondMomentFailureBound + (S₀ : Finset (Fin n)) + (M Δ ε : ℝ) (hM : 0 < M) (hΔ : 0 < Δ) (hε : 0 ≤ ε) + (he : 0 < (rodierSingleCutoffExpectation S₀ M Δ).re) + (hpair : ∀ S T : Finset (Fin n), S ≠ T → + (rodierPairCutoffExpectation S T M Δ).re ≤ + (rodierSingleCutoffExpectation S₀ M Δ).re ^ 2 + ε) : + (FABL.uniformPMF (FABL.BooleanFunction n)).toMeasure.real + {f | FABL.fourierInfinityNorm f.toReal ≤ M / (2 : ℝ) ^ n} ≤ + rodierSecondMomentFailureBound n S₀ M Δ ε := by + calc + _ ≤ (FABL.uniformPMF (FABL.BooleanFunction n)).toMeasure.real + {f | rodierCutoffFrequencyAverage M Δ f = 0} := + measureReal_mono + (fourierInfinityNorm_le_rawCutoff_subset_average_eq_zero M Δ hM hΔ) + _ ≤ _ := by + simpa [rodierSecondMomentFailureBound] using + measure_rodierCutoffFrequencyAverage_eq_zero_le + S₀ M Δ ε hM hΔ hε he hpair + +/-- The second-moment failure ratio at Rodier's asymptotic cutoff scale. -/ +noncomputable def rodierAsymptoticSecondMomentFailureBound + (ε : ℕ → ℝ) (n : ℕ) : ℝ := + rodierSecondMomentFailureBound n ∅ + (rodierAsymptoticM n) (rodierAsymptoticDelta n) (ε n) + +/-- The finite no-hit bound gives a lower bound for Rodier's spectral event. -/ +theorem one_sub_rodierAsymptoticSecondMomentFailureBound_le_fourierLowerProbability + {n : ℕ} (hn : 0 < n) (hM : 0 < rodierAsymptoticM n) + (ε : ℕ → ℝ) (hε : 0 ≤ ε n) + (he : 0 < (rodierSingleCutoffExpectation (∅ : Finset (Fin n)) + (rodierAsymptoticM n) (rodierAsymptoticDelta n)).re) + (hpair : ∀ S T : Finset (Fin n), S ≠ T → + (rodierPairCutoffExpectation S T + (rodierAsymptoticM n) (rodierAsymptoticDelta n)).re ≤ + (rodierSingleCutoffExpectation (∅ : Finset (Fin n)) + (rodierAsymptoticM n) (rodierAsymptoticDelta n)).re ^ 2 + ε n) : + 1 - rodierAsymptoticSecondMomentFailureBound ε n ≤ + rodierRandomFourierLowerProbability n := by + let μ := (FABL.uniformPMF (FABL.BooleanFunction n)).toMeasure + let bad : Set (FABL.BooleanFunction n) := + {f | FABL.fourierInfinityNorm f.toReal ≤ rodierRandomFourierLowerThreshold n} + let good : Set (FABL.BooleanFunction n) := + {f | rodierRandomFourierLowerThreshold n < FABL.fourierInfinityNorm f.toReal} + have hdiv : rodierAsymptoticM n / (2 : ℝ) ^ n = + rodierRandomFourierLowerThreshold n := by + rw [rodierAsymptoticM_eq_q_mul_threshold, rodierAsymptoticQ] + field_simp + have hbad : μ.real bad ≤ rodierAsymptoticSecondMomentFailureBound ε n := by + dsimp only [μ, bad, rodierAsymptoticSecondMomentFailureBound] + rw [← hdiv] + exact measure_fourierInfinityNorm_le_rawCutoff_le_secondMomentFailureBound + (∅ : Finset (Fin n)) + (rodierAsymptoticM n) (rodierAsymptoticDelta n) (ε n) + hM (rodierAsymptoticDelta_pos hn) hε he hpair + have hcompl : badᶜ ⊆ good := by + intro f hf + simpa [bad, good] using hf + calc + 1 - rodierAsymptoticSecondMomentFailureBound ε n ≤ 1 - μ.real bad := + sub_le_sub_left hbad 1 + _ = μ.real badᶜ := by + rw [measureReal_compl (Set.toFinite bad).measurableSet] + simp + _ ≤ μ.real good := measureReal_mono hcompl + _ = rodierRandomFourierLowerProbability n := by + rfl + +/-- An asymptotically vanishing second-moment ratio closes Rodier's lower +spectral tail. -/ +theorem tendsto_rodierRandomFourierLowerProbability_of_secondMoment + (ε : ℕ → ℝ) + (hM : ∀ᶠ n in Filter.atTop, 0 < rodierAsymptoticM n) + (hε : ∀ᶠ n in Filter.atTop, 0 ≤ ε n) + (he : ∀ᶠ n in Filter.atTop, + 0 < (rodierSingleCutoffExpectation (∅ : Finset (Fin n)) + (rodierAsymptoticM n) (rodierAsymptoticDelta n)).re) + (hpair : ∀ᶠ n in Filter.atTop, ∀ S T : Finset (Fin n), S ≠ T → + (rodierPairCutoffExpectation S T + (rodierAsymptoticM n) (rodierAsymptoticDelta n)).re ≤ + (rodierSingleCutoffExpectation (∅ : Finset (Fin n)) + (rodierAsymptoticM n) (rodierAsymptoticDelta n)).re ^ 2 + ε n) + (hbound : Filter.Tendsto (rodierAsymptoticSecondMomentFailureBound ε) + Filter.atTop (nhds 0)) : + Filter.Tendsto rodierRandomFourierLowerProbability + Filter.atTop (nhds 1) := by + have hlower : Filter.Tendsto + (fun n => 1 - rodierAsymptoticSecondMomentFailureBound ε n) + Filter.atTop (nhds 1) := by + simpa only [sub_zero] using hbound.const_sub 1 + apply tendsto_of_tendsto_of_tendsto_of_le_of_le' hlower tendsto_const_nhds + · filter_upwards [Filter.eventually_ge_atTop 1, hM, hε, he, hpair] with + n hn hnM hnε hne hnpair + exact + one_sub_rodierAsymptoticSecondMomentFailureBound_le_fourierLowerProbability + (Nat.zero_lt_of_lt hn) hnM ε hnε hne hnpair + · exact Filter.Eventually.of_forall fun n => by + unfold rodierRandomFourierLowerProbability + exact measureReal_le_one + +end CryptBoolean diff --git a/CryptBoolean/Carlet/Chapter04/SevenVariableMaximumNonlinearity.lean b/CryptBoolean/Carlet/Chapter04/SevenVariableMaximumNonlinearity.lean new file mode 100644 index 0000000..a9459a3 --- /dev/null +++ b/CryptBoolean/Carlet/Chapter04/SevenVariableMaximumNonlinearity.lean @@ -0,0 +1,389 @@ +/- +Copyright (c) 2026 Asher Yan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Asher Yan with Codex +-/ +module + +public import CryptBoolean.Carlet.Chapter04.DegreeRepairNonlinearity +public import FABL.Chapter06.F₂Polynomials.Interpolation + +/-! +# Seven-variable maximum nonlinearity + +The point-indicator quotient reduction in Hou's proof of the covering radius +of the first-order Reed--Muller code in dimension seven. +-/ + +open Finset +open scoped BigOperators BooleanCube + +@[expose] public section + +namespace CryptBoolean + +variable {n : ℕ} + +private theorem two_eq_zero_f₂ : (2 : FABL.𝔽₂) = 0 := + ZMod.natCast_self 2 + +private theorem anfCoeff_pointIndicator + (a : FABL.F₂Cube n) (S : Finset (Fin n)) : + FABL.anfCoeff (FABL.f₂PointIndicator a) S = + if FABL.f₂Support a ⊆ S then 1 else 0 := by + classical + rw [FABL.anfCoeff] + have hcubeeq (T : Finset (Fin n)) : + FABL.f₂CubeOfFinset T = a ↔ T = FABL.f₂Support a := by + constructor + · intro h + calc + T = FABL.f₂Support (FABL.f₂CubeOfFinset T) := by + simpa using (FABL.f₂CubeEquivFinset n).apply_symm_apply T |>.symm + _ = FABL.f₂Support a := congrArg FABL.f₂Support h + · intro h + subst T + simpa using (FABL.f₂CubeEquivFinset n).symm_apply_apply a + simp_rw [FABL.f₂PointIndicator_eq_ite, hcubeeq] + by_cases ha : FABL.f₂Support a ⊆ S + · rw [if_pos ha] + have hmem : FABL.f₂Support a ∈ S.powerset := by simpa + simp [hmem] + · rw [if_neg ha] + have hnotmem : FABL.f₂Support a ∉ S.powerset := by simpa + simp [hnotmem] + +private theorem anfCoeff_pointIndicator_univ + (a : FABL.F₂Cube n) : + FABL.anfCoeff (FABL.f₂PointIndicator a) Finset.univ = 1 := by + rw [anfCoeff_pointIndicator] + simp + +private theorem anfCoeff_pointIndicator_erase + (a : FABL.F₂Cube n) (i : Fin n) : + FABL.anfCoeff (FABL.f₂PointIndicator a) (Finset.univ.erase i) = 1 + a i := by + rw [anfCoeff_pointIndicator] + by_cases hai : a i = 0 + · have hsub : FABL.f₂Support a ⊆ Finset.univ.erase i := by + intro j hj + simp only [Finset.mem_erase, Finset.mem_univ, and_true] + intro hji + subst j + exact (FABL.mem_f₂Support a i).mp hj hai + rw [if_pos hsub, hai] + norm_num [two_eq_zero_f₂] + · have hi : i ∈ FABL.f₂Support a := (FABL.mem_f₂Support a i).2 hai + have hnot : ¬FABL.f₂Support a ⊆ Finset.univ.erase i := by + intro hsub + exact (Finset.mem_erase.mp (hsub hi)).1 rfl + have hai1 : a i = 1 := Fin.eq_one_of_ne_zero _ hai + rw [if_neg hnot, hai1] + ring_nf + simp only [two_eq_zero_f₂] + +private theorem finset_fin_seven_eq_univ_or_erase_of_five_lt_card + (S : Finset (Fin 7)) (hS : 5 < S.card) : + S = Finset.univ ∨ ∃ i : Fin 7, S = Finset.univ.erase i := by + have hcard : S.card ≤ 7 := by simpa using Finset.card_le_univ S + have hcases : S.card = 6 ∨ S.card = 7 := by omega + rcases hcases with h | h + · right + have hcompl : Sᶜ.card = 1 := by + rw [Finset.card_compl] + norm_num [h] + obtain ⟨i, hi⟩ := Finset.card_eq_one.mp hcompl + refine ⟨i, ?_⟩ + ext j + have hcompmem : j ∈ Sᶜ ↔ j = i := by rw [hi]; simp + by_cases hji : j = i + · subst j + have : i ∉ S := by + intro hiS + have : i ∉ Sᶜ := by simp [hiS] + exact this (by simp [hi]) + simp [this] + · have : j ∈ S := by + by_contra hjS + have : j ∈ Sᶜ := by simp [hjS] + exact hji (hcompmem.mp this) + simp [this, hji] + · left + exact Finset.eq_univ_of_card S (by simpa using h) + +private noncomputable def degreeSixProfile (f : BooleanFunction 7) : FABL.F₂Cube 7 := + fun i ↦ FABL.anfCoeff f (Finset.univ.erase i) + +private noncomputable def oddPoint (f : BooleanFunction 7) : FABL.F₂Cube 7 := + fun i ↦ 1 + degreeSixProfile f i + +private theorem add_oddPoint_degree_le_five + (f : BooleanFunction 7) + (htop : FABL.anfCoeff f Finset.univ = 1) : + FABL.functionAlgebraicDegree + (f + FABL.f₂PointIndicator (oddPoint f)) ≤ 5 := by + rw [FABL.functionAlgebraicDegree, FABL.algebraicDegree_le_iff] + intro S hcoeff + by_contra hcard + have hcard' : 5 < S.card := Nat.lt_of_not_ge hcard + rcases finset_fin_seven_eq_univ_or_erase_of_five_lt_card S hcard' with + rfl | ⟨i, rfl⟩ + · apply hcoeff + rw [FABL.anfCoeff_add] + change FABL.anfCoeff f Finset.univ + + FABL.anfCoeff (FABL.f₂PointIndicator (oddPoint f)) Finset.univ = 0 + rw [htop, anfCoeff_pointIndicator_univ] + ring_nf + simp only [two_eq_zero_f₂] + · apply hcoeff + rw [FABL.anfCoeff_add] + change FABL.anfCoeff f (Finset.univ.erase i) + + FABL.anfCoeff (FABL.f₂PointIndicator (oddPoint f)) + (Finset.univ.erase i) = 0 + rw [anfCoeff_pointIndicator_erase] + simp only [oddPoint, degreeSixProfile] + ring_nf + simp only [two_eq_zero_f₂, zero_add, mul_zero] + +private theorem add_two_points_degree_le_five + (f : BooleanFunction 7) + (htop : FABL.anfCoeff f Finset.univ = 0) : + FABL.functionAlgebraicDegree + (f + FABL.f₂PointIndicator 0 + + FABL.f₂PointIndicator (degreeSixProfile f)) ≤ 5 := by + rw [FABL.functionAlgebraicDegree, FABL.algebraicDegree_le_iff] + intro S hcoeff + by_contra hcard + have hcard' : 5 < S.card := Nat.lt_of_not_ge hcard + rcases finset_fin_seven_eq_univ_or_erase_of_five_lt_card S hcard' with + rfl | ⟨i, rfl⟩ + · apply hcoeff + rw [FABL.anfCoeff_add, FABL.anfCoeff_add] + change (FABL.anfCoeff f Finset.univ + + FABL.anfCoeff (FABL.f₂PointIndicator 0) Finset.univ) + + FABL.anfCoeff (FABL.f₂PointIndicator (degreeSixProfile f)) + Finset.univ = 0 + rw [htop, anfCoeff_pointIndicator_univ, + anfCoeff_pointIndicator_univ] + ring_nf + simp only [two_eq_zero_f₂] + · apply hcoeff + rw [FABL.anfCoeff_add, FABL.anfCoeff_add] + change (FABL.anfCoeff f (Finset.univ.erase i) + + FABL.anfCoeff (FABL.f₂PointIndicator 0) (Finset.univ.erase i)) + + FABL.anfCoeff (FABL.f₂PointIndicator (degreeSixProfile f)) + (Finset.univ.erase i) = 0 + rw [anfCoeff_pointIndicator_erase, + anfCoeff_pointIndicator_erase] + simp only [degreeSixProfile, Pi.zero_apply] + ring_nf + simp only [two_eq_zero_f₂, zero_add, mul_zero] + +private theorem support_f₂PointIndicator + (a : FABL.F₂Cube n) : + support (FABL.f₂PointIndicator a) = {a} := by + classical + ext x + simp [mem_support, FABL.f₂PointIndicator_eq_ite] + +private theorem hammingWeight_f₂PointIndicator + (a : FABL.F₂Cube n) : + hammingWeight (FABL.f₂PointIndicator a) = 1 := by + rw [hammingWeight_eq_card_support, support_f₂PointIndicator] + simp + +private theorem hammingDistance_add_pointIndicator + (f : BooleanFunction n) (a : FABL.F₂Cube n) : + hammingDistance f (f + FABL.f₂PointIndicator a) = 1 := by + rw [hammingDistance_eq_hammingWeight_add] + have hcancel : f + (f + FABL.f₂PointIndicator a) = + FABL.f₂PointIndicator a := by + funext x + simp only [Pi.add_apply] + exact CharTwo.add_cancel_left _ _ + rw [hcancel, hammingWeight_f₂PointIndicator] + +private theorem support_add_pointIndicator_of_eq_one + (f : BooleanFunction n) (a : FABL.F₂Cube n) (ha : f a = 1) : + support (f + FABL.f₂PointIndicator a) = (support f).erase a := by + classical + ext x + by_cases hxa : x = a + · subst x + simp [mem_support, FABL.f₂PointIndicator_eq_ite, ha] + · simp [mem_support, FABL.f₂PointIndicator_eq_ite, hxa] + +private theorem hammingWeight_add_pointIndicator_add_one + (f : BooleanFunction n) (a : FABL.F₂Cube n) (ha : f a = 1) : + hammingWeight (f + FABL.f₂PointIndicator a) + 1 = hammingWeight f := by + rw [hammingWeight_eq_card_support, hammingWeight_eq_card_support, + support_add_pointIndicator_of_eq_one f a ha] + exact Finset.card_erase_add_one ((mem_support f a).2 ha) + +private theorem hammingDistance_add_pointIndicator_add_one + (f g : BooleanFunction n) (a : FABL.F₂Cube n) + (ha : (f + g) a = 1) : + hammingDistance (f + FABL.f₂PointIndicator a) g + 1 = + hammingDistance f g := by + rw [hammingDistance_eq_hammingWeight_add, + hammingDistance_eq_hammingWeight_add] + have hreassoc : + (f + FABL.f₂PointIndicator a) + g = + (f + g) + FABL.f₂PointIndicator a := by + funext x + simp only [Pi.add_apply] + ac_rfl + rw [hreassoc] + exact hammingWeight_add_pointIndicator_add_one (f + g) a ha + +private theorem even_hammingWeight_of_degree_le_five + (f : BooleanFunction 7) (hf : FABL.functionAlgebraicDegree f ≤ 5) : + Even (hammingWeight f) := by + rw [hammingWeight_eq_card_support] + apply Nat.not_odd_iff_even.mp + intro hodd + have hdegree := + (FABL.functionAlgebraicDegree_eq_dimension_iff_card_f₂OneSupport_odd + f (by omega)).2 hodd + omega + +private theorem nonlinearity_ne_fifty_five_of_degree_le_five + (f : BooleanFunction 7) (hf : FABL.functionAlgebraicDegree f ≤ 5) : + nonlinearity f ≠ 55 := by + classical + intro hnonlinearity + unfold nonlinearity at hnonlinearity + obtain ⟨p, _hp, hmin⟩ := Finset.exists_mem_eq_inf' + (s := (Finset.univ : Finset (FABL.𝔽₂ × FABL.F₂Cube 7))) + Finset.univ_nonempty + (fun q ↦ hammingDistance f (FABL.affineFunction q.1 q.2)) + have hdistance := hmin + rw [hnonlinearity] at hdistance + rw [hammingDistance_eq_hammingWeight_add] at hdistance + have haffine : FABL.functionAlgebraicDegree + (FABL.affineFunction p.1 p.2) ≤ 1 := by + exact FABL.functionAlgebraicDegree_affineFunction_le_one p.1 p.2 + have hsumdegree : FABL.functionAlgebraicDegree + (f + FABL.affineFunction p.1 p.2) ≤ 5 := + (FABL.functionAlgebraicDegree_add_le_max f + (FABL.affineFunction p.1 p.2)).trans (by omega) + obtain ⟨k, hk⟩ := even_hammingWeight_of_degree_le_five + (f + FABL.affineFunction p.1 p.2) hsumdegree + omega + +/-- Hou's quotient reduction: a radius-`56` bound on the degree-at-most-five +subcode, together with a minimum leader through every coordinate of each +radius-`56` coset, bounds every seven-variable Boolean function by `56`. -/ +theorem nonlinearity_le_fifty_six_of_degree_five_covering + (hleader : ∀ g : BooleanFunction 7, + FABL.functionAlgebraicDegree g ≤ 5 → nonlinearity g = 56 → + ∀ x : FABL.F₂Cube 7, ∃ b a, + hammingDistance g (FABL.affineFunction b a) = 56 ∧ + (g + FABL.affineFunction b a) x = 1) + (f : BooleanFunction 7) : + nonlinearity f ≤ 56 := by + classical + by_cases htop : FABL.anfCoeff f Finset.univ = 0 + · let v := degreeSixProfile f + let g := f + FABL.f₂PointIndicator 0 + FABL.f₂PointIndicator v + have hgdegree : FABL.functionAlgebraicDegree g ≤ 5 := by + simpa [g, v] using add_two_points_degree_le_five f htop + have hgupper := nonlinearity_le_56_of_degree_le_five_seven g hgdegree + have hgne : nonlinearity g ≠ 55 := + nonlinearity_ne_fifty_five_of_degree_le_five g hgdegree + by_cases hgsmall : nonlinearity g ≤ 54 + · have hfg : hammingDistance f g ≤ 2 := by + have htriangle := hammingDist_triangle f + (f + FABL.f₂PointIndicator 0) g + change hammingDistance f g ≤ + hammingDistance f (f + FABL.f₂PointIndicator 0) + + hammingDistance (f + FABL.f₂PointIndicator 0) g at htriangle + have hfirst := hammingDistance_add_pointIndicator f + (0 : FABL.F₂Cube 7) + have hsecond : hammingDistance (f + FABL.f₂PointIndicator 0) g = 1 := by + have hrewrite : g = + (f + FABL.f₂PointIndicator 0) + FABL.f₂PointIndicator v := by + simp only [g] + rw [hrewrite] + exact hammingDistance_add_pointIndicator + (f + FABL.f₂PointIndicator 0) v + omega + exact (nonlinearity_le_hammingDistance_add_nonlinearity f g).trans (by omega) + · have hge : 55 ≤ nonlinearity g := by omega + have hgeq : nonlinearity g = 56 := by omega + obtain ⟨b, a, hdist, herror⟩ := hleader g hgdegree hgeq 0 + let h := g + FABL.f₂PointIndicator 0 + have hhcandidate : nonlinearity h ≤ 55 := by + have hdrop := hammingDistance_add_pointIndicator_add_one + g (FABL.affineFunction b a) 0 herror + have hdistance : hammingDistance h (FABL.affineFunction b a) = 55 := by + change hammingDistance (g + FABL.f₂PointIndicator 0) + (FABL.affineFunction b a) = 55 + omega + exact Finset.inf'_le + (fun q : FABL.𝔽₂ × FABL.F₂Cube 7 ↦ + hammingDistance h (FABL.affineFunction q.1 q.2)) + (Finset.mem_univ (b, a)) |>.trans_eq hdistance + have hfh : hammingDistance f h = 1 := by + have hrewrite : h = f + FABL.f₂PointIndicator v := by + change ((f + FABL.f₂PointIndicator 0) + + FABL.f₂PointIndicator v) + FABL.f₂PointIndicator 0 = + f + FABL.f₂PointIndicator v + calc + ((f + FABL.f₂PointIndicator 0) + + FABL.f₂PointIndicator v) + FABL.f₂PointIndicator 0 = + (f + FABL.f₂PointIndicator v) + + (FABL.f₂PointIndicator 0 + FABL.f₂PointIndicator 0) := by + funext y + simp only [Pi.add_apply] + abel + _ = f + FABL.f₂PointIndicator v := by + rw [CharTwo.add_self_eq_zero, add_zero] + rw [hrewrite] + exact hammingDistance_add_pointIndicator f v + exact (nonlinearity_le_hammingDistance_add_nonlinearity f h).trans (by omega) + · have htopone : FABL.anfCoeff f Finset.univ = 1 := + Fin.eq_one_of_ne_zero _ htop + let x := oddPoint f + let g := f + FABL.f₂PointIndicator x + have hgdegree : FABL.functionAlgebraicDegree g ≤ 5 := by + simpa [g, x] using add_oddPoint_degree_le_five f htopone + have hgupper := nonlinearity_le_56_of_degree_le_five_seven g hgdegree + by_cases hgsmall : nonlinearity g ≤ 55 + · have hfg : hammingDistance f g = 1 := by + rw [show g = f + FABL.f₂PointIndicator x by rfl] + exact hammingDistance_add_pointIndicator f x + exact (nonlinearity_le_hammingDistance_add_nonlinearity f g).trans (by omega) + · have hgeq : nonlinearity g = 56 := by omega + obtain ⟨b, a, hdist, herror⟩ := hleader g hgdegree hgeq x + have hdrop := hammingDistance_add_pointIndicator_add_one + g (FABL.affineFunction b a) x herror + have hfgfun : f = g + FABL.f₂PointIndicator x := by + funext y + change f y = (f y + FABL.f₂PointIndicator x y) + + FABL.f₂PointIndicator x y + rw [add_assoc, CharTwo.add_self_eq_zero, add_zero] + rw [← hfgfun] at hdrop + have hcandidate : hammingDistance f (FABL.affineFunction b a) = 55 := by + omega + calc + nonlinearity f ≤ hammingDistance f (FABL.affineFunction b a) := + Finset.inf'_le + (fun q : FABL.𝔽₂ × FABL.F₂Cube 7 ↦ + hammingDistance f (FABL.affineFunction q.1 q.2)) + (Finset.mem_univ (b, a)) + _ = 55 := hcandidate + _ ≤ 56 := by omega + +/-- Carlet's exact best nonlinearity in seven variables. -/ +theorem maximumNonlinearity_seven : maximumNonlinearity 7 = 56 := by + apply Nat.le_antisymm + · obtain ⟨f, hf⟩ := exists_nonlinearity_eq_maximumNonlinearity 7 + rw [← hf] + exact nonlinearity_le_fifty_six_of_degree_five_covering + exists_minimum_affine_error_one_at_of_degree_le_five_nonlinearity_eq_56_seven f + · have hlower := quadraticBound_le_maximumNonlinearity_of_odd + (n := 7) (by decide) + norm_num at hlower ⊢ + exact hlower + +end CryptBoolean diff --git a/CryptBoolean/Carlet/Chapter04/SupportDualDistance.lean b/CryptBoolean/Carlet/Chapter04/SupportDualDistance.lean new file mode 100644 index 0000000..293e24c --- /dev/null +++ b/CryptBoolean/Carlet/Chapter04/SupportDualDistance.lean @@ -0,0 +1,129 @@ +/- +Copyright (c) 2026 Asher Yan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Asher Yan with Codex +-/ +module + +public import CryptBoolean.Carlet.Chapter04.Resiliency + +/-! +# Support dual distance + +The character-sum definition of dual distance for arbitrary binary codes and its +specialization to supports of correlation-immune and resilient Boolean functions. +-/ + +open Finset +open scoped BigOperators BooleanCube + +@[expose] public section + +namespace CryptBoolean + +variable {n : ℕ} + +/-- The character sum of a binary code at a frequency. -/ +noncomputable def codeCharacterSum + (C : Finset (FABL.F₂Cube n)) (u : FABL.F₂Cube n) : ℝ := + ∑ x ∈ C, FABL.vectorWalshCharacter u x + +/-- An arbitrary binary code has dual distance at least `d` when every nonzero +character of weight below `d` has zero sum over the code. -/ +def HasDualDistanceAtLeast + (C : Finset (FABL.F₂Cube n)) (d : ℕ) : Prop := + ∀ u : FABL.F₂Cube n, u ≠ 0 → + (FABL.f₂Support u).card < d → codeCharacterSum C u = 0 + +/-- A nontrivial Walsh character sums to zero over the full binary cube. -/ +theorem sum_vectorWalshCharacter_eq_zero + (u : FABL.F₂Cube n) (hu : u ≠ 0) : + ∑ x, FABL.vectorWalshCharacter u x = 0 := by + have h := FABL.expect_vectorWalshCharacter u + rw [if_neg hu, Fintype.expect_eq_sum_div_card] at h + exact (div_eq_zero_iff.mp h).resolve_right (by positivity) + +/-- At a nonzero frequency, the raw Walsh transform is minus twice the +character sum over the support. -/ +theorem walshTransform_cast_eq_neg_two_mul_codeCharacterSum_support + (f : BooleanFunction n) (u : FABL.F₂Cube n) (hu : u ≠ 0) : + (walshTransform f u : ℝ) = + -2 * codeCharacterSum (support f) u := by + rw [walshTransform_cast_eq_sum_realSignView_mul_character] + calc + ∑ x, realSignView f x * FABL.vectorWalshCharacter u x = + ∑ x, (1 - 2 * (if f x = 1 then (1 : ℝ) else 0)) * + FABL.vectorWalshCharacter u x := by + apply Finset.sum_congr rfl + intro x _ + by_cases hx : f x = 1 + · simp [realSignView, FABL.realSignEncodedFunction, + FABL.signEncodedFunction, hx] + ring + · have hxzero : f x = 0 := by + by_contra hzero + exact hx (Fin.eq_one_of_ne_zero (f x) hzero) + simp [realSignView, FABL.realSignEncodedFunction, + FABL.signEncodedFunction, hxzero] + _ = ∑ x, (FABL.vectorWalshCharacter u x - + 2 * ((if f x = 1 then (1 : ℝ) else 0) * + FABL.vectorWalshCharacter u x)) := by + apply Finset.sum_congr rfl + intro x _ + ring + _ = (∑ x, FABL.vectorWalshCharacter u x) - + 2 * ∑ x, (if f x = 1 then (1 : ℝ) else 0) * + FABL.vectorWalshCharacter u x := by + rw [Finset.sum_sub_distrib, Finset.mul_sum] + _ = -2 * ∑ x, (if f x = 1 then (1 : ℝ) else 0) * + FABL.vectorWalshCharacter u x := by + rw [sum_vectorWalshCharacter_eq_zero u hu] + ring + _ = -2 * codeCharacterSum (support f) u := by + congr 1 + rw [codeCharacterSum, support, FABL.f₂OneSupport, Finset.sum_filter] + apply Finset.sum_congr rfl + intro x _ + by_cases hx : f x = 1 <;> simp [hx] + +/-- Carlet's support-dual-distance corollary, correlation-immunity form. -/ +theorem isCorrelationImmune_iff_support_hasDualDistanceAtLeast + (m : ℕ) (f : BooleanFunction n) (hn : 0 < n) (hm : m < n) : + IsCorrelationImmune m f ↔ + HasDualDistanceAtLeast (support f) (m + 1) := by + rw [theorem_3_correlationImmune_iff_walshTransform_eq_zero m f hn hm] + constructor + · intro hwalsh u hu hweight + have hzero := hwalsh u hu (Nat.lt_succ_iff.mp hweight) + have hidentity := + walshTransform_cast_eq_neg_two_mul_codeCharacterSum_support f u hu + rw [hzero, Int.cast_zero] at hidentity + linarith + · intro hdual u hu hweight + apply Int.cast_injective (α := ℝ) + rw [Int.cast_zero, + walshTransform_cast_eq_neg_two_mul_codeCharacterSum_support f u hu, + hdual u hu (Nat.lt_succ_iff.mpr hweight), mul_zero] + +/-- For a nonempty binary cube, balancedness says exactly that the support has +cardinality `2^(n-1)`. -/ +theorem isBalanced_iff_support_card_eq_two_pow_pred + (f : BooleanFunction n) (hn : 0 < n) : + IsBalanced f ↔ (support f).card = 2 ^ (n - 1) := by + obtain ⟨k, rfl⟩ := Nat.exists_eq_succ_of_ne_zero (Nat.ne_of_gt hn) + rw [IsBalanced, hammingWeight_eq_card_support] + simp only [Nat.succ_sub_one, pow_succ] + omega + +/-- Carlet's support-dual-distance corollary, resilient form: the support has +size `2^(n-1)` and dual distance at least `m+1`. -/ +theorem isResilient_iff_support_card_and_hasDualDistanceAtLeast + (m : ℕ) (f : BooleanFunction n) (hn : 0 < n) (hm : m < n) : + IsResilient m f ↔ + (support f).card = 2 ^ (n - 1) ∧ + HasDualDistanceAtLeast (support f) (m + 1) := by + rw [IsResilient, + isCorrelationImmune_iff_support_hasDualDistanceAtLeast m f hn hm, + isBalanced_iff_support_card_eq_two_pow_pred f hn, and_comm] + +end CryptBoolean diff --git a/README.md b/README.md index 65d5f84..64ae236 100644 --- a/README.md +++ b/README.md @@ -4,12 +4,14 @@ CryptBoolean is a Lean 4 and Mathlib formalization of cryptographic Boolean func Claude Carlet's *Boolean Functions for Cryptography and Error Correcting Codes*. It develops the algebraic, spectral, coding-theoretic, and cryptographic theory as a reusable theorem library. -The project uses [FABL](https://github.com/Polarnova/FABL) for Boolean Fourier analysis and supplies -explicit bridges between FABL's normalized coefficients and Carlet's raw Walsh transform. +The project uses [FABL](https://github.com/Polarnova/FABL) for Boolean Fourier analysis and its +canonical ANF, algebraic-degree, affine-function, and derivative APIs. CryptBoolean imports those +APIs directly and supplies explicit bridges between FABL's normalized coefficients and Carlet's raw +Walsh transform. ## Status -The verified production surface currently covers selected results from Carlet Chapters 2 and 3. +The verified production surface currently covers selected results from Carlet Chapters 2--4. Every Blueprint node has a complete mathematical statement and reviewed dependencies. Formalized nodes are associated with compiled Lean declarations; open source theorems remain visible without placeholder associations. @@ -17,21 +19,38 @@ placeholder associations. | Chapter | Subject | Statements | Formalized | Open | Lean declarations | Dependency edges | |---|---|---:|---:|---:|---:|---:| | 2 | Representations and Fourier/Walsh transforms | 36 | 35 | 1 | 159 | 45 | -| 3 | Boolean functions and Reed--Muller coding | 7 | 6 | 1 | 21 | 19 | -| **Total** | | **43** | **41** | **2** | **180** | **64** | +| 3 | Boolean functions and Reed--Muller coding | 7 | 7 | 0 | 32 | 19 | +| 4 | Cryptographic criteria | 73 | 73 | 0 | 568 | 159 | +| **Total** | | **116** | **115** | **1** | **759** | **223** | The Chapter 2 surface includes algebraic and numerical normal forms, Walsh and pseudo-Boolean Fourier transforms, inversion and Plancherel identities, the full raw Poisson formula, the numerical-normal-form integrality criterion, affine invariance, restriction recovery, spectral-support bounds, derivatives, autocorrelation, and finite-field representations. Chapter 3 defines Reed--Muller codes and proves the general distance bound, dimension and cardinality -formulas, and duality theorem. - -Exactly two source statements remain open. Carlet Proposition 3 requires a finite-field coordinate -bridge identifying ANF degree with the maximum binary weight of a univariate exponent, together -with noncancellation along the relevant cyclotomic orbit. Carlet Chapter 3 Proposition 12 requires -an arbitrary affine-flat normal form, the codimension--degree theorem for affine-flat indicators, -and equality-case slice infrastructure for the minimum-weight classification. +formulas, duality theorem, and Proposition 12's classification of minimum-weight words as affine- +flat indicators. Chapter 4 now compiles the reviewed finite theory of nonlinearity, higher-order +nonlinearity, resiliency and propagation, linear structures, algebraic immunity, autocorrelation, +maximum correlation, and the remaining complexity criteria. + +One source node remains open: Carlet Proposition 3 still requires the finite-field coordinate and +cyclotomic-orbit noncancellation bridge. Chapter 4 is source-complete. Its last closures are +Rodier's sharp random-nonlinearity interval, the exact dimension-seven maximum, and the sharp +fixed-order higher-order asymptotic upper bound. The latter is exposed through separate formal +nodes for the moment ratio, dual-code weight decomposition, low-weight estimates, the exact +weight-`16` rank-seven classification and character bound, and finite Plotkin propagation. +Strict improvement over +the quadratic bound in every odd dimension above seven follows from a kernel-checked Kavut--Yücel +certificate. The balanced Maitra--Kavut--Yücel family is proved for every odd dimension at least +thirteen; a linear reindexing and complete bent extensions give `PC(1)` witnesses over the same +range; and a Proposition 12 affine-line repair gives balanced degree-`n-1` witnesses for every odd +dimension at least fifteen. + +Two source-fidelity distinctions are explicit in the formalized Chapter 4 surface. Carlet's Reed-- +Muller coset-distance formula needs pairwise distinct cosets (and, for the two-coset corollary, a +non-affine representative). Carlet calls the even-output tuple count `k`th nonhomomorphicity, +whereas reference [357] calls that same count homomorphicity and uses nonhomomorphicity for its +odd-output complement. The production library contains zero `sorry`, project-defined axioms, unsafe declarations, or native proof shortcuts. @@ -89,9 +108,13 @@ Read [`AGENTS.md`](AGENTS.md) for the contributor contract and verification work ## References and prior work +The reader-facing Blueprint generates a sorted References page from the single +[`references.bib`](blueprint-verso/CryptBooleanBlueprint/references.bib) database. Source notes use +the same citation keys, so papers, stable URLs, and DOIs are maintained in one place. + - Claude Carlet, *Boolean Functions for Cryptography and Error Correcting Codes*, 2010. - Thomas W. Cusick and Pantelimon Stănică, *Cryptographic Boolean Functions and Applications*, - second edition, 2009. + second edition, 2017. - Ryan O'Donnell, *Analysis of Boolean Functions*, May 2021 edition, formalized by [FABL](https://github.com/Polarnova/FABL). - [Mathlib](https://github.com/leanprover-community/mathlib4), the mathematical foundation used by diff --git a/blueprint-verso/CryptBooleanBlueprint/BibTeX.lean b/blueprint-verso/CryptBooleanBlueprint/BibTeX.lean new file mode 100644 index 0000000..fb2383d --- /dev/null +++ b/blueprint-verso/CryptBooleanBlueprint/BibTeX.lean @@ -0,0 +1,340 @@ +/- +Copyright (c) 2026 Asher Yan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Asher Yan with Codex +-/ +import Lean +import VersoBlueprint.Cite + +open Lean Elab Command +open Verso.Genre.Manual.Bibliography + +namespace CryptBooleanBlueprint.BibTeX + +/-- A parsed BibTeX entry before conversion to Verso's bibliography model. -/ +structure Entry where + kind : String + key : String + fields : List (String × String) +deriving Repr, Inhabited + +private abbrev Parser := StateT (List Char) (Except String) + +private def trim (value : String) : String := + value.trimAscii.toString + +private def normalizedName (value : String) : String := + (trim value).toLower + +private def isNameChar (char : Char) : Bool := + char.isAlphanum || char == '_' || char == '-' || char == ':' || char == '.' + +private partial def skipTrivia : Parser Unit := do + match ← get with + | [] => pure () + | '%' :: chars => + let chars := chars.dropWhile (· != '\n') + set chars + skipTrivia + | char :: chars => + if char.isWhitespace then + set chars + skipTrivia + +private def peek? : Parser (Option Char) := do + pure (← get).head? + +private def pop : Parser Char := do + match ← get with + | [] => throw "unexpected end of BibTeX input" + | char :: chars => + set chars + pure char + +private def expect (expected : Char) : Parser Unit := do + let actual ← pop + unless actual == expected do + throw s!"expected '{expected}', found '{actual}'" + +private def takeWhile (predicate : Char → Bool) : Parser String := do + let chars ← get + let (taken, suffix) := chars.span predicate + set suffix + pure (String.ofList taken) + +private def identifier : Parser String := do + let value ← takeWhile isNameChar + if value.isEmpty then + throw "expected a BibTeX identifier" + else + pure value + +private def untilDelimiter (delimiter : Char) : Parser String := do + let value ← takeWhile (· != delimiter) + pure (trim value) + +private partial def bracedValueLoop (depth : Nat) (accumulator : List Char) : Parser String := do + match ← pop with + | '{' => bracedValueLoop (depth + 1) ('{' :: accumulator) + | '}' => + if depth == 1 then + pure (String.ofList accumulator.reverse) + else + bracedValueLoop (depth - 1) ('}' :: accumulator) + | '\\' => + let escaped ← pop + bracedValueLoop depth (escaped :: '\\' :: accumulator) + | char => bracedValueLoop depth (char :: accumulator) + +private def bracedValue : Parser String := do + expect '{' + bracedValueLoop 1 [] + +private partial def quotedValueLoop (accumulator : List Char) : Parser String := do + match ← pop with + | '"' => pure (String.ofList accumulator.reverse) + | '\\' => + let escaped ← pop + quotedValueLoop (escaped :: '\\' :: accumulator) + | char => quotedValueLoop (char :: accumulator) + +private def quotedValue : Parser String := do + expect '"' + quotedValueLoop [] + +private def bareValue : Parser String := do + let value ← takeWhile fun char => + char != ',' && char != '}' && char != ')' && char != '#' + let value := trim value + if value.isEmpty then + throw "expected a BibTeX value" + else + pure value + +private def valueAtom : Parser String := do + skipTrivia + match ← peek? with + | some '{' => bracedValue + | some '"' => quotedValue + | some _ => bareValue + | none => throw "unexpected end of BibTeX input while reading a value" + +private partial def value : Parser String := do + let first ← valueAtom + skipTrivia + if (← peek?) == some '#' then + discard pop + let rest ← value + pure (first ++ rest) + else + pure first + +private partial def fields (closing : Char) (accumulator : List (String × String)) : + Parser (List (String × String)) := do + skipTrivia + match ← peek? with + | none => throw s!"unexpected end of BibTeX input; expected '{closing}'" + | some char => + if char == closing then + discard pop + pure accumulator.reverse + else if char == ',' then + discard pop + fields closing accumulator + else + let name := normalizedName (← identifier) + skipTrivia + expect '=' + let fieldValue ← value + fields closing ((name, trim fieldValue) :: accumulator) + +private def entry : Parser Entry := do + skipTrivia + expect '@' + let kind := normalizedName (← identifier) + skipTrivia + let opening ← pop + let closing ← + match opening with + | '{' => pure '}' + | '(' => pure ')' + | _ => throw s!"expected an opening brace or parenthesis after entry type, found '{opening}'" + skipTrivia + let key ← untilDelimiter ',' + if key.isEmpty then + throw "BibTeX entry has an empty citation key" + expect ',' + let parsedFields ← fields closing [] + pure { kind, key, fields := parsedFields } + +private partial def entries (accumulator : List Entry) : Parser (List Entry) := do + skipTrivia + match ← peek? with + | none => pure accumulator.reverse + | some '@' => + let parsed ← entry + if accumulator.any (·.key == parsed.key) then + throw s!"duplicate BibTeX citation key '{parsed.key}'" + entries (parsed :: accumulator) + | some char => throw s!"expected '@' at the start of a BibTeX entry, found '{char}'" + +/-- Parse a BibTeX database containing braced, quoted, bare, and concatenated field values. -/ +def parse (source : String) : Except String (List Entry) := + (entries []).run source.toList |>.map Prod.fst + +private def Entry.field? (entry : Entry) (name : String) : Option String := + entry.fields.find? (fun field => field.1 == normalizedName name) |>.map Prod.snd + +private def Entry.field (entry : Entry) (name : String) : Except String String := + match entry.field? name with + | some value => pure value + | none => throw s!"BibTeX entry '{entry.key}' lacks required field '{name}'" + +private def parseNat (entry : Entry) (fieldName value : String) : Except String Nat := + match (trim value).toNat? with + | some parsed => pure parsed + | none => throw s!"BibTeX entry '{entry.key}' has invalid {fieldName} '{value}'" + +private def parseYear (entry : Entry) : Except String Int := do + pure (Int.ofNat (← parseNat entry "year" (← entry.field "year"))) + +private def parsePages (entry : Entry) (value : String) : Except String (Nat × Nat) := do + let parts := (value.replace "--" "-").splitOn "-" + match parts with + | [first, last] => + pure ( + ← parseNat entry "page" first, + ← parseNat entry "page" last + ) + | _ => throw s!"BibTeX entry '{entry.key}' has invalid pages '{value}'" + +private def parseNames (value : String) : Array String := + (value.splitOn " and ").map trim |>.filter (· != "") |>.toArray + +private def liftExcept : Except String α → CommandElabM α + | .ok value => pure value + | .error message => throwError message + +private def inlineTerm (value : String) : CommandElabM (TSyntax `term) := + `(Verso.Doc.Inline.text $(quote value)) + +private def inlineArrayTerm (values : Array String) : CommandElabM (TSyntax `term) := do + let terms ← values.mapM inlineTerm + `(#[$terms,*]) + +private def optionalInlineTerm (value : Option String) : CommandElabM (TSyntax `term) := + match value with + | none => `(none) + | some value => do + let term ← inlineTerm value + `(some $term) + +private def optionalInlineArrayTerm (value : Option (Array String)) : + CommandElabM (TSyntax `term) := + match value with + | none => `(none) + | some values => do + let term ← inlineArrayTerm values + `(some $term) + +private def Entry.url? (entry : Entry) : Option String := + entry.field? "url" <|> (entry.field? "doi").map (fun doi => s!"https://doi.org/{doi}") + +private def articleTerm (entry : Entry) : CommandElabM (TSyntax `term) := do + let title ← inlineTerm (← liftExcept (entry.field "title")) + let authors ← inlineArrayTerm (parseNames (← liftExcept (entry.field "author"))) + let journal ← inlineTerm (← liftExcept (entry.field "journal")) + let year ← liftExcept (parseYear entry) + let month ← optionalInlineTerm (entry.field? "month") + let volume ← inlineTerm (entry.field? "volume" |>.getD "") + let number ← inlineTerm (entry.field? "number" |>.getD "") + let pages ← liftExcept (entry.field? "pages" |>.mapM (parsePages entry)) + let url := entry.url? + `(Verso.Genre.Manual.Bibliography.Citable.article { + title := $title + authors := $authors + journal := $journal + year := $(quote year) + month := $month + volume := $volume + number := $number + pages := $(quote pages) + url := $(quote url) + }) + +private def proceedingsTerm (entry : Entry) : CommandElabM (TSyntax `term) := do + let title ← inlineTerm (← liftExcept (entry.field "title")) + let authors ← inlineArrayTerm (parseNames (← liftExcept (entry.field "author"))) + let year ← liftExcept (parseYear entry) + let booktitle ← inlineTerm (← liftExcept (entry.field "booktitle")) + let editors ← optionalInlineArrayTerm (entry.field? "editor" |>.map parseNames) + let series ← optionalInlineTerm (entry.field? "series") + let url := entry.url? + `(Verso.Genre.Manual.Bibliography.Citable.inProceedings { + title := $title + authors := $authors + year := $(quote year) + booktitle := $booktitle + editors := $editors + series := $series + url := $(quote url) + }) + +private def bookTerm (entry : Entry) : CommandElabM (TSyntax `term) := do + let title ← inlineTerm (← liftExcept (entry.field "title")) + let authors ← inlineArrayTerm (parseNames (← liftExcept (entry.field "author"))) + let year ← liftExcept (parseYear entry) + let booktitle ← inlineTerm (← liftExcept (entry.field "publisher")) + let seriesValue := + match entry.field? "series", entry.field? "volume" with + | some series, some volume => some s!"{series}, vol. {volume}" + | some series, none => some series + | none, some volume => some s!"vol. {volume}" + | none, none => none + let series ← optionalInlineTerm seriesValue + let url := entry.url? + `(Verso.Genre.Manual.Bibliography.Citable.inProceedings { + title := $title + authors := $authors + year := $(quote year) + booktitle := $booktitle + editors := none + series := $series + url := $(quote url) + }) + +private def citableTerm (entry : Entry) : CommandElabM (TSyntax `term) := + match entry.kind with + | "article" => articleTerm entry + | "incollection" | "inproceedings" => proceedingsTerm entry + | "book" => bookTerm entry + | other => throwError s!"unsupported BibTeX entry type '@{other}' for '{entry.key}'" + +syntax (name := loadBibTeX) "load_bibtex " str : command + +/-- +Parse a `.bib` file relative to the current Lean source and register every entry as a Verso +bibliography declaration. Citation keys must be valid Lean declaration names. +-/ +elab_rules : command + | `(load_bibtex $path:str) => do + let sourcePath := System.FilePath.mk (← getFileName) + let some sourceDirectory := sourcePath.parent + | throwError "cannot determine the directory of '{sourcePath}'" + let bibliographyPath := sourceDirectory / path.getString + let source ← IO.FS.readFile bibliographyPath + let parsed ← + match parse source with + | .ok parsed => pure parsed + | .error message => throwError s!"{bibliographyPath}: {message}" + for parsedEntry in parsed do + let declarationName := parsedEntry.key.toName + if declarationName.isAnonymous then + throwError s!"invalid BibTeX citation key '{parsedEntry.key}'" + let declaration ← citableTerm parsedEntry + let command ← + `(@[bib $(quote parsedEntry.key)] + def $(mkIdent declarationName) : Citable := $declaration) + elabCommand command + +end CryptBooleanBlueprint.BibTeX diff --git a/blueprint-verso/CryptBooleanBlueprint/Blueprint.lean b/blueprint-verso/CryptBooleanBlueprint/Blueprint.lean index 85ab84c..1fdac59 100644 --- a/blueprint-verso/CryptBooleanBlueprint/Blueprint.lean +++ b/blueprint-verso/CryptBooleanBlueprint/Blueprint.lean @@ -7,29 +7,34 @@ import Verso import VersoManual import VersoBlueprint import VersoBlueprint.Commands.Graph +import CryptBooleanBlueprint.Citations import CryptBooleanBlueprint.Carlet.Chapter02 import CryptBooleanBlueprint.Carlet.Chapter03 +import CryptBooleanBlueprint.Carlet.Chapter04 +import CryptBooleanBlueprint.References open Verso.Genre open Verso.Genre.Manual open Informal +open CryptBooleanBlueprint.Sources #doc (Manual) "Cryptographic Boolean Functions in Lean" => [CryptBoolean](https://github.com/Polarnova/CryptBoolean) is a formalization of cryptographic Boolean-function theory in [Lean 4](https://github.com/leanprover/lean4) and [Mathlib](https://github.com/leanprover-community/mathlib4). Its primary mathematical source is -Claude Carlet's *Boolean Functions for Cryptography and Error Correcting Codes*. +Claude Carlet's *Boolean Functions for Cryptography and Error-Correcting Codes* +{Citations.citep carlet2010}[]. -The library develops algebraic representations, Walsh analysis, finite-field representations, and -Reed--Muller coding for scalar Boolean functions. It uses +The library develops algebraic representations, Walsh analysis, finite-field representations, +Reed--Muller coding, and cryptographic criteria for scalar Boolean functions. It uses [FABL](https://github.com/Polarnova/FABL) for Boolean Fourier analysis and records explicit bridges between FABL's normalized Fourier coefficients and Carlet's raw Walsh transform. -This volume contains 43 source-facing mathematical statements: 41 are associated with 180 proved -Lean declarations, while 2 remain visibly open. The dependency graph records 64 reviewed +This volume contains 116 source-facing mathematical statements: 115 are associated with 759 proved +Lean declarations, while one remains visibly open. The dependency graph records 223 reviewed mathematical edges. Chapter 2 develops representations and the Fourier--Walsh interface; Chapter 3 -develops the distance, dimension, and duality theory of Reed--Muller codes. +develops Reed--Muller coding; Chapter 4 develops the scalar criteria used in cryptography. Each entry states the mathematics with explicit domains, hypotheses, quantifiers, and conclusions. Implementation and normalization notes sit outside statement blocks. A source theorem without an @@ -46,8 +51,16 @@ Chapter 2: Generalities on Boolean functions Chapter 3: Boolean functions and coding ::: +:::group "carlet-chapter-4" +Chapter 4: Boolean functions and cryptography +::: + {include 0 CryptBooleanBlueprint.Carlet.Chapter02} {include 0 CryptBooleanBlueprint.Carlet.Chapter03} +{include 0 CryptBooleanBlueprint.Carlet.Chapter04} + +{references} + {blueprint_graph (direction := LR)} diff --git a/blueprint-verso/CryptBooleanBlueprint/Carlet/Chapter03.lean b/blueprint-verso/CryptBooleanBlueprint/Carlet/Chapter03.lean index 7fa66bf..13d67df 100644 --- a/blueprint-verso/CryptBooleanBlueprint/Carlet/Chapter03.lean +++ b/blueprint-verso/CryptBooleanBlueprint/Carlet/Chapter03.lean @@ -15,11 +15,9 @@ open Informal #doc (Manual) "Boolean functions and coding" => Chapter 3 develops the coding-theoretic structure of Boolean functions. Its seven source-facing -nodes contain six formalized results associated with 21 proved Lean declarations and one exact open -statement. The verified surface defines Reed--Muller codes and proves the order-one specialization -and full general-order form of Carlet's Theorem 1, the dimension and cardinality formulas, and -Theorem 2 on duality. Proposition 12's minimum-weight equality classification remains open: it -requires an arbitrary affine-flat normal form, the codimension--degree theorem for affine-flat -indicators, and equality-case slice infrastructure. +nodes are all formalized and associated with 32 proved Lean declarations. The verified surface +defines Reed--Muller codes and proves the order-one specialization and full general-order form of +Carlet's Theorem 1, Proposition 12's complete minimum-weight equality classification, the dimension +and cardinality formulas, and Theorem 2 on duality. {include 0 CryptBooleanBlueprint.Carlet.Chapter03.ReedMuller} diff --git a/blueprint-verso/CryptBooleanBlueprint/Carlet/Chapter03/ReedMuller.lean b/blueprint-verso/CryptBooleanBlueprint/Carlet/Chapter03/ReedMuller.lean index e17ec1a..22dd0fd 100644 --- a/blueprint-verso/CryptBooleanBlueprint/Carlet/Chapter03/ReedMuller.lean +++ b/blueprint-verso/CryptBooleanBlueprint/Carlet/Chapter03/ReedMuller.lean @@ -7,6 +7,7 @@ import Verso import VersoManual import VersoBlueprint import CryptBoolean.Carlet.Chapter03.ReedMullerDuality +import CryptBoolean.Carlet.Chapter03.ReedMullerMinimumWeight open Verso.Genre open Verso.Genre.Manual @@ -74,7 +75,7 @@ Equivalently, every nonzero Boolean function $`h` of algebraic degree at most $`r` satisfies $`w_H(h)\ge2^{n-r}`. ::: -:::proposition "carlet-3-prop-12" (parent := "carlet-chapter-3") (uses := "carlet-3-theorem-1") (tags := "carlet, chapter-3, proposition-12, pages-36-37, source-open") +:::proposition "carlet-3-prop-12" (parent := "carlet-chapter-3") (lean := "CryptBoolean.affineFlatIndicator, CryptBoolean.affineFlatIndicator_apply_eq_one_iff, CryptBoolean.mem_support_affineFlatIndicator, CryptBoolean.IsBinaryAffineSet, CryptBoolean.hammingWeight_affineFlatIndicator, CryptBoolean.functionAlgebraicDegree_affineFlatIndicator, CryptBoolean.degree_eq_and_hammingWeight_eq_affineFlatIndicator, CryptBoolean.eq_affineFlatIndicator_iff_support_eq, CryptBoolean.exists_affineFlatIndicator_of_degree_eq_and_hammingWeight_eq, CryptBoolean.degree_eq_and_hammingWeight_eq_iff_exists_affineFlatIndicator, CryptBoolean.degree_eq_and_hammingWeight_eq_iff_support_is_affineFlat") (uses := "carlet-3-theorem-1") (tags := "carlet, chapter-3, proposition-12, pages-36-37, fidelity-exact") *Proposition 12 (Carlet, pp. 36--37).* Let $`0\le r\le n`. A Boolean function $`f:V_n\to\mathbb F_2` satisfies $$` @@ -86,6 +87,13 @@ if and only if $`f` is the indicator of an $`(n-r)`-dimensional affine subspace of $`V_n`. ::: +Formalization note. The forward proof makes Carlet's equality case explicit through +first-coordinate slices: equality forces the nonzero slices, and when necessary their +difference, to attain the lower bound recursively; their supports then assemble into a +ternary-closed affine set. The reverse proof represents a flat by a basis of its perpendicular +space, bounds the degree of the product of the corresponding affine equations, and uses Theorem 1 +to show that the bound is exact. + :::theorem "carlet-3-reed-muller-dimension" (parent := "carlet-chapter-3") (lean := "CryptBoolean.reedMuller_card, CryptBoolean.reedMuller_finrank") (uses := "carlet-3-reed-muller-code, carlet-2-anf-existence-uniqueness") (tags := "carlet, chapter-3, reed-muller-dimension, page-38, fidelity-exact") *Dimension of the Reed--Muller code (Carlet, p. 38).* For $`0\le r\le n`, $$` diff --git a/blueprint-verso/CryptBooleanBlueprint/Carlet/Chapter04.lean b/blueprint-verso/CryptBooleanBlueprint/Carlet/Chapter04.lean new file mode 100644 index 0000000..872f378 --- /dev/null +++ b/blueprint-verso/CryptBooleanBlueprint/Carlet/Chapter04.lean @@ -0,0 +1,48 @@ +/- +Copyright (c) 2026 Asher Yan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Asher Yan with Codex +-/ +import Verso +import VersoManual +import VersoBlueprint +import CryptBooleanBlueprint.Carlet.Chapter04.Nonlinearity +import CryptBooleanBlueprint.Carlet.Chapter04.HigherOrderNonlinearity +import CryptBooleanBlueprint.Carlet.Chapter04.Resiliency +import CryptBooleanBlueprint.Carlet.Chapter04.LinearStructures +import CryptBooleanBlueprint.Carlet.Chapter04.AlgebraicImmunity +import CryptBooleanBlueprint.Carlet.Chapter04.Autocorrelation +import CryptBooleanBlueprint.Carlet.Chapter04.MaximumCorrelation +import CryptBooleanBlueprint.Carlet.Chapter04.OtherCriteria + +open Verso.Genre +open Verso.Genre.Manual +open Informal + +#doc (Manual) "Boolean functions and cryptography" => + +Chapter 4 contains 73 source-facing nodes. All 73 nodes are associated with 568 proved +declarations. They cover nonlinearity and its Walsh formula, Rodier's sharp random-nonlinearity +interval, general odd-dimensional bounds and exact values in dimensions one, three, five, and +seven, balanced, `PC(1)`, and degree-`n-1` constructions above the quadratic bound, higher-order +lower bounds, the rank-seven weight-sixteen classification, and the sharp fixed-order +higher-order upper bound, +Reed--Muller coset distances, resiliency, propagation criteria, linear structures, algebraic +immunity, autocorrelation indicators, maximum correlation, and scalar complexity criteria. The +chapter has no remaining open statement nodes. + +{include 0 CryptBooleanBlueprint.Carlet.Chapter04.Nonlinearity} + +{include 0 CryptBooleanBlueprint.Carlet.Chapter04.HigherOrderNonlinearity} + +{include 0 CryptBooleanBlueprint.Carlet.Chapter04.Resiliency} + +{include 0 CryptBooleanBlueprint.Carlet.Chapter04.LinearStructures} + +{include 0 CryptBooleanBlueprint.Carlet.Chapter04.AlgebraicImmunity} + +{include 0 CryptBooleanBlueprint.Carlet.Chapter04.Autocorrelation} + +{include 0 CryptBooleanBlueprint.Carlet.Chapter04.MaximumCorrelation} + +{include 0 CryptBooleanBlueprint.Carlet.Chapter04.OtherCriteria} diff --git a/blueprint-verso/CryptBooleanBlueprint/Carlet/Chapter04/AlgebraicImmunity.lean b/blueprint-verso/CryptBooleanBlueprint/Carlet/Chapter04/AlgebraicImmunity.lean new file mode 100644 index 0000000..20c6459 --- /dev/null +++ b/blueprint-verso/CryptBooleanBlueprint/Carlet/Chapter04/AlgebraicImmunity.lean @@ -0,0 +1,86 @@ +/- +Copyright (c) 2026 Asher Yan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Asher Yan with Codex +-/ +import Verso +import VersoManual +import VersoBlueprint +import CryptBoolean.Carlet.Chapter04 + +open Verso.Genre +open Verso.Genre.Manual +open Informal + +#doc (Manual) "Algebraic immunity" => + +:::definition "carlet-4-def-annihilator-algebraic-immunity" (parent := "carlet-chapter-4") (lean := "CryptBoolean.support_mul, CryptBoolean.booleanFunction_mul_self, CryptBoolean.booleanFunction_mul_complement, CryptBoolean.IsAnnihilator, CryptBoolean.annihilatorIdeal, CryptBoolean.mem_annihilatorIdeal_iff, CryptBoolean.isAnnihilator_iff_mem_annihilatorIdeal, CryptBoolean.IsAlgebraicImmunityWitness, CryptBoolean.algebraicImmunityCandidates, CryptBoolean.mem_algebraicImmunityCandidates, CryptBoolean.algebraicImmunityCandidates_nonempty, CryptBoolean.algebraicImmunity, CryptBoolean.algebraicImmunity_le_functionAlgebraicDegree, CryptBoolean.exists_witness_functionAlgebraicDegree_eq_algebraicImmunity, CryptBoolean.IsAnnihilator.comp_affineEquiv, CryptBoolean.IsAlgebraicImmunityWitness.comp_affineEquiv, CryptBoolean.algebraicImmunity_comp_affineEquiv_le, CryptBoolean.algebraicImmunity_comp_affineEquiv") (uses := "carlet-2-anf-existence-uniqueness, carlet-2-def-algebraic-degree, carlet-2-def-support-weight") (tags := "carlet, chapter-4, annihilator, algebraic-immunity, pages-61-62, fidelity-exact") +*Annihilators and algebraic immunity (Carlet, pp. 61--62).* Pointwise +multiplication satisfies +$$` +\operatorname{supp}(fg) +=\operatorname{supp}(f)\cap\operatorname{supp}(g). +` +A nonzero $`g` with $`fg=0` is an annihilator of $`f`; all such +annihilators together with zero form the ideal of multiples of $`f+1`. +Define +$$` +\operatorname{AI}(f)= +\min\{\deg(g):g\ne0,\ fg=0\text{ or }(f+1)g=0\}. +` +Algebraic immunity is invariant under affine equivalence. +::: + +:::theorem "carlet-4-low-degree-relation-equivalence" (parent := "carlet-chapter-4") (lean := "CryptBoolean.exists_lowDegreeRelation_iff_exists_algebraicImmunityWitness") (uses := "carlet-4-def-annihilator-algebraic-immunity") (tags := "carlet, chapter-4, algebraic-immunity, page-62, fidelity-exact") +*Low-degree relation equivalence (Carlet, p. 62).* There exist $`g\ne0` +and $`h` such that +$$` +fg=h, +\qquad \deg(g)\le d, +\qquad \deg(h)\le d +` +if and only if there exists $`q\ne0` of degree at most $`d` such that +$`fq=0` or $`(f+1)q=0`. +::: + +:::theorem "carlet-4-annihilator-linear-system" (parent := "carlet-chapter-4") (lean := "CryptBoolean.extendLowDegreeCoefficients, CryptBoolean.reedMullerAnfEquiv, CryptBoolean.annihilatorEvaluationLinearMap, CryptBoolean.mem_ker_annihilatorEvaluationLinearMap_iff, CryptBoolean.annihilatorEvaluationLinearMap_domain_finrank, CryptBoolean.annihilatorEvaluationLinearMap_codomain_finrank") (uses := "carlet-4-def-annihilator-algebraic-immunity, carlet-2-anf-existence-uniqueness, carlet-2-def-support-weight") (tags := "carlet, chapter-4, annihilator, linear-system, page-62, fidelity-exact-explicit-coefficient-space") +*Annihilator evaluation system (Carlet, p. 62).* A function $`g` of degree +at most $`d` annihilates $`f` exactly when its low-degree ANF coefficient +vector belongs to the kernel of evaluation on $`\operatorname{supp}(f)`. +The homogeneous system has +$$` +\sum_{i=0}^{d}\binom ni +` +unknown coefficients and $`w_H(f)` equations. +::: + +:::theorem "carlet-4-ai-upper-bound" (parent := "carlet-chapter-4") (lean := "CryptBoolean.functionAlgebraicDegree_affineMap_coordinate_le_one_general, CryptBoolean.functionAlgebraicDegree_anfMonomial_comp_affineMap_le_card_general, CryptBoolean.functionAlgebraicDegree_comp_affineMap_le_general, CryptBoolean.algebraicImmunity_comp_surjectiveAffineMap_le, CryptBoolean.algebraicImmunity_le_ceiling_half, CryptBoolean.HasSurjectiveAffineFactorization, CryptBoolean.algebraicImmunity_le_ceiling_half_of_hasSurjectiveAffineFactorization, CryptBoolean.hasSurjectiveAffineFactorization_of_hasSeparatedLinearStructureNormalForm, CryptBoolean.algebraicImmunity_le_ceiling_half_add_one_of_hasSeparatedLinearStructureNormalForm, CryptBoolean.algebraicImmunity_le_ceiling_half_add_one_of_linearKernel_finrank_ge") (uses := "carlet-4-low-degree-relation-equivalence, carlet-4-annihilator-linear-system, carlet-4-prop-14") (tags := "carlet, chapter-4, algebraic-immunity, upper-bound, page-62, fidelity-exact-surjective-factorization-generalization") +*Upper bounds on algebraic immunity (Carlet, p. 62).* Every +$`f:V_n\to\mathbb F_2` satisfies +$$` +\operatorname{AI}(f)\le\left\lceil\frac n2\right\rceil. +` +If $`f` is affinely equivalent to a function on only $`k` variables, then +$`\operatorname{AI}(f)\le\lceil k/2\rceil`. If +$`\dim\ker_{\mathrm{lin}}(f)=n-k`, then +$`\operatorname{AI}(f)\le\lceil k/2+1\rceil`. +::: + +Formalization note. Depending on at most $`k` affine coordinates is +represented by factorization through a surjective affine map to $`V_k`. The +linear-kernel theorem is slightly stronger in its hypothesis form: a contained +tail subspace of the stated dimension suffices, so equality of kernel dimension +is an immediate specialization. + +:::definition "carlet-4-fast-algebraic-optimality" (parent := "carlet-chapter-4") (lean := "CryptBoolean.two_pow_lt_sum_choose_add_sum_choose_of_add_ge, CryptBoolean.sum_choose_add_sum_choose_gt_iff, CryptBoolean.fastAlgebraicRelationLinearMap, CryptBoolean.exists_fastAlgebraicRelation_of_add_ge, CryptBoolean.IsFastAlgebraicallyOptimal, CryptBoolean.isFastAlgebraicallyOptimal_iff_no_lowDegreeRelation, CryptBoolean.algebraicImmunity_le_degree_of_mul_eq_of_ne_zero") (uses := "carlet-4-def-annihilator-algebraic-immunity, carlet-4-annihilator-linear-system") (tags := "carlet, chapter-4, fast-algebraic, page-63, fidelity-exact") +*Optimality against fast algebraic relations (Carlet, p. 63).* If +$$` +\sum_{i=0}^{e}\binom ni+ +\sum_{i=0}^{d}\binom ni>2^n, +` +equivalently $`e+d\ge n`, then there exist $`g\ne0` and $`h` with +$`fg=h`, $`\deg(g)\le e`, and $`\deg(h)\le d`. The function $`f` is optimal +against such relations when none exists with +$`\deg(g)+\deg(h) + +:::definition "carlet-4-def-autocorrelation-indicators" (parent := "carlet-chapter-4") (lean := "CryptBoolean.sumOfSquaresIndicator, CryptBoolean.absoluteIndicator, CryptBoolean.booleanDerivative_comp_affineEquiv, CryptBoolean.autocorrelation_comp_affineEquiv, CryptBoolean.sumOfSquaresIndicator_comp_affineEquiv, CryptBoolean.absoluteIndicator_comp_affineEquiv, CryptBoolean.absoluteIndicator_zero_dimension") (uses := "carlet-2-def-autocorrelation") (tags := "carlet, chapter-4, relation-38, autocorrelation, page-64, fidelity-exact-with-zero-dimensional-convention") +*Relation (38) (Carlet, p. 64).* Define the sum-of-squares indicator and +absolute indicator by +$$` +\mathcal V(f)=\sum_{e\in V_n}\Delta_f(e)^2, +\qquad +\Delta(f)=\max_{e\ne0}|\Delta_f(e)|. +` +Both quantities are invariant under affine equivalence. +::: + +:::theorem "carlet-4-autocorrelation-indicator-bounds" (parent := "carlet-chapter-4") (lean := "CryptBoolean.autocorrelation_zero, CryptBoolean.sumOfSquaresIndicator_lower_bound, CryptBoolean.sumOfSquaresIndicator_eq_two_pow_iff, CryptBoolean.absoluteIndicator_sq_lower_bound, CryptBoolean.absoluteIndicator_lower_bound, CryptBoolean.autocorrelation_sq_of_mem_linearKernel, CryptBoolean.sumOfSquaresIndicator_lower_bound_linearKernel, CryptBoolean.sumOfSquaresIndicator_lower_bound_of_finrank_eq") (uses := "carlet-4-def-autocorrelation-indicators, carlet-4-def-linear-kernel, carlet-2-balanced-zero-walsh") (tags := "carlet, chapter-4, autocorrelation, indicators, pages-64-65, fidelity-exact") +*Bounds for autocorrelation indicators (Carlet, pp. 64--65).* One has +$$` +\mathcal V(f)\ge2^{2n}, +\qquad +\Delta(f)\ge +\sqrt{\frac{\mathcal V(f)-2^{2n}}{2^n-1}}. +` +The second inequality is asserted for $`n>0`. +Equality $`\mathcal V(f)=2^{2n}` holds exactly when every nonzero derivative +is balanced. If $`\dim\ker_{\mathrm{lin}}(f)=k`, then +$`\mathcal V(f)\ge2^{2n+k}`. +::: + +:::theorem "carlet-4-second-derivative-sum" (parent := "carlet-chapter-4") (lean := "CryptBoolean.secondBooleanDerivative, CryptBoolean.secondBooleanDerivative_apply, CryptBoolean.sumOfSquaresIndicator_eq_sum_secondBooleanDerivative") (uses := "carlet-4-def-autocorrelation-indicators, carlet-2-rel-26-total-autocorrelation") (tags := "carlet, chapter-4, second-derivative, page-65, fidelity-exact") +*Second-derivative expression for the indicator (Carlet, p. 65).* With +$$` +D_aD_ef(x)=f(x)+f(x+a)+f(x+e)+f(x+a+e), +` +one has +$$` +\mathcal V(f)=\sum_{a,e\in V_n}\mathcal F(D_aD_ef), +` +where $`\mathcal F(h)=\sum_x(-1)^{h(x)}`. +::: + +:::theorem "carlet-4-rel-39-fourth-walsh-moment" (parent := "carlet-chapter-4") (lean := "CryptBoolean.sum_walshTransform_sq_mul_add_sq_eq, CryptBoolean.sum_walshTransform_fourth_eq_two_pow_mul_sumOfSquaresIndicator") (uses := "carlet-4-def-autocorrelation-indicators, carlet-2-rel-25-wiener-khinchin, carlet-2-rel-22-plancherel") (tags := "carlet, chapter-4, relation-39, fourth-moment, pages-65-66, fidelity-exact") +*Relation (39) (Carlet, pp. 65--66).* For every $`a\in V_n`, +$$` +\sum_{e\in V_n}W_f(e)^2W_f(a+e)^2 +=2^n\sum_{e\in V_n}\Delta_f(e)^2(-1)^{e\mathbin\cdot a}. +` +In particular, +$$` +\sum_{e\in V_n}W_f(e)^4=2^n\mathcal V(f). +` +::: + +:::theorem "carlet-4-indicator-nonlinearity-spectral-support" (parent := "carlet-chapter-4") (lean := "CryptBoolean.HasPlateauedWalshSpectrum, CryptBoolean.abs_walshTransform_le_maxWalshMagnitude, CryptBoolean.sum_walshTransform_fourth_le_sum_sq_mul_maxWalshMagnitude_sq, CryptBoolean.sum_walshTransform_fourth_le_two_pow_mul_maxWalshMagnitude_fourth, CryptBoolean.sumOfSquaresIndicator_div_two_pow_le_maxWalshMagnitude_sq, CryptBoolean.sumOfSquaresIndicator_le_maxWalshMagnitude_fourth, CryptBoolean.inv_sqrt_two_pow_mul_sqrt_sumOfSquaresIndicator_le_maxWalshMagnitude, CryptBoolean.rpow_one_fourth_sumOfSquaresIndicator_le_maxWalshMagnitude, CryptBoolean.nonlinearity_cast_le_sqrt_sumOfSquaresIndicator_bound, CryptBoolean.nonlinearity_cast_le_fourthRoot_sumOfSquaresIndicator_bound, CryptBoolean.sum_walshTransform_fourth_eq_sum_sq_mul_maxWalshMagnitude_sq_iff_plateaued, CryptBoolean.sum_walshTransform_fourth_eq_two_pow_mul_maxWalshMagnitude_fourth_iff_flat, CryptBoolean.nonlinearity_cast_eq_sqrt_sumOfSquaresIndicator_bound_iff_plateaued, CryptBoolean.nonlinearity_cast_eq_fourthRoot_sumOfSquaresIndicator_bound_iff_bent, CryptBoolean.two_pow_three_mul_n_le_sumOfSquaresIndicator_mul_card_walshSupport, CryptBoolean.sumOfSquaresIndicator_mul_card_walshSupport_eq_two_pow_three_mul_n_iff_plateaued") (uses := "carlet-4-def-nonlinearity, carlet-4-rel-39-fourth-walsh-moment, carlet-2-parseval, carlet-2-spectral-support-bounds, carlet-4-rel-36-covering-radius-bent") (tags := "carlet, chapter-4, autocorrelation, nonlinearity, plateaued, pages-65-66, fidelity-exact-equality-cases") +*Indicator, nonlinearity, and Walsh-support bounds (Carlet, pp. 65--66).* +The fourth-moment identities imply +$$` +\operatorname{nl}(f) +\le2^{n-1}-2^{-n/2-1}\sqrt{\mathcal V(f)} +\le2^{n-1}-\frac12\mathcal V(f)^{1/4}. +` +If $`N_W=|\operatorname{supp}(W_f)|`, then +$$` +\mathcal V(f)N_W\ge2^{3n}. +` +Equality in the first nonlinearity bound or in the product bound occurs +exactly when all nonzero Walsh values have one common magnitude; equality in +the fourth-root bound occurs exactly for bent functions. +::: diff --git a/blueprint-verso/CryptBooleanBlueprint/Carlet/Chapter04/HigherOrderNonlinearity.lean b/blueprint-verso/CryptBooleanBlueprint/Carlet/Chapter04/HigherOrderNonlinearity.lean new file mode 100644 index 0000000..331ec95 --- /dev/null +++ b/blueprint-verso/CryptBooleanBlueprint/Carlet/Chapter04/HigherOrderNonlinearity.lean @@ -0,0 +1,495 @@ +/- +Copyright (c) 2026 Asher Yan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Asher Yan with Codex +-/ +import Verso +import VersoManual +import VersoBlueprint +import CryptBooleanBlueprint.Citations +import CryptBoolean.Carlet.Chapter04.HigherOrderNonlinearity +import CryptBoolean.Carlet.Chapter04.HigherOrderJuntaDistance +import CryptBoolean.Carlet.Chapter04.HigherOrderGeneralBounds +import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwo +import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightEight +import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightTwelveClassification +import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightFourteenClassification +import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoLowWeightSpectrum +import CryptBoolean.Carlet.Chapter04.HigherOrderTupleCountDifferences +import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoMomentDifference +import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoAsymptotics +import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightSixteenOrbitAggregation +import CryptBoolean.Carlet.Chapter03.ReedMullerWeightSixteenSelfDual + +open Verso.Genre +open Verso.Genre.Manual +open Informal + +#doc (Manual) "Higher-order nonlinearity" => + +:::definition "carlet-4-def-higher-order-nonlinearity" (parent := "carlet-chapter-4") (lean := "CryptBoolean.higherOrderNonlinearity, CryptBoolean.nonlinearity_eq_higherOrderNonlinearity_one, CryptBoolean.higherOrderNonlinearity_le_hammingDistance, CryptBoolean.exists_reedMuller_hammingDistance_eq_higherOrderNonlinearity, CryptBoolean.higherOrderNonlinearity_antitone") (uses := "carlet-3-reed-muller-code, carlet-2-def-hamming-distance") (tags := "carlet, chapter-4, higher-order-nonlinearity, pages-53-54, fidelity-exact-with-derived-laws") +*Higher-order nonlinearity (Carlet, pp. 53--54).* For $`0\le r +2^{n-1}-\sqrt{2^{n-1}\sum_{i=0}^{r}\binom ni}. +` +::: + +:::lemma_ "carlet-4-higher-order-plotkin-induction" (parent := "carlet-chapter-4") (lean := "CryptBoolean.maximumHigherOrderNonlinearity, CryptBoolean.higherOrderNonlinearity_le_maximum, CryptBoolean.exists_higherOrderNonlinearity_eq_maximum, CryptBoolean.maximumHigherOrderNonlinearity_succ_le, CryptBoolean.maximumHigherOrderNonlinearity_self, CryptBoolean.maximumHigherOrderNonlinearity_le_sum_Ico, CryptBoolean.maximumHigherOrderNonlinearity_cast_le_sum_Ico_of_le, CryptBoolean.maximumHigherOrderNonlinearity_cast_le_carlet_step") (uses := "carlet-4-def-higher-order-nonlinearity") (tags := "project-bridge, carlet, chapter-4, higher-order-nonlinearity, plotkin-recurrence, reference-91, fidelity-exact-finite-core") +*Project bridge: finite Plotkin induction for the cited upper bound.* Define +$`\rho(r,n)=\max_f\operatorname{nl}_r(f)`. For $`1\le r\le n`, +$$` +\rho(r,n)\le\sum_{j=r}^{n-1}\rho(r-1,j). +` +More generally, if throughout this range +$$` +\rho(r-1,j)\le 2^{j-1}-A(\sqrt2)^j+e(j), +` +then +$$` +\rho(r,n)\le +\frac{2^n-2^r}{2} +-A(1+\sqrt2)\big((\sqrt2)^n-(\sqrt2)^r\big) ++\sum_{j=r}^{n-1}e(j). +` +::: + +Formalization note. The proof constructs the Plotkin approximant from the two +coordinate slices and then evaluates the two finite geometric sums exactly. +Thus the cited sharp constant reduces to the order-two covering-radius +theorem. + +## Proof architecture of the sharp upper bound + +The argument below is organized as a chain of mathematical interfaces rather +than as one monolithic calculation. First, the correlation-moment ratio turns +a lower bound for two consecutive even moments into an upper bound for the +order-two covering radius. Character orthogonality then rewrites those moments +as signed counts of words in the dual Reed--Muller code, and finite Fourier +inversion groups the counts by Hamming weight. The difference of the seventh +and eighth moments is supported only at weights $`0,8,12,14,16`; separate +geometric or classification arguments bound the character sum at each weight. +The resulting moment inequality gives the sharp $`\sqrt{15}/2` order-two +coefficient, and the Plotkin recurrence propagates it to every fixed order +$`r\ge2`, multiplying it by $`1+\sqrt2` at each step. + +The weight-sixteen branch is the only exceptional part of this spine. Its +rank-seven words are normalized through an augmented self-dual +$`[16,8,\ge4]` code, classified into the three affine orbits $`2E_8`, +$`D_{16}^{+}`, and $`F_{16}`, and controlled by an orbit-wise sum-of-squares +identity. Words of affine-span rank at most six are handled by a separate +rank-deficient affine-mask cover. Adding these two estimates supplies the +single weight-sixteen character bound consumed by the moment argument; no +later analytic step depends on the details of the finite classification. + +More explicitly, the exceptional branch factors through the following +mathematical interfaces. + +1. Orthogonality to $`R(2,n)` bounds the affine-span dimension of a + weight-sixteen support by seven and, in dimension seven, produces an + augmented self-dual $`[16,8,\ge4]` code. +2. Choosing a support point and seven genuine support differences identifies + the full-rank support with a systematic sixteen-point subset of $`V_7`; + its quadratic parity constraints are precisely those inherited from the + dual Reed--Muller condition. +3. The systematic constraints classify the normalized support into one of + the three canonical patterns. Affine composition transports that + classification back to $`V_n`, and pairwise orbit disjointness makes the + three alternatives unique. +4. For each canonical pattern, a nonnegative complete affine-map sum is split + into injective and rank-deficient maps. Counting the latter and then + dividing by the common positive fiber size gives the lower bound for the + corresponding set of distinct image words. +5. If the affine-span dimension is at most six, a padded basis realizes the + support as the image of a mask on $`V_7` under a rank-deficient affine map. + Counting maps and masks bounds both the residual family and its character + loss. +6. The exact rank-seven/residual partition adds the three orbit estimates and + the residual estimate. This is the sole weight-sixteen input to the + seventh/eighth moment inequality. + +:::lemma_ "carlet-4-higher-order-order-two-moment-ratio" (parent := "carlet-chapter-4") (lean := "CryptBoolean.orderTwoCorrelation, CryptBoolean.orderTwoCorrelation_eq_two_pow_sub_two_hammingDistance, CryptBoolean.maximumOrderTwoCorrelation, CryptBoolean.maximumOrderTwoCorrelation_eq, CryptBoolean.orderTwoCorrelation_le_maximum, CryptBoolean.exists_orderTwoCorrelation_eq_maximum, CryptBoolean.maximumOrderTwoCorrelation_nonneg, CryptBoolean.abs_orderTwoCorrelation_le_maximum, CryptBoolean.orderTwoCorrelationPowerSum, CryptBoolean.orderTwoCorrelationPowerSum_nonneg, CryptBoolean.orderTwoCorrelationPowerSum_pos, CryptBoolean.orderTwoCorrelationPowerSum_succ_le, CryptBoolean.sqrt_orderTwoCorrelationPowerSum_ratio_le, CryptBoolean.minimumOrderTwoMomentRatio, CryptBoolean.maximumHigherOrderNonlinearity_two_cast_le_momentRatio") (uses := "carlet-4-def-higher-order-nonlinearity, carlet-4-rel-35-nonlinearity-walsh, carlet-2-parseval") (tags := "project-bridge, carlet, chapter-4, higher-order-nonlinearity, order-two, moment-method, reference-91, fidelity-exact-finite-core") +*Project bridge: second-order correlation moment ratio.* For +$`f:V_n\to\mathbb F_2` and $`g\in R(2,n)`, put +$$` +C_f(g)=2^n-2d_H(f,g), +\qquad +S_k(f)=\sum_{g\in R(2,n)} C_f(g)^{2k}. +` +Then $`S_k(f)>0` and +$$` +\sqrt{\frac{S_{k+1}(f)}{S_k(f)}} +\le 2^n-2\operatorname{nl}_2(f). +` +Consequently, if $`\rho(2,n)=\max_f\operatorname{nl}_2(f)` and +$`\mu_{k,n}=\min_f\sqrt{S_{k+1}(f)/S_k(f)}`, then +$$` +\rho(2,n)\le 2^{n-1}-\frac{\mu_{k,n}}2. +` +::: + +Formalization note. Relations (9.7)--(9.10) of the cited Carlet--Mesnager +argument reduce the sharp order-two bound to a uniform lower estimate for +consecutive even correlation moments. The low-weight dual Reed--Muller +classification supplies that estimate through the subsequent weight-by-weight +decomposition. + +:::lemma_ "carlet-4-higher-order-order-two-dual-moment-decomposition" (parent := "carlet-chapter-4") (lean := "CryptBoolean.tuplePointParity, CryptBoolean.booleanFunctionPairing_tuplePointParity, CryptBoolean.orderTwoAdmissibleTuples, CryptBoolean.reedMullerTwoPairingCharacterSum, CryptBoolean.reedMullerTwoPairingCharacterSum_eq_card_of_mem_dual, CryptBoolean.reedMullerTwoPairingCharacterSum_eq_zero_of_not_mem_dual, CryptBoolean.orderTwoCorrelationPowerSum_eq_admissibleTupleCharacterSum") (uses := "carlet-4-higher-order-order-two-moment-ratio, carlet-3-theorem-2") (tags := "project-bridge, carlet, chapter-4, higher-order-nonlinearity, order-two, dual-code, moment-decomposition, reference-91, fidelity-exact-finite-core") +*Project bridge: dual-code decomposition of second-order correlation moments.* +For an ordered $`2k`-tuple $`x=(x_i)` of points of $`V_n`, let $`p_x` be +the Boolean function recording the parity of the multiplicity of each point, +and let +$$` +U_{k,n}=\{x:p_x\in R(n-3,n)\}. +` +If $`n\ge3`, then +$$` +S_k(f)=|R(2,n)| +\sum_{x\in U_{k,n}}(-1)^{\langle f,p_x\rangle}. +` +::: + +Formalization note. Expanding the even power gives ordered tuples. Character +orthogonality over $`R(2,n)` leaves exactly its dual, and Chapter 3 duality +identifies that code with $`R(n-3,n)`. This is Carlet--Mesnager Lemma 9.2.2; +the subsequent grouping by low dual weights remains separate. + +:::lemma_ "carlet-4-higher-order-order-two-weight-grouping" (parent := "carlet-chapter-4") (lean := "CryptBoolean.orderTwoDualWords, CryptBoolean.tuplePointParityFiber, CryptBoolean.tuplePointParityMultiplicity, CryptBoolean.tuplePointParityMultiplicity_comp_perm, CryptBoolean.tuplePointParityMultiplicity_eq_of_hammingWeight_eq, CryptBoolean.tuplePointParityMultiplicityByWeight, CryptBoolean.tuplePointParityMultiplicity_eq_byWeight, CryptBoolean.tuplePointParityMultiplicityByWeight_eq_fourierSum, CryptBoolean.tuplePointParityKrawtchoukMultiplicity, CryptBoolean.tuplePointParityMultiplicityByWeight_eq_krawtchoukSum, CryptBoolean.orderTwoCorrelationPowerSum_eq_dualWeightGroupedCharacterSum, CryptBoolean.orderTwoCorrelationPowerSum_eq_dualFourierMultiplicityCharacterSum, CryptBoolean.orderTwoCorrelationPowerSum_eq_dualKrawtchoukMultiplicityCharacterSum") (uses := "carlet-4-higher-order-order-two-dual-moment-decomposition") (tags := "project-bridge, carlet, chapter-4, higher-order-nonlinearity, order-two, dual-code, weight-grouping, krawtchouk, reference-91, fidelity-exact-finite-core") +*Project bridge: weight grouping and finite inversion of tuple multiplicities.* +Let $`N_k(w)` be the number of ordered $`2k`-tuples whose point-parity word +is a prescribed Boolean function of Hamming weight $`w`. This number depends +only on $`w`, and +$$` +N_k(w)=2^{-2^n}\sum_{j=0}^{2^n} +K_j^{(2^n)}(w)(2^n-2j)^{2k}, +` +where $`K_j^{(2^n)}` is the binary Krawtchouk polynomial. Consequently the +dual-code moment decomposition can be grouped by dual words and then by their +Hamming weights using these exact multiplicities. +::: + +Formalization note. Permuting the Boolean cube identifies all tuple-parity +fibers of equal weight. Character orthogonality on the full Boolean-function +group gives finite Fourier inversion, and FABL's Krawtchouk API groups the +Fourier sum by Hamming weight. This is the finite form of Carlet--Mesnager +Proposition 9.2.5 and Lemma 9.2.7. + +:::lemma_ "carlet-4-higher-order-order-two-low-weight-support" (parent := "carlet-chapter-4") (lean := "CryptBoolean.hasOrderTwoLowWeightSpectrum, CryptBoolean.tuplePointParityMultiplicityByWeight_eq_zero_of_lt, CryptBoolean.tuplePointParityMomentDifference_eq_zero_of_sixteen_lt, CryptBoolean.orderTwoMomentDifferenceCharacterSum_eq_lowWeights") (uses := "carlet-4-higher-order-order-two-weight-grouping, carlet-3-theorem-1") (tags := "project-bridge, carlet, chapter-4, higher-order-nonlinearity, order-two, dual-code, low-weight-spectrum, reference-91, fidelity-exact-finite-core") +*Project bridge: support of the seventh/eighth moment difference.* Let +$`h\in R(n-3,n)` and $`n\ge7`. Among even weights at most $`16`, the only +possibilities are +$$` +0,\ 8,\ 12,\ 14,\ 16. +` +Moreover, a point-parity multiplicity for ordered $`2k`-tuples vanishes +when $`w>2k`. Hence the coefficient of $`h` in +$`S_8(f)-15\cdot2^nS_7(f)` vanishes for $`w>16`, so this moment difference +is supported only at the five displayed weights. +::: + +Formalization note. The minimum-distance theorem excludes weights below +eight and the codimension-three spectrum excludes weight ten; tuple support +alone removes weights above sixteen. This is the finite support reduction +used before the individual low-weight estimates in +{Citations.citet carletMesnager2007}[]. + +:::lemma_ "carlet-4-higher-order-order-two-weight-eight-bound" (parent := "carlet-chapter-4") (lean := "CryptBoolean.orderTwoWeightEightDualWords_eq_affineFlatIndicators, CryptBoolean.orderTwoWeightEightCharacterSum_eq_affineFlatCharacterSum, CryptBoolean.card_binaryAffineFlats_two, CryptBoolean.binaryAffineFlatCharacterSum_three_ge_neg_card, CryptBoolean.binaryAffineFlatCharacterSum_three_ge, CryptBoolean.orderTwoWeightEightCharacterSum_ge") (uses := "carlet-4-higher-order-order-two-low-weight-support, carlet-3-prop-12") (tags := "project-bridge, carlet, chapter-4, higher-order-nonlinearity, order-two, dual-code, weight-eight, affine-flats, reference-91, fidelity-exact-finite-core") +*Project bridge: weight-eight dual character bound.* For $`n\ge3`, the +weight-eight words of $`R(n-3,n)` are precisely the indicators of affine +three-flats. If +$$` +M_8(f)=\sum_{\substack{h\in R(n-3,n)\\\operatorname{wt}(h)=8}} +(-1)^{\langle f,h\rangle}, +` +then +$$` +M_8(f)\ge +-\frac{2^n(2^n-1)(2^n-2)}{336}. +` +::: + +Formalization note. Proposition 12 supplies the affine-flat normal form. +The character sum over parallel affine two-flat pairs is a square; removing +the diagonal leaves the stated lower bound. This is +Carlet--Mesnager Proposition 9.2.10(1) +{Citations.citep carletMesnager2007}[]. + +:::lemma_ "carlet-4-higher-order-order-two-weight-twelve-bound" (parent := "carlet-chapter-4") (lean := "CryptBoolean.hasWeightTwelveFlatPairClassification, CryptBoolean.weightTwelveRepresentationCharacterSum_ge, CryptBoolean.orderTwoWeightTwelveCharacterSum_eq_representation, CryptBoolean.orderTwoWeightTwelveCharacterSum_ge") (uses := "carlet-4-higher-order-order-two-low-weight-support, carlet-3-theorem-2") (tags := "project-bridge, carlet, chapter-4, higher-order-nonlinearity, order-two, dual-code, weight-twelve, affine-flats, reference-91, fidelity-exact-finite-core") +*Project bridge: weight-twelve dual character bound.* For $`n\ge5`, every +weight-twelve word of $`R(n-3,n)` has exactly twenty ordered +representations as the sum of two affine three-flat indicators whose +intersection is an affine line. Consequently, with +$$` +M_{12}(f)=\sum_{\substack{h\in R(n-3,n)\\\operatorname{wt}(h)=12}} +(-1)^{\langle f,h\rangle}, +` +one has +$$` +M_{12}(f)\ge-\frac{(2^n)^5}{20}. +` +::: + +Formalization note. The exact fiber size converts the word sum into a +normalized affine-flat representation sum. The unrestricted sum is a sum of +squares indexed by affine lines; the excluded nontransverse configurations +inject into five ambient vectors. The low-weight classification follows the +Kasami--Tokura analysis +{Citations.citep kasamiTokura1970, kasamiTokuraAzumi1976}[]. + +:::lemma_ "carlet-4-higher-order-order-two-weight-fourteen-bound" (parent := "carlet-chapter-4") (lean := "CryptBoolean.hasWeightFourteenFlatPairClassification, CryptBoolean.weightFourteenRepresentationCharacterSum_ge, CryptBoolean.orderTwoWeightFourteenCharacterSum_eq_representation, CryptBoolean.orderTwoWeightFourteenCharacterSum_ge") (uses := "carlet-4-higher-order-order-two-low-weight-support, carlet-3-theorem-2") (tags := "project-bridge, carlet, chapter-4, higher-order-nonlinearity, order-two, dual-code, weight-fourteen, affine-flats, reference-91, fidelity-exact-finite-core") +*Project bridge: weight-fourteen dual character bound.* Every +weight-fourteen word of $`R(n-3,n)` is the sum of two affine three-flat +indicators meeting in one point, with exactly the two ordered +representations obtained by exchanging the flats. Therefore +$$` +M_{14}(f)=\sum_{\substack{h\in R(n-3,n)\\\operatorname{wt}(h)=14}} +(-1)^{\langle f,h\rangle} +\ge-\frac{(2^n)^6}{2}. +` +::: + +Formalization note. The complete ordered-pair sum at each base point is a +square. Nontransverse pairs inject into five ambient vectors, and the exact +two-element representation fiber transfers the resulting bound to distinct +dual words. The classification is the relevant Kasami--Tokura low-weight +case {Citations.citep kasamiTokura1970, kasamiTokuraAzumi1976}[]. + +:::lemma_ "carlet-4-higher-order-order-two-weight-sixteen-rank-reduction" (parent := "carlet-chapter-4") (lean := "CryptBoolean.finrank_supportDifferenceSpan_le_seven_of_weight_sixteen, CryptBoolean.exists_supportDifferenceBasis_of_finrank_eq, CryptBoolean.augmentedSupportDifferenceCode_le_perpendicular, CryptBoolean.four_le_binaryVectorWeight_of_mem_augmentedSupportDifferenceCode, CryptBoolean.finrank_augmentedSupportDifferenceCode_eq_eight, CryptBoolean.augmentedSupportDifferenceCode_eq_perpendicular") (uses := "carlet-4-higher-order-order-two-low-weight-support, carlet-3-theorem-2") (tags := "project-bridge, carlet, chapter-4, higher-order-nonlinearity, order-two, dual-code, weight-sixteen, self-dual-code, affine-span, reference-91, fidelity-exact-finite-core") +*Project bridge: rank reduction and the augmented self-dual code.* Let +$`h\in R(n-3,n)` have weight $`16`, and choose $`p\in\operatorname{supp}(h)`. +Then the affine span of the support differences has dimension at most seven. +Whenever this dimension is $`r`, one can choose $`r` actual support +differences that form a basis of the span. +If its dimension is seven, adjoining the constant coordinate to affine +evaluation on the sixteen support points produces a binary self-dual code +of length $`16`, dimension $`8`, and minimum distance at least $`4`. +::: + +Formalization note. Orthogonality to $`R(2,n)` gives self-orthogonality of +the augmented evaluation code; the full-span rank calculation upgrades this +to self-duality. A basis is then extracted from the genuine support +differences spanning the direction space. Thus the rank-seven branch reduces +to the classification of +projective binary self-dual $`[16,8,\ge4]` codes, whose three types are +described in {Citations.citet pless1972}[] and surveyed by +{Citations.citet rainsSloane1998}[]. + +:::lemma_ "carlet-4-higher-order-order-two-weight-sixteen-rank-seven-classification" (parent := "carlet-chapter-4") (lean := "CryptBoolean.rankSevenWeightSixteenPatternCertificate, CryptBoolean.hasRankSevenWeightSixteenOrbitClassification") (uses := "carlet-4-higher-order-order-two-weight-sixteen-rank-reduction") (tags := "project-bridge, carlet, chapter-4, higher-order-nonlinearity, order-two, dual-code, weight-sixteen, rank-seven, finite-classification, fidelity-exact") +*Project bridge: rank-seven weight-sixteen classification.* A weight-sixteen +word $`h\in R(n-3,n)` whose support has affine-span dimension seven is an +injective affine image of exactly one of the three canonical sixteen-point +patterns $`2E_8`, $`D_{16}^{+}`, and $`F_{16}`. Conversely, every such image +has weight sixteen, belongs to $`R(n-3,n)`, and has support-affine-span +dimension seven; the three affine orbits are pairwise disjoint. +::: + +Formalization note. Choosing a support point and a basis of genuine support +differences gives an affine embedding of a normalized sixteen-point set in +$`V_7`. The quadratic dual-code constraints become systematic parity +conditions on that set. Their three solutions, transported back by affine +composition, agree with the complete classification in +{Citations.citet mesnagerOblaukhov2022}[] and with the self-dual code types in +{Citations.citet pless1972, rainsSloane1998}[]. + +:::lemma_ "carlet-4-higher-order-order-two-weight-sixteen-orbit-sos" (parent := "carlet-chapter-4") (lean := "CryptBoolean.rankSevenWeightSixteenPatternAffineProduct, CryptBoolean.rankSevenWeightSixteenPatternCompleteAffineMapCharacterSum, CryptBoolean.rankSevenWeightSixteenPatternCompleteAffineMapCharacterSum_nonneg, CryptBoolean.rankSevenWeightSixteenInjectiveAffineMapData, CryptBoolean.rankSevenWeightSixteenInjectiveAffineMapCharacterSum_ge, CryptBoolean.rankSevenWeightSixteenPatternOrbitWords, CryptBoolean.rankSevenWeightSixteenPatternOrbitCharacterSum, CryptBoolean.rankSevenWeightSixteenPatternOrbitCharacterSum_ge") (tags := "project-bridge, carlet, chapter-4, higher-order-nonlinearity, order-two, dual-code, weight-sixteen, orbit-sum, sum-of-squares, fidelity-exact-finite-core") +*Project bridge: nonnegative affine-map sums for rank-seven patterns.* Let +$`\sigma:V_n\to\{-1,1\}`. For each +$`c\in\{2E_8,D_{16}^{+},F_{16}\}`, the sum over all affine maps +$`A:V_7\to V_n` of +$$` +\prod_{x\in c}\sigma(Ax) +` +is nonnegative. Restricting to injective affine maps and then to distinct +image words gives, for every $`f:V_n\to\mathbb F_2`, +$$` +\sum_{h\in\mathcal O_c}(-1)^{\langle f,h\rangle} +\ge-127(2^n)^7. +` +::: + +Formalization note. The $`2E_8` sum is a square, the $`D_{16}^{+}` sum is a +sum of squares after a fourfold convolution, and the $`F_{16}` sum is a +nonnegative four-cycle trace. Splitting the complete sum into injective and +rank-deficient maps loses at most $`127(2^n)^7`, since every character product +is at most one. Postcomposition by affine automorphisms identifies the fibers +over distinct injective images and gives them one common positive cardinality; +division by this cardinality yields the orbit bound. This is the repaired +orbit-level substitute for the overextended disjoint-three-flat step in +{Citations.citet carletMesnager2007}[]. + +:::lemma_ "carlet-4-higher-order-order-two-weight-sixteen-residual-cover" (parent := "carlet-chapter-4") (lean := "CryptBoolean.sevenVariableAffineMaskWord, CryptBoolean.rankDeficientSevenVariableAffineMaskImageWords, CryptBoolean.card_rankDeficientSevenVariableAffineMaskImageWords_le, CryptBoolean.HasRankAtMostSixWeightSixteenDeficientAffineMaskCover, CryptBoolean.hasRankAtMostSixWeightSixteenDeficientAffineMaskCover, CryptBoolean.orderTwoWeightSixteenRankAtMostSixResidualWords_subset_affineMaskImage_of_cover, CryptBoolean.card_orderTwoWeightSixteenRankAtMostSixResidualWords_le, CryptBoolean.orderTwoWeightSixteenRankAtMostSixResidualCharacterSum, CryptBoolean.orderTwoWeightSixteenRankAtMostSixResidualCharacterSum_ge") (uses := "carlet-4-higher-order-order-two-weight-sixteen-rank-reduction") (tags := "project-bridge, carlet, chapter-4, higher-order-nonlinearity, order-two, dual-code, weight-sixteen, low-rank, residual-cover, fidelity-exact-finite-core") +*Project bridge: rank-at-most-six residual cover.* For $`n\ge3`, every +weight-sixteen word of $`R(n-3,n)` whose support-affine-span dimension is at +most six is the image of an arbitrary mask on $`V_7` under a rank-deficient +affine map $`V_7\to V_n`. Hence the residual family has cardinality at most +$$` +127\cdot2^{128}(2^n)^7, +` +and its character sum is at least the negative of this quantity. +::: + +Formalization note. A padded basis of the support-difference span supplies +the rank-deficient affine map, while the inverse image of the support supplies +the mask. There are at most $`127(2^n)^7` such affine maps and exactly +$`2^{128}` masks; taking images cannot increase cardinality, and a sum of +$`\{-1,1\}` characters is bounded below by minus the number of words. This +deliberately coarse cover handles the weight-sixteen words missed by the +non-minimal disjoint-flat classification of +{Citations.citet borissovManevNikova2003}[]; the existence of minimal +weight-sixteen words is documented by {Citations.citet borissovManev2004}[]. + +:::lemma_ "carlet-4-higher-order-order-two-weight-sixteen-character-bound" (parent := "carlet-chapter-4") (lean := "CryptBoolean.orderTwoWeightSixteenCharacterSum_ge_rankSevenClassification") (uses := "carlet-4-higher-order-order-two-weight-sixteen-rank-seven-classification, carlet-4-higher-order-order-two-weight-sixteen-orbit-sos, carlet-4-higher-order-order-two-weight-sixteen-residual-cover") (tags := "project-bridge, carlet, chapter-4, higher-order-nonlinearity, order-two, dual-code, weight-sixteen, character-sum, fidelity-exact") +*Project bridge: aggregate weight-sixteen character bound.* For $`n\ge3` +and every $`f:V_n\to\mathbb F_2`, +$$` +M_{16}(f)= +\sum_{\substack{h\in R(n-3,n)\\\operatorname{wt}(h)=16}} +(-1)^{\langle f,h\rangle} +\ge-\bigl(3\cdot127+127\cdot2^{128}\bigr)(2^n)^7. +` +::: + +Formalization note. The rank-seven classification and the low-rank cover +partition the weight-sixteen words into the three canonical affine orbits and +the rank-at-most-six residual family. The orbit estimates and the residual +cardinality estimate then add without requiring a universal disjoint-flat +representation. + +:::lemma_ "carlet-4-higher-order-order-two-moment-difference" (parent := "carlet-chapter-4") (lean := "CryptBoolean.tuplePointParityMomentDifference_zero_ge, CryptBoolean.tuplePointParityMomentDifference_eight_bounds, CryptBoolean.tuplePointParityMomentDifference_twelve_bounds, CryptBoolean.tuplePointParityMomentDifference_fourteen_bounds, CryptBoolean.tuplePointParityMomentDifference_sixteen_bounds, CryptBoolean.orderTwoCorrelationPowerSum_difference_eq_lowWeights, CryptBoolean.orderTwoCorrelationPowerSum_difference_ge_of_weightSixteenCharacterSum") (uses := "carlet-4-higher-order-order-two-weight-eight-bound, carlet-4-higher-order-order-two-weight-twelve-bound, carlet-4-higher-order-order-two-weight-fourteen-bound, carlet-4-higher-order-order-two-weight-sixteen-character-bound") (tags := "project-bridge, carlet, chapter-4, higher-order-nonlinearity, order-two, moment-difference, low-weight-spectrum, reference-91, fidelity-exact-conditional-core") +*Project bridge: seventh/eighth moment-difference estimate.* Put $`q=2^n`. +For $`n\ge7`, the exact dual-weight decomposition gives +$$` +S_8(f)-15qS_7(f) +=|R(2,n)|\sum_{w\in\{0,8,12,14,16\}} +\Delta_w(n)M_w(f), +` +where $`\Delta_w(n)=N_8(w)-15qN_7(w)`. If +$`M_{16}(f)\ge-Bq^7` with $`B\ge0`, then +$$` +S_8(f)-15qS_7(f) +\ge-\bigl(133000020000000+21000000000000B\bigr) +|R(2,n)|q^7. +` +::: + +Formalization note. Exact tuple-count polynomials provide one-sided bounds +for the five coefficients $`\Delta_w`; the weight-eight, twelve, and fourteen +sum estimates control the corresponding terms, leaving only the parameter +$`B` for weight sixteen. This is the quantitative meeting point of +the finite classification and moment branches. + +:::lemma_ "carlet-4-higher-order-order-two-asymptotic-upper" (parent := "carlet-chapter-4") (lean := "CryptBoolean.reedMuller_card_mul_two_pow_seven_le_orderTwoCorrelationPowerSum_seven, CryptBoolean.orderTwoCorrelationPowerSum_eight_div_seven_ge_of_card_scaled, CryptBoolean.sqrt_fifteen_mul_sqrtTwo_pow_sub_sqrt_le_momentRatio, CryptBoolean.maximumHigherOrderNonlinearity_two_cast_le_of_card_scaled_moment_difference, CryptBoolean.eventually_maximumHigherOrderNonlinearity_two_cast_le_of_card_scaled_moment_difference") (uses := "carlet-4-higher-order-order-two-moment-ratio, carlet-4-higher-order-order-two-moment-difference") (tags := "project-bridge, carlet, chapter-4, higher-order-nonlinearity, order-two, asymptotic-upper-bound, reference-91, fidelity-exact-conditional-core") +*Project bridge: order-two asymptotic extraction.* If some $`K\ge0` +satisfies, for every $`f:V_n\to\mathbb F_2`, +$$` +15\cdot2^nS_7(f)-K|R(2,n)|(2^n)^7\le S_8(f), +` +then +$$` +\rho(2,n)\le +2^{n-1}-\frac{\sqrt{15}}2(\sqrt2)^n+\frac{\sqrt K}{2}. +` +The same implication holds eventually when the moment hypothesis holds +eventually and uniformly in $`f`. +::: + +Formalization note. Jensen's inequality and the exact second moment give +$`S_7(f)\ge|R(2,n)|(2^n)^7`. Division by this denominator, the consecutive +moment-ratio inequality, and one square-root estimate expose the sharp +$`\sqrt{15}/2` coefficient. + +:::lemma_ "carlet-4-higher-order-general-r-propagation" (parent := "carlet-chapter-4") (lean := "CryptBoolean.exists_maximumHigherOrderNonlinearity_cast_le_of_card_scaled_moment_difference") (uses := "carlet-4-higher-order-plotkin-induction, carlet-4-higher-order-order-two-asymptotic-upper") (tags := "project-bridge, carlet, chapter-4, higher-order-nonlinearity, fixed-order, asymptotic-upper-bound, reference-91, fidelity-exact-conditional-core") +*Project bridge: propagation from order two to fixed order.* Suppose there is +$`K\ge0` such that eventually, uniformly in $`f:V_n\to\mathbb F_2`, +$$` +15\cdot2^nS_7(f)-K|R(2,n)|(2^n)^7\le S_8(f). +` +For every fixed $`r\ge2`, there is $`D\ge0` such that, for all $`n\ge r`, +$$` +\rho(r,n)\le +2^{n-1}-\frac{\sqrt{15}}2(1+\sqrt2)^{r-2}(\sqrt2)^n ++D(n+1)^{r-2}. +` +::: + +Formalization note. The preceding order-two estimate supplies the base case. +Iterating the Plotkin recurrence multiplies the square-root coefficient by +$`1+\sqrt2` at each order and turns the bounded base remainder into a +polynomial error of degree $`r-2`. + +:::theorem "carlet-4-higher-order-general-bounds" (parent := "carlet-chapter-4") (lean := "CryptBoolean.exists_maximumHigherOrderNonlinearity_cast_le_sharp") (uses := "carlet-4-higher-order-general-r-propagation, carlet-4-higher-order-order-two-weight-sixteen-character-bound") (tags := "carlet, chapter-4, higher-order-nonlinearity, asymptotic-upper-bound, page-53, fidelity-exact") +*Sharp asymptotic upper bound for higher-order nonlinearity (Carlet, p. 53).* +Define +$`\rho(r,n)=\max_f\operatorname{nl}_r(f)`. For fixed $`r\ge2`, the cited +asymptotic upper bound is +$$` +\rho(r,n)\le +2^{n-1}-\frac{\sqrt{15}}2(1+\sqrt2)^{r-2}2^{n/2} ++O(n^{r-2}). +` +::: + +Formalization note. The upper constant comes from the Carlet--Mesnager +order-two covering-radius theorem {Citations.citep carletMesnager2007}[]. The +moment ratio reduces the order-two estimate to the seventh/eighth moment +difference; dual-code orthogonality and Krawtchouk inversion reduce that +difference to weights $`0,8,12,14,16`. At weight sixteen, the +disjoint-three-flat description of +{Citations.citet borissovManevNikova2003}[] covers the non-minimal case but +not the minimal words exhibited by {Citations.citet borissovManev2004}[]. The +complete alternative is the rank-seven three-orbit classification of +{Citations.citet mesnagerOblaukhov2022}[] together with the rank-at-most-six +affine-mask cover above. Their character estimates feed the moment inequality, +and Plotkin induction propagates the resulting $`\sqrt{15}/2` coefficient by +the factor $`1+\sqrt2` at every increase of order. + +:::proposition "carlet-4-prop-13" (parent := "carlet-chapter-4") (lean := "CryptBoolean.hammingWeight_translate, CryptBoolean.hammingWeight_booleanDerivative_le_two_mul, CryptBoolean.booleanDerivative_add, CryptBoolean.derivative_higherOrderNonlinearity_le_two_mul, CryptBoolean.maxDerivativeHigherOrderNonlinearity, CryptBoolean.maxDerivativeHigherOrderNonlinearity_le_two_mul, CryptBoolean.proposition_13_first_bound, CryptBoolean.two_mul_higherOrderNonlinearity_le_two_pow, CryptBoolean.autocorrelation_eq_walshTransform_booleanDerivative_zero, CryptBoolean.autocorrelation_eq_two_pow_sub_two_derivative_weight, CryptBoolean.autocorrelation_le_two_pow_sub_two_higherOrderNonlinearity, CryptBoolean.derivativeHigherOrderNonlinearitySum, CryptBoolean.higherOrderNonlinearity_gap_sq_le, CryptBoolean.proposition_13_second_bound, CryptBoolean.proposition_13_second_bound_source_form") (uses := "carlet-4-def-higher-order-nonlinearity, carlet-2-def-2-derivative") (tags := "carlet, chapter-4, proposition-13, pages-54-55, fidelity-exact") +*Proposition 13 (Carlet, pp. 54--55).* Let $`1\le r + +:::definition "carlet-4-def-linear-kernel" (parent := "carlet-chapter-4") (lean := "CryptBoolean.IsLinearStructure, CryptBoolean.isLinearStructure_zero, CryptBoolean.booleanDerivative_add_direction, CryptBoolean.IsLinearStructure.add, CryptBoolean.IsLinearStructure.smul, CryptBoolean.linearKernel, CryptBoolean.mem_linearKernel") (uses := "carlet-2-def-2-derivative") (tags := "carlet, chapter-4, linear-kernel, page-59, fidelity-exact") +*Linear kernel (Carlet, p. 59).* Define +$$` +\ker_{\mathrm{lin}}(f) +=\{e\in V_n:D_ef\text{ is constant}\}. +` +This is an $`\mathbb F_2`-linear subspace of $`V_n`, and its elements are +the linear structures of $`f`. +::: + +:::proposition "carlet-4-prop-14" (parent := "carlet-chapter-4") (lean := "CryptBoolean.HasSeparatedLinearStructureNormalForm, CryptBoolean.finrank_linearKernel_ge_iff_hasSeparatedLinearStructureNormalForm, CryptBoolean.exists_nonzero_linearStructure_iff_exists_single_coordinate_normalForm") (uses := "carlet-4-def-linear-kernel, carlet-2-def-affine-functions") (tags := "carlet, chapter-4, proposition-14, linear-structures, page-59, fidelity-exact-dimension-split") +*Proposition 14 (Carlet, p. 59).* A function $`f` has a nonzero linear +structure if and only if it is linearly equivalent to +$$` +g(x_1,\ldots,x_{n-1})+\varepsilon x_n. +` +More generally, $`\dim\ker_{\mathrm{lin}}(f)\ge k` if and only if $`f` is +linearly equivalent to +$$` +g(x_1,\ldots,x_{n-k}) ++\sum_{i=n-k+1}^{n}\varepsilon_i x_i. +` +::: + +Formalization note. The general theorem writes the ambient dimension as +$`m+k`; this is exactly the feasible range of Carlet's $`n-k` and avoids +truncated natural-number subtraction. + +:::corollary "carlet-4-linear-kernel-nonlinearity-bound" (parent := "carlet-chapter-4") (lean := "CryptBoolean.nonlinearity_cast_le_of_finrank_linearKernel_eq, CryptBoolean.nonlinearity_cast_le_of_exists_nonzero_linearStructure") (uses := "carlet-4-prop-14, carlet-4-rel-36-covering-radius-bent") (tags := "carlet, chapter-4, linear-kernel, nonlinearity, page-59, fidelity-exact-real-rpow") +*Nonlinearity bound from the linear kernel (Carlet, p. 59).* If +$`\dim\ker_{\mathrm{lin}}(f)=k`, then +$$` +\operatorname{nl}(f) +\le2^{n-1}-2^{(n+k-2)/2}. +` +In particular, a nonzero linear structure gives +$`\operatorname{nl}(f)\le2^{n-1}-2^{(n-1)/2}`. +::: + +:::theorem "carlet-4-hyperplane-walsh-autocorrelation" (parent := "carlet-chapter-4") (lean := "CryptBoolean.walshHyperplane, CryptBoolean.mem_walshHyperplane_iff, CryptBoolean.natCard_walshHyperplane, CryptBoolean.sum_walshTransform_sq_hyperplane_coset") (uses := "carlet-2-cor-1-poisson-summation, carlet-2-rel-25-wiener-khinchin") (tags := "carlet, chapter-4, walsh, autocorrelation, pages-59-60, fidelity-exact") +*Hyperplane Walsh--autocorrelation identity (Carlet, pp. 59--60).* Let +$`e\ne0`, $`E=\{0,e\}^{\perp}`, and $`a\in V_n`. Then +$$` +\sum_{u\in a+E}W_f(u)^2 +=2^{n-1}\left(2^n+(-1)^{a\mathbin\cdot e}\Delta_f(e)\right). +` +::: + +:::proposition "carlet-4-prop-15" (parent := "carlet-chapter-4") (lean := "CryptBoolean.walshSupport, CryptBoolean.mem_walshSupport, CryptBoolean.booleanDerivative_eq_zero_iff_walshSupport_subset_hyperplane, CryptBoolean.booleanDerivative_eq_one_iff_walshSupport_subset_hyperplane_compl, CryptBoolean.isBalanced_of_booleanDerivative_eq_one, CryptBoolean.isLinearStructure_iff_booleanDerivative_eq_zero_of_not_balanced, CryptBoolean.walshSupportSpan, CryptBoolean.walshSupportRank, CryptBoolean.no_nonzero_null_derivative_iff_walshSupportSpan_eq_top, CryptBoolean.walshSupportRank_eq_n_iff, CryptBoolean.no_nonzero_linearStructure_iff_walshSupportRank_eq_n_of_not_balanced") (uses := "carlet-4-hyperplane-walsh-autocorrelation, carlet-4-def-linear-kernel, carlet-2-def-walsh-transform") (tags := "carlet, chapter-4, proposition-15, linear-structures, page-60, fidelity-exact") +*Proposition 15 (Carlet, p. 60).* For $`e\ne0`, one has $`D_ef=0` if and +only if +$$` +\operatorname{supp}(W_f)\subseteq\{0,e\}^{\perp}, +` +and $`D_ef=1` if and only if the Walsh support is contained in the other +coset of this hyperplane. The latter condition implies that $`f` is balanced. +If $`f` is not balanced, it has no nonzero linear structure exactly when its +Walsh support has rank $`n`. +::: + +:::theorem "carlet-4-distance-to-linear-structures" (parent := "carlet-chapter-4") (lean := "CryptBoolean.HasNonzeroLinearStructure, CryptBoolean.distanceToLinearStructures, CryptBoolean.distanceToLinearStructures_le_hammingDistance, CryptBoolean.exists_hammingDistance_eq_distanceToLinearStructures, CryptBoolean.abs_autocorrelation_le_absoluteIndicator, CryptBoolean.distanceToLinearStructures_cast_eq, CryptBoolean.distanceToLinearStructures_le_nonlinearity, CryptBoolean.distanceToLinearStructures_le_two_pow, CryptBoolean.absoluteIndicator_eq_zero_iff_isBent, CryptBoolean.distanceToLinearStructures_eq_two_pow_iff_isBent") (uses := "carlet-4-def-linear-kernel, carlet-2-def-hamming-distance, carlet-2-def-autocorrelation, carlet-4-rel-36-covering-radius-bent") (tags := "carlet, chapter-4, linear-structures, distance, page-60, fidelity-exact-with-zero-dimensional-convention") +*Distance to functions with a nonzero linear structure (Carlet, p. 60).* +For $`n\ge2`, let $`d_{\mathrm{LS}}(f)` be the least Hamming distance from +$`f` to such a function. Then +$$` +d_{\mathrm{LS}}(f) +=2^{n-2}-\frac14\max_{e\ne0}|\Delta_f(e)|. +` +Consequently $`d_{\mathrm{LS}}(f)\le\operatorname{nl}(f)` and +$`d_{\mathrm{LS}}(f)\le2^{n-2}`; equality in the latter bound holds exactly +for bent $`f`. +::: diff --git a/blueprint-verso/CryptBooleanBlueprint/Carlet/Chapter04/MaximumCorrelation.lean b/blueprint-verso/CryptBooleanBlueprint/Carlet/Chapter04/MaximumCorrelation.lean new file mode 100644 index 0000000..683425b --- /dev/null +++ b/blueprint-verso/CryptBooleanBlueprint/Carlet/Chapter04/MaximumCorrelation.lean @@ -0,0 +1,57 @@ +/- +Copyright (c) 2026 Asher Yan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Asher Yan with Codex +-/ +import Verso +import VersoManual +import VersoBlueprint +import CryptBoolean.Carlet.Chapter04 + +open Verso.Genre +open Verso.Genre.Manual +open Informal + +#doc (Manual) "Maximum correlation" => + +:::definition "carlet-4-def-maximum-correlation" (parent := "carlet-chapter-4") (lean := "CryptBoolean.CoordinateSignChoice, CryptBoolean.coordinateBooleanFunction, CryptBoolean.coordinateBooleanFunction_dependsOn, CryptBoolean.exists_coordinateSignChoice_iff_dependsOn, CryptBoolean.normalizedCorrelation, CryptBoolean.normalizedCorrelation_eq_one_sub_two_mul_hammingDistance, CryptBoolean.distanceToCoordinateFunctions, CryptBoolean.maximumCorrelation, CryptBoolean.distanceToCoordinateFunctions_cast_eq, CryptBoolean.higherOrderNonlinearity_le_distanceToCoordinateFunctions, CryptBoolean.restrictionMaximumCorrelation, CryptBoolean.maximumCorrelation_eq_restrictionMaximumCorrelation, CryptBoolean.restrictionRawImbalance, CryptBoolean.maximumCorrelation_eq_sum_abs_restrictionRawImbalance_div_two_pow, CryptBoolean.maximumCorrelation_eq_zero_iff_restrictions_balanced") (uses := "carlet-4-def-higher-order-nonlinearity, carlet-4-def-resiliency-correlation-immunity, carlet-2-balanced-zero-walsh") (tags := "carlet, chapter-4, maximum-correlation, pages-66-67, fidelity-exact-with-zero-dimensional-form") +*Maximum correlation on a coordinate set (Carlet, pp. 66--67).* Let +$`\mathrm{BF}_{I,n}` be the functions depending only on coordinates in $`I` +and define +$$` +C_f(I)=2^{-n}\max_{g\in\mathrm{BF}_{I,n}}\mathcal F(f+g). +` +Then +$$` +d_H(f,\mathrm{BF}_{I,n})=2^{n-1}(1-C_f(I)). +` +If $`|I|=r`, this distance is at least $`\operatorname{nl}_r(f)`. Moreover, +$`C_f(I)` is $`2^{-n}` times the sum of the absolute imbalances of the +restrictions obtained by fixing $`I`; hence it vanishes exactly when all +those restrictions are balanced. +::: + +:::theorem "carlet-4-rel-40-maximum-correlation-bound" (parent := "carlet-chapter-4") (lean := "CryptBoolean.restrictedWalshSquareSum, CryptBoolean.restrictedWalshSquareSum_eq_sum_filter, CryptBoolean.two_pow_sq_mul_expect_restrictionMean_sq_eq_restrictedWalshSquareSum, CryptBoolean.maximumCorrelation_le_sqrt_restrictedWalshSquareSum_div, CryptBoolean.restrictedWalshSquareSum_le_card_mul_maxWalshMagnitude_sq, CryptBoolean.sqrt_restrictedWalshSquareSum_le, CryptBoolean.relation_40_maximumCorrelation_bound, CryptBoolean.distanceToCoordinateFunctions_cast_ge_walshSquare, CryptBoolean.distanceToCoordinateFunctions_cast_ge_maxWalshMagnitude") (uses := "carlet-4-def-maximum-correlation, carlet-4-def-nonlinearity, carlet-2-def-walsh-transform, carlet-2-cor-1-poisson-summation") (tags := "carlet, chapter-4, relation-40, maximum-correlation, page-66, fidelity-exact-with-real-rpow-source-form") +*Relation (40) (Carlet, p. 66).* For $`I\subseteq\{1,\ldots,n\}`, +$$` +C_f(I) +\le2^{-n}\left(\sum_{\operatorname{supp}(u)\subseteq I}W_f(u)^2\right)^{1/2} +\le2^{-n+|I|/2}\bigl(2^n-2\operatorname{nl}(f)\bigr). +` +Equivalently, +$$` +d_H(f,\mathrm{BF}_{I,n}) +\ge2^{n-1}-\frac12 +\left(\sum_{\operatorname{supp}(u)\subseteq I}W_f(u)^2\right)^{1/2} +\ge2^{n-1}-2^{|I|/2-1}\max_u|W_f(u)|. +` +::: + +:::definition "carlet-4-generalized-linear-structure-distance" (parent := "carlet-chapter-4") (lean := "CryptBoolean.IsZeroDerivativeDirection, CryptBoolean.zeroDerivativeKernel, CryptBoolean.mem_zeroDerivativeKernel, CryptBoolean.zeroDerivativeKernel_le_linearKernel, CryptBoolean.zeroDerivativeKernelAffineEquiv, CryptBoolean.finrank_zeroDerivativeKernel_comp_affineEquiv, CryptBoolean.zeroDerivativeKernel_zero, CryptBoolean.finrank_zeroDerivativeKernel_zero, CryptBoolean.largeZeroDerivativeFunctions, CryptBoolean.largeZeroDerivativeFunctions_nonempty, CryptBoolean.generalizedLinearStructureDistance, CryptBoolean.mem_largeZeroDerivativeFunctions_comp_affineEquiv_iff, CryptBoolean.generalizedLinearStructureDistance_comp_affineEquiv_le, CryptBoolean.generalizedLinearStructureDistance_comp_affineEquiv") (uses := "carlet-4-def-linear-kernel, carlet-2-def-hamming-distance") (tags := "carlet, chapter-4, generalized-linear-structure, page-67, fidelity-exact-on-feasible-range") +*Generalized distance to a large zero-derivative space (Carlet, p. 67).* For +$`0\le k\le n`, define the distance from $`f` to the functions $`g` satisfying +$$` +\dim\{e\in V_n:D_eg=0\}\ge k. +` +This distance is invariant under affine equivalence. +::: diff --git a/blueprint-verso/CryptBooleanBlueprint/Carlet/Chapter04/Nonlinearity.lean b/blueprint-verso/CryptBooleanBlueprint/Carlet/Chapter04/Nonlinearity.lean new file mode 100644 index 0000000..87147a5 --- /dev/null +++ b/blueprint-verso/CryptBooleanBlueprint/Carlet/Chapter04/Nonlinearity.lean @@ -0,0 +1,370 @@ +/- +Copyright (c) 2026 Asher Yan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Asher Yan with Codex +-/ +import Verso +import VersoManual +import VersoBlueprint +import CryptBooleanBlueprint.Citations +import CryptBoolean.Carlet.Chapter04.DegreeCount +import CryptBoolean.Carlet.Chapter04.Nonlinearity +import CryptBoolean.Carlet.Chapter04.RandomNonlinearityAsymptotics +import CryptBoolean.Carlet.Chapter04.RodierLowerTail +import CryptBoolean.Carlet.Chapter04.OddDimensionBestNonlinearity +import CryptBoolean.Carlet.Chapter04.SevenVariableMaximumNonlinearity +import CryptBoolean.Carlet.Chapter04.FiveVariableMaximumNonlinearity +import CryptBoolean.Carlet.Chapter04.PropagationNonlinearity +import CryptBoolean.Carlet.Chapter04.DegreeRepairNonlinearity +import CryptBoolean.Carlet.Chapter04.ReedMullerCosetDistance +import CryptBoolean.Carlet.Chapter04.DerivativeNonlinearity +import CryptBoolean.Carlet.Chapter04.OddWeightingNonlinearity + +open Verso.Genre +open Verso.Genre.Manual +open Informal + +#doc (Manual) "Nonlinearity" => + +:::theorem "carlet-4-degree-count" (parent := "carlet-chapter-4") (lean := "CryptBoolean.sum_choose_le_n_sub_two, CryptBoolean.card_booleanFunctions_degree_le_n_sub_two, CryptBoolean.card_booleanFunctions_degree_le_n_sub_two_eq, CryptBoolean.natCard_booleanFunction, CryptBoolean.highAlgebraicDegreeProbability, CryptBoolean.highAlgebraicDegreeProbability_eq_card_ratio, CryptBoolean.tendsto_highAlgebraicDegreeProbability") (uses := "carlet-2-anf-existence-uniqueness, carlet-2-def-algebraic-degree") (tags := "carlet, chapter-4, algebraic-degree, page-49, fidelity-exact") +*High algebraic degree is typical (Carlet, p. 49).* For $`n\ge2`, the number +of functions $`f:V_n\to\mathbb F_2` with $`\deg_{\mathrm{alg}}(f)\le n-2` is +$$` +2^{\sum_{i=0}^{n-2}\binom ni}=2^{2^n-n-1}. +` +Consequently, the probability that a uniformly chosen $`n`-variable Boolean +function has degree at least $`n-1` tends to one as $`n\to\infty`. +::: + +:::definition "carlet-4-def-nonlinearity" (parent := "carlet-chapter-4") (lean := "CryptBoolean.nonlinearity") (uses := "carlet-2-def-hamming-distance, carlet-2-def-affine-functions") (tags := "carlet, chapter-4, nonlinearity, pages-49-51, fidelity-exact") +*Nonlinearity (Carlet, pp. 49--51).* For $`f:V_n\to\mathbb F_2`, define +$$` +\operatorname{nl}(f) +=\min_{a\in V_n,\ b\in\mathbb F_2} +d_H\bigl(f,x\mapsto a\mathbin\cdot x+b\bigr). +` +::: + +:::theorem "carlet-4-nonlinearity-affine-invariance" (parent := "carlet-chapter-4") (lean := "CryptBoolean.hammingDistance_comp_affineEquiv, CryptBoolean.exists_affineFunction_comp_affineEquiv, CryptBoolean.nonlinearity_comp_affineEquiv_le, CryptBoolean.nonlinearity_comp_affineEquiv") (uses := "carlet-4-def-nonlinearity, carlet-2-affine-invariance") (tags := "carlet, chapter-4, nonlinearity, affine-invariance, page-50, fidelity-exact") +*Affine invariance of nonlinearity (Carlet, p. 50).* If +$`L:V_n\to V_n` is an affine automorphism, then every +$`f:V_n\to\mathbb F_2` satisfies +$$` +\operatorname{nl}(f\circ L)=\operatorname{nl}(f). +` +::: + +:::theorem "carlet-4-rel-35-nonlinearity-walsh" (parent := "carlet-chapter-4") (lean := "CryptBoolean.maxWalshMagnitude, CryptBoolean.hammingDistance_cast_affineFunction, CryptBoolean.bitSignInt_cast, CryptBoolean.hammingDistance_cast_affineFunction_eq, CryptBoolean.hammingDistance_cast_linearFunction_eq, CryptBoolean.hammingDistance_cast_complementLinearFunction_eq, CryptBoolean.nonlinearity_cast_eq_distanceToAffineSigns, CryptBoolean.maxWalshMagnitude_cast_eq_spectralInfinityNorm, CryptBoolean.two_mul_nonlinearity_add_maxWalshMagnitude, CryptBoolean.nonlinearity_cast_eq_relation_35") (uses := "carlet-4-def-nonlinearity, carlet-2-def-walsh-transform") (tags := "carlet, chapter-4, relation-35, page-51, fidelity-exact-with-division-free-form") +*Relation (35) (Carlet, p. 51).* For $`a\in V_n`, write +$`\ell_a(x)=a\mathbin\cdot x`. Then +$$` +d_H(f,\ell_a)=2^{n-1}-\frac12W_f(a), +\qquad +d_H(f,\ell_a+1)=2^{n-1}+\frac12W_f(a), +` +and hence +$$` +\operatorname{nl}(f) +=2^{n-1}-\frac12\max_{a\in V_n}|W_f(a)|. +` +::: + +:::theorem "carlet-4-rel-36-covering-radius-bent" (parent := "carlet-chapter-4") (lean := "CryptBoolean.exists_inv_sqrt_card_le_vectorFourierCoeff_abs, CryptBoolean.spectralInfinityNorm_ge_inv_sqrt_card, CryptBoolean.distanceToAffineSigns_le_coveringRadius, CryptBoolean.two_pow_mul_inv_sqrt, CryptBoolean.sqrt_two_pow_eq_rpow, CryptBoolean.coveringRadius_eq_relation_36, CryptBoolean.nonlinearity_cast_le_coveringRadius, CryptBoolean.nonlinearity_cast_le_relation_36, CryptBoolean.vectorFourierCoeff_abs_eq_inv_sqrt_of_spectralInfinityNorm_eq, CryptBoolean.spectralInfinityNorm_eq_inv_sqrt_of_forall_abs, CryptBoolean.distanceToAffineSigns_eq_coveringRadius_iff, CryptBoolean.HasFlatWalshSpectrum, CryptBoolean.hasFlatWalshSpectrum_iff_vectorFourierCoeff, CryptBoolean.nonlinearity_eq_coveringRadius_iff_flatWalshSpectrum, CryptBoolean.nonlinearity_cast_eq_relation_36_iff_flatWalshSpectrum, CryptBoolean.even_of_hasFlatWalshSpectrum, CryptBoolean.IsBent, CryptBoolean.sqrt_two_pow_eq_pow_half, CryptBoolean.even_of_isBent, CryptBoolean.hasFlatWalshSpectrum_iff_isBent, CryptBoolean.even_of_exists_isBent, CryptBoolean.not_isBalanced_of_isBent, CryptBoolean.isBent_iff_nonlinearity_cast_eq_relation_36_of_even, CryptBoolean.nonlinearity_cast_eq_relation_36_iff_isBent") (uses := "carlet-4-rel-35-nonlinearity-walsh, carlet-2-parseval, carlet-2-balanced-zero-walsh") (tags := "carlet, chapter-4, relation-36, bent, page-51, fidelity-exact-with-real-rpow-source-form") +*Covering-radius bound and bent equality (Carlet, Relation (36), p. 51).* +Every $`f:V_n\to\mathbb F_2` satisfies +$$` +\operatorname{nl}(f)\le2^{n-1}-2^{n/2-1}. +` +Equality holds exactly when $`|W_f(a)|=2^{n/2}` for every $`a\in V_n`. +Such a function is bent; it can exist only for even $`n` and is not balanced. +::: + +:::theorem "carlet-4-random-nonlinearity-lower-bound" (parent := "carlet-chapter-4") (lean := "CryptBoolean.carletRandomFourierThreshold, CryptBoolean.carletRandomNonlinearityThreshold, CryptBoolean.carletRandomNonlinearityThreshold_eq_displayed, CryptBoolean.carletRandomFourierThreshold_nonneg, CryptBoolean.card_mul_carletRandomFourierThreshold_sq_div_two, CryptBoolean.measure_fourierInfinityNorm_ge_carletThreshold_le, CryptBoolean.carletRandomNonlinearityFailureBound, CryptBoolean.fourier_union_bound_eq_failureBound, CryptBoolean.tendsto_carletRandomNonlinearityFailureBound, CryptBoolean.spectralInfinityNorm_encoding_eq_fourierInfinityNorm, CryptBoolean.nonlinearity_encoding_eq_fourierInfinityNorm, CryptBoolean.carletRandomNonlinearityThreshold_lt_of_fourierInfinityNorm_lt, CryptBoolean.carletRandomNonlinearityProbability, CryptBoolean.one_sub_failureBound_le_carletRandomNonlinearityProbability, CryptBoolean.tendsto_carletRandomNonlinearityProbability") (uses := "carlet-4-rel-35-nonlinearity-walsh") (tags := "carlet, chapter-4, asymptotic-nonlinearity, olejar-stanek, page-51, fidelity-exact") +*Random-function nonlinearity lower bound (Olejár--Stanek; Carlet, p. 51).* As +$`n\to\infty`, the uniform probability tends to $`1` that +$`f:V_n\to\mathbb F_2` satisfies +$$` +\operatorname{nl}(f)>2^{n-1}-\sqrt n\,2^{(n-1)/2}. +` +::: + +Formalization note. The finite proof bounds the failure probability by +$`2(2/e)^n`, using the exact Walsh threshold, a single-frequency Hoeffding bound, +and a union bound over all $`2^n` frequencies. Relation (35) transports the +result to Carlet's raw nonlinearity normalization. + +:::theorem "carlet-4-rodier-lower-endpoint" (parent := "carlet-chapter-4") (lean := "CryptBoolean.rodierRandomFourierUpperThreshold, CryptBoolean.rodierRandomNonlinearityLowerThreshold, CryptBoolean.rodierRandomNonlinearityLowerThreshold_eq_displayed, CryptBoolean.rodierRandomFourierUpperThreshold_nonneg, CryptBoolean.card_mul_rodierRandomFourierUpperThreshold_sq_div_two_ge, CryptBoolean.measure_fourierInfinityNorm_ge_rodierUpperThreshold_le, CryptBoolean.rodierRandomNonlinearityLowerFailureBound, CryptBoolean.tendsto_rodierRandomNonlinearityLowerFailureBound, CryptBoolean.rodierRandomNonlinearityLowerThreshold_lt_of_fourierInfinityNorm_lt, CryptBoolean.rodierRandomNonlinearityLowerProbability, CryptBoolean.one_sub_rodierLowerFailureBound_le_probability, CryptBoolean.tendsto_rodierRandomNonlinearityLowerProbability") (uses := "carlet-4-rel-35-nonlinearity-walsh") (tags := "carlet, chapter-4, asymptotic-nonlinearity, rodier, page-51, fidelity-derived-one-sided") +*Rodier lower endpoint (one-sided consequence of the sharp interval; Carlet, p. 51).* As $`n\to\infty`, the uniform probability tends to $`1` that +$`f:V_n\to\mathbb F_2` satisfies +$$` +\operatorname{nl}(f)> +2^{n-1}-2^{n/2-1}\sqrt n +\left(\sqrt{2\ln2}+\frac{4\ln n}{n}\right). +` +::: + +Formalization note. A one-frequency Hoeffding estimate followed by a union +bound over all Walsh frequencies gives failure probability at most $`2/n`. +Relation (35) converts the spectral event to the displayed nonlinearity event. + +:::lemma_ "carlet-4-rodier-upper-endpoint-reduction" (parent := "carlet-chapter-4") (lean := "CryptBoolean.rodierRandomFourierLowerThreshold, CryptBoolean.rodierRandomNonlinearityUpperThreshold, CryptBoolean.rodierRandomNonlinearityUpperThreshold_eq_displayed, CryptBoolean.nonlinearity_lt_rodierRandomNonlinearityUpperThreshold, CryptBoolean.rodierRandomFourierLowerProbability, CryptBoolean.rodierRandomNonlinearityUpperProbability, CryptBoolean.rodierRandomFourierLowerProbability_le_nonlinearityUpperProbability, CryptBoolean.tendsto_rodierRandomNonlinearityUpperProbability_of_fourierLower") (uses := "carlet-4-rel-35-nonlinearity-walsh") (tags := "project-bridge, carlet, chapter-4, asymptotic-nonlinearity, rodier, lower-spectral-tail, fidelity-exact-reduction") +*Project bridge: reduction of Rodier's upper endpoint to a spectral lower tail.* +Put +$$` +\tau_n=\sqrt n\left(\sqrt{2\ln2}-\frac{5\ln n}{n}\right)2^{-n/2}. +` +If the uniform probability of +$`\tau_n<\|\widehat{(-1)^f}\|_\infty` tends to $`1`, then the uniform +probability tends to $`1` that +$$` +\operatorname{nl}(f)< +2^{n-1}-2^{n/2-1}\sqrt n +\left(\sqrt{2\ln2}-\frac{5\ln n}{n}\right). +` +::: + +Formalization note. Relation (35) proves the deterministic event inclusion; +monotonicity of the uniform measure transports the assumed spectral limit. +Thus only the lower tail of the maximum Walsh coefficient remains analytic. + +:::lemma_ "carlet-4-rodier-pair-characteristic-moments" (parent := "carlet-chapter-4") (lean := "CryptBoolean.rodierPairPhase, CryptBoolean.rodierPairCharacteristic, CryptBoolean.rodierPairCharacteristic_eq_prod_cos, CryptBoolean.sum_monomial_mul_eq_zero_of_ne, CryptBoolean.sum_rodierPairPhase_sq, CryptBoolean.sum_rodierPairPhase_fourth") (tags := "project-bridge, carlet, chapter-4, asymptotic-nonlinearity, rodier, characteristic-function, fidelity-exact-finite-core") +*Project bridge: Rodier's two-character characteristic-function moments.* +For distinct Walsh characters $`\chi_S,\chi_T` and real $`t,r`, put +$`u_x=t\chi_S(x)+r\chi_T(x)`. Then the joint characteristic function of +the corresponding raw Walsh coefficients is +$$` +\prod_{x\in\{-1,1\}^n}\cos u_x, +` +and +$$` +\sum_xu_x^2=2^n(t^2+r^2), +\qquad +\sum_xu_x^4=2^n(t^4+6t^2r^2+r^4). +` +::: + +Formalization note. Independence gives the cosine product and Walsh-character +orthogonality cancels the mixed odd terms. These are the exact finite +identities used before Rodier's smoothed Fourier estimates. + +:::theorem "carlet-4-rodier-sharp-random-nonlinearity-interval" (parent := "carlet-chapter-4") (lean := "CryptBoolean.exists_rodierAsymptoticOffDiagonalPairError_bound, CryptBoolean.tendsto_rodierRandomFourierLowerProbability, CryptBoolean.rodierSharpRandomNonlinearityIntervalProbability, CryptBoolean.tendsto_rodierSharpRandomNonlinearityIntervalProbability") (uses := "carlet-4-rodier-lower-endpoint, carlet-4-rodier-upper-endpoint-reduction, carlet-4-rodier-pair-characteristic-moments") (tags := "carlet, chapter-4, asymptotic-nonlinearity, rodier, page-51, fidelity-exact") +*Sharp random-function nonlinearity interval (Rodier; Carlet, p. 51).* As +$`n\to\infty`, the uniform probability tends to $`1` that +$`f:V_n\to\mathbb F_2` has nonlinearity between +$$` +2^{n-1}-2^{n/2-1}\sqrt n +\left(\sqrt{2\ln2}+\frac{4\ln n}{n}\right) +` +and +$$` +2^{n-1}-2^{n/2-1}\sqrt n +\left(\sqrt{2\ln2}-\frac{5\ln n}{n}\right). +` +::: + +Formalization note. Following {Citations.citet rodier2006}[], the proof uses +correlated Walsh pairs, smoothed cutoff estimates, and a second-moment +argument. A uniform off-diagonal covariance error tends to zero at the +required scale; the resulting spectral lower tail is intersected with the +compiled one-sided upper tail. Relation (35) then gives the simultaneous +nonlinearity interval, including the exact $`+4\ln(n)/n` and +$`-5\ln(n)/n` corrections. + +:::theorem "carlet-4-odd-dimension-exact-five" (parent := "carlet-chapter-4") (lean := "CryptBoolean.maximumNonlinearity_five") (uses := "carlet-4-odd-dimension-quadratic-covering-bounds, carlet-3-affine-weight, carlet-3-reed-muller-dimension, carlet-4-def-higher-order-nonlinearity") (tags := "carlet, chapter-4, odd-dimension, exact-five-variables, pages-51-52, fidelity-exact") +*Exact best nonlinearity in dimension five (Carlet, pp. 51--52).* If $`M_n` +denotes the maximum nonlinearity of an $`n`-variable Boolean function, then +$$` +M_5=2^4-2^2=12. +` +::: + +Formalization note. The quadratic construction gives the lower bound. For the +upper bound, a hypothetical weight-thirteen first-order Reed--Muller coset +leader yields a self-complementary binary $`[13,6,\ge5]` code. Residuation at +a minimum-weight word produces a binary $`[7,5,\ge3]` or $`[8,5,\ge3]` code, +and the radius-one Hamming bound rules out both cases. + +:::lemma_ "carlet-4-six-variable-covering-coset-coordinate" (parent := "carlet-chapter-4") (lean := "CryptBoolean.exists_minimum_affine_error_one_at_of_nonlinearity_eq_28") (uses := "carlet-4-rel-36-covering-radius-bent") (tags := "project-bridge, carlet, chapter-4, odd-dimension, reed-muller-coset, hou-1996, fidelity-strengthened") +*Project bridge: coordinate-covering leaders of six-variable deep cosets.* +Let $`f:V_6\to\mathbb F_2` have $`\operatorname{nl}(f)=28`. For every +$`x\in V_6`, there is an affine function $`\ell` such that +$$` +d_H(f,\ell)=28 +\qquad\text{and}\qquad +(f+\ell)(x)=1. +` +::: + +Formalization note. This is the covering-radius orphan fact used in Hou's +dimension-seven argument. The proof derives the flat Walsh spectrum from +Relation (36) and uses Walsh inversion to force a minimum representative +through every prescribed coordinate; it needs no finite truth-table +certificate or degree hypothesis. + +:::lemma_ "carlet-4-six-variable-degree-four-coset-coordinate" (parent := "carlet-chapter-4") (lean := "CryptBoolean.exists_minimum_affine_error_one_at_of_degree_le_four_nonlinearity_eq_26") (uses := "carlet-4-rel-35-nonlinearity-walsh, carlet-2-parseval, carlet-3-theorem-2") (tags := "project-bridge, carlet, chapter-4, odd-dimension, reed-muller-coset, hou-1997, fidelity-exact") +*Project bridge: coordinate-covering leaders of degree-four six-variable cosets.* +Let $`f:V_6\to\mathbb F_2` have algebraic degree at most $`4` and +$`\operatorname{nl}(f)=26`. For every $`x\in V_6`, there is an affine +function $`\ell` such that +$$` +d_H(f,\ell)=26 +\qquad\text{and}\qquad +(f+\ell)(x)=1. +` +::: + +Formalization note. Reed--Muller duality forces all affine-coset weights to +be congruent modulo four. Relation (35) and Parseval then give exactly 24 +Walsh coefficients of magnitude 12 and 40 of magnitude 4; Walsh inversion +forces a minimum representative through every prescribed coordinate. This +is Hou's remaining six-variable orphan fact, without a finite certificate. + +:::theorem "carlet-4-odd-dimension-best-nonlinearity" (parent := "carlet-chapter-4") (lean := "CryptBoolean.firstCoordinateSliceSeven, CryptBoolean.exists_linearEquiv_firstCoordinateSlices_degree_le_four, CryptBoolean.nonlinearity_le_56_of_degree_le_five_seven, CryptBoolean.exists_minimum_affine_error_one_at_of_degree_le_five_nonlinearity_eq_56_seven, CryptBoolean.nonlinearity_le_fifty_six_of_degree_five_covering, CryptBoolean.maximumNonlinearity_seven") (uses := "carlet-4-odd-dimension-quadratic-covering-bounds, carlet-4-six-variable-covering-coset-coordinate, carlet-4-six-variable-degree-four-coset-coordinate") (tags := "carlet, chapter-4, odd-dimension, exact-seven-variables, pages-51-52, fidelity-exact") +*Exact best nonlinearity in dimension seven (Carlet, pp. 51--52).* If $`M_n` +denotes the maximum nonlinearity of an $`n`-variable Boolean function, then +$$` +M_7=2^6-2^3=56. +` +::: + +Formalization note. The proof follows Hou's alternative to Mykkeltveit's +self-complementary-code argument. A point-indicator quotient reduces an +arbitrary seven-variable word to degree at most five. An alternating-form +radical supplies a linear coordinate in which both six-variable slices have +degree at most four; the two coordinate-covering results above close the +nonlinearity-$`24`, $`26`, and $`28` equality cases. The quadratic +construction gives the matching lower bound. + +:::theorem "carlet-4-odd-dimension-quadratic-covering-bounds" (parent := "carlet-chapter-4") (lean := "CryptBoolean.maximumNonlinearity, CryptBoolean.nonlinearity_le_maximumNonlinearity, CryptBoolean.exists_nonlinearity_eq_maximumNonlinearity, CryptBoolean.oddQuadraticFunction, CryptBoolean.walshTransform_oddQuadraticFunction, CryptBoolean.maxWalshMagnitude_oddQuadraticFunction, CryptBoolean.nonlinearity_oddQuadraticFunction, CryptBoolean.quadraticBound_le_maximumNonlinearity_of_odd, CryptBoolean.maximumNonlinearity_cast_le_relation_36, CryptBoolean.maximumNonlinearity_odd_bounds") (uses := "carlet-4-rel-35-nonlinearity-walsh, carlet-4-rel-36-covering-radius-bent") (tags := "carlet, chapter-4, odd-dimension, quadratic-bound, covering-radius, pages-51-52, fidelity-exact") +*Quadratic and covering-radius bounds in odd dimension (Carlet, pp. 51--52).* +For every odd $`n`, if $`M_n` is the maximum nonlinearity of an $`n`-variable +Boolean function, then +$$` +2^{n-1}-2^{(n-1)/2} +\le M_n\le +2^{n-1}-2^{n/2-1}. +` +::: + +Formalization note. The lower bound is attained by FABL's complete +inner-product bent function on $`n-1` variables extended by one dummy +coordinate. Relation (35) gives its exact nonlinearity. The upper bound is +Relation (36), applied to a function attaining the finite maximum. + +:::theorem "carlet-4-odd-dimension-exact-one-three" (parent := "carlet-chapter-4") (lean := "CryptBoolean.maximumNonlinearity_one, CryptBoolean.maximumNonlinearity_three") (uses := "carlet-4-odd-dimension-quadratic-covering-bounds") (tags := "carlet, chapter-4, odd-dimension, exact-small-dimensions, page-52, fidelity-exact") +*Exact best nonlinearities in dimensions one and three (Carlet, p. 52).* If +$`M_n` denotes the maximum nonlinearity of an $`n`-variable Boolean function, +then +$$` +M_1=0\qquad\text{and}\qquad M_3=2. +` +::: + +Formalization note. The quadratic construction supplies the matching lower +bounds, while Relation (36) makes the covering-radius upper bounds strict +enough that integrality determines both maxima. + +:::theorem "carlet-4-odd-dimension-strict-above-quadratic" (parent := "carlet-chapter-4") (lean := "CryptBoolean.f₂CubeNatIndex, CryptBoolean.f₂CubeOfNat, CryptBoolean.kavutYucelTruthTable, CryptBoolean.kavutYucelFunction9, CryptBoolean.kavutYucelFunction9_walsh_bound, CryptBoolean.kavutYucelFunction9_walsh_witness, CryptBoolean.maxWalshMagnitude_kavutYucelFunction9, CryptBoolean.nonlinearity_kavutYucelFunction9, CryptBoolean.kavutYucelBentExtension, CryptBoolean.realSignView_kavutYucelBentExtension, CryptBoolean.walshTransform_kavutYucelBentExtension_append, CryptBoolean.natAbs_walshTransform_innerProductModTwoBit, CryptBoolean.natAbs_walshTransform_kavutYucelBentExtension_append, CryptBoolean.maxWalshMagnitude_kavutYucelBentExtension, CryptBoolean.nonlinearity_kavutYucelBentExtension, CryptBoolean.quadraticBound_lt_nonlinearity_kavutYucelBentExtension, CryptBoolean.exists_nonlinearity_gt_quadraticBound_of_odd, CryptBoolean.quadraticBound_lt_maximumNonlinearity_of_odd") (uses := "carlet-4-rel-35-nonlinearity-walsh") (tags := "carlet, chapter-4, odd-dimension, kavut-yucel, pages-51-52, fidelity-exact") +*Strict improvement above the quadratic bound (Carlet, pp. 51--52).* For every +odd $`n>7`, there exists $`f:V_n\to\mathbb F_2` such that +$$` +\operatorname{nl}(f)>2^{n-1}-2^{(n-1)/2}. +` +::: + +Formalization note. The base case is the first nine-variable truth table in +Kavut--Yücel, with a kernel-checked fast Walsh certificate proving +$`\max_a|W_f(a)|=28` and hence $`\operatorname{nl}(f)=242`. Direct product +with FABL's complete $`2m`-variable bent block scales all raw Walsh magnitudes +by $`2^m`, yielding every odd dimension above seven. + +:::theorem "carlet-4-odd-dimension-balanced-above-quadratic" (parent := "carlet-chapter-4") (lean := "CryptBoolean.flipOn, CryptBoolean.MaitraKavutYucel.seedTruthTable, CryptBoolean.MaitraKavutYucel.seedFunction9, CryptBoolean.MaitraKavutYucel.shiftFrequency9, CryptBoolean.MaitraKavutYucel.shiftedSeedFunction9, CryptBoolean.MaitraKavutYucel.bentTruthTable, CryptBoolean.MaitraKavutYucel.bentFunction4, CryptBoolean.MaitraKavutYucel.initialFunction13, CryptBoolean.MaitraKavutYucel.flipPointList13, CryptBoolean.MaitraKavutYucel.flipPoints13, CryptBoolean.maitraKavutYucelFunction13, CryptBoolean.maitraKavutYucelFunction13_walsh_bound, CryptBoolean.isBalanced_maitraKavutYucelFunction13, CryptBoolean.maitraKavutYucelFunction13_walsh_witness, CryptBoolean.maxWalshMagnitude_maitraKavutYucelFunction13, CryptBoolean.nonlinearity_maitraKavutYucelFunction13, CryptBoolean.maitraKavutYucelBentExtension, CryptBoolean.isBalanced_maitraKavutYucelBentExtension, CryptBoolean.maxWalshMagnitude_maitraKavutYucelBentExtension, CryptBoolean.nonlinearity_maitraKavutYucelBentExtension, CryptBoolean.quadraticBound_lt_nonlinearity_maitraKavutYucelBentExtension, CryptBoolean.exists_isBalanced_nonlinearity_gt_quadraticBound_of_odd") (uses := "carlet-4-rel-35-nonlinearity-walsh, carlet-2-balanced-zero-walsh") (tags := "carlet, chapter-4, odd-dimension, balanced, maitra-kavut-yucel, page-52, fidelity-strengthened-dimension-range") +*Balanced functions above the quadratic bound (Carlet, p. 52, footnote 22).* +For every odd $`n\ge15`, there exists a balanced Boolean function +$`f:V_n\to\mathbb F_2` such that +$$` +\operatorname{nl}(f)>2^{n-1}-2^{(n-1)/2}. +` +::: + +Formalization note. Maitra--Kavut--Yücel's published thirteen-variable +function is reconstructed from its nine-variable seed, linear shift, +four-variable bent direct-sum component, and eight toggled positions. A +kernel-checked $`512`-point seed certificate plus the exact flip formula proves +balance, $`\max_a|W_f(a)|=120`, and $`\operatorname{nl}(f)=4036`. Complete +bent direct sums preserve balance and scale the spectrum, proving the stronger +range of every odd $`n\ge13`. + +:::theorem "carlet-4-odd-dimension-pc-one-above-quadratic" (parent := "carlet-chapter-4") (lean := "CryptBoolean.maitraKavutYucelZeroAutocorrelationBasis, CryptBoolean.maitraKavutYucelZeroAutocorrelationBasis_independent, CryptBoolean.maitraKavutYucelPCOneReindex, CryptBoolean.maitraKavutYucelPCOneFunction13, CryptBoolean.satisfiesPropagationCriterion_one_maitraKavutYucelPCOneFunction13, CryptBoolean.nonlinearity_maitraKavutYucelPCOneFunction13, CryptBoolean.maitraKavutYucelPCOneBentExtension, CryptBoolean.satisfiesPropagationCriterion_one_maitraKavutYucelPCOneBentExtension, CryptBoolean.maxWalshMagnitude_maitraKavutYucelPCOneBentExtension, CryptBoolean.nonlinearity_maitraKavutYucelPCOneBentExtension, CryptBoolean.quadraticBound_lt_nonlinearity_maitraKavutYucelPCOneBentExtension, CryptBoolean.exists_pc_one_nonlinearity_gt_quadraticBound_of_odd") (uses := "carlet-4-odd-dimension-balanced-above-quadratic, carlet-4-def-propagation-criteria") (tags := "carlet, chapter-4, odd-dimension, propagation-criterion, maitra-sarkar, page-52, fidelity-strengthened-dimension-range") +*PC(1) functions above the quadratic bound (Carlet, p. 52, footnote 22).* For +every odd $`n\ge15`, there exists a Boolean function +$`f:V_n\to\mathbb F_2` satisfying $`\mathrm{PC}(1)` such that +$$` +\operatorname{nl}(f)>2^{n-1}-2^{(n-1)/2}. +` +::: + +Formalization note. Carlet cites Maitra--Sarkar, reference 264. The compiled +construction linearly reindexes the thirteen-variable Maitra--Kavut--Yücel +function along a certified basis of zero-autocorrelation directions and then +uses complete bent extensions. This proves the stronger range of every odd +$`n\ge13`. + +:::theorem "carlet-4-odd-dimension-degree-pred-above-quadratic" (parent := "carlet-chapter-4") (lean := "CryptBoolean.nonlinearity_le_hammingDistance_add_nonlinearity, CryptBoolean.exists_isBalanced_degree_pred_nonlinearity_ge_sub_two, CryptBoolean.exists_isBalanced_degree_pred_nonlinearity_gt_quadraticBound_of_odd") (uses := "carlet-4-odd-dimension-balanced-above-quadratic, carlet-3-prop-12, carlet-4-def-nonlinearity") (tags := "carlet, chapter-4, odd-dimension, algebraic-degree, page-52, fidelity-strengthened-balancedness") +*Degree-$`n-1` functions above the quadratic bound (Carlet, p. 52, footnote 22).* +For every odd $`n\ge15`, there exists a Boolean function +$`f:V_n\to\mathbb F_2` with $`\deg_{\mathrm{alg}}(f)=n-1` such that +$$` +\operatorname{nl}(f)>2^{n-1}-2^{(n-1)/2}. +` +::: + +Formalization note. A balanced function already of degree $`n-1` is left +unchanged. Otherwise, swapping one zero and one one is addition by the +indicator of their affine line. Proposition 12 gives that indicator degree +$`n-1` and weight two; the algebraic-degree sum bound forces exact degree, +while Hamming-triangle Lipschitzness loses at most two units of nonlinearity. +Applied to the balanced family above, the remaining spectral margin is strict +for every odd $`n\ge15`. The compiled witnesses are therefore also balanced. + +:::theorem "carlet-4-reed-muller-coset-distance" (parent := "carlet-chapter-4") (lean := "CryptBoolean.minimumHammingDistance, CryptBoolean.firstOrderCosetUnion, CryptBoolean.firstOrderReedMullerCoset, CryptBoolean.HasDistinctFirstOrderCosets, CryptBoolean.minimumPairNonlinearity, CryptBoolean.mem_firstOrderCosetUnion_iff, CryptBoolean.mem_firstOrderReedMullerCoset_iff, CryptBoolean.firstOrderCosetUnion_pair, CryptBoolean.minimumHammingDistance_le, CryptBoolean.le_minimumHammingDistance, CryptBoolean.minimumPairNonlinearity_le, CryptBoolean.le_minimumPairNonlinearity, CryptBoolean.hammingDistance_add_right, CryptBoolean.hammingDistance_eq_cosetDifference, CryptBoolean.nonlinearity_le_hammingDistance_of_mem_cosets, CryptBoolean.nonlinearity_le_two_pow_sub_one, CryptBoolean.exists_pair_nonlinearity_eq_minimumPairNonlinearity, CryptBoolean.firstOrderCosetUnion_offDiag_nonempty, CryptBoolean.dimension_pos_of_hasDistinctFirstOrderCosets, CryptBoolean.two_pow_sub_one_le_hammingDistance_of_mem_same_coset, CryptBoolean.minimumPairNonlinearity_le_two_pow_sub_one, CryptBoolean.minimumHammingDistance_firstOrderCosetUnion, CryptBoolean.hasDistinctFirstOrderCosets_pair_zero, CryptBoolean.minimumPairNonlinearity_pair_zero, CryptBoolean.minimumHammingDistance_two_firstOrderReedMullerCosets") (uses := "carlet-4-def-nonlinearity, carlet-3-reed-muller-code") (tags := "carlet, chapter-4, reed-muller, cosets, page-52, fidelity-corrected-distinct-cosets") +*Corrected distances of unions of first-order Reed--Muller cosets (Carlet, p. 52).* Let +$`\mathcal F` be a finite family with at least two members and +suppose that distinct members represent distinct cosets of $`R(1,n)`. Then +$$` +d_{\min}\!\left(\bigcup_{f\in\mathcal F}(f+R(1,n))\right) +=\min_{\substack{f,g\in\mathcal F\\f\ne g}} +\operatorname{nl}(f+g). +` +In particular, if $`f\notin R(1,n)`, then +$$` +d_{\min}\bigl(R(1,n)\cup(f+R(1,n))\bigr)=\operatorname{nl}(f). +` +::: + +Formalization note. The source omits the distinct-coset hypothesis. Without +it the displayed equality is false: for affine $`f`, the two listed cosets +coincide. The formal declaration records the necessary correction explicitly. + +:::theorem "carlet-4-derivative-nonlinearity-bounds" (parent := "carlet-chapter-4") (lean := "CryptBoolean.minimumAutocorrelationMagnitude, CryptBoolean.autocorrelation_add_of_isLinearStructure, CryptBoolean.abs_autocorrelation_add_of_isLinearStructure, CryptBoolean.exists_abs_autocorrelation_eq_absoluteIndicator, CryptBoolean.nonlinearity_cast_le_autocorrelation_upper_bound, CryptBoolean.relation_37_nonlinearity_lower_bound") (uses := "carlet-4-def-nonlinearity, carlet-4-hyperplane-walsh-autocorrelation, carlet-2-def-2-derivative, carlet-2-def-autocorrelation") (tags := "carlet, chapter-4, relation-37, derivatives, pages-52-53, fidelity-exact-with-real-rpow-source-form") +*Derivative bounds for nonlinearity (Carlet, Relation (37), pp. 52--53).* +For $`\Delta_f(e)=\sum_x(-1)^{D_ef(x)}`, one has +$$` +\operatorname{nl}(f) +\le2^{n-1}-\frac12 +\sqrt{2^n+\max_{e\ne0}|\Delta_f(e)|} +` +and +$$` +\operatorname{nl}(f) +\ge2^{n-2}-\frac14\min_{e\ne0}|\Delta_f(e)|. +` +::: + +:::corollary "carlet-4-odd-weighting-nonlinearity" (parent := "carlet-chapter-4") (lean := "CryptBoolean.subspaceCosetWeight, CryptBoolean.IsMaximalOddWeightingSubspace, CryptBoolean.hammingWeight_lower_bound_of_isMaximalOddWeightingSubspace, CryptBoolean.isMaximalOddWeightingSubspace_add_affineFunction, CryptBoolean.hammingWeight_lower_bound_of_maximalOddWeightingSubspace, CryptBoolean.nonlinearity_lower_bound_of_maximalOddWeightingSubspace") (uses := "carlet-4-def-nonlinearity") (tags := "carlet, chapter-4, odd-weighting, page-53, fidelity-exact") +*Odd-weighting subspace bound (Carlet, p. 53).* If $`f` admits a maximal +odd-weighting subspace $`E` of dimension $`d\ge2`, then +$$` +\operatorname{nl}(f)\ge2^{n-d}. +` +::: diff --git a/blueprint-verso/CryptBooleanBlueprint/Carlet/Chapter04/OtherCriteria.lean b/blueprint-verso/CryptBooleanBlueprint/Carlet/Chapter04/OtherCriteria.lean new file mode 100644 index 0000000..6f67e53 --- /dev/null +++ b/blueprint-verso/CryptBooleanBlueprint/Carlet/Chapter04/OtherCriteria.lean @@ -0,0 +1,59 @@ +/- +Copyright (c) 2026 Asher Yan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Asher Yan with Codex +-/ +import Verso +import VersoManual +import VersoBlueprint +import CryptBoolean.Carlet.Chapter04 + +open Verso.Genre +open Verso.Genre.Manual +open Informal + +#doc (Manual) "Other criteria" => + +:::definition "carlet-4-other-complexity-definitions" (parent := "carlet-chapter-4") (lean := "CryptBoolean.algebraicThickness, CryptBoolean.exists_affineEquiv_anfSupport_card_eq_algebraicThickness, CryptBoolean.IsConstantOnAffineFlat, CryptBoolean.IsAffineOnAffineFlat, CryptBoolean.IsConstantOnAffineFlat.isAffineOnAffineFlat, CryptBoolean.normality, CryptBoolean.weakNormality, CryptBoolean.normality_le_weakNormality, CryptBoolean.spectralComplexity") (uses := "carlet-2-def-algebraic-degree, carlet-2-affine-invariance, carlet-2-spectral-support-bounds") (tags := "carlet, chapter-4, algebraic-thickness, normality, spectral-complexity, page-67, fidelity-exact-with-derived-laws") +*Algebraic thickness, normality, and spectral complexity (Carlet, p. 67).* +The algebraic thickness of $`f` is the least number of nonzero ANF terms +among functions affinely equivalent to $`f`. Its normality parameter is the +largest dimension of a flat on which $`f` is constant; weak normality permits +an affine restriction. Its spectral complexity is +$$` +|\operatorname{supp}(W_f)|. +` +::: + +:::theorem "carlet-4-kth-nonhomomorphicity" (parent := "carlet-chapter-4") (lean := "CryptBoolean.booleanTupleSum, CryptBoolean.booleanTupleOutputSum, CryptBoolean.kthNonhomomorphicity, CryptBoolean.two_mul_two_pow_mul_kthNonhomomorphicity, CryptBoolean.kthNonhomomorphicity_cast_eq_walshMoment, CryptBoolean.kthNonhomomorphicity_cast_eq_carlet_formula, CryptBoolean.IsAffineBooleanFunction, CryptBoolean.isAffineBooleanFunction_iff_nonlinearity_eq_zero, CryptBoolean.abs_walshTransform_le_two_pow, CryptBoolean.sum_walshTransform_evenMoment_le, CryptBoolean.kthNonhomomorphicity_affineFunction, CryptBoolean.kthNonhomomorphicity_cast_le_max, CryptBoolean.kthNonhomomorphicity_cast_eq_max_iff_isAffine, CryptBoolean.carlet_kthNonhomomorphicity_cast_eq_max_iff_isAffine, CryptBoolean.two_pow_pow_succ_le_sum_walshTransform_evenMoment, CryptBoolean.sum_walshTransform_evenMoment_eq_min_iff_isBent, CryptBoolean.kthNonhomomorphicity_cast_min_le, CryptBoolean.kthNonhomomorphicity_cast_eq_min_iff_isBent, CryptBoolean.carlet_kthNonhomomorphicity_cast_eq_min_iff_isBent") (uses := "carlet-2-def-walsh-transform, carlet-2-parseval, carlet-4-rel-36-covering-radius-bent") (tags := "carlet, chapter-4, nonhomomorphicity, page-67, fidelity-exact-carlet-naming") +*The $`k`th nonhomomorphicity (Carlet, p. 67).* Let $`k` be even with +$`4\le k\le2^n`. The number $`\mathrm{NH}_k(f)` of tuples +$`(u_1,\ldots,u_k)` satisfying +$$` +\sum_i u_i=0, +\qquad +\sum_i f(u_i)=0 +` +obeys +$$` +\mathrm{NH}_k(f) +=2^{(k-1)n-1}+2^{-n-1}\sum_{u\in V_n}W_f(u)^k. +` +Its maximum $`2^{(k-1)n}` is attained exactly by affine functions, and its +minimum $`2^{(k-1)n-1}+2^{nk/2-1}` exactly by bent functions. +::: + +Formalization note. Carlet calls the zero-sum/even-output count +$`\mathrm{NH}_k`. Reference 357 calls that same quantity homomorphicity and +reserves nonhomomorphicity for the complementary odd-output count; the Lean +declarations follow Carlet's convention. + +:::theorem "carlet-4-affine-reindex-first-resilient" (parent := "carlet-chapter-4") (lean := "CryptBoolean.walshCoordinateLinearMap, CryptBoolean.walshCoordinateLinearMap_injective, CryptBoolean.walshReindexLinearEquiv, CryptBoolean.bentDualFrequency_walshReindexLinearEquiv_single, CryptBoolean.walshTransform_linearReindex_cast, CryptBoolean.bentDualFrequency_zero, CryptBoolean.isBalanced_linearReindex, CryptBoolean.exists_linearEquiv_isResilient_one") (uses := "carlet-4-theorem-3, carlet-4-resiliency-translation-invariance, carlet-2-def-affine-functions") (tags := "carlet, chapter-4, resiliency, affine-reindexing, page-68, fidelity-exact") +*Affine reindexing to first-order resiliency (Carlet, p. 68).* Suppose $`f` +is balanced and its zero-Walsh set contains $`n` linearly independent +vectors. Then there is a linear automorphism $`L:V_n\to V_n` such that +$$` +f\circ L +` +is $`1`-resilient. +::: diff --git a/blueprint-verso/CryptBooleanBlueprint/Carlet/Chapter04/Resiliency.lean b/blueprint-verso/CryptBooleanBlueprint/Carlet/Chapter04/Resiliency.lean new file mode 100644 index 0000000..0543cb9 --- /dev/null +++ b/blueprint-verso/CryptBooleanBlueprint/Carlet/Chapter04/Resiliency.lean @@ -0,0 +1,83 @@ +/- +Copyright (c) 2026 Asher Yan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Asher Yan with Codex +-/ +import Verso +import VersoManual +import VersoBlueprint +import CryptBoolean.Carlet.Chapter04 + +open Verso.Genre +open Verso.Genre.Manual +open Informal + +#doc (Manual) "Resiliency and propagation" => + +:::definition "carlet-4-def-resiliency-correlation-immunity" (parent := "carlet-chapter-4") (lean := "CryptBoolean.signCubeView, CryptBoolean.signCubeView_toReal, CryptBoolean.IsCorrelationImmune, CryptBoolean.IsResilient, CryptBoolean.isCorrelationImmune_iff_fabl, CryptBoolean.isBalanced_iff_fabl, CryptBoolean.isResilient_iff_fabl, CryptBoolean.isResilient_iff_forall_coordinateRestriction_balanced, CryptBoolean.isCorrelationImmune_iff_fixing_exactly, CryptBoolean.isResilient_iff_fixing_exactly") (uses := "carlet-2-balanced-zero-walsh") (tags := "carlet, chapter-4, definition-3, resiliency, correlation-immunity, pages-55-56, fidelity-exact") +*Definition 3 (Carlet, pp. 55--56).* Let $`n>0` and $`0\le m do + let .ok label := fromJson? (α := String) data + | Verso.reportError s!"Malformed bibliography link: {data}" + pure .empty + let body ← contents.mapM go + let anchor := "bp-bib-" ++ Informal.Cite.citationAnchorId label + pure <| .raw ("\\hyperlink{" ++ anchor ++ "}{") ++ body ++ .raw "}" + toHtml := + some <| fun go _id _data contents => + contents.mapM go + +open Verso Doc Elab in +private def citeItemTerm (label : String) (declaration : Lean.Name) : + DocElabM (TSyntax `term) := + `(Informal.Cite.CiteItem.mk $(quote label) $(mkIdent declaration)) + +open Verso Doc Elab in +private def linkedCitationTerm (label : String) (item : TSyntax `term) + (style : Informal.Cite.CitationStyle) + (kind : Option Informal.Cite.CitePartKind) (index : Option String) + (contents : Array (TSyntax `term)) : DocElabM (TSyntax `term) := do + let citation ← + `(Verso.Doc.Inline.other + (Informal.Cite.Inline.bpCite + ([$item] : List Informal.Cite.CiteItem) + $(quote style) + $(quote kind) + $(quote index)) + #[$contents,*]) + `(Verso.Doc.Inline.other + (Citations.Inline.referenceLink $(quote label)) + #[$citation]) + +private def intersperse (separator : TSyntax `term) (items : Array (TSyntax `term)) : + Array (TSyntax `term) := + items.foldl (init := #[]) fun output item => + if output.isEmpty then output.push item else output.push separator |>.push item + +open Verso Doc Elab in +private def groupedCitationTerm (style : Informal.Cite.CitationStyle) + (config : Informal.Cite.CiteConfig) (extra : Array (TSyntax `inline)) : + DocElabM (TSyntax `term) := do + let resolved ← + config.citations.mapM fun citation => + Informal.Cite.resolveCitation citation.syntax citation.val + let extraTerms ← extra.mapM elabInline + match resolved with + | [] => throwError "A bibliography citation must contain at least one key" + | [(label, declaration)] => + let item ← citeItemTerm label declaration + linkedCitationTerm label item style config.kind config.index extraTerms + | citations => + let itemStyle := + match style with + | .parenthetical => Informal.Cite.CitationStyle.here + | .textual => .textual + | .here => .here + let linked ← citations.toArray.mapM fun (label, declaration) => do + let item ← citeItemTerm label declaration + linkedCitationTerm label item itemStyle none none #[] + let separator ← `(Verso.Doc.Inline.text "; ") + let mut pieces := intersperse separator linked + if style == .parenthetical then + pieces := #[← `(Verso.Doc.Inline.text "(")] ++ pieces + if let some locator := Informal.Cite.locatorText config.kind config.index then + pieces := pieces.push (← `(Verso.Doc.Inline.text $(quote s!", {locator}"))) + unless extraTerms.isEmpty do + pieces := pieces.push (← `(Verso.Doc.Inline.text ", ")) ++ extraTerms + if style == .parenthetical then + pieces := pieces.push (← `(Verso.Doc.Inline.text ")")) + `(Verso.Doc.Inline.concat #[$pieces,*]) + +open Verso Doc Elab in +@[role] +def citep : RoleExpanderOf Informal.Cite.CiteConfig + | config, extra => groupedCitationTerm .parenthetical config extra + +open Verso Doc Elab in +@[role] +def citet : RoleExpanderOf Informal.Cite.CiteConfig + | config, extra => groupedCitationTerm .textual config extra + +open Verso Doc Elab in +@[role] +def citehere : RoleExpanderOf Informal.Cite.CiteConfig + | config, extra => groupedCitationTerm .here config extra + +end Citations diff --git a/blueprint-verso/CryptBooleanBlueprint/References.lean b/blueprint-verso/CryptBooleanBlueprint/References.lean new file mode 100644 index 0000000..b8042b8 --- /dev/null +++ b/blueprint-verso/CryptBooleanBlueprint/References.lean @@ -0,0 +1,90 @@ +/- +Copyright (c) 2026 Asher Yan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Asher Yan with Codex +-/ +import VersoManual.Basic +import VersoBlueprint.Commands.Bibliography +import CryptBooleanBlueprint.Sources + +namespace CryptBooleanBlueprint.References + +open Lean Elab +open Verso.Genre.Manual.Bibliography + +private partial def inlineText : Verso.Doc.Inline Verso.Genre.Manual → String + | .text value | .code value | .math _ value => value + | .bold contents | .emph contents | .concat contents | .other _ contents + | .link contents _ | .footnote _ contents => + contents.toList.foldl (init := "") fun output content => + output ++ inlineText content + | .linebreak value => value + | .image description _ => description + +private def referenceSortKey (entry : Informal.Commands.BibliographyEntry) : String := + let authors := + entry.citation.authors.map fun author => + inlineText (Bibliography.lastName author) + String.intercalate "\u0000" authors.toList ++ + "\u0000" ++ toString entry.citation.year ++ + "\u0000" ++ entry.label + +open Verso Doc Elab Genre Manual in +block_extension Block.references (bibliography : Informal.Commands.BibliographyData) where + data := toJson bibliography + traverse := Informal.Commands.Block.bibliography.descr.traverse + toHtml := Informal.Commands.Block.bibliography.descr.toHtml + extraCss := Informal.Commands.Block.bibliography.descr.extraCss + extraJs := Informal.Commands.Block.bibliography.descr.extraJs + usePackages := Informal.Commands.Block.bibliography.descr.usePackages + preamble := ["\\hypersetup{hidelinks}"] + toTeX := + open Verso.Output.TeX in + some <| fun goI _goB _id data _contents => do + let .ok bibliography := + fromJson? (α := Informal.Commands.BibliographyData) data + | Verso.reportError s!"Malformed references data: {data}" + pure .empty + let entries := + bibliography.entries.toArray.qsort + (fun left right => referenceSortKey left < referenceSortKey right) + let items ← entries.mapM fun entry => do + let rendered ← entry.citation.bibTeX goI + let anchor := "bp-bib-" ++ Informal.Cite.citationAnchorId entry.label + let anchored := + .raw ("\\hypertarget{" ++ anchor ++ "}{") ++ rendered ++ .raw "}" + pure \TeX{\item[] \Lean{anchored} s!"\n"} + let body := \TeX{\begin{description}\Lean{items}\end{description}} + pure <| + .raw "\\begingroup\n\\let\\href\\oldhref\n" ++ + body ++ + .raw "\n\\endgroup\n" + +open Verso Doc Elab Syntax PartElabM +private def mkReferencesPart (stx : Syntax) (endPos : String.Pos.Raw) : + PartElabM FinishedPart := do + let titlePreview := "References" + let titleSyntax ← `(inline | "References") + let expandedTitle ← #[titleSyntax].mapM (elabInline ·) + let metadata : Option (TSyntax `term) := some (← `(term| { number := false })) + let entries := Informal.Cite.allBibEntries (← getEnv) + let referenceTerms : Array (TSyntax `term) ← entries.toArray.mapM fun (label, declaration) => + `(Informal.Commands.BibliographyEntry.mk $(quote label) $(mkIdent declaration)) + let block ← + ``(Verso.Doc.Block.other + (CryptBooleanBlueprint.References.Block.references + (Informal.Commands.BibliographyData.mk + (entries := ([$referenceTerms,*] : List Informal.Commands.BibliographyEntry)))) + #[]) + pure <| FinishedPart.mk stx stx expandedTitle titlePreview metadata #[block] #[] endPos + +open Verso Doc Elab Syntax PartElabM in +@[part_command Lean.Doc.Syntax.command] +public meta def referencesCmd : PartCommand + | stx@`(block|command{references}) => do + let endPos := stx.getTailPos?.get! + closePartsUntil 1 endPos + addPart (← mkReferencesPart stx endPos) + | _ => (Lean.Elab.throwUnsupportedSyntax : PartElabM Unit) + +end CryptBooleanBlueprint.References diff --git a/blueprint-verso/CryptBooleanBlueprint/Sources.lean b/blueprint-verso/CryptBooleanBlueprint/Sources.lean new file mode 100644 index 0000000..7c0c96c --- /dev/null +++ b/blueprint-verso/CryptBooleanBlueprint/Sources.lean @@ -0,0 +1,12 @@ +/- +Copyright (c) 2026 Asher Yan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Asher Yan with Codex +-/ +import CryptBooleanBlueprint.BibTeX + +namespace CryptBooleanBlueprint.Sources + +load_bibtex "references.bib" + +end CryptBooleanBlueprint.Sources diff --git a/blueprint-verso/CryptBooleanBlueprint/references.bib b/blueprint-verso/CryptBooleanBlueprint/references.bib new file mode 100644 index 0000000..d9f756b --- /dev/null +++ b/blueprint-verso/CryptBooleanBlueprint/references.bib @@ -0,0 +1,128 @@ +@incollection{carlet2010, + author = {Claude Carlet}, + editor = {Yves Crama and Peter L. Hammer}, + title = {Boolean Functions for Cryptography and Error-Correcting Codes}, + booktitle = {Boolean Models and Methods in Mathematics, Computer Science, and Engineering, pp. 257--397}, + year = {2010}, + doi = {10.1017/CBO9780511780448.011} +} + +@book{cusickStanica2017, + author = {Thomas W. Cusick and Pantelimon Stănică}, + title = {Cryptographic Boolean Functions and Applications, Second Edition}, + publisher = {Academic Press}, + year = {2017}, + doi = {10.1016/C2016-0-00852-5} +} + +@book{odonnell2021, + author = {Ryan O'Donnell}, + title = {Analysis of Boolean Functions, May 2021 Revision}, + publisher = {Cambridge University Press}, + year = {2021}, + url = {https://arxiv.org/abs/2105.10386} +} + +@article{kasamiTokura1970, + author = {Tadao Kasami and Nobuki Tokura}, + title = {On the Weight Structure of Reed--Muller Codes}, + journal = {IEEE Transactions on Information Theory}, + year = {1970}, + volume = {16}, + number = {6}, + pages = {752--759}, + doi = {10.1109/TIT.1970.1054545} +} + +@article{kasamiTokuraAzumi1976, + author = {Tadao Kasami and Nobuki Tokura and Saburo Azumi}, + title = {On the Weight Enumeration of Weights Less than 2.5d of Reed--Muller Codes}, + journal = {Information and Control}, + year = {1976}, + volume = {30}, + number = {4}, + pages = {380--395}, + doi = {10.1016/S0019-9958(76)90355-7} +} + +@article{rodier2006, + author = {François Rodier}, + title = {Asymptotic Nonlinearity of Boolean Functions}, + journal = {Designs, Codes and Cryptography}, + year = {2006}, + volume = {40}, + number = {1}, + pages = {59--70}, + doi = {10.1007/s10623-005-6363-8} +} + +@article{carletMesnager2007, + author = {Claude Carlet and Sihem Mesnager}, + title = {Improving the Upper Bounds on the Covering Radii of Binary Reed--Muller Codes}, + journal = {IEEE Transactions on Information Theory}, + year = {2007}, + volume = {53}, + number = {1}, + pages = {162--173}, + doi = {10.1109/TIT.2006.887494} +} + +@article{borissovManevNikova2003, + author = {Yuri Borissov and Nickolai Manev and Svetla Nikova}, + title = {On the Non-Minimal Codewords in Binary Reed--Muller Codes}, + journal = {Discrete Applied Mathematics}, + year = {2003}, + volume = {128}, + number = {1}, + pages = {65--74}, + doi = {10.1016/S0166-218X(02)00436-5} +} + +@article{borissovManev2004, + author = {Yuri Borissov and Nickolai Manev}, + title = {Minimal Codewords in Linear Codes}, + journal = {Serdica Mathematical Journal}, + year = {2004}, + volume = {30}, + pages = {303--324}, + url = {https://www.math.bas.bg/serdica/2004/2004-303-324.pdf} +} + +@article{mesnagerOblaukhov2022, + author = {Sihem Mesnager and Alexey Oblaukhov}, + title = {Classification of the Codewords of Weights 16 and 18 of the Reed--Muller Code RM(n-3,n)}, + journal = {IEEE Transactions on Information Theory}, + year = {2022}, + volume = {68}, + number = {2}, + pages = {940--952}, + doi = {10.1109/TIT.2021.3128495} +} + +@article{pless1972, + author = {Vera Pless}, + title = {A Classification of Self-Orthogonal Codes over GF(2)}, + journal = {Discrete Mathematics}, + year = {1972}, + volume = {3}, + number = {1--3}, + pages = {209--246}, + doi = {10.1016/0012-365X(72)90034-9} +} + +@incollection{rainsSloane1998, + author = {Eric M. Rains and Neil J. A. Sloane}, + editor = {Vera S. Pless and W. Cary Huffman}, + title = {Self-Dual Codes}, + booktitle = {Handbook of Coding Theory, Volume I, pp. 177--294}, + year = {1998}, + url = {https://arxiv.org/abs/math/0208001} +} + +@incollection{russell2016, + author = {Nathan John Russell}, + title = {Self Dual Codes and the Indecomposable Building Blocks}, + booktitle = {Eastern Kentucky University Online Theses and Dissertations, no. 421}, + year = {2016}, + url = {https://encompass.eku.edu/etd/421/} +} diff --git a/blueprint-verso/lakefile.lean b/blueprint-verso/lakefile.lean index 724a153..983cd75 100644 --- a/blueprint-verso/lakefile.lean +++ b/blueprint-verso/lakefile.lean @@ -10,5 +10,25 @@ package CryptBooleanBlueprint where precompileModules := false leanOptions := #[⟨`experimental.module, true⟩] +input_file referencesBib where + path := "CryptBooleanBlueprint/references.bib" + text := true + +target referencesBibStamp pkg : System.FilePath := do + let bibliography ← referencesBib.fetch + let stamp := pkg.buildDir / "references.bib.stamp" + IO.FS.createDirAll pkg.buildDir + buildFileAfterDep (text := true) stamp bibliography fun bibliographyPath => do + let sourcesOlean := + pkg.buildDir / "lib" / "lean" / + "CryptBooleanBlueprint" / "Sources.olean" + let sourcesIlean := + pkg.buildDir / "lib" / "lean" / + "CryptBooleanBlueprint" / "Sources.ilean" + removeFileIfExists sourcesOlean + removeFileIfExists sourcesIlean + IO.FS.writeFile stamp (← IO.FS.readFile bibliographyPath) + @[default_target] lean_lib CryptBooleanBlueprint where + extraDepTargets := #[`referencesBibStamp] diff --git a/blueprint-verso/scripts/check_statement_style.py b/blueprint-verso/scripts/check_statement_style.py index 17e106b..2a075f2 100644 --- a/blueprint-verso/scripts/check_statement_style.py +++ b/blueprint-verso/scripts/check_statement_style.py @@ -12,7 +12,7 @@ ROOT = Path(__file__).resolve().parents[1] SOURCE_ROOT = ROOT / "CryptBooleanBlueprint" / "Carlet" START = re.compile( - r'^:::(definition|theorem|proposition|corollary|lemma_)\s+"([^"]+)"(.*)$' + r'^:::(definition|theorem|proposition|corollary|lemma_?)\s+"([^"]+)"(.*)$' ) LABEL = re.compile(r"^\*[^*]+\.\*(?:\s|$)") MARKDOWN_LINK = re.compile(r"\[[^]]+\]\([^)]+\)") @@ -94,9 +94,9 @@ def main() -> None: errors.append(f"{location}: {block.identifier} must have {expected}, but not both") formalized = sum("(lean :=" in block.header for block in blocks) open_count = sum("source-open" in block.header for block in blocks) - if (len(blocks), formalized, open_count) != (43, 41, 2): + if (len(blocks), formalized, open_count) != (116, 115, 1): errors.append( - "expected 43 statements split into 41 formalized and 2 open; " + "expected 116 statements split into 115 formalized and 1 open; " f"found {len(blocks)}, {formalized}, and {open_count}" ) if errors: diff --git a/blueprint-verso/scripts/validate_manifest.py b/blueprint-verso/scripts/validate_manifest.py index 83b4967..01209ba 100755 --- a/blueprint-verso/scripts/validate_manifest.py +++ b/blueprint-verso/scripts/validate_manifest.py @@ -8,21 +8,22 @@ from pathlib import Path -EXPECTED_STATEMENTS = 43 -EXPECTED_FORMALIZED = 41 -EXPECTED_DECLARATIONS = 180 -EXPECTED_EDGES = 64 +EXPECTED_STATEMENTS = 116 +EXPECTED_FORMALIZED = 115 +EXPECTED_DECLARATIONS = 759 +EXPECTED_EDGES = 223 EXPECTED_CHAPTERS = { "chapter-2": 36, "chapter-3": 7, + "chapter-4": 73, } EXPECTED_GROUPS = { "«carlet-chapter-2»": 36, "«carlet-chapter-3»": 7, + "«carlet-chapter-4»": 73, } EXPECTED_OPEN = { "carlet-2-trace-monomial-degree", - "carlet-3-prop-12", } From bf2e8515c1125d63ece6d6d071d2840759cbac9e Mon Sep 17 00:00:00 2001 From: Asher Yan Date: Thu, 23 Jul 2026 09:29:46 -0400 Subject: [PATCH 2/7] Satisfy heartbeat style lint --- ...HigherOrderOrderTwoWeightSixteenNormalizedClassification.lean | 1 + .../HigherOrderOrderTwoWeightSixteenNormalizedClassifier.lean | 1 + .../HigherOrderOrderTwoWeightSixteenOrbitSoundness.lean | 1 + 3 files changed, 3 insertions(+) diff --git a/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenNormalizedClassification.lean b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenNormalizedClassification.lean index 51318b9..240338e 100644 --- a/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenNormalizedClassification.lean +++ b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenNormalizedClassification.lean @@ -93,6 +93,7 @@ local macro_rules declarations.map (·.raw) ++ #[dispatcherDeclaration.raw] set_option maxRecDepth 100000 in +set_option linter.style.maxHeartbeats false in set_option maxHeartbeats 20000000 in normalized_weight_sixteen_classification systematicWeightSixteen_generated_of_constraints where diff --git a/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenNormalizedClassifier.lean b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenNormalizedClassifier.lean index 86b9cce..12ce9e6 100644 --- a/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenNormalizedClassifier.lean +++ b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenNormalizedClassifier.lean @@ -764,6 +764,7 @@ def IsSystematicWeightSixteenPrefixAllowed (code : BitVec 64) : Bool := code.extractLsb' 0 16 == BitVec.ofNat 16 47487 || code.extractLsb' 0 16 == BitVec.ofNat 16 49023))))))))) +set_option linter.style.maxHeartbeats false in set_option maxHeartbeats 20000000 in /-- Every systematic orthonormal-column code has one of the generated two-column prefixes. -/ diff --git a/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenOrbitSoundness.lean b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenOrbitSoundness.lean index eeacefe..785fdc2 100644 --- a/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenOrbitSoundness.lean +++ b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenOrbitSoundness.lean @@ -28,6 +28,7 @@ namespace CryptBoolean variable {n : ℕ} set_option maxRecDepth 100000 in +set_option linter.style.maxHeartbeats false in set_option maxHeartbeats 3000000 in /-- Each canonical rank-seven pattern indicator has algebraic degree at most four. -/ From b3d3395fbb7355eb5bf2f298ca065d28322eea6b Mon Sep 17 00:00:00 2001 From: Asher Yan Date: Thu, 23 Jul 2026 10:25:03 -0400 Subject: [PATCH 3/7] Generate weight-sixteen certificates on demand --- .gitignore | 1 + CryptBoolean/Carlet/Chapter04.lean | 1 - .../HigherOrderOrderTwoMomentDifference.lean | 2 +- .../HigherOrderOrderTwoWeightSixteen.lean | 858 +- .../AffineMaps.lean} | 0 .../Basic.lean | 863 + .../CandidateCertificates.lean} | 2 +- .../CandidateDecode.lean} | 2 +- .../CandidateSoundness.lean} | 2 +- .../CharacterBound.lean} | 2 +- .../NormalizedClassification.lean} | 4 +- .../NormalizedClassifier.lean} | 2 +- .../OrbitAggregation.lean} | 4 +- .../OrbitDisjointness.lean} | 2 +- .../OrbitPairwiseDisjoint.lean} | 4 +- .../OrbitSoundness.lean} | 4 +- .../OrbitSums.lean} | 2 +- .../PatternOrbitSums.lean} | 4 +- .../RankSevenClassification.lean} | 6 +- .../RankSevenPatterns.lean} | 2 +- .../SupportNormalization.lean} | 2 +- .../SystematicEncoding.lean} | 2 +- ...erOrderTwoWeightSixteenClassification.lean | 2065 -- ...rTwoWeightSixteenNormalizedCandidates.lean | 24648 ---------------- ...HigherOrderOrderTwoWeightSixteenTypeA.lean | 750 - .../Chapter04/HigherOrderNonlinearity.lean | 2 +- lakefile.lean | 31 +- ...te_normalized_weight_sixteen_candidates.py | 433 + 28 files changed, 1358 insertions(+), 28342 deletions(-) rename CryptBoolean/Carlet/Chapter04/{HigherOrderOrderTwoWeightSixteenAffineMaps.lean => HigherOrderOrderTwoWeightSixteen/AffineMaps.lean} (100%) create mode 100644 CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteen/Basic.lean rename CryptBoolean/Carlet/Chapter04/{HigherOrderOrderTwoWeightSixteenCandidateSoundnessCertificates.lean => HigherOrderOrderTwoWeightSixteen/CandidateCertificates.lean} (99%) rename CryptBoolean/Carlet/Chapter04/{HigherOrderOrderTwoWeightSixteenNormalizedCandidateDecode.lean => HigherOrderOrderTwoWeightSixteen/CandidateDecode.lean} (98%) rename CryptBoolean/Carlet/Chapter04/{HigherOrderOrderTwoWeightSixteenCandidateSoundness.lean => HigherOrderOrderTwoWeightSixteen/CandidateSoundness.lean} (99%) rename CryptBoolean/Carlet/Chapter04/{HigherOrderOrderTwoWeightSixteenCharacterBound.lean => HigherOrderOrderTwoWeightSixteen/CharacterBound.lean} (96%) rename CryptBoolean/Carlet/Chapter04/{HigherOrderOrderTwoWeightSixteenNormalizedClassification.lean => HigherOrderOrderTwoWeightSixteen/NormalizedClassification.lean} (99%) rename CryptBoolean/Carlet/Chapter04/{HigherOrderOrderTwoWeightSixteenNormalizedClassifier.lean => HigherOrderOrderTwoWeightSixteen/NormalizedClassifier.lean} (99%) rename CryptBoolean/Carlet/Chapter04/{HigherOrderOrderTwoWeightSixteenOrbitAggregation.lean => HigherOrderOrderTwoWeightSixteen/OrbitAggregation.lean} (99%) rename CryptBoolean/Carlet/Chapter04/{HigherOrderOrderTwoWeightSixteenOrbitDisjointness.lean => HigherOrderOrderTwoWeightSixteen/OrbitDisjointness.lean} (99%) rename CryptBoolean/Carlet/Chapter04/{HigherOrderOrderTwoWeightSixteenOrbitPairwiseDisjoint.lean => HigherOrderOrderTwoWeightSixteen/OrbitPairwiseDisjoint.lean} (96%) rename CryptBoolean/Carlet/Chapter04/{HigherOrderOrderTwoWeightSixteenOrbitSoundness.lean => HigherOrderOrderTwoWeightSixteen/OrbitSoundness.lean} (99%) rename CryptBoolean/Carlet/Chapter04/{HigherOrderOrderTwoWeightSixteenOrbitSums.lean => HigherOrderOrderTwoWeightSixteen/OrbitSums.lean} (99%) rename CryptBoolean/Carlet/Chapter04/{HigherOrderOrderTwoWeightSixteenPatternOrbitSums.lean => HigherOrderOrderTwoWeightSixteen/PatternOrbitSums.lean} (99%) rename CryptBoolean/Carlet/Chapter04/{HigherOrderOrderTwoWeightSixteenRankSevenClassification.lean => HigherOrderOrderTwoWeightSixteen/RankSevenClassification.lean} (99%) rename CryptBoolean/Carlet/Chapter04/{HigherOrderOrderTwoWeightSixteenRankSevenPatterns.lean => HigherOrderOrderTwoWeightSixteen/RankSevenPatterns.lean} (99%) rename CryptBoolean/Carlet/Chapter04/{HigherOrderOrderTwoWeightSixteenSupportNormalization.lean => HigherOrderOrderTwoWeightSixteen/SupportNormalization.lean} (99%) rename CryptBoolean/Carlet/Chapter04/{HigherOrderOrderTwoWeightSixteenSystematicEncoding.lean => HigherOrderOrderTwoWeightSixteen/SystematicEncoding.lean} (98%) delete mode 100644 CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenClassification.lean delete mode 100644 CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenNormalizedCandidates.lean delete mode 100644 CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenTypeA.lean create mode 100644 scripts/generate_normalized_weight_sixteen_candidates.py diff --git a/.gitignore b/.gitignore index d803175..29370ef 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ cryptographic_boolean_functions_and_applications/ *.olean *.ilean *.trace +CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteen/NormalizedCandidates.lean diff --git a/CryptBoolean/Carlet/Chapter04.lean b/CryptBoolean/Carlet/Chapter04.lean index c420724..29ddf60 100644 --- a/CryptBoolean/Carlet/Chapter04.lean +++ b/CryptBoolean/Carlet/Chapter04.lean @@ -24,7 +24,6 @@ public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightEight public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightTwelveClassification public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightFourteenClassification public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightSixteen -public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightSixteenRankSevenClassification public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoLowWeightSpectrum public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoAsymptotics public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoMomentDifference diff --git a/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoMomentDifference.lean b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoMomentDifference.lean index b9f09eb..cfc7671 100644 --- a/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoMomentDifference.lean +++ b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoMomentDifference.lean @@ -9,7 +9,7 @@ public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoAsymptotics public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoLowWeightSpectrum public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightEight public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightFourteen -public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightSixteen +public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightSixteen.Basic public import CryptBoolean.Carlet.Chapter04.HigherOrderTupleCountDifferences /-! diff --git a/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteen.lean b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteen.lean index 9184d6c..32b8be8 100644 --- a/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteen.lean +++ b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteen.lean @@ -5,859 +5,13 @@ Authors: Asher Yan with Codex -/ module -public import CryptBoolean.Carlet.Chapter04.HigherOrderLowWeightFlats -public import Mathlib.LinearAlgebra.AffineSpace.FiniteDimensional -public import Mathlib.LinearAlgebra.Dual.Basis +public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightSixteen.Basic +public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightSixteen.RankSevenClassification /-! -# The weight-sixteen dual character sum +# Weight-sixteen dual words -The disjoint-three-flat square-sum argument behind Carlet--Mesnager -Proposition 9.2.10(4). +The low-weight dual-code analysis, normalized finite classification, affine +orbit estimates, and rank-seven character bound used in the sharp +higher-order nonlinearity theorem. -/ - -open Finset -open scoped BigOperators BooleanCube - -@[expose] public section - -namespace CryptBoolean - -open FABL - -variable {n : ℕ} - -noncomputable local instance weightSixteenFintypeAffineSubspace : Fintype - (AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) := - Fintype.ofFinite _ - -noncomputable local instance weightSixteenDecidableEqAffineSubspace : DecidableEq - (AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) := - Classical.decEq _ - -noncomputable local instance weightSixteenFintypeDual - (H : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) : - Fintype (Module.Dual FABL.𝔽₂ H) := - Module.fintypeOfFintype (Module.finBasis FABL.𝔽₂ H).dualBasis - -/-- Ordered pairs of binary affine three-flats. -/ -noncomputable def binaryAffineThreeFlatPairs (n : ℕ) : - Finset (AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × - AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) := - (binaryAffineFlats 3 n).product (binaryAffineFlats 3 n) - -/-- Ordered pairs of disjoint binary affine three-flats. -/ -noncomputable def disjointBinaryAffineThreeFlatPairs (n : ℕ) : - Finset (AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × - AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) := by - classical - exact (binaryAffineThreeFlatPairs n).filter fun p ↦ p.1 ⊓ p.2 = ⊥ - -/-- Ordered pairs of intersecting binary affine three-flats. -/ -noncomputable def intersectingBinaryAffineThreeFlatPairs (n : ℕ) : - Finset (AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × - AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) := by - classical - exact (binaryAffineThreeFlatPairs n).filter fun p ↦ p.1 ⊓ p.2 ≠ ⊥ - -/-- The Boolean word represented by two affine three-flats. -/ -noncomputable def weightSixteenRepresentationWord - (A B : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) : - BooleanFunction n := - binaryAffineFlatIndicator A + binaryAffineFlatIndicator B - -/-- The weight-sixteen words in the dual Reed--Muller code. -/ -noncomputable def orderTwoWeightSixteenDualWords (n : ℕ) : - Finset (BooleanFunction n) := by - classical - exact (orderTwoDualWords n).filter fun h ↦ hammingWeight h = 16 - -/-- The canonical character sum over weight-sixteen dual words. -/ -noncomputable def orderTwoWeightSixteenCharacterSum - (f : BooleanFunction n) : ℝ := - ∑ h ∈ orderTwoWeightSixteenDualWords n, - FABL.binarySign (booleanFunctionPairing n f h) - -/-- The normalized character sum over ordered disjoint-flat -representations. -/ -noncomputable def weightSixteenRepresentationCharacterSum - (f : BooleanFunction n) : ℝ := - (1 / 2 : ℝ) * - ∑ p ∈ disjointBinaryAffineThreeFlatPairs n, - binaryAffineFlatCharacter f p.1 * binaryAffineFlatCharacter f p.2 - -private theorem affineThreeFlatPairData - {A B : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)} - (hp : (A, B) ∈ binaryAffineThreeFlatPairs n) : - A ∈ binaryAffineFlats 3 n ∧ B ∈ binaryAffineFlats 3 n := by - change (A, B) ∈ (binaryAffineFlats 3 n).product - (binaryAffineFlats 3 n) at hp - exact Finset.mem_product.mp hp - -private theorem affineThreeFlatData - {A : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)} - (hA : A ∈ binaryAffineFlats 3 n) : - A ≠ ⊥ ∧ Module.finrank FABL.𝔽₂ A.direction = 3 := by - simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, - true_and] using hA - -private theorem disjointAffineThreeFlatPairData - {A B : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)} - (hp : (A, B) ∈ disjointBinaryAffineThreeFlatPairs n) : - A ∈ binaryAffineFlats 3 n ∧ B ∈ binaryAffineFlats 3 n ∧ - A ⊓ B = ⊥ := by - have hp' : (A, B) ∈ binaryAffineThreeFlatPairs n ∧ A ⊓ B = ⊥ := by - simpa only [disjointBinaryAffineThreeFlatPairs, - Finset.mem_filter] using hp - exact ⟨(affineThreeFlatPairData hp'.1).1, - (affineThreeFlatPairData hp'.1).2, hp'.2⟩ - -private theorem binaryAffineFlatPoints_inter_eq_empty - (A B : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) - (hdisjoint : A ⊓ B = ⊥) : - binaryAffineFlatPoints A ∩ binaryAffineFlatPoints B = ∅ := by - ext x - constructor - · intro hx - exfalso - have hx' := Finset.mem_inter.mp hx - have hxMeet : x ∈ A ⊓ B := by - exact ⟨(mem_binaryAffineFlatPoints A x).mp hx'.1, - (mem_binaryAffineFlatPoints B x).mp hx'.2⟩ - rw [hdisjoint] at hxMeet - rw [← SetLike.mem_coe, AffineSubspace.bot_coe] at hxMeet - simp at hxMeet - · intro hx - simp at hx - -/-- A disjoint pair of affine three-flats represents a word of Hamming -weight sixteen. -/ -theorem hammingWeight_weightSixteenRepresentationWord - (A B : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) - (hp : (A, B) ∈ disjointBinaryAffineThreeFlatPairs n) : - hammingWeight (weightSixteenRepresentationWord A B) = 16 := by - have hpdata := disjointAffineThreeFlatPairData hp - have hAdata := affineThreeFlatData hpdata.1 - have hBdata := affineThreeFlatData hpdata.2.1 - have hintersection := binaryAffineFlatPoints_inter_eq_empty - A B hpdata.2.2 - have hidentity := hammingWeight_add_add_two_mul_card_support_inter - (binaryAffineFlatIndicator A) (binaryAffineFlatIndicator B) - rw [support_binaryAffineFlatIndicator, - support_binaryAffineFlatIndicator, hintersection, - hammingWeight_binaryAffineFlatIndicator A hAdata.1, - hammingWeight_binaryAffineFlatIndicator B hBdata.1, - hAdata.2, hBdata.2] at hidentity - change hammingWeight - (binaryAffineFlatIndicator A + binaryAffineFlatIndicator B) = 16 - norm_num at hidentity - omega - -/-- Every disjoint-three-flat representation produces a weight-sixteen -dual Reed--Muller word. -/ -theorem weightSixteenRepresentationWord_mem_dualWords - (A B : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) - (hp : (A, B) ∈ disjointBinaryAffineThreeFlatPairs n) : - weightSixteenRepresentationWord A B ∈ - orderTwoWeightSixteenDualWords n := by - have hpdata := disjointAffineThreeFlatPairData hp - have hA := binaryAffineFlatIndicator_mem_reedMuller A hpdata.1 - have hB := binaryAffineFlatIndicator_mem_reedMuller B hpdata.2.1 - simp only [orderTwoWeightSixteenDualWords, orderTwoDualWords, - Finset.mem_filter, Finset.mem_univ, true_and] - exact ⟨(reedMuller (n - 3) n).add_mem hA hB, - hammingWeight_weightSixteenRepresentationWord A B hp⟩ - -/-- The character of a represented word is the product of its two -affine-flat characters. -/ -theorem weightSixteenRepresentationWord_character - (f : BooleanFunction n) - (A B : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) : - FABL.binarySign (booleanFunctionPairing n f - (weightSixteenRepresentationWord A B)) = - binaryAffineFlatCharacter f A * binaryAffineFlatCharacter f B := by - rw [weightSixteenRepresentationWord, map_add, AddChar.map_add_eq_mul] - rfl - -/-- The type-`a` exceptional words: indicators of affine four-flats. -/ -noncomputable def orderTwoWeightSixteenTypeAWords (n : ℕ) : - Finset (BooleanFunction n) := by - classical - exact (binaryAffineFlats 4 n).image binaryAffineFlatIndicator - -/-- Every affine-four-flat indicator is a weight-sixteen word in the dual -Reed--Muller code. -/ -theorem orderTwoWeightSixteenTypeAWords_subset_dualWords (n : ℕ) : - orderTwoWeightSixteenTypeAWords n ⊆ orderTwoWeightSixteenDualWords n := by - classical - intro h hh - obtain ⟨A, hA, rfl⟩ := Finset.mem_image.mp hh - have hAdata : A ≠ ⊥ ∧ Module.finrank FABL.𝔽₂ A.direction = 4 := by - simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, - true_and] using hA - have hmemComplementary := binaryAffineFlatIndicator_mem_reedMuller A hA - have hmem : binaryAffineFlatIndicator A ∈ reedMuller (n - 3) n := - reedMuller_mono (by omega : n - 4 ≤ n - 3) hmemComplementary - have hweight : hammingWeight (binaryAffineFlatIndicator A) = 16 := by - rw [hammingWeight_binaryAffineFlatIndicator A hAdata.1, hAdata.2] - norm_num - simpa only [orderTwoWeightSixteenDualWords, orderTwoDualWords, - Finset.mem_filter, Finset.mem_univ, true_and] using ⟨hmem, hweight⟩ - -private theorem exists_spanning_quadruple_of_finrank_four - (H : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) - (hH : Module.finrank FABL.𝔽₂ H = 4) : - ∃ a b c d : FABL.F₂Cube n, - H = (((FABL.𝔽₂ ∙ a) ⊔ (FABL.𝔽₂ ∙ b)) ⊔ - (FABL.𝔽₂ ∙ c)) ⊔ (FABL.𝔽₂ ∙ d) := by - have hbotlt : (⊥ : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) < H := by - apply bot_lt_iff_ne_bot.mpr - intro hHbot - rw [hHbot, finrank_bot] at hH - omega - obtain ⟨a, haH, haBot⟩ := SetLike.exists_of_lt hbotlt - have ha0 : a ≠ 0 := by - intro ha - subst a - exact haBot (Submodule.zero_mem _) - let S₁ : Submodule FABL.𝔽₂ (FABL.F₂Cube n) := FABL.𝔽₂ ∙ a - have hS₁le : S₁ ≤ H := - Submodule.span_le.2 (Set.singleton_subset_iff.2 haH) - have hS₁rank : Module.finrank FABL.𝔽₂ S₁ = 1 := - finrank_span_singleton ha0 - have hS₁lt : S₁ < H := - Submodule.lt_of_le_of_finrank_lt_finrank hS₁le (by omega) - obtain ⟨b, hbH, hbS₁⟩ := SetLike.exists_of_lt hS₁lt - let S₂ : Submodule FABL.𝔽₂ (FABL.F₂Cube n) := - S₁ ⊔ (FABL.𝔽₂ ∙ b) - have hS₂le : S₂ ≤ H := by - exact sup_le hS₁le - (Submodule.span_le.2 (Set.singleton_subset_iff.2 hbH)) - have hS₂rank : Module.finrank FABL.𝔽₂ S₂ = 2 := by - dsimp only [S₂] - rw [Submodule.finrank_sup_span_singleton hbS₁, hS₁rank] - have hS₂lt : S₂ < H := - Submodule.lt_of_le_of_finrank_lt_finrank hS₂le (by omega) - obtain ⟨c, hcH, hcS₂⟩ := SetLike.exists_of_lt hS₂lt - let S₃ : Submodule FABL.𝔽₂ (FABL.F₂Cube n) := - S₂ ⊔ (FABL.𝔽₂ ∙ c) - have hS₃le : S₃ ≤ H := by - exact sup_le hS₂le - (Submodule.span_le.2 (Set.singleton_subset_iff.2 hcH)) - have hS₃rank : Module.finrank FABL.𝔽₂ S₃ = 3 := by - dsimp only [S₃] - rw [Submodule.finrank_sup_span_singleton hcS₂, hS₂rank] - have hS₃lt : S₃ < H := - Submodule.lt_of_le_of_finrank_lt_finrank hS₃le (by omega) - obtain ⟨d, hdH, hdS₃⟩ := SetLike.exists_of_lt hS₃lt - refine ⟨a, b, c, d, ?_⟩ - symm - apply Submodule.eq_of_le_of_finrank_eq - · exact sup_le hS₃le - (Submodule.span_le.2 (Set.singleton_subset_iff.2 hdH)) - · rw [Submodule.finrank_sup_span_singleton hdS₃, hS₃rank, hH] - -private structure AffineFourFlatWitness - (A : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) where - u : FABL.F₂Cube n - a : FABL.F₂Cube n - b : FABL.F₂Cube n - c : FABL.F₂Cube n - d : FABL.F₂Cube n - flat_eq : A = FABL.binaryAffineSubspace - ((((FABL.𝔽₂ ∙ a) ⊔ (FABL.𝔽₂ ∙ b)) ⊔ - (FABL.𝔽₂ ∙ c)) ⊔ (FABL.𝔽₂ ∙ d)) u - -private noncomputable def affineFourFlatWitness - (A : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) - (hA : A ∈ binaryAffineFlats 4 n) : AffineFourFlatWitness A := by - classical - have hAdata : A ≠ ⊥ ∧ Module.finrank FABL.𝔽₂ A.direction = 4 := by - simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, - true_and] using hA - let u := Classical.choose - ((AffineSubspace.nonempty_iff_ne_bot A).2 hAdata.1) - have hu := Classical.choose_spec - ((AffineSubspace.nonempty_iff_ne_bot A).2 hAdata.1) - let hspanExists := - exists_spanning_quadruple_of_finrank_four A.direction hAdata.2 - let a := Classical.choose hspanExists - let b := Classical.choose (Classical.choose_spec hspanExists) - let c := Classical.choose - (Classical.choose_spec (Classical.choose_spec hspanExists)) - let d := Classical.choose (Classical.choose_spec - (Classical.choose_spec (Classical.choose_spec hspanExists))) - have hspan := Classical.choose_spec (Classical.choose_spec - (Classical.choose_spec (Classical.choose_spec hspanExists))) - refine ⟨u, a, b, c, d, ?_⟩ - calc - A = FABL.binaryAffineSubspace A.direction u := - (AffineSubspace.mk'_eq hu).symm - _ = FABL.binaryAffineSubspace - ((((FABL.𝔽₂ ∙ a) ⊔ (FABL.𝔽₂ ∙ b)) ⊔ - (FABL.𝔽₂ ∙ c)) ⊔ (FABL.𝔽₂ ∙ d)) u := by rw [hspan] - -private def affineFourFlatWitnessCode - {A : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)} - (w : AffineFourFlatWitness A) : Fin 5 → FABL.F₂Cube n := - ![w.u, w.a, w.b, w.c, w.d] - -private noncomputable def affineFourFlatCode - (A : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) : - Fin 5 → FABL.F₂Cube n := by - classical - exact if hA : A ∈ binaryAffineFlats 4 n then - affineFourFlatWitnessCode (affineFourFlatWitness A hA) - else 0 - -private theorem affineFourFlatCode_injective_on : - Set.InjOn (affineFourFlatCode (n := n)) - (binaryAffineFlats 4 n : - Set (AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n))) := by - intro A hA B hB hcode - have hA' : A ∈ binaryAffineFlats 4 n := hA - have hB' : B ∈ binaryAffineFlats 4 n := hB - let wA := affineFourFlatWitness A hA - let wB := affineFourFlatWitness B hB - have hcode' : affineFourFlatWitnessCode wA = - affineFourFlatWitnessCode wB := by - unfold affineFourFlatCode at hcode - rw [dif_pos hA', dif_pos hB'] at hcode - simpa only [wA, wB] using hcode - have h0 : wA.u = wB.u := by - simpa [affineFourFlatWitnessCode] using congrFun hcode' (0 : Fin 5) - have h1 : wA.a = wB.a := by - simpa [affineFourFlatWitnessCode] using congrFun hcode' (1 : Fin 5) - have h2 : wA.b = wB.b := by - simpa [affineFourFlatWitnessCode] using congrFun hcode' (2 : Fin 5) - have h3 : wA.c = wB.c := by - simpa [affineFourFlatWitnessCode] using congrFun hcode' (3 : Fin 5) - have h4 : wA.d = wB.d := by - simpa [affineFourFlatWitnessCode] using congrFun hcode' (4 : Fin 5) - rw [wA.flat_eq, wB.flat_eq, h0, h1, h2, h3, h4] - -/-- The type-`a` exceptional family has at most `(2^n)^5` words. -/ -theorem card_orderTwoWeightSixteenTypeAWords_le (n : ℕ) : - (orderTwoWeightSixteenTypeAWords n).card ≤ (2 ^ n) ^ 5 := by - classical - calc - (orderTwoWeightSixteenTypeAWords n).card ≤ - (binaryAffineFlats 4 n).card := by - exact Finset.card_image_le - _ ≤ (Finset.univ : Finset (Fin 5 → FABL.F₂Cube n)).card := by - apply Finset.card_le_card_of_injOn (affineFourFlatCode (n := n)) - · intro A _hA - exact Finset.mem_univ _ - · exact affineFourFlatCode_injective_on - _ = (2 ^ n) ^ 5 := by - rw [Finset.card_univ, Fintype.card_fun, Fintype.card_fin, card_f₂Cube] - -private noncomputable def nonzeroBinaryDuals - (H : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) : - Finset (Module.Dual FABL.𝔽₂ H) := by - classical - exact Finset.univ.filter fun ℓ ↦ ℓ ≠ 0 - -private theorem card_nonzeroBinaryDuals_of_finrank_four - (H : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) - (hH : Module.finrank FABL.𝔽₂ H = 4) : - (nonzeroBinaryDuals H).card = 15 := by - classical - let B : Module.Basis (Fin (Module.finrank FABL.𝔽₂ H)) FABL.𝔽₂ H := - Module.finBasis FABL.𝔽₂ H - have hcardDual : Fintype.card (Module.Dual FABL.𝔽₂ H) = 16 := by - calc - Fintype.card (Module.Dual FABL.𝔽₂ H) = - Fintype.card (Fin (Module.finrank FABL.𝔽₂ H) → FABL.𝔽₂) := - Fintype.card_congr B.dualBasis.equivFun.toEquiv - _ = 16 := by - rw [Fintype.card_fun, Fintype.card_fin, hH] - norm_num - have hfilter : nonzeroBinaryDuals H = - (Finset.univ : Finset (Module.Dual FABL.𝔽₂ H)).erase 0 := by - ext ℓ - simp [nonzeroBinaryDuals] - rw [hfilter, Finset.card_erase_of_mem (Finset.mem_univ 0), - Finset.card_univ, hcardDual] - -private theorem exists_spanning_triple_of_finrank_three - (H : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) - (hH : Module.finrank FABL.𝔽₂ H = 3) : - ∃ a b c : FABL.F₂Cube n, - H = ((FABL.𝔽₂ ∙ a) ⊔ (FABL.𝔽₂ ∙ b)) ⊔ - (FABL.𝔽₂ ∙ c) := by - have hbotlt : (⊥ : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) < H := by - apply bot_lt_iff_ne_bot.mpr - intro hHbot - rw [hHbot, finrank_bot] at hH - omega - obtain ⟨a, haH, haBot⟩ := SetLike.exists_of_lt hbotlt - have ha0 : a ≠ 0 := by - intro ha - subst a - exact haBot (Submodule.zero_mem _) - let S₁ : Submodule FABL.𝔽₂ (FABL.F₂Cube n) := FABL.𝔽₂ ∙ a - have hS₁le : S₁ ≤ H := - Submodule.span_le.2 (Set.singleton_subset_iff.2 haH) - have hS₁rank : Module.finrank FABL.𝔽₂ S₁ = 1 := - finrank_span_singleton ha0 - have hS₁lt : S₁ < H := - Submodule.lt_of_le_of_finrank_lt_finrank hS₁le (by omega) - obtain ⟨b, hbH, hbS₁⟩ := SetLike.exists_of_lt hS₁lt - let S₂ : Submodule FABL.𝔽₂ (FABL.F₂Cube n) := - S₁ ⊔ (FABL.𝔽₂ ∙ b) - have hS₂le : S₂ ≤ H := by - exact sup_le hS₁le - (Submodule.span_le.2 (Set.singleton_subset_iff.2 hbH)) - have hS₂rank : Module.finrank FABL.𝔽₂ S₂ = 2 := by - dsimp only [S₂] - rw [Submodule.finrank_sup_span_singleton hbS₁, hS₁rank] - have hS₂lt : S₂ < H := - Submodule.lt_of_le_of_finrank_lt_finrank hS₂le (by omega) - obtain ⟨c, hcH, hcS₂⟩ := SetLike.exists_of_lt hS₂lt - refine ⟨a, b, c, ?_⟩ - symm - apply Submodule.eq_of_le_of_finrank_eq - · exact sup_le hS₂le - (Submodule.span_le.2 (Set.singleton_subset_iff.2 hcH)) - · rw [Submodule.finrank_sup_span_singleton hcS₂, hS₂rank, hH] - -private structure IntersectingAffineThreeFlatPairWitness - (p : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × - AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) where - u : FABL.F₂Cube n - a₁ : FABL.F₂Cube n - b₁ : FABL.F₂Cube n - c₁ : FABL.F₂Cube n - a₂ : FABL.F₂Cube n - b₂ : FABL.F₂Cube n - c₂ : FABL.F₂Cube n - first_eq : p.1 = FABL.binaryAffineSubspace - (((FABL.𝔽₂ ∙ a₁) ⊔ (FABL.𝔽₂ ∙ b₁)) ⊔ - (FABL.𝔽₂ ∙ c₁)) u - second_eq : p.2 = FABL.binaryAffineSubspace - (((FABL.𝔽₂ ∙ a₂) ⊔ (FABL.𝔽₂ ∙ b₂)) ⊔ - (FABL.𝔽₂ ∙ c₂)) u - -private noncomputable def intersectingAffineThreeFlatPairWitness - (p : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × - AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) - (hp : p ∈ intersectingBinaryAffineThreeFlatPairs n) : - IntersectingAffineThreeFlatPairWitness p := by - classical - have hp' : p ∈ binaryAffineThreeFlatPairs n ∧ p.1 ⊓ p.2 ≠ ⊥ := by - simpa only [intersectingBinaryAffineThreeFlatPairs, - Finset.mem_filter] using hp - have hpdata := affineThreeFlatPairData hp'.1 - have hfirstData := affineThreeFlatData hpdata.1 - have hsecondData := affineThreeFlatData hpdata.2 - let u := Classical.choose - ((AffineSubspace.nonempty_iff_ne_bot (p.1 ⊓ p.2)).2 hp'.2) - have hu := Classical.choose_spec - ((AffineSubspace.nonempty_iff_ne_bot (p.1 ⊓ p.2)).2 hp'.2) - let a₁ := Classical.choose - (exists_spanning_triple_of_finrank_three p.1.direction hfirstData.2) - let b₁ := Classical.choose (Classical.choose_spec - (exists_spanning_triple_of_finrank_three p.1.direction hfirstData.2)) - let c₁ := Classical.choose (Classical.choose_spec (Classical.choose_spec - (exists_spanning_triple_of_finrank_three p.1.direction hfirstData.2))) - have hfirstSpan := Classical.choose_spec (Classical.choose_spec - (Classical.choose_spec - (exists_spanning_triple_of_finrank_three p.1.direction hfirstData.2))) - let a₂ := Classical.choose - (exists_spanning_triple_of_finrank_three p.2.direction hsecondData.2) - let b₂ := Classical.choose (Classical.choose_spec - (exists_spanning_triple_of_finrank_three p.2.direction hsecondData.2)) - let c₂ := Classical.choose (Classical.choose_spec (Classical.choose_spec - (exists_spanning_triple_of_finrank_three p.2.direction hsecondData.2))) - have hsecondSpan := Classical.choose_spec (Classical.choose_spec - (Classical.choose_spec - (exists_spanning_triple_of_finrank_three p.2.direction hsecondData.2))) - refine ⟨u, a₁, b₁, c₁, a₂, b₂, c₂, ?_, ?_⟩ - · calc - p.1 = FABL.binaryAffineSubspace p.1.direction u := - (AffineSubspace.mk'_eq hu.1).symm - _ = FABL.binaryAffineSubspace - (((FABL.𝔽₂ ∙ a₁) ⊔ (FABL.𝔽₂ ∙ b₁)) ⊔ - (FABL.𝔽₂ ∙ c₁)) u := by rw [hfirstSpan] - · calc - p.2 = FABL.binaryAffineSubspace p.2.direction u := - (AffineSubspace.mk'_eq hu.2).symm - _ = FABL.binaryAffineSubspace - (((FABL.𝔽₂ ∙ a₂) ⊔ (FABL.𝔽₂ ∙ b₂)) ⊔ - (FABL.𝔽₂ ∙ c₂)) u := by rw [hsecondSpan] - -private def intersectingAffineThreeFlatPairWitnessCode - {p : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × - AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)} - (w : IntersectingAffineThreeFlatPairWitness p) : - Fin 7 → FABL.F₂Cube n := - ![w.u, w.a₁, w.b₁, w.c₁, w.a₂, w.b₂, w.c₂] - -private noncomputable def intersectingAffineThreeFlatPairCode - (p : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × - AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) : - Fin 7 → FABL.F₂Cube n := by - classical - exact if hp : p ∈ intersectingBinaryAffineThreeFlatPairs n then - intersectingAffineThreeFlatPairWitnessCode - (intersectingAffineThreeFlatPairWitness p hp) - else 0 - -private theorem intersectingAffineThreeFlatPairCode_injective_on : - Set.InjOn (intersectingAffineThreeFlatPairCode (n := n)) - (intersectingBinaryAffineThreeFlatPairs n : - Set (AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × - AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n))) := by - intro p hp q hq hcode - have hpFin : p ∈ intersectingBinaryAffineThreeFlatPairs n := hp - have hqFin : q ∈ intersectingBinaryAffineThreeFlatPairs n := hq - let wp := intersectingAffineThreeFlatPairWitness p hp - let wq := intersectingAffineThreeFlatPairWitness q hq - have hcode' : intersectingAffineThreeFlatPairWitnessCode wp = - intersectingAffineThreeFlatPairWitnessCode wq := by - unfold intersectingAffineThreeFlatPairCode at hcode - rw [dif_pos hpFin, dif_pos hqFin] at hcode - simpa only [wp, wq] using hcode - have h0 : wp.u = wq.u := by - simpa [intersectingAffineThreeFlatPairWitnessCode] using - congrFun hcode' (0 : Fin 7) - have h1 : wp.a₁ = wq.a₁ := by - simpa [intersectingAffineThreeFlatPairWitnessCode] using - congrFun hcode' (1 : Fin 7) - have h2 : wp.b₁ = wq.b₁ := by - simpa [intersectingAffineThreeFlatPairWitnessCode] using - congrFun hcode' (2 : Fin 7) - have h3 : wp.c₁ = wq.c₁ := by - simpa [intersectingAffineThreeFlatPairWitnessCode] using - congrFun hcode' (3 : Fin 7) - have h4 : wp.a₂ = wq.a₂ := by - simpa [intersectingAffineThreeFlatPairWitnessCode] using - congrFun hcode' (4 : Fin 7) - have h5 : wp.b₂ = wq.b₂ := by - simpa [intersectingAffineThreeFlatPairWitnessCode] using - congrFun hcode' (5 : Fin 7) - have h6 : wp.c₂ = wq.c₂ := by - simpa [intersectingAffineThreeFlatPairWitnessCode] using - congrFun hcode' (6 : Fin 7) - apply Prod.ext - · rw [wp.first_eq, wq.first_eq, h0, h1, h2, h3] - · rw [wp.second_eq, wq.second_eq, h0, h4, h5, h6] - -/-- Intersecting ordered pairs of affine three-flats inject into seven -ambient vectors. -/ -theorem card_intersectingBinaryAffineThreeFlatPairs_le (n : ℕ) : - (intersectingBinaryAffineThreeFlatPairs n).card ≤ (2 ^ n) ^ 7 := by - classical - calc - (intersectingBinaryAffineThreeFlatPairs n).card ≤ - (Finset.univ : Finset (Fin 7 → FABL.F₂Cube n)).card := by - apply Finset.card_le_card_of_injOn - (intersectingAffineThreeFlatPairCode (n := n)) - · intro p _hp - exact Finset.mem_univ _ - · exact intersectingAffineThreeFlatPairCode_injective_on - _ = (2 ^ n) ^ 7 := by - rw [Finset.card_univ, Fintype.card_fun, Fintype.card_fin, card_f₂Cube] - -private theorem allAffineThreeFlatPairCharacterSum_eq_sq - (f : BooleanFunction n) : - (∑ p ∈ binaryAffineThreeFlatPairs n, - binaryAffineFlatCharacter f p.1 * - binaryAffineFlatCharacter f p.2) = - (binaryAffineFlatCharacterSum 3 f) ^ 2 := by - classical - rw [binaryAffineThreeFlatPairs, binaryAffineFlatCharacterSum] - calc - (∑ p ∈ (binaryAffineFlats 3 n).product (binaryAffineFlats 3 n), - binaryAffineFlatCharacter f p.1 * - binaryAffineFlatCharacter f p.2) = - ∑ A ∈ binaryAffineFlats 3 n, - ∑ B ∈ binaryAffineFlats 3 n, - binaryAffineFlatCharacter f A * - binaryAffineFlatCharacter f B := by - exact Finset.sum_product _ _ _ - _ = (∑ A ∈ binaryAffineFlats 3 n, - binaryAffineFlatCharacter f A) ^ 2 := by - simp only [pow_two, Finset.mul_sum, mul_comm] - -private theorem affineThreeFlatPairCharacterSum_split - (f : BooleanFunction n) : - (∑ p ∈ binaryAffineThreeFlatPairs n, - binaryAffineFlatCharacter f p.1 * - binaryAffineFlatCharacter f p.2) = - (∑ p ∈ disjointBinaryAffineThreeFlatPairs n, - binaryAffineFlatCharacter f p.1 * - binaryAffineFlatCharacter f p.2) + - ∑ p ∈ intersectingBinaryAffineThreeFlatPairs n, - binaryAffineFlatCharacter f p.1 * - binaryAffineFlatCharacter f p.2 := by - have hsplit := Finset.sum_filter_add_sum_filter_not - (binaryAffineThreeFlatPairs n) (fun p ↦ p.1 ⊓ p.2 = ⊥) - (fun p ↦ binaryAffineFlatCharacter f p.1 * - binaryAffineFlatCharacter f p.2) - change - (∑ p ∈ disjointBinaryAffineThreeFlatPairs n, - binaryAffineFlatCharacter f p.1 * - binaryAffineFlatCharacter f p.2) + - (∑ p ∈ intersectingBinaryAffineThreeFlatPairs n, - binaryAffineFlatCharacter f p.1 * - binaryAffineFlatCharacter f p.2) = - ∑ p ∈ binaryAffineThreeFlatPairs n, - binaryAffineFlatCharacter f p.1 * - binaryAffineFlatCharacter f p.2 at hsplit - exact hsplit.symm - -private theorem binaryAffineFlatCharacter_mul_le_one - (f : BooleanFunction n) - (A B : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) : - binaryAffineFlatCharacter f A * binaryAffineFlatCharacter f B ≤ 1 := by - rcases binaryAffineFlatCharacter_eq_one_or_neg_one f A with hA | hA <;> - rcases binaryAffineFlatCharacter_eq_one_or_neg_one f B with hB | hB <;> - simp only [hA, hB] <;> norm_num - -private theorem intersectingAffineThreeFlatPairCharacterSum_le_card - (f : BooleanFunction n) : - (∑ p ∈ intersectingBinaryAffineThreeFlatPairs n, - binaryAffineFlatCharacter f p.1 * - binaryAffineFlatCharacter f p.2) ≤ - ((intersectingBinaryAffineThreeFlatPairs n).card : ℝ) := by - calc - (∑ p ∈ intersectingBinaryAffineThreeFlatPairs n, - binaryAffineFlatCharacter f p.1 * - binaryAffineFlatCharacter f p.2) ≤ - ∑ _p ∈ intersectingBinaryAffineThreeFlatPairs n, (1 : ℝ) := by - apply Finset.sum_le_sum - intro p _hp - exact binaryAffineFlatCharacter_mul_le_one f p.1 p.2 - _ = ((intersectingBinaryAffineThreeFlatPairs n).card : ℝ) := by simp - -private theorem disjointAffineThreeFlatPairCharacterSum_ge_neg_card - (f : BooleanFunction n) : - (∑ p ∈ disjointBinaryAffineThreeFlatPairs n, - binaryAffineFlatCharacter f p.1 * - binaryAffineFlatCharacter f p.2) ≥ - -((intersectingBinaryAffineThreeFlatPairs n).card : ℝ) := by - have hall : 0 ≤ ∑ p ∈ binaryAffineThreeFlatPairs n, - binaryAffineFlatCharacter f p.1 * - binaryAffineFlatCharacter f p.2 := by - rw [allAffineThreeFlatPairCharacterSum_eq_sq] - positivity - rw [affineThreeFlatPairCharacterSum_split] at hall - have hintersecting := - intersectingAffineThreeFlatPairCharacterSum_le_card f - linarith - -/-- The disjoint-three-flat representation sum has the `O((2^n)^7)` -lower bound required by the seventh/eighth moment argument. -/ -theorem weightSixteenRepresentationCharacterSum_ge - (f : BooleanFunction n) : - weightSixteenRepresentationCharacterSum f ≥ - -((2 ^ n : ℝ) ^ 7) / 2 := by - have hsum := disjointAffineThreeFlatPairCharacterSum_ge_neg_card f - have hcardNat := card_intersectingBinaryAffineThreeFlatPairs_le n - have hcardReal : - ((intersectingBinaryAffineThreeFlatPairs n).card : ℝ) ≤ - (((2 ^ n) ^ 7 : ℕ) : ℝ) := by - exact_mod_cast hcardNat - norm_num only [Nat.cast_pow, Nat.cast_ofNat] at hcardReal - calc - weightSixteenRepresentationCharacterSum f = - (1 / 2 : ℝ) * - ∑ p ∈ disjointBinaryAffineThreeFlatPairs n, - binaryAffineFlatCharacter f p.1 * - binaryAffineFlatCharacter f p.2 := rfl - _ ≥ (1 / 2 : ℝ) * - -((intersectingBinaryAffineThreeFlatPairs n).card : ℝ) := by - exact mul_le_mul_of_nonneg_left hsum (by norm_num) - _ ≥ -((2 ^ n : ℝ) ^ 7) / 2 := by - nlinarith - -/-- The ordered disjoint-flat representations of a Boolean word. -/ -noncomputable def weightSixteenRepresentationFiber - (h : BooleanFunction n) : - Finset (AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × - AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) := - (disjointBinaryAffineThreeFlatPairs n).filter fun p ↦ - weightSixteenRepresentationWord p.1 p.2 = h - -/-- The exact Kasami--Tokura exceptional-multiplicity interface. Type `a` -words have thirty ordered representations, type `b` words have six, and -all remaining weight-sixteen words have two. The zero fibers outside the -dual code also encode the existence classification. -/ -def HasWeightSixteenExceptionalMultiplicity - (typeA typeB : Finset (BooleanFunction n)) : Prop := - typeA ⊆ orderTwoWeightSixteenDualWords n ∧ - typeB ⊆ orderTwoWeightSixteenDualWords n ∧ - Disjoint typeA typeB ∧ - ∀ h : BooleanFunction n, - (weightSixteenRepresentationFiber h).card = - if h ∈ orderTwoWeightSixteenDualWords n then - if h ∈ typeA then 30 else if h ∈ typeB then 6 else 2 - else 0 - -/-- The coarse consequences of the exact exceptional-word counts: type -`a` contributes `O((2^n)^5)` words and type `b` contributes -`O((2^n)^6)`. -/ -def HasWeightSixteenExceptionalCountBounds - (typeA typeB : Finset (BooleanFunction n)) : Prop := - typeA.card ≤ (2 ^ n) ^ 5 ∧ typeB.card ≤ (2 ^ n) ^ 6 - -private theorem sum_ite_mem_subset - {s t : Finset (BooleanFunction n)} - (hst : s ⊆ t) (g : BooleanFunction n → ℝ) : - (∑ h ∈ t, if h ∈ s then g h else 0) = ∑ h ∈ s, g h := by - classical - rw [← Finset.sum_filter] - congr 1 - ext h - simp only [Finset.mem_filter] - constructor - · exact fun hh ↦ hh.2 - · exact fun hh ↦ ⟨hst hh, hh⟩ - -private theorem binarySign_le_one (b : FABL.𝔽₂) : - FABL.binarySign b ≤ 1 := by - by_cases hb : b = 0 - · rw [hb] - norm_num - · have hbOne : b = 1 := Fin.eq_one_of_ne_zero _ hb - rw [hbOne, FABL.binarySign_one] - norm_num - -private theorem booleanWordCharacterSum_le_card - (f : BooleanFunction n) (s : Finset (BooleanFunction n)) : - (∑ h ∈ s, FABL.binarySign (booleanFunctionPairing n f h)) ≤ - (s.card : ℝ) := by - calc - (∑ h ∈ s, FABL.binarySign (booleanFunctionPairing n f h)) ≤ - ∑ _h ∈ s, (1 : ℝ) := by - apply Finset.sum_le_sum - intro h _hh - exact binarySign_le_one (booleanFunctionPairing n f h) - _ = (s.card : ℝ) := by simp - -private theorem sum_disjointWeightSixteenRepresentations_eq - (f : BooleanFunction n) - (typeA typeB : Finset (BooleanFunction n)) - (hmultiplicity : HasWeightSixteenExceptionalMultiplicity typeA typeB) : - (∑ p ∈ disjointBinaryAffineThreeFlatPairs n, - binaryAffineFlatCharacter f p.1 * - binaryAffineFlatCharacter f p.2) = - 2 * orderTwoWeightSixteenCharacterSum f + - 28 * ∑ h ∈ typeA, - FABL.binarySign (booleanFunctionPairing n f h) + - 4 * ∑ h ∈ typeB, - FABL.binarySign (booleanFunctionPairing n f h) := by - classical - have htypeA := hmultiplicity.1 - have htypeB := hmultiplicity.2.1 - have hdisjoint := hmultiplicity.2.2.1 - have htypeASum := sum_ite_mem_subset htypeA - (fun h ↦ 28 * FABL.binarySign (booleanFunctionPairing n f h)) - have htypeBSum := sum_ite_mem_subset htypeB - (fun h ↦ 4 * FABL.binarySign (booleanFunctionPairing n f h)) - calc - (∑ p ∈ disjointBinaryAffineThreeFlatPairs n, - binaryAffineFlatCharacter f p.1 * - binaryAffineFlatCharacter f p.2) = - ∑ p ∈ disjointBinaryAffineThreeFlatPairs n, - FABL.binarySign (booleanFunctionPairing n f - (weightSixteenRepresentationWord p.1 p.2)) := by - apply Finset.sum_congr rfl - intro p _hp - rw [weightSixteenRepresentationWord_character] - _ = ∑ h ∈ orderTwoWeightSixteenDualWords n, - ∑ p ∈ weightSixteenRepresentationFiber h, - FABL.binarySign (booleanFunctionPairing n f - (weightSixteenRepresentationWord p.1 p.2)) := by - symm - unfold weightSixteenRepresentationFiber - apply Finset.sum_fiberwise_of_maps_to - intro p hp - exact weightSixteenRepresentationWord_mem_dualWords p.1 p.2 hp - _ = ∑ h ∈ orderTwoWeightSixteenDualWords n, - ((weightSixteenRepresentationFiber h).card : ℝ) * - FABL.binarySign (booleanFunctionPairing n f h) := by - apply Finset.sum_congr rfl - intro h _hh - calc - (∑ p ∈ weightSixteenRepresentationFiber h, - FABL.binarySign (booleanFunctionPairing n f - (weightSixteenRepresentationWord p.1 p.2))) = - ∑ _p ∈ weightSixteenRepresentationFiber h, - FABL.binarySign (booleanFunctionPairing n f h) := by - apply Finset.sum_congr rfl - intro p hp - rw [(Finset.mem_filter.mp hp).2] - _ = ((weightSixteenRepresentationFiber h).card : ℝ) * - FABL.binarySign (booleanFunctionPairing n f h) := by simp - _ = ∑ h ∈ orderTwoWeightSixteenDualWords n, - (2 * FABL.binarySign (booleanFunctionPairing n f h) + - (if h ∈ typeA then - 28 * FABL.binarySign (booleanFunctionPairing n f h) else 0) + - if h ∈ typeB then - 4 * FABL.binarySign (booleanFunctionPairing n f h) else 0) := by - apply Finset.sum_congr rfl - intro h hh - rw [hmultiplicity.2.2.2 h, if_pos hh] - by_cases hA : h ∈ typeA - · have hB : h ∉ typeB := by - intro hB - exact (Finset.disjoint_left.mp hdisjoint) hA hB - simp [hA, hB] - ring - · by_cases hB : h ∈ typeB - · simp [hA, hB] - ring - · simp [hA, hB] - _ = 2 * orderTwoWeightSixteenCharacterSum f + - 28 * ∑ h ∈ typeA, - FABL.binarySign (booleanFunctionPairing n f h) + - 4 * ∑ h ∈ typeB, - FABL.binarySign (booleanFunctionPairing n f h) := by - rw [Finset.sum_add_distrib, Finset.sum_add_distrib, - htypeASum, htypeBSum] - rw [← Finset.mul_sum, ← Finset.mul_sum, ← Finset.mul_sum] - rfl - -/-- Conditional on the cited exceptional-multiplicity classification, the -canonical weight-sixteen sum is the representation sum with the two -exceptional overcount corrections. -/ -theorem orderTwoWeightSixteenCharacterSum_eq_representation_sub_exceptions - (f : BooleanFunction n) - (typeA typeB : Finset (BooleanFunction n)) - (hmultiplicity : HasWeightSixteenExceptionalMultiplicity typeA typeB) : - orderTwoWeightSixteenCharacterSum f = - weightSixteenRepresentationCharacterSum f - - 14 * ∑ h ∈ typeA, - FABL.binarySign (booleanFunctionPairing n f h) - - 2 * ∑ h ∈ typeB, - FABL.binarySign (booleanFunctionPairing n f h) := by - rw [weightSixteenRepresentationCharacterSum, - sum_disjointWeightSixteenRepresentations_eq - f typeA typeB hmultiplicity] - ring - -/-- A conditional canonical lower bound retaining the sharper orders of -the two exceptional families. -/ -theorem orderTwoWeightSixteenCharacterSum_ge - (f : BooleanFunction n) - (typeA typeB : Finset (BooleanFunction n)) - (hmultiplicity : HasWeightSixteenExceptionalMultiplicity typeA typeB) - (hcounts : HasWeightSixteenExceptionalCountBounds typeA typeB) : - orderTwoWeightSixteenCharacterSum f ≥ - -((2 ^ n : ℝ) ^ 7) / 2 - 14 * (2 ^ n : ℝ) ^ 5 - - 2 * (2 ^ n : ℝ) ^ 6 := by - have hrepresentation := weightSixteenRepresentationCharacterSum_ge f - have htypeASum := booleanWordCharacterSum_le_card f typeA - have htypeBSum := booleanWordCharacterSum_le_card f typeB - have htypeACard : (typeA.card : ℝ) ≤ (2 ^ n : ℝ) ^ 5 := by - exact_mod_cast hcounts.1 - have htypeBCard : (typeB.card : ℝ) ≤ (2 ^ n : ℝ) ^ 6 := by - exact_mod_cast hcounts.2 - rw [orderTwoWeightSixteenCharacterSum_eq_representation_sub_exceptions - f typeA typeB hmultiplicity] - linarith - -end CryptBoolean diff --git a/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenAffineMaps.lean b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteen/AffineMaps.lean similarity index 100% rename from CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenAffineMaps.lean rename to CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteen/AffineMaps.lean diff --git a/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteen/Basic.lean b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteen/Basic.lean new file mode 100644 index 0000000..e0eb958 --- /dev/null +++ b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteen/Basic.lean @@ -0,0 +1,863 @@ +/- +Copyright (c) 2026 Asher Yan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Asher Yan with Codex +-/ +module + +public import CryptBoolean.Carlet.Chapter04.HigherOrderLowWeightFlats +public import Mathlib.LinearAlgebra.AffineSpace.FiniteDimensional +public import Mathlib.LinearAlgebra.Dual.Basis + +/-! +# Weight-sixteen dual words and character sums + +The disjoint-three-flat square-sum argument behind Carlet--Mesnager +Proposition 9.2.10(4). +-/ + +open Finset +open scoped BigOperators BooleanCube + +@[expose] public section + +namespace CryptBoolean + +open FABL + +variable {n : ℕ} + +noncomputable local instance weightSixteenFintypeAffineSubspace : Fintype + (AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) := + Fintype.ofFinite _ + +noncomputable local instance weightSixteenDecidableEqAffineSubspace : DecidableEq + (AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) := + Classical.decEq _ + +noncomputable local instance weightSixteenFintypeDual + (H : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) : + Fintype (Module.Dual FABL.𝔽₂ H) := + Module.fintypeOfFintype (Module.finBasis FABL.𝔽₂ H).dualBasis + +/-- Ordered pairs of binary affine three-flats. -/ +noncomputable def binaryAffineThreeFlatPairs (n : ℕ) : + Finset (AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × + AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) := + (binaryAffineFlats 3 n).product (binaryAffineFlats 3 n) + +/-- Ordered pairs of disjoint binary affine three-flats. -/ +noncomputable def disjointBinaryAffineThreeFlatPairs (n : ℕ) : + Finset (AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × + AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) := by + classical + exact (binaryAffineThreeFlatPairs n).filter fun p ↦ p.1 ⊓ p.2 = ⊥ + +/-- Ordered pairs of intersecting binary affine three-flats. -/ +noncomputable def intersectingBinaryAffineThreeFlatPairs (n : ℕ) : + Finset (AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × + AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) := by + classical + exact (binaryAffineThreeFlatPairs n).filter fun p ↦ p.1 ⊓ p.2 ≠ ⊥ + +/-- The Boolean word represented by two affine three-flats. -/ +noncomputable def weightSixteenRepresentationWord + (A B : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) : + BooleanFunction n := + binaryAffineFlatIndicator A + binaryAffineFlatIndicator B + +/-- The weight-sixteen words in the dual Reed--Muller code. -/ +noncomputable def orderTwoWeightSixteenDualWords (n : ℕ) : + Finset (BooleanFunction n) := by + classical + exact (orderTwoDualWords n).filter fun h ↦ hammingWeight h = 16 + +/-- The canonical character sum over weight-sixteen dual words. -/ +noncomputable def orderTwoWeightSixteenCharacterSum + (f : BooleanFunction n) : ℝ := + ∑ h ∈ orderTwoWeightSixteenDualWords n, + FABL.binarySign (booleanFunctionPairing n f h) + +/-- The normalized character sum over ordered disjoint-flat +representations. -/ +noncomputable def weightSixteenRepresentationCharacterSum + (f : BooleanFunction n) : ℝ := + (1 / 2 : ℝ) * + ∑ p ∈ disjointBinaryAffineThreeFlatPairs n, + binaryAffineFlatCharacter f p.1 * binaryAffineFlatCharacter f p.2 + +private theorem affineThreeFlatPairData + {A B : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)} + (hp : (A, B) ∈ binaryAffineThreeFlatPairs n) : + A ∈ binaryAffineFlats 3 n ∧ B ∈ binaryAffineFlats 3 n := by + change (A, B) ∈ (binaryAffineFlats 3 n).product + (binaryAffineFlats 3 n) at hp + exact Finset.mem_product.mp hp + +private theorem affineThreeFlatData + {A : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)} + (hA : A ∈ binaryAffineFlats 3 n) : + A ≠ ⊥ ∧ Module.finrank FABL.𝔽₂ A.direction = 3 := by + simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, + true_and] using hA + +private theorem disjointAffineThreeFlatPairData + {A B : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)} + (hp : (A, B) ∈ disjointBinaryAffineThreeFlatPairs n) : + A ∈ binaryAffineFlats 3 n ∧ B ∈ binaryAffineFlats 3 n ∧ + A ⊓ B = ⊥ := by + have hp' : (A, B) ∈ binaryAffineThreeFlatPairs n ∧ A ⊓ B = ⊥ := by + simpa only [disjointBinaryAffineThreeFlatPairs, + Finset.mem_filter] using hp + exact ⟨(affineThreeFlatPairData hp'.1).1, + (affineThreeFlatPairData hp'.1).2, hp'.2⟩ + +private theorem binaryAffineFlatPoints_inter_eq_empty + (A B : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) + (hdisjoint : A ⊓ B = ⊥) : + binaryAffineFlatPoints A ∩ binaryAffineFlatPoints B = ∅ := by + ext x + constructor + · intro hx + exfalso + have hx' := Finset.mem_inter.mp hx + have hxMeet : x ∈ A ⊓ B := by + exact ⟨(mem_binaryAffineFlatPoints A x).mp hx'.1, + (mem_binaryAffineFlatPoints B x).mp hx'.2⟩ + rw [hdisjoint] at hxMeet + rw [← SetLike.mem_coe, AffineSubspace.bot_coe] at hxMeet + simp at hxMeet + · intro hx + simp at hx + +/-- A disjoint pair of affine three-flats represents a word of Hamming +weight sixteen. -/ +theorem hammingWeight_weightSixteenRepresentationWord + (A B : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) + (hp : (A, B) ∈ disjointBinaryAffineThreeFlatPairs n) : + hammingWeight (weightSixteenRepresentationWord A B) = 16 := by + have hpdata := disjointAffineThreeFlatPairData hp + have hAdata := affineThreeFlatData hpdata.1 + have hBdata := affineThreeFlatData hpdata.2.1 + have hintersection := binaryAffineFlatPoints_inter_eq_empty + A B hpdata.2.2 + have hidentity := hammingWeight_add_add_two_mul_card_support_inter + (binaryAffineFlatIndicator A) (binaryAffineFlatIndicator B) + rw [support_binaryAffineFlatIndicator, + support_binaryAffineFlatIndicator, hintersection, + hammingWeight_binaryAffineFlatIndicator A hAdata.1, + hammingWeight_binaryAffineFlatIndicator B hBdata.1, + hAdata.2, hBdata.2] at hidentity + change hammingWeight + (binaryAffineFlatIndicator A + binaryAffineFlatIndicator B) = 16 + norm_num at hidentity + omega + +/-- Every disjoint-three-flat representation produces a weight-sixteen +dual Reed--Muller word. -/ +theorem weightSixteenRepresentationWord_mem_dualWords + (A B : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) + (hp : (A, B) ∈ disjointBinaryAffineThreeFlatPairs n) : + weightSixteenRepresentationWord A B ∈ + orderTwoWeightSixteenDualWords n := by + have hpdata := disjointAffineThreeFlatPairData hp + have hA := binaryAffineFlatIndicator_mem_reedMuller A hpdata.1 + have hB := binaryAffineFlatIndicator_mem_reedMuller B hpdata.2.1 + simp only [orderTwoWeightSixteenDualWords, orderTwoDualWords, + Finset.mem_filter, Finset.mem_univ, true_and] + exact ⟨(reedMuller (n - 3) n).add_mem hA hB, + hammingWeight_weightSixteenRepresentationWord A B hp⟩ + +/-- The character of a represented word is the product of its two +affine-flat characters. -/ +theorem weightSixteenRepresentationWord_character + (f : BooleanFunction n) + (A B : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) : + FABL.binarySign (booleanFunctionPairing n f + (weightSixteenRepresentationWord A B)) = + binaryAffineFlatCharacter f A * binaryAffineFlatCharacter f B := by + rw [weightSixteenRepresentationWord, map_add, AddChar.map_add_eq_mul] + rfl + +/-- The type-`a` exceptional words: indicators of affine four-flats. -/ +noncomputable def orderTwoWeightSixteenTypeAWords (n : ℕ) : + Finset (BooleanFunction n) := by + classical + exact (binaryAffineFlats 4 n).image binaryAffineFlatIndicator + +/-- Every affine-four-flat indicator is a weight-sixteen word in the dual +Reed--Muller code. -/ +theorem orderTwoWeightSixteenTypeAWords_subset_dualWords (n : ℕ) : + orderTwoWeightSixteenTypeAWords n ⊆ orderTwoWeightSixteenDualWords n := by + classical + intro h hh + obtain ⟨A, hA, rfl⟩ := Finset.mem_image.mp hh + have hAdata : A ≠ ⊥ ∧ Module.finrank FABL.𝔽₂ A.direction = 4 := by + simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, + true_and] using hA + have hmemComplementary := binaryAffineFlatIndicator_mem_reedMuller A hA + have hmem : binaryAffineFlatIndicator A ∈ reedMuller (n - 3) n := + reedMuller_mono (by omega : n - 4 ≤ n - 3) hmemComplementary + have hweight : hammingWeight (binaryAffineFlatIndicator A) = 16 := by + rw [hammingWeight_binaryAffineFlatIndicator A hAdata.1, hAdata.2] + norm_num + simpa only [orderTwoWeightSixteenDualWords, orderTwoDualWords, + Finset.mem_filter, Finset.mem_univ, true_and] using ⟨hmem, hweight⟩ + +private theorem exists_spanning_quadruple_of_finrank_four + (H : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) + (hH : Module.finrank FABL.𝔽₂ H = 4) : + ∃ a b c d : FABL.F₂Cube n, + H = (((FABL.𝔽₂ ∙ a) ⊔ (FABL.𝔽₂ ∙ b)) ⊔ + (FABL.𝔽₂ ∙ c)) ⊔ (FABL.𝔽₂ ∙ d) := by + have hbotlt : (⊥ : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) < H := by + apply bot_lt_iff_ne_bot.mpr + intro hHbot + rw [hHbot, finrank_bot] at hH + omega + obtain ⟨a, haH, haBot⟩ := SetLike.exists_of_lt hbotlt + have ha0 : a ≠ 0 := by + intro ha + subst a + exact haBot (Submodule.zero_mem _) + let S₁ : Submodule FABL.𝔽₂ (FABL.F₂Cube n) := FABL.𝔽₂ ∙ a + have hS₁le : S₁ ≤ H := + Submodule.span_le.2 (Set.singleton_subset_iff.2 haH) + have hS₁rank : Module.finrank FABL.𝔽₂ S₁ = 1 := + finrank_span_singleton ha0 + have hS₁lt : S₁ < H := + Submodule.lt_of_le_of_finrank_lt_finrank hS₁le (by omega) + obtain ⟨b, hbH, hbS₁⟩ := SetLike.exists_of_lt hS₁lt + let S₂ : Submodule FABL.𝔽₂ (FABL.F₂Cube n) := + S₁ ⊔ (FABL.𝔽₂ ∙ b) + have hS₂le : S₂ ≤ H := by + exact sup_le hS₁le + (Submodule.span_le.2 (Set.singleton_subset_iff.2 hbH)) + have hS₂rank : Module.finrank FABL.𝔽₂ S₂ = 2 := by + dsimp only [S₂] + rw [Submodule.finrank_sup_span_singleton hbS₁, hS₁rank] + have hS₂lt : S₂ < H := + Submodule.lt_of_le_of_finrank_lt_finrank hS₂le (by omega) + obtain ⟨c, hcH, hcS₂⟩ := SetLike.exists_of_lt hS₂lt + let S₃ : Submodule FABL.𝔽₂ (FABL.F₂Cube n) := + S₂ ⊔ (FABL.𝔽₂ ∙ c) + have hS₃le : S₃ ≤ H := by + exact sup_le hS₂le + (Submodule.span_le.2 (Set.singleton_subset_iff.2 hcH)) + have hS₃rank : Module.finrank FABL.𝔽₂ S₃ = 3 := by + dsimp only [S₃] + rw [Submodule.finrank_sup_span_singleton hcS₂, hS₂rank] + have hS₃lt : S₃ < H := + Submodule.lt_of_le_of_finrank_lt_finrank hS₃le (by omega) + obtain ⟨d, hdH, hdS₃⟩ := SetLike.exists_of_lt hS₃lt + refine ⟨a, b, c, d, ?_⟩ + symm + apply Submodule.eq_of_le_of_finrank_eq + · exact sup_le hS₃le + (Submodule.span_le.2 (Set.singleton_subset_iff.2 hdH)) + · rw [Submodule.finrank_sup_span_singleton hdS₃, hS₃rank, hH] + +private structure AffineFourFlatWitness + (A : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) where + u : FABL.F₂Cube n + a : FABL.F₂Cube n + b : FABL.F₂Cube n + c : FABL.F₂Cube n + d : FABL.F₂Cube n + flat_eq : A = FABL.binaryAffineSubspace + ((((FABL.𝔽₂ ∙ a) ⊔ (FABL.𝔽₂ ∙ b)) ⊔ + (FABL.𝔽₂ ∙ c)) ⊔ (FABL.𝔽₂ ∙ d)) u + +private noncomputable def affineFourFlatWitness + (A : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) + (hA : A ∈ binaryAffineFlats 4 n) : AffineFourFlatWitness A := by + classical + have hAdata : A ≠ ⊥ ∧ Module.finrank FABL.𝔽₂ A.direction = 4 := by + simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, + true_and] using hA + let u := Classical.choose + ((AffineSubspace.nonempty_iff_ne_bot A).2 hAdata.1) + have hu := Classical.choose_spec + ((AffineSubspace.nonempty_iff_ne_bot A).2 hAdata.1) + let hspanExists := + exists_spanning_quadruple_of_finrank_four A.direction hAdata.2 + let a := Classical.choose hspanExists + let b := Classical.choose (Classical.choose_spec hspanExists) + let c := Classical.choose + (Classical.choose_spec (Classical.choose_spec hspanExists)) + let d := Classical.choose (Classical.choose_spec + (Classical.choose_spec (Classical.choose_spec hspanExists))) + have hspan := Classical.choose_spec (Classical.choose_spec + (Classical.choose_spec (Classical.choose_spec hspanExists))) + refine ⟨u, a, b, c, d, ?_⟩ + calc + A = FABL.binaryAffineSubspace A.direction u := + (AffineSubspace.mk'_eq hu).symm + _ = FABL.binaryAffineSubspace + ((((FABL.𝔽₂ ∙ a) ⊔ (FABL.𝔽₂ ∙ b)) ⊔ + (FABL.𝔽₂ ∙ c)) ⊔ (FABL.𝔽₂ ∙ d)) u := by rw [hspan] + +private def affineFourFlatWitnessCode + {A : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)} + (w : AffineFourFlatWitness A) : Fin 5 → FABL.F₂Cube n := + ![w.u, w.a, w.b, w.c, w.d] + +private noncomputable def affineFourFlatCode + (A : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) : + Fin 5 → FABL.F₂Cube n := by + classical + exact if hA : A ∈ binaryAffineFlats 4 n then + affineFourFlatWitnessCode (affineFourFlatWitness A hA) + else 0 + +private theorem affineFourFlatCode_injective_on : + Set.InjOn (affineFourFlatCode (n := n)) + (binaryAffineFlats 4 n : + Set (AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n))) := by + intro A hA B hB hcode + have hA' : A ∈ binaryAffineFlats 4 n := hA + have hB' : B ∈ binaryAffineFlats 4 n := hB + let wA := affineFourFlatWitness A hA + let wB := affineFourFlatWitness B hB + have hcode' : affineFourFlatWitnessCode wA = + affineFourFlatWitnessCode wB := by + unfold affineFourFlatCode at hcode + rw [dif_pos hA', dif_pos hB'] at hcode + simpa only [wA, wB] using hcode + have h0 : wA.u = wB.u := by + simpa [affineFourFlatWitnessCode] using congrFun hcode' (0 : Fin 5) + have h1 : wA.a = wB.a := by + simpa [affineFourFlatWitnessCode] using congrFun hcode' (1 : Fin 5) + have h2 : wA.b = wB.b := by + simpa [affineFourFlatWitnessCode] using congrFun hcode' (2 : Fin 5) + have h3 : wA.c = wB.c := by + simpa [affineFourFlatWitnessCode] using congrFun hcode' (3 : Fin 5) + have h4 : wA.d = wB.d := by + simpa [affineFourFlatWitnessCode] using congrFun hcode' (4 : Fin 5) + rw [wA.flat_eq, wB.flat_eq, h0, h1, h2, h3, h4] + +/-- The type-`a` exceptional family has at most `(2^n)^5` words. -/ +theorem card_orderTwoWeightSixteenTypeAWords_le (n : ℕ) : + (orderTwoWeightSixteenTypeAWords n).card ≤ (2 ^ n) ^ 5 := by + classical + calc + (orderTwoWeightSixteenTypeAWords n).card ≤ + (binaryAffineFlats 4 n).card := by + exact Finset.card_image_le + _ ≤ (Finset.univ : Finset (Fin 5 → FABL.F₂Cube n)).card := by + apply Finset.card_le_card_of_injOn (affineFourFlatCode (n := n)) + · intro A _hA + exact Finset.mem_univ _ + · exact affineFourFlatCode_injective_on + _ = (2 ^ n) ^ 5 := by + rw [Finset.card_univ, Fintype.card_fun, Fintype.card_fin, card_f₂Cube] + +private noncomputable def nonzeroBinaryDuals + (H : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) : + Finset (Module.Dual FABL.𝔽₂ H) := by + classical + exact Finset.univ.filter fun ℓ ↦ ℓ ≠ 0 + +private theorem card_nonzeroBinaryDuals_of_finrank_four + (H : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) + (hH : Module.finrank FABL.𝔽₂ H = 4) : + (nonzeroBinaryDuals H).card = 15 := by + classical + let B : Module.Basis (Fin (Module.finrank FABL.𝔽₂ H)) FABL.𝔽₂ H := + Module.finBasis FABL.𝔽₂ H + have hcardDual : Fintype.card (Module.Dual FABL.𝔽₂ H) = 16 := by + calc + Fintype.card (Module.Dual FABL.𝔽₂ H) = + Fintype.card (Fin (Module.finrank FABL.𝔽₂ H) → FABL.𝔽₂) := + Fintype.card_congr B.dualBasis.equivFun.toEquiv + _ = 16 := by + rw [Fintype.card_fun, Fintype.card_fin, hH] + norm_num + have hfilter : nonzeroBinaryDuals H = + (Finset.univ : Finset (Module.Dual FABL.𝔽₂ H)).erase 0 := by + ext ℓ + simp [nonzeroBinaryDuals] + rw [hfilter, Finset.card_erase_of_mem (Finset.mem_univ 0), + Finset.card_univ, hcardDual] + +private theorem exists_spanning_triple_of_finrank_three + (H : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) + (hH : Module.finrank FABL.𝔽₂ H = 3) : + ∃ a b c : FABL.F₂Cube n, + H = ((FABL.𝔽₂ ∙ a) ⊔ (FABL.𝔽₂ ∙ b)) ⊔ + (FABL.𝔽₂ ∙ c) := by + have hbotlt : (⊥ : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) < H := by + apply bot_lt_iff_ne_bot.mpr + intro hHbot + rw [hHbot, finrank_bot] at hH + omega + obtain ⟨a, haH, haBot⟩ := SetLike.exists_of_lt hbotlt + have ha0 : a ≠ 0 := by + intro ha + subst a + exact haBot (Submodule.zero_mem _) + let S₁ : Submodule FABL.𝔽₂ (FABL.F₂Cube n) := FABL.𝔽₂ ∙ a + have hS₁le : S₁ ≤ H := + Submodule.span_le.2 (Set.singleton_subset_iff.2 haH) + have hS₁rank : Module.finrank FABL.𝔽₂ S₁ = 1 := + finrank_span_singleton ha0 + have hS₁lt : S₁ < H := + Submodule.lt_of_le_of_finrank_lt_finrank hS₁le (by omega) + obtain ⟨b, hbH, hbS₁⟩ := SetLike.exists_of_lt hS₁lt + let S₂ : Submodule FABL.𝔽₂ (FABL.F₂Cube n) := + S₁ ⊔ (FABL.𝔽₂ ∙ b) + have hS₂le : S₂ ≤ H := by + exact sup_le hS₁le + (Submodule.span_le.2 (Set.singleton_subset_iff.2 hbH)) + have hS₂rank : Module.finrank FABL.𝔽₂ S₂ = 2 := by + dsimp only [S₂] + rw [Submodule.finrank_sup_span_singleton hbS₁, hS₁rank] + have hS₂lt : S₂ < H := + Submodule.lt_of_le_of_finrank_lt_finrank hS₂le (by omega) + obtain ⟨c, hcH, hcS₂⟩ := SetLike.exists_of_lt hS₂lt + refine ⟨a, b, c, ?_⟩ + symm + apply Submodule.eq_of_le_of_finrank_eq + · exact sup_le hS₂le + (Submodule.span_le.2 (Set.singleton_subset_iff.2 hcH)) + · rw [Submodule.finrank_sup_span_singleton hcS₂, hS₂rank, hH] + +private structure IntersectingAffineThreeFlatPairWitness + (p : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × + AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) where + u : FABL.F₂Cube n + a₁ : FABL.F₂Cube n + b₁ : FABL.F₂Cube n + c₁ : FABL.F₂Cube n + a₂ : FABL.F₂Cube n + b₂ : FABL.F₂Cube n + c₂ : FABL.F₂Cube n + first_eq : p.1 = FABL.binaryAffineSubspace + (((FABL.𝔽₂ ∙ a₁) ⊔ (FABL.𝔽₂ ∙ b₁)) ⊔ + (FABL.𝔽₂ ∙ c₁)) u + second_eq : p.2 = FABL.binaryAffineSubspace + (((FABL.𝔽₂ ∙ a₂) ⊔ (FABL.𝔽₂ ∙ b₂)) ⊔ + (FABL.𝔽₂ ∙ c₂)) u + +private noncomputable def intersectingAffineThreeFlatPairWitness + (p : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × + AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) + (hp : p ∈ intersectingBinaryAffineThreeFlatPairs n) : + IntersectingAffineThreeFlatPairWitness p := by + classical + have hp' : p ∈ binaryAffineThreeFlatPairs n ∧ p.1 ⊓ p.2 ≠ ⊥ := by + simpa only [intersectingBinaryAffineThreeFlatPairs, + Finset.mem_filter] using hp + have hpdata := affineThreeFlatPairData hp'.1 + have hfirstData := affineThreeFlatData hpdata.1 + have hsecondData := affineThreeFlatData hpdata.2 + let u := Classical.choose + ((AffineSubspace.nonempty_iff_ne_bot (p.1 ⊓ p.2)).2 hp'.2) + have hu := Classical.choose_spec + ((AffineSubspace.nonempty_iff_ne_bot (p.1 ⊓ p.2)).2 hp'.2) + let a₁ := Classical.choose + (exists_spanning_triple_of_finrank_three p.1.direction hfirstData.2) + let b₁ := Classical.choose (Classical.choose_spec + (exists_spanning_triple_of_finrank_three p.1.direction hfirstData.2)) + let c₁ := Classical.choose (Classical.choose_spec (Classical.choose_spec + (exists_spanning_triple_of_finrank_three p.1.direction hfirstData.2))) + have hfirstSpan := Classical.choose_spec (Classical.choose_spec + (Classical.choose_spec + (exists_spanning_triple_of_finrank_three p.1.direction hfirstData.2))) + let a₂ := Classical.choose + (exists_spanning_triple_of_finrank_three p.2.direction hsecondData.2) + let b₂ := Classical.choose (Classical.choose_spec + (exists_spanning_triple_of_finrank_three p.2.direction hsecondData.2)) + let c₂ := Classical.choose (Classical.choose_spec (Classical.choose_spec + (exists_spanning_triple_of_finrank_three p.2.direction hsecondData.2))) + have hsecondSpan := Classical.choose_spec (Classical.choose_spec + (Classical.choose_spec + (exists_spanning_triple_of_finrank_three p.2.direction hsecondData.2))) + refine ⟨u, a₁, b₁, c₁, a₂, b₂, c₂, ?_, ?_⟩ + · calc + p.1 = FABL.binaryAffineSubspace p.1.direction u := + (AffineSubspace.mk'_eq hu.1).symm + _ = FABL.binaryAffineSubspace + (((FABL.𝔽₂ ∙ a₁) ⊔ (FABL.𝔽₂ ∙ b₁)) ⊔ + (FABL.𝔽₂ ∙ c₁)) u := by rw [hfirstSpan] + · calc + p.2 = FABL.binaryAffineSubspace p.2.direction u := + (AffineSubspace.mk'_eq hu.2).symm + _ = FABL.binaryAffineSubspace + (((FABL.𝔽₂ ∙ a₂) ⊔ (FABL.𝔽₂ ∙ b₂)) ⊔ + (FABL.𝔽₂ ∙ c₂)) u := by rw [hsecondSpan] + +private def intersectingAffineThreeFlatPairWitnessCode + {p : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × + AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)} + (w : IntersectingAffineThreeFlatPairWitness p) : + Fin 7 → FABL.F₂Cube n := + ![w.u, w.a₁, w.b₁, w.c₁, w.a₂, w.b₂, w.c₂] + +private noncomputable def intersectingAffineThreeFlatPairCode + (p : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × + AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) : + Fin 7 → FABL.F₂Cube n := by + classical + exact if hp : p ∈ intersectingBinaryAffineThreeFlatPairs n then + intersectingAffineThreeFlatPairWitnessCode + (intersectingAffineThreeFlatPairWitness p hp) + else 0 + +private theorem intersectingAffineThreeFlatPairCode_injective_on : + Set.InjOn (intersectingAffineThreeFlatPairCode (n := n)) + (intersectingBinaryAffineThreeFlatPairs n : + Set (AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × + AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n))) := by + intro p hp q hq hcode + have hpFin : p ∈ intersectingBinaryAffineThreeFlatPairs n := hp + have hqFin : q ∈ intersectingBinaryAffineThreeFlatPairs n := hq + let wp := intersectingAffineThreeFlatPairWitness p hp + let wq := intersectingAffineThreeFlatPairWitness q hq + have hcode' : intersectingAffineThreeFlatPairWitnessCode wp = + intersectingAffineThreeFlatPairWitnessCode wq := by + unfold intersectingAffineThreeFlatPairCode at hcode + rw [dif_pos hpFin, dif_pos hqFin] at hcode + simpa only [wp, wq] using hcode + have h0 : wp.u = wq.u := by + simpa [intersectingAffineThreeFlatPairWitnessCode] using + congrFun hcode' (0 : Fin 7) + have h1 : wp.a₁ = wq.a₁ := by + simpa [intersectingAffineThreeFlatPairWitnessCode] using + congrFun hcode' (1 : Fin 7) + have h2 : wp.b₁ = wq.b₁ := by + simpa [intersectingAffineThreeFlatPairWitnessCode] using + congrFun hcode' (2 : Fin 7) + have h3 : wp.c₁ = wq.c₁ := by + simpa [intersectingAffineThreeFlatPairWitnessCode] using + congrFun hcode' (3 : Fin 7) + have h4 : wp.a₂ = wq.a₂ := by + simpa [intersectingAffineThreeFlatPairWitnessCode] using + congrFun hcode' (4 : Fin 7) + have h5 : wp.b₂ = wq.b₂ := by + simpa [intersectingAffineThreeFlatPairWitnessCode] using + congrFun hcode' (5 : Fin 7) + have h6 : wp.c₂ = wq.c₂ := by + simpa [intersectingAffineThreeFlatPairWitnessCode] using + congrFun hcode' (6 : Fin 7) + apply Prod.ext + · rw [wp.first_eq, wq.first_eq, h0, h1, h2, h3] + · rw [wp.second_eq, wq.second_eq, h0, h4, h5, h6] + +/-- Intersecting ordered pairs of affine three-flats inject into seven +ambient vectors. -/ +theorem card_intersectingBinaryAffineThreeFlatPairs_le (n : ℕ) : + (intersectingBinaryAffineThreeFlatPairs n).card ≤ (2 ^ n) ^ 7 := by + classical + calc + (intersectingBinaryAffineThreeFlatPairs n).card ≤ + (Finset.univ : Finset (Fin 7 → FABL.F₂Cube n)).card := by + apply Finset.card_le_card_of_injOn + (intersectingAffineThreeFlatPairCode (n := n)) + · intro p _hp + exact Finset.mem_univ _ + · exact intersectingAffineThreeFlatPairCode_injective_on + _ = (2 ^ n) ^ 7 := by + rw [Finset.card_univ, Fintype.card_fun, Fintype.card_fin, card_f₂Cube] + +private theorem allAffineThreeFlatPairCharacterSum_eq_sq + (f : BooleanFunction n) : + (∑ p ∈ binaryAffineThreeFlatPairs n, + binaryAffineFlatCharacter f p.1 * + binaryAffineFlatCharacter f p.2) = + (binaryAffineFlatCharacterSum 3 f) ^ 2 := by + classical + rw [binaryAffineThreeFlatPairs, binaryAffineFlatCharacterSum] + calc + (∑ p ∈ (binaryAffineFlats 3 n).product (binaryAffineFlats 3 n), + binaryAffineFlatCharacter f p.1 * + binaryAffineFlatCharacter f p.2) = + ∑ A ∈ binaryAffineFlats 3 n, + ∑ B ∈ binaryAffineFlats 3 n, + binaryAffineFlatCharacter f A * + binaryAffineFlatCharacter f B := by + exact Finset.sum_product _ _ _ + _ = (∑ A ∈ binaryAffineFlats 3 n, + binaryAffineFlatCharacter f A) ^ 2 := by + simp only [pow_two, Finset.mul_sum, mul_comm] + +private theorem affineThreeFlatPairCharacterSum_split + (f : BooleanFunction n) : + (∑ p ∈ binaryAffineThreeFlatPairs n, + binaryAffineFlatCharacter f p.1 * + binaryAffineFlatCharacter f p.2) = + (∑ p ∈ disjointBinaryAffineThreeFlatPairs n, + binaryAffineFlatCharacter f p.1 * + binaryAffineFlatCharacter f p.2) + + ∑ p ∈ intersectingBinaryAffineThreeFlatPairs n, + binaryAffineFlatCharacter f p.1 * + binaryAffineFlatCharacter f p.2 := by + have hsplit := Finset.sum_filter_add_sum_filter_not + (binaryAffineThreeFlatPairs n) (fun p ↦ p.1 ⊓ p.2 = ⊥) + (fun p ↦ binaryAffineFlatCharacter f p.1 * + binaryAffineFlatCharacter f p.2) + change + (∑ p ∈ disjointBinaryAffineThreeFlatPairs n, + binaryAffineFlatCharacter f p.1 * + binaryAffineFlatCharacter f p.2) + + (∑ p ∈ intersectingBinaryAffineThreeFlatPairs n, + binaryAffineFlatCharacter f p.1 * + binaryAffineFlatCharacter f p.2) = + ∑ p ∈ binaryAffineThreeFlatPairs n, + binaryAffineFlatCharacter f p.1 * + binaryAffineFlatCharacter f p.2 at hsplit + exact hsplit.symm + +private theorem binaryAffineFlatCharacter_mul_le_one + (f : BooleanFunction n) + (A B : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) : + binaryAffineFlatCharacter f A * binaryAffineFlatCharacter f B ≤ 1 := by + rcases binaryAffineFlatCharacter_eq_one_or_neg_one f A with hA | hA <;> + rcases binaryAffineFlatCharacter_eq_one_or_neg_one f B with hB | hB <;> + simp only [hA, hB] <;> norm_num + +private theorem intersectingAffineThreeFlatPairCharacterSum_le_card + (f : BooleanFunction n) : + (∑ p ∈ intersectingBinaryAffineThreeFlatPairs n, + binaryAffineFlatCharacter f p.1 * + binaryAffineFlatCharacter f p.2) ≤ + ((intersectingBinaryAffineThreeFlatPairs n).card : ℝ) := by + calc + (∑ p ∈ intersectingBinaryAffineThreeFlatPairs n, + binaryAffineFlatCharacter f p.1 * + binaryAffineFlatCharacter f p.2) ≤ + ∑ _p ∈ intersectingBinaryAffineThreeFlatPairs n, (1 : ℝ) := by + apply Finset.sum_le_sum + intro p _hp + exact binaryAffineFlatCharacter_mul_le_one f p.1 p.2 + _ = ((intersectingBinaryAffineThreeFlatPairs n).card : ℝ) := by simp + +private theorem disjointAffineThreeFlatPairCharacterSum_ge_neg_card + (f : BooleanFunction n) : + (∑ p ∈ disjointBinaryAffineThreeFlatPairs n, + binaryAffineFlatCharacter f p.1 * + binaryAffineFlatCharacter f p.2) ≥ + -((intersectingBinaryAffineThreeFlatPairs n).card : ℝ) := by + have hall : 0 ≤ ∑ p ∈ binaryAffineThreeFlatPairs n, + binaryAffineFlatCharacter f p.1 * + binaryAffineFlatCharacter f p.2 := by + rw [allAffineThreeFlatPairCharacterSum_eq_sq] + positivity + rw [affineThreeFlatPairCharacterSum_split] at hall + have hintersecting := + intersectingAffineThreeFlatPairCharacterSum_le_card f + linarith + +/-- The disjoint-three-flat representation sum has the `O((2^n)^7)` +lower bound required by the seventh/eighth moment argument. -/ +theorem weightSixteenRepresentationCharacterSum_ge + (f : BooleanFunction n) : + weightSixteenRepresentationCharacterSum f ≥ + -((2 ^ n : ℝ) ^ 7) / 2 := by + have hsum := disjointAffineThreeFlatPairCharacterSum_ge_neg_card f + have hcardNat := card_intersectingBinaryAffineThreeFlatPairs_le n + have hcardReal : + ((intersectingBinaryAffineThreeFlatPairs n).card : ℝ) ≤ + (((2 ^ n) ^ 7 : ℕ) : ℝ) := by + exact_mod_cast hcardNat + norm_num only [Nat.cast_pow, Nat.cast_ofNat] at hcardReal + calc + weightSixteenRepresentationCharacterSum f = + (1 / 2 : ℝ) * + ∑ p ∈ disjointBinaryAffineThreeFlatPairs n, + binaryAffineFlatCharacter f p.1 * + binaryAffineFlatCharacter f p.2 := rfl + _ ≥ (1 / 2 : ℝ) * + -((intersectingBinaryAffineThreeFlatPairs n).card : ℝ) := by + exact mul_le_mul_of_nonneg_left hsum (by norm_num) + _ ≥ -((2 ^ n : ℝ) ^ 7) / 2 := by + nlinarith + +/-- The ordered disjoint-flat representations of a Boolean word. -/ +noncomputable def weightSixteenRepresentationFiber + (h : BooleanFunction n) : + Finset (AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × + AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) := + (disjointBinaryAffineThreeFlatPairs n).filter fun p ↦ + weightSixteenRepresentationWord p.1 p.2 = h + +/-- The exact Kasami--Tokura exceptional-multiplicity interface. Type `a` +words have thirty ordered representations, type `b` words have six, and +all remaining weight-sixteen words have two. The zero fibers outside the +dual code also encode the existence classification. -/ +def HasWeightSixteenExceptionalMultiplicity + (typeA typeB : Finset (BooleanFunction n)) : Prop := + typeA ⊆ orderTwoWeightSixteenDualWords n ∧ + typeB ⊆ orderTwoWeightSixteenDualWords n ∧ + Disjoint typeA typeB ∧ + ∀ h : BooleanFunction n, + (weightSixteenRepresentationFiber h).card = + if h ∈ orderTwoWeightSixteenDualWords n then + if h ∈ typeA then 30 else if h ∈ typeB then 6 else 2 + else 0 + +/-- The coarse consequences of the exact exceptional-word counts: type +`a` contributes `O((2^n)^5)` words and type `b` contributes +`O((2^n)^6)`. -/ +def HasWeightSixteenExceptionalCountBounds + (typeA typeB : Finset (BooleanFunction n)) : Prop := + typeA.card ≤ (2 ^ n) ^ 5 ∧ typeB.card ≤ (2 ^ n) ^ 6 + +private theorem sum_ite_mem_subset + {s t : Finset (BooleanFunction n)} + (hst : s ⊆ t) (g : BooleanFunction n → ℝ) : + (∑ h ∈ t, if h ∈ s then g h else 0) = ∑ h ∈ s, g h := by + classical + rw [← Finset.sum_filter] + congr 1 + ext h + simp only [Finset.mem_filter] + constructor + · exact fun hh ↦ hh.2 + · exact fun hh ↦ ⟨hst hh, hh⟩ + +private theorem binarySign_le_one (b : FABL.𝔽₂) : + FABL.binarySign b ≤ 1 := by + by_cases hb : b = 0 + · rw [hb] + norm_num + · have hbOne : b = 1 := Fin.eq_one_of_ne_zero _ hb + rw [hbOne, FABL.binarySign_one] + norm_num + +private theorem booleanWordCharacterSum_le_card + (f : BooleanFunction n) (s : Finset (BooleanFunction n)) : + (∑ h ∈ s, FABL.binarySign (booleanFunctionPairing n f h)) ≤ + (s.card : ℝ) := by + calc + (∑ h ∈ s, FABL.binarySign (booleanFunctionPairing n f h)) ≤ + ∑ _h ∈ s, (1 : ℝ) := by + apply Finset.sum_le_sum + intro h _hh + exact binarySign_le_one (booleanFunctionPairing n f h) + _ = (s.card : ℝ) := by simp + +private theorem sum_disjointWeightSixteenRepresentations_eq + (f : BooleanFunction n) + (typeA typeB : Finset (BooleanFunction n)) + (hmultiplicity : HasWeightSixteenExceptionalMultiplicity typeA typeB) : + (∑ p ∈ disjointBinaryAffineThreeFlatPairs n, + binaryAffineFlatCharacter f p.1 * + binaryAffineFlatCharacter f p.2) = + 2 * orderTwoWeightSixteenCharacterSum f + + 28 * ∑ h ∈ typeA, + FABL.binarySign (booleanFunctionPairing n f h) + + 4 * ∑ h ∈ typeB, + FABL.binarySign (booleanFunctionPairing n f h) := by + classical + have htypeA := hmultiplicity.1 + have htypeB := hmultiplicity.2.1 + have hdisjoint := hmultiplicity.2.2.1 + have htypeASum := sum_ite_mem_subset htypeA + (fun h ↦ 28 * FABL.binarySign (booleanFunctionPairing n f h)) + have htypeBSum := sum_ite_mem_subset htypeB + (fun h ↦ 4 * FABL.binarySign (booleanFunctionPairing n f h)) + calc + (∑ p ∈ disjointBinaryAffineThreeFlatPairs n, + binaryAffineFlatCharacter f p.1 * + binaryAffineFlatCharacter f p.2) = + ∑ p ∈ disjointBinaryAffineThreeFlatPairs n, + FABL.binarySign (booleanFunctionPairing n f + (weightSixteenRepresentationWord p.1 p.2)) := by + apply Finset.sum_congr rfl + intro p _hp + rw [weightSixteenRepresentationWord_character] + _ = ∑ h ∈ orderTwoWeightSixteenDualWords n, + ∑ p ∈ weightSixteenRepresentationFiber h, + FABL.binarySign (booleanFunctionPairing n f + (weightSixteenRepresentationWord p.1 p.2)) := by + symm + unfold weightSixteenRepresentationFiber + apply Finset.sum_fiberwise_of_maps_to + intro p hp + exact weightSixteenRepresentationWord_mem_dualWords p.1 p.2 hp + _ = ∑ h ∈ orderTwoWeightSixteenDualWords n, + ((weightSixteenRepresentationFiber h).card : ℝ) * + FABL.binarySign (booleanFunctionPairing n f h) := by + apply Finset.sum_congr rfl + intro h _hh + calc + (∑ p ∈ weightSixteenRepresentationFiber h, + FABL.binarySign (booleanFunctionPairing n f + (weightSixteenRepresentationWord p.1 p.2))) = + ∑ _p ∈ weightSixteenRepresentationFiber h, + FABL.binarySign (booleanFunctionPairing n f h) := by + apply Finset.sum_congr rfl + intro p hp + rw [(Finset.mem_filter.mp hp).2] + _ = ((weightSixteenRepresentationFiber h).card : ℝ) * + FABL.binarySign (booleanFunctionPairing n f h) := by simp + _ = ∑ h ∈ orderTwoWeightSixteenDualWords n, + (2 * FABL.binarySign (booleanFunctionPairing n f h) + + (if h ∈ typeA then + 28 * FABL.binarySign (booleanFunctionPairing n f h) else 0) + + if h ∈ typeB then + 4 * FABL.binarySign (booleanFunctionPairing n f h) else 0) := by + apply Finset.sum_congr rfl + intro h hh + rw [hmultiplicity.2.2.2 h, if_pos hh] + by_cases hA : h ∈ typeA + · have hB : h ∉ typeB := by + intro hB + exact (Finset.disjoint_left.mp hdisjoint) hA hB + simp [hA, hB] + ring + · by_cases hB : h ∈ typeB + · simp [hA, hB] + ring + · simp [hA, hB] + _ = 2 * orderTwoWeightSixteenCharacterSum f + + 28 * ∑ h ∈ typeA, + FABL.binarySign (booleanFunctionPairing n f h) + + 4 * ∑ h ∈ typeB, + FABL.binarySign (booleanFunctionPairing n f h) := by + rw [Finset.sum_add_distrib, Finset.sum_add_distrib, + htypeASum, htypeBSum] + rw [← Finset.mul_sum, ← Finset.mul_sum, ← Finset.mul_sum] + rfl + +/-- Conditional on the cited exceptional-multiplicity classification, the +canonical weight-sixteen sum is the representation sum with the two +exceptional overcount corrections. -/ +theorem orderTwoWeightSixteenCharacterSum_eq_representation_sub_exceptions + (f : BooleanFunction n) + (typeA typeB : Finset (BooleanFunction n)) + (hmultiplicity : HasWeightSixteenExceptionalMultiplicity typeA typeB) : + orderTwoWeightSixteenCharacterSum f = + weightSixteenRepresentationCharacterSum f - + 14 * ∑ h ∈ typeA, + FABL.binarySign (booleanFunctionPairing n f h) - + 2 * ∑ h ∈ typeB, + FABL.binarySign (booleanFunctionPairing n f h) := by + rw [weightSixteenRepresentationCharacterSum, + sum_disjointWeightSixteenRepresentations_eq + f typeA typeB hmultiplicity] + ring + +/-- A conditional canonical lower bound retaining the sharper orders of +the two exceptional families. -/ +theorem orderTwoWeightSixteenCharacterSum_ge + (f : BooleanFunction n) + (typeA typeB : Finset (BooleanFunction n)) + (hmultiplicity : HasWeightSixteenExceptionalMultiplicity typeA typeB) + (hcounts : HasWeightSixteenExceptionalCountBounds typeA typeB) : + orderTwoWeightSixteenCharacterSum f ≥ + -((2 ^ n : ℝ) ^ 7) / 2 - 14 * (2 ^ n : ℝ) ^ 5 - + 2 * (2 ^ n : ℝ) ^ 6 := by + have hrepresentation := weightSixteenRepresentationCharacterSum_ge f + have htypeASum := booleanWordCharacterSum_le_card f typeA + have htypeBSum := booleanWordCharacterSum_le_card f typeB + have htypeACard : (typeA.card : ℝ) ≤ (2 ^ n : ℝ) ^ 5 := by + exact_mod_cast hcounts.1 + have htypeBCard : (typeB.card : ℝ) ≤ (2 ^ n : ℝ) ^ 6 := by + exact_mod_cast hcounts.2 + rw [orderTwoWeightSixteenCharacterSum_eq_representation_sub_exceptions + f typeA typeB hmultiplicity] + linarith + +end CryptBoolean diff --git a/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenCandidateSoundnessCertificates.lean b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteen/CandidateCertificates.lean similarity index 99% rename from CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenCandidateSoundnessCertificates.lean rename to CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteen/CandidateCertificates.lean index fd7389b..9c917d7 100644 --- a/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenCandidateSoundnessCertificates.lean +++ b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteen/CandidateCertificates.lean @@ -5,7 +5,7 @@ Authors: Asher Yan with Codex -/ module -public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightSixteenCandidateSoundness +public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightSixteen.CandidateSoundness /-! # Compact soundness certificates for normalized weight-sixteen candidates diff --git a/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenNormalizedCandidateDecode.lean b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteen/CandidateDecode.lean similarity index 98% rename from CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenNormalizedCandidateDecode.lean rename to CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteen/CandidateDecode.lean index 453363e..afada56 100644 --- a/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenNormalizedCandidateDecode.lean +++ b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteen/CandidateDecode.lean @@ -5,7 +5,7 @@ Authors: Asher Yan with Codex -/ module -public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightSixteenNormalizedCandidates +public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightSixteen.NormalizedCandidates /-! # Decode normalized weight-sixteen affine certificates diff --git a/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenCandidateSoundness.lean b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteen/CandidateSoundness.lean similarity index 99% rename from CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenCandidateSoundness.lean rename to CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteen/CandidateSoundness.lean index 7e9ca4a..8ab38b5 100644 --- a/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenCandidateSoundness.lean +++ b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteen/CandidateSoundness.lean @@ -5,7 +5,7 @@ Authors: Asher Yan with Codex -/ module -public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightSixteenSystematicEncoding +public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightSixteen.SystematicEncoding /-! # Semantic soundness of generated normalized candidates diff --git a/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenCharacterBound.lean b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteen/CharacterBound.lean similarity index 96% rename from CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenCharacterBound.lean rename to CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteen/CharacterBound.lean index a7fb730..25bb8cc 100644 --- a/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenCharacterBound.lean +++ b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteen/CharacterBound.lean @@ -5,7 +5,7 @@ Authors: Asher Yan with Codex -/ module -public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightSixteenOrbitPairwiseDisjoint +public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightSixteen.OrbitPairwiseDisjoint /-! # Weight-sixteen character bound from a rank-seven classifier diff --git a/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenNormalizedClassification.lean b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteen/NormalizedClassification.lean similarity index 99% rename from CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenNormalizedClassification.lean rename to CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteen/NormalizedClassification.lean index 240338e..09224ef 100644 --- a/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenNormalizedClassification.lean +++ b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteen/NormalizedClassification.lean @@ -5,8 +5,8 @@ Authors: Asher Yan with Codex -/ module -public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightSixteenNormalizedClassifier -public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightSixteenNormalizedCandidateDecode +public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightSixteen.NormalizedClassifier +public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightSixteen.CandidateDecode public meta import Std.Tactic.BVDecide.Reflect /-! diff --git a/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenNormalizedClassifier.lean b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteen/NormalizedClassifier.lean similarity index 99% rename from CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenNormalizedClassifier.lean rename to CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteen/NormalizedClassifier.lean index 12ce9e6..9112f10 100644 --- a/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenNormalizedClassifier.lean +++ b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteen/NormalizedClassifier.lean @@ -5,7 +5,7 @@ Authors: Asher Yan with Codex -/ module -public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightSixteenNormalizedCandidates +public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightSixteen.NormalizedCandidates public meta import Std.Tactic.BVDecide.Reflect /-! diff --git a/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenOrbitAggregation.lean b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteen/OrbitAggregation.lean similarity index 99% rename from CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenOrbitAggregation.lean rename to CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteen/OrbitAggregation.lean index b4de71a..a8d9f8e 100644 --- a/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenOrbitAggregation.lean +++ b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteen/OrbitAggregation.lean @@ -5,8 +5,8 @@ Authors: Asher Yan with Codex -/ module -public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightSixteenPatternOrbitSums -public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightSixteenOrbitSoundness +public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightSixteen.PatternOrbitSums +public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightSixteen.OrbitSoundness public import Mathlib.LinearAlgebra.FiniteDimensional.Basic /-! diff --git a/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenOrbitDisjointness.lean b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteen/OrbitDisjointness.lean similarity index 99% rename from CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenOrbitDisjointness.lean rename to CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteen/OrbitDisjointness.lean index 5d5fca9..35fcc82 100644 --- a/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenOrbitDisjointness.lean +++ b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteen/OrbitDisjointness.lean @@ -5,7 +5,7 @@ Authors: Asher Yan with Codex -/ module -public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightSixteenRankSevenPatterns +public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightSixteen.RankSevenPatterns /-! # Disjointness of the rank-seven weight-sixteen pattern orbits diff --git a/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenOrbitPairwiseDisjoint.lean b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteen/OrbitPairwiseDisjoint.lean similarity index 96% rename from CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenOrbitPairwiseDisjoint.lean rename to CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteen/OrbitPairwiseDisjoint.lean index e43fab2..09f12bd 100644 --- a/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenOrbitPairwiseDisjoint.lean +++ b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteen/OrbitPairwiseDisjoint.lean @@ -5,8 +5,8 @@ Authors: Asher Yan with Codex -/ module -public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightSixteenOrbitAggregation -public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightSixteenOrbitDisjointness +public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightSixteen.OrbitAggregation +public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightSixteen.OrbitDisjointness /-! # Pairwise disjointness of the rank-seven weight-sixteen word orbits diff --git a/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenOrbitSoundness.lean b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteen/OrbitSoundness.lean similarity index 99% rename from CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenOrbitSoundness.lean rename to CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteen/OrbitSoundness.lean index 785fdc2..9e6641a 100644 --- a/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenOrbitSoundness.lean +++ b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteen/OrbitSoundness.lean @@ -5,8 +5,8 @@ Authors: Asher Yan with Codex -/ module -public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightSixteenRankSevenPatterns -public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightSixteen +public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightSixteen.RankSevenPatterns +public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightSixteen.Basic public import CryptBoolean.Carlet.Chapter04.AlgebraicImmunityBounds /-! diff --git a/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenOrbitSums.lean b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteen/OrbitSums.lean similarity index 99% rename from CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenOrbitSums.lean rename to CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteen/OrbitSums.lean index 6bc1bdc..b6eafd7 100644 --- a/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenOrbitSums.lean +++ b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteen/OrbitSums.lean @@ -5,7 +5,7 @@ Authors: Asher Yan with Codex -/ module -public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightSixteenAffineMaps +public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightSixteen.AffineMaps public import CryptBoolean.Carlet.Chapter02.FourierOperations /-! diff --git a/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenPatternOrbitSums.lean b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteen/PatternOrbitSums.lean similarity index 99% rename from CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenPatternOrbitSums.lean rename to CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteen/PatternOrbitSums.lean index 3f5704a..243e450 100644 --- a/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenPatternOrbitSums.lean +++ b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteen/PatternOrbitSums.lean @@ -5,8 +5,8 @@ Authors: Asher Yan with Codex -/ module -public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightSixteenRankSevenPatterns -public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightSixteenOrbitSums +public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightSixteen.RankSevenPatterns +public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightSixteen.OrbitSums /-! # Canonical rank-seven pattern orbit sums diff --git a/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenRankSevenClassification.lean b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteen/RankSevenClassification.lean similarity index 99% rename from CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenRankSevenClassification.lean rename to CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteen/RankSevenClassification.lean index 5501a08..47b37f2 100644 --- a/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenRankSevenClassification.lean +++ b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteen/RankSevenClassification.lean @@ -5,9 +5,9 @@ Authors: Asher Yan with Codex -/ module -public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightSixteenCandidateSoundnessCertificates -public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightSixteenCharacterBound -public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightSixteenSupportNormalization +public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightSixteen.CandidateCertificates +public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightSixteen.CharacterBound +public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightSixteen.SupportNormalization public import CryptBoolean.Carlet.Chapter04.HigherOrderSharpAsymptotics /-! diff --git a/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenRankSevenPatterns.lean b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteen/RankSevenPatterns.lean similarity index 99% rename from CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenRankSevenPatterns.lean rename to CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteen/RankSevenPatterns.lean index cf0f35d..c18b622 100644 --- a/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenRankSevenPatterns.lean +++ b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteen/RankSevenPatterns.lean @@ -6,7 +6,7 @@ Authors: Asher Yan with Codex module public import CryptBoolean.Carlet.Chapter03.ReedMullerWeightSixteenSelfDual -public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightSixteenAffineMaps +public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightSixteen.AffineMaps public import CryptBoolean.Carlet.Chapter04.OddDimensionBestNonlinearity /-! diff --git a/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenSupportNormalization.lean b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteen/SupportNormalization.lean similarity index 99% rename from CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenSupportNormalization.lean rename to CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteen/SupportNormalization.lean index 1d53554..9f02a13 100644 --- a/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenSupportNormalization.lean +++ b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteen/SupportNormalization.lean @@ -7,7 +7,7 @@ module public import CryptBoolean.Carlet.Chapter03.ReedMullerWeightSixteenSelfDual public import CryptBoolean.Carlet.Chapter04.AlgebraicImmunityBounds -public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightSixteenSystematicEncoding +public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightSixteen.SystematicEncoding /-! # Normalize full-span weight-sixteen supports diff --git a/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenSystematicEncoding.lean b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteen/SystematicEncoding.lean similarity index 98% rename from CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenSystematicEncoding.lean rename to CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteen/SystematicEncoding.lean index 29317ca..a36bcfa 100644 --- a/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenSystematicEncoding.lean +++ b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteen/SystematicEncoding.lean @@ -5,7 +5,7 @@ Authors: Asher Yan with Codex -/ module -public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightSixteenNormalizedClassification +public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightSixteen.NormalizedClassification public import Mathlib.Data.Finset.Sort /-! diff --git a/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenClassification.lean b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenClassification.lean deleted file mode 100644 index 4b81ec8..0000000 --- a/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenClassification.lean +++ /dev/null @@ -1,2065 +0,0 @@ -/- -Copyright (c) 2026 Asher Yan. All rights reserved. -Released under Apache 2.0 license as described in the file LICENSE. -Authors: Asher Yan with Codex --/ -module - -public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightSixteenTypeA -public import CryptBoolean.Carlet.Chapter04.GeneralizedLinearStructureDistance - -/-! -# The weight-sixteen exceptional families - -The period-space description and the six-vector count for the type-`b` -exceptional words in the Kasami--Tokura classification. --/ - -open Finset -open scoped BigOperators BooleanCube - -@[expose] public section - -namespace CryptBoolean - -open FABL - -variable {n : ℕ} - -noncomputable local instance weightSixteenClassificationQuotientDecidableEq - (S : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) : - DecidableEq (FABL.F₂Cube n ⧸ S) := - Classical.decEq _ - -/-- The type-`b` exceptional family, characterized intrinsically by its -two-dimensional zero-derivative kernel. -/ -noncomputable def orderTwoWeightSixteenTypeBWords (n : ℕ) : - Finset (BooleanFunction n) := by - classical - exact (orderTwoWeightSixteenDualWords n).filter fun h ↦ - Module.finrank FABL.𝔽₂ (zeroDerivativeKernel h) = 2 - -/-- Type-`b` words are weight-sixteen words in the dual Reed--Muller code. -/ -theorem orderTwoWeightSixteenTypeBWords_subset_dualWords (n : ℕ) : - orderTwoWeightSixteenTypeBWords n ⊆ - orderTwoWeightSixteenDualWords n := by - intro h hh - exact (Finset.mem_filter.mp hh).1 - -private theorem binaryAffineFlatIndicator_period_of_mem_direction - (C : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) - (a : FABL.F₂Cube n) (ha : a ∈ C.direction) - (x : FABL.F₂Cube n) : - binaryAffineFlatIndicator C (x + a) = - binaryAffineFlatIndicator C x := by - classical - have hmem : x + a ∈ C ↔ x ∈ C := by - simpa only [vadd_eq_add, add_comm] using - (AffineSubspace.vadd_mem_iff_mem_of_mem_direction ha (p := x)) - simp only [binaryAffineFlatIndicator] - by_cases hx : x ∈ C - · rw [if_pos hx, if_pos (hmem.mpr hx)] - · rw [if_neg hx, if_neg (fun h ↦ hx (hmem.mp h))] - -theorem binaryAffineFlatIndicator_zeroDerivativeKernel - (C : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) (hC : C ≠ ⊥) : - zeroDerivativeKernel (binaryAffineFlatIndicator C) = C.direction := by - apply le_antisymm - · intro a ha - obtain ⟨x, hx⟩ := (AffineSubspace.nonempty_iff_ne_bot C).2 hC - have hderivative := ha x - simp only [FABL.booleanDerivative] at hderivative - have hxOne : binaryAffineFlatIndicator C x = 1 := - (binaryAffineFlatIndicator_apply_eq_one_iff C x).2 hx - have hxaOne : binaryAffineFlatIndicator C (x + a) = 1 := by - rw [hxOne] at hderivative - have heq := add_eq_zero_iff_eq_neg.mp hderivative - exact (heq.trans (ZMod.neg_eq_self_mod_two - (binaryAffineFlatIndicator C (x + a)))).symm - have hxa : x + a ∈ C := - (binaryAffineFlatIndicator_apply_eq_one_iff C (x + a)).1 hxaOne - have hvsub := AffineSubspace.vsub_mem_direction hxa hx - have hdifference : (x + a) - x = a := by - simp only [sub_eq_add_neg, ZModModule.neg_eq_self] - calc - x + a + x = a + (x + x) := by abel - _ = a := by rw [ZModModule.add_self, add_zero] - rw [vsub_eq_sub, hdifference] at hvsub - exact hvsub - · intro a ha x - simp only [FABL.booleanDerivative] - rw [binaryAffineFlatIndicator_period_of_mem_direction C a ha x] - exact ZModModule.add_self _ - -/-- The zero-derivative kernel of a type-`a` word has dimension four. -/ -theorem finrank_zeroDerivativeKernel_of_mem_weightSixteenTypeAWords - (h : BooleanFunction n) (hh : h ∈ orderTwoWeightSixteenTypeAWords n) : - Module.finrank FABL.𝔽₂ (zeroDerivativeKernel h) = 4 := by - classical - obtain ⟨C, hC, rfl⟩ := Finset.mem_image.mp hh - have hCdata : C ≠ ⊥ ∧ Module.finrank FABL.𝔽₂ C.direction = 4 := by - simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, - true_and] using hC - rw [binaryAffineFlatIndicator_zeroDerivativeKernel C hCdata.1, - hCdata.2] - -/-- The two exceptional weight-sixteen families are disjoint. -/ -theorem disjoint_orderTwoWeightSixteenTypeAWords_typeBWords (n : ℕ) : - Disjoint (orderTwoWeightSixteenTypeAWords n) - (orderTwoWeightSixteenTypeBWords n) := by - rw [Finset.disjoint_left] - intro h hA hB - have hfour := - finrank_zeroDerivativeKernel_of_mem_weightSixteenTypeAWords h hA - have htwo : Module.finrank FABL.𝔽₂ (zeroDerivativeKernel h) = 2 := - (Finset.mem_filter.mp hB).2 - omega - -/-- A Boolean function descends canonically to the quotient by its -zero-derivative kernel. -/ -noncomputable def zeroDerivativeKernelQuotientFunction - (h : BooleanFunction n) : - (FABL.F₂Cube n ⧸ zeroDerivativeKernel h) → FABL.𝔽₂ := - fun q ↦ Quotient.liftOn' q h (by - intro a b hab - let R := zeroDerivativeKernel h - have hquotient : R.mkQ a = R.mkQ b := Quotient.sound' hab - have habKernel : a + b ∈ R := by - have hdifference := (Submodule.Quotient.eq R).mp hquotient - simpa only [sub_eq_add_neg, ZModModule.neg_eq_self] using hdifference - have hperiod := habKernel b - simp only [FABL.booleanDerivative] at hperiod - have harg : b + (a + b) = a := by - calc - b + (a + b) = a + (b + b) := by abel - _ = a := by rw [ZModModule.add_self, add_zero] - rw [harg] at hperiod - have heq : h b = -h a := add_eq_zero_iff_eq_neg.mp hperiod - calc - h a = -h a := (ZMod.neg_eq_self_mod_two (h a)).symm - _ = h b := heq.symm) - -@[simp] theorem zeroDerivativeKernelQuotientFunction_mkQ - (h : BooleanFunction n) (x : FABL.F₂Cube n) : - zeroDerivativeKernelQuotientFunction h - ((zeroDerivativeKernel h).mkQ x) = h x := by - rfl - -private theorem card_submodule_mkQ_fiber_weightSixteen - (S : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) - (q : FABL.F₂Cube n ⧸ S) : - ((Finset.univ : Finset (FABL.F₂Cube n)).filter fun x ↦ - S.mkQ x = q).card = Nat.card S := by - classical - rw [← Fintype.card_subtype] - calc - Fintype.card {x : FABL.F₂Cube n // S.mkQ x = q} = - Fintype.card S.mkQ.toAddMonoidHom.ker := by - apply Fintype.card_congr - exact AddMonoidHom.fiberEquivKerOfSurjective - (f := S.mkQ.toAddMonoidHom) S.mkQ_surjective q - _ = Nat.card S := by - rw [← Nat.card_eq_fintype_card] - have hker : S.mkQ.toAddMonoidHom.ker = S.toAddSubgroup := by - rw [← LinearMap.ker_toAddSubgroup, Submodule.ker_mkQ] - rw [hker] - congr - -private theorem card_filter_mkQ_eq_card_mul_card_filter_weightSixteen - (S : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) - (P : (FABL.F₂Cube n ⧸ S) → Prop) [DecidablePred P] : - ((Finset.univ : Finset (FABL.F₂Cube n)).filter fun x ↦ - P (S.mkQ x)).card = - Nat.card S * - ((Finset.univ : Finset (FABL.F₂Cube n ⧸ S)).filter P).card := by - classical - have hfiber := Finset.sum_card_fiberwise_eq_card_filter - (s := (Finset.univ : Finset (FABL.F₂Cube n))) - (t := (Finset.univ : Finset (FABL.F₂Cube n ⧸ S)).filter P) - (g := S.mkQ) - rw [Finset.sum_const_nat] at hfiber - · calc - ((Finset.univ : Finset (FABL.F₂Cube n)).filter fun x ↦ - P (S.mkQ x)).card = - ((Finset.univ : Finset (FABL.F₂Cube n ⧸ S)).filter P).card * - Nat.card S := by - simpa only [Finset.mem_filter, Finset.mem_univ, true_and] using - hfiber.symm - _ = Nat.card S * - ((Finset.univ : Finset (FABL.F₂Cube n ⧸ S)).filter P).card := - Nat.mul_comm _ _ - · intro q hq - exact card_submodule_mkQ_fiber_weightSixteen S q - -private theorem exists_spanning_pair_of_finrank_two - (H : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) - (hH : Module.finrank FABL.𝔽₂ H = 2) : - ∃ a b : FABL.F₂Cube n, - H = (FABL.𝔽₂ ∙ a) ⊔ (FABL.𝔽₂ ∙ b) := by - have hbotlt : (⊥ : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) < H := by - apply bot_lt_iff_ne_bot.mpr - intro hHbot - rw [hHbot, finrank_bot] at hH - omega - obtain ⟨a, haH, haBot⟩ := SetLike.exists_of_lt hbotlt - have ha0 : a ≠ 0 := by - intro ha - subst a - exact haBot (Submodule.zero_mem _) - let S : Submodule FABL.𝔽₂ (FABL.F₂Cube n) := FABL.𝔽₂ ∙ a - have hSle : S ≤ H := - Submodule.span_le.2 (Set.singleton_subset_iff.2 haH) - have hSrank : Module.finrank FABL.𝔽₂ S = 1 := - finrank_span_singleton ha0 - have hSlt : S < H := - Submodule.lt_of_le_of_finrank_lt_finrank hSle (by omega) - obtain ⟨b, hbH, hbS⟩ := SetLike.exists_of_lt hSlt - refine ⟨a, b, ?_⟩ - symm - apply Submodule.eq_of_le_of_finrank_eq - · exact sup_le hSle - (Submodule.span_le.2 (Set.singleton_subset_iff.2 hbH)) - · rw [Submodule.finrank_sup_span_singleton hbS, hSrank, hH] - -private theorem mem_binaryAffineSubspace_iff_mkQ_eq - (S : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) - (a x : FABL.F₂Cube n) : - x ∈ FABL.binaryAffineSubspace S a ↔ S.mkQ x = S.mkQ a := by - rw [FABL.mem_binaryAffineSubspace_iff_add_mem] - constructor - · intro hx - apply (Submodule.Quotient.eq S).2 - simpa only [sub_eq_add_neg, ZModModule.neg_eq_self] using hx - · intro hx - have hdifference := (Submodule.Quotient.eq S).1 hx - simpa only [sub_eq_add_neg, ZModModule.neg_eq_self] using hdifference - -private theorem weightSixteenClassificationDisjointPairData - {p : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × - AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)} - (hp : p ∈ disjointBinaryAffineThreeFlatPairs n) : - p.1 ∈ binaryAffineFlats 3 n ∧ - p.2 ∈ binaryAffineFlats 3 n ∧ p.1 ⊓ p.2 = ⊥ := by - have hp' : p ∈ binaryAffineThreeFlatPairs n ∧ p.1 ⊓ p.2 = ⊥ := by - simpa only [disjointBinaryAffineThreeFlatPairs, - Finset.mem_filter] using hp - have hproduct : p ∈ - (binaryAffineFlats 3 n).product (binaryAffineFlats 3 n) := hp'.1 - exact ⟨(Finset.mem_product.mp hproduct).1, - (Finset.mem_product.mp hproduct).2, hp'.2⟩ - -private theorem weightSixteenClassificationPairPointSetsDisjoint - {p : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × - AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)} - (hp : p ∈ disjointBinaryAffineThreeFlatPairs n) : - Disjoint (binaryAffineFlatPoints p.1) - (binaryAffineFlatPoints p.2) := by - rw [Finset.disjoint_left] - intro x hxFirst hxSecond - have hxMeet : x ∈ p.1 ⊓ p.2 := - ⟨(mem_binaryAffineFlatPoints p.1 x).1 hxFirst, - (mem_binaryAffineFlatPoints p.2 x).1 hxSecond⟩ - rw [(weightSixteenClassificationDisjointPairData hp).2.2] at hxMeet - rw [← SetLike.mem_coe, AffineSubspace.bot_coe] at hxMeet - exact hxMeet - -private theorem firstFlatPoints_subset_support_of_mem_weightSixteenFiber - (h : BooleanFunction n) - {p : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × - AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)} - (hp : p ∈ weightSixteenRepresentationFiber h) : - binaryAffineFlatPoints p.1 ⊆ support h := by - have hpData := Finset.mem_filter.mp hp - intro x hx - have hxFirst : x ∈ p.1 := (mem_binaryAffineFlatPoints p.1 x).1 hx - have hxNotSecond : x ∉ p.2 := by - intro hxSecond - exact (Finset.disjoint_left.mp - (weightSixteenClassificationPairPointSetsDisjoint hpData.1)) hx - ((mem_binaryAffineFlatPoints p.2 x).2 hxSecond) - apply (mem_support h x).2 - rw [← hpData.2] - simp [weightSixteenRepresentationWord, binaryAffineFlatIndicator, - hxFirst, hxNotSecond] - -private theorem parallelAffineFlatPoints_disjoint - {A B : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)} - (hdirection : A.direction = B.direction) (hne : A ≠ B) : - Disjoint (binaryAffineFlatPoints A) (binaryAffineFlatPoints B) := by - rw [Finset.disjoint_left] - intro x hxA hxB - apply hne - have hxA' : x ∈ A := (mem_binaryAffineFlatPoints A x).1 hxA - have hxB' : x ∈ B := (mem_binaryAffineFlatPoints B x).1 hxB - exact (AffineSubspace.eq_iff_direction_eq_of_mem hxA' hxB').2 hdirection - -private theorem zeroDerivativeKernel_le_firstDirection_of_nonTypeA_fiber - (h : BooleanFunction n) - (hh : h ∈ orderTwoWeightSixteenDualWords n) - (hnotA : h ∉ orderTwoWeightSixteenTypeAWords n) - {p : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × - AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)} - (hp : p ∈ weightSixteenRepresentationFiber h) : - zeroDerivativeKernel h ≤ p.1.direction := by - intro r hr - by_contra hrDirection - classical - have hpFiber := Finset.mem_filter.mp hp - have hpData := weightSixteenClassificationDisjointPairData hpFiber.1 - have hAData : p.1 ≠ ⊥ ∧ - Module.finrank FABL.𝔽₂ p.1.direction = 3 := by - simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, - true_and] using hpData.1 - obtain ⟨a, ha⟩ := (AffineSubspace.nonempty_iff_ne_bot p.1).2 hAData.1 - let B := FABL.binaryAffineSubspace p.1.direction (a + r) - have hBbase : a + r ∈ B := by - change a + r ∈ FABL.binaryAffineSubspace p.1.direction (a + r) - rw [FABL.mem_binaryAffineSubspace_iff_add_mem, - ZModModule.add_self] - exact p.1.direction.zero_mem - have hBdirection : B.direction = p.1.direction := by - exact FABL.binaryAffineSubspace_direction p.1.direction (a + r) - have hBneBot : B ≠ ⊥ := by - intro hbot - have := hBbase - rw [hbot, ← SetLike.mem_coe, AffineSubspace.bot_coe] at this - exact this - have hABne : p.1 ≠ B := by - intro heq - have harA : a + r ∈ p.1 := by rw [heq]; exact hBbase - have hvsub := AffineSubspace.vsub_mem_direction harA ha - apply hrDirection - have hdifference : (a + r) -ᵥ a = r := by - simp only [vsub_eq_sub, sub_eq_add_neg, ZModModule.neg_eq_self] - calc - a + r + a = r + (a + a) := by abel - _ = r := by rw [ZModModule.add_self, add_zero] - rwa [hdifference] at hvsub - have hABdisjoint : Disjoint (binaryAffineFlatPoints p.1) - (binaryAffineFlatPoints B) := - parallelAffineFlatPoints_disjoint hBdirection.symm hABne - have hAcard : (binaryAffineFlatPoints p.1).card = 8 := by - rw [card_binaryAffineFlatPoints p.1 hAData.1, hAData.2] - norm_num - have hBcard : (binaryAffineFlatPoints B).card = 8 := by - rw [card_binaryAffineFlatPoints B hBneBot, hBdirection, hAData.2] - norm_num - have hfirstSubset : binaryAffineFlatPoints p.1 ⊆ support h := - firstFlatPoints_subset_support_of_mem_weightSixteenFiber h hp - have hsecondSubset : binaryAffineFlatPoints B ⊆ support h := by - intro x hx - have hxB : x ∈ B := (mem_binaryAffineFlatPoints B x).1 hx - have hxrA : x + r ∈ p.1 := by - have hxDirection : x + (a + r) ∈ p.1.direction := by - exact (FABL.mem_binaryAffineSubspace_iff_add_mem - p.1.direction (a + r) x).1 hxB - rw [show p.1 = FABL.binaryAffineSubspace p.1.direction a from - (AffineSubspace.mk'_eq ha).symm] - rw [FABL.mem_binaryAffineSubspace_iff_add_mem] - have harg : x + r + a = x + (a + r) := by abel - rwa [harg] - have hxrOne : h (x + r) = 1 := - (mem_support h (x + r)).1 - (hfirstSubset ((mem_binaryAffineFlatPoints p.1 (x + r)).2 hxrA)) - have hperiod := hr x - simp only [FABL.booleanDerivative] at hperiod - have hxOne : h x = 1 := by - have heq := add_eq_zero_iff_eq_neg.mp hperiod - rw [hxrOne] at heq - exact heq.trans (ZMod.neg_eq_self_mod_two 1) - exact (mem_support h x).2 hxOne - have hsupportCard : (support h).card = 16 := by - have hhData : h ∈ reedMuller (n - 3) n ∧ hammingWeight h = 16 := by - simpa only [orderTwoWeightSixteenDualWords, orderTwoDualWords, - Finset.mem_filter, Finset.mem_univ, true_and] using hh - simpa only [hammingWeight_eq_card_support] using hhData.2 - have hunionCard : - (binaryAffineFlatPoints p.1 ∪ binaryAffineFlatPoints B).card = 16 := by - rw [Finset.card_union_of_disjoint hABdisjoint, hAcard, hBcard] - have hunionSupport : - binaryAffineFlatPoints p.1 ∪ binaryAffineFlatPoints B = support h := by - apply Finset.eq_of_subset_of_card_le - · exact Finset.union_subset hfirstSubset hsecondSubset - · rw [hsupportCard, hunionCard] - let C := p.1 ⊔ B - have haC : a ∈ C := (le_sup_left : p.1 ≤ p.1 ⊔ B) ha - have hCneBot : C ≠ ⊥ := by - intro hbot - have := haC - rw [hbot, ← SetLike.mem_coe, AffineSubspace.bot_coe] at this - exact this - have hdifference : (a + r) -ᵥ a ∉ p.1.direction := by - simpa only [vsub_eq_sub, sub_eq_add_neg, ZModModule.neg_eq_self, - show a + r + a = r by - calc - a + r + a = r + (a + a) := by abel - _ = r := by rw [ZModModule.add_self, add_zero]] using hrDirection - have hCrank : Module.finrank FABL.𝔽₂ C.direction = 4 := by - dsimp only [C] - rw [AffineSubspace.direction_sup ha hBbase, - hBdirection, sup_idem, - Submodule.finrank_sup_span_singleton hdifference, hAData.2] - have hCcard : (binaryAffineFlatPoints C).card = 16 := by - rw [card_binaryAffineFlatPoints C hCneBot, hCrank] - norm_num - have hunionC : - binaryAffineFlatPoints p.1 ∪ binaryAffineFlatPoints B = - binaryAffineFlatPoints C := by - apply Finset.eq_of_subset_of_card_le - · intro x hx - rcases Finset.mem_union.mp hx with hxFirst | hxSecond - · have hle : p.1 ≤ C := by - exact le_sup_left - exact (mem_binaryAffineFlatPoints C x).2 - (hle ((mem_binaryAffineFlatPoints p.1 x).1 hxFirst)) - · have hle : B ≤ C := by - exact le_sup_right - exact (mem_binaryAffineFlatPoints C x).2 - (hle ((mem_binaryAffineFlatPoints B x).1 hxSecond)) - · rw [hCcard, hunionCard] - have hsupportC : support h = binaryAffineFlatPoints C := by - rw [← hunionSupport, hunionC] - have hsupportSet : (support h : Set (FABL.F₂Cube n)) = C := by - ext x - constructor - · intro hx - have hxFin : x ∈ support h := hx - have hxPoints : x ∈ binaryAffineFlatPoints C := by - rw [← hsupportC] - exact hxFin - exact (mem_binaryAffineFlatPoints C x).1 hxPoints - · intro hx - have hxPoints : x ∈ binaryAffineFlatPoints C := - (mem_binaryAffineFlatPoints C x).2 hx - have hxFin : x ∈ support h := by - rw [hsupportC] - exact hxPoints - exact hxFin - have hCflat : C ∈ binaryAffineFlats 4 n := by - simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, - true_and] using And.intro hCneBot hCrank - have hfunction : h = binaryAffineFlatIndicator C := by - have hflat : FABL.binaryAffineSubspace C.direction a = C := - AffineSubspace.mk'_eq haC - have haffine : h = affineFlatIndicator C.direction a := - (eq_affineFlatIndicator_iff_support_eq h C.direction a).2 (by - rw [hflat] - exact hsupportSet) - rw [binaryAffineFlatIndicator_eq_affineFlatIndicator C a haC] - exact haffine - have htypeA : h ∈ orderTwoWeightSixteenTypeAWords n := by - rw [orderTwoWeightSixteenTypeAWords, Finset.mem_image] - exact ⟨C, hCflat, hfunction.symm⟩ - exact hnotA htypeA - -private theorem zeroDerivativeKernel_le_firstDirection_of_typeB_fiber - (h : BooleanFunction n) - (hh : h ∈ orderTwoWeightSixteenTypeBWords n) - {p : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × - AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)} - (hp : p ∈ weightSixteenRepresentationFiber h) : - zeroDerivativeKernel h ≤ p.1.direction := by - apply zeroDerivativeKernel_le_firstDirection_of_nonTypeA_fiber h - (orderTwoWeightSixteenTypeBWords_subset_dualWords n hh) - · intro hA - exact (Finset.disjoint_left.mp - (disjoint_orderTwoWeightSixteenTypeAWords_typeBWords n)) hA hh - · exact hp - -/-- The quotient support of a Boolean function modulo its zero-derivative -kernel. -/ -noncomputable def zeroDerivativeSupportCosets (h : BooleanFunction n) : - Finset (FABL.F₂Cube n ⧸ zeroDerivativeKernel h) := by - classical - exact Finset.univ.filter fun q ↦ - zeroDerivativeKernelQuotientFunction h q = 1 - -/-- A type-`b` word is supported on exactly four cosets of its -two-dimensional zero-derivative kernel. -/ -theorem card_zeroDerivativeSupportCosets_of_mem_typeB - (h : BooleanFunction n) (hh : h ∈ orderTwoWeightSixteenTypeBWords n) : - (zeroDerivativeSupportCosets h).card = 4 := by - classical - let R := zeroDerivativeKernel h - let qh := zeroDerivativeKernelQuotientFunction h - have hhData := Finset.mem_filter.mp hh - have hweight : hammingWeight h = 16 := by - have hdualData : h ∈ reedMuller (n - 3) n ∧ - hammingWeight h = 16 := by - simpa only [orderTwoWeightSixteenDualWords, orderTwoDualWords, - Finset.mem_filter, Finset.mem_univ, true_and] using hhData.1 - exact hdualData.2 - have hRrank : Module.finrank FABL.𝔽₂ R = 2 := hhData.2 - have hRcard : Nat.card R = 4 := by - rw [FABL.card_submodule_eq_two_pow_finrank, hRrank] - norm_num - have hfactor := card_filter_mkQ_eq_card_mul_card_filter_weightSixteen - R (fun q ↦ qh q = 1) - have hleft : - ((Finset.univ : Finset (FABL.F₂Cube n)).filter fun x ↦ - qh (R.mkQ x) = 1).card = 16 := by - simpa only [R, qh, zeroDerivativeKernelQuotientFunction_mkQ, - support, FABL.f₂OneSupport, hammingWeight_eq_card_support] using hweight - have heq : 16 = 4 * - ((Finset.univ : Finset (FABL.F₂Cube n ⧸ R)).filter fun q ↦ - qh q = 1).card := by - calc - 16 = ((Finset.univ : Finset (FABL.F₂Cube n)).filter fun x ↦ - qh (R.mkQ x) = 1).card := hleft.symm - _ = Nat.card R * - ((Finset.univ : Finset (FABL.F₂Cube n ⧸ R)).filter fun q ↦ - qh q = 1).card := hfactor - _ = 4 * - ((Finset.univ : Finset (FABL.F₂Cube n ⧸ R)).filter fun q ↦ - qh q = 1).card := by rw [hRcard] - change ((Finset.univ : Finset (FABL.F₂Cube n ⧸ R)).filter fun q ↦ - qh q = 1).card = 4 - omega - -/-- The quotient cosets met by the first flat in a weight-sixteen -representation. -/ -noncomputable def weightSixteenRepresentationFirstCosets - (h : BooleanFunction n) - (p : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × - AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) : - Finset (FABL.F₂Cube n ⧸ zeroDerivativeKernel h) := by - classical - exact (binaryAffineFlatPoints p.1).image (zeroDerivativeKernel h).mkQ - -private theorem card_affineThreeFlatQuotientImage - (h : BooleanFunction n) - (A : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) - (hA : A ∈ binaryAffineFlats 3 n) - (hRrank : Module.finrank FABL.𝔽₂ (zeroDerivativeKernel h) = 2) - (hRle : zeroDerivativeKernel h ≤ A.direction) : - ((binaryAffineFlatPoints A).image - (zeroDerivativeKernel h).mkQ).card = 2 := by - classical - let R := zeroDerivativeKernel h - let t := (binaryAffineFlatPoints A).image R.mkQ - have hAData : A ≠ ⊥ ∧ Module.finrank FABL.𝔽₂ A.direction = 3 := by - simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, - true_and] using hA - have hAcard : (binaryAffineFlatPoints A).card = 8 := by - rw [card_binaryAffineFlatPoints A hAData.1, hAData.2] - norm_num - have hRcard : Nat.card R = 4 := by - rw [FABL.card_submodule_eq_two_pow_finrank, hRrank] - norm_num - have hfiber : ∀ q ∈ t, - ((binaryAffineFlatPoints A).filter fun x ↦ R.mkQ x = q).card = 4 := by - intro q hq - obtain ⟨x, hxA, hxq⟩ := Finset.mem_image.mp hq - have hfiberEq : - (binaryAffineFlatPoints A).filter (fun y ↦ R.mkQ y = q) = - (Finset.univ : Finset (FABL.F₂Cube n)).filter - (fun y ↦ R.mkQ y = q) := by - ext y - simp only [Finset.mem_filter, Finset.mem_univ, true_and] - constructor - · exact fun hy ↦ hy.2 - · intro hyq - have hyxQ : R.mkQ y = R.mkQ x := hyq.trans hxq.symm - have hyxR : y + x ∈ R := by - have hdifference := (Submodule.Quotient.eq R).1 hyxQ - simpa only [sub_eq_add_neg, ZModModule.neg_eq_self] using hdifference - have hxASet : x ∈ A := (mem_binaryAffineFlatPoints A x).1 hxA - have hyA : y ∈ A := by - rw [show A = FABL.binaryAffineSubspace A.direction x from - (AffineSubspace.mk'_eq hxASet).symm] - rw [FABL.mem_binaryAffineSubspace_iff_add_mem] - exact hRle hyxR - exact ⟨(mem_binaryAffineFlatPoints A y).2 hyA, hyq⟩ - rw [hfiberEq, card_submodule_mkQ_fiber_weightSixteen R q, hRcard] - have hsum := Finset.card_eq_sum_card_image R.mkQ - (binaryAffineFlatPoints A) - rw [Finset.sum_const_nat hfiber, hAcard] at hsum - change t.card = 2 - change 8 = t.card * 4 at hsum - omega - -private theorem weightSixteenRepresentationFirstCosets_mem_powersetCard - (h : BooleanFunction n) - (hh : h ∈ orderTwoWeightSixteenTypeBWords n) - {p : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × - AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)} - (hp : p ∈ weightSixteenRepresentationFiber h) : - weightSixteenRepresentationFirstCosets h p ∈ - (zeroDerivativeSupportCosets h).powersetCard 2 := by - classical - rw [Finset.mem_powersetCard] - constructor - · intro q hq - obtain ⟨x, hxFirst, rfl⟩ := Finset.mem_image.mp hq - have hxSupport := firstFlatPoints_subset_support_of_mem_weightSixteenFiber - h hp hxFirst - have hxOne : h x = 1 := (mem_support h x).1 hxSupport - simp only [zeroDerivativeSupportCosets, Finset.mem_filter, - Finset.mem_univ, true_and, - zeroDerivativeKernelQuotientFunction_mkQ] - exact hxOne - · have hpData := weightSixteenClassificationDisjointPairData - (Finset.mem_filter.mp hp).1 - have hRrank : Module.finrank FABL.𝔽₂ (zeroDerivativeKernel h) = 2 := - (Finset.mem_filter.mp hh).2 - exact card_affineThreeFlatQuotientImage h p.1 hpData.1 hRrank - (zeroDerivativeKernel_le_firstDirection_of_typeB_fiber h hh hp) - -private theorem firstFlat_eq_of_firstCosets_eq - (h : BooleanFunction n) - (hh : h ∈ orderTwoWeightSixteenTypeBWords n) - {p q : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × - AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)} - (hp : p ∈ weightSixteenRepresentationFiber h) - (hq : q ∈ weightSixteenRepresentationFiber h) - (hcosets : weightSixteenRepresentationFirstCosets h p = - weightSixteenRepresentationFirstCosets h q) : - p.1 = q.1 := by - classical - have hpData := weightSixteenClassificationDisjointPairData - (Finset.mem_filter.mp hp).1 - have hqData := weightSixteenClassificationDisjointPairData - (Finset.mem_filter.mp hq).1 - have hpRle := zeroDerivativeKernel_le_firstDirection_of_typeB_fiber - h hh hp - have hqRle := zeroDerivativeKernel_le_firstDirection_of_typeB_fiber - h hh hq - apply AffineSubspace.ext - intro x - constructor - · intro hxp - have hxCoset : (zeroDerivativeKernel h).mkQ x ∈ - weightSixteenRepresentationFirstCosets h p := by - apply Finset.mem_image.mpr - exact ⟨x, (mem_binaryAffineFlatPoints p.1 x).2 hxp, rfl⟩ - rw [hcosets] at hxCoset - obtain ⟨y, hyq, hyx⟩ := Finset.mem_image.mp hxCoset - have hyqSet : y ∈ q.1 := (mem_binaryAffineFlatPoints q.1 y).1 hyq - have hxyKernel : x + y ∈ zeroDerivativeKernel h := by - have hdifference := (Submodule.Quotient.eq - (zeroDerivativeKernel h)).1 hyx.symm - simpa only [sub_eq_add_neg, ZModModule.neg_eq_self] using hdifference - rw [show q.1 = FABL.binaryAffineSubspace q.1.direction y from - (AffineSubspace.mk'_eq hyqSet).symm] - rw [FABL.mem_binaryAffineSubspace_iff_add_mem] - exact hqRle hxyKernel - · intro hxq - have hxCoset : (zeroDerivativeKernel h).mkQ x ∈ - weightSixteenRepresentationFirstCosets h q := by - apply Finset.mem_image.mpr - exact ⟨x, (mem_binaryAffineFlatPoints q.1 x).2 hxq, rfl⟩ - rw [← hcosets] at hxCoset - obtain ⟨y, hyp, hyx⟩ := Finset.mem_image.mp hxCoset - have hypSet : y ∈ p.1 := (mem_binaryAffineFlatPoints p.1 y).1 hyp - have hxyKernel : x + y ∈ zeroDerivativeKernel h := by - have hdifference := (Submodule.Quotient.eq - (zeroDerivativeKernel h)).1 hyx.symm - simpa only [sub_eq_add_neg, ZModModule.neg_eq_self] using hdifference - rw [show p.1 = FABL.binaryAffineSubspace p.1.direction y from - (AffineSubspace.mk'_eq hypSet).symm] - rw [FABL.mem_binaryAffineSubspace_iff_add_mem] - exact hpRle hxyKernel - -private theorem weightSixteenRepresentationFirstCosets_injective_on_typeB_fiber - (h : BooleanFunction n) - (hh : h ∈ orderTwoWeightSixteenTypeBWords n) : - Set.InjOn (weightSixteenRepresentationFirstCosets h) - (weightSixteenRepresentationFiber h : Set - (AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × - AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n))) := by - intro p hp q hq hcosets - have hpFin : p ∈ weightSixteenRepresentationFiber h := hp - have hqFin : q ∈ weightSixteenRepresentationFiber h := hq - have hfirst := firstFlat_eq_of_firstCosets_eq h hh hpFin hqFin hcosets - have hpWord := (Finset.mem_filter.mp hpFin).2 - have hqWord := (Finset.mem_filter.mp hqFin).2 - have hsums : binaryAffineFlatIndicator p.1 + - binaryAffineFlatIndicator p.2 = - binaryAffineFlatIndicator q.1 + binaryAffineFlatIndicator q.2 := by - exact hpWord.trans hqWord.symm - rw [hfirst] at hsums - have hsecondIndicator : binaryAffineFlatIndicator p.2 = - binaryAffineFlatIndicator q.2 := add_left_cancel hsums - have hpSecond := (weightSixteenClassificationDisjointPairData - (Finset.mem_filter.mp hpFin).1).2.1 - have hqSecond := (weightSixteenClassificationDisjointPairData - (Finset.mem_filter.mp hqFin).1).2.1 - have hpSecondNe : p.2 ≠ ⊥ := by - have hpSecondData : p.2 ≠ ⊥ ∧ - Module.finrank FABL.𝔽₂ p.2.direction = 3 := by - simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, - true_and] using hpSecond - exact hpSecondData.1 - have hqSecondNe : q.2 ≠ ⊥ := by - have hqSecondData : q.2 ≠ ⊥ ∧ - Module.finrank FABL.𝔽₂ q.2.direction = 3 := by - simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, - true_and] using hqSecond - exact hqSecondData.1 - have hsecond : p.2 = q.2 := - binaryAffineFlatIndicator_injective_on_nonempty - hpSecondNe hqSecondNe hsecondIndicator - exact Prod.ext hfirst hsecond - -private theorem card_weightSixteenRepresentationFiber_typeB_le_six - (h : BooleanFunction n) (hh : h ∈ orderTwoWeightSixteenTypeBWords n) : - (weightSixteenRepresentationFiber h).card ≤ 6 := by - classical - calc - (weightSixteenRepresentationFiber h).card ≤ - ((zeroDerivativeSupportCosets h).powersetCard 2).card := by - apply Finset.card_le_card_of_injOn - (weightSixteenRepresentationFirstCosets h) - · intro p hp - exact weightSixteenRepresentationFirstCosets_mem_powersetCard - h hh hp - · exact weightSixteenRepresentationFirstCosets_injective_on_typeB_fiber - h hh - _ = 6 := by - rw [Finset.card_powersetCard, - card_zeroDerivativeSupportCosets_of_mem_typeB h hh] - norm_num [Nat.choose] - -private def twoCosetAffineThreeFlat - (R : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) - (x y : FABL.F₂Cube n) : - AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) := - FABL.binaryAffineSubspace R x ⊔ FABL.binaryAffineSubspace R y - -private theorem twoCosetAffineThreeFlat_mem_flats - (R : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) - (x y : FABL.F₂Cube n) - (hRrank : Module.finrank FABL.𝔽₂ R = 2) - (hxy : R.mkQ x ≠ R.mkQ y) : - twoCosetAffineThreeFlat R x y ∈ binaryAffineFlats 3 n := by - let A := FABL.binaryAffineSubspace R x - let B := FABL.binaryAffineSubspace R y - have hxA : x ∈ A := by - change x ∈ FABL.binaryAffineSubspace R x - rw [FABL.mem_binaryAffineSubspace_iff_add_mem, - ZModModule.add_self] - exact R.zero_mem - have hyB : y ∈ B := by - change y ∈ FABL.binaryAffineSubspace R y - rw [FABL.mem_binaryAffineSubspace_iff_add_mem, - ZModModule.add_self] - exact R.zero_mem - have hdifference : y -ᵥ x ∉ R := by - intro hyx - apply hxy - apply (Submodule.Quotient.eq R).2 - simpa only [vsub_eq_sub, sub_eq_add_neg, ZModModule.neg_eq_self, - add_comm] using hyx - have hneBot : twoCosetAffineThreeFlat R x y ≠ ⊥ := by - intro hbot - have hxBot : x ∈ (⊥ : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) := by - rw [← hbot] - exact (le_sup_left : A ≤ A ⊔ B) hxA - rw [← SetLike.mem_coe, AffineSubspace.bot_coe] at hxBot - exact hxBot - have hrank : Module.finrank FABL.𝔽₂ - (twoCosetAffineThreeFlat R x y).direction = 3 := by - rw [twoCosetAffineThreeFlat, - AffineSubspace.direction_sup hxA hyB, - FABL.binaryAffineSubspace_direction, - FABL.binaryAffineSubspace_direction, sup_idem, - Submodule.finrank_sup_span_singleton hdifference, hRrank] - simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, - true_and] using And.intro hneBot hrank - -private theorem points_twoCosetAffineThreeFlat - (R : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) - (x y : FABL.F₂Cube n) - (hRrank : Module.finrank FABL.𝔽₂ R = 2) - (hxy : R.mkQ x ≠ R.mkQ y) : - binaryAffineFlatPoints (twoCosetAffineThreeFlat R x y) = - binaryAffineFlatPoints (FABL.binaryAffineSubspace R x) ∪ - binaryAffineFlatPoints (FABL.binaryAffineSubspace R y) := by - let A := FABL.binaryAffineSubspace R x - let B := FABL.binaryAffineSubspace R y - let C := twoCosetAffineThreeFlat R x y - have hAne : A ≠ ⊥ := by - intro hbot - have hx : x ∈ A := by - change x ∈ FABL.binaryAffineSubspace R x - rw [FABL.mem_binaryAffineSubspace_iff_add_mem, - ZModModule.add_self] - exact R.zero_mem - rw [hbot, ← SetLike.mem_coe, AffineSubspace.bot_coe] at hx - exact hx - have hBne : B ≠ ⊥ := by - intro hbot - have hy : y ∈ B := by - change y ∈ FABL.binaryAffineSubspace R y - rw [FABL.mem_binaryAffineSubspace_iff_add_mem, - ZModModule.add_self] - exact R.zero_mem - rw [hbot, ← SetLike.mem_coe, AffineSubspace.bot_coe] at hy - exact hy - have hABne : A ≠ B := by - intro heq - apply hxy - apply (Submodule.Quotient.eq R).2 - have hyA : y ∈ A := by - rw [heq] - change y ∈ FABL.binaryAffineSubspace R y - rw [FABL.mem_binaryAffineSubspace_iff_add_mem, - ZModModule.add_self] - exact R.zero_mem - have hyx := (FABL.mem_binaryAffineSubspace_iff_add_mem R x y).1 hyA - simpa only [sub_eq_add_neg, ZModModule.neg_eq_self, add_comm] using hyx - have hdisjoint : Disjoint (binaryAffineFlatPoints A) - (binaryAffineFlatPoints B) := - parallelAffineFlatPoints_disjoint (by - simp only [A, B, FABL.binaryAffineSubspace_direction]) hABne - have hCflat := twoCosetAffineThreeFlat_mem_flats R x y hRrank hxy - have hAdirection : A.direction = R := by - exact FABL.binaryAffineSubspace_direction R x - have hBdirection : B.direction = R := by - exact FABL.binaryAffineSubspace_direction R y - have hCData : C ≠ ⊥ ∧ Module.finrank FABL.𝔽₂ C.direction = 3 := by - simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, - true_and, C] using hCflat - symm - apply Finset.eq_of_subset_of_card_le - · intro z hz - rcases Finset.mem_union.mp hz with hzA | hzB - · exact (mem_binaryAffineFlatPoints C z).2 - ((le_sup_left : A ≤ A ⊔ B) - ((mem_binaryAffineFlatPoints A z).1 hzA)) - · exact (mem_binaryAffineFlatPoints C z).2 - ((le_sup_right : B ≤ A ⊔ B) - ((mem_binaryAffineFlatPoints B z).1 hzB)) - · rw [card_binaryAffineFlatPoints C hCData.1, hCData.2, - Finset.card_union_of_disjoint hdisjoint, - card_binaryAffineFlatPoints A hAne, - card_binaryAffineFlatPoints B hBne, - hAdirection, hBdirection, hRrank] - norm_num - -private theorem indicator_twoCosetAffineThreeFlat - (R : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) - (x y : FABL.F₂Cube n) - (hRrank : Module.finrank FABL.𝔽₂ R = 2) - (hxy : R.mkQ x ≠ R.mkQ y) : - binaryAffineFlatIndicator (twoCosetAffineThreeFlat R x y) = - binaryAffineFlatIndicator (FABL.binaryAffineSubspace R x) + - binaryAffineFlatIndicator (FABL.binaryAffineSubspace R y) := by - have hpoints := points_twoCosetAffineThreeFlat R x y hRrank hxy - have hdisjoint : Disjoint - (binaryAffineFlatPoints (FABL.binaryAffineSubspace R x)) - (binaryAffineFlatPoints (FABL.binaryAffineSubspace R y)) := by - rw [Finset.disjoint_left] - intro z hzx hzy - apply hxy - have hzx' : R.mkQ z = R.mkQ x := - (mem_binaryAffineSubspace_iff_mkQ_eq R x z).1 - ((mem_binaryAffineFlatPoints _ z).1 hzx) - have hzy' : R.mkQ z = R.mkQ y := - (mem_binaryAffineSubspace_iff_mkQ_eq R y z).1 - ((mem_binaryAffineFlatPoints _ z).1 hzy) - exact hzx'.symm.trans hzy' - exact binaryAffineFlatIndicator_eq_add_of_points_eq_union - (FABL.binaryAffineSubspace R x) (FABL.binaryAffineSubspace R y) - (twoCosetAffineThreeFlat R x y) hpoints hdisjoint - -private theorem mem_twoCosetAffineThreeFlat_iff - (R : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) - (x y z : FABL.F₂Cube n) - (hRrank : Module.finrank FABL.𝔽₂ R = 2) - (hxy : R.mkQ x ≠ R.mkQ y) : - z ∈ twoCosetAffineThreeFlat R x y ↔ - R.mkQ z = R.mkQ x ∨ R.mkQ z = R.mkQ y := by - have hpoints := Finset.ext_iff.mp - (points_twoCosetAffineThreeFlat R x y hRrank hxy) z - simpa only [mem_binaryAffineFlatPoints, Finset.mem_union, - mem_binaryAffineSubspace_iff_mkQ_eq] using hpoints - -private theorem image_mkQ_points_twoCosetAffineThreeFlat - (R : Submodule FABL.𝔽₂ (FABL.F₂Cube n)) - (x y : FABL.F₂Cube n) - (hRrank : Module.finrank FABL.𝔽₂ R = 2) - (hxy : R.mkQ x ≠ R.mkQ y) : - (binaryAffineFlatPoints (twoCosetAffineThreeFlat R x y)).image R.mkQ = - {R.mkQ x, R.mkQ y} := by - ext q - constructor - · intro hq - obtain ⟨z, hz, rfl⟩ := Finset.mem_image.mp hq - have hzFlat := (mem_binaryAffineFlatPoints _ z).1 hz - simpa only [Finset.mem_insert, Finset.mem_singleton] using - (mem_twoCosetAffineThreeFlat_iff R x y z hRrank hxy).1 hzFlat - · intro hq - simp only [Finset.mem_insert, Finset.mem_singleton] at hq - rcases hq with rfl | rfl - · apply Finset.mem_image.mpr - refine ⟨x, (mem_binaryAffineFlatPoints _ x).2 ?_, rfl⟩ - exact (mem_twoCosetAffineThreeFlat_iff R x y x hRrank hxy).2 - (Or.inl rfl) - · apply Finset.mem_image.mpr - refine ⟨y, (mem_binaryAffineFlatPoints _ y).2 ?_, rfl⟩ - exact (mem_twoCosetAffineThreeFlat_iff R x y y hRrank hxy).2 - (Or.inr rfl) - -private theorem weightSixteenRepresentationFirstCosets_surjOn_typeB_fiber - (h : BooleanFunction n) - (hh : h ∈ orderTwoWeightSixteenTypeBWords n) : - Set.SurjOn (weightSixteenRepresentationFirstCosets h) - (weightSixteenRepresentationFiber h : Set - (AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × - AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n))) - ((zeroDerivativeSupportCosets h).powersetCard 2 : Set - (Finset (FABL.F₂Cube n ⧸ zeroDerivativeKernel h))) := by - classical - intro t ht - have htFin : t ∈ (zeroDerivativeSupportCosets h).powersetCard 2 := ht - have htData := Finset.mem_powersetCard.mp htFin - let R := zeroDerivativeKernel h - let qs := zeroDerivativeSupportCosets h - let u := qs \ t - have hqscard : qs.card = 4 := - card_zeroDerivativeSupportCosets_of_mem_typeB h hh - have hucard : u.card = 2 := by - dsimp only [u] - rw [Finset.card_sdiff_of_subset htData.1, hqscard, htData.2] - obtain ⟨q₀, q₁, hq01, htEq⟩ := Finset.card_eq_two.mp htData.2 - obtain ⟨q₂, q₃, hq23, huEq⟩ := Finset.card_eq_two.mp hucard - have hq0t : q₀ ∈ t := by simp [htEq] - have hq1t : q₁ ∈ t := by simp [htEq] - have hq2u : q₂ ∈ u := by simp [huEq] - have hq3u : q₃ ∈ u := by simp [huEq] - have hq2notT : q₂ ∉ t := (Finset.mem_sdiff.mp hq2u).2 - have hq3notT : q₃ ∉ t := (Finset.mem_sdiff.mp hq3u).2 - have hq02 : q₀ ≠ q₂ := by - intro heq - exact hq2notT (heq ▸ hq0t) - have hq03 : q₀ ≠ q₃ := by - intro heq - exact hq3notT (heq ▸ hq0t) - have hq12 : q₁ ≠ q₂ := by - intro heq - exact hq2notT (heq ▸ hq1t) - have hq13 : q₁ ≠ q₃ := by - intro heq - exact hq3notT (heq ▸ hq1t) - let x₀ : FABL.F₂Cube n := Quotient.out q₀ - let x₁ : FABL.F₂Cube n := Quotient.out q₁ - let x₂ : FABL.F₂Cube n := Quotient.out q₂ - let x₃ : FABL.F₂Cube n := Quotient.out q₃ - have hx₀ : R.mkQ x₀ = q₀ := Submodule.Quotient.mk_out q₀ - have hx₁ : R.mkQ x₁ = q₁ := Submodule.Quotient.mk_out q₁ - have hx₂ : R.mkQ x₂ = q₂ := Submodule.Quotient.mk_out q₂ - have hx₃ : R.mkQ x₃ = q₃ := Submodule.Quotient.mk_out q₃ - have h01 : R.mkQ x₀ ≠ R.mkQ x₁ := by - intro heq - exact hq01 (hx₀.symm.trans (heq.trans hx₁)) - have h23 : R.mkQ x₂ ≠ R.mkQ x₃ := by - intro heq - exact hq23 (hx₂.symm.trans (heq.trans hx₃)) - have h02 : R.mkQ x₀ ≠ R.mkQ x₂ := by - intro heq - exact hq02 (hx₀.symm.trans (heq.trans hx₂)) - have h03 : R.mkQ x₀ ≠ R.mkQ x₃ := by - intro heq - exact hq03 (hx₀.symm.trans (heq.trans hx₃)) - have h12 : R.mkQ x₁ ≠ R.mkQ x₂ := by - intro heq - exact hq12 (hx₁.symm.trans (heq.trans hx₂)) - have h13 : R.mkQ x₁ ≠ R.mkQ x₃ := by - intro heq - exact hq13 (hx₁.symm.trans (heq.trans hx₃)) - have hRrank : Module.finrank FABL.𝔽₂ R = 2 := - (Finset.mem_filter.mp hh).2 - let A := twoCosetAffineThreeFlat R x₀ x₁ - let B := twoCosetAffineThreeFlat R x₂ x₃ - have hAflat : A ∈ binaryAffineFlats 3 n := - twoCosetAffineThreeFlat_mem_flats R x₀ x₁ hRrank h01 - have hBflat : B ∈ binaryAffineFlats 3 n := - twoCosetAffineThreeFlat_mem_flats R x₂ x₃ hRrank h23 - have hpointsDisjoint : Disjoint (binaryAffineFlatPoints A) - (binaryAffineFlatPoints B) := by - rw [Finset.disjoint_left] - intro z hzA hzB - have hzAData := (mem_twoCosetAffineThreeFlat_iff - R x₀ x₁ z hRrank h01).1 - ((mem_binaryAffineFlatPoints A z).1 hzA) - have hzBData := (mem_twoCosetAffineThreeFlat_iff - R x₂ x₃ z hRrank h23).1 - ((mem_binaryAffineFlatPoints B z).1 hzB) - rcases hzAData with hz0 | hz1 <;> - rcases hzBData with hz2 | hz3 - · exact h02 (hz0.symm.trans hz2) - · exact h03 (hz0.symm.trans hz3) - · exact h12 (hz1.symm.trans hz2) - · exact h13 (hz1.symm.trans hz3) - have hinf : A ⊓ B = ⊥ := by - by_contra hne - obtain ⟨z, hz⟩ := (AffineSubspace.nonempty_iff_ne_bot (A ⊓ B)).2 hne - exact (Finset.disjoint_left.mp hpointsDisjoint) - ((mem_binaryAffineFlatPoints A z).2 hz.1) - ((mem_binaryAffineFlatPoints B z).2 hz.2) - have hpair : (A, B) ∈ disjointBinaryAffineThreeFlatPairs n := by - simp only [disjointBinaryAffineThreeFlatPairs, Finset.mem_filter] - constructor - · change (A, B) ∈ (binaryAffineFlats 3 n).product - (binaryAffineFlats 3 n) - exact Finset.mem_product.mpr ⟨hAflat, hBflat⟩ - · exact hinf - have hpartition : t ∪ u = qs := by - exact Finset.union_sdiff_of_subset htData.1 - have hword : weightSixteenRepresentationWord A B = h := by - funext z - have hzA : z ∈ A ↔ R.mkQ z ∈ t := by - rw [mem_twoCosetAffineThreeFlat_iff R x₀ x₁ z hRrank h01, - htEq, hx₀, hx₁] - simp - have hzB : z ∈ B ↔ R.mkQ z ∈ u := by - rw [mem_twoCosetAffineThreeFlat_iff R x₂ x₃ z hRrank h23, - huEq, hx₂, hx₃] - simp - have hzSupport : h z = 1 ↔ z ∈ A ∨ z ∈ B := by - calc - h z = 1 ↔ R.mkQ z ∈ qs := by - dsimp only [qs, R, zeroDerivativeSupportCosets] - simp only [Finset.mem_filter, Finset.mem_univ, true_and, - zeroDerivativeKernelQuotientFunction_mkQ] - _ ↔ R.mkQ z ∈ t ∪ u := by rw [hpartition] - _ ↔ R.mkQ z ∈ t ∨ R.mkQ z ∈ u := Finset.mem_union - _ ↔ z ∈ A ∨ z ∈ B := or_congr hzA.symm hzB.symm - have hzNotBoth : ¬(z ∈ A ∧ z ∈ B) := by - intro hz - exact (Finset.disjoint_left.mp hpointsDisjoint) - ((mem_binaryAffineFlatPoints A z).2 hz.1) - ((mem_binaryAffineFlatPoints B z).2 hz.2) - simp only [weightSixteenRepresentationWord, Pi.add_apply, - binaryAffineFlatIndicator] - by_cases hza : z ∈ A <;> by_cases hzb : z ∈ B - · exact (hzNotBoth ⟨hza, hzb⟩).elim - · have hzOne : h z = 1 := hzSupport.2 (Or.inl hza) - simp [hza, hzb, hzOne] - · have hzOne : h z = 1 := hzSupport.2 (Or.inr hzb) - simp [hza, hzb, hzOne] - · have hzNotOne : h z ≠ 1 := by - intro hzOne - exact (hzSupport.1 hzOne).elim hza hzb - have hzZero : h z = 0 := by - by_contra hzNeZero - exact hzNotOne (Fin.eq_one_of_ne_zero _ hzNeZero) - simp [hza, hzb, hzZero] - have hpFiber : (A, B) ∈ weightSixteenRepresentationFiber h := by - simp only [weightSixteenRepresentationFiber, Finset.mem_filter] - exact ⟨hpair, hword⟩ - refine ⟨(A, B), hpFiber, ?_⟩ - change (binaryAffineFlatPoints A).image R.mkQ = t - dsimp only [A] - rw [image_mkQ_points_twoCosetAffineThreeFlat - R x₀ x₁ hRrank h01, hx₀, hx₁, htEq] - -/-- A type-`b` word has exactly six ordered disjoint-three-flat -representations. -/ -theorem card_weightSixteenRepresentationFiber_of_mem_typeBWords - (h : BooleanFunction n) (hh : h ∈ orderTwoWeightSixteenTypeBWords n) : - (weightSixteenRepresentationFiber h).card = 6 := by - have hlower := Finset.card_le_card_of_surjOn - (weightSixteenRepresentationFirstCosets h) - (weightSixteenRepresentationFirstCosets_surjOn_typeB_fiber h hh) - have hpowerset : ((zeroDerivativeSupportCosets h).powersetCard 2).card = 6 := by - rw [Finset.card_powersetCard, - card_zeroDerivativeSupportCosets_of_mem_typeB h hh] - norm_num [Nat.choose] - rw [hpowerset] at hlower - exact Nat.le_antisymm - (card_weightSixteenRepresentationFiber_typeB_le_six h hh) hlower - -private theorem support_weightSixteenRepresentationWord_eq_union - {p : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × - AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)} - (hp : p ∈ disjointBinaryAffineThreeFlatPairs n) : - support (weightSixteenRepresentationWord p.1 p.2) = - binaryAffineFlatPoints p.1 ∪ binaryAffineFlatPoints p.2 := by - classical - have hdisjoint := weightSixteenClassificationPairPointSetsDisjoint hp - ext x - have hnotBoth : ¬(x ∈ p.1 ∧ x ∈ p.2) := by - intro hboth - exact (Finset.disjoint_left.mp hdisjoint) - ((mem_binaryAffineFlatPoints p.1 x).2 hboth.1) - ((mem_binaryAffineFlatPoints p.2 x).2 hboth.2) - simp only [support, FABL.f₂OneSupport, Finset.mem_filter, - Finset.mem_univ, true_and, weightSixteenRepresentationWord, - Pi.add_apply, binaryAffineFlatIndicator, Finset.mem_union, - mem_binaryAffineFlatPoints] - by_cases hxFirst : x ∈ p.1 <;> by_cases hxSecond : x ∈ p.2 - · exact (hnotBoth ⟨hxFirst, hxSecond⟩).elim - · simp [hxFirst, hxSecond] - · simp [hxFirst, hxSecond] - · simp [hxFirst, hxSecond] - -private theorem support_eq_union_of_mem_weightSixteenFiber - (h : BooleanFunction n) - {p : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × - AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)} - (hp : p ∈ weightSixteenRepresentationFiber h) : - support h = - binaryAffineFlatPoints p.1 ∪ binaryAffineFlatPoints p.2 := by - have hpData := Finset.mem_filter.mp hp - rw [← hpData.2] - exact support_weightSixteenRepresentationWord_eq_union hpData.1 - -private theorem swap_mem_weightSixteenRepresentationFiber - (h : BooleanFunction n) - {p : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × - AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)} - (hp : p ∈ weightSixteenRepresentationFiber h) : - (p.2, p.1) ∈ weightSixteenRepresentationFiber h := by - classical - have hpData := Finset.mem_filter.mp hp - apply Finset.mem_filter.mpr - constructor - · have hpPair : p ∈ binaryAffineThreeFlatPairs n ∧ p.1 ⊓ p.2 = ⊥ := by - simpa only [disjointBinaryAffineThreeFlatPairs, - Finset.mem_filter] using hpData.1 - have hproduct := Finset.mem_product.mp hpPair.1 - rw [disjointBinaryAffineThreeFlatPairs, Finset.mem_filter] - exact ⟨Finset.mem_product.mpr ⟨hproduct.2, hproduct.1⟩, - by rw [inf_comm, hpPair.2]⟩ - · simpa only [weightSixteenRepresentationWord, add_comm] using hpData.2 - -private theorem first_ne_second_of_mem_weightSixteenFiber - (h : BooleanFunction n) - {p : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × - AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)} - (hp : p ∈ weightSixteenRepresentationFiber h) : - p.1 ≠ p.2 := by - intro heq - have hpData := Finset.mem_filter.mp hp - have hmeet := (weightSixteenClassificationDisjointPairData hpData.1).2.2 - rw [heq, inf_idem] at hmeet - have hsecondData := - (weightSixteenClassificationDisjointPairData hpData.1).2.1 - have hnonbot : p.2 ≠ ⊥ := by - have hsecondData' : p.2 ≠ ⊥ ∧ - Module.finrank FABL.𝔽₂ p.2.direction = 3 := by - simpa only [binaryAffineFlats, Finset.mem_filter, - Finset.mem_univ, true_and] using hsecondData - exact hsecondData'.1 - exact hnonbot hmeet - -private theorem affineThreeFlat_eq_of_points_subset - {A B : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)} - (hA : A ∈ binaryAffineFlats 3 n) - (hB : B ∈ binaryAffineFlats 3 n) - (hsubset : binaryAffineFlatPoints A ⊆ binaryAffineFlatPoints B) : - A = B := by - have hAData : A ≠ ⊥ ∧ Module.finrank FABL.𝔽₂ A.direction = 3 := by - simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, - true_and] using hA - have hBData : B ≠ ⊥ ∧ Module.finrank FABL.𝔽₂ B.direction = 3 := by - simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, - true_and] using hB - have hpoints : binaryAffineFlatPoints A = binaryAffineFlatPoints B := by - apply Finset.eq_of_subset_of_card_le hsubset - rw [card_binaryAffineFlatPoints A hAData.1, - card_binaryAffineFlatPoints B hBData.1, - hAData.2, hBData.2] - ext x - have hx := Finset.ext_iff.mp hpoints x - simpa only [mem_binaryAffineFlatPoints] using hx - -private theorem weightSixteenFiber_pair_eq_of_first_eq - (h : BooleanFunction n) - {p q : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × - AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)} - (hp : p ∈ weightSixteenRepresentationFiber h) - (hq : q ∈ weightSixteenRepresentationFiber h) - (hfirst : p.1 = q.1) : - p = q := by - have hpData := Finset.mem_filter.mp hp - have hqData := Finset.mem_filter.mp hq - have hpPair := weightSixteenClassificationDisjointPairData hpData.1 - have hqPair := weightSixteenClassificationDisjointPairData hqData.1 - have hunion : binaryAffineFlatPoints p.1 ∪ binaryAffineFlatPoints p.2 = - binaryAffineFlatPoints q.1 ∪ binaryAffineFlatPoints q.2 := by - rw [← support_eq_union_of_mem_weightSixteenFiber h hp, - ← support_eq_union_of_mem_weightSixteenFiber h hq] - have hsecondSubset : binaryAffineFlatPoints p.2 ⊆ - binaryAffineFlatPoints q.2 := by - intro x hxSecond - have hxUnion : x ∈ binaryAffineFlatPoints q.1 ∪ - binaryAffineFlatPoints q.2 := by - rw [← hunion] - exact Finset.mem_union_right _ hxSecond - rcases Finset.mem_union.mp hxUnion with hxFirst | hxSecond' - · have hxPFirst : x ∈ binaryAffineFlatPoints p.1 := by - rw [hfirst] - exact hxFirst - exact (Finset.disjoint_left.mp - (weightSixteenClassificationPairPointSetsDisjoint hpData.1)) - hxPFirst hxSecond |>.elim - · exact hxSecond' - apply Prod.ext hfirst - exact affineThreeFlat_eq_of_points_subset hpPair.2.1 hqPair.2.1 - hsecondSubset - -private theorem weightSixteenFiber_pair_eq_of_second_eq - (h : BooleanFunction n) - {p q : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × - AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)} - (hp : p ∈ weightSixteenRepresentationFiber h) - (hq : q ∈ weightSixteenRepresentationFiber h) - (hsecond : p.2 = q.2) : - p = q := by - have hpSwap := swap_mem_weightSixteenRepresentationFiber h hp - have hqSwap := swap_mem_weightSixteenRepresentationFiber h hq - have hswap := weightSixteenFiber_pair_eq_of_first_eq h hpSwap hqSwap hsecond - apply Prod.ext - · exact congrArg Prod.snd hswap - · exact congrArg Prod.fst hswap - -private theorem binaryAffineFlatPoints_inf_eq_inter - (A B : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) : - binaryAffineFlatPoints (A ⊓ B) = - binaryAffineFlatPoints A ∩ binaryAffineFlatPoints B := by - ext x - simp only [mem_binaryAffineFlatPoints, Finset.mem_inter, - AffineSubspace.mem_inf_iff] - -private theorem card_firstFlat_inter_firstFlat_eq_four_of_cross - (h : BooleanFunction n) - {p q : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × - AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)} - (hp : p ∈ weightSixteenRepresentationFiber h) - (hq : q ∈ weightSixteenRepresentationFiber h) - (hqFirstNeSecond : q.1 ≠ p.2) - (hqSecondNeSecond : q.2 ≠ p.2) : - (binaryAffineFlatPoints p.1 ∩ - binaryAffineFlatPoints q.1).card = 4 := by - classical - have hpData := Finset.mem_filter.mp hp - have hqData := Finset.mem_filter.mp hq - have hpPair := weightSixteenClassificationDisjointPairData hpData.1 - have hqPair := weightSixteenClassificationDisjointPairData hqData.1 - have hpFirstData : p.1 ≠ ⊥ ∧ - Module.finrank FABL.𝔽₂ p.1.direction = 3 := by - simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, - true_and] using hpPair.1 - have hunion : binaryAffineFlatPoints p.1 ∪ binaryAffineFlatPoints p.2 = - binaryAffineFlatPoints q.1 ∪ binaryAffineFlatPoints q.2 := by - rw [← support_eq_union_of_mem_weightSixteenFiber h hp, - ← support_eq_union_of_mem_weightSixteenFiber h hq] - have hfirstInterNonempty : - (binaryAffineFlatPoints p.1 ∩ - binaryAffineFlatPoints q.1).Nonempty := by - by_contra hnot - have hempty : binaryAffineFlatPoints p.1 ∩ - binaryAffineFlatPoints q.1 = ∅ := - Finset.not_nonempty_iff_eq_empty.mp hnot - have hsubset : binaryAffineFlatPoints q.1 ⊆ - binaryAffineFlatPoints p.2 := by - intro x hxq - have hxUnion : x ∈ binaryAffineFlatPoints p.1 ∪ - binaryAffineFlatPoints p.2 := by - rw [hunion] - exact Finset.mem_union_left _ hxq - rcases Finset.mem_union.mp hxUnion with hxp | hxp - · have hxInter : x ∈ binaryAffineFlatPoints p.1 ∩ - binaryAffineFlatPoints q.1 := Finset.mem_inter.mpr ⟨hxp, hxq⟩ - rw [hempty] at hxInter - exact (Finset.notMem_empty x hxInter).elim - · exact hxp - exact hqFirstNeSecond - (affineThreeFlat_eq_of_points_subset hqPair.1 hpPair.2.1 hsubset) - have hsecondInterNonempty : - (binaryAffineFlatPoints p.1 ∩ - binaryAffineFlatPoints q.2).Nonempty := by - by_contra hnot - have hempty : binaryAffineFlatPoints p.1 ∩ - binaryAffineFlatPoints q.2 = ∅ := - Finset.not_nonempty_iff_eq_empty.mp hnot - have hsubset : binaryAffineFlatPoints q.2 ⊆ - binaryAffineFlatPoints p.2 := by - intro x hxq - have hxUnion : x ∈ binaryAffineFlatPoints p.1 ∪ - binaryAffineFlatPoints p.2 := by - rw [hunion] - exact Finset.mem_union_right _ hxq - rcases Finset.mem_union.mp hxUnion with hxp | hxp - · have hxInter : x ∈ binaryAffineFlatPoints p.1 ∩ - binaryAffineFlatPoints q.2 := Finset.mem_inter.mpr ⟨hxp, hxq⟩ - rw [hempty] at hxInter - exact (Finset.notMem_empty x hxInter).elim - · exact hxp - exact hqSecondNeSecond - (affineThreeFlat_eq_of_points_subset hqPair.2.1 hpPair.2.1 hsubset) - have hpartition : binaryAffineFlatPoints p.1 = - (binaryAffineFlatPoints p.1 ∩ binaryAffineFlatPoints q.1) ∪ - (binaryAffineFlatPoints p.1 ∩ binaryAffineFlatPoints q.2) := by - ext x - constructor - · intro hxp - have hxUnion : x ∈ binaryAffineFlatPoints q.1 ∪ - binaryAffineFlatPoints q.2 := by - rw [← hunion] - exact Finset.mem_union_left _ hxp - rcases Finset.mem_union.mp hxUnion with hxq | hxq - · exact Finset.mem_union_left _ (Finset.mem_inter.mpr ⟨hxp, hxq⟩) - · exact Finset.mem_union_right _ (Finset.mem_inter.mpr ⟨hxp, hxq⟩) - · intro hx - rcases Finset.mem_union.mp hx with hx | hx - · exact (Finset.mem_inter.mp hx).1 - · exact (Finset.mem_inter.mp hx).1 - have hinterDisjoint : Disjoint - (binaryAffineFlatPoints p.1 ∩ binaryAffineFlatPoints q.1) - (binaryAffineFlatPoints p.1 ∩ binaryAffineFlatPoints q.2) := by - rw [Finset.disjoint_left] - intro x hxFirst hxSecond - exact (Finset.disjoint_left.mp - (weightSixteenClassificationPairPointSetsDisjoint hqData.1)) - (Finset.mem_inter.mp hxFirst).2 - (Finset.mem_inter.mp hxSecond).2 - have hsum : - (binaryAffineFlatPoints p.1 ∩ binaryAffineFlatPoints q.1).card + - (binaryAffineFlatPoints p.1 ∩ binaryAffineFlatPoints q.2).card = 8 := by - calc - _ = ((binaryAffineFlatPoints p.1 ∩ binaryAffineFlatPoints q.1) ∪ - (binaryAffineFlatPoints p.1 ∩ binaryAffineFlatPoints q.2)).card := - (Finset.card_union_of_disjoint hinterDisjoint).symm - _ = (binaryAffineFlatPoints p.1).card := by rw [← hpartition] - _ = 8 := by - rw [card_binaryAffineFlatPoints p.1 hpFirstData.1, - hpFirstData.2] - norm_num - have hfirstInfNe : p.1 ⊓ q.1 ≠ ⊥ := by - obtain ⟨x, hx⟩ := hfirstInterNonempty - intro hbot - have hxInf : x ∈ p.1 ⊓ q.1 := - (AffineSubspace.mem_inf_iff x p.1 q.1).2 - ⟨(mem_binaryAffineFlatPoints p.1 x).1 (Finset.mem_inter.mp hx).1, - (mem_binaryAffineFlatPoints q.1 x).1 (Finset.mem_inter.mp hx).2⟩ - rw [hbot, ← SetLike.mem_coe, AffineSubspace.bot_coe] at hxInf - exact hxInf - have hsecondInfNe : p.1 ⊓ q.2 ≠ ⊥ := by - obtain ⟨x, hx⟩ := hsecondInterNonempty - intro hbot - have hxInf : x ∈ p.1 ⊓ q.2 := - (AffineSubspace.mem_inf_iff x p.1 q.2).2 - ⟨(mem_binaryAffineFlatPoints p.1 x).1 (Finset.mem_inter.mp hx).1, - (mem_binaryAffineFlatPoints q.2 x).1 (Finset.mem_inter.mp hx).2⟩ - rw [hbot, ← SetLike.mem_coe, AffineSubspace.bot_coe] at hxInf - exact hxInf - have hfirstCard : - (binaryAffineFlatPoints p.1 ∩ binaryAffineFlatPoints q.1).card = - 2 ^ Module.finrank FABL.𝔽₂ (p.1 ⊓ q.1).direction := by - rw [← binaryAffineFlatPoints_inf_eq_inter, - card_binaryAffineFlatPoints (p.1 ⊓ q.1) hfirstInfNe] - have hsecondCard : - (binaryAffineFlatPoints p.1 ∩ binaryAffineFlatPoints q.2).card = - 2 ^ Module.finrank FABL.𝔽₂ (p.1 ⊓ q.2).direction := by - rw [← binaryAffineFlatPoints_inf_eq_inter, - card_binaryAffineFlatPoints (p.1 ⊓ q.2) hsecondInfNe] - have hfirstRank : Module.finrank FABL.𝔽₂ (p.1 ⊓ q.1).direction ≤ 3 := by - have hle := Submodule.finrank_mono - (AffineSubspace.direction_le (inf_le_left : p.1 ⊓ q.1 ≤ p.1)) - rwa [hpFirstData.2] at hle - have hsecondRank : Module.finrank FABL.𝔽₂ (p.1 ⊓ q.2).direction ≤ 3 := by - have hle := Submodule.finrank_mono - (AffineSubspace.direction_le (inf_le_left : p.1 ⊓ q.2 ≤ p.1)) - rwa [hpFirstData.2] at hle - interval_cases hfirstRankEq : - Module.finrank FABL.𝔽₂ (p.1 ⊓ q.1).direction <;> - interval_cases hsecondRankEq : - Module.finrank FABL.𝔽₂ (p.1 ⊓ q.2).direction <;> - norm_num [hfirstRankEq, hsecondRankEq] at hfirstCard hsecondCard <;> - omega - -private theorem finrank_direction_inf_eq_two_of_card_inter_eq_four - {A B : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)} - (hA : A ∈ binaryAffineFlats 3 n) - (hcard : (binaryAffineFlatPoints A ∩ - binaryAffineFlatPoints B).card = 4) : - Module.finrank FABL.𝔽₂ (A ⊓ B).direction = 2 := by - have hAData : A ≠ ⊥ ∧ Module.finrank FABL.𝔽₂ A.direction = 3 := by - simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, - true_and] using hA - have hnonempty : - (binaryAffineFlatPoints A ∩ binaryAffineFlatPoints B).Nonempty := - Finset.card_pos.mp (by omega) - have hinfNe : A ⊓ B ≠ ⊥ := by - obtain ⟨x, hx⟩ := hnonempty - intro hbot - have hxInf : x ∈ A ⊓ B := - (AffineSubspace.mem_inf_iff x A B).2 - ⟨(mem_binaryAffineFlatPoints A x).1 (Finset.mem_inter.mp hx).1, - (mem_binaryAffineFlatPoints B x).1 (Finset.mem_inter.mp hx).2⟩ - rw [hbot, ← SetLike.mem_coe, AffineSubspace.bot_coe] at hxInf - exact hxInf - have hpow : 4 = 2 ^ Module.finrank FABL.𝔽₂ (A ⊓ B).direction := by - calc - 4 = (binaryAffineFlatPoints A ∩ - binaryAffineFlatPoints B).card := hcard.symm - _ = (binaryAffineFlatPoints (A ⊓ B)).card := by - rw [binaryAffineFlatPoints_inf_eq_inter] - _ = 2 ^ Module.finrank FABL.𝔽₂ (A ⊓ B).direction := - card_binaryAffineFlatPoints (A ⊓ B) hinfNe - apply Nat.pow_right_injective (by norm_num : 2 ≤ 2) - calc - 2 ^ Module.finrank FABL.𝔽₂ (A ⊓ B).direction = 4 := hpow.symm - _ = 2 ^ 2 := by norm_num - -private theorem direction_firstInf_eq_secondInf_of_four_four_partition - {A C D : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)} - (hA : A ∈ binaryAffineFlats 3 n) - (hCDdisjoint : Disjoint (binaryAffineFlatPoints C) - (binaryAffineFlatPoints D)) - (hACcard : (binaryAffineFlatPoints A ∩ - binaryAffineFlatPoints C).card = 4) - (hADcard : (binaryAffineFlatPoints A ∩ - binaryAffineFlatPoints D).card = 4) : - (A ⊓ C).direction = (A ⊓ D).direction := by - classical - have hAData : A ≠ ⊥ ∧ Module.finrank FABL.𝔽₂ A.direction = 3 := by - simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, - true_and] using hA - have hACrank := - finrank_direction_inf_eq_two_of_card_inter_eq_four hA hACcard - have hADrank := - finrank_direction_inf_eq_two_of_card_inter_eq_four hA hADcard - by_contra hne - have hACstrict : (A ⊓ C).direction < - (A ⊓ C).direction ⊔ (A ⊓ D).direction := by - apply lt_of_le_of_ne le_sup_left - intro heq - have hADle : (A ⊓ D).direction ≤ (A ⊓ C).direction := by - calc - (A ⊓ D).direction ≤ - (A ⊓ C).direction ⊔ (A ⊓ D).direction := le_sup_right - _ = (A ⊓ C).direction := heq.symm - have heqDirections : (A ⊓ D).direction = (A ⊓ C).direction := - Submodule.eq_of_le_of_finrank_eq hADle (by rw [hADrank, hACrank]) - exact hne heqDirections.symm - have hsupLe : (A ⊓ C).direction ⊔ (A ⊓ D).direction ≤ A.direction := - sup_le - (AffineSubspace.direction_le (inf_le_left : A ⊓ C ≤ A)) - (AffineSubspace.direction_le (inf_le_left : A ⊓ D ≤ A)) - have hsupRankLower : 3 ≤ Module.finrank FABL.𝔽₂ - ↥((A ⊓ C).direction ⊔ (A ⊓ D).direction) := by - have hlt := Submodule.finrank_lt_finrank_of_lt hACstrict - rw [hACrank] at hlt - omega - have hsupRankUpper : Module.finrank FABL.𝔽₂ - ↥((A ⊓ C).direction ⊔ (A ⊓ D).direction) ≤ 3 := by - have hle := Submodule.finrank_mono hsupLe - rwa [hAData.2] at hle - have hsupRank : Module.finrank FABL.𝔽₂ - ↥((A ⊓ C).direction ⊔ (A ⊓ D).direction) = 3 := by omega - have hsupEq : (A ⊓ C).direction ⊔ (A ⊓ D).direction = A.direction := - Submodule.eq_of_le_of_finrank_eq hsupLe (by rw [hsupRank, hAData.2]) - obtain ⟨x, hx⟩ := Finset.card_pos.mp (by rw [hACcard]; omega : - 0 < (binaryAffineFlatPoints A ∩ binaryAffineFlatPoints C).card) - obtain ⟨y, hy⟩ := Finset.card_pos.mp (by rw [hADcard]; omega : - 0 < (binaryAffineFlatPoints A ∩ binaryAffineFlatPoints D).card) - have hxInf : x ∈ A ⊓ C := - (AffineSubspace.mem_inf_iff x A C).2 - ⟨(mem_binaryAffineFlatPoints A x).1 (Finset.mem_inter.mp hx).1, - (mem_binaryAffineFlatPoints C x).1 (Finset.mem_inter.mp hx).2⟩ - have hyInf : y ∈ A ⊓ D := - (AffineSubspace.mem_inf_iff y A D).2 - ⟨(mem_binaryAffineFlatPoints A y).1 (Finset.mem_inter.mp hy).1, - (mem_binaryAffineFlatPoints D y).1 (Finset.mem_inter.mp hy).2⟩ - have hyxA : y + x ∈ A.direction := by - have hvsub := AffineSubspace.vsub_mem_direction - ((AffineSubspace.mem_inf_iff y A D).1 hyInf).1 - ((AffineSubspace.mem_inf_iff x A C).1 hxInf).1 - simpa only [vsub_eq_sub, sub_eq_add_neg, ZModModule.neg_eq_self] using hvsub - have hyxSup : y + x ∈ - (A ⊓ C).direction ⊔ (A ⊓ D).direction := by - rw [hsupEq] - exact hyxA - obtain ⟨u, hu, v, hv, huv⟩ := Submodule.mem_sup.mp hyxSup - let z := u + x - have hzFirst : z ∈ A ⊓ C := by - exact AffineSubspace.vadd_mem_of_mem_direction hu hxInf - have hzEq : u + x = v + y := by - calc - u + x = u + x + (v + v) := by - rw [ZModModule.add_self, add_zero] - _ = (u + v) + (v + x) := by abel - _ = (y + x) + (v + x) := by rw [huv] - _ = y + v + (x + x) := by abel - _ = v + y := by rw [ZModModule.add_self, add_zero, add_comm] - have hzSecond : z ∈ A ⊓ D := by - change u + x ∈ A ⊓ D - rw [hzEq] - exact AffineSubspace.vadd_mem_of_mem_direction hv hyInf - exact (Finset.disjoint_left.mp hCDdisjoint) - ((mem_binaryAffineFlatPoints C z).2 - ((AffineSubspace.mem_inf_iff z A C).1 hzFirst).2) - ((mem_binaryAffineFlatPoints D z).2 - ((AffineSubspace.mem_inf_iff z A D).1 hzSecond).2) - -private theorem exists_cross_weightSixteenRepresentation_of_two_lt_card - (h : BooleanFunction n) - {p : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × - AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)} - (hp : p ∈ weightSixteenRepresentationFiber h) - (hcard : 2 < (weightSixteenRepresentationFiber h).card) : - ∃ q ∈ weightSixteenRepresentationFiber h, - q.1 ≠ p.1 ∧ q.1 ≠ p.2 ∧ q.2 ≠ p.1 ∧ q.2 ≠ p.2 := by - classical - have hpSwap := swap_mem_weightSixteenRepresentationFiber h hp - have hpFirstNeSecond := first_ne_second_of_mem_weightSixteenFiber h hp - have hpNeSwap : p ≠ (p.2, p.1) := by - intro heq - exact hpFirstNeSecond (congrArg Prod.fst heq) - have hpairCard : ({p, (p.2, p.1)} : Finset - (AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × - AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n))).card = 2 := by - rw [Finset.card_pair hpNeSwap] - have hpairLt : ({p, (p.2, p.1)} : Finset - (AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × - AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n))).card < - (weightSixteenRepresentationFiber h).card := by - rwa [hpairCard] - obtain ⟨q, hq, hqNotPair⟩ := - Finset.exists_mem_notMem_of_card_lt_card hpairLt - have hqNeP : q ≠ p := by - intro heq - apply hqNotPair - simp [heq] - have hqNeSwap : q ≠ (p.2, p.1) := by - intro heq - apply hqNotPair - simp [heq] - have hqFirstNePFirst : q.1 ≠ p.1 := by - intro heq - apply hqNeP - exact (weightSixteenFiber_pair_eq_of_first_eq h hp hq heq.symm).symm - have hqFirstNePSecond : q.1 ≠ p.2 := by - intro heq - apply hqNeSwap - exact weightSixteenFiber_pair_eq_of_first_eq h hpSwap hq heq.symm |>.symm - have hqSecondNePFirst : q.2 ≠ p.1 := by - intro heq - apply hqNeSwap - exact weightSixteenFiber_pair_eq_of_second_eq h hq hpSwap heq - have hqSecondNePSecond : q.2 ≠ p.2 := by - intro heq - apply hqNeP - exact weightSixteenFiber_pair_eq_of_second_eq h hq hp heq - exact ⟨q, hq, hqFirstNePFirst, hqFirstNePSecond, - hqSecondNePFirst, hqSecondNePSecond⟩ - -private theorem two_le_finrank_zeroDerivativeKernel_of_two_lt_fiber_card - (h : BooleanFunction n) - {p : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × - AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)} - (hp : p ∈ weightSixteenRepresentationFiber h) - (hcard : 2 < (weightSixteenRepresentationFiber h).card) : - 2 ≤ Module.finrank FABL.𝔽₂ (zeroDerivativeKernel h) := by - classical - obtain ⟨q, hq, hqFirstNePFirst, hqFirstNePSecond, - hqSecondNePFirst, hqSecondNePSecond⟩ := - exists_cross_weightSixteenRepresentation_of_two_lt_card h hp hcard - have hpData := Finset.mem_filter.mp hp - have hqData := Finset.mem_filter.mp hq - have hpPair := weightSixteenClassificationDisjointPairData hpData.1 - have hqPair := weightSixteenClassificationDisjointPairData hqData.1 - have hpSwap := swap_mem_weightSixteenRepresentationFiber h hp - have hACcard := card_firstFlat_inter_firstFlat_eq_four_of_cross - h hp hq hqFirstNePSecond hqSecondNePSecond - have hBCcard := card_firstFlat_inter_firstFlat_eq_four_of_cross - h hpSwap hq hqFirstNePFirst hqSecondNePFirst - have hCcolumn := direction_firstInf_eq_secondInf_of_four_four_partition - hqPair.1 - (weightSixteenClassificationPairPointSetsDisjoint hpData.1) - (by simpa only [Finset.inter_comm] using hACcard) - (by simpa only [Finset.inter_comm] using hBCcard) - let R := (p.1 ⊓ q.1).direction - have hRrank : Module.finrank FABL.𝔽₂ R = 2 := by - exact finrank_direction_inf_eq_two_of_card_inter_eq_four hpPair.1 hACcard - have hRBC : R = (p.2 ⊓ q.1).direction := by - calc - R = (q.1 ⊓ p.1).direction := by - simp only [R, inf_comm] - _ = (q.1 ⊓ p.2).direction := hCcolumn - _ = (p.2 ⊓ q.1).direction := by rw [inf_comm] - have hRleFirst : R ≤ p.1.direction := by - exact AffineSubspace.direction_le (inf_le_left : p.1 ⊓ q.1 ≤ p.1) - have hRleSecond : R ≤ p.2.direction := by - rw [hRBC] - exact AffineSubspace.direction_le (inf_le_left : p.2 ⊓ q.1 ≤ p.2) - have hRleKernel : R ≤ zeroDerivativeKernel h := by - intro r hr - apply (mem_zeroDerivativeKernel h r).2 - intro x - have hpWord := (Finset.mem_filter.mp hp).2 - rw [← hpWord] - simp only [FABL.booleanDerivative, weightSixteenRepresentationWord, - Pi.add_apply] - rw [binaryAffineFlatIndicator_period_of_mem_direction - p.1 r (hRleFirst hr) x, - binaryAffineFlatIndicator_period_of_mem_direction - p.2 r (hRleSecond hr) x] - exact ZModModule.add_self _ - have hle := Submodule.finrank_mono hRleKernel - rwa [hRrank] at hle - -private theorem mem_typeA_of_parallel_weightSixteenRepresentation - (h : BooleanFunction n) - {p : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × - AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)} - (hp : p ∈ weightSixteenRepresentationFiber h) - (hdirection : p.1.direction = p.2.direction) : - h ∈ orderTwoWeightSixteenTypeAWords n := by - classical - have hpData := Finset.mem_filter.mp hp - have hpPair := weightSixteenClassificationDisjointPairData hpData.1 - have hAData : p.1 ≠ ⊥ ∧ - Module.finrank FABL.𝔽₂ p.1.direction = 3 := by - simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, - true_and] using hpPair.1 - have hBData : p.2 ≠ ⊥ ∧ - Module.finrank FABL.𝔽₂ p.2.direction = 3 := by - simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, - true_and] using hpPair.2.1 - obtain ⟨a, ha⟩ := (AffineSubspace.nonempty_iff_ne_bot p.1).2 hAData.1 - obtain ⟨b, hb⟩ := (AffineSubspace.nonempty_iff_ne_bot p.2).2 hBData.1 - have hbNotA : b ∉ p.1 := by - intro hbA - have hbMeet : b ∈ p.1 ⊓ p.2 := - (AffineSubspace.mem_inf_iff b p.1 p.2).2 ⟨hbA, hb⟩ - rw [hpPair.2.2, ← SetLike.mem_coe, AffineSubspace.bot_coe] at hbMeet - exact hbMeet - have hdifference : b -ᵥ a ∉ p.1.direction := by - intro hdifference - apply hbNotA - simpa only [vsub_vadd] using - AffineSubspace.vadd_mem_of_mem_direction hdifference ha - let C := p.1 ⊔ p.2 - have haC : a ∈ C := (le_sup_left : p.1 ≤ p.1 ⊔ p.2) ha - have hCneBot : C ≠ ⊥ := by - intro hbot - have := haC - rw [hbot, ← SetLike.mem_coe, AffineSubspace.bot_coe] at this - exact this - have hCrank : Module.finrank FABL.𝔽₂ C.direction = 4 := by - dsimp only [C] - rw [AffineSubspace.direction_sup ha hb, ← hdirection, sup_idem, - Submodule.finrank_sup_span_singleton hdifference, hAData.2] - have hCcard : (binaryAffineFlatPoints C).card = 16 := by - rw [card_binaryAffineFlatPoints C hCneBot, hCrank] - norm_num - have hdisjoint := - weightSixteenClassificationPairPointSetsDisjoint hpData.1 - have hunionCard : - (binaryAffineFlatPoints p.1 ∪ - binaryAffineFlatPoints p.2).card = 16 := by - rw [Finset.card_union_of_disjoint hdisjoint, - card_binaryAffineFlatPoints p.1 hAData.1, - card_binaryAffineFlatPoints p.2 hBData.1, - hAData.2, hBData.2] - norm_num - have hpoints : binaryAffineFlatPoints C = - binaryAffineFlatPoints p.1 ∪ binaryAffineFlatPoints p.2 := by - symm - apply Finset.eq_of_subset_of_card_le - · intro x hx - rcases Finset.mem_union.mp hx with hxFirst | hxSecond - · exact (mem_binaryAffineFlatPoints C x).2 - ((le_sup_left : p.1 ≤ p.1 ⊔ p.2) - ((mem_binaryAffineFlatPoints p.1 x).1 hxFirst)) - · exact (mem_binaryAffineFlatPoints C x).2 - ((le_sup_right : p.2 ≤ p.1 ⊔ p.2) - ((mem_binaryAffineFlatPoints p.2 x).1 hxSecond)) - · rw [hCcard, hunionCard] - have hCflat : C ∈ binaryAffineFlats 4 n := by - simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, - true_and] using And.intro hCneBot hCrank - have hindicator := binaryAffineFlatIndicator_eq_add_of_points_eq_union - p.1 p.2 C hpoints hdisjoint - have hfunction : h = binaryAffineFlatIndicator C := by - calc - h = weightSixteenRepresentationWord p.1 p.2 := hpData.2.symm - _ = binaryAffineFlatIndicator p.1 + - binaryAffineFlatIndicator p.2 := rfl - _ = binaryAffineFlatIndicator C := hindicator.symm - rw [orderTwoWeightSixteenTypeAWords, Finset.mem_image] - exact ⟨C, hCflat, hfunction.symm⟩ - -private theorem finrank_zeroDerivativeKernel_le_two_of_nonTypeA_fiber - (h : BooleanFunction n) - (hh : h ∈ orderTwoWeightSixteenDualWords n) - (hnotA : h ∉ orderTwoWeightSixteenTypeAWords n) - {p : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × - AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)} - (hp : p ∈ weightSixteenRepresentationFiber h) : - Module.finrank FABL.𝔽₂ (zeroDerivativeKernel h) ≤ 2 := by - have hpData := Finset.mem_filter.mp hp - have hpPair := weightSixteenClassificationDisjointPairData hpData.1 - have hfirstRank : Module.finrank FABL.𝔽₂ p.1.direction = 3 := by - exact (by - simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, - true_and] using hpPair.1 : - p.1 ≠ ⊥ ∧ Module.finrank FABL.𝔽₂ p.1.direction = 3).2 - have hsecondRank : Module.finrank FABL.𝔽₂ p.2.direction = 3 := by - exact (by - simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, - true_and] using hpPair.2.1 : - p.2 ≠ ⊥ ∧ Module.finrank FABL.𝔽₂ p.2.direction = 3).2 - have hleFirst := zeroDerivativeKernel_le_firstDirection_of_nonTypeA_fiber - h hh hnotA hp - have hpSwap := swap_mem_weightSixteenRepresentationFiber h hp - have hleSecond : zeroDerivativeKernel h ≤ p.2.direction := by - simpa only using - zeroDerivativeKernel_le_firstDirection_of_nonTypeA_fiber - h hh hnotA hpSwap - have hkernelRankLeThree := Submodule.finrank_mono hleFirst - rw [hfirstRank] at hkernelRankLeThree - by_contra hnotLe - have hkernelRank : - Module.finrank FABL.𝔽₂ (zeroDerivativeKernel h) = 3 := by - omega - have hkernelFirst : zeroDerivativeKernel h = p.1.direction := - Submodule.eq_of_le_of_finrank_eq hleFirst (by - rw [hkernelRank, hfirstRank]) - have hkernelSecond : zeroDerivativeKernel h = p.2.direction := - Submodule.eq_of_le_of_finrank_eq hleSecond (by - rw [hkernelRank, hsecondRank]) - apply hnotA - exact mem_typeA_of_parallel_weightSixteenRepresentation h hp - (hkernelFirst.symm.trans hkernelSecond) - -private theorem two_le_card_weightSixteenRepresentationFiber_of_mem - (h : BooleanFunction n) - {p : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × - AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)} - (hp : p ∈ weightSixteenRepresentationFiber h) : - 2 ≤ (weightSixteenRepresentationFiber h).card := by - classical - let q := (p.2, p.1) - have hq : q ∈ weightSixteenRepresentationFiber h := by - exact swap_mem_weightSixteenRepresentationFiber h hp - have hpq : p ≠ q := by - intro heq - apply first_ne_second_of_mem_weightSixteenFiber h hp - simpa only [q] using congrArg Prod.fst heq - have hsubset : ({p, q} : Finset - (AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × - AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n))) ⊆ - weightSixteenRepresentationFiber h := by - intro r hr - simp only [Finset.mem_insert, Finset.mem_singleton] at hr - rcases hr with rfl | rfl - · exact hp - · exact hq - calc - 2 = ({p, q} : Finset - (AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × - AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n))).card := by - simp [hpq] - _ ≤ (weightSixteenRepresentationFiber h).card := - Finset.card_le_card hsubset - -private theorem card_weightSixteenRepresentationFiber_le_two_of_not_typeA_typeB - (h : BooleanFunction n) - (hh : h ∈ orderTwoWeightSixteenDualWords n) - (hnotA : h ∉ orderTwoWeightSixteenTypeAWords n) - (hnotB : h ∉ orderTwoWeightSixteenTypeBWords n) - {p : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × - AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)} - (hp : p ∈ weightSixteenRepresentationFiber h) : - (weightSixteenRepresentationFiber h).card ≤ 2 := by - classical - by_contra hnotLe - have hcard : 2 < (weightSixteenRepresentationFiber h).card := by - omega - have hkernelLower := - two_le_finrank_zeroDerivativeKernel_of_two_lt_fiber_card h hp hcard - have hkernelUpper := - finrank_zeroDerivativeKernel_le_two_of_nonTypeA_fiber h hh hnotA hp - have hkernelRank : - Module.finrank FABL.𝔽₂ (zeroDerivativeKernel h) = 2 := by - omega - apply hnotB - rw [orderTwoWeightSixteenTypeBWords, Finset.mem_filter] - exact ⟨hh, hkernelRank⟩ - -/-- A represented weight-sixteen dual word outside the two multiple- -representation families has only the two ordered representations obtained by -swapping its affine three-flats. -/ -theorem card_weightSixteenRepresentationFiber_of_not_mem_typeA_typeB - (h : BooleanFunction n) - (hh : h ∈ orderTwoWeightSixteenDualWords n) - (hnotA : h ∉ orderTwoWeightSixteenTypeAWords n) - (hnotB : h ∉ orderTwoWeightSixteenTypeBWords n) - {p : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × - AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)} - (hp : p ∈ weightSixteenRepresentationFiber h) : - (weightSixteenRepresentationFiber h).card = 2 := - Nat.le_antisymm - (card_weightSixteenRepresentationFiber_le_two_of_not_typeA_typeB - h hh hnotA hnotB hp) - (two_le_card_weightSixteenRepresentationFiber_of_mem h hp) - -private structure WeightSixteenTypeBWordWitness - (h : BooleanFunction n) where - a : FABL.F₂Cube n - b : FABL.F₂Cube n - x₀ : FABL.F₂Cube n - x₁ : FABL.F₂Cube n - x₂ : FABL.F₂Cube n - x₃ : FABL.F₂Cube n - word_eq : h = - binaryAffineFlatIndicator - (FABL.binaryAffineSubspace - ((FABL.𝔽₂ ∙ a) ⊔ (FABL.𝔽₂ ∙ b)) x₀) + - binaryAffineFlatIndicator - (FABL.binaryAffineSubspace - ((FABL.𝔽₂ ∙ a) ⊔ (FABL.𝔽₂ ∙ b)) x₁) + - binaryAffineFlatIndicator - (FABL.binaryAffineSubspace - ((FABL.𝔽₂ ∙ a) ⊔ (FABL.𝔽₂ ∙ b)) x₂) + - binaryAffineFlatIndicator - (FABL.binaryAffineSubspace - ((FABL.𝔽₂ ∙ a) ⊔ (FABL.𝔽₂ ∙ b)) x₃) - -private noncomputable def weightSixteenTypeBWordWitness - (h : BooleanFunction n) (hh : h ∈ orderTwoWeightSixteenTypeBWords n) : - WeightSixteenTypeBWordWitness h := by - classical - let R := zeroDerivativeKernel h - let qh := zeroDerivativeKernelQuotientFunction h - have hhData := Finset.mem_filter.mp hh - have hweight : hammingWeight h = 16 := by - have hdualData : h ∈ reedMuller (n - 3) n ∧ - hammingWeight h = 16 := by - simpa only [orderTwoWeightSixteenDualWords, orderTwoDualWords, - Finset.mem_filter, Finset.mem_univ, true_and] using hhData.1 - exact hdualData.2 - have hRrank : Module.finrank FABL.𝔽₂ R = 2 := hhData.2 - have hRcard : Nat.card R = 4 := by - rw [FABL.card_submodule_eq_two_pow_finrank, hRrank] - norm_num - let qs : Finset (FABL.F₂Cube n ⧸ R) := - Finset.univ.filter fun q ↦ qh q = 1 - have hfactor := card_filter_mkQ_eq_card_mul_card_filter_weightSixteen - R (fun q ↦ qh q = 1) - have hleft : - ((Finset.univ : Finset (FABL.F₂Cube n)).filter fun x ↦ - qh (R.mkQ x) = 1).card = 16 := by - simpa only [R, qh, zeroDerivativeKernelQuotientFunction_mkQ, - support, FABL.f₂OneSupport, hammingWeight_eq_card_support] using hweight - have hqscard : qs.card = 4 := by - have heq : 16 = 4 * - ((Finset.univ : Finset (FABL.F₂Cube n ⧸ R)).filter fun q ↦ - qh q = 1).card := by - calc - 16 = ((Finset.univ : Finset (FABL.F₂Cube n)).filter fun x ↦ - qh (R.mkQ x) = 1).card := hleft.symm - _ = Nat.card R * - ((Finset.univ : Finset (FABL.F₂Cube n ⧸ R)).filter fun q ↦ - qh q = 1).card := hfactor - _ = 4 * - ((Finset.univ : Finset (FABL.F₂Cube n ⧸ R)).filter fun q ↦ - qh q = 1).card := by rw [hRcard] - change ((Finset.univ : Finset (FABL.F₂Cube n ⧸ R)).filter fun q ↦ - qh q = 1).card = 4 - omega - let e : Fin 4 ≃ {q // q ∈ qs} := Fintype.equivOfCardEq (by - rw [Fintype.card_fin, Fintype.card_coe, hqscard]) - let q₀ : FABL.F₂Cube n ⧸ R := (e 0).1 - let q₁ : FABL.F₂Cube n ⧸ R := (e 1).1 - let q₂ : FABL.F₂Cube n ⧸ R := (e 2).1 - let q₃ : FABL.F₂Cube n ⧸ R := (e 3).1 - have h01 : q₀ ≠ q₁ := by - intro heq - have : (0 : Fin 4) = 1 := e.injective (Subtype.ext heq) - norm_num at this - have h02 : q₀ ≠ q₂ := by - intro heq - have : (0 : Fin 4) = 2 := e.injective (Subtype.ext heq) - exact (by decide : (0 : Fin 4) ≠ 2) this - have h03 : q₀ ≠ q₃ := by - intro heq - have : (0 : Fin 4) = 3 := e.injective (Subtype.ext heq) - exact (by decide : (0 : Fin 4) ≠ 3) this - have h12 : q₁ ≠ q₂ := by - intro heq - have : (1 : Fin 4) = 2 := e.injective (Subtype.ext heq) - exact (by decide : (1 : Fin 4) ≠ 2) this - have h13 : q₁ ≠ q₃ := by - intro heq - have : (1 : Fin 4) = 3 := e.injective (Subtype.ext heq) - exact (by decide : (1 : Fin 4) ≠ 3) this - have h23 : q₂ ≠ q₃ := by - intro heq - have : (2 : Fin 4) = 3 := e.injective (Subtype.ext heq) - exact (by decide : (2 : Fin 4) ≠ 3) this - have hqs : qs = {q₀, q₁, q₂, q₃} := by - ext q - constructor - · intro hq - obtain ⟨i, hi⟩ := e.surjective ⟨q, hq⟩ - fin_cases i - all_goals - simp only [Finset.mem_insert, Finset.mem_singleton] - have hvalue := congrArg Subtype.val hi - · exact Or.inl hvalue.symm - · exact Or.inr (Or.inl hvalue.symm) - · exact Or.inr (Or.inr (Or.inl hvalue.symm)) - · exact Or.inr (Or.inr (Or.inr hvalue.symm)) - · intro hq - simp only [Finset.mem_insert, Finset.mem_singleton] at hq - rcases hq with rfl | rfl | rfl | rfl - · exact (e 0).2 - · exact (e 1).2 - · exact (e 2).2 - · exact (e 3).2 - let x₀ : FABL.F₂Cube n := Quotient.out q₀ - let x₁ : FABL.F₂Cube n := Quotient.out q₁ - let x₂ : FABL.F₂Cube n := Quotient.out q₂ - let x₃ : FABL.F₂Cube n := Quotient.out q₃ - have hx₀ : R.mkQ x₀ = q₀ := Submodule.Quotient.mk_out q₀ - have hx₁ : R.mkQ x₁ = q₁ := Submodule.Quotient.mk_out q₁ - have hx₂ : R.mkQ x₂ = q₂ := Submodule.Quotient.mk_out q₂ - have hx₃ : R.mkQ x₃ = q₃ := Submodule.Quotient.mk_out q₃ - let a := Classical.choose - (exists_spanning_pair_of_finrank_two R hRrank) - let b := Classical.choose (Classical.choose_spec - (exists_spanning_pair_of_finrank_two R hRrank)) - have hRspan := Classical.choose_spec (Classical.choose_spec - (exists_spanning_pair_of_finrank_two R hRrank)) - refine ⟨a, b, x₀, x₁, x₂, x₃, ?_⟩ - change R = (FABL.𝔽₂ ∙ a) ⊔ (FABL.𝔽₂ ∙ b) at hRspan - rw [← hRspan] - funext x - have hquotientValue : qh (R.mkQ x) = h x := by - rfl - have hsupport : qh (R.mkQ x) = 1 ↔ - R.mkQ x = R.mkQ x₀ ∨ R.mkQ x = R.mkQ x₁ ∨ - R.mkQ x = R.mkQ x₂ ∨ R.mkQ x = R.mkQ x₃ := by - have hmem : R.mkQ x ∈ qs ↔ qh (R.mkQ x) = 1 := by - simp only [qs, Finset.mem_filter, Finset.mem_univ, true_and] - rw [← hmem, hqs, hx₀, hx₁, hx₂, hx₃] - simp - simp only [Pi.add_apply, binaryAffineFlatIndicator, - mem_binaryAffineSubspace_iff_mkQ_eq] - by_cases h0 : R.mkQ x = R.mkQ x₀ - · have h1 : R.mkQ x ≠ R.mkQ x₁ := fun hx ↦ - h01 (hx₀.symm.trans ((h0.symm.trans hx).trans hx₁)) - have h2 : R.mkQ x ≠ R.mkQ x₂ := fun hx ↦ - h02 (hx₀.symm.trans ((h0.symm.trans hx).trans hx₂)) - have h3 : R.mkQ x ≠ R.mkQ x₃ := fun hx ↦ - h03 (hx₀.symm.trans ((h0.symm.trans hx).trans hx₃)) - have hxOne : h x = 1 := by - rw [← hquotientValue] - exact hsupport.mpr (Or.inl h0) - rw [hxOne, if_pos h0, if_neg h1, if_neg h2, if_neg h3] - norm_num - · by_cases h1 : R.mkQ x = R.mkQ x₁ - · have h2 : R.mkQ x ≠ R.mkQ x₂ := fun hx ↦ - h12 (hx₁.symm.trans ((h1.symm.trans hx).trans hx₂)) - have h3 : R.mkQ x ≠ R.mkQ x₃ := fun hx ↦ - h13 (hx₁.symm.trans ((h1.symm.trans hx).trans hx₃)) - have hxOne : h x = 1 := by - rw [← hquotientValue] - exact hsupport.mpr (Or.inr (Or.inl h1)) - rw [hxOne, if_neg h0, if_pos h1, if_neg h2, if_neg h3] - norm_num - · by_cases h2 : R.mkQ x = R.mkQ x₂ - · have h3 : R.mkQ x ≠ R.mkQ x₃ := fun hx ↦ - h23 (hx₂.symm.trans ((h2.symm.trans hx).trans hx₃)) - have hxOne : h x = 1 := by - rw [← hquotientValue] - exact hsupport.mpr (Or.inr (Or.inr (Or.inl h2))) - rw [hxOne, if_neg h0, if_neg h1, if_pos h2, if_neg h3] - norm_num - · by_cases h3 : R.mkQ x = R.mkQ x₃ - · have hxOne : h x = 1 := by - rw [← hquotientValue] - exact hsupport.mpr (Or.inr (Or.inr (Or.inr h3))) - rw [hxOne, if_neg h0, if_neg h1, if_neg h2, if_pos h3] - norm_num - · have hxNotOne : h x ≠ 1 := by - intro hxOne - have hqOne : qh (R.mkQ x) = 1 := by - exact hquotientValue.trans hxOne - exact hsupport.mp hqOne |>.elim h0 fun hrest ↦ - hrest.elim h1 fun hrest' ↦ hrest'.elim h2 h3 - have hxZero : h x = 0 := by - by_contra hxNeZero - exact hxNotOne (Fin.eq_one_of_ne_zero _ hxNeZero) - rw [hxZero, if_neg h0, if_neg h1, if_neg h2, if_neg h3] - norm_num - -private def weightSixteenTypeBWordWitnessCode - {h : BooleanFunction n} (w : WeightSixteenTypeBWordWitness h) : - Fin 6 → FABL.F₂Cube n := - ![w.a, w.b, w.x₀, w.x₁, w.x₂, w.x₃] - -private noncomputable def weightSixteenTypeBWordCode - (h : BooleanFunction n) : Fin 6 → FABL.F₂Cube n := by - classical - exact if hh : h ∈ orderTwoWeightSixteenTypeBWords n then - weightSixteenTypeBWordWitnessCode - (weightSixteenTypeBWordWitness h hh) - else 0 - -private theorem weightSixteenTypeBWordCode_injective_on : - Set.InjOn (weightSixteenTypeBWordCode (n := n)) - (orderTwoWeightSixteenTypeBWords n : Set (BooleanFunction n)) := by - intro f hf g hg hcode - have hfFin : f ∈ orderTwoWeightSixteenTypeBWords n := hf - have hgFin : g ∈ orderTwoWeightSixteenTypeBWords n := hg - let wf := weightSixteenTypeBWordWitness f hfFin - let wg := weightSixteenTypeBWordWitness g hgFin - have hcode' : weightSixteenTypeBWordWitnessCode wf = - weightSixteenTypeBWordWitnessCode wg := by - unfold weightSixteenTypeBWordCode at hcode - rw [dif_pos hfFin, dif_pos hgFin] at hcode - simpa only [wf, wg] using hcode - have h0 : wf.a = wg.a := by - simpa [weightSixteenTypeBWordWitnessCode] using - congrFun hcode' (0 : Fin 6) - have h1 : wf.b = wg.b := by - simpa [weightSixteenTypeBWordWitnessCode] using - congrFun hcode' (1 : Fin 6) - have h2 : wf.x₀ = wg.x₀ := by - simpa [weightSixteenTypeBWordWitnessCode] using - congrFun hcode' (2 : Fin 6) - have h3 : wf.x₁ = wg.x₁ := by - simpa [weightSixteenTypeBWordWitnessCode] using - congrFun hcode' (3 : Fin 6) - have h4 : wf.x₂ = wg.x₂ := by - simpa [weightSixteenTypeBWordWitnessCode] using - congrFun hcode' (4 : Fin 6) - have h5 : wf.x₃ = wg.x₃ := by - simpa [weightSixteenTypeBWordWitnessCode] using - congrFun hcode' (5 : Fin 6) - rw [wf.word_eq, wg.word_eq, h0, h1, h2, h3, h4, h5] - -/-- Type-`b` exceptional words inject into six ambient vectors. -/ -theorem card_orderTwoWeightSixteenTypeBWords_le (n : ℕ) : - (orderTwoWeightSixteenTypeBWords n).card ≤ (2 ^ n) ^ 6 := by - classical - calc - (orderTwoWeightSixteenTypeBWords n).card ≤ - (Finset.univ : Finset (Fin 6 → FABL.F₂Cube n)).card := by - apply Finset.card_le_card_of_injOn - (weightSixteenTypeBWordCode (n := n)) - · intro h _hh - exact Finset.mem_univ _ - · exact weightSixteenTypeBWordCode_injective_on - _ = (2 ^ n) ^ 6 := by - rw [Finset.card_univ, Fintype.card_fun, Fintype.card_fin, card_f₂Cube] - -/-- The canonical exceptional families satisfy the count interface used by -the weight-sixteen character-sum estimate. -/ -theorem hasWeightSixteenExceptionalCountBounds_typeA_typeB (n : ℕ) : - HasWeightSixteenExceptionalCountBounds - (orderTwoWeightSixteenTypeAWords n) - (orderTwoWeightSixteenTypeBWords n) := by - exact ⟨card_orderTwoWeightSixteenTypeAWords_le n, - card_orderTwoWeightSixteenTypeBWords_le n⟩ - -end CryptBoolean diff --git a/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenNormalizedCandidates.lean b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenNormalizedCandidates.lean deleted file mode 100644 index b31f938..0000000 --- a/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenNormalizedCandidates.lean +++ /dev/null @@ -1,24648 +0,0 @@ -/- -Copyright (c) 2026 Asher Yan. All rights reserved. -Released under Apache 2.0 license as described in the file LICENSE. -Authors: Asher Yan with Codex --/ -module - -public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightSixteenRankSevenPatterns - -/-! -# Generated normalized weight-sixteen candidates - -Each leaf records a canonical class, an invertible affine normalization, -the resulting 128-bit support mask, and its systematic 64-bit column code. -Candidate trees are sharded by the low sixteen bits of the systematic code so -that each kernel-checked finite classification problem remains small. --/ - -@[expose] public section - -namespace CryptBoolean - -/-- One normalized-pattern certificate. The affine code stores the source origin -in its low seven bits, followed by the seven rows of the normalizing linear map. -/ -structure NormalizedWeightSixteenCandidate where - patternClass : RankSevenWeightSixteenPatternClass - affineCode : BitVec 56 - maskLow : BitVec 64 - maskHigh : BitVec 64 - systematicCode : BitVec 64 - -/-- A balanced tree keeps finite classification reduction logarithmic in the -number of certificates in one prefix shard. -/ -inductive NormalizedWeightSixteenCandidateTree where - | leaf (candidate : NormalizedWeightSixteenCandidate) - | node (left right : NormalizedWeightSixteenCandidateTree) - -namespace NormalizedWeightSixteenCandidateTree - -/-- Whether the tree contains a certificate with the given systematic code. -/ -def containsSystematicCode : - NormalizedWeightSixteenCandidateTree → BitVec 64 → Bool - | .leaf candidate, code => candidate.systematicCode == code - | .node left right, code => - left.containsSystematicCode code || right.containsSystematicCode code - -/-- Propositional membership in a generated candidate tree. -/ -inductive Member (candidate : NormalizedWeightSixteenCandidate) : - NormalizedWeightSixteenCandidateTree → Prop - | leaf : Member candidate (.leaf candidate) - | left {left right} : Member candidate left → Member candidate (.node left right) - | right {left right} : Member candidate right → Member candidate (.node left right) - -end NormalizedWeightSixteenCandidateTree - -/-- Generated candidate shard for systematic prefix 0x0b07. -/ -def normalizedWeightSixteenCandidateBucket_0b07 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.node - (.leaf - { patternClass := .twoE8 - affineCode := BitVec.ofNat 56 18085074352242816 - maskLow := BitVec.ofNat 64 72057598332961279 - maskHigh := BitVec.ofNat 64 282574505115649 - systematicCode := BitVec.ofNat 64 16199641854970235655 }) - (.leaf - { patternClass := .d16Plus - affineCode := BitVec.ofNat 56 54397531543592960 - maskLow := BitVec.ofNat 64 12885099327 - maskHigh := BitVec.ofNat 64 13835058055282163715 - systematicCode := BitVec.ofNat 64 18373986379115989767 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9360144676980864 - maskLow := BitVec.ofNat 64 144115192370889023 - maskHigh := BitVec.ofNat 64 283399155613697 - systematicCode := BitVec.ofNat 64 16199675242525952775 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9150687711889536 - maskLow := BitVec.ofNat 64 144115192370889023 - maskHigh := BitVec.ofNat 64 283674029326337 - systematicCode := BitVec.ofNat 64 16200486548862601991 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18087518222452864 - maskLow := BitVec.ofNat 64 126100793861407039 - maskHigh := BitVec.ofNat 64 283674033520641 - systematicCode := BitVec.ofNat 64 16200489580052155143 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148233138079872 - maskLow := BitVec.ofNat 64 144115192370889023 - maskHigh := BitVec.ofNat 64 564049481875457 - systematicCode := BitVec.ofNat 64 16415814837058341639 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085063648643200 - maskLow := BitVec.ofNat 64 72268704565494079 - maskHigh := BitVec.ofNat 64 564049498603521 - systematicCode := BitVec.ofNat 64 16415817936966322951 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18050154154461312 - maskLow := BitVec.ofNat 64 72057601554186559 - maskHigh := BitVec.ofNat 64 565148993454081 - systematicCode := BitVec.ofNat 64 16416659062822603527 }) - ) - ) - ) - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9289775898984576 - maskLow := BitVec.ofNat 64 144115192370889023 - maskHigh := BitVec.ofNat 64 4611686568191623171 - systematicCode := BitVec.ofNat 64 18288747132631583495 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36100267430674560 - maskLow := BitVec.ofNat 64 36169547392287039 - maskHigh := BitVec.ofNat 64 4611686568216756225 - systematicCode := BitVec.ofNat 64 18288752423407389447 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36170086419038336 - maskLow := BitVec.ofNat 64 36028803461611839 - maskHigh := BitVec.ofNat 64 4611688217459032065 - systematicCode := BitVec.ofNat 64 18290154300193835783 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36169813688615040 - maskLow := BitVec.ofNat 64 140743930872639 - maskHigh := BitVec.ofNat 64 4612248968380841985 - systematicCode := BitVec.ofNat 64 18294640238914636551 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9289775898986624 - maskLow := BitVec.ofNat 64 144115192370889023 - maskHigh := BitVec.ofNat 64 9223372311736893443 - systematicCode := BitVec.ofNat 64 18360522147886205703 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36100267430676608 - maskLow := BitVec.ofNat 64 18084780138627391 - maskHigh := BitVec.ofNat 64 9223372311766237185 - systematicCode := BitVec.ofNat 64 18360528538156862215 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36170086419040384 - maskLow := BitVec.ofNat 64 18014403878388031 - maskHigh := BitVec.ofNat 64 9223374235882225665 - systematicCode := BitVec.ofNat 64 18362210790408391431 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36169813688617088 - maskLow := BitVec.ofNat 64 70374112953151 - maskHigh := BitVec.ofNat 64 9223934986808213505 - systematicCode := BitVec.ofNat 64 18366696729129192199 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9360698727760000 - maskLow := BitVec.ofNat 64 144115192370889023 - maskHigh := BitVec.ofNat 64 13835623204292395009 - systematicCode := BitVec.ofNat 64 18374092553129757447 }) - ) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x0d07. -/ -def normalizedWeightSixteenCandidateBucket_0d07 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.node - (.leaf - { patternClass := .d16Plus - affineCode := BitVec.ofNat 56 54397531543576704 - maskLow := BitVec.ofNat 64 21475165535 - maskHigh := BitVec.ofNat 64 11529215046068469765 - systematicCode := BitVec.ofNat 64 18373425636809444615 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9360144676964608 - maskLow := BitVec.ofNat 64 288230380446744927 - maskHigh := BitVec.ofNat 64 283261750214657 - systematicCode := BitVec.ofNat 64 16199675233969704199 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9150687711873280 - maskLow := BitVec.ofNat 64 288230380446744927 - maskHigh := BitVec.ofNat 64 285873050484737 - systematicCode := BitVec.ofNat 64 16201049498782600455 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18087518222436608 - maskLow := BitVec.ofNat 64 117093594606666079 - maskHigh := BitVec.ofNat 64 285873090330625 - systematicCode := BitVec.ofNat 64 16201054729028701447 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148233138063616 - maskLow := BitVec.ofNat 64 288230380446744927 - maskHigh := BitVec.ofNat 64 1126999435288577 - systematicCode := BitVec.ofNat 64 16559930025100774663 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085063648626944 - maskLow := BitVec.ofNat 64 72233520193405279 - maskHigh := BitVec.ofNat 64 1126999485579265 - systematicCode := BitVec.ofNat 64 16559935324065303815 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18050154154445056 - maskLow := BitVec.ofNat 64 72057601017315679 - maskHigh := BitVec.ofNat 64 1130297970130945 - systematicCode := BitVec.ofNat 64 16561337200851750151 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9289775898968320 - maskLow := BitVec.ofNat 64 288230380446744927 - maskHigh := BitVec.ofNat 64 2305843558977929221 - systematicCode := BitVec.ofNat 64 18144631944589413639 }) - ) - ) - ) - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36100267430658304 - maskLow := BitVec.ofNat 64 36169555982221663 - maskHigh := BitVec.ofNat 64 2305843559036616705 - systematicCode := BitVec.ofNat 64 18144639434354920711 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36170086419022080 - maskLow := BitVec.ofNat 64 36028803461742943 - maskHigh := BitVec.ofNat 64 2305847407268593665 - systematicCode := BitVec.ofNat 64 18146602062071532807 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36169813688598784 - maskLow := BitVec.ofNat 64 140743930873183 - maskHigh := BitVec.ofNat 64 2306968909120569345 - systematicCode := BitVec.ofNat 64 18151088000792333575 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9289775899230464 - maskLow := BitVec.ofNat 64 288230380446744927 - maskHigh := BitVec.ofNat 64 9223372174295834629 - systematicCode := BitVec.ofNat 64 18359956990353280263 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36100267430920448 - maskLow := BitVec.ofNat 64 9042405101732191 - maskHigh := BitVec.ofNat 64 9223372174360838145 - systematicCode := BitVec.ofNat 64 18359967778603339015 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36170086419284224 - maskLow := BitVec.ofNat 64 9007204086907231 - maskHigh := BitVec.ofNat 64 9223376434903384065 - systematicCode := BitVec.ofNat 64 18362771532715199751 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36169813688860928 - maskLow := BitVec.ofNat 64 35189203993951 - maskHigh := BitVec.ofNat 64 9224497936761626625 - systematicCode := BitVec.ofNat 64 18367257471436000519 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9360698727483648 - maskLow := BitVec.ofNat 64 288230380446744927 - maskHigh := BitVec.ofNat 64 11530345344088932353 - systematicCode := BitVec.ofNat 64 18373531810823212295 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x0d0b. -/ -def normalizedWeightSixteenCandidateBucket_0d0b : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.node - (.leaf - { patternClass := .d16Plus - affineCode := BitVec.ofNat 56 54397531539415168 - maskLow := BitVec.ofNat 64 73015562615 - maskHigh := BitVec.ofNat 64 9799832789158199313 - systematicCode := BitVec.ofNat 64 18372304152196353291 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9360144670722304 - maskLow := BitVec.ofNat 64 1152921508901880183 - maskHigh := BitVec.ofNat 64 283158872326145 - systematicCode := BitVec.ofNat 64 16199675216857206027 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9150687705630976 - maskLow := BitVec.ofNat 64 1152921508901880183 - maskHigh := BitVec.ofNat 64 299067188445185 - systematicCode := BitVec.ofNat 64 16202175398622596363 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18087518216194304 - maskLow := BitVec.ofNat 64 110338195165610359 - maskHigh := BitVec.ofNat 64 299067431190529 - systematicCode := BitVec.ofNat 64 16202185026981793035 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148233131821312 - maskLow := BitVec.ofNat 64 1152921508901880183 - maskHigh := BitVec.ofNat 64 4504699155810305 - systematicCode := BitVec.ofNat 64 16848160401185639691 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085063642384640 - maskLow := BitVec.ofNat 64 72207131914338679 - maskHigh := BitVec.ofNat 64 4504699407433729 - systematicCode := BitVec.ofNat 64 16848170098263264523 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18050154148202752 - maskLow := BitVec.ofNat 64 72057600614662519 - maskHigh := BitVec.ofNat 64 4521191830192129 - systematicCode := BitVec.ofNat 64 16850693476910042379 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9289775892726016 - maskLow := BitVec.ofNat 64 1152921508901880183 - maskHigh := BitVec.ofNat 64 576461302067658769 - systematicCode := BitVec.ofNat 64 17856401568505072907 }) - ) - ) - ) - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36100267424416000 - maskLow := BitVec.ofNat 64 36169607521829239 - maskHigh := BitVec.ofNat 64 576461302327672833 - systematicCode := BitVec.ofNat 64 17856413456249982219 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36170086412779776 - maskLow := BitVec.ofNat 64 36028803462529399 - maskHigh := BitVec.ofNat 64 576478344497856513 - systematicCode := BitVec.ofNat 64 17859497585826925835 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36169813682356480 - maskLow := BitVec.ofNat 64 140743930876279 - maskHigh := BitVec.ofNat 64 580964351930826753 - systematicCode := BitVec.ofNat 64 17863983524547726603 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9289775926280448 - maskLow := BitVec.ofNat 64 1152921508901880183 - maskHigh := BitVec.ofNat 64 9223372071215040529 - systematicCode := BitVec.ofNat 64 18358826675287428363 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36100267457970432 - maskLow := BitVec.ofNat 64 2260668921217399 - maskHigh := BitVec.ofNat 64 9223372071482949633 - systematicCode := BitVec.ofNat 64 18358846259496291595 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36170086446334208 - maskLow := BitVec.ofNat 64 2251804243984759 - maskHigh := BitVec.ofNat 64 9223389629041344513 - systematicCode := BitVec.ofNat 64 18363893017328815371 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36169813715910912 - maskLow := BitVec.ofNat 64 8800522277239 - maskHigh := BitVec.ofNat 64 9227875636482148353 - systematicCode := BitVec.ofNat 64 18368378956049616139 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9360698687949056 - maskLow := BitVec.ofNat 64 1152921508901880183 - maskHigh := BitVec.ofNat 64 9804353981240049665 - systematicCode := BitVec.ofNat 64 18372410326210120971 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x0e07. -/ -def normalizedWeightSixteenCandidateBucket_0e07 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.node - (.leaf - { patternClass := .d16Plus - affineCode := BitVec.ofNat 56 54397531543568512 - maskLow := BitVec.ofNat 64 38655297951 - maskHigh := BitVec.ofNat 64 6917529027641081865 - systematicCode := BitVec.ofNat 64 18301369146594954759 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9360144672768640 - maskLow := BitVec.ofNat 64 576460756598456735 - maskHigh := BitVec.ofNat 64 282986939416577 - systematicCode := BitVec.ofNat 64 16199674134474919431 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9150687707677312 - maskLow := BitVec.ofNat 64 576460756598456735 - maskHigh := BitVec.ofNat 64 290271092801537 - systematicCode := BitVec.ofNat 64 16201330969464409607 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18087518218240640 - maskLow := BitVec.ofNat 64 99079196097184159 - maskHigh := BitVec.ofNat 64 290271203950593 - systematicCode := BitVec.ofNat 64 16201337303500262919 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148233133867648 - maskLow := BitVec.ofNat 64 576460756598456735 - maskHigh := BitVec.ofNat 64 2252899342114817 - systematicCode := BitVec.ofNat 64 16631987614843801095 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085063644430976 - maskLow := BitVec.ofNat 64 72163151449227679 - maskHigh := BitVec.ofNat 64 2252899459530753 - systematicCode := BitVec.ofNat 64 16631994017598082567 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18050154150249088 - maskLow := BitVec.ofNat 64 72057599943573919 - maskHigh := BitVec.ofNat 64 2260595923484673 - systematicCode := BitVec.ofNat 64 16633676269849611783 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2534376453720192 - maskLow := BitVec.ofNat 64 576460756598456735 - maskHigh := BitVec.ofNat 64 2305843284095811593 - systematicCode := BitVec.ofNat 64 18144349365822950919 }) - ) - ) - ) - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36047490868332672 - maskLow := BitVec.ofNat 64 18084805908431263 - maskHigh := BitVec.ofNat 64 2305843284225818625 - systematicCode := BitVec.ofNat 64 18144359054578159111 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36169674097969280 - maskLow := BitVec.ofNat 64 18014403878781343 - maskHigh := BitVec.ofNat 64 2305851805310910465 - systematicCode := BitVec.ofNat 64 18146882433224936967 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36169810463180928 - maskLow := BitVec.ofNat 64 70374112954783 - maskHigh := BitVec.ofNat 64 2308094809027395585 - systematicCode := BitVec.ofNat 64 18151368371945737735 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2534376453980288 - maskLow := BitVec.ofNat 64 576460756598456735 - maskHigh := BitVec.ofNat 64 4611686155868446729 - systematicCode := BitVec.ofNat 64 18287899396332195335 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36047490868592768 - maskLow := BitVec.ofNat 64 9042422281601439 - maskHigh := BitVec.ofNat 64 4611686156000559105 - systematicCode := BitVec.ofNat 64 18287911284077104647 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36169674098229376 - maskLow := BitVec.ofNat 64 9007204087169439 - maskHigh := BitVec.ofNat 64 4611694814522507265 - systematicCode := BitVec.ofNat 64 18290995413654048263 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36169810463441024 - maskLow := BitVec.ofNat 64 35189203995039 - maskHigh := BitVec.ofNat 64 4613937818241081345 - systematicCode := BitVec.ofNat 64 18295481352374849031 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9360698723289728 - maskLow := BitVec.ofNat 64 576460756598456735 - maskHigh := BitVec.ofNat 64 6919789623682007041 - systematicCode := BitVec.ofNat 64 18301475320608722439 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x0e0b. -/ -def normalizedWeightSixteenCandidateBucket_0e0b : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.node - (.leaf - { patternClass := .d16Plus - affineCode := BitVec.ofNat 56 54397531539406976 - maskLow := BitVec.ofNat 64 141736092087 - maskHigh := BitVec.ofNat 64 5188146770730811425 - systematicCode := BitVec.ofNat 64 18300247661981863435 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9360144670687872 - maskLow := BitVec.ofNat 64 2305843013508727223 - maskHigh := BitVec.ofNat 64 282884262854657 - systematicCode := BitVec.ofNat 64 16199674117362421259 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9150687705596544 - maskLow := BitVec.ofNat 64 2305843013508727223 - maskHigh := BitVec.ofNat 64 316659370295297 - systematicCode := BitVec.ofNat 64 16202456869304405515 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18087518216159872 - maskLow := BitVec.ofNat 64 92323796656128439 - maskHigh := BitVec.ofNat 64 316659885670401 - systematicCode := BitVec.ofNat 64 16202467601453354507 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148233131786880 - maskLow := BitVec.ofNat 64 2305843013508727223 - maskHigh := BitVec.ofNat 64 9008298783164417 - systematicCode := BitVec.ofNat 64 16920217990928666123 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085063642350208 - maskLow := BitVec.ofNat 64 72136763170161079 - maskHigh := BitVec.ofNat 64 9008299303239681 - systematicCode := BitVec.ofNat 64 16920228791796043275 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18050154148168320 - maskLow := BitVec.ofNat 64 72057599540920759 - maskHigh := BitVec.ofNat 64 9042383643607041 - systematicCode := BitVec.ofNat 64 16923032545907904011 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2534376451639424 - maskLow := BitVec.ofNat 64 2305843013508727223 - maskHigh := BitVec.ofNat 64 576461027185541153 - systematicCode := BitVec.ofNat 64 17856118989738610187 }) - ) - ) - ) - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36047490866251904 - maskLow := BitVec.ofNat 64 18084908987646391 - maskHigh := BitVec.ofNat 64 576461027718201345 - systematicCode := BitVec.ofNat 64 17856133076473220619 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36169674095888512 - maskLow := BitVec.ofNat 64 18014403880354231 - maskHigh := BitVec.ofNat 64 576495936679706625 - systematicCode := BitVec.ofNat 64 17859777956980329995 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36169810461100160 - maskLow := BitVec.ofNat 64 70374112960951 - maskHigh := BitVec.ofNat 64 585467951558180865 - systematicCode := BitVec.ofNat 64 17864263895701130763 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2534376485191808 - maskLow := BitVec.ofNat 64 2305843013508727223 - maskHigh := BitVec.ofNat 64 4611686052787652641 - systematicCode := BitVec.ofNat 64 18286769081266343435 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36047490899804288 - maskLow := BitVec.ofNat 64 2260737640694199 - maskHigh := BitVec.ofNat 64 4611686053323997185 - systematicCode := BitVec.ofNat 64 18286789764970057227 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36169674129440896 - maskLow := BitVec.ofNat 64 2251804245033399 - maskHigh := BitVec.ofNat 64 4611721202800001025 - systematicCode := BitVec.ofNat 64 18292116898267663883 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36169810494652544 - maskLow := BitVec.ofNat 64 8800522281399 - maskHigh := BitVec.ofNat 64 4620693217682130945 - systematicCode := BitVec.ofNat 64 18296602836988464651 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9360698687916672 - maskLow := BitVec.ofNat 64 2305843013508727223 - maskHigh := BitVec.ofNat 64 5197189154894512129 - systematicCode := BitVec.ofNat 64 18300353835995631115 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x0e0d. -/ -def normalizedWeightSixteenCandidateBucket_0e0d : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.node - (.leaf - { patternClass := .d16Plus - affineCode := BitVec.ofNat 56 54397531538350336 - maskLow := BitVec.ofNat 64 279177150935 - maskHigh := BitVec.ofNat 64 2882303761517117505 - systematicCode := BitVec.ofNat 64 18156134681552883213 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9360144670476544 - maskLow := BitVec.ofNat 64 4611686022722421207 - maskHigh := BitVec.ofNat 64 282747360772097 - systematicCode := BitVec.ofNat 64 16199671918372851213 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9150687705385216 - maskLow := BitVec.ofNat 64 4611686022722421207 - maskHigh := BitVec.ofNat 64 351843740286977 - systematicCode := BitVec.ofNat 64 16203019810668023309 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18087518215948544 - maskLow := BitVec.ofNat 64 83316597401387479 - maskHigh := BitVec.ofNat 64 351844794630145 - systematicCode := BitVec.ofNat 64 16203032750396476941 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148233131575552 - maskLow := BitVec.ofNat 64 4611686022722421207 - maskHigh := BitVec.ofNat 64 18015498037897217 - systematicCode := BitVec.ofNat 64 17064333170414718477 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085063642138880 - maskLow := BitVec.ofNat 64 72101578798072279 - maskHigh := BitVec.ofNat 64 18015499094851585 - systematicCode := BitVec.ofNat 64 17064346178861600269 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18050154147956992 - maskLow := BitVec.ofNat 64 72057599004049879 - maskHigh := BitVec.ofNat 64 18084767270436865 - systematicCode := BitVec.ofNat 64 17067710683903626765 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2534376451883264 - maskLow := BitVec.ofNat 64 4611686022722421207 - maskHigh := BitVec.ofNat 64 576460889744482369 - systematicCode := BitVec.ofNat 64 17855553832205684237 }) - ) - ) - ) - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36047490866495744 - maskLow := BitVec.ofNat 64 9042662799770071 - maskHigh := BitVec.ofNat 64 576460890816118785 - systematicCode := BitVec.ofNat 64 17855572316919696909 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36169674096132352 - maskLow := BitVec.ofNat 64 9007204090839511 - maskHigh := BitVec.ofNat 64 576531121049698305 - systematicCode := BitVec.ofNat 64 17860338699287137805 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36169810461344000 - maskLow := BitVec.ofNat 64 35189204009431 - maskHigh := BitVec.ofNat 64 594475150812913665 - systematicCode := BitVec.ofNat 64 17864824638007938573 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2534376485175552 - maskLow := BitVec.ofNat 64 4611686022722421207 - maskHigh := BitVec.ofNat 64 2305843043573958721 - systematicCode := BitVec.ofNat 64 18142653893224173069 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36047490899788032 - maskLow := BitVec.ofNat 64 2260875079647703 - maskHigh := BitVec.ofNat 64 2305843044647174145 - systematicCode := BitVec.ofNat 64 18142676775917587981 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36169674129424640 - maskLow := BitVec.ofNat 64 2251804247130583 - maskHigh := BitVec.ofNat 64 2305913377958395905 - systematicCode := BitVec.ofNat 64 18148564660145360397 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36169810494636288 - maskLow := BitVec.ofNat 64 8800522289623 - maskHigh := BitVec.ofNat 64 2323857407723177985 - systematicCode := BitVec.ofNat 64 18153050598866161165 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9360698687965440 - maskLow := BitVec.ofNat 64 4611686022722421207 - maskHigh := BitVec.ofNat 64 2900388529844518913 - systematicCode := BitVec.ofNat 64 18156240855566650893 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x1307. -/ -def normalizedWeightSixteenCandidateBucket_1307 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .twoE8 - affineCode := BitVec.ofNat 56 18085043456999552 - maskLow := BitVec.ofNat 64 4503603922407199 - maskHigh := BitVec.ofNat 64 281543697235969 - systematicCode := BitVec.ofNat 64 16197381224838533895 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18087521418512512 - maskLow := BitVec.ofNat 64 869194732377539359 - maskHigh := BitVec.ofNat 64 281612417761281 - systematicCode := BitVec.ofNat 64 16198229010032366343 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9150690907949184 - maskLow := BitVec.ofNat 64 9007203549774623 - maskHigh := BitVec.ofNat 64 281612618039297 - systematicCode := BitVec.ofNat 64 16198241376099046151 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9360147873040512 - maskLow := BitVec.ofNat 64 9007203549774623 - maskHigh := BitVec.ofNat 64 294737837817857 - systematicCode := BitVec.ofNat 64 16201371767358034695 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148217157781632 - maskLow := BitVec.ofNat 64 9007203549774623 - maskHigh := BitVec.ofNat 64 563018673995777 - systematicCode := BitVec.ofNat 64 16413554241151111943 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085047668344960 - maskLow := BitVec.ofNat 64 4714710154937119 - maskHigh := BitVec.ofNat 64 563018674995201 - systematicCode := BitVec.ofNat 64 16413557306699879175 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18050138174163072 - maskLow := BitVec.ofNat 64 4503607143629599 - maskHigh := BitVec.ofNat 64 563087393423361 - systematicCode := BitVec.ofNat 64 16414398432556159751 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36170085353685120 - maskLow := BitVec.ofNat 64 576460758746071839 - maskHigh := BitVec.ofNat 64 4611686156000559105 - systematicCode := BitVec.ofNat 64 18287911330832913159 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36100266365321344 - maskLow := BitVec.ofNat 64 576601502676747039 - maskHigh := BitVec.ofNat 64 4611694814522507265 - systematicCode := BitVec.ofNat 64 18290995461487792903 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9289774833631360 - maskLow := BitVec.ofNat 64 9007203549774623 - maskHigh := BitVec.ofNat 64 4611694814654660611 - systematicCode := BitVec.ofNat 64 18291007728537768711 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36170085353687168 - maskLow := BitVec.ofNat 64 288230381520618271 - maskHigh := BitVec.ofNat 64 9223372174360838145 - systematicCode := BitVec.ofNat 64 18359967821047468807 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36100266365323392 - maskLow := BitVec.ofNat 64 288300757780857631 - maskHigh := BitVec.ofNat 64 9223376434903384065 - systematicCode := BitVec.ofNat 64 18362771576237265671 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9289774833633408 - maskLow := BitVec.ofNat 64 9007203549774623 - maskHigh := BitVec.ofNat 64 9223376434968412163 - systematicCode := BitVec.ofNat 64 18362782743792390919 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9360697662406784 - maskLow := BitVec.ofNat 64 9007203549774623 - maskHigh := BitVec.ofNat 64 13835621142676635649 - systematicCode := BitVec.ofNat 64 18374092518635279111 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x130b. -/ -def normalizedWeightSixteenCandidateBucket_130b : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .twoE8 - affineCode := BitVec.ofNat 56 18085043211468928 - maskLow := BitVec.ofNat 64 1125904201888567 - maskHigh := BitVec.ofNat 64 281492156841985 - systematicCode := BitVec.ofNat 64 16196250909772681995 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18087521439320192 - maskLow := BitVec.ofNat 64 3459890418022417207 - maskHigh := BitVec.ofNat 64 281509336973313 - systematicCode := BitVec.ofNat 64 16197098729325728523 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9150690928756864 - maskLow := BitVec.ofNat 64 2251804108718903 - maskHigh := BitVec.ofNat 64 281510142017537 - systematicCode := BitVec.ofNat 64 16197119891351212811 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9360147893848192 - maskLow := BitVec.ofNat 64 2251804108718903 - maskHigh := BitVec.ofNat 64 334268715237377 - systematicCode := BitVec.ofNat 64 16202502048064148235 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148217028774016 - maskLow := BitVec.ofNat 64 2251804108718903 - maskHigh := BitVec.ofNat 64 562967133601793 - systematicCode := BitVec.ofNat 64 16412423943197496075 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085047539337344 - maskLow := BitVec.ofNat 64 1337010434409271 - maskHigh := BitVec.ofNat 64 562967133814785 - systematicCode := BitVec.ofNat 64 16412426991566656267 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18050138045155456 - maskLow := BitVec.ofNat 64 1125907423101751 - maskHigh := BitVec.ofNat 64 562984313421825 - systematicCode := BitVec.ofNat 64 16413268117422936843 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36170085341200512 - maskLow := BitVec.ofNat 64 2305843015656342327 - maskHigh := BitVec.ofNat 64 4611686053323997185 - systematicCode := BitVec.ofNat 64 18286789846152450827 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36100266352836736 - maskLow := BitVec.ofNat 64 2305983759587017527 - maskHigh := BitVec.ofNat 64 4611721202800001025 - systematicCode := BitVec.ofNat 64 18292116980527993611 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9289774821146752 - maskLow := BitVec.ofNat 64 2251804108718903 - maskHigh := BitVec.ofNat 64 4611721203336380419 - systematicCode := BitVec.ofNat 64 18292138026490860299 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36170085341202560 - maskLow := BitVec.ofNat 64 1152921509975753527 - maskHigh := BitVec.ofNat 64 9223372071482949633 - systematicCode := BitVec.ofNat 64 18358846336367006475 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36100266352838784 - maskLow := BitVec.ofNat 64 1152991886235992887 - maskHigh := BitVec.ofNat 64 9223389629041344513 - systematicCode := BitVec.ofNat 64 18363893095277466379 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9289774821148800 - maskLow := BitVec.ofNat 64 2251804108718903 - maskHigh := BitVec.ofNat 64 9223389629309272067 - systematicCode := BitVec.ofNat 64 18363913041745482507 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9360697649922176 - maskLow := BitVec.ofNat 64 2251804108718903 - maskHigh := BitVec.ofNat 64 13835621039595847681 - systematicCode := BitVec.ofNat 64 18374092501388038923 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x1507. -/ -def normalizedWeightSixteenCandidateBucket_1507 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18087521418496256 - maskLow := BitVec.ofNat 64 725079544301683999 - maskHigh := BitVec.ofNat 64 281749858811905 - systematicCode := BitVec.ofNat 64 16198794158975489287 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9150690907932928 - maskLow := BitVec.ofNat 64 18014402804516127 - maskHigh := BitVec.ofNat 64 281750023438337 - systematicCode := BitVec.ofNat 64 16198804317462664455 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9360147873024256 - maskLow := BitVec.ofNat 64 18014402804516127 - maskHigh := BitVec.ofNat 64 292538816659457 - systematicCode := BitVec.ofNat 64 16201369568368465159 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148217157765376 - maskLow := BitVec.ofNat 64 18014402804516127 - maskHigh := BitVec.ofNat 64 1125968627408897 - systematicCode := BitVec.ofNat 64 16557669429193544967 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085047668328704 - maskLow := BitVec.ofNat 64 4679525782848799 - maskHigh := BitVec.ofNat 64 1125968630513665 - systematicCode := BitVec.ofNat 64 16557674693798860039 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18050138174146816 - maskLow := BitVec.ofNat 64 4503606606759199 - maskHigh := BitVec.ofNat 64 1126174785798145 - systematicCode := BitVec.ofNat 64 16559076570585306375 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36170085353668864 - maskLow := BitVec.ofNat 64 576460758746203423 - maskHigh := BitVec.ofNat 64 2305843284225818625 - systematicCode := BitVec.ofNat 64 18144359092710610183 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36100266365305088 - maskLow := BitVec.ofNat 64 576601511266682143 - maskHigh := BitVec.ofNat 64 2305851805310910465 - systematicCode := BitVec.ofNat 64 18146882472435324167 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9289774833615104 - maskLow := BitVec.ofNat 64 18014402804516127 - maskHigh := BitVec.ofNat 64 2305851805440966661 - systematicCode := BitVec.ofNat 64 18146892540495598855 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36170085353931008 - maskLow := BitVec.ofNat 64 144115192908023071 - maskHigh := BitVec.ofNat 64 9223372311766237185 - systematicCode := BitVec.ofNat 64 18360528563354277127 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36100266365567232 - maskLow := BitVec.ofNat 64 144150393922848031 - maskHigh := BitVec.ofNat 64 9223374235882225665 - systematicCode := BitVec.ofNat 64 18362210816683742471 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9289774833877248 - maskLow := BitVec.ofNat 64 18014402804516127 - maskHigh := BitVec.ofNat 64 9223374235911593989 - systematicCode := BitVec.ofNat 64 18362217586259465479 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9360697662130432 - maskLow := BitVec.ofNat 64 18014402804516127 - maskHigh := BitVec.ofNat 64 11530341220857413633 - systematicCode := BitVec.ofNat 64 18373531776328733959 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x150d. -/ -def normalizedWeightSixteenCandidateBucket_150d : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .twoE8 - affineCode := BitVec.ofNat 56 18085043209534464 - maskLow := BitVec.ofNat 64 562954248475991 - maskHigh := BitVec.ofNat 64 281483566776321 - systematicCode := BitVec.ofNat 64 16195685752239625485 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18087521439466496 - maskLow := BitVec.ofNat 64 5765170477282690391 - maskHigh := BitVec.ofNat 64 281509336973313 - systematicCode := BitVec.ofNat 64 16197098737915532557 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9150690928903168 - maskLow := BitVec.ofNat 64 2251804108719447 - maskHigh := BitVec.ofNat 64 281510678757377 - systematicCode := BitVec.ofNat 64 16197122090340914445 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9360147893994496 - maskLow := BitVec.ofNat 64 2251804108719447 - maskHigh := BitVec.ofNat 64 369444497391617 - systematicCode := BitVec.ofNat 64 16203064989427635469 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148217027749888 - maskLow := BitVec.ofNat 64 2251804108719447 - maskHigh := BitVec.ofNat 64 1125908496949249 - systematicCode := BitVec.ofNat 64 16555973982263121165 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085047538313216 - maskLow := BitVec.ofNat 64 738876108899671 - maskHigh := BitVec.ofNat 64 1125908497301505 - systematicCode := BitVec.ofNat 64 16555979221099025677 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18050138044131328 - maskLow := BitVec.ofNat 64 562956932810071 - maskHigh := BitVec.ofNat 64 1125934266712065 - systematicCode := BitVec.ofNat 64 16557381097885472013 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36170085341086720 - maskLow := BitVec.ofNat 64 4611686024870167895 - maskHigh := BitVec.ofNat 64 2305843044647174145 - systematicCode := BitVec.ofNat 64 18142676865689916685 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36100266352722944 - maskLow := BitVec.ofNat 64 4611826777390646615 - maskHigh := BitVec.ofNat 64 2305913377958395905 - systematicCode := BitVec.ofNat 64 18148564750995625229 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9289774821032960 - maskLow := BitVec.ofNat 64 2251804108719447 - maskHigh := BitVec.ofNat 64 2305913379031646213 - systematicCode := BitVec.ofNat 64 18148587987425236237 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36170085341348864 - maskLow := BitVec.ofNat 64 1152921509439014231 - maskHigh := BitVec.ofNat 64 9223372071482949633 - systematicCode := BitVec.ofNat 64 18358846336333583629 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36100266352985088 - maskLow := BitVec.ofNat 64 1152956710453839191 - maskHigh := BitVec.ofNat 64 9223389629041344513 - systematicCode := BitVec.ofNat 64 18363893095244043533 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9289774821295104 - maskLow := BitVec.ofNat 64 2251804108719447 - maskHigh := BitVec.ofNat 64 9223389629309263877 - systematicCode := BitVec.ofNat 64 18363913033189102861 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9360697649548288 - maskLow := BitVec.ofNat 64 2251804108719447 - maskHigh := BitVec.ofNat 64 11530340980335575041 - systematicCode := BitVec.ofNat 64 18373531750457873677 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x1513. -/ -def normalizedWeightSixteenCandidateBucket_1513 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.node - (.leaf - { patternClass := .d16Plus - affineCode := BitVec.ofNat 56 54397530474061952 - maskLow := BitVec.ofNat 64 1103823443735 - maskHigh := BitVec.ofNat 64 9259400833873740033 - systematicCode := BitVec.ofNat 64 18370061182969648403 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9360147067767040 - maskLow := BitVec.ofNat 64 1152921508901881623 - maskHigh := BitVec.ofNat 64 290374417383425 - systematicCode := BitVec.ofNat 64 16201357469647705363 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9150690102675712 - maskLow := BitVec.ofNat 64 1152921508901881623 - maskHigh := BitVec.ofNat 64 299067298545665 - systematicCode := BitVec.ofNat 64 16202181969922561299 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18087520613239040 - maskLow := BitVec.ofNat 64 583216156039513879 - maskHigh := BitVec.ofNat 64 299067431190529 - systematicCode := BitVec.ofNat 64 16202185052650935571 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9289774028357888 - maskLow := BitVec.ofNat 64 1152921508901881623 - maskHigh := BitVec.ofNat 64 36037593246236929 - systematicCode := BitVec.ofNat 64 17282201412242576659 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36100265560047872 - maskLow := BitVec.ofNat 64 576602593598441239 - maskHigh := BitVec.ofNat 64 36037593380421633 - systematicCode := BitVec.ofNat 64 17282204538120508691 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36170084548411648 - maskLow := BitVec.ofNat 64 576460758762718999 - maskHigh := BitVec.ofNat 64 36046389339226113 - systematicCode := BitVec.ofNat 64 17283045663976789267 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148216352508160 - maskLow := BitVec.ofNat 64 1152921508901881623 - maskHigh := BitVec.ofNat 64 72057662758486145 - systematicCode := BitVec.ofNat 64 17422360557448140051 }) - ) - ) - ) - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085046863071488 - maskLow := BitVec.ofNat 64 4644891166574359 - maskHigh := BitVec.ofNat 64 72057663025840129 - systematicCode := BitVec.ofNat 64 17422379016392742163 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18050137368889600 - maskLow := BitVec.ofNat 64 4503606078277399 - maskHigh := BitVec.ofNat 64 72075186225020929 - systematicCode := BitVec.ofNat 64 17427145398760183059 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36169809687281920 - maskLow := BitVec.ofNat 64 140743930877719 - maskHigh := BitVec.ofNat 64 108086391056924673 - systematicCode := BitVec.ofNat 64 17433326810180424979 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9289778323325184 - maskLow := BitVec.ofNat 64 1152921508901881623 - maskHigh := BitVec.ofNat 64 9223372071215038849 - systematicCode := BitVec.ofNat 64 18358826649618289939 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36100269855015168 - maskLow := BitVec.ofNat 64 2253453376161559 - maskHigh := BitVec.ofNat 64 9223372071482949633 - systematicCode := BitVec.ofNat 64 18358846259396023571 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36170088843378944 - maskLow := BitVec.ofNat 64 2251804133885719 - maskHigh := BitVec.ofNat 64 9223389629041344513 - systematicCode := BitVec.ofNat 64 18363893017228547347 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36169813982249216 - maskLow := BitVec.ofNat 64 554059241239 - maskHigh := BitVec.ofNat 64 9295429630892703873 - systematicCode := BitVec.ofNat 64 18370621925276325139 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9360692562168064 - maskLow := BitVec.ofNat 64 1152921508901881623 - maskHigh := BitVec.ofNat 64 9331476020366147585 - systematicCode := BitVec.ofNat 64 18370728073419625747 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x1607. -/ -def normalizedWeightSixteenCandidateBucket_1607 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18087520881623680 - maskLow := BitVec.ofNat 64 436849168149973279 - maskHigh := BitVec.ofNat 64 282024740913153 - systematicCode := BitVec.ofNat 64 16199076729168860679 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9150690371060352 - maskLow := BitVec.ofNat 64 36028801313999135 - maskHigh := BitVec.ofNat 64 282024834236417 - systematicCode := BitVec.ofNat 64 16199084692927813127 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9360147336151680 - maskLow := BitVec.ofNat 64 36028801313999135 - maskHigh := BitVec.ofNat 64 288140774342657 - systematicCode := BitVec.ofNat 64 16201088093408597511 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148216620892800 - maskLow := BitVec.ofNat 64 36028801313999135 - maskHigh := BitVec.ofNat 64 2251868534235137 - systematicCode := BitVec.ofNat 64 16629727018936571399 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085047131456128 - maskLow := BitVec.ofNat 64 4609157038672159 - maskHigh := BitVec.ofNat 64 2251868541550593 - systematicCode := BitVec.ofNat 64 16629733387331638791 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18050137637274240 - maskLow := BitVec.ofNat 64 4503605533018399 - maskHigh := BitVec.ofNat 64 2252349570547713 - systematicCode := BitVec.ofNat 64 16631415639583168007 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36169672499939456 - maskLow := BitVec.ofNat 64 288230381521013023 - maskHigh := BitVec.ofNat 64 2305843559036616705 - systematicCode := BitVec.ofNat 64 18144639463864014343 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36047489270302848 - maskLow := BitVec.ofNat 64 288300783550662943 - maskHigh := BitVec.ofNat 64 2305847407268593665 - systematicCode := BitVec.ofNat 64 18146602092658562567 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2534374855690368 - maskLow := BitVec.ofNat 64 36028801313999135 - maskHigh := BitVec.ofNat 64 2305847407327330313 - systematicCode := BitVec.ofNat 64 18146609961729136135 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36169672500199552 - maskLow := BitVec.ofNat 64 144115192908286239 - maskHigh := BitVec.ofNat 64 4611686568216756225 - systematicCode := BitVec.ofNat 64 18288752444293125639 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36047489270562944 - maskLow := BitVec.ofNat 64 144150411102718239 - maskHigh := BitVec.ofNat 64 4611688217459032065 - systematicCode := BitVec.ofNat 64 18290154322157508103 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2534374855950464 - maskLow := BitVec.ofNat 64 36028801313999135 - maskHigh := BitVec.ofNat 64 4611688217484206089 - systematicCode := BitVec.ofNat 64 18290159992238380551 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9360697125259904 - maskLow := BitVec.ofNat 64 36028801313999135 - maskHigh := BitVec.ofNat 64 6919781377218969601 - systematicCode := BitVec.ofNat 64 18301475286114244103 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x160e. -/ -def normalizedWeightSixteenCandidateBucket_160e : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .twoE8 - affineCode := BitVec.ofNat 56 2260638890081280 - maskLow := BitVec.ofNat 64 281479271770519 - maskHigh := BitVec.ofNat 64 281479271743489 - systematicCode := BitVec.ofNat 64 16195403173456385550 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10208046357948416 - maskLow := BitVec.ofNat 64 6917810506912827799 - maskHigh := BitVec.ofNat 64 281509336973313 - systematicCode := BitVec.ofNat 64 16197098737932244494 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9649494451038208 - maskLow := BitVec.ofNat 64 2251804108720535 - maskHigh := BitVec.ofNat 64 281510947127297 - systematicCode := BitVec.ofNat 64 16197122094619104782 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9592766522992640 - maskLow := BitVec.ofNat 64 2251804108720535 - maskHigh := BitVec.ofNat 64 387032388468737 - systematicCode := BitVec.ofNat 64 16203066084644296206 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9658737220659200 - maskLow := BitVec.ofNat 64 2251804108720535 - maskHigh := BitVec.ofNat 64 2251804108742657 - systematicCode := BitVec.ofNat 64 16627748997517743630 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11334392941389824 - maskLow := BitVec.ofNat 64 387032388012439 - maskHigh := BitVec.ofNat 64 2251804109176833 - systematicCode := BitVec.ofNat 64 16627755335848498702 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11338756628162560 - maskLow := BitVec.ofNat 64 281480882358679 - maskHigh := BitVec.ofNat 64 2251834173489153 - systematicCode := BitVec.ofNat 64 16629437588100027918 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11338761226971136 - maskLow := BitVec.ofNat 64 4611686023796689303 - maskHigh := BitVec.ofNat 64 2305843044647174145 - systematicCode := BitVec.ofNat 64 18142676865673205262 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11334397540198400 - maskLow := BitVec.ofNat 64 4611756425826339223 - maskHigh := BitVec.ofNat 64 2305913377958395905 - systematicCode := BitVec.ofNat 64 18148564750978913806 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9658741819467776 - maskLow := BitVec.ofNat 64 2251804108720535 - maskHigh := BitVec.ofNat 64 2305913379031629833 - systematicCode := BitVec.ofNat 64 18148587983147046414 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11338761228255360 - maskLow := BitVec.ofNat 64 2305843014046124439 - maskHigh := BitVec.ofNat 64 4611686053323997185 - systematicCode := BitVec.ofNat 64 18286789846102316558 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11334397541482624 - maskLow := BitVec.ofNat 64 2305878232240556439 - maskHigh := BitVec.ofNat 64 4611721202800001025 - systematicCode := BitVec.ofNat 64 18292116980477859342 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9658741820752000 - maskLow := BitVec.ofNat 64 2251804108720535 - maskHigh := BitVec.ofNat 64 4611721203336355849 - systematicCode := BitVec.ofNat 64 18292138013656290830 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9592251126669440 - maskLow := BitVec.ofNat 64 2251804108720535 - maskHigh := BitVec.ofNat 64 6919780861815029761 - systematicCode := BitVec.ofNat 64 18301475255931573774 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x1613. -/ -def normalizedWeightSixteenCandidateBucket_1613 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.node - (.leaf - { patternClass := .d16Plus - affineCode := BitVec.ofNat 56 54397530474053760 - maskLow := BitVec.ofNat 64 2203351853847 - maskHigh := BitVec.ofNat 64 4647714815446352385 - systematicCode := BitVec.ofNat 64 18298004692755158547 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9360147067732608 - maskLow := BitVec.ofNat 64 2305843013508729623 - maskHigh := BitVec.ofNat 64 285976639307777 - systematicCode := BitVec.ofNat 64 16201075994687837715 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9150690102641280 - maskLow := BitVec.ofNat 64 2305843013508729623 - maskHigh := BitVec.ofNat 64 316659417481217 - systematicCode := BitVec.ofNat 64 16202462345387709971 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18087520613204608 - maskLow := BitVec.ofNat 64 294985779887803159 - maskHigh := BitVec.ofNat 64 316659885670401 - systematicCode := BitVec.ofNat 64 16202467622844306963 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2534374587271296 - maskLow := BitVec.ofNat 64 2305843013508729623 - maskHigh := BitVec.ofNat 64 36033195132600833 - systematicCode := BitVec.ofNat 64 17281918833476113939 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36047489001883776 - maskLow := BitVec.ofNat 64 288302948214180631 - maskHigh := BitVec.ofNat 64 36033195602345985 - systematicCode := BitVec.ofNat 64 17281924158343747091 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36169672231520384 - maskLow := BitVec.ofNat 64 288230381554043671 - maskHigh := BitVec.ofNat 64 36063981458161665 - systematicCode := BitVec.ofNat 64 17283326035130193427 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148216352473728 - maskLow := BitVec.ofNat 64 2305843013508729623 - maskHigh := BitVec.ofNat 64 144115256796397697 - systematicCode := BitVec.ofNat 64 17494418147191166483 }) - ) - ) - ) - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085046863037056 - maskLow := BitVec.ofNat 64 4574522422397719 - maskHigh := BitVec.ofNat 64 144115257332203521 - systematicCode := BitVec.ofNat 64 17494437709925520915 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18050137368855168 - maskLow := BitVec.ofNat 64 4503605004536599 - maskHigh := BitVec.ofNat 64 144150372448993281 - systematicCode := BitVec.ofNat 64 17499484467758044691 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36169809662085248 - maskLow := BitVec.ofNat 64 70374112963351 - maskHigh := BitVec.ofNat 64 180143985094836225 - systematicCode := BitVec.ofNat 64 17505383300395046419 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2534378882236544 - maskLow := BitVec.ofNat 64 2305843013508729623 - maskHigh := BitVec.ofNat 64 4611686052787651201 - systematicCode := BitVec.ofNat 64 18286769059875395091 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36047493296849024 - maskLow := BitVec.ofNat 64 2254552887790359 - maskHigh := BitVec.ofNat 64 4611686053323997185 - systematicCode := BitVec.ofNat 64 18286789764886500883 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36169676526485632 - maskLow := BitVec.ofNat 64 2251804150663959 - maskHigh := BitVec.ofNat 64 4611721202800001025 - systematicCode := BitVec.ofNat 64 18292116898184107539 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36169813957050496 - maskLow := BitVec.ofNat 64 554059246359 - maskHigh := BitVec.ofNat 64 4755801206503243905 - systematicCode := BitVec.ofNat 64 18298845806215173651 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9360692562135680 - maskLow := BitVec.ofNat 64 2305843013508729623 - maskHigh := BitVec.ofNat 64 4791865188431167489 - systematicCode := BitVec.ofNat 64 18298951958670218771 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x1615. -/ -def normalizedWeightSixteenCandidateBucket_1615 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.node - (.leaf - { patternClass := .d16Plus - affineCode := BitVec.ofNat 56 54397530472997120 - maskLow := BitVec.ofNat 64 4402408672535 - maskHigh := BitVec.ofNat 64 2341871806232658945 - systematicCode := BitVec.ofNat 64 18153891712326178325 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9360147067521280 - maskLow := BitVec.ofNat 64 4611686022722424087 - maskHigh := BitVec.ofNat 64 283778152923137 - systematicCode := BitVec.ofNat 64 16200513044768101909 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9150690102429952 - maskLow := BitVec.ofNat 64 4611686022722424087 - maskHigh := BitVec.ofNat 64 351843756015617 - systematicCode := BitVec.ofNat 64 16203023096318006805 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18087520612993280 - maskLow := BitVec.ofNat 64 150870591811947799 - maskHigh := BitVec.ofNat 64 351844794630145 - systematicCode := BitVec.ofNat 64 16203032763231049237 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2534374587515136 - maskLow := BitVec.ofNat 64 4611686022722424087 - maskHigh := BitVec.ofNat 64 36030996075783169 - systematicCode := BitVec.ofNat 64 17281353675943187989 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36047489002127616 - maskLow := BitVec.ofNat 64 144154774789491991 - maskHigh := BitVec.ofNat 64 36030997115961345 - systematicCode := BitVec.ofNat 64 17281363398790223381 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36169672231764224 - maskLow := BitVec.ofNat 64 144115192974871831 - maskHigh := BitVec.ofNat 64 36099165796696065 - systematicCode := BitVec.ofNat 64 17283886777437001237 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148216352262400 - maskLow := BitVec.ofNat 64 4611686022722424087 - maskHigh := BitVec.ofNat 64 288230444872245377 - systematicCode := BitVec.ofNat 64 17638533326677218837 }) - ) - ) - ) - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085046862825728 - maskLow := BitVec.ofNat 64 4539338050309399 - maskHigh := BitVec.ofNat 64 288230445944930305 - systematicCode := BitVec.ofNat 64 17638555096991077909 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18050137368643840 - maskLow := BitVec.ofNat 64 4503604467666199 - maskHigh := BitVec.ofNat 64 288300744896937985 - systematicCode := BitVec.ofNat 64 17644162605753767445 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36169809662329088 - maskLow := BitVec.ofNat 64 35189204012311 - maskHigh := BitVec.ofNat 64 324259173170683905 - systematicCode := BitVec.ofNat 64 17649496280824288789 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2534378882220288 - maskLow := BitVec.ofNat 64 4611686022722424087 - maskHigh := BitVec.ofNat 64 2305843043573957761 - systematicCode := BitVec.ofNat 64 18142653880389604885 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36047493296832768 - maskLow := BitVec.ofNat 64 2256751911046423 - maskHigh := BitVec.ofNat 64 2305843044647174145 - systematicCode := BitVec.ofNat 64 18142676775867454997 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36169676526469376 - maskLow := BitVec.ofNat 64 2251804184218903 - maskHigh := BitVec.ofNat 64 2305913377958395905 - systematicCode := BitVec.ofNat 64 18148564660095227413 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36169813957034240 - maskLow := BitVec.ofNat 64 554059255063 - maskHigh := BitVec.ofNat 64 2594073385365405825 - systematicCode := BitVec.ofNat 64 18155293568092870165 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9360692562184448 - maskLow := BitVec.ofNat 64 4611686022722424087 - maskHigh := BitVec.ofNat 64 2630172552202289153 - systematicCode := BitVec.ofNat 64 18155399729171404309 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x190b. -/ -def normalizedWeightSixteenCandidateBucket_190b : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18087521437223168 - maskLow := BitVec.ofNat 64 2451084101491429687 - maskHigh := BitVec.ofNat 64 281749858811905 - systematicCode := BitVec.ofNat 64 16198794176155097355 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9150690926659840 - maskLow := BitVec.ofNat 64 18014402804519223 - maskHigh := BitVec.ofNat 64 281750425305089 - systematicCode := BitVec.ofNat 64 16198808715442067723 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9360147891751168 - maskLow := BitVec.ofNat 64 18014402804519223 - maskHigh := BitVec.ofNat 64 318875556118529 - systematicCode := BitVec.ofNat 64 16202495451095439627 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148217026676992 - maskLow := BitVec.ofNat 64 18014402804519223 - maskHigh := BitVec.ofNat 64 4503616807536641 - systematicCode := BitVec.ofNat 64 16844769507324795147 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085047537240320 - maskLow := BitVec.ofNat 64 1275437783257399 - maskHigh := BitVec.ofNat 64 4503616811433985 - systematicCode := BitVec.ofNat 64 16844779152863598859 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18050138043058432 - maskLow := BitVec.ofNat 64 1125906483581239 - maskHigh := BitVec.ofNat 64 4503874505539585 - systematicCode := BitVec.ofNat 64 16847302531510376715 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36170085339103488 - maskLow := BitVec.ofNat 64 2305843015657263415 - maskHigh := BitVec.ofNat 64 576461027718201345 - systematicCode := BitVec.ofNat 64 17856133131785541899 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36100266350739712 - maskLow := BitVec.ofNat 64 2305983819716563255 - maskHigh := BitVec.ofNat 64 576495936679706625 - systematicCode := BitVec.ofNat 64 17859778013370587403 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9289774819049728 - maskLow := BitVec.ofNat 64 18014402804519223 - maskHigh := BitVec.ofNat 64 576495937212416017 - systematicCode := BitVec.ofNat 64 17859792462364350731 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36170085372657920 - maskLow := BitVec.ofNat 64 144115192506159415 - maskHigh := BitVec.ofNat 64 9223372311766237185 - systematicCode := BitVec.ofNat 64 18360528563287431435 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36100266384294144 - maskLow := BitVec.ofNat 64 144124057183392055 - maskHigh := BitVec.ofNat 64 9223374235882225665 - systematicCode := BitVec.ofNat 64 18362210816616896779 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9289774852604160 - maskLow := BitVec.ofNat 64 18014402804519223 - maskHigh := BitVec.ofNat 64 9223374235911587857 - systematicCode := BitVec.ofNat 64 18362217569146706187 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9360697614272768 - maskLow := BitVec.ofNat 64 18014402804519223 - maskHigh := BitVec.ofNat 64 9804336663667671041 - systematicCode := BitVec.ofNat 64 18372410274468403467 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x190d. -/ -def normalizedWeightSixteenCandidateBucket_190d : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18087521437385728 - maskLow := BitVec.ofNat 64 4900479348827558231 - maskHigh := BitVec.ofNat 64 281612417761281 - systematicCode := BitVec.ofNat 64 16198229035801778445 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9150690926822400 - maskLow := BitVec.ofNat 64 9007203549778263 - maskHigh := BitVec.ofNat 64 281613556645889 - systematicCode := BitVec.ofNat 64 16198247973068151053 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9360147891913728 - maskLow := BitVec.ofNat 64 9007203549778263 - maskHigh := BitVec.ofNat 64 356250359431169 - systematicCode := BitVec.ofNat 64 16203060591448496397 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148217025669120 - maskLow := BitVec.ofNat 64 9007203549778263 - maskHigh := BitVec.ofNat 64 4503608217470977 - systematicCode := BitVec.ofNat 64 16844204358347987213 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085047536232448 - maskLow := BitVec.ofNat 64 712487829836119 - maskHigh := BitVec.ofNat 64 4503608219402241 - systematicCode := BitVec.ofNat 64 16844213995296987405 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18050138042050560 - maskLow := BitVec.ofNat 64 562956530159959 - maskHigh := BitVec.ofNat 64 4503737066455041 - systematicCode := BitVec.ofNat 64 16846737373943765261 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36170085339005952 - maskLow := BitVec.ofNat 64 4611686024870957399 - maskHigh := BitVec.ofNat 64 576460890816118785 - systematicCode := BitVec.ofNat 64 17855572389445310733 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36100266350642176 - maskLow := BitVec.ofNat 64 4611826828930257239 - maskHigh := BitVec.ofNat 64 576531121049698305 - systematicCode := BitVec.ofNat 64 17860338772890687757 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9289774818952192 - maskLow := BitVec.ofNat 64 9007203549778263 - maskHigh := BitVec.ofNat 64 576531122121375761 - systematicCode := BitVec.ofNat 64 17860357611340896525 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36170085372560384 - maskLow := BitVec.ofNat 64 288230380582015319 - maskHigh := BitVec.ofNat 64 9223372174360838145 - systematicCode := BitVec.ofNat 64 18359967820947200269 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36100266384196608 - maskLow := BitVec.ofNat 64 288239245259247959 - maskHigh := BitVec.ofNat 64 9223376434903384065 - systematicCode := BitVec.ofNat 64 18362771576136997133 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9289774852506624 - maskLow := BitVec.ofNat 64 9007203549778263 - maskHigh := BitVec.ofNat 64 9223376434968397841 - systematicCode := BitVec.ofNat 64 18362782718123251981 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9360697614175232 - maskLow := BitVec.ofNat 64 9007203549778263 - maskHigh := BitVec.ofNat 64 9804336526226620417 - systematicCode := BitVec.ofNat 64 18372410265844783373 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x1913. -/ -def normalizedWeightSixteenCandidateBucket_1913 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18087520638208256 - maskLow := BitVec.ofNat 64 2315976112670315287 - maskHigh := BitVec.ofNat 64 285873090330625 - systematicCode := BitVec.ofNat 64 16201054771927587091 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9150690127644928 - maskLow := BitVec.ofNat 64 288230380446749463 - maskHigh := BitVec.ofNat 64 285873562451969 - systematicCode := BitVec.ofNat 64 16201060480896538899 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9360147092736256 - maskLow := BitVec.ofNat 64 288230380446749463 - maskHigh := BitVec.ofNat 64 316814034731009 - systematicCode := BitVec.ofNat 64 16202486655137159443 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36170084540088576 - maskLow := BitVec.ofNat 64 2305843015672992535 - maskHigh := BitVec.ofNat 64 36033195602345985 - systematicCode := BitVec.ofNat 64 17281924179296327955 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36100265551724800 - maskLow := BitVec.ofNat 64 2305984850508714775 - maskHigh := BitVec.ofNat 64 36063981458161665 - systematicCode := BitVec.ofNat 64 17283326057160710419 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9289774020034816 - maskLow := BitVec.ofNat 64 288230380446749463 - maskHigh := BitVec.ofNat 64 36063981927956737 - systematicCode := BitVec.ofNat 64 17283331710195669267 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148216227662080 - maskLow := BitVec.ofNat 64 288230380446749463 - maskHigh := BitVec.ofNat 64 72057611218092161 - systematicCode := BitVec.ofNat 64 17421230259494525203 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085046738225408 - maskLow := BitVec.ofNat 64 1267191446049559 - maskHigh := BitVec.ofNat 64 72057611284905985 - systematicCode := BitVec.ofNat 64 17421248701259520275 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18050137244043520 - maskLow := BitVec.ofNat 64 1125906357752599 - maskHigh := BitVec.ofNat 64 72061992084701185 - systematicCode := BitVec.ofNat 64 17426015083626961171 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9289778315002112 - maskLow := BitVec.ofNat 64 288230380446749463 - maskHigh := BitVec.ofNat 64 9223372174295826817 - systematicCode := BitVec.ofNat 64 18359956947571382547 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36100269846692096 - maskLow := BitVec.ofNat 64 9008852817220375 - maskHigh := BitVec.ofNat 64 9223372174360838145 - systematicCode := BitVec.ofNat 64 18359967778436225299 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36170088835055872 - maskLow := BitVec.ofNat 64 9007203574944535 - maskHigh := BitVec.ofNat 64 9223376434903384065 - systematicCode := BitVec.ofNat 64 18362771532548086035 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9360692553844992 - maskLow := BitVec.ofNat 64 288230380446749463 - maskHigh := BitVec.ofNat 64 9331462826025287681 - systematicCode := BitVec.ofNat 64 18370728056172386579 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x1915. -/ -def normalizedWeightSixteenCandidateBucket_1915 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18087520638370816 - maskLow := BitVec.ofNat 64 4630263371185329431 - maskHigh := BitVec.ofNat 64 283674033520641 - systematicCode := BitVec.ofNat 64 16200489631574268181 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9150690127807488 - maskLow := BitVec.ofNat 64 144115192370894103 - maskHigh := BitVec.ofNat 64 283675078033409 - systematicCode := BitVec.ofNat 64 16200499738522622229 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9360147092898816 - maskLow := BitVec.ofNat 64 144115192370894103 - maskHigh := BitVec.ofNat 64 352127222284289 - systematicCode := BitVec.ofNat 64 16203051795490216213 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36170084539991040 - maskLow := BitVec.ofNat 64 4611686024886686999 - maskHigh := BitVec.ofNat 64 36030997115961345 - systematicCode := BitVec.ofNat 64 17281363436956096789 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36100265551627264 - maskLow := BitVec.ofNat 64 4611827859722409239 - maskHigh := BitVec.ofNat 64 36099165796696065 - systematicCode := BitVec.ofNat 64 17283886816680810773 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9289774019937280 - maskLow := BitVec.ofNat 64 144115192370894103 - maskHigh := BitVec.ofNat 64 36099166836916481 - systematicCode := BitVec.ofNat 64 17283896859172215061 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148216226654208 - maskLow := BitVec.ofNat 64 144115192370894103 - maskHigh := BitVec.ofNat 64 72057602628026497 - systematicCode := BitVec.ofNat 64 17420665110517717269 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085046737217536 - maskLow := BitVec.ofNat 64 704241492628759 - maskHigh := BitVec.ofNat 64 72057602661416961 - systematicCode := BitVec.ofNat 64 17420683543692908821 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18050137243035648 - maskLow := BitVec.ofNat 64 562956404331799 - maskHigh := BitVec.ofNat 64 72059793061314561 - systematicCode := BitVec.ofNat 64 17425449926060349717 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9289778314904576 - maskLow := BitVec.ofNat 64 144115192370894103 - maskHigh := BitVec.ofNat 64 9223372311736877441 - systematicCode := BitVec.ofNat 64 18360522096547928341 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36100269846594560 - maskLow := BitVec.ofNat 64 18016052071961879 - maskHigh := BitVec.ofNat 64 9223372311766237185 - systematicCode := BitVec.ofNat 64 18360528537956325653 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36170088834958336 - maskLow := BitVec.ofNat 64 18014402829686039 - maskHigh := BitVec.ofNat 64 9223374235882225665 - systematicCode := BitVec.ofNat 64 18362210790207854869 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9360692553747456 - maskLow := BitVec.ofNat 64 144115192370894103 - maskHigh := BitVec.ofNat 64 9331460626968477697 - systematicCode := BitVec.ofNat 64 18370728047548766485 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x1a0b. -/ -def normalizedWeightSixteenCandidateBucket_1a0b : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18087520900350592 - maskLow := BitVec.ofNat 64 1298162596884586807 - maskHigh := BitVec.ofNat 64 282024740913153 - systematicCode := BitVec.ofNat 64 16199076746348468747 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9150690389787264 - maskLow := BitVec.ofNat 64 36028801314005303 - maskHigh := BitVec.ofNat 64 282025034776577 - systematicCode := BitVec.ofNat 64 16199089090907216395 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9360147354878592 - maskLow := BitVec.ofNat 64 36028801314005303 - maskHigh := BitVec.ofNat 64 301283374268417 - systematicCode := BitVec.ofNat 64 16202213976135571979 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148216489804416 - maskLow := BitVec.ofNat 64 36028801314005303 - maskHigh := BitVec.ofNat 64 9007216434890753 - systematicCode := BitVec.ofNat 64 16916827097067821579 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085047000367744 - maskLow := BitVec.ofNat 64 1205069039083831 - maskHigh := BitVec.ofNat 64 9007216442998785 - systematicCode := BitVec.ofNat 64 16916837846396377611 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18050137506185856 - maskLow := BitVec.ofNat 64 1125905409843511 - maskHigh := BitVec.ofNat 64 9007749010817025 - systematicCode := BitVec.ofNat 64 16919641600508238347 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36169672485374080 - maskLow := BitVec.ofNat 64 1152921509977727287 - maskHigh := BitVec.ofNat 64 576461302327672833 - systematicCode := BitVec.ofNat 64 17856413502938946059 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36047489255737472 - maskLow := BitVec.ofNat 64 1152992015085019447 - maskHigh := BitVec.ofNat 64 576478344497856513 - systematicCode := BitVec.ofNat 64 17859497633593825803 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2534374841124992 - maskLow := BitVec.ofNat 64 36028801314005303 - maskHigh := BitVec.ofNat 64 576478344757919777 - systematicCode := BitVec.ofNat 64 17859509883597888011 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36169672518926464 - maskLow := BitVec.ofNat 64 144115192507212087 - maskHigh := BitVec.ofNat 64 4611686568216756225 - systematicCode := BitVec.ofNat 64 18288752444226279947 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36047489289289856 - maskLow := BitVec.ofNat 64 144124125902872887 - maskHigh := BitVec.ofNat 64 4611688217459032065 - systematicCode := BitVec.ofNat 64 18290154322090662411 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2534374874677376 - maskLow := BitVec.ofNat 64 36028801314005303 - maskHigh := BitVec.ofNat 64 4611688217484199969 - systematicCode := BitVec.ofNat 64 18290159975125621259 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9360697077402240 - maskLow := BitVec.ofNat 64 36028801314005303 - maskHigh := BitVec.ofNat 64 5197154519749754881 - systematicCode := BitVec.ofNat 64 18300353784253913611 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x1a0e. -/ -def normalizedWeightSixteenCandidateBucket_1a0e : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10208046374594560 - maskLow := BitVec.ofNat 64 5188428250002563479 - maskHigh := BitVec.ofNat 64 281612417761281 - systematicCode := BitVec.ofNat 64 16198229035818490382 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9649494467684352 - maskLow := BitVec.ofNat 64 9007203549782423 - maskHigh := BitVec.ofNat 64 281613623689217 - systematicCode := BitVec.ofNat 64 16198247977346341390 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9592766539638784 - maskLow := BitVec.ofNat 64 9007203549782423 - maskHigh := BitVec.ofNat 64 360644110974977 - systematicCode := BitVec.ofNat 64 16203061686665157134 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9658737237305344 - maskLow := BitVec.ofNat 64 9007203549782423 - maskHigh := BitVec.ofNat 64 9007203549792257 - systematicCode := BitVec.ofNat 64 16915979373602609678 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11334392958035968 - maskLow := BitVec.ofNat 64 360644108951959 - maskHigh := BitVec.ofNat 64 9007203551805441 - systematicCode := BitVec.ofNat 64 16915990110046460430 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11338756644808704 - maskLow := BitVec.ofNat 64 281480479711639 - maskHigh := BitVec.ofNat 64 9007336693760001 - systematicCode := BitVec.ofNat 64 16918793864158321166 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11338761177032704 - maskLow := BitVec.ofNat 64 4611686023798268311 - maskHigh := BitVec.ofNat 64 576460890816118785 - systematicCode := BitVec.ofNat 64 17855572389428599310 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11334397490259968 - maskLow := BitVec.ofNat 64 4611756528905560471 - maskHigh := BitVec.ofNat 64 576531121049698305 - systematicCode := BitVec.ofNat 64 17860338772873976334 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9658741769529344 - maskLow := BitVec.ofNat 64 9007203549782423 - maskHigh := BitVec.ofNat 64 576531122121359393 - systematicCode := BitVec.ofNat 64 17860357607062706702 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11338761342697600 - maskLow := BitVec.ofNat 64 576460756734779799 - maskHigh := BitVec.ofNat 64 4611686156000559105 - systematicCode := BitVec.ofNat 64 18287911330715933198 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11334397655924864 - maskLow := BitVec.ofNat 64 576469690130440599 - maskHigh := BitVec.ofNat 64 4611694814522507265 - systematicCode := BitVec.ofNat 64 18290995461370812942 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9658741935194240 - maskLow := BitVec.ofNat 64 9007203549782423 - maskHigh := BitVec.ofNat 64 4611694814654629921 - systematicCode := BitVec.ofNat 64 18291007698590439950 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9592251112104064 - maskLow := BitVec.ofNat 64 9007203549782423 - maskHigh := BitVec.ofNat 64 5197154107426603009 - systematicCode := BitVec.ofNat 64 18300353771318483470 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x1a13. -/ -def normalizedWeightSixteenCandidateBucket_1a13 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18087520634012288 - maskLow := BitVec.ofNat 64 1163054608063472407 - maskHigh := BitVec.ofNat 64 290271203950593 - systematicCode := BitVec.ofNat 64 16201337342120958483 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9150690123448960 - maskLow := BitVec.ofNat 64 576460756598465303 - maskHigh := BitVec.ofNat 64 290271340527617 - systematicCode := BitVec.ofNat 64 16201340856361687571 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9360147088540288 - maskLow := BitVec.ofNat 64 576460756598465303 - maskHigh := BitVec.ofNat 64 299221915795457 - systematicCode := BitVec.ofNat 64 16202205180177291795 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36169672219035776 - maskLow := BitVec.ofNat 64 1152921510009185047 - maskHigh := BitVec.ofNat 64 36037593380421633 - systematicCode := BitVec.ofNat 64 17282204550449732115 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36047488989399168 - maskLow := BitVec.ofNat 64 1152994076669322007 - maskHigh := BitVec.ofNat 64 36046389339226113 - systematicCode := BitVec.ofNat 64 17283045677383948819 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2534374574786688 - maskLow := BitVec.ofNat 64 576460756598465303 - maskHigh := BitVec.ofNat 64 36046389473460737 - systematicCode := BitVec.ofNat 64 17283049131429206547 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148216223466112 - maskLow := BitVec.ofNat 64 576460756598465303 - maskHigh := BitVec.ofNat 64 144115205256003713 - systematicCode := BitVec.ofNat 64 17493287849237551635 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085046734029440 - maskLow := BitVec.ofNat 64 1196822701875991 - maskHigh := BitVec.ofNat 64 144115205389942785 - systematicCode := BitVec.ofNat 64 17493307394792299027 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18050137239847552 - maskLow := BitVec.ofNat 64 1125905284014871 - maskHigh := BitVec.ofNat 64 144123984169140225 - systematicCode := BitVec.ofNat 64 17498354152624822803 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2534378869751936 - maskLow := BitVec.ofNat 64 576460756598465303 - maskHigh := BitVec.ofNat 64 4611686155868439169 - systematicCode := BitVec.ofNat 64 18287899357828487699 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36047493284364416 - maskLow := BitVec.ofNat 64 9009952328852247 - maskHigh := BitVec.ofNat 64 4611686156000559105 - systematicCode := BitVec.ofNat 64 18287911283926702611 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36169676514001024 - maskLow := BitVec.ofNat 64 9007203591725847 - maskHigh := BitVec.ofNat 64 4611694814522507265 - systematicCode := BitVec.ofNat 64 18290995413503646227 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9360692549651072 - maskLow := BitVec.ofNat 64 576460756598465303 - maskHigh := BitVec.ofNat 64 4791838799749447681 - systematicCode := BitVec.ofNat 64 18298951941422979603 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x1a16. -/ -def normalizedWeightSixteenCandidateBucket_1a16 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10208042113181696 - maskLow := BitVec.ofNat 64 4647996294718105879 - maskHigh := BitVec.ofNat 64 283674033520641 - systematicCode := BitVec.ofNat 64 16200489631590980118 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9649490206271488 - maskLow := BitVec.ofNat 64 144115192370899223 - maskHigh := BitVec.ofNat 64 283675082162177 - systematicCode := BitVec.ofNat 64 16200499742800812566 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9592762278225920 - maskLow := BitVec.ofNat 64 144115192370899223 - maskHigh := BitVec.ofNat 64 352397805223937 - systematicCode := BitVec.ofNat 64 16203052890706876950 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11338748392794112 - maskLow := BitVec.ofNat 64 4611686023829727511 - maskHigh := BitVec.ofNat 64 36030997115961345 - systematicCode := BitVec.ofNat 64 17281363436939385366 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11334384706021376 - maskLow := BitVec.ofNat 64 4611758590489864471 - maskHigh := BitVec.ofNat 64 36099165796696065 - systematicCode := BitVec.ofNat 64 17283886816664099350 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9658728985290752 - maskLow := BitVec.ofNat 64 144115192370899223 - maskHigh := BitVec.ofNat 64 36099166836900353 - systematicCode := BitVec.ofNat 64 17283896854894025238 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9658732975892480 - maskLow := BitVec.ofNat 64 144115192370899223 - maskHigh := BitVec.ofNat 64 144115192370905217 - systematicCode := BitVec.ofNat 64 17492440125772339734 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11334388696623104 - maskLow := BitVec.ofNat 64 352397771745559 - maskHigh := BitVec.ofNat 64 144115192404377601 - systematicCode := BitVec.ofNat 64 17492459658442381846 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11338752383395840 - maskLow := BitVec.ofNat 64 281480353884439 - maskHigh := BitVec.ofNat 64 144117387099176961 - systematicCode := BitVec.ofNat 64 17497506416274905622 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9658750191681664 - maskLow := BitVec.ofNat 64 144115192370899223 - maskHigh := BitVec.ofNat 64 4611686568191591041 - systematicCode := BitVec.ofNat 64 18288747081293306390 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11334405912412288 - maskLow := BitVec.ofNat 64 36031550093076759 - maskHigh := BitVec.ofNat 64 4611686568216756225 - systematicCode := BitVec.ofNat 64 18288752423206853142 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11338769599185024 - maskLow := BitVec.ofNat 64 36028801355950359 - maskHigh := BitVec.ofNat 64 4611688217459032065 - systematicCode := BitVec.ofNat 64 18290154299993299478 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9592242855616640 - maskLow := BitVec.ofNat 64 144115192370899223 - maskHigh := BitVec.ofNat 64 4791832202579017729 - systematicCode := BitVec.ofNat 64 18298951928487549462 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x1a19. -/ -def normalizedWeightSixteenCandidateBucket_1a19 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.node - (.leaf - { patternClass := .d16Plus - affineCode := BitVec.ofNat 56 54397530333585664 - maskLow := BitVec.ofNat 64 17596749541655 - maskHigh := BitVec.ofNat 64 612489549322391553 - systematicCode := BitVec.ofNat 64 17865665751467956761 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9360147061278976 - maskLow := BitVec.ofNat 64 4611686022722433303 - maskHigh := BitVec.ofNat 64 283829692530689 - systematicCode := BitVec.ofNat 64 16200516330418084377 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9150690096187648 - maskLow := BitVec.ofNat 64 4611686022722433303 - maskHigh := BitVec.ofNat 64 351843756802049 - systematicCode := BitVec.ofNat 64 16203023109152578073 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18087520606750976 - maskLow := BitVec.ofNat 64 154248291532484887 - maskHigh := BitVec.ofNat 64 351844794630145 - systematicCode := BitVec.ofNat 64 16203032763281185305 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2534374606242048 - maskLow := BitVec.ofNat 64 4611686022722433303 - maskHigh := BitVec.ofNat 64 36030996075780097 - systematicCode := BitVec.ofNat 64 17281353663108618777 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36047489020854528 - maskLow := BitVec.ofNat 64 144141580649967895 - maskHigh := BitVec.ofNat 64 36030997115961345 - systematicCode := BitVec.ofNat 64 17281363398740089369 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36169672250491136 - maskLow := BitVec.ofNat 64 144115192773554455 - maskHigh := BitVec.ofNat 64 36099165796696065 - systematicCode := BitVec.ofNat 64 17283886777386867225 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2534378867654912 - maskLow := BitVec.ofNat 64 4611686022722433303 - maskHigh := BitVec.ofNat 64 576460889744478337 - systematicCode := BitVec.ofNat 64 17855553819371117081 }) - ) - ) - ) - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36047493282267392 - maskLow := BitVec.ofNat 64 9025345491644695 - maskHigh := BitVec.ofNat 64 576460890816118785 - systematicCode := BitVec.ofNat 64 17855572316869564953 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36169676511904000 - maskLow := BitVec.ofNat 64 9007203826610455 - maskHigh := BitVec.ofNat 64 576531121049698305 - systematicCode := BitVec.ofNat 64 17860338699237005849 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148216196204800 - maskLow := BitVec.ofNat 64 4611686022722433303 - maskHigh := BitVec.ofNat 64 1152921521786980481 - systematicCode := BitVec.ofNat 64 17925633387695708697 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085046706768128 - maskLow := BitVec.ofNat 64 1135250050724119 - maskHigh := BitVec.ofNat 64 1152921522860457985 - systematicCode := BitVec.ofNat 64 17925659555988970009 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18050137212586240 - maskLow := BitVec.ofNat 64 1125904344494359 - maskHigh := BitVec.ofNat 64 1152991873351286785 - systematicCode := BitVec.ofNat 64 17932388566611991065 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36169809689379072 - maskLow := BitVec.ofNat 64 8800522301719 - maskHigh := BitVec.ofNat 64 1188950301625812993 - systematicCode := BitVec.ofNat 64 17937722241682512409 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36169813950791936 - maskLow := BitVec.ofNat 64 554059264279 - maskHigh := BitVec.ofNat 64 1729382256910270593 - systematicCode := BitVec.ofNat 64 17939965210909219353 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9360692555942144 - maskLow := BitVec.ofNat 64 4611686022722433303 - maskHigh := BitVec.ofNat 64 1765481423747153921 - systematicCode := BitVec.ofNat 64 17940071371987753497 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x1c0d. -/ -def normalizedWeightSixteenCandidateBucket_1c0d : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18087520900301824 - maskLow := BitVec.ofNat 64 1441714835007029591 - maskHigh := BitVec.ofNat 64 282024740913153 - systematicCode := BitVec.ofNat 64 16199076746381892621 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9150690389738496 - maskLow := BitVec.ofNat 64 36028801314013527 - maskHigh := BitVec.ofNat 64 282025068199937 - systematicCode := BitVec.ofNat 64 16199089099463597069 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9360147354829824 - maskLow := BitVec.ofNat 64 36028801314013527 - maskHigh := BitVec.ofNat 64 303473807589377 - systematicCode := BitVec.ofNat 64 16202216166568893453 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148216488585216 - maskLow := BitVec.ofNat 64 36028801314013527 - maskHigh := BitVec.ofNat 64 18014407099557889 - systematicCode := BitVec.ofNat 64 17060377127577066509 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085046999148544 - maskLow := BitVec.ofNat 64 606934713581911 - maskHigh := BitVec.ofNat 64 18014407107805185 - systematicCode := BitVec.ofNat 64 17060390075895323661 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18050137504966656 - maskLow := BitVec.ofNat 64 562954919559511 - maskHigh := BitVec.ofNat 64 18014948265426945 - systematicCode := BitVec.ofNat 64 17063754580937350157 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36169672485520384 - maskLow := BitVec.ofNat 64 1152921509442961751 - maskHigh := BitVec.ofNat 64 576461302327672833 - systematicCode := BitVec.ofNat 64 17856413502905523213 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36047489255883776 - maskLow := BitVec.ofNat 64 1152956968151892311 - maskHigh := BitVec.ofNat 64 576478344497856513 - systematicCode := BitVec.ofNat 64 17859497633560402957 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2534374841271296 - maskLow := BitVec.ofNat 64 36028801314013527 - maskHigh := BitVec.ofNat 64 576478344757911617 - systematicCode := BitVec.ofNat 64 17859509875041508365 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36169672518812672 - maskLow := BitVec.ofNat 64 288230380585173335 - maskHigh := BitVec.ofNat 64 2305843559036616705 - systematicCode := BitVec.ofNat 64 18144639463763745805 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36047489289176064 - maskLow := BitVec.ofNat 64 288239451417690455 - maskHigh := BitVec.ofNat 64 2305847407268593665 - systematicCode := BitVec.ofNat 64 18146602092558294029 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2534374874563584 - maskLow := BitVec.ofNat 64 36028801314013527 - maskHigh := BitVec.ofNat 64 2305847407327316033 - systematicCode := BitVec.ofNat 64 18146609936059997197 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9360697077353472 - maskLow := BitVec.ofNat 64 36028801314013527 - maskHigh := BitVec.ofNat 64 2900318709790801921 - systematicCode := BitVec.ofNat 64 18156240795201313805 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x1c0e. -/ -def normalizedWeightSixteenCandidateBucket_1c0e : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10208046375764992 - maskLow := BitVec.ofNat 64 2882585240788877719 - maskHigh := BitVec.ofNat 64 281749858811905 - systematicCode := BitVec.ofNat 64 16198794176205233166 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9649494468854784 - maskLow := BitVec.ofNat 64 18014402804531607 - maskHigh := BitVec.ofNat 64 281750525771777 - systematicCode := BitVec.ofNat 64 16198808728276638734 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9592766540809216 - maskLow := BitVec.ofNat 64 18014402804531607 - maskHigh := BitVec.ofNat 64 325459740983297 - systematicCode := BitVec.ofNat 64 16202498736745421838 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9658737238475776 - maskLow := BitVec.ofNat 64 18014402804531607 - maskHigh := BitVec.ofNat 64 18014402804525057 - systematicCode := BitVec.ofNat 64 17060094553088662542 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11334392959206400 - maskLow := BitVec.ofNat 64 325459736871319 - maskHigh := BitVec.ofNat 64 18014402808643585 - systematicCode := BitVec.ofNat 64 17060107497112017934 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11338756645979136 - maskLow := BitVec.ofNat 64 281479942848919 - maskHigh := BitVec.ofNat 64 18014673387454465 - systematicCode := BitVec.ofNat 64 17063472002154044430 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11338761177926784 - maskLow := BitVec.ofNat 64 2305843014049808791 - maskHigh := BitVec.ofNat 64 576461027718201345 - systematicCode := BitVec.ofNat 64 17856133131735407630 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11334397491154048 - maskLow := BitVec.ofNat 64 2305878472758739351 - maskHigh := BitVec.ofNat 64 576495936679706625 - systematicCode := BitVec.ofNat 64 17859778013320453134 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9658741770423424 - maskLow := BitVec.ofNat 64 18014402804531607 - maskHigh := BitVec.ofNat 64 576495937212391489 - systematicCode := BitVec.ofNat 64 17859792449529781262 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11338761342307456 - maskLow := BitVec.ofNat 64 576460756736885143 - maskHigh := BitVec.ofNat 64 2305843284225818625 - systematicCode := BitVec.ofNat 64 18144359092593630222 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11334397655534720 - maskLow := BitVec.ofNat 64 576469827569402263 - maskHigh := BitVec.ofNat 64 2305851805310910465 - systematicCode := BitVec.ofNat 64 18146882472318344206 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9658741934804096 - maskLow := BitVec.ofNat 64 18014402804531607 - maskHigh := BitVec.ofNat 64 2305851805440936001 - systematicCode := BitVec.ofNat 64 18146892510548270094 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9592251113030656 - maskLow := BitVec.ofNat 64 18014402804531607 - maskHigh := BitVec.ofNat 64 2900318434908700673 - systematicCode := BitVec.ofNat 64 18156240790889503758 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x1c15. -/ -def normalizedWeightSixteenCandidateBucket_1c15 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18087520633963520 - maskLow := BitVec.ofNat 64 1171498857364800791 - maskHigh := BitVec.ofNat 64 290271203950593 - systematicCode := BitVec.ofNat 64 16201337342154382357 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9150690123400192 - maskLow := BitVec.ofNat 64 576460756598474007 - maskHigh := BitVec.ofNat 64 290271342493697 - systematicCode := BitVec.ofNat 64 16201340864918068245 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9360147088491520 - maskLow := BitVec.ofNat 64 576460756598474007 - maskHigh := BitVec.ofNat 64 299350764814337 - systematicCode := BitVec.ofNat 64 16202207370610613269 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36169672219182080 - maskLow := BitVec.ofNat 64 1152921509505877271 - maskHigh := BitVec.ofNat 64 36037593380421633 - systematicCode := BitVec.ofNat 64 17282204550416309269 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36047488989545472 - maskLow := BitVec.ofNat 64 1152961091320497431 - maskHigh := BitVec.ofNat 64 36046389339226113 - systematicCode := BitVec.ofNat 64 17283045677350525973 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2534374574932992 - maskLow := BitVec.ofNat 64 576460756598474007 - maskHigh := BitVec.ofNat 64 36046389473453057 - systematicCode := BitVec.ofNat 64 17283049122872826901 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148216222246912 - maskLow := BitVec.ofNat 64 576460756598474007 - maskHigh := BitVec.ofNat 64 288230384741785729 - systematicCode := BitVec.ofNat 64 17636837879746796565 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085046732810240 - maskLow := BitVec.ofNat 64 598688376374551 - maskHigh := BitVec.ofNat 64 288230384875864065 - systematicCode := BitVec.ofNat 64 17636859624291245077 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18050137238628352 - maskLow := BitVec.ofNat 64 562954793731351 - maskHigh := BitVec.ofNat 64 288239172244865025 - systematicCode := BitVec.ofNat 64 17642467133053934613 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2534378869638144 - maskLow := BitVec.ofNat 64 576460756598474007 - maskHigh := BitVec.ofNat 64 2305843284095796353 - systematicCode := BitVec.ofNat 64 18144349327319243797 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36047493284250624 - maskLow := BitVec.ofNat 64 18019350606857495 - maskHigh := BitVec.ofNat 64 2305843284225818625 - systematicCode := BitVec.ofNat 64 18144359054427757589 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36169676513887232 - maskLow := BitVec.ofNat 64 18014402880029975 - maskHigh := BitVec.ofNat 64 2305851805310910465 - systematicCode := BitVec.ofNat 64 18146882433074535445 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9360692549602304 - maskLow := BitVec.ofNat 64 576460756598474007 - maskHigh := BitVec.ofNat 64 2630110978611609601 - systematicCode := BitVec.ofNat 64 18155399703300545557 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x1c16. -/ -def normalizedWeightSixteenCandidateBucket_1c16 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10208042114352128 - maskLow := BitVec.ofNat 64 2342153285504420119 - maskHigh := BitVec.ofNat 64 285873090330625 - systematicCode := BitVec.ofNat 64 16201054771977722902 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9649490207441920 - maskLow := BitVec.ofNat 64 288230380446763287 - maskHigh := BitVec.ofNat 64 285873568546817 - systematicCode := BitVec.ofNat 64 16201060493731109910 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9592762279396352 - maskLow := BitVec.ofNat 64 288230380446763287 - maskHigh := BitVec.ofNat 64 317213466689537 - systematicCode := BitVec.ofNat 64 16202489940787141654 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11338748393688192 - maskLow := BitVec.ofNat 64 2305843014112725271 - maskHigh := BitVec.ofNat 64 36033195602345985 - systematicCode := BitVec.ofNat 64 17281924179246193686 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11334384706915456 - maskLow := BitVec.ofNat 64 2305882595927345431 - maskHigh := BitVec.ofNat 64 36063981458161665 - systematicCode := BitVec.ofNat 64 17283326057110576150 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9658728986184832 - maskLow := BitVec.ofNat 64 288230380446763287 - maskHigh := BitVec.ofNat 64 36063981927932929 - systematicCode := BitVec.ofNat 64 17283331697361099798 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9658732977062912 - maskLow := BitVec.ofNat 64 288230380446763287 - maskHigh := BitVec.ofNat 64 288230380446752897 - systematicCode := BitVec.ofNat 64 17636555305258392598 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11334388697793536 - maskLow := BitVec.ofNat 64 317213399664919 - maskHigh := BitVec.ofNat 64 288230380513787905 - systematicCode := BitVec.ofNat 64 17636577045507939350 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11338752384566272 - maskLow := BitVec.ofNat 64 281479817021719 - maskHigh := BitVec.ofNat 64 288234774198288385 - systematicCode := BitVec.ofNat 64 17642184554270628886 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9658750191291520 - maskLow := BitVec.ofNat 64 288230380446763287 - maskHigh := BitVec.ofNat 64 2305843558977897601 - systematicCode := BitVec.ofNat 64 18144631901807516694 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11334405912022144 - maskLow := BitVec.ofNat 64 36033749116340503 - maskHigh := BitVec.ofNat 64 2305843559036616705 - systematicCode := BitVec.ofNat 64 18144639434187807766 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11338769598794880 - maskLow := BitVec.ofNat 64 36028801389512983 - maskHigh := BitVec.ofNat 64 2305847407268593665 - systematicCode := BitVec.ofNat 64 18146602061904419862 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9592242856543232 - maskLow := BitVec.ofNat 64 288230380446763287 - maskHigh := BitVec.ofNat 64 2630106580497989633 - systematicCode := BitVec.ofNat 64 18155399698988735510 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x1c19. -/ -def normalizedWeightSixteenCandidateBucket_1c19 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9360147061441536 - maskLow := BitVec.ofNat 64 2305843013508747543 - maskHigh := BitVec.ofNat 64 286157027934209 - systematicCode := BitVec.ofNat 64 16201081470771141657 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9150690096350208 - maskLow := BitVec.ofNat 64 2305843013508747543 - maskHigh := BitVec.ofNat 64 316659420233729 - systematicCode := BitVec.ofNat 64 16202462366778661913 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18087520606913536 - maskLow := BitVec.ofNat 64 306807728909668631 - maskHigh := BitVec.ofNat 64 316659885670401 - systematicCode := BitVec.ofNat 64 16202467622927866905 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2534374606144512 - maskLow := BitVec.ofNat 64 2305843013508747543 - maskHigh := BitVec.ofNat 64 36033195132590081 - systematicCode := BitVec.ofNat 64 17281918812085165081 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36047489020756992 - maskLow := BitVec.ofNat 64 288256768725831959 - maskHigh := BitVec.ofNat 64 36033195602345985 - systematicCode := BitVec.ofNat 64 17281924158260190233 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36169672250393600 - maskLow := BitVec.ofNat 64 288230380849418519 - maskHigh := BitVec.ofNat 64 36063981458161665 - systematicCode := BitVec.ofNat 64 17283326035046636569 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2534378867557376 - maskLow := BitVec.ofNat 64 2305843013508747543 - maskHigh := BitVec.ofNat 64 576461027185528961 - systematicCode := BitVec.ofNat 64 17856118968347663385 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36047493282169856 - maskLow := BitVec.ofNat 64 18032544746393879 - maskHigh := BitVec.ofNat 64 576461027718201345 - systematicCode := BitVec.ofNat 64 17856133076389665817 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36169676511806464 - maskLow := BitVec.ofNat 64 18014403081359639 - maskHigh := BitVec.ofNat 64 576495936679706625 - systematicCode := BitVec.ofNat 64 17859777956896775193 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148216195196928 - maskLow := BitVec.ofNat 64 2305843013508747543 - maskHigh := BitVec.ofNat 64 1152921513196914817 - systematicCode := BitVec.ofNat 64 17925068238718901273 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085046705760256 - maskLow := BitVec.ofNat 64 572300097310999 - maskHigh := BitVec.ofNat 64 1152921513733652481 - systematicCode := BitVec.ofNat 64 17925094398422359065 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18050137211578368 - maskLow := BitVec.ofNat 64 562954391081239 - maskHigh := BitVec.ofNat 64 1152956688979066881 - systematicCode := BitVec.ofNat 64 17931823409045380121 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9360692555844608 - maskLow := BitVec.ofNat 64 2305843013508747543 - maskHigh := BitVec.ofNat 64 1765446238838194177 - systematicCode := BitVec.ofNat 64 17940071363364133913 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x1c1a. -/ -def normalizedWeightSixteenCandidateBucket_1c1a : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9592762379273216 - maskLow := BitVec.ofNat 64 1152921508901904663 - maskHigh := BitVec.ofNat 64 290825388949505 - systematicCode := BitVec.ofNat 64 16201364040947670042 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9649490307318784 - maskLow := BitVec.ofNat 64 1152921508901904663 - maskHigh := BitVec.ofNat 64 299067305426945 - systematicCode := BitVec.ofNat 64 16202181995591703578 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10208042214228992 - maskLow := BitVec.ofNat 64 612771028594155799 - maskHigh := BitVec.ofNat 64 299067431190529 - systematicCode := BitVec.ofNat 64 16202185052751207450 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9658729050688640 - maskLow := BitVec.ofNat 64 1152921508901904663 - maskHigh := BitVec.ofNat 64 36037593246210049 - systematicCode := BitVec.ofNat 64 17282201386573437978 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11334384771419264 - maskLow := BitVec.ofNat 64 576487144877547799 - maskHigh := BitVec.ofNat 64 36037593380421633 - systematicCode := BitVec.ofNat 64 17282204538020240410 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11338748458192000 - maskLow := BitVec.ofNat 64 576460757001134359 - maskHigh := BitVec.ofNat 64 36046389339226113 - systematicCode := BitVec.ofNat 64 17283045663876520986 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9658750091414656 - maskLow := BitVec.ofNat 64 1152921508901904663 - maskHigh := BitVec.ofNat 64 576461302067630209 - systematicCode := BitVec.ofNat 64 17856401542835936282 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11334405812145280 - maskLow := BitVec.ofNat 64 36046943255879959 - maskHigh := BitVec.ofNat 64 576461302327672833 - systematicCode := BitVec.ofNat 64 17856413456149715994 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11338769498918016 - maskLow := BitVec.ofNat 64 36028801590845719 - maskHigh := BitVec.ofNat 64 576478344497856513 - systematicCode := BitVec.ofNat 64 17859497585726659610 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9658733076939776 - maskLow := BitVec.ofNat 64 1152921508901904663 - maskHigh := BitVec.ofNat 64 1152921508901881985 - systematicCode := BitVec.ofNat 64 17924785664230497306 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11334388797670400 - maskLow := BitVec.ofNat 64 290825120604439 - maskHigh := BitVec.ofNat 64 1152921509170249729 - systematicCode := BitVec.ofNat 64 17924811819639053338 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11338752484443136 - maskLow := BitVec.ofNat 64 281479414374679 - maskHigh := BitVec.ofNat 64 1152939096792956929 - systematicCode := BitVec.ofNat 64 17931540830262074394 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9592242925208576 - maskLow := BitVec.ofNat 64 1152921508901904663 - maskHigh := BitVec.ofNat 64 1765428646383714305 - systematicCode := BitVec.ofNat 64 17940071359052323866 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x2307. -/ -def normalizedWeightSixteenCandidateBucket_2307 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .twoE8 - affineCode := BitVec.ofNat 56 18084907091787904 - maskLow := BitVec.ofNat 64 17596481995039 - maskHigh := BitVec.ofNat 64 1168231108609 - systematicCode := BitVec.ofNat 64 15044442059595653895 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085475940337792 - maskLow := BitVec.ofNat 64 864708724936343839 - maskHigh := BitVec.ofNat 64 1236950589441 - systematicCode := BitVec.ofNat 64 15045289913238430471 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148645429774464 - maskLow := BitVec.ofNat 64 35188667253023 - maskHigh := BitVec.ofNat 64 1237151911937 - systematicCode := BitVec.ofNat 64 15045319871222719239 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085456763979904 - maskLow := BitVec.ofNat 64 54060792009654559 - maskHigh := BitVec.ofNat 64 2267742740481 - systematicCode := BitVec.ofNat 64 15260618235928126215 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148626253416576 - maskLow := BitVec.ofNat 64 35188667253023 - maskHigh := BitVec.ofNat 64 2267755319297 - systematicCode := BitVec.ofNat 64 15260639397953610503 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18050274539374720 - maskLow := BitVec.ofNat 64 17599702434079 - maskHigh := BitVec.ofNat 64 2336462213121 - systematicCode := BitVec.ofNat 64 15261459267043795719 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9359738777405568 - maskLow := BitVec.ofNat 64 35188667253023 - maskHigh := BitVec.ofNat 64 3378867951640577 - systematicCode := BitVec.ofNat 64 16637933958408643335 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36099311808839808 - maskLow := BitVec.ofNat 64 612489562207486239 - maskHigh := BitVec.ofNat 64 4613937818241081345 - systematicCode := BitVec.ofNat 64 18295481469197558535 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9288820277149824 - maskLow := BitVec.ofNat 64 35188667253023 - maskHigh := BitVec.ofNat 64 4613937818383679491 - systematicCode := BitVec.ofNat 64 18295511396883571463 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36099311808841856 - maskLow := BitVec.ofNat 64 306244787546292511 - maskHigh := BitVec.ofNat 64 9224497936761626625 - systematicCode := BitVec.ofNat 64 18367257583947031303 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9288820277151872 - maskLow := BitVec.ofNat 64 35188667253023 - maskHigh := BitVec.ofNat 64 9224497936832921603 - systematicCode := BitVec.ofNat 64 18367286412138193671 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9359743105925248 - maskLow := BitVec.ofNat 64 35188667253023 - maskHigh := BitVec.ofNat 64 13835060391744380929 - systematicCode := BitVec.ofNat 64 18374074926179754759 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x230b. -/ -def normalizedWeightSixteenCandidateBucket_230b : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .twoE8 - affineCode := BitVec.ofNat 56 18084906846257280 - maskLow := BitVec.ofNat 64 4402344821047 - maskHigh := BitVec.ofNat 64 1116691497985 - systematicCode := BitVec.ofNat 64 15043311744529801995 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085475961145472 - maskLow := BitVec.ofNat 64 3458768916162216247 - maskHigh := BitVec.ofNat 64 1133871368193 - systematicCode := BitVec.ofNat 64 15044159632531792651 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148645450582144 - maskLow := BitVec.ofNat 64 8800388186423 - maskHigh := BitVec.ofNat 64 1134676673537 - systematicCode := BitVec.ofNat 64 15044198386474885899 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085456634972288 - maskLow := BitVec.ofNat 64 54047597870121271 - maskHigh := BitVec.ofNat 64 2216203126785 - systematicCode := BitVec.ofNat 64 15259487937974510347 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148626124408960 - maskLow := BitVec.ofNat 64 8800388186423 - maskHigh := BitVec.ofNat 64 2216215708673 - systematicCode := BitVec.ofNat 64 15259513497979396875 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18050274410367104 - maskLow := BitVec.ofNat 64 4405562900791 - maskHigh := BitVec.ofNat 64 2233382994945 - systematicCode := BitVec.ofNat 64 15260328951910572811 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9359738798213248 - maskLow := BitVec.ofNat 64 8800388186423 - maskHigh := BitVec.ofNat 64 13511915573610497 - systematicCode := BitVec.ofNat 64 16927290217219957515 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36099311796355200 - maskLow := BitVec.ofNat 64 2341871819117756727 - maskHigh := BitVec.ofNat 64 4620693217682130945 - systematicCode := BitVec.ofNat 64 18296602988237759243 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9288820264665216 - maskLow := BitVec.ofNat 64 8800388186423 - maskHigh := BitVec.ofNat 64 4620693218227388419 - systematicCode := BitVec.ofNat 64 18296641694836663051 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36099311796357248 - maskLow := BitVec.ofNat 64 1170935916001427767 - maskHigh := BitVec.ofNat 64 9227875636482148353 - systematicCode := BitVec.ofNat 64 18368379102987232011 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9288820264667264 - maskLow := BitVec.ofNat 64 8800388186423 - maskHigh := BitVec.ofNat 64 9227875636754776067 - systematicCode := BitVec.ofNat 64 18368416710091285259 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9359743093440640 - maskLow := BitVec.ofNat 64 8800388186423 - maskHigh := BitVec.ofNat 64 13835060288665159681 - systematicCode := BitVec.ofNat 64 18374074908932514571 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x2313. -/ -def normalizedWeightSixteenCandidateBucket_2313 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .twoE8 - affineCode := BitVec.ofNat 56 18084905248227456 - maskLow := BitVec.ofNat 64 279223403287 - maskHigh := BitVec.ofNat 64 85899345985 - systematicCode := BitVec.ofNat 64 14466842161908359955 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085459448170624 - maskLow := BitVec.ofNat 64 3458764792993612567 - maskHigh := BitVec.ofNat 64 103079215233 - systematicCode := BitVec.ofNat 64 14467690084134822675 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148628937607296 - maskLow := BitVec.ofNat 64 554050978583 - maskHigh := BitVec.ofNat 64 103884521537 - systematicCode := BitVec.ofNat 64 14467737634036720403 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085459298355328 - maskLow := BitVec.ofNat 64 864691407628206871 - maskHigh := BitVec.ofNat 64 154618822785 - systematicCode := BitVec.ofNat 64 14683018424071496467 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148628787792000 - maskLow := BitVec.ofNat 64 554050978583 - maskHigh := BitVec.ofNat 64 154820149313 - systematicCode := BitVec.ofNat 64 14683061575993991955 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18050274943043712 - maskLow := BitVec.ofNat 64 282394297111 - maskHigh := BitVec.ofNat 64 171798691905 - systematicCode := BitVec.ofNat 64 14683859369154388755 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9359735069476992 - maskLow := BitVec.ofNat 64 554050978583 - maskHigh := BitVec.ofNat 64 216172868013129857 - systematicCode := BitVec.ofNat 64 17505993973109302035 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36099303806206080 - maskLow := BitVec.ofNat 64 2882303774402216727 - maskHigh := BitVec.ofNat 64 4755801206503243905 - systematicCode := BitVec.ofNat 64 18298845992092640019 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9288812274516096 - maskLow := BitVec.ofNat 64 554050978583 - maskHigh := BitVec.ofNat 64 4755801207174332419 - systematicCode := BitVec.ofNat 64 18298893529009562387 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36099303806208128 - maskLow := BitVec.ofNat 64 1441151893643658007 - maskHigh := BitVec.ofNat 64 9295429630892703873 - systematicCode := BitVec.ofNat 64 18370622106842112787 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9288812274518144 - maskLow := BitVec.ofNat 64 554050978583 - maskHigh := BitVec.ofNat 64 9295429631228248067 - systematicCode := BitVec.ofNat 64 18370668544264184595 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9359735103291520 - maskLow := BitVec.ofNat 64 554050978583 - maskHigh := BitVec.ofNat 64 13835058227080855681 - systematicCode := BitVec.ofNat 64 18374066112704750355 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x231c. -/ -def normalizedWeightSixteenCandidateBucket_231c : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.node - (.leaf - { patternClass := .twoE8 - affineCode := BitVec.ofNat 56 18032063728713856 - maskLow := BitVec.ofNat 64 844437815247127 - maskHigh := BitVec.ofNat 64 5185 - systematicCode := BitVec.ofNat 64 10994566944484696860 }) - (.leaf - { patternClass := .twoE8 - affineCode := BitVec.ofNat 56 2392610335228032 - maskLow := BitVec.ofNat 64 22269405643031 - maskHigh := BitVec.ofNat 64 196611 - systematicCode := BitVec.ofNat 64 11718792120789377820 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18102982377867392 - maskLow := BitVec.ofNat 64 3458764526705656087 - maskHigh := BitVec.ofNat 64 6273 - systematicCode := BitVec.ofNat 64 10995414771431580444 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18102982228052096 - maskLow := BitVec.ofNat 64 864691141340250391 - maskHigh := BitVec.ofNat 64 9345 - systematicCode := BitVec.ofNat 64 11210743111368254236 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18102980097345664 - maskLow := BitVec.ofNat 64 54043208413561111 - maskHigh := BitVec.ofNat 64 10305 - systematicCode := BitVec.ofNat 64 11211584203269546780 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10274422947840640 - maskLow := BitVec.ofNat 64 2882304040690204951 - maskHigh := BitVec.ofNat 64 4325505 - systematicCode := BitVec.ofNat 64 12511720470922142492 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11400322854684928 - maskLow := BitVec.ofNat 64 1441152159931646231 - maskHigh := BitVec.ofNat 64 8454273 - systematicCode := BitVec.ofNat 64 12583496585671615260 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11400357214423168 - maskLow := BitVec.ofNat 64 44259638198551 - maskHigh := BitVec.ofNat 64 12582915 - systematicCode := BitVec.ofNat 64 12586860961900274460 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10274425078547072 - maskLow := BitVec.ofNat 64 2341876208574349591 - maskHigh := BitVec.ofNat 64 67241985 - systematicCode := BitVec.ofNat 64 13088190019184894748 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18102948018129152 - maskLow := BitVec.ofNat 64 2306159672857674007 - maskHigh := BitVec.ofNat 64 71307265 - systematicCode := BitVec.ofNat 64 13091287343222694684 }) - ) - ) - ) - ) - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11400324985391360 - maskLow := BitVec.ofNat 64 1170940305458020631 - maskHigh := BitVec.ofNat 64 134285313 - systematicCode := BitVec.ofNat 64 13159966133934367516 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18094151925105280 - maskLow := BitVec.ofNat 64 1153519643227537687 - maskHigh := BitVec.ofNat 64 142610433 - systematicCode := BitVec.ofNat 64 13163626407959143196 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11400359345129600 - maskLow := BitVec.ofNat 64 40136469594391 - maskHigh := BitVec.ofNat 64 201326595 - systematicCode := BitVec.ofNat 64 13165573513967248156 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10274425228362368 - maskLow := BitVec.ofNat 64 612507145803612439 - maskHigh := BitVec.ofNat 64 268574721 - systematicCode := BitVec.ofNat 64 13376424776203510556 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18102947868313856 - maskLow := BitVec.ofNat 64 576751027668336919 - maskHigh := BitVec.ofNat 64 272630785 - systematicCode := BitVec.ofNat 64 13379513304147763996 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18102945737607424 - maskLow := BitVec.ofNat 64 36310826046669079 - maskHigh := BitVec.ofNat 64 335544385 - systematicCode := BitVec.ofNat 64 13381756273508164380 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11400325135206656 - maskLow := BitVec.ofNat 64 306262371142418711 - maskHigh := BitVec.ofNat 64 536944641 - systematicCode := BitVec.ofNat 64 13448200890952983324 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18094151775289984 - maskLow := BitVec.ofNat 64 288802126493335831 - maskHigh := BitVec.ofNat 64 545260545 - systematicCode := BitVec.ofNat 64 13451852368884212508 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18094149644583552 - maskLow := BitVec.ofNat 64 18577902513897751 - maskHigh := BitVec.ofNat 64 671088705 - systematicCode := BitVec.ofNat 64 13454095338244612892 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11400359494944896 - maskLow := BitVec.ofNat 64 26942330061079 - maskHigh := BitVec.ofNat 64 805306371 - systematicCode := BitVec.ofNat 64 13454929777191232284 }) - ) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x231f. -/ -def normalizedWeightSixteenCandidateBucket_231f : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11329994895919232 - maskLow := BitVec.ofNat 64 39861591703831 - maskHigh := BitVec.ofNat 64 3377699720527875 - systematicCode := BitVec.ofNat 64 16637848826669703967 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9095787268278400 - maskLow := BitVec.ofNat 64 12885131543 - maskHigh := BitVec.ofNat 64 3377699720537153 - systematicCode := BitVec.ofNat 64 16637875460700840735 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18050172400699648 - maskLow := BitVec.ofNat 64 281337364759 - maskHigh := BitVec.ofNat 64 5629499534213185 - systematicCode := BitVec.ofNat 64 16854031439592760095 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18050171863827072 - maskLow := BitVec.ofNat 64 280280400151 - maskHigh := BitVec.ofNat 64 11258999068426305 - systematicCode := BitVec.ofNat 64 16926370508590687007 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11329995045734528 - maskLow := BitVec.ofNat 64 26667452170519 - maskHigh := BitVec.ofNat 64 13510798882111491 - systematicCode := BitVec.ofNat 64 16927205089893688095 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9095787418093696 - maskLow := BitVec.ofNat 64 12885131543 - maskHigh := BitVec.ofNat 64 13510798882117697 - systematicCode := BitVec.ofNat 64 16927228451109413663 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18050171335346432 - maskLow := BitVec.ofNat 64 4404490240279 - maskHigh := BitVec.ofNat 64 73183493944771585 - systematicCode := BitVec.ofNat 64 17430501022348419871 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18050171460192512 - maskLow := BitVec.ofNat 64 17598628987159 - maskHigh := BitVec.ofNat 64 76561193665302529 - systematicCode := BitVec.ofNat 64 17431631337481380639 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18050171331150464 - maskLow := BitVec.ofNat 64 4403417547031 - maskHigh := BitVec.ofNat 64 146366987889542145 - systematicCode := BitVec.ofNat 64 17502840091346346783 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18050171460158080 - maskLow := BitVec.ofNat 64 17597555507479 - maskHigh := BitVec.ofNat 64 153122387330600961 - systematicCode := BitVec.ofNat 64 17503970406479307551 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11330007829973120 - maskLow := BitVec.ofNat 64 22544283566359 - maskHigh := BitVec.ofNat 64 216172782113783811 - systematicCode := BitVec.ofNat 64 17505917641960661791 }) - ) - ) - ) - ) - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9095800202332288 - maskLow := BitVec.ofNat 64 12885131543 - maskHigh := BitVec.ofNat 64 216172782113789057 - systematicCode := BitVec.ofNat 64 17505940990391952159 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36170119700938880 - maskLow := BitVec.ofNat 64 35188702937367 - maskHigh := BitVec.ofNat 64 4613937818241081345 - systematicCode := BitVec.ofNat 64 18295481352225170207 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36170119713423488 - maskLow := BitVec.ofNat 64 8800422297879 - maskHigh := BitVec.ofNat 64 4620693217682130945 - systematicCode := BitVec.ofNat 64 18296602836905370399 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36170120778776704 - maskLow := BitVec.ofNat 64 554053632279 - maskHigh := BitVec.ofNat 64 4755801206503243905 - systematicCode := BitVec.ofNat 64 18298845806132077343 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9024877407371392 - maskLow := BitVec.ofNat 64 12885131543 - maskHigh := BitVec.ofNat 64 4767060205571670019 - systematicCode := BitVec.ofNat 64 18298946511725339423 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36170122926358784 - maskLow := BitVec.ofNat 64 35188685111575 - maskHigh := BitVec.ofNat 64 9224497936761626625 - systematicCode := BitVec.ofNat 64 18367257471269544735 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36170122934681856 - maskLow := BitVec.ofNat 64 8800405258519 - maskHigh := BitVec.ofNat 64 9227875636482148353 - systematicCode := BitVec.ofNat 64 18368378955949744927 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36170120803975424 - maskLow := BitVec.ofNat 64 554052321559 - maskHigh := BitVec.ofNat 64 9295429630892703873 - systematicCode := BitVec.ofNat 64 18370621925176451871 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9024877407373440 - maskLow := BitVec.ofNat 64 12885131543 - maskHigh := BitVec.ofNat 64 9301059130426916867 - systematicCode := BitVec.ofNat 64 18370721526979961631 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11330007863787648 - maskLow := BitVec.ofNat 64 44534516121879 - maskHigh := BitVec.ofNat 64 13835058055282163715 - systematicCode := BitVec.ofNat 64 18373986483071558431 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9095800236146816 - maskLow := BitVec.ofNat 64 12885131543 - maskHigh := BitVec.ofNat 64 13835058055282174081 - systematicCode := BitVec.ofNat 64 18374013129987400479 }) - ) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x2507. -/ -def normalizedWeightSixteenCandidateBucket_2507 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085475940321536 - maskLow := BitVec.ofNat 64 720593536860619039 - maskHigh := BitVec.ofNat 64 1374389551105 - systematicCode := BitVec.ofNat 64 15045855062181553415 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148645429758208 - maskLow := BitVec.ofNat 64 70373039472927 - maskHigh := BitVec.ofNat 64 1374557310977 - systematicCode := BitVec.ofNat 64 15045882812586337543 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085456763963648 - maskLow := BitVec.ofNat 64 45053592755044639 - maskHigh := BitVec.ofNat 64 4466766004225 - systematicCode := BitVec.ofNat 64 15404735622993683719 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148626253400320 - maskLow := BitVec.ofNat 64 70373039472927 - maskHigh := BitVec.ofNat 64 4466776477697 - systematicCode := BitVec.ofNat 64 15404754577439663367 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18050274539358464 - maskLow := BitVec.ofNat 64 17599165694239 - maskHigh := BitVec.ofNat 64 4672924422145 - systematicCode := BitVec.ofNat 64 15406137405072942343 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9359738777389312 - maskLow := BitVec.ofNat 64 70373039472927 - maskHigh := BitVec.ofNat 64 2815917998227457 - systematicCode := BitVec.ofNat 64 16637371008488908039 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36099311808823552 - maskLow := BitVec.ofNat 64 612489570797551903 - maskHigh := BitVec.ofNat 64 2308094809027395585 - systematicCode := BitVec.ofNat 64 18151368480145089799 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9288820277133568 - maskLow := BitVec.ofNat 64 70373039472927 - maskHigh := BitVec.ofNat 64 2308094809169985541 - systematicCode := BitVec.ofNat 64 18151396208841401607 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36099311809085696 - maskLow := BitVec.ofNat 64 153122408805761311 - maskHigh := BitVec.ofNat 64 9223934986808213505 - systematicCode := BitVec.ofNat 64 18366696824393508103 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9288820277395712 - maskLow := BitVec.ofNat 64 70373039472927 - maskHigh := BitVec.ofNat 64 9223934986843848709 - systematicCode := BitVec.ofNat 64 18366721254605268231 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9359743105648896 - maskLow := BitVec.ofNat 64 70373039472927 - maskHigh := BitVec.ofNat 64 11529219718992904193 - systematicCode := BitVec.ofNat 64 18373514183873209607 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x250d. -/ -def normalizedWeightSixteenCandidateBucket_250d : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .twoE8 - affineCode := BitVec.ofNat 56 18084906844322816 - maskLow := BitVec.ofNat 64 2203323793751 - maskHigh := BitVec.ofNat 64 1108101562881 - systematicCode := BitVec.ofNat 64 15042746586996745485 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085475961291776 - maskLow := BitVec.ofNat 64 5764609726352785751 - maskHigh := BitVec.ofNat 64 1133871368193 - systematicCode := BitVec.ofNat 64 15044159641121596685 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148645450728448 - maskLow := BitVec.ofNat 64 8800388317527 - maskHigh := BitVec.ofNat 64 1135213543937 - systematicCode := BitVec.ofNat 64 15044200585464587533 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085456633948160 - maskLow := BitVec.ofNat 64 45038199592255831 - maskHigh := BitVec.ofNat 64 4406636447745 - systematicCode := BitVec.ofNat 64 15403040176063259917 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148626123384832 - maskLow := BitVec.ofNat 64 8800388317527 - maskHigh := BitVec.ofNat 64 4406646931969 - systematicCode := BitVec.ofNat 64 15403065727478342925 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18050274409342976 - maskLow := BitVec.ofNat 64 2206002905431 - maskHigh := BitVec.ofNat 64 4432406249985 - systematicCode := BitVec.ofNat 64 15404441932373107981 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9359738798359552 - maskLow := BitVec.ofNat 64 8800388317527 - maskHigh := BitVec.ofNat 64 22519106238416897 - systematicCode := BitVec.ofNat 64 17071405396705879309 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36099311796241408 - maskLow := BitVec.ofNat 64 4647714836921516375 - maskHigh := BitVec.ofNat 64 2323857407723177985 - systematicCode := BitVec.ofNat 64 18153050758705390861 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9288820264551424 - maskLow := BitVec.ofNat 64 8800388317527 - maskHigh := BitVec.ofNat 64 2323857408805306373 - systematicCode := BitVec.ofNat 64 18153091655771038989 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36099311796503552 - maskLow := BitVec.ofNat 64 1161928725336752471 - maskHigh := BitVec.ofNat 64 9227875636482148353 - systematicCode := BitVec.ofNat 64 18368379102953809165 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9288820264813568 - maskLow := BitVec.ofNat 64 8800388317527 - maskHigh := BitVec.ofNat 64 9227875636752678917 - systematicCode := BitVec.ofNat 64 18368416701534905613 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9359743093066752 - maskLow := BitVec.ofNat 64 8800388317527 - maskHigh := BitVec.ofNat 64 11529219478474721281 - systematicCode := BitVec.ofNat 64 18373514158002349325 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x2515. -/ -def normalizedWeightSixteenCandidateBucket_2515 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .twoE8 - affineCode := BitVec.ofNat 56 18084905246292992 - maskLow := BitVec.ofNat 64 141818135831 - maskHigh := BitVec.ofNat 64 77309411361 - systematicCode := BitVec.ofNat 64 14466277004375303445 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085459448316928 - maskLow := BitVec.ofNat 64 5764607664768484631 - maskHigh := BitVec.ofNat 64 103079215233 - systematicCode := BitVec.ofNat 64 14467690092724626709 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148628937753600 - maskLow := BitVec.ofNat 64 554051110167 - maskHigh := BitVec.ofNat 64 104421392417 - systematicCode := BitVec.ofNat 64 14467739833026422037 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085459297331200 - maskLow := BitVec.ofNat 64 720576082113529111 - maskHigh := BitVec.ofNat 64 283467841665 - systematicCode := BitVec.ofNat 64 14826570662160246037 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148628786767872 - maskLow := BitVec.ofNat 64 554051110167 - maskHigh := BitVec.ofNat 64 283635613729 - systematicCode := BitVec.ofNat 64 14826613805492938005 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18050274942019584 - maskLow := BitVec.ofNat 64 144418604311 - maskHigh := BitVec.ofNat 64 309237645345 - systematicCode := BitVec.ofNat 64 14827972349616923925 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9359735069623296 - maskLow := BitVec.ofNat 64 554051110167 - maskHigh := BitVec.ofNat 64 360288047499051137 - systematicCode := BitVec.ofNat 64 17650109152595223829 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36099303806092288 - maskLow := BitVec.ofNat 64 5188146792205976855 - maskHigh := BitVec.ofNat 64 2594073385365405825 - systematicCode := BitVec.ofNat 64 18155293762560271637 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9288812274402304 - maskLow := BitVec.ofNat 64 554051110167 - maskHigh := BitVec.ofNat 64 2594073386573365253 - systematicCode := BitVec.ofNat 64 18155343489943938325 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36099303806354432 - maskLow := BitVec.ofNat 64 1297036714157868311 - maskHigh := BitVec.ofNat 64 9295429630892703873 - systematicCode := BitVec.ofNat 64 18370622106808689941 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9288812274664448 - maskLow := BitVec.ofNat 64 554051110167 - maskHigh := BitVec.ofNat 64 9295429631194693637 - systematicCode := BitVec.ofNat 64 18370668535707804949 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9359735102917632 - maskLow := BitVec.ofNat 64 554051110167 - maskHigh := BitVec.ofNat 64 11529215355306115201 - systematicCode := BitVec.ofNat 64 18373505361774585109 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x251a. -/ -def normalizedWeightSixteenCandidateBucket_251a : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.node - (.leaf - { patternClass := .twoE8 - affineCode := BitVec.ofNat 56 18032063726779392 - maskLow := BitVec.ofNat 64 1407396358725911 - maskHigh := BitVec.ofNat 64 4641 - systematicCode := BitVec.ofNat 64 10994001804098086170 }) - (.leaf - { patternClass := .twoE8 - affineCode := BitVec.ofNat 56 2392610333293568 - maskLow := BitVec.ofNat 64 19932943556887 - maskHigh := BitVec.ofNat 64 327685 - systematicCode := BitVec.ofNat 64 11862909507854804250 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18102982378013696 - maskLow := BitVec.ofNat 64 5764607544509407511 - maskHigh := BitVec.ofNat 64 6273 - systematicCode := BitVec.ofNat 64 10995414780021646618 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18102982227027968 - maskLow := BitVec.ofNat 64 720575961854451991 - maskHigh := BitVec.ofNat 64 17025 - systematicCode := BitVec.ofNat 64 11354295349457265946 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18102980096321536 - maskLow := BitVec.ofNat 64 45036017748877591 - maskHigh := BitVec.ofNat 64 18465 - systematicCode := BitVec.ofNat 64 11355697192288724250 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10274422946621440 - maskLow := BitVec.ofNat 64 5188146912465068311 - maskHigh := BitVec.ofNat 64 2359425 - systematicCode := BitVec.ofNat 64 12368168241389511962 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11400322853677056 - maskLow := BitVec.ofNat 64 1297036834416959767 - maskHigh := BitVec.ofNat 64 8454273 - systematicCode := BitVec.ofNat 64 12583496585637930266 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11400357213399040 - maskLow := BitVec.ofNat 64 79306571456791 - maskHigh := BitVec.ofNat 64 10485765 - systematicCode := BitVec.ofNat 64 12586300219559912730 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10274425077327872 - maskLow := BitVec.ofNat 64 4647717018764910871 - maskHigh := BitVec.ofNat 64 33818625 - systematicCode := BitVec.ofNat 64 12944637789652264218 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18102948018291712 - maskLow := BitVec.ofNat 64 4612037866443579671 - maskHigh := BitVec.ofNat 64 35655681 - systematicCode := BitVec.ofNat 64 12946609213783483674 }) - ) - ) - ) - ) - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11400324984383488 - maskLow := BitVec.ofNat 64 1161930907180146967 - maskHigh := BitVec.ofNat 64 134285313 - systematicCode := BitVec.ofNat 64 13159966133900682522 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18094151925056512 - maskLow := BitVec.ofNat 64 1154117777553170711 - maskHigh := BitVec.ofNat 64 142610433 - systematicCode := BitVec.ofNat 64 13163626407992829210 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11400359344105472 - maskLow := BitVec.ofNat 64 73121818550551 - maskHigh := BitVec.ofNat 64 167772165 - systematicCode := BitVec.ofNat 64 13165012771593463066 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10274425228313600 - maskLow := BitVec.ofNat 64 612507145803735319 - maskHigh := BitVec.ofNat 64 268713985 - systematicCode := BitVec.ofNat 64 13376989925180187930 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18102947867305984 - maskLow := BitVec.ofNat 64 576751027668459799 - maskHigh := BitVec.ofNat 64 270533121 - systematicCode := BitVec.ofNat 64 13378948155171087642 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18102945736599552 - maskLow := BitVec.ofNat 64 36310826046791959 - maskHigh := BitVec.ofNat 64 301989921 - systematicCode := BitVec.ofNat 64 13381191124531488026 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11400325135369216 - maskLow := BitVec.ofNat 64 153139983811944727 - maskHigh := BitVec.ofNat 64 1073823745 - systematicCode := BitVec.ofNat 64 13592318269428606234 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18094151774070784 - maskLow := BitVec.ofNat 64 145249888371024151 - maskHigh := BitVec.ofNat 64 1082130945 - systematicCode := BitVec.ofNat 64 13595965349380433178 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18094149643364352 - maskLow := BitVec.ofNat 64 10133653212700951 - maskHigh := BitVec.ofNat 64 1207959585 - systematicCode := BitVec.ofNat 64 13598208318740833562 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11400359495091200 - maskLow := BitVec.ofNat 64 26942330183959 - maskHigh := BitVec.ofNat 64 1342177285 - systematicCode := BitVec.ofNat 64 13599047164290344218 }) - ) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x251f. -/ -def normalizedWeightSixteenCandidateBucket_251f : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11329994894895104 - maskLow := BitVec.ofNat 64 72709501714711 - maskHigh := BitVec.ofNat 64 2814749767106565 - systematicCode := BitVec.ofNat 64 16637288084295787807 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9095787267254272 - maskLow := BitVec.ofNat 64 21475197207 - maskHigh := BitVec.ofNat 64 2814749767123489 - systematicCode := BitVec.ofNat 64 16637314701147317535 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18050172399691776 - maskLow := BitVec.ofNat 64 143898542359 - maskHigh := BitVec.ofNat 64 5066549580791841 - systematicCode := BitVec.ofNat 64 16853466282026149151 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18050171862607872 - maskLow := BitVec.ofNat 64 142338261271 - maskHigh := BitVec.ofNat 64 20266198323167265 - systematicCode := BitVec.ofNat 64 17070483489019929887 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11329995045880832 - maskLow := BitVec.ofNat 64 26530013348119 - maskHigh := BitVec.ofNat 64 22517998136852485 - systematicCode := BitVec.ofNat 64 17071322476992668959 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9095787418240000 - maskLow := BitVec.ofNat 64 21475197207 - maskHigh := BitVec.ofNat 64 22517998136858657 - systematicCode := BitVec.ofNat 64 17071343639151846687 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18050171334338560 - maskLow := BitVec.ofNat 64 2205467115799 - maskHigh := BitVec.ofNat 64 72620543991349761 - systematicCode := BitVec.ofNat 64 17429935864781808927 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18050171329931264 - maskLow := BitVec.ofNat 64 2203859648791 - maskHigh := BitVec.ofNat 64 290482175965397505 - systematicCode := BitVec.ofNat 64 17646953071775589663 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18050171459946752 - maskLow := BitVec.ofNat 64 17597018767639 - maskHigh := BitVec.ofNat 64 306244774661197825 - systematicCode := BitVec.ofNat 64 17648648544475030815 }) - ) - ) - ) - ) - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11330007830119424 - maskLow := BitVec.ofNat 64 20345260441879 - maskHigh := BitVec.ofNat 64 360287970189639685 - systematicCode := BitVec.ofNat 64 17650035029026219295 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9095800202478592 - maskLow := BitVec.ofNat 64 21475197207 - maskHigh := BitVec.ofNat 64 360287970189644417 - systematicCode := BitVec.ofNat 64 17650056169878005023 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36170119700825088 - maskLow := BitVec.ofNat 64 70373110808855 - maskHigh := BitVec.ofNat 64 2308094809027395585 - systematicCode := BitVec.ofNat 64 18151368371796190495 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36170119713407232 - maskLow := BitVec.ofNat 64 8800455983383 - maskHigh := BitVec.ofNat 64 2323857407723177985 - systematicCode := BitVec.ofNat 64 18153050598816490783 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36170120778760448 - maskLow := BitVec.ofNat 64 554055860503 - maskHigh := BitVec.ofNat 64 2594073385365405825 - systematicCode := BitVec.ofNat 64 18155293568043197727 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9024877407257600 - maskLow := BitVec.ofNat 64 21475197207 - maskHigh := BitVec.ofNat 64 2614339583688572933 - systematicCode := BitVec.ofNat 64 18155396472659846431 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36170122926261248 - maskLow := BitVec.ofNat 64 70373057331479 - maskHigh := BitVec.ofNat 64 9223934986808213505 - systematicCode := BitVec.ofNat 64 18366696728929314079 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9024877407519744 - maskLow := BitVec.ofNat 64 21475197207 - maskHigh := BitVec.ofNat 64 9300496180473495557 - systematicCode := BitVec.ofNat 64 18370721518423713055 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11330007863413760 - maskLow := BitVec.ofNat 64 79718888341783 - maskHigh := BitVec.ofNat 64 11529215046068469765 - systematicCode := BitVec.ofNat 64 18373425740731327775 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9095800235772928 - maskLow := BitVec.ofNat 64 21475197207 - maskHigh := BitVec.ofNat 64 11529215046068488321 - systematicCode := BitVec.ofNat 64 18373452379057366303 }) - ) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x2523. -/ -def normalizedWeightSixteenCandidateBucket_2523 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .d16Plus - affineCode := BitVec.ofNat 56 54397257743638656 - maskLow := BitVec.ofNat 64 281479289962775 - maskHigh := BitVec.ofNat 64 9223512774343196673 - systematicCode := BitVec.ofNat 64 18365575244248851747 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9359635698223360 - maskLow := BitVec.ofNat 64 1152921508902273303 - maskHigh := BitVec.ofNat 64 2253002672963585 - systematicCode := BitVec.ofNat 64 16632014184015013155 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9288717197967616 - maskLow := BitVec.ofNat 64 1152921508902273303 - maskHigh := BitVec.ofNat 64 2392537444712449 - systematicCode := BitVec.ofNat 64 16636216409679537443 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36099208729657600 - maskLow := BitVec.ofNat 64 612771028594524439 - maskHigh := BitVec.ofNat 64 2392537570476033 - systematicCode := BitVec.ofNat 64 16636219466839041315 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148542350592256 - maskLow := BitVec.ofNat 64 1152921508902273303 - maskHigh := BitVec.ofNat 64 4504699273222145 - systematicCode := BitVec.ofNat 64 16848166972485608739 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085372861155584 - maskLow := BitVec.ofNat 64 576487144877916439 - maskHigh := BitVec.ofNat 64 4504699407433729 - systematicCode := BitVec.ofNat 64 16848170123932411171 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36169573178867968 - maskLow := BitVec.ofNat 64 576460758763110679 - maskHigh := BitVec.ofNat 64 4644337249943553 - systematicCode := BitVec.ofNat 64 16852388949609489699 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148523174234368 - maskLow := BitVec.ofNat 64 1152921508902273303 - maskHigh := BitVec.ofNat 64 72057662765797505 - systematicCode := BitVec.ofNat 64 17422367128748107043 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085353684797696 - maskLow := BitVec.ofNat 64 36046943256248599 - maskHigh := BitVec.ofNat 64 72057663025840129 - systematicCode := BitVec.ofNat 64 17422379042061886755 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36169571048161536 - maskLow := BitVec.ofNat 64 36028803462922519 - maskHigh := BitVec.ofNat 64 72198331534671873 - systematicCode := BitVec.ofNat 64 17428840871459628323 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9289266953781504 - maskLow := BitVec.ofNat 64 1152921508902273303 - maskHigh := BitVec.ofNat 64 9223372071214581889 - systematicCode := BitVec.ofNat 64 18358820078318331171 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36099758485471488 - maskLow := BitVec.ofNat 64 290825120973079 - maskHigh := BitVec.ofNat 64 9223372071482949633 - systematicCode := BitVec.ofNat 64 18358846233726887203 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9359090270931200 - maskLow := BitVec.ofNat 64 1152921508902273303 - maskHigh := BitVec.ofNat 64 9300073968276865025 - systematicCode := BitVec.ofNat 64 18370721502119666979 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x2607. -/ -def normalizedWeightSixteenCandidateBucket_2607 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085407220843136 - maskLow := BitVec.ofNat 64 432363160709169439 - maskHigh := BitVec.ofNat 64 1649267474433 - systematicCode := BitVec.ofNat 64 15046137632374924807 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148576710279808 - maskLow := BitVec.ofNat 64 140741783912735 - maskHigh := BitVec.ofNat 64 1649368109057 - systematicCode := BitVec.ofNat 64 15046163188051486215 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085388044485248 - maskLow := BitVec.ofNat 64 27039194245824799 - maskHigh := BitVec.ofNat 64 8864812531713 - systematicCode := BitVec.ofNat 64 15476794312248272391 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148557533921920 - maskLow := BitVec.ofNat 64 140741783912735 - maskHigh := BitVec.ofNat 64 8864818794497 - systematicCode := BitVec.ofNat 64 15476811071966029319 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18050205819880064 - maskLow := BitVec.ofNat 64 17598092214559 - maskHigh := BitVec.ofNat 64 9345848840193 - systematicCode := BitVec.ofNat 64 15478476474070803975 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9359670057910912 - maskLow := BitVec.ofNat 64 140741783912735 - maskHigh := BitVec.ofNat 64 1690018091401217 - systematicCode := BitVec.ofNat 64 16565313414467823111 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36046466531215488 - maskLow := BitVec.ofNat 64 306244813316489503 - maskHigh := BitVec.ofNat 64 2306968909120569345 - systematicCode := BitVec.ofNat 64 18151088100368328199 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2533352116603008 - maskLow := BitVec.ofNat 64 140741783912735 - maskHigh := BitVec.ofNat 64 2306968909191839753 - systematicCode := BitVec.ofNat 64 18151113630074938887 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36046466531475584 - maskLow := BitVec.ofNat 64 153122425985892639 - maskHigh := BitVec.ofNat 64 4612248968380841985 - systematicCode := BitVec.ofNat 64 18294640329867273735 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2533352116863104 - maskLow := BitVec.ofNat 64 140741783912735 - maskHigh := BitVec.ofNat 64 4612248968416460809 - systematicCode := BitVec.ofNat 64 18294663660584183303 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9359674386172544 - maskLow := BitVec.ofNat 64 140741783912735 - maskHigh := BitVec.ofNat 64 6917538373489950721 - systematicCode := BitVec.ofNat 64 18301457693658719751 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x260e. -/ -def normalizedWeightSixteenCandidateBucket_260e : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .twoE8 - affineCode := BitVec.ofNat 56 2261695720471552 - maskLow := BitVec.ofNat 64 1103813476759 - maskHigh := BitVec.ofNat 64 1103806595329 - systematicCode := BitVec.ofNat 64 15042464008213505550 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10208966823127040 - maskLow := BitVec.ofNat 64 6917530131448267159 - maskHigh := BitVec.ofNat 64 1133871368193 - systematicCode := BitVec.ofNat 64 15044159641138308622 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9650414916216832 - maskLow := BitVec.ofNat 64 8800388579735 - maskHigh := BitVec.ofNat 64 1135481979137 - systematicCode := BitVec.ofNat 64 15044200589742777870 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11334870219630592 - maskLow := BitVec.ofNat 64 27022701571408279 - maskHigh := BitVec.ofNat 64 8800387991553 - systematicCode := BitVec.ofNat 64 15474816290829444622 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9659214498899968 - maskLow := BitVec.ofNat 64 8800388579735 - maskHigh := BitVec.ofNat 64 8800394281217 - systematicCode := BitVec.ofNat 64 15474840747011155470 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11339267997706240 - maskLow := BitVec.ofNat 64 1105417798039 - maskHigh := BitVec.ofNat 64 8830452760833 - systematicCode := BitVec.ofNat 64 15476498422587663886 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9593243801233408 - maskLow := BitVec.ofNat 64 8800388579735 - maskHigh := BitVec.ofNat 64 27022701570820097 - systematicCode := BitVec.ofNat 64 17071686867387622926 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11335454370588672 - maskLow := BitVec.ofNat 64 4629700455592165783 - maskHigh := BitVec.ofNat 64 2323857407723177985 - systematicCode := BitVec.ofNat 64 18153050758688679438 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9659798649858048 - maskLow := BitVec.ofNat 64 8800388579735 - maskHigh := BitVec.ofNat 64 2323857408801112073 - systematicCode := BitVec.ofNat 64 18153091651492849166 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11335454371872896 - maskLow := BitVec.ofNat 64 2314850247123730839 - maskHigh := BitVec.ofNat 64 4620693217682130945 - systematicCode := BitVec.ofNat 64 18296602988187624974 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9659798651142272 - maskLow := BitVec.ofNat 64 8800388579735 - maskHigh := BitVec.ofNat 64 4620693218221096969 - systematicCode := BitVec.ofNat 64 18296641682002093582 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9593239774453888 - maskLow := BitVec.ofNat 64 8800388579735 - maskHigh := BitVec.ofNat 64 6917537858093844481 - systematicCode := BitVec.ofNat 64 18301457663476049422 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x2616. -/ -def normalizedWeightSixteenCandidateBucket_2616 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .twoE8 - affineCode := BitVec.ofNat 56 2261699715546112 - maskLow := BitVec.ofNat 64 73115699479 - maskHigh := BitVec.ofNat 64 73014444049 - systematicCode := BitVec.ofNat 64 14465994425592063510 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10208967622141952 - maskLow := BitVec.ofNat 64 6917529100656118039 - maskHigh := BitVec.ofNat 64 103079215233 - systematicCode := BitVec.ofNat 64 14467690092741338646 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9650415715231744 - maskLow := BitVec.ofNat 64 554051373335 - maskHigh := BitVec.ofNat 64 104689827857 - systematicCode := BitVec.ofNat 64 14467739837304612374 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11334867556247552 - maskLow := BitVec.ofNat 64 432345637242603799 - maskHigh := BitVec.ofNat 64 554050781313 - systematicCode := BitVec.ofNat 64 14898346776926430742 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9659211835516928 - maskLow := BitVec.ofNat 64 554051373335 - maskHigh := BitVec.ofNat 64 554151444497 - systematicCode := BitVec.ofNat 64 14898388825025750550 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11339265600661504 - maskLow := BitVec.ofNat 64 74625648919 - maskHigh := BitVec.ofNat 64 584115552273 - systematicCode := BitVec.ofNat 64 14900028839831479830 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9593241137850368 - maskLow := BitVec.ofNat 64 554051373335 - maskHigh := BitVec.ofNat 64 432345637242011777 - systematicCode := BitVec.ofNat 64 17650390623276967446 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11335456234956800 - maskLow := BitVec.ofNat 64 4899916433234397463 - maskHigh := BitVec.ofNat 64 2594073385365405825 - systematicCode := BitVec.ofNat 64 18155293762543560214 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9659800514226176 - maskLow := BitVec.ofNat 64 554051373335 - maskHigh := BitVec.ofNat 64 2594073386506256393 - systematicCode := BitVec.ofNat 64 18155343485665748502 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11335456236241024 - maskLow := BitVec.ofNat 64 2449958235944847639 - maskHigh := BitVec.ofNat 64 4755801206503243905 - systematicCode := BitVec.ofNat 64 18298845992042505750 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9659800515510400 - maskLow := BitVec.ofNat 64 554051373335 - maskHigh := BitVec.ofNat 64 4755801207073669129 - systematicCode := BitVec.ofNat 64 18298893516174992918 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9593241106145408 - maskLow := BitVec.ofNat 64 554051373335 - maskHigh := BitVec.ofNat 64 6917529611756634241 - systematicCode := BitVec.ofNat 64 18301448867248285206 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x2619. -/ -def normalizedWeightSixteenCandidateBucket_2619 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.node - (.leaf - { patternClass := .twoE8 - affineCode := BitVec.ofNat 56 2393087596968960 - maskLow := BitVec.ofNat 64 1688888515563799 - maskHigh := BitVec.ofNat 64 4369 - systematicCode := BitVec.ofNat 64 10993719229626590745 }) - (.leaf - { patternClass := .twoE8 - affineCode := BitVec.ofNat 56 18032540990454784 - maskLow := BitVec.ofNat 64 18764712710423 - maskHigh := BitVec.ofNat 64 393225 - systematicCode := BitVec.ofNat 64 11863192082326300185 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10274116102006784 - maskLow := BitVec.ofNat 64 6917529066296381719 - maskHigh := BitVec.ofNat 64 6273 - systematicCode := BitVec.ofNat 64 10995414780038489625 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11400016036112384 - maskLow := BitVec.ofNat 64 432345602882867479 - maskHigh := BitVec.ofNat 64 33153 - systematicCode := BitVec.ofNat 64 11426071464223581721 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11400016302450688 - maskLow := BitVec.ofNat 64 27021636419522839 - maskHigh := BitVec.ofNat 64 34833 - systematicCode := BitVec.ofNat 64 11427753682520122905 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18102914064319488 - maskLow := BitVec.ofNat 64 4899916467594137879 - maskHigh := BitVec.ofNat 64 2359425 - systematicCode := BitVec.ofNat 64 12368168241372669465 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18102914063149056 - maskLow := BitVec.ofNat 64 2449958270304588055 - maskHigh := BitVec.ofNat 64 4325505 - systematicCode := BitVec.ofNat 64 12511720470871615001 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18102639185373184 - maskLow := BitVec.ofNat 64 149606596415767 - maskHigh := BitVec.ofNat 64 6291465 - systematicCode := BitVec.ofNat 64 12514243729328514585 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18102913797981184 - maskLow := BitVec.ofNat 64 4629701520744059159 - maskHigh := BitVec.ofNat 64 33818625 - systematicCode := BitVec.ofNat 64 12944637789635421721 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10274390979782656 - maskLow := BitVec.ofNat 64 4612389710164726039 - maskHigh := BitVec.ofNat 64 35655681 - systematicCode := BitVec.ofNat 64 12946609213800326681 }) - ) - ) - ) - ) - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18102913796810752 - maskLow := BitVec.ofNat 64 2314851312275624215 - maskHigh := BitVec.ofNat 64 67241985 - systematicCode := BitVec.ofNat 64 13088190019134367257 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10274390980953088 - maskLow := BitVec.ofNat 64 2307109650904453399 - maskHigh := BitVec.ofNat 64 71307265 - systematicCode := BitVec.ofNat 64 13091287343273223705 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18102638919034880 - maskLow := BitVec.ofNat 64 142391051358487 - maskHigh := BitVec.ofNat 64 100663305 - systematicCode := BitVec.ofNat 64 13092956281345353241 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18094117677696000 - maskLow := BitVec.ofNat 64 306262371142799639 - maskHigh := BitVec.ofNat 64 537165825 - systematicCode := BitVec.ofNat 64 13449048614417999385 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11400290913888256 - maskLow := BitVec.ofNat 64 288802126493716759 - maskHigh := BitVec.ofNat 64 538968321 - systematicCode := BitVec.ofNat 64 13451004645419197977 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11400291180226560 - maskLow := BitVec.ofNat 64 18577902514278679 - maskHigh := BitVec.ofNat 64 570425361 - systematicCode := BitVec.ofNat 64 13453247614779598361 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18094117676525568 - maskLow := BitVec.ofNat 64 153139983812202775 - maskHigh := BitVec.ofNat 64 1073905665 - systematicCode := BitVec.ofNat 64 13592600843916944921 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11400290915058688 - maskLow := BitVec.ofNat 64 145249888371282199 - maskHigh := BitVec.ofNat 64 1077936385 - systematicCode := BitVec.ofNat 64 13595682774892095001 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11400291181396992 - maskLow := BitVec.ofNat 64 10133653212958999 - maskHigh := BitVec.ofNat 64 1140850705 - systematicCode := BitVec.ofNat 64 13597925744252495385 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18093842798749696 - maskLow := BitVec.ofNat 64 26942330442007 - maskHigh := BitVec.ofNat 64 1610612745 - systematicCode := BitVec.ofNat 64 13599329738778682905 }) - ) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x261f. -/ -def normalizedWeightSixteenCandidateBucket_261f : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089445584807936 - maskLow := BitVec.ofNat 64 141910015050007 - maskHigh := BitVec.ofNat 64 1688849860263945 - systematicCode := BitVec.ofNat 64 16565231594047612447 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711166981154816 - maskLow := BitVec.ofNat 64 38655328535 - maskHigh := BitVec.ofNat 64 1688849860296977 - systematicCode := BitVec.ofNat 64 16565258202309338655 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11338722287167488 - maskLow := BitVec.ofNat 64 74122363159 - maskHigh := BitVec.ofNat 64 9570149208162321 - systematicCode := BitVec.ofNat 64 16925522772240770591 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11338722288337920 - maskLow := BitVec.ofNat 64 73619046679 - maskHigh := BitVec.ofNat 64 19140298416324625 - systematicCode := BitVec.ofNat 64 17070200910236624415 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089445020674048 - maskLow := BitVec.ofNat 64 26461294133527 - maskHigh := BitVec.ofNat 64 27021597764222985 - systematicCode := BitVec.ofNat 64 17071605051480942111 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711166417020928 - maskLow := BitVec.ofNat 64 38655328535 - maskHigh := BitVec.ofNat 64 27021597764229137 - systematicCode := BitVec.ofNat 64 17071625114111845919 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11338718292092928 - maskLow := BitVec.ofNat 64 1104883056919 - maskHigh := BitVec.ofNat 64 144678138029277441 - systematicCode := BitVec.ofNat 64 17501992354996430367 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11338718293263360 - maskLow := BitVec.ofNat 64 1104348283159 - maskHigh := BitVec.ofNat 64 289356276058554625 - systematicCode := BitVec.ofNat 64 17646670492992284191 }) - ) - ) - ) - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089441558276096 - maskLow := BitVec.ofNat 64 19245749076247 - maskHigh := BitVec.ofNat 64 432345564227567625 - systematicCode := BitVec.ofNat 64 17650317603497780767 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711162954622976 - maskLow := BitVec.ofNat 64 38655328535 - maskHigh := BitVec.ofNat 64 432345564227572097 - systematicCode := BitVec.ofNat 64 17650337640559814175 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11340917350878336 - maskLow := BitVec.ofNat 64 140741855248663 - maskHigh := BitVec.ofNat 64 2306968909120569345 - systematicCode := BitVec.ofNat 64 18151088000626075167 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9786517887150080 - maskLow := BitVec.ofNat 64 38655328535 - maskHigh := BitVec.ofNat 64 2613213683781730313 - systematicCode := BitVec.ofNat 64 18155396468381722143 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11340917351268480 - maskLow := BitVec.ofNat 64 140741819597079 - maskHigh := BitVec.ofNat 64 4612248968380841985 - systematicCode := BitVec.ofNat 64 18294640238714824223 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9786517888434304 - maskLow := BitVec.ofNat 64 38655328535 - maskHigh := BitVec.ofNat 64 4765371355711406089 - systematicCode := BitVec.ofNat 64 18298946498890966559 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089441526571136 - maskLow := BitVec.ofNat 64 150087632781591 - maskHigh := BitVec.ofNat 64 6917529027641081865 - systematicCode := BitVec.ofNat 64 18301369250499995167 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711162922918016 - maskLow := BitVec.ofNat 64 38655328535 - maskHigh := BitVec.ofNat 64 6917529027641116801 - systematicCode := BitVec.ofNat 64 18301395884531131935 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x2623. -/ -def normalizedWeightSixteenCandidateBucket_2623 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .d16Plus - affineCode := BitVec.ofNat 56 54397257743630464 - maskLow := BitVec.ofNat 64 562954284761367 - maskHigh := BitVec.ofNat 64 4611826755915874305 - systematicCode := BitVec.ofNat 64 18293518754034361891 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9359635698188928 - maskLow := BitVec.ofNat 64 2305843013509382423 - maskHigh := BitVec.ofNat 64 1127103034556417 - systematicCode := BitVec.ofNat 64 16559956589993928227 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2533317756881024 - maskLow := BitVec.ofNat 64 2305843013509382423 - maskHigh := BitVec.ofNat 64 1266637466632193 - systematicCode := BitVec.ofNat 64 16564157711851857443 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36046432171493504 - maskLow := BitVec.ofNat 64 306807728910303511 - maskHigh := BitVec.ofNat 64 1266637932068865 - systematicCode := BitVec.ofNat 64 16564162968001062435 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148542350557824 - maskLow := BitVec.ofNat 64 2305843013509382423 - maskHigh := BitVec.ofNat 64 9008298833483777 - systematicCode := BitVec.ofNat 64 16920223467011974691 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085372861121152 - maskLow := BitVec.ofNat 64 288256768726466839 - maskHigh := BitVec.ofNat 64 9008299303239681 - systematicCode := BitVec.ofNat 64 16920228813186999843 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36169569957611648 - maskLow := BitVec.ofNat 64 288230381554696471 - maskHigh := BitVec.ofNat 64 9147936810205185 - systematicCode := BitVec.ofNat 64 16924445439824111139 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148523174199936 - maskLow := BitVec.ofNat 64 2305843013509382423 - maskHigh := BitVec.ofNat 64 144115256799531137 - systematicCode := BitVec.ofNat 64 17494423623274472995 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085353684763264 - maskLow := BitVec.ofNat 64 18032544747028759 - maskHigh := BitVec.ofNat 64 144115257332203521 - systematicCode := BitVec.ofNat 64 17494437731316475427 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36169571022964864 - maskLow := BitVec.ofNat 64 18014403881009431 - maskHigh := BitVec.ofNat 64 144255925568405505 - systematicCode := BitVec.ofNat 64 17500897361674249763 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2533867512692864 - maskLow := BitVec.ofNat 64 2305843013509382423 - maskHigh := BitVec.ofNat 64 4611686052787259521 - systematicCode := BitVec.ofNat 64 18286763583792096803 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36046981927305344 - maskLow := BitVec.ofNat 64 572300097945879 - maskHigh := BitVec.ofNat 64 4611686053323997185 - systematicCode := BitVec.ofNat 64 18286789743495554595 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9359090270898816 - maskLow := BitVec.ofNat 64 2305843013509382423 - maskHigh := BitVec.ofNat 64 4764949143783211009 - systematicCode := BitVec.ofNat 64 18298946482586920483 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x2625. -/ -def normalizedWeightSixteenCandidateBucket_2625 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .d16Plus - affineCode := BitVec.ofNat 56 54397257742573824 - maskLow := BitVec.ofNat 64 1125904273965335 - maskHigh := BitVec.ofNat 64 2305983746702311425 - systematicCode := BitVec.ofNat 64 18149405773605381669 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9359635697977600 - maskLow := BitVec.ofNat 64 4611686022723207447 - maskHigh := BitVec.ofNat 64 564153618006017 - systematicCode := BitVec.ofNat 64 16415841401951757861 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2533317757124864 - maskLow := BitVec.ofNat 64 4611686022723207447 - maskHigh := BitVec.ofNat 64 703687477690369 - systematicCode := BitVec.ofNat 64 16420040316196496933 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36046432171737344 - maskLow := BitVec.ofNat 64 154248291533259031 - maskHigh := BitVec.ofNat 64 703688515518465 - systematicCode := BitVec.ofNat 64 16420049970325104165 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148542350346496 - maskLow := BitVec.ofNat 64 4611686022723207447 - maskHigh := BitVec.ofNat 64 18015498054670337 - systematicCode := BitVec.ofNat 64 17064336456064706085 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085372860909824 - maskLow := BitVec.ofNat 64 144141580650742039 - maskHigh := BitVec.ofNat 64 18015499094851585 - systematicCode := BitVec.ofNat 64 17064346191696176677 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36169569957855488 - maskLow := BitVec.ofNat 64 144115192975655191 - maskHigh := BitVec.ofNat 64 18155136031391745 - systematicCode := BitVec.ofNat 64 17068558420253353509 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148523173988608 - maskLow := BitVec.ofNat 64 4611686022723207447 - maskHigh := BitVec.ofNat 64 288230444873289857 - systematicCode := BitVec.ofNat 64 17638536612327204389 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085353684551936 - maskLow := BitVec.ofNat 64 9025345492418839 - maskHigh := BitVec.ofNat 64 288230445944930305 - systematicCode := BitVec.ofNat 64 17638555109825652261 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36169571023208704 - maskLow := BitVec.ofNat 64 9007204091625751 - maskHigh := BitVec.ofNat 64 288371113642164225 - systematicCode := BitVec.ofNat 64 17645010342103492133 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2533867512676608 - maskLow := BitVec.ofNat 64 4611686022723207447 - maskHigh := BitVec.ofNat 64 2305843043573696641 - systematicCode := BitVec.ofNat 64 18142650594739627557 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36046981927289088 - maskLow := BitVec.ofNat 64 1135250051498263 - maskHigh := BitVec.ofNat 64 2305843044647174145 - systematicCode := BitVec.ofNat 64 18142676763032888869 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9359090270947584 - maskLow := BitVec.ofNat 64 4611686022723207447 - maskHigh := BitVec.ofNat 64 2612228522436984833 - systematicCode := BitVec.ofNat 64 18155396443521426981 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x290b. -/ -def normalizedWeightSixteenCandidateBucket_290b : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085475959048448 - maskLow := BitVec.ofNat 64 2449962599632142647 - maskHigh := BitVec.ofNat 64 1374389551105 - systematicCode := BitVec.ofNat 64 15045855079361161483 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148645448485120 - maskLow := BitVec.ofNat 64 70373040259383 - maskHigh := BitVec.ofNat 64 1374959961089 - systematicCode := BitVec.ofNat 64 15045887210565740811 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085456632875264 - maskLow := BitVec.ofNat 64 38284999175242039 - maskHigh := BitVec.ofNat 64 17609365929985 - systematicCode := BitVec.ofNat 64 15691840099171182859 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148626122311936 - maskLow := BitVec.ofNat 64 70373040259383 - maskHigh := BitVec.ofNat 64 17609374827521 - systematicCode := BitVec.ofNat 64 15691859036437555467 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18050274408270080 - maskLow := BitVec.ofNat 64 4404624294199 - maskHigh := BitVec.ofNat 64 17867063952385 - systematicCode := BitVec.ofNat 64 15694363365998012683 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9359738796116224 - maskLow := BitVec.ofNat 64 70373040259383 - maskHigh := BitVec.ofNat 64 9571265899675649 - systematicCode := BitVec.ofNat 64 16925601367460751627 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36099311794258176 - maskLow := BitVec.ofNat 64 2341871879248216375 - maskHigh := BitVec.ofNat 64 585467951558180865 - systematicCode := BitVec.ofNat 64 17864264021080353035 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9288820262568192 - maskLow := BitVec.ofNat 64 70373040259383 - maskHigh := BitVec.ofNat 64 585467952103424017 - systematicCode := BitVec.ofNat 64 17864296130710153483 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36099311827812608 - maskLow := BitVec.ofNat 64 146367060905099575 - maskHigh := BitVec.ofNat 64 9223934986808213505 - systematicCode := BitVec.ofNat 64 18366696824326662411 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9288820296122624 - maskLow := BitVec.ofNat 64 70373040259383 - maskHigh := BitVec.ofNat 64 9223934986842275857 - systematicCode := BitVec.ofNat 64 18366721237492508939 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9359743057791232 - maskLow := BitVec.ofNat 64 70373040259383 - maskHigh := BitVec.ofNat 64 9799850656222167041 - systematicCode := BitVec.ofNat 64 18372392682012879115 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x290d. -/ -def normalizedWeightSixteenCandidateBucket_290d : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085475959211008 - maskLow := BitVec.ofNat 64 4899918597898436951 - maskHigh := BitVec.ofNat 64 1236950589441 - systematicCode := BitVec.ofNat 64 15045289939007842573 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148645448647680 - maskLow := BitVec.ofNat 64 35188668170583 - maskHigh := BitVec.ofNat 64 1238091432449 - systematicCode := BitVec.ofNat 64 15045326468191824141 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085456631867392 - maskLow := BitVec.ofNat 64 38282800151986519 - maskHigh := BitVec.ofNat 64 17600775987201 - systematicCode := BitVec.ofNat 64 15691274950194374925 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148626121304064 - maskLow := BitVec.ofNat 64 35188668170583 - maskHigh := BitVec.ofNat 64 17600784892417 - systematicCode := BitVec.ofNat 64 15691296086450448653 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18050274407262208 - maskLow := BitVec.ofNat 64 2205601038679 - maskHigh := BitVec.ofNat 64 17729624998401 - systematicCode := BitVec.ofNat 64 15693798208431401229 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9359738796278784 - maskLow := BitVec.ofNat 64 35188668170583 - maskHigh := BitVec.ofNat 64 19141406517895169 - systematicCode := BitVec.ofNat 64 17070279496866408717 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36099311794160640 - maskLow := BitVec.ofNat 64 4647714888461910359 - maskHigh := BitVec.ofNat 64 594475150812913665 - systematicCode := BitVec.ofNat 64 17864824780600453389 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9288820262470656 - maskLow := BitVec.ofNat 64 35188668170583 - maskHigh := BitVec.ofNat 64 594475151895035921 - systematicCode := BitVec.ofNat 64 17864861279686699277 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36099311827715072 - maskLow := BitVec.ofNat 64 290482248980955479 - maskHigh := BitVec.ofNat 64 9224497936761626625 - systematicCode := BitVec.ofNat 64 18367257583846762765 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9288820296025088 - maskLow := BitVec.ofNat 64 35188668170583 - maskHigh := BitVec.ofNat 64 9224497936829251601 - systematicCode := BitVec.ofNat 64 18367286386469054733 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9359743057693696 - maskLow := BitVec.ofNat 64 35188668170583 - maskHigh := BitVec.ofNat 64 9799850518783205377 - systematicCode := BitVec.ofNat 64 18372392673389259021 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x2916. -/ -def normalizedWeightSixteenCandidateBucket_2916 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.node - (.leaf - { patternClass := .twoE8 - affineCode := BitVec.ofNat 56 18032063712214016 - maskLow := BitVec.ofNat 64 4785147619641623 - maskHigh := BitVec.ofNat 64 1545 - systematicCode := BitVec.ofNat 64 10705767047079995670 }) - (.leaf - { patternClass := .twoE8 - affineCode := BitVec.ofNat 56 2392610318728192 - maskLow := BitVec.ofNat 64 6635725588759 - maskHigh := BitVec.ofNat 64 1114129 - systematicCode := BitVec.ofNat 64 12151144264872896790 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18102982246925312 - maskLow := BitVec.ofNat 64 4899916467594660119 - maskHigh := BitVec.ofNat 64 9345 - systematicCode := BitVec.ofNat 64 11210743137138452758 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18102982245754880 - maskLow := BitVec.ofNat 64 2449958270305110295 - maskHigh := BitVec.ofNat 64 17025 - systematicCode := BitVec.ofNat 64 11354295366637398294 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18102980098402304 - maskLow := BitVec.ofNat 64 38280669848209687 - maskHigh := BitVec.ofNat 64 24585 - systematicCode := BitVec.ofNat 64 11356818694082210070 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10274422923732992 - maskLow := BitVec.ofNat 64 6917529066296903959 - maskHigh := BitVec.ofNat 64 1572993 - systematicCode := BitVec.ofNat 64 12152839884272707862 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11400322857838592 - maskLow := BitVec.ofNat 64 432345602883389719 - maskHigh := BitVec.ofNat 64 8454273 - systematicCode := BitVec.ofNat 64 12583496568457799958 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11400357215479808 - maskLow := BitVec.ofNat 64 105591772088599 - maskHigh := BitVec.ofNat 64 8912913 - systematicCode := BitVec.ofNat 64 12585178717766428950 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18102947889284096 - maskLow := BitVec.ofNat 64 4612037866444359959 - maskHigh := BitVec.ofNat 64 34079745 - systematicCode := BitVec.ofNat 64 12945478915830130966 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10274425071085568 - maskLow := BitVec.ofNat 64 4647717018765691159 - maskHigh := BitVec.ofNat 64 34611201 - systematicCode := BitVec.ofNat 64 12945768087605618966 }) - ) - ) - ) - ) - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18102947888113664 - maskLow := BitVec.ofNat 64 2306159672858577175 - maskHigh := BitVec.ofNat 64 67633665 - systematicCode := BitVec.ofNat 64 13089591896292665622 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10274425072256000 - maskLow := BitVec.ofNat 64 2341876208575252759 - maskHigh := BitVec.ofNat 64 68173825 - systematicCode := BitVec.ofNat 64 13089885466114926870 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18102945740761088 - maskLow := BitVec.ofNat 64 36310826047572247 - maskHigh := BitVec.ofNat 64 100663305 - systematicCode := BitVec.ofNat 64 13092956350333266198 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11400325005191168 - maskLow := BitVec.ofNat 64 290484379284736279 - maskHigh := BitVec.ofNat 64 536944641 - systematicCode := BitVec.ofNat 64 13448200890851928342 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18094151768998912 - maskLow := BitVec.ofNat 64 292804348819343639 - maskHigh := BitVec.ofNat 64 545260545 - systematicCode := BitVec.ofNat 64 13451852368985270550 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11400359362832384 - maskLow := BitVec.ofNat 64 73121819330839 - maskHigh := BitVec.ofNat 64 570425361 - systematicCode := BitVec.ofNat 64 13453247545791686934 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11400325006361600 - maskLow := BitVec.ofNat 64 146371390232135959 - maskHigh := BitVec.ofNat 64 1073823745 - systematicCode := BitVec.ofNat 64 13592318269361236246 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18094151767828480 - maskLow := BitVec.ofNat 64 148653976371398935 - maskHigh := BitVec.ofNat 64 1082130945 - systematicCode := BitVec.ofNat 64 13595965349447805206 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11400359364002816 - maskLow := BitVec.ofNat 64 40136470497559 - maskHigh := BitVec.ofNat 64 1140850705 - systematicCode := BitVec.ofNat 64 13597925675264583958 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18094149620475904 - maskLow := BitVec.ofNat 64 6755953492953367 - maskHigh := BitVec.ofNat 64 1610612745 - systematicCode := BitVec.ofNat 64 13599329807766595862 }) - ) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x2919. -/ -def normalizedWeightSixteenCandidateBucket_2919 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .twoE8 - affineCode := BitVec.ofNat 56 18084905231727616 - maskLow := BitVec.ofNat 64 38941036823 - maskHigh := BitVec.ofNat 64 25769803785 - systematicCode := BitVec.ofNat 64 14178042213064321305 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085459317228544 - maskLow := BitVec.ofNat 64 4899916433234923799 - maskHigh := BitVec.ofNat 64 154618822785 - systematicCode := BitVec.ofNat 64 14683018449840908569 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148628806665216 - maskLow := BitVec.ofNat 64 554051899671 - maskHigh := BitVec.ofNat 64 155759673353 - systematicCode := BitVec.ofNat 64 14683068172963096857 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085459316058112 - maskLow := BitVec.ofNat 64 2449958235945373975 - maskHigh := BitVec.ofNat 64 283467841665 - systematicCode := BitVec.ofNat 64 14826570679339854105 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148628805494784 - maskLow := BitVec.ofNat 64 554051899671 - maskHigh := BitVec.ofNat 64 284038266889 - systematicCode := BitVec.ofNat 64 14826618203472341273 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18050274944100352 - maskLow := BitVec.ofNat 64 40937525527 - maskHigh := BitVec.ofNat 64 412316860425 - systematicCode := BitVec.ofNat 64 14829093834297125145 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9359735038411776 - maskLow := BitVec.ofNat 64 554051899671 - maskHigh := BitVec.ofNat 64 1224979124414578817 - systematicCode := BitVec.ofNat 64 17938335130700425497 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36099303741588480 - maskLow := BitVec.ofNat 64 6917529100656644375 - maskHigh := BitVec.ofNat 64 1729382256910270593 - systematicCode := BitVec.ofNat 64 17939965405443991833 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9288812209898496 - maskLow := BitVec.ofNat 64 554051899671 - maskHigh := BitVec.ofNat 64 1729382258520883217 - systematicCode := BitVec.ofNat 64 17940015150007265561 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36099303775142912 - maskLow := BitVec.ofNat 64 432345637243130135 - maskHigh := BitVec.ofNat 64 9295429630892703873 - systematicCode := BitVec.ofNat 64 18370622089629083929 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9288812243452928 - maskLow := BitVec.ofNat 64 554051899671 - maskHigh := BitVec.ofNat 64 9295429630993367057 - systematicCode := BitVec.ofNat 64 18370664137728403737 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9359735005121536 - maskLow := BitVec.ofNat 64 554051899671 - maskHigh := BitVec.ofNat 64 9799833201475059841 - systematicCode := BitVec.ofNat 64 18372379479047612697 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x291f. -/ -def normalizedWeightSixteenCandidateBucket_291f : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18050172403853312 - maskLow := BitVec.ofNat 64 40820113687 - maskHigh := BitVec.ofNat 64 1688849860263945 - systematicCode := BitVec.ofNat 64 16565231490648058143 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11329994913622016 - maskLow := BitVec.ofNat 64 72606423286039 - maskHigh := BitVec.ofNat 64 9570149208162321 - systematicCode := BitVec.ofNat 64 16925522858493749535 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9095787285981184 - maskLow := BitVec.ofNat 64 73015591191 - maskHigh := BitVec.ofNat 64 9570149208179209 - systematicCode := BitVec.ofNat 64 16925545077232183583 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11329994914792448 - maskLow := BitVec.ofNat 64 39621074452759 - maskHigh := BitVec.ofNat 64 19140298416324625 - systematicCode := BitVec.ofNat 64 17070200987966646559 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9095787287151616 - maskLow := BitVec.ofNat 64 73015591191 - maskHigh := BitVec.ofNat 64 19140298416333833 - systematicCode := BitVec.ofNat 64 17070221024828139807 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18050171839719424 - maskLow := BitVec.ofNat 64 39058506007 - maskHigh := BitVec.ofNat 64 27021597764222985 - systematicCode := BitVec.ofNat 64 17071604973650258207 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36170119698744320 - maskLow := BitVec.ofNat 64 70373312921879 - maskHigh := BitVec.ofNat 64 585467951558180865 - systematicCode := BitVec.ofNat 64 17864263895618431263 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36170119698841856 - maskLow := BitVec.ofNat 64 35188938735895 - maskHigh := BitVec.ofNat 64 594475150812913665 - systematicCode := BitVec.ofNat 64 17864824637958531359 }) - ) - ) - ) - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18050171302881280 - maskLow := BitVec.ofNat 64 2203457782039 - maskHigh := BitVec.ofNat 64 1161928703861588481 - systematicCode := BitVec.ofNat 64 17936309347767036191 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18050171303889152 - maskLow := BitVec.ofNat 64 4402478940439 - maskHigh := BitVec.ofNat 64 1170935903116329985 - systematicCode := BitVec.ofNat 64 17936874505333516575 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11330007798907904 - maskLow := BitVec.ofNat 64 7151121694999 - maskHigh := BitVec.ofNat 64 1224979098644774929 - systematicCode := BitVec.ofNat 64 17938269786044573983 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9095800171267072 - maskLow := BitVec.ofNat 64 73015591191 - maskHigh := BitVec.ofNat 64 1224979098644776577 - systematicCode := BitVec.ofNat 64 17938282147983468831 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36170120772518144 - maskLow := BitVec.ofNat 64 554058219799 - maskHigh := BitVec.ofNat 64 1729382256910270593 - systematicCode := BitVec.ofNat 64 17939965210859809055 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9024877342753792 - maskLow := BitVec.ofNat 64 73015591191 - maskHigh := BitVec.ofNat 64 1756403854674493457 - systematicCode := BitVec.ofNat 64 17940068132723435807 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9024877376308224 - maskLow := BitVec.ofNat 64 73015591191 - maskHigh := BitVec.ofNat 64 9297118480752967697 - systematicCode := BitVec.ofNat 64 18370717120444573983 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11330007765617664 - maskLow := BitVec.ofNat 64 106107168194839 - maskHigh := BitVec.ofNat 64 9799832789158199313 - systematicCode := BitVec.ofNat 64 18372304238938106143 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9095800137976832 - maskLow := BitVec.ofNat 64 73015591191 - maskHigh := BitVec.ofNat 64 9799832789158224001 - systematicCode := BitVec.ofNat 64 18372326496330656031 }) - ) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x2923. -/ -def normalizedWeightSixteenCandidateBucket_2923 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085372886124800 - maskLow := BitVec.ofNat 64 2305882595928506647 - maskHigh := BitVec.ofNat 64 1126999485579265 - systematicCode := BitVec.ofNat 64 16559935366964193571 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148542375561472 - maskLow := BitVec.ofNat 64 288230380447924503 - maskHigh := BitVec.ofNat 64 1126999955350529 - systematicCode := BitVec.ofNat 64 16559941007214717219 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36169573170544896 - maskLow := BitVec.ofNat 64 2305843015674167575 - maskHigh := BitVec.ofNat 64 1266637932068865 - systematicCode := BitVec.ofNat 64 16564162988684159267 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9359635723192576 - maskLow := BitVec.ofNat 64 288230380447924503 - maskHigh := BitVec.ofNat 64 9008453452300289 - systematicCode := BitVec.ofNat 64 16920247845749336355 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36099208721334528 - maskLow := BitVec.ofNat 64 2342153285505581335 - maskHigh := BitVec.ofNat 64 9147936810205185 - systematicCode := BitVec.ofNat 64 16924445462124112163 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9288717189644544 - maskLow := BitVec.ofNat 64 288230380447924503 - maskHigh := BitVec.ofNat 64 9147937288421377 - systematicCode := BitVec.ofNat 64 16924451183877499171 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148523049388288 - maskLow := BitVec.ofNat 64 288230380447924503 - maskHigh := BitVec.ofNat 64 72057611226186881 - systematicCode := BitVec.ofNat 64 17421241211661134115 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085353559951616 - maskLow := BitVec.ofNat 64 36033749117501719 - maskHigh := BitVec.ofNat 64 72057611284905985 - systematicCode := BitVec.ofNat 64 17421248744041425187 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9289266945458432 - maskLow := BitVec.ofNat 64 288230380447924503 - maskHigh := BitVec.ofNat 64 9223372174293803137 - systematicCode := BitVec.ofNat 64 18359945995404781859 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36099758477148416 - maskLow := BitVec.ofNat 64 317213400826135 - maskHigh := BitVec.ofNat 64 9223372174360838145 - systematicCode := BitVec.ofNat 64 18359967735654328611 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9359090262608128 - maskLow := BitVec.ofNat 64 288230380447924503 - maskHigh := BitVec.ofNat 64 9296696268355010561 - systematicCode := BitVec.ofNat 64 18370717104005785891 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x2925. -/ -def normalizedWeightSixteenCandidateBucket_2925 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085372886287360 - maskLow := BitVec.ofNat 64 4611758590491164951 - maskHigh := BitVec.ofNat 64 564049498603521 - systematicCode := BitVec.ofNat 64 16415817988488440101 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148542375724032 - maskLow := BitVec.ofNat 64 144115192372199703 - maskHigh := BitVec.ofNat 64 564050538807809 - systematicCode := BitVec.ofNat 64 16415828026718365989 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36169573170447360 - maskLow := BitVec.ofNat 64 4611686024887992599 - maskHigh := BitVec.ofNat 64 703688515518465 - systematicCode := BitVec.ofNat 64 16420050008221493541 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9359635723355136 - maskLow := BitVec.ofNat 64 144115192372199703 - maskHigh := BitVec.ofNat 64 18015781522505729 - systematicCode := BitVec.ofNat 64 17064365224224827685 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36099208721236992 - maskLow := BitVec.ofNat 64 4647996294719406359 - maskHigh := BitVec.ofNat 64 18155136031391745 - systematicCode := BitVec.ofNat 64 17068558459766647077 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9288717189547008 - maskLow := BitVec.ofNat 64 144115192372199703 - maskHigh := BitVec.ofNat 64 18155137080033281 - systematicCode := BitVec.ofNat 64 17068568570976479525 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148523048380416 - maskLow := BitVec.ofNat 64 144115192372199703 - maskHigh := BitVec.ofNat 64 72057602636251777 - systematicCode := BitVec.ofNat 64 17420678253117647141 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085353558943744 - maskLow := BitVec.ofNat 64 36031550094377239 - maskHigh := BitVec.ofNat 64 72057602661416961 - systematicCode := BitVec.ofNat 64 17420683595031193893 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9289266945360896 - maskLow := BitVec.ofNat 64 144115192372199703 - maskHigh := BitVec.ofNat 64 9223372311732764801 - systematicCode := BitVec.ofNat 64 18360508953948006693 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36099758477050880 - maskLow := BitVec.ofNat 64 352397773046039 - maskHigh := BitVec.ofNat 64 9223372311766237185 - systematicCode := BitVec.ofNat 64 18360528486618048805 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9359090262510592 - maskLow := BitVec.ofNat 64 144115192372199703 - maskHigh := BitVec.ofNat 64 9296133318368034817 - systematicCode := BitVec.ofNat 64 18370714904948844837 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x2a0b. -/ -def normalizedWeightSixteenCandidateBucket_2a0b : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085407239570048 - maskLow := BitVec.ofNat 64 1297041095026344247 - maskHigh := BitVec.ofNat 64 1649267474433 - systematicCode := BitVec.ofNat 64 15046137649554532875 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148576729006720 - maskLow := BitVec.ofNat 64 140741785485623 - maskHigh := BitVec.ofNat 64 1649569432577 - systematicCode := BitVec.ofNat 64 15046167586030889483 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085387913396864 - maskLow := BitVec.ofNat 64 20270600666808631 - maskHigh := BitVec.ofNat 64 35201551990785 - systematicCode := BitVec.ofNat 64 15763898788425771531 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148557402833536 - maskLow := BitVec.ofNat 64 140741785485623 - maskHigh := BitVec.ofNat 64 35201556677633 - systematicCode := BitVec.ofNat 64 15763915530963921419 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18050205688791680 - maskLow := BitVec.ofNat 64 4403551600951 - maskHigh := BitVec.ofNat 64 35734127903745 - systematicCode := BitVec.ofNat 64 15766702434995874315 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9359670076637824 - maskLow := BitVec.ofNat 64 140741785485623 - maskHigh := BitVec.ofNat 64 5067666272321537 - systematicCode := BitVec.ofNat 64 16853543773439666699 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36046466516650112 - maskLow := BitVec.ofNat 64 1170936044852412727 - maskHigh := BitVec.ofNat 64 580964351930826753 - systematicCode := BitVec.ofNat 64 17863983641303591435 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2533352102037632 - maskLow := BitVec.ofNat 64 140741785485623 - maskHigh := BitVec.ofNat 64 580964352203423777 - systematicCode := BitVec.ofNat 64 17864013551943690763 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36046466550202496 - maskLow := BitVec.ofNat 64 146367129625624887 - maskHigh := BitVec.ofNat 64 4612248968380841985 - systematicCode := BitVec.ofNat 64 18294640329800428043 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2533352135590016 - maskLow := BitVec.ofNat 64 140741785485623 - maskHigh := BitVec.ofNat 64 4612248968414887969 - systematicCode := BitVec.ofNat 64 18294663643471424011 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9359674338314880 - maskLow := BitVec.ofNat 64 140741785485623 - maskHigh := BitVec.ofNat 64 5188182504858746881 - systematicCode := BitVec.ofNat 64 18300336191798389259 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x2a0e. -/ -def normalizedWeightSixteenCandidateBucket_2a0e : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10208966839773184 - maskLow := BitVec.ofNat 64 5188147874539569559 - maskHigh := BitVec.ofNat 64 1236950589441 - systematicCode := BitVec.ofNat 64 15045289939024554510 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9650414932862976 - maskLow := BitVec.ofNat 64 35188669219223 - maskHigh := BitVec.ofNat 64 1238158541057 - systematicCode := BitVec.ofNat 64 15045326472470014478 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11334870236276736 - maskLow := BitVec.ofNat 64 20267302131925399 - maskHigh := BitVec.ofNat 64 35188667064321 - systematicCode := BitVec.ofNat 64 15763051064960559630 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9659214515546112 - maskLow := BitVec.ofNat 64 35188669219223 - maskHigh := BitVec.ofNat 64 35188671774977 - systematicCode := BitVec.ofNat 64 15763071105983261198 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11339268014352384 - maskLow := BitVec.ofNat 64 1105016717719 - maskHigh := BitVec.ofNat 64 35321811042561 - systematicCode := BitVec.ofNat 64 15765854698645957134 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9593243817879552 - maskLow := BitVec.ofNat 64 35188669219223 - maskHigh := BitVec.ofNat 64 20267302129770497 - systematicCode := BitVec.ofNat 64 17070560967548152334 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11335454320650240 - maskLow := BitVec.ofNat 64 4629700558672953751 - maskHigh := BitVec.ofNat 64 594475150812913665 - systematicCode := BitVec.ofNat 64 17864824780583741966 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9659798599919616 - maskLow := BitVec.ofNat 64 35188669219223 - maskHigh := BitVec.ofNat 64 594475151890841633 - systematicCode := BitVec.ofNat 64 17864861275408509454 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11335454486315136 - maskLow := BitVec.ofNat 64 578712693853192599 - maskHigh := BitVec.ofNat 64 4613937818241081345 - systematicCode := BitVec.ofNat 64 18295481469080578574 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9659798765584512 - maskLow := BitVec.ofNat 64 35188669219223 - maskHigh := BitVec.ofNat 64 4613937818375815201 - systematicCode := BitVec.ofNat 64 18295511366936242702 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9593239759888512 - maskLow := BitVec.ofNat 64 35188669219223 - maskHigh := BitVec.ofNat 64 5188182092541861889 - systematicCode := BitVec.ofNat 64 18300336178862959118 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x2a15. -/ -def normalizedWeightSixteenCandidateBucket_2a15 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.node - (.leaf - { patternClass := .twoE8 - affineCode := BitVec.ofNat 56 2393087611534336 - maskLow := BitVec.ofNat 64 5066691316876567 - maskHigh := BitVec.ofNat 64 1285 - systematicCode := BitVec.ofNat 64 10705484472608500245 }) - (.leaf - { patternClass := .twoE8 - affineCode := BitVec.ofNat 56 18032541005020160 - maskLow := BitVec.ofNat 64 5519035139351 - maskHigh := BitVec.ofNat 64 1179681 - systematicCode := BitVec.ofNat 64 12151426839344392725 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10274116124895232 - maskLow := BitVec.ofNat 64 5188146912466896151 - maskHigh := BitVec.ofNat 64 9345 - systematicCode := BitVec.ofNat 64 11210743137155295765 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11400016031950848 - maskLow := BitVec.ofNat 64 1297036834418787607 - maskHigh := BitVec.ofNat 64 33153 - systematicCode := BitVec.ofNat 64 11426071481403714069 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11400016300369920 - maskLow := BitVec.ofNat 64 20266340059251991 - maskHigh := BitVec.ofNat 64 40965 - systematicCode := BitVec.ofNat 64 11428875184313608725 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18102914195407872 - maskLow := BitVec.ofNat 64 5764607544511235351 - maskHigh := BitVec.ofNat 64 1572993 - systematicCode := BitVec.ofNat 64 12152839884255865365 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18102914044422144 - maskLow := BitVec.ofNat 64 720575961856279831 - maskHigh := BitVec.ofNat 64 4325505 - systematicCode := BitVec.ofNat 64 12511720453691484693 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18102639183292416 - maskLow := BitVec.ofNat 64 175943337444631 - maskHigh := BitVec.ofNat 64 4718625 - systematicCode := BitVec.ofNat 64 12513122227535030805 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10274390986024960 - maskLow := BitVec.ofNat 64 4612389710166295831 - maskHigh := BitVec.ofNat 64 34079745 - systematicCode := BitVec.ofNat 64 12945478915846973973 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18102913926988800 - maskLow := BitVec.ofNat 64 4629701520745628951 - maskHigh := BitVec.ofNat 64 34611201 - systematicCode := BitVec.ofNat 64 12945768087588776469 }) - ) - ) - ) - ) - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11400290893080576 - maskLow := BitVec.ofNat 64 1153519643229488407 - maskHigh := BitVec.ofNat 64 134742273 - systematicCode := BitVec.ofNat 64 13161648386540775957 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18094117833753600 - maskLow := BitVec.ofNat 64 1170940305459971351 - maskHigh := BitVec.ofNat 64 135299073 - systematicCode := BitVec.ofNat 64 13161944155352738325 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11400291161499648 - maskLow := BitVec.ofNat 64 18577902515848471 - maskHigh := BitVec.ofNat 64 167772165 - systematicCode := BitVec.ofNat 64 13165012840581376533 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18102913776003072 - maskLow := BitVec.ofNat 64 578713655925867799 - maskHigh := BitVec.ofNat 64 268574721 - systematicCode := BitVec.ofNat 64 13376424776085613077 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10274391137010688 - maskLow := BitVec.ofNat 64 581105093716280599 - maskHigh := BitVec.ofNat 64 272630785 - systematicCode := BitVec.ofNat 64 13379513304265665045 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18102638914873344 - maskLow := BitVec.ofNat 64 142391052928279 - maskHigh := BitVec.ofNat 64 301989921 - systematicCode := BitVec.ofNat 64 13381191055543577109 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18094117682767872 - maskLow := BitVec.ofNat 64 146371390233183511 - maskHigh := BitVec.ofNat 64 1073905665 - systematicCode := BitVec.ofNat 64 13592600843849574933 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11400291044066304 - maskLow := BitVec.ofNat 64 148653976372446487 - maskHigh := BitVec.ofNat 64 1077936385 - systematicCode := BitVec.ofNat 64 13595682774959467029 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18093842821638144 - maskLow := BitVec.ofNat 64 40136471545111 - maskHigh := BitVec.ofNat 64 1207959585 - systematicCode := BitVec.ofNat 64 13598208249752922645 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11400291312485376 - maskLow := BitVec.ofNat 64 6755953494000919 - maskHigh := BitVec.ofNat 64 1342177285 - systematicCode := BitVec.ofNat 64 13599047233278257685 }) - ) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x2a1a. -/ -def normalizedWeightSixteenCandidateBucket_2a1a : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .twoE8 - affineCode := BitVec.ofNat 56 2261699730111488 - maskLow := BitVec.ofNat 64 21778997527 - maskHigh := BitVec.ofNat 64 21474836485 - systematicCode := BitVec.ofNat 64 14177759634281081370 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10208967645030400 - maskLow := BitVec.ofNat 64 5188146792207819031 - maskHigh := BitVec.ofNat 64 154618822785 - systematicCode := BitVec.ofNat 64 14683018449857620506 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9650415738120192 - maskLow := BitVec.ofNat 64 554052952343 - maskHigh := BitVec.ofNat 64 155826782213 - systematicCode := BitVec.ofNat 64 14683068177241287194 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11334867552086016 - maskLow := BitVec.ofNat 64 1297036714159710487 - maskHigh := BitVec.ofNat 64 554050781313 - systematicCode := BitVec.ofNat 64 14898346794106038810 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9659211831355392 - maskLow := BitVec.ofNat 64 554052952343 - maskHigh := BitVec.ofNat 64 554352771077 - systematicCode := BitVec.ofNat 64 14898393223005153818 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11339265598580736 - maskLow := BitVec.ofNat 64 22684967191 - maskHigh := BitVec.ofNat 64 687194767365 - systematicCode := BitVec.ofNat 64 14901150324511681050 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9593241133688832 - maskLow := BitVec.ofNat 64 554052952343 - maskHigh := BitVec.ofNat 64 1297036714157539457 - systematicCode := BitVec.ofNat 64 17938616601382169114 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11335456199583744 - maskLow := BitVec.ofNat 64 5764607664770326807 - maskHigh := BitVec.ofNat 64 1729382256910270593 - systematicCode := BitVec.ofNat 64 17939965405427280410 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9659800478853120 - maskLow := BitVec.ofNat 64 554052952343 - maskHigh := BitVec.ofNat 64 1729382258252447777 - systematicCode := BitVec.ofNat 64 17940015145729075738 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11335456365248640 - maskLow := BitVec.ofNat 64 720576082115371287 - maskHigh := BitVec.ofNat 64 4755801206503243905 - systematicCode := BitVec.ofNat 64 18298845974862899738 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9659800644518016 - maskLow := BitVec.ofNat 64 554052952343 - maskHigh := BitVec.ofNat 64 4755801206671015969 - systematicCode := BitVec.ofNat 64 18298889118195591706 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9593241101983872 - maskLow := BitVec.ofNat 64 554052952343 - maskHigh := BitVec.ofNat 64 5188147457925578881 - systematicCode := BitVec.ofNat 64 18300322984521312794 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x2a1f. -/ -def normalizedWeightSixteenCandidateBucket_2a1f : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11338722268440576 - maskLow := BitVec.ofNat 64 22584328471 - maskHigh := BitVec.ofNat 64 2814749767106565 - systematicCode := BitVec.ofNat 64 16637287980862679583 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089445580646400 - maskLow := BitVec.ofNat 64 141858477015319 - maskHigh := BitVec.ofNat 64 5066549580791841 - systematicCode := BitVec.ofNat 64 16853466368245574175 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711166976993280 - maskLow := BitVec.ofNat 64 141736116503 - maskHigh := BitVec.ofNat 64 5066549580824837 - systematicCode := BitVec.ofNat 64 16853488578394204703 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089445043562496 - maskLow := BitVec.ofNat 64 39603895632151 - maskHigh := BitVec.ofNat 64 20266198323167265 - systematicCode := BitVec.ofNat 64 17070483562454919711 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711166439909376 - maskLow := BitVec.ofNat 64 141736116503 - maskHigh := BitVec.ofNat 64 20266198323176453 - systematicCode := BitVec.ofNat 64 17070502499788139039 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11338722419426304 - maskLow := BitVec.ofNat 64 21879685399 - maskHigh := BitVec.ofNat 64 22517998136852485 - systematicCode := BitVec.ofNat 64 17071322394866952735 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11340917251001472 - maskLow := BitVec.ofNat 64 140742058148119 - maskHigh := BitVec.ofNat 64 580964351930826753 - systematicCode := BitVec.ofNat 64 17863983524448315935 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11338718393140224 - maskLow := BitVec.ofNat 64 1103947202839 - maskHigh := BitVec.ofNat 64 1157425104234217729 - systematicCode := BitVec.ofNat 64 17936026768983730719 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089441554114560 - maskLow := BitVec.ofNat 64 6051611115799 - maskHigh := BitVec.ofNat 64 1297036692682702881 - systematicCode := BitVec.ofNat 64 17938552360516135455 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711162950461440 - maskLow := BitVec.ofNat 64 141736116503 - maskHigh := BitVec.ofNat 64 1297036692682704257 - systematicCode := BitVec.ofNat 64 17938563618665277983 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9786517851777024 - maskLow := BitVec.ofNat 64 141736116503 - maskHigh := BitVec.ofNat 64 1751900255047122977 - systematicCode := BitVec.ofNat 64 17940068128445311519 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9786518017441920 - maskLow := BitVec.ofNat 64 141736116503 - maskHigh := BitVec.ofNat 64 4758615956270350369 - systematicCode := BitVec.ofNat 64 18298942100911827487 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089441522409600 - maskLow := BitVec.ofNat 64 176475913421079 - maskHigh := BitVec.ofNat 64 5188146770730811425 - systematicCode := BitVec.ofNat 64 18300247748706773535 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711162918756480 - maskLow := BitVec.ofNat 64 141736116503 - maskHigh := BitVec.ofNat 64 5188146770730852481 - systematicCode := BitVec.ofNat 64 18300270001804421663 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x2a23. -/ -def normalizedWeightSixteenCandidateBucket_2a23 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085372881928832 - maskLow := BitVec.ofNat 64 1152961091322708247 - maskHigh := BitVec.ofNat 64 2252899459530753 - systematicCode := BitVec.ofNat 64 16631994056218782243 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148542371365504 - maskLow := BitVec.ofNat 64 576460756600684823 - maskHigh := BitVec.ofNat 64 2252899593757697 - systematicCode := BitVec.ofNat 64 16631997501741083171 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36169569945127040 - maskLow := BitVec.ofNat 64 1152921510011404567 - maskHigh := BitVec.ofNat 64 2392537570476033 - systematicCode := BitVec.ofNat 64 16636219478898780707 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9359635718996608 - maskLow := BitVec.ofNat 64 576460756600684823 - maskHigh := BitVec.ofNat 64 4504853892038657 - systematicCode := BitVec.ofNat 64 16848190251728251427 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36046432159008896 - maskLow := BitVec.ofNat 64 1171498857367011607 - maskHigh := BitVec.ofNat 64 4644337249943553 - systematicCode := BitVec.ofNat 64 16852388963286133283 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2533317744396416 - maskLow := BitVec.ofNat 64 576460756600684823 - maskHigh := BitVec.ofNat 64 4644337388486657 - systematicCode := BitVec.ofNat 64 16852392486049819171 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148523045192320 - maskLow := BitVec.ofNat 64 576460756600684823 - maskHigh := BitVec.ofNat 64 144115205259920513 - systematicCode := BitVec.ofNat 64 17493297706187500067 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085353555755648 - maskLow := BitVec.ofNat 64 18019350609068311 - maskHigh := BitVec.ofNat 64 144115205389942785 - systematicCode := BitVec.ofNat 64 17493307433296013859 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2533867500208256 - maskLow := BitVec.ofNat 64 576460756600684823 - maskHigh := BitVec.ofNat 64 4611686155866480769 - systematicCode := BitVec.ofNat 64 18287889500878547491 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36046981914820736 - maskLow := BitVec.ofNat 64 598688378585367 - maskHigh := BitVec.ofNat 64 4611686156000559105 - systematicCode := BitVec.ofNat 64 18287911245422996003 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9359090258414208 - maskLow := BitVec.ofNat 64 576460756600684823 - maskHigh := BitVec.ofNat 64 4758193743939502081 - systematicCode := BitVec.ofNat 64 18298942084473039395 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x2a26. -/ -def normalizedWeightSixteenCandidateBucket_2a26 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10208417117513728 - maskLow := BitVec.ofNat 64 4611827859725025559 - maskHigh := BitVec.ofNat 64 564049498603521 - systematicCode := BitVec.ofNat 64 16415817988505152038 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9649865210603520 - maskLow := BitVec.ofNat 64 144115192373510423 - maskHigh := BitVec.ofNat 64 564050538823937 - systematicCode := BitVec.ofNat 64 16415828030996556326 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11338202931947520 - maskLow := BitVec.ofNat 64 4611686023832338711 - maskHigh := BitVec.ofNat 64 703688515518465 - systematicCode := BitVec.ofNat 64 16420050008204782118 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9592694095620096 - maskLow := BitVec.ofNat 64 144115192373510423 - maskHigh := BitVec.ofNat 64 18016052105445377 - systematicCode := BitVec.ofNat 64 17064366319441488422 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11333805153871872 - maskLow := BitVec.ofNat 64 4630263371187945751 - maskHigh := BitVec.ofNat 64 18155136031391745 - systematicCode := BitVec.ofNat 64 17068558459749935654 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9658149433141248 - maskLow := BitVec.ofNat 64 144115192373510423 - maskHigh := BitVec.ofNat 64 18155137075904513 - systematicCode := BitVec.ofNat 64 17068568566698289702 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9658664793286656 - maskLow := BitVec.ofNat 64 144115192373510423 - maskHigh := BitVec.ofNat 64 144115192375017857 - systematicCode := BitVec.ofNat 64 17492453268372269606 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11334320514017280 - maskLow := BitVec.ofNat 64 18016052074578199 - maskHigh := BitVec.ofNat 64 144115192404377601 - systematicCode := BitVec.ofNat 64 17492459709780666918 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9660863852462208 - maskLow := BitVec.ofNat 64 144115192373510423 - maskHigh := BitVec.ofNat 64 4611686568183365761 - systematicCode := BitVec.ofNat 64 18288733938693384742 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11336519573192832 - maskLow := BitVec.ofNat 64 704241495245079 - maskHigh := BitVec.ofNat 64 4611686568216756225 - systematicCode := BitVec.ofNat 64 18288752371868576294 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9592174673010816 - maskLow := BitVec.ofNat 64 144115192373510423 - maskHigh := BitVec.ofNat 64 4756504893978574849 - systematicCode := BitVec.ofNat 64 18298938785887627814 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x2a29. -/ -def normalizedWeightSixteenCandidateBucket_2a29 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .d16Plus - affineCode := BitVec.ofNat 56 54397257603162368 - maskLow := BitVec.ofNat 64 4503604198179095 - maskHigh := BitVec.ofNat 64 576601489792827393 - systematicCode := BitVec.ofNat 64 17861179812747160105 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9359635691735296 - maskLow := BitVec.ofNat 64 4611686022725566743 - maskHigh := BitVec.ofNat 64 564205157613569 - systematicCode := BitVec.ofNat 64 16415844687601740329 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2533317775851776 - maskLow := BitVec.ofNat 64 4611686022725566743 - maskHigh := BitVec.ofNat 64 703687476903937 - systematicCode := BitVec.ofNat 64 16420040303361927721 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36046432190464256 - maskLow := BitVec.ofNat 64 150870591815090455 - maskHigh := BitVec.ofNat 64 703688515518465 - systematicCode := BitVec.ofNat 64 16420049970274970153 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148542344104192 - maskLow := BitVec.ofNat 64 4611686022725566743 - maskHigh := BitVec.ofNat 64 18015498054673409 - systematicCode := BitVec.ofNat 64 17064336468899277353 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085372854667520 - maskLow := BitVec.ofNat 64 144154774792634647 - maskHigh := BitVec.ofNat 64 18015499094851585 - systematicCode := BitVec.ofNat 64 17064346191746312745 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36169569976582400 - maskLow := BitVec.ofNat 64 144115192776687895 - maskHigh := BitVec.ofNat 64 18155136031391745 - systematicCode := BitVec.ofNat 64 17068558420203219497 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2533867498111232 - maskLow := BitVec.ofNat 64 4611686022725566743 - maskHigh := BitVec.ofNat 64 576460889743433857 - systematicCode := BitVec.ofNat 64 17855550533721139753 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36046981912723712 - maskLow := BitVec.ofNat 64 4539338053452055 - maskHigh := BitVec.ofNat 64 576460890816118785 - systematicCode := BitVec.ofNat 64 17855572304034998825 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148523017931008 - maskLow := BitVec.ofNat 64 4611686022725566743 - maskHigh := BitVec.ofNat 64 1152921521787241601 - systematicCode := BitVec.ofNat 64 17925636673345694249 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085353528494336 - maskLow := BitVec.ofNat 64 2256751914189079 - maskHigh := BitVec.ofNat 64 1152921522860457985 - systematicCode := BitVec.ofNat 64 17925659568823544361 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36169571050258688 - maskLow := BitVec.ofNat 64 2251804250276119 - maskHigh := BitVec.ofNat 64 1153062242095726593 - systematicCode := BitVec.ofNat 64 17933236302961715753 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9359090264705280 - maskLow := BitVec.ofNat 64 4611686022725566743 - maskHigh := BitVec.ofNat 64 1747537393981849601 - systematicCode := BitVec.ofNat 64 17940068086337776169 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x2c0d. -/ -def normalizedWeightSixteenCandidateBucket_2c0d : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085407239521280 - maskLow := BitVec.ofNat 64 1441154084081041751 - maskHigh := BitVec.ofNat 64 1649267474433 - systematicCode := BitVec.ofNat 64 15046137649587956749 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148576728957952 - maskLow := BitVec.ofNat 64 140741787582807 - maskHigh := BitVec.ofNat 64 1649602986497 - systematicCode := BitVec.ofNat 64 15046167594587270157 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085387912177664 - maskLow := BitVec.ofNat 64 11261202390909271 - maskHigh := BitVec.ofNat 64 70377334145025 - systematicCode := BitVec.ofNat 64 15907451017958140941 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148557401614336 - maskLow := BitVec.ofNat 64 140741787582807 - maskHigh := BitVec.ofNat 64 70377336734209 - systematicCode := BitVec.ofNat 64 15907465570029546509 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18050205687572480 - maskLow := BitVec.ofNat 64 2203993571671 - maskHigh := BitVec.ofNat 64 70918499992065 - systematicCode := BitVec.ofNat 64 15910815415424986125 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9359670076589056 - maskLow := BitVec.ofNat 64 140741787582807 - maskHigh := BitVec.ofNat 64 5630607635808257 - systematicCode := BitVec.ofNat 64 16854106714803153933 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36046466516796416 - maskLow := BitVec.ofNat 64 1161928983038722391 - maskHigh := BitVec.ofNat 64 580964351930826753 - systematicCode := BitVec.ofNat 64 17863983641270168589 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2533352102183936 - maskLow := BitVec.ofNat 64 140741787582807 - maskHigh := BitVec.ofNat 64 580964352201326657 - systematicCode := BitVec.ofNat 64 17864013543387311117 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36046466550088704 - maskLow := BitVec.ofNat 64 290482455142531415 - maskHigh := BitVec.ofNat 64 2306968909120569345 - systematicCode := BitVec.ofNat 64 18151088100268059661 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2533352135476224 - maskLow := BitVec.ofNat 64 140741787582807 - maskHigh := BitVec.ofNat 64 2306968909188169793 - systematicCode := BitVec.ofNat 64 18151113604405799949 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9359674338266112 - maskLow := BitVec.ofNat 64 140741787582807 - maskHigh := BitVec.ofNat 64 2882374680017141761 - systematicCode := BitVec.ofNat 64 18156223202745789453 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x2c0e. -/ -def normalizedWeightSixteenCandidateBucket_2c0e : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10208966840943616 - maskLow := BitVec.ofNat 64 2882304865327972759 - maskHigh := BitVec.ofNat 64 1374389551105 - systematicCode := BitVec.ofNat 64 15045855079411297294 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9650414934033408 - maskLow := BitVec.ofNat 64 70373043405207 - maskHigh := BitVec.ofNat 64 1375060623617 - systematicCode := BitVec.ofNat 64 15045887223400311822 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11334870237447168 - maskLow := BitVec.ofNat 64 11260102879281559 - maskHigh := BitVec.ofNat 64 70373039161345 - systematicCode := BitVec.ofNat 64 15907168443469736974 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9659214516716544 - maskLow := BitVec.ofNat 64 70373043405207 - maskHigh := BitVec.ofNat 64 70373041766657 - systematicCode := BitVec.ofNat 64 15907184095035993102 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11339268015522816 - maskLow := BitVec.ofNat 64 1104481943959 - maskHigh := BitVec.ofNat 64 70643622084865 - systematicCode := BitVec.ofNat 64 15910532836641680398 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9593243819049984 - maskLow := BitVec.ofNat 64 70373043405207 - maskHigh := BitVec.ofNat 64 11260102875037697 - systematicCode := BitVec.ofNat 64 16926445779505982478 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11335454321544320 - maskLow := BitVec.ofNat 64 2314850487645569431 - maskHigh := BitVec.ofNat 64 585467951558180865 - systematicCode := BitVec.ofNat 64 17864264021030218766 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9659798600813696 - maskLow := BitVec.ofNat 64 70373043405207 - maskHigh := BitVec.ofNat 64 585467952097132609 - systematicCode := BitVec.ofNat 64 17864296117875584014 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11335454485924992 - maskLow := BitVec.ofNat 64 578712831294243223 - maskHigh := BitVec.ofNat 64 2308094809027395585 - systematicCode := BitVec.ofNat 64 18151368480028109838 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9659798765194368 - maskLow := BitVec.ofNat 64 70373043405207 - maskHigh := BitVec.ofNat 64 2308094809162121281 - systematicCode := BitVec.ofNat 64 18151396178894072846 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9593239760815104 - maskLow := BitVec.ofNat 64 70373043405207 - maskHigh := BitVec.ofNat 64 2882374405139218433 - systematicCode := BitVec.ofNat 64 18156223198433979406 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x2c13. -/ -def normalizedWeightSixteenCandidateBucket_2c13 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.node - (.leaf - { patternClass := .twoE8 - affineCode := BitVec.ofNat 56 2393087613468800 - maskLow := BitVec.ofNat 64 5629778711347991 - maskHigh := BitVec.ofNat 64 771 - systematicCode := BitVec.ofNat 64 10561367085543074835 }) - (.leaf - { patternClass := .twoE8 - affineCode := BitVec.ofNat 56 18032541006954624 - maskLow := BitVec.ofNat 64 3311424045847 - maskHigh := BitVec.ofNat 64 1310785 - systematicCode := BitVec.ofNat 64 12151991979731004435 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10274116126114432 - maskLow := BitVec.ofNat 64 2882304040694252311 - maskHigh := BitVec.ofNat 64 17025 - systematicCode := BitVec.ofNat 64 11354295366687927315 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11400016032958720 - maskLow := BitVec.ofNat 64 1441152159935693591 - maskHigh := BitVec.ofNat 64 33153 - systematicCode := BitVec.ofNat 64 11426071481437400083 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11400016301394048 - maskLow := BitVec.ofNat 64 11259278245561111 - maskHigh := BitVec.ofNat 64 49155 - systematicCode := BitVec.ofNat 64 11429435926653971475 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18102914195261568 - maskLow := BitVec.ofNat 64 3458764526709703447 - maskHigh := BitVec.ofNat 64 1572993 - systematicCode := BitVec.ofNat 64 12152839875665800211 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18102914045446272 - maskLow := BitVec.ofNat 64 864691141344297751 - maskHigh := BitVec.ofNat 64 2359425 - systematicCode := BitVec.ofNat 64 12368168215602474003 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18102639184316544 - maskLow := BitVec.ofNat 64 211119121695511 - maskHigh := BitVec.ofNat 64 2621505 - systematicCode := BitVec.ofNat 64 12369009238515854355 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10274390987244160 - maskLow := BitVec.ofNat 64 2307109650908119831 - maskHigh := BitVec.ofNat 64 67633665 - systematicCode := BitVec.ofNat 64 13089591896343194643 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18102913926826240 - maskLow := BitVec.ofNat 64 2314851312279290647 - maskHigh := BitVec.ofNat 64 68173825 - systematicCode := BitVec.ofNat 64 13089885466064399379 }) - ) - ) - ) - ) - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11400290894088448 - maskLow := BitVec.ofNat 64 1154117777557095191 - maskHigh := BitVec.ofNat 64 134742273 - systematicCode := BitVec.ofNat 64 13161648386574461971 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18094117833802368 - maskLow := BitVec.ofNat 64 1161930907184071447 - maskHigh := BitVec.ofNat 64 135299073 - systematicCode := BitVec.ofNat 64 13161944155319053331 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11400291162523776 - maskLow := BitVec.ofNat 64 10133653216625431 - maskHigh := BitVec.ofNat 64 201326595 - systematicCode := BitVec.ofNat 64 13165573582955162643 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18102913777010944 - maskLow := BitVec.ofNat 64 578713655927964439 - maskHigh := BitVec.ofNat 64 268713985 - systematicCode := BitVec.ofNat 64 13376989925062290451 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10274391137059456 - maskLow := BitVec.ofNat 64 581105093718377239 - maskHigh := BitVec.ofNat 64 270533121 - systematicCode := BitVec.ofNat 64 13378948155288988691 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18102638915881216 - maskLow := BitVec.ofNat 64 142391055024919 - maskHigh := BitVec.ofNat 64 335544385 - systematicCode := BitVec.ofNat 64 13381756204520254483 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18094117683987072 - maskLow := BitVec.ofNat 64 290484379287880471 - maskHigh := BitVec.ofNat 64 537165825 - systematicCode := BitVec.ofNat 64 13449048614316944403 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11400291043903744 - maskLow := BitVec.ofNat 64 292804348822487831 - maskHigh := BitVec.ofNat 64 538968321 - systematicCode := BitVec.ofNat 64 13451004645520256019 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18093842822857344 - maskLow := BitVec.ofNat 64 73121822475031 - maskHigh := BitVec.ofNat 64 671088705 - systematicCode := BitVec.ofNat 64 13454095269256702995 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11400291312339072 - maskLow := BitVec.ofNat 64 6755953496097559 - maskHigh := BitVec.ofNat 64 805306371 - systematicCode := BitVec.ofNat 64 13454929846179146771 }) - ) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x2c1c. -/ -def normalizedWeightSixteenCandidateBucket_2c1c : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .twoE8 - affineCode := BitVec.ofNat 56 2261699732045952 - maskLow := BitVec.ofNat 64 13224722711 - maskHigh := BitVec.ofNat 64 12884901891 - systematicCode := BitVec.ofNat 64 14033642238592166940 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10208967646249600 - maskLow := BitVec.ofNat 64 2882303774406295831 - maskHigh := BitVec.ofNat 64 283467841665 - systematicCode := BitVec.ofNat 64 14826570679389989916 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9650415739339392 - maskLow := BitVec.ofNat 64 554055057687 - maskHigh := BitVec.ofNat 64 284138930179 - systematicCode := BitVec.ofNat 64 14826618216306912284 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11334867553093888 - maskLow := BitVec.ofNat 64 1441151893647737111 - maskHigh := BitVec.ofNat 64 554050781313 - systematicCode := BitVec.ofNat 64 14898346794139462684 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9659211832363264 - maskLow := BitVec.ofNat 64 554055057687 - maskHigh := BitVec.ofNat 64 554386325507 - systematicCode := BitVec.ofNat 64 14898393231561534492 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11339265599604864 - maskLow := BitVec.ofNat 64 13560267031 - maskHigh := BitVec.ofNat 64 824633720835 - systematicCode := BitVec.ofNat 64 14901711066818358300 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9593241134696704 - maskLow := BitVec.ofNat 64 554055057687 - maskHigh := BitVec.ofNat 64 1441151893643460737 - systematicCode := BitVec.ofNat 64 17939177352312335388 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11335456200591616 - maskLow := BitVec.ofNat 64 3458764792997691671 - maskHigh := BitVec.ofNat 64 1729382256910270593 - systematicCode := BitVec.ofNat 64 17939965396837477404 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9659800479860992 - maskLow := BitVec.ofNat 64 554055057687 - maskHigh := BitVec.ofNat 64 1729382257715576897 - systematicCode := BitVec.ofNat 64 17940012946739375132 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11335456364972288 - maskLow := BitVec.ofNat 64 864691407632285975 - maskHigh := BitVec.ofNat 64 2594073385365405825 - systematicCode := BitVec.ofNat 64 18155293736774151196 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9659800644241664 - maskLow := BitVec.ofNat 64 554055057687 - maskHigh := BitVec.ofNat 64 2594073385566732353 - systematicCode := BitVec.ofNat 64 18155336888696646684 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9593241102991744 - maskLow := BitVec.ofNat 64 554055057687 - maskHigh := BitVec.ofNat 64 2882304586150838401 - systematicCode := BitVec.ofNat 64 18156207805035392028 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x2c1f. -/ -def normalizedWeightSixteenCandidateBucket_2c1f : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11338722269464704 - maskLow := BitVec.ofNat 64 13493174551 - maskHigh := BitVec.ofNat 64 3377699720527875 - systematicCode := BitVec.ofNat 64 16637848723169487903 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089445581654272 - maskLow := BitVec.ofNat 64 141849889177879 - maskHigh := BitVec.ofNat 64 5629499534213185 - systematicCode := BitVec.ofNat 64 16854031517222120479 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711166978001152 - maskLow := BitVec.ofNat 64 279177167127 - maskHigh := BitVec.ofNat 64 5629499534246147 - systematicCode := BitVec.ofNat 64 16854051528314203167 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089445044781696 - maskLow := BitVec.ofNat 64 72580656627991 - maskHigh := BitVec.ofNat 64 11258999068426305 - systematicCode := BitVec.ofNat 64 16926370581958568991 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711166441128576 - maskLow := BitVec.ofNat 64 279177167127 - maskHigh := BitVec.ofNat 64 11258999068443139 - systematicCode := BitVec.ofNat 64 16926389502112181279 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11338722419280000 - maskLow := BitVec.ofNat 64 13291847959 - maskHigh := BitVec.ofNat 64 13510798882111491 - systematicCode := BitVec.ofNat 64 16927204999177907231 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089441555122432 - maskLow := BitVec.ofNat 64 3852589957399 - maskHigh := BitVec.ofNat 64 1441151880758558785 - systematicCode := BitVec.ofNat 64 17939117500902878239 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711162951469312 - maskLow := BitVec.ofNat 64 279177167127 - maskHigh := BitVec.ofNat 64 1441151880758559617 - systematicCode := BitVec.ofNat 64 17939124369595575327 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9786517852784896 - maskLow := BitVec.ofNat 64 279177167127 - maskHigh := BitVec.ofNat 64 1742893055792382017 - systematicCode := BitVec.ofNat 64 17940065929455741983 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9786518017165568 - maskLow := BitVec.ofNat 64 279177167127 - maskHigh := BitVec.ofNat 64 2597451085085933633 - systematicCode := BitVec.ofNat 64 18155389871413013535 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089441523417472 - maskLow := BitVec.ofNat 64 211660287607063 - maskHigh := BitVec.ofNat 64 2882303761517117505 - systematicCode := BitVec.ofNat 64 18156134759687728159 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711162919764352 - maskLow := BitVec.ofNat 64 279177167127 - maskHigh := BitVec.ofNat 64 2882303761517166721 - systematicCode := BitVec.ofNat 64 18156154822318631967 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x2c25. -/ -def normalizedWeightSixteenCandidateBucket_2c25 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085372881880064 - maskLow := BitVec.ofNat 64 1152994076673769751 - maskHigh := BitVec.ofNat 64 2252899459530753 - systematicCode := BitVec.ofNat 64 16631994056252206117 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148542371316736 - maskLow := BitVec.ofNat 64 576460756602913047 - maskHigh := BitVec.ofNat 64 2252899593765377 - systematicCode := BitVec.ofNat 64 16631997510297463845 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36169569945273344 - maskLow := BitVec.ofNat 64 1152921509510316311 - maskHigh := BitVec.ofNat 64 2392537570476033 - systematicCode := BitVec.ofNat 64 16636219478865357861 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9359635718947840 - maskLow := BitVec.ofNat 64 576460756602913047 - maskHigh := BitVec.ofNat 64 4504982741057537 - systematicCode := BitVec.ofNat 64 16848192442161572901 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36046432159155200 - maskLow := BitVec.ofNat 64 1163054608067920151 - maskHigh := BitVec.ofNat 64 4644337249943553 - systematicCode := BitVec.ofNat 64 16852388963252710437 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2533317744542720 - maskLow := BitVec.ofNat 64 576460756602913047 - maskHigh := BitVec.ofNat 64 4644337386520577 - systematicCode := BitVec.ofNat 64 16852392477493439525 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148523043973120 - maskLow := BitVec.ofNat 64 576460756602913047 - maskHigh := BitVec.ofNat 64 288230384743744129 - systematicCode := BitVec.ofNat 64 17636847736696744997 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085353554536448 - maskLow := BitVec.ofNat 64 9009952333299991 - maskHigh := BitVec.ofNat 64 288230384875864065 - systematicCode := BitVec.ofNat 64 17636859662794959909 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2533867500094464 - maskLow := BitVec.ofNat 64 576460756602913047 - maskHigh := BitVec.ofNat 64 2305843284091879553 - systematicCode := BitVec.ofNat 64 18144339470369303589 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36046981914706944 - maskLow := BitVec.ofNat 64 1196822706323735 - maskHigh := BitVec.ofNat 64 2305843284225818625 - systematicCode := BitVec.ofNat 64 18144359015924050981 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9359090258365440 - maskLow := BitVec.ofNat 64 576460756602913047 - maskHigh := BitVec.ofNat 64 2596465922801664001 - systematicCode := BitVec.ofNat 64 18155389846350605349 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x2c26. -/ -def normalizedWeightSixteenCandidateBucket_2c26 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10208417118684160 - maskLow := BitVec.ofNat 64 2305984850513428759 - maskHigh := BitVec.ofNat 64 1126999485579265 - systematicCode := BitVec.ofNat 64 16559935367014329382 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9649865211773952 - maskLow := BitVec.ofNat 64 288230380451463447 - maskHigh := BitVec.ofNat 64 1126999955374337 - systematicCode := BitVec.ofNat 64 16559941020049288230 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11338202932841600 - maskLow := BitVec.ofNat 64 2305843014117425431 - maskHigh := BitVec.ofNat 64 1266637932068865 - systematicCode := BitVec.ofNat 64 16564162988634024998 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9592694096790528 - maskLow := BitVec.ofNat 64 288230380451463447 - maskHigh := BitVec.ofNat 64 9008852884258817 - systematicCode := BitVec.ofNat 64 16920251131399318566 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11333805154765952 - maskLow := BitVec.ofNat 64 2315976112675029271 - maskHigh := BitVec.ofNat 64 9147936810205185 - systematicCode := BitVec.ofNat 64 16924445462073977894 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9658149434035328 - maskLow := BitVec.ofNat 64 288230380451463447 - maskHigh := BitVec.ofNat 64 9147937282326529 - systematicCode := BitVec.ofNat 64 16924451171042929702 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9658664794457088 - maskLow := BitVec.ofNat 64 288230380451463447 - maskHigh := BitVec.ofNat 64 288230380448776577 - systematicCode := BitVec.ofNat 64 17636566257425001510 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11334320515187712 - maskLow := BitVec.ofNat 64 9008852821934359 - maskHigh := BitVec.ofNat 64 288230380513787905 - systematicCode := BitVec.ofNat 64 17636577088289844262 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9660863852072064 - maskLow := BitVec.ofNat 64 288230380451463447 - maskHigh := BitVec.ofNat 64 2305843558969802881 - systematicCode := BitVec.ofNat 64 18144620949640916006 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11336519572802688 - maskLow := BitVec.ofNat 64 1267191450763543 - maskHigh := BitVec.ofNat 64 2305843559036616705 - systematicCode := BitVec.ofNat 64 18144639391405911078 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9592174673937408 - maskLow := BitVec.ofNat 64 288230380451463447 - maskHigh := BitVec.ofNat 64 2595340022827712513 - systematicCode := BitVec.ofNat 64 18155388746822134822 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x2c29. -/ -def normalizedWeightSixteenCandidateBucket_2c29 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9359635691897856 - maskLow := BitVec.ofNat 64 2305843013513969943 - maskHigh := BitVec.ofNat 64 1127283423182849 - systematicCode := BitVec.ofNat 64 16559962066077232169 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2533317775754240 - maskLow := BitVec.ofNat 64 2305843013513969943 - maskHigh := BitVec.ofNat 64 1266637463879681 - systematicCode := BitVec.ofNat 64 16564157690460908585 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36046432190366720 - maskLow := BitVec.ofNat 64 294985779893043479 - maskHigh := BitVec.ofNat 64 1266637932068865 - systematicCode := BitVec.ofNat 64 16564162967917505577 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148542344266752 - maskLow := BitVec.ofNat 64 2305843013513969943 - maskHigh := BitVec.ofNat 64 9008298833494529 - systematicCode := BitVec.ofNat 64 16920223488402926633 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085372854830080 - maskLow := BitVec.ofNat 64 288302948219420951 - maskHigh := BitVec.ofNat 64 9008299303239681 - systematicCode := BitVec.ofNat 64 16920228813270559785 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36169569976484864 - maskLow := BitVec.ofNat 64 288230380854640919 - maskHigh := BitVec.ofNat 64 9147936810205185 - systematicCode := BitVec.ofNat 64 16924445439740554281 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2533867498013696 - maskLow := BitVec.ofNat 64 2305843013513969943 - maskHigh := BitVec.ofNat 64 576461027182395521 - systematicCode := BitVec.ofNat 64 17856113492264365097 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36046981912626176 - maskLow := BitVec.ofNat 64 4574522427638039 - maskHigh := BitVec.ofNat 64 576461027718201345 - systematicCode := BitVec.ofNat 64 17856133054998719529 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148523016923136 - maskLow := BitVec.ofNat 64 2305843013513969943 - maskHigh := BitVec.ofNat 64 1152921513197306497 - systematicCode := BitVec.ofNat 64 17925073714802207785 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085353527486464 - maskLow := BitVec.ofNat 64 2254552893030679 - maskHigh := BitVec.ofNat 64 1152921513733652481 - systematicCode := BitVec.ofNat 64 17925094419813313577 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9359090264607744 - maskLow := BitVec.ofNat 64 2305843013513969943 - maskHigh := BitVec.ofNat 64 1738530194190237697 - systematicCode := BitVec.ofNat 64 17940065887280835625 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x2c2a. -/ -def normalizedWeightSixteenCandidateBucket_2c2a : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9592694196667392 - maskLow := BitVec.ofNat 64 1152921508908171543 - maskHigh := BitVec.ofNat 64 2253453644529665 - systematicCode := BitVec.ofNat 64 16632020755314977834 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9658149498539136 - maskLow := BitVec.ofNat 64 1152921508908171543 - maskHigh := BitVec.ofNat 64 2392537437831169 - systematicCode := BitVec.ofNat 64 16636216384010398762 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11333805219269760 - maskLow := BitVec.ofNat 64 583216156045803799 - maskHigh := BitVec.ofNat 64 2392537570476033 - systematicCode := BitVec.ofNat 64 16636219466738773034 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9649865311650816 - maskLow := BitVec.ofNat 64 1152921508908171543 - maskHigh := BitVec.ofNat 64 4504699273249025 - systematicCode := BitVec.ofNat 64 16848166998154751018 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10208417218561024 - maskLow := BitVec.ofNat 64 576602593604731159 - maskHigh := BitVec.ofNat 64 4504699407433729 - systematicCode := BitVec.ofNat 64 16848170124032683050 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11338202997345408 - maskLow := BitVec.ofNat 64 576460757007401239 - maskHigh := BitVec.ofNat 64 4644337249943553 - systematicCode := BitVec.ofNat 64 16852388949509221418 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9660863752195200 - maskLow := BitVec.ofNat 64 1152921508908171543 - maskHigh := BitVec.ofNat 64 576461302060318849 - systematicCode := BitVec.ofNat 64 17856394971535977514 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11336519472925824 - maskLow := BitVec.ofNat 64 4644891172864279 - maskHigh := BitVec.ofNat 64 576461302327672833 - systematicCode := BitVec.ofNat 64 17856413430480579626 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9658664894333952 - maskLow := BitVec.ofNat 64 1152921508908171543 - maskHigh := BitVec.ofNat 64 1152921508902338945 - systematicCode := BitVec.ofNat 64 17924792235530464298 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11334320615064576 - maskLow := BitVec.ofNat 64 2253453382451479 - maskHigh := BitVec.ofNat 64 1152921509170249729 - systematicCode := BitVec.ofNat 64 17924811845308197930 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9592174742602752 - maskLow := BitVec.ofNat 64 1152921508908171543 - maskHigh := BitVec.ofNat 64 1734026594294431745 - systematicCode := BitVec.ofNat 64 17940064787752365098 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x2f13. -/ -def normalizedWeightSixteenCandidateBucket_2f13 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11330472174160000 - maskLow := BitVec.ofNat 64 10133378342912791 - maskHigh := BitVec.ofNat 64 13194139533315 - systematicCode := BitVec.ofNat 64 15480423791423401747 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9096264546519168 - maskLow := BitVec.ofNat 64 12893356823 - maskHigh := BitVec.ofNat 64 13194141892673 - systematicCode := BitVec.ofNat 64 15480468017372147475 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18050274674608384 - maskLow := BitVec.ofNat 64 281345590039 - maskHigh := BitVec.ofNat 64 21990232555585 - systematicCode := BitVec.ofNat 64 15696606335358545683 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18050205955129984 - maskLow := BitVec.ofNat 64 280288625431 - maskHigh := BitVec.ofNat 64 43980465111105 - systematicCode := BitVec.ofNat 64 15768945404356472595 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11330472323975296 - maskLow := BitVec.ofNat 64 6755678622384919 - maskHigh := BitVec.ofNat 64 52776558133251 - systematicCode := BitVec.ofNat 64 15769780054647385875 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9096264696334464 - maskLow := BitVec.ofNat 64 12893356823 - maskHigh := BitVec.ofNat 64 52776559706177 - systematicCode := BitVec.ofNat 64 15769821007780720403 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11332121490753664 - maskLow := BitVec.ofNat 64 5630053593449239 - maskHigh := BitVec.ofNat 64 216172782113783811 - systematicCode := BitVec.ofNat 64 17505917710948577043 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9097913863112832 - maskLow := BitVec.ofNat 64 12893356823 - maskHigh := BitVec.ofNat 64 216172782115094657 - systematicCode := BitVec.ofNat 64 17505958651297476371 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9026991068151936 - maskLow := BitVec.ofNat 64 12893356823 - maskHigh := BitVec.ofNat 64 4755845186968354819 - systematicCode := BitVec.ofNat 64 18298928850819821331 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9026991068153984 - maskLow := BitVec.ofNat 64 12893356823 - maskHigh := BitVec.ofNat 64 9295451621125259267 - systematicCode := BitVec.ofNat 64 18370703866074443539 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11332121524568192 - maskLow := BitVec.ofNat 64 11259553127662359 - maskHigh := BitVec.ofNat 64 13835058055282163715 - systematicCode := BitVec.ofNat 64 18373986552059473683 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9097913896927360 - maskLow := BitVec.ofNat 64 12893356823 - maskHigh := BitVec.ofNat 64 13835058055284785281 - systematicCode := BitVec.ofNat 64 18374030790892924691 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x2f15. -/ -def normalizedWeightSixteenCandidateBucket_2f15 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11330472173135872 - maskLow := BitVec.ofNat 64 18577490205279511 - maskHigh := BitVec.ofNat 64 10995116277765 - systematicCode := BitVec.ofNat 64 15479863049049485077 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9096264545495040 - maskLow := BitVec.ofNat 64 21483291927 - maskHigh := BitVec.ofNat 64 10995120603169 - systematicCode := BitVec.ofNat 64 15479907257818623765 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18050274673600512 - maskLow := BitVec.ofNat 64 143906637079 - maskHigh := BitVec.ofNat 64 19791209300001 - systematicCode := BitVec.ofNat 64 15696041177791934229 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18050205953910784 - maskLow := BitVec.ofNat 64 142346355991 - maskHigh := BitVec.ofNat 64 79164837199905 - systematicCode := BitVec.ofNat 64 15913058384785714965 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11330472324121600 - maskLow := BitVec.ofNat 64 6755541183431959 - maskHigh := BitVec.ofNat 64 87960930222085 - systematicCode := BitVec.ofNat 64 15913897441746366229 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9096264696480768 - maskLow := BitVec.ofNat 64 21483291927 - maskHigh := BitVec.ofNat 64 87960931794977 - systematicCode := BitVec.ofNat 64 15913936195823152917 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11332121490899968 - maskLow := BitVec.ofNat 64 5067103640028439 - maskHigh := BitVec.ofNat 64 360287970189639685 - systematicCode := BitVec.ofNat 64 17650035098014134037 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9097913863259136 - maskLow := BitVec.ofNat 64 21483291927 - maskHigh := BitVec.ofNat 64 360287970190819457 - systematicCode := BitVec.ofNat 64 17650073830783528725 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9026991068038144 - maskLow := BitVec.ofNat 64 21483291927 - maskHigh := BitVec.ofNat 64 2594152550202605573 - systematicCode := BitVec.ofNat 64 18155378811754327829 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9026991068300288 - maskLow := BitVec.ofNat 64 21483291927 - maskHigh := BitVec.ofNat 64 9295449422102003717 - systematicCode := BitVec.ofNat 64 18370703857518194453 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11332121524194304 - maskLow := BitVec.ofNat 64 20266752382403863 - maskHigh := BitVec.ofNat 64 11529215046068469765 - systematicCode := BitVec.ofNat 64 18373425809719242517 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9097913896553472 - maskLow := BitVec.ofNat 64 21483291927 - maskHigh := BitVec.ofNat 64 11529215046073188481 - systematicCode := BitVec.ofNat 64 18373470039962890005 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x2f16. -/ -def normalizedWeightSixteenCandidateBucket_2f16 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089854680442880 - maskLow := BitVec.ofNat 64 36310345018575127 - maskHigh := BitVec.ofNat 64 6597069766665 - systematicCode := BitVec.ofNat 64 15407806558801309462 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711576076789760 - maskLow := BitVec.ofNat 64 38663162135 - maskHigh := BitVec.ofNat 64 6597078220817 - systematicCode := BitVec.ofNat 64 15407850758980644630 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11339267748014080 - maskLow := BitVec.ofNat 64 74130196759 - maskHigh := BitVec.ofNat 64 37383395344401 - systematicCode := BitVec.ofNat 64 15768097668006555414 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11339267749184512 - maskLow := BitVec.ofNat 64 73626880279 - maskHigh := BitVec.ofNat 64 74766790688785 - systematicCode := BitVec.ofNat 64 15912775806002409238 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089785933703168 - maskLow := BitVec.ofNat 64 6755472463956247 - maskHigh := BitVec.ofNat 64 105553116266505 - systematicCode := BitVec.ofNat 64 15914180016234639126 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711507330050048 - maskLow := BitVec.ofNat 64 38663162135 - maskHigh := BitVec.ofNat 64 105553117839377 - systematicCode := BitVec.ofNat 64 15914217670783151894 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089339284367360 - maskLow := BitVec.ofNat 64 4785628663318807 - maskHigh := BitVec.ofNat 64 432345564227567625 - systematicCode := BitVec.ofNat 64 17650317672485695254 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711060680714240 - maskLow := BitVec.ofNat 64 38663162135 - maskHigh := BitVec.ofNat 64 432345564228681857 - systematicCode := BitVec.ofNat 64 17650355301465337622 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9786347430635520 - maskLow := BitVec.ofNat 64 38663162135 - maskHigh := BitVec.ofNat 64 2594148152156094473 - systematicCode := BitVec.ofNat 64 18155378807476203286 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9786347431919744 - maskLow := BitVec.ofNat 64 38663162135 - maskHigh := BitVec.ofNat 64 4755838589898588169 - systematicCode := BitVec.ofNat 64 18298928837985447702 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089339252662400 - maskLow := BitVec.ofNat 64 38281150891886871 - maskHigh := BitVec.ofNat 64 6917529027641081865 - systematicCode := BitVec.ofNat 64 18301369319487909654 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711060649009280 - maskLow := BitVec.ofNat 64 38663162135 - maskHigh := BitVec.ofNat 64 6917529027649994881 - systematicCode := BitVec.ofNat 64 18301413545436655382 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x2f19. -/ -def normalizedWeightSixteenCandidateBucket_2f19 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18050274677762048 - maskLow := BitVec.ofNat 64 40827425047 - maskHigh := BitVec.ofNat 64 6597069766665 - systematicCode := BitVec.ofNat 64 15407806386413842201 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11330472191862784 - maskLow := BitVec.ofNat 64 18577387126067479 - maskHigh := BitVec.ofNat 64 37383395344401 - systematicCode := BitVec.ofNat 64 15768097823247445785 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9096264564221952 - maskLow := BitVec.ofNat 64 73022902551 - maskHigh := BitVec.ofNat 64 37383399669769 - systematicCode := BitVec.ofNat 64 15768137633903488793 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11330472193033216 - maskLow := BitVec.ofNat 64 10133137824747799 - maskHigh := BitVec.ofNat 64 74766790688785 - systematicCode := BitVec.ofNat 64 15912775952720342809 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9096264565392384 - maskLow := BitVec.ofNat 64 73022902551 - maskHigh := BitVec.ofNat 64 74766793048073 - systematicCode := BitVec.ofNat 64 15912813581499445017 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18050205931022336 - maskLow := BitVec.ofNat 64 39065817367 - maskHigh := BitVec.ofNat 64 105553116266505 - systematicCode := BitVec.ofNat 64 15914179869416042265 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11332121459688448 - maskLow := BitVec.ofNat 64 1689403919503639 - maskHigh := BitVec.ofNat 64 1224979098644774929 - systematicCode := BitVec.ofNat 64 17938269855032487705 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9097913832047616 - maskLow := BitVec.ofNat 64 73022902551 - maskHigh := BitVec.ofNat 64 1224979098645168257 - systematicCode := BitVec.ofNat 64 17938299808888991513 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9026991003534336 - maskLow := BitVec.ofNat 64 73022902551 - maskHigh := BitVec.ofNat 64 1729487810026536977 - systematicCode := BitVec.ofNat 64 17940050471817916185 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9026991037088768 - maskLow := BitVec.ofNat 64 73022902551 - maskHigh := BitVec.ofNat 64 9295436227962470417 - systematicCode := BitVec.ofNat 64 18370699459539054361 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11332121426398208 - maskLow := BitVec.ofNat 64 27022151823462679 - maskHigh := BitVec.ofNat 64 9799832789158199313 - systematicCode := BitVec.ofNat 64 18372304307926019865 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9097913798757376 - maskLow := BitVec.ofNat 64 73022902551 - maskHigh := BitVec.ofNat 64 9799832789164490881 - systematicCode := BitVec.ofNat 64 18372344157236178713 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x2f1a. -/ -def normalizedWeightSixteenCandidateBucket_2f1a : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11339267729287168 - maskLow := BitVec.ofNat 64 22590595351 - maskHigh := BitVec.ofNat 64 10995116277765 - systematicCode := BitVec.ofNat 64 15479862876628463386 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089854676281344 - maskLow := BitVec.ofNat 64 36310293478973719 - maskHigh := BitVec.ofNat 64 19791209300001 - systematicCode := BitVec.ofNat 64 15696041332999270170 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711576072628224 - maskLow := BitVec.ofNat 64 141742383383 - maskHigh := BitVec.ofNat 64 19791217754117 - systematicCode := BitVec.ofNat 64 15696081135065509658 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089785956591616 - maskLow := BitVec.ofNat 64 10133120644882711 - maskHigh := BitVec.ofNat 64 79164837199905 - systematicCode := BitVec.ofNat 64 15913058527208615706 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711507352938496 - maskLow := BitVec.ofNat 64 141742383383 - maskHigh := BitVec.ofNat 64 79164839559173 - systematicCode := BitVec.ofNat 64 15913095056459443994 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11339267880272896 - maskLow := BitVec.ofNat 64 21885952279 - maskHigh := BitVec.ofNat 64 87960930222085 - systematicCode := BitVec.ofNat 64 15913897290632736538 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089339280205824 - maskLow := BitVec.ofNat 64 1407928942797079 - maskHigh := BitVec.ofNat 64 1297036692682702881 - systematicCode := BitVec.ofNat 64 17938552429504048922 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711060676552704 - maskLow := BitVec.ofNat 64 141742383383 - maskHigh := BitVec.ofNat 64 1297036692683030657 - systematicCode := BitVec.ofNat 64 17938581279570800410 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9786347395262464 - maskLow := BitVec.ofNat 64 141742383383 - maskHigh := BitVec.ofNat 64 1729470217840492577 - systematicCode := BitVec.ofNat 64 17940050467539791642 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9786347560927360 - maskLow := BitVec.ofNat 64 141742383383 - maskHigh := BitVec.ofNat 64 4755812201619521569 - systematicCode := BitVec.ofNat 64 18298924440006307610 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089339248500864 - maskLow := BitVec.ofNat 64 45036550332948759 - maskHigh := BitVec.ofNat 64 5188146770730811425 - systematicCode := BitVec.ofNat 64 18300247817694687002 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711060644847744 - maskLow := BitVec.ofNat 64 141742383383 - maskHigh := BitVec.ofNat 64 5188146770741297281 - systematicCode := BitVec.ofNat 64 18300287662709944090 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x2f1c. -/ -def normalizedWeightSixteenCandidateBucket_2f1c : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11339267730311296 - maskLow := BitVec.ofNat 64 13497352471 - maskHigh := BitVec.ofNat 64 13194139533315 - systematicCode := BitVec.ofNat 64 15480423618935271196 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089854677289216 - maskLow := BitVec.ofNat 64 36310284889047319 - maskHigh := BitVec.ofNat 64 21990232555585 - systematicCode := BitVec.ofNat 64 15696606481975815964 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711576073636096 - maskLow := BitVec.ofNat 64 279181345047 - maskHigh := BitVec.ofNat 64 21990241009667 - systematicCode := BitVec.ofNat 64 15696644084985507612 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089785957810816 - maskLow := BitVec.ofNat 64 18577361356275991 - maskHigh := BitVec.ofNat 64 43980465111105 - systematicCode := BitVec.ofNat 64 15768945546712264476 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711507354157696 - maskLow := BitVec.ofNat 64 279181345047 - maskHigh := BitVec.ofNat 64 43980469436419 - systematicCode := BitVec.ofNat 64 15768982058783485724 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11339267880126592 - maskLow := BitVec.ofNat 64 13296025879 - maskHigh := BitVec.ofNat 64 52776558133251 - systematicCode := BitVec.ofNat 64 15769779894943690524 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089339281213696 - maskLow := BitVec.ofNat 64 844978989383959 - maskHigh := BitVec.ofNat 64 1441151880758558785 - systematicCode := BitVec.ofNat 64 17939117569890791196 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711060677560576 - maskLow := BitVec.ofNat 64 279181345047 - maskHigh := BitVec.ofNat 64 1441151880758755457 - systematicCode := BitVec.ofNat 64 17939142030501097244 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9786347396270336 - maskLow := BitVec.ofNat 64 279181345047 - maskHigh := BitVec.ofNat 64 1729435033468403777 - systematicCode := BitVec.ofNat 64 17940048268550221596 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9786347560651008 - maskLow := BitVec.ofNat 64 279181345047 - maskHigh := BitVec.ofNat 64 2594086579504939073 - systematicCode := BitVec.ofNat 64 18155372210507493148 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089339249508736 - maskLow := BitVec.ofNat 64 54043749587697943 - maskHigh := BitVec.ofNat 64 2882303761517117505 - systematicCode := BitVec.ofNat 64 18156134828675641116 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711060645855616 - maskLow := BitVec.ofNat 64 279181345047 - maskHigh := BitVec.ofNat 64 2882303761529700481 - systematicCode := BitVec.ofNat 64 18156172483224153884 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x2f1f. -/ -def normalizedWeightSixteenCandidateBucket_2f1f : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11338735203518592 - maskLow := BitVec.ofNat 64 13228933399 - maskHigh := BitVec.ofNat 64 216172782113783811 - systematicCode := BitVec.ofNat 64 17505917551294820127 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11338735203664896 - maskLow := BitVec.ofNat 64 21785313559 - maskHigh := BitVec.ofNat 64 360287970189639685 - systematicCode := BitVec.ofNat 64 17650034946983735071 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18050168377321472 - maskLow := BitVec.ofNat 64 38948405527 - maskHigh := BitVec.ofNat 64 432345564227567625 - systematicCode := BitVec.ofNat 64 17650317525766975263 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11338735172453376 - maskLow := BitVec.ofNat 64 73123594519 - maskHigh := BitVec.ofNat 64 1224979098644774929 - systematicCode := BitVec.ofNat 64 17938269738294718239 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18050168373159936 - maskLow := BitVec.ofNat 64 141826294039 - maskHigh := BitVec.ofNat 64 1297036692682702881 - systematicCode := BitVec.ofNat 64 17938552317077958431 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18050168374167808 - maskLow := BitVec.ofNat 64 279231693079 - maskHigh := BitVec.ofNat 64 1441151880758558785 - systematicCode := BitVec.ofNat 64 17939117474611015455 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9928081347248384 - maskLow := BitVec.ofNat 64 554059268375 - maskHigh := BitVec.ofNat 64 1657324662872342657 - systematicCode := BitVec.ofNat 64 17939230335028899615 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9852725846147328 - maskLow := BitVec.ofNat 64 554059268375 - maskHigh := BitVec.ofNat 64 1729382256910270577 - systematicCode := BitVec.ofNat 64 17939962167290703647 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36104665470927104 - maskLow := BitVec.ofNat 64 485339791639 - maskHigh := BitVec.ofNat 64 1729382256910270593 - systematicCode := BitVec.ofNat 64 17939965198480256799 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9852725852389632 - maskLow := BitVec.ofNat 64 554059268375 - maskHigh := BitVec.ofNat 64 2594073385365405773 - systematicCode := BitVec.ofNat 64 18155290507227377439 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36104665477169408 - maskLow := BitVec.ofNat 64 330720968983 - maskHigh := BitVec.ofNat 64 2594073385365405825 - systematicCode := BitVec.ofNat 64 18155293555596537631 }) - ) - ) - ) - ) - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18050168342462848 - maskLow := BitVec.ofNat 64 282402586903 - maskHigh := BitVec.ofNat 64 2882303761517117505 - systematicCode := BitVec.ofNat 64 18156134681857044255 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9852725852405888 - maskLow := BitVec.ofNat 64 554059268375 - maskHigh := BitVec.ofNat 64 4755801206503243819 - systematicCode := BitVec.ofNat 64 18298840546293002015 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36104665477185664 - maskLow := BitVec.ofNat 64 184692080919 - maskHigh := BitVec.ofNat 64 4755801206503243905 - systematicCode := BitVec.ofNat 64 18298845785128906527 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18050168341454976 - maskLow := BitVec.ofNat 64 144426762519 - maskHigh := BitVec.ofNat 64 5188146770730811425 - systematicCode := BitVec.ofNat 64 18300247662319578911 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18050168345616512 - maskLow := BitVec.ofNat 64 40944894231 - maskHigh := BitVec.ofNat 64 6917529027641081865 - systematicCode := BitVec.ofNat 64 18301369146999779103 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9852725877604608 - maskLow := BitVec.ofNat 64 554059268375 - maskHigh := BitVec.ofNat 64 9295429630892703767 - systematicCode := BitVec.ofNat 64 18370615561547624223 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36104665502384384 - maskLow := BitVec.ofNat 64 98792734999 - maskHigh := BitVec.ofNat 64 9295429630892703873 - systematicCode := BitVec.ofNat 64 18370621899878379295 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11338735139163136 - maskLow := BitVec.ofNat 64 74633543959 - maskHigh := BitVec.ofNat 64 9799832789158199313 - systematicCode := BitVec.ofNat 64 18372304152534134559 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11338735236959232 - maskLow := BitVec.ofNat 64 22691283223 - maskHigh := BitVec.ofNat 64 11529215046068469765 - systematicCode := BitVec.ofNat 64 18373425637214334751 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11338735237333120 - maskLow := BitVec.ofNat 64 13564477719 - maskHigh := BitVec.ofNat 64 13835058055282163715 - systematicCode := BitVec.ofNat 64 18373986379521011487 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9928081316071808 - maskLow := BitVec.ofNat 64 554059268375 - maskHigh := BitVec.ofNat 64 16717361816799281281 - systematicCode := BitVec.ofNat 64 18374119095421316895 }) - ) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x310e. -/ -def normalizedWeightSixteenCandidateBucket_310e : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.node - (.leaf - { patternClass := .twoE8 - affineCode := BitVec.ofNat 56 18032059717139456 - maskLow := BitVec.ofNat 64 72340172838076823 - maskHigh := BitVec.ofNat 64 105 - systematicCode := BitVec.ofNat 64 10127054529323151630 }) - (.leaf - { patternClass := .twoE8 - affineCode := BitVec.ofNat 56 2392606323653632 - maskLow := BitVec.ofNat 64 450988409239 - maskHigh := BitVec.ofNat 64 16843009 - systematicCode := BitVec.ofNat 64 12727613778775388430 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18102982513263616 - maskLow := BitVec.ofNat 64 4629701520760308119 - maskHigh := BitVec.ofNat 64 10305 - systematicCode := BitVec.ofNat 64 11211584263400009998 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18102982512093184 - maskLow := BitVec.ofNat 64 2314851312291873175 - maskHigh := BitVec.ofNat 64 18465 - systematicCode := BitVec.ofNat 64 11355697243829121294 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18102982495447040 - maskLow := BitVec.ofNat 64 578713655940546967 - maskHigh := BitVec.ofNat 64 24585 - systematicCode := BitVec.ofNat 64 11356818728442474766 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18102948421960704 - maskLow := BitVec.ofNat 64 4612037866460086679 - maskHigh := BitVec.ofNat 64 2621505 - systematicCode := BitVec.ofNat 64 12369009367433687310 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18102948420790272 - maskLow := BitVec.ofNat 64 2306159672874303895 - maskHigh := BitVec.ofNat 64 4718625 - systematicCode := BitVec.ofNat 64 12513122347896221966 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18102948404144128 - maskLow := BitVec.ofNat 64 576751027684966807 - maskHigh := BitVec.ofNat 64 6291465 - systematicCode := BitVec.ofNat 64 12514243832576422158 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10274422124718080 - maskLow := BitVec.ofNat 64 6917529066312630679 - maskHigh := BitVec.ofNat 64 17303553 - systematicCode := BitVec.ofNat 64 12729309432669155598 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10274422141364224 - maskLow := BitVec.ofNat 64 5188146912481575319 - maskHigh := BitVec.ofNat 64 18882561 - systematicCode := BitVec.ofNat 64 12730439730555662606 }) - ) - ) - ) - ) - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10274422142534656 - maskLow := BitVec.ofNat 64 2882304040706834839 - maskHigh := BitVec.ofNat 64 20987905 - systematicCode := BitVec.ofNat 64 12731004870942535950 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11400325521221632 - maskLow := BitVec.ofNat 64 27021636435771799 - maskHigh := BitVec.ofNat 64 134285313 - systematicCode := BitVec.ofNat 64 13159966082360291598 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11400359612524544 - maskLow := BitVec.ofNat 64 105591787815319 - maskHigh := BitVec.ofNat 64 134742273 - systematicCode := BitVec.ofNat 64 13161648266162876686 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11400325537867776 - maskLow := BitVec.ofNat 64 20266340073931159 - maskHigh := BitVec.ofNat 64 536944641 - systematicCode := BitVec.ofNat 64 13448200856491667726 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11400359629170688 - maskLow := BitVec.ofNat 64 79306587963799 - maskHigh := BitVec.ofNat 64 538968321 - systematicCode := BitVec.ofNat 64 13451004542154584334 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18094148839277568 - maskLow := BitVec.ofNat 64 90142365603398039 - maskHigh := BitVec.ofNat 64 671088705 - systematicCode := BitVec.ofNat 64 13454095351314985230 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11400325539038208 - maskLow := BitVec.ofNat 64 11259278258143639 - maskHigh := BitVec.ofNat 64 1073823745 - systematicCode := BitVec.ofNat 64 13592318235000975630 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11400359630341120 - maskLow := BitVec.ofNat 64 44259654828439 - maskHigh := BitVec.ofNat 64 1077936385 - systematicCode := BitVec.ofNat 64 13595682671594057998 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18094148838107136 - maskLow := BitVec.ofNat 64 81099981976568215 - maskHigh := BitVec.ofNat 64 1207959585 - systematicCode := BitVec.ofNat 64 13598208340333900046 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18094148821460992 - maskLow := BitVec.ofNat 64 74318194256445847 - maskHigh := BitVec.ofNat 64 1610612745 - systematicCode := BitVec.ofNat 64 13599329842126860558 }) - ) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x3113. -/ -def normalizedWeightSixteenCandidateBucket_3113 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085459179735296 - maskLow := BitVec.ofNat 64 2314850487658152727 - maskHigh := BitVec.ofNat 64 4466766004225 - systematicCode := BitVec.ofNat 64 15404735674532507923 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148628669171968 - maskLow := BitVec.ofNat 64 70373055988503 - maskHigh := BitVec.ofNat 64 4467304955969 - systematicCode := BitVec.ofNat 64 15404767771377873171 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085459029920000 - maskLow := BitVec.ofNat 64 578712831306826519 - maskHigh := BitVec.ofNat 64 17609365929985 - systematicCode := BitVec.ofNat 64 15691840133530398995 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148628519356672 - maskLow := BitVec.ofNat 64 70373055988503 - maskHigh := BitVec.ofNat 64 17609500655681 - systematicCode := BitVec.ofNat 64 15691867832396362003 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9359734801041664 - maskLow := BitVec.ofNat 64 70373055988503 - maskHigh := BitVec.ofNat 64 144678223928639489 - systematicCode := BitVec.ofNat 64 17502053323671154963 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36099303537770752 - maskLow := BitVec.ofNat 64 2882304865340556055 - maskHigh := BitVec.ofNat 64 180143985094836225 - systematicCode := BitVec.ofNat 64 17505383425909010707 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9288812006080768 - maskLow := BitVec.ofNat 64 70373055988503 - maskHigh := BitVec.ofNat 64 180143985765908737 - systematicCode := BitVec.ofNat 64 17505415569898025235 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36099307832738048 - maskLow := BitVec.ofNat 64 11260102891864855 - maskHigh := BitVec.ofNat 64 9223934986808213505 - systematicCode := BitVec.ofNat 64 18366696789967450387 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9288816301048064 - maskLow := BitVec.ofNat 64 70373055988503 - maskHigh := BitVec.ofNat 64 9223934986810818817 - systematicCode := BitVec.ofNat 64 18366712441533706515 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9359730539890944 - maskLow := BitVec.ofNat 64 70373055988503 - maskHigh := BitVec.ofNat 64 9259422824106311681 - systematicCode := BitVec.ofNat 64 18370140916558934291 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x3115. -/ -def normalizedWeightSixteenCandidateBucket_3115 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085459179897856 - maskLow := BitVec.ofNat 64 4629700558687634711 - maskHigh := BitVec.ofNat 64 2267742740481 - systematicCode := BitVec.ofNat 64 15260618296056754453 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148628669334528 - maskLow := BitVec.ofNat 64 35188683900183 - maskHigh := BitVec.ofNat 64 2268820668449 - systematicCode := BitVec.ofNat 64 15260654790881521941 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085459028912128 - maskLow := BitVec.ofNat 64 578712693867873559 - maskHigh := BitVec.ofNat 64 17600775987201 - systematicCode := BitVec.ofNat 64 15691274984553591061 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148628518348800 - maskLow := BitVec.ofNat 64 35188683900183 - maskHigh := BitVec.ofNat 64 17600910721057 - systematicCode := BitVec.ofNat 64 15691304882409255189 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9359734801204224 - maskLow := BitVec.ofNat 64 35188683900183 - maskHigh := BitVec.ofNat 64 289356353367973889 - systematicCode := BitVec.ofNat 64 17646731453076812053 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36099303537673216 - maskLow := BitVec.ofNat 64 5188147874554250519 - maskHigh := BitVec.ofNat 64 324259173170683905 - systematicCode := BitVec.ofNat 64 17649496423551545621 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9288812005983232 - maskLow := BitVec.ofNat 64 35188683900183 - maskHigh := BitVec.ofNat 64 324259174378635521 - systematicCode := BitVec.ofNat 64 17649532956997005589 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36099307832640512 - maskLow := BitVec.ofNat 64 20267302146606359 - maskHigh := BitVec.ofNat 64 9224497936761626625 - systematicCode := BitVec.ofNat 64 18367257549487550741 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9288816300950528 - maskLow := BitVec.ofNat 64 35188683900183 - maskHigh := BitVec.ofNat 64 9224497936766337281 - systematicCode := BitVec.ofNat 64 18367277590510252309 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9359730539793408 - maskLow := BitVec.ofNat 64 35188683900183 - maskHigh := BitVec.ofNat 64 9259420625083047937 - systematicCode := BitVec.ofNat 64 18370140907935314197 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x3119. -/ -def normalizedWeightSixteenCandidateBucket_3119 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085459050890240 - maskLow := BitVec.ofNat 64 4629700455608422679 - maskHigh := BitVec.ofNat 64 2216203126785 - systematicCode := BitVec.ofNat 64 15259487998103138585 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148628540326912 - maskLow := BitVec.ofNat 64 8800404836631 - maskHigh := BitVec.ofNat 64 2217281060873 - systematicCode := BitVec.ofNat 64 15259528890907308313 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085459049719808 - maskLow := BitVec.ofNat 64 2314850247139987735 - maskHigh := BitVec.ofNat 64 4406636447745 - systematicCode := BitVec.ofNat 64 15403040227602084121 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148628539156480 - maskLow := BitVec.ofNat 64 8800404836631 - maskHigh := BitVec.ofNat 64 4407175413769 - systematicCode := BitVec.ofNat 64 15403078921416552729 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9359734772073472 - maskLow := BitVec.ofNat 64 8800404836631 - maskHigh := BitVec.ofNat 64 1157425130004023297 - systematicCode := BitVec.ofNat 64 17936083331021484313 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36099303475250176 - maskLow := BitVec.ofNat 64 6917530131464524055 - maskHigh := BitVec.ofNat 64 1188950301625812993 - systematicCode := BitVec.ofNat 64 17937722401723855129 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9288811943560192 - maskLow := BitVec.ofNat 64 8800404836631 - maskHigh := BitVec.ofNat 64 1188950303236423937 - systematicCode := BitVec.ofNat 64 17937763350328324377 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36099307770217472 - maskLow := BitVec.ofNat 64 27022701587665175 - maskHigh := BitVec.ofNat 64 9227875636482148353 - systematicCode := BitVec.ofNat 64 18368379051414991129 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9288816238527488 - maskLow := BitVec.ofNat 64 8800404836631 - maskHigh := BitVec.ofNat 64 9227875636488438017 - systematicCode := BitVec.ofNat 64 18368403507596701977 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9359730477370368 - maskLow := BitVec.ofNat 64 8800404836631 - maskHigh := BitVec.ofNat 64 9259407430943508481 - systematicCode := BitVec.ofNat 64 18370136509821432089 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x311f. -/ -def normalizedWeightSixteenCandidateBucket_311f : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11329990918547456 - maskLow := BitVec.ofNat 64 70544854712599 - maskHigh := BitVec.ofNat 64 144678138029277441 - systematicCode := BitVec.ofNat 64 17501992406755979551 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9095783290906624 - maskLow := BitVec.ofNat 64 1103823470871 - maskHigh := BitVec.ofNat 64 144678138029293609 - systematicCode := BitVec.ofNat 64 17502005795176395039 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36170118899729408 - maskLow := BitVec.ofNat 64 70373391565079 - maskHigh := BitVec.ofNat 64 180143985094836225 - systematicCode := BitVec.ofNat 64 17505383300312871199 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11329990919717888 - maskLow := BitVec.ofNat 64 35497921577239 - maskHigh := BitVec.ofNat 64 289356276058554625 - systematicCode := BitVec.ofNat 64 17646670536228876575 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9095783292077056 - maskLow := BitVec.ofNat 64 1103823470871 - maskHigh := BitVec.ofNat 64 289356276058562633 - systematicCode := BitVec.ofNat 64 17646681742772351263 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36170118899826944 - maskLow := BitVec.ofNat 64 35188985921815 - maskHigh := BitVec.ofNat 64 324259173170683905 - systematicCode := BitVec.ofNat 64 17649496280775405855 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11329991019594752 - maskLow := BitVec.ofNat 64 9212721725719 - maskHigh := BitVec.ofNat 64 1157425104234217729 - systematicCode := BitVec.ofNat 64 17936026795107823903 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9095783391953920 - maskLow := BitVec.ofNat 64 1103823470871 - maskHigh := BitVec.ofNat 64 1157425104234219617 - systematicCode := BitVec.ofNat 64 17936033620851503391 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36170118908150016 - maskLow := BitVec.ofNat 64 8800505528599 - maskHigh := BitVec.ofNat 64 1188950301625812993 - systematicCode := BitVec.ofNat 64 17937722241633628447 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9024860563440640 - maskLow := BitVec.ofNat 64 1103823470871 - maskHigh := BitVec.ofNat 64 1621295865853378817 - systematicCode := BitVec.ofNat 64 17939230326472651039 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9024864858407936 - maskLow := BitVec.ofNat 64 1103823470871 - maskHigh := BitVec.ofNat 64 9229564486342410497 - systematicCode := BitVec.ofNat 64 18368465320765632799 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11329986724891648 - maskLow := BitVec.ofNat 64 114353521131799 - maskHigh := BitVec.ofNat 64 9259400833873740033 - systematicCode := BitVec.ofNat 64 18370061235217969439 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9095779097250816 - maskLow := BitVec.ofNat 64 1103823470871 - maskHigh := BitVec.ofNat 64 9259400833873766401 - systematicCode := BitVec.ofNat 64 18370074696651714847 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x3123. -/ -def normalizedWeightSixteenCandidateBucket_3123 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085356905826560 - maskLow := BitVec.ofNat 64 2305878472775631127 - maskHigh := BitVec.ofNat 64 1125968630513665 - systematicCode := BitVec.ofNat 64 16557674771056963875 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148526395263232 - maskLow := BitVec.ofNat 64 18014402821423383 - maskHigh := BitVec.ofNat 64 1125969163198529 - systematicCode := BitVec.ofNat 64 16557689207266292003 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085356756011264 - maskLow := BitVec.ofNat 64 576469827586294039 - maskHigh := BitVec.ofNat 64 4503616811433985 - systematicCode := BitVec.ofNat 64 16844779230054854947 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148526245447936 - maskLow := BitVec.ofNat 64 18014402821423383 - maskHigh := BitVec.ofNat 64 4503616941459521 - systematicCode := BitVec.ofNat 64 16844789268284780835 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9359632527132928 - maskLow := BitVec.ofNat 64 18014402821423383 - maskHigh := BitVec.ofNat 64 144117473002651649 - systematicCode := BitVec.ofNat 64 17497549724313268515 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36099201263862016 - maskLow := BitVec.ofNat 64 2882585240805769495 - maskHigh := BitVec.ofNat 64 144255925568405505 - systematicCode := BitVec.ofNat 64 17500897418468733219 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9288709732172032 - maskLow := BitVec.ofNat 64 18014402821423383 - maskHigh := BitVec.ofNat 64 144255926235365377 - systematicCode := BitVec.ofNat 64 17500911970540138787 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9289259487985920 - maskLow := BitVec.ofNat 64 18014402821423383 - maskHigh := BitVec.ofNat 64 9223374235878107137 - systematicCode := BitVec.ofNat 64 18362197795352162595 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36099751019675904 - maskLow := BitVec.ofNat 64 325459753763095 - maskHigh := BitVec.ofNat 64 9223374235882225665 - systematicCode := BitVec.ofNat 64 18362210739375517987 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9359082805135616 - maskLow := BitVec.ofNat 64 18014402821423383 - maskHigh := BitVec.ofNat 64 9229142273881538561 - systematicCode := BitVec.ofNat 64 18368465304057360675 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x3125. -/ -def normalizedWeightSixteenCandidateBucket_3125 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085356905989120 - maskLow := BitVec.ofNat 64 4611756528922591511 - maskHigh := BitVec.ofNat 64 563018674995201 - systematicCode := BitVec.ofNat 64 16413557392581210405 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148526395425792 - maskLow := BitVec.ofNat 64 9007203566813463 - maskHigh := BitVec.ofNat 64 563019746656289 - systematicCode := BitVec.ofNat 64 16413576226769940773 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085356755003392 - maskLow := BitVec.ofNat 64 576469690147471639 - maskHigh := BitVec.ofNat 64 4503608219402241 - systematicCode := BitVec.ofNat 64 16844214081078047013 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148526244440064 - maskLow := BitVec.ofNat 64 9007203566813463 - maskHigh := BitVec.ofNat 64 4503608351524897 - systematicCode := BitVec.ofNat 64 16844226318297674021 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9359632527295488 - maskLow := BitVec.ofNat 64 9007203566813463 - maskHigh := BitVec.ofNat 64 288234851509731329 - systematicCode := BitVec.ofNat 64 17642227853718925605 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36099201263764480 - maskLow := BitVec.ofNat 64 5188428250019594519 - maskHigh := BitVec.ofNat 64 288371113642164225 - systematicCode := BitVec.ofNat 64 17645010416111268133 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9288709732074496 - maskLow := BitVec.ofNat 64 9007203566813463 - maskHigh := BitVec.ofNat 64 288371114848092161 - systematicCode := BitVec.ofNat 64 17645029357639119141 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9289259487888384 - maskLow := BitVec.ofNat 64 9007203566813463 - maskHigh := BitVec.ofNat 64 9223376434901370881 - systematicCode := BitVec.ofNat 64 18362760753895387429 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36099751019578368 - maskLow := BitVec.ofNat 64 360644125982999 - maskHigh := BitVec.ofNat 64 9223376434903384065 - systematicCode := BitVec.ofNat 64 18362771490339238181 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9359082805038080 - maskLow := BitVec.ofNat 64 9007203566813463 - maskHigh := BitVec.ofNat 64 9228579323926020097 - systematicCode := BitVec.ofNat 64 18368463105000419621 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x3129. -/ -def normalizedWeightSixteenCandidateBucket_3129 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085356776981504 - maskLow := BitVec.ofNat 64 4611756425844162839 - maskHigh := BitVec.ofNat 64 562967133814785 - systematicCode := BitVec.ofNat 64 16412427094627594537 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148526266418176 - maskLow := BitVec.ofNat 64 2251804126544151 - maskHigh := BitVec.ofNat 64 562968207048713 - systematicCode := BitVec.ofNat 64 16412450326795727145 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085356775811072 - maskLow := BitVec.ofNat 64 2305878232258380055 - maskHigh := BitVec.ofNat 64 1125908497301505 - systematicCode := BitVec.ofNat 64 16555979324126540073 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148526265247744 - maskLow := BitVec.ofNat 64 2251804126544151 - maskHigh := BitVec.ofNat 64 1125909033656329 - systematicCode := BitVec.ofNat 64 16556000357304971561 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9359632498164736 - maskLow := BitVec.ofNat 64 2251804126544151 - maskHigh := BitVec.ofNat 64 1152939122563219457 - systematicCode := BitVec.ofNat 64 17931579731663597865 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36099201201341440 - maskLow := BitVec.ofNat 64 6917810506930651415 - maskHigh := BitVec.ofNat 64 1153062242095726593 - systematicCode := BitVec.ofNat 64 17933236394283577641 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9288709669651456 - maskLow := BitVec.ofNat 64 2251804126544151 - maskHigh := BitVec.ofNat 64 1153062243705880577 - systematicCode := BitVec.ofNat 64 17933259750970437929 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9289259425465344 - maskLow := BitVec.ofNat 64 2251804126544151 - maskHigh := BitVec.ofNat 64 9223389629040910337 - systematicCode := BitVec.ofNat 64 18363886653869076777 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36099750957155328 - maskLow := BitVec.ofNat 64 387032405836055 - maskHigh := BitVec.ofNat 64 9223389629041344513 - systematicCode := BitVec.ofNat 64 18363892992199831849 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9359082742615040 - maskLow := BitVec.ofNat 64 2251804126544151 - maskHigh := BitVec.ofNat 64 9225201624203919361 - systematicCode := BitVec.ofNat 64 18367337205026205993 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x312f. -/ -def normalizedWeightSixteenCandidateBucket_312f : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11329956827244544 - maskLow := BitVec.ofNat 64 18014574628372759 - maskHigh := BitVec.ofNat 64 144117387099176961 - systematicCode := BitVec.ofNat 64 17497506468034130223 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9095749199603712 - maskLow := BitVec.ofNat 64 281479296909591 - maskHigh := BitVec.ofNat 64 144117387103305769 - systematicCode := BitVec.ofNat 64 17497519787736117551 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36169573438882816 - maskLow := BitVec.ofNat 64 18014403165225239 - maskHigh := BitVec.ofNat 64 144255925568405505 - systematicCode := BitVec.ofNat 64 17500897361591021871 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11329956828414976 - maskLow := BitVec.ofNat 64 9007512812585239 - maskHigh := BitVec.ofNat 64 288234774198288385 - systematicCode := BitVec.ofNat 64 17642184597507027247 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9095749200774144 - maskLow := BitVec.ofNat 64 281479296909591 - maskHigh := BitVec.ofNat 64 288234774200320073 - systematicCode := BitVec.ofNat 64 17642195735332073775 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36169573438980352 - maskLow := BitVec.ofNat 64 9007203876929815 - maskHigh := BitVec.ofNat 64 288371113642164225 - systematicCode := BitVec.ofNat 64 17645010342053556527 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11329956928291840 - maskLow := BitVec.ofNat 64 2252216450744599 - maskHigh := BitVec.ofNat 64 1152939096792956929 - systematicCode := BitVec.ofNat 64 17931540856385974575 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9095749300651008 - maskLow := BitVec.ofNat 64 281479296909591 - maskHigh := BitVec.ofNat 64 1152939096793415777 - systematicCode := BitVec.ofNat 64 17931547613411225903 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36169573447303424 - maskLow := BitVec.ofNat 64 2251804234547479 - maskHigh := BitVec.ofNat 64 1153062242095726593 - systematicCode := BitVec.ofNat 64 17933236302911779119 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9024826472137728 - maskLow := BitVec.ofNat 64 281479296909591 - maskHigh := BitVec.ofNat 64 1585407806322835457 - systematicCode := BitVec.ofNat 64 17939230258022658351 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9025376227951616 - maskLow := BitVec.ofNat 64 281479296909591 - maskHigh := BitVec.ofNat 64 9223396226110652417 - systematicCode := BitVec.ofNat 64 18363944060502225199 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11329407172742144 - maskLow := BitVec.ofNat 64 29273401898107159 - maskHigh := BitVec.ofNat 64 9223512774343196673 - systematicCode := BitVec.ofNat 64 18365575296765604143 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9095199545101312 - maskLow := BitVec.ofNat 64 281479296909591 - maskHigh := BitVec.ofNat 64 9223512774349946881 - systematicCode := BitVec.ofNat 64 18365588758199349551 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x320d. -/ -def normalizedWeightSixteenCandidateBucket_320d : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.node - (.leaf - { patternClass := .twoE8 - affineCode := BitVec.ofNat 56 2393089209564160 - maskLow := BitVec.ofNat 64 72622747343192407 - maskHigh := BitVec.ofNat 64 85 - systematicCode := BitVec.ofNat 64 10126771954851656205 }) - (.leaf - { patternClass := .twoE8 - affineCode := BitVec.ofNat 56 18032542603049984 - maskLow := BitVec.ofNat 64 365105840471 - maskHigh := BitVec.ofNat 64 16908801 - systematicCode := BitVec.ofNat 64 12727896353246884365 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10274115858556928 - maskLow := BitVec.ofNat 64 4647717018798195031 - maskHigh := BitVec.ofNat 64 10305 - systematicCode := BitVec.ofNat 64 11211584263416853005 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11400015765612544 - maskLow := BitVec.ofNat 64 1161930907213431127 - maskHigh := BitVec.ofNat 64 34833 - systematicCode := BitVec.ofNat 64 11427753734060519949 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11400015767693312 - maskLow := BitVec.ofNat 64 290484379317240151 - maskHigh := BitVec.ofNat 64 40965 - systematicCode := BitVec.ofNat 64 11428875218673873421 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10274388588980224 - maskLow := BitVec.ofNat 64 4612389710197752151 - maskHigh := BitVec.ofNat 64 2621505 - systematicCode := BitVec.ofNat 64 12369009367450530317 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11400288496035840 - maskLow := BitVec.ofNat 64 1153519643260944727 - maskHigh := BitVec.ofNat 64 8912913 - systematicCode := BitVec.ofNat 64 12585178838144332301 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11400288498116608 - maskLow := BitVec.ofNat 64 288802126526742871 - maskHigh := BitVec.ofNat 64 10485765 - systematicCode := BitVec.ofNat 64 12586300322824532493 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18102930708382720 - maskLow := BitVec.ofNat 64 5764607544542691671 - maskHigh := BitVec.ofNat 64 17303553 - systematicCode := BitVec.ofNat 64 12729309432652313101 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18102930706301952 - maskLow := BitVec.ofNat 64 4899916467627163991 - maskHigh := BitVec.ofNat 64 18882561 - systematicCode := BitVec.ofNat 64 12730439730538820109 }) - ) - ) - ) - ) - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18094134613066752 - maskLow := BitVec.ofNat 64 1441152159965053271 - maskHigh := BitVec.ofNat 64 25198593 - systematicCode := BitVec.ofNat 64 12731287441119130125 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18102911381039104 - maskLow := BitVec.ofNat 64 45036017782161751 - maskHigh := BitVec.ofNat 64 67241985 - systematicCode := BitVec.ofNat 64 13088189967593976333 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18102638650615808 - maskLow := BitVec.ofNat 64 175943368900951 - maskHigh := BitVec.ofNat 64 67633665 - systematicCode := BitVec.ofNat 64 13089591775931478541 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18102911378958336 - maskLow := BitVec.ofNat 64 38280669880713559 - maskHigh := BitVec.ofNat 64 268574721 - systematicCode := BitVec.ofNat 64 13376424741725352461 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18102638648535040 - maskLow := BitVec.ofNat 64 149606629441879 - maskHigh := BitVec.ofNat 64 270533121 - systematicCode := BitVec.ofNat 64 13378948051923186189 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10274407916323840 - maskLow := BitVec.ofNat 64 108227132873834839 - maskHigh := BitVec.ofNat 64 335544385 - systematicCode := BitVec.ofNat 64 13381756282317189645 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18094115285723136 - maskLow := BitVec.ofNat 64 11259278274920791 - maskHigh := BitVec.ofNat 64 1073905665 - systematicCode := BitVec.ofNat 64 13592600809489314317 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18093842555299840 - maskLow := BitVec.ofNat 64 44259671605591 - maskHigh := BitVec.ofNat 64 1082130945 - systematicCode := BitVec.ofNat 64 13595965246082396685 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11400307823379456 - maskLow := BitVec.ofNat 64 81099981993345367 - maskHigh := BitVec.ofNat 64 1140850705 - systematicCode := BitVec.ofNat 64 13597925765845561869 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11400307825460224 - maskLow := BitVec.ofNat 64 74318194273222999 - maskHigh := BitVec.ofNat 64 1342177285 - systematicCode := BitVec.ofNat 64 13599047267638522381 }) - ) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x3213. -/ -def normalizedWeightSixteenCandidateBucket_3213 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085390460256896 - maskLow := BitVec.ofNat 64 1161928983068082967 - maskHigh := BitVec.ofNat 64 8864812531713 - systematicCode := BitVec.ofNat 64 15476794363787096595 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148559949693568 - maskLow := BitVec.ofNat 64 140741816943383 - maskHigh := BitVec.ofNat 64 8865083031617 - systematicCode := BitVec.ofNat 64 15476824265904239123 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085390310441600 - maskLow := BitVec.ofNat 64 290482455171891991 - maskHigh := BitVec.ofNat 64 35201551990785 - systematicCode := BitVec.ofNat 64 15763898822784987667 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148559799878272 - maskLow := BitVec.ofNat 64 140741816943383 - maskHigh := BitVec.ofNat 64 35201619591233 - systematicCode := BitVec.ofNat 64 15763924326922727955 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9359666081563264 - maskLow := BitVec.ofNat 64 140741816943383 - maskHigh := BitVec.ofNat 64 72620629890727937 - systematicCode := BitVec.ofNat 64 17429995729650070035 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36046458260162688 - maskLow := BitVec.ofNat 64 1441154084110402327 - maskHigh := BitVec.ofNat 64 108086391056924673 - systematicCode := BitVec.ofNat 64 17433326927071031827 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2533343845550208 - maskLow := BitVec.ofNat 64 140741816943383 - maskHigh := BitVec.ofNat 64 108086391392436737 - systematicCode := BitVec.ofNat 64 17433356872070345235 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36046462555127936 - maskLow := BitVec.ofNat 64 11261202420269847 - maskHigh := BitVec.ofNat 64 4612248968380841985 - systematicCode := BitVec.ofNat 64 18294640295441216019 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2533348140515456 - maskLow := BitVec.ofNat 64 140741816943383 - maskHigh := BitVec.ofNat 64 4612248968383431169 - systematicCode := BitVec.ofNat 64 18294654847512621587 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9359661820414592 - maskLow := BitVec.ofNat 64 140741816943383 - maskHigh := BitVec.ofNat 64 4647758795911495681 - systematicCode := BitVec.ofNat 64 18298084426344444435 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x3216. -/ -def normalizedWeightSixteenCandidateBucket_3216 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10208969769494528 - maskLow := BitVec.ofNat 64 4647714888494418199 - maskHigh := BitVec.ofNat 64 2267742740481 - systematicCode := BitVec.ofNat 64 15260618296073466390 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9650417862584320 - maskLow := BitVec.ofNat 64 35188700678423 - maskHigh := BitVec.ofNat 64 2268824862737 - systematicCode := BitVec.ofNat 64 15260654795159712278 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11334869703600128 - maskLow := BitVec.ofNat 64 290482249013463319 - maskHigh := BitVec.ofNat 64 35188667064321 - systematicCode := BitVec.ofNat 64 15763051099319775766 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9659213982869504 - maskLow := BitVec.ofNat 64 35188700678423 - maskHigh := BitVec.ofNat 64 35188734689297 - systematicCode := BitVec.ofNat 64 15763079901942067734 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9593243285202944 - maskLow := BitVec.ofNat 64 35188700678423 - maskHigh := BitVec.ofNat 64 290482248979849217 - systematicCode := BitVec.ofNat 64 17647012923758555670 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11335449792899072 - maskLow := BitVec.ofNat 64 4899918597930944791 - maskHigh := BitVec.ofNat 64 324259173170683905 - systematicCode := BitVec.ofNat 64 17649496423534834198 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9659794072168448 - maskLow := BitVec.ofNat 64 35188700678423 - maskHigh := BitVec.ofNat 64 324259174311526913 - systematicCode := BitVec.ofNat 64 17649532952718815766 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11335470999289984 - maskLow := BitVec.ofNat 64 38282800184494359 - maskHigh := BitVec.ofNat 64 4613937818241081345 - systematicCode := BitVec.ofNat 64 18295481434721366550 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9659815278559360 - maskLow := BitVec.ofNat 64 35188700678423 - maskHigh := BitVec.ofNat 64 4613937818249986561 - systematicCode := BitVec.ofNat 64 18295502570977440278 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9593239227211904 - maskLow := BitVec.ofNat 64 35188700678423 - maskHigh := BitVec.ofNat 64 4647752198841704449 - systematicCode := BitVec.ofNat 64 18298084413409014294 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x321a. -/ -def normalizedWeightSixteenCandidateBucket_321a : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10208969775736832 - maskLow := BitVec.ofNat 64 4647714836954816791 - maskHigh := BitVec.ofNat 64 2216203126785 - systematicCode := BitVec.ofNat 64 15259487998119850522 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9650417868826624 - maskLow := BitVec.ofNat 64 8800421617943 - maskHigh := BitVec.ofNat 64 2217285255173 - systematicCode := BitVec.ofNat 64 15259528895185498650 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11334869682792448 - maskLow := BitVec.ofNat 64 1161928725370052887 - maskHigh := BitVec.ofNat 64 8800387991553 - systematicCode := BitVec.ofNat 64 15474816342368268826 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9659213962061824 - maskLow := BitVec.ofNat 64 8800421617943 - maskHigh := BitVec.ofNat 64 8800658522117 - systematicCode := BitVec.ofNat 64 15474853940949365274 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9593243264395264 - maskLow := BitVec.ofNat 64 8800421617943 - maskHigh := BitVec.ofNat 64 1161928725336426497 - systematicCode := BitVec.ofNat 64 17936364801703227930 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11335449807464448 - maskLow := BitVec.ofNat 64 5764609726386086167 - maskHigh := BitVec.ofNat 64 1188950301625812993 - systematicCode := BitVec.ofNat 64 17937722401707143706 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9659794086733824 - maskLow := BitVec.ofNat 64 8800421617943 - maskHigh := BitVec.ofNat 64 1188950302967988737 - systematicCode := BitVec.ofNat 64 17937763346050134554 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11335471013855360 - maskLow := BitVec.ofNat 64 45038199625556247 - maskHigh := BitVec.ofNat 64 4620693217682130945 - systematicCode := BitVec.ofNat 64 18296602936648806938 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9659815293124736 - maskLow := BitVec.ofNat 64 8800421617943 - maskHigh := BitVec.ofNat 64 4620693217692615169 - systematicCode := BitVec.ofNat 64 18296628488063889946 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9593239237615744 - maskLow := BitVec.ofNat 64 8800421617943 - maskHigh := BitVec.ofNat 64 4647725810562631681 - systematicCode := BitVec.ofNat 64 18298080015295132186 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x321f. -/ -def normalizedWeightSixteenCandidateBucket_321f : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089444515293184 - maskLow := BitVec.ofNat 64 140827716321559 - maskHigh := BitVec.ofNat 64 72620543991349761 - systematicCode := BitVec.ofNat 64 17429935916507804191 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711165911640064 - maskLow := BitVec.ofNat 64 2203351875863 - maskHigh := BitVec.ofNat 64 72620543991382037 - systematicCode := BitVec.ofNat 64 17429949296338416159 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11340912989588608 - maskLow := BitVec.ofNat 64 140742152519959 - maskHigh := BitVec.ofNat 64 108086391056924673 - systematicCode := BitVec.ofNat 64 17433326810081538591 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089444510885888 - maskLow := BitVec.ofNat 64 35480758485271 - maskHigh := BitVec.ofNat 64 290482175965397505 - systematicCode := BitVec.ofNat 64 17646953110717149727 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711165907232768 - maskLow := BitVec.ofNat 64 2203351875863 - maskHigh := BitVec.ofNat 64 290482175965405253 - systematicCode := BitVec.ofNat 64 17646963217732350495 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089444483835904 - maskLow := BitVec.ofNat 64 9144019026199 - maskHigh := BitVec.ofNat 64 1161928703861588481 - systematicCode := BitVec.ofNat 64 17936309369596097055 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711165880182784 - maskLow := BitVec.ofNat 64 2203351875863 - maskHigh := BitVec.ofNat 64 1161928703861590097 - systematicCode := BitVec.ofNat 64 17936315095811502623 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9786512791349248 - maskLow := BitVec.ofNat 64 2203351875863 - maskHigh := BitVec.ofNat 64 1549238271815451137 - systematicCode := BitVec.ofNat 64 17939229226977866271 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9786533997740160 - maskLow := BitVec.ofNat 64 2203351875863 - maskHigh := BitVec.ofNat 64 4623507967449235969 - systematicCode := BitVec.ofNat 64 18296690301232886303 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089440457056384 - maskLow := BitVec.ofNat 64 184722282086679 - maskHigh := BitVec.ofNat 64 4647714815446352385 - systematicCode := BitVec.ofNat 64 18298004744986636831 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711161853403264 - maskLow := BitVec.ofNat 64 2203351875863 - maskHigh := BitVec.ofNat 64 4647714815446394881 - systematicCode := BitVec.ofNat 64 18298018202125480479 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x3223. -/ -def normalizedWeightSixteenCandidateBucket_3223 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085356368953984 - maskLow := BitVec.ofNat 64 1152956968185561367 - maskHigh := BitVec.ofNat 64 2251868541550593 - systematicCode := BitVec.ofNat 64 16629733460311552547 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148525858390656 - maskLow := BitVec.ofNat 64 36028801347682583 - maskHigh := BitVec.ofNat 64 2251868801605697 - systematicCode := BitVec.ofNat 64 16629745701792657955 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085356219138688 - maskLow := BitVec.ofNat 64 288239451451359511 - maskHigh := BitVec.ofNat 64 9007216442998785 - systematicCode := BitVec.ofNat 64 16916837919309443619 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148525708575360 - maskLow := BitVec.ofNat 64 36028801347682583 - maskHigh := BitVec.ofNat 64 9007216501721153 - systematicCode := BitVec.ofNat 64 16916845762811146787 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9359631990260352 - maskLow := BitVec.ofNat 64 36028801347682583 - maskHigh := BitVec.ofNat 64 72059878968918017 - systematicCode := BitVec.ofNat 64 17425492130292183587 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36046424168859776 - maskLow := BitVec.ofNat 64 1441714835040698647 - maskHigh := BitVec.ofNat 64 72198331534671873 - systematicCode := BitVec.ofNat 64 17428840919630754339 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2533309754247296 - maskLow := BitVec.ofNat 64 36028801347682583 - maskHigh := BitVec.ofNat 64 72198331861958657 - systematicCode := BitVec.ofNat 64 17428853272712458787 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2533859510059136 - maskLow := BitVec.ofNat 64 36028801347682583 - maskHigh := BitVec.ofNat 64 4611688217450784769 - systematicCode := BitVec.ofNat 64 18290141300825928227 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36046973924671616 - maskLow := BitVec.ofNat 64 606934747250967 - maskHigh := BitVec.ofNat 64 4611688217459032065 - systematicCode := BitVec.ofNat 64 18290154249144185379 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9359082268265088 - maskLow := BitVec.ofNat 64 36028801347682583 - maskHigh := BitVec.ofNat 64 4623085754992558081 - systematicCode := BitVec.ofNat 64 18296690284524614179 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x3226. -/ -def normalizedWeightSixteenCandidateBucket_3226 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10208424308647936 - maskLow := BitVec.ofNat 64 4611826828964331799 - maskHigh := BitVec.ofNat 64 563018674995201 - systematicCode := BitVec.ofNat 64 16413557392597922342 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9649872401737728 - maskLow := BitVec.ofNat 64 9007203583852823 - maskHigh := BitVec.ofNat 64 563019746672657 - systematicCode := BitVec.ofNat 64 16413576231048131110 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11334324242753536 - maskLow := BitVec.ofNat 64 288239245293322519 - maskHigh := BitVec.ofNat 64 9007203551805441 - systematicCode := BitVec.ofNat 64 16915990195844231718 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9658668522022912 - maskLow := BitVec.ofNat 64 9007203583852823 - maskHigh := BitVec.ofNat 64 9007203616819217 - systematicCode := BitVec.ofNat 64 16916001337830486566 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9592697824356352 - maskLow := BitVec.ofNat 64 9007203583852823 - maskHigh := BitVec.ofNat 64 288239245261275137 - systematicCode := BitVec.ofNat 64 17642509324400669222 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11333813410359296 - maskLow := BitVec.ofNat 64 4900479348861632791 - maskHigh := BitVec.ofNat 64 288371113642164225 - systematicCode := BitVec.ofNat 64 17645010416094556710 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9658157689628672 - maskLow := BitVec.ofNat 64 9007203583852823 - maskHigh := BitVec.ofNat 64 288371114781048833 - systematicCode := BitVec.ofNat 64 17645029353360929318 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9660872108949632 - maskLow := BitVec.ofNat 64 9007203583852823 - maskHigh := BitVec.ofNat 64 4611694814520576001 - systematicCode := BitVec.ofNat 64 18290985738640765478 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11336527829680256 - maskLow := BitVec.ofNat 64 712487863910679 - maskHigh := BitVec.ofNat 64 4611694814522507265 - systematicCode := BitVec.ofNat 64 18290995375589765670 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9592182396821632 - maskLow := BitVec.ofNat 64 9007203583852823 - maskHigh := BitVec.ofNat 64 4621396905126002689 - systematicCode := BitVec.ofNat 64 18296686985939202598 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x322a. -/ -def normalizedWeightSixteenCandidateBucket_322a : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10208424314890240 - maskLow := BitVec.ofNat 64 4611826777426297111 - maskHigh := BitVec.ofNat 64 562967133814785 - systematicCode := BitVec.ofNat 64 16412427094644306474 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9649872407980032 - maskLow := BitVec.ofNat 64 2251804144369943 - maskHigh := BitVec.ofNat 64 562968207065093 - systematicCode := BitVec.ofNat 64 16412450331073917482 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11334324221945856 - maskLow := BitVec.ofNat 64 1152956710489489687 - maskHigh := BitVec.ofNat 64 2251804109176833 - systematicCode := BitVec.ofNat 64 16627755438892724778 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9658668501215232 - maskLow := BitVec.ofNat 64 2251804144369943 - maskHigh := BitVec.ofNat 64 2251804377096197 - systematicCode := BitVec.ofNat 64 16627775376837784106 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9592697803548672 - maskLow := BitVec.ofNat 64 2251804144369943 - maskHigh := BitVec.ofNat 64 1152956710454296577 - systematicCode := BitVec.ofNat 64 17931861202345341482 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11333813424924672 - maskLow := BitVec.ofNat 64 5765170477318340887 - maskHigh := BitVec.ofNat 64 1153062242095726593 - systematicCode := BitVec.ofNat 64 17933236394266866218 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9658157704194048 - maskLow := BitVec.ofNat 64 2251804144369943 - maskHigh := BitVec.ofNat 64 1153062243437510657 - systematicCode := BitVec.ofNat 64 17933259746692248106 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9660872123515008 - maskLow := BitVec.ofNat 64 2251804144369943 - maskHigh := BitVec.ofNat 64 4611721202799648769 - systematicCode := BitVec.ofNat 64 18292111638614454826 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11336527844245632 - maskLow := BitVec.ofNat 64 738876144550167 - maskHigh := BitVec.ofNat 64 4611721202800001025 - systematicCode := BitVec.ofNat 64 18292116877450359338 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9592182407225472 - maskLow := BitVec.ofNat 64 2251804144369943 - maskHigh := BitVec.ofNat 64 4614641505683374081 - systematicCode := BitVec.ofNat 64 18295561085964988970 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x322f. -/ -def normalizedWeightSixteenCandidateBucket_322f : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089717245716480 - maskLow := BitVec.ofNat 64 36028887255286039 - maskHigh := BitVec.ofNat 64 72059793061314561 - systematicCode := BitVec.ofNat 64 17425449977785954863 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711438642063360 - maskLow := BitVec.ofNat 64 562954290397463 - maskHigh := BitVec.ofNat 64 72059793069572117 - systematicCode := BitVec.ofNat 64 17425463288898138671 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11338219776658560 - maskLow := BitVec.ofNat 64 36028801691484439 - maskHigh := BitVec.ofNat 64 72198331534671873 - systematicCode := BitVec.ofNat 64 17428840871359689263 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089717241309184 - maskLow := BitVec.ofNat 64 9007495649493271 - maskHigh := BitVec.ofNat 64 288239172244865025 - systematicCode := BitVec.ofNat 64 17642467171995300399 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711438637656064 - maskLow := BitVec.ofNat 64 562954290397463 - maskHigh := BitVec.ofNat 64 288239172246831173 - systematicCode := BitVec.ofNat 64 17642477210292073007 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089717214259200 - maskLow := BitVec.ofNat 64 2252147748045079 - maskHigh := BitVec.ofNat 64 1152956688979066881 - systematicCode := BitVec.ofNat 64 17931823430874247727 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711438610606080 - maskLow := BitVec.ofNat 64 562954290397463 - maskHigh := BitVec.ofNat 64 1152956688979460177 - systematicCode := BitVec.ofNat 64 17931829088371225135 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9785694600079360 - maskLow := BitVec.ofNat 64 562954290397463 - maskHigh := BitVec.ofNat 64 1513350212284973057 - systematicCode := BitVec.ofNat 64 17939229158527873583 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9788409019400320 - maskLow := BitVec.ofNat 64 562954290397463 - maskHigh := BitVec.ofNat 64 4611732197915885569 - systematicCode := BitVec.ofNat 64 18292169040969478703 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089201817936000 - maskLow := BitVec.ofNat 64 47287800424366359 - maskHigh := BitVec.ofNat 64 4611826755915874305 - systematicCode := BitVec.ofNat 64 18293518806534271535 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9710923214282880 - maskLow := BitVec.ofNat 64 562954290397463 - maskHigh := BitVec.ofNat 64 4611826755926753281 - systematicCode := BitVec.ofNat 64 18293532263673115183 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x3231. -/ -def normalizedWeightSixteenCandidateBucket_3231 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .d16Plus - affineCode := BitVec.ofNat 56 54397238693142784 - maskLow := BitVec.ofNat 64 72057598718837015 - maskHigh := BitVec.ofNat 64 36169534524096513 - systematicCode := BitVec.ofNat 64 17284727890897023537 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9359628500601088 - maskLow := BitVec.ofNat 64 4611686022772752663 - maskHigh := BitVec.ofNat 64 565235949764609 - systematicCode := BitVec.ofNat 64 16416685813996991025 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2533313780777216 - maskLow := BitVec.ofNat 64 4611686022772752663 - maskHigh := BitVec.ofNat 64 703687461175297 - systematicCode := BitVec.ofNat 64 16420037017711948337 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36046428195389696 - maskLow := BitVec.ofNat 64 83316597451718935 - maskHigh := BitVec.ofNat 64 703688515518465 - systematicCode := BitVec.ofNat 64 16420049957440401969 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2533859241623808 - maskLow := BitVec.ofNat 64 4611686022772752663 - maskHigh := BitVec.ofNat 64 36030996059006977 - systematicCode := BitVec.ofNat 64 17281350377458643505 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36046973656236288 - maskLow := BitVec.ofNat 64 72101578848403735 - maskHigh := BitVec.ofNat 64 36030997115961345 - systematicCode := BitVec.ofNat 64 17281363385905525297 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148522368731392 - maskLow := BitVec.ofNat 64 4611686022772752663 - maskHigh := BitVec.ofNat 64 288230444873293889 - systematicCode := BitVec.ofNat 64 17638536625161777713 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085352879294720 - maskLow := BitVec.ofNat 64 9042662850101527 - maskHigh := BitVec.ofNat 64 288230445944930305 - systematicCode := BitVec.ofNat 64 17638555109875790385 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148522218916096 - maskLow := BitVec.ofNat 64 4611686022772752663 - maskHigh := BitVec.ofNat 64 1152921521787242561 - systematicCode := BitVec.ofNat 64 17925636686180266545 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085352729479424 - maskLow := BitVec.ofNat 64 2260875129979159 - maskHigh := BitVec.ofNat 64 1152921522860457985 - systematicCode := BitVec.ofNat 64 17925659568873681457 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9359083073571072 - maskLow := BitVec.ofNat 64 4611686022772752663 - maskHigh := BitVec.ofNat 64 1477321416339619841 - systematicCode := BitVec.ofNat 64 17939226959942529585 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x340b. -/ -def normalizedWeightSixteenCandidateBucket_340b : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.node - (.leaf - { patternClass := .twoE8 - affineCode := BitVec.ofNat 56 2393089211498624 - maskLow := BitVec.ofNat 64 73187896353423671 - maskHigh := BitVec.ofNat 64 51 - systematicCode := BitVec.ofNat 64 9982654567786230795 }) - (.leaf - { patternClass := .twoE8 - affineCode := BitVec.ofNat 56 18032542604984448 - maskLow := BitVec.ofNat 64 219110506807 - maskHigh := BitVec.ofNat 64 17040385 - systematicCode := BitVec.ofNat 64 12728461493633496075 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10274115859776128 - maskLow := BitVec.ofNat 64 2341876208641311031 - maskHigh := BitVec.ofNat 64 18465 - systematicCode := BitVec.ofNat 64 11355697243879650315 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11400015766620416 - maskLow := BitVec.ofNat 64 1170940305524982071 - maskHigh := BitVec.ofNat 64 34833 - systematicCode := BitVec.ofNat 64 11427753734094205963 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11400015768717440 - maskLow := BitVec.ofNat 64 146371390298194231 - maskHigh := BitVec.ofNat 64 49155 - systematicCode := BitVec.ofNat 64 11429435961014236171 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10274388590199424 - maskLow := BitVec.ofNat 64 2307109650971033911 - maskHigh := BitVec.ofNat 64 4718625 - systematicCode := BitVec.ofNat 64 12513122347946750987 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11400288497043712 - maskLow := BitVec.ofNat 64 1154117777620009271 - maskHigh := BitVec.ofNat 64 8912913 - systematicCode := BitVec.ofNat 64 12585178838178018315 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11400288499140736 - maskLow := BitVec.ofNat 64 145249888437862711 - maskHigh := BitVec.ofNat 64 12582915 - systematicCode := BitVec.ofNat 64 12586861065198318603 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18102930708236416 - maskLow := BitVec.ofNat 64 3458764526772617527 - maskHigh := BitVec.ofNat 64 17303553 - systematicCode := BitVec.ofNat 64 12729309424062247947 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18102930706139392 - maskLow := BitVec.ofNat 64 2449958270371168567 - maskHigh := BitVec.ofNat 64 20987905 - systematicCode := BitVec.ofNat 64 12731004870892008459 }) - ) - ) - ) - ) - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18094134613115520 - maskLow := BitVec.ofNat 64 1297036834483798327 - maskHigh := BitVec.ofNat 64 25198593 - systematicCode := BitVec.ofNat 64 12731287441085445131 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18102911382063232 - maskLow := BitVec.ofNat 64 54043208480522551 - maskHigh := BitVec.ofNat 64 33818625 - systematicCode := BitVec.ofNat 64 12944637729504965643 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18102638651639936 - maskLow := BitVec.ofNat 64 211119184609591 - maskHigh := BitVec.ofNat 64 34079745 - systematicCode := BitVec.ofNat 64 12945478786912302091 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18102911379966208 - maskLow := BitVec.ofNat 64 38280669914267959 - maskHigh := BitVec.ofNat 64 268713985 - systematicCode := BitVec.ofNat 64 13376989890702029835 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18102638649542912 - maskLow := BitVec.ofNat 64 149606662996279 - maskHigh := BitVec.ofNat 64 272630785 - systematicCode := BitVec.ofNat 64 13379513200899863563 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10274407916372608 - maskLow := BitVec.ofNat 64 108227132907389239 - maskHigh := BitVec.ofNat 64 301989921 - systematicCode := BitVec.ofNat 64 13381191133340513291 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18094115286942336 - maskLow := BitVec.ofNat 64 20266340124262711 - maskHigh := BitVec.ofNat 64 537165825 - systematicCode := BitVec.ofNat 64 13449048579956683787 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18093842556519040 - maskLow := BitVec.ofNat 64 79306638295351 - maskHigh := BitVec.ofNat 64 545260545 - systematicCode := BitVec.ofNat 64 13451852265619600395 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11400307823216896 - maskLow := BitVec.ofNat 64 90142365653729591 - maskHigh := BitVec.ofNat 64 570425361 - systematicCode := BitVec.ofNat 64 13453247627849970699 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11400307825313920 - maskLow := BitVec.ofNat 64 74318194306777399 - maskHigh := BitVec.ofNat 64 805306371 - systematicCode := BitVec.ofNat 64 13454929880539411467 }) - ) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x3415. -/ -def normalizedWeightSixteenCandidateBucket_3415 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085390460208128 - maskLow := BitVec.ofNat 64 1170936044917425431 - maskHigh := BitVec.ofNat 64 8864812531713 - systematicCode := BitVec.ofNat 64 15476794363820520469 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148559949644800 - maskLow := BitVec.ofNat 64 140741850498327 - maskHigh := BitVec.ofNat 64 8865085128737 - systematicCode := BitVec.ofNat 64 15476824274460619797 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085390309222400 - maskLow := BitVec.ofNat 64 146367129690637591 - maskHigh := BitVec.ofNat 64 70377334145025 - systematicCode := BitVec.ofNat 64 15907451052317357077 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148559798659072 - maskLow := BitVec.ofNat 64 140741850498327 - maskHigh := BitVec.ofNat 64 70377368191009 - systematicCode := BitVec.ofNat 64 15907474365988353045 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9359666081514496 - maskLow := BitVec.ofNat 64 140741850498327 - maskHigh := BitVec.ofNat 64 73183571254214657 - systematicCode := BitVec.ofNat 64 17430558671013557269 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36046458260308992 - maskLow := BitVec.ofNat 64 1297041095091356951 - maskHigh := BitVec.ofNat 64 108086391056924673 - systematicCode := BitVec.ofNat 64 17433326927037608981 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2533343845696512 - maskLow := BitVec.ofNat 64 140741850498327 - maskHigh := BitVec.ofNat 64 108086391358882817 - systematicCode := BitVec.ofNat 64 17433356863513965589 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36046462555014144 - maskLow := BitVec.ofNat 64 20270600731821335 - maskHigh := BitVec.ofNat 64 2306968909120569345 - systematicCode := BitVec.ofNat 64 18151088065908847637 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2533348140401664 - maskLow := BitVec.ofNat 64 140741850498327 - maskHigh := BitVec.ofNat 64 2306968909125256193 - systematicCode := BitVec.ofNat 64 18151104808446997525 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9359661820365824 - maskLow := BitVec.ofNat 64 140741850498327 - maskHigh := BitVec.ofNat 64 2341950971069890561 - systematicCode := BitVec.ofNat 64 18153971437291844629 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x3416. -/ -def normalizedWeightSixteenCandidateBucket_3416 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10208969770664960 - maskLow := BitVec.ofNat 64 2341871879314278679 - maskHigh := BitVec.ofNat 64 4466766004225 - systematicCode := BitVec.ofNat 64 15404735674582643734 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9650417863754752 - maskLow := BitVec.ofNat 64 70373106321687 - maskHigh := BitVec.ofNat 64 4467311247377 - systematicCode := BitVec.ofNat 64 15404767784212444182 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11334869704770560 - maskLow := BitVec.ofNat 64 146367060971161879 - maskHigh := BitVec.ofNat 64 70373039161345 - systematicCode := BitVec.ofNat 64 15907168477828953110 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9659213984039936 - maskLow := BitVec.ofNat 64 70373106321687 - maskHigh := BitVec.ofNat 64 70373073223697 - systematicCode := BitVec.ofNat 64 15907192890994799638 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9593243286373376 - maskLow := BitVec.ofNat 64 70373106321687 - maskHigh := BitVec.ofNat 64 146367060904001537 - systematicCode := BitVec.ofNat 64 17502897735716385814 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11335449793793152 - maskLow := BitVec.ofNat 64 2449962599698204951 - maskHigh := BitVec.ofNat 64 180143985094836225 - systematicCode := BitVec.ofNat 64 17505383425858876438 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9659794073062528 - maskLow := BitVec.ofNat 64 70373106321687 - maskHigh := BitVec.ofNat 64 180143985665246209 - systematicCode := BitVec.ofNat 64 17505415557063455766 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11335470998899840 - maskLow := BitVec.ofNat 64 38284999241304343 - maskHigh := BitVec.ofNat 64 2308094809027395585 - systematicCode := BitVec.ofNat 64 18151368445668897814 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9659815278169216 - maskLow := BitVec.ofNat 64 70373106321687 - maskHigh := BitVec.ofNat 64 2308094809036293121 - systematicCode := BitVec.ofNat 64 18151387382935270422 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9593239228138496 - maskLow := BitVec.ofNat 64 70373106321687 - maskHigh := BitVec.ofNat 64 2341946573023363073 - systematicCode := BitVec.ofNat 64 18153971432980034582 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x341c. -/ -def normalizedWeightSixteenCandidateBucket_341c : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10208969776956032 - maskLow := BitVec.ofNat 64 2341871819184750871 - maskHigh := BitVec.ofNat 64 4406636447745 - systematicCode := BitVec.ofNat 64 15403040227652219932 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9650417870045824 - maskLow := BitVec.ofNat 64 8800455180567 - maskHigh := BitVec.ofNat 64 4407181705219 - systematicCode := BitVec.ofNat 64 15403078934251123740 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11334869683800320 - maskLow := BitVec.ofNat 64 1170935916068421911 - maskHigh := BitVec.ofNat 64 8800387991553 - systematicCode := BitVec.ofNat 64 15474816342401692700 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9659213963069696 - maskLow := BitVec.ofNat 64 8800455180567 - maskHigh := BitVec.ofNat 64 8800660619267 - systematicCode := BitVec.ofNat 64 15474853949505745948 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9593243265403136 - maskLow := BitVec.ofNat 64 8800455180567 - maskHigh := BitVec.ofNat 64 1170935916001232897 - systematicCode := BitVec.ofNat 64 17936925552633394204 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11335449808472320 - maskLow := BitVec.ofNat 64 3458768916229210391 - maskHigh := BitVec.ofNat 64 1188950301625812993 - systematicCode := BitVec.ofNat 64 17937722393117340700 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9659794087741696 - maskLow := BitVec.ofNat 64 8800455180567 - maskHigh := BitVec.ofNat 64 1188950302431118337 - systematicCode := BitVec.ofNat 64 17937761147060433948 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11335471013579008 - maskLow := BitVec.ofNat 64 54047597937115415 - maskHigh := BitVec.ofNat 64 2323857407723177985 - systematicCode := BitVec.ofNat 64 18153050698560058396 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9659815292848384 - maskLow := BitVec.ofNat 64 8800455180567 - maskHigh := BitVec.ofNat 64 2323857407735759873 - systematicCode := BitVec.ofNat 64 18153076258564944924 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9593239238623616 - maskLow := BitVec.ofNat 64 8800455180567 - maskHigh := BitVec.ofNat 64 2341885000372193281 - systematicCode := BitVec.ofNat 64 18153964835809211420 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x341f. -/ -def normalizedWeightSixteenCandidateBucket_341f : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089444516301056 - maskLow := BitVec.ofNat 64 140819159941399 - maskHigh := BitVec.ofNat 64 73183493944771585 - systematicCode := BitVec.ofNat 64 17430501065484350495 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711165912647936 - maskLow := BitVec.ofNat 64 4402408685847 - maskHigh := BitVec.ofNat 64 73183493944803347 - systematicCode := BitVec.ofNat 64 17430512246258414623 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089444512105088 - maskLow := BitVec.ofNat 64 70519135240471 - maskHigh := BitVec.ofNat 64 146366987889542145 - systematicCode := BitVec.ofNat 64 17502840130220799007 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711165908451968 - maskLow := BitVec.ofNat 64 4402408685847 - maskHigh := BitVec.ofNat 64 146366987889557539 - systematicCode := BitVec.ofNat 64 17502850220056392735 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089444484843776 - maskLow := BitVec.ofNat 64 9006613627159 - maskHigh := BitVec.ofNat 64 1170935903116329985 - systematicCode := BitVec.ofNat 64 17936874518539219999 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711165881190656 - maskLow := BitVec.ofNat 64 4402408685847 - maskHigh := BitVec.ofNat 64 1170935903116331057 - systematicCode := BitVec.ofNat 64 17936878037175120927 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9786512792357120 - maskLow := BitVec.ofNat 64 4402408685847 - maskHigh := BitVec.ofNat 64 1405123083739595777 - systematicCode := BitVec.ofNat 64 17938666277058130975 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9786533997463808 - maskLow := BitVec.ofNat 64 4402408685847 - maskHigh := BitVec.ofNat 64 2327235107443704833 - systematicCode := BitVec.ofNat 64 18153138071734072351 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089440458064256 - maskLow := BitVec.ofNat 64 219906687729943 - maskHigh := BitVec.ofNat 64 2341871806232658945 - systematicCode := BitVec.ofNat 64 18153891755967591455 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711161854411136 - maskLow := BitVec.ofNat 64 4402408685847 - maskHigh := BitVec.ofNat 64 2341871806232709121 - systematicCode := BitVec.ofNat 64 18153903022639690783 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x3425. -/ -def normalizedWeightSixteenCandidateBucket_3425 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085356368905216 - maskLow := BitVec.ofNat 64 1152992015152382231 - maskHigh := BitVec.ofNat 64 2251868541550593 - systematicCode := BitVec.ofNat 64 16629733460344976421 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148525858341888 - maskLow := BitVec.ofNat 64 36028801381368087 - maskHigh := BitVec.ofNat 64 2251868801613857 - systematicCode := BitVec.ofNat 64 16629745710349038629 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085356217919488 - maskLow := BitVec.ofNat 64 144124125970235671 - maskHigh := BitVec.ofNat 64 18014407107805185 - systematicCode := BitVec.ofNat 64 17060390148841813029 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148525707356160 - maskLow := BitVec.ofNat 64 36028801381368087 - maskHigh := BitVec.ofNat 64 18014407132973089 - systematicCode := BitVec.ofNat 64 17060395801876771877 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9359631990211584 - maskLow := BitVec.ofNat 64 36028801381368087 - maskHigh := BitVec.ofNat 64 72062069402238977 - systematicCode := BitVec.ofNat 64 17426055071655670821 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36046424169006080 - maskLow := BitVec.ofNat 64 1298162596951949591 - maskHigh := BitVec.ofNat 64 72198331534671873 - systematicCode := BitVec.ofNat 64 17428840919597331493 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2533309754393600 - maskLow := BitVec.ofNat 64 36028801381368087 - maskHigh := BitVec.ofNat 64 72198331828535297 - systematicCode := BitVec.ofNat 64 17428853264156079141 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2533859509945344 - maskLow := BitVec.ofNat 64 36028801381368087 - maskHigh := BitVec.ofNat 64 2305847407260485633 - systematicCode := BitVec.ofNat 64 18146591270316684325 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36046973924557824 - maskLow := BitVec.ofNat 64 1205069106446615 - maskHigh := BitVec.ofNat 64 2305847407268593665 - systematicCode := BitVec.ofNat 64 18146602019645240357 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9359082268216320 - maskLow := BitVec.ofNat 64 36028801381368087 - maskHigh := BitVec.ofNat 64 2326249945033605121 - systematicCode := BitVec.ofNat 64 18153138046402180133 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x3426. -/ -def normalizedWeightSixteenCandidateBucket_3426 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10208424309818368 - maskLow := BitVec.ofNat 64 2305983819784192279 - maskHigh := BitVec.ofNat 64 1125968630513665 - systematicCode := BitVec.ofNat 64 16557674771107099686 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9649872402908160 - maskLow := BitVec.ofNat 64 18014402872148247 - maskHigh := BitVec.ofNat 64 1125969163223057 - systematicCode := BitVec.ofNat 64 16557689220100863014 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11334324243923968 - maskLow := BitVec.ofNat 64 144124057251021079 - maskHigh := BitVec.ofNat 64 18014402808643585 - systematicCode := BitVec.ofNat 64 17060107574353409062 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9658668523193344 - maskLow := BitVec.ofNat 64 18014402872148247 - maskHigh := BitVec.ofNat 64 18014402838005777 - systematicCode := BitVec.ofNat 64 17060114326883218470 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9592697825526784 - maskLow := BitVec.ofNat 64 18014402872148247 - maskHigh := BitVec.ofNat 64 144124057187516417 - systematicCode := BitVec.ofNat 64 17498394136358499366 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11333813411253376 - maskLow := BitVec.ofNat 64 2451084101559058711 - maskHigh := BitVec.ofNat 64 144255925568405505 - systematicCode := BitVec.ofNat 64 17500897418418598950 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9658157690522752 - maskLow := BitVec.ofNat 64 18014402872148247 - maskHigh := BitVec.ofNat 64 144255926134898689 - systematicCode := BitVec.ofNat 64 17500911957705569318 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9660872108559488 - maskLow := BitVec.ofNat 64 18014402872148247 - maskHigh := BitVec.ofNat 64 2305851805307013121 - systematicCode := BitVec.ofNat 64 18146872749588296742 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11336527829290112 - maskLow := BitVec.ofNat 64 1275437850886423 - maskHigh := BitVec.ofNat 64 2305851805310910465 - systematicCode := BitVec.ofNat 64 18146882395127100454 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9592182397748224 - maskLow := BitVec.ofNat 64 18014402872148247 - maskHigh := BitVec.ofNat 64 2325124045122568193 - systematicCode := BitVec.ofNat 64 18153136946873709606 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x342c. -/ -def normalizedWeightSixteenCandidateBucket_342c : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10208424316109440 - maskLow := BitVec.ofNat 64 2305983759658320151 - maskHigh := BitVec.ofNat 64 1125908497301505 - systematicCode := BitVec.ofNat 64 16555979324176675884 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9649872409199232 - maskLow := BitVec.ofNat 64 2251804180021527 - maskHigh := BitVec.ofNat 64 1125909033680899 - systematicCode := BitVec.ofNat 64 16556000370139542572 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11334324222953728 - maskLow := BitVec.ofNat 64 1152991886307295511 - maskHigh := BitVec.ofNat 64 2251804109176833 - systematicCode := BitVec.ofNat 64 16627755438926148652 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9658668502223104 - maskLow := BitVec.ofNat 64 2251804180021527 - maskHigh := BitVec.ofNat 64 2251804377104387 - systematicCode := BitVec.ofNat 64 16627775385394164780 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9592697804556544 - maskLow := BitVec.ofNat 64 2251804180021527 - maskHigh := BitVec.ofNat 64 1152991886236450817 - systematicCode := BitVec.ofNat 64 17932421953275507756 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11333813425932544 - maskLow := BitVec.ofNat 64 3459890418093719831 - maskHigh := BitVec.ofNat 64 1153062242095726593 - systematicCode := BitVec.ofNat 64 17933236385677063212 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9658157705201920 - maskLow := BitVec.ofNat 64 2251804180021527 - maskHigh := BitVec.ofNat 64 1153062242900770817 - systematicCode := BitVec.ofNat 64 17933257547702547500 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9660872123238656 - maskLow := BitVec.ofNat 64 2251804180021527 - maskHigh := BitVec.ofNat 64 2305913377958182913 - systematicCode := BitVec.ofNat 64 18148561599548830764 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11336527843969280 - maskLow := BitVec.ofNat 64 1337010505711895 - maskHigh := BitVec.ofNat 64 2305913377958395905 - systematicCode := BitVec.ofNat 64 18148564647917990956 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9592182408233344 - maskLow := BitVec.ofNat 64 2251804180021527 - maskHigh := BitVec.ofNat 64 2309361446423101441 - systematicCode := BitVec.ofNat 64 18151448096912389164 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x342f. -/ -def normalizedWeightSixteenCandidateBucket_342f : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089717246724352 - maskLow := BitVec.ofNat 64 36028878698905879 - maskHigh := BitVec.ofNat 64 72061992084701185 - systematicCode := BitVec.ofNat 64 17426015126762501167 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711438643071232 - maskLow := BitVec.ofNat 64 1125904277373207 - maskHigh := BitVec.ofNat 64 72061992092827667 - systematicCode := BitVec.ofNat 64 17426026238818137135 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089717242528384 - maskLow := BitVec.ofNat 64 18014548908900631 - maskHigh := BitVec.ofNat 64 144123984169140225 - systematicCode := BitVec.ofNat 64 17498354191498949679 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711438638875264 - maskLow := BitVec.ofNat 64 1125904277373207 - maskHigh := BitVec.ofNat 64 144123984173072419 - systematicCode := BitVec.ofNat 64 17498364212616115247 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089717215267072 - maskLow := BitVec.ofNat 64 2252010342646039 - maskHigh := BitVec.ofNat 64 1152991873351286785 - systematicCode := BitVec.ofNat 64 17932388579817370671 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711438611613952 - maskLow := BitVec.ofNat 64 1125904277373207 - maskHigh := BitVec.ofNat 64 1152991873351548977 - systematicCode := BitVec.ofNat 64 17932392029734843439 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9785694601087232 - maskLow := BitVec.ofNat 64 1125904277373207 - maskHigh := BitVec.ofNat 64 1369235024209248257 - systematicCode := BitVec.ofNat 64 17938666208608138287 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9788409019123968 - maskLow := BitVec.ofNat 64 1125904277373207 - maskHigh := BitVec.ofNat 64 2305926572097667073 - systematicCode := BitVec.ofNat 64 18148616811470664751 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089201818943872 - maskLow := BitVec.ofNat 64 56294999712661783 - maskHigh := BitVec.ofNat 64 2305983746702311425 - systematicCode := BitVec.ofNat 64 18149405817515226159 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9710923215290752 - maskLow := BitVec.ofNat 64 1125904277373207 - maskHigh := BitVec.ofNat 64 2305983746715156481 - systematicCode := BitVec.ofNat 64 18149417084187325487 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x3431. -/ -def normalizedWeightSixteenCandidateBucket_3431 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9359628500763648 - maskLow := BitVec.ofNat 64 2305843013592613143 - maskHigh := BitVec.ofNat 64 1130375799635969 - systematicCode := BitVec.ofNat 64 16561363943402648625 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2533313780679680 - maskLow := BitVec.ofNat 64 2305843013592613143 - maskHigh := BitVec.ofNat 64 1266637416693761 - systematicCode := BitVec.ofNat 64 16564152214377608241 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36046428195292160 - maskLow := BitVec.ofNat 64 92323796740014359 - maskHigh := BitVec.ofNat 64 1266637932068865 - systematicCode := BitVec.ofNat 64 16564162946526557233 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2533859241526272 - maskLow := BitVec.ofNat 64 2305843013592613143 - maskHigh := BitVec.ofNat 64 36033195082270721 - systematicCode := BitVec.ofNat 64 17281913336001868849 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36046973656138752 - maskLow := BitVec.ofNat 64 72136763254046999 - maskHigh := BitVec.ofNat 64 36033195602345985 - systematicCode := BitVec.ofNat 64 17281924136869246001 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148522368893952 - maskLow := BitVec.ofNat 64 2305843013592613143 - maskHigh := BitVec.ofNat 64 144115256799543329 - systematicCode := BitVec.ofNat 64 17494423644665426993 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085352879457280 - maskLow := BitVec.ofNat 64 18084909071532311 - maskHigh := BitVec.ofNat 64 144115257332203521 - systematicCode := BitVec.ofNat 64 17494437731400037425 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148522217908224 - maskLow := BitVec.ofNat 64 2305843013592613143 - maskHigh := BitVec.ofNat 64 1152921513197307937 - systematicCode := BitVec.ofNat 64 17925073736193160241 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085352728471552 - maskLow := BitVec.ofNat 64 2260737724580119 - maskHigh := BitVec.ofNat 64 1152921513733652481 - systematicCode := BitVec.ofNat 64 17925094419896874033 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9359083073473536 - maskLow := BitVec.ofNat 64 2305843013592613143 - maskHigh := BitVec.ofNat 64 1333206227726893057 - systematicCode := BitVec.ofNat 64 17938664009955423281 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x3432. -/ -def normalizedWeightSixteenCandidateBucket_3432 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9592710709642240 - maskLow := BitVec.ofNat 64 1152921509002543383 - maskHigh := BitVec.ofNat 64 2260669189586945 - systematicCode := BitVec.ofNat 64 16633703008105477170 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9658166011513984 - maskLow := BitVec.ofNat 64 1152921509002543383 - maskHigh := BitVec.ofNat 64 2392537327730689 - systematicCode := BitVec.ofNat 64 16636209812710437938 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11333821732244608 - maskLow := BitVec.ofNat 64 110338195266273559 - maskHigh := BitVec.ofNat 64 2392537570476033 - systematicCode := BitVec.ofNat 64 16636219441069634610 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9660859224444032 - maskLow := BitVec.ofNat 64 1152921509002543383 - maskHigh := BitVec.ofNat 64 36037593128798209 - systematicCode := BitVec.ofNat 64 17282194815273481266 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11336514945174656 - maskLow := BitVec.ofNat 64 72207132015001879 - maskHigh := BitVec.ofNat 64 36037593380421633 - systematicCode := BitVec.ofNat 64 17282204512351106098 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9649885287023616 - maskLow := BitVec.ofNat 64 1152921509002543383 - maskHigh := BitVec.ofNat 64 72057662765826065 - systematicCode := BitVec.ofNat 64 17422367154417251378 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10208437193933824 - maskLow := BitVec.ofNat 64 36169607622492439 - maskHigh := BitVec.ofNat 64 72057663025840129 - systematicCode := BitVec.ofNat 64 17422379042162160690 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9658681407308800 - maskLow := BitVec.ofNat 64 1152921509002543383 - maskHigh := BitVec.ofNat 64 1152921508902340625 - systematicCode := BitVec.ofNat 64 17924792261199606834 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11334337128039424 - maskLow := BitVec.ofNat 64 2260669021880599 - maskHigh := BitVec.ofNat 64 1152921509170249729 - systematicCode := BitVec.ofNat 64 17924811845408470066 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9592191255577600 - maskLow := BitVec.ofNat 64 1152921509002543383 - maskHigh := BitVec.ofNat 64 1261148633420529665 - systematicCode := BitVec.ofNat 64 17938382534961869874 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x370b. -/ -def normalizedWeightSixteenCandidateBucket_370b : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11330469510776960 - maskLow := BitVec.ofNat 64 145245490458460471 - maskHigh := BitVec.ofNat 64 824633720835 - systematicCode := BitVec.ofNat 64 14901711273666557707 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9096261883136128 - maskLow := BitVec.ofNat 64 13019185463 - maskHigh := BitVec.ofNat 64 824667538433 - systematicCode := BitVec.ofNat 64 14901764261482280715 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11330488836950144 - maskLow := BitVec.ofNat 64 74313796327375159 - maskHigh := BitVec.ofNat 64 52776558133251 - systematicCode := BitVec.ofNat 64 15769780089007650571 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9096281209309312 - maskLow := BitVec.ofNat 64 13019185463 - maskHigh := BitVec.ofNat 64 52776575435777 - systematicCode := BitVec.ofNat 64 15769829804007962379 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11332125219489920 - maskLow := BitVec.ofNat 64 73192294467043639 - maskHigh := BitVec.ofNat 64 13510798882111491 - systematicCode := BitVec.ofNat 64 16927205193191733003 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9097917591849088 - maskLow := BitVec.ofNat 64 13019185463 - maskHigh := BitVec.ofNat 64 13510798899152897 - systematicCode := BitVec.ofNat 64 16927254895407609611 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9026999058301056 - maskLow := BitVec.ofNat 64 13019185463 - maskHigh := BitVec.ofNat 64 4620728951810031619 - systematicCode := BitVec.ofNat 64 18296677016646399755 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9026999058303104 - maskLow := BitVec.ofNat 64 13019185463 - maskHigh := BitVec.ofNat 64 9227893503546097667 - systematicCode := BitVec.ofNat 64 18368452031901021963 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11332129514717312 - maskLow := BitVec.ofNat 64 146375788411814199 - maskHigh := BitVec.ofNat 64 13835058055282163715 - systematicCode := BitVec.ofNat 64 18373986586419738379 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9097921887076480 - maskLow := BitVec.ofNat 64 13019185463 - maskHigh := BitVec.ofNat 64 13835058055316244481 - systematicCode := BitVec.ofNat 64 18374039587120166667 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x370d. -/ -def normalizedWeightSixteenCandidateBucket_370d : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11330469509752832 - maskLow := BitVec.ofNat 64 288795529557639511 - maskHigh := BitVec.ofNat 64 687194767365 - systematicCode := BitVec.ofNat 64 14901150531292641037 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9096261882112000 - maskLow := BitVec.ofNat 64 21609120087 - maskHigh := BitVec.ofNat 64 687262007809 - systematicCode := BitVec.ofNat 64 14901203501928757005 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11330488837096448 - maskLow := BitVec.ofNat 64 74311597304119639 - maskHigh := BitVec.ofNat 64 87960930222085 - systematicCode := BitVec.ofNat 64 15913897476106630925 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9096281209455616 - maskLow := BitVec.ofNat 64 21609120087 - maskHigh := BitVec.ofNat 64 87960947524097 - systematicCode := BitVec.ofNat 64 15913944992050394893 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11332125219636224 - maskLow := BitVec.ofNat 64 72629344513622359 - maskHigh := BitVec.ofNat 64 22517998136852485 - systematicCode := BitVec.ofNat 64 17071322580257289997 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9097917591995392 - maskLow := BitVec.ofNat 64 21609120087 - maskHigh := BitVec.ofNat 64 22517998153762817 - systematicCode := BitVec.ofNat 64 17071370074893661965 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9026999058187264 - maskLow := BitVec.ofNat 64 21609120087 - maskHigh := BitVec.ofNat 64 2323928326223167493 - systematicCode := BitVec.ofNat 64 18153126977580906253 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9026999058449408 - maskLow := BitVec.ofNat 64 21609120087 - maskHigh := BitVec.ofNat 64 9227893366107144197 - systematicCode := BitVec.ofNat 64 18368452023344772877 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11332129514343424 - maskLow := BitVec.ofNat 64 290490976487670103 - maskHigh := BitVec.ofNat 64 11529215046068469765 - systematicCode := BitVec.ofNat 64 18373425844079507213 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9097921886702592 - maskLow := BitVec.ofNat 64 21609120087 - maskHigh := BitVec.ofNat 64 11529215046136104961 - systematicCode := BitVec.ofNat 64 18373478836190131981 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x370e. -/ -def normalizedWeightSixteenCandidateBucket_370e : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089857343825920 - maskLow := BitVec.ofNat 64 576743331221012887 - maskHigh := BitVec.ofNat 64 412316860425 - systematicCode := BitVec.ofNat 64 14829094041044465422 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711578740172800 - maskLow := BitVec.ofNat 64 38788989335 - maskHigh := BitVec.ofNat 64 412451143937 - systematicCode := BitVec.ofNat 64 14829147003090777870 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089785134688256 - maskLow := BitVec.ofNat 64 74310497792491927 - maskHigh := BitVec.ofNat 64 105553116266505 - systematicCode := BitVec.ofNat 64 15914180050594903822 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711506531035136 - maskLow := BitVec.ofNat 64 38788989335 - maskHigh := BitVec.ofNat 64 105553133568257 - systematicCode := BitVec.ofNat 64 15914226467010393870 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089341947750400 - maskLow := BitVec.ofNat 64 72347869536911767 - maskHigh := BitVec.ofNat 64 27021597764222985 - systematicCode := BitVec.ofNat 64 17071605154728851214 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711063344097280 - maskLow := BitVec.ofNat 64 38788989335 - maskHigh := BitVec.ofNat 64 27021597781067777 - systematicCode := BitVec.ofNat 64 17071651545575470862 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9786345566267392 - maskLow := BitVec.ofNat 64 38788989335 - maskHigh := BitVec.ofNat 64 2323928051345260553 - systematicCode := BitVec.ofNat 64 18153126973302781710 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9786345567551616 - maskLow := BitVec.ofNat 64 38788989335 - maskHigh := BitVec.ofNat 64 4620728539493171209 - systematicCode := BitVec.ofNat 64 18296677003812026126 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089337920970880 - maskLow := BitVec.ofNat 64 578721352639381911 - maskHigh := BitVec.ofNat 64 6917529027641081865 - systematicCode := BitVec.ofNat 64 18301369353848174350 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711059317317760 - maskLow := BitVec.ofNat 64 38788989335 - maskHigh := BitVec.ofNat 64 6917529027775825921 - systematicCode := BitVec.ofNat 64 18301422341663897358 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x3719. -/ -def normalizedWeightSixteenCandidateBucket_3719 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11330471925524480 - maskLow := BitVec.ofNat 64 288793364894126359 - maskHigh := BitVec.ofNat 64 35321811042561 - systematicCode := BitVec.ofNat 64 15765854853886523161 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9096264297883648 - maskLow := BitVec.ofNat 64 1103940882711 - maskHigh := BitVec.ofNat 64 35321878282249 - systematicCode := BitVec.ofNat 64 15765894630183352089 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11330471926694912 - maskLow := BitVec.ofNat 64 145241126771691799 - maskHigh := BitVec.ofNat 64 70643622084865 - systematicCode := BitVec.ofNat 64 15910532983359420185 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9096264299054080 - maskLow := BitVec.ofNat 64 1103940882711 - maskHigh := BitVec.ofNat 64 70643655901193 - systematicCode := BitVec.ofNat 64 15910570577779308313 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11332121193350144 - maskLow := BitVec.ofNat 64 1697650382541079 - maskHigh := BitVec.ofNat 64 1157425104234217729 - systematicCode := BitVec.ofNat 64 17936026851312351001 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9097913565709312 - maskLow := BitVec.ofNat 64 1103940882711 - maskHigh := BitVec.ofNat 64 1157425104234612737 - systematicCode := BitVec.ofNat 64 17936048009210050329 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9026990737196032 - maskLow := BitVec.ofNat 64 1103940882711 - maskHigh := BitVec.ofNat 64 1189055854742077697 - systematicCode := BitVec.ofNat 64 17937798672138975001 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9026995032163328 - maskLow := BitVec.ofNat 64 1103940882711 - maskHigh := BitVec.ofNat 64 9227876048799006977 - systematicCode := BitVec.ofNat 64 18368438829407352601 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11332116898647040 - maskLow := BitVec.ofNat 64 432354364749844759 - maskHigh := BitVec.ofNat 64 9259400833873740033 - systematicCode := BitVec.ofNat 64 18370061338699839257 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9097909271006208 - maskLow := BitVec.ofNat 64 1103940882711 - maskHigh := BitVec.ofNat 64 9259400833974405121 - systematicCode := BitVec.ofNat 64 18370101188009998105 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x371a. -/ -def normalizedWeightSixteenCandidateBucket_371a : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089856806987776 - maskLow := BitVec.ofNat 64 576742248889262359 - maskHigh := BitVec.ofNat 64 17729624998401 - systematicCode := BitVec.ofNat 64 15693798363638347546 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711578203334656 - maskLow := BitVec.ofNat 64 2203452514583 - maskHigh := BitVec.ofNat 64 17729759281157 - systematicCode := BitVec.ofNat 64 15693838131345372954 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089788087298048 - maskLow := BitVec.ofNat 64 145241109591826711 - maskHigh := BitVec.ofNat 64 70918499992065 - systematicCode := BitVec.ofNat 64 15910815557847693082 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711509483644928 - maskLow := BitVec.ofNat 64 2203452514583 - maskHigh := BitVec.ofNat 64 70918533808133 - systematicCode := BitVec.ofNat 64 15910852052739307290 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089341410912256 - maskLow := BitVec.ofNat 64 1416175405834519 - maskHigh := BitVec.ofNat 64 1161928703861588481 - systematicCode := BitVec.ofNat 64 17936309425783912218 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711062807259136 - maskLow := BitVec.ofNat 64 2203452514583 - maskHigh := BitVec.ofNat 64 1161928703861917697 - systematicCode := BitVec.ofNat 64 17936329479891859226 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9786341003143168 - maskLow := BitVec.ofNat 64 2203452514583 - maskHigh := BitVec.ofNat 64 1189038262556033537 - systematicCode := BitVec.ofNat 64 17937798667860850458 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9786362209534080 - maskLow := BitVec.ofNat 64 2203452514583 - maskHigh := BitVec.ofNat 64 4620693904876896769 - systematicCode := BitVec.ofNat 64 18296663809874605850 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089337384132736 - maskLow := BitVec.ofNat 64 720584740901560599 - maskHigh := BitVec.ofNat 64 4647714815446352385 - systematicCode := BitVec.ofNat 64 18298004848468506394 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711058780479616 - maskLow := BitVec.ofNat 64 2203452514583 - maskHigh := BitVec.ofNat 64 4647714815614126081 - systematicCode := BitVec.ofNat 64 18298044693483763482 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x371c. -/ -def normalizedWeightSixteenCandidateBucket_371c : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089856807995648 - maskLow := BitVec.ofNat 64 576742240299335959 - maskHigh := BitVec.ofNat 64 17867063952385 - systematicCode := BitVec.ofNat 64 15694363512614893340 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711578204342528 - maskLow := BitVec.ofNat 64 4402475778327 - maskHigh := BitVec.ofNat 64 17867198234627 - systematicCode := BitVec.ofNat 64 15694401081265370908 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089788088517248 - maskLow := BitVec.ofNat 64 288793339124334871 - maskHigh := BitVec.ofNat 64 35734127903745 - systematicCode := BitVec.ofNat 64 15766702577351341852 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711509484864128 - maskLow := BitVec.ofNat 64 4402475778327 - maskHigh := BitVec.ofNat 64 35734195142659 - systematicCode := BitVec.ofNat 64 15766739055063349020 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089341411920128 - maskLow := BitVec.ofNat 64 853225452421399 - maskHigh := BitVec.ofNat 64 1170935903116329985 - systematicCode := BitVec.ofNat 64 17936874566170654492 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711062808267008 - maskLow := BitVec.ofNat 64 4402475778327 - maskHigh := BitVec.ofNat 64 1170935903116527617 - systematicCode := BitVec.ofNat 64 17936890230822156060 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9786341004151040 - maskLow := BitVec.ofNat 64 4402475778327 - maskHigh := BitVec.ofNat 64 1189003078183945217 - systematicCode := BitVec.ofNat 64 17937796468871280412 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9786362209257728 - maskLow := BitVec.ofNat 64 4402475778327 - maskHigh := BitVec.ofNat 64 2323858232356897793 - systematicCode := BitVec.ofNat 64 18153111580375791388 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089337385140608 - maskLow := BitVec.ofNat 64 864699928977424663 - maskHigh := BitVec.ofNat 64 2341871806232658945 - systematicCode := BitVec.ofNat 64 18153891859449460508 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711058781487488 - maskLow := BitVec.ofNat 64 4402475778327 - maskHigh := BitVec.ofNat 64 2341871806433986561 - systematicCode := BitVec.ofNat 64 18153929513997973276 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x371f. -/ -def normalizedWeightSixteenCandidateBucket_371f : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9928078950203648 - maskLow := BitVec.ofNat 64 8800522305815 - maskHigh := BitVec.ofNat 64 1184446701998442497 - systematicCode := BitVec.ofNat 64 17936969704897197855 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9852723981779200 - maskLow := BitVec.ofNat 64 8800522305815 - maskHigh := BitVec.ofNat 64 1188950301625812737 - systematicCode := BitVec.ofNat 64 17937719198064523039 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36104663606558976 - maskLow := BitVec.ofNat 64 7701010678039 - maskHigh := BitVec.ofNat 64 1188950301625812993 - systematicCode := BitVec.ofNat 64 17937722229254076191 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9852724787036416 - maskLow := BitVec.ofNat 64 8800522305815 - maskHigh := BitVec.ofNat 64 2323857407723176973 - systematicCode := BitVec.ofNat 64 18153047503507240735 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36104664411816192 - maskLow := BitVec.ofNat 64 4454015402263 - maskHigh := BitVec.ofNat 64 2323857407723177985 - systematicCode := BitVec.ofNat 64 18153050586235615007 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18050167277109632 - maskLow := BitVec.ofNat 64 4405697020183 - maskHigh := BitVec.ofNat 64 2341871806232658945 - systematicCode := BitVec.ofNat 64 18153891712496121631 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9852724787052672 - maskLow := BitVec.ofNat 64 8800522305815 - maskHigh := BitVec.ofNat 64 4620693217682129419 - systematicCode := BitVec.ofNat 64 18296597542572865311 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36104664411832448 - maskLow := BitVec.ofNat 64 2246402212119 - maskHigh := BitVec.ofNat 64 4620693217682130945 - systematicCode := BitVec.ofNat 64 18296602815767983903 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18050167276101760 - maskLow := BitVec.ofNat 64 2206136893719 - maskHigh := BitVec.ofNat 64 4647714815446352385 - systematicCode := BitVec.ofNat 64 18298004692958656287 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9852728008311040 - maskLow := BitVec.ofNat 64 8800522305815 - maskHigh := BitVec.ofNat 64 9227875636482146567 - systematicCode := BitVec.ofNat 64 18368372557827487519 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36104667633090816 - maskLow := BitVec.ofNat 64 1129710715159 - maskHigh := BitVec.ofNat 64 9227875636482148353 - systematicCode := BitVec.ofNat 64 18368378930517456671 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11338714098437120 - maskLow := BitVec.ofNat 64 1105551524119 - maskHigh := BitVec.ofNat 64 9259400833873740033 - systematicCode := BitVec.ofNat 64 18370061183173211935 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9928074923952512 - maskLow := BitVec.ofNat 64 8800522305815 - maskHigh := BitVec.ofNat 64 16176929861514823681 - systematicCode := BitVec.ofNat 64 18374119061196322591 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x3729. -/ -def normalizedWeightSixteenCandidateBucket_3729 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11329960555980800 - maskLow := BitVec.ofNat 64 288232613965005079 - maskHigh := BitVec.ofNat 64 9007336693760001 - systematicCode := BitVec.ofNat 64 16918793950410979113 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9095752928339968 - maskLow := BitVec.ofNat 64 281479407010071 - maskHigh := BitVec.ofNat 64 9007336760803849 - systematicCode := BitVec.ofNat 64 16918816066071770921 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11329960557151232 - maskLow := BitVec.ofNat 64 144119624912404759 - maskHigh := BitVec.ofNat 64 18014673387454465 - systematicCode := BitVec.ofNat 64 17063472079883876137 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9095752929510400 - maskLow := BitVec.ofNat 64 281479407010071 - maskHigh := BitVec.ofNat 64 18014673420944393 - systematicCode := BitVec.ofNat 64 17063492013667727145 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11329973441266688 - maskLow := BitVec.ofNat 64 2258401313751319 - maskHigh := BitVec.ofNat 64 1152939096792956929 - systematicCode := BitVec.ofNat 64 17931540856520718121 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9095765813625856 - maskLow := BitVec.ofNat 64 281479407010071 - maskHigh := BitVec.ofNat 64 1152939096793417217 - systematicCode := BitVec.ofNat 64 17931547647905183529 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9024842985112576 - maskLow := BitVec.ofNat 64 281479407010071 - maskHigh := BitVec.ofNat 64 1180083839859490817 - systematicCode := BitVec.ofNat 64 17936969662115952425 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9025392740926464 - maskLow := BitVec.ofNat 64 281479407010071 - maskHigh := BitVec.ofNat 64 9223390041357746177 - systematicCode := BitVec.ofNat 64 18363935230049466153 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11329423685716992 - maskLow := BitVec.ofNat 64 434597368471552279 - maskHigh := BitVec.ofNat 64 9223512774343196673 - systematicCode := BitVec.ofNat 64 18365575331259561769 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9095216058076160 - maskLow := BitVec.ofNat 64 281479407010071 - maskHigh := BitVec.ofNat 64 9223512774444318721 - systematicCode := BitVec.ofNat 64 18365597588652111657 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x372a. -/ -def normalizedWeightSixteenCandidateBucket_372a : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089720441776128 - maskLow := BitVec.ofNat 64 576461873426268439 - maskHigh := BitVec.ofNat 64 4503737066455041 - systematicCode := BitVec.ofNat 64 16846737460162803498 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711441838123008 - maskLow := BitVec.ofNat 64 562954384769303 - maskHigh := BitVec.ofNat 64 4503737200541957 - systematicCode := BitVec.ofNat 64 16846759567233791786 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089719904692224 - maskLow := BitVec.ofNat 64 144119607733584151 - maskHigh := BitVec.ofNat 64 18014948265426945 - systematicCode := BitVec.ofNat 64 17063754654372149034 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711441301039104 - maskLow := BitVec.ofNat 64 562954384769303 - maskHigh := BitVec.ofNat 64 18014948298851333 - systematicCode := BitVec.ofNat 64 17063773488627726122 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089716415244288 - maskLow := BitVec.ofNat 64 2257301803172119 - maskHigh := BitVec.ofNat 64 1152956688979066881 - systematicCode := BitVec.ofNat 64 17931823431008991018 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711437811591168 - maskLow := BitVec.ofNat 64 562954384769303 - maskHigh := BitVec.ofNat 64 1152956688979461377 - systematicCode := BitVec.ofNat 64 17931829122865182506 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9785693268387840 - maskLow := BitVec.ofNat 64 562954384769303 - maskHigh := BitVec.ofNat 64 1175580240232185857 - systematicCode := BitVec.ofNat 64 17936968562621167402 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9788407687708800 - maskLow := BitVec.ofNat 64 562954384769303 - maskHigh := BitVec.ofNat 64 4611721889994375169 - systematicCode := BitVec.ofNat 64 18292160210516719402 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089201018921088 - maskLow := BitVec.ofNat 64 722827744624312599 - maskHigh := BitVec.ofNat 64 4611826755915874305 - systematicCode := BitVec.ofNat 64 18293518841028228906 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9710922415267968 - maskLow := BitVec.ofNat 64 562954384769303 - maskHigh := BitVec.ofNat 64 4611826756084039681 - systematicCode := BitVec.ofNat 64 18293541094125877034 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x372c. -/ -def normalizedWeightSixteenCandidateBucket_372c : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089720442784000 - maskLow := BitVec.ofNat 64 576461864838430999 - maskHigh := BitVec.ofNat 64 4503874505539585 - systematicCode := BitVec.ofNat 64 16847302609139349292 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711441839130880 - maskLow := BitVec.ofNat 64 1125904340287767 - maskHigh := BitVec.ofNat 64 4503874639495427 - systematicCode := BitVec.ofNat 64 16847322517153789740 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089719905911424 - maskLow := BitVec.ofNat 64 288232588198347031 - maskHigh := BitVec.ofNat 64 9007749010817025 - systematicCode := BitVec.ofNat 64 16919641673875797804 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711441302258304 - maskLow := BitVec.ofNat 64 1125904340287767 - maskHigh := BitVec.ofNat 64 9007749077664259 - systematicCode := BitVec.ofNat 64 16919660490951767852 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089716416252160 - maskLow := BitVec.ofNat 64 2255102782013719 - maskHigh := BitVec.ofNat 64 1152991873351286785 - systematicCode := BitVec.ofNat 64 17932388579952113452 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711437812599040 - maskLow := BitVec.ofNat 64 1125904340287767 - maskHigh := BitVec.ofNat 64 1152991873351549697 - systematicCode := BitVec.ofNat 64 17932392064228800300 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9785693269395712 - maskLow := BitVec.ofNat 64 1125904340287767 - maskHigh := BitVec.ofNat 64 1166573040977575937 - systematicCode := BitVec.ofNat 64 17936405612701431596 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9788407687432448 - maskLow := BitVec.ofNat 64 1125904340287767 - maskHigh := BitVec.ofNat 64 2305914202591854593 - systematicCode := BitVec.ofNat 64 18148607981017904940 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089201019928960 - maskLow := BitVec.ofNat 64 866942932702265623 - maskHigh := BitVec.ofNat 64 2305983746702311425 - systematicCode := BitVec.ofNat 64 18149405852009183020 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9710922416275840 - maskLow := BitVec.ofNat 64 1125904340287767 - maskHigh := BitVec.ofNat 64 2305983746903900161 - systematicCode := BitVec.ofNat 64 18149425914640086828 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x372f. -/ -def normalizedWeightSixteenCandidateBucket_372f : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9926953937207552 - maskLow := BitVec.ofNat 64 2251804251324695 - maskHigh := BitVec.ofNat 64 1153044649909682177 - systematicCode := BitVec.ofNat 64 17932448444633790255 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9851667151388928 - maskLow := BitVec.ofNat 64 2251804251324695 - maskHigh := BitVec.ofNat 64 1153062242095661057 - systematicCode := BitVec.ofNat 64 17933233259612157743 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36103606776168704 - maskLow := BitVec.ofNat 64 1970329274614039 - maskHigh := BitVec.ofNat 64 1153062242095726593 - systematicCode := BitVec.ofNat 64 17933236290801710895 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9851770230554880 - maskLow := BitVec.ofNat 64 2251804251324695 - maskHigh := BitVec.ofNat 64 2305913377958133773 - systematicCode := BitVec.ofNat 64 18148561496066963247 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36103709855334656 - maskLow := BitVec.ofNat 64 1125955884089623 - maskHigh := BitVec.ofNat 64 2305913377958395905 - systematicCode := BitVec.ofNat 64 18148564647513765679 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18049621816263040 - maskLow := BitVec.ofNat 64 1125907565707543 - maskHigh := BitVec.ofNat 64 2305983746702311425 - systematicCode := BitVec.ofNat 64 18149405773774272303 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9851770230571136 - maskLow := BitVec.ofNat 64 2251804251324695 - maskHigh := BitVec.ofNat 64 4611721202799607819 - systematicCode := BitVec.ofNat 64 18292111535132587823 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36103709855350912 - maskLow := BitVec.ofNat 64 562997340733719 - maskHigh := BitVec.ofNat 64 4611721202800001025 - systematicCode := BitVec.ofNat 64 18292116877046134575 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18049621815255168 - maskLow := BitVec.ofNat 64 562957075415319 - maskHigh := BitVec.ofNat 64 4611826755915874305 - systematicCode := BitVec.ofNat 64 18293518754236806959 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9852182547464448 - maskLow := BitVec.ofNat 64 2251804251324695 - maskHigh := BitVec.ofNat 64 9223389629040885767 - systematicCode := BitVec.ofNat 64 18363886550387210031 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36104122172244224 - maskLow := BitVec.ofNat 64 281505184153879 - maskHigh := BitVec.ofNat 64 9223389629041344513 - systematicCode := BitVec.ofNat 64 18363892991795607343 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11338202728893440 - maskLow := BitVec.ofNat 64 281481024962839 - maskHigh := BitVec.ofNat 64 9223512774343196673 - systematicCode := BitVec.ofNat 64 18365575244451362607 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9926438541412736 - maskLow := BitVec.ofNat 64 2251804251324695 - maskHigh := BitVec.ofNat 64 16141041801984737281 - systematicCode := BitVec.ofNat 64 18374118992746329903 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x3807. -/ -def normalizedWeightSixteenCandidateBucket_3807 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.node - (.leaf - { patternClass := .twoE8 - affineCode := BitVec.ofNat 56 2393089457029248 - maskLow := BitVec.ofNat 64 76578790414811423 - maskHigh := BitVec.ofNat 64 15 - systematicCode := BitVec.ofNat 64 9693298291795048455 }) - (.leaf - { patternClass := .twoE8 - affineCode := BitVec.ofNat 56 18032542850515072 - maskLow := BitVec.ofNat 64 64693010719 - maskHigh := BitVec.ofNat 64 17829889 - systematicCode := BitVec.ofNat 64 12729591774339872775 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10274115990864512 - maskLow := BitVec.ofNat 64 612507146071900447 - maskHigh := BitVec.ofNat 64 24585 - systematicCode := BitVec.ofNat 64 11356818728560375815 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11400015897708800 - maskLow := BitVec.ofNat 64 306262371410706719 - maskHigh := BitVec.ofNat 64 40965 - systematicCode := BitVec.ofNat 64 11428875218774931463 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11400015897725056 - maskLow := BitVec.ofNat 64 153139984080109855 - maskHigh := BitVec.ofNat 64 49155 - systematicCode := BitVec.ofNat 64 11429435961081608199 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10274388721287808 - maskLow := BitVec.ofNat 64 581105093982617887 - maskHigh := BitVec.ofNat 64 6291465 - systematicCode := BitVec.ofNat 64 12514243832694323207 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11400288628132096 - maskLow := BitVec.ofNat 64 292804349086728479 - maskHigh := BitVec.ofNat 64 10485765 - systematicCode := BitVec.ofNat 64 12586300322925590535 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11400288628148352 - maskLow := BitVec.ofNat 64 148653976638783775 - maskHigh := BitVec.ofNat 64 12582915 - systematicCode := BitVec.ofNat 64 12586861065265690631 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18102930687428736 - maskLow := BitVec.ofNat 64 864691141608538399 - maskHigh := BitVec.ofNat 64 18882561 - systematicCode := BitVec.ofNat 64 12730439704768624647 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18102930687412480 - maskLow := BitVec.ofNat 64 720575962122617119 - maskHigh := BitVec.ofNat 64 20987905 - systematicCode := BitVec.ofNat 64 12731004853711878151 }) - ) - ) - ) - ) - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18094134594388608 - maskLow := BitVec.ofNat 64 432345603150774559 - maskHigh := BitVec.ofNat 64 25198593 - systematicCode := BitVec.ofNat 64 12731287423905314823 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18102911511070848 - maskLow := BitVec.ofNat 64 54043208681849119 - maskHigh := BitVec.ofNat 64 34611201 - systematicCode := BitVec.ofNat 64 12945768027458320391 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18102638780647552 - maskLow := BitVec.ofNat 64 211119385936159 - maskHigh := BitVec.ofNat 64 35655681 - systematicCode := BitVec.ofNat 64 12946609084865656839 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18102911511054592 - maskLow := BitVec.ofNat 64 45036018017042719 - maskHigh := BitVec.ofNat 64 68173825 - systematicCode := BitVec.ofNat 64 13089885414524008455 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18102638780631296 - maskLow := BitVec.ofNat 64 175943603781919 - maskHigh := BitVec.ofNat 64 71307265 - systematicCode := BitVec.ofNat 64 13091287222861510663 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10274407897645696 - maskLow := BitVec.ofNat 64 108227133108715807 - maskHigh := BitVec.ofNat 64 100663305 - systematicCode := BitVec.ofNat 64 13092956359142291463 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18094115418030720 - maskLow := BitVec.ofNat 64 27021636687429919 - maskHigh := BitVec.ofNat 64 135299073 - systematicCode := BitVec.ofNat 64 13161944103778662407 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18093842687607424 - maskLow := BitVec.ofNat 64 105592039473439 - maskHigh := BitVec.ofNat 64 142610433 - systematicCode := BitVec.ofNat 64 13163626287581247495 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11400307804489984 - maskLow := BitVec.ofNat 64 90142365855056159 - maskHigh := BitVec.ofNat 64 167772165 - systematicCode := BitVec.ofNat 64 13165012853651748871 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11400307804506240 - maskLow := BitVec.ofNat 64 81099982228226335 - maskHigh := BitVec.ofNat 64 201326595 - systematicCode := BitVec.ofNat 64 13165573604548229127 }) - ) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x3819. -/ -def normalizedWeightSixteenCandidateBucket_3819 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085390304150528 - maskLow := BitVec.ofNat 64 306244813584404759 - maskHigh := BitVec.ofNat 64 35201551990785 - systematicCode := BitVec.ofNat 64 15763898822885259289 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148559793587200 - maskLow := BitVec.ofNat 64 140742051827991 - maskHigh := BitVec.ofNat 64 35201623261193 - systematicCode := BitVec.ofNat 64 15763924352591869977 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085390302980096 - maskLow := BitVec.ofNat 64 153122426253807895 - maskHigh := BitVec.ofNat 64 70377334145025 - systematicCode := BitVec.ofNat 64 15907451052384204825 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148559792416768 - maskLow := BitVec.ofNat 64 140742051827991 - maskHigh := BitVec.ofNat 64 70377369763849 - systematicCode := BitVec.ofNat 64 15907474383101114393 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9359666025333760 - maskLow := BitVec.ofNat 64 140742051827991 - maskHigh := BitVec.ofNat 64 76561219435134977 - systematicCode := BitVec.ofNat 64 17431680172873889817 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36046458229097472 - maskLow := BitVec.ofNat 64 432363160977084695 - maskHigh := BitVec.ofNat 64 108086391056924673 - systematicCode := BitVec.ofNat 64 17433326909858002969 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2533343814484992 - maskLow := BitVec.ofNat 64 140742051827991 - maskHigh := BitVec.ofNat 64 108086391157559297 - systematicCode := BitVec.ofNat 64 17433352465534564377 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36046462490510336 - maskLow := BitVec.ofNat 64 27039194513740055 - maskHigh := BitVec.ofNat 64 580964351930826753 - systematicCode := BitVec.ofNat 64 17863983589731350553 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2533348075897856 - maskLow := BitVec.ofNat 64 140742051827991 - maskHigh := BitVec.ofNat 64 580964351937089537 - systematicCode := BitVec.ofNat 64 17864000349449107481 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9359661764185088 - maskLow := BitVec.ofNat 64 140742051827991 - maskHigh := BitVec.ofNat 64 612595102438686721 - systematicCode := BitVec.ofNat 64 17865741078320003097 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x381a. -/ -def normalizedWeightSixteenCandidateBucket_381a : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10208969926722560 - maskLow := BitVec.ofNat 64 612489571065733399 - maskHigh := BitVec.ofNat 64 17609365929985 - systematicCode := BitVec.ofNat 64 15691840133647382554 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9650418019812352 - maskLow := BitVec.ofNat 64 70373307654423 - maskHigh := BitVec.ofNat 64 17609508519941 - systematicCode := BitVec.ofNat 64 15691867862343694362 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11334869833778176 - maskLow := BitVec.ofNat 64 153122409073942807 - maskHigh := BitVec.ofNat 64 70373039161345 - systematicCode := BitVec.ofNat 64 15907168477895800858 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9659214113047552 - maskLow := BitVec.ofNat 64 70373307654423 - maskHigh := BitVec.ofNat 64 70373074796549 - systematicCode := BitVec.ofNat 64 15907192908107560986 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9593243415380992 - maskLow := BitVec.ofNat 64 70373307654423 - maskHigh := BitVec.ofNat 64 153122408805449729 - systematicCode := BitVec.ofNat 64 17504019237576718362 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11335449922800768 - maskLow := BitVec.ofNat 64 720593537128800535 - maskHigh := BitVec.ofNat 64 180143985094836225 - systematicCode := BitVec.ofNat 64 17505383408679270426 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9659794202070144 - maskLow := BitVec.ofNat 64 70373307654423 - maskHigh := BitVec.ofNat 64 180143985262596097 - systematicCode := BitVec.ofNat 64 17505411159084054554 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11335470963526784 - maskLow := BitVec.ofNat 64 45053593023226135 - maskHigh := BitVec.ofNat 64 585467951558180865 - systematicCode := BitVec.ofNat 64 17864263969491400730 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9659815242796160 - maskLow := BitVec.ofNat 64 70373307654423 - maskHigh := BitVec.ofNat 64 585467951568654337 - systematicCode := BitVec.ofNat 64 17864282923937380378 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9593239357146112 - maskLow := BitVec.ofNat 64 70373307654423 - maskHigh := BitVec.ofNat 64 612577510252625921 - systematicCode := BitVec.ofNat 64 17865741074008193050 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x381c. -/ -def normalizedWeightSixteenCandidateBucket_381c : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10208969926771328 - maskLow := BitVec.ofNat 64 612489562475806999 - maskHigh := BitVec.ofNat 64 17600775987201 - systematicCode := BitVec.ofNat 64 15691274984670574620 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9650418019861120 - maskLow := BitVec.ofNat 64 35188935573783 - maskHigh := BitVec.ofNat 64 17600918585347 - systematicCode := BitVec.ofNat 64 15691304912356587548 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11334869833615616 - maskLow := BitVec.ofNat 64 306244787814613271 - maskHigh := BitVec.ofNat 64 35188667064321 - systematicCode := BitVec.ofNat 64 15763051099420047388 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9659214112884992 - maskLow := BitVec.ofNat 64 35188935573783 - maskHigh := BitVec.ofNat 64 35188738359299 - systematicCode := BitVec.ofNat 64 15763079927611209756 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9593243415218432 - maskLow := BitVec.ofNat 64 35188935573783 - maskHigh := BitVec.ofNat 64 306244787546103809 - systematicCode := BitVec.ofNat 64 17648695176549054492 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11335449922914560 - maskLow := BitVec.ofNat 64 864708725204664599 - maskHigh := BitVec.ofNat 64 324259173170683905 - systematicCode := BitVec.ofNat 64 17649496397765425180 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9659794202183936 - maskLow := BitVec.ofNat 64 35188935573783 - maskHigh := BitVec.ofNat 64 324259173372006401 - systematicCode := BitVec.ofNat 64 17649526355749713948 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11335470963640576 - maskLow := BitVec.ofNat 64 54060792277975319 - maskHigh := BitVec.ofNat 64 594475150812913665 - systematicCode := BitVec.ofNat 64 17864824720455120924 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9659815242909952 - maskLow := BitVec.ofNat 64 35188935573783 - maskHigh := BitVec.ofNat 64 594475150825492481 - systematicCode := BitVec.ofNat 64 17864845882480605212 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9593239357227392 - maskLow := BitVec.ofNat 64 35188935573783 - maskHigh := BitVec.ofNat 64 612542325880528897 - systematicCode := BitVec.ofNat 64 17865738874951251996 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x381f. -/ -def normalizedWeightSixteenCandidateBucket_381f : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089444641147136 - maskLow := BitVec.ofNat 64 140767821660439 - maskHigh := BitVec.ofNat 64 76561193665302529 - systematicCode := BitVec.ofNat 64 17431631363370596383 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711166037494016 - maskLow := BitVec.ofNat 64 17596749545751 - maskHigh := BitVec.ofNat 64 76561193665331207 - systematicCode := BitVec.ofNat 64 17431638128985651231 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089444641112704 - maskLow := BitVec.ofNat 64 70416257351959 - maskHigh := BitVec.ofNat 64 153122387330600961 - systematicCode := BitVec.ofNat 64 17503970428107044895 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711166037459584 - maskLow := BitVec.ofNat 64 17596749545751 - maskHigh := BitVec.ofNat 64 153122387330613259 - systematicCode := BitVec.ofNat 64 17503976102783629343 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089444640901376 - maskLow := BitVec.ofNat 64 35240475197719 - maskHigh := BitVec.ofNat 64 306244774661197825 - systematicCode := BitVec.ofNat 64 17648648557546518559 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711166037248256 - maskLow := BitVec.ofNat 64 17596749545751 - maskHigh := BitVec.ofNat 64 306244774661201933 - systematicCode := BitVec.ofNat 64 17648652041823205407 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9786512917203200 - maskLow := BitVec.ofNat 64 17596749545751 - maskHigh := BitVec.ofNat 64 540431955284463617 - systematicCode := BitVec.ofNat 64 17650435900973791263 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9786533957929216 - maskLow := BitVec.ofNat 64 17596749545751 - maskHigh := BitVec.ofNat 64 607985949695021057 - systematicCode := BitVec.ofNat 64 17864912110876112927 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089440582910336 - maskLow := BitVec.ofNat 64 246295168123159 - maskHigh := BitVec.ofNat 64 612489549322391553 - systematicCode := BitVec.ofNat 64 17865665777862653983 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711161979257216 - maskLow := BitVec.ofNat 64 17596749545751 - maskHigh := BitVec.ofNat 64 612489549322444801 - systematicCode := BitVec.ofNat 64 17865672646555351071 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x3829. -/ -def normalizedWeightSixteenCandidateBucket_3829 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085356212847616 - maskLow := BitVec.ofNat 64 288300783820144919 - maskHigh := BitVec.ofNat 64 9007216442998785 - systematicCode := BitVec.ofNat 64 16916837919409715241 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148525702284288 - maskLow := BitVec.ofNat 64 36028801583481111 - maskHigh := BitVec.ofNat 64 9007216501735433 - systematicCode := BitVec.ofNat 64 16916845788480288809 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085356211677184 - maskLow := BitVec.ofNat 64 144150411372200215 - maskHigh := BitVec.ofNat 64 18014407107805185 - systematicCode := BitVec.ofNat 64 17060390148908660777 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148525701113856 - maskLow := BitVec.ofNat 64 36028801583481111 - maskHigh := BitVec.ofNat 64 18014407132979209 - systematicCode := BitVec.ofNat 64 17060395818989533225 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9359631934030848 - maskLow := BitVec.ofNat 64 36028801583481111 - maskHigh := BitVec.ofNat 64 72075212002164737 - systematicCode := BitVec.ofNat 64 17427176573516003369 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36046424137794560 - maskLow := BitVec.ofNat 64 436849168419455255 - maskHigh := BitVec.ofNat 64 72198331534671873 - systematicCode := BitVec.ofNat 64 17428840902417725481 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2533309723182080 - maskLow := BitVec.ofNat 64 36028801583481111 - maskHigh := BitVec.ofNat 64 72198331627995137 - systematicCode := BitVec.ofNat 64 17428848866176677929 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2533859445441536 - maskLow := BitVec.ofNat 64 36028801583481111 - maskHigh := BitVec.ofNat 64 576478344490541057 - systematicCode := BitVec.ofNat 64 17859491192185436201 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36046973860054016 - maskLow := BitVec.ofNat 64 4609157308154135 - maskHigh := BitVec.ofNat 64 576478344497856513 - systematicCode := BitVec.ofNat 64 17859497560580503593 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9359082212035584 - maskLow := BitVec.ofNat 64 36028801583481111 - maskHigh := BitVec.ofNat 64 603623087564390401 - systematicCode := BitVec.ofNat 64 17864912068296980521 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x382a. -/ -def normalizedWeightSixteenCandidateBucket_382a : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10208424465875968 - maskLow := BitVec.ofNat 64 576601511537213719 - maskHigh := BitVec.ofNat 64 4503616811433985 - systematicCode := BitVec.ofNat 64 16844779230171838506 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9649872558965760 - maskLow := BitVec.ofNat 64 18014403075047703 - maskHigh := BitVec.ofNat 64 4503616941490181 - systematicCode := BitVec.ofNat 64 16844789298232113194 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11334324372931584 - maskLow := BitVec.ofNat 64 144150394193379607 - maskHigh := BitVec.ofNat 64 18014402808643585 - systematicCode := BitVec.ofNat 64 17060107574420256810 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9658668652200960 - maskLow := BitVec.ofNat 64 18014403075047703 - maskHigh := BitVec.ofNat 64 18014402838011909 - systematicCode := BitVec.ofNat 64 17060114343995979818 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9592697954534400 - maskLow := BitVec.ofNat 64 18014403075047703 - maskHigh := BitVec.ofNat 64 144150393926975489 - systematicCode := BitVec.ofNat 64 17499515638218831914 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11333813540260992 - maskLow := BitVec.ofNat 64 725079544572215575 - maskHigh := BitVec.ofNat 64 144255925568405505 - systematicCode := BitVec.ofNat 64 17500897401238992938 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9658157819530368 - maskLow := BitVec.ofNat 64 18014403075047703 - maskHigh := BitVec.ofNat 64 144255925733031937 - systematicCode := BitVec.ofNat 64 17500907559726168106 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9660872073186432 - maskLow := BitVec.ofNat 64 18014403075047703 - maskHigh := BitVec.ofNat 64 576495936676601857 - systematicCode := BitVec.ofNat 64 17859772671457048618 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11336527793917056 - maskLow := BitVec.ofNat 64 4679526053380375 - maskHigh := BitVec.ofNat 64 576495936679706625 - systematicCode := BitVec.ofNat 64 17859777936062363690 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9592182526755840 - maskLow := BitVec.ofNat 64 18014403075047703 - maskHigh := BitVec.ofNat 64 599119487932825601 - systematicCode := BitVec.ofNat 64 17864910968768509994 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x382c. -/ -def normalizedWeightSixteenCandidateBucket_382c : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10208424465924736 - maskLow := BitVec.ofNat 64 576601502949376279 - maskHigh := BitVec.ofNat 64 4503608219402241 - systematicCode := BitVec.ofNat 64 16844214081195030572 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9649872559014528 - maskLow := BitVec.ofNat 64 9007203822403863 - maskHigh := BitVec.ofNat 64 4503608351555587 - systematicCode := BitVec.ofNat 64 16844226348245006380 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11334324372769024 - maskLow := BitVec.ofNat 64 288300758053486871 - maskHigh := BitVec.ofNat 64 9007203551805441 - systematicCode := BitVec.ofNat 64 16915990195944503340 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9658668652038400 - maskLow := BitVec.ofNat 64 9007203822403863 - maskHigh := BitVec.ofNat 64 9007203616833539 - systematicCode := BitVec.ofNat 64 16916001363499628588 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9592697954371840 - maskLow := BitVec.ofNat 64 9007203822403863 - maskHigh := BitVec.ofNat 64 288300757782888449 - systematicCode := BitVec.ofNat 64 17644191577191168044 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11333813540374784 - maskLow := BitVec.ofNat 64 869194732650168599 - maskHigh := BitVec.ofNat 64 288371113642164225 - systematicCode := BitVec.ofNat 64 17645010390325147692 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9658157819644160 - maskLow := BitVec.ofNat 64 9007203822403863 - maskHigh := BitVec.ofNat 64 288371113842442241 - systematicCode := BitVec.ofNat 64 17645022756391827500 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9660872073300224 - maskLow := BitVec.ofNat 64 9007203822403863 - maskHigh := BitVec.ofNat 64 576531121048698881 - systematicCode := BitVec.ofNat 64 17860335621443893292 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11336527794030848 - maskLow := BitVec.ofNat 64 4714710427566359 - maskHigh := BitVec.ofNat 64 576531121049698305 - systematicCode := BitVec.ofNat 64 17860338686992660524 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9592182526837120 - maskLow := BitVec.ofNat 64 9007203822403863 - maskHigh := BitVec.ofNat 64 590112288675987457 - systematicCode := BitVec.ofNat 64 17864348018781403180 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x382f. -/ -def normalizedWeightSixteenCandidateBucket_382f : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089717371570432 - maskLow := BitVec.ofNat 64 36028827360624919 - maskHigh := BitVec.ofNat 64 72075186225020929 - systematicCode := BitVec.ofNat 64 17427145424648747055 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711438767917312 - maskLow := BitVec.ofNat 64 4503604199227671 - maskHigh := BitVec.ofNat 64 72075186232360967 - systematicCode := BitVec.ofNat 64 17427152121545373743 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089717371536000 - maskLow := BitVec.ofNat 64 18014446031012119 - maskHigh := BitVec.ofNat 64 144150372448993281 - systematicCode := BitVec.ofNat 64 17499484489385195567 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711438767882880 - maskLow := BitVec.ofNat 64 4503604199227671 - maskHigh := BitVec.ofNat 64 144150372452139019 - systematicCode := BitVec.ofNat 64 17499490095343351855 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089717371324672 - maskLow := BitVec.ofNat 64 9007255366205719 - maskHigh := BitVec.ofNat 64 288300744896937985 - systematicCode := BitVec.ofNat 64 17644162618824669231 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711438767671552 - maskLow := BitVec.ofNat 64 4503604199227671 - maskHigh := BitVec.ofNat 64 288300744897986573 - systematicCode := BitVec.ofNat 64 17644166034382927919 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9785694725933312 - maskLow := BitVec.ofNat 64 4503604199227671 - maskHigh := BitVec.ofNat 64 504543895754899457 - systematicCode := BitVec.ofNat 64 17650435832523798575 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9788408979589376 - maskLow := BitVec.ofNat 64 4503604199227671 - maskHigh := BitVec.ofNat 64 576583897606782977 - systematicCode := BitVec.ofNat 64 17860390850612705327 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089201943789952 - maskLow := BitVec.ofNat 64 63050399355044119 - maskHigh := BitVec.ofNat 64 576601489792827393 - systematicCode := BitVec.ofNat 64 17861179839410288687 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9710923340136832 - maskLow := BitVec.ofNat 64 4503604199227671 - maskHigh := BitVec.ofNat 64 576601489806458881 - systematicCode := BitVec.ofNat 64 17861186708102985775 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x3831. -/ -def normalizedWeightSixteenCandidateBucket_3831 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9359628471632896 - maskLow := BitVec.ofNat 64 576460756883669271 - maskHigh := BitVec.ofNat 64 4521217717436417 - systematicCode := BitVec.ofNat 64 16850715821347321905 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2533313718256640 - maskLow := BitVec.ofNat 64 576460756883669271 - maskHigh := BitVec.ofNat 64 4644337138794497 - systematicCode := BitVec.ofNat 64 16852382590596167729 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36046428132869120 - maskLow := BitVec.ofNat 64 99079196382396695 - maskHigh := BitVec.ofNat 64 4644337249943553 - systematicCode := BitVec.ofNat 64 16852388924632021041 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2533859179103232 - maskLow := BitVec.ofNat 64 576460756883669271 - maskHigh := BitVec.ofNat 64 36046389221810177 - systematicCode := BitVec.ofNat 64 17283039235975559217 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36046973593715712 - maskLow := BitVec.ofNat 64 72163151734440215 - maskHigh := BitVec.ofNat 64 36046389339226113 - systematicCode := BitVec.ofNat 64 17283045638729840689 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148522239886336 - maskLow := BitVec.ofNat 64 576460756883669271 - maskHigh := BitVec.ofNat 64 144115205259935753 - systematicCode := BitVec.ofNat 64 17493297744691214385 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085352750449664 - maskLow := BitVec.ofNat 64 18084806193643799 - maskHigh := BitVec.ofNat 64 144115205389942785 - systematicCode := BitVec.ofNat 64 17493307433446422577 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9148522238715904 - maskLow := BitVec.ofNat 64 576460756883669271 - maskHigh := BitVec.ofNat 64 288230384743751689 - systematicCode := BitVec.ofNat 64 17636847775200458801 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18085352749279232 - maskLow := BitVec.ofNat 64 9042422566813975 - maskHigh := BitVec.ofNat 64 288230384875864065 - systematicCode := BitVec.ofNat 64 17636859662945368113 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9359083011050496 - maskLow := BitVec.ofNat 64 576460756883669271 - maskHigh := BitVec.ofNat 64 468515098869104641 - systematicCode := BitVec.ofNat 64 17650433633736341553 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x3832. -/ -def normalizedWeightSixteenCandidateBucket_3832 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9592710738772992 - maskLow := BitVec.ofNat 64 288230380748734743 - maskHigh := BitVec.ofNat 64 9042405168775169 - systematicCode := BitVec.ofNat 64 16923054886050150450 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9658166076017792 - maskLow := BitVec.ofNat 64 288230380748734743 - maskHigh := BitVec.ofNat 64 9147936770359297 - systematicCode := BitVec.ofNat 64 16924440188928997426 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11333821796748416 - maskLow := BitVec.ofNat 64 117093594908655895 - maskHigh := BitVec.ofNat 64 9147936810205185 - systematicCode := BitVec.ofNat 64 16924445419175098418 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9660859288947840 - maskLow := BitVec.ofNat 64 288230380748734743 - maskHigh := BitVec.ofNat 64 36063981407870977 - systematicCode := BitVec.ofNat 64 17283320715247171634 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11336515009678464 - maskLow := BitVec.ofNat 64 72233520495395095 - maskHigh := BitVec.ofNat 64 36063981458161665 - systematicCode := BitVec.ofNat 64 17283326014211700786 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9649885343204352 - maskLow := BitVec.ofNat 64 288230380748734743 - maskHigh := BitVec.ofNat 64 72057611226218501 - systematicCode := BitVec.ofNat 64 17421241254443038770 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10208437250114560 - maskLow := BitVec.ofNat 64 36169556284211479 - maskHigh := BitVec.ofNat 64 72057611284905985 - systematicCode := BitVec.ofNat 64 17421248744208545842 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9658681436439552 - maskLow := BitVec.ofNat 64 288230380748734743 - maskHigh := BitVec.ofNat 64 288230380448784389 - systematicCode := BitVec.ofNat 64 17636566300206905394 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11334337157170176 - maskLow := BitVec.ofNat 64 9042405403722007 - maskHigh := BitVec.ofNat 64 288230380513787905 - systematicCode := BitVec.ofNat 64 17636577088456964146 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9592191315919872 - maskLow := BitVec.ofNat 64 288230380748734743 - maskHigh := BitVec.ofNat 64 396457504764067841 - systematicCode := BitVec.ofNat 64 17650152158742788146 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x3834. -/ -def normalizedWeightSixteenCandidateBucket_3834 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9592710738610432 - maskLow := BitVec.ofNat 64 144115192706433303 - maskHigh := BitVec.ofNat 64 18084780172115969 - systematicCode := BitVec.ofNat 64 17067730825022486580 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9658166076131584 - maskLow := BitVec.ofNat 64 144115192706433303 - maskHigh := BitVec.ofNat 64 18155136027197441 - systematicCode := BitVec.ofNat 64 17068555377038276660 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11333821796862208 - maskLow := BitVec.ofNat 64 126100794196951319 - maskHigh := BitVec.ofNat 64 18155136031391745 - systematicCode := BitVec.ofNat 64 17068558408227829812 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9660859289061632 - maskLow := BitVec.ofNat 64 144115192706433303 - maskHigh := BitVec.ofNat 64 36099165779968001 - systematicCode := BitVec.ofNat 64 17283883665234016308 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11336515009792256 - maskLow := BitVec.ofNat 64 72268704901038359 - maskHigh := BitVec.ofNat 64 36099165796696065 - systematicCode := BitVec.ofNat 64 17283886765141997620 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9649885343253120 - maskLow := BitVec.ofNat 64 144115192706433303 - maskHigh := BitVec.ofNat 64 72057602636283907 - systematicCode := BitVec.ofNat 64 17420678304455931956 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10208437250163328 - maskLow := BitVec.ofNat 64 36169547727831319 - maskHigh := BitVec.ofNat 64 72057602661416961 - systematicCode := BitVec.ofNat 64 17420683595231737908 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9658681436276992 - maskLow := BitVec.ofNat 64 144115192706433303 - maskHigh := BitVec.ofNat 64 144115192375033859 - systematicCode := BitVec.ofNat 64 17492453319710554164 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11334337157007616 - maskLow := BitVec.ofNat 64 18084780474171671 - maskHigh := BitVec.ofNat 64 144115192404377601 - systematicCode := BitVec.ofNat 64 17492459709981210676 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9592191316001152 - maskLow := BitVec.ofNat 64 144115192706433303 - maskHigh := BitVec.ofNat 64 252342316654657537 - systematicCode := BitVec.ofNat 64 17506036970633246772 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x3837. -/ -def normalizedWeightSixteenCandidateBucket_3837 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089736547928320 - maskLow := BitVec.ofNat 64 576460782770913559 - maskHigh := BitVec.ofNat 64 4521191830192129 - systematicCode := BitVec.ofNat 64 16850693502798084151 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711457944275200 - maskLow := BitVec.ofNat 64 72057598735614231 - maskHigh := BitVec.ofNat 64 4521191947632647 - systematicCode := BitVec.ofNat 64 16850700165335496759 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089736547893888 - maskLow := BitVec.ofNat 64 288230423799070999 - maskHigh := BitVec.ofNat 64 9042383643607041 - systematicCode := BitVec.ofNat 64 16923032567534532663 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711457944240768 - maskLow := BitVec.ofNat 64 72057598735614231 - maskHigh := BitVec.ofNat 64 9042383693938699 - systematicCode := BitVec.ofNat 64 16923038139133474871 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089736547682560 - maskLow := BitVec.ofNat 64 144115244313149719 - maskHigh := BitVec.ofNat 64 18084767270436865 - systematicCode := BitVec.ofNat 64 17067710696974006327 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711457944029440 - maskLow := BitVec.ofNat 64 72057598735614231 - maskHigh := BitVec.ofNat 64 18084767287214093 - systematicCode := BitVec.ofNat 64 17067714078173050935 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9785709374540032 - maskLow := BitVec.ofNat 64 72057598735614231 - maskHigh := BitVec.ofNat 64 31665934896726017 - systematicCode := BitVec.ofNat 64 17071714484448409655 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9788402587470080 - maskLow := BitVec.ofNat 64 72057598735614231 - maskHigh := BitVec.ofNat 64 36151942338052097 - systematicCode := BitVec.ofNat 64 17283930098444023863 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089217125073280 - maskLow := BitVec.ofNat 64 1008806321228677399 - maskHigh := BitVec.ofNat 64 36169534524096513 - systematicCode := BitVec.ofNat 64 17284727917694367799 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9710938521420160 - maskLow := BitVec.ofNat 64 72057598735614231 - maskHigh := BitVec.ofNat 64 36169534742200321 - systematicCode := BitVec.ofNat 64 17284734786387064887 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x3b07. -/ -def normalizedWeightSixteenCandidateBucket_3b07 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11330469639784576 - maskLow := BitVec.ofNat 64 148636384721174815 - maskHigh := BitVec.ofNat 64 824633720835 - systematicCode := BitVec.ofNat 64 14901711273733929735 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9096262012143744 - maskLow := BitVec.ofNat 64 13421838623 - maskHigh := BitVec.ofNat 64 824668327937 - systematicCode := BitVec.ofNat 64 14901764278729259783 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11330488816142464 - maskLow := BitVec.ofNat 64 81082390310617375 - maskHigh := BitVec.ofNat 64 13194139533315 - systematicCode := BitVec.ofNat 64 15480423813016468231 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9096281188501632 - maskLow := BitVec.ofNat 64 13421838623 - maskHigh := BitVec.ofNat 64 13194158411777 - systematicCode := BitVec.ofNat 64 15480473545196387079 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11332125198682240 - maskLow := BitVec.ofNat 64 76596382869291295 - maskHigh := BitVec.ofNat 64 3377699720527875 - systematicCode := BitVec.ofNat 64 16637848917200550663 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9097917571041408 - maskLow := BitVec.ofNat 64 13421838623 - maskHigh := BitVec.ofNat 64 3377699738361857 - systematicCode := BitVec.ofNat 64 16637898636596034311 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9026999070785664 - maskLow := BitVec.ofNat 64 13421838623 - maskHigh := BitVec.ofNat 64 4613947164089909251 - systematicCode := BitVec.ofNat 64 18295546718693047047 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9026999070787712 - maskLow := BitVec.ofNat 64 13421838623 - maskHigh := BitVec.ofNat 64 9224502609686036483 - systematicCode := BitVec.ofNat 64 18367321733947669255 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11332129527201920 - maskLow := BitVec.ofNat 64 153157576534589727 - maskHigh := BitVec.ofNat 64 13835058055282163715 - systematicCode := BitVec.ofNat 64 18373986586487110407 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9097921899561088 - maskLow := BitVec.ofNat 64 13421838623 - maskHigh := BitVec.ofNat 64 13835058055317823489 - systematicCode := BitVec.ofNat 64 18374039604367145735 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x3b0d. -/ -def normalizedWeightSixteenCandidateBucket_3b0d : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11330469507672064 - maskLow := BitVec.ofNat 64 1153486658415427927 - maskHigh := BitVec.ofNat 64 584115552273 - systematicCode := BitVec.ofNat 64 14900029046612179725 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9096261880031232 - maskLow := BitVec.ofNat 64 73551380823 - maskHigh := BitVec.ofNat 64 584384119297 - systematicCode := BitVec.ofNat 64 14900082000068688653 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11330488835015680 - maskLow := BitVec.ofNat 64 81066997147828567 - maskHigh := BitVec.ofNat 64 74766790688785 - systematicCode := BitVec.ofNat 64 15912775974313409293 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9096281207374848 - maskLow := BitVec.ofNat 64 73551380823 - maskHigh := BitVec.ofNat 64 74766809563649 - systematicCode := BitVec.ofNat 64 15912819109323684621 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11332125217555456 - maskLow := BitVec.ofNat 64 72655733195342167 - maskHigh := BitVec.ofNat 64 19140298416324625 - systematicCode := BitVec.ofNat 64 17070201078397221645 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9097917589914624 - maskLow := BitVec.ofNat 64 73551380823 - maskHigh := BitVec.ofNat 64 19140298433241089 - systematicCode := BitVec.ofNat 64 17070244175054191373 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9026999056106496 - maskLow := BitVec.ofNat 64 73551380823 - maskHigh := BitVec.ofNat 64 594546069312897041 - systematicCode := BitVec.ofNat 64 17864896601496566541 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9026999089660928 - maskLow := BitVec.ofNat 64 73551380823 - maskHigh := BitVec.ofNat 64 9224502369167867921 - systematicCode := BitVec.ofNat 64 18367321708278921997 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11332129478970368 - maskLow := BitVec.ofNat 64 1161963893065580887 - maskHigh := BitVec.ofNat 64 9799832789158199313 - systematicCode := BitVec.ofNat 64 18372304359466416909 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9097921851329536 - maskLow := BitVec.ofNat 64 73551380823 - maskHigh := BitVec.ofNat 64 9799832789428740097 - systematicCode := BitVec.ofNat 64 18372357351577041677 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x3b0e. -/ -def normalizedWeightSixteenCandidateBucket_3b0e : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089857360472064 - maskLow := BitVec.ofNat 64 2306125588533936535 - maskHigh := BitVec.ofNat 64 309237645345 - systematicCode := BitVec.ofNat 64 14827972556364004110 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711578756818944 - maskLow := BitVec.ofNat 64 142270857623 - maskHigh := BitVec.ofNat 64 309774582017 - systematicCode := BitVec.ofNat 64 14828025501230709518 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089785151334400 - maskLow := BitVec.ofNat 64 81065897636200855 - maskHigh := BitVec.ofNat 64 79164837199905 - systematicCode := BitVec.ofNat 64 15913058548801682190 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711506547681280 - maskLow := BitVec.ofNat 64 142270857623 - maskHigh := BitVec.ofNat 64 79164856074497 - systematicCode := BitVec.ofNat 64 15913100584283683598 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089341964396544 - maskLow := BitVec.ofNat 64 72374258218631575 - maskHigh := BitVec.ofNat 64 20266198323167265 - systematicCode := BitVec.ofNat 64 17070483652868782862 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711063360743424 - maskLow := BitVec.ofNat 64 142270857623 - maskHigh := BitVec.ofNat 64 20266198340018177 - systematicCode := BitVec.ofNat 64 17070525645736000270 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9786345516328960 - maskLow := BitVec.ofNat 64 142270857623 - maskHigh := BitVec.ofNat 64 594545794434990113 - systematicCode := BitVec.ofNat 64 17864896597218441998 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9786345681993856 - maskLow := BitVec.ofNat 64 142270857623 - maskHigh := BitVec.ofNat 64 4613946648693833761 - systematicCode := BitVec.ofNat 64 18295546688746175246 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089337906405504 - maskLow := BitVec.ofNat 64 2314885397672427927 - maskHigh := BitVec.ofNat 64 5188146770730811425 - systematicCode := BitVec.ofNat 64 18300247869235084046 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711059302752384 - maskLow := BitVec.ofNat 64 142270857623 - maskHigh := BitVec.ofNat 64 5188146771269787649 - systematicCode := BitVec.ofNat 64 18300300857050807054 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x3b15. -/ -def normalizedWeightSixteenCandidateBucket_3b15 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11330471904716800 - maskLow := BitVec.ofNat 64 1153484596831126807 - maskHigh := BitVec.ofNat 64 8830452760833 - systematicCode := BitVec.ofNat 64 15476498595008101141 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9096264277075968 - maskLow := BitVec.ofNat 64 1104343532823 - maskHigh := BitVec.ofNat 64 8830721327137 - systematicCode := BitVec.ofNat 64 15476542752238418709 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11330472055702528 - maskLow := BitVec.ofNat 64 148618929974084887 - maskHigh := BitVec.ofNat 64 70643622084865 - systematicCode := BitVec.ofNat 64 15910532983426792213 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9096264428061696 - maskLow := BitVec.ofNat 64 1104343532823 - maskHigh := BitVec.ofNat 64 70643656687649 - systematicCode := BitVec.ofNat 64 15910570595026287381 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11332121222480896 - maskLow := BitVec.ofNat 64 5101738784785687 - maskHigh := BitVec.ofNat 64 289356276058554625 - systematicCode := BitVec.ofNat 64 17646670592433928981 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9097913594840064 - maskLow := BitVec.ofNat 64 1104343532823 - maskHigh := BitVec.ofNat 64 289356276059742209 - systematicCode := BitVec.ofNat 64 17646696131265116949 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9026990799619072 - maskLow := BitVec.ofNat 64 1104343532823 - maskHigh := BitVec.ofNat 64 324338338007875841 - systematicCode := BitVec.ofNat 64 17649568278807395093 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9026995094586368 - maskLow := BitVec.ofNat 64 1104343532823 - maskHigh := BitVec.ofNat 64 9224498245999264001 - systematicCode := BitVec.ofNat 64 18367312912320641813 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11332116961070080 - maskLow := BitVec.ofNat 64 1297071881886696727 - maskHigh := BitVec.ofNat 64 9259400833873740033 - systematicCode := BitVec.ofNat 64 18370061355879971605 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9097909333429248 - maskLow := BitVec.ofNat 64 1104343532823 - maskHigh := BitVec.ofNat 64 9259400834175737857 - systematicCode := BitVec.ofNat 64 18370105586123619093 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x3b16. -/ -def normalizedWeightSixteenCandidateBucket_3b16 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089856827795456 - maskLow := BitVec.ofNat 64 2306124557741787415 - maskHigh := BitVec.ofNat 64 4432406249985 - systematicCode := BitVec.ofNat 64 15404442104759925526 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711578224142336 - maskLow := BitVec.ofNat 64 2203855161623 - maskHigh := BitVec.ofNat 64 4432943185937 - systematicCode := BitVec.ofNat 64 15404486253400439574 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089788081055744 - maskLow := BitVec.ofNat 64 148618861254609175 - maskHigh := BitVec.ofNat 64 70918499992065 - systematicCode := BitVec.ofNat 64 15910815557915065110 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711509477402624 - maskLow := BitVec.ofNat 64 2203855161623 - maskHigh := BitVec.ofNat 64 70918534594577 - systematicCode := BitVec.ofNat 64 15910852069986286358 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089341431719936 - maskLow := BitVec.ofNat 64 4820263808076055 - maskHigh := BitVec.ofNat 64 290482175965397505 - systematicCode := BitVec.ofNat 64 17646953166905490198 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711062828066816 - maskLow := BitVec.ofNat 64 2203855161623 - maskHigh := BitVec.ofNat 64 290482175966519297 - systematicCode := BitVec.ofNat 64 17646977601946925846 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9786340988577792 - maskLow := BitVec.ofNat 64 2203855161623 - maskHigh := BitVec.ofNat 64 324333939961364993 - systematicCode := BitVec.ofNat 64 17649568274529270550 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9786362194968704 - maskLow := BitVec.ofNat 64 2203855161623 - maskHigh := BitVec.ofNat 64 4613938402356625921 - systematicCode := BitVec.ofNat 64 18295537892787895062 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089337373728896 - maskLow := BitVec.ofNat 64 2449993386493544727 - maskHigh := BitVec.ofNat 64 4647714815446352385 - systematicCode := BitVec.ofNat 64 18298004865648638742 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711058770075776 - maskLow := BitVec.ofNat 64 2203855161623 - maskHigh := BitVec.ofNat 64 4647714816016785409 - systematicCode := BitVec.ofNat 64 18298049091597384470 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x3b1c. -/ -def normalizedWeightSixteenCandidateBucket_3b1c : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089856957810944 - maskLow := BitVec.ofNat 64 2306124497612259607 - maskHigh := BitVec.ofNat 64 4672924422145 - systematicCode := BitVec.ofNat 64 15406137551689562908 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711578354157824 - maskLow := BitVec.ofNat 64 17597017964823 - maskHigh := BitVec.ofNat 64 4673461354499 - systematicCode := BitVec.ofNat 64 15406175103160433436 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089788238332544 - maskLow := BitVec.ofNat 64 1153484467982123287 - maskHigh := BitVec.ofNat 64 9345848840193 - systematicCode := BitVec.ofNat 64 15478476616426011420 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711509634679424 - maskLow := BitVec.ofNat 64 17597017964823 - maskHigh := BitVec.ofNat 64 9346117402627 - systematicCode := BitVec.ofNat 64 15478513076958411548 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089341561735424 - maskLow := BitVec.ofNat 64 879614134141207 - maskHigh := BitVec.ofNat 64 306244774661197825 - systematicCode := BitVec.ofNat 64 17648648588065717020 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711062958082304 - maskLow := BitVec.ofNat 64 17597017964823 - maskHigh := BitVec.ofNat 64 306244774661398529 - systematicCode := BitVec.ofNat 64 17648659854737816348 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9786341118593280 - maskLow := BitVec.ofNat 64 17597017964823 - maskHigh := BitVec.ofNat 64 324272367310213121 - systematicCode := BitVec.ofNat 64 17649561677560560412 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9786362159319296 - maskLow := BitVec.ofNat 64 17597017964823 - maskHigh := BitVec.ofNat 64 594475975446630401 - systematicCode := BitVec.ofNat 64 17864881204291451676 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089337503744384 - maskLow := BitVec.ofNat 64 3458799703024550167 - maskHigh := BitVec.ofNat 64 612489549322391553 - systematicCode := BitVec.ofNat 64 17865665898591501084 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711058900091264 - maskLow := BitVec.ofNat 64 17597017964823 - maskHigh := BitVec.ofNat 64 612489550127702017 - systematicCode := BitVec.ofNat 64 17865703553140013852 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x3b1f. -/ -def normalizedWeightSixteenCandidateBucket_3b1f : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9928078906507520 - maskLow := BitVec.ofNat 64 35189204025623 - maskHigh := BitVec.ofNat 64 309622474381729793 - systematicCode := BitVec.ofNat 64 17648734913586477855 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9852723973456128 - maskLow := BitVec.ofNat 64 35189204025623 - maskHigh := BitVec.ofNat 64 324259173170680577 - systematicCode := BitVec.ofNat 64 17649493219959585567 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36104663598235904 - maskLow := BitVec.ofNat 64 20895552864535 - maskHigh := BitVec.ofNat 64 324259173170683905 - systematicCode := BitVec.ofNat 64 17649496268328745759 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9852724772471040 - maskLow := BitVec.ofNat 64 35189204025623 - maskHigh := BitVec.ofNat 64 594475150812909617 - systematicCode := BitVec.ofNat 64 17864821542649281311 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36104664397250816 - maskLow := BitVec.ofNat 64 17803176411415 - maskHigh := BitVec.ofNat 64 594475150812913665 - systematicCode := BitVec.ofNat 64 17864824625377655583 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18050167401955712 - maskLow := BitVec.ofNat 64 17600239206679 - maskHigh := BitVec.ofNat 64 612489549322391553 - systematicCode := BitVec.ofNat 64 17865665751570791199 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9852724774568064 - maskLow := BitVec.ofNat 64 35189204025623 - maskHigh := BitVec.ofNat 64 4613937818241073699 - systematicCode := BitVec.ofNat 64 18295471659846155039 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36104664399347840 - maskLow := BitVec.ofNat 64 2349884080407 - maskHigh := BitVec.ofNat 64 4613937818241081345 - systematicCode := BitVec.ofNat 64 18295481313974762271 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9852727999987968 - maskLow := BitVec.ofNat 64 35189204025623 - maskHigh := BitVec.ofNat 64 9224497936761618707 - systematicCode := BitVec.ofNat 64 18367246675100777247 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36104667624767744 - maskLow := BitVec.ofNat 64 1181652975895 - maskHigh := BitVec.ofNat 64 9224497936761626625 - systematicCode := BitVec.ofNat 64 18367257428724235039 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9928074915629440 - maskLow := BitVec.ofNat 64 35189204025623 - maskHigh := BitVec.ofNat 64 14447547604604559361 - systematicCode := BitVec.ofNat 64 18374114663217183519 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x3b25. -/ -def normalizedWeightSixteenCandidateBucket_3b25 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11329960535173120 - maskLow := BitVec.ofNat 64 1152923845901222167 - maskHigh := BitVec.ofNat 64 2251834173489153 - systematicCode := BitVec.ofNat 64 16629437691532557093 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9095752907532288 - maskLow := BitVec.ofNat 64 281479808876823 - maskHigh := BitVec.ofNat 64 2251834441859617 - systematicCode := BitVec.ofNat 64 16629464188126837541 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11329960686158848 - maskLow := BitVec.ofNat 64 144132922533019927 - maskHigh := BitVec.ofNat 64 18014673387454465 - systematicCode := BitVec.ofNat 64 17063472079951248165 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9095753058518016 - maskLow := BitVec.ofNat 64 281479808876823 - maskHigh := BitVec.ofNat 64 18014673420947489 - systematicCode := BitVec.ofNat 64 17063492030914706213 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11329973470397440 - maskLow := BitVec.ofNat 64 9026995296207127 - maskHigh := BitVec.ofNat 64 288234774198288385 - systematicCode := BitVec.ofNat 64 17642184597709142821 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9095765842756608 - maskLow := BitVec.ofNat 64 281479808876823 - maskHigh := BitVec.ofNat 64 288234774200324609 - systematicCode := BitVec.ofNat 64 17642195787073010469 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9024843047535616 - maskLow := BitVec.ofNat 64 281479808876823 - maskHigh := BitVec.ofNat 64 308637311963299841 - systematicCode := BitVec.ofNat 64 17648734887917730597 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9025392803349504 - maskLow := BitVec.ofNat 64 281479808876823 - maskHigh := BitVec.ofNat 64 9223376744138997761 - systematicCode := BitVec.ofNat 64 18362809312962755365 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11329423748140032 - maskLow := BitVec.ofNat 64 1306043896769610007 - maskHigh := BitVec.ofNat 64 9223512774343196673 - systematicCode := BitVec.ofNat 64 18365575348439694117 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9095216120499200 - maskLow := BitVec.ofNat 64 281479808876823 - maskHigh := BitVec.ofNat 64 9223512774647218177 - systematicCode := BitVec.ofNat 64 18365601986765732645 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x3b26. -/ -def normalizedWeightSixteenCandidateBucket_3b26 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089720462583808 - maskLow := BitVec.ofNat 64 2305844182277226775 - maskHigh := BitVec.ofNat 64 1125934266712065 - systematicCode := BitVec.ofNat 64 16557381201284381478 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711441858930688 - maskLow := BitVec.ofNat 64 562954785849623 - maskHigh := BitVec.ofNat 64 1125934803452177 - systematicCode := BitVec.ofNat 64 16557407689288858406 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089719898449920 - maskLow := BitVec.ofNat 64 144132853813805335 - maskHigh := BitVec.ofNat 64 18014948265426945 - systematicCode := BitVec.ofNat 64 17063754654439521062 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711441294796800 - maskLow := BitVec.ofNat 64 562954785849623 - maskHigh := BitVec.ofNat 64 18014948298854417 - systematicCode := BitVec.ofNat 64 17063773505874705190 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089716436051968 - maskLow := BitVec.ofNat 64 9025895784841495 - maskHigh := BitVec.ofNat 64 288239172244865025 - systematicCode := BitVec.ofNat 64 17642467172197415718 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711437832398848 - maskLow := BitVec.ofNat 64 562954785849623 - maskHigh := BitVec.ofNat 64 288239172246835457 - systematicCode := BitVec.ofNat 64 17642477262033009446 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9785693253822464 - maskLow := BitVec.ofNat 64 562954785849623 - maskHigh := BitVec.ofNat 64 307511412056522753 - systematicCode := BitVec.ofNat 64 17648733788422945574 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9788407673143424 - maskLow := BitVec.ofNat 64 562954785849623 - maskHigh := BitVec.ofNat 64 4611695398636093441 - systematicCode := BitVec.ofNat 64 18291034293430008614 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089201008517248 - maskLow := BitVec.ofNat 64 2458965401376719127 - maskHigh := BitVec.ofNat 64 4611826755915874305 - systematicCode := BitVec.ofNat 64 18293518858208361254 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9710922404864128 - maskLow := BitVec.ofNat 64 562954785849623 - maskHigh := BitVec.ofNat 64 4611826756488265729 - systematicCode := BitVec.ofNat 64 18293545492239498022 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x3b2c. -/ -def normalizedWeightSixteenCandidateBucket_3b2c : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089720592599296 - maskLow := BitVec.ofNat 64 2305844122151354647 - maskHigh := BitVec.ofNat 64 1126174785798145 - systematicCode := BitVec.ofNat 64 16559076648214018860 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711441988946176 - maskLow := BitVec.ofNat 64 4503604463468823 - maskHigh := BitVec.ofNat 64 1126175321620739 - systematicCode := BitVec.ofNat 64 16559096539048852268 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089720055726720 - maskLow := BitVec.ofNat 64 1152923717056135447 - maskHigh := BitVec.ofNat 64 2252349570547713 - systematicCode := BitVec.ofNat 64 16631415712950467372 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711441452073600 - maskLow := BitVec.ofNat 64 4503604463468823 - maskHigh := BitVec.ofNat 64 2252349837935107 - systematicCode := BitVec.ofNat 64 16631434512846830380 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089716566067456 - maskLow := BitVec.ofNat 64 9010502625722647 - maskHigh := BitVec.ofNat 64 288300744896937985 - systematicCode := BitVec.ofNat 64 17644162619026783020 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711437962414336 - maskLow := BitVec.ofNat 64 4503604463468823 - maskHigh := BitVec.ofNat 64 288300744897987329 - systematicCode := BitVec.ofNat 64 17644166086123862828 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9785693383837952 - maskLow := BitVec.ofNat 64 4503604463468823 - maskHigh := BitVec.ofNat 64 291748813361643521 - systematicCode := BitVec.ofNat 64 17647044938663738156 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9788407637494016 - maskLow := BitVec.ofNat 64 4503604463468823 - maskHigh := BitVec.ofNat 64 576531945682370561 - systematicCode := BitVec.ofNat 64 17860377604933565228 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089201138532736 - maskLow := BitVec.ofNat 64 3467771717911380247 - maskHigh := BitVec.ofNat 64 576601489792827393 - systematicCode := BitVec.ofNat 64 17861179891151223596 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9710922534879616 - maskLow := BitVec.ofNat 64 4503604463468823 - maskHigh := BitVec.ofNat 64 576601490599182337 - systematicCode := BitVec.ofNat 64 17861199953782127404 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x3b2f. -/ -def normalizedWeightSixteenCandidateBucket_3b2f : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9926953893511424 - maskLow := BitVec.ofNat 64 9007204095033623 - maskHigh := BitVec.ofNat 64 288313939037519873 - systematicCode := BitVec.ofNat 64 17644213653323070255 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9851667143065856 - maskLow := BitVec.ofNat 64 9007204095033623 - maskHigh := BitVec.ofNat 64 288371113641312257 - systematicCode := BitVec.ofNat 64 17645007281507220271 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36103606767845632 - maskLow := BitVec.ofNat 64 5348029397795095 - maskHigh := BitVec.ofNat 64 288371113642164225 - systematicCode := BitVec.ofNat 64 17645010329876380463 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9851770215989504 - maskLow := BitVec.ofNat 64 9007204095033623 - maskHigh := BitVec.ofNat 64 576531121048649777 - systematicCode := BitVec.ofNat 64 17860335535209003823 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36103709840769280 - maskLow := BitVec.ofNat 64 4503810626093335 - maskHigh := BitVec.ofNat 64 576531121049698305 - systematicCode := BitVec.ofNat 64 17860338686655806255 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18049621941109120 - maskLow := BitVec.ofNat 64 4503607688888599 - maskHigh := BitVec.ofNat 64 576601489792827393 - systematicCode := BitVec.ofNat 64 17861179812848941871 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9851770218086528 - maskLow := BitVec.ofNat 64 9007204095033623 - maskHigh := BitVec.ofNat 64 4611694814520541219 - systematicCode := BitVec.ofNat 64 18290985652405877551 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36103709842866304 - maskLow := BitVec.ofNat 64 563100822602007 - maskHigh := BitVec.ofNat 64 4611694814522507265 - systematicCode := BitVec.ofNat 64 18290995375252912943 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9852182539141376 - maskLow := BitVec.ofNat 64 9007204095033623 - maskHigh := BitVec.ofNat 64 9223376434901352467 - systematicCode := BitVec.ofNat 64 18362760667660499759 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36104122163921152 - maskLow := BitVec.ofNat 64 281557126414615 - maskHigh := BitVec.ofNat 64 9223376434903384065 - systematicCode := BitVec.ofNat 64 18362771490002385711 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9926438533089664 - maskLow := BitVec.ofNat 64 9007204095033623 - maskHigh := BitVec.ofNat 64 14411659545076039681 - systematicCode := BitVec.ofNat 64 18374114594767190831 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x3b34. -/ -def normalizedWeightSixteenCandidateBucket_3b34 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089736572897536 - maskLow := BitVec.ofNat 64 2305843091422118167 - maskHigh := BitVec.ofNat 64 1130297970130945 - systematicCode := BitVec.ofNat 64 16561337243986508596 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711457969244416 - maskLow := BitVec.ofNat 64 72057598936940823 - maskHigh := BitVec.ofNat 64 1130298490224659 - systematicCode := BitVec.ofNat 64 16561348304503323444 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089736568701568 - maskLow := BitVec.ofNat 64 1152921655534747927 - maskHigh := BitVec.ofNat 64 2260595923484673 - systematicCode := BitVec.ofNat 64 16633676308722957108 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711457965048448 - maskLow := BitVec.ofNat 64 72057598936940823 - maskHigh := BitVec.ofNat 64 2260596175142947 - systematicCode := BitVec.ofNat 64 16633686278301301556 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089736541440256 - maskLow := BitVec.ofNat 64 144115399133298967 - maskHigh := BitVec.ofNat 64 18084767270436865 - systematicCode := BitVec.ofNat 64 17067710697041378100 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711457937787136 - maskLow := BitVec.ofNat 64 72057598936940823 - maskHigh := BitVec.ofNat 64 18084767287214129 - systematicCode := BitVec.ofNat 64 17067714095420029748 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9785709364136192 - maskLow := BitVec.ofNat 64 72057598936940823 - maskHigh := BitVec.ofNat 64 21532835735142401 - systematicCode := BitVec.ofNat 64 17070584186495056692 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9788402577066240 - maskLow := BitVec.ofNat 64 72057598936940823 - maskHigh := BitVec.ofNat 64 36112359919452161 - systematicCode := BitVec.ofNat 64 17283925683217644340 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089217118830976 - maskLow := BitVec.ofNat 64 3602879706795409687 - maskHigh := BitVec.ofNat 64 36169534524096513 - systematicCode := BitVec.ofNat 64 17284727934941346612 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9710938515177856 - maskLow := BitVec.ofNat 64 72057598936940823 - maskHigh := BitVec.ofNat 64 36169535346180097 - systematicCode := BitVec.ofNat 64 17284739201613445940 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x3b37. -/ -def normalizedWeightSixteenCandidateBucket_3b37 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9926941908287744 - maskLow := BitVec.ofNat 64 144115193041977623 - maskHigh := BitVec.ofNat 64 18085591920934913 - systematicCode := BitVec.ofNat 64 17067744070701628215 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9851659685593344 - maskLow := BitVec.ofNat 64 144115193041977623 - maskHigh := BitVec.ofNat 64 18155136014811137 - systematicCode := BitVec.ofNat 64 17068555325297343287 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36103599310373120 - maskLow := BitVec.ofNat 64 72902023934181655 - maskHigh := BitVec.ofNat 64 18155136031391745 - systematicCode := BitVec.ofNat 64 17068558408025717559 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9851761959502080 - maskLow := BitVec.ofNat 64 144115193041977623 - maskHigh := BitVec.ofNat 64 36099165779919617 - systematicCode := BitVec.ofNat 64 17283883613493082935 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36103701584281856 - maskLow := BitVec.ofNat 64 72060897538933015 - maskHigh := BitVec.ofNat 64 36099165796696065 - systematicCode := BitVec.ofNat 64 17283886764939885367 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18049634725347712 - maskLow := BitVec.ofNat 64 72057602225275159 - maskHigh := BitVec.ofNat 64 36169534524096513 - systematicCode := BitVec.ofNat 64 17284727890998278967 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9851762227937408 - maskLow := BitVec.ofNat 64 144115193041977623 - maskHigh := BitVec.ofNat 64 4611686568183333379 - systematicCode := BitVec.ofNat 64 18288733886952454967 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36103701852717184 - maskLow := BitVec.ofNat 64 565162532733207 - maskHigh := BitVec.ofNat 64 4611686568216756225 - systematicCode := BitVec.ofNat 64 18288752371666467639 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9852175081668864 - maskLow := BitVec.ofNat 64 144115193041977623 - maskHigh := BitVec.ofNat 64 9223372311732748547 - systematicCode := BitVec.ofNat 64 18360508902207077175 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36104114706448640 - maskLow := BitVec.ofNat 64 282588044394775 - maskHigh := BitVec.ofNat 64 9223372311766237185 - systematicCode := BitVec.ofNat 64 18360528486415940407 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9926431075617152 - maskLow := BitVec.ofNat 64 144115193041977623 - maskHigh := BitVec.ofNat 64 13871227589823037441 - systematicCode := BitVec.ofNat 64 18374105798808910647 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x3d07. -/ -def normalizedWeightSixteenCandidateBucket_3d07 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11330469639768320 - maskLow := BitVec.ofNat 64 292751573333901599 - maskHigh := BitVec.ofNat 64 687194767365 - systematicCode := BitVec.ofNat 64 14901150531393699079 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9096262012127488 - maskLow := BitVec.ofNat 64 22548644127 - maskHigh := BitVec.ofNat 64 687262928897 - systematicCode := BitVec.ofNat 64 14901203527799225607 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11330488816126208 - maskLow := BitVec.ofNat 64 90089590102229279 - maskHigh := BitVec.ofNat 64 10995116277765 - systematicCode := BitVec.ofNat 64 15479863062119857415 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9096281188485376 - maskLow := BitVec.ofNat 64 22548644127 - maskHigh := BitVec.ofNat 64 10995137253377 - systematicCode := BitVec.ofNat 64 15479910603833031943 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11332125198665984 - maskLow := BitVec.ofNat 64 76631567778251039 - maskHigh := BitVec.ofNat 64 2814749767106565 - systematicCode := BitVec.ofNat 64 16637288166270516487 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9097917571025152 - maskLow := BitVec.ofNat 64 22548644127 - maskHigh := BitVec.ofNat 64 2814749784948737 - systematicCode := BitVec.ofNat 64 16637335686676299015 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9026999070769408 - maskLow := BitVec.ofNat 64 22548644127 - maskHigh := BitVec.ofNat 64 2308104154876215301 - systematicCode := BitVec.ofNat 64 18151431530650877191 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9026999071031552 - maskLow := BitVec.ofNat 64 22548644127 - maskHigh := BitVec.ofNat 64 9223937323270406149 - systematicCode := BitVec.ofNat 64 18366756576414743815 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11332129526925568 - maskLow := BitVec.ofNat 64 306315148774146335 - maskHigh := BitVec.ofNat 64 11529215046068469765 - systematicCode := BitVec.ofNat 64 18373425844180565255 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9097921899284736 - maskLow := BitVec.ofNat 64 22548644127 - maskHigh := BitVec.ofNat 64 11529215046139789313 - systematicCode := BitVec.ofNat 64 18373478862060600583 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x3d0b. -/ -def normalizedWeightSixteenCandidateBucket_3d0b : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11330469508679936 - maskLow := BitVec.ofNat 64 1154051807928975671 - maskHigh := BitVec.ofNat 64 584115552273 - systematicCode := BitVec.ofNat 64 14900029046645865739 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9096261881039104 - maskLow := BitVec.ofNat 64 74088251703 - maskHigh := BitVec.ofNat 64 584384250881 - systematicCode := BitVec.ofNat 64 14900082008692178187 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11330488834853120 - maskLow := BitVec.ofNat 64 90076395962695991 - maskHigh := BitVec.ofNat 64 37383395344401 - systematicCode := BitVec.ofNat 64 15768097836317818123 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9096281207212288 - maskLow := BitVec.ofNat 64 74088251703 - maskHigh := BitVec.ofNat 64 37383416316929 - systematicCode := BitVec.ofNat 64 15768140979917896971 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11332125217392896 - maskLow := BitVec.ofNat 64 73253868057723191 - maskHigh := BitVec.ofNat 64 9570149208162321 - systematicCode := BitVec.ofNat 64 16925522940401630475 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9097917589752064 - maskLow := BitVec.ofNat 64 74088251703 - maskHigh := BitVec.ofNat 64 9570149225218049 - systematicCode := BitVec.ofNat 64 16925566045648403723 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9026999056204032 - maskLow := BitVec.ofNat 64 74088251703 - maskHigh := BitVec.ofNat 64 585503685686067217 - systematicCode := BitVec.ofNat 64 17864331452519890187 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9026999089758464 - maskLow := BitVec.ofNat 64 74088251703 - maskHigh := BitVec.ofNat 64 9223937220191191057 - systematicCode := BitVec.ofNat 64 18366756559302245643 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11332129479067904 - maskLow := BitVec.ofNat 64 1171006277229281591 - maskHigh := BitVec.ofNat 64 9799832789158199313 - systematicCode := BitVec.ofNat 64 18372304359500102923 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9097921851427072 - maskLow := BitVec.ofNat 64 74088251703 - maskHigh := BitVec.ofNat 64 9799832789430845441 - systematicCode := BitVec.ofNat 64 18372357360200531211 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x3d0e. -/ -def normalizedWeightSixteenCandidateBucket_3d0e : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089857361642496 - maskLow := BitVec.ofNat 64 4611968598284501399 - maskHigh := BitVec.ofNat 64 171798691905 - systematicCode := BitVec.ofNat 64 14683859575901338894 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711578757989376 - maskLow := BitVec.ofNat 64 280246682007 - maskHigh := BitVec.ofNat 64 172872499457 - systematicCode := BitVec.ofNat 64 14683912512178240782 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089785152504832 - maskLow := BitVec.ofNat 64 90073097427812759 - maskHigh := BitVec.ofNat 64 43980465111105 - systematicCode := BitVec.ofNat 64 15768945559782636814 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711506548851712 - maskLow := BitVec.ofNat 64 280246682007 - maskHigh := BitVec.ofNat 64 43980486082817 - systematicCode := BitVec.ofNat 64 15768985404797893902 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089341965566976 - maskLow := BitVec.ofNat 64 72409443127591319 - maskHigh := BitVec.ofNat 64 11258999068426305 - systematicCode := BitVec.ofNat 64 16926370663816314126 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711063361913856 - maskLow := BitVec.ofNat 64 280246682007 - maskHigh := BitVec.ofNat 64 11258999085285377 - systematicCode := BitVec.ofNat 64 16926410457693830414 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9786345517223040 - maskLow := BitVec.ofNat 64 280246682007 - maskHigh := BitVec.ofNat 64 585503273369206849 - systematicCode := BitVec.ofNat 64 17864331439685516558 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9786345681603712 - maskLow := BitVec.ofNat 64 280246682007 - maskHigh := BitVec.ofNat 64 2308103639480139841 - systematicCode := BitVec.ofNat 64 18151431500704005390 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089337907332096 - maskLow := BitVec.ofNat 64 4629770791049822615 - maskHigh := BitVec.ofNat 64 2882303761517117505 - systematicCode := BitVec.ofNat 64 18156134888806104334 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711059303678976 - maskLow := BitVec.ofNat 64 280246682007 - maskHigh := BitVec.ofNat 64 2882303762595069953 - systematicCode := BitVec.ofNat 64 18156187876621827342 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x3d13. -/ -def normalizedWeightSixteenCandidateBucket_3d13 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11330471905724672 - maskLow := BitVec.ofNat 64 1154047684760371991 - maskHigh := BitVec.ofNat 64 8830452760833 - systematicCode := BitVec.ofNat 64 15476498595041787155 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9096264278083840 - maskLow := BitVec.ofNat 64 1104880403223 - maskHigh := BitVec.ofNat 64 8830721458241 - systematicCode := BitVec.ofNat 64 15476542760861908243 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11330472055539968 - maskLow := BitVec.ofNat 64 292734256025764631 - maskHigh := BitVec.ofNat 64 35321811042561 - systematicCode := BitVec.ofNat 64 15765854853987581203 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9096264427899136 - maskLow := BitVec.ofNat 64 1104880403223 - maskHigh := BitVec.ofNat 64 35321879199809 - systematicCode := BitVec.ofNat 64 15765894656053820691 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11332121222318336 - maskLow := BitVec.ofNat 64 5699873647166231 - maskHigh := BitVec.ofNat 64 144678138029277441 - systematicCode := BitVec.ofNat 64 17501992454438337811 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9097913594677504 - maskLow := BitVec.ofNat 64 1104880403223 - maskHigh := BitVec.ofNat 64 144678138030604289 - systematicCode := BitVec.ofNat 64 17502018001859329299 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9026990799716608 - maskLow := BitVec.ofNat 64 1104880403223 - maskHigh := BitVec.ofNat 64 180187965559931137 - systematicCode := BitVec.ofNat 64 17505450891708284179 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9026995094683904 - maskLow := BitVec.ofNat 64 1104880403223 - maskHigh := BitVec.ofNat 64 9223935158606889217 - systematicCode := BitVec.ofNat 64 18366747763343965459 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11332116961167616 - maskLow := BitVec.ofNat 64 1441222254871511831 - maskHigh := BitVec.ofNat 64 9259400833873740033 - systematicCode := BitVec.ofNat 64 18370061355913657619 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9097909333526784 - maskLow := BitVec.ofNat 64 1104880403223 - maskHigh := BitVec.ofNat 64 9259400834209300481 - systematicCode := BitVec.ofNat 64 18370105594747108627 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x3d16. -/ -def normalizedWeightSixteenCandidateBucket_3d16 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089856828965888 - maskLow := BitVec.ofNat 64 4611967567492352279 - maskHigh := BitVec.ofNat 64 2233382994945 - systematicCode := BitVec.ofNat 64 15260329124297260310 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711578225312768 - maskLow := BitVec.ofNat 64 4403415288087 - maskHigh := BitVec.ofNat 64 2234456801297 - systematicCode := BitVec.ofNat 64 15260373264347970838 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089788082226176 - maskLow := BitVec.ofNat 64 292734049867335959 - maskHigh := BitVec.ofNat 64 35734127903745 - systematicCode := BitVec.ofNat 64 15766702577452399894 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711509478573056 - maskLow := BitVec.ofNat 64 4403415288087 - maskHigh := BitVec.ofNat 64 35734196060177 - systematicCode := BitVec.ofNat 64 15766739080933817622 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089341432890368 - maskLow := BitVec.ofNat 64 4855448717035799 - maskHigh := BitVec.ofNat 64 146366987889542145 - systematicCode := BitVec.ofNat 64 17502840177853021462 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711062829237248 - maskLow := BitVec.ofNat 64 4403415288087 - maskHigh := BitVec.ofNat 64 146366987890671617 - systematicCode := BitVec.ofNat 64 17502862413904755990 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9786340989471872 - maskLow := BitVec.ofNat 64 4403415288087 - maskHigh := BitVec.ofNat 64 180181368490165249 - systematicCode := BitVec.ofNat 64 17505450878873910550 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9786362194578560 - maskLow := BitVec.ofNat 64 4403415288087 - maskHigh := BitVec.ofNat 64 2308095393142932481 - systematicCode := BitVec.ofNat 64 18151422704745725206 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089337374655488 - maskLow := BitVec.ofNat 64 4899986768692054295 - maskHigh := BitVec.ofNat 64 2341871806232658945 - systematicCode := BitVec.ofNat 64 18153891885219659030 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711058771002368 - maskLow := BitVec.ofNat 64 4403415288087 - maskHigh := BitVec.ofNat 64 2341871807373524993 - systematicCode := BitVec.ofNat 64 18153936111168404758 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x3d1a. -/ -def normalizedWeightSixteenCandidateBucket_3d1a : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089856957973504 - maskLow := BitVec.ofNat 64 4611967515952750871 - maskHigh := BitVec.ofNat 64 2336462213121 - systematicCode := BitVec.ofNat 64 15261459422250351898 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711578354320384 - maskLow := BitVec.ofNat 64 17597554827543 - maskHigh := BitVec.ofNat 64 2337536016389 - systematicCode := BitVec.ofNat 64 15261499164187966746 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089788238283776 - maskLow := BitVec.ofNat 64 1154047427062341911 - maskHigh := BitVec.ofNat 64 9345848840193 - systematicCode := BitVec.ofNat 64 15478476616459697434 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711509634630656 - maskLow := BitVec.ofNat 64 17597554827543 - maskHigh := BitVec.ofNat 64 9346117533701 - systematicCode := BitVec.ofNat 64 15478513085581901082 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089341561897984 - maskLow := BitVec.ofNat 64 1477748996514071 - maskHigh := BitVec.ofNat 64 153122387330600961 - systematicCode := BitVec.ofNat 64 17503970458626506010 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711062958244864 - maskLow := BitVec.ofNat 64 17597554827543 - maskHigh := BitVec.ofNat 64 153122387330940929 - systematicCode := BitVec.ofNat 64 17503983915765349658 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9786341118479488 - maskLow := BitVec.ofNat 64 17597554827543 - maskHigh := BitVec.ofNat 64 180154980211101697 - systematicCode := BitVec.ofNat 64 17505446480894770458 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9786362159205504 - maskLow := BitVec.ofNat 64 17597554827543 - maskHigh := BitVec.ofNat 64 585468638752935937 - systematicCode := BitVec.ofNat 64 17864318245748096282 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089337503663104 - maskLow := BitVec.ofNat 64 5764677897147195671 - maskHigh := BitVec.ofNat 64 612489549322391553 - systematicCode := BitVec.ofNat 64 17865665907181567258 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711058900009984 - maskLow := BitVec.ofNat 64 17597554827543 - maskHigh := BitVec.ofNat 64 612489550664581121 - systematicCode := BitVec.ofNat 64 17865705752196824346 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x3d1f. -/ -def normalizedWeightSixteenCandidateBucket_3d1f : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9928078906133632 - maskLow := BitVec.ofNat 64 70374112985367 - maskHigh := BitVec.ofNat 64 155937137097719809 - systematicCode := BitVec.ofNat 64 17504056767000952095 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9852723973358592 - maskLow := BitVec.ofNat 64 70374112985367 - maskHigh := BitVec.ofNat 64 180143985094825217 - systematicCode := BitVec.ofNat 64 17505378040473795871 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36104663598138368 - maskLow := BitVec.ofNat 64 23095112990999 - maskHigh := BitVec.ofNat 64 180143985094836225 - systematicCode := BitVec.ofNat 64 17505383279309700383 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9852724772373504 - maskLow := BitVec.ofNat 64 70374112985367 - maskHigh := BitVec.ofNat 64 585467951558168657 - systematicCode := BitVec.ofNat 64 17864258601285926175 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36104664397153280 - maskLow := BitVec.ofNat 64 17941152235799 - maskHigh := BitVec.ofNat 64 585467951558180865 - systematicCode := BitVec.ofNat 64 17864263874481044767 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9852724774454272 - maskLow := BitVec.ofNat 64 70374112985367 - maskHigh := BitVec.ofNat 64 2308094809027380293 - systematicCode := BitVec.ofNat 64 18151358679417175327 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36104664399234048 - maskLow := BitVec.ofNat 64 4695473094935 - maskHigh := BitVec.ofNat 64 2308094809027395585 - systematicCode := BitVec.ofNat 64 18151368333545782559 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9852727999890432 - maskLow := BitVec.ofNat 64 70374112985367 - maskHigh := BitVec.ofNat 64 9223934986808197397 - systematicCode := BitVec.ofNat 64 18366683725181041951 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36104667624670208 - maskLow := BitVec.ofNat 64 1190779781399 - maskHigh := BitVec.ofNat 64 9223934986808213505 - systematicCode := BitVec.ofNat 64 18366696677794200863 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9928074915531904 - maskLow := BitVec.ofNat 64 70374112985367 - maskHigh := BitVec.ofNat 64 12141704595390873601 - systematicCode := BitVec.ofNat 64 18373551713297448223 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x3d23. -/ -def normalizedWeightSixteenCandidateBucket_3d23 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11329960536180992 - maskLow := BitVec.ofNat 64 1152926182900171031 - maskHigh := BitVec.ofNat 64 2251834173489153 - systematicCode := BitVec.ofNat 64 16629437691566243107 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9095752908540160 - maskLow := BitVec.ofNat 64 281480345616663 - maskHigh := BitVec.ofNat 64 2251834441860161 - systematicCode := BitVec.ofNat 64 16629464196750327075 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11329960685996288 - maskLow := BitVec.ofNat 64 288248248584569111 - maskHigh := BitVec.ofNat 64 9007336693760001 - systematicCode := BitVec.ofNat 64 16918793950512037155 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9095753058355456 - maskLow := BitVec.ofNat 64 281480345616663 - maskHigh := BitVec.ofNat 64 9007336760807489 - systematicCode := BitVec.ofNat 64 16918816091942239523 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11329973470234880 - maskLow := BitVec.ofNat 64 18036394110943511 - maskHigh := BitVec.ofNat 64 144117387099176961 - systematicCode := BitVec.ofNat 64 17497506468269931811 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9095765842594048 - maskLow := BitVec.ofNat 64 281480345616663 - maskHigh := BitVec.ofNat 64 144117387103310849 - systematicCode := BitVec.ofNat 64 17497519848100543779 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9024843047633152 - maskLow := BitVec.ofNat 64 281480345616663 - maskHigh := BitVec.ofNat 64 155514924632702977 - systematicCode := BitVec.ofNat 64 17504056749888453923 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9025392803447040 - maskLow := BitVec.ofNat 64 281480345616663 - maskHigh := BitVec.ofNat 64 9223374407676788737 - systematicCode := BitVec.ofNat 64 18362244163986079011 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11329423748237568 - maskLow := BitVec.ofNat 64 1459166284636946711 - maskHigh := BitVec.ofNat 64 9223512774343196673 - systematicCode := BitVec.ofNat 64 18365575348473380131 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9095216120596736 - maskLow := BitVec.ofNat 64 281480345616663 - maskHigh := BitVec.ofNat 64 9223512774682869761 - systematicCode := BitVec.ofNat 64 18365601995389222179 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x3d26. -/ -def normalizedWeightSixteenCandidateBucket_3d26 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089720463754240 - maskLow := BitVec.ofNat 64 4611687192027791639 - maskHigh := BitVec.ofNat 64 562984313421825 - systematicCode := BitVec.ofNat 64 16413268220821716262 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711441860101120 - maskLow := BitVec.ofNat 64 1125905276141847 - maskHigh := BitVec.ofNat 64 562985386901777 - systematicCode := BitVec.ofNat 64 16413294700236389670 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089719899620352 - maskLow := BitVec.ofNat 64 288248042426532119 - maskHigh := BitVec.ofNat 64 9007749010817025 - systematicCode := BitVec.ofNat 64 16919641673976855846 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711441295967232 - maskLow := BitVec.ofNat 64 1125905276141847 - maskHigh := BitVec.ofNat 64 9007749077667857 - systematicCode := BitVec.ofNat 64 16919660516822236454 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089716437222400 - maskLow := BitVec.ofNat 64 18033095576453399 - maskHigh := BitVec.ofNat 64 144123984169140225 - systematicCode := BitVec.ofNat 64 17498354191734750502 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711437833569280 - maskLow := BitVec.ofNat 64 1125905276141847 - maskHigh := BitVec.ofNat 64 144123984173076737 - systematicCode := BitVec.ofNat 64 17498364272980540710 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9785693254716544 - maskLow := BitVec.ofNat 64 1125905276141847 - maskHigh := BitVec.ofNat 64 153826074772635649 - systematicCode := BitVec.ofNat 64 17504053451404098854 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9788407672753280 - maskLow := BitVec.ofNat 64 1125905276141847 - maskHigh := BitVec.ofNat 64 2305852389422530561 - systematicCode := BitVec.ofNat 64 18146919105387838758 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089201009443840 - maskLow := BitVec.ofNat 64 4917930798457880855 - maskHigh := BitVec.ofNat 64 2305983746702311425 - systematicCode := BitVec.ofNat 64 18149405877779381542 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9710922405790720 - maskLow := BitVec.ofNat 64 1125905276141847 - maskHigh := BitVec.ofNat 64 2305983747847094273 - systematicCode := BitVec.ofNat 64 18149432511810518310 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x3d2a. -/ -def normalizedWeightSixteenCandidateBucket_3d2a : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089720592761856 - maskLow := BitVec.ofNat 64 4611687140489756951 - maskHigh := BitVec.ofNat 64 563087393423361 - systematicCode := BitVec.ofNat 64 16414398518774807850 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711441989108736 - maskLow := BitVec.ofNat 64 4503604998242583 - maskHigh := BitVec.ofNat 64 563088466116869 - systematicCode := BitVec.ofNat 64 16414420600076385578 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089720055677952 - maskLow := BitVec.ofNat 64 1152925925204099351 - maskHigh := BitVec.ofNat 64 2252349570547713 - systematicCode := BitVec.ofNat 64 16631415712984153386 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711441452024832 - maskLow := BitVec.ofNat 64 4503604998242583 - maskHigh := BitVec.ofNat 64 2252349837935621 - systematicCode := BitVec.ofNat 64 16631434521470319914 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089716566230016 - maskLow := BitVec.ofNat 64 18019901438492951 - maskHigh := BitVec.ofNat 64 144150372448993281 - systematicCode := BitVec.ofNat 64 17499484489620995370 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711437962576896 - maskLow := BitVec.ofNat 64 4503604998242583 - maskHigh := BitVec.ofNat 64 144150372452140289 - systematicCode := BitVec.ofNat 64 17499490155707776298 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9785693383724160 - maskLow := BitVec.ofNat 64 4503604998242583 - maskHigh := BitVec.ofNat 64 147070675332366337 - systematicCode := BitVec.ofNat 64 17502927551564627242 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9788407637380224 - maskLow := BitVec.ofNat 64 4503604998242583 - maskHigh := BitVec.ofNat 64 576496623871328257 - systematicCode := BitVec.ofNat 64 17859814646390209834 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089201138451456 - maskLow := BitVec.ofNat 64 5782621926914588951 - maskHigh := BitVec.ofNat 64 576601489792827393 - systematicCode := BitVec.ofNat 64 17861179899741289770 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9710922534798336 - maskLow := BitVec.ofNat 64 4503604998242583 - maskHigh := BitVec.ofNat 64 576601491138150401 - systematicCode := BitVec.ofNat 64 17861202152838937898 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x3d2f. -/ -def normalizedWeightSixteenCandidateBucket_3d2f : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9926953893137536 - maskLow := BitVec.ofNat 64 18014403886645527 - maskHigh := BitVec.ofNat 64 144161367568416769 - systematicCode := BitVec.ofNat 64 17499535506737544495 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9851667142968320 - maskLow := BitVec.ofNat 64 18014403886645527 - maskHigh := BitVec.ofNat 64 144255925565587457 - systematicCode := BitVec.ofNat 64 17500892102021430575 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36103606767748096 - maskLow := BitVec.ofNat 64 5910979888087319 - maskHigh := BitVec.ofNat 64 144255925568405505 - systematicCode := BitVec.ofNat 64 17500897340857335087 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9851770215891968 - maskLow := BitVec.ofNat 64 18014403886645527 - maskHigh := BitVec.ofNat 64 576495936676560977 - systematicCode := BitVec.ofNat 64 17859772593845648687 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36103709840671744 - maskLow := BitVec.ofNat 64 4503948601917719 - maskHigh := BitVec.ofNat 64 576495936679706625 - systematicCode := BitVec.ofNat 64 17859777935759195439 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9851770217972736 - maskLow := BitVec.ofNat 64 18014403886645527 - maskHigh := BitVec.ofNat 64 2305851805306978373 - systematicCode := BitVec.ofNat 64 18146872671976897839 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36103709842752512 - maskLow := BitVec.ofNat 64 1126197341782295 - maskHigh := BitVec.ofNat 64 2305851805310910465 - systematicCode := BitVec.ofNat 64 18146882394823933231 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9852182539043840 - maskLow := BitVec.ofNat 64 18014403886645527 - maskHigh := BitVec.ofNat 64 9223374235878096917 - systematicCode := BitVec.ofNat 64 18362197717740764463 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36104122163823616 - maskLow := BitVec.ofNat 64 281566253220119 - maskHigh := BitVec.ofNat 64 9223374235882225665 - systematicCode := BitVec.ofNat 64 18362210739072351535 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9926438532992128 - maskLow := BitVec.ofNat 64 18014403886645527 - maskHigh := BitVec.ofNat 64 12105816535864442881 - systematicCode := BitVec.ofNat 64 18373551644847455535 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x3d32. -/ -def normalizedWeightSixteenCandidateBucket_3d32 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089736573060096 - maskLow := BitVec.ofNat 64 4611686109729063191 - maskHigh := BitVec.ofNat 64 565148993454081 - systematicCode := BitVec.ofNat 64 16416659114547297586 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711457969406976 - maskLow := BitVec.ofNat 64 72057599440257303 - maskHigh := BitVec.ofNat 64 565150050418709 - systematicCode := BitVec.ofNat 64 16416672365530856754 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089736568652800 - maskLow := BitVec.ofNat 64 1152921802066952471 - maskHigh := BitVec.ofNat 64 2260595923484673 - systematicCode := BitVec.ofNat 64 16633676308756643122 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711457964999680 - maskLow := BitVec.ofNat 64 72057599440257303 - maskHigh := BitVec.ofNat 64 2260596175142981 - systematicCode := BitVec.ofNat 64 16633686286924791090 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089736541602816 - maskLow := BitVec.ofNat 64 288230725151424791 - maskHigh := BitVec.ofNat 64 9042383643607041 - systematicCode := BitVec.ofNat 64 16923032567635590450 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9711457937949696 - maskLow := BitVec.ofNat 64 72057599440257303 - maskHigh := BitVec.ofNat 64 9042383693938769 - systematicCode := BitVec.ofNat 64 16923038165003943218 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9785709364022400 - maskLow := BitVec.ofNat 64 72057599440257303 - maskHigh := BitVec.ofNat 64 11962686526980097 - systematicCode := BitVec.ofNat 64 16926466799395945778 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9788402576952448 - maskLow := BitVec.ofNat 64 72057599440257303 - maskHigh := BitVec.ofNat 64 36074976524107777 - systematicCode := BitVec.ofNat 64 17283362724674288946 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18089217118749696 - maskLow := BitVec.ofNat 64 6052837904588275991 - maskHigh := BitVec.ofNat 64 36169534524096513 - systematicCode := BitVec.ofNat 64 17284727943531412786 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9710938515096576 - maskLow := BitVec.ofNat 64 72057599440257303 - maskHigh := BitVec.ofNat 64 36169535916605441 - systematicCode := BitVec.ofNat 64 17284741400670256434 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x3d37. -/ -def normalizedWeightSixteenCandidateBucket_3d37 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9926941907913856 - maskLow := BitVec.ofNat 64 288230381654704407 - maskHigh := BitVec.ofNat 64 9043070888706049 - systematicCode := BitVec.ofNat 64 16923065924116102455 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9851659685495808 - maskLow := BitVec.ofNat 64 288230381654704407 - maskHigh := BitVec.ofNat 64 9147936760201217 - systematicCode := BitVec.ofNat 64 16924440145811553591 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36103599310275584 - maskLow := BitVec.ofNat 64 73464974424473879 - maskHigh := BitVec.ofNat 64 9147936810205185 - systematicCode := BitVec.ofNat 64 16924445419006672183 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9851761959404544 - maskLow := BitVec.ofNat 64 288230381654704407 - maskHigh := BitVec.ofNat 64 36063981407831297 - systematicCode := BitVec.ofNat 64 17283320672129727799 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36103701584184320 - maskLow := BitVec.ofNat 64 72063097099059479 - maskHigh := BitVec.ofNat 64 36063981458161665 - systematicCode := BitVec.ofNat 64 17283326014043274551 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9851762227823616 - maskLow := BitVec.ofNat 64 288230381654704407 - maskHigh := BitVec.ofNat 64 2305843558969771013 - systematicCode := BitVec.ofNat 64 18144620906523475255 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36103701852603392 - maskLow := BitVec.ofNat 64 1130320636215575 - maskHigh := BitVec.ofNat 64 2305843559036616705 - systematicCode := BitVec.ofNat 64 18144639391237487927 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9852175081571328 - maskLow := BitVec.ofNat 64 288230381654704407 - maskHigh := BitVec.ofNat 64 9223372174293795077 - systematicCode := BitVec.ofNat 64 18359945952287341879 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36104114706351104 - maskLow := BitVec.ofNat 64 282597171200279 - maskHigh := BitVec.ofNat 64 9223372174360838145 - systematicCode := BitVec.ofNat 64 18359967735485906231 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9926431075519616 - maskLow := BitVec.ofNat 64 288230381654704407 - maskHigh := BitVec.ofNat 64 11565384580642897921 - systematicCode := BitVec.ofNat 64 18373542848889175351 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x3d3b. -/ -def normalizedWeightSixteenCandidateBucket_3d3b : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9926941810117760 - maskLow := BitVec.ofNat 64 1152921510512492823 - maskHigh := BitVec.ofNat 64 2261180290695169 - systematicCode := BitVec.ofNat 64 16633709630945049915 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9851659623072768 - maskLow := BitVec.ofNat 64 1152921510512492823 - maskHigh := BitVec.ofNat 64 2392537319931905 - systematicCode := BitVec.ofNat 64 16636209786839973179 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36103599247852544 - maskLow := BitVec.ofNat 64 76842674547654935 - maskHigh := BitVec.ofNat 64 2392537570476033 - systematicCode := BitVec.ofNat 64 16636219440968580411 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9851761896981504 - maskLow := BitVec.ofNat 64 1152921510512492823 - maskHigh := BitVec.ofNat 64 36037593128767745 - systematicCode := BitVec.ofNat 64 17282194789403016507 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36103701521761280 - maskLow := BitVec.ofNat 64 72076291641245975 - maskHigh := BitVec.ofNat 64 36037593380421633 - systematicCode := BitVec.ofNat 64 17282204512250051899 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9851762163319808 - maskLow := BitVec.ofNat 64 1152921510512492823 - maskHigh := BitVec.ofNat 64 576461302060290065 - systematicCode := BitVec.ofNat 64 17856394945665514811 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36103701788099584 - maskLow := BitVec.ofNat 64 4521266438537495 - maskHigh := BitVec.ofNat 64 576461302327672833 - systematicCode := BitVec.ofNat 64 17856413430379527483 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9852175019148288 - maskLow := BitVec.ofNat 64 1152921510512492823 - maskHigh := BitVec.ofNat 64 9223372071214579985 - systematicCode := BitVec.ofNat 64 18358820052447870267 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36104114643928064 - maskLow := BitVec.ofNat 64 282649113461015 - maskHigh := BitVec.ofNat 64 9223372071482949633 - systematicCode := BitVec.ofNat 64 18358846233625836859 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9926431013096576 - maskLow := BitVec.ofNat 64 1152921510512492823 - maskHigh := BitVec.ofNat 64 9836002323933954049 - systematicCode := BitVec.ofNat 64 18372416949049703739 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x3e07. -/ -def normalizedWeightSixteenCandidateBucket_3e07 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10204569732924032 - maskLow := BitVec.ofNat 64 580981950559355167 - maskHigh := BitVec.ofNat 64 412316860425 - systematicCode := BitVec.ofNat 64 14829094041162366471 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9087465919103616 - maskLow := BitVec.ofNat 64 40802255135 - maskHigh := BitVec.ofNat 64 412452130817 - systematicCode := BitVec.ofNat 64 14829147033272991239 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10204588909281920 - maskLow := BitVec.ofNat 64 108103989685453087 - maskHigh := BitVec.ofNat 64 6597069766665 - systematicCode := BitVec.ofNat 64 15407806567610334727 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9087485095461504 - maskLow := BitVec.ofNat 64 40802255135 - maskHigh := BitVec.ofNat 64 6597094936577 - systematicCode := BitVec.ofNat 64 15407853014090137095 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10206225291821696 - maskLow := BitVec.ofNat 64 76701937596170527 - maskHigh := BitVec.ofNat 64 1688849860263945 - systematicCode := BitVec.ofNat 64 16565231671744282119 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9089121478001280 - maskLow := BitVec.ofNat 64 40802255135 - maskHigh := BitVec.ofNat 64 1688849878122497 - systematicCode := BitVec.ofNat 64 16565278092655214087 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2262803536693376 - maskLow := BitVec.ofNat 64 40802255135 - maskHigh := BitVec.ofNat 64 2306973582044954633 - systematicCode := BitVec.ofNat 64 18151148951884414471 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2262803536953472 - maskLow := BitVec.ofNat 64 40802255135 - maskHigh := BitVec.ofNat 64 4612251304843018249 - systematicCode := BitVec.ofNat 64 18294698982393658887 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10206229620083328 - maskLow := BitVec.ofNat 64 612630293253259551 - maskHigh := BitVec.ofNat 64 6917529027641081865 - systematicCode := BitVec.ofNat 64 18301369353966075399 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9089125806262912 - maskLow := BitVec.ofNat 64 40802255135 - maskHigh := BitVec.ofNat 64 6917529027783720961 - systematicCode := BitVec.ofNat 64 18301422371846110727 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x3e0b. -/ -def normalizedWeightSixteenCandidateBucket_3e0b : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10204569601835648 - maskLow := BitVec.ofNat 64 2306973313609564471 - maskHigh := BitVec.ofNat 64 309237645345 - systematicCode := BitVec.ofNat 64 14827972556414533131 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9087465788015232 - maskLow := BitVec.ofNat 64 143881470263 - maskHigh := BitVec.ofNat 64 309774779393 - systematicCode := BitVec.ofNat 64 14828025514165943819 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10204588928008832 - maskLow := BitVec.ofNat 64 108090795545919799 - maskHigh := BitVec.ofNat 64 19791209300001 - systematicCode := BitVec.ofNat 64 15696041341808295435 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9087485114188416 - maskLow := BitVec.ofNat 64 143881470263 - maskHigh := BitVec.ofNat 64 19791234466817 - systematicCode := BitVec.ofNat 64 15696083390175002123 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10206225310548608 - maskLow := BitVec.ofNat 64 73324237875642679 - maskHigh := BitVec.ofNat 64 5066549580791841 - systematicCode := BitVec.ofNat 64 16853466445875396107 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9089121496728192 - maskLow := BitVec.ofNat 64 143881470263 - maskHigh := BitVec.ofNat 64 5066549597863937 - systematicCode := BitVec.ofNat 64 16853508451627318795 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2262803522128000 - maskLow := BitVec.ofNat 64 143881470263 - maskHigh := BitVec.ofNat 64 580982218994745377 - systematicCode := BitVec.ofNat 64 17864048873753427467 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2262803555680384 - maskLow := BitVec.ofNat 64 143881470263 - maskHigh := BitVec.ofNat 64 4612251201763803169 - systematicCode := BitVec.ofNat 64 18294698965281160715 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10206229572225664 - maskLow := BitVec.ofNat 64 2342012550163530039 - maskHigh := BitVec.ofNat 64 5188146770730811425 - systematicCode := BitVec.ofNat 64 18300247869285613067 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9089125758405248 - maskLow := BitVec.ofNat 64 143881470263 - maskHigh := BitVec.ofNat 64 5188146771276103681 - systematicCode := BitVec.ofNat 64 18300300869986041355 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x3e0d. -/ -def normalizedWeightSixteenCandidateBucket_3e0d : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10204569600616448 - maskLow := BitVec.ofNat 64 4612251173846581591 - maskHigh := BitVec.ofNat 64 171798691905 - systematicCode := BitVec.ofNat 64 14683859575918181901 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9087465786796032 - maskLow := BitVec.ofNat 64 281320423767 - maskHigh := BitVec.ofNat 64 172872565249 - systematicCode := BitVec.ofNat 64 14683912516489985549 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10204588927960064 - maskLow := BitVec.ofNat 64 108088596522664279 - maskHigh := BitVec.ofNat 64 21990232555585 - systematicCode := BitVec.ofNat 64 15696606490784841229 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9087485114139648 - maskLow := BitVec.ofNat 64 281320423767 - maskHigh := BitVec.ofNat 64 21990257721857 - systematicCode := BitVec.ofNat 64 15696646340095000077 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10206225310499840 - maskLow := BitVec.ofNat 64 72761287922221399 - maskHigh := BitVec.ofNat 64 5629499534213185 - systematicCode := BitVec.ofNat 64 16854031594818518541 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9089121496679424 - maskLow := BitVec.ofNat 64 281320423767 - maskHigh := BitVec.ofNat 64 5629499551154177 - systematicCode := BitVec.ofNat 64 16854071392990936589 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2262803522274304 - maskLow := BitVec.ofNat 64 281320423767 - maskHigh := BitVec.ofNat 64 580982081555791937 - systematicCode := BitVec.ofNat 64 17864048865197178381 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2262803555566592 - maskLow := BitVec.ofNat 64 281320423767 - maskHigh := BitVec.ofNat 64 2306973341526786113 - systematicCode := BitVec.ofNat 64 18151148926215667213 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10206229572176896 - maskLow := BitVec.ofNat 64 4647855559377224023 - maskHigh := BitVec.ofNat 64 2882303761517117505 - systematicCode := BitVec.ofNat 64 18156134888822947341 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9089125758356480 - maskLow := BitVec.ofNat 64 281320423767 - maskHigh := BitVec.ofNat 64 2882303762599280641 - systematicCode := BitVec.ofNat 64 18156187880933572109 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x3e13. -/ -def normalizedWeightSixteenCandidateBucket_3e13 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10204571998880384 - maskLow := BitVec.ofNat 64 2306969190440960791 - maskHigh := BitVec.ofNat 64 4432406249985 - systematicCode := BitVec.ofNat 64 15404442104810454547 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9087468185059968 - maskLow := BitVec.ofNat 64 2205465772823 - maskHigh := BitVec.ofNat 64 4432943382593 - systematicCode := BitVec.ofNat 64 15404486266335673875 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10204572148695680 - maskLow := BitVec.ofNat 64 580964633251218199 - maskHigh := BitVec.ofNat 64 17729624998401 - systematicCode := BitVec.ofNat 64 15693798363756248595 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9087468334875264 - maskLow := BitVec.ofNat 64 2205465772823 - maskHigh := BitVec.ofNat 64 17729760264257 - systematicCode := BitVec.ofNat 64 15693838161527586323 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10206221315474048 - maskLow := BitVec.ofNat 64 5770243465085719 - maskHigh := BitVec.ofNat 64 72620543991349761 - systematicCode := BitVec.ofNat 64 17429935959912103443 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9089117501653632 - maskLow := BitVec.ofNat 64 2205465772823 - maskHigh := BitVec.ofNat 64 72620543992692737 - systematicCode := BitVec.ofNat 64 17429960407838244371 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2262795265640576 - maskLow := BitVec.ofNat 64 2205465772823 - maskHigh := BitVec.ofNat 64 108108381289447937 - systematicCode := BitVec.ofNat 64 17433392193880604179 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2262799560605824 - maskLow := BitVec.ofNat 64 2205465772823 - maskHigh := BitVec.ofNat 64 4612249140179501569 - systematicCode := BitVec.ofNat 64 18294690169322880531 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10206217054325376 - maskLow := BitVec.ofNat 64 2882444505447990039 - maskHigh := BitVec.ofNat 64 4647714815446352385 - systematicCode := BitVec.ofNat 64 18298004865699167763 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9089113240504960 - maskLow := BitVec.ofNat 64 2205465772823 - maskHigh := BitVec.ofNat 64 4647714816117473281 - systematicCode := BitVec.ofNat 64 18298049104532618771 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x3e15. -/ -def normalizedWeightSixteenCandidateBucket_3e15 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10204571997661184 - maskLow := BitVec.ofNat 64 4612249112262280471 - maskHigh := BitVec.ofNat 64 2233382994945 - systematicCode := BitVec.ofNat 64 15260329124314103317 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9087468183840768 - maskLow := BitVec.ofNat 64 4404489028887 - maskHigh := BitVec.ofNat 64 2234456866849 - systematicCode := BitVec.ofNat 64 15260373268659715605 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10204572148646912 - maskLow := BitVec.ofNat 64 580964495812265239 - maskHigh := BitVec.ofNat 64 17867063952385 - systematicCode := BitVec.ofNat 64 15694363512732794389 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9087468334826496 - maskLow := BitVec.ofNat 64 4404489028887 - maskHigh := BitVec.ofNat 64 17867199217697 - systematicCode := BitVec.ofNat 64 15694401111447584277 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10206221315425280 - maskLow := BitVec.ofNat 64 5207293511664919 - maskHigh := BitVec.ofNat 64 73183493944771585 - systematicCode := BitVec.ofNat 64 17430501108855225877 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9089117501604864 - maskLow := BitVec.ofNat 64 4404489028887 - maskHigh := BitVec.ofNat 64 73183493945982977 - systematicCode := BitVec.ofNat 64 17430523349201862165 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2262795265786880 - maskLow := BitVec.ofNat 64 4404489028887 - maskHigh := BitVec.ofNat 64 108106182266192897 - systematicCode := BitVec.ofNat 64 17433392185324355093 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2262799560492032 - maskLow := BitVec.ofNat 64 4404489028887 - maskHigh := BitVec.ofNat 64 2306969218358182913 - systematicCode := BitVec.ofNat 64 18151140130257387029 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10206217054276608 - maskLow := BitVec.ofNat 64 5188287514661684503 - maskHigh := BitVec.ofNat 64 2341871806232658945 - systematicCode := BitVec.ofNat 64 18153891885236502037 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9089113240456192 - maskLow := BitVec.ofNat 64 4404489028887 - maskHigh := BitVec.ofNat 64 2341871807440650241 - systematicCode := BitVec.ofNat 64 18153936115480149525 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x3e19. -/ -def normalizedWeightSixteenCandidateBucket_3e19 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10204571991418880 - maskLow := BitVec.ofNat 64 4612249009183068439 - maskHigh := BitVec.ofNat 64 2336462213121 - systematicCode := BitVec.ofNat 64 15261459422267194905 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9087468177598464 - maskLow := BitVec.ofNat 64 17598628565271 - maskHigh := BitVec.ofNat 64 2337536081929 - systematicCode := BitVec.ofNat 64 15261499168499711513 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10204571992589312 - maskLow := BitVec.ofNat 64 2306968949922795799 - maskHigh := BitVec.ofNat 64 4672924422145 - systematicCode := BitVec.ofNat 64 15406137551740091929 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9087468178768896 - maskLow := BitVec.ofNat 64 17598628565271 - maskHigh := BitVec.ofNat 64 4673461551113 - systematicCode := BitVec.ofNat 64 15406175116095667737 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10206221259244544 - maskLow := BitVec.ofNat 64 1829593791140119 - maskHigh := BitVec.ofNat 64 76561193665302529 - systematicCode := BitVec.ofNat 64 17431631389628710425 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9089117445424128 - maskLow := BitVec.ofNat 64 17598628565271 - maskHigh := BitVec.ofNat 64 76561193665724417 - systematicCode := BitVec.ofNat 64 17431644851062455833 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2262795234575360 - maskLow := BitVec.ofNat 64 17598628565271 - maskHigh := BitVec.ofNat 64 108092988126662657 - systematicCode := BitVec.ofNat 64 17433387787345215001 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2262799495988224 - maskLow := BitVec.ofNat 64 17598628565271 - maskHigh := BitVec.ofNat 64 580964764247658497 - systematicCode := BitVec.ofNat 64 17864035671259758105 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10206216998095872 - maskLow := BitVec.ofNat 64 6917669771571958039 - maskHigh := BitVec.ofNat 64 612489549322391553 - systematicCode := BitVec.ofNat 64 17865665907198410265 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9089113184275456 - maskLow := BitVec.ofNat 64 17598628565271 - maskHigh := BitVec.ofNat 64 612489550933032961 - systematicCode := BitVec.ofNat 64 17865705756508569113 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x3e1f. -/ -def normalizedWeightSixteenCandidateBucket_3e1f : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9024864894340224 - maskLow := BitVec.ofNat 64 140743930904855 - maskHigh := BitVec.ofNat 64 78250043525595137 - systematicCode := BitVec.ofNat 64 17431716598491528735 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 45124575984110720 - maskLow := BitVec.ofNat 64 140743930904855 - maskHigh := BitVec.ofNat 64 108086391056897537 - systematicCode := BitVec.ofNat 64 17433320446452710943 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11611461569498240 - maskLow := BitVec.ofNat 64 24195698360599 - maskHigh := BitVec.ofNat 64 108086391056924673 - systematicCode := BitVec.ofNat 64 17433326784783466015 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 45124580245523584 - maskLow := BitVec.ofNat 64 140743930904855 - maskHigh := BitVec.ofNat 64 580964351930798177 - systematicCode := BitVec.ofNat 64 17863977126326058527 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11611465830911104 - maskLow := BitVec.ofNat 64 18010945454359 - maskHigh := BitVec.ofNat 64 580964351930826753 - systematicCode := BitVec.ofNat 64 17863983499016027679 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 45124580345400448 - maskLow := BitVec.ofNat 64 140743930904855 - maskHigh := BitVec.ofNat 64 2306968909120537673 - systematicCode := BitVec.ofNat 64 18151077204457307679 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11611465930787968 - maskLow := BitVec.ofNat 64 4713726705943 - maskHigh := BitVec.ofNat 64 2306968909120569345 - systematicCode := BitVec.ofNat 64 18151087958080765471 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 45124580345790592 - maskLow := BitVec.ofNat 64 140743930904855 - maskHigh := BitVec.ofNat 64 4612248968380809769 - systematicCode := BitVec.ofNat 64 18294627234966552095 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11611465931178112 - maskLow := BitVec.ofNat 64 2377264496919 - maskHigh := BitVec.ofNat 64 4612248968380841985 - systematicCode := BitVec.ofNat 64 18294640187579711007 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9024860565554304 - maskLow := BitVec.ofNat 64 140743930904855 - maskHigh := BitVec.ofNat 64 7530018576963502081 - systematicCode := BitVec.ofNat 64 18301494119276363295 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x3e23. -/ -def normalizedWeightSixteenCandidateBucket_3e23 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10204060629336704 - maskLow := BitVec.ofNat 64 2305847688580759831 - maskHigh := BitVec.ofNat 64 1125934266712065 - systematicCode := BitVec.ofNat 64 16557381201334910499 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9086956815516288 - maskLow := BitVec.ofNat 64 562956396069143 - maskHigh := BitVec.ofNat 64 1125934803452993 - systematicCode := BitVec.ofNat 64 16557407702224092707 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10204060779152000 - maskLow := BitVec.ofNat 64 576478625810022679 - maskHigh := BitVec.ofNat 64 4503737066455041 - systematicCode := BitVec.ofNat 64 16846737460280704547 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9086956965331584 - maskLow := BitVec.ofNat 64 562956396069143 - maskHigh := BitVec.ofNat 64 4503737200545857 - systematicCode := BitVec.ofNat 64 16846759597416005155 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10204073563390592 - maskLow := BitVec.ofNat 64 36050793694167319 - maskHigh := BitVec.ofNat 64 72059793061314561 - systematicCode := BitVec.ofNat 64 17425449978038599203 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9086969749570176 - maskLow := BitVec.ofNat 64 562956396069143 - maskHigh := BitVec.ofNat 64 72059793069577217 - systematicCode := BitVec.ofNat 64 17425463353574309411 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2260647513557120 - maskLow := BitVec.ofNat 64 562956396069143 - maskHigh := BitVec.ofNat 64 77827831060627457 - systematicCode := BitVec.ofNat 64 17431716581379030563 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2261197269368960 - maskLow := BitVec.ofNat 64 562956396069143 - maskHigh := BitVec.ofNat 64 4611688389249466369 - systematicCode := BitVec.ofNat 64 18290186569964994083 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10203523841395328 - maskLow := BitVec.ofNat 64 2918332564978729239 - maskHigh := BitVec.ofNat 64 4611826755915874305 - systematicCode := BitVec.ofNat 64 18293518858258890275 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9086420027574912 - maskLow := BitVec.ofNat 64 562956396069143 - maskHigh := BitVec.ofNat 64 4611826756595220481 - systematicCode := BitVec.ofNat 64 18293545505174732323 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x3e25. -/ -def normalizedWeightSixteenCandidateBucket_3e25 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10204060628117504 - maskLow := BitVec.ofNat 64 4611688361332375831 - maskHigh := BitVec.ofNat 64 562984313421825 - systematicCode := BitVec.ofNat 64 16413268220838559269 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9086956814297088 - maskLow := BitVec.ofNat 64 1125906349621527 - maskHigh := BitVec.ofNat 64 562985386902049 - systematicCode := BitVec.ofNat 64 16413294704548134437 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10204060779103232 - maskLow := BitVec.ofNat 64 576478488371200279 - maskHigh := BitVec.ofNat 64 4503874505539585 - systematicCode := BitVec.ofNat 64 16847302609257250341 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9086956965282816 - maskLow := BitVec.ofNat 64 1125906349621527 - maskHigh := BitVec.ofNat 64 4503874639499297 - systematicCode := BitVec.ofNat 64 16847322547336003109 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10204073563341824 - maskLow := BitVec.ofNat 64 36048594671042839 - maskHigh := BitVec.ofNat 64 72061992084701185 - systematicCode := BitVec.ofNat 64 17426015127015144997 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9086969749521408 - maskLow := BitVec.ofNat 64 1125906349621527 - maskHigh := BitVec.ofNat 64 72061992092832257 - systematicCode := BitVec.ofNat 64 17426026303494307365 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2260647513703424 - maskLow := BitVec.ofNat 64 1125906349621527 - maskHigh := BitVec.ofNat 64 77264881107337217 - systematicCode := BitVec.ofNat 64 17431714382389460517 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2261197269255168 - maskLow := BitVec.ofNat 64 1125906349621527 - maskHigh := BitVec.ofNat 64 2305847716498112513 - systematicCode := BitVec.ofNat 64 18146636530899500581 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10203523841346560 - maskLow := BitVec.ofNat 64 5224175574192554263 - maskHigh := BitVec.ofNat 64 2305983746702311425 - systematicCode := BitVec.ofNat 64 18149405877796224549 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9086420027526144 - maskLow := BitVec.ofNat 64 1125906349621527 - maskHigh := BitVec.ofNat 64 2305983747918397441 - systematicCode := BitVec.ofNat 64 18149432516122263077 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x3e29. -/ -def normalizedWeightSixteenCandidateBucket_3e29 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10204060621875200 - maskLow := BitVec.ofNat 64 4611688258253947159 - maskHigh := BitVec.ofNat 64 563087393423361 - systematicCode := BitVec.ofNat 64 16414398518791650857 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9086956808054784 - maskLow := BitVec.ofNat 64 4503606070935831 - maskHigh := BitVec.ofNat 64 563088466117129 - systematicCode := BitVec.ofNat 64 16414420604388130345 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10204060623045632 - maskLow := BitVec.ofNat 64 2305847448063508759 - maskHigh := BitVec.ofNat 64 1126174785798145 - systematicCode := BitVec.ofNat 64 16559076648264547881 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9086956809225216 - maskLow := BitVec.ofNat 64 4503606070935831 - maskHigh := BitVec.ofNat 64 1126175321621513 - systematicCode := BitVec.ofNat 64 16559096551984086569 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10204073507161088 - maskLow := BitVec.ofNat 64 36035400532295959 - maskHigh := BitVec.ofNat 64 72075186225020929 - systematicCode := BitVec.ofNat 64 17427145424901389865 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9086969693340672 - maskLow := BitVec.ofNat 64 4503606070935831 - maskHigh := BitVec.ofNat 64 72075186232362497 - systematicCode := BitVec.ofNat 64 17427152186221542953 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2260647482491904 - maskLow := BitVec.ofNat 64 4503606070935831 - maskHigh := BitVec.ofNat 64 73887181387595777 - systematicCode := BitVec.ofNat 64 17430588482549988905 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2261197204751360 - maskLow := BitVec.ofNat 64 4503606070935831 - maskHigh := BitVec.ofNat 64 576478756807376897 - systematicCode := BitVec.ofNat 64 17859532071901871657 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10203523785165824 - maskLow := BitVec.ofNat 64 6953557831103611159 - maskHigh := BitVec.ofNat 64 576601489792827393 - systematicCode := BitVec.ofNat 64 17861179899758132777 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9086419971345408 - maskLow := BitVec.ofNat 64 4503606070935831 - maskHigh := BitVec.ofNat 64 576601491410780161 - systematicCode := BitVec.ofNat 64 17861202157150682665 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x3e2f. -/ -def normalizedWeightSixteenCandidateBucket_3e2f : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9025376263883904 - maskLow := BitVec.ofNat 64 36028803469869335 - maskHigh := BitVec.ofNat 64 72081783302127617 - systematicCode := BitVec.ofNat 64 17427195338228121135 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 45123996431961216 - maskLow := BitVec.ofNat 64 36028803469869335 - maskHigh := BitVec.ofNat 64 72198331527725057 - systematicCode := BitVec.ofNat 64 17428834508000345647 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11610882017348736 - maskLow := BitVec.ofNat 64 6192455938539799 - maskHigh := BitVec.ofNat 64 72198331534671873 - systematicCode := BitVec.ofNat 64 17428840846331100719 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 45124546154220672 - maskLow := BitVec.ofNat 64 36028803469869335 - maskHigh := BitVec.ofNat 64 576478344490516577 - systematicCode := BitVec.ofNat 64 17859491118885781039 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11611431739608192 - maskLow := BitVec.ofNat 64 4504018395136279 - maskHigh := BitVec.ofNat 64 576478344497856513 - systematicCode := BitVec.ofNat 64 17859497560294178351 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 45124546254097536 - maskLow := BitVec.ofNat 64 36028803469869335 - maskHigh := BitVec.ofNat 64 2305847407260467273 - systematicCode := BitVec.ofNat 64 18146591197017030191 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11611431839485056 - maskLow := BitVec.ofNat 64 1126215595393303 - maskHigh := BitVec.ofNat 64 2305847407268593665 - systematicCode := BitVec.ofNat 64 18146602019358916143 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 45124546254487680 - maskLow := BitVec.ofNat 64 36028803469869335 - maskHigh := BitVec.ofNat 64 4611688217450774569 - systematicCode := BitVec.ofNat 64 18290141227526274607 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11611431839875200 - maskLow := BitVec.ofNat 64 563128203018519 - maskHigh := BitVec.ofNat 64 4611688217459032065 - systematicCode := BitVec.ofNat 64 18290154248857861679 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9024826474251392 - maskLow := BitVec.ofNat 64 36028803469869335 - maskHigh := BitVec.ofNat 64 7494130517441249281 - systematicCode := BitVec.ofNat 64 18301494050826370607 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x3e31. -/ -def normalizedWeightSixteenCandidateBucket_3e31 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10204053430740992 - maskLow := BitVec.ofNat 64 4611686196685373719 - maskHigh := BitVec.ofNat 64 565148993454081 - systematicCode := BitVec.ofNat 64 16416659114564140593 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9086949616920576 - maskLow := BitVec.ofNat 64 72057600497221911 - maskHigh := BitVec.ofNat 64 565150050418729 - systematicCode := BitVec.ofNat 64 16416672369842601521 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10204053431911424 - maskLow := BitVec.ofNat 64 2305843324910633239 - maskHigh := BitVec.ofNat 64 1130297970130945 - systematicCode := BitVec.ofNat 64 16561337244037037617 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9086949618091008 - maskLow := BitVec.ofNat 64 72057600497221911 - maskHigh := BitVec.ofNat 64 1130298490224713 - systematicCode := BitVec.ofNat 64 16561348317438557745 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10204053531788288 - maskLow := BitVec.ofNat 64 576461171079577879 - maskHigh := BitVec.ofNat 64 4521191830192129 - systematicCode := BitVec.ofNat 64 16850693502915984945 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9086949717967872 - maskLow := BitVec.ofNat 64 72057600497221911 - maskHigh := BitVec.ofNat 64 4521191947632737 - systematicCode := BitVec.ofNat 64 16850700195517709873 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2260634964591616 - maskLow := BitVec.ofNat 64 72057600497221911 - maskHigh := BitVec.ofNat 64 6333186992766977 - systematicCode := BitVec.ofNat 64 16854127730381307441 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2261180425438208 - maskLow := BitVec.ofNat 64 72057600497221911 - maskHigh := BitVec.ofNat 64 36052986291552257 - systematicCode := BitVec.ofNat 64 17283080150185950769 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10203508071205888 - maskLow := BitVec.ofNat 64 7493989786403799319 - maskHigh := BitVec.ofNat 64 36169534524096513 - systematicCode := BitVec.ofNat 64 17284727943548255793 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9086404257385472 - maskLow := BitVec.ofNat 64 72057600497221911 - maskHigh := BitVec.ofNat 64 36169536252149761 - systematicCode := BitVec.ofNat 64 17284741404982001201 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x3e37. -/ -def normalizedWeightSixteenCandidateBucket_3e37 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9025397304609920 - maskLow := BitVec.ofNat 64 576460758880157975 - maskHigh := BitVec.ofNat 64 4521604264493057 - systematicCode := BitVec.ofNat 64 16850725755606679095 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 45123996165622912 - maskLow := BitVec.ofNat 64 576460758880157975 - maskHigh := BitVec.ofNat 64 4644337132896257 - systematicCode := BitVec.ofNat 64 16852382551790468663 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11610881751010432 - maskLow := BitVec.ofNat 64 73746450474926359 - maskHigh := BitVec.ofNat 64 4644337249943553 - systematicCode := BitVec.ofNat 64 16852388924480437815 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 45124541626469504 - maskLow := BitVec.ofNat 64 576460758880157975 - maskHigh := BitVec.ofNat 64 36046389221787137 - systematicCode := BitVec.ofNat 64 17283039197169860151 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11611427211857024 - maskLow := BitVec.ofNat 64 72064197684429079 - maskHigh := BitVec.ofNat 64 36046389339226113 - systematicCode := BitVec.ofNat 64 17283045638578257463 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 45124554510584960 - maskLow := BitVec.ofNat 64 576460758880157975 - maskHigh := BitVec.ofNat 64 2305843284091864073 - systematicCode := BitVec.ofNat 64 18144339431563607607 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11611440095972480 - maskLow := BitVec.ofNat 64 1130338889826583 - maskHigh := BitVec.ofNat 64 2305843284225818625 - systematicCode := BitVec.ofNat 64 18144359015772470839 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 45124554510975104 - maskLow := BitVec.ofNat 64 576460758880157975 - maskHigh := BitVec.ofNat 64 4611686155866472969 - systematicCode := BitVec.ofNat 64 18287889462072852023 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11611440096362624 - maskLow := BitVec.ofNat 64 565189913149719 - maskHigh := BitVec.ofNat 64 4611686156000559105 - systematicCode := BitVec.ofNat 64 18287911245271416375 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9024843253564544 - maskLow := BitVec.ofNat 64 576460758880157975 - maskHigh := BitVec.ofNat 64 6953698562282618881 - systematicCode := BitVec.ofNat 64 18301485254868090423 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x3e3b. -/ -def normalizedWeightSixteenCandidateBucket_3e3b : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9025397402406016 - maskLow := BitVec.ofNat 64 2305843016193081623 - maskHigh := BitVec.ofNat 64 1130607727869953 - systematicCode := BitVec.ofNat 64 16561369462435626555 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 45123996230126720 - maskLow := BitVec.ofNat 64 2305843016193081623 - maskHigh := BitVec.ofNat 64 1266637413154817 - systematicCode := BitVec.ofNat 64 16564152192818888251 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11610881815514240 - maskLow := BitVec.ofNat 64 77124150598107415 - maskHigh := BitVec.ofNat 64 1266637932068865 - systematicCode := BitVec.ofNat 64 16564162946442346043 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 45124541690973312 - maskLow := BitVec.ofNat 64 2305843016193081623 - maskHigh := BitVec.ofNat 64 36033195082256897 - systematicCode := BitVec.ofNat 64 17281913314443148859 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11611427276360832 - maskLow := BitVec.ofNat 64 72077392226615575 - maskHigh := BitVec.ofNat 64 36033195602345985 - systematicCode := BitVec.ofNat 64 17281924136785034811 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 45124554475211904 - maskLow := BitVec.ofNat 64 2305843016193081623 - maskHigh := BitVec.ofNat 64 576461027182383137 - systematicCode := BitVec.ofNat 64 17856113470705647163 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11611440060599424 - maskLow := BitVec.ofNat 64 4521336231756055 - maskHigh := BitVec.ofNat 64 576461027718201345 - systematicCode := BitVec.ofNat 64 17856133054914510395 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 45124554525540480 - maskLow := BitVec.ofNat 64 2305843016193081623 - maskHigh := BitVec.ofNat 64 4611686052787257889 - systematicCode := BitVec.ofNat 64 18286763562233380411 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11611440110928000 - maskLow := BitVec.ofNat 64 565293395018007 - maskHigh := BitVec.ofNat 64 4611686053323997185 - systematicCode := BitVec.ofNat 64 18286789743411347003 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9024843318068352 - maskLow := BitVec.ofNat 64 2305843016193081623 - maskHigh := BitVec.ofNat 64 5224316305775001601 - systematicCode := BitVec.ofNat 64 18300359355028618811 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x3e3d. -/ -def normalizedWeightSixteenCandidateBucket_3e3d : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9025397402779904 - maskLow := BitVec.ofNat 64 4611686025943646487 - maskHigh := BitVec.ofNat 64 565321849110529 - systematicCode := BitVec.ofNat 64 16416689125416779325 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 45123996230240512 - maskLow := BitVec.ofNat 64 4611686025943646487 - maskHigh := BitVec.ofNat 64 703687459864577 - systematicCode := BitVec.ofNat 64 16420037004776717885 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11610881815628032 - maskLow := BitVec.ofNat 64 77687101088399639 - maskHigh := BitVec.ofNat 64 703688515518465 - systematicCode := BitVec.ofNat 64 16420049957389876797 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 45124541691087104 - maskLow := BitVec.ofNat 64 4611686025943646487 - maskHigh := BitVec.ofNat 64 36030996059001857 - systematicCode := BitVec.ofNat 64 17281350364523413053 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11611427276474624 - maskLow := BitVec.ofNat 64 72079591786742039 - maskHigh := BitVec.ofNat 64 36030997115961345 - systematicCode := BitVec.ofNat 64 17281363385855000125 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 45124554475325696 - maskLow := BitVec.ofNat 64 4611686025943646487 - maskHigh := BitVec.ofNat 64 576460889743429697 - systematicCode := BitVec.ofNat 64 17855550520785911357 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11611440060713216 - maskLow := BitVec.ofNat 64 4521474207580439 - maskHigh := BitVec.ofNat 64 576460890816118785 - systematicCode := BitVec.ofNat 64 17855572303984475709 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 45124554525264128 - maskLow := BitVec.ofNat 64 4611686025943646487 - maskHigh := BitVec.ofNat 64 2305843043573695553 - systematicCode := BitVec.ofNat 64 18142650581804400189 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11611440110651648 - maskLow := BitVec.ofNat 64 1130580347519255 - maskHigh := BitVec.ofNat 64 2305843044647174145 - systematicCode := BitVec.ofNat 64 18142676762982366781 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9024843318182144 - maskLow := BitVec.ofNat 64 4611686025943646487 - maskHigh := BitVec.ofNat 64 2918473297098178561 - systematicCode := BitVec.ofNat 64 18156244166986448445 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x4543. -/ -def normalizedWeightSixteenCandidateBucket_4543 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .d16Plus - affineCode := BitVec.ofNat 56 54327438755274880 - maskLow := BitVec.ofNat 64 282673272652055 - maskHigh := BitVec.ofNat 64 9223372043297226753 - systematicCode := BitVec.ofNat 64 18357163980835341635 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9013804931285248 - maskLow := BitVec.ofNat 64 1152921534671683863 - maskHigh := BitVec.ofNat 64 2261152104972289 - systematicCode := BitVec.ofNat 64 16633709605275911491 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9084723431540992 - maskLow := BitVec.ofNat 64 1152921534671683863 - maskHigh := BitVec.ofNat 64 2269392018079745 - systematicCode := BitVec.ofNat 64 16634520937080374595 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36033753428066560 - maskLow := BitVec.ofNat 64 612771054363934999 - maskHigh := BitVec.ofNat 64 2269394147213313 - systematicCode := BitVec.ofNat 64 16634537214048552259 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9083087049001216 - maskLow := BitVec.ofNat 64 1152921534671683863 - maskHigh := BitVec.ofNat 64 4512395737176065 - systematicCode := BitVec.ofNat 64 16849849225276114243 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36034298888913152 - maskLow := BitVec.ofNat 64 576602619368243479 - maskHigh := BitVec.ofNat 64 4512397867876353 - systematicCode := BitVec.ofNat 64 16849865570962720067 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9083067872643328 - maskLow := BitVec.ofNat 64 1152921534671683863 - maskHigh := BitVec.ofNat 64 72058143794794625 - systematicCode := BitVec.ofNat 64 17424049381538612547 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36034296758206720 - maskLow := BitVec.ofNat 64 36169633291632919 - maskHigh := BitVec.ofNat 64 72058145941225473 - systematicCode := BitVec.ofNat 64 17424074489092195651 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9084173675462912 - maskLow := BitVec.ofNat 64 1152921534671683863 - maskHigh := BitVec.ofNat 64 9223372041150269569 - systematicCode := BitVec.ofNat 64 18357137825527842115 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9014359015885056 - maskLow := BitVec.ofNat 64 1152921534671683863 - maskHigh := BitVec.ofNat 64 9299950824853602305 - systematicCode := BitVec.ofNat 64 18370721476450534723 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x4643. -/ -def normalizedWeightSixteenCandidateBucket_4643 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .d16Plus - affineCode := BitVec.ofNat 56 54327438755266688 - maskLow := BitVec.ofNat 64 565333660336407 - maskHigh := BitVec.ofNat 64 4611686029164806145 - systematicCode := BitVec.ofNat 64 18285387866085934659 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2258405490198656 - maskLow := BitVec.ofNat 64 2305843056458400023 - maskHigh := BitVec.ofNat 64 1130583568678913 - systematicCode := BitVec.ofNat 64 16561369441044678211 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9084723431506560 - maskLow := BitVec.ofNat 64 2305843056458400023 - maskHigh := BitVec.ofNat 64 1161084297281537 - systematicCode := BitVec.ofNat 64 16562744818019223107 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36033341111175296 - maskLow := BitVec.ofNat 64 306807771859321111 - maskHigh := BitVec.ofNat 64 1161086426415105 - systematicCode := BitVec.ofNat 64 16562761090675656259 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9083087048966784 - maskLow := BitVec.ofNat 64 2305843056458400023 - maskHigh := BitVec.ofNat 64 9011597318035457 - systematicCode := BitVec.ofNat 64 16921625344337397315 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36034295667656832 - maskLow := BitVec.ofNat 64 288302991163851031 - maskHigh := BitVec.ofNat 64 9011599448735745 - systematicCode := BitVec.ofNat 64 16921641685712258627 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9083067872608896 - maskLow := BitVec.ofNat 64 2305843056458400023 - maskHigh := BitVec.ofNat 64 144115462954815617 - systematicCode := BitVec.ofNat 64 17495825500599895619 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36034296733010048 - maskLow := BitVec.ofNat 64 18084951937319191 - maskHigh := BitVec.ofNat 64 144115465101246465 - systematicCode := BitVec.ofNat 64 17495850603841734211 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2328774234374272 - maskLow := BitVec.ofNat 64 2305843056458400023 - maskHigh := BitVec.ofNat 64 4611686027017848961 - systematicCode := BitVec.ofNat 64 18285361706466690627 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9014359015852672 - maskLow := BitVec.ofNat 64 2305843056458400023 - maskHigh := BitVec.ofNat 64 4764843592277557249 - systematicCode := BitVec.ofNat 64 18298946461195978307 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x4645. -/ -def normalizedWeightSixteenCandidateBucket_4645 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .d16Plus - affineCode := BitVec.ofNat 56 54327438754210048 - maskLow := BitVec.ofNat 64 1130628665901335 - maskHigh := BitVec.ofNat 64 2305843028541046785 - systematicCode := BitVec.ofNat 64 18141835636587120197 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2258405490442496 - maskLow := BitVec.ofNat 64 4611686074262028567 - maskHigh := BitVec.ofNat 64 565305742983169 - systematicCode := BitVec.ofNat 64 16416689112582211141 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9084723431295232 - maskLow := BitVec.ofNat 64 4611686074262028567 - maskHigh := BitVec.ofNat 64 633318715949057 - systematicCode := BitVec.ofNat 64 16419192579896919621 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36033341111419136 - maskLow := BitVec.ofNat 64 154248343072080151 - maskHigh := BitVec.ofNat 64 633320845082625 - systematicCode := BitVec.ofNat 64 16419208843929863749 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9083087048755456 - maskLow := BitVec.ofNat 64 4611686074262028567 - maskHigh := BitVec.ofNat 64 18016597549520897 - systematicCode := BitVec.ofNat 64 17065177582459962949 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36034295667900672 - maskLow := BitVec.ofNat 64 144154826329096471 - maskHigh := BitVec.ofNat 64 18016599680221185 - systematicCode := BitVec.ofNat 64 17065193915211335237 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9083067872397568 - maskLow := BitVec.ofNat 64 4611686074262028567 - maskHigh := BitVec.ofNat 64 288230513591718017 - systematicCode := BitVec.ofNat 64 17639377738722461253 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36034296733253888 - maskLow := BitVec.ofNat 64 9042714339377431 - maskHigh := BitVec.ofNat 64 288230515738148865 - systematicCode := BitVec.ofNat 64 17639402833340810821 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2328774234358016 - maskLow := BitVec.ofNat 64 4611686074262028567 - maskHigh := BitVec.ofNat 64 2305843026394089601 - systematicCode := BitVec.ofNat 64 18141809468344387141 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9014359015901440 - maskLow := BitVec.ofNat 64 4611686074262028567 - maskHigh := BitVec.ofNat 64 2612158154766548993 - systematicCode := BitVec.ofNat 64 18155396430686864965 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x4943. -/ -def normalizedWeightSixteenCandidateBucket_4943 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9083087073970432 - maskLow := BitVec.ofNat 64 288230457756156183 - maskHigh := BitVec.ofNat 64 1161084295717889 - systematicCode := BitVec.ofNat 64 16562744761865554243 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36034298880590080 - maskLow := BitVec.ofNat 64 2305984927818121495 - maskHigh := BitVec.ofNat 64 1161086426415105 - systematicCode := BitVec.ofNat 64 16562761111897721155 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9084723456510208 - maskLow := BitVec.ofNat 64 288230457756156183 - maskHigh := BitVec.ofNat 64 9011597320388609 - systematicCode := BitVec.ofNat 64 16921625426159552835 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36033753419743488 - maskLow := BitVec.ofNat 64 2342153362813813015 - maskHigh := BitVec.ofNat 64 9011599448735745 - systematicCode := BitVec.ofNat 64 16921641707473291587 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9013804922962176 - maskLow := BitVec.ofNat 64 288230457756156183 - maskHigh := BitVec.ofNat 64 9042939825094657 - systematicCode := BitVec.ofNat 64 16923065881334204739 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9083067747797248 - maskLow := BitVec.ofNat 64 288230457756156183 - maskHigh := BitVec.ofNat 64 72058143794005121 - systematicCode := BitVec.ofNat 64 17424044966311971139 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9084173667139840 - maskLow := BitVec.ofNat 64 288230457756156183 - maskHigh := BitVec.ofNat 64 9223372041151848577 - systematicCode := BitVec.ofNat 64 18357142240753961283 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9014359007561984 - maskLow := BitVec.ofNat 64 288230457756156183 - maskHigh := BitVec.ofNat 64 9296559930993541121 - systematicCode := BitVec.ofNat 64 18370717061223893315 }) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x4945. -/ -def normalizedWeightSixteenCandidateBucket_4945 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9083087074132992 - maskLow := BitVec.ofNat 64 144115278270234903 - maskHigh := BitVec.ofNat 64 633318714393089 - systematicCode := BitVec.ofNat 64 16419192532299368773 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36034298880492544 - maskLow := BitVec.ofNat 64 4611827945621750039 - maskHigh := BitVec.ofNat 64 633320845082625 - systematicCode := BitVec.ofNat 64 16419208882365221189 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9084723456672768 - maskLow := BitVec.ofNat 64 144115278270234903 - maskHigh := BitVec.ofNat 64 18016597553840129 - systematicCode := BitVec.ofNat 64 17065177672838236485 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36033753419645952 - maskLow := BitVec.ofNat 64 4647996380617441559 - maskHigh := BitVec.ofNat 64 18016599680221185 - systematicCode := BitVec.ofNat 64 17065193954185660741 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9013804922864640 - maskLow := BitVec.ofNat 64 144115278270234903 - maskHigh := BitVec.ofNat 64 18085323451924481 - systematicCode := BitVec.ofNat 64 17067744019363350853 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9083067746789376 - maskLow := BitVec.ofNat 64 144115278270234903 - maskHigh := BitVec.ofNat 64 72058143793873537 - systematicCode := BitVec.ofNat 64 17424042758698649925 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9084173667042304 - maskLow := BitVec.ofNat 64 144115278270234903 - maskHigh := BitVec.ofNat 64 9223372041153953921 - systematicCode := BitVec.ofNat 64 18357144448367020357 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9014359007464448 - maskLow := BitVec.ofNat 64 144115278270234903 - maskHigh := BitVec.ofNat 64 9295994782016864257 - systematicCode := BitVec.ofNat 64 18370714853610572101 }) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x4a43. -/ -def normalizedWeightSixteenCandidateBucket_4a43 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9083087069774464 - maskLow := BitVec.ofNat 64 576460902627344663 - maskHigh := BitVec.ofNat 64 2269392016516097 - systematicCode := BitVec.ofNat 64 16634520880926837315 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36034295655172224 - maskLow := BitVec.ofNat 64 1152994222698201367 - maskHigh := BitVec.ofNat 64 2269394147213313 - systematicCode := BitVec.ofNat 64 16634537226647259715 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9084723452314240 - maskLow := BitVec.ofNat 64 576460902627344663 - maskHigh := BitVec.ofNat 64 4512395739529217 - systematicCode := BitVec.ofNat 64 16849849307098401347 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36033341098690688 - maskLow := BitVec.ofNat 64 1171499003393671447 - maskHigh := BitVec.ofNat 64 4512397867876353 - systematicCode := BitVec.ofNat 64 16849865584100395587 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2258405477714048 - maskLow := BitVec.ofNat 64 576460902627344663 - maskHigh := BitVec.ofNat 64 4521477428740097 - systematicCode := BitVec.ofNat 64 16850725717102971459 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9083067743601280 - maskLow := BitVec.ofNat 64 576460902627344663 - maskHigh := BitVec.ofNat 64 144115462954026113 - systematicCode := BitVec.ofNat 64 17495821085373254211 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2328774221889664 - maskLow := BitVec.ofNat 64 576460902627344663 - maskHigh := BitVec.ofNat 64 4611686027019427969 - systematicCode := BitVec.ofNat 64 18285366121692809795 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9014359003368064 - maskLow := BitVec.ofNat 64 576460902627344663 - maskHigh := BitVec.ofNat 64 4758061804557434881 - systematicCode := BitVec.ofNat 64 18298942045969336899 }) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x4a46. -/ -def normalizedWeightSixteenCandidateBucket_4a46 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9641137837058048 - maskLow := BitVec.ofNat 64 144115364169580823 - maskHigh := BitVec.ofNat 64 633318714409217 - systematicCode := BitVec.ofNat 64 16419192536577559110 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11264020256811008 - maskLow := BitVec.ofNat 64 4611758762288546071 - maskHigh := BitVec.ofNat 64 633320845082625 - systematicCode := BitVec.ofNat 64 16419208882348509766 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9640694650120192 - maskLow := BitVec.ofNat 64 144115364169580823 - maskHigh := BitVec.ofNat 64 18016597557968897 - systematicCode := BitVec.ofNat 64 17065177677116426822 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11263986165508096 - maskLow := BitVec.ofNat 64 4630263542984016151 - maskHigh := BitVec.ofNat 64 18016599680221185 - systematicCode := BitVec.ofNat 64 17065193954168949318 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9575239384459264 - maskLow := BitVec.ofNat 64 144115364169580823 - maskHigh := BitVec.ofNat 64 18085052868984833 - systematicCode := BitVec.ofNat 64 17067742924146690630 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9641210046195712 - maskLow := BitVec.ofNat 64 144115364169580823 - maskHigh := BitVec.ofNat 64 144115462953828737 - systematicCode := BitVec.ofNat 64 17495817773953272390 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9922685058826368 - maskLow := BitVec.ofNat 64 144115364169580823 - maskHigh := BitVec.ofNat 64 4611686027025744001 - systematicCode := BitVec.ofNat 64 18285369433112398406 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9574719925919872 - maskLow := BitVec.ofNat 64 144115364169580823 - maskHigh := BitVec.ofNat 64 4756366357627404289 - systematicCode := BitVec.ofNat 64 18298938734549355078 }) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x4a49. -/ -def normalizedWeightSixteenCandidateBucket_4a49 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .d16Plus - affineCode := BitVec.ofNat 56 54327438614798592 - maskLow := BitVec.ofNat 64 4521677144785175 - maskHigh := BitVec.ofNat 64 576460823170383873 - systematicCode := BitVec.ofNat 64 17854731177589230153 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2258405509169408 - maskLow := BitVec.ofNat 64 4611686228880851223 - maskHigh := BitVec.ofNat 64 565254203375617 - systematicCode := BitVec.ofNat 64 16416685826932230729 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9084723425052928 - maskLow := BitVec.ofNat 64 4611686228880851223 - maskHigh := BitVec.ofNat 64 633318716735489 - systematicCode := BitVec.ofNat 64 16419192592731490889 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36033341130146048 - maskLow := BitVec.ofNat 64 150870797970374935 - maskHigh := BitVec.ofNat 64 633320845082625 - systematicCode := BitVec.ofNat 64 16419208843879729737 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9083087042513152 - maskLow := BitVec.ofNat 64 4611686228880851223 - maskHigh := BitVec.ofNat 64 18016597549523969 - systematicCode := BitVec.ofNat 64 17065177595294534217 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36034295686627584 - maskLow := BitVec.ofNat 64 144141786808385815 - maskHigh := BitVec.ofNat 64 18016599680221185 - systematicCode := BitVec.ofNat 64 17065193915161201225 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2328774219792640 - maskLow := BitVec.ofNat 64 4611686228880851223 - maskHigh := BitVec.ofNat 64 576460821025005697 - systematicCode := BitVec.ofNat 64 17854709407325899337 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9083067716339968 - maskLow := BitVec.ofNat 64 4611686228880851223 - maskHigh := BitVec.ofNat 64 1152921538966848641 - systematicCode := BitVec.ofNat 64 17926477799740951113 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36034296760303872 - maskLow := BitVec.ofNat 64 2261081238077719 - maskHigh := BitVec.ofNat 64 1152921541114068993 - systematicCode := BitVec.ofNat 64 17926507292338702921 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9014359009659136 - maskLow := BitVec.ofNat 64 4611686228880851223 - maskHigh := BitVec.ofNat 64 1747467026311413761 - systematicCode := BitVec.ofNat 64 17940068073503214153 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x4c45. -/ -def normalizedWeightSixteenCandidateBucket_4c45 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9083087069725696 - maskLow := BitVec.ofNat 64 576461048656232727 - maskHigh := BitVec.ofNat 64 2269392016523777 - systematicCode := BitVec.ofNat 64 16634520889483217989 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36034295655318528 - maskLow := BitVec.ofNat 64 1152961383378256151 - maskHigh := BitVec.ofNat 64 2269394147213313 - systematicCode := BitVec.ofNat 64 16634537226613836869 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9084723452265472 - maskLow := BitVec.ofNat 64 576461048656232727 - maskHigh := BitVec.ofNat 64 4512395741495297 - systematicCode := BitVec.ofNat 64 16849849315654782021 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36033341098836992 - maskLow := BitVec.ofNat 64 1163054900121239831 - maskHigh := BitVec.ofNat 64 4512397867876353 - systematicCode := BitVec.ofNat 64 16849865584066972741 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2258405477860352 - maskLow := BitVec.ofNat 64 576461048656232727 - maskHigh := BitVec.ofNat 64 4521348579721217 - systematicCode := BitVec.ofNat 64 16850723526669651013 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9083067742382080 - maskLow := BitVec.ofNat 64 576461048656232727 - maskHigh := BitVec.ofNat 64 288230513590796929 - systematicCode := BitVec.ofNat 64 17639371115882499141 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2328774221775872 - maskLow := BitVec.ofNat 64 576461048656232727 - maskHigh := BitVec.ofNat 64 2305843026397773953 - systematicCode := BitVec.ofNat 64 18141816091183565893 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9014359003319296 - maskLow := BitVec.ofNat 64 576461048656232727 - maskHigh := BitVec.ofNat 64 2596333983419596801 - systematicCode := BitVec.ofNat 64 18155389807846902853 }) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x4c46. -/ -def normalizedWeightSixteenCandidateBucket_4c46 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9641137838228480 - maskLow := BitVec.ofNat 64 288230689684390167 - maskHigh := BitVec.ofNat 64 1161084295741697 - systematicCode := BitVec.ofNat 64 16562744774700125254 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11264020257705088 - maskLow := BitVec.ofNat 64 2305882905164972311 - maskHigh := BitVec.ofNat 64 1161086426415105 - systematicCode := BitVec.ofNat 64 16562761111847586886 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9640694651290624 - maskLow := BitVec.ofNat 64 288230689684390167 - maskHigh := BitVec.ofNat 64 9011597326483457 - systematicCode := BitVec.ofNat 64 16921625438994123846 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11263986166402176 - maskLow := BitVec.ofNat 64 2315976421907955991 - maskHigh := BitVec.ofNat 64 9011599448735745 - systematicCode := BitVec.ofNat 64 16921641707423157318 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9575239385353344 - maskLow := BitVec.ofNat 64 288230689684390167 - maskHigh := BitVec.ofNat 64 9042540393136129 - systematicCode := BitVec.ofNat 64 16923062595684224070 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9641210047366144 - maskLow := BitVec.ofNat 64 288230689684390167 - maskHigh := BitVec.ofNat 64 288230513590731137 - systematicCode := BitVec.ofNat 64 17639370012075838534 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9922685058436224 - maskLow := BitVec.ofNat 64 288230689684390167 - maskHigh := BitVec.ofNat 64 2305843026401984641 - systematicCode := BitVec.ofNat 64 18141817194990095430 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9574719926846464 - maskLow := BitVec.ofNat 64 288230689684390167 - maskHigh := BitVec.ofNat 64 2595203685466243073 - systematicCode := BitVec.ofNat 64 18155388704040242246 }) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x4c49. -/ -def normalizedWeightSixteenCandidateBucket_4c49 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2258405509071872 - maskLow := BitVec.ofNat 64 2305843357106110743 - maskHigh := BitVec.ofNat 64 1130403180052481 - systematicCode := BitVec.ofNat 64 16561363964961377353 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9084723425215488 - maskLow := BitVec.ofNat 64 2305843357106110743 - maskHigh := BitVec.ofNat 64 1161084300034049 - systematicCode := BitVec.ofNat 64 16562744839410175049 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36033341130048512 - maskLow := BitVec.ofNat 64 294986123485184279 - maskHigh := BitVec.ofNat 64 1161086426415105 - systematicCode := BitVec.ofNat 64 16562761090592099401 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9083087042675712 - maskLow := BitVec.ofNat 64 2305843357106110743 - maskHigh := BitVec.ofNat 64 9011597318046209 - systematicCode := BitVec.ofNat 64 16921625365728349257 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36034295686530048 - maskLow := BitVec.ofNat 64 288257112323195159 - maskHigh := BitVec.ofNat 64 9011599448735745 - systematicCode := BitVec.ofNat 64 16921641685628701769 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2328774219695104 - maskLow := BitVec.ofNat 64 2305843357106110743 - maskHigh := BitVec.ofNat 64 576460821027111041 - systematicCode := BitVec.ofNat 64 17854711614938958921 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9083067715332096 - maskLow := BitVec.ofNat 64 2305843357106110743 - maskHigh := BitVec.ofNat 64 1152921538966717057 - systematicCode := BitVec.ofNat 64 17926475592127630409 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9014359009561600 - maskLow := BitVec.ofNat 64 2305843357106110743 - maskHigh := BitVec.ofNat 64 1738424642684583937 - systematicCode := BitVec.ofNat 64 17940065865889893449 }) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x4c4a. -/ -def normalizedWeightSixteenCandidateBucket_4c4a : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9575239449857152 - maskLow := BitVec.ofNat 64 1152921921218740503 - maskHigh := BitVec.ofNat 64 2260701133406209 - systematicCode := BitVec.ofNat 64 16633703033975950410 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9640694751167488 - maskLow := BitVec.ofNat 64 1152921921218740503 - maskHigh := BitVec.ofNat 64 2269392024961025 - systematicCode := BitVec.ofNat 64 16634520962749516874 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11263986230905984 - maskLow := BitVec.ofNat 64 583216568356372759 - maskHigh := BitVec.ofNat 64 2269394147213313 - systematicCode := BitVec.ofNat 64 16634537213948283978 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9641137938105344 - maskLow := BitVec.ofNat 64 1152921921218740503 - maskHigh := BitVec.ofNat 64 4512395737202945 - systematicCode := BitVec.ofNat 64 16849849250945256522 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11264020322208896 - maskLow := BitVec.ofNat 64 576487557194383639 - maskHigh := BitVec.ofNat 64 4512397867876353 - systematicCode := BitVec.ofNat 64 16849865570862451786 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9922684958559360 - maskLow := BitVec.ofNat 64 1152921921218740503 - maskHigh := BitVec.ofNat 64 576460821031321729 - systematicCode := BitVec.ofNat 64 17854712718745488458 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9641210147243008 - maskLow := BitVec.ofNat 64 1152921921218740503 - maskHigh := BitVec.ofNat 64 1152921538966651265 - systematicCode := BitVec.ofNat 64 17926474488320969802 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9574719995511808 - maskLow := BitVec.ofNat 64 1152921921218740503 - maskHigh := BitVec.ofNat 64 1733903450871169025 - systematicCode := BitVec.ofNat 64 17940064762083232842 }) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x5143. -/ -def normalizedWeightSixteenCandidateBucket_5143 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9083071093672192 - maskLow := BitVec.ofNat 64 18015510906077463 - maskHigh := BitVec.ofNat 64 1161084279988289 - systematicCode := BitVec.ofNat 64 16562735965637792067 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9083070943856896 - maskLow := BitVec.ofNat 64 18015510906077463 - maskHigh := BitVec.ofNat 64 4512395720656961 - systematicCode := BitVec.ofNat 64 16849836026656280899 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9084720260450560 - maskLow := BitVec.ofNat 64 18015510906077463 - maskHigh := BitVec.ofNat 64 144115462988627969 - systematicCode := BitVec.ofNat 64 17495837664298750275 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36033745962270976 - maskLow := BitVec.ofNat 64 2882586348890423575 - maskHigh := BitVec.ofNat 64 144115465101246465 - systematicCode := BitVec.ofNat 64 17495850660097249603 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9013797465489664 - maskLow := BitVec.ofNat 64 18015510906077463 - maskHigh := BitVec.ofNat 64 144159174983417857 - systematicCode := BitVec.ofNat 64 17499535429730128195 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9084166209667328 - maskLow := BitVec.ofNat 64 18015510906077463 - maskHigh := BitVec.ofNat 64 9223372041183307777 - systematicCode := BitVec.ofNat 64 18357151036980678979 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9014351550089472 - maskLow := BitVec.ofNat 64 18015510906077463 - maskHigh := BitVec.ofNat 64 9229001813414379521 - systematicCode := BitVec.ofNat 64 18368465227049947459 }) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x5145. -/ -def normalizedWeightSixteenCandidateBucket_5145 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9083071093834752 - maskLow := BitVec.ofNat 64 9008320241271063 - maskHigh := BitVec.ofNat 64 633318698663969 - systematicCode := BitVec.ofNat 64 16419183736071606597 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9083070942849024 - maskLow := BitVec.ofNat 64 9008320241271063 - maskHigh := BitVec.ofNat 64 4512395720525857 - systematicCode := BitVec.ofNat 64 16849833827599339845 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9084720260613120 - maskLow := BitVec.ofNat 64 9008320241271063 - maskHigh := BitVec.ofNat 64 288230513658953729 - systematicCode := BitVec.ofNat 64 17639392101410754885 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36033745962173440 - maskLow := BitVec.ofNat 64 5188429366694052119 - maskHigh := BitVec.ofNat 64 288230515738148865 - systematicCode := BitVec.ofNat 64 17639402906809618757 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9013797465392128 - maskLow := BitVec.ofNat 64 9008320241271063 - maskHigh := BitVec.ofNat 64 288309547431362561 - systematicCode := BitVec.ofNat 64 17644213567759274309 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9084166209569792 - maskLow := BitVec.ofNat 64 9008320241271063 - maskHigh := BitVec.ofNat 64 9223372041216870401 - systematicCode := BitVec.ofNat 64 18357153244593738053 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9014351549991936 - maskLow := BitVec.ofNat 64 9008320241271063 - maskHigh := BitVec.ofNat 64 9228438726022004737 - systematicCode := BitVec.ofNat 64 18368463019436626245 }) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x5149. -/ -def normalizedWeightSixteenCandidateBucket_5149 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9083070964827136 - maskLow := BitVec.ofNat 64 2252972339822871 - maskHigh := BitVec.ofNat 64 633318697877513 - systematicCode := BitVec.ofNat 64 16419179337957724489 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9083070963656704 - maskLow := BitVec.ofNat 64 2252972339822871 - maskHigh := BitVec.ofNat 64 1161084279070729 - systematicCode := BitVec.ofNat 64 16562729368466968905 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9084720231482368 - maskLow := BitVec.ofNat 64 2252972339822871 - maskHigh := BitVec.ofNat 64 1152921539235414017 - systematicCode := BitVec.ofNat 64 17926500958522003785 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36033745899750400 - maskLow := BitVec.ofNat 64 6917811675143930135 - maskHigh := BitVec.ofNat 64 1152921541114068993 - systematicCode := BitVec.ofNat 64 17926507383121596745 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9013797402969088 - maskLow := BitVec.ofNat 64 2252972339822871 - maskHigh := BitVec.ofNat 64 1153027064165564417 - systematicCode := BitVec.ofNat 64 17932448341957235017 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9084166147146752 - maskLow := BitVec.ofNat 64 2252972339822871 - maskHigh := BitVec.ofNat 64 9223372041418203137 - systematicCode := BitVec.ofNat 64 18357157642707095881 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9014351487568896 - maskLow := BitVec.ofNat 64 2252972339822871 - maskHigh := BitVec.ofNat 64 9225060923222261761 - systematicCode := BitVec.ofNat 64 18367337102349652297 }) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x514f. -/ -def normalizedWeightSixteenCandidateBucket_514f : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9082658139285504 - maskLow := BitVec.ofNat 64 283128539185431 - maskHigh := BitVec.ofNat 64 144115462987317289 - systematicCode := BitVec.ofNat 64 17495837534945628495 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36034299148928000 - maskLow := BitVec.ofNat 64 18038042304512279 - maskHigh := BitVec.ofNat 64 144115465101246465 - systematicCode := BitVec.ofNat 64 17495850603758506319 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9082658140455936 - maskLow := BitVec.ofNat 64 283128539185431 - maskHigh := BitVec.ofNat 64 288230513657774153 - systematicCode := BitVec.ofNat 64 17639391980681253199 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36034299149025536 - maskLow := BitVec.ofNat 64 9028644026515735 - maskHigh := BitVec.ofNat 64 288230515738148865 - systematicCode := BitVec.ofNat 64 17639402833290875215 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9082658240332800 - maskLow := BitVec.ofNat 64 283128539185431 - maskHigh := BitVec.ofNat 64 1152921539235020897 - systematicCode := BitVec.ofNat 64 17926500855039742287 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36034299157348608 - maskLow := BitVec.ofNat 64 2260050445926679 - maskHigh := BitVec.ofNat 64 1152921541114068993 - systematicCode := BitVec.ofNat 64 17926507292288766287 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9011735411819520 - maskLow := BitVec.ofNat 64 283128539185431 - maskHigh := BitVec.ofNat 64 1585267075276865537 - systematicCode := BitVec.ofNat 64 17939230129676964175 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9082104155997184 - maskLow := BitVec.ofNat 64 283128539185431 - maskHigh := BitVec.ofNat 64 9223372041518841857 - systematicCode := BitVec.ofNat 64 18357157746188570959 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11263951871151104 - maskLow := BitVec.ofNat 64 29275051140382999 - maskHigh := BitVec.ofNat 64 9223372043297226753 - systematicCode := BitVec.ofNat 64 18357164032813125967 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9012289496419328 - maskLow := BitVec.ofNat 64 283128539185431 - maskHigh := BitVec.ofNat 64 9223372485678858241 - systematicCode := BitVec.ofNat 64 18360555314629136719 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x5243. -/ -def normalizedWeightSixteenCandidateBucket_5243 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9083070556799616 - maskLow := BitVec.ofNat 64 36031008927187223 - maskHigh := BitVec.ofNat 64 2269392000786497 - systematicCode := BitVec.ofNat 64 16634512084699075139 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9083070406984320 - maskLow := BitVec.ofNat 64 36031008927187223 - maskHigh := BitVec.ofNat 64 9011597301516353 - systematicCode := BitVec.ofNat 64 16921612145717563971 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9084719723577984 - maskLow := BitVec.ofNat 64 36031008927187223 - maskHigh := BitVec.ofNat 64 72058143828606977 - systematicCode := BitVec.ofNat 64 17424061545237598787 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36033333108541568 - maskLow := BitVec.ofNat 64 1441717042620203287 - maskHigh := BitVec.ofNat 64 72058145941225473 - systematicCode := BitVec.ofNat 64 17424074536724353603 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2258397487564928 - maskLow := BitVec.ofNat 64 36031008927187223 - maskHigh := BitVec.ofNat 64 72079595007901697 - systematicCode := BitVec.ofNat 64 17427195265498894915 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2328766231740544 - maskLow := BitVec.ofNat 64 36031008927187223 - maskHigh := BitVec.ofNat 64 4611686027050887169 - systematicCode := BitVec.ofNat 64 18285374917919527491 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9014351013218944 - maskLow := BitVec.ofNat 64 36031008927187223 - maskHigh := BitVec.ofNat 64 4622945569399111681 - systematicCode := BitVec.ofNat 64 18296690211795391043 }) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x5246. -/ -def normalizedWeightSixteenCandidateBucket_5246 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9641145028192256 - maskLow := BitVec.ofNat 64 9009436932768023 - maskHigh := BitVec.ofNat 64 633318698680337 - systematicCode := BitVec.ofNat 64 16419183740349796934 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9641213774931968 - maskLow := BitVec.ofNat 64 9009436932768023 - maskHigh := BitVec.ofNat 64 9011597301319697 - systematicCode := BitVec.ofNat 64 16921608847132152390 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9640698378856448 - maskLow := BitVec.ofNat 64 9009436932768023 - maskHigh := BitVec.ofNat 64 288230513725997057 - systematicCode := BitVec.ofNat 64 17639393200905605702 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11263994421995520 - maskLow := BitVec.ofNat 64 4900481582210547991 - maskHigh := BitVec.ofNat 64 288230515738148865 - systematicCode := BitVec.ofNat 64 17639402906792907334 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9575247640946688 - maskLow := BitVec.ofNat 64 9009436932768023 - maskHigh := BitVec.ofNat 64 288305153679818753 - systematicCode := BitVec.ofNat 64 17644212472542614086 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9922693315313792 - maskLow := BitVec.ofNat 64 9009436932768023 - maskHigh := BitVec.ofNat 64 4611686027151575041 - systematicCode := BitVec.ofNat 64 18285378229339116102 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9574727649730688 - maskLow := BitVec.ofNat 64 9009436932768023 - maskHigh := BitVec.ofNat 64 4621256307221987329 - systematicCode := BitVec.ofNat 64 18296686900375409222 }) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x524a. -/ -def normalizedWeightSixteenCandidateBucket_524a : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9641145034434560 - maskLow := BitVec.ofNat 64 2254140570927383 - maskHigh := BitVec.ofNat 64 633318697893893 - systematicCode := BitVec.ofNat 64 16419179342235914826 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9641213754124288 - maskLow := BitVec.ofNat 64 2254140570927383 - maskHigh := BitVec.ofNat 64 2269391999803397 - systematicCode := BitVec.ofNat 64 16634504387999781450 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9640698358048768 - maskLow := BitVec.ofNat 64 2254140570927383 - maskHigh := BitVec.ofNat 64 1152921539503783937 - systematicCode := BitVec.ofNat 64 17926502058016854602 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11263994436560896 - maskLow := BitVec.ofNat 64 5765172813744898327 - maskHigh := BitVec.ofNat 64 1152921541114068993 - systematicCode := BitVec.ofNat 64 17926507383104885322 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9575247655512064 - maskLow := BitVec.ofNat 64 2254140570927383 - maskHigh := BitVec.ofNat 64 1153009476274487297 - systematicCode := BitVec.ofNat 64 17932447246740574794 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9922693329879168 - maskLow := BitVec.ofNat 64 2254140570927383 - maskHigh := BitVec.ofNat 64 4611686027554234369 - systematicCode := BitVec.ofNat 64 18285382627452473930 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9574727660134528 - maskLow := BitVec.ofNat 64 2254140570927383 - maskHigh := BitVec.ofNat 64 4614500804701716481 - systematicCode := BitVec.ofNat 64 18295560983288435274 }) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x524f. -/ -def normalizedWeightSixteenCandidateBucket_524f : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9641619653699584 - maskLow := BitVec.ofNat 64 565703027523863 - maskHigh := BitVec.ofNat 64 72058143827296277 - systematicCode := BitVec.ofNat 64 17424061411572732495 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11264037101522048 - maskLow := BitVec.ofNat 64 36053540325622039 - maskHigh := BitVec.ofNat 64 72058145941225473 - systematicCode := BitVec.ofNat 64 17424074488992256591 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9641619649292288 - maskLow := BitVec.ofNat 64 565703027523863 - maskHigh := BitVec.ofNat 64 288230513724883013 - systematicCode := BitVec.ofNat 64 17639393080176169551 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9641619622242304 - maskLow := BitVec.ofNat 64 565703027523863 - maskHigh := BitVec.ofNat 64 1152921539503456337 - systematicCode := BitVec.ofNat 64 17926501954534658639 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9576237634988032 - maskLow := BitVec.ofNat 64 565703027523863 - maskHigh := BitVec.ofNat 64 1513209485533904897 - systematicCode := BitVec.ofNat 64 17939229034460369487 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9923683309355136 - maskLow := BitVec.ofNat 64 565703027523863 - maskHigh := BitVec.ofNat 64 4611686027721965569 - systematicCode := BitVec.ofNat 64 18285382730934014543 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18019382829572224 - maskLow := BitVec.ofNat 64 47290549161492759 - maskHigh := BitVec.ofNat 64 4611686029164806145 - systematicCode := BitVec.ofNat 64 18285387918046876239 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9575648924328064 - maskLow := BitVec.ofNat 64 565703027523863 - maskHigh := BitVec.ofNat 64 4611686742129377281 - systematicCode := BitVec.ofNat 64 18288779195567985231 }) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x5251. -/ -def normalizedWeightSixteenCandidateBucket_5251 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .d16Plus - affineCode := BitVec.ofNat 56 54327419704779008 - maskLow := BitVec.ofNat 64 72082887100399895 - maskHigh := BitVec.ofNat 64 36029898678075393 - systematicCode := BitVec.ofNat 64 17280522259459756625 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2258401514094848 - maskLow := BitVec.ofNat 64 4611689321257304343 - maskHigh := BitVec.ofNat 64 564223411224577 - systematicCode := BitVec.ofNat 64 16415844700536984145 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9084716233918720 - maskLow := BitVec.ofNat 64 4611689321257304343 - maskHigh := BitVec.ofNat 64 633318732464129 - systematicCode := BitVec.ofNat 64 16419195878381474385 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36033337135071488 - maskLow := BitVec.ofNat 64 83319895936270615 - maskHigh := BitVec.ofNat 64 633320845082625 - systematicCode := BitVec.ofNat 64 16419208831045161553 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2328765963305216 - maskLow := BitVec.ofNat 64 4611689321257304343 - maskHigh := BitVec.ofNat 64 36029896564156417 - systematicCode := BitVec.ofNat 64 17280509251063403089 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9083067067140352 - maskLow := BitVec.ofNat 64 4611689321257304343 - maskHigh := BitVec.ofNat 64 288230513591722049 - systematicCode := BitVec.ofNat 64 17639377751557034577 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9083066917325056 - maskLow := BitVec.ofNat 64 4611689321257304343 - maskHigh := BitVec.ofNat 64 1152921538966849601 - systematicCode := BitVec.ofNat 64 17926477812575523409 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9014351818524928 - maskLow := BitVec.ofNat 64 4611689321257304343 - maskHigh := BitVec.ofNat 64 1477251048669184001 - systematicCode := BitVec.ofNat 64 17939226947107967569 }) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x5445. -/ -def normalizedWeightSixteenCandidateBucket_5445 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9083070556750848 - maskLow := BitVec.ofNat 64 36033216540377367 - maskHigh := BitVec.ofNat 64 2269392000794657 - systematicCode := BitVec.ofNat 64 16634512093255455813 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9083070405765120 - maskLow := BitVec.ofNat 64 36033216540377367 - maskHigh := BitVec.ofNat 64 18016597532870689 - systematicCode := BitVec.ofNat 64 17065162184783189061 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9084719723529216 - maskLow := BitVec.ofNat 64 36033216540377367 - maskHigh := BitVec.ofNat 64 72058143862030337 - systematicCode := BitVec.ofNat 64 17424063744227300421 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36033333108687872 - maskLow := BitVec.ofNat 64 1298167012110958871 - maskHigh := BitVec.ofNat 64 72058145941225473 - systematicCode := BitVec.ofNat 64 17424074536690930757 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2258397487711232 - maskLow := BitVec.ofNat 64 36033216540377367 - maskHigh := BitVec.ofNat 64 72077404574580737 - systematicCode := BitVec.ofNat 64 17427193075065574469 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2328766231626752 - maskLow := BitVec.ofNat 64 36033216540377367 - maskHigh := BitVec.ofNat 64 2305843026460690433 - systematicCode := BitVec.ofNat 64 18141824887410283589 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9014351013170176 - maskLow := BitVec.ofNat 64 36033216540377367 - maskHigh := BitVec.ofNat 64 2326109759440158721 - systematicCode := BitVec.ofNat 64 18153137973672956997 }) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x5446. -/ -def normalizedWeightSixteenCandidateBucket_5446 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9641145029362688 - maskLow := BitVec.ofNat 64 18018835210764567 - maskHigh := BitVec.ofNat 64 1161084280012817 - systematicCode := BitVec.ofNat 64 16562735978472363078 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9641213776102400 - maskLow := BitVec.ofNat 64 18018835210764567 - maskHigh := BitVec.ofNat 64 18016597532805137 - systematicCode := BitVec.ofNat 64 17065161085254718534 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9640698380026880 - maskLow := BitVec.ofNat 64 18018835210764567 - maskHigh := BitVec.ofNat 64 144115463089094657 - systematicCode := BitVec.ofNat 64 17495840962783302726 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11263994422889600 - maskLow := BitVec.ofNat 64 2451088533897675031 - maskHigh := BitVec.ofNat 64 144115465101246465 - systematicCode := BitVec.ofNat 64 17495850660047115334 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9575247641840768 - maskLow := BitVec.ofNat 64 18018835210764567 - maskHigh := BitVec.ofNat 64 144152590798553089 - systematicCode := BitVec.ofNat 64 17499532144080147526 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9922693314923648 - maskLow := BitVec.ofNat 64 18018835210764567 - maskHigh := BitVec.ofNat 64 2305843026527815681 - systematicCode := BitVec.ofNat 64 18141825991216813126 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9574727650657280 - maskLow := BitVec.ofNat 64 18018835210764567 - maskHigh := BitVec.ofNat 64 2324983584655409153 - systematicCode := BitVec.ofNat 64 18153136869866296390 }) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x544c. -/ -def normalizedWeightSixteenCandidateBucket_544c : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9641145035653760 - maskLow := BitVec.ofNat 64 2256477033136407 - maskHigh := BitVec.ofNat 64 1161084279095299 - systematicCode := BitVec.ofNat 64 16562729381301539916 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9641213755132160 - maskLow := BitVec.ofNat 64 2256477033136407 - maskHigh := BitVec.ofNat 64 2269391999811587 - systematicCode := BitVec.ofNat 64 16634504396556162124 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9640698359056640 - maskLow := BitVec.ofNat 64 2256477033136407 - maskHigh := BitVec.ofNat 64 1152921540040523777 - systematicCode := BitVec.ofNat 64 17926504248450176076 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11263994437568768 - maskLow := BitVec.ofNat 64 3459895090946834711 - maskHigh := BitVec.ofNat 64 1152921541114068993 - systematicCode := BitVec.ofNat 64 17926507374515082316 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9575247656519936 - maskLow := BitVec.ofNat 64 2256477033136407 - maskHigh := BitVec.ofNat 64 1152974300492333057 - systematicCode := BitVec.ofNat 64 17931884305377088588 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9922693329602816 - maskLow := BitVec.ofNat 64 2256477033136407 - maskHigh := BitVec.ofNat 64 2305843027467354113 - systematicCode := BitVec.ofNat 64 18141832588386849868 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9574727661142400 - maskLow := BitVec.ofNat 64 2256477033136407 - maskHigh := BitVec.ofNat 64 2309220745441443841 - systematicCode := BitVec.ofNat 64 18151447994235835468 }) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x544f. -/ -def normalizedWeightSixteenCandidateBucket_544f : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9641619654707456 - maskLow := BitVec.ofNat 64 1130852004200727 - maskHigh := BitVec.ofNat 64 72058143860850707 - systematicCode := BitVec.ofNat 64 17424063610562565199 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9641619650511488 - maskLow := BitVec.ofNat 64 1130852004200727 - maskHigh := BitVec.ofNat 64 144115463087980579 - systematicCode := BitVec.ofNat 64 17495840833430377551 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9641619623250176 - maskLow := BitVec.ofNat 64 1130852004200727 - maskHigh := BitVec.ofNat 64 1152921540040327217 - systematicCode := BitVec.ofNat 64 17926504144968111183 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9576237635995904 - maskLow := BitVec.ofNat 64 1130852004200727 - maskHigh := BitVec.ofNat 64 1369094306047983617 - systematicCode := BitVec.ofNat 64 17938666093097014351 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9923683309078784 - maskLow := BitVec.ofNat 64 1130852004200727 - maskHigh := BitVec.ofNat 64 2305843027668631553 - systematicCode := BitVec.ofNat 64 18141832691868521551 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18019382830580096 - maskLow := BitVec.ofNat 64 56299947439489303 - maskHigh := BitVec.ofNat 64 2305843028541046785 - systematicCode := BitVec.ofNat 64 18141835679957996623 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9575648925335936 - maskLow := BitVec.ofNat 64 1130852004200727 - maskHigh := BitVec.ofNat 64 2305843870354636801 - systematicCode := BitVec.ofNat 64 18144666206515516495 }) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x5451. -/ -def normalizedWeightSixteenCandidateBucket_5451 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2258401513997312 - maskLow := BitVec.ofNat 64 2305848511066865943 - maskHigh := BitVec.ofNat 64 1127310803599361 - systematicCode := BitVec.ofNat 64 16559962087635965009 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9084716234081280 - maskLow := BitVec.ofNat 64 2305848511066865943 - maskHigh := BitVec.ofNat 64 1161084347219969 - systematicCode := BitVec.ofNat 64 16562750315493479505 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36033337134973952 - maskLow := BitVec.ofNat 64 92329294214267159 - maskHigh := BitVec.ofNat 64 1161086426415105 - systematicCode := BitVec.ofNat 64 16562761069201151057 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2328765963207680 - maskLow := BitVec.ofNat 64 2305848511066865943 - maskHigh := BitVec.ofNat 64 36029896597719041 - systematicCode := BitVec.ofNat 64 17280511458676462673 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9083067067302912 - maskLow := BitVec.ofNat 64 2305848511066865943 - maskHigh := BitVec.ofNat 64 144115462954827809 - systematicCode := BitVec.ofNat 64 17495825521990849617 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9083066916317184 - maskLow := BitVec.ofNat 64 2305848511066865943 - maskHigh := BitVec.ofNat 64 1152921538966718497 - systematicCode := BitVec.ofNat 64 17926475613518582865 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9014351818427392 - maskLow := BitVec.ofNat 64 2305848511066865943 - maskHigh := BitVec.ofNat 64 1333100676221239297 - systematicCode := BitVec.ofNat 64 17938663988564481105 }) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x5452. -/ -def normalizedWeightSixteenCandidateBucket_5452 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9575255962832000 - maskLow := BitVec.ofNat 64 1152928105971646743 - maskHigh := BitVec.ofNat 64 2253485588348929 - systematicCode := BitVec.ofNat 64 16632020781185455186 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9640711264142336 - maskLow := BitVec.ofNat 64 1152928105971646743 - maskHigh := BitVec.ofNat 64 2269392135061505 - systematicCode := BitVec.ofNat 64 16634527534049481810 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11264002743880832 - maskLow := BitVec.ofNat 64 110344792235376919 - maskHigh := BitVec.ofNat 64 2269394147213313 - systematicCode := BitVec.ofNat 64 16634537188279145554 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9922680430808192 - maskLow := BitVec.ofNat 64 1152928105971646743 - maskHigh := BitVec.ofNat 64 36029896664844289 - systematicCode := BitVec.ofNat 64 17280512562482992210 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9641157913478144 - maskLow := BitVec.ofNat 64 1152928105971646743 - maskHigh := BitVec.ofNat 64 72058143794823185 - systematicCode := BitVec.ofNat 64 17424049407207756882 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9641226660217856 - maskLow := BitVec.ofNat 64 1152928105971646743 - maskHigh := BitVec.ofNat 64 1152921538966652945 - systematicCode := BitVec.ofNat 64 17926474513990112338 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9574736508486656 - maskLow := BitVec.ofNat 64 1152928105971646743 - maskHigh := BitVec.ofNat 64 1261025489997266945 - systematicCode := BitVec.ofNat 64 17938382509292737618 }) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x5749. -/ -def normalizedWeightSixteenCandidateBucket_5749 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9082661868021760 - maskLow := BitVec.ofNat 64 290344084242711 - maskHigh := BitVec.ofNat 64 9011597303349769 - systematicCode := BitVec.ofNat 64 16921619820722607945 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9082661869192192 - maskLow := BitVec.ofNat 64 290344084242711 - maskHigh := BitVec.ofNat 64 18016597536932873 - systematicCode := BitVec.ofNat 64 17065174266458232649 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9082674753307648 - maskLow := BitVec.ofNat 64 290344084242711 - maskHigh := BitVec.ofNat 64 1152921539235022337 - systematicCode := BitVec.ofNat 64 17926500889533699913 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9011751924794368 - maskLow := BitVec.ofNat 64 290344084242711 - maskHigh := BitVec.ofNat 64 1179943108813520897 - systematicCode := BitVec.ofNat 64 17936969533770258249 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9082120668972032 - maskLow := BitVec.ofNat 64 290344084242711 - maskHigh := BitVec.ofNat 64 9223372041424470017 - systematicCode := BitVec.ofNat 64 18357157711694616393 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11263968384125952 - maskLow := BitVec.ofNat 64 434606233148784919 - maskHigh := BitVec.ofNat 64 9223372043297226753 - systematicCode := BitVec.ofNat 64 18357164067307083593 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9012306009394176 - maskLow := BitVec.ofNat 64 290344084242711 - maskHigh := BitVec.ofNat 64 9223378670431764481 - systematicCode := BitVec.ofNat 64 18362815910535845705 }) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x574a. -/ -def normalizedWeightSixteenCandidateBucket_574a : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9641622849759232 - maskLow := BitVec.ofNat 64 571887780430103 - maskHigh := BitVec.ofNat 64 4512395722490117 - systematicCode := BitVec.ofNat 64 16849843697349711690 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9641622312675328 - maskLow := BitVec.ofNat 64 571887780430103 - maskHigh := BitVec.ofNat 64 18016597541127173 - systematicCode := BitVec.ofNat 64 17065175365953148746 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9641618823227392 - maskLow := BitVec.ofNat 64 571887780430103 - maskHigh := BitVec.ofNat 64 1152921539503457537 - systematicCode := BitVec.ofNat 64 17926501989028616010 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9576236303296512 - maskLow := BitVec.ofNat 64 571887780430103 - maskHigh := BitVec.ofNat 64 1175439513481117697 - systematicCode := BitVec.ofNat 64 17936968438553663306 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9923681977663616 - maskLow := BitVec.ofNat 64 571887780430103 - maskHigh := BitVec.ofNat 64 4611686027564679169 - systematicCode := BitVec.ofNat 64 18285382696440059722 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18019382030557312 - maskLow := BitVec.ofNat 64 722836678019973399 - maskHigh := BitVec.ofNat 64 4611686029164806145 - systematicCode := BitVec.ofNat 64 18285387952540833610 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9575648125313152 - maskLow := BitVec.ofNat 64 571887780430103 - maskHigh := BitVec.ofNat 64 4611697050050887681 - systematicCode := BitVec.ofNat 64 18291039791474693962 }) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x574c. -/ -def normalizedWeightSixteenCandidateBucket_574c : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9641622850767104 - maskLow := BitVec.ofNat 64 1134975172804887 - maskHigh := BitVec.ofNat 64 4512395724587267 - systematicCode := BitVec.ofNat 64 16849845896339543884 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9641622313894528 - maskLow := BitVec.ofNat 64 1134975172804887 - maskHigh := BitVec.ofNat 64 9011597309641219 - systematicCode := BitVec.ofNat 64 16921623119207356236 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9641618824235264 - maskLow := BitVec.ofNat 64 1134975172804887 - maskHigh := BitVec.ofNat 64 1152921540040327937 - systematicCode := BitVec.ofNat 64 17926504179462068044 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9576236304304384 - maskLow := BitVec.ofNat 64 1134975172804887 - maskHigh := BitVec.ofNat 64 1166432322816311297 - systematicCode := BitVec.ofNat 64 17936405497190307660 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9923681977387264 - maskLow := BitVec.ofNat 64 1134975172804887 - maskHigh := BitVec.ofNat 64 2305843027479887873 - systematicCode := BitVec.ofNat 64 18141832657374566220 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18019382031565184 - maskLow := BitVec.ofNat 64 866952003534782743 - maskHigh := BitVec.ofNat 64 2305843028541046785 - systematicCode := BitVec.ofNat 64 18141835714451953484 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9575648126321024 - maskLow := BitVec.ofNat 64 1134975172804887 - maskHigh := BitVec.ofNat 64 2305856239860449281 - systematicCode := BitVec.ofNat 64 18146926802422224716 }) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x574f. -/ -def normalizedWeightSixteenCandidateBucket_574f : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9576754884706560 - maskLow := BitVec.ofNat 64 2261149957554455 - maskHigh := BitVec.ofNat 64 1152921536819101697 - systematicCode := BitVec.ofNat 64 17925666554237114191 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9643314296979712 - maskLow := BitVec.ofNat 64 2261149957554455 - maskHigh := BitVec.ofNat 64 1152921540845633537 - systematicCode := BitVec.ofNat 64 17926504351932045135 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36033787787804928 - maskLow := BitVec.ofNat 64 1979674980843799 - maskHigh := BitVec.ofNat 64 1152921541114068993 - systematicCode := BitVec.ofNat 64 17926507279639729999 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9589949024190720 - maskLow := BitVec.ofNat 64 2261149957554455 - maskHigh := BitVec.ofNat 64 2305843027467304973 - systematicCode := BitVec.ofNat 64 18141832484904982351 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18019076008853888 - maskLow := BitVec.ofNat 64 1346356283244823 - maskHigh := BitVec.ofNat 64 2305843028541046785 - systematicCode := BitVec.ofNat 64 18141835636756010831 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9589949024206976 - maskLow := BitVec.ofNat 64 2261149957554455 - maskHigh := BitVec.ofNat 64 4611686027554193419 - systematicCode := BitVec.ofNat 64 18285382523970606927 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18019076007846016 - maskLow := BitVec.ofNat 64 748221957734679 - maskHigh := BitVec.ofNat 64 4611686029164806145 - systematicCode := BitVec.ofNat 64 18285387866288379727 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9642725582373120 - maskLow := BitVec.ofNat 64 2261149957554455 - maskHigh := BitVec.ofNat 64 9223372041418178567 - systematicCode := BitVec.ofNat 64 18357157539225229135 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11264020053756928 - maskLow := BitVec.ofNat 64 396378236846359 - maskHigh := BitVec.ofNat 64 9223372043297226753 - systematicCode := BitVec.ofNat 64 18357163981037852495 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9577343599593856 - maskLow := BitVec.ofNat 64 2261149957554455 - maskHigh := BitVec.ofNat 64 16140901101003079681 - systematicCode := BitVec.ofNat 64 18374118890069776207 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x5849. -/ -def normalizedWeightSixteenCandidateBucket_5849 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9083070400693248 - maskLow := BitVec.ofNat 64 36046462219518231 - maskHigh := BitVec.ofNat 64 9011597301530633 - systematicCode := BitVec.ofNat 64 16921612171386705993 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9083070399522816 - maskLow := BitVec.ofNat 64 36046462219518231 - maskHigh := BitVec.ofNat 64 18016597532876809 - systematicCode := BitVec.ofNat 64 17065162201895950409 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9084719667348480 - maskLow := BitVec.ofNat 64 36046462219518231 - maskHigh := BitVec.ofNat 64 72058144062570497 - systematicCode := BitVec.ofNat 64 17424068125093943369 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36033333077476352 - maskLow := BitVec.ofNat 64 436866829055492375 - maskHigh := BitVec.ofNat 64 72058145941225473 - systematicCode := BitVec.ofNat 64 17424074519511324745 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2258397456499712 - maskLow := BitVec.ofNat 64 36046462219518231 - maskHigh := BitVec.ofNat 64 72064261974654977 - systematicCode := BitVec.ofNat 64 17426067192338602057 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2328766167122944 - maskLow := BitVec.ofNat 64 36046462219518231 - maskHigh := BitVec.ofNat 64 576460821291360257 - systematicCode := BitVec.ofNat 64 17854724809279035465 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9014350956989440 - maskLow := BitVec.ofNat 64 36046462219518231 - maskHigh := BitVec.ofNat 64 603482901970944001 - systematicCode := BitVec.ofNat 64 17864911995567757385 }) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x584a. -/ -def normalizedWeightSixteenCandidateBucket_584a : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9641145185420288 - maskLow := BitVec.ofNat 64 18032132429512983 - maskHigh := BitVec.ofNat 64 4512395720687621 - systematicCode := BitVec.ofNat 64 16849836056603613258 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9641213905110016 - maskLow := BitVec.ofNat 64 18032132429512983 - maskHigh := BitVec.ofNat 64 18016597532811269 - systematicCode := BitVec.ofNat 64 17065161102367479882 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9640698509034496 - maskLow := BitVec.ofNat 64 18032132429512983 - maskHigh := BitVec.ofNat 64 144115463490961409 - systematicCode := BitVec.ofNat 64 17495845343649945674 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11263994551897216 - maskLow := BitVec.ofNat 64 725097273926680855 - maskHigh := BitVec.ofNat 64 144115465101246465 - systematicCode := BitVec.ofNat 64 17495850642867509322 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9575247770848384 - maskLow := BitVec.ofNat 64 18032132429512983 - maskHigh := BitVec.ofNat 64 144126254059094017 - systematicCode := BitVec.ofNat 64 17498406261353175114 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9922693279550592 - maskLow := BitVec.ofNat 64 18032132429512983 - maskHigh := BitVec.ofNat 64 576460821559812097 - systematicCode := BitVec.ofNat 64 17854725913085565002 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9574727779664896 - maskLow := BitVec.ofNat 64 18032132429512983 - maskHigh := BitVec.ofNat 64 598979027465666561 - systematicCode := BitVec.ofNat 64 17864910891761096778 }) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x584c. -/ -def normalizedWeightSixteenCandidateBucket_584c : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9641145185469056 - maskLow := BitVec.ofNat 64 9025070613725463 - maskHigh := BitVec.ofNat 64 4512395720556547 - systematicCode := BitVec.ofNat 64 16849833857546672204 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9641213904947456 - maskLow := BitVec.ofNat 64 9025070613725463 - maskHigh := BitVec.ofNat 64 9011597301334019 - systematicCode := BitVec.ofNat 64 16921608872801294412 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9640698508871936 - maskLow := BitVec.ofNat 64 9025070613725463 - maskHigh := BitVec.ofNat 64 288230514664603649 - systematicCode := BitVec.ofNat 64 17639399772205570124 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11263994552011008 - maskLow := BitVec.ofNat 64 869212599441490199 - maskHigh := BitVec.ofNat 64 288230515738148865 - systematicCode := BitVec.ofNat 64 17639402881023498316 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9575247770962176 - maskLow := BitVec.ofNat 64 9025070613725463 - maskHigh := BitVec.ofNat 64 288243641158205441 - systematicCode := BitVec.ofNat 64 17642523648452155468 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9922693279664384 - maskLow := BitVec.ofNat 64 9025070613725463 - maskHigh := BitVec.ofNat 64 576460822096691201 - systematicCode := BitVec.ofNat 64 17854728112142243916 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9574727779746176 - maskLow := BitVec.ofNat 64 9025070613725463 - maskHigh := BitVec.ofNat 64 589971690771972097 - systematicCode := BitVec.ofNat 64 17864347933217609804 }) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x584f. -/ -def normalizedWeightSixteenCandidateBucket_584f : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9641619779553536 - maskLow := BitVec.ofNat 64 4521745864261911 - maskHigh := BitVec.ofNat 64 72058144062177287 - systematicCode := BitVec.ofNat 64 17424067991429470287 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9641619779519104 - maskLow := BitVec.ofNat 64 4521745864261911 - maskHigh := BitVec.ofNat 64 144115463490633739 - systematicCode := BitVec.ofNat 64 17495845214297282639 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9641619779307776 - maskLow := BitVec.ofNat 64 4521745864261911 - maskHigh := BitVec.ofNat 64 288230514664407053 - systematicCode := BitVec.ofNat 64 17639399651476527183 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9576237760841984 - maskLow := BitVec.ofNat 64 4521745864261911 - maskHigh := BitVec.ofNat 64 504403229132455937 - systematicCode := BitVec.ofNat 64 17650435734125434959 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9923683269544192 - maskLow := BitVec.ofNat 64 4521745864261911 - maskHigh := BitVec.ofNat 64 576460822901948417 - systematicCode := BitVec.ofNat 64 17854728232870893647 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18019382955426176 - maskLow := BitVec.ofNat 64 63068541020078359 - maskHigh := BitVec.ofNat 64 576460823170383873 - systematicCode := BitVec.ofNat 64 17854731203713390671 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9575649050182016 - maskLow := BitVec.ofNat 64 4521745864261911 - maskHigh := BitVec.ofNat 64 576461716523581441 - systematicCode := BitVec.ofNat 64 17856435847543937103 }) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x5851. -/ -def normalizedWeightSixteenCandidateBucket_5851 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2258401451574272 - maskLow := BitVec.ofNat 64 576479448296128791 - maskHigh := BitVec.ofNat 64 4505113603342337 - systematicCode := BitVec.ofNat 64 16848192480967284817 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9084716204950528 - maskLow := BitVec.ofNat 64 576479448296128791 - maskHigh := BitVec.ofNat 64 4512395989221377 - systematicCode := BitVec.ofNat 64 16849859172604729425 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36033337072550912 - maskLow := BitVec.ofNat 64 99097887794856215 - maskHigh := BitVec.ofNat 64 4512397867876353 - systematicCode := BitVec.ofNat 64 16849865545446283345 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2328765900784640 - maskLow := BitVec.ofNat 64 576479448296128791 - maskHigh := BitVec.ofNat 64 36029896799051777 - systematicCode := BitVec.ofNat 64 17280515856789821521 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9083066938295296 - maskLow := BitVec.ofNat 64 576479448296128791 - maskHigh := BitVec.ofNat 64 144115462954041353 - systematicCode := BitVec.ofNat 64 17495821123876968529 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9083066937124864 - maskLow := BitVec.ofNat 64 576479448296128791 - maskHigh := BitVec.ofNat 64 288230513590804489 - systematicCode := BitVec.ofNat 64 17639371154386212945 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9014351756004352 - maskLow := BitVec.ofNat 64 576479448296128791 - maskHigh := BitVec.ofNat 64 468383159487037441 - systematicCode := BitVec.ofNat 64 17650433595232639057 }) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x5852. -/ -def normalizedWeightSixteenCandidateBucket_5852 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9575256027335808 - maskLow := BitVec.ofNat 64 288250171656044823 - maskHigh := BitVec.ofNat 64 9008988108619777 - systematicCode := BitVec.ofNat 64 16920251174516774994 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9640711293273088 - maskLow := BitVec.ofNat 64 288250171656044823 - maskHigh := BitVec.ofNat 64 9011597838450689 - systematicCode := BitVec.ofNat 64 16921636391160731730 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11264002808384640 - maskLow := BitVec.ofNat 64 117113385815965975 - maskHigh := BitVec.ofNat 64 9011599448735745 - systematicCode := BitVec.ofNat 64 16921641664524277842 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9922680495312000 - maskLow := BitVec.ofNat 64 288250171656044823 - maskHigh := BitVec.ofNat 64 36029897067503617 - systematicCode := BitVec.ofNat 64 17280516960596351058 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9641157969658880 - maskLow := BitVec.ofNat 64 288250171656044823 - maskHigh := BitVec.ofNat 64 72058143794036741 - systematicCode := BitVec.ofNat 64 17424045009093875794 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9641226689348608 - maskLow := BitVec.ofNat 64 288250171656044823 - maskHigh := BitVec.ofNat 64 288230513590738949 - systematicCode := BitVec.ofNat 64 17639370054857742418 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9574736568828928 - maskLow := BitVec.ofNat 64 288250171656044823 - maskHigh := BitVec.ofNat 64 396321167402598401 - systematicCode := BitVec.ofNat 64 17650152115960895570 }) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x5854. -/ -def normalizedWeightSixteenCandidateBucket_5854 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9575256027449600 - maskLow := BitVec.ofNat 64 144137182603444503 - maskHigh := BitVec.ofNat 64 18016324802314241 - systematicCode := BitVec.ofNat 64 17064366371182434388 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9640711293110528 - maskLow := BitVec.ofNat 64 144137182603444503 - maskHigh := BitVec.ofNat 64 18016598606675969 - systematicCode := BitVec.ofNat 64 17065190819716356180 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11264002808498432 - maskLow := BitVec.ofNat 64 126122784093962519 - maskHigh := BitVec.ofNat 64 18016599680221185 - systematicCode := BitVec.ofNat 64 17065193902646843476 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9922680495425792 - maskLow := BitVec.ofNat 64 144137182603444503 - maskHigh := BitVec.ofNat 64 36029897604382721 - systematicCode := BitVec.ofNat 64 17280519159653029972 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9641157969707648 - maskLow := BitVec.ofNat 64 144137182603444503 - maskHigh := BitVec.ofNat 64 72058143793905667 - systematicCode := BitVec.ofNat 64 17424042810036934740 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9641226689186048 - maskLow := BitVec.ofNat 64 144137182603444503 - maskHigh := BitVec.ofNat 64 144115462953844739 - systematicCode := BitVec.ofNat 64 17495817825291556948 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9574736568910208 - maskLow := BitVec.ofNat 64 144137182603444503 - maskHigh := BitVec.ofNat 64 252203780303486977 - systematicCode := BitVec.ofNat 64 17506036919294974036 }) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x5857. -/ -def normalizedWeightSixteenCandidateBucket_5857 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9641638955911424 - maskLow := BitVec.ofNat 64 72083986612027671 - maskHigh := BitVec.ofNat 64 4512395988828167 - systematicCode := BitVec.ofNat 64 16849859038940256343 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9641638955876992 - maskLow := BitVec.ofNat 64 72083986612027671 - maskHigh := BitVec.ofNat 64 9011597838123019 - systematicCode := BitVec.ofNat 64 16921636261808068695 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9641638955665664 - maskLow := BitVec.ofNat 64 72083986612027671 - maskHigh := BitVec.ofNat 64 18016598606479373 - systematicCode := BitVec.ofNat 64 17065190698987313239 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9576252409448704 - maskLow := BitVec.ofNat 64 72083986612027671 - maskHigh := BitVec.ofNat 64 31526299050704897 - systematicCode := BitVec.ofNat 64 17071714420275566679 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9923676877424896 - maskLow := BitVec.ofNat 64 72083986612027671 - maskHigh := BitVec.ofNat 64 36029898409639937 - systematicCode := BitVec.ofNat 64 17280519280381679703 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18019398136709504 - maskLow := BitVec.ofNat 64 1008832709105090839 - maskHigh := BitVec.ofNat 64 36029898678075393 - systematicCode := BitVec.ofNat 64 17280522285718132823 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9575664231465344 - maskLow := BitVec.ofNat 64 72083986612027671 - maskHigh := BitVec.ofNat 64 36044192329236481 - systematicCode := BitVec.ofNat 64 17282235725507483735 }) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x5b45. -/ -def normalizedWeightSixteenCandidateBucket_5b45 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9082661847214080 - maskLow := BitVec.ofNat 64 316680823701783 - maskHigh := BitVec.ofNat 64 2269392000254497 - systematicCode := BitVec.ofNat 64 16634510946498337605 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9082661998199808 - maskLow := BitVec.ofNat 64 316680823701783 - maskHigh := BitVec.ofNat 64 18016597536935969 - systematicCode := BitVec.ofNat 64 17065174283705211717 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9082674782438400 - maskLow := BitVec.ofNat 64 316680823701783 - maskHigh := BitVec.ofNat 64 288230513657778689 - systematicCode := BitVec.ofNat 64 17639392032422189893 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9011751987217408 - maskLow := BitVec.ofNat 64 316680823701783 - maskHigh := BitVec.ofNat 64 308496580917329921 - systematicCode := BitVec.ofNat 64 17648734759572036421 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9082120731395072 - maskLow := BitVec.ofNat 64 316680823701783 - maskHigh := BitVec.ofNat 64 9223372041221570561 - systematicCode := BitVec.ofNat 64 18357153313580997445 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11263968446548992 - maskLow := BitVec.ofNat 64 1306079097784434967 - maskHigh := BitVec.ofNat 64 9223372043297226753 - systematicCode := BitVec.ofNat 64 18357164084487215941 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9012306071817216 - maskLow := BitVec.ofNat 64 316680823701783 - maskHigh := BitVec.ofNat 64 9223391967650512897 - systematicCode := BitVec.ofNat 64 18363941827622558533 }) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x5b46. -/ -def normalizedWeightSixteenCandidateBucket_5b46 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9641622870566912 - maskLow := BitVec.ofNat 64 598172980281623 - maskHigh := BitVec.ofNat 64 1161084279456017 - systematicCode := BitVec.ofNat 64 16562734823125441350 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9641622306433024 - maskLow := BitVec.ofNat 64 598172980281623 - maskHigh := BitVec.ofNat 64 18016597541130257 - systematicCode := BitVec.ofNat 64 17065175383200127814 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9641618844035072 - maskLow := BitVec.ofNat 64 598172980281623 - maskHigh := BitVec.ofNat 64 288230513724887297 - systematicCode := BitVec.ofNat 64 17639393131917105990 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9576236288731136 - maskLow := BitVec.ofNat 64 598172980281623 - maskHigh := BitVec.ofNat 64 307370685305454593 - systematicCode := BitVec.ofNat 64 17648733664355441478 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9923681963098240 - maskLow := BitVec.ofNat 64 598172980281623 - maskHigh := BitVec.ofNat 64 4611686027160453121 - systematicCode := BitVec.ofNat 64 18285378298326440774 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18019382020153472 - maskLow := BitVec.ofNat 64 2459000619571151127 - maskHigh := BitVec.ofNat 64 4611686029164806145 - systematicCode := BitVec.ofNat 64 18285387969720965958 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9575648114909312 - maskLow := BitVec.ofNat 64 598172980281623 - maskHigh := BitVec.ofNat 64 4611723541409169409 - systematicCode := BitVec.ofNat 64 18292165708561406790 }) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x5b4c. -/ -def normalizedWeightSixteenCandidateBucket_5b4c : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9641623000582400 - maskLow := BitVec.ofNat 64 4539063172399383 - maskHigh := BitVec.ofNat 64 1161084283126019 - systematicCode := BitVec.ofNat 64 16562741420094937932 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9641622463709824 - maskLow := BitVec.ofNat 64 4539063172399383 - maskHigh := BitVec.ofNat 64 2269392008118787 - systematicCode := BitVec.ofNat 64 16634518642962750284 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9641618974050560 - maskLow := BitVec.ofNat 64 4539063172399383 - maskHigh := BitVec.ofNat 64 288230514664407809 - systematicCode := BitVec.ofNat 64 17639399703217462092 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9576236418746624 - maskLow := BitVec.ofNat 64 4539063172399383 - maskHigh := BitVec.ofNat 64 291608146739200001 - systematicCode := BitVec.ofNat 64 17647044840265374540 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9923681927448832 - maskLow := BitVec.ofNat 64 4539063172399383 - maskHigh := BitVec.ofNat 64 576460822109224961 - systematicCode := BitVec.ofNat 64 17854728181129960268 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18019382150168960 - maskLow := BitVec.ofNat 64 3467807176620310807 - maskHigh := BitVec.ofNat 64 576460823170383873 - systematicCode := BitVec.ofNat 64 17854731255454325580 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9575648244924800 - maskLow := BitVec.ofNat 64 4539063172399383 - maskHigh := BitVec.ofNat 64 576513668447993857 - systematicCode := BitVec.ofNat 64 17859826741403999052 }) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x5b4f. -/ -def normalizedWeightSixteenCandidateBucket_5b4f : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9576754876383488 - maskLow := BitVec.ofNat 64 9042937677676823 - maskHigh := BitVec.ofNat 64 288230459903574017 - systematicCode := BitVec.ofNat 64 17638562077992508239 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9643314253283584 - maskLow := BitVec.ofNat 64 9042937677676823 - maskHigh := BitVec.ofNat 64 288230514865733633 - systematicCode := BitVec.ofNat 64 17639399858440461135 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36033787779481856 - maskLow := BitVec.ofNat 64 5383762980438295 - maskHigh := BitVec.ofNat 64 288230515738148865 - systematicCode := BitVec.ofNat 64 17639402820574731087 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9589949009625344 - maskLow := BitVec.ofNat 64 9042937677676823 - maskHigh := BitVec.ofNat 64 576460822096642097 - systematicCode := BitVec.ofNat 64 17854728025907354447 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18019076133699968 - maskLow := BitVec.ofNat 64 4750444282839319 - maskHigh := BitVec.ofNat 64 576460823170383873 - systematicCode := BitVec.ofNat 64 17854731177691011919 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9589949011722368 - maskLow := BitVec.ofNat 64 9042937677676823 - maskHigh := BitVec.ofNat 64 4611686027151540259 - systematicCode := BitVec.ofNat 64 18285378143104228175 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9642725574050048 - maskLow := BitVec.ofNat 64 9042937677676823 - maskHigh := BitVec.ofNat 64 9223372041216851987 - systematicCode := BitVec.ofNat 64 18357153158358850383 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9577343591270784 - maskLow := BitVec.ofNat 64 9042937677676823 - maskHigh := BitVec.ofNat 64 14411518947172024321 - systematicCode := BitVec.ofNat 64 18374114509203397455 }) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x5b54. -/ -def normalizedWeightSixteenCandidateBucket_5b54 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9641638980880640 - maskLow := BitVec.ofNat 64 72097180751560983 - maskHigh := BitVec.ofNat 64 1161084346040339 - systematicCode := BitVec.ofNat 64 16562750181828746068 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9641638976684672 - maskLow := BitVec.ofNat 64 72097180751560983 - maskHigh := BitVec.ofNat 64 2269392133947427 - systematicCode := BitVec.ofNat 64 16634527404696558420 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9641638949423360 - maskLow := BitVec.ofNat 64 72097180751560983 - maskHigh := BitVec.ofNat 64 18016598606479409 - systematicCode := BitVec.ofNat 64 17065190716234292052 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9576252399044864 - maskLow := BitVec.ofNat 64 72097180751560983 - maskHigh := BitVec.ofNat 64 21393199889121281 - systematicCode := BitVec.ofNat 64 17070584122322213716 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9923676867021056 - maskLow := BitVec.ofNat 64 72097180751560983 - maskHigh := BitVec.ofNat 64 36029897805660161 - systematicCode := BitVec.ofNat 64 17280519263134702420 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18019398130467200 - maskLow := BitVec.ofNat 64 3602919288610029847 - maskHigh := BitVec.ofNat 64 36029898678075393 - systematicCode := BitVec.ofNat 64 17280522302965111636 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9575664225223040 - maskLow := BitVec.ofNat 64 72097180751560983 - maskHigh := BitVec.ofNat 64 36083774747836417 - systematicCode := BitVec.ofNat 64 17283366023460838228 }) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x5b57. -/ -def normalizedWeightSixteenCandidateBucket_5b57 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9576747418910976 - maskLow := BitVec.ofNat 64 144159172836000023 - maskHigh := BitVec.ofNat 64 18015513053495297 - systematicCode := BitVec.ofNat 64 17064353125503294295 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9643302268059904 - maskLow := BitVec.ofNat 64 144159172836000023 - maskHigh := BitVec.ofNat 64 18016598619062273 - systematicCode := BitVec.ofNat 64 17065190871457291095 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36033780322009344 - maskLow := BitVec.ofNat 64 72946003728204055 - maskHigh := BitVec.ofNat 64 18016599680221185 - systematicCode := BitVec.ofNat 64 17065193902444731223 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9589940753137920 - maskLow := BitVec.ofNat 64 144159172836000023 - maskHigh := BitVec.ofNat 64 36029897604334337 - systematicCode := BitVec.ofNat 64 17280519107912096599 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18019088917938560 - maskLow := BitVec.ofNat 64 72312685030605079 - maskHigh := BitVec.ofNat 64 36029898678075393 - systematicCode := BitVec.ofNat 64 17280522259561012055 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9589941021573248 - maskLow := BitVec.ofNat 64 144159172836000023 - maskHigh := BitVec.ofNat 64 4611686027025711619 - systematicCode := BitVec.ofNat 64 18285369381371468631 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9642718116577536 - maskLow := BitVec.ofNat 64 144159172836000023 - maskHigh := BitVec.ofNat 64 9223372041153937667 - systematicCode := BitVec.ofNat 64 18357144396626090839 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9577336133798272 - maskLow := BitVec.ofNat 64 144159172836000023 - maskHigh := BitVec.ofNat 64 13871089053471866881 - systematicCode := BitVec.ofNat 64 18374105747470637911 }) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x5d43. -/ -def normalizedWeightSixteenCandidateBucket_5d43 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9082661848221952 - maskLow := BitVec.ofNat 64 351856605856023 - maskHigh := BitVec.ofNat 64 2269392000255041 - systematicCode := BitVec.ofNat 64 16634510955121827139 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9082661998037248 - maskLow := BitVec.ofNat 64 351856605856023 - maskHigh := BitVec.ofNat 64 9011597303353409 - systematicCode := BitVec.ofNat 64 16921619846593076547 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9082674782275840 - maskLow := BitVec.ofNat 64 351856605856023 - maskHigh := BitVec.ofNat 64 144115462987322369 - systematicCode := BitVec.ofNat 64 17495837595310054723 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9011751987314944 - maskLow := BitVec.ofNat 64 351856605856023 - maskHigh := BitVec.ofNat 64 155374193586733057 - systematicCode := BitVec.ofNat 64 17504056621542759747 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9082120731492608 - maskLow := BitVec.ofNat 64 351856605856023 - maskHigh := BitVec.ofNat 64 9223372041185918977 - systematicCode := BitVec.ofNat 64 18357151105967807811 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11263968446646528 - maskLow := BitVec.ofNat 64 1459236660897186071 - maskHigh := BitVec.ofNat 64 9223372043297226753 - systematicCode := BitVec.ofNat 64 18357164084520901955 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9012306071914752 - maskLow := BitVec.ofNat 64 351856605856023 - maskHigh := BitVec.ofNat 64 9223394304112721921 - systematicCode := BitVec.ofNat 64 18363944035235749187 }) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x5d46. -/ -def normalizedWeightSixteenCandidateBucket_5d46 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9641622871737344 - maskLow := BitVec.ofNat 64 1196307305791767 - maskHigh := BitVec.ofNat 64 633318698123537 - systematicCode := BitVec.ofNat 64 16419182585003138374 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9641622307603456 - maskLow := BitVec.ofNat 64 1196307305791767 - maskHigh := BitVec.ofNat 64 9011597309644817 - systematicCode := BitVec.ofNat 64 16921623145077824838 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9641618845205504 - maskLow := BitVec.ofNat 64 1196307305791767 - maskHigh := BitVec.ofNat 64 144115463087984897 - systematicCode := BitVec.ofNat 64 17495840893794803014 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9576236289625216 - maskLow := BitVec.ofNat 64 1196307305791767 - maskHigh := BitVec.ofNat 64 153685356611371009 - systematicCode := BitVec.ofNat 64 17504053335892974918 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9923681962708096 - maskLow := BitVec.ofNat 64 1196307305791767 - maskHigh := BitVec.ofNat 64 2305843026536693761 - systematicCode := BitVec.ofNat 64 18141826060204137798 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18019382021080064 - maskLow := BitVec.ofNat 64 4918001200487530775 - maskHigh := BitVec.ofNat 64 2305843028541046785 - systematicCode := BitVec.ofNat 64 18141835740222152006 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9575648115835904 - maskLow := BitVec.ofNat 64 1196307305791767 - maskHigh := BitVec.ofNat 64 2305918053029773313 - systematicCode := BitVec.ofNat 64 18148615678052293958 }) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x5d4a. -/ -def normalizedWeightSixteenCandidateBucket_5d4a : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9641623000744960 - maskLow := BitVec.ofNat 64 4574110105534743 - maskHigh := BitVec.ofNat 64 633318699696389 - systematicCode := BitVec.ofNat 64 16419186982982802762 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9641622463661056 - maskLow := BitVec.ofNat 64 4574110105534743 - maskHigh := BitVec.ofNat 64 2269392008119301 - systematicCode := BitVec.ofNat 64 16634518651586239818 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9641618974213120 - maskLow := BitVec.ofNat 64 4574110105534743 - maskHigh := BitVec.ofNat 64 144115463490635009 - systematicCode := BitVec.ofNat 64 17495845274661707082 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9576236418632832 - maskLow := BitVec.ofNat 64 4574110105534743 - maskHigh := BitVec.ofNat 64 146930008709922817 - systematicCode := BitVec.ofNat 64 17502927453166263626 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9923681927335040 - maskLow := BitVec.ofNat 64 4574110105534743 - maskHigh := BitVec.ofNat 64 576460821570256897 - systematicCode := BitVec.ofNat 64 17854725982073150794 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18019382150087680 - maskLow := BitVec.ofNat 64 5782692432021881111 - maskHigh := BitVec.ofNat 64 576460823170383873 - systematicCode := BitVec.ofNat 64 17854731264044391754 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9575648244843520 - maskLow := BitVec.ofNat 64 4574110105534743 - maskHigh := BitVec.ofNat 64 576548990259036161 - systematicCode := BitVec.ofNat 64 17860389699947355466 }) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x5d4f. -/ -def normalizedWeightSixteenCandidateBucket_5d4f : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9576754876285952 - maskLow := BitVec.ofNat 64 18085321304506647 - maskHigh := BitVec.ofNat 64 144115280417652737 - systematicCode := BitVec.ofNat 64 17494449088940039503 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9643314252909696 - maskLow := BitVec.ofNat 64 18085321304506647 - maskHigh := BitVec.ofNat 64 144115463658405889 - systematicCode := BitVec.ofNat 64 17495845421261348175 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36033787779384320 - maskLow := BitVec.ofNat 64 5981897305948439 - maskHigh := BitVec.ofNat 64 144115465101246465 - systematicCode := BitVec.ofNat 64 17495850582485851471 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9589949009527808 - maskLow := BitVec.ofNat 64 18085321304506647 - maskHigh := BitVec.ofNat 64 576460821559771217 - systematicCode := BitVec.ofNat 64 17854725835474165071 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9589949011608576 - maskLow := BitVec.ofNat 64 18085321304506647 - maskHigh := BitVec.ofNat 64 2305843026527780933 - systematicCode := BitVec.ofNat 64 18141825913605414223 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9642725573952512 - maskLow := BitVec.ofNat 64 18085321304506647 - maskHigh := BitVec.ofNat 64 9223372041183297557 - systematicCode := BitVec.ofNat 64 18357150959369280847 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9577343591173248 - maskLow := BitVec.ofNat 64 18085321304506647 - maskHigh := BitVec.ofNat 64 12105676075397283841 - systematicCode := BitVec.ofNat 64 18373551567840042319 }) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x5d52. -/ -def normalizedWeightSixteenCandidateBucket_5d52 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9641638981043200 - maskLow := BitVec.ofNat 64 72130166100394263 - maskHigh := BitVec.ofNat 64 633318731153429 - systematicCode := BitVec.ofNat 64 16419195744716610898 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9641638976635904 - maskLow := BitVec.ofNat 64 72130166100394263 - maskHigh := BitVec.ofNat 64 2269392133947461 - systematicCode := BitVec.ofNat 64 16634527413320047954 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9641638949585920 - maskLow := BitVec.ofNat 64 72130166100394263 - maskHigh := BitVec.ofNat 64 9011597838123089 - systematicCode := BitVec.ofNat 64 16921636287678537042 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9576252398931072 - maskLow := BitVec.ofNat 64 72130166100394263 - maskHigh := BitVec.ofNat 64 11823050680958977 - systematicCode := BitVec.ofNat 64 16926466735223102802 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9923676866907264 - maskLow := BitVec.ofNat 64 72130166100394263 - maskHigh := BitVec.ofNat 64 36029897235234817 - systematicCode := BitVec.ofNat 64 17280517064077892946 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18019398130385920 - maskLow := BitVec.ofNat 64 6052910471248412951 - maskHigh := BitVec.ofNat 64 36029898678075393 - systematicCode := BitVec.ofNat 64 17280522311555177810 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9575664225141760 - maskLow := BitVec.ofNat 64 72130166100394263 - maskHigh := BitVec.ofNat 64 36121158143180801 - systematicCode := BitVec.ofNat 64 17283928982004194642 }) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x5d57. -/ -def normalizedWeightSixteenCandidateBucket_5d57 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9576747418813440 - maskLow := BitVec.ofNat 64 288309545283944727 - maskHigh := BitVec.ofNat 64 9008322388688897 - systematicCode := BitVec.ofNat 64 16920240136450825559 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9643302267686016 - maskLow := BitVec.ofNat 64 288309545283944727 - maskHigh := BitVec.ofNat 64 9011597848608769 - systematicCode := BitVec.ofNat 64 16921636434278178135 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36033780321911808 - maskLow := BitVec.ofNat 64 73544138053714199 - maskHigh := BitVec.ofNat 64 9011599448735745 - systematicCode := BitVec.ofNat 64 16921641664355851607 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9589940753040384 - maskLow := BitVec.ofNat 64 288309545283944727 - maskHigh := BitVec.ofNat 64 36029897067463937 - systematicCode := BitVec.ofNat 64 17280516917478907223 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9589941021459456 - maskLow := BitVec.ofNat 64 288309545283944727 - maskHigh := BitVec.ofNat 64 2305843026401952773 - systematicCode := BitVec.ofNat 64 18141817151872654679 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9642718116480000 - maskLow := BitVec.ofNat 64 288309545283944727 - maskHigh := BitVec.ofNat 64 9223372041151840517 - systematicCode := BitVec.ofNat 64 18357142197636521303 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9577336133700736 - maskLow := BitVec.ofNat 64 288309545283944727 - maskHigh := BitVec.ofNat 64 11565248243281428481 - systematicCode := BitVec.ofNat 64 18373542806107282775 }) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x5d5b. -/ -def normalizedWeightSixteenCandidateBucket_5d5b : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9576747356390400 - maskLow := BitVec.ofNat 64 1153027062018146583 - maskHigh := BitVec.ofNat 64 2252974487240705 - systematicCode := BitVec.ofNat 64 16632014158345887067 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9643302169889920 - maskLow := BitVec.ofNat 64 1153027062018146583 - maskHigh := BitVec.ofNat 64 2269392142860289 - systematicCode := BitVec.ofNat 64 16634527559919951195 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 36033780259488768 - maskLow := BitVec.ofNat 64 76948226053308695 - maskHigh := BitVec.ofNat 64 2269394147213313 - systematicCode := BitVec.ofNat 64 16634537188178091355 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9589940690617344 - maskLow := BitVec.ofNat 64 1153027062018146583 - maskHigh := BitVec.ofNat 64 36029896664813825 - systematicCode := BitVec.ofNat 64 17280512536612527451 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9589940956955648 - maskLow := BitVec.ofNat 64 1153027062018146583 - maskHigh := BitVec.ofNat 64 576460821031292945 - systematicCode := BitVec.ofNat 64 17854712692875025755 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9642718054056960 - maskLow := BitVec.ofNat 64 1153027062018146583 - maskHigh := BitVec.ofNat 64 9223372041150267665 - systematicCode := BitVec.ofNat 64 18357137799657381211 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9577336071277696 - maskLow := BitVec.ofNat 64 1153027062018146583 - maskHigh := BitVec.ofNat 64 9835879180510691329 - systematicCode := BitVec.ofNat 64 18372416923380571483 }) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x5e43. -/ -def normalizedWeightSixteenCandidateBucket_5e43 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9082593128743552 - maskLow := BitVec.ofNat 64 703700326744343 - maskHigh := BitVec.ofNat 64 1161084279456833 - systematicCode := BitVec.ofNat 64 16562734836060675651 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9082593278558848 - maskLow := BitVec.ofNat 64 703700326744343 - maskHigh := BitVec.ofNat 64 4512395722494017 - systematicCode := BitVec.ofNat 64 16849843727531925059 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9082606062797440 - maskLow := BitVec.ofNat 64 703700326744343 - maskHigh := BitVec.ofNat 64 72058143827301377 - systematicCode := BitVec.ofNat 64 17424061476248903235 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2256283826784384 - maskLow := BitVec.ofNat 64 703700326744343 - maskHigh := BitVec.ofNat 64 77687104309559297 - systematicCode := BitVec.ofNat 64 17431716457311526467 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2326652570960000 - maskLow := BitVec.ofNat 64 703700326744343 - maskHigh := BitVec.ofNat 64 4611686027053498369 - systematicCode := BitVec.ofNat 64 18285374986906656323 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10138068539804288 - maskLow := BitVec.ofNat 64 2918473308909404439 - maskHigh := BitVec.ofNat 64 4611686029164806145 - systematicCode := BitVec.ofNat 64 18285387969771494979 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9012237352438400 - maskLow := BitVec.ofNat 64 703700326744343 - maskHigh := BitVec.ofNat 64 4611730550795796481 - systematicCode := BitVec.ofNat 64 18292169019981192771 }) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x5e45. -/ -def normalizedWeightSixteenCandidateBucket_5e45 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9082593127524352 - maskLow := BitVec.ofNat 64 1266658870100247 - maskHigh := BitVec.ofNat 64 633318698123809 - systematicCode := BitVec.ofNat 64 16419182589314883141 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9082593278510080 - maskLow := BitVec.ofNat 64 1266658870100247 - maskHigh := BitVec.ofNat 64 4512395724591137 - systematicCode := BitVec.ofNat 64 16849845926521757253 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9082606062748672 - maskLow := BitVec.ofNat 64 1266658870100247 - maskHigh := BitVec.ofNat 64 72058143860855297 - systematicCode := BitVec.ofNat 64 17424063675238735429 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2256283826930688 - maskLow := BitVec.ofNat 64 1266658870100247 - maskHigh := BitVec.ofNat 64 77124162946072577 - systematicCode := BitVec.ofNat 64 17431714266878336581 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2326652570846208 - maskLow := BitVec.ofNat 64 1266658870100247 - maskHigh := BitVec.ofNat 64 2305843026465390593 - systematicCode := BitVec.ofNat 64 18141824956397542981 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10138068539755520 - maskLow := BitVec.ofNat 64 5224316326713032983 - maskHigh := BitVec.ofNat 64 2305843028541046785 - systematicCode := BitVec.ofNat 64 18141835740238995013 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9012237352389632 - maskLow := BitVec.ofNat 64 1266658870100247 - maskHigh := BitVec.ofNat 64 2305922725954191361 - systematicCode := BitVec.ofNat 64 18148616781858889285 }) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x5e49. -/ -def normalizedWeightSixteenCandidateBucket_5e49 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9082593121282048 - maskLow := BitVec.ofNat 64 4644410130235671 - maskHigh := BitVec.ofNat 64 633318699696649 - systematicCode := BitVec.ofNat 64 16419186987294547529 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9082593122452480 - maskLow := BitVec.ofNat 64 4644410130235671 - maskHigh := BitVec.ofNat 64 1161084283126793 - systematicCode := BitVec.ofNat 64 16562741433030172233 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9082606006567936 - maskLow := BitVec.ofNat 64 4644410130235671 - maskHigh := BitVec.ofNat 64 72058144062178817 - systematicCode := BitVec.ofNat 64 17424068056105639497 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2256283795719168 - maskLow := BitVec.ofNat 64 4644410130235671 - maskHigh := BitVec.ofNat 64 73746514765152257 - systematicCode := BitVec.ofNat 64 17430588384151625289 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2326652506342400 - maskLow := BitVec.ofNat 64 4644410130235671 - maskHigh := BitVec.ofNat 64 576460821297627137 - systematicCode := BitVec.ofNat 64 17854724878266555977 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10138068483574784 - maskLow := BitVec.ofNat 64 6953698635162910999 - maskHigh := BitVec.ofNat 64 576460823170383873 - systematicCode := BitVec.ofNat 64 17854731264061234761 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9012237296208896 - maskLow := BitVec.ofNat 64 4644410130235671 - maskHigh := BitVec.ofNat 64 576566857322987521 - systematicCode := BitVec.ofNat 64 17860390803753950793 }) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x5e4f. -/ -def normalizedWeightSixteenCandidateBucket_5e4f : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 45041086383279232 - maskLow := BitVec.ofNat 64 36170088558166295 - maskHigh := BitVec.ofNat 64 72057690674692097 - systematicCode := BitVec.ofNat 64 17422391499197144655 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9082104191929472 - maskLow := BitVec.ofNat 64 36170088558166295 - maskHigh := BitVec.ofNat 64 72058144162840577 - systematicCode := BitVec.ofNat 64 17424068198393601615 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11266150762302592 - maskLow := BitVec.ofNat 64 6333741026836759 - maskHigh := BitVec.ofNat 64 72058145941225473 - systematicCode := BitVec.ofNat 64 17424074463424699983 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 45111455093902464 - maskLow := BitVec.ofNat 64 36170088558166295 - maskHigh := BitVec.ofNat 64 576460821291335777 - systematicCode := BitVec.ofNat 64 17854724735979380303 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 45111455193779328 - maskLow := BitVec.ofNat 64 36170088558166295 - maskHigh := BitVec.ofNat 64 2305843026460672073 - systematicCode := BitVec.ofNat 64 18141824814110629455 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 45111455194169472 - maskLow := BitVec.ofNat 64 36170088558166295 - maskHigh := BitVec.ofNat 64 4611686027050876969 - systematicCode := BitVec.ofNat 64 18285374844619873871 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9011735413933184 - maskLow := BitVec.ofNat 64 36170088558166295 - maskHigh := BitVec.ofNat 64 7493990331847802881 - systematicCode := BitVec.ofNat 64 18301493978097147471 }) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x5e51. -/ -def normalizedWeightSixteenCandidateBucket_5e51 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9082585930147840 - maskLow := BitVec.ofNat 64 72199435332944151 - maskHigh := BitVec.ofNat 64 633318731153449 - systematicCode := BitVec.ofNat 64 16419195749028355665 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9082585931318272 - maskLow := BitVec.ofNat 64 72199435332944151 - maskHigh := BitVec.ofNat 64 1161084346040393 - systematicCode := BitVec.ofNat 64 16562750194763980369 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9082586031195136 - maskLow := BitVec.ofNat 64 72199435332944151 - maskHigh := BitVec.ofNat 64 4512395988828257 - systematicCode := BitVec.ofNat 64 16849859069122469457 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2256271277818880 - maskLow := BitVec.ofNat 64 72199435332944151 - maskHigh := BitVec.ofNat 64 6193551146745857 - systematicCode := BitVec.ofNat 64 16854127666208464465 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2326635727029248 - maskLow := BitVec.ofNat 64 72199435332944151 - maskHigh := BitVec.ofNat 64 36029896899690497 - systematicCode := BitVec.ofNat 64 17280515960271298129 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10138052769614848 - maskLow := BitVec.ofNat 64 7494131621239521559 - maskHigh := BitVec.ofNat 64 36029898678075393 - systematicCode := BitVec.ofNat 64 17280522311572020817 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9012221582248960 - maskLow := BitVec.ofNat 64 72199435332944151 - maskHigh := BitVec.ofNat 64 36143148375736321 - systematicCode := BitVec.ofNat 64 17283930085810789969 }) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x5e57. -/ -def normalizedWeightSixteenCandidateBucket_5e57 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 45041086116940928 - maskLow := BitVec.ofNat 64 576610290179834135 - maskHigh := BitVec.ofNat 64 4504727056285697 - systematicCode := BitVec.ofNat 64 16848182546707930711 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9082125232655488 - maskLow := BitVec.ofNat 64 576610290179834135 - maskHigh := BitVec.ofNat 64 4512395995119617 - systematicCode := BitVec.ofNat 64 16849859211410431575 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11266150495964288 - maskLow := BitVec.ofNat 64 73895981774602519 - maskHigh := BitVec.ofNat 64 4512397867876353 - systematicCode := BitVec.ofNat 64 16849865545294700119 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 45111450566151296 - maskLow := BitVec.ofNat 64 576610290179834135 - maskHigh := BitVec.ofNat 64 36029896799028737 - systematicCode := BitVec.ofNat 64 17280515817984122455 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 45111463450266752 - maskLow := BitVec.ofNat 64 576610290179834135 - maskHigh := BitVec.ofNat 64 2305843026397758473 - systematicCode := BitVec.ofNat 64 18141816052377869911 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 45111463450656896 - maskLow := BitVec.ofNat 64 576610290179834135 - maskHigh := BitVec.ofNat 64 4611686027019420169 - systematicCode := BitVec.ofNat 64 18285366082887114327 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9011752193246336 - maskLow := BitVec.ofNat 64 576610290179834135 - maskHigh := BitVec.ofNat 64 6953566622900551681 - systematicCode := BitVec.ofNat 64 18301485216364387927 }) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x5e5b. -/ -def normalizedWeightSixteenCandidateBucket_5e5b : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 45041086181444736 - maskLow := BitVec.ofNat 64 2306018935369171223 - maskHigh := BitVec.ofNat 64 1127078875365377 - systematicCode := BitVec.ofNat 64 16559956568602992219 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9082125330451584 - maskLow := BitVec.ofNat 64 2306018935369171223 - maskHigh := BitVec.ofNat 64 1161084350758913 - systematicCode := BitVec.ofNat 64 16562750337052204635 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11266150560468096 - maskLow := BitVec.ofNat 64 77300069774197015 - maskHigh := BitVec.ofNat 64 1161086426415105 - systematicCode := BitVec.ofNat 64 16562761069116939867 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 45111450630655104 - maskLow := BitVec.ofNat 64 2306018935369171223 - maskHigh := BitVec.ofNat 64 36029896597705217 - systematicCode := BitVec.ofNat 64 17280511437117742683 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 45111463414893696 - maskLow := BitVec.ofNat 64 2306018935369171223 - maskHigh := BitVec.ofNat 64 576460821027098657 - systematicCode := BitVec.ofNat 64 17854711593380240987 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 45111463465222272 - maskLow := BitVec.ofNat 64 2306018935369171223 - maskHigh := BitVec.ofNat 64 4611686027017847329 - systematicCode := BitVec.ofNat 64 18285361684907974235 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9011752257750144 - maskLow := BitVec.ofNat 64 2306018935369171223 - maskHigh := BitVec.ofNat 64 5224210754269347841 - systematicCode := BitVec.ofNat 64 18300359333637676635 }) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x5e5d. -/ -def normalizedWeightSixteenCandidateBucket_5e5d : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 45041086181558528 - maskLow := BitVec.ofNat 64 4611897128954954007 - maskHigh := BitVec.ofNat 64 564137511878657 - systematicCode := BitVec.ofNat 64 16415841389117202013 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9082125330825472 - maskLow := BitVec.ofNat 64 4611897128954954007 - maskHigh := BitVec.ofNat 64 633318733774849 - systematicCode := BitVec.ofNat 64 16419195891316711005 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 11266150560581888 - maskLow := BitVec.ofNat 64 77898204099707159 - maskHigh := BitVec.ofNat 64 633320845082625 - systematicCode := BitVec.ofNat 64 16419208830994636381 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 45111450630768896 - maskLow := BitVec.ofNat 64 4611897128954954007 - maskHigh := BitVec.ofNat 64 36029896564151297 - systematicCode := BitVec.ofNat 64 17280509238128172637 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 45111463415007488 - maskLow := BitVec.ofNat 64 4611897128954954007 - maskHigh := BitVec.ofNat 64 576460821025001537 - systematicCode := BitVec.ofNat 64 17854709394390670941 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 45111463464945920 - maskLow := BitVec.ofNat 64 4611897128954954007 - maskHigh := BitVec.ofNat 64 2305843026394088513 - systematicCode := BitVec.ofNat 64 18141809455409159773 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9011752257863936 - maskLow := BitVec.ofNat 64 4611897128954954007 - maskHigh := BitVec.ofNat 64 2918402929427742721 - systematicCode := BitVec.ofNat 64 18156244154151886429 }) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x6261. -/ -def normalizedWeightSixteenCandidateBucket_6261 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.leaf - { patternClass := .d16Plus - affineCode := BitVec.ofNat 56 54324726491848960 - maskLow := BitVec.ofNat 64 78531522797306135 - maskHigh := BitVec.ofNat 64 422214612549633 - systematicCode := BitVec.ofNat 64 16203880473810985569 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2256799222857984 - maskLow := BitVec.ofNat 64 4612530447652552983 - maskHigh := BitVec.ofNat 64 283847946141697 - systematicCode := BitVec.ofNat 64 16200516343353336417 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2326618211221760 - maskLow := BitVec.ofNat 64 4612530447652552983 - maskHigh := BitVec.ofNat 64 422212501241857 - systematicCode := BitVec.ofNat 64 16203867534133060193 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9082159386200320 - maskLow := BitVec.ofNat 64 4612530447652552983 - maskHigh := BitVec.ofNat 64 18016597566297089 - systematicCode := BitVec.ofNat 64 17065180880944521825 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9082146601961728 - maskLow := BitVec.ofNat 64 4612530447652552983 - maskHigh := BitVec.ofNat 64 288230513592766529 - systematicCode := BitVec.ofNat 64 17639381037207020129 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9082146452146432 - maskLow := BitVec.ofNat 64 4612530447652552983 - maskHigh := BitVec.ofNat 64 1152921538967110721 - systematicCode := BitVec.ofNat 64 17926481098225508961 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9012340431653120 - maskLow := BitVec.ofNat 64 4612530447652552983 - maskHigh := BitVec.ofNat 64 1459307018903879681 - systematicCode := BitVec.ofNat 64 17939223661457990241 }) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x6461. -/ -def normalizedWeightSixteenCandidateBucket_6461 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2256799222760448 - maskLow := BitVec.ofNat 64 2307250388392280343 - maskHigh := BitVec.ofNat 64 286184408350721 - systematicCode := BitVec.ofNat 64 16201081492329882721 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2326618211124224 - maskLow := BitVec.ofNat 64 2307250388392280343 - maskHigh := BitVec.ofNat 64 422212536893441 - systematicCode := BitVec.ofNat 64 16203869741746119777 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9082159386362880 - maskLow := BitVec.ofNat 64 2307250388392280343 - maskHigh := BitVec.ofNat 64 9011597368365569 - systematicCode := BitVec.ofNat 64 16921630841811657825 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9082146602124288 - maskLow := BitVec.ofNat 64 2307250388392280343 - maskHigh := BitVec.ofNat 64 144115462957961249 - systematicCode := BitVec.ofNat 64 17495830998074156129 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9082146451138560 - maskLow := BitVec.ofNat 64 2307250388392280343 - maskHigh := BitVec.ofNat 64 1152921538967110177 - systematicCode := BitVec.ofNat 64 17926481089601889377 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9012340431555584 - maskLow := BitVec.ofNat 64 2307250388392280343 - maskHigh := BitVec.ofNat 64 1306184631573282817 - systematicCode := BitVec.ofNat 64 17938658512481182817 }) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x6462. -/ -def normalizedWeightSixteenCandidateBucket_6462 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9577301441006720 - maskLow := BitVec.ofNat 64 1154610358762144023 - maskHigh := BitVec.ofNat 64 290857332768769 - systematicCode := BitVec.ofNat 64 16201364066818155618 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9922032696052864 - maskLow := BitVec.ofNat 64 1154610358762144023 - maskHigh := BitVec.ofNat 64 422212608196609 - systematicCode := BitVec.ofNat 64 16203870845552649314 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9643268111860736 - maskLow := BitVec.ofNat 64 1154610358762144023 - maskHigh := BitVec.ofNat 64 4512395854614785 - systematicCode := BitVec.ofNat 64 16849855822245225570 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9643271574258688 - maskLow := BitVec.ofNat 64 1154610358762144023 - maskHigh := BitVec.ofNat 64 72058143802134545 - systematicCode := BitVec.ofNat 64 17424055978507723874 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9643272138392576 - maskLow := BitVec.ofNat 64 1154610358762144023 - maskHigh := BitVec.ofNat 64 1152921538967109905 - systematicCode := BitVec.ofNat 64 17926481085290079330 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9576781986661376 - maskLow := BitVec.ofNat 64 1154610358762144023 - maskHigh := BitVec.ofNat 64 1229623437907984385 - systematicCode := BitVec.ofNat 64 17938375937992778850 }) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x6861. -/ -def normalizedWeightSixteenCandidateBucket_6861 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2256799160337408 - maskLow := BitVec.ofNat 64 581245831202537751 - maskHigh := BitVec.ofNat 64 299481627099137 - systematicCode := BitVec.ofNat 64 16202207409416333409 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2326618148701184 - maskLow := BitVec.ofNat 64 581245831202537751 - maskHigh := BitVec.ofNat 64 422212739792897 - systematicCode := BitVec.ofNat 64 16203874139859478625 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9082159357232128 - maskLow := BitVec.ofNat 64 581245831202537751 - maskHigh := BitVec.ofNat 64 2269392268166657 - systematicCode := BitVec.ofNat 64 16634530746433169505 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9082146473116672 - maskLow := BitVec.ofNat 64 581245831202537751 - maskHigh := BitVec.ofNat 64 144115462957958153 - systematicCode := BitVec.ofNat 64 17495830980826916961 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9082146471946240 - maskLow := BitVec.ofNat 64 581245831202537751 - maskHigh := BitVec.ofNat 64 288230513592762889 - systematicCode := BitVec.ofNat 64 17639381011336161377 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9012340369132544 - maskLow := BitVec.ofNat 64 581245831202537751 - maskHigh := BitVec.ofNat 64 434738103677091841 - systematicCode := BitVec.ofNat 64 17650423738282698849 }) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x6862. -/ -def normalizedWeightSixteenCandidateBucket_6862 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9577301505510528 - maskLow := BitVec.ofNat 64 293296930027536663 - maskHigh := BitVec.ofNat 64 317348691050497 - systematicCode := BitVec.ofNat 64 16202489983904606306 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9922032760556672 - maskLow := BitVec.ofNat 64 293296930027536663 - maskHigh := BitVec.ofNat 64 422213012422657 - systematicCode := BitVec.ofNat 64 16203875243666008162 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9643268140991488 - maskLow := BitVec.ofNat 64 293296930027536663 - maskHigh := BitVec.ofNat 64 1161084815803649 - systematicCode := BitVec.ofNat 64 16562755726866737250 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9643271630439424 - maskLow := BitVec.ofNat 64 293296930027536663 - maskHigh := BitVec.ofNat 64 72058143802131461 - systematicCode := BitVec.ofNat 64 17424055961260484706 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9643272167523328 - maskLow := BitVec.ofNat 64 293296930027536663 - maskHigh := BitVec.ofNat 64 288230513592762629 - systematicCode := BitVec.ofNat 64 17639381007024351330 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9576782047003648 - maskLow := BitVec.ofNat 64 293296930027536663 - maskHigh := BitVec.ofNat 64 361554609732321281 - systematicCode := BitVec.ofNat 64 17650141163794294882 }) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x6864. -/ -def normalizedWeightSixteenCandidateBucket_6864 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9577301505624320 - maskLow := BitVec.ofNat 64 149744691905102103 - maskHigh := BitVec.ofNat 64 352670502092801 - systematicCode := BitVec.ofNat 64 16203052942447831140 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9922032760670464 - maskLow := BitVec.ofNat 64 149744691905102103 - maskHigh := BitVec.ofNat 64 422213551390721 - systematicCode := BitVec.ofNat 64 16203877442722687076 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9643268140828928 - maskLow := BitVec.ofNat 64 149744691905102103 - maskHigh := BitVec.ofNat 64 633319771341569 - systematicCode := BitVec.ofNat 64 16419205679177492580 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9643271630488192 - maskLow := BitVec.ofNat 64 149744691905102103 - maskHigh := BitVec.ofNat 64 72058143802130947 - systematicCode := BitVec.ofNat 64 17424055952636864612 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9643272167360768 - maskLow := BitVec.ofNat 64 149744691905102103 - maskHigh := BitVec.ofNat 64 144115462957957379 - systematicCode := BitVec.ofNat 64 17495830967891486820 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9576782047084928 - maskLow := BitVec.ofNat 64 149744691905102103 - maskHigh := BitVec.ofNat 64 216876471703044097 - systematicCode := BitVec.ofNat 64 17506023776695052388 }) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x6867. -/ -def normalizedWeightSixteenCandidateBucket_6867 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9577309239838976 - maskLow := BitVec.ofNat 64 78812997774016791 - maskHigh := BitVec.ofNat 64 404622426505217 - systematicCode := BitVec.ofNat 64 16203066188126775399 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9922040494885120 - maskLow := BitVec.ofNat 64 78812997774016791 - maskHigh := BitVec.ofNat 64 422214344114177 - systematicCode := BitVec.ofNat 64 16203877494463424615 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18021034519249280 - maskLow := BitVec.ofNat 64 1015561720267079959 - maskHigh := BitVec.ofNat 64 422214612549633 - systematicCode := BitVec.ofNat 64 16203880499799877735 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9643275338205440 - maskLow := BitVec.ofNat 64 78812997774016791 - maskHigh := BitVec.ofNat 64 633319771340813 - systematicCode := BitVec.ofNat 64 16419205627436361831 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9643275338416768 - maskLow := BitVec.ofNat 64 78812997774016791 - maskHigh := BitVec.ofNat 64 1161084815802379 - systematicCode := BitVec.ofNat 64 16562755666501986407 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9643275338451200 - maskLow := BitVec.ofNat 64 78812997774016791 - maskHigh := BitVec.ofNat 64 2269392268165127 - systematicCode := BitVec.ofNat 64 16634530681756608615 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9576789244461440 - maskLow := BitVec.ofNat 64 78812997774016791 - maskHigh := BitVec.ofNat 64 4081389309788161 - systematicCode := BitVec.ofNat 64 16637954948519192679 }) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x6b64. -/ -def normalizedWeightSixteenCandidateBucket_6b64 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9577309229435136 - maskLow := BitVec.ofNat 64 82190697494544663 - maskHigh := BitVec.ofNat 64 365040007905281 - systematicCode := BitVec.ofNat 64 16203061772900395876 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9922040484481280 - maskLow := BitVec.ofNat 64 82190697494544663 - maskHigh := BitVec.ofNat 64 422213740134401 - systematicCode := BitVec.ofNat 64 16203877477216447332 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18021034513006976 - maskLow := BitVec.ofNat 64 3613012805353013527 - maskHigh := BitVec.ofNat 64 422214612549633 - systematicCode := BitVec.ofNat 64 16203880517046856548 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9643275331963136 - maskLow := BitVec.ofNat 64 82190697494544663 - maskHigh := BitVec.ofNat 64 633319771340849 - systematicCode := BitVec.ofNat 64 16419205644683340644 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9643275359224448 - maskLow := BitVec.ofNat 64 82190697494544663 - maskHigh := BitVec.ofNat 64 4512395854610467 - systematicCode := BitVec.ofNat 64 16849855761880214372 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9643275363420416 - maskLow := BitVec.ofNat 64 82190697494544663 - maskHigh := BitVec.ofNat 64 9011597368360979 - systematicCode := BitVec.ofNat 64 16921630777134836580 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9576789238219136 - maskLow := BitVec.ofNat 64 82190697494544663 - maskHigh := BitVec.ofNat 64 14214488471371777 - systematicCode := BitVec.ofNat 64 16927311224577747812 }) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x6b67. -/ -def normalizedWeightSixteenCandidateBucket_6b67 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9574701940736256 - maskLow := BitVec.ofNat 64 155374191439315223 - maskHigh := BitVec.ofNat 64 351858753273857 - systematicCode := BitVec.ofNat 64 16203039696768691047 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9587793001054464 - maskLow := BitVec.ofNat 64 155374191439315223 - maskHigh := BitVec.ofNat 64 422213539004417 - systematicCode := BitVec.ofNat 64 16203877390981753703 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18021032122204544 - maskLow := BitVec.ofNat 64 137359792929833239 - maskHigh := BitVec.ofNat 64 422214612549633 - systematicCode := BitVec.ofNat 64 16203880473912240999 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9640677237735680 - maskLow := BitVec.ofNat 64 155374191439315223 - maskHigh := BitVec.ofNat 64 633319771389953 - systematicCode := BitVec.ofNat 64 16419205730918427495 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9587827360792704 - maskLow := BitVec.ofNat 64 155374191439315223 - maskHigh := BitVec.ofNat 64 4611686027017486339 - systematicCode := BitVec.ofNat 64 18285356238771546983 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9640672638402816 - maskLow := BitVec.ofNat 64 155374191439315223 - maskHigh := BitVec.ofNat 64 9223372041149825027 - systematicCode := BitVec.ofNat 64 18357131254026169191 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9575290655623552 - maskLow := BitVec.ofNat 64 155374191439315223 - maskHigh := BitVec.ofNat 64 13835761744871424001 - systematicCode := BitVec.ofNat 64 18374092604870716263 }) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x6d62. -/ -def normalizedWeightSixteenCandidateBucket_6d62 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9577309229321344 - maskLow := BitVec.ofNat 64 90634946795864343 - maskHigh := BitVec.ofNat 64 327656612560897 - systematicCode := BitVec.ofNat 64 16202498814357040482 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9922040484367488 - maskLow := BitVec.ofNat 64 90634946795864343 - maskHigh := BitVec.ofNat 64 422213169709057 - systematicCode := BitVec.ofNat 64 16203875278159637858 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 18021034512925696 - maskLow := BitVec.ofNat 64 6071415251943883031 - maskHigh := BitVec.ofNat 64 422214612549633 - systematicCode := BitVec.ofNat 64 16203880525636922722 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9643275332125696 - maskLow := BitVec.ofNat 64 90634946795864343 - maskHigh := BitVec.ofNat 64 1161084815802449 - systematicCode := BitVec.ofNat 64 16562755692372454754 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9643275359175680 - maskLow := BitVec.ofNat 64 90634946795864343 - maskHigh := BitVec.ofNat 64 4512395854610501 - systematicCode := BitVec.ofNat 64 16849855770503703906 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9643275363582976 - maskLow := BitVec.ofNat 64 90634946795864343 - maskHigh := BitVec.ofNat 64 18016597566291989 - systematicCode := BitVec.ofNat 64 17065180816267570530 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9576789238137856 - maskLow := BitVec.ofNat 64 90634946795864343 - maskHigh := BitVec.ofNat 64 23784637679534081 - systematicCode := BitVec.ofNat 64 17071428611676859746 }) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x6d67. -/ -def normalizedWeightSixteenCandidateBucket_6d67 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9574701940638720 - maskLow := BitVec.ofNat 64 308496578769912087 - maskHigh := BitVec.ofNat 64 316682971119617 - systematicCode := BitVec.ofNat 64 16202478945838656871 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9587793000956928 - maskLow := BitVec.ofNat 64 308496578769912087 - maskHigh := BitVec.ofNat 64 422213002264577 - systematicCode := BitVec.ofNat 64 16203875200548564327 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9640677237361792 - maskLow := BitVec.ofNat 64 308496578769912087 - maskHigh := BitVec.ofNat 64 1161084815843329 - systematicCode := BitVec.ofNat 64 16562755769984183655 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9587827360678912 - maskLow := BitVec.ofNat 64 308496578769912087 - maskHigh := BitVec.ofNat 64 2305843026393858053 - systematicCode := BitVec.ofNat 64 18141806199706053991 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9640672638305280 - maskLow := BitVec.ofNat 64 308496578769912087 - maskHigh := BitVec.ofNat 64 9223372041149816837 - systematicCode := BitVec.ofNat 64 18357131245469920615 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9575290655526016 - maskLow := BitVec.ofNat 64 308496578769912087 - maskHigh := BitVec.ofNat 64 11530481685611151361 - systematicCode := BitVec.ofNat 64 18373531853940682087 }) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x6d6b. -/ -def normalizedWeightSixteenCandidateBucket_6d6b : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9574701878215680 - maskLow := BitVec.ofNat 64 1179943106666103063 - maskHigh := BitVec.ofNat 64 290346231660545 - systematicCode := BitVec.ofNat 64 16201357443978587499 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9587792938533888 - maskLow := BitVec.ofNat 64 1179943106666103063 - maskHigh := BitVec.ofNat 64 422212600397825 - systematicCode := BitVec.ofNat 64 16203870819682184555 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9640677139565696 - maskLow := BitVec.ofNat 64 1179943106666103063 - maskHigh := BitVec.ofNat 64 4512395854645249 - systematicCode := BitVec.ofNat 64 16849855848115694955 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9587827296175104 - maskLow := BitVec.ofNat 64 1179943106666103063 - maskHigh := BitVec.ofNat 64 576460821023981585 - systematicCode := BitVec.ofNat 64 17854706121575066987 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9640672575882240 - maskLow := BitVec.ofNat 64 1179943106666103063 - maskHigh := BitVec.ofNat 64 9223372041149810705 - systematicCode := BitVec.ofNat 64 18357131228357422443 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9575290593102976 - maskLow := BitVec.ofNat 64 1179943106666103063 - maskHigh := BitVec.ofNat 64 9804477128421408769 - systematicCode := BitVec.ofNat 64 18372410352080612715 }) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x6e61. -/ -def normalizedWeightSixteenCandidateBucket_6e61 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2256782647362560 - maskLow := BitVec.ofNat 64 108367870328635671 - maskHigh := BitVec.ofNat 64 305666380005377 - systematicCode := BitVec.ofNat 64 16202216239868702305 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 2326601635726336 - maskLow := BitVec.ofNat 64 108367870328635671 - maskHigh := BitVec.ofNat 64 422212834164737 - systematicCode := BitVec.ofNat 64 16203874174353043041 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 10138223226129408 - maskLow := BitVec.ofNat 64 7530300056235213079 - maskHigh := BitVec.ofNat 64 422214612549633 - systematicCode := BitVec.ofNat 64 16203880525653765729 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9082142844257280 - maskLow := BitVec.ofNat 64 108367870328635671 - maskHigh := BitVec.ofNat 64 2269392268165217 - systematicCode := BitVec.ofNat 64 16634530711938821729 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9082142744380416 - maskLow := BitVec.ofNat 64 108367870328635671 - maskHigh := BitVec.ofNat 64 9011597368361033 - systematicCode := BitVec.ofNat 64 16921630790070070881 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9082142743209984 - maskLow := BitVec.ofNat 64 108367870328635671 - maskHigh := BitVec.ofNat 64 18016597566292009 - systematicCode := BitVec.ofNat 64 17065180820579315297 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9012323856157696 - maskLow := BitVec.ofNat 64 108367870328635671 - maskHigh := BitVec.ofNat 64 29414137213747201 - systematicCode := BitVec.ofNat 64 17071711186165198433 }) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x6e67. -/ -def normalizedWeightSixteenCandidateBucket_6e67 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 45040983843032192 - maskLow := BitVec.ofNat 64 614741353431105815 - maskHigh := BitVec.ofNat 64 299095080042497 - systematicCode := BitVec.ofNat 64 16202197475156979303 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 45110802831395968 - maskLow := BitVec.ofNat 64 614741353431105815 - maskHigh := BitVec.ofNat 64 422212733894657 - systematicCode := BitVec.ofNat 64 16203874101053779559 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9084750262979712 - maskLow := BitVec.ofNat 64 614741353431105815 - maskHigh := BitVec.ofNat 64 2269392268189697 - systematicCode := BitVec.ofNat 64 16634530785238871655 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 45112452098051200 - maskLow := BitVec.ofNat 64 614741353431105815 - maskHigh := BitVec.ofNat 64 2305843026393841673 - systematicCode := BitVec.ofNat 64 18141806195427929703 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 45112452098441344 - maskLow := BitVec.ofNat 64 614741353431105815 - maskHigh := BitVec.ofNat 64 4611686027017461769 - systematicCode := BitVec.ofNat 64 18285356225937174119 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9013831762723968 - maskLow := BitVec.ofNat 64 614741353431105815 - maskHigh := BitVec.ofNat 64 6919921567090606081 - systematicCode := BitVec.ofNat 64 18301475359414447719 }) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x6e6b. -/ -def normalizedWeightSixteenCandidateBucket_6e6b : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 45040983907536000 - maskLow := BitVec.ofNat 64 2350879009782432023 - maskHigh := BitVec.ofNat 64 285952480116737 - systematicCode := BitVec.ofNat 64 16201075973296909931 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 45110802895899776 - maskLow := BitVec.ofNat 64 2350879009782432023 - maskHigh := BitVec.ofNat 64 422212533354497 - systematicCode := BitVec.ofNat 64 16203869720187399787 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9084750360775808 - maskLow := BitVec.ofNat 64 2350879009782432023 - maskHigh := BitVec.ofNat 64 9011597368379393 - systematicCode := BitVec.ofNat 64 16921630863370382955 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 45112452062678144 - maskLow := BitVec.ofNat 64 2350879009782432023 - maskHigh := BitVec.ofNat 64 576460821023965217 - systematicCode := BitVec.ofNat 64 17854706117296942699 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 45112452113006720 - maskLow := BitVec.ofNat 64 2350879009782432023 - maskHigh := BitVec.ofNat 64 4611686027017455649 - systematicCode := BitVec.ofNat 64 18285356208824675947 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9013831827227776 - maskLow := BitVec.ofNat 64 2350879009782432023 - maskHigh := BitVec.ofNat 64 5197294709621391361 - systematicCode := BitVec.ofNat 64 18300353857554378347 }) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x6e6d. -/ -def normalizedWeightSixteenCandidateBucket_6e6d : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 45040983907649792 - maskLow := BitVec.ofNat 64 4665729218250866967 - maskHigh := BitVec.ofNat 64 283762046795777 - systematicCode := BitVec.ofNat 64 16200513031933554285 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 45110802896013568 - maskLow := BitVec.ofNat 64 4665729218250866967 - maskHigh := BitVec.ofNat 64 422212499931137 - systematicCode := BitVec.ofNat 64 16203867521197829741 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9084750361149696 - maskLow := BitVec.ofNat 64 4665729218250866967 - maskHigh := BitVec.ofNat 64 18016597566302209 - systematicCode := BitVec.ofNat 64 17065180893879758445 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 45112452062791936 - maskLow := BitVec.ofNat 64 4665729218250866967 - maskHigh := BitVec.ofNat 64 576460821023957057 - systematicCode := BitVec.ofNat 64 17854706108740693613 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 45112452112730368 - maskLow := BitVec.ofNat 64 4665729218250866967 - maskHigh := BitVec.ofNat 64 2305843026393827393 - systematicCode := BitVec.ofNat 64 18141806169759182445 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9013831827341568 - maskLow := BitVec.ofNat 64 4665729218250866967 - maskHigh := BitVec.ofNat 64 2900458899662438401 - systematicCode := BitVec.ofNat 64 18156240868501909101 }) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x7573. -/ -def normalizedWeightSixteenCandidateBucket_7573 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9574685365240832 - maskLow := BitVec.ofNat 64 1585267073129447703 - maskHigh := BitVec.ofNat 64 283130686603265 - systematicCode := BitVec.ofNat 64 16199675191188092275 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9587776425559040 - maskLow := BitVec.ofNat 64 1585267073129447703 - maskHigh := BitVec.ofNat 64 422212490297345 - systematicCode := BitVec.ofNat 64 16203864248382223731 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9587810516861952 - maskLow := BitVec.ofNat 64 1585267073129447703 - maskHigh := BitVec.ofNat 64 36029896547401985 - systematicCode := BitVec.ofNat 64 17280505965312570739 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9640656098839680 - maskLow := BitVec.ofNat 64 1585267073129447703 - maskHigh := BitVec.ofNat 64 72058143802163329 - systematicCode := BitVec.ofNat 64 17424056004378195315 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9640656062907392 - maskLow := BitVec.ofNat 64 1585267073129447703 - maskHigh := BitVec.ofNat 64 9223372041149809025 - systematicCode := BitVec.ofNat 64 18357131202688284019 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9575274080128128 - maskLow := BitVec.ofNat 64 1585267073129447703 - maskHigh := BitVec.ofNat 64 9331599167547506689 - systematicCode := BitVec.ofNat 64 18370728099290117491 }) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x7673. -/ -def normalizedWeightSixteenCandidateBucket_7673 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 45040991631346816 - maskLow := BitVec.ofNat 64 3026418953888006423 - maskHigh := BitVec.ofNat 64 282860103663617 - systematicCode := BitVec.ofNat 64 16199674095971497587 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 45110810619710592 - maskLow := BitVec.ofNat 64 3026418953888006423 - maskHigh := BitVec.ofNat 64 422212486168577 - systematicCode := BitVec.ofNat 64 16203864244104099443 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 45112447002250368 - maskLow := BitVec.ofNat 64 3026418953888006423 - maskHigh := BitVec.ofNat 64 36029896547385857 - systematicCode := BitVec.ofNat 64 17280505961034446451 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9084762345999488 - maskLow := BitVec.ofNat 64 3026418953888006423 - maskHigh := BitVec.ofNat 64 144115462957973633 - systematicCode := BitVec.ofNat 64 17495831019632883315 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 45112453444698240 - maskLow := BitVec.ofNat 64 3026418953888006423 - maskHigh := BitVec.ofNat 64 4611686027017454209 - systematicCode := BitVec.ofNat 64 18285356187433727603 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9013839551038592 - maskLow := BitVec.ofNat 64 3026418953888006423 - maskHigh := BitVec.ofNat 64 4791970743158046721 - systematicCode := BitVec.ofNat 64 18298951980228966003 }) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x7675. -/ -def normalizedWeightSixteenCandidateBucket_7675 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 45040991631460608 - maskLow := BitVec.ofNat 64 5476377151177556247 - maskHigh := BitVec.ofNat 64 282731254644737 - systematicCode := BitVec.ofNat 64 16199671905538307701 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 45110810619824384 - maskLow := BitVec.ofNat 64 5476377151177556247 - maskHigh := BitVec.ofNat 64 422212484202497 - systematicCode := BitVec.ofNat 64 16203864235547850357 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 45112447002364160 - maskLow := BitVec.ofNat 64 5476377151177556247 - maskHigh := BitVec.ofNat 64 36029896547378177 - systematicCode := BitVec.ofNat 64 17280505952478197365 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9084762346373376 - maskLow := BitVec.ofNat 64 5476377151177556247 - maskHigh := BitVec.ofNat 64 288230513592770689 - systematicCode := BitVec.ofNat 64 17639381050142258805 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 45112453444421888 - maskLow := BitVec.ofNat 64 5476377151177556247 - maskHigh := BitVec.ofNat 64 2305843026393826433 - systematicCode := BitVec.ofNat 64 18141806156924614261 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9013839551152384 - maskLow := BitVec.ofNat 64 5476377151177556247 - maskHigh := BitVec.ofNat 64 2630242922020208641 - systematicCode := BitVec.ofNat 64 18155399742106662517 }) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x7a79. -/ -def normalizedWeightSixteenCandidateBucket_7a79 : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 45040991641864448 - maskLow := BitVec.ofNat 64 8070450536542961943 - maskHigh := BitVec.ofNat 64 282679715037185 - systematicCode := BitVec.ofNat 64 16199668619888327289 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 45110810630228224 - maskLow := BitVec.ofNat 64 8070450536542961943 - maskHigh := BitVec.ofNat 64 422212483416065 - systematicCode := BitVec.ofNat 64 16203864222713281145 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 45112447012768000 - maskLow := BitVec.ofNat 64 8070450536542961943 - maskHigh := BitVec.ofNat 64 36029896547375105 - systematicCode := BitVec.ofNat 64 17280505939643628153 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 45112453404887296 - maskLow := BitVec.ofNat 64 8070450536542961943 - maskHigh := BitVec.ofNat 64 576460821023953025 - systematicCode := BitVec.ofNat 64 17854706095906126457 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9084762390069504 - maskLow := BitVec.ofNat 64 8070450536542961943 - maskHigh := BitVec.ofNat 64 1152921538967111809 - systematicCode := BitVec.ofNat 64 17926481111160748665 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 9013839561556224 - maskLow := BitVec.ofNat 64 8070450536542961943 - maskHigh := BitVec.ofNat 64 1765551793565073409 - systematicCode := BitVec.ofNat 64 17940071384923011705 }) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x837f. -/ -def normalizedWeightSixteenCandidateBucket_837f : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.node - (.node - (.leaf - { patternClass := .d16Plus - affineCode := BitVec.ofNat 56 36453777734140032 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 4611686027017454123 - systematicCode := BitVec.ofNat 64 18285356187350631295 }) - (.leaf - { patternClass := .d16Plus - affineCode := BitVec.ofNat 56 36453777734148224 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 9223372041149808919 - systematicCode := BitVec.ofNat 64 18357131202588410751 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 582749769468032 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 1130581958066187 - systematicCode := BitVec.ofNat 64 16561369440961594239 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 844570975832192 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 1161084350365707 - systematicCode := BitVec.ofNat 64 16562750336969114495 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 845528745246976 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 1161084815835411 - systematicCode := BitVec.ofNat 64 16562755769817727871 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 635526327632128 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 2261150225924103 - systematicCode := BitVec.ofNat 64 16633709605176050559 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 844983292723456 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 2269392142401543 - systematicCode := BitVec.ofNat 64 16634527559820084095 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 845525519829120 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 2269392268182051 - systematicCode := BitVec.ofNat 64 16634530785089192831 }) - ) - ) - ) - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 845528753570048 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 4512395854643463 - systematicCode := BitVec.ofNat 64 16849855848015823743 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 844570963347584 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 4512395993153571 - systematicCode := BitVec.ofNat 64 16849859211260756863 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 582749756983424 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 4521475415474211 - systematicCode := BitVec.ofNat 64 16850725716953301887 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 845525532313728 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 9011597368377867 - systematicCode := BitVec.ofNat 64 16921630863287288703 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 844983284400384 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 9011597846577171 - systematicCode := BitVec.ofNat 64 16921636434111726463 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 635526319309056 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 9042937744719891 - systematicCode := BitVec.ofNat 64 16923065881167758207 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 845526622863616 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 72058143802163223 - systematicCode := BitVec.ofNat 64 17424056004278322047 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 844562973198464 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 72058144129417731 - systematicCode := BitVec.ofNat 64 17424068198110757759 }) - ) - ) - ) - ) - (.node - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 582741766834304 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 72079592868807171 - systematicCode := BitVec.ofNat 64 17427195265216054143 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 580628106053760 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 77687102162239491 - systematicCode := BitVec.ofNat 64 17431716456828928895 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 845526597666944 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 144115462957973547 - systematicCode := BitVec.ofNat 64 17495831019549787007 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 844975826927872 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 144115463624917251 - systematicCode := BitVec.ofNat 64 17495845420961727359 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 635518861836544 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 144159172840128771 - systematicCode := BitVec.ofNat 64 17499535429430510463 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 633473383661824 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 155374191439331331 - systematicCode := BitVec.ofNat 64 17504056621043385215 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 642686122330752 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 4611686027696832515 - systematicCode := BitVec.ofNat 64 18285382730854073215 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 633958748785280 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 4611730548648476675 - systematicCode := BitVec.ofNat 64 18292169019498595199 }) - ) - ) - ) - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 636072409565824 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 4622945567260017155 - systematicCode := BitVec.ofNat 64 18296690211512550271 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 636080399714944 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 4758061802544168995 - systematicCode := BitVec.ofNat 64 18298942045819667327 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 636080412199552 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 4764843590666944523 - systematicCode := BitVec.ofNat 64 18298946461112894335 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 651482215352576 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 9223372041489498115 - systematicCode := BitVec.ofNat 64 18357157746091852671 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 634027468261632 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 9223394301965320195 - systematicCode := BitVec.ofNat 64 18363944034736374655 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 636072946436352 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 9229001811271090435 - systematicCode := BitVec.ofNat 64 18368465226750329727 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 636080403908864 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 9296559928913166355 - systematicCode := BitVec.ofNat 64 18370717061057446783 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 636080412231936 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 9299950822974554119 - systematicCode := BitVec.ofNat 64 18370721476350673791 }) - ) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x857f. -/ -def normalizedWeightSixteenCandidateBucket_857f : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.node - (.leaf - { patternClass := .d16Plus - affineCode := BitVec.ofNat 56 36453777733083392 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 2305843026393826381 - systematicCode := BitVec.ofNat 64 18141806156874941823 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 582749769711872 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 565304669241357 - systematicCode := BitVec.ofNat 64 16416689112532551039 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 844570976076032 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 633318733512717 - systematicCode := BitVec.ofNat 64 16419195891267044735 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 845528745149440 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 633319771373845 - systematicCode := BitVec.ofNat 64 16419205730718549375 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 845525519975424 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 2269392268174405 - systematicCode := BitVec.ofNat 64 16634530776532944255 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 844570963493888 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 4512395991187525 - systematicCode := BitVec.ofNat 64 16849859202704508287 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 582749757129728 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 4521346566455365 - systematicCode := BitVec.ofNat 64 16850723526520112511 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 845525532557568 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 18016597566301197 - systematicCode := BitVec.ofNat 64 17065180893830088063 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 844983284302848 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 18016598614933525 - systematicCode := BitVec.ofNat 64 17065190871257417087 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 635526319211520 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 18085321337995285 - systematicCode := BitVec.ofNat 64 17067744019163481471 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 844562973344768 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 72058144095994885 - systematicCode := BitVec.ofNat 64 17424068189554509183 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 582741766980608 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 72077402435486725 - systematicCode := BitVec.ofNat 64 17427193074782864767 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 580628106200064 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 77124160798883845 - systematicCode := BitVec.ofNat 64 17431714266429162879 }) - ) - ) - ) - ) - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 845526597910784 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 288230513592770637 - systematicCode := BitVec.ofNat 64 17639381050092586367 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 844975826830336 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 288230514798690565 - systematicCode := BitVec.ofNat 64 17639399858107417983 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 635518861739008 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 288309545285976325 - systematicCode := BitVec.ofNat 64 17644213567426233727 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 633473383564288 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 308496578769920005 - systematicCode := BitVec.ofNat 64 17648734759072531839 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 642686122281984 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 2305843027609944069 - systematicCode := BitVec.ofNat 64 18141832691754894719 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 633958748736512 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 2305922723807002629 - systematicCode := BitVec.ofNat 64 18148616781409715583 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 636072409517056 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 2326109757301064709 - systematicCode := BitVec.ofNat 64 18153137973390247295 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 636080399666176 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 2596333981406330949 - systematicCode := BitVec.ofNat 64 18155389807697364351 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 636080412248320 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 2612158153692807181 - systematicCode := BitVec.ofNat 64 18155396430637204863 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 651482215255040 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 9223372041453838341 - systematicCode := BitVec.ofNat 64 18357157737468233087 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 634027468164096 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 9223391965503102981 - systematicCode := BitVec.ofNat 64 18363941827123053951 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 636072946338816 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 9228438723876618501 - systematicCode := BitVec.ofNat 64 18368463019103585663 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 636080403811328 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 9295994779902935061 - systematicCode := BitVec.ofNat 64 18370714853410702719 }) - ) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x867f. -/ -def normalizedWeightSixteenCandidateBucket_867f : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 651534025517056 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 633319771357737 - systematicCode := BitVec.ofNat 64 16419205726440425087 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 651534026411136 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 1161084815811657 - systematicCode := BitVec.ofNat 64 16562755756983355007 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 651499935108224 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 9011597840482377 - systematicCode := BitVec.ofNat 64 16921636421277353599 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 638408874790016 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 9042538312761417 - systematicCode := BitVec.ofNat 64 16923062595517974143 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 651499934214144 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 18016598610804777 - systematicCode := BitVec.ofNat 64 17065190866979292799 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 638408873895936 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 18085050755055657 - systematicCode := BitVec.ofNat 64 17067742923946886783 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 651508191595648 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 144115463524451337 - systematicCode := BitVec.ofNat 64 17495845408127354495 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 638417131277440 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 144152588655264777 - systematicCode := BitVec.ofNat 64 17499532143780726399 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 639405779061888 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 153685354464165897 - systematicCode := BitVec.ofNat 64 17504053335443736191 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 651508190701568 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 288230514731647497 - systematicCode := BitVec.ofNat 64 17639399853829293695 }) - ) - ) - ) - ) - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 638417130383360 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 288305151534432777 - systematicCode := BitVec.ofNat 64 17644212472209639039 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 639405778167808 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 307370683158110217 - systematicCode := BitVec.ofNat 64 17648733663872648831 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 704272906863616 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 2305843027538624521 - systematicCode := BitVec.ofNat 64 18141832687443084927 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 638817605272576 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 2305918050882568201 - systematicCode := BitVec.ofNat 64 18148615677603055231 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 637897140093952 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 2324983582512120841 - systematicCode := BitVec.ofNat 64 18153136869566875263 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 637889416283136 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 2595203683385868361 - systematicCode := BitVec.ofNat 64 18155388703873992319 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 704272905937024 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 4611686027589853193 - systematicCode := BitVec.ofNat 64 18285382717918643839 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 638817604345984 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 4611723539261825033 - systematicCode := BitVec.ofNat 64 18292165708078614143 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 637897139167360 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 4621256305076601353 - systematicCode := BitVec.ofNat 64 18296686900042434175 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 637889415356544 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 4756366355513475113 - systematicCode := BitVec.ofNat 64 18298938734349551231 }) - ) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x897f. -/ -def normalizedWeightSixteenCandidateBucket_897f : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.node - (.leaf - { patternClass := .d16Plus - affineCode := BitVec.ofNat 56 36453777593671936 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 576460821023953009 - systematicCode := BitVec.ofNat 64 17854706095856716159 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 582749788438784 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 565253129633841 - systematicCode := BitVec.ofNat 64 16416685826882832767 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 844570994802944 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 633318732726321 - systematicCode := BitVec.ofNat 64 16419195878432737663 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 582749788341248 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 1130401569439825 - systematicCode := BitVec.ofNat 64 16561363964878686591 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 844570994705408 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 1161084347613265 - systematicCode := BitVec.ofNat 64 16562750315578558847 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 845525551186944 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 9011597368367185 - systematicCode := BitVec.ofNat 64 16921630841896733055 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 845525551284480 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 18016597566298161 - systematicCode := BitVec.ofNat 64 17065180880995780991 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 844562942133248 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 72058143895457809 - systematicCode := BitVec.ofNat 64 17424063791575370111 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 582741735769088 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 72064259835564049 - systematicCode := BitVec.ofNat 64 17426067192056154495 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 580628074988544 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 73746512618749969 - systematicCode := BitVec.ofNat 64 17430588383769299327 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 642686066101248 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 576460822641934353 - systematicCode := BitVec.ofNat 64 17854728232689895807 }) - ) - ) - ) - ) - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 633958692555776 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 576566855176585233 - systematicCode := BitVec.ofNat 64 17860390803371624831 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 636072353336320 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 603482899831853073 - systematicCode := BitVec.ofNat 64 17864911995285309823 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 845526624960768 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 1152921538967111793 - systematicCode := BitVec.ofNat 64 17926481111111338367 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 844975764407296 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 1152921540577263889 - systematicCode := BitVec.ofNat 64 17926504351532157311 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 635518799315968 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 1153027062018605329 - systematicCode := BitVec.ofNat 64 17932448341557348735 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 633473321141248 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 1179943106666104849 - systematicCode := BitVec.ofNat 64 17936969533270493567 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 636080405908480 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 1738424641073971281 - systematicCode := BitVec.ofNat 64 17940065865807202687 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 636080406006016 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 1747467025237671985 - systematicCode := BitVec.ofNat 64 17940068073453816191 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 651482152832000 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 9223372041250932753 - systematicCode := BitVec.ofNat 64 18357153339354351999 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 634027405741056 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 9223378668284348433 - systematicCode := BitVec.ofNat 64 18362815910036081023 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 636072883915776 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 9225060921075302673 - systematicCode := BitVec.ofNat 64 18367337101949766015 }) - ) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x8a7f. -/ -def normalizedWeightSixteenCandidateBucket_8a7f : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 638408939293824 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 2260699254358113 - systematicCode := BitVec.ofNat 64 16633703033876548223 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 651499999612032 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 2269392135520353 - systematicCode := BitVec.ofNat 64 16634527534151404159 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 651534090914944 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 4512395854616673 - systematicCode := BitVec.ofNat 64 16849855822347143807 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 651508320603264 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 144115463122587681 - systematicCode := BitVec.ofNat 64 17495841010148215423 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 638417260285056 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 144126251915808801 - systematicCode := BitVec.ofNat 64 17498406261054016127 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 639405908069504 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 146930006563504161 - systematicCode := BitVec.ofNat 64 17502927452783872639 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 704273035871232 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 576460822369288225 - systematicCode := BitVec.ofNat 64 17854728228378086015 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 638817734280192 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 576548988112617505 - systematicCode := BitVec.ofNat 64 17860389699564964479 }) - ) - ) - ) - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 637897269101568 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 598979025322381345 - systematicCode := BitVec.ofNat 64 17864910891461937791 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 651508205266944 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 1152921540308894241 - systematicCode := BitVec.ofNat 64 17926504347254033023 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 638417144948736 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 1153009474127528481 - systematicCode := BitVec.ofNat 64 17932447246340754047 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 639405792733184 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 1175439511333767201 - systematicCode := BitVec.ofNat 64 17936968438070610559 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 637889484948480 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 1733903448992120929 - systematicCode := BitVec.ofNat 64 17940064761983830655 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 704272916340864 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 4611686027185621025 - systematicCode := BitVec.ofNat 64 18285378319804762751 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 638817614749824 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 4611697047903537185 - systematicCode := BitVec.ofNat 64 18291039790991641215 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 637897149571200 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 4614500802554757665 - systematicCode := BitVec.ofNat 64 18295560982888614527 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x8c7f. -/ -def normalizedWeightSixteenCandidateBucket_8c7f : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 651508320717056 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 288230513793044545 - systematicCode := BitVec.ofNat 64 17639393256860585087 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 638417260398848 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 288243639012823105 - systematicCode := BitVec.ofNat 64 17642523648119573631 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 639405908183296 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 291608144592773185 - systematicCode := BitVec.ofNat 64 17647044839882853503 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 704273035952512 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 576460821830312001 - systematicCode := BitVec.ofNat 64 17854726029321145471 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 638817734361472 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 576513666301567041 - systematicCode := BitVec.ofNat 64 17859826741021478015 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 637897269182848 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 589971688626589761 - systematicCode := BitVec.ofNat 64 17864347932885027967 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 651508206274816 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 1152921539772154945 - systematicCode := BitVec.ofNat 64 17926502148264463487 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 638417145956608 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 1152974298345374785 - systematicCode := BitVec.ofNat 64 17931884304977398911 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 639405793741056 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 1166432320669091905 - systematicCode := BitVec.ofNat 64 17936405496740678783 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 704272917348736 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 2305843026595416129 - systematicCode := BitVec.ofNat 64 18141826090272263295 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 638817615757696 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 2305856237713229889 - systematicCode := BitVec.ofNat 64 18146926801972595839 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 637897150579072 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 2309220743294485569 - systematicCode := BitVec.ofNat 64 18151447993836145791 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x8f7f. -/ -def normalizedWeightSixteenCandidateBucket_8f7f : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 915485737372800 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 72057688535629953 - systematicCode := BitVec.ofNat 64 17422391498915090303 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 653664531008640 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 72058143795216513 - systematicCode := BitVec.ofNat 64 17424049433399431039 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 651550870228096 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 72058143802136193 - systematicCode := BitVec.ofNat 64 17424055978693922687 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 639924365722624 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 144115278274379905 - systematicCode := BitVec.ofNat 64 17494449088641208191 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 845017644041216 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 144115462955155585 - systematicCode := BitVec.ofNat 64 17495825552443805567 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 845529013584896 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 144115462957962625 - systematicCode := BitVec.ofNat 64 17495830998243446655 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 639924365820160 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 288230457758195841 - systematicCode := BitVec.ofNat 64 17638562077660123007 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 845017644138752 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 288230513591918721 - systematicCode := BitVec.ofNat 64 17639377781976174463 }) - ) - ) - ) - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 845529013682432 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 288230513592767361 - systematicCode := BitVec.ofNat 64 17639381037309071231 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 639407250278656 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 504403226986025089 - systematicCode := BitVec.ofNat 64 17650435733742718847 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 703967019483520 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 576460821024006273 - systematicCode := BitVec.ofNat 64 17854706121912848255 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 704273841209728 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 576460821037584513 - systematicCode := BitVec.ofNat 64 17854712783641808767 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 638818539618688 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 576461714377150593 - systematicCode := BitVec.ofNat 64 17856435847161220991 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 639924374143232 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 1152921534672144513 - systematicCode := BitVec.ofNat 64 17925666553837621119 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 845017652461824 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 1152921538967046273 - systematicCode := BitVec.ofNat 64 17926477860174270335 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 845529022005504 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 1152921538967111553 - systematicCode := BitVec.ofNat 64 17926481098327560063 }) - ) - ) - ) - ) - (.node - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 639407125432576 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 1369094303900763265 - systematicCode := BitVec.ofNat 64 17938666092647190399 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 639407124424704 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 1513209483386552961 - systematicCode := BitVec.ofNat 64 17939229033976991615 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 633456808166400 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 1585267073129447809 - systematicCode := BitVec.ofNat 64 17939230129176809343 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 703966894637440 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 2305843026393876609 - systematicCode := BitVec.ofNat 64 18141806200110944127 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 704273716363648 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 2305843026406671489 - systematicCode := BitVec.ofNat 64 18141817259819306879 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 638818414772608 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 2305843868207416449 - systematicCode := BitVec.ofNat 64 18144666206065692543 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 703966893629568 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 4611686027017496705 - systematicCode := BitVec.ofNat 64 18285356239176568703 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 704273715355776 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 4611686027028333185 - systematicCode := BitVec.ofNat 64 18285369489351675775 }) - ) - ) - ) - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 638818413764736 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 4611686739982025345 - systematicCode := BitVec.ofNat 64 18288779195084607359 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 633456810280064 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 7493990329708740737 - systematicCode := BitVec.ofNat 64 18301493977815093119 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 651533822462976 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 9223372041149835393 - systematicCode := BitVec.ofNat 64 18357131254431190911 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 651465639857152 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 9223372041156559233 - systematicCode := BitVec.ofNat 64 18357144508901199743 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 634010892766208 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 9223372483531440513 - systematicCode := BitVec.ofNat 64 18360555314128981887 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 640513080609920 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 12105676073254011009 - systematicCode := BitVec.ofNat 64 18373551567541211007 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 640513080707456 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 14411518945026646145 - systematicCode := BitVec.ofNat 64 18374114508871012223 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 640513089030528 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 16140901098856122497 - systematicCode := BitVec.ofNat 64 18374118889670283135 }) - ) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x917f. -/ -def normalizedWeightSixteenCandidateBucket_917f : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .d16Plus - affineCode := BitVec.ofNat 56 36453758683652352 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 36029896547374849 - systematicCode := BitVec.ofNat 64 17280505939594744191 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 582745793364224 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 564222337483521 - systematicCode := BitVec.ofNat 64 16415844700488110463 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 844566999728384 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 633318716998401 - systematicCode := BitVec.ofNat 64 16419192592783282559 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 582745793266688 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 1127309192987905 - systematicCode := BitVec.ofNat 64 16559962087553798527 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 844566999630848 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 1161084300428545 - systematicCode := BitVec.ofNat 64 16562744839495782783 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 582745730843648 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 4505111590080769 - systematicCode := BitVec.ofNat 64 16848192480818532735 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 844566937207808 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 4512395743465729 - systematicCode := BitVec.ofNat 64 16849849315808022911 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 580615557088256 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 6193549016072449 - systematicCode := BitVec.ofNat 64 16854127665959833983 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 642670352141312 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 36029898275455233 - systematicCode := BitVec.ofNat 64 17280519280334377343 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 633942978595840 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 36143146245062913 - systematicCode := BitVec.ofNat 64 17283930085562159487 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 636073152351232 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 468383157473775873 - systematicCode := BitVec.ofNat 64 17650433595083886975 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 636073214774272 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 1333100674610627841 - systematicCode := BitVec.ofNat 64 17938663988482314623 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 636073214871808 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 1477251047595442945 - systematicCode := BitVec.ofNat 64 17939226947059093887 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x927f. -/ -def normalizedWeightSixteenCandidateBucket_927f : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 638425452268672 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 2253483709302273 - systematicCode := BitVec.ofNat 64 16632020781086577279 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 651516512586880 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 2269392025421313 - systematicCode := BitVec.ofNat 64 16634520962851967615 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 638425516772480 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 9008986028249601 - systematicCode := BitVec.ofNat 64 16920251174351311487 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 651516577090688 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 9011597328519681 - systematicCode := BitVec.ofNat 64 16921625439164207743 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 639421888367744 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 11823048550269441 - systematicCode := BitVec.ofNat 64 16926466734974407295 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 704289016169472 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 36029897939894785 - systematicCode := BitVec.ofNat 64 17280519276022567551 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 638833714578432 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 36121156012491265 - systematicCode := BitVec.ofNat 64 17283928981755499135 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 637906058265600 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 396321165322228225 - systematicCode := BitVec.ofNat 64 17650152115795432063 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 637905997923328 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 1261025488118220289 - systematicCode := BitVec.ofNat 64 17938382509193859711 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x947f. -/ -def normalizedWeightSixteenCandidateBucket_947f : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 638425516886272 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 18016322688390145 - systematicCode := BitVec.ofNat 64 17064366370983548031 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 651516577204480 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 18016597562102785 - systematicCode := BitVec.ofNat 64 17065177677320197247 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 639421888481536 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 21393197758424065 - systematicCode := BitVec.ofNat 64 17070584122073388159 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 704289016250752 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 36029897369461761 - systematicCode := BitVec.ofNat 64 17280517076965627007 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 638833714659712 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 36083772617139201 - systematicCode := BitVec.ofNat 64 17283366023212012671 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 637906058346880 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 252203778189562881 - systematicCode := BitVec.ofNat 64 17506036919096087679 }) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x977f. -/ -def normalizedWeightSixteenCandidateBucket_977f : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 915485471034496 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 4504725043054593 - systematicCode := BitVec.ofNat 64 16848182546559571839 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 653664264670336 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 4512395737597953 - systematicCode := BitVec.ofNat 64 16849849277002717055 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 639916908250112 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 9008320308332545 - systematicCode := BitVec.ofNat 64 16920240136285689727 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 845010186568704 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 9011597318375425 - systematicCode := BitVec.ofNat 64 16921625396047091583 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 639916908347648 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 18015510939576321 - systematicCode := BitVec.ofNat 64 17064353125304604543 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 845010186666240 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 18016597549721601 - systematicCode := BitVec.ofNat 64 17065177625579460479 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 639421898885376 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 31526296920004609 - systematicCode := BitVec.ofNat 64 17071714420026546047 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 703979803722112 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 36029896547428353 - systematicCode := BitVec.ofNat 64 17280505965516134271 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 704289022493056 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 36029896765478913 - systematicCode := BitVec.ofNat 64 17280512661739050879 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 638833720902016 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 36044190198536193 - systematicCode := BitVec.ofNat 64 17282235725258463103 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 633473589593216 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 6953566620887320577 - systematicCode := BitVec.ofNat 64 18301485216216029055 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 640505623137408 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 11565248241201072129 - systematicCode := BitVec.ofNat 64 18373542805942146943 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 640505623234944 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 13871089051357947905 - systematicCode := BitVec.ofNat 64 18374105747271948159 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x9b7f. -/ -def normalizedWeightSixteenCandidateBucket_9b7f : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 915485535538304 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 1127077264793601 - systematicCode := BitVec.ofNat 64 16559956568521481087 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 653664329174144 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 1161084296929281 - systematicCode := BitVec.ofNat 64 16562744817937718143 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 639916845827072 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 2252972608217089 - systematicCode := BitVec.ofNat 64 16632014158247598975 }) - ) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 845010124145664 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 2269392017645569 - systematicCode := BitVec.ofNat 64 16634520936982092671 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 633473654097024 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 5224210752658776065 - systematicCode := BitVec.ofNat 64 18300359333556165503 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 640505560714368 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 9835879178631667713 - systematicCode := BitVec.ofNat 64 18372416923282283391 }) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0x9d7f. -/ -def normalizedWeightSixteenCandidateBucket_9d7f : - NormalizedWeightSixteenCandidateTree := - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 915485535652096 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 564136438185985 - systematicCode := BitVec.ofNat 64 16415841389069114751 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 653664329287936 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 633318715736065 - systematicCode := BitVec.ofNat 64 16419192579848838527 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 633473654210816 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 2918402928354050049 - systematicCode := BitVec.ofNat 64 18156244154103799167 }) - ) - ) - -/-- Generated candidate shard for systematic prefix 0xa17f. -/ -def normalizedWeightSixteenCandidateBucket_a17f : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .d16Plus - affineCode := BitVec.ofNat 56 36451065470722304 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 422212483350529 - systematicCode := BitVec.ofNat 64 16203864222665449855 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 581143502127360 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 283846872596481 - systematicCode := BitVec.ofNat 64 16200516343305511295 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 581143502029824 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 286182798065665 - systematicCode := BitVec.ofNat 64 16201081492248764799 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 581143439606784 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 299479614947329 - systematicCode := BitVec.ofNat 64 16202207409268629887 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 581126926631936 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 305664257753089 - systematicCode := BitVec.ofNat 64 16202216239621120383 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 642840808655872 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 422214218350593 - systematicCode := BitVec.ofNat 64 16203877494417170815 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 634045252504576 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 29414135091494913 - systematicCode := BitVec.ofNat 64 17071711185917616511 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 634061765479424 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 434738101664940033 - systematicCode := BitVec.ofNat 64 17650423738134995327 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 634061827902464 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 1306184629962997761 - systematicCode := BitVec.ofNat 64 17938658512400064895 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 634061828000000 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 1459307017830334465 - systematicCode := BitVec.ofNat 64 17939223661410165119 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0xa27f. -/ -def normalizedWeightSixteenCandidateBucket_a27f : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 640470930443392 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 290855454113793 - systematicCode := BitVec.ofNat 64 16201364066720326271 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 640470994947200 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 317346611855361 - systematicCode := BitVec.ofNat 64 16202489983740191359 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 640478718758016 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 327654486179841 - systematicCode := BitVec.ofNat 64 16202498814109393535 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 705925398709248 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 422213878677505 - systematicCode := BitVec.ofNat 64 16203877490105361023 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 639958727574528 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 23784635553153025 - systematicCode := BitVec.ofNat 64 17071428611429212799 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 639951536440320 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 361554607653126145 - systematicCode := BitVec.ofNat 64 17650141163629879935 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 639951476098048 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 1229623436029329409 - systematicCode := BitVec.ofNat 64 17938375937894949503 }) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0xa47f. -/ -def normalizedWeightSixteenCandidateBucket_a47f : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 640470995060992 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 352668389474305 - systematicCode := BitVec.ofNat 64 16203052942249993343 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 640478718871808 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 365037879558145 - systematicCode := BitVec.ofNat 64 16203061772652618879 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 705925398790528 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 422213306286081 - systematicCode := BitVec.ofNat 64 16203875291048420479 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 639958727655808 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 14214486343024641 - systematicCode := BitVec.ofNat 64 16927311224329970815 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 639951536521600 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 216876469590425601 - systematicCode := BitVec.ofNat 64 17506023776497214591 }) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0xa77f. -/ -def normalizedWeightSixteenCandidateBucket_a77f : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 915383197125760 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 299093075689473 - systematicCode := BitVec.ofNat 64 16202197475009668991 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 637871430075392 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 316680895463425 - systematicCode := BitVec.ofNat 64 16202478945674569599 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 637871430172928 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 351856641966081 - systematicCode := BitVec.ofNat 64 16203039696571049855 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 640478729275648 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 404620297371649 - systematicCode := BitVec.ofNat 64 16203066187878803327 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 705923007988096 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 422212497047553 - systematicCode := BitVec.ofNat 64 16203864248586839935 }) - ) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 705925405032832 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 422212701519873 - systematicCode := BitVec.ofNat 64 16203870875821844351 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 639958733898112 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 4081387180654593 - systematicCode := BitVec.ofNat 64 16637954948271220607 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 635553159070848 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 6919921565086253057 - systematicCode := BitVec.ofNat 64 18301475359267137407 }) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 638460144962688 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 11530481683535495169 - systematicCode := BitVec.ofNat 64 18373531853776594815 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 638460145060224 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 13835761742760116225 - systematicCode := BitVec.ofNat 64 18374092604673075071 }) - ) - ) - ) - ) - -/-- Generated candidate shard for systematic prefix 0xab7f. -/ -def normalizedWeightSixteenCandidateBucket_ab7f : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 915383261629568 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 285950879989761 - systematicCode := BitVec.ofNat 64 16201075973216447359 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 637871367652352 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 290344358903809 - systematicCode := BitVec.ofNat 64 16201357443881347967 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 635553223574656 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 5197294708021264385 - systematicCode := BitVec.ofNat 64 18300353857473915775 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 638460082539648 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 9804477126548652033 - systematicCode := BitVec.ofNat 64 18372410351983373183 }) - ) - ) - -/-- Generated candidate shard for systematic prefix 0xad7f. -/ -def normalizedWeightSixteenCandidateBucket_ad7f : - NormalizedWeightSixteenCandidateTree := - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 915383261743360 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 283760985636865 - systematicCode := BitVec.ofNat 64 16200513031886515583 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 635553223688448 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 2900458898601279489 - systematicCode := BitVec.ofNat 64 18156240868454870399 }) - ) - -/-- Generated candidate shard for systematic prefix 0xb37f. -/ -def normalizedWeightSixteenCandidateBucket_b37f : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 915390985440384 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 282858660823041 - systematicCode := BitVec.ofNat 64 16199674095891559295 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 637854854677504 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 283128908218369 - systematicCode := BitVec.ofNat 64 16199675191091377023 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 635560947385472 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 4791970741715206145 - systematicCode := BitVec.ofNat 64 18298951980149027711 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 638443569564800 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 9331599165769121793 - systematicCode := BitVec.ofNat 64 18370728099193402239 }) - ) - ) - -/-- Generated candidate shard for systematic prefix 0xb57f. -/ -def normalizedWeightSixteenCandidateBucket_b57f : - NormalizedWeightSixteenCandidateTree := - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 915390985554176 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 282730382229505 - systematicCode := BitVec.ofNat 64 16199671905491793279 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 635560947499264 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 2630242921147793409 - systematicCode := BitVec.ofNat 64 18155399742060148095 }) - ) - -/-- Generated candidate shard for systematic prefix 0xb97f. -/ -def normalizedWeightSixteenCandidateBucket_b97f : - NormalizedWeightSixteenCandidateTree := - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 915390995958016 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 282679446601729 - systematicCode := BitVec.ofNat 64 16199668619842075007 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 635560957903104 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 1765551793296637953 - systematicCode := BitVec.ofNat 64 17940071384876759423 }) - ) - -/-- Generated candidate shard for systematic prefix 0xbf7f. -/ -def normalizedWeightSixteenCandidateBucket_bf7f : - NormalizedWeightSixteenCandidateTree := - (.node - (.node - (.node - (.node - (.node - (.leaf - { patternClass := .d16Plus - affineCode := BitVec.ofNat 56 36036515227312384 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 282675420069889 - systematicCode := BitVec.ofNat 64 16199668607058296703 }) - (.leaf - { patternClass := .d16Plus - affineCode := BitVec.ofNat 56 36170086419038336 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 16753531353454084097 - systematicCode := BitVec.ofNat 64 18374119097041403775 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 849924671488384 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 283573068234753 - systematicCode := BitVec.ofNat 64 16199675242934157183 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 849927068533120 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 296973366198273 - systematicCode := BitVec.ofNat 64 16201371815095287679 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 849927062290816 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 336607324405761 - systematicCode := BitVec.ofNat 64 16202502113098776447 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 849927062209536 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 374119568769025 - systematicCode := BitVec.ofNat 64 16203065071675555711 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 655931868974080 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 396380384264193 - systematicCode := BitVec.ofNat 64 16203066175498862463 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 849415698989440 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 3941854412275713 - systematicCode := BitVec.ofNat 64 16637954884251402111 }) - ) - ) - ) - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 849415692747136 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 14075005113466881 - systematicCode := BitVec.ofNat 64 16927311160360091519 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 849415692665856 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 23645283170648065 - systematicCode := BitVec.ofNat 64 17071428547492626303 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 655863686368256 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 29275053287800833 - systematicCode := BitVec.ofNat 64 17071711121997676415 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 849408501612928 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 216738019137290241 - systematicCode := BitVec.ofNat 64 17506023725311770495 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 849408501531648 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 361418347599888385 - systematicCode := BitVec.ofNat 64 17650141121000685439 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 655880199343104 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 434606235296202753 - systematicCode := BitVec.ofNat 64 17650423699783925631 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 849408441189376 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 1229500318375477249 - systematicCode := BitVec.ofNat 64 17938375912311668607 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 655880261766144 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 1306079099931852801 - systematicCode := BitVec.ofNat 64 17938658491094908799 }) - ) - ) - ) - ) - (.node - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 655880261863680 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 1459236663044603905 - systematicCode := BitVec.ofNat 64 17939223648627965823 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 849959297548544 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 1693494199527145473 - systematicCode := BitVec.ofNat 64 17939230336648986495 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 849961161916672 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 1761048193937702913 - systematicCode := BitVec.ofNat 64 17940068134343917439 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 849381609767168 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 1765534201379028993 - systematicCode := BitVec.ofNat 64 17940071372497207167 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 849961151512832 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 2615606223231254529 - systematicCode := BitVec.ofNat 64 18155396474280591231 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 849381599363328 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 2630185747415564289 - systematicCode := BitVec.ofNat 64 18155399729613487999 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 849373875552512 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 2900389355551981569 - systematicCode := BitVec.ofNat 64 18156240855873994623 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 849961151399040 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 4767763895160930305 - systematicCode := BitVec.ofNat 64 18298946513346215807 }) - ) - ) - ) - (.node - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 849381599249536 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 4791876185158057985 - systematicCode := BitVec.ofNat 64 18298951959145856895 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 849373875438720 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 5197189843699892225 - systematicCode := BitVec.ofNat 64 18300353836336529279 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 849373810934912 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 6919790209810825217 - systematicCode := BitVec.ofNat 64 18301475321016729471 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 655966499261568 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 9301762820016177153 - systematicCode := BitVec.ofNat 64 18370721528600838015 }) - ) - ) - (.node - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 655898316655744 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 9331482619314962433 - systematicCode := BitVec.ofNat 64 18370728073895329663 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 655914829630592 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 9804354395435958273 - systematicCode := BitVec.ofNat 64 18372410326551084927 }) - ) - (.node - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 655914892053632 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 11530345655406952449 - systematicCode := BitVec.ofNat 64 18373531811231285119 }) - (.leaf - { patternClass := .f16 - affineCode := BitVec.ofNat 56 655914892151168 - maskLow := BitVec.ofNat 64 9223372041149808919 - maskHigh := BitVec.ofNat 64 13835623378205016065 - systematicCode := BitVec.ofNat 64 18374092553537961855 }) - ) - ) - ) - ) - ) - -/-- Select the generated candidate shard determined by the first two sorted columns. -/ -def normalizedWeightSixteenCandidateBucket (codePrefix : BitVec 16) : - Option NormalizedWeightSixteenCandidateTree := - match codePrefix.toNat with - | 2823 => some normalizedWeightSixteenCandidateBucket_0b07 - | 3335 => some normalizedWeightSixteenCandidateBucket_0d07 - | 3339 => some normalizedWeightSixteenCandidateBucket_0d0b - | 3591 => some normalizedWeightSixteenCandidateBucket_0e07 - | 3595 => some normalizedWeightSixteenCandidateBucket_0e0b - | 3597 => some normalizedWeightSixteenCandidateBucket_0e0d - | 4871 => some normalizedWeightSixteenCandidateBucket_1307 - | 4875 => some normalizedWeightSixteenCandidateBucket_130b - | 5383 => some normalizedWeightSixteenCandidateBucket_1507 - | 5389 => some normalizedWeightSixteenCandidateBucket_150d - | 5395 => some normalizedWeightSixteenCandidateBucket_1513 - | 5639 => some normalizedWeightSixteenCandidateBucket_1607 - | 5646 => some normalizedWeightSixteenCandidateBucket_160e - | 5651 => some normalizedWeightSixteenCandidateBucket_1613 - | 5653 => some normalizedWeightSixteenCandidateBucket_1615 - | 6411 => some normalizedWeightSixteenCandidateBucket_190b - | 6413 => some normalizedWeightSixteenCandidateBucket_190d - | 6419 => some normalizedWeightSixteenCandidateBucket_1913 - | 6421 => some normalizedWeightSixteenCandidateBucket_1915 - | 6667 => some normalizedWeightSixteenCandidateBucket_1a0b - | 6670 => some normalizedWeightSixteenCandidateBucket_1a0e - | 6675 => some normalizedWeightSixteenCandidateBucket_1a13 - | 6678 => some normalizedWeightSixteenCandidateBucket_1a16 - | 6681 => some normalizedWeightSixteenCandidateBucket_1a19 - | 7181 => some normalizedWeightSixteenCandidateBucket_1c0d - | 7182 => some normalizedWeightSixteenCandidateBucket_1c0e - | 7189 => some normalizedWeightSixteenCandidateBucket_1c15 - | 7190 => some normalizedWeightSixteenCandidateBucket_1c16 - | 7193 => some normalizedWeightSixteenCandidateBucket_1c19 - | 7194 => some normalizedWeightSixteenCandidateBucket_1c1a - | 8967 => some normalizedWeightSixteenCandidateBucket_2307 - | 8971 => some normalizedWeightSixteenCandidateBucket_230b - | 8979 => some normalizedWeightSixteenCandidateBucket_2313 - | 8988 => some normalizedWeightSixteenCandidateBucket_231c - | 8991 => some normalizedWeightSixteenCandidateBucket_231f - | 9479 => some normalizedWeightSixteenCandidateBucket_2507 - | 9485 => some normalizedWeightSixteenCandidateBucket_250d - | 9493 => some normalizedWeightSixteenCandidateBucket_2515 - | 9498 => some normalizedWeightSixteenCandidateBucket_251a - | 9503 => some normalizedWeightSixteenCandidateBucket_251f - | 9507 => some normalizedWeightSixteenCandidateBucket_2523 - | 9735 => some normalizedWeightSixteenCandidateBucket_2607 - | 9742 => some normalizedWeightSixteenCandidateBucket_260e - | 9750 => some normalizedWeightSixteenCandidateBucket_2616 - | 9753 => some normalizedWeightSixteenCandidateBucket_2619 - | 9759 => some normalizedWeightSixteenCandidateBucket_261f - | 9763 => some normalizedWeightSixteenCandidateBucket_2623 - | 9765 => some normalizedWeightSixteenCandidateBucket_2625 - | 10507 => some normalizedWeightSixteenCandidateBucket_290b - | 10509 => some normalizedWeightSixteenCandidateBucket_290d - | 10518 => some normalizedWeightSixteenCandidateBucket_2916 - | 10521 => some normalizedWeightSixteenCandidateBucket_2919 - | 10527 => some normalizedWeightSixteenCandidateBucket_291f - | 10531 => some normalizedWeightSixteenCandidateBucket_2923 - | 10533 => some normalizedWeightSixteenCandidateBucket_2925 - | 10763 => some normalizedWeightSixteenCandidateBucket_2a0b - | 10766 => some normalizedWeightSixteenCandidateBucket_2a0e - | 10773 => some normalizedWeightSixteenCandidateBucket_2a15 - | 10778 => some normalizedWeightSixteenCandidateBucket_2a1a - | 10783 => some normalizedWeightSixteenCandidateBucket_2a1f - | 10787 => some normalizedWeightSixteenCandidateBucket_2a23 - | 10790 => some normalizedWeightSixteenCandidateBucket_2a26 - | 10793 => some normalizedWeightSixteenCandidateBucket_2a29 - | 11277 => some normalizedWeightSixteenCandidateBucket_2c0d - | 11278 => some normalizedWeightSixteenCandidateBucket_2c0e - | 11283 => some normalizedWeightSixteenCandidateBucket_2c13 - | 11292 => some normalizedWeightSixteenCandidateBucket_2c1c - | 11295 => some normalizedWeightSixteenCandidateBucket_2c1f - | 11301 => some normalizedWeightSixteenCandidateBucket_2c25 - | 11302 => some normalizedWeightSixteenCandidateBucket_2c26 - | 11305 => some normalizedWeightSixteenCandidateBucket_2c29 - | 11306 => some normalizedWeightSixteenCandidateBucket_2c2a - | 12051 => some normalizedWeightSixteenCandidateBucket_2f13 - | 12053 => some normalizedWeightSixteenCandidateBucket_2f15 - | 12054 => some normalizedWeightSixteenCandidateBucket_2f16 - | 12057 => some normalizedWeightSixteenCandidateBucket_2f19 - | 12058 => some normalizedWeightSixteenCandidateBucket_2f1a - | 12060 => some normalizedWeightSixteenCandidateBucket_2f1c - | 12063 => some normalizedWeightSixteenCandidateBucket_2f1f - | 12558 => some normalizedWeightSixteenCandidateBucket_310e - | 12563 => some normalizedWeightSixteenCandidateBucket_3113 - | 12565 => some normalizedWeightSixteenCandidateBucket_3115 - | 12569 => some normalizedWeightSixteenCandidateBucket_3119 - | 12575 => some normalizedWeightSixteenCandidateBucket_311f - | 12579 => some normalizedWeightSixteenCandidateBucket_3123 - | 12581 => some normalizedWeightSixteenCandidateBucket_3125 - | 12585 => some normalizedWeightSixteenCandidateBucket_3129 - | 12591 => some normalizedWeightSixteenCandidateBucket_312f - | 12813 => some normalizedWeightSixteenCandidateBucket_320d - | 12819 => some normalizedWeightSixteenCandidateBucket_3213 - | 12822 => some normalizedWeightSixteenCandidateBucket_3216 - | 12826 => some normalizedWeightSixteenCandidateBucket_321a - | 12831 => some normalizedWeightSixteenCandidateBucket_321f - | 12835 => some normalizedWeightSixteenCandidateBucket_3223 - | 12838 => some normalizedWeightSixteenCandidateBucket_3226 - | 12842 => some normalizedWeightSixteenCandidateBucket_322a - | 12847 => some normalizedWeightSixteenCandidateBucket_322f - | 12849 => some normalizedWeightSixteenCandidateBucket_3231 - | 13323 => some normalizedWeightSixteenCandidateBucket_340b - | 13333 => some normalizedWeightSixteenCandidateBucket_3415 - | 13334 => some normalizedWeightSixteenCandidateBucket_3416 - | 13340 => some normalizedWeightSixteenCandidateBucket_341c - | 13343 => some normalizedWeightSixteenCandidateBucket_341f - | 13349 => some normalizedWeightSixteenCandidateBucket_3425 - | 13350 => some normalizedWeightSixteenCandidateBucket_3426 - | 13356 => some normalizedWeightSixteenCandidateBucket_342c - | 13359 => some normalizedWeightSixteenCandidateBucket_342f - | 13361 => some normalizedWeightSixteenCandidateBucket_3431 - | 13362 => some normalizedWeightSixteenCandidateBucket_3432 - | 14091 => some normalizedWeightSixteenCandidateBucket_370b - | 14093 => some normalizedWeightSixteenCandidateBucket_370d - | 14094 => some normalizedWeightSixteenCandidateBucket_370e - | 14105 => some normalizedWeightSixteenCandidateBucket_3719 - | 14106 => some normalizedWeightSixteenCandidateBucket_371a - | 14108 => some normalizedWeightSixteenCandidateBucket_371c - | 14111 => some normalizedWeightSixteenCandidateBucket_371f - | 14121 => some normalizedWeightSixteenCandidateBucket_3729 - | 14122 => some normalizedWeightSixteenCandidateBucket_372a - | 14124 => some normalizedWeightSixteenCandidateBucket_372c - | 14127 => some normalizedWeightSixteenCandidateBucket_372f - | 14343 => some normalizedWeightSixteenCandidateBucket_3807 - | 14361 => some normalizedWeightSixteenCandidateBucket_3819 - | 14362 => some normalizedWeightSixteenCandidateBucket_381a - | 14364 => some normalizedWeightSixteenCandidateBucket_381c - | 14367 => some normalizedWeightSixteenCandidateBucket_381f - | 14377 => some normalizedWeightSixteenCandidateBucket_3829 - | 14378 => some normalizedWeightSixteenCandidateBucket_382a - | 14380 => some normalizedWeightSixteenCandidateBucket_382c - | 14383 => some normalizedWeightSixteenCandidateBucket_382f - | 14385 => some normalizedWeightSixteenCandidateBucket_3831 - | 14386 => some normalizedWeightSixteenCandidateBucket_3832 - | 14388 => some normalizedWeightSixteenCandidateBucket_3834 - | 14391 => some normalizedWeightSixteenCandidateBucket_3837 - | 15111 => some normalizedWeightSixteenCandidateBucket_3b07 - | 15117 => some normalizedWeightSixteenCandidateBucket_3b0d - | 15118 => some normalizedWeightSixteenCandidateBucket_3b0e - | 15125 => some normalizedWeightSixteenCandidateBucket_3b15 - | 15126 => some normalizedWeightSixteenCandidateBucket_3b16 - | 15132 => some normalizedWeightSixteenCandidateBucket_3b1c - | 15135 => some normalizedWeightSixteenCandidateBucket_3b1f - | 15141 => some normalizedWeightSixteenCandidateBucket_3b25 - | 15142 => some normalizedWeightSixteenCandidateBucket_3b26 - | 15148 => some normalizedWeightSixteenCandidateBucket_3b2c - | 15151 => some normalizedWeightSixteenCandidateBucket_3b2f - | 15156 => some normalizedWeightSixteenCandidateBucket_3b34 - | 15159 => some normalizedWeightSixteenCandidateBucket_3b37 - | 15623 => some normalizedWeightSixteenCandidateBucket_3d07 - | 15627 => some normalizedWeightSixteenCandidateBucket_3d0b - | 15630 => some normalizedWeightSixteenCandidateBucket_3d0e - | 15635 => some normalizedWeightSixteenCandidateBucket_3d13 - | 15638 => some normalizedWeightSixteenCandidateBucket_3d16 - | 15642 => some normalizedWeightSixteenCandidateBucket_3d1a - | 15647 => some normalizedWeightSixteenCandidateBucket_3d1f - | 15651 => some normalizedWeightSixteenCandidateBucket_3d23 - | 15654 => some normalizedWeightSixteenCandidateBucket_3d26 - | 15658 => some normalizedWeightSixteenCandidateBucket_3d2a - | 15663 => some normalizedWeightSixteenCandidateBucket_3d2f - | 15666 => some normalizedWeightSixteenCandidateBucket_3d32 - | 15671 => some normalizedWeightSixteenCandidateBucket_3d37 - | 15675 => some normalizedWeightSixteenCandidateBucket_3d3b - | 15879 => some normalizedWeightSixteenCandidateBucket_3e07 - | 15883 => some normalizedWeightSixteenCandidateBucket_3e0b - | 15885 => some normalizedWeightSixteenCandidateBucket_3e0d - | 15891 => some normalizedWeightSixteenCandidateBucket_3e13 - | 15893 => some normalizedWeightSixteenCandidateBucket_3e15 - | 15897 => some normalizedWeightSixteenCandidateBucket_3e19 - | 15903 => some normalizedWeightSixteenCandidateBucket_3e1f - | 15907 => some normalizedWeightSixteenCandidateBucket_3e23 - | 15909 => some normalizedWeightSixteenCandidateBucket_3e25 - | 15913 => some normalizedWeightSixteenCandidateBucket_3e29 - | 15919 => some normalizedWeightSixteenCandidateBucket_3e2f - | 15921 => some normalizedWeightSixteenCandidateBucket_3e31 - | 15927 => some normalizedWeightSixteenCandidateBucket_3e37 - | 15931 => some normalizedWeightSixteenCandidateBucket_3e3b - | 15933 => some normalizedWeightSixteenCandidateBucket_3e3d - | 17731 => some normalizedWeightSixteenCandidateBucket_4543 - | 17987 => some normalizedWeightSixteenCandidateBucket_4643 - | 17989 => some normalizedWeightSixteenCandidateBucket_4645 - | 18755 => some normalizedWeightSixteenCandidateBucket_4943 - | 18757 => some normalizedWeightSixteenCandidateBucket_4945 - | 19011 => some normalizedWeightSixteenCandidateBucket_4a43 - | 19014 => some normalizedWeightSixteenCandidateBucket_4a46 - | 19017 => some normalizedWeightSixteenCandidateBucket_4a49 - | 19525 => some normalizedWeightSixteenCandidateBucket_4c45 - | 19526 => some normalizedWeightSixteenCandidateBucket_4c46 - | 19529 => some normalizedWeightSixteenCandidateBucket_4c49 - | 19530 => some normalizedWeightSixteenCandidateBucket_4c4a - | 20803 => some normalizedWeightSixteenCandidateBucket_5143 - | 20805 => some normalizedWeightSixteenCandidateBucket_5145 - | 20809 => some normalizedWeightSixteenCandidateBucket_5149 - | 20815 => some normalizedWeightSixteenCandidateBucket_514f - | 21059 => some normalizedWeightSixteenCandidateBucket_5243 - | 21062 => some normalizedWeightSixteenCandidateBucket_5246 - | 21066 => some normalizedWeightSixteenCandidateBucket_524a - | 21071 => some normalizedWeightSixteenCandidateBucket_524f - | 21073 => some normalizedWeightSixteenCandidateBucket_5251 - | 21573 => some normalizedWeightSixteenCandidateBucket_5445 - | 21574 => some normalizedWeightSixteenCandidateBucket_5446 - | 21580 => some normalizedWeightSixteenCandidateBucket_544c - | 21583 => some normalizedWeightSixteenCandidateBucket_544f - | 21585 => some normalizedWeightSixteenCandidateBucket_5451 - | 21586 => some normalizedWeightSixteenCandidateBucket_5452 - | 22345 => some normalizedWeightSixteenCandidateBucket_5749 - | 22346 => some normalizedWeightSixteenCandidateBucket_574a - | 22348 => some normalizedWeightSixteenCandidateBucket_574c - | 22351 => some normalizedWeightSixteenCandidateBucket_574f - | 22601 => some normalizedWeightSixteenCandidateBucket_5849 - | 22602 => some normalizedWeightSixteenCandidateBucket_584a - | 22604 => some normalizedWeightSixteenCandidateBucket_584c - | 22607 => some normalizedWeightSixteenCandidateBucket_584f - | 22609 => some normalizedWeightSixteenCandidateBucket_5851 - | 22610 => some normalizedWeightSixteenCandidateBucket_5852 - | 22612 => some normalizedWeightSixteenCandidateBucket_5854 - | 22615 => some normalizedWeightSixteenCandidateBucket_5857 - | 23365 => some normalizedWeightSixteenCandidateBucket_5b45 - | 23366 => some normalizedWeightSixteenCandidateBucket_5b46 - | 23372 => some normalizedWeightSixteenCandidateBucket_5b4c - | 23375 => some normalizedWeightSixteenCandidateBucket_5b4f - | 23380 => some normalizedWeightSixteenCandidateBucket_5b54 - | 23383 => some normalizedWeightSixteenCandidateBucket_5b57 - | 23875 => some normalizedWeightSixteenCandidateBucket_5d43 - | 23878 => some normalizedWeightSixteenCandidateBucket_5d46 - | 23882 => some normalizedWeightSixteenCandidateBucket_5d4a - | 23887 => some normalizedWeightSixteenCandidateBucket_5d4f - | 23890 => some normalizedWeightSixteenCandidateBucket_5d52 - | 23895 => some normalizedWeightSixteenCandidateBucket_5d57 - | 23899 => some normalizedWeightSixteenCandidateBucket_5d5b - | 24131 => some normalizedWeightSixteenCandidateBucket_5e43 - | 24133 => some normalizedWeightSixteenCandidateBucket_5e45 - | 24137 => some normalizedWeightSixteenCandidateBucket_5e49 - | 24143 => some normalizedWeightSixteenCandidateBucket_5e4f - | 24145 => some normalizedWeightSixteenCandidateBucket_5e51 - | 24151 => some normalizedWeightSixteenCandidateBucket_5e57 - | 24155 => some normalizedWeightSixteenCandidateBucket_5e5b - | 24157 => some normalizedWeightSixteenCandidateBucket_5e5d - | 25185 => some normalizedWeightSixteenCandidateBucket_6261 - | 25697 => some normalizedWeightSixteenCandidateBucket_6461 - | 25698 => some normalizedWeightSixteenCandidateBucket_6462 - | 26721 => some normalizedWeightSixteenCandidateBucket_6861 - | 26722 => some normalizedWeightSixteenCandidateBucket_6862 - | 26724 => some normalizedWeightSixteenCandidateBucket_6864 - | 26727 => some normalizedWeightSixteenCandidateBucket_6867 - | 27492 => some normalizedWeightSixteenCandidateBucket_6b64 - | 27495 => some normalizedWeightSixteenCandidateBucket_6b67 - | 28002 => some normalizedWeightSixteenCandidateBucket_6d62 - | 28007 => some normalizedWeightSixteenCandidateBucket_6d67 - | 28011 => some normalizedWeightSixteenCandidateBucket_6d6b - | 28257 => some normalizedWeightSixteenCandidateBucket_6e61 - | 28263 => some normalizedWeightSixteenCandidateBucket_6e67 - | 28267 => some normalizedWeightSixteenCandidateBucket_6e6b - | 28269 => some normalizedWeightSixteenCandidateBucket_6e6d - | 30067 => some normalizedWeightSixteenCandidateBucket_7573 - | 30323 => some normalizedWeightSixteenCandidateBucket_7673 - | 30325 => some normalizedWeightSixteenCandidateBucket_7675 - | 31353 => some normalizedWeightSixteenCandidateBucket_7a79 - | 33663 => some normalizedWeightSixteenCandidateBucket_837f - | 34175 => some normalizedWeightSixteenCandidateBucket_857f - | 34431 => some normalizedWeightSixteenCandidateBucket_867f - | 35199 => some normalizedWeightSixteenCandidateBucket_897f - | 35455 => some normalizedWeightSixteenCandidateBucket_8a7f - | 35967 => some normalizedWeightSixteenCandidateBucket_8c7f - | 36735 => some normalizedWeightSixteenCandidateBucket_8f7f - | 37247 => some normalizedWeightSixteenCandidateBucket_917f - | 37503 => some normalizedWeightSixteenCandidateBucket_927f - | 38015 => some normalizedWeightSixteenCandidateBucket_947f - | 38783 => some normalizedWeightSixteenCandidateBucket_977f - | 39807 => some normalizedWeightSixteenCandidateBucket_9b7f - | 40319 => some normalizedWeightSixteenCandidateBucket_9d7f - | 41343 => some normalizedWeightSixteenCandidateBucket_a17f - | 41599 => some normalizedWeightSixteenCandidateBucket_a27f - | 42111 => some normalizedWeightSixteenCandidateBucket_a47f - | 42879 => some normalizedWeightSixteenCandidateBucket_a77f - | 43903 => some normalizedWeightSixteenCandidateBucket_ab7f - | 44415 => some normalizedWeightSixteenCandidateBucket_ad7f - | 45951 => some normalizedWeightSixteenCandidateBucket_b37f - | 46463 => some normalizedWeightSixteenCandidateBucket_b57f - | 47487 => some normalizedWeightSixteenCandidateBucket_b97f - | 49023 => some normalizedWeightSixteenCandidateBucket_bf7f - | _ => none - -end CryptBoolean diff --git a/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenTypeA.lean b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenTypeA.lean deleted file mode 100644 index 6336e61..0000000 --- a/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteenTypeA.lean +++ /dev/null @@ -1,750 +0,0 @@ -/- -Copyright (c) 2026 Asher Yan. All rights reserved. -Released under Apache 2.0 license as described in the file LICENSE. -Authors: Asher Yan with Codex --/ -module - -public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightSixteen - -/-! -# Type-a weight-sixteen words - -The thirty ordered affine-hyperplane decompositions of an affine four-flat. --/ - -open Finset -open scoped BigOperators BooleanCube - -@[expose] public section - -namespace CryptBoolean - -open FABL - -variable {n : ℕ} - -noncomputable local instance weightSixteenTypeAFintypeDual - (C : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) : - Fintype (Module.Dual FABL.𝔽₂ C.direction) := - Module.fintypeOfFintype - (Module.finBasis FABL.𝔽₂ C.direction).dualBasis - -noncomputable local instance weightSixteenTypeAFintypeNonzeroDual - (C : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) : - Fintype { ℓ : Module.Dual FABL.𝔽₂ C.direction // ℓ ≠ 0 } := - Fintype.ofFinite _ - -/-- A nonzero linear functional on the direction of an affine four-flat, -together with the value selecting its first affine hyperplane. -/ -abbrev WeightSixteenTypeAParameter - (C : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) := - { ℓ : Module.Dual FABL.𝔽₂ C.direction // ℓ ≠ 0 } × FABL.𝔽₂ - -/-- The canonical finite parameter space for the ordered hyperplane -decompositions of an affine four-flat. -/ -noncomputable def weightSixteenTypeAParameters - (C : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) : - Finset (WeightSixteenTypeAParameter C) := by - classical - exact Finset.univ - -private theorem card_nonzero_dual_of_finrank_four - (C : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) - (hC : Module.finrank FABL.𝔽₂ C.direction = 4) : - Fintype.card - { ℓ : Module.Dual FABL.𝔽₂ C.direction // ℓ ≠ 0 } = 15 := by - classical - let B : Module.Basis - (Fin (Module.finrank FABL.𝔽₂ C.direction)) FABL.𝔽₂ C.direction := - Module.finBasis FABL.𝔽₂ C.direction - have hcardDual : - Fintype.card (Module.Dual FABL.𝔽₂ C.direction) = 16 := by - calc - Fintype.card (Module.Dual FABL.𝔽₂ C.direction) = - Fintype.card - (Fin (Module.finrank FABL.𝔽₂ C.direction) → FABL.𝔽₂) := - Fintype.card_congr B.dualBasis.equivFun.toEquiv - _ = 16 := by - rw [Fintype.card_fun, Fintype.card_fin, hC] - norm_num - rw [Fintype.card_subtype_compl (fun ℓ : - Module.Dual FABL.𝔽₂ C.direction ↦ ℓ = 0), - Fintype.card_subtype_eq, hcardDual] - -/-- A four-flat has thirty functional/value parameters. -/ -theorem card_weightSixteenTypeAParameters - (C : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) - (hC : C ∈ binaryAffineFlats 4 n) : - (weightSixteenTypeAParameters C).card = 30 := by - classical - have hCrank : Module.finrank FABL.𝔽₂ C.direction = 4 := by - exact (by - simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, - true_and] using hC : - C ≠ ⊥ ∧ Module.finrank FABL.𝔽₂ C.direction = 4).2 - rw [weightSixteenTypeAParameters, Finset.card_univ, - Fintype.card_prod, card_nonzero_dual_of_finrank_four C hCrank] - norm_num - -/-- A chosen basepoint of an affine four-flat. -/ -noncomputable def weightSixteenTypeABasepoint - (C : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) - (hC : C ∈ binaryAffineFlats 4 n) : FABL.F₂Cube n := by - have hCne : C ≠ ⊥ := by - exact (by - simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, - true_and] using hC : - C ≠ ⊥ ∧ Module.finrank FABL.𝔽₂ C.direction = 4).1 - exact Classical.choose ((AffineSubspace.nonempty_iff_ne_bot C).2 hCne) - -private theorem weightSixteenTypeABasepoint_mem - (C : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) - (hC : C ∈ binaryAffineFlats 4 n) : - weightSixteenTypeABasepoint C hC ∈ C := by - unfold weightSixteenTypeABasepoint - exact Classical.choose_spec - ((AffineSubspace.nonempty_iff_ne_bot C).2 (by - exact (by - simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, - true_and] using hC : - C ≠ ⊥ ∧ Module.finrank FABL.𝔽₂ C.direction = 4).1)) - -/-- A chosen direction vector on which a nonzero binary functional is one. -/ -noncomputable def weightSixteenTypeANormal - (C : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) - (ℓ : { ℓ : Module.Dual FABL.𝔽₂ C.direction // ℓ ≠ 0 }) : - C.direction := - Classical.choose ((LinearMap.surjective ℓ.property) (1 : FABL.𝔽₂)) - -@[simp] private theorem weightSixteenTypeANormal_apply - (C : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) - (ℓ : { ℓ : Module.Dual FABL.𝔽₂ C.direction // ℓ ≠ 0 }) : - ℓ.1 (weightSixteenTypeANormal C ℓ) = 1 := - Classical.choose_spec - ((LinearMap.surjective ℓ.property) (1 : FABL.𝔽₂)) - -/-- The ambient hyperplane direction given by the kernel of a functional on -the four-flat direction. -/ -noncomputable def weightSixteenTypeADirection - (C : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) - (ℓ : { ℓ : Module.Dual FABL.𝔽₂ C.direction // ℓ ≠ 0 }) : - Submodule FABL.𝔽₂ (FABL.F₂Cube n) := - (LinearMap.ker ℓ.1).map C.direction.subtype - -/-- The affine hyperplane selected by a functional/value parameter. -/ -noncomputable def weightSixteenTypeAHyperplane - (C : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) - (hC : C ∈ binaryAffineFlats 4 n) - (p : WeightSixteenTypeAParameter C) : - AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) := - FABL.binaryAffineSubspace (weightSixteenTypeADirection C p.1) - (p.2 • (weightSixteenTypeANormal C p.1 : FABL.F₂Cube n) + - weightSixteenTypeABasepoint C hC) - -private theorem weightSixteenTypeADirection_le - (C : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) - (ℓ : { ℓ : Module.Dual FABL.𝔽₂ C.direction // ℓ ≠ 0 }) : - weightSixteenTypeADirection C ℓ ≤ C.direction := by - rintro x ⟨y, _hy, rfl⟩ - exact y.property - -private theorem finrank_weightSixteenTypeADirection - (C : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) - (hC : C ∈ binaryAffineFlats 4 n) - (ℓ : { ℓ : Module.Dual FABL.𝔽₂ C.direction // ℓ ≠ 0 }) : - Module.finrank FABL.𝔽₂ (weightSixteenTypeADirection C ℓ) = 3 := by - have hCrank : Module.finrank FABL.𝔽₂ C.direction = 4 := by - exact (by - simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, - true_and] using hC : - C ≠ ⊥ ∧ Module.finrank FABL.𝔽₂ C.direction = 4).2 - have hker := ℓ.1.finrank_ker_add_one_of_ne_zero ℓ.property - rw [hCrank] at hker - have hkerRank : Module.finrank FABL.𝔽₂ (LinearMap.ker ℓ.1) = 3 := by - omega - rw [weightSixteenTypeADirection, Submodule.finrank_map_subtype_eq] - exact hkerRank - -private theorem weightSixteenTypeAHyperplane_basepoint_mem - (C : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) - (hC : C ∈ binaryAffineFlats 4 n) - (p : WeightSixteenTypeAParameter C) : - p.2 • (weightSixteenTypeANormal C p.1 : FABL.F₂Cube n) + - weightSixteenTypeABasepoint C hC ∈ C := by - have hdirection : p.2 • - (weightSixteenTypeANormal C p.1 : FABL.F₂Cube n) ∈ C.direction := - C.direction.smul_mem p.2 (weightSixteenTypeANormal C p.1).property - simpa only [vadd_eq_add] using AffineSubspace.vadd_mem_of_mem_direction - hdirection (weightSixteenTypeABasepoint_mem C hC) - -private theorem weightSixteenTypeAHyperplane_le - (C : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) - (hC : C ∈ binaryAffineFlats 4 n) - (p : WeightSixteenTypeAParameter C) : - weightSixteenTypeAHyperplane C hC p ≤ C := by - intro x hx - let a := p.2 • - (weightSixteenTypeANormal C p.1 : FABL.F₂Cube n) + - weightSixteenTypeABasepoint C hC - have haC : a ∈ C := weightSixteenTypeAHyperplane_basepoint_mem C hC p - have hxa : x -ᵥ a ∈ (weightSixteenTypeAHyperplane C hC p).direction := - AffineSubspace.vsub_mem_direction hx - (AffineSubspace.self_mem_mk' _ _) - have hxa' : x -ᵥ a ∈ C.direction := by - rw [weightSixteenTypeAHyperplane, - FABL.binaryAffineSubspace_direction] at hxa - exact weightSixteenTypeADirection_le C p.1 hxa - simpa only [vsub_vadd] using - (AffineSubspace.vadd_mem_of_mem_direction hxa' haC) - -private theorem weightSixteenTypeAHyperplane_mem_flats - (C : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) - (hC : C ∈ binaryAffineFlats 4 n) - (p : WeightSixteenTypeAParameter C) : - weightSixteenTypeAHyperplane C hC p ∈ binaryAffineFlats 3 n := by - apply binaryAffineSubspace_mem_binaryAffineFlats - rw [mem_binaryLinearSubspaces] - exact finrank_weightSixteenTypeADirection C hC p.1 - -/-- Exchanging zero and one selects the complementary hyperplane. -/ -def weightSixteenTypeAComplementParameter - {C : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)} - (p : WeightSixteenTypeAParameter C) : - WeightSixteenTypeAParameter C := - (p.1, 1 + p.2) - -/-- The ordered pair of complementary affine hyperplanes selected by a -type-`a` parameter. -/ -noncomputable def weightSixteenTypeARepresentationPair - (C : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) - (hC : C ∈ binaryAffineFlats 4 n) - (p : WeightSixteenTypeAParameter C) : - AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × - AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) := - (weightSixteenTypeAHyperplane C hC p, - weightSixteenTypeAHyperplane C hC - (weightSixteenTypeAComplementParameter p)) - -@[simp] private theorem direction_weightSixteenTypeAHyperplane - (C : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) - (hC : C ∈ binaryAffineFlats 4 n) - (p : WeightSixteenTypeAParameter C) : - (weightSixteenTypeAHyperplane C hC p).direction = - weightSixteenTypeADirection C p.1 := by - rw [weightSixteenTypeAHyperplane, - FABL.binaryAffineSubspace_direction] - -private theorem weightSixteenTypeAComplement_basepoint_add_basepoint - (C : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) - (hC : C ∈ binaryAffineFlats 4 n) - (p : WeightSixteenTypeAParameter C) : - ((weightSixteenTypeAComplementParameter p).2 • - (weightSixteenTypeANormal C p.1 : FABL.F₂Cube n) + - weightSixteenTypeABasepoint C hC) + - (p.2 • (weightSixteenTypeANormal C p.1 : FABL.F₂Cube n) + - weightSixteenTypeABasepoint C hC) = - (weightSixteenTypeANormal C p.1 : FABL.F₂Cube n) := by - let v := (weightSixteenTypeANormal C p.1 : FABL.F₂Cube n) - let u := weightSixteenTypeABasepoint C hC - have hcoefficient : (1 + p.2) + p.2 = 1 := by - calc - (1 + p.2) + p.2 = 1 + (p.2 + p.2) := by abel - _ = 1 := by rw [ZModModule.add_self, add_zero] - change ((1 + p.2) • v + u) + (p.2 • v + u) = v - calc - ((1 + p.2) • v + u) + (p.2 • v + u) = - ((1 + p.2) • v + p.2 • v) + (u + u) := by abel - _ = ((1 + p.2) + p.2) • v + (u + u) := by - rw [← add_smul] - _ = v := by rw [hcoefficient, one_smul, ZModModule.add_self, add_zero] - -private theorem weightSixteenTypeANormal_not_mem_direction - (C : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) - (ℓ : { ℓ : Module.Dual FABL.𝔽₂ C.direction // ℓ ≠ 0 }) : - (weightSixteenTypeANormal C ℓ : FABL.F₂Cube n) ∉ - weightSixteenTypeADirection C ℓ := by - intro hnormal - obtain ⟨y, hy, hyval⟩ := hnormal - have hyEq : y = weightSixteenTypeANormal C ℓ := by - apply Subtype.ext - exact hyval - have hyZero : ℓ.1 y = 0 := by - change ℓ.1 y = 0 at hy - exact hy - rw [hyEq, weightSixteenTypeANormal_apply] at hyZero - exact one_ne_zero hyZero - -private theorem weightSixteenTypeAHyperplanes_ne - (C : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) - (hC : C ∈ binaryAffineFlats 4 n) - (p : WeightSixteenTypeAParameter C) : - weightSixteenTypeAHyperplane C hC p ≠ - weightSixteenTypeAHyperplane C hC - (weightSixteenTypeAComplementParameter p) := by - intro heq - let a := p.2 • - (weightSixteenTypeANormal C p.1 : FABL.F₂Cube n) + - weightSixteenTypeABasepoint C hC - let b := (weightSixteenTypeAComplementParameter p).2 • - (weightSixteenTypeANormal C p.1 : FABL.F₂Cube n) + - weightSixteenTypeABasepoint C hC - have ha : a ∈ weightSixteenTypeAHyperplane C hC p := - AffineSubspace.self_mem_mk' _ _ - have hbComplement : b ∈ weightSixteenTypeAHyperplane C hC - (weightSixteenTypeAComplementParameter p) := - AffineSubspace.self_mem_mk' _ _ - have hb : b ∈ weightSixteenTypeAHyperplane C hC p := by - rw [heq] - exact hbComplement - have hdiff := AffineSubspace.vsub_mem_direction hb ha - have hdiff' : (weightSixteenTypeANormal C p.1 : FABL.F₂Cube n) ∈ - weightSixteenTypeADirection C p.1 := by - rw [direction_weightSixteenTypeAHyperplane] at hdiff - have hba : b -ᵥ a = - (weightSixteenTypeANormal C p.1 : FABL.F₂Cube n) := by - change b - a = _ - have hnega : -a = a := by - funext i - exact ZMod.neg_eq_self_mod_two (a i) - rw [sub_eq_add_neg, hnega] - exact weightSixteenTypeAComplement_basepoint_add_basepoint C hC p - rwa [hba] at hdiff - exact weightSixteenTypeANormal_not_mem_direction C p.1 hdiff' - -private theorem weightSixteenTypeAHyperplanes_inf_eq_bot - (C : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) - (hC : C ∈ binaryAffineFlats 4 n) - (p : WeightSixteenTypeAParameter C) : - weightSixteenTypeAHyperplane C hC p ⊓ - weightSixteenTypeAHyperplane C hC - (weightSixteenTypeAComplementParameter p) = ⊥ := by - by_contra hmeet - obtain ⟨x, hx⟩ := (AffineSubspace.nonempty_iff_ne_bot _).2 hmeet - have hxFirst : x ∈ weightSixteenTypeAHyperplane C hC p := hx.1 - have hxSecond : x ∈ weightSixteenTypeAHyperplane C hC - (weightSixteenTypeAComplementParameter p) := hx.2 - apply weightSixteenTypeAHyperplanes_ne C hC p - apply (AffineSubspace.eq_iff_direction_eq_of_mem hxFirst hxSecond).2 - simp only [direction_weightSixteenTypeAHyperplane, - weightSixteenTypeAComplementParameter] - -/-- Every type-`a` parameter gives an ordered disjoint pair of affine -three-flats. -/ -theorem weightSixteenTypeARepresentationPair_mem - (C : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) - (hC : C ∈ binaryAffineFlats 4 n) - (p : WeightSixteenTypeAParameter C) : - weightSixteenTypeARepresentationPair C hC p ∈ - disjointBinaryAffineThreeFlatPairs n := by - have hproduct : weightSixteenTypeARepresentationPair C hC p ∈ - binaryAffineThreeFlatPairs n := by - change weightSixteenTypeARepresentationPair C hC p ∈ - (binaryAffineFlats 3 n).product (binaryAffineFlats 3 n) - apply Finset.mem_product.mpr - exact ⟨weightSixteenTypeAHyperplane_mem_flats C hC p, - weightSixteenTypeAHyperplane_mem_flats C hC - (weightSixteenTypeAComplementParameter p)⟩ - simp only [disjointBinaryAffineThreeFlatPairs, Finset.mem_filter] - exact ⟨hproduct, weightSixteenTypeAHyperplanes_inf_eq_bot C hC p⟩ - -private theorem weightSixteenTypeAHyperplanePoints_disjoint - (C : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) - (hC : C ∈ binaryAffineFlats 4 n) - (p : WeightSixteenTypeAParameter C) : - Disjoint - (binaryAffineFlatPoints (weightSixteenTypeAHyperplane C hC p)) - (binaryAffineFlatPoints (weightSixteenTypeAHyperplane C hC - (weightSixteenTypeAComplementParameter p))) := by - rw [Finset.disjoint_left] - intro x hxFirst hxSecond - have hxMeet : x ∈ - weightSixteenTypeAHyperplane C hC p ⊓ - weightSixteenTypeAHyperplane C hC - (weightSixteenTypeAComplementParameter p) := - ⟨(mem_binaryAffineFlatPoints _ _).mp hxFirst, - (mem_binaryAffineFlatPoints _ _).mp hxSecond⟩ - rw [weightSixteenTypeAHyperplanes_inf_eq_bot C hC p] at hxMeet - rw [← SetLike.mem_coe, AffineSubspace.bot_coe] at hxMeet - exact hxMeet - -private theorem weightSixteenTypeAHyperplanePoints_union - (C : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) - (hC : C ∈ binaryAffineFlats 4 n) - (p : WeightSixteenTypeAParameter C) : - binaryAffineFlatPoints C = - binaryAffineFlatPoints (weightSixteenTypeAHyperplane C hC p) ∪ - binaryAffineFlatPoints (weightSixteenTypeAHyperplane C hC - (weightSixteenTypeAComplementParameter p)) := by - have hCdata : C ≠ ⊥ ∧ Module.finrank FABL.𝔽₂ C.direction = 4 := by - simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, - true_and] using hC - have hfirstFlat := weightSixteenTypeAHyperplane_mem_flats C hC p - have hsecondFlat := weightSixteenTypeAHyperplane_mem_flats C hC - (weightSixteenTypeAComplementParameter p) - have hfirstData : weightSixteenTypeAHyperplane C hC p ≠ ⊥ ∧ - Module.finrank FABL.𝔽₂ - (weightSixteenTypeAHyperplane C hC p).direction = 3 := by - simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, - true_and] using hfirstFlat - have hsecondData : weightSixteenTypeAHyperplane C hC - (weightSixteenTypeAComplementParameter p) ≠ ⊥ ∧ - Module.finrank FABL.𝔽₂ - (weightSixteenTypeAHyperplane C hC - (weightSixteenTypeAComplementParameter p)).direction = 3 := by - simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, - true_and] using hsecondFlat - symm - apply Finset.eq_of_subset_of_card_le - · intro x hx - rcases Finset.mem_union.mp hx with hxFirst | hxSecond - · exact (mem_binaryAffineFlatPoints C x).mpr - (weightSixteenTypeAHyperplane_le C hC p - ((mem_binaryAffineFlatPoints _ x).mp hxFirst)) - · exact (mem_binaryAffineFlatPoints C x).mpr - (weightSixteenTypeAHyperplane_le C hC - (weightSixteenTypeAComplementParameter p) - ((mem_binaryAffineFlatPoints _ x).mp hxSecond)) - · rw [Finset.card_union_of_disjoint - (weightSixteenTypeAHyperplanePoints_disjoint C hC p), - card_binaryAffineFlatPoints _ hfirstData.1, hfirstData.2, - card_binaryAffineFlatPoints _ hsecondData.1, hsecondData.2, - card_binaryAffineFlatPoints C hCdata.1, hCdata.2] - norm_num - -/-- The two hyperplanes selected by a type-`a` parameter sum to the -indicator of the original affine four-flat. -/ -theorem weightSixteenTypeARepresentationWord_eq_indicator - (C : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) - (hC : C ∈ binaryAffineFlats 4 n) - (p : WeightSixteenTypeAParameter C) : - weightSixteenRepresentationWord - (weightSixteenTypeARepresentationPair C hC p).1 - (weightSixteenTypeARepresentationPair C hC p).2 = - binaryAffineFlatIndicator C := by - have hpoints : binaryAffineFlatPoints C = - binaryAffineFlatPoints - (weightSixteenTypeARepresentationPair C hC p).1 ∪ - binaryAffineFlatPoints - (weightSixteenTypeARepresentationPair C hC p).2 := by - simpa only [weightSixteenTypeARepresentationPair] using - weightSixteenTypeAHyperplanePoints_union C hC p - have hdisjoint : Disjoint - (binaryAffineFlatPoints - (weightSixteenTypeARepresentationPair C hC p).1) - (binaryAffineFlatPoints - (weightSixteenTypeARepresentationPair C hC p).2) := by - simpa only [weightSixteenTypeARepresentationPair] using - weightSixteenTypeAHyperplanePoints_disjoint C hC p - symm - exact binaryAffineFlatIndicator_eq_add_of_points_eq_union - (weightSixteenTypeARepresentationPair C hC p).1 - (weightSixteenTypeARepresentationPair C hC p).2 C - hpoints hdisjoint - -private theorem binaryDual_eq_of_ker_eq - {H : Submodule FABL.𝔽₂ (FABL.F₂Cube n)} - (f g : Module.Dual FABL.𝔽₂ H) - (hker : LinearMap.ker f = LinearMap.ker g) : f = g := by - ext x - by_cases hfx : f x = 0 - · have hxKerF : x ∈ LinearMap.ker f := hfx - have hxKerG : x ∈ LinearMap.ker g := by rwa [← hker] - have hgx : g x = 0 := hxKerG - exact hfx.trans hgx.symm - · have hfxOne : f x = 1 := Fin.eq_one_of_ne_zero _ hfx - have hgx : g x ≠ 0 := by - intro hgx - have hxKerG : x ∈ LinearMap.ker g := hgx - have hxKerF : x ∈ LinearMap.ker f := by rwa [hker] - exact hfx hxKerF - have hgxOne : g x = 1 := Fin.eq_one_of_ne_zero _ hgx - exact hfxOne.trans hgxOne.symm - -private theorem weightSixteenTypeAHyperplane_injective - (C : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) - (hC : C ∈ binaryAffineFlats 4 n) : - Function.Injective (weightSixteenTypeAHyperplane C hC) := by - rintro ⟨ℓ, b⟩ ⟨m, c⟩ hflat - have hdirections := congrArg AffineSubspace.direction hflat - simp only [direction_weightSixteenTypeAHyperplane] at hdirections - have hkers : LinearMap.ker ℓ.1 = LinearMap.ker m.1 := by - apply Submodule.map_injective_of_injective C.direction.subtype_injective - exact hdirections - have hfunctionals : ℓ = m := by - apply Subtype.ext - exact binaryDual_eq_of_ker_eq ℓ.1 m.1 hkers - subst m - let v := weightSixteenTypeANormal C ℓ - let u := weightSixteenTypeABasepoint C hC - let a : FABL.F₂Cube n := b • (v : FABL.F₂Cube n) + u - let d : FABL.F₂Cube n := c • (v : FABL.F₂Cube n) + u - have ha : a ∈ weightSixteenTypeAHyperplane C hC (ℓ, b) := - AffineSubspace.self_mem_mk' _ _ - have ha' : a ∈ weightSixteenTypeAHyperplane C hC (ℓ, c) := by - rw [← hflat] - exact ha - have hd : d ∈ weightSixteenTypeAHyperplane C hC (ℓ, c) := - AffineSubspace.self_mem_mk' _ _ - have hadiff := AffineSubspace.vsub_mem_direction ha' hd - rw [direction_weightSixteenTypeAHyperplane] at hadiff - have hadiffEq : a -ᵥ d = - ((b + c) • v : C.direction) := by - change a - d = (b + c) • (v : FABL.F₂Cube n) - have hnegd : -d = d := by - funext i - exact ZMod.neg_eq_self_mod_two (d i) - rw [sub_eq_add_neg, hnegd] - change (b • (v : FABL.F₂Cube n) + u) + - (c • (v : FABL.F₂Cube n) + u) = - (b + c) • (v : FABL.F₂Cube n) - calc - (b • (v : FABL.F₂Cube n) + u) + - (c • (v : FABL.F₂Cube n) + u) = - (b • (v : FABL.F₂Cube n) + - c • (v : FABL.F₂Cube n)) + (u + u) := by abel - _ = (b + c) • (v : FABL.F₂Cube n) := by - rw [← add_smul, ZModModule.add_self, add_zero] - rw [hadiffEq] at hadiff - obtain ⟨y, hy, hyval⟩ := hadiff - have hyEq : y = (b + c) • v := by - apply Subtype.ext - exact hyval - have hyZero : ℓ.1 y = 0 := by - change ℓ.1 y = 0 at hy - exact hy - have hbc : b + c = 0 := by - rw [hyEq, map_smul, weightSixteenTypeANormal_apply, smul_eq_mul, - mul_one] at hyZero - exact hyZero - have hbcEq : b = c := - (add_eq_zero_iff_eq_neg.mp hbc).trans (ZMod.neg_eq_self_mod_two c) - subst c - rfl - -/-- The affine three-flats contained in a fixed affine four-flat. -/ -noncomputable def affineThreeFlatsInFourFlat - (C : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) : - Finset (AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) := by - classical - exact (binaryAffineFlats 3 n).filter fun A ↦ A ≤ C - -private theorem exists_typeAParameter_eq_hyperplane - (C A : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) - (hC : C ∈ binaryAffineFlats 4 n) - (hA : A ∈ affineThreeFlatsInFourFlat C) : - ∃ p : WeightSixteenTypeAParameter C, - weightSixteenTypeAHyperplane C hC p = A := by - have hCdata : C ≠ ⊥ ∧ Module.finrank FABL.𝔽₂ C.direction = 4 := by - simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, - true_and] using hC - have hAdata : A ∈ binaryAffineFlats 3 n ∧ A ≤ C := by - simpa only [affineThreeFlatsInFourFlat, Finset.mem_filter] using hA - have hAflat : A ≠ ⊥ ∧ Module.finrank FABL.𝔽₂ A.direction = 3 := by - simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, - true_and] using hAdata.1 - have hdirLe : A.direction ≤ C.direction := - AffineSubspace.direction_le hAdata.2 - let K : Submodule FABL.𝔽₂ C.direction := - A.direction.comap C.direction.subtype - have hKmap : K.map C.direction.subtype = A.direction := by - dsimp only [K] - rw [Submodule.map_comap_subtype, inf_of_le_right hdirLe] - have hKrank : Module.finrank FABL.𝔽₂ K = 3 := by - have hmapRank := Submodule.finrank_map_subtype_eq C.direction K - rw [hKmap, hAflat.2] at hmapRank - exact hmapRank.symm - have hKlt : K < ⊤ := - Submodule.lt_of_le_of_finrank_lt_finrank le_top (by - rw [hKrank, finrank_top, hCdata.2] - omega) - obtain ⟨ℓ, hℓne, hKker⟩ := K.exists_le_ker_of_lt_top hKlt - have hkerRank : Module.finrank FABL.𝔽₂ (LinearMap.ker ℓ) = 3 := by - have hker := Module.Dual.finrank_ker_add_one_of_ne_zero - (f := ℓ) hℓne - rw [hCdata.2] at hker - omega - have hKkerEq : K = LinearMap.ker ℓ := - Submodule.eq_of_le_of_finrank_eq hKker (hKrank.trans hkerRank.symm) - let ℓ' : { ℓ : Module.Dual FABL.𝔽₂ C.direction // ℓ ≠ 0 } := ⟨ℓ, hℓne⟩ - obtain ⟨a, ha⟩ := (AffineSubspace.nonempty_iff_ne_bot A).2 hAflat.1 - let u := weightSixteenTypeABasepoint C hC - have haC : a ∈ C := hAdata.2 ha - have hau : a + u ∈ C.direction := by - have hvsub := AffineSubspace.vsub_mem_direction haC - (weightSixteenTypeABasepoint_mem C hC) - change a - u ∈ C.direction at hvsub - have hnegu : -u = u := by - funext i - exact ZMod.neg_eq_self_mod_two (u i) - rwa [sub_eq_add_neg, hnegu] at hvsub - let d : C.direction := ⟨a + u, hau⟩ - let b : FABL.𝔽₂ := ℓ d - let p : WeightSixteenTypeAParameter C := (ℓ', b) - let v := weightSixteenTypeANormal C ℓ' - let y : C.direction := b • v + d - have hℓv : ℓ v = 1 := by - simpa only [v, ℓ'] using weightSixteenTypeANormal_apply C ℓ' - have hyKer : y ∈ LinearMap.ker ℓ := by - change ℓ y = 0 - rw [show ℓ y = b • ℓ v + ℓ d by - simp only [y, map_add, map_smul]] - rw [hℓv] - change b * 1 + ℓ d = 0 - rw [mul_one] - change ℓ d + ℓ d = 0 - exact ZModModule.add_self _ - have hyK : y ∈ K := by - rw [hKkerEq] - exact hyKer - have hyDirection : (y : FABL.F₂Cube n) ∈ A.direction := by - rw [← hKmap] - exact ⟨y, hyK, rfl⟩ - have hbaseA : b • (v : FABL.F₂Cube n) + u ∈ A := by - have hva := AffineSubspace.vadd_mem_of_mem_direction hyDirection ha - change (y : FABL.F₂Cube n) + a ∈ A at hva - have hyadd : (y : FABL.F₂Cube n) + a = - b • (v : FABL.F₂Cube n) + u := by - change (b • (v : FABL.F₂Cube n) + (a + u)) + a = - b • (v : FABL.F₂Cube n) + u - calc - (b • (v : FABL.F₂Cube n) + (a + u)) + a = - b • (v : FABL.F₂Cube n) + (a + a) + u := by abel - _ = b • (v : FABL.F₂Cube n) + u := by - rw [ZModModule.add_self, add_zero] - rwa [hyadd] at hva - refine ⟨p, ?_⟩ - apply (AffineSubspace.eq_iff_direction_eq_of_mem - (AffineSubspace.self_mem_mk' _ _) hbaseA).2 - rw [AffineSubspace.direction_mk'] - change weightSixteenTypeADirection C p.1 = A.direction - dsimp only [p] - rw [weightSixteenTypeADirection, ← hKkerEq, hKmap] - -/-- An affine four-flat contains exactly thirty affine three-flats. -/ -theorem card_affineThreeFlatsInFourFlat - (C : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) - (hC : C ∈ binaryAffineFlats 4 n) : - (affineThreeFlatsInFourFlat C).card = 30 := by - classical - rw [← card_weightSixteenTypeAParameters C hC] - symm - apply Finset.card_bij - (fun p _hp ↦ weightSixteenTypeAHyperplane C hC p) - · intro p _hp - simp only [affineThreeFlatsInFourFlat, Finset.mem_filter] - exact ⟨weightSixteenTypeAHyperplane_mem_flats C hC p, - weightSixteenTypeAHyperplane_le C hC p⟩ - · intro p _hp q _hq heq - exact weightSixteenTypeAHyperplane_injective C hC heq - · intro A hA - obtain ⟨p, hp⟩ := exists_typeAParameter_eq_hyperplane C A hC hA - exact ⟨p, Finset.mem_univ p, hp⟩ - -private theorem weightSixteenDisjointPairData - {p : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × - AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)} - (hp : p ∈ disjointBinaryAffineThreeFlatPairs n) : - p.1 ∈ binaryAffineFlats 3 n ∧ - p.2 ∈ binaryAffineFlats 3 n ∧ p.1 ⊓ p.2 = ⊥ := by - have hp' : p ∈ binaryAffineThreeFlatPairs n ∧ p.1 ⊓ p.2 = ⊥ := by - simpa only [disjointBinaryAffineThreeFlatPairs, - Finset.mem_filter] using hp - have hproduct : p ∈ - (binaryAffineFlats 3 n).product (binaryAffineFlats 3 n) := hp'.1 - exact ⟨(Finset.mem_product.mp hproduct).1, - (Finset.mem_product.mp hproduct).2, hp'.2⟩ - -private theorem weightSixteenDisjointPair_pointSets - {p : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n) × - AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)} - (hp : p ∈ disjointBinaryAffineThreeFlatPairs n) : - Disjoint (binaryAffineFlatPoints p.1) (binaryAffineFlatPoints p.2) := by - rw [Finset.disjoint_left] - intro x hxFirst hxSecond - have hxMeet : x ∈ p.1 ⊓ p.2 := - ⟨(mem_binaryAffineFlatPoints p.1 x |>.mp hxFirst), - (mem_binaryAffineFlatPoints p.2 x).mp hxSecond⟩ - rw [(weightSixteenDisjointPairData hp).2.2] at hxMeet - rw [← SetLike.mem_coe, AffineSubspace.bot_coe] at hxMeet - exact hxMeet - -/-- A type-`a` affine-four-flat indicator has exactly thirty ordered -disjoint-three-flat representations. -/ -theorem card_weightSixteenRepresentationFiber_typeAIndicator - (C : AffineSubspace FABL.𝔽₂ (FABL.F₂Cube n)) - (hC : C ∈ binaryAffineFlats 4 n) : - (weightSixteenRepresentationFiber - (binaryAffineFlatIndicator C)).card = 30 := by - classical - rw [← card_affineThreeFlatsInFourFlat C hC] - apply Finset.card_bij (fun p _hp ↦ p.1) - · intro p hp - have hp' : p ∈ disjointBinaryAffineThreeFlatPairs n ∧ - weightSixteenRepresentationWord p.1 p.2 = - binaryAffineFlatIndicator C := by - simpa only [weightSixteenRepresentationFiber, - Finset.mem_filter] using hp - have hpdata := weightSixteenDisjointPairData hp'.1 - have hpoints := binaryAffineFlatPoints_eq_union_of_indicator_eq_add - p.1 p.2 C (weightSixteenDisjointPair_pointSets hp'.1) (by - simpa only [weightSixteenRepresentationWord] using hp'.2.symm) - have hfirstLe : p.1 ≤ C := by - intro x hx - apply (mem_binaryAffineFlatPoints C x).mp - rw [hpoints] - exact Finset.mem_union_left _ - ((mem_binaryAffineFlatPoints p.1 x).mpr hx) - simp only [affineThreeFlatsInFourFlat, Finset.mem_filter] - exact ⟨hpdata.1, hfirstLe⟩ - · intro p hp q hq hfirst - have hp' : p ∈ disjointBinaryAffineThreeFlatPairs n ∧ - weightSixteenRepresentationWord p.1 p.2 = - binaryAffineFlatIndicator C := by - simpa only [weightSixteenRepresentationFiber, - Finset.mem_filter] using hp - have hq' : q ∈ disjointBinaryAffineThreeFlatPairs n ∧ - weightSixteenRepresentationWord q.1 q.2 = - binaryAffineFlatIndicator C := by - simpa only [weightSixteenRepresentationFiber, - Finset.mem_filter] using hq - have hsums : binaryAffineFlatIndicator p.1 + - binaryAffineFlatIndicator p.2 = - binaryAffineFlatIndicator q.1 + binaryAffineFlatIndicator q.2 := by - exact hp'.2.trans hq'.2.symm - rw [hfirst] at hsums - have hsecondIndicator : binaryAffineFlatIndicator p.2 = - binaryAffineFlatIndicator q.2 := add_left_cancel hsums - have hpSecondData : p.2 ≠ ⊥ ∧ - Module.finrank FABL.𝔽₂ p.2.direction = 3 := by - simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, - true_and] using (weightSixteenDisjointPairData hp'.1).2.1 - have hqSecondData : q.2 ≠ ⊥ ∧ - Module.finrank FABL.𝔽₂ q.2.direction = 3 := by - simpa only [binaryAffineFlats, Finset.mem_filter, Finset.mem_univ, - true_and] using (weightSixteenDisjointPairData hq'.1).2.1 - have hsecond : p.2 = q.2 := - binaryAffineFlatIndicator_injective_on_nonempty - hpSecondData.1 hqSecondData.1 hsecondIndicator - exact Prod.ext hfirst hsecond - · intro A hA - obtain ⟨p, hp⟩ := exists_typeAParameter_eq_hyperplane C A hC hA - let pair := weightSixteenTypeARepresentationPair C hC p - have hpairFiber : pair ∈ weightSixteenRepresentationFiber - (binaryAffineFlatIndicator C) := by - simp only [weightSixteenRepresentationFiber, Finset.mem_filter] - exact ⟨weightSixteenTypeARepresentationPair_mem C hC p, - weightSixteenTypeARepresentationWord_eq_indicator C hC p⟩ - refine ⟨pair, hpairFiber, ?_⟩ - simpa only [pair, weightSixteenTypeARepresentationPair] using hp - -/-- Every word in the canonical type-`a` family has representation fiber -cardinality thirty. -/ -theorem card_weightSixteenRepresentationFiber_of_mem_typeAWords - (h : BooleanFunction n) (hh : h ∈ orderTwoWeightSixteenTypeAWords n) : - (weightSixteenRepresentationFiber h).card = 30 := by - classical - obtain ⟨C, hC, rfl⟩ := Finset.mem_image.mp hh - exact card_weightSixteenRepresentationFiber_typeAIndicator C hC - -end CryptBoolean diff --git a/blueprint-verso/CryptBooleanBlueprint/Carlet/Chapter04/HigherOrderNonlinearity.lean b/blueprint-verso/CryptBooleanBlueprint/Carlet/Chapter04/HigherOrderNonlinearity.lean index 331ec95..ead063c 100644 --- a/blueprint-verso/CryptBooleanBlueprint/Carlet/Chapter04/HigherOrderNonlinearity.lean +++ b/blueprint-verso/CryptBooleanBlueprint/Carlet/Chapter04/HigherOrderNonlinearity.lean @@ -18,7 +18,7 @@ import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoLowWeightSpectrum import CryptBoolean.Carlet.Chapter04.HigherOrderTupleCountDifferences import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoMomentDifference import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoAsymptotics -import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightSixteenOrbitAggregation +import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightSixteen.OrbitAggregation import CryptBoolean.Carlet.Chapter03.ReedMullerWeightSixteenSelfDual open Verso.Genre diff --git a/lakefile.lean b/lakefile.lean index 5606c82..6ed00aa 100644 --- a/lakefile.lean +++ b/lakefile.lean @@ -1,6 +1,6 @@ import Lake -open Lake DSL +open Lake DSL System require FABL from git "https://github.com/Polarnova/FABL.git" @ "v0.5.6" @@ -14,5 +14,34 @@ package CryptBooleanFunction where ⟨`weak.linter.mathlibStandardSet, true⟩ ] +input_file normalizedWeightSixteenCandidateGenerator where + path := "scripts/generate_normalized_weight_sixteen_candidates.py" + text := true + +input_file rankSevenWeightSixteenPatterns where + path := + "CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteen/RankSevenPatterns.lean" + text := true + +/-- Reconstruct the generated finite certificate table before Lean scans its imports. -/ +target normalizedWeightSixteenCandidates pkg : FilePath := do + let generator ← normalizedWeightSixteenCandidateGenerator.fetch + let patterns ← rankSevenWeightSixteenPatterns.fetch + let inputs := generator.zipWith (sync := true) + (fun generatorPath patternsPath => (generatorPath, patternsPath)) patterns + let output := pkg.dir / + "CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteen/NormalizedCandidates.lean" + inputs.mapM fun (generatorPath, _patternsPath) => do + let traceFile := pkg.buildDir / "normalized-weight-sixteen-candidates.trace" + buildUnlessUpToDate output (← getTrace) traceFile do + proc { + cmd := if Platform.isWindows then "python" else "python3" + args := #[generatorPath.toString, "--lean-output", output.toString, + "--timeout-seconds", "60"] + cwd := some pkg.dir + } (quiet := true) + return output + @[default_target] lean_lib CryptBoolean where + needs := #[normalizedWeightSixteenCandidates] diff --git a/scripts/generate_normalized_weight_sixteen_candidates.py b/scripts/generate_normalized_weight_sixteen_candidates.py new file mode 100644 index 0000000..63f6f41 --- /dev/null +++ b/scripts/generate_normalized_weight_sixteen_candidates.py @@ -0,0 +1,433 @@ +#!/usr/bin/env python3 +"""Generate the kernel-checked normalized weight-sixteen candidate table.""" + +from __future__ import annotations + +import argparse +import hashlib +import math +import os +from dataclasses import dataclass +from itertools import combinations, permutations +from pathlib import Path +import sys +import tempfile +import time +from typing import NoReturn, Sequence + + +PATTERNS: tuple[tuple[str, tuple[int, ...]], ...] = ( + ("twoE8", (0, 1, 2, 3, 4, 5, 6, 7, 64, 72, 80, 88, 96, 104, 112, 120)), + ("d16Plus", (0, 1, 2, 4, 8, 16, 32, 64, 127, 126, 125, 123, 119, 111, 95, 63)), + ("f16", (0, 1, 2, 4, 8, 16, 32, 64, 126, 87, 55, 17, 31, 5, 3, 105)), +) +CLASS_CODES = {name: code for code, (name, _) in enumerate(PATTERNS)} +EXPECTED_CANDIDATE_COUNT = 2969 +EXPECTED_PREFIX_COUNT = 278 +EXPECTED_LOGICAL_SHA256 = "d35e0733be92ccaad2437f29159b74d57f9043107907cf76f6c29a1cb48ddf73" +LOW_64_BITS = (1 << 64) - 1 +FIXED_POINTS = frozenset((0, 1, 2, 4, 8, 16, 32, 64)) +PARITY = tuple(bin(value).count("1") & 1 for value in range(128)) + + +LEAN_PREAMBLE = """/- +Copyright (c) 2026 Asher Yan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Asher Yan with Codex +-/ +module + +public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightSixteen.RankSevenPatterns + +/-! +# Generated normalized weight-sixteen candidates + +Each leaf records a canonical class, an invertible affine normalization, +the resulting 128-bit support mask, and its systematic 64-bit column code. +Candidate trees are sharded by the low sixteen bits of the systematic code so +that each kernel-checked finite classification problem remains small. +-/ + +@[expose] public section + +namespace CryptBoolean + +/-- One normalized-pattern certificate. The affine code stores the source origin +in its low seven bits, followed by the seven rows of the normalizing linear map. -/ +structure NormalizedWeightSixteenCandidate where + patternClass : RankSevenWeightSixteenPatternClass + affineCode : BitVec 56 + maskLow : BitVec 64 + maskHigh : BitVec 64 + systematicCode : BitVec 64 + +/-- A balanced tree keeps finite classification reduction logarithmic in the +number of certificates in one prefix shard. -/ +inductive NormalizedWeightSixteenCandidateTree where + | leaf (candidate : NormalizedWeightSixteenCandidate) + | node (left right : NormalizedWeightSixteenCandidateTree) + +namespace NormalizedWeightSixteenCandidateTree + +/-- Whether the tree contains a certificate with the given systematic code. -/ +def containsSystematicCode : + NormalizedWeightSixteenCandidateTree → BitVec 64 → Bool + | .leaf candidate, code => candidate.systematicCode == code + | .node left right, code => + left.containsSystematicCode code || right.containsSystematicCode code + +/-- Propositional membership in a generated candidate tree. -/ +inductive Member (candidate : NormalizedWeightSixteenCandidate) : + NormalizedWeightSixteenCandidateTree → Prop + | leaf : Member candidate (.leaf candidate) + | left {left right} : Member candidate left → Member candidate (.node left right) + | right {left right} : Member candidate right → Member candidate (.node left right) + +end NormalizedWeightSixteenCandidateTree + +""" + + +class GenerationError(Exception): + pass + + +class OneLineArgumentParser(argparse.ArgumentParser): + def error(self, message: str) -> NoReturn: + raise GenerationError(message) + + +@dataclass(frozen=True) +class Candidate: + pattern_class: str + class_code: int + affine_code: int + mask_low: int + mask_high: int + systematic_code: int + + +@dataclass(frozen=True) +class Deadline: + expires_at: float + + def check(self, stage: str) -> None: + if time.monotonic() >= self.expires_at: + raise GenerationError(f"deadline exceeded during {stage}") + + +def inverse_rows(columns: Sequence[int]) -> tuple[int, ...] | None: + rows = [] + for row_index in range(7): + row = 0 + for column_index, column in enumerate(columns): + row |= ((column >> row_index) & 1) << column_index + rows.append(row | (1 << (7 + row_index))) + for column in range(7): + pivot = next( + (row for row in range(column, 7) if (rows[row] >> column) & 1), + None, + ) + if pivot is None: + return None + rows[column], rows[pivot] = rows[pivot], rows[column] + for row in range(7): + if row != column and ((rows[row] >> column) & 1): + rows[row] ^= rows[column] + return tuple(row >> 7 for row in rows) + + +def coordinates(inverse: Sequence[int], value: int) -> int: + result = 0 + for index, row in enumerate(inverse): + result |= PARITY[row & value] << index + return result + + +def permute_point(point: int, permutation: Sequence[int]) -> int: + result = 0 + for target, source in enumerate(permutation): + result |= ((point >> source) & 1) << target + return result + + +def coordinate_permutation_tables( + deadline: Deadline, +) -> tuple[tuple[tuple[int, ...], tuple[int, ...]], ...]: + result = [] + for index, permutation in enumerate(permutations(range(7))): + if index % 64 == 0: + deadline.check("coordinate permutation tables") + result.append( + ( + permutation, + tuple(permute_point(point, permutation) for point in range(128)), + ) + ) + return tuple(result) + + +def normalized_pattern_masks( + points: Sequence[int], + permutation_tables: Sequence[tuple[tuple[int, ...], tuple[int, ...]]], + deadline: Deadline, +) -> dict[int, tuple[int, tuple[int, ...]]]: + masks: dict[int, tuple[int, tuple[int, ...]]] = {} + basis_index = 0 + for origin in points: + differences = [point ^ origin for point in points if point != origin] + for basis in combinations(differences, 7): + if basis_index % 256 == 0: + deadline.check("affine basis enumeration") + basis_index += 1 + inverse = inverse_rows(basis) + if inverse is None: + continue + mask = 0 + for point in points: + mask |= 1 << coordinates(inverse, point ^ origin) + masks.setdefault(mask, (origin, inverse)) + + ordered_masks: dict[int, tuple[int, tuple[int, ...]]] = {} + for mask_index, (mask, (origin, inverse)) in enumerate(masks.items()): + deadline.check("normalized mask permutation") + support = tuple(point for point in range(128) if (mask >> point) & 1) + for permutation_index, (permutation, table) in enumerate(permutation_tables): + if permutation_index % 256 == 0: + deadline.check("normalized mask permutation") + transformed = 0 + for point in support: + transformed |= 1 << table[point] + ordered_inverse = tuple(inverse[source] for source in permutation) + ordered_masks.setdefault(transformed, (origin, ordered_inverse)) + if mask_index % 16 == 0: + deadline.check("normalized mask permutation") + return ordered_masks + + +def systematic_column(point: int) -> int: + return (1 ^ PARITY[point]) | (point << 1) + + +def generate_candidates(deadline: Deadline) -> tuple[Candidate, ...]: + permutation_tables = coordinate_permutation_tables(deadline) + candidates = [] + for pattern_class, points in PATTERNS: + ordered_masks = normalized_pattern_masks(points, permutation_tables, deadline) + for mask, (origin, inverse) in sorted(ordered_masks.items()): + affine_code = origin + for index, row in enumerate(inverse): + affine_code |= row << (7 * (index + 1)) + mask_low = mask & LOW_64_BITS + mask_high = mask >> 64 + columns = sorted( + systematic_column(point) + for point in range(128) + if ((mask >> point) & 1) and point not in FIXED_POINTS + ) + if len(columns) != 8: + raise GenerationError("normalized mask does not have eight free columns") + systematic_code = sum( + column << (8 * index) for index, column in enumerate(columns) + ) + candidates.append( + Candidate( + pattern_class=pattern_class, + class_code=CLASS_CODES[pattern_class], + affine_code=affine_code, + mask_low=mask_low, + mask_high=mask_high, + systematic_code=systematic_code, + ) + ) + deadline.check(f"{pattern_class} candidate generation") + return tuple(candidates) + + +def logical_tsv(candidates: Sequence[Candidate]) -> bytes: + lines = ["class_code\taffine_code\tmask_low\tmask_high\tsystematic_code"] + lines.extend( + "\t".join( + str(value) + for value in ( + candidate.class_code, + candidate.affine_code, + candidate.mask_low, + candidate.mask_high, + candidate.systematic_code, + ) + ) + for candidate in candidates + ) + return ("\n".join(lines) + "\n").encode("utf-8") + + +def candidate_buckets(candidates: Sequence[Candidate]) -> dict[int, list[Candidate]]: + buckets: dict[int, list[Candidate]] = {} + for candidate in candidates: + buckets.setdefault(candidate.systematic_code & 0xFFFF, []).append(candidate) + return buckets + + +def validate_candidates(candidates: Sequence[Candidate]) -> tuple[str, dict[int, list[Candidate]]]: + if len(candidates) != EXPECTED_CANDIDATE_COUNT: + raise GenerationError( + f"candidate count {len(candidates)} != {EXPECTED_CANDIDATE_COUNT}" + ) + systematic_codes = {candidate.systematic_code for candidate in candidates} + if len(systematic_codes) != EXPECTED_CANDIDATE_COUNT: + raise GenerationError("systematic candidate codes are not unique") + buckets = candidate_buckets(candidates) + if len(buckets) != EXPECTED_PREFIX_COUNT: + raise GenerationError(f"prefix count {len(buckets)} != {EXPECTED_PREFIX_COUNT}") + digest = hashlib.sha256(logical_tsv(candidates)).hexdigest() + if digest != EXPECTED_LOGICAL_SHA256: + raise GenerationError( + f"logical SHA256 {digest} != {EXPECTED_LOGICAL_SHA256}" + ) + return digest, buckets + + +def render_candidate_tree( + candidates: Sequence[Candidate], + indent: int, + lines: list[str], + deadline: Deadline, +) -> None: + deadline.check("Lean candidate tree rendering") + spaces = " " * indent + if len(candidates) == 1: + candidate = candidates[0] + lines.extend( + ( + f"{spaces}(.leaf", + f"{spaces} {{ patternClass := .{candidate.pattern_class}", + f"{spaces} affineCode := BitVec.ofNat 56 {candidate.affine_code}", + f"{spaces} maskLow := BitVec.ofNat 64 {candidate.mask_low}", + f"{spaces} maskHigh := BitVec.ofNat 64 {candidate.mask_high}", + f"{spaces} systematicCode := BitVec.ofNat 64 {candidate.systematic_code} }})", + ) + ) + return + midpoint = len(candidates) // 2 + lines.append(f"{spaces}(.node") + render_candidate_tree(candidates[:midpoint], indent + 2, lines, deadline) + render_candidate_tree(candidates[midpoint:], indent + 2, lines, deadline) + lines.append(f"{spaces})") + + +def render_lean( + buckets: dict[int, list[Candidate]], deadline: Deadline +) -> bytes: + lines = [LEAN_PREAMBLE.rstrip("\n")] + for prefix in sorted(buckets): + deadline.check("Lean bucket rendering") + suffix = f"{prefix:04x}" + lines.extend( + ( + "", + f"/-- Generated candidate shard for systematic prefix 0x{suffix}. -/", + f"def normalizedWeightSixteenCandidateBucket_{suffix} :", + " NormalizedWeightSixteenCandidateTree :=", + ) + ) + render_candidate_tree(buckets[prefix], 2, lines, deadline) + lines.extend( + ( + "", + "/-- Select the generated candidate shard determined by the first two sorted columns. -/", + "def normalizedWeightSixteenCandidateBucket (codePrefix : BitVec 16) :", + " Option NormalizedWeightSixteenCandidateTree :=", + " match codePrefix.toNat with", + ) + ) + for prefix in sorted(buckets): + lines.append( + f" | {prefix} => some normalizedWeightSixteenCandidateBucket_{prefix:04x}" + ) + lines.extend((" | _ => none", "", "end CryptBoolean")) + return ("\n".join(lines) + "\n").encode("utf-8") + + +def atomic_write(path: Path, content: bytes, deadline: Deadline) -> None: + parent = path.parent if path.parent != Path("") else Path(".") + if not parent.is_dir(): + raise GenerationError(f"output directory does not exist: {parent}") + deadline.check("atomic output") + descriptor, temporary_name = tempfile.mkstemp( + prefix=f".{path.name}.", suffix=".tmp", dir=parent + ) + temporary_path = Path(temporary_name) + try: + os.fchmod(descriptor, 0o644) + with os.fdopen(descriptor, "wb") as output: + output.write(content) + output.flush() + os.fsync(output.fileno()) + deadline.check("atomic output") + os.replace(temporary_path, path) + except BaseException: + try: + os.close(descriptor) + except OSError: + pass + temporary_path.unlink(missing_ok=True) + raise + + +def parse_arguments(argv: Sequence[str]) -> argparse.Namespace: + parser = OneLineArgumentParser( + description="Generate normalized rank-seven weight-sixteen Lean certificates." + ) + parser.add_argument("--lean-output", type=Path) + parser.add_argument("--check", type=Path) + parser.add_argument("--timeout-seconds", type=float, default=60.0) + arguments = parser.parse_args(argv) + if arguments.lean_output is None and arguments.check is None: + raise GenerationError("one of --lean-output or --check is required") + if not math.isfinite(arguments.timeout_seconds) or arguments.timeout_seconds <= 0: + raise GenerationError("--timeout-seconds must be finite and positive") + return arguments + + +def run(argv: Sequence[str]) -> int: + arguments = parse_arguments(argv) + started_at = time.monotonic() + deadline = Deadline(started_at + arguments.timeout_seconds) + candidates = generate_candidates(deadline) + digest, buckets = validate_candidates(candidates) + lean = render_lean(buckets, deadline) + actions = [] + if arguments.check is not None: + deadline.check("Lean output check") + actual = arguments.check.read_bytes() + if actual != lean: + actual_digest = hashlib.sha256(actual).hexdigest() + expected_digest = hashlib.sha256(lean).hexdigest() + raise GenerationError( + f"Lean output mismatch actual={actual_digest} generated={expected_digest}" + ) + actions.append(f"checked={arguments.check}") + if arguments.lean_output is not None: + atomic_write(arguments.lean_output, lean, deadline) + actions.append(f"wrote={arguments.lean_output}") + elapsed = time.monotonic() - started_at + print( + "normalized-weight-sixteen " + f"candidates={len(candidates)} prefixes={len(buckets)} " + f"logical-sha256={digest} lean-bytes={len(lean)} " + f"elapsed={elapsed:.2f}s {' '.join(actions)}" + ) + return 0 + + +def main() -> int: + try: + return run(sys.argv[1:]) + except (GenerationError, OSError) as error: + print(f"normalized-weight-sixteen error={error}", file=sys.stderr) + return 1 + + +if __name__ == "__main__": + raise SystemExit(main()) From e8b1861bdf5127352797312b4863c06a8a443804 Mon Sep 17 00:00:00 2001 From: Asher Yan Date: Thu, 23 Jul 2026 11:17:30 -0400 Subject: [PATCH 4/7] Compile weight-sixteen certificates from compact data --- .gitattributes | 2 + .github/workflows/ci.yml | 11 + .gitignore | 1 - .../NormalizedCandidates.lean | 3432 +++++++++++++++++ lakefile.lean | 31 +- ...te_normalized_weight_sixteen_candidates.py | 191 +- 6 files changed, 3588 insertions(+), 80 deletions(-) create mode 100644 .gitattributes create mode 100644 CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteen/NormalizedCandidates.lean diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..cc93973 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +scripts/generate_normalized_weight_sixteen_candidates.py text eol=lf +CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteen/NormalizedCandidates.lean text eol=lf diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2dcc1c6..1663a5b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,6 +19,17 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v7 + - name: Verify normalized weight-sixteen candidates + if: runner.os == 'Linux' + timeout-minutes: 2 + shell: bash + run: | + set -o pipefail + timeout --signal=TERM --kill-after=10s 90s \ + python3 scripts/generate_normalized_weight_sixteen_candidates.py \ + --check CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteen/NormalizedCandidates.lean \ + --timeout-seconds 60 \ + 2>&1 | tail -c 8192 - name: Set up Lean and restore Mathlib cache uses: leanprover/lean-action@v1 with: diff --git a/.gitignore b/.gitignore index 29370ef..d803175 100644 --- a/.gitignore +++ b/.gitignore @@ -11,4 +11,3 @@ cryptographic_boolean_functions_and_applications/ *.olean *.ilean *.trace -CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteen/NormalizedCandidates.lean diff --git a/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteen/NormalizedCandidates.lean b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteen/NormalizedCandidates.lean new file mode 100644 index 0000000..23234fd --- /dev/null +++ b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteen/NormalizedCandidates.lean @@ -0,0 +1,3432 @@ +/- +Copyright (c) 2026 Asher Yan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Asher Yan with Codex +-/ +module + +public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightSixteen.RankSevenPatterns +import Lean.Elab.Command + +/-! +# Generated normalized weight-sixteen candidates + +Each leaf records a canonical class, an invertible affine normalization, +the resulting 128-bit support mask, and its systematic 64-bit column code. +Candidate trees are sharded by the low sixteen bits of the systematic code so +that each kernel-checked finite classification problem remains small. +-/ + +@[expose] public section + +namespace CryptBoolean + +open Lean Elab Command + +/-- One normalized-pattern certificate. The affine code stores the source origin +in its low seven bits, followed by the seven rows of the normalizing linear map. -/ +structure NormalizedWeightSixteenCandidate where + patternClass : RankSevenWeightSixteenPatternClass + affineCode : BitVec 56 + maskLow : BitVec 64 + maskHigh : BitVec 64 + systematicCode : BitVec 64 + +/-- A balanced tree keeps finite classification reduction logarithmic in the +number of certificates in one prefix shard. -/ +inductive NormalizedWeightSixteenCandidateTree where + | leaf (candidate : NormalizedWeightSixteenCandidate) + | node (left right : NormalizedWeightSixteenCandidateTree) + +namespace NormalizedWeightSixteenCandidateTree + +/-- Whether the tree contains a certificate with the given systematic code. -/ +def containsSystematicCode : + NormalizedWeightSixteenCandidateTree → BitVec 64 → Bool + | .leaf candidate, code => candidate.systematicCode == code + | .node left right, code => + left.containsSystematicCode code || right.containsSystematicCode code + +/-- Propositional membership in a generated candidate tree. -/ +inductive Member (candidate : NormalizedWeightSixteenCandidate) : + NormalizedWeightSixteenCandidateTree → Prop + | leaf : Member candidate (.leaf candidate) + | left {left right} : Member candidate left → Member candidate (.node left right) + | right {left right} : Member candidate right → Member candidate (.node left right) + +end NormalizedWeightSixteenCandidateTree + +declare_syntax_cat normalizedWeightSixteenCandidateRow +local syntax (name := normalizedWeightSixteenCandidateRowSyntax) + ident num num num num : normalizedWeightSixteenCandidateRow + +declare_syntax_cat normalizedWeightSixteenCandidateBucket +local syntax (name := normalizedWeightSixteenCandidateBucketSyntax) + "bucket" ident num normalizedWeightSixteenCandidateRow* : + normalizedWeightSixteenCandidateBucket + +local syntax (name := normalizedWeightSixteenCandidatesCommand) + "normalized_weight_sixteen_candidates" normalizedWeightSixteenCandidateBucket* + "end_normalized_weight_sixteen_candidates" : command + +private meta def normalizedWeightSixteenCandidateTerm + (row : TSyntax `normalizedWeightSixteenCandidateRow) : + CommandElabM (TSyntax `term) := do + match row with + | `(normalizedWeightSixteenCandidateRowSyntax| + $patternClass:ident $affineCode:num $maskLow:num $maskHigh:num + $systematicCode:num) => + let patternClassName := + `CryptBoolean.RankSevenWeightSixteenPatternClass ++ patternClass.getId + `(term| + { patternClass := $(mkIdent patternClassName):ident + affineCode := BitVec.ofNat 56 $affineCode + maskLow := BitVec.ofNat 64 $maskLow + maskHigh := BitVec.ofNat 64 $maskHigh + systematicCode := BitVec.ofNat 64 $systematicCode }) + | _ => throwUnsupportedSyntax + +private meta def normalizedWeightSixteenCandidateTreeTerm + (rows : Array (TSyntax `term)) : CommandElabM (TSyntax `term) := do + let rec loop (fuel : Nat) (current : Array (TSyntax `term)) : + CommandElabM (TSyntax `term) := do + if current.isEmpty then + throwError "a normalized candidate bucket must be nonempty" + else if current.size = 1 then + `(term| NormalizedWeightSixteenCandidateTree.leaf $(current[0]!)) + else + match fuel with + | 0 => throwError "candidate-tree elaboration exhausted its structural bound" + | fuel + 1 => + let midpoint := current.size / 2 + let left ← loop fuel (current.extract 0 midpoint) + let right ← loop fuel (current.extract midpoint current.size) + `(term| NormalizedWeightSixteenCandidateTree.node $left $right) + loop rows.size rows + +private structure NormalizedWeightSixteenBucketData where + codePrefix : TSyntax `num + codePrefixValue : Nat + declarationName : TSyntax `ident + +private meta def elaborateNormalizedWeightSixteenCandidateBucket + (bucketSyntax : TSyntax `normalizedWeightSixteenCandidateBucket) : + CommandElabM NormalizedWeightSixteenBucketData := do + match bucketSyntax with + | `(normalizedWeightSixteenCandidateBucketSyntax| + bucket $label:ident $codePrefixSyntax:num + $rows:normalizedWeightSixteenCandidateRow*) => + let suffix := label.getId.toString.drop 1 + let declarationName := mkIdent <| + Name.mkSimple s!"normalizedWeightSixteenCandidateBucket_{suffix}" + let candidates ← rows.mapM normalizedWeightSixteenCandidateTerm + let tree ← normalizedWeightSixteenCandidateTreeTerm candidates + elabCommand <| ← `(command| + def $declarationName : NormalizedWeightSixteenCandidateTree := $tree) + pure ⟨codePrefixSyntax, codePrefixSyntax.getNat, declarationName⟩ + | _ => throwUnsupportedSyntax + +private meta def validateNormalizedWeightSixteenBucketOrder + (buckets : Array NormalizedWeightSixteenBucketData) : CommandElabM Unit := do + let rec loop (previous : Option Nat) : + List NormalizedWeightSixteenBucketData → CommandElabM Unit + | [] => pure () + | bucketData :: rest => do + if let some previousPrefix := previous then + unless previousPrefix < bucketData.codePrefixValue do + throwErrorAt bucketData.codePrefix + "candidate bucket prefixes must be strictly increasing" + loop (some bucketData.codePrefixValue) rest + loop none buckets.toList + +private meta def normalizedWeightSixteenCandidateDispatcherTerm + (buckets : Array NormalizedWeightSixteenBucketData) : + CommandElabM (TSyntax `term) := do + let rec loop (fuel : Nat) (current : Array NormalizedWeightSixteenBucketData) : + CommandElabM (TSyntax `term) := do + if current.isEmpty then + `(term| none) + else + match fuel with + | 0 => throwError "candidate-dispatch elaboration exhausted its structural bound" + | fuel + 1 => + let midpoint := current.size / 2 + let some bucketData := current[midpoint]? + | throwError "candidate-dispatch midpoint is out of bounds" + let left ← loop fuel (current.extract 0 midpoint) + let right ← loop fuel (current.extract (midpoint + 1) current.size) + `(term| + if codePrefix.toNat < $(bucketData.codePrefix) then + $left + else if codePrefix.toNat = $(bucketData.codePrefix) then + some $(bucketData.declarationName) + else + $right) + loop buckets.size buckets + +local elab_rules : command + | `(command| normalized_weight_sixteen_candidates + $buckets:normalizedWeightSixteenCandidateBucket* + end_normalized_weight_sixteen_candidates) => do + let bucketData ← + buckets.mapM elaborateNormalizedWeightSixteenCandidateBucket + validateNormalizedWeightSixteenBucketOrder bucketData + let dispatcher ← + normalizedWeightSixteenCandidateDispatcherTerm bucketData + let dispatcherName := mkIdent <| + Name.mkSimple "normalizedWeightSixteenCandidateBucket" + elabCommand <| ← `(command| + def $dispatcherName (codePrefix : BitVec 16) : + Option NormalizedWeightSixteenCandidateTree := + $dispatcher) +normalized_weight_sixteen_candidates +bucket b0b07 2823 + twoE8 18085074352242816 72057598332961279 282574505115649 16199641854970235655 + d16Plus 54397531543592960 12885099327 13835058055282163715 18373986379115989767 + f16 9360144676980864 144115192370889023 283399155613697 16199675242525952775 + f16 9150687711889536 144115192370889023 283674029326337 16200486548862601991 + f16 18087518222452864 126100793861407039 283674033520641 16200489580052155143 + f16 9148233138079872 144115192370889023 564049481875457 16415814837058341639 + f16 18085063648643200 72268704565494079 564049498603521 16415817936966322951 + f16 18050154154461312 72057601554186559 565148993454081 16416659062822603527 + f16 9289775898984576 144115192370889023 4611686568191623171 18288747132631583495 + f16 36100267430674560 36169547392287039 4611686568216756225 18288752423407389447 + f16 36170086419038336 36028803461611839 4611688217459032065 18290154300193835783 + f16 36169813688615040 140743930872639 4612248968380841985 18294640238914636551 + f16 9289775898986624 144115192370889023 9223372311736893443 18360522147886205703 + f16 36100267430676608 18084780138627391 9223372311766237185 18360528538156862215 + f16 36170086419040384 18014403878388031 9223374235882225665 18362210790408391431 + f16 36169813688617088 70374112953151 9223934986808213505 18366696729129192199 + f16 9360698727760000 144115192370889023 13835623204292395009 18374092553129757447 +bucket b0d07 3335 + d16Plus 54397531543576704 21475165535 11529215046068469765 18373425636809444615 + f16 9360144676964608 288230380446744927 283261750214657 16199675233969704199 + f16 9150687711873280 288230380446744927 285873050484737 16201049498782600455 + f16 18087518222436608 117093594606666079 285873090330625 16201054729028701447 + f16 9148233138063616 288230380446744927 1126999435288577 16559930025100774663 + f16 18085063648626944 72233520193405279 1126999485579265 16559935324065303815 + f16 18050154154445056 72057601017315679 1130297970130945 16561337200851750151 + f16 9289775898968320 288230380446744927 2305843558977929221 18144631944589413639 + f16 36100267430658304 36169555982221663 2305843559036616705 18144639434354920711 + f16 36170086419022080 36028803461742943 2305847407268593665 18146602062071532807 + f16 36169813688598784 140743930873183 2306968909120569345 18151088000792333575 + f16 9289775899230464 288230380446744927 9223372174295834629 18359956990353280263 + f16 36100267430920448 9042405101732191 9223372174360838145 18359967778603339015 + f16 36170086419284224 9007204086907231 9223376434903384065 18362771532715199751 + f16 36169813688860928 35189203993951 9224497936761626625 18367257471436000519 + f16 9360698727483648 288230380446744927 11530345344088932353 18373531810823212295 +bucket b0d0b 3339 + d16Plus 54397531539415168 73015562615 9799832789158199313 18372304152196353291 + f16 9360144670722304 1152921508901880183 283158872326145 16199675216857206027 + f16 9150687705630976 1152921508901880183 299067188445185 16202175398622596363 + f16 18087518216194304 110338195165610359 299067431190529 16202185026981793035 + f16 9148233131821312 1152921508901880183 4504699155810305 16848160401185639691 + f16 18085063642384640 72207131914338679 4504699407433729 16848170098263264523 + f16 18050154148202752 72057600614662519 4521191830192129 16850693476910042379 + f16 9289775892726016 1152921508901880183 576461302067658769 17856401568505072907 + f16 36100267424416000 36169607521829239 576461302327672833 17856413456249982219 + f16 36170086412779776 36028803462529399 576478344497856513 17859497585826925835 + f16 36169813682356480 140743930876279 580964351930826753 17863983524547726603 + f16 9289775926280448 1152921508901880183 9223372071215040529 18358826675287428363 + f16 36100267457970432 2260668921217399 9223372071482949633 18358846259496291595 + f16 36170086446334208 2251804243984759 9223389629041344513 18363893017328815371 + f16 36169813715910912 8800522277239 9227875636482148353 18368378956049616139 + f16 9360698687949056 1152921508901880183 9804353981240049665 18372410326210120971 +bucket b0e07 3591 + d16Plus 54397531543568512 38655297951 6917529027641081865 18301369146594954759 + f16 9360144672768640 576460756598456735 282986939416577 16199674134474919431 + f16 9150687707677312 576460756598456735 290271092801537 16201330969464409607 + f16 18087518218240640 99079196097184159 290271203950593 16201337303500262919 + f16 9148233133867648 576460756598456735 2252899342114817 16631987614843801095 + f16 18085063644430976 72163151449227679 2252899459530753 16631994017598082567 + f16 18050154150249088 72057599943573919 2260595923484673 16633676269849611783 + f16 2534376453720192 576460756598456735 2305843284095811593 18144349365822950919 + f16 36047490868332672 18084805908431263 2305843284225818625 18144359054578159111 + f16 36169674097969280 18014403878781343 2305851805310910465 18146882433224936967 + f16 36169810463180928 70374112954783 2308094809027395585 18151368371945737735 + f16 2534376453980288 576460756598456735 4611686155868446729 18287899396332195335 + f16 36047490868592768 9042422281601439 4611686156000559105 18287911284077104647 + f16 36169674098229376 9007204087169439 4611694814522507265 18290995413654048263 + f16 36169810463441024 35189203995039 4613937818241081345 18295481352374849031 + f16 9360698723289728 576460756598456735 6919789623682007041 18301475320608722439 +bucket b0e0b 3595 + d16Plus 54397531539406976 141736092087 5188146770730811425 18300247661981863435 + f16 9360144670687872 2305843013508727223 282884262854657 16199674117362421259 + f16 9150687705596544 2305843013508727223 316659370295297 16202456869304405515 + f16 18087518216159872 92323796656128439 316659885670401 16202467601453354507 + f16 9148233131786880 2305843013508727223 9008298783164417 16920217990928666123 + f16 18085063642350208 72136763170161079 9008299303239681 16920228791796043275 + f16 18050154148168320 72057599540920759 9042383643607041 16923032545907904011 + f16 2534376451639424 2305843013508727223 576461027185541153 17856118989738610187 + f16 36047490866251904 18084908987646391 576461027718201345 17856133076473220619 + f16 36169674095888512 18014403880354231 576495936679706625 17859777956980329995 + f16 36169810461100160 70374112960951 585467951558180865 17864263895701130763 + f16 2534376485191808 2305843013508727223 4611686052787652641 18286769081266343435 + f16 36047490899804288 2260737640694199 4611686053323997185 18286789764970057227 + f16 36169674129440896 2251804245033399 4611721202800001025 18292116898267663883 + f16 36169810494652544 8800522281399 4620693217682130945 18296602836988464651 + f16 9360698687916672 2305843013508727223 5197189154894512129 18300353835995631115 +bucket b0e0d 3597 + d16Plus 54397531538350336 279177150935 2882303761517117505 18156134681552883213 + f16 9360144670476544 4611686022722421207 282747360772097 16199671918372851213 + f16 9150687705385216 4611686022722421207 351843740286977 16203019810668023309 + f16 18087518215948544 83316597401387479 351844794630145 16203032750396476941 + f16 9148233131575552 4611686022722421207 18015498037897217 17064333170414718477 + f16 18085063642138880 72101578798072279 18015499094851585 17064346178861600269 + f16 18050154147956992 72057599004049879 18084767270436865 17067710683903626765 + f16 2534376451883264 4611686022722421207 576460889744482369 17855553832205684237 + f16 36047490866495744 9042662799770071 576460890816118785 17855572316919696909 + f16 36169674096132352 9007204090839511 576531121049698305 17860338699287137805 + f16 36169810461344000 35189204009431 594475150812913665 17864824638007938573 + f16 2534376485175552 4611686022722421207 2305843043573958721 18142653893224173069 + f16 36047490899788032 2260875079647703 2305843044647174145 18142676775917587981 + f16 36169674129424640 2251804247130583 2305913377958395905 18148564660145360397 + f16 36169810494636288 8800522289623 2323857407723177985 18153050598866161165 + f16 9360698687965440 4611686022722421207 2900388529844518913 18156240855566650893 +bucket b1307 4871 + twoE8 18085043456999552 4503603922407199 281543697235969 16197381224838533895 + f16 18087521418512512 869194732377539359 281612417761281 16198229010032366343 + f16 9150690907949184 9007203549774623 281612618039297 16198241376099046151 + f16 9360147873040512 9007203549774623 294737837817857 16201371767358034695 + f16 9148217157781632 9007203549774623 563018673995777 16413554241151111943 + f16 18085047668344960 4714710154937119 563018674995201 16413557306699879175 + f16 18050138174163072 4503607143629599 563087393423361 16414398432556159751 + f16 36170085353685120 576460758746071839 4611686156000559105 18287911330832913159 + f16 36100266365321344 576601502676747039 4611694814522507265 18290995461487792903 + f16 9289774833631360 9007203549774623 4611694814654660611 18291007728537768711 + f16 36170085353687168 288230381520618271 9223372174360838145 18359967821047468807 + f16 36100266365323392 288300757780857631 9223376434903384065 18362771576237265671 + f16 9289774833633408 9007203549774623 9223376434968412163 18362782743792390919 + f16 9360697662406784 9007203549774623 13835621142676635649 18374092518635279111 +bucket b130b 4875 + twoE8 18085043211468928 1125904201888567 281492156841985 16196250909772681995 + f16 18087521439320192 3459890418022417207 281509336973313 16197098729325728523 + f16 9150690928756864 2251804108718903 281510142017537 16197119891351212811 + f16 9360147893848192 2251804108718903 334268715237377 16202502048064148235 + f16 9148217028774016 2251804108718903 562967133601793 16412423943197496075 + f16 18085047539337344 1337010434409271 562967133814785 16412426991566656267 + f16 18050138045155456 1125907423101751 562984313421825 16413268117422936843 + f16 36170085341200512 2305843015656342327 4611686053323997185 18286789846152450827 + f16 36100266352836736 2305983759587017527 4611721202800001025 18292116980527993611 + f16 9289774821146752 2251804108718903 4611721203336380419 18292138026490860299 + f16 36170085341202560 1152921509975753527 9223372071482949633 18358846336367006475 + f16 36100266352838784 1152991886235992887 9223389629041344513 18363893095277466379 + f16 9289774821148800 2251804108718903 9223389629309272067 18363913041745482507 + f16 9360697649922176 2251804108718903 13835621039595847681 18374092501388038923 +bucket b1507 5383 + f16 18087521418496256 725079544301683999 281749858811905 16198794158975489287 + f16 9150690907932928 18014402804516127 281750023438337 16198804317462664455 + f16 9360147873024256 18014402804516127 292538816659457 16201369568368465159 + f16 9148217157765376 18014402804516127 1125968627408897 16557669429193544967 + f16 18085047668328704 4679525782848799 1125968630513665 16557674693798860039 + f16 18050138174146816 4503606606759199 1126174785798145 16559076570585306375 + f16 36170085353668864 576460758746203423 2305843284225818625 18144359092710610183 + f16 36100266365305088 576601511266682143 2305851805310910465 18146882472435324167 + f16 9289774833615104 18014402804516127 2305851805440966661 18146892540495598855 + f16 36170085353931008 144115192908023071 9223372311766237185 18360528563354277127 + f16 36100266365567232 144150393922848031 9223374235882225665 18362210816683742471 + f16 9289774833877248 18014402804516127 9223374235911593989 18362217586259465479 + f16 9360697662130432 18014402804516127 11530341220857413633 18373531776328733959 +bucket b150d 5389 + twoE8 18085043209534464 562954248475991 281483566776321 16195685752239625485 + f16 18087521439466496 5765170477282690391 281509336973313 16197098737915532557 + f16 9150690928903168 2251804108719447 281510678757377 16197122090340914445 + f16 9360147893994496 2251804108719447 369444497391617 16203064989427635469 + f16 9148217027749888 2251804108719447 1125908496949249 16555973982263121165 + f16 18085047538313216 738876108899671 1125908497301505 16555979221099025677 + f16 18050138044131328 562956932810071 1125934266712065 16557381097885472013 + f16 36170085341086720 4611686024870167895 2305843044647174145 18142676865689916685 + f16 36100266352722944 4611826777390646615 2305913377958395905 18148564750995625229 + f16 9289774821032960 2251804108719447 2305913379031646213 18148587987425236237 + f16 36170085341348864 1152921509439014231 9223372071482949633 18358846336333583629 + f16 36100266352985088 1152956710453839191 9223389629041344513 18363893095244043533 + f16 9289774821295104 2251804108719447 9223389629309263877 18363913033189102861 + f16 9360697649548288 2251804108719447 11530340980335575041 18373531750457873677 +bucket b1513 5395 + d16Plus 54397530474061952 1103823443735 9259400833873740033 18370061182969648403 + f16 9360147067767040 1152921508901881623 290374417383425 16201357469647705363 + f16 9150690102675712 1152921508901881623 299067298545665 16202181969922561299 + f16 18087520613239040 583216156039513879 299067431190529 16202185052650935571 + f16 9289774028357888 1152921508901881623 36037593246236929 17282201412242576659 + f16 36100265560047872 576602593598441239 36037593380421633 17282204538120508691 + f16 36170084548411648 576460758762718999 36046389339226113 17283045663976789267 + f16 9148216352508160 1152921508901881623 72057662758486145 17422360557448140051 + f16 18085046863071488 4644891166574359 72057663025840129 17422379016392742163 + f16 18050137368889600 4503606078277399 72075186225020929 17427145398760183059 + f16 36169809687281920 140743930877719 108086391056924673 17433326810180424979 + f16 9289778323325184 1152921508901881623 9223372071215038849 18358826649618289939 + f16 36100269855015168 2253453376161559 9223372071482949633 18358846259396023571 + f16 36170088843378944 2251804133885719 9223389629041344513 18363893017228547347 + f16 36169813982249216 554059241239 9295429630892703873 18370621925276325139 + f16 9360692562168064 1152921508901881623 9331476020366147585 18370728073419625747 +bucket b1607 5639 + f16 18087520881623680 436849168149973279 282024740913153 16199076729168860679 + f16 9150690371060352 36028801313999135 282024834236417 16199084692927813127 + f16 9360147336151680 36028801313999135 288140774342657 16201088093408597511 + f16 9148216620892800 36028801313999135 2251868534235137 16629727018936571399 + f16 18085047131456128 4609157038672159 2251868541550593 16629733387331638791 + f16 18050137637274240 4503605533018399 2252349570547713 16631415639583168007 + f16 36169672499939456 288230381521013023 2305843559036616705 18144639463864014343 + f16 36047489270302848 288300783550662943 2305847407268593665 18146602092658562567 + f16 2534374855690368 36028801313999135 2305847407327330313 18146609961729136135 + f16 36169672500199552 144115192908286239 4611686568216756225 18288752444293125639 + f16 36047489270562944 144150411102718239 4611688217459032065 18290154322157508103 + f16 2534374855950464 36028801313999135 4611688217484206089 18290159992238380551 + f16 9360697125259904 36028801313999135 6919781377218969601 18301475286114244103 +bucket b160e 5646 + twoE8 2260638890081280 281479271770519 281479271743489 16195403173456385550 + f16 10208046357948416 6917810506912827799 281509336973313 16197098737932244494 + f16 9649494451038208 2251804108720535 281510947127297 16197122094619104782 + f16 9592766522992640 2251804108720535 387032388468737 16203066084644296206 + f16 9658737220659200 2251804108720535 2251804108742657 16627748997517743630 + f16 11334392941389824 387032388012439 2251804109176833 16627755335848498702 + f16 11338756628162560 281480882358679 2251834173489153 16629437588100027918 + f16 11338761226971136 4611686023796689303 2305843044647174145 18142676865673205262 + f16 11334397540198400 4611756425826339223 2305913377958395905 18148564750978913806 + f16 9658741819467776 2251804108720535 2305913379031629833 18148587983147046414 + f16 11338761228255360 2305843014046124439 4611686053323997185 18286789846102316558 + f16 11334397541482624 2305878232240556439 4611721202800001025 18292116980477859342 + f16 9658741820752000 2251804108720535 4611721203336355849 18292138013656290830 + f16 9592251126669440 2251804108720535 6919780861815029761 18301475255931573774 +bucket b1613 5651 + d16Plus 54397530474053760 2203351853847 4647714815446352385 18298004692755158547 + f16 9360147067732608 2305843013508729623 285976639307777 16201075994687837715 + f16 9150690102641280 2305843013508729623 316659417481217 16202462345387709971 + f16 18087520613204608 294985779887803159 316659885670401 16202467622844306963 + f16 2534374587271296 2305843013508729623 36033195132600833 17281918833476113939 + f16 36047489001883776 288302948214180631 36033195602345985 17281924158343747091 + f16 36169672231520384 288230381554043671 36063981458161665 17283326035130193427 + f16 9148216352473728 2305843013508729623 144115256796397697 17494418147191166483 + f16 18085046863037056 4574522422397719 144115257332203521 17494437709925520915 + f16 18050137368855168 4503605004536599 144150372448993281 17499484467758044691 + f16 36169809662085248 70374112963351 180143985094836225 17505383300395046419 + f16 2534378882236544 2305843013508729623 4611686052787651201 18286769059875395091 + f16 36047493296849024 2254552887790359 4611686053323997185 18286789764886500883 + f16 36169676526485632 2251804150663959 4611721202800001025 18292116898184107539 + f16 36169813957050496 554059246359 4755801206503243905 18298845806215173651 + f16 9360692562135680 2305843013508729623 4791865188431167489 18298951958670218771 +bucket b1615 5653 + d16Plus 54397530472997120 4402408672535 2341871806232658945 18153891712326178325 + f16 9360147067521280 4611686022722424087 283778152923137 16200513044768101909 + f16 9150690102429952 4611686022722424087 351843756015617 16203023096318006805 + f16 18087520612993280 150870591811947799 351844794630145 16203032763231049237 + f16 2534374587515136 4611686022722424087 36030996075783169 17281353675943187989 + f16 36047489002127616 144154774789491991 36030997115961345 17281363398790223381 + f16 36169672231764224 144115192974871831 36099165796696065 17283886777437001237 + f16 9148216352262400 4611686022722424087 288230444872245377 17638533326677218837 + f16 18085046862825728 4539338050309399 288230445944930305 17638555096991077909 + f16 18050137368643840 4503604467666199 288300744896937985 17644162605753767445 + f16 36169809662329088 35189204012311 324259173170683905 17649496280824288789 + f16 2534378882220288 4611686022722424087 2305843043573957761 18142653880389604885 + f16 36047493296832768 2256751911046423 2305843044647174145 18142676775867454997 + f16 36169676526469376 2251804184218903 2305913377958395905 18148564660095227413 + f16 36169813957034240 554059255063 2594073385365405825 18155293568092870165 + f16 9360692562184448 4611686022722424087 2630172552202289153 18155399729171404309 +bucket b190b 6411 + f16 18087521437223168 2451084101491429687 281749858811905 16198794176155097355 + f16 9150690926659840 18014402804519223 281750425305089 16198808715442067723 + f16 9360147891751168 18014402804519223 318875556118529 16202495451095439627 + f16 9148217026676992 18014402804519223 4503616807536641 16844769507324795147 + f16 18085047537240320 1275437783257399 4503616811433985 16844779152863598859 + f16 18050138043058432 1125906483581239 4503874505539585 16847302531510376715 + f16 36170085339103488 2305843015657263415 576461027718201345 17856133131785541899 + f16 36100266350739712 2305983819716563255 576495936679706625 17859778013370587403 + f16 9289774819049728 18014402804519223 576495937212416017 17859792462364350731 + f16 36170085372657920 144115192506159415 9223372311766237185 18360528563287431435 + f16 36100266384294144 144124057183392055 9223374235882225665 18362210816616896779 + f16 9289774852604160 18014402804519223 9223374235911587857 18362217569146706187 + f16 9360697614272768 18014402804519223 9804336663667671041 18372410274468403467 +bucket b190d 6413 + f16 18087521437385728 4900479348827558231 281612417761281 16198229035801778445 + f16 9150690926822400 9007203549778263 281613556645889 16198247973068151053 + f16 9360147891913728 9007203549778263 356250359431169 16203060591448496397 + f16 9148217025669120 9007203549778263 4503608217470977 16844204358347987213 + f16 18085047536232448 712487829836119 4503608219402241 16844213995296987405 + f16 18050138042050560 562956530159959 4503737066455041 16846737373943765261 + f16 36170085339005952 4611686024870957399 576460890816118785 17855572389445310733 + f16 36100266350642176 4611826828930257239 576531121049698305 17860338772890687757 + f16 9289774818952192 9007203549778263 576531122121375761 17860357611340896525 + f16 36170085372560384 288230380582015319 9223372174360838145 18359967820947200269 + f16 36100266384196608 288239245259247959 9223376434903384065 18362771576136997133 + f16 9289774852506624 9007203549778263 9223376434968397841 18362782718123251981 + f16 9360697614175232 9007203549778263 9804336526226620417 18372410265844783373 +bucket b1913 6419 + f16 18087520638208256 2315976112670315287 285873090330625 16201054771927587091 + f16 9150690127644928 288230380446749463 285873562451969 16201060480896538899 + f16 9360147092736256 288230380446749463 316814034731009 16202486655137159443 + f16 36170084540088576 2305843015672992535 36033195602345985 17281924179296327955 + f16 36100265551724800 2305984850508714775 36063981458161665 17283326057160710419 + f16 9289774020034816 288230380446749463 36063981927956737 17283331710195669267 + f16 9148216227662080 288230380446749463 72057611218092161 17421230259494525203 + f16 18085046738225408 1267191446049559 72057611284905985 17421248701259520275 + f16 18050137244043520 1125906357752599 72061992084701185 17426015083626961171 + f16 9289778315002112 288230380446749463 9223372174295826817 18359956947571382547 + f16 36100269846692096 9008852817220375 9223372174360838145 18359967778436225299 + f16 36170088835055872 9007203574944535 9223376434903384065 18362771532548086035 + f16 9360692553844992 288230380446749463 9331462826025287681 18370728056172386579 +bucket b1915 6421 + f16 18087520638370816 4630263371185329431 283674033520641 16200489631574268181 + f16 9150690127807488 144115192370894103 283675078033409 16200499738522622229 + f16 9360147092898816 144115192370894103 352127222284289 16203051795490216213 + f16 36170084539991040 4611686024886686999 36030997115961345 17281363436956096789 + f16 36100265551627264 4611827859722409239 36099165796696065 17283886816680810773 + f16 9289774019937280 144115192370894103 36099166836916481 17283896859172215061 + f16 9148216226654208 144115192370894103 72057602628026497 17420665110517717269 + f16 18085046737217536 704241492628759 72057602661416961 17420683543692908821 + f16 18050137243035648 562956404331799 72059793061314561 17425449926060349717 + f16 9289778314904576 144115192370894103 9223372311736877441 18360522096547928341 + f16 36100269846594560 18016052071961879 9223372311766237185 18360528537956325653 + f16 36170088834958336 18014402829686039 9223374235882225665 18362210790207854869 + f16 9360692553747456 144115192370894103 9331460626968477697 18370728047548766485 +bucket b1a0b 6667 + f16 18087520900350592 1298162596884586807 282024740913153 16199076746348468747 + f16 9150690389787264 36028801314005303 282025034776577 16199089090907216395 + f16 9360147354878592 36028801314005303 301283374268417 16202213976135571979 + f16 9148216489804416 36028801314005303 9007216434890753 16916827097067821579 + f16 18085047000367744 1205069039083831 9007216442998785 16916837846396377611 + f16 18050137506185856 1125905409843511 9007749010817025 16919641600508238347 + f16 36169672485374080 1152921509977727287 576461302327672833 17856413502938946059 + f16 36047489255737472 1152992015085019447 576478344497856513 17859497633593825803 + f16 2534374841124992 36028801314005303 576478344757919777 17859509883597888011 + f16 36169672518926464 144115192507212087 4611686568216756225 18288752444226279947 + f16 36047489289289856 144124125902872887 4611688217459032065 18290154322090662411 + f16 2534374874677376 36028801314005303 4611688217484199969 18290159975125621259 + f16 9360697077402240 36028801314005303 5197154519749754881 18300353784253913611 +bucket b1a0e 6670 + f16 10208046374594560 5188428250002563479 281612417761281 16198229035818490382 + f16 9649494467684352 9007203549782423 281613623689217 16198247977346341390 + f16 9592766539638784 9007203549782423 360644110974977 16203061686665157134 + f16 9658737237305344 9007203549782423 9007203549792257 16915979373602609678 + f16 11334392958035968 360644108951959 9007203551805441 16915990110046460430 + f16 11338756644808704 281480479711639 9007336693760001 16918793864158321166 + f16 11338761177032704 4611686023798268311 576460890816118785 17855572389428599310 + f16 11334397490259968 4611756528905560471 576531121049698305 17860338772873976334 + f16 9658741769529344 9007203549782423 576531122121359393 17860357607062706702 + f16 11338761342697600 576460756734779799 4611686156000559105 18287911330715933198 + f16 11334397655924864 576469690130440599 4611694814522507265 18290995461370812942 + f16 9658741935194240 9007203549782423 4611694814654629921 18291007698590439950 + f16 9592251112104064 9007203549782423 5197154107426603009 18300353771318483470 +bucket b1a13 6675 + f16 18087520634012288 1163054608063472407 290271203950593 16201337342120958483 + f16 9150690123448960 576460756598465303 290271340527617 16201340856361687571 + f16 9360147088540288 576460756598465303 299221915795457 16202205180177291795 + f16 36169672219035776 1152921510009185047 36037593380421633 17282204550449732115 + f16 36047488989399168 1152994076669322007 36046389339226113 17283045677383948819 + f16 2534374574786688 576460756598465303 36046389473460737 17283049131429206547 + f16 9148216223466112 576460756598465303 144115205256003713 17493287849237551635 + f16 18085046734029440 1196822701875991 144115205389942785 17493307394792299027 + f16 18050137239847552 1125905284014871 144123984169140225 17498354152624822803 + f16 2534378869751936 576460756598465303 4611686155868439169 18287899357828487699 + f16 36047493284364416 9009952328852247 4611686156000559105 18287911283926702611 + f16 36169676514001024 9007203591725847 4611694814522507265 18290995413503646227 + f16 9360692549651072 576460756598465303 4791838799749447681 18298951941422979603 +bucket b1a16 6678 + f16 10208042113181696 4647996294718105879 283674033520641 16200489631590980118 + f16 9649490206271488 144115192370899223 283675082162177 16200499742800812566 + f16 9592762278225920 144115192370899223 352397805223937 16203052890706876950 + f16 11338748392794112 4611686023829727511 36030997115961345 17281363436939385366 + f16 11334384706021376 4611758590489864471 36099165796696065 17283886816664099350 + f16 9658728985290752 144115192370899223 36099166836900353 17283896854894025238 + f16 9658732975892480 144115192370899223 144115192370905217 17492440125772339734 + f16 11334388696623104 352397771745559 144115192404377601 17492459658442381846 + f16 11338752383395840 281480353884439 144117387099176961 17497506416274905622 + f16 9658750191681664 144115192370899223 4611686568191591041 18288747081293306390 + f16 11334405912412288 36031550093076759 4611686568216756225 18288752423206853142 + f16 11338769599185024 36028801355950359 4611688217459032065 18290154299993299478 + f16 9592242855616640 144115192370899223 4791832202579017729 18298951928487549462 +bucket b1a19 6681 + d16Plus 54397530333585664 17596749541655 612489549322391553 17865665751467956761 + f16 9360147061278976 4611686022722433303 283829692530689 16200516330418084377 + f16 9150690096187648 4611686022722433303 351843756802049 16203023109152578073 + f16 18087520606750976 154248291532484887 351844794630145 16203032763281185305 + f16 2534374606242048 4611686022722433303 36030996075780097 17281353663108618777 + f16 36047489020854528 144141580649967895 36030997115961345 17281363398740089369 + f16 36169672250491136 144115192773554455 36099165796696065 17283886777386867225 + f16 2534378867654912 4611686022722433303 576460889744478337 17855553819371117081 + f16 36047493282267392 9025345491644695 576460890816118785 17855572316869564953 + f16 36169676511904000 9007203826610455 576531121049698305 17860338699237005849 + f16 9148216196204800 4611686022722433303 1152921521786980481 17925633387695708697 + f16 18085046706768128 1135250050724119 1152921522860457985 17925659555988970009 + f16 18050137212586240 1125904344494359 1152991873351286785 17932388566611991065 + f16 36169809689379072 8800522301719 1188950301625812993 17937722241682512409 + f16 36169813950791936 554059264279 1729382256910270593 17939965210909219353 + f16 9360692555942144 4611686022722433303 1765481423747153921 17940071371987753497 +bucket b1c0d 7181 + f16 18087520900301824 1441714835007029591 282024740913153 16199076746381892621 + f16 9150690389738496 36028801314013527 282025068199937 16199089099463597069 + f16 9360147354829824 36028801314013527 303473807589377 16202216166568893453 + f16 9148216488585216 36028801314013527 18014407099557889 17060377127577066509 + f16 18085046999148544 606934713581911 18014407107805185 17060390075895323661 + f16 18050137504966656 562954919559511 18014948265426945 17063754580937350157 + f16 36169672485520384 1152921509442961751 576461302327672833 17856413502905523213 + f16 36047489255883776 1152956968151892311 576478344497856513 17859497633560402957 + f16 2534374841271296 36028801314013527 576478344757911617 17859509875041508365 + f16 36169672518812672 288230380585173335 2305843559036616705 18144639463763745805 + f16 36047489289176064 288239451417690455 2305847407268593665 18146602092558294029 + f16 2534374874563584 36028801314013527 2305847407327316033 18146609936059997197 + f16 9360697077353472 36028801314013527 2900318709790801921 18156240795201313805 +bucket b1c0e 7182 + f16 10208046375764992 2882585240788877719 281749858811905 16198794176205233166 + f16 9649494468854784 18014402804531607 281750525771777 16198808728276638734 + f16 9592766540809216 18014402804531607 325459740983297 16202498736745421838 + f16 9658737238475776 18014402804531607 18014402804525057 17060094553088662542 + f16 11334392959206400 325459736871319 18014402808643585 17060107497112017934 + f16 11338756645979136 281479942848919 18014673387454465 17063472002154044430 + f16 11338761177926784 2305843014049808791 576461027718201345 17856133131735407630 + f16 11334397491154048 2305878472758739351 576495936679706625 17859778013320453134 + f16 9658741770423424 18014402804531607 576495937212391489 17859792449529781262 + f16 11338761342307456 576460756736885143 2305843284225818625 18144359092593630222 + f16 11334397655534720 576469827569402263 2305851805310910465 18146882472318344206 + f16 9658741934804096 18014402804531607 2305851805440936001 18146892510548270094 + f16 9592251113030656 18014402804531607 2900318434908700673 18156240790889503758 +bucket b1c15 7189 + f16 18087520633963520 1171498857364800791 290271203950593 16201337342154382357 + f16 9150690123400192 576460756598474007 290271342493697 16201340864918068245 + f16 9360147088491520 576460756598474007 299350764814337 16202207370610613269 + f16 36169672219182080 1152921509505877271 36037593380421633 17282204550416309269 + f16 36047488989545472 1152961091320497431 36046389339226113 17283045677350525973 + f16 2534374574932992 576460756598474007 36046389473453057 17283049122872826901 + f16 9148216222246912 576460756598474007 288230384741785729 17636837879746796565 + f16 18085046732810240 598688376374551 288230384875864065 17636859624291245077 + f16 18050137238628352 562954793731351 288239172244865025 17642467133053934613 + f16 2534378869638144 576460756598474007 2305843284095796353 18144349327319243797 + f16 36047493284250624 18019350606857495 2305843284225818625 18144359054427757589 + f16 36169676513887232 18014402880029975 2305851805310910465 18146882433074535445 + f16 9360692549602304 576460756598474007 2630110978611609601 18155399703300545557 +bucket b1c16 7190 + f16 10208042114352128 2342153285504420119 285873090330625 16201054771977722902 + f16 9649490207441920 288230380446763287 285873568546817 16201060493731109910 + f16 9592762279396352 288230380446763287 317213466689537 16202489940787141654 + f16 11338748393688192 2305843014112725271 36033195602345985 17281924179246193686 + f16 11334384706915456 2305882595927345431 36063981458161665 17283326057110576150 + f16 9658728986184832 288230380446763287 36063981927932929 17283331697361099798 + f16 9658732977062912 288230380446763287 288230380446752897 17636555305258392598 + f16 11334388697793536 317213399664919 288230380513787905 17636577045507939350 + f16 11338752384566272 281479817021719 288234774198288385 17642184554270628886 + f16 9658750191291520 288230380446763287 2305843558977897601 18144631901807516694 + f16 11334405912022144 36033749116340503 2305843559036616705 18144639434187807766 + f16 11338769598794880 36028801389512983 2305847407268593665 18146602061904419862 + f16 9592242856543232 288230380446763287 2630106580497989633 18155399698988735510 +bucket b1c19 7193 + f16 9360147061441536 2305843013508747543 286157027934209 16201081470771141657 + f16 9150690096350208 2305843013508747543 316659420233729 16202462366778661913 + f16 18087520606913536 306807728909668631 316659885670401 16202467622927866905 + f16 2534374606144512 2305843013508747543 36033195132590081 17281918812085165081 + f16 36047489020756992 288256768725831959 36033195602345985 17281924158260190233 + f16 36169672250393600 288230380849418519 36063981458161665 17283326035046636569 + f16 2534378867557376 2305843013508747543 576461027185528961 17856118968347663385 + f16 36047493282169856 18032544746393879 576461027718201345 17856133076389665817 + f16 36169676511806464 18014403081359639 576495936679706625 17859777956896775193 + f16 9148216195196928 2305843013508747543 1152921513196914817 17925068238718901273 + f16 18085046705760256 572300097310999 1152921513733652481 17925094398422359065 + f16 18050137211578368 562954391081239 1152956688979066881 17931823409045380121 + f16 9360692555844608 2305843013508747543 1765446238838194177 17940071363364133913 +bucket b1c1a 7194 + f16 9592762379273216 1152921508901904663 290825388949505 16201364040947670042 + f16 9649490307318784 1152921508901904663 299067305426945 16202181995591703578 + f16 10208042214228992 612771028594155799 299067431190529 16202185052751207450 + f16 9658729050688640 1152921508901904663 36037593246210049 17282201386573437978 + f16 11334384771419264 576487144877547799 36037593380421633 17282204538020240410 + f16 11338748458192000 576460757001134359 36046389339226113 17283045663876520986 + f16 9658750091414656 1152921508901904663 576461302067630209 17856401542835936282 + f16 11334405812145280 36046943255879959 576461302327672833 17856413456149715994 + f16 11338769498918016 36028801590845719 576478344497856513 17859497585726659610 + f16 9658733076939776 1152921508901904663 1152921508901881985 17924785664230497306 + f16 11334388797670400 290825120604439 1152921509170249729 17924811819639053338 + f16 11338752484443136 281479414374679 1152939096792956929 17931540830262074394 + f16 9592242925208576 1152921508901904663 1765428646383714305 17940071359052323866 +bucket b2307 8967 + twoE8 18084907091787904 17596481995039 1168231108609 15044442059595653895 + f16 18085475940337792 864708724936343839 1236950589441 15045289913238430471 + f16 9148645429774464 35188667253023 1237151911937 15045319871222719239 + f16 18085456763979904 54060792009654559 2267742740481 15260618235928126215 + f16 9148626253416576 35188667253023 2267755319297 15260639397953610503 + f16 18050274539374720 17599702434079 2336462213121 15261459267043795719 + f16 9359738777405568 35188667253023 3378867951640577 16637933958408643335 + f16 36099311808839808 612489562207486239 4613937818241081345 18295481469197558535 + f16 9288820277149824 35188667253023 4613937818383679491 18295511396883571463 + f16 36099311808841856 306244787546292511 9224497936761626625 18367257583947031303 + f16 9288820277151872 35188667253023 9224497936832921603 18367286412138193671 + f16 9359743105925248 35188667253023 13835060391744380929 18374074926179754759 +bucket b230b 8971 + twoE8 18084906846257280 4402344821047 1116691497985 15043311744529801995 + f16 18085475961145472 3458768916162216247 1133871368193 15044159632531792651 + f16 9148645450582144 8800388186423 1134676673537 15044198386474885899 + f16 18085456634972288 54047597870121271 2216203126785 15259487937974510347 + f16 9148626124408960 8800388186423 2216215708673 15259513497979396875 + f16 18050274410367104 4405562900791 2233382994945 15260328951910572811 + f16 9359738798213248 8800388186423 13511915573610497 16927290217219957515 + f16 36099311796355200 2341871819117756727 4620693217682130945 18296602988237759243 + f16 9288820264665216 8800388186423 4620693218227388419 18296641694836663051 + f16 36099311796357248 1170935916001427767 9227875636482148353 18368379102987232011 + f16 9288820264667264 8800388186423 9227875636754776067 18368416710091285259 + f16 9359743093440640 8800388186423 13835060288665159681 18374074908932514571 +bucket b2313 8979 + twoE8 18084905248227456 279223403287 85899345985 14466842161908359955 + f16 18085459448170624 3458764792993612567 103079215233 14467690084134822675 + f16 9148628937607296 554050978583 103884521537 14467737634036720403 + f16 18085459298355328 864691407628206871 154618822785 14683018424071496467 + f16 9148628787792000 554050978583 154820149313 14683061575993991955 + f16 18050274943043712 282394297111 171798691905 14683859369154388755 + f16 9359735069476992 554050978583 216172868013129857 17505993973109302035 + f16 36099303806206080 2882303774402216727 4755801206503243905 18298845992092640019 + f16 9288812274516096 554050978583 4755801207174332419 18298893529009562387 + f16 36099303806208128 1441151893643658007 9295429630892703873 18370622106842112787 + f16 9288812274518144 554050978583 9295429631228248067 18370668544264184595 + f16 9359735103291520 554050978583 13835058227080855681 18374066112704750355 +bucket b231c 8988 + twoE8 18032063728713856 844437815247127 5185 10994566944484696860 + twoE8 2392610335228032 22269405643031 196611 11718792120789377820 + f16 18102982377867392 3458764526705656087 6273 10995414771431580444 + f16 18102982228052096 864691141340250391 9345 11210743111368254236 + f16 18102980097345664 54043208413561111 10305 11211584203269546780 + f16 10274422947840640 2882304040690204951 4325505 12511720470922142492 + f16 11400322854684928 1441152159931646231 8454273 12583496585671615260 + f16 11400357214423168 44259638198551 12582915 12586860961900274460 + f16 10274425078547072 2341876208574349591 67241985 13088190019184894748 + f16 18102948018129152 2306159672857674007 71307265 13091287343222694684 + f16 11400324985391360 1170940305458020631 134285313 13159966133934367516 + f16 18094151925105280 1153519643227537687 142610433 13163626407959143196 + f16 11400359345129600 40136469594391 201326595 13165573513967248156 + f16 10274425228362368 612507145803612439 268574721 13376424776203510556 + f16 18102947868313856 576751027668336919 272630785 13379513304147763996 + f16 18102945737607424 36310826046669079 335544385 13381756273508164380 + f16 11400325135206656 306262371142418711 536944641 13448200890952983324 + f16 18094151775289984 288802126493335831 545260545 13451852368884212508 + f16 18094149644583552 18577902513897751 671088705 13454095338244612892 + f16 11400359494944896 26942330061079 805306371 13454929777191232284 +bucket b231f 8991 + f16 11329994895919232 39861591703831 3377699720527875 16637848826669703967 + f16 9095787268278400 12885131543 3377699720537153 16637875460700840735 + f16 18050172400699648 281337364759 5629499534213185 16854031439592760095 + f16 18050171863827072 280280400151 11258999068426305 16926370508590687007 + f16 11329995045734528 26667452170519 13510798882111491 16927205089893688095 + f16 9095787418093696 12885131543 13510798882117697 16927228451109413663 + f16 18050171335346432 4404490240279 73183493944771585 17430501022348419871 + f16 18050171460192512 17598628987159 76561193665302529 17431631337481380639 + f16 18050171331150464 4403417547031 146366987889542145 17502840091346346783 + f16 18050171460158080 17597555507479 153122387330600961 17503970406479307551 + f16 11330007829973120 22544283566359 216172782113783811 17505917641960661791 + f16 9095800202332288 12885131543 216172782113789057 17505940990391952159 + f16 36170119700938880 35188702937367 4613937818241081345 18295481352225170207 + f16 36170119713423488 8800422297879 4620693217682130945 18296602836905370399 + f16 36170120778776704 554053632279 4755801206503243905 18298845806132077343 + f16 9024877407371392 12885131543 4767060205571670019 18298946511725339423 + f16 36170122926358784 35188685111575 9224497936761626625 18367257471269544735 + f16 36170122934681856 8800405258519 9227875636482148353 18368378955949744927 + f16 36170120803975424 554052321559 9295429630892703873 18370621925176451871 + f16 9024877407373440 12885131543 9301059130426916867 18370721526979961631 + f16 11330007863787648 44534516121879 13835058055282163715 18373986483071558431 + f16 9095800236146816 12885131543 13835058055282174081 18374013129987400479 +bucket b2507 9479 + f16 18085475940321536 720593536860619039 1374389551105 15045855062181553415 + f16 9148645429758208 70373039472927 1374557310977 15045882812586337543 + f16 18085456763963648 45053592755044639 4466766004225 15404735622993683719 + f16 9148626253400320 70373039472927 4466776477697 15404754577439663367 + f16 18050274539358464 17599165694239 4672924422145 15406137405072942343 + f16 9359738777389312 70373039472927 2815917998227457 16637371008488908039 + f16 36099311808823552 612489570797551903 2308094809027395585 18151368480145089799 + f16 9288820277133568 70373039472927 2308094809169985541 18151396208841401607 + f16 36099311809085696 153122408805761311 9223934986808213505 18366696824393508103 + f16 9288820277395712 70373039472927 9223934986843848709 18366721254605268231 + f16 9359743105648896 70373039472927 11529219718992904193 18373514183873209607 +bucket b250d 9485 + twoE8 18084906844322816 2203323793751 1108101562881 15042746586996745485 + f16 18085475961291776 5764609726352785751 1133871368193 15044159641121596685 + f16 9148645450728448 8800388317527 1135213543937 15044200585464587533 + f16 18085456633948160 45038199592255831 4406636447745 15403040176063259917 + f16 9148626123384832 8800388317527 4406646931969 15403065727478342925 + f16 18050274409342976 2206002905431 4432406249985 15404441932373107981 + f16 9359738798359552 8800388317527 22519106238416897 17071405396705879309 + f16 36099311796241408 4647714836921516375 2323857407723177985 18153050758705390861 + f16 9288820264551424 8800388317527 2323857408805306373 18153091655771038989 + f16 36099311796503552 1161928725336752471 9227875636482148353 18368379102953809165 + f16 9288820264813568 8800388317527 9227875636752678917 18368416701534905613 + f16 9359743093066752 8800388317527 11529219478474721281 18373514158002349325 +bucket b2515 9493 + twoE8 18084905246292992 141818135831 77309411361 14466277004375303445 + f16 18085459448316928 5764607664768484631 103079215233 14467690092724626709 + f16 9148628937753600 554051110167 104421392417 14467739833026422037 + f16 18085459297331200 720576082113529111 283467841665 14826570662160246037 + f16 9148628786767872 554051110167 283635613729 14826613805492938005 + f16 18050274942019584 144418604311 309237645345 14827972349616923925 + f16 9359735069623296 554051110167 360288047499051137 17650109152595223829 + f16 36099303806092288 5188146792205976855 2594073385365405825 18155293762560271637 + f16 9288812274402304 554051110167 2594073386573365253 18155343489943938325 + f16 36099303806354432 1297036714157868311 9295429630892703873 18370622106808689941 + f16 9288812274664448 554051110167 9295429631194693637 18370668535707804949 + f16 9359735102917632 554051110167 11529215355306115201 18373505361774585109 +bucket b251a 9498 + twoE8 18032063726779392 1407396358725911 4641 10994001804098086170 + twoE8 2392610333293568 19932943556887 327685 11862909507854804250 + f16 18102982378013696 5764607544509407511 6273 10995414780021646618 + f16 18102982227027968 720575961854451991 17025 11354295349457265946 + f16 18102980096321536 45036017748877591 18465 11355697192288724250 + f16 10274422946621440 5188146912465068311 2359425 12368168241389511962 + f16 11400322853677056 1297036834416959767 8454273 12583496585637930266 + f16 11400357213399040 79306571456791 10485765 12586300219559912730 + f16 10274425077327872 4647717018764910871 33818625 12944637789652264218 + f16 18102948018291712 4612037866443579671 35655681 12946609213783483674 + f16 11400324984383488 1161930907180146967 134285313 13159966133900682522 + f16 18094151925056512 1154117777553170711 142610433 13163626407992829210 + f16 11400359344105472 73121818550551 167772165 13165012771593463066 + f16 10274425228313600 612507145803735319 268713985 13376989925180187930 + f16 18102947867305984 576751027668459799 270533121 13378948155171087642 + f16 18102945736599552 36310826046791959 301989921 13381191124531488026 + f16 11400325135369216 153139983811944727 1073823745 13592318269428606234 + f16 18094151774070784 145249888371024151 1082130945 13595965349380433178 + f16 18094149643364352 10133653212700951 1207959585 13598208318740833562 + f16 11400359495091200 26942330183959 1342177285 13599047164290344218 +bucket b251f 9503 + f16 11329994894895104 72709501714711 2814749767106565 16637288084295787807 + f16 9095787267254272 21475197207 2814749767123489 16637314701147317535 + f16 18050172399691776 143898542359 5066549580791841 16853466282026149151 + f16 18050171862607872 142338261271 20266198323167265 17070483489019929887 + f16 11329995045880832 26530013348119 22517998136852485 17071322476992668959 + f16 9095787418240000 21475197207 22517998136858657 17071343639151846687 + f16 18050171334338560 2205467115799 72620543991349761 17429935864781808927 + f16 18050171329931264 2203859648791 290482175965397505 17646953071775589663 + f16 18050171459946752 17597018767639 306244774661197825 17648648544475030815 + f16 11330007830119424 20345260441879 360287970189639685 17650035029026219295 + f16 9095800202478592 21475197207 360287970189644417 17650056169878005023 + f16 36170119700825088 70373110808855 2308094809027395585 18151368371796190495 + f16 36170119713407232 8800455983383 2323857407723177985 18153050598816490783 + f16 36170120778760448 554055860503 2594073385365405825 18155293568043197727 + f16 9024877407257600 21475197207 2614339583688572933 18155396472659846431 + f16 36170122926261248 70373057331479 9223934986808213505 18366696728929314079 + f16 9024877407519744 21475197207 9300496180473495557 18370721518423713055 + f16 11330007863413760 79718888341783 11529215046068469765 18373425740731327775 + f16 9095800235772928 21475197207 11529215046068488321 18373452379057366303 +bucket b2523 9507 + d16Plus 54397257743638656 281479289962775 9223512774343196673 18365575244248851747 + f16 9359635698223360 1152921508902273303 2253002672963585 16632014184015013155 + f16 9288717197967616 1152921508902273303 2392537444712449 16636216409679537443 + f16 36099208729657600 612771028594524439 2392537570476033 16636219466839041315 + f16 9148542350592256 1152921508902273303 4504699273222145 16848166972485608739 + f16 18085372861155584 576487144877916439 4504699407433729 16848170123932411171 + f16 36169573178867968 576460758763110679 4644337249943553 16852388949609489699 + f16 9148523174234368 1152921508902273303 72057662765797505 17422367128748107043 + f16 18085353684797696 36046943256248599 72057663025840129 17422379042061886755 + f16 36169571048161536 36028803462922519 72198331534671873 17428840871459628323 + f16 9289266953781504 1152921508902273303 9223372071214581889 18358820078318331171 + f16 36099758485471488 290825120973079 9223372071482949633 18358846233726887203 + f16 9359090270931200 1152921508902273303 9300073968276865025 18370721502119666979 +bucket b2607 9735 + f16 18085407220843136 432363160709169439 1649267474433 15046137632374924807 + f16 9148576710279808 140741783912735 1649368109057 15046163188051486215 + f16 18085388044485248 27039194245824799 8864812531713 15476794312248272391 + f16 9148557533921920 140741783912735 8864818794497 15476811071966029319 + f16 18050205819880064 17598092214559 9345848840193 15478476474070803975 + f16 9359670057910912 140741783912735 1690018091401217 16565313414467823111 + f16 36046466531215488 306244813316489503 2306968909120569345 18151088100368328199 + f16 2533352116603008 140741783912735 2306968909191839753 18151113630074938887 + f16 36046466531475584 153122425985892639 4612248968380841985 18294640329867273735 + f16 2533352116863104 140741783912735 4612248968416460809 18294663660584183303 + f16 9359674386172544 140741783912735 6917538373489950721 18301457693658719751 +bucket b260e 9742 + twoE8 2261695720471552 1103813476759 1103806595329 15042464008213505550 + f16 10208966823127040 6917530131448267159 1133871368193 15044159641138308622 + f16 9650414916216832 8800388579735 1135481979137 15044200589742777870 + f16 11334870219630592 27022701571408279 8800387991553 15474816290829444622 + f16 9659214498899968 8800388579735 8800394281217 15474840747011155470 + f16 11339267997706240 1105417798039 8830452760833 15476498422587663886 + f16 9593243801233408 8800388579735 27022701570820097 17071686867387622926 + f16 11335454370588672 4629700455592165783 2323857407723177985 18153050758688679438 + f16 9659798649858048 8800388579735 2323857408801112073 18153091651492849166 + f16 11335454371872896 2314850247123730839 4620693217682130945 18296602988187624974 + f16 9659798651142272 8800388579735 4620693218221096969 18296641682002093582 + f16 9593239774453888 8800388579735 6917537858093844481 18301457663476049422 +bucket b2616 9750 + twoE8 2261699715546112 73115699479 73014444049 14465994425592063510 + f16 10208967622141952 6917529100656118039 103079215233 14467690092741338646 + f16 9650415715231744 554051373335 104689827857 14467739837304612374 + f16 11334867556247552 432345637242603799 554050781313 14898346776926430742 + f16 9659211835516928 554051373335 554151444497 14898388825025750550 + f16 11339265600661504 74625648919 584115552273 14900028839831479830 + f16 9593241137850368 554051373335 432345637242011777 17650390623276967446 + f16 11335456234956800 4899916433234397463 2594073385365405825 18155293762543560214 + f16 9659800514226176 554051373335 2594073386506256393 18155343485665748502 + f16 11335456236241024 2449958235944847639 4755801206503243905 18298845992042505750 + f16 9659800515510400 554051373335 4755801207073669129 18298893516174992918 + f16 9593241106145408 554051373335 6917529611756634241 18301448867248285206 +bucket b2619 9753 + twoE8 2393087596968960 1688888515563799 4369 10993719229626590745 + twoE8 18032540990454784 18764712710423 393225 11863192082326300185 + f16 10274116102006784 6917529066296381719 6273 10995414780038489625 + f16 11400016036112384 432345602882867479 33153 11426071464223581721 + f16 11400016302450688 27021636419522839 34833 11427753682520122905 + f16 18102914064319488 4899916467594137879 2359425 12368168241372669465 + f16 18102914063149056 2449958270304588055 4325505 12511720470871615001 + f16 18102639185373184 149606596415767 6291465 12514243729328514585 + f16 18102913797981184 4629701520744059159 33818625 12944637789635421721 + f16 10274390979782656 4612389710164726039 35655681 12946609213800326681 + f16 18102913796810752 2314851312275624215 67241985 13088190019134367257 + f16 10274390980953088 2307109650904453399 71307265 13091287343273223705 + f16 18102638919034880 142391051358487 100663305 13092956281345353241 + f16 18094117677696000 306262371142799639 537165825 13449048614417999385 + f16 11400290913888256 288802126493716759 538968321 13451004645419197977 + f16 11400291180226560 18577902514278679 570425361 13453247614779598361 + f16 18094117676525568 153139983812202775 1073905665 13592600843916944921 + f16 11400290915058688 145249888371282199 1077936385 13595682774892095001 + f16 11400291181396992 10133653212958999 1140850705 13597925744252495385 + f16 18093842798749696 26942330442007 1610612745 13599329738778682905 +bucket b261f 9759 + f16 18089445584807936 141910015050007 1688849860263945 16565231594047612447 + f16 9711166981154816 38655328535 1688849860296977 16565258202309338655 + f16 11338722287167488 74122363159 9570149208162321 16925522772240770591 + f16 11338722288337920 73619046679 19140298416324625 17070200910236624415 + f16 18089445020674048 26461294133527 27021597764222985 17071605051480942111 + f16 9711166417020928 38655328535 27021597764229137 17071625114111845919 + f16 11338718292092928 1104883056919 144678138029277441 17501992354996430367 + f16 11338718293263360 1104348283159 289356276058554625 17646670492992284191 + f16 18089441558276096 19245749076247 432345564227567625 17650317603497780767 + f16 9711162954622976 38655328535 432345564227572097 17650337640559814175 + f16 11340917350878336 140741855248663 2306968909120569345 18151088000626075167 + f16 9786517887150080 38655328535 2613213683781730313 18155396468381722143 + f16 11340917351268480 140741819597079 4612248968380841985 18294640238714824223 + f16 9786517888434304 38655328535 4765371355711406089 18298946498890966559 + f16 18089441526571136 150087632781591 6917529027641081865 18301369250499995167 + f16 9711162922918016 38655328535 6917529027641116801 18301395884531131935 +bucket b2623 9763 + d16Plus 54397257743630464 562954284761367 4611826755915874305 18293518754034361891 + f16 9359635698188928 2305843013509382423 1127103034556417 16559956589993928227 + f16 2533317756881024 2305843013509382423 1266637466632193 16564157711851857443 + f16 36046432171493504 306807728910303511 1266637932068865 16564162968001062435 + f16 9148542350557824 2305843013509382423 9008298833483777 16920223467011974691 + f16 18085372861121152 288256768726466839 9008299303239681 16920228813186999843 + f16 36169569957611648 288230381554696471 9147936810205185 16924445439824111139 + f16 9148523174199936 2305843013509382423 144115256799531137 17494423623274472995 + f16 18085353684763264 18032544747028759 144115257332203521 17494437731316475427 + f16 36169571022964864 18014403881009431 144255925568405505 17500897361674249763 + f16 2533867512692864 2305843013509382423 4611686052787259521 18286763583792096803 + f16 36046981927305344 572300097945879 4611686053323997185 18286789743495554595 + f16 9359090270898816 2305843013509382423 4764949143783211009 18298946482586920483 +bucket b2625 9765 + d16Plus 54397257742573824 1125904273965335 2305983746702311425 18149405773605381669 + f16 9359635697977600 4611686022723207447 564153618006017 16415841401951757861 + f16 2533317757124864 4611686022723207447 703687477690369 16420040316196496933 + f16 36046432171737344 154248291533259031 703688515518465 16420049970325104165 + f16 9148542350346496 4611686022723207447 18015498054670337 17064336456064706085 + f16 18085372860909824 144141580650742039 18015499094851585 17064346191696176677 + f16 36169569957855488 144115192975655191 18155136031391745 17068558420253353509 + f16 9148523173988608 4611686022723207447 288230444873289857 17638536612327204389 + f16 18085353684551936 9025345492418839 288230445944930305 17638555109825652261 + f16 36169571023208704 9007204091625751 288371113642164225 17645010342103492133 + f16 2533867512676608 4611686022723207447 2305843043573696641 18142650594739627557 + f16 36046981927289088 1135250051498263 2305843044647174145 18142676763032888869 + f16 9359090270947584 4611686022723207447 2612228522436984833 18155396443521426981 +bucket b290b 10507 + f16 18085475959048448 2449962599632142647 1374389551105 15045855079361161483 + f16 9148645448485120 70373040259383 1374959961089 15045887210565740811 + f16 18085456632875264 38284999175242039 17609365929985 15691840099171182859 + f16 9148626122311936 70373040259383 17609374827521 15691859036437555467 + f16 18050274408270080 4404624294199 17867063952385 15694363365998012683 + f16 9359738796116224 70373040259383 9571265899675649 16925601367460751627 + f16 36099311794258176 2341871879248216375 585467951558180865 17864264021080353035 + f16 9288820262568192 70373040259383 585467952103424017 17864296130710153483 + f16 36099311827812608 146367060905099575 9223934986808213505 18366696824326662411 + f16 9288820296122624 70373040259383 9223934986842275857 18366721237492508939 + f16 9359743057791232 70373040259383 9799850656222167041 18372392682012879115 +bucket b290d 10509 + f16 18085475959211008 4899918597898436951 1236950589441 15045289939007842573 + f16 9148645448647680 35188668170583 1238091432449 15045326468191824141 + f16 18085456631867392 38282800151986519 17600775987201 15691274950194374925 + f16 9148626121304064 35188668170583 17600784892417 15691296086450448653 + f16 18050274407262208 2205601038679 17729624998401 15693798208431401229 + f16 9359738796278784 35188668170583 19141406517895169 17070279496866408717 + f16 36099311794160640 4647714888461910359 594475150812913665 17864824780600453389 + f16 9288820262470656 35188668170583 594475151895035921 17864861279686699277 + f16 36099311827715072 290482248980955479 9224497936761626625 18367257583846762765 + f16 9288820296025088 35188668170583 9224497936829251601 18367286386469054733 + f16 9359743057693696 35188668170583 9799850518783205377 18372392673389259021 +bucket b2916 10518 + twoE8 18032063712214016 4785147619641623 1545 10705767047079995670 + twoE8 2392610318728192 6635725588759 1114129 12151144264872896790 + f16 18102982246925312 4899916467594660119 9345 11210743137138452758 + f16 18102982245754880 2449958270305110295 17025 11354295366637398294 + f16 18102980098402304 38280669848209687 24585 11356818694082210070 + f16 10274422923732992 6917529066296903959 1572993 12152839884272707862 + f16 11400322857838592 432345602883389719 8454273 12583496568457799958 + f16 11400357215479808 105591772088599 8912913 12585178717766428950 + f16 18102947889284096 4612037866444359959 34079745 12945478915830130966 + f16 10274425071085568 4647717018765691159 34611201 12945768087605618966 + f16 18102947888113664 2306159672858577175 67633665 13089591896292665622 + f16 10274425072256000 2341876208575252759 68173825 13089885466114926870 + f16 18102945740761088 36310826047572247 100663305 13092956350333266198 + f16 11400325005191168 290484379284736279 536944641 13448200890851928342 + f16 18094151768998912 292804348819343639 545260545 13451852368985270550 + f16 11400359362832384 73121819330839 570425361 13453247545791686934 + f16 11400325006361600 146371390232135959 1073823745 13592318269361236246 + f16 18094151767828480 148653976371398935 1082130945 13595965349447805206 + f16 11400359364002816 40136470497559 1140850705 13597925675264583958 + f16 18094149620475904 6755953492953367 1610612745 13599329807766595862 +bucket b2919 10521 + twoE8 18084905231727616 38941036823 25769803785 14178042213064321305 + f16 18085459317228544 4899916433234923799 154618822785 14683018449840908569 + f16 9148628806665216 554051899671 155759673353 14683068172963096857 + f16 18085459316058112 2449958235945373975 283467841665 14826570679339854105 + f16 9148628805494784 554051899671 284038266889 14826618203472341273 + f16 18050274944100352 40937525527 412316860425 14829093834297125145 + f16 9359735038411776 554051899671 1224979124414578817 17938335130700425497 + f16 36099303741588480 6917529100656644375 1729382256910270593 17939965405443991833 + f16 9288812209898496 554051899671 1729382258520883217 17940015150007265561 + f16 36099303775142912 432345637243130135 9295429630892703873 18370622089629083929 + f16 9288812243452928 554051899671 9295429630993367057 18370664137728403737 + f16 9359735005121536 554051899671 9799833201475059841 18372379479047612697 +bucket b291f 10527 + f16 18050172403853312 40820113687 1688849860263945 16565231490648058143 + f16 11329994913622016 72606423286039 9570149208162321 16925522858493749535 + f16 9095787285981184 73015591191 9570149208179209 16925545077232183583 + f16 11329994914792448 39621074452759 19140298416324625 17070200987966646559 + f16 9095787287151616 73015591191 19140298416333833 17070221024828139807 + f16 18050171839719424 39058506007 27021597764222985 17071604973650258207 + f16 36170119698744320 70373312921879 585467951558180865 17864263895618431263 + f16 36170119698841856 35188938735895 594475150812913665 17864824637958531359 + f16 18050171302881280 2203457782039 1161928703861588481 17936309347767036191 + f16 18050171303889152 4402478940439 1170935903116329985 17936874505333516575 + f16 11330007798907904 7151121694999 1224979098644774929 17938269786044573983 + f16 9095800171267072 73015591191 1224979098644776577 17938282147983468831 + f16 36170120772518144 554058219799 1729382256910270593 17939965210859809055 + f16 9024877342753792 73015591191 1756403854674493457 17940068132723435807 + f16 9024877376308224 73015591191 9297118480752967697 18370717120444573983 + f16 11330007765617664 106107168194839 9799832789158199313 18372304238938106143 + f16 9095800137976832 73015591191 9799832789158224001 18372326496330656031 +bucket b2923 10531 + f16 18085372886124800 2305882595928506647 1126999485579265 16559935366964193571 + f16 9148542375561472 288230380447924503 1126999955350529 16559941007214717219 + f16 36169573170544896 2305843015674167575 1266637932068865 16564162988684159267 + f16 9359635723192576 288230380447924503 9008453452300289 16920247845749336355 + f16 36099208721334528 2342153285505581335 9147936810205185 16924445462124112163 + f16 9288717189644544 288230380447924503 9147937288421377 16924451183877499171 + f16 9148523049388288 288230380447924503 72057611226186881 17421241211661134115 + f16 18085353559951616 36033749117501719 72057611284905985 17421248744041425187 + f16 9289266945458432 288230380447924503 9223372174293803137 18359945995404781859 + f16 36099758477148416 317213400826135 9223372174360838145 18359967735654328611 + f16 9359090262608128 288230380447924503 9296696268355010561 18370717104005785891 +bucket b2925 10533 + f16 18085372886287360 4611758590491164951 564049498603521 16415817988488440101 + f16 9148542375724032 144115192372199703 564050538807809 16415828026718365989 + f16 36169573170447360 4611686024887992599 703688515518465 16420050008221493541 + f16 9359635723355136 144115192372199703 18015781522505729 17064365224224827685 + f16 36099208721236992 4647996294719406359 18155136031391745 17068558459766647077 + f16 9288717189547008 144115192372199703 18155137080033281 17068568570976479525 + f16 9148523048380416 144115192372199703 72057602636251777 17420678253117647141 + f16 18085353558943744 36031550094377239 72057602661416961 17420683595031193893 + f16 9289266945360896 144115192372199703 9223372311732764801 18360508953948006693 + f16 36099758477050880 352397773046039 9223372311766237185 18360528486618048805 + f16 9359090262510592 144115192372199703 9296133318368034817 18370714904948844837 +bucket b2a0b 10763 + f16 18085407239570048 1297041095026344247 1649267474433 15046137649554532875 + f16 9148576729006720 140741785485623 1649569432577 15046167586030889483 + f16 18085387913396864 20270600666808631 35201551990785 15763898788425771531 + f16 9148557402833536 140741785485623 35201556677633 15763915530963921419 + f16 18050205688791680 4403551600951 35734127903745 15766702434995874315 + f16 9359670076637824 140741785485623 5067666272321537 16853543773439666699 + f16 36046466516650112 1170936044852412727 580964351930826753 17863983641303591435 + f16 2533352102037632 140741785485623 580964352203423777 17864013551943690763 + f16 36046466550202496 146367129625624887 4612248968380841985 18294640329800428043 + f16 2533352135590016 140741785485623 4612248968414887969 18294663643471424011 + f16 9359674338314880 140741785485623 5188182504858746881 18300336191798389259 +bucket b2a0e 10766 + f16 10208966839773184 5188147874539569559 1236950589441 15045289939024554510 + f16 9650414932862976 35188669219223 1238158541057 15045326472470014478 + f16 11334870236276736 20267302131925399 35188667064321 15763051064960559630 + f16 9659214515546112 35188669219223 35188671774977 15763071105983261198 + f16 11339268014352384 1105016717719 35321811042561 15765854698645957134 + f16 9593243817879552 35188669219223 20267302129770497 17070560967548152334 + f16 11335454320650240 4629700558672953751 594475150812913665 17864824780583741966 + f16 9659798599919616 35188669219223 594475151890841633 17864861275408509454 + f16 11335454486315136 578712693853192599 4613937818241081345 18295481469080578574 + f16 9659798765584512 35188669219223 4613937818375815201 18295511366936242702 + f16 9593239759888512 35188669219223 5188182092541861889 18300336178862959118 +bucket b2a15 10773 + twoE8 2393087611534336 5066691316876567 1285 10705484472608500245 + twoE8 18032541005020160 5519035139351 1179681 12151426839344392725 + f16 10274116124895232 5188146912466896151 9345 11210743137155295765 + f16 11400016031950848 1297036834418787607 33153 11426071481403714069 + f16 11400016300369920 20266340059251991 40965 11428875184313608725 + f16 18102914195407872 5764607544511235351 1572993 12152839884255865365 + f16 18102914044422144 720575961856279831 4325505 12511720453691484693 + f16 18102639183292416 175943337444631 4718625 12513122227535030805 + f16 10274390986024960 4612389710166295831 34079745 12945478915846973973 + f16 18102913926988800 4629701520745628951 34611201 12945768087588776469 + f16 11400290893080576 1153519643229488407 134742273 13161648386540775957 + f16 18094117833753600 1170940305459971351 135299073 13161944155352738325 + f16 11400291161499648 18577902515848471 167772165 13165012840581376533 + f16 18102913776003072 578713655925867799 268574721 13376424776085613077 + f16 10274391137010688 581105093716280599 272630785 13379513304265665045 + f16 18102638914873344 142391052928279 301989921 13381191055543577109 + f16 18094117682767872 146371390233183511 1073905665 13592600843849574933 + f16 11400291044066304 148653976372446487 1077936385 13595682774959467029 + f16 18093842821638144 40136471545111 1207959585 13598208249752922645 + f16 11400291312485376 6755953494000919 1342177285 13599047233278257685 +bucket b2a1a 10778 + twoE8 2261699730111488 21778997527 21474836485 14177759634281081370 + f16 10208967645030400 5188146792207819031 154618822785 14683018449857620506 + f16 9650415738120192 554052952343 155826782213 14683068177241287194 + f16 11334867552086016 1297036714159710487 554050781313 14898346794106038810 + f16 9659211831355392 554052952343 554352771077 14898393223005153818 + f16 11339265598580736 22684967191 687194767365 14901150324511681050 + f16 9593241133688832 554052952343 1297036714157539457 17938616601382169114 + f16 11335456199583744 5764607664770326807 1729382256910270593 17939965405427280410 + f16 9659800478853120 554052952343 1729382258252447777 17940015145729075738 + f16 11335456365248640 720576082115371287 4755801206503243905 18298845974862899738 + f16 9659800644518016 554052952343 4755801206671015969 18298889118195591706 + f16 9593241101983872 554052952343 5188147457925578881 18300322984521312794 +bucket b2a1f 10783 + f16 11338722268440576 22584328471 2814749767106565 16637287980862679583 + f16 18089445580646400 141858477015319 5066549580791841 16853466368245574175 + f16 9711166976993280 141736116503 5066549580824837 16853488578394204703 + f16 18089445043562496 39603895632151 20266198323167265 17070483562454919711 + f16 9711166439909376 141736116503 20266198323176453 17070502499788139039 + f16 11338722419426304 21879685399 22517998136852485 17071322394866952735 + f16 11340917251001472 140742058148119 580964351930826753 17863983524448315935 + f16 11338718393140224 1103947202839 1157425104234217729 17936026768983730719 + f16 18089441554114560 6051611115799 1297036692682702881 17938552360516135455 + f16 9711162950461440 141736116503 1297036692682704257 17938563618665277983 + f16 9786517851777024 141736116503 1751900255047122977 17940068128445311519 + f16 9786518017441920 141736116503 4758615956270350369 18298942100911827487 + f16 18089441522409600 176475913421079 5188146770730811425 18300247748706773535 + f16 9711162918756480 141736116503 5188146770730852481 18300270001804421663 +bucket b2a23 10787 + f16 18085372881928832 1152961091322708247 2252899459530753 16631994056218782243 + f16 9148542371365504 576460756600684823 2252899593757697 16631997501741083171 + f16 36169569945127040 1152921510011404567 2392537570476033 16636219478898780707 + f16 9359635718996608 576460756600684823 4504853892038657 16848190251728251427 + f16 36046432159008896 1171498857367011607 4644337249943553 16852388963286133283 + f16 2533317744396416 576460756600684823 4644337388486657 16852392486049819171 + f16 9148523045192320 576460756600684823 144115205259920513 17493297706187500067 + f16 18085353555755648 18019350609068311 144115205389942785 17493307433296013859 + f16 2533867500208256 576460756600684823 4611686155866480769 18287889500878547491 + f16 36046981914820736 598688378585367 4611686156000559105 18287911245422996003 + f16 9359090258414208 576460756600684823 4758193743939502081 18298942084473039395 +bucket b2a26 10790 + f16 10208417117513728 4611827859725025559 564049498603521 16415817988505152038 + f16 9649865210603520 144115192373510423 564050538823937 16415828030996556326 + f16 11338202931947520 4611686023832338711 703688515518465 16420050008204782118 + f16 9592694095620096 144115192373510423 18016052105445377 17064366319441488422 + f16 11333805153871872 4630263371187945751 18155136031391745 17068558459749935654 + f16 9658149433141248 144115192373510423 18155137075904513 17068568566698289702 + f16 9658664793286656 144115192373510423 144115192375017857 17492453268372269606 + f16 11334320514017280 18016052074578199 144115192404377601 17492459709780666918 + f16 9660863852462208 144115192373510423 4611686568183365761 18288733938693384742 + f16 11336519573192832 704241495245079 4611686568216756225 18288752371868576294 + f16 9592174673010816 144115192373510423 4756504893978574849 18298938785887627814 +bucket b2a29 10793 + d16Plus 54397257603162368 4503604198179095 576601489792827393 17861179812747160105 + f16 9359635691735296 4611686022725566743 564205157613569 16415844687601740329 + f16 2533317775851776 4611686022725566743 703687476903937 16420040303361927721 + f16 36046432190464256 150870591815090455 703688515518465 16420049970274970153 + f16 9148542344104192 4611686022725566743 18015498054673409 17064336468899277353 + f16 18085372854667520 144154774792634647 18015499094851585 17064346191746312745 + f16 36169569976582400 144115192776687895 18155136031391745 17068558420203219497 + f16 2533867498111232 4611686022725566743 576460889743433857 17855550533721139753 + f16 36046981912723712 4539338053452055 576460890816118785 17855572304034998825 + f16 9148523017931008 4611686022725566743 1152921521787241601 17925636673345694249 + f16 18085353528494336 2256751914189079 1152921522860457985 17925659568823544361 + f16 36169571050258688 2251804250276119 1153062242095726593 17933236302961715753 + f16 9359090264705280 4611686022725566743 1747537393981849601 17940068086337776169 +bucket b2c0d 11277 + f16 18085407239521280 1441154084081041751 1649267474433 15046137649587956749 + f16 9148576728957952 140741787582807 1649602986497 15046167594587270157 + f16 18085387912177664 11261202390909271 70377334145025 15907451017958140941 + f16 9148557401614336 140741787582807 70377336734209 15907465570029546509 + f16 18050205687572480 2203993571671 70918499992065 15910815415424986125 + f16 9359670076589056 140741787582807 5630607635808257 16854106714803153933 + f16 36046466516796416 1161928983038722391 580964351930826753 17863983641270168589 + f16 2533352102183936 140741787582807 580964352201326657 17864013543387311117 + f16 36046466550088704 290482455142531415 2306968909120569345 18151088100268059661 + f16 2533352135476224 140741787582807 2306968909188169793 18151113604405799949 + f16 9359674338266112 140741787582807 2882374680017141761 18156223202745789453 +bucket b2c0e 11278 + f16 10208966840943616 2882304865327972759 1374389551105 15045855079411297294 + f16 9650414934033408 70373043405207 1375060623617 15045887223400311822 + f16 11334870237447168 11260102879281559 70373039161345 15907168443469736974 + f16 9659214516716544 70373043405207 70373041766657 15907184095035993102 + f16 11339268015522816 1104481943959 70643622084865 15910532836641680398 + f16 9593243819049984 70373043405207 11260102875037697 16926445779505982478 + f16 11335454321544320 2314850487645569431 585467951558180865 17864264021030218766 + f16 9659798600813696 70373043405207 585467952097132609 17864296117875584014 + f16 11335454485924992 578712831294243223 2308094809027395585 18151368480028109838 + f16 9659798765194368 70373043405207 2308094809162121281 18151396178894072846 + f16 9593239760815104 70373043405207 2882374405139218433 18156223198433979406 +bucket b2c13 11283 + twoE8 2393087613468800 5629778711347991 771 10561367085543074835 + twoE8 18032541006954624 3311424045847 1310785 12151991979731004435 + f16 10274116126114432 2882304040694252311 17025 11354295366687927315 + f16 11400016032958720 1441152159935693591 33153 11426071481437400083 + f16 11400016301394048 11259278245561111 49155 11429435926653971475 + f16 18102914195261568 3458764526709703447 1572993 12152839875665800211 + f16 18102914045446272 864691141344297751 2359425 12368168215602474003 + f16 18102639184316544 211119121695511 2621505 12369009238515854355 + f16 10274390987244160 2307109650908119831 67633665 13089591896343194643 + f16 18102913926826240 2314851312279290647 68173825 13089885466064399379 + f16 11400290894088448 1154117777557095191 134742273 13161648386574461971 + f16 18094117833802368 1161930907184071447 135299073 13161944155319053331 + f16 11400291162523776 10133653216625431 201326595 13165573582955162643 + f16 18102913777010944 578713655927964439 268713985 13376989925062290451 + f16 10274391137059456 581105093718377239 270533121 13378948155288988691 + f16 18102638915881216 142391055024919 335544385 13381756204520254483 + f16 18094117683987072 290484379287880471 537165825 13449048614316944403 + f16 11400291043903744 292804348822487831 538968321 13451004645520256019 + f16 18093842822857344 73121822475031 671088705 13454095269256702995 + f16 11400291312339072 6755953496097559 805306371 13454929846179146771 +bucket b2c1c 11292 + twoE8 2261699732045952 13224722711 12884901891 14033642238592166940 + f16 10208967646249600 2882303774406295831 283467841665 14826570679389989916 + f16 9650415739339392 554055057687 284138930179 14826618216306912284 + f16 11334867553093888 1441151893647737111 554050781313 14898346794139462684 + f16 9659211832363264 554055057687 554386325507 14898393231561534492 + f16 11339265599604864 13560267031 824633720835 14901711066818358300 + f16 9593241134696704 554055057687 1441151893643460737 17939177352312335388 + f16 11335456200591616 3458764792997691671 1729382256910270593 17939965396837477404 + f16 9659800479860992 554055057687 1729382257715576897 17940012946739375132 + f16 11335456364972288 864691407632285975 2594073385365405825 18155293736774151196 + f16 9659800644241664 554055057687 2594073385566732353 18155336888696646684 + f16 9593241102991744 554055057687 2882304586150838401 18156207805035392028 +bucket b2c1f 11295 + f16 11338722269464704 13493174551 3377699720527875 16637848723169487903 + f16 18089445581654272 141849889177879 5629499534213185 16854031517222120479 + f16 9711166978001152 279177167127 5629499534246147 16854051528314203167 + f16 18089445044781696 72580656627991 11258999068426305 16926370581958568991 + f16 9711166441128576 279177167127 11258999068443139 16926389502112181279 + f16 11338722419280000 13291847959 13510798882111491 16927204999177907231 + f16 18089441555122432 3852589957399 1441151880758558785 17939117500902878239 + f16 9711162951469312 279177167127 1441151880758559617 17939124369595575327 + f16 9786517852784896 279177167127 1742893055792382017 17940065929455741983 + f16 9786518017165568 279177167127 2597451085085933633 18155389871413013535 + f16 18089441523417472 211660287607063 2882303761517117505 18156134759687728159 + f16 9711162919764352 279177167127 2882303761517166721 18156154822318631967 +bucket b2c25 11301 + f16 18085372881880064 1152994076673769751 2252899459530753 16631994056252206117 + f16 9148542371316736 576460756602913047 2252899593765377 16631997510297463845 + f16 36169569945273344 1152921509510316311 2392537570476033 16636219478865357861 + f16 9359635718947840 576460756602913047 4504982741057537 16848192442161572901 + f16 36046432159155200 1163054608067920151 4644337249943553 16852388963252710437 + f16 2533317744542720 576460756602913047 4644337386520577 16852392477493439525 + f16 9148523043973120 576460756602913047 288230384743744129 17636847736696744997 + f16 18085353554536448 9009952333299991 288230384875864065 17636859662794959909 + f16 2533867500094464 576460756602913047 2305843284091879553 18144339470369303589 + f16 36046981914706944 1196822706323735 2305843284225818625 18144359015924050981 + f16 9359090258365440 576460756602913047 2596465922801664001 18155389846350605349 +bucket b2c26 11302 + f16 10208417118684160 2305984850513428759 1126999485579265 16559935367014329382 + f16 9649865211773952 288230380451463447 1126999955374337 16559941020049288230 + f16 11338202932841600 2305843014117425431 1266637932068865 16564162988634024998 + f16 9592694096790528 288230380451463447 9008852884258817 16920251131399318566 + f16 11333805154765952 2315976112675029271 9147936810205185 16924445462073977894 + f16 9658149434035328 288230380451463447 9147937282326529 16924451171042929702 + f16 9658664794457088 288230380451463447 288230380448776577 17636566257425001510 + f16 11334320515187712 9008852821934359 288230380513787905 17636577088289844262 + f16 9660863852072064 288230380451463447 2305843558969802881 18144620949640916006 + f16 11336519572802688 1267191450763543 2305843559036616705 18144639391405911078 + f16 9592174673937408 288230380451463447 2595340022827712513 18155388746822134822 +bucket b2c29 11305 + f16 9359635691897856 2305843013513969943 1127283423182849 16559962066077232169 + f16 2533317775754240 2305843013513969943 1266637463879681 16564157690460908585 + f16 36046432190366720 294985779893043479 1266637932068865 16564162967917505577 + f16 9148542344266752 2305843013513969943 9008298833494529 16920223488402926633 + f16 18085372854830080 288302948219420951 9008299303239681 16920228813270559785 + f16 36169569976484864 288230380854640919 9147936810205185 16924445439740554281 + f16 2533867498013696 2305843013513969943 576461027182395521 17856113492264365097 + f16 36046981912626176 4574522427638039 576461027718201345 17856133054998719529 + f16 9148523016923136 2305843013513969943 1152921513197306497 17925073714802207785 + f16 18085353527486464 2254552893030679 1152921513733652481 17925094419813313577 + f16 9359090264607744 2305843013513969943 1738530194190237697 17940065887280835625 +bucket b2c2a 11306 + f16 9592694196667392 1152921508908171543 2253453644529665 16632020755314977834 + f16 9658149498539136 1152921508908171543 2392537437831169 16636216384010398762 + f16 11333805219269760 583216156045803799 2392537570476033 16636219466738773034 + f16 9649865311650816 1152921508908171543 4504699273249025 16848166998154751018 + f16 10208417218561024 576602593604731159 4504699407433729 16848170124032683050 + f16 11338202997345408 576460757007401239 4644337249943553 16852388949509221418 + f16 9660863752195200 1152921508908171543 576461302060318849 17856394971535977514 + f16 11336519472925824 4644891172864279 576461302327672833 17856413430480579626 + f16 9658664894333952 1152921508908171543 1152921508902338945 17924792235530464298 + f16 11334320615064576 2253453382451479 1152921509170249729 17924811845308197930 + f16 9592174742602752 1152921508908171543 1734026594294431745 17940064787752365098 +bucket b2f13 12051 + f16 11330472174160000 10133378342912791 13194139533315 15480423791423401747 + f16 9096264546519168 12893356823 13194141892673 15480468017372147475 + f16 18050274674608384 281345590039 21990232555585 15696606335358545683 + f16 18050205955129984 280288625431 43980465111105 15768945404356472595 + f16 11330472323975296 6755678622384919 52776558133251 15769780054647385875 + f16 9096264696334464 12893356823 52776559706177 15769821007780720403 + f16 11332121490753664 5630053593449239 216172782113783811 17505917710948577043 + f16 9097913863112832 12893356823 216172782115094657 17505958651297476371 + f16 9026991068151936 12893356823 4755845186968354819 18298928850819821331 + f16 9026991068153984 12893356823 9295451621125259267 18370703866074443539 + f16 11332121524568192 11259553127662359 13835058055282163715 18373986552059473683 + f16 9097913896927360 12893356823 13835058055284785281 18374030790892924691 +bucket b2f15 12053 + f16 11330472173135872 18577490205279511 10995116277765 15479863049049485077 + f16 9096264545495040 21483291927 10995120603169 15479907257818623765 + f16 18050274673600512 143906637079 19791209300001 15696041177791934229 + f16 18050205953910784 142346355991 79164837199905 15913058384785714965 + f16 11330472324121600 6755541183431959 87960930222085 15913897441746366229 + f16 9096264696480768 21483291927 87960931794977 15913936195823152917 + f16 11332121490899968 5067103640028439 360287970189639685 17650035098014134037 + f16 9097913863259136 21483291927 360287970190819457 17650073830783528725 + f16 9026991068038144 21483291927 2594152550202605573 18155378811754327829 + f16 9026991068300288 21483291927 9295449422102003717 18370703857518194453 + f16 11332121524194304 20266752382403863 11529215046068469765 18373425809719242517 + f16 9097913896553472 21483291927 11529215046073188481 18373470039962890005 +bucket b2f16 12054 + f16 18089854680442880 36310345018575127 6597069766665 15407806558801309462 + f16 9711576076789760 38663162135 6597078220817 15407850758980644630 + f16 11339267748014080 74130196759 37383395344401 15768097668006555414 + f16 11339267749184512 73626880279 74766790688785 15912775806002409238 + f16 18089785933703168 6755472463956247 105553116266505 15914180016234639126 + f16 9711507330050048 38663162135 105553117839377 15914217670783151894 + f16 18089339284367360 4785628663318807 432345564227567625 17650317672485695254 + f16 9711060680714240 38663162135 432345564228681857 17650355301465337622 + f16 9786347430635520 38663162135 2594148152156094473 18155378807476203286 + f16 9786347431919744 38663162135 4755838589898588169 18298928837985447702 + f16 18089339252662400 38281150891886871 6917529027641081865 18301369319487909654 + f16 9711060649009280 38663162135 6917529027649994881 18301413545436655382 +bucket b2f19 12057 + f16 18050274677762048 40827425047 6597069766665 15407806386413842201 + f16 11330472191862784 18577387126067479 37383395344401 15768097823247445785 + f16 9096264564221952 73022902551 37383399669769 15768137633903488793 + f16 11330472193033216 10133137824747799 74766790688785 15912775952720342809 + f16 9096264565392384 73022902551 74766793048073 15912813581499445017 + f16 18050205931022336 39065817367 105553116266505 15914179869416042265 + f16 11332121459688448 1689403919503639 1224979098644774929 17938269855032487705 + f16 9097913832047616 73022902551 1224979098645168257 17938299808888991513 + f16 9026991003534336 73022902551 1729487810026536977 17940050471817916185 + f16 9026991037088768 73022902551 9295436227962470417 18370699459539054361 + f16 11332121426398208 27022151823462679 9799832789158199313 18372304307926019865 + f16 9097913798757376 73022902551 9799832789164490881 18372344157236178713 +bucket b2f1a 12058 + f16 11339267729287168 22590595351 10995116277765 15479862876628463386 + f16 18089854676281344 36310293478973719 19791209300001 15696041332999270170 + f16 9711576072628224 141742383383 19791217754117 15696081135065509658 + f16 18089785956591616 10133120644882711 79164837199905 15913058527208615706 + f16 9711507352938496 141742383383 79164839559173 15913095056459443994 + f16 11339267880272896 21885952279 87960930222085 15913897290632736538 + f16 18089339280205824 1407928942797079 1297036692682702881 17938552429504048922 + f16 9711060676552704 141742383383 1297036692683030657 17938581279570800410 + f16 9786347395262464 141742383383 1729470217840492577 17940050467539791642 + f16 9786347560927360 141742383383 4755812201619521569 18298924440006307610 + f16 18089339248500864 45036550332948759 5188146770730811425 18300247817694687002 + f16 9711060644847744 141742383383 5188146770741297281 18300287662709944090 +bucket b2f1c 12060 + f16 11339267730311296 13497352471 13194139533315 15480423618935271196 + f16 18089854677289216 36310284889047319 21990232555585 15696606481975815964 + f16 9711576073636096 279181345047 21990241009667 15696644084985507612 + f16 18089785957810816 18577361356275991 43980465111105 15768945546712264476 + f16 9711507354157696 279181345047 43980469436419 15768982058783485724 + f16 11339267880126592 13296025879 52776558133251 15769779894943690524 + f16 18089339281213696 844978989383959 1441151880758558785 17939117569890791196 + f16 9711060677560576 279181345047 1441151880758755457 17939142030501097244 + f16 9786347396270336 279181345047 1729435033468403777 17940048268550221596 + f16 9786347560651008 279181345047 2594086579504939073 18155372210507493148 + f16 18089339249508736 54043749587697943 2882303761517117505 18156134828675641116 + f16 9711060645855616 279181345047 2882303761529700481 18156172483224153884 +bucket b2f1f 12063 + f16 11338735203518592 13228933399 216172782113783811 17505917551294820127 + f16 11338735203664896 21785313559 360287970189639685 17650034946983735071 + f16 18050168377321472 38948405527 432345564227567625 17650317525766975263 + f16 11338735172453376 73123594519 1224979098644774929 17938269738294718239 + f16 18050168373159936 141826294039 1297036692682702881 17938552317077958431 + f16 18050168374167808 279231693079 1441151880758558785 17939117474611015455 + f16 9928081347248384 554059268375 1657324662872342657 17939230335028899615 + f16 9852725846147328 554059268375 1729382256910270577 17939962167290703647 + f16 36104665470927104 485339791639 1729382256910270593 17939965198480256799 + f16 9852725852389632 554059268375 2594073385365405773 18155290507227377439 + f16 36104665477169408 330720968983 2594073385365405825 18155293555596537631 + f16 18050168342462848 282402586903 2882303761517117505 18156134681857044255 + f16 9852725852405888 554059268375 4755801206503243819 18298840546293002015 + f16 36104665477185664 184692080919 4755801206503243905 18298845785128906527 + f16 18050168341454976 144426762519 5188146770730811425 18300247662319578911 + f16 18050168345616512 40944894231 6917529027641081865 18301369146999779103 + f16 9852725877604608 554059268375 9295429630892703767 18370615561547624223 + f16 36104665502384384 98792734999 9295429630892703873 18370621899878379295 + f16 11338735139163136 74633543959 9799832789158199313 18372304152534134559 + f16 11338735236959232 22691283223 11529215046068469765 18373425637214334751 + f16 11338735237333120 13564477719 13835058055282163715 18373986379521011487 + f16 9928081316071808 554059268375 16717361816799281281 18374119095421316895 +bucket b310e 12558 + twoE8 18032059717139456 72340172838076823 105 10127054529323151630 + twoE8 2392606323653632 450988409239 16843009 12727613778775388430 + f16 18102982513263616 4629701520760308119 10305 11211584263400009998 + f16 18102982512093184 2314851312291873175 18465 11355697243829121294 + f16 18102982495447040 578713655940546967 24585 11356818728442474766 + f16 18102948421960704 4612037866460086679 2621505 12369009367433687310 + f16 18102948420790272 2306159672874303895 4718625 12513122347896221966 + f16 18102948404144128 576751027684966807 6291465 12514243832576422158 + f16 10274422124718080 6917529066312630679 17303553 12729309432669155598 + f16 10274422141364224 5188146912481575319 18882561 12730439730555662606 + f16 10274422142534656 2882304040706834839 20987905 12731004870942535950 + f16 11400325521221632 27021636435771799 134285313 13159966082360291598 + f16 11400359612524544 105591787815319 134742273 13161648266162876686 + f16 11400325537867776 20266340073931159 536944641 13448200856491667726 + f16 11400359629170688 79306587963799 538968321 13451004542154584334 + f16 18094148839277568 90142365603398039 671088705 13454095351314985230 + f16 11400325539038208 11259278258143639 1073823745 13592318235000975630 + f16 11400359630341120 44259654828439 1077936385 13595682671594057998 + f16 18094148838107136 81099981976568215 1207959585 13598208340333900046 + f16 18094148821460992 74318194256445847 1610612745 13599329842126860558 +bucket b3113 12563 + f16 18085459179735296 2314850487658152727 4466766004225 15404735674532507923 + f16 9148628669171968 70373055988503 4467304955969 15404767771377873171 + f16 18085459029920000 578712831306826519 17609365929985 15691840133530398995 + f16 9148628519356672 70373055988503 17609500655681 15691867832396362003 + f16 9359734801041664 70373055988503 144678223928639489 17502053323671154963 + f16 36099303537770752 2882304865340556055 180143985094836225 17505383425909010707 + f16 9288812006080768 70373055988503 180143985765908737 17505415569898025235 + f16 36099307832738048 11260102891864855 9223934986808213505 18366696789967450387 + f16 9288816301048064 70373055988503 9223934986810818817 18366712441533706515 + f16 9359730539890944 70373055988503 9259422824106311681 18370140916558934291 +bucket b3115 12565 + f16 18085459179897856 4629700558687634711 2267742740481 15260618296056754453 + f16 9148628669334528 35188683900183 2268820668449 15260654790881521941 + f16 18085459028912128 578712693867873559 17600775987201 15691274984553591061 + f16 9148628518348800 35188683900183 17600910721057 15691304882409255189 + f16 9359734801204224 35188683900183 289356353367973889 17646731453076812053 + f16 36099303537673216 5188147874554250519 324259173170683905 17649496423551545621 + f16 9288812005983232 35188683900183 324259174378635521 17649532956997005589 + f16 36099307832640512 20267302146606359 9224497936761626625 18367257549487550741 + f16 9288816300950528 35188683900183 9224497936766337281 18367277590510252309 + f16 9359730539793408 35188683900183 9259420625083047937 18370140907935314197 +bucket b3119 12569 + f16 18085459050890240 4629700455608422679 2216203126785 15259487998103138585 + f16 9148628540326912 8800404836631 2217281060873 15259528890907308313 + f16 18085459049719808 2314850247139987735 4406636447745 15403040227602084121 + f16 9148628539156480 8800404836631 4407175413769 15403078921416552729 + f16 9359734772073472 8800404836631 1157425130004023297 17936083331021484313 + f16 36099303475250176 6917530131464524055 1188950301625812993 17937722401723855129 + f16 9288811943560192 8800404836631 1188950303236423937 17937763350328324377 + f16 36099307770217472 27022701587665175 9227875636482148353 18368379051414991129 + f16 9288816238527488 8800404836631 9227875636488438017 18368403507596701977 + f16 9359730477370368 8800404836631 9259407430943508481 18370136509821432089 +bucket b311f 12575 + f16 11329990918547456 70544854712599 144678138029277441 17501992406755979551 + f16 9095783290906624 1103823470871 144678138029293609 17502005795176395039 + f16 36170118899729408 70373391565079 180143985094836225 17505383300312871199 + f16 11329990919717888 35497921577239 289356276058554625 17646670536228876575 + f16 9095783292077056 1103823470871 289356276058562633 17646681742772351263 + f16 36170118899826944 35188985921815 324259173170683905 17649496280775405855 + f16 11329991019594752 9212721725719 1157425104234217729 17936026795107823903 + f16 9095783391953920 1103823470871 1157425104234219617 17936033620851503391 + f16 36170118908150016 8800505528599 1188950301625812993 17937722241633628447 + f16 9024860563440640 1103823470871 1621295865853378817 17939230326472651039 + f16 9024864858407936 1103823470871 9229564486342410497 18368465320765632799 + f16 11329986724891648 114353521131799 9259400833873740033 18370061235217969439 + f16 9095779097250816 1103823470871 9259400833873766401 18370074696651714847 +bucket b3123 12579 + f16 18085356905826560 2305878472775631127 1125968630513665 16557674771056963875 + f16 9148526395263232 18014402821423383 1125969163198529 16557689207266292003 + f16 18085356756011264 576469827586294039 4503616811433985 16844779230054854947 + f16 9148526245447936 18014402821423383 4503616941459521 16844789268284780835 + f16 9359632527132928 18014402821423383 144117473002651649 17497549724313268515 + f16 36099201263862016 2882585240805769495 144255925568405505 17500897418468733219 + f16 9288709732172032 18014402821423383 144255926235365377 17500911970540138787 + f16 9289259487985920 18014402821423383 9223374235878107137 18362197795352162595 + f16 36099751019675904 325459753763095 9223374235882225665 18362210739375517987 + f16 9359082805135616 18014402821423383 9229142273881538561 18368465304057360675 +bucket b3125 12581 + f16 18085356905989120 4611756528922591511 563018674995201 16413557392581210405 + f16 9148526395425792 9007203566813463 563019746656289 16413576226769940773 + f16 18085356755003392 576469690147471639 4503608219402241 16844214081078047013 + f16 9148526244440064 9007203566813463 4503608351524897 16844226318297674021 + f16 9359632527295488 9007203566813463 288234851509731329 17642227853718925605 + f16 36099201263764480 5188428250019594519 288371113642164225 17645010416111268133 + f16 9288709732074496 9007203566813463 288371114848092161 17645029357639119141 + f16 9289259487888384 9007203566813463 9223376434901370881 18362760753895387429 + f16 36099751019578368 360644125982999 9223376434903384065 18362771490339238181 + f16 9359082805038080 9007203566813463 9228579323926020097 18368463105000419621 +bucket b3129 12585 + f16 18085356776981504 4611756425844162839 562967133814785 16412427094627594537 + f16 9148526266418176 2251804126544151 562968207048713 16412450326795727145 + f16 18085356775811072 2305878232258380055 1125908497301505 16555979324126540073 + f16 9148526265247744 2251804126544151 1125909033656329 16556000357304971561 + f16 9359632498164736 2251804126544151 1152939122563219457 17931579731663597865 + f16 36099201201341440 6917810506930651415 1153062242095726593 17933236394283577641 + f16 9288709669651456 2251804126544151 1153062243705880577 17933259750970437929 + f16 9289259425465344 2251804126544151 9223389629040910337 18363886653869076777 + f16 36099750957155328 387032405836055 9223389629041344513 18363892992199831849 + f16 9359082742615040 2251804126544151 9225201624203919361 18367337205026205993 +bucket b312f 12591 + f16 11329956827244544 18014574628372759 144117387099176961 17497506468034130223 + f16 9095749199603712 281479296909591 144117387103305769 17497519787736117551 + f16 36169573438882816 18014403165225239 144255925568405505 17500897361591021871 + f16 11329956828414976 9007512812585239 288234774198288385 17642184597507027247 + f16 9095749200774144 281479296909591 288234774200320073 17642195735332073775 + f16 36169573438980352 9007203876929815 288371113642164225 17645010342053556527 + f16 11329956928291840 2252216450744599 1152939096792956929 17931540856385974575 + f16 9095749300651008 281479296909591 1152939096793415777 17931547613411225903 + f16 36169573447303424 2251804234547479 1153062242095726593 17933236302911779119 + f16 9024826472137728 281479296909591 1585407806322835457 17939230258022658351 + f16 9025376227951616 281479296909591 9223396226110652417 18363944060502225199 + f16 11329407172742144 29273401898107159 9223512774343196673 18365575296765604143 + f16 9095199545101312 281479296909591 9223512774349946881 18365588758199349551 +bucket b320d 12813 + twoE8 2393089209564160 72622747343192407 85 10126771954851656205 + twoE8 18032542603049984 365105840471 16908801 12727896353246884365 + f16 10274115858556928 4647717018798195031 10305 11211584263416853005 + f16 11400015765612544 1161930907213431127 34833 11427753734060519949 + f16 11400015767693312 290484379317240151 40965 11428875218673873421 + f16 10274388588980224 4612389710197752151 2621505 12369009367450530317 + f16 11400288496035840 1153519643260944727 8912913 12585178838144332301 + f16 11400288498116608 288802126526742871 10485765 12586300322824532493 + f16 18102930708382720 5764607544542691671 17303553 12729309432652313101 + f16 18102930706301952 4899916467627163991 18882561 12730439730538820109 + f16 18094134613066752 1441152159965053271 25198593 12731287441119130125 + f16 18102911381039104 45036017782161751 67241985 13088189967593976333 + f16 18102638650615808 175943368900951 67633665 13089591775931478541 + f16 18102911378958336 38280669880713559 268574721 13376424741725352461 + f16 18102638648535040 149606629441879 270533121 13378948051923186189 + f16 10274407916323840 108227132873834839 335544385 13381756282317189645 + f16 18094115285723136 11259278274920791 1073905665 13592600809489314317 + f16 18093842555299840 44259671605591 1082130945 13595965246082396685 + f16 11400307823379456 81099981993345367 1140850705 13597925765845561869 + f16 11400307825460224 74318194273222999 1342177285 13599047267638522381 +bucket b3213 12819 + f16 18085390460256896 1161928983068082967 8864812531713 15476794363787096595 + f16 9148559949693568 140741816943383 8865083031617 15476824265904239123 + f16 18085390310441600 290482455171891991 35201551990785 15763898822784987667 + f16 9148559799878272 140741816943383 35201619591233 15763924326922727955 + f16 9359666081563264 140741816943383 72620629890727937 17429995729650070035 + f16 36046458260162688 1441154084110402327 108086391056924673 17433326927071031827 + f16 2533343845550208 140741816943383 108086391392436737 17433356872070345235 + f16 36046462555127936 11261202420269847 4612248968380841985 18294640295441216019 + f16 2533348140515456 140741816943383 4612248968383431169 18294654847512621587 + f16 9359661820414592 140741816943383 4647758795911495681 18298084426344444435 +bucket b3216 12822 + f16 10208969769494528 4647714888494418199 2267742740481 15260618296073466390 + f16 9650417862584320 35188700678423 2268824862737 15260654795159712278 + f16 11334869703600128 290482249013463319 35188667064321 15763051099319775766 + f16 9659213982869504 35188700678423 35188734689297 15763079901942067734 + f16 9593243285202944 35188700678423 290482248979849217 17647012923758555670 + f16 11335449792899072 4899918597930944791 324259173170683905 17649496423534834198 + f16 9659794072168448 35188700678423 324259174311526913 17649532952718815766 + f16 11335470999289984 38282800184494359 4613937818241081345 18295481434721366550 + f16 9659815278559360 35188700678423 4613937818249986561 18295502570977440278 + f16 9593239227211904 35188700678423 4647752198841704449 18298084413409014294 +bucket b321a 12826 + f16 10208969775736832 4647714836954816791 2216203126785 15259487998119850522 + f16 9650417868826624 8800421617943 2217285255173 15259528895185498650 + f16 11334869682792448 1161928725370052887 8800387991553 15474816342368268826 + f16 9659213962061824 8800421617943 8800658522117 15474853940949365274 + f16 9593243264395264 8800421617943 1161928725336426497 17936364801703227930 + f16 11335449807464448 5764609726386086167 1188950301625812993 17937722401707143706 + f16 9659794086733824 8800421617943 1188950302967988737 17937763346050134554 + f16 11335471013855360 45038199625556247 4620693217682130945 18296602936648806938 + f16 9659815293124736 8800421617943 4620693217692615169 18296628488063889946 + f16 9593239237615744 8800421617943 4647725810562631681 18298080015295132186 +bucket b321f 12831 + f16 18089444515293184 140827716321559 72620543991349761 17429935916507804191 + f16 9711165911640064 2203351875863 72620543991382037 17429949296338416159 + f16 11340912989588608 140742152519959 108086391056924673 17433326810081538591 + f16 18089444510885888 35480758485271 290482175965397505 17646953110717149727 + f16 9711165907232768 2203351875863 290482175965405253 17646963217732350495 + f16 18089444483835904 9144019026199 1161928703861588481 17936309369596097055 + f16 9711165880182784 2203351875863 1161928703861590097 17936315095811502623 + f16 9786512791349248 2203351875863 1549238271815451137 17939229226977866271 + f16 9786533997740160 2203351875863 4623507967449235969 18296690301232886303 + f16 18089440457056384 184722282086679 4647714815446352385 18298004744986636831 + f16 9711161853403264 2203351875863 4647714815446394881 18298018202125480479 +bucket b3223 12835 + f16 18085356368953984 1152956968185561367 2251868541550593 16629733460311552547 + f16 9148525858390656 36028801347682583 2251868801605697 16629745701792657955 + f16 18085356219138688 288239451451359511 9007216442998785 16916837919309443619 + f16 9148525708575360 36028801347682583 9007216501721153 16916845762811146787 + f16 9359631990260352 36028801347682583 72059878968918017 17425492130292183587 + f16 36046424168859776 1441714835040698647 72198331534671873 17428840919630754339 + f16 2533309754247296 36028801347682583 72198331861958657 17428853272712458787 + f16 2533859510059136 36028801347682583 4611688217450784769 18290141300825928227 + f16 36046973924671616 606934747250967 4611688217459032065 18290154249144185379 + f16 9359082268265088 36028801347682583 4623085754992558081 18296690284524614179 +bucket b3226 12838 + f16 10208424308647936 4611826828964331799 563018674995201 16413557392597922342 + f16 9649872401737728 9007203583852823 563019746672657 16413576231048131110 + f16 11334324242753536 288239245293322519 9007203551805441 16915990195844231718 + f16 9658668522022912 9007203583852823 9007203616819217 16916001337830486566 + f16 9592697824356352 9007203583852823 288239245261275137 17642509324400669222 + f16 11333813410359296 4900479348861632791 288371113642164225 17645010416094556710 + f16 9658157689628672 9007203583852823 288371114781048833 17645029353360929318 + f16 9660872108949632 9007203583852823 4611694814520576001 18290985738640765478 + f16 11336527829680256 712487863910679 4611694814522507265 18290995375589765670 + f16 9592182396821632 9007203583852823 4621396905126002689 18296686985939202598 +bucket b322a 12842 + f16 10208424314890240 4611826777426297111 562967133814785 16412427094644306474 + f16 9649872407980032 2251804144369943 562968207065093 16412450331073917482 + f16 11334324221945856 1152956710489489687 2251804109176833 16627755438892724778 + f16 9658668501215232 2251804144369943 2251804377096197 16627775376837784106 + f16 9592697803548672 2251804144369943 1152956710454296577 17931861202345341482 + f16 11333813424924672 5765170477318340887 1153062242095726593 17933236394266866218 + f16 9658157704194048 2251804144369943 1153062243437510657 17933259746692248106 + f16 9660872123515008 2251804144369943 4611721202799648769 18292111638614454826 + f16 11336527844245632 738876144550167 4611721202800001025 18292116877450359338 + f16 9592182407225472 2251804144369943 4614641505683374081 18295561085964988970 +bucket b322f 12847 + f16 18089717245716480 36028887255286039 72059793061314561 17425449977785954863 + f16 9711438642063360 562954290397463 72059793069572117 17425463288898138671 + f16 11338219776658560 36028801691484439 72198331534671873 17428840871359689263 + f16 18089717241309184 9007495649493271 288239172244865025 17642467171995300399 + f16 9711438637656064 562954290397463 288239172246831173 17642477210292073007 + f16 18089717214259200 2252147748045079 1152956688979066881 17931823430874247727 + f16 9711438610606080 562954290397463 1152956688979460177 17931829088371225135 + f16 9785694600079360 562954290397463 1513350212284973057 17939229158527873583 + f16 9788409019400320 562954290397463 4611732197915885569 18292169040969478703 + f16 18089201817936000 47287800424366359 4611826755915874305 18293518806534271535 + f16 9710923214282880 562954290397463 4611826755926753281 18293532263673115183 +bucket b3231 12849 + d16Plus 54397238693142784 72057598718837015 36169534524096513 17284727890897023537 + f16 9359628500601088 4611686022772752663 565235949764609 16416685813996991025 + f16 2533313780777216 4611686022772752663 703687461175297 16420037017711948337 + f16 36046428195389696 83316597451718935 703688515518465 16420049957440401969 + f16 2533859241623808 4611686022772752663 36030996059006977 17281350377458643505 + f16 36046973656236288 72101578848403735 36030997115961345 17281363385905525297 + f16 9148522368731392 4611686022772752663 288230444873293889 17638536625161777713 + f16 18085352879294720 9042662850101527 288230445944930305 17638555109875790385 + f16 9148522218916096 4611686022772752663 1152921521787242561 17925636686180266545 + f16 18085352729479424 2260875129979159 1152921522860457985 17925659568873681457 + f16 9359083073571072 4611686022772752663 1477321416339619841 17939226959942529585 +bucket b340b 13323 + twoE8 2393089211498624 73187896353423671 51 9982654567786230795 + twoE8 18032542604984448 219110506807 17040385 12728461493633496075 + f16 10274115859776128 2341876208641311031 18465 11355697243879650315 + f16 11400015766620416 1170940305524982071 34833 11427753734094205963 + f16 11400015768717440 146371390298194231 49155 11429435961014236171 + f16 10274388590199424 2307109650971033911 4718625 12513122347946750987 + f16 11400288497043712 1154117777620009271 8912913 12585178838178018315 + f16 11400288499140736 145249888437862711 12582915 12586861065198318603 + f16 18102930708236416 3458764526772617527 17303553 12729309424062247947 + f16 18102930706139392 2449958270371168567 20987905 12731004870892008459 + f16 18094134613115520 1297036834483798327 25198593 12731287441085445131 + f16 18102911382063232 54043208480522551 33818625 12944637729504965643 + f16 18102638651639936 211119184609591 34079745 12945478786912302091 + f16 18102911379966208 38280669914267959 268713985 13376989890702029835 + f16 18102638649542912 149606662996279 272630785 13379513200899863563 + f16 10274407916372608 108227132907389239 301989921 13381191133340513291 + f16 18094115286942336 20266340124262711 537165825 13449048579956683787 + f16 18093842556519040 79306638295351 545260545 13451852265619600395 + f16 11400307823216896 90142365653729591 570425361 13453247627849970699 + f16 11400307825313920 74318194306777399 805306371 13454929880539411467 +bucket b3415 13333 + f16 18085390460208128 1170936044917425431 8864812531713 15476794363820520469 + f16 9148559949644800 140741850498327 8865085128737 15476824274460619797 + f16 18085390309222400 146367129690637591 70377334145025 15907451052317357077 + f16 9148559798659072 140741850498327 70377368191009 15907474365988353045 + f16 9359666081514496 140741850498327 73183571254214657 17430558671013557269 + f16 36046458260308992 1297041095091356951 108086391056924673 17433326927037608981 + f16 2533343845696512 140741850498327 108086391358882817 17433356863513965589 + f16 36046462555014144 20270600731821335 2306968909120569345 18151088065908847637 + f16 2533348140401664 140741850498327 2306968909125256193 18151104808446997525 + f16 9359661820365824 140741850498327 2341950971069890561 18153971437291844629 +bucket b3416 13334 + f16 10208969770664960 2341871879314278679 4466766004225 15404735674582643734 + f16 9650417863754752 70373106321687 4467311247377 15404767784212444182 + f16 11334869704770560 146367060971161879 70373039161345 15907168477828953110 + f16 9659213984039936 70373106321687 70373073223697 15907192890994799638 + f16 9593243286373376 70373106321687 146367060904001537 17502897735716385814 + f16 11335449793793152 2449962599698204951 180143985094836225 17505383425858876438 + f16 9659794073062528 70373106321687 180143985665246209 17505415557063455766 + f16 11335470998899840 38284999241304343 2308094809027395585 18151368445668897814 + f16 9659815278169216 70373106321687 2308094809036293121 18151387382935270422 + f16 9593239228138496 70373106321687 2341946573023363073 18153971432980034582 +bucket b341c 13340 + f16 10208969776956032 2341871819184750871 4406636447745 15403040227652219932 + f16 9650417870045824 8800455180567 4407181705219 15403078934251123740 + f16 11334869683800320 1170935916068421911 8800387991553 15474816342401692700 + f16 9659213963069696 8800455180567 8800660619267 15474853949505745948 + f16 9593243265403136 8800455180567 1170935916001232897 17936925552633394204 + f16 11335449808472320 3458768916229210391 1188950301625812993 17937722393117340700 + f16 9659794087741696 8800455180567 1188950302431118337 17937761147060433948 + f16 11335471013579008 54047597937115415 2323857407723177985 18153050698560058396 + f16 9659815292848384 8800455180567 2323857407735759873 18153076258564944924 + f16 9593239238623616 8800455180567 2341885000372193281 18153964835809211420 +bucket b341f 13343 + f16 18089444516301056 140819159941399 73183493944771585 17430501065484350495 + f16 9711165912647936 4402408685847 73183493944803347 17430512246258414623 + f16 18089444512105088 70519135240471 146366987889542145 17502840130220799007 + f16 9711165908451968 4402408685847 146366987889557539 17502850220056392735 + f16 18089444484843776 9006613627159 1170935903116329985 17936874518539219999 + f16 9711165881190656 4402408685847 1170935903116331057 17936878037175120927 + f16 9786512792357120 4402408685847 1405123083739595777 17938666277058130975 + f16 9786533997463808 4402408685847 2327235107443704833 18153138071734072351 + f16 18089440458064256 219906687729943 2341871806232658945 18153891755967591455 + f16 9711161854411136 4402408685847 2341871806232709121 18153903022639690783 +bucket b3425 13349 + f16 18085356368905216 1152992015152382231 2251868541550593 16629733460344976421 + f16 9148525858341888 36028801381368087 2251868801613857 16629745710349038629 + f16 18085356217919488 144124125970235671 18014407107805185 17060390148841813029 + f16 9148525707356160 36028801381368087 18014407132973089 17060395801876771877 + f16 9359631990211584 36028801381368087 72062069402238977 17426055071655670821 + f16 36046424169006080 1298162596951949591 72198331534671873 17428840919597331493 + f16 2533309754393600 36028801381368087 72198331828535297 17428853264156079141 + f16 2533859509945344 36028801381368087 2305847407260485633 18146591270316684325 + f16 36046973924557824 1205069106446615 2305847407268593665 18146602019645240357 + f16 9359082268216320 36028801381368087 2326249945033605121 18153138046402180133 +bucket b3426 13350 + f16 10208424309818368 2305983819784192279 1125968630513665 16557674771107099686 + f16 9649872402908160 18014402872148247 1125969163223057 16557689220100863014 + f16 11334324243923968 144124057251021079 18014402808643585 17060107574353409062 + f16 9658668523193344 18014402872148247 18014402838005777 17060114326883218470 + f16 9592697825526784 18014402872148247 144124057187516417 17498394136358499366 + f16 11333813411253376 2451084101559058711 144255925568405505 17500897418418598950 + f16 9658157690522752 18014402872148247 144255926134898689 17500911957705569318 + f16 9660872108559488 18014402872148247 2305851805307013121 18146872749588296742 + f16 11336527829290112 1275437850886423 2305851805310910465 18146882395127100454 + f16 9592182397748224 18014402872148247 2325124045122568193 18153136946873709606 +bucket b342c 13356 + f16 10208424316109440 2305983759658320151 1125908497301505 16555979324176675884 + f16 9649872409199232 2251804180021527 1125909033680899 16556000370139542572 + f16 11334324222953728 1152991886307295511 2251804109176833 16627755438926148652 + f16 9658668502223104 2251804180021527 2251804377104387 16627775385394164780 + f16 9592697804556544 2251804180021527 1152991886236450817 17932421953275507756 + f16 11333813425932544 3459890418093719831 1153062242095726593 17933236385677063212 + f16 9658157705201920 2251804180021527 1153062242900770817 17933257547702547500 + f16 9660872123238656 2251804180021527 2305913377958182913 18148561599548830764 + f16 11336527843969280 1337010505711895 2305913377958395905 18148564647917990956 + f16 9592182408233344 2251804180021527 2309361446423101441 18151448096912389164 +bucket b342f 13359 + f16 18089717246724352 36028878698905879 72061992084701185 17426015126762501167 + f16 9711438643071232 1125904277373207 72061992092827667 17426026238818137135 + f16 18089717242528384 18014548908900631 144123984169140225 17498354191498949679 + f16 9711438638875264 1125904277373207 144123984173072419 17498364212616115247 + f16 18089717215267072 2252010342646039 1152991873351286785 17932388579817370671 + f16 9711438611613952 1125904277373207 1152991873351548977 17932392029734843439 + f16 9785694601087232 1125904277373207 1369235024209248257 17938666208608138287 + f16 9788409019123968 1125904277373207 2305926572097667073 18148616811470664751 + f16 18089201818943872 56294999712661783 2305983746702311425 18149405817515226159 + f16 9710923215290752 1125904277373207 2305983746715156481 18149417084187325487 +bucket b3431 13361 + f16 9359628500763648 2305843013592613143 1130375799635969 16561363943402648625 + f16 2533313780679680 2305843013592613143 1266637416693761 16564152214377608241 + f16 36046428195292160 92323796740014359 1266637932068865 16564162946526557233 + f16 2533859241526272 2305843013592613143 36033195082270721 17281913336001868849 + f16 36046973656138752 72136763254046999 36033195602345985 17281924136869246001 + f16 9148522368893952 2305843013592613143 144115256799543329 17494423644665426993 + f16 18085352879457280 18084909071532311 144115257332203521 17494437731400037425 + f16 9148522217908224 2305843013592613143 1152921513197307937 17925073736193160241 + f16 18085352728471552 2260737724580119 1152921513733652481 17925094419896874033 + f16 9359083073473536 2305843013592613143 1333206227726893057 17938664009955423281 +bucket b3432 13362 + f16 9592710709642240 1152921509002543383 2260669189586945 16633703008105477170 + f16 9658166011513984 1152921509002543383 2392537327730689 16636209812710437938 + f16 11333821732244608 110338195266273559 2392537570476033 16636219441069634610 + f16 9660859224444032 1152921509002543383 36037593128798209 17282194815273481266 + f16 11336514945174656 72207132015001879 36037593380421633 17282204512351106098 + f16 9649885287023616 1152921509002543383 72057662765826065 17422367154417251378 + f16 10208437193933824 36169607622492439 72057663025840129 17422379042162160690 + f16 9658681407308800 1152921509002543383 1152921508902340625 17924792261199606834 + f16 11334337128039424 2260669021880599 1152921509170249729 17924811845408470066 + f16 9592191255577600 1152921509002543383 1261148633420529665 17938382534961869874 +bucket b370b 14091 + f16 11330469510776960 145245490458460471 824633720835 14901711273666557707 + f16 9096261883136128 13019185463 824667538433 14901764261482280715 + f16 11330488836950144 74313796327375159 52776558133251 15769780089007650571 + f16 9096281209309312 13019185463 52776575435777 15769829804007962379 + f16 11332125219489920 73192294467043639 13510798882111491 16927205193191733003 + f16 9097917591849088 13019185463 13510798899152897 16927254895407609611 + f16 9026999058301056 13019185463 4620728951810031619 18296677016646399755 + f16 9026999058303104 13019185463 9227893503546097667 18368452031901021963 + f16 11332129514717312 146375788411814199 13835058055282163715 18373986586419738379 + f16 9097921887076480 13019185463 13835058055316244481 18374039587120166667 +bucket b370d 14093 + f16 11330469509752832 288795529557639511 687194767365 14901150531292641037 + f16 9096261882112000 21609120087 687262007809 14901203501928757005 + f16 11330488837096448 74311597304119639 87960930222085 15913897476106630925 + f16 9096281209455616 21609120087 87960947524097 15913944992050394893 + f16 11332125219636224 72629344513622359 22517998136852485 17071322580257289997 + f16 9097917591995392 21609120087 22517998153762817 17071370074893661965 + f16 9026999058187264 21609120087 2323928326223167493 18153126977580906253 + f16 9026999058449408 21609120087 9227893366107144197 18368452023344772877 + f16 11332129514343424 290490976487670103 11529215046068469765 18373425844079507213 + f16 9097921886702592 21609120087 11529215046136104961 18373478836190131981 +bucket b370e 14094 + f16 18089857343825920 576743331221012887 412316860425 14829094041044465422 + f16 9711578740172800 38788989335 412451143937 14829147003090777870 + f16 18089785134688256 74310497792491927 105553116266505 15914180050594903822 + f16 9711506531035136 38788989335 105553133568257 15914226467010393870 + f16 18089341947750400 72347869536911767 27021597764222985 17071605154728851214 + f16 9711063344097280 38788989335 27021597781067777 17071651545575470862 + f16 9786345566267392 38788989335 2323928051345260553 18153126973302781710 + f16 9786345567551616 38788989335 4620728539493171209 18296677003812026126 + f16 18089337920970880 578721352639381911 6917529027641081865 18301369353848174350 + f16 9711059317317760 38788989335 6917529027775825921 18301422341663897358 +bucket b3719 14105 + f16 11330471925524480 288793364894126359 35321811042561 15765854853886523161 + f16 9096264297883648 1103940882711 35321878282249 15765894630183352089 + f16 11330471926694912 145241126771691799 70643622084865 15910532983359420185 + f16 9096264299054080 1103940882711 70643655901193 15910570577779308313 + f16 11332121193350144 1697650382541079 1157425104234217729 17936026851312351001 + f16 9097913565709312 1103940882711 1157425104234612737 17936048009210050329 + f16 9026990737196032 1103940882711 1189055854742077697 17937798672138975001 + f16 9026995032163328 1103940882711 9227876048799006977 18368438829407352601 + f16 11332116898647040 432354364749844759 9259400833873740033 18370061338699839257 + f16 9097909271006208 1103940882711 9259400833974405121 18370101188009998105 +bucket b371a 14106 + f16 18089856806987776 576742248889262359 17729624998401 15693798363638347546 + f16 9711578203334656 2203452514583 17729759281157 15693838131345372954 + f16 18089788087298048 145241109591826711 70918499992065 15910815557847693082 + f16 9711509483644928 2203452514583 70918533808133 15910852052739307290 + f16 18089341410912256 1416175405834519 1161928703861588481 17936309425783912218 + f16 9711062807259136 2203452514583 1161928703861917697 17936329479891859226 + f16 9786341003143168 2203452514583 1189038262556033537 17937798667860850458 + f16 9786362209534080 2203452514583 4620693904876896769 18296663809874605850 + f16 18089337384132736 720584740901560599 4647714815446352385 18298004848468506394 + f16 9711058780479616 2203452514583 4647714815614126081 18298044693483763482 +bucket b371c 14108 + f16 18089856807995648 576742240299335959 17867063952385 15694363512614893340 + f16 9711578204342528 4402475778327 17867198234627 15694401081265370908 + f16 18089788088517248 288793339124334871 35734127903745 15766702577351341852 + f16 9711509484864128 4402475778327 35734195142659 15766739055063349020 + f16 18089341411920128 853225452421399 1170935903116329985 17936874566170654492 + f16 9711062808267008 4402475778327 1170935903116527617 17936890230822156060 + f16 9786341004151040 4402475778327 1189003078183945217 17937796468871280412 + f16 9786362209257728 4402475778327 2323858232356897793 18153111580375791388 + f16 18089337385140608 864699928977424663 2341871806232658945 18153891859449460508 + f16 9711058781487488 4402475778327 2341871806433986561 18153929513997973276 +bucket b371f 14111 + f16 9928078950203648 8800522305815 1184446701998442497 17936969704897197855 + f16 9852723981779200 8800522305815 1188950301625812737 17937719198064523039 + f16 36104663606558976 7701010678039 1188950301625812993 17937722229254076191 + f16 9852724787036416 8800522305815 2323857407723176973 18153047503507240735 + f16 36104664411816192 4454015402263 2323857407723177985 18153050586235615007 + f16 18050167277109632 4405697020183 2341871806232658945 18153891712496121631 + f16 9852724787052672 8800522305815 4620693217682129419 18296597542572865311 + f16 36104664411832448 2246402212119 4620693217682130945 18296602815767983903 + f16 18050167276101760 2206136893719 4647714815446352385 18298004692958656287 + f16 9852728008311040 8800522305815 9227875636482146567 18368372557827487519 + f16 36104667633090816 1129710715159 9227875636482148353 18368378930517456671 + f16 11338714098437120 1105551524119 9259400833873740033 18370061183173211935 + f16 9928074923952512 8800522305815 16176929861514823681 18374119061196322591 +bucket b3729 14121 + f16 11329960555980800 288232613965005079 9007336693760001 16918793950410979113 + f16 9095752928339968 281479407010071 9007336760803849 16918816066071770921 + f16 11329960557151232 144119624912404759 18014673387454465 17063472079883876137 + f16 9095752929510400 281479407010071 18014673420944393 17063492013667727145 + f16 11329973441266688 2258401313751319 1152939096792956929 17931540856520718121 + f16 9095765813625856 281479407010071 1152939096793417217 17931547647905183529 + f16 9024842985112576 281479407010071 1180083839859490817 17936969662115952425 + f16 9025392740926464 281479407010071 9223390041357746177 18363935230049466153 + f16 11329423685716992 434597368471552279 9223512774343196673 18365575331259561769 + f16 9095216058076160 281479407010071 9223512774444318721 18365597588652111657 +bucket b372a 14122 + f16 18089720441776128 576461873426268439 4503737066455041 16846737460162803498 + f16 9711441838123008 562954384769303 4503737200541957 16846759567233791786 + f16 18089719904692224 144119607733584151 18014948265426945 17063754654372149034 + f16 9711441301039104 562954384769303 18014948298851333 17063773488627726122 + f16 18089716415244288 2257301803172119 1152956688979066881 17931823431008991018 + f16 9711437811591168 562954384769303 1152956688979461377 17931829122865182506 + f16 9785693268387840 562954384769303 1175580240232185857 17936968562621167402 + f16 9788407687708800 562954384769303 4611721889994375169 18292160210516719402 + f16 18089201018921088 722827744624312599 4611826755915874305 18293518841028228906 + f16 9710922415267968 562954384769303 4611826756084039681 18293541094125877034 +bucket b372c 14124 + f16 18089720442784000 576461864838430999 4503874505539585 16847302609139349292 + f16 9711441839130880 1125904340287767 4503874639495427 16847322517153789740 + f16 18089719905911424 288232588198347031 9007749010817025 16919641673875797804 + f16 9711441302258304 1125904340287767 9007749077664259 16919660490951767852 + f16 18089716416252160 2255102782013719 1152991873351286785 17932388579952113452 + f16 9711437812599040 1125904340287767 1152991873351549697 17932392064228800300 + f16 9785693269395712 1125904340287767 1166573040977575937 17936405612701431596 + f16 9788407687432448 1125904340287767 2305914202591854593 18148607981017904940 + f16 18089201019928960 866942932702265623 2305983746702311425 18149405852009183020 + f16 9710922416275840 1125904340287767 2305983746903900161 18149425914640086828 +bucket b372f 14127 + f16 9926953937207552 2251804251324695 1153044649909682177 17932448444633790255 + f16 9851667151388928 2251804251324695 1153062242095661057 17933233259612157743 + f16 36103606776168704 1970329274614039 1153062242095726593 17933236290801710895 + f16 9851770230554880 2251804251324695 2305913377958133773 18148561496066963247 + f16 36103709855334656 1125955884089623 2305913377958395905 18148564647513765679 + f16 18049621816263040 1125907565707543 2305983746702311425 18149405773774272303 + f16 9851770230571136 2251804251324695 4611721202799607819 18292111535132587823 + f16 36103709855350912 562997340733719 4611721202800001025 18292116877046134575 + f16 18049621815255168 562957075415319 4611826755915874305 18293518754236806959 + f16 9852182547464448 2251804251324695 9223389629040885767 18363886550387210031 + f16 36104122172244224 281505184153879 9223389629041344513 18363892991795607343 + f16 11338202728893440 281481024962839 9223512774343196673 18365575244451362607 + f16 9926438541412736 2251804251324695 16141041801984737281 18374118992746329903 +bucket b3807 14343 + twoE8 2393089457029248 76578790414811423 15 9693298291795048455 + twoE8 18032542850515072 64693010719 17829889 12729591774339872775 + f16 10274115990864512 612507146071900447 24585 11356818728560375815 + f16 11400015897708800 306262371410706719 40965 11428875218774931463 + f16 11400015897725056 153139984080109855 49155 11429435961081608199 + f16 10274388721287808 581105093982617887 6291465 12514243832694323207 + f16 11400288628132096 292804349086728479 10485765 12586300322925590535 + f16 11400288628148352 148653976638783775 12582915 12586861065265690631 + f16 18102930687428736 864691141608538399 18882561 12730439704768624647 + f16 18102930687412480 720575962122617119 20987905 12731004853711878151 + f16 18094134594388608 432345603150774559 25198593 12731287423905314823 + f16 18102911511070848 54043208681849119 34611201 12945768027458320391 + f16 18102638780647552 211119385936159 35655681 12946609084865656839 + f16 18102911511054592 45036018017042719 68173825 13089885414524008455 + f16 18102638780631296 175943603781919 71307265 13091287222861510663 + f16 10274407897645696 108227133108715807 100663305 13092956359142291463 + f16 18094115418030720 27021636687429919 135299073 13161944103778662407 + f16 18093842687607424 105592039473439 142610433 13163626287581247495 + f16 11400307804489984 90142365855056159 167772165 13165012853651748871 + f16 11400307804506240 81099982228226335 201326595 13165573604548229127 +bucket b3819 14361 + f16 18085390304150528 306244813584404759 35201551990785 15763898822885259289 + f16 9148559793587200 140742051827991 35201623261193 15763924352591869977 + f16 18085390302980096 153122426253807895 70377334145025 15907451052384204825 + f16 9148559792416768 140742051827991 70377369763849 15907474383101114393 + f16 9359666025333760 140742051827991 76561219435134977 17431680172873889817 + f16 36046458229097472 432363160977084695 108086391056924673 17433326909858002969 + f16 2533343814484992 140742051827991 108086391157559297 17433352465534564377 + f16 36046462490510336 27039194513740055 580964351930826753 17863983589731350553 + f16 2533348075897856 140742051827991 580964351937089537 17864000349449107481 + f16 9359661764185088 140742051827991 612595102438686721 17865741078320003097 +bucket b381a 14362 + f16 10208969926722560 612489571065733399 17609365929985 15691840133647382554 + f16 9650418019812352 70373307654423 17609508519941 15691867862343694362 + f16 11334869833778176 153122409073942807 70373039161345 15907168477895800858 + f16 9659214113047552 70373307654423 70373074796549 15907192908107560986 + f16 9593243415380992 70373307654423 153122408805449729 17504019237576718362 + f16 11335449922800768 720593537128800535 180143985094836225 17505383408679270426 + f16 9659794202070144 70373307654423 180143985262596097 17505411159084054554 + f16 11335470963526784 45053593023226135 585467951558180865 17864263969491400730 + f16 9659815242796160 70373307654423 585467951568654337 17864282923937380378 + f16 9593239357146112 70373307654423 612577510252625921 17865741074008193050 +bucket b381c 14364 + f16 10208969926771328 612489562475806999 17600775987201 15691274984670574620 + f16 9650418019861120 35188935573783 17600918585347 15691304912356587548 + f16 11334869833615616 306244787814613271 35188667064321 15763051099420047388 + f16 9659214112884992 35188935573783 35188738359299 15763079927611209756 + f16 9593243415218432 35188935573783 306244787546103809 17648695176549054492 + f16 11335449922914560 864708725204664599 324259173170683905 17649496397765425180 + f16 9659794202183936 35188935573783 324259173372006401 17649526355749713948 + f16 11335470963640576 54060792277975319 594475150812913665 17864824720455120924 + f16 9659815242909952 35188935573783 594475150825492481 17864845882480605212 + f16 9593239357227392 35188935573783 612542325880528897 17865738874951251996 +bucket b381f 14367 + f16 18089444641147136 140767821660439 76561193665302529 17431631363370596383 + f16 9711166037494016 17596749545751 76561193665331207 17431638128985651231 + f16 18089444641112704 70416257351959 153122387330600961 17503970428107044895 + f16 9711166037459584 17596749545751 153122387330613259 17503976102783629343 + f16 18089444640901376 35240475197719 306244774661197825 17648648557546518559 + f16 9711166037248256 17596749545751 306244774661201933 17648652041823205407 + f16 9786512917203200 17596749545751 540431955284463617 17650435900973791263 + f16 9786533957929216 17596749545751 607985949695021057 17864912110876112927 + f16 18089440582910336 246295168123159 612489549322391553 17865665777862653983 + f16 9711161979257216 17596749545751 612489549322444801 17865672646555351071 +bucket b3829 14377 + f16 18085356212847616 288300783820144919 9007216442998785 16916837919409715241 + f16 9148525702284288 36028801583481111 9007216501735433 16916845788480288809 + f16 18085356211677184 144150411372200215 18014407107805185 17060390148908660777 + f16 9148525701113856 36028801583481111 18014407132979209 17060395818989533225 + f16 9359631934030848 36028801583481111 72075212002164737 17427176573516003369 + f16 36046424137794560 436849168419455255 72198331534671873 17428840902417725481 + f16 2533309723182080 36028801583481111 72198331627995137 17428848866176677929 + f16 2533859445441536 36028801583481111 576478344490541057 17859491192185436201 + f16 36046973860054016 4609157308154135 576478344497856513 17859497560580503593 + f16 9359082212035584 36028801583481111 603623087564390401 17864912068296980521 +bucket b382a 14378 + f16 10208424465875968 576601511537213719 4503616811433985 16844779230171838506 + f16 9649872558965760 18014403075047703 4503616941490181 16844789298232113194 + f16 11334324372931584 144150394193379607 18014402808643585 17060107574420256810 + f16 9658668652200960 18014403075047703 18014402838011909 17060114343995979818 + f16 9592697954534400 18014403075047703 144150393926975489 17499515638218831914 + f16 11333813540260992 725079544572215575 144255925568405505 17500897401238992938 + f16 9658157819530368 18014403075047703 144255925733031937 17500907559726168106 + f16 9660872073186432 18014403075047703 576495936676601857 17859772671457048618 + f16 11336527793917056 4679526053380375 576495936679706625 17859777936062363690 + f16 9592182526755840 18014403075047703 599119487932825601 17864910968768509994 +bucket b382c 14380 + f16 10208424465924736 576601502949376279 4503608219402241 16844214081195030572 + f16 9649872559014528 9007203822403863 4503608351555587 16844226348245006380 + f16 11334324372769024 288300758053486871 9007203551805441 16915990195944503340 + f16 9658668652038400 9007203822403863 9007203616833539 16916001363499628588 + f16 9592697954371840 9007203822403863 288300757782888449 17644191577191168044 + f16 11333813540374784 869194732650168599 288371113642164225 17645010390325147692 + f16 9658157819644160 9007203822403863 288371113842442241 17645022756391827500 + f16 9660872073300224 9007203822403863 576531121048698881 17860335621443893292 + f16 11336527794030848 4714710427566359 576531121049698305 17860338686992660524 + f16 9592182526837120 9007203822403863 590112288675987457 17864348018781403180 +bucket b382f 14383 + f16 18089717371570432 36028827360624919 72075186225020929 17427145424648747055 + f16 9711438767917312 4503604199227671 72075186232360967 17427152121545373743 + f16 18089717371536000 18014446031012119 144150372448993281 17499484489385195567 + f16 9711438767882880 4503604199227671 144150372452139019 17499490095343351855 + f16 18089717371324672 9007255366205719 288300744896937985 17644162618824669231 + f16 9711438767671552 4503604199227671 288300744897986573 17644166034382927919 + f16 9785694725933312 4503604199227671 504543895754899457 17650435832523798575 + f16 9788408979589376 4503604199227671 576583897606782977 17860390850612705327 + f16 18089201943789952 63050399355044119 576601489792827393 17861179839410288687 + f16 9710923340136832 4503604199227671 576601489806458881 17861186708102985775 +bucket b3831 14385 + f16 9359628471632896 576460756883669271 4521217717436417 16850715821347321905 + f16 2533313718256640 576460756883669271 4644337138794497 16852382590596167729 + f16 36046428132869120 99079196382396695 4644337249943553 16852388924632021041 + f16 2533859179103232 576460756883669271 36046389221810177 17283039235975559217 + f16 36046973593715712 72163151734440215 36046389339226113 17283045638729840689 + f16 9148522239886336 576460756883669271 144115205259935753 17493297744691214385 + f16 18085352750449664 18084806193643799 144115205389942785 17493307433446422577 + f16 9148522238715904 576460756883669271 288230384743751689 17636847775200458801 + f16 18085352749279232 9042422566813975 288230384875864065 17636859662945368113 + f16 9359083011050496 576460756883669271 468515098869104641 17650433633736341553 +bucket b3832 14386 + f16 9592710738772992 288230380748734743 9042405168775169 16923054886050150450 + f16 9658166076017792 288230380748734743 9147936770359297 16924440188928997426 + f16 11333821796748416 117093594908655895 9147936810205185 16924445419175098418 + f16 9660859288947840 288230380748734743 36063981407870977 17283320715247171634 + f16 11336515009678464 72233520495395095 36063981458161665 17283326014211700786 + f16 9649885343204352 288230380748734743 72057611226218501 17421241254443038770 + f16 10208437250114560 36169556284211479 72057611284905985 17421248744208545842 + f16 9658681436439552 288230380748734743 288230380448784389 17636566300206905394 + f16 11334337157170176 9042405403722007 288230380513787905 17636577088456964146 + f16 9592191315919872 288230380748734743 396457504764067841 17650152158742788146 +bucket b3834 14388 + f16 9592710738610432 144115192706433303 18084780172115969 17067730825022486580 + f16 9658166076131584 144115192706433303 18155136027197441 17068555377038276660 + f16 11333821796862208 126100794196951319 18155136031391745 17068558408227829812 + f16 9660859289061632 144115192706433303 36099165779968001 17283883665234016308 + f16 11336515009792256 72268704901038359 36099165796696065 17283886765141997620 + f16 9649885343253120 144115192706433303 72057602636283907 17420678304455931956 + f16 10208437250163328 36169547727831319 72057602661416961 17420683595231737908 + f16 9658681436276992 144115192706433303 144115192375033859 17492453319710554164 + f16 11334337157007616 18084780474171671 144115192404377601 17492459709981210676 + f16 9592191316001152 144115192706433303 252342316654657537 17506036970633246772 +bucket b3837 14391 + f16 18089736547928320 576460782770913559 4521191830192129 16850693502798084151 + f16 9711457944275200 72057598735614231 4521191947632647 16850700165335496759 + f16 18089736547893888 288230423799070999 9042383643607041 16923032567534532663 + f16 9711457944240768 72057598735614231 9042383693938699 16923038139133474871 + f16 18089736547682560 144115244313149719 18084767270436865 17067710696974006327 + f16 9711457944029440 72057598735614231 18084767287214093 17067714078173050935 + f16 9785709374540032 72057598735614231 31665934896726017 17071714484448409655 + f16 9788402587470080 72057598735614231 36151942338052097 17283930098444023863 + f16 18089217125073280 1008806321228677399 36169534524096513 17284727917694367799 + f16 9710938521420160 72057598735614231 36169534742200321 17284734786387064887 +bucket b3b07 15111 + f16 11330469639784576 148636384721174815 824633720835 14901711273733929735 + f16 9096262012143744 13421838623 824668327937 14901764278729259783 + f16 11330488816142464 81082390310617375 13194139533315 15480423813016468231 + f16 9096281188501632 13421838623 13194158411777 15480473545196387079 + f16 11332125198682240 76596382869291295 3377699720527875 16637848917200550663 + f16 9097917571041408 13421838623 3377699738361857 16637898636596034311 + f16 9026999070785664 13421838623 4613947164089909251 18295546718693047047 + f16 9026999070787712 13421838623 9224502609686036483 18367321733947669255 + f16 11332129527201920 153157576534589727 13835058055282163715 18373986586487110407 + f16 9097921899561088 13421838623 13835058055317823489 18374039604367145735 +bucket b3b0d 15117 + f16 11330469507672064 1153486658415427927 584115552273 14900029046612179725 + f16 9096261880031232 73551380823 584384119297 14900082000068688653 + f16 11330488835015680 81066997147828567 74766790688785 15912775974313409293 + f16 9096281207374848 73551380823 74766809563649 15912819109323684621 + f16 11332125217555456 72655733195342167 19140298416324625 17070201078397221645 + f16 9097917589914624 73551380823 19140298433241089 17070244175054191373 + f16 9026999056106496 73551380823 594546069312897041 17864896601496566541 + f16 9026999089660928 73551380823 9224502369167867921 18367321708278921997 + f16 11332129478970368 1161963893065580887 9799832789158199313 18372304359466416909 + f16 9097921851329536 73551380823 9799832789428740097 18372357351577041677 +bucket b3b0e 15118 + f16 18089857360472064 2306125588533936535 309237645345 14827972556364004110 + f16 9711578756818944 142270857623 309774582017 14828025501230709518 + f16 18089785151334400 81065897636200855 79164837199905 15913058548801682190 + f16 9711506547681280 142270857623 79164856074497 15913100584283683598 + f16 18089341964396544 72374258218631575 20266198323167265 17070483652868782862 + f16 9711063360743424 142270857623 20266198340018177 17070525645736000270 + f16 9786345516328960 142270857623 594545794434990113 17864896597218441998 + f16 9786345681993856 142270857623 4613946648693833761 18295546688746175246 + f16 18089337906405504 2314885397672427927 5188146770730811425 18300247869235084046 + f16 9711059302752384 142270857623 5188146771269787649 18300300857050807054 +bucket b3b15 15125 + f16 11330471904716800 1153484596831126807 8830452760833 15476498595008101141 + f16 9096264277075968 1104343532823 8830721327137 15476542752238418709 + f16 11330472055702528 148618929974084887 70643622084865 15910532983426792213 + f16 9096264428061696 1104343532823 70643656687649 15910570595026287381 + f16 11332121222480896 5101738784785687 289356276058554625 17646670592433928981 + f16 9097913594840064 1104343532823 289356276059742209 17646696131265116949 + f16 9026990799619072 1104343532823 324338338007875841 17649568278807395093 + f16 9026995094586368 1104343532823 9224498245999264001 18367312912320641813 + f16 11332116961070080 1297071881886696727 9259400833873740033 18370061355879971605 + f16 9097909333429248 1104343532823 9259400834175737857 18370105586123619093 +bucket b3b16 15126 + f16 18089856827795456 2306124557741787415 4432406249985 15404442104759925526 + f16 9711578224142336 2203855161623 4432943185937 15404486253400439574 + f16 18089788081055744 148618861254609175 70918499992065 15910815557915065110 + f16 9711509477402624 2203855161623 70918534594577 15910852069986286358 + f16 18089341431719936 4820263808076055 290482175965397505 17646953166905490198 + f16 9711062828066816 2203855161623 290482175966519297 17646977601946925846 + f16 9786340988577792 2203855161623 324333939961364993 17649568274529270550 + f16 9786362194968704 2203855161623 4613938402356625921 18295537892787895062 + f16 18089337373728896 2449993386493544727 4647714815446352385 18298004865648638742 + f16 9711058770075776 2203855161623 4647714816016785409 18298049091597384470 +bucket b3b1c 15132 + f16 18089856957810944 2306124497612259607 4672924422145 15406137551689562908 + f16 9711578354157824 17597017964823 4673461354499 15406175103160433436 + f16 18089788238332544 1153484467982123287 9345848840193 15478476616426011420 + f16 9711509634679424 17597017964823 9346117402627 15478513076958411548 + f16 18089341561735424 879614134141207 306244774661197825 17648648588065717020 + f16 9711062958082304 17597017964823 306244774661398529 17648659854737816348 + f16 9786341118593280 17597017964823 324272367310213121 17649561677560560412 + f16 9786362159319296 17597017964823 594475975446630401 17864881204291451676 + f16 18089337503744384 3458799703024550167 612489549322391553 17865665898591501084 + f16 9711058900091264 17597017964823 612489550127702017 17865703553140013852 +bucket b3b1f 15135 + f16 9928078906507520 35189204025623 309622474381729793 17648734913586477855 + f16 9852723973456128 35189204025623 324259173170680577 17649493219959585567 + f16 36104663598235904 20895552864535 324259173170683905 17649496268328745759 + f16 9852724772471040 35189204025623 594475150812909617 17864821542649281311 + f16 36104664397250816 17803176411415 594475150812913665 17864824625377655583 + f16 18050167401955712 17600239206679 612489549322391553 17865665751570791199 + f16 9852724774568064 35189204025623 4613937818241073699 18295471659846155039 + f16 36104664399347840 2349884080407 4613937818241081345 18295481313974762271 + f16 9852727999987968 35189204025623 9224497936761618707 18367246675100777247 + f16 36104667624767744 1181652975895 9224497936761626625 18367257428724235039 + f16 9928074915629440 35189204025623 14447547604604559361 18374114663217183519 +bucket b3b25 15141 + f16 11329960535173120 1152923845901222167 2251834173489153 16629437691532557093 + f16 9095752907532288 281479808876823 2251834441859617 16629464188126837541 + f16 11329960686158848 144132922533019927 18014673387454465 17063472079951248165 + f16 9095753058518016 281479808876823 18014673420947489 17063492030914706213 + f16 11329973470397440 9026995296207127 288234774198288385 17642184597709142821 + f16 9095765842756608 281479808876823 288234774200324609 17642195787073010469 + f16 9024843047535616 281479808876823 308637311963299841 17648734887917730597 + f16 9025392803349504 281479808876823 9223376744138997761 18362809312962755365 + f16 11329423748140032 1306043896769610007 9223512774343196673 18365575348439694117 + f16 9095216120499200 281479808876823 9223512774647218177 18365601986765732645 +bucket b3b26 15142 + f16 18089720462583808 2305844182277226775 1125934266712065 16557381201284381478 + f16 9711441858930688 562954785849623 1125934803452177 16557407689288858406 + f16 18089719898449920 144132853813805335 18014948265426945 17063754654439521062 + f16 9711441294796800 562954785849623 18014948298854417 17063773505874705190 + f16 18089716436051968 9025895784841495 288239172244865025 17642467172197415718 + f16 9711437832398848 562954785849623 288239172246835457 17642477262033009446 + f16 9785693253822464 562954785849623 307511412056522753 17648733788422945574 + f16 9788407673143424 562954785849623 4611695398636093441 18291034293430008614 + f16 18089201008517248 2458965401376719127 4611826755915874305 18293518858208361254 + f16 9710922404864128 562954785849623 4611826756488265729 18293545492239498022 +bucket b3b2c 15148 + f16 18089720592599296 2305844122151354647 1126174785798145 16559076648214018860 + f16 9711441988946176 4503604463468823 1126175321620739 16559096539048852268 + f16 18089720055726720 1152923717056135447 2252349570547713 16631415712950467372 + f16 9711441452073600 4503604463468823 2252349837935107 16631434512846830380 + f16 18089716566067456 9010502625722647 288300744896937985 17644162619026783020 + f16 9711437962414336 4503604463468823 288300744897987329 17644166086123862828 + f16 9785693383837952 4503604463468823 291748813361643521 17647044938663738156 + f16 9788407637494016 4503604463468823 576531945682370561 17860377604933565228 + f16 18089201138532736 3467771717911380247 576601489792827393 17861179891151223596 + f16 9710922534879616 4503604463468823 576601490599182337 17861199953782127404 +bucket b3b2f 15151 + f16 9926953893511424 9007204095033623 288313939037519873 17644213653323070255 + f16 9851667143065856 9007204095033623 288371113641312257 17645007281507220271 + f16 36103606767845632 5348029397795095 288371113642164225 17645010329876380463 + f16 9851770215989504 9007204095033623 576531121048649777 17860335535209003823 + f16 36103709840769280 4503810626093335 576531121049698305 17860338686655806255 + f16 18049621941109120 4503607688888599 576601489792827393 17861179812848941871 + f16 9851770218086528 9007204095033623 4611694814520541219 18290985652405877551 + f16 36103709842866304 563100822602007 4611694814522507265 18290995375252912943 + f16 9852182539141376 9007204095033623 9223376434901352467 18362760667660499759 + f16 36104122163921152 281557126414615 9223376434903384065 18362771490002385711 + f16 9926438533089664 9007204095033623 14411659545076039681 18374114594767190831 +bucket b3b34 15156 + f16 18089736572897536 2305843091422118167 1130297970130945 16561337243986508596 + f16 9711457969244416 72057598936940823 1130298490224659 16561348304503323444 + f16 18089736568701568 1152921655534747927 2260595923484673 16633676308722957108 + f16 9711457965048448 72057598936940823 2260596175142947 16633686278301301556 + f16 18089736541440256 144115399133298967 18084767270436865 17067710697041378100 + f16 9711457937787136 72057598936940823 18084767287214129 17067714095420029748 + f16 9785709364136192 72057598936940823 21532835735142401 17070584186495056692 + f16 9788402577066240 72057598936940823 36112359919452161 17283925683217644340 + f16 18089217118830976 3602879706795409687 36169534524096513 17284727934941346612 + f16 9710938515177856 72057598936940823 36169535346180097 17284739201613445940 +bucket b3b37 15159 + f16 9926941908287744 144115193041977623 18085591920934913 17067744070701628215 + f16 9851659685593344 144115193041977623 18155136014811137 17068555325297343287 + f16 36103599310373120 72902023934181655 18155136031391745 17068558408025717559 + f16 9851761959502080 144115193041977623 36099165779919617 17283883613493082935 + f16 36103701584281856 72060897538933015 36099165796696065 17283886764939885367 + f16 18049634725347712 72057602225275159 36169534524096513 17284727890998278967 + f16 9851762227937408 144115193041977623 4611686568183333379 18288733886952454967 + f16 36103701852717184 565162532733207 4611686568216756225 18288752371666467639 + f16 9852175081668864 144115193041977623 9223372311732748547 18360508902207077175 + f16 36104114706448640 282588044394775 9223372311766237185 18360528486415940407 + f16 9926431075617152 144115193041977623 13871227589823037441 18374105798808910647 +bucket b3d07 15623 + f16 11330469639768320 292751573333901599 687194767365 14901150531393699079 + f16 9096262012127488 22548644127 687262928897 14901203527799225607 + f16 11330488816126208 90089590102229279 10995116277765 15479863062119857415 + f16 9096281188485376 22548644127 10995137253377 15479910603833031943 + f16 11332125198665984 76631567778251039 2814749767106565 16637288166270516487 + f16 9097917571025152 22548644127 2814749784948737 16637335686676299015 + f16 9026999070769408 22548644127 2308104154876215301 18151431530650877191 + f16 9026999071031552 22548644127 9223937323270406149 18366756576414743815 + f16 11332129526925568 306315148774146335 11529215046068469765 18373425844180565255 + f16 9097921899284736 22548644127 11529215046139789313 18373478862060600583 +bucket b3d0b 15627 + f16 11330469508679936 1154051807928975671 584115552273 14900029046645865739 + f16 9096261881039104 74088251703 584384250881 14900082008692178187 + f16 11330488834853120 90076395962695991 37383395344401 15768097836317818123 + f16 9096281207212288 74088251703 37383416316929 15768140979917896971 + f16 11332125217392896 73253868057723191 9570149208162321 16925522940401630475 + f16 9097917589752064 74088251703 9570149225218049 16925566045648403723 + f16 9026999056204032 74088251703 585503685686067217 17864331452519890187 + f16 9026999089758464 74088251703 9223937220191191057 18366756559302245643 + f16 11332129479067904 1171006277229281591 9799832789158199313 18372304359500102923 + f16 9097921851427072 74088251703 9799832789430845441 18372357360200531211 +bucket b3d0e 15630 + f16 18089857361642496 4611968598284501399 171798691905 14683859575901338894 + f16 9711578757989376 280246682007 172872499457 14683912512178240782 + f16 18089785152504832 90073097427812759 43980465111105 15768945559782636814 + f16 9711506548851712 280246682007 43980486082817 15768985404797893902 + f16 18089341965566976 72409443127591319 11258999068426305 16926370663816314126 + f16 9711063361913856 280246682007 11258999085285377 16926410457693830414 + f16 9786345517223040 280246682007 585503273369206849 17864331439685516558 + f16 9786345681603712 280246682007 2308103639480139841 18151431500704005390 + f16 18089337907332096 4629770791049822615 2882303761517117505 18156134888806104334 + f16 9711059303678976 280246682007 2882303762595069953 18156187876621827342 +bucket b3d13 15635 + f16 11330471905724672 1154047684760371991 8830452760833 15476498595041787155 + f16 9096264278083840 1104880403223 8830721458241 15476542760861908243 + f16 11330472055539968 292734256025764631 35321811042561 15765854853987581203 + f16 9096264427899136 1104880403223 35321879199809 15765894656053820691 + f16 11332121222318336 5699873647166231 144678138029277441 17501992454438337811 + f16 9097913594677504 1104880403223 144678138030604289 17502018001859329299 + f16 9026990799716608 1104880403223 180187965559931137 17505450891708284179 + f16 9026995094683904 1104880403223 9223935158606889217 18366747763343965459 + f16 11332116961167616 1441222254871511831 9259400833873740033 18370061355913657619 + f16 9097909333526784 1104880403223 9259400834209300481 18370105594747108627 +bucket b3d16 15638 + f16 18089856828965888 4611967567492352279 2233382994945 15260329124297260310 + f16 9711578225312768 4403415288087 2234456801297 15260373264347970838 + f16 18089788082226176 292734049867335959 35734127903745 15766702577452399894 + f16 9711509478573056 4403415288087 35734196060177 15766739080933817622 + f16 18089341432890368 4855448717035799 146366987889542145 17502840177853021462 + f16 9711062829237248 4403415288087 146366987890671617 17502862413904755990 + f16 9786340989471872 4403415288087 180181368490165249 17505450878873910550 + f16 9786362194578560 4403415288087 2308095393142932481 18151422704745725206 + f16 18089337374655488 4899986768692054295 2341871806232658945 18153891885219659030 + f16 9711058771002368 4403415288087 2341871807373524993 18153936111168404758 +bucket b3d1a 15642 + f16 18089856957973504 4611967515952750871 2336462213121 15261459422250351898 + f16 9711578354320384 17597554827543 2337536016389 15261499164187966746 + f16 18089788238283776 1154047427062341911 9345848840193 15478476616459697434 + f16 9711509634630656 17597554827543 9346117533701 15478513085581901082 + f16 18089341561897984 1477748996514071 153122387330600961 17503970458626506010 + f16 9711062958244864 17597554827543 153122387330940929 17503983915765349658 + f16 9786341118479488 17597554827543 180154980211101697 17505446480894770458 + f16 9786362159205504 17597554827543 585468638752935937 17864318245748096282 + f16 18089337503663104 5764677897147195671 612489549322391553 17865665907181567258 + f16 9711058900009984 17597554827543 612489550664581121 17865705752196824346 +bucket b3d1f 15647 + f16 9928078906133632 70374112985367 155937137097719809 17504056767000952095 + f16 9852723973358592 70374112985367 180143985094825217 17505378040473795871 + f16 36104663598138368 23095112990999 180143985094836225 17505383279309700383 + f16 9852724772373504 70374112985367 585467951558168657 17864258601285926175 + f16 36104664397153280 17941152235799 585467951558180865 17864263874481044767 + f16 9852724774454272 70374112985367 2308094809027380293 18151358679417175327 + f16 36104664399234048 4695473094935 2308094809027395585 18151368333545782559 + f16 9852727999890432 70374112985367 9223934986808197397 18366683725181041951 + f16 36104667624670208 1190779781399 9223934986808213505 18366696677794200863 + f16 9928074915531904 70374112985367 12141704595390873601 18373551713297448223 +bucket b3d23 15651 + f16 11329960536180992 1152926182900171031 2251834173489153 16629437691566243107 + f16 9095752908540160 281480345616663 2251834441860161 16629464196750327075 + f16 11329960685996288 288248248584569111 9007336693760001 16918793950512037155 + f16 9095753058355456 281480345616663 9007336760807489 16918816091942239523 + f16 11329973470234880 18036394110943511 144117387099176961 17497506468269931811 + f16 9095765842594048 281480345616663 144117387103310849 17497519848100543779 + f16 9024843047633152 281480345616663 155514924632702977 17504056749888453923 + f16 9025392803447040 281480345616663 9223374407676788737 18362244163986079011 + f16 11329423748237568 1459166284636946711 9223512774343196673 18365575348473380131 + f16 9095216120596736 281480345616663 9223512774682869761 18365601995389222179 +bucket b3d26 15654 + f16 18089720463754240 4611687192027791639 562984313421825 16413268220821716262 + f16 9711441860101120 1125905276141847 562985386901777 16413294700236389670 + f16 18089719899620352 288248042426532119 9007749010817025 16919641673976855846 + f16 9711441295967232 1125905276141847 9007749077667857 16919660516822236454 + f16 18089716437222400 18033095576453399 144123984169140225 17498354191734750502 + f16 9711437833569280 1125905276141847 144123984173076737 17498364272980540710 + f16 9785693254716544 1125905276141847 153826074772635649 17504053451404098854 + f16 9788407672753280 1125905276141847 2305852389422530561 18146919105387838758 + f16 18089201009443840 4917930798457880855 2305983746702311425 18149405877779381542 + f16 9710922405790720 1125905276141847 2305983747847094273 18149432511810518310 +bucket b3d2a 15658 + f16 18089720592761856 4611687140489756951 563087393423361 16414398518774807850 + f16 9711441989108736 4503604998242583 563088466116869 16414420600076385578 + f16 18089720055677952 1152925925204099351 2252349570547713 16631415712984153386 + f16 9711441452024832 4503604998242583 2252349837935621 16631434521470319914 + f16 18089716566230016 18019901438492951 144150372448993281 17499484489620995370 + f16 9711437962576896 4503604998242583 144150372452140289 17499490155707776298 + f16 9785693383724160 4503604998242583 147070675332366337 17502927551564627242 + f16 9788407637380224 4503604998242583 576496623871328257 17859814646390209834 + f16 18089201138451456 5782621926914588951 576601489792827393 17861179899741289770 + f16 9710922534798336 4503604998242583 576601491138150401 17861202152838937898 +bucket b3d2f 15663 + f16 9926953893137536 18014403886645527 144161367568416769 17499535506737544495 + f16 9851667142968320 18014403886645527 144255925565587457 17500892102021430575 + f16 36103606767748096 5910979888087319 144255925568405505 17500897340857335087 + f16 9851770215891968 18014403886645527 576495936676560977 17859772593845648687 + f16 36103709840671744 4503948601917719 576495936679706625 17859777935759195439 + f16 9851770217972736 18014403886645527 2305851805306978373 18146872671976897839 + f16 36103709842752512 1126197341782295 2305851805310910465 18146882394823933231 + f16 9852182539043840 18014403886645527 9223374235878096917 18362197717740764463 + f16 36104122163823616 281566253220119 9223374235882225665 18362210739072351535 + f16 9926438532992128 18014403886645527 12105816535864442881 18373551644847455535 +bucket b3d32 15666 + f16 18089736573060096 4611686109729063191 565148993454081 16416659114547297586 + f16 9711457969406976 72057599440257303 565150050418709 16416672365530856754 + f16 18089736568652800 1152921802066952471 2260595923484673 16633676308756643122 + f16 9711457964999680 72057599440257303 2260596175142981 16633686286924791090 + f16 18089736541602816 288230725151424791 9042383643607041 16923032567635590450 + f16 9711457937949696 72057599440257303 9042383693938769 16923038165003943218 + f16 9785709364022400 72057599440257303 11962686526980097 16926466799395945778 + f16 9788402576952448 72057599440257303 36074976524107777 17283362724674288946 + f16 18089217118749696 6052837904588275991 36169534524096513 17284727943531412786 + f16 9710938515096576 72057599440257303 36169535916605441 17284741400670256434 +bucket b3d37 15671 + f16 9926941907913856 288230381654704407 9043070888706049 16923065924116102455 + f16 9851659685495808 288230381654704407 9147936760201217 16924440145811553591 + f16 36103599310275584 73464974424473879 9147936810205185 16924445419006672183 + f16 9851761959404544 288230381654704407 36063981407831297 17283320672129727799 + f16 36103701584184320 72063097099059479 36063981458161665 17283326014043274551 + f16 9851762227823616 288230381654704407 2305843558969771013 18144620906523475255 + f16 36103701852603392 1130320636215575 2305843559036616705 18144639391237487927 + f16 9852175081571328 288230381654704407 9223372174293795077 18359945952287341879 + f16 36104114706351104 282597171200279 9223372174360838145 18359967735485906231 + f16 9926431075519616 288230381654704407 11565384580642897921 18373542848889175351 +bucket b3d3b 15675 + f16 9926941810117760 1152921510512492823 2261180290695169 16633709630945049915 + f16 9851659623072768 1152921510512492823 2392537319931905 16636209786839973179 + f16 36103599247852544 76842674547654935 2392537570476033 16636219440968580411 + f16 9851761896981504 1152921510512492823 36037593128767745 17282194789403016507 + f16 36103701521761280 72076291641245975 36037593380421633 17282204512250051899 + f16 9851762163319808 1152921510512492823 576461302060290065 17856394945665514811 + f16 36103701788099584 4521266438537495 576461302327672833 17856413430379527483 + f16 9852175019148288 1152921510512492823 9223372071214579985 18358820052447870267 + f16 36104114643928064 282649113461015 9223372071482949633 18358846233625836859 + f16 9926431013096576 1152921510512492823 9836002323933954049 18372416949049703739 +bucket b3e07 15879 + f16 10204569732924032 580981950559355167 412316860425 14829094041162366471 + f16 9087465919103616 40802255135 412452130817 14829147033272991239 + f16 10204588909281920 108103989685453087 6597069766665 15407806567610334727 + f16 9087485095461504 40802255135 6597094936577 15407853014090137095 + f16 10206225291821696 76701937596170527 1688849860263945 16565231671744282119 + f16 9089121478001280 40802255135 1688849878122497 16565278092655214087 + f16 2262803536693376 40802255135 2306973582044954633 18151148951884414471 + f16 2262803536953472 40802255135 4612251304843018249 18294698982393658887 + f16 10206229620083328 612630293253259551 6917529027641081865 18301369353966075399 + f16 9089125806262912 40802255135 6917529027783720961 18301422371846110727 +bucket b3e0b 15883 + f16 10204569601835648 2306973313609564471 309237645345 14827972556414533131 + f16 9087465788015232 143881470263 309774779393 14828025514165943819 + f16 10204588928008832 108090795545919799 19791209300001 15696041341808295435 + f16 9087485114188416 143881470263 19791234466817 15696083390175002123 + f16 10206225310548608 73324237875642679 5066549580791841 16853466445875396107 + f16 9089121496728192 143881470263 5066549597863937 16853508451627318795 + f16 2262803522128000 143881470263 580982218994745377 17864048873753427467 + f16 2262803555680384 143881470263 4612251201763803169 18294698965281160715 + f16 10206229572225664 2342012550163530039 5188146770730811425 18300247869285613067 + f16 9089125758405248 143881470263 5188146771276103681 18300300869986041355 +bucket b3e0d 15885 + f16 10204569600616448 4612251173846581591 171798691905 14683859575918181901 + f16 9087465786796032 281320423767 172872565249 14683912516489985549 + f16 10204588927960064 108088596522664279 21990232555585 15696606490784841229 + f16 9087485114139648 281320423767 21990257721857 15696646340095000077 + f16 10206225310499840 72761287922221399 5629499534213185 16854031594818518541 + f16 9089121496679424 281320423767 5629499551154177 16854071392990936589 + f16 2262803522274304 281320423767 580982081555791937 17864048865197178381 + f16 2262803555566592 281320423767 2306973341526786113 18151148926215667213 + f16 10206229572176896 4647855559377224023 2882303761517117505 18156134888822947341 + f16 9089125758356480 281320423767 2882303762599280641 18156187880933572109 +bucket b3e13 15891 + f16 10204571998880384 2306969190440960791 4432406249985 15404442104810454547 + f16 9087468185059968 2205465772823 4432943382593 15404486266335673875 + f16 10204572148695680 580964633251218199 17729624998401 15693798363756248595 + f16 9087468334875264 2205465772823 17729760264257 15693838161527586323 + f16 10206221315474048 5770243465085719 72620543991349761 17429935959912103443 + f16 9089117501653632 2205465772823 72620543992692737 17429960407838244371 + f16 2262795265640576 2205465772823 108108381289447937 17433392193880604179 + f16 2262799560605824 2205465772823 4612249140179501569 18294690169322880531 + f16 10206217054325376 2882444505447990039 4647714815446352385 18298004865699167763 + f16 9089113240504960 2205465772823 4647714816117473281 18298049104532618771 +bucket b3e15 15893 + f16 10204571997661184 4612249112262280471 2233382994945 15260329124314103317 + f16 9087468183840768 4404489028887 2234456866849 15260373268659715605 + f16 10204572148646912 580964495812265239 17867063952385 15694363512732794389 + f16 9087468334826496 4404489028887 17867199217697 15694401111447584277 + f16 10206221315425280 5207293511664919 73183493944771585 17430501108855225877 + f16 9089117501604864 4404489028887 73183493945982977 17430523349201862165 + f16 2262795265786880 4404489028887 108106182266192897 17433392185324355093 + f16 2262799560492032 4404489028887 2306969218358182913 18151140130257387029 + f16 10206217054276608 5188287514661684503 2341871806232658945 18153891885236502037 + f16 9089113240456192 4404489028887 2341871807440650241 18153936115480149525 +bucket b3e19 15897 + f16 10204571991418880 4612249009183068439 2336462213121 15261459422267194905 + f16 9087468177598464 17598628565271 2337536081929 15261499168499711513 + f16 10204571992589312 2306968949922795799 4672924422145 15406137551740091929 + f16 9087468178768896 17598628565271 4673461551113 15406175116095667737 + f16 10206221259244544 1829593791140119 76561193665302529 17431631389628710425 + f16 9089117445424128 17598628565271 76561193665724417 17431644851062455833 + f16 2262795234575360 17598628565271 108092988126662657 17433387787345215001 + f16 2262799495988224 17598628565271 580964764247658497 17864035671259758105 + f16 10206216998095872 6917669771571958039 612489549322391553 17865665907198410265 + f16 9089113184275456 17598628565271 612489550933032961 17865705756508569113 +bucket b3e1f 15903 + f16 9024864894340224 140743930904855 78250043525595137 17431716598491528735 + f16 45124575984110720 140743930904855 108086391056897537 17433320446452710943 + f16 11611461569498240 24195698360599 108086391056924673 17433326784783466015 + f16 45124580245523584 140743930904855 580964351930798177 17863977126326058527 + f16 11611465830911104 18010945454359 580964351930826753 17863983499016027679 + f16 45124580345400448 140743930904855 2306968909120537673 18151077204457307679 + f16 11611465930787968 4713726705943 2306968909120569345 18151087958080765471 + f16 45124580345790592 140743930904855 4612248968380809769 18294627234966552095 + f16 11611465931178112 2377264496919 4612248968380841985 18294640187579711007 + f16 9024860565554304 140743930904855 7530018576963502081 18301494119276363295 +bucket b3e23 15907 + f16 10204060629336704 2305847688580759831 1125934266712065 16557381201334910499 + f16 9086956815516288 562956396069143 1125934803452993 16557407702224092707 + f16 10204060779152000 576478625810022679 4503737066455041 16846737460280704547 + f16 9086956965331584 562956396069143 4503737200545857 16846759597416005155 + f16 10204073563390592 36050793694167319 72059793061314561 17425449978038599203 + f16 9086969749570176 562956396069143 72059793069577217 17425463353574309411 + f16 2260647513557120 562956396069143 77827831060627457 17431716581379030563 + f16 2261197269368960 562956396069143 4611688389249466369 18290186569964994083 + f16 10203523841395328 2918332564978729239 4611826755915874305 18293518858258890275 + f16 9086420027574912 562956396069143 4611826756595220481 18293545505174732323 +bucket b3e25 15909 + f16 10204060628117504 4611688361332375831 562984313421825 16413268220838559269 + f16 9086956814297088 1125906349621527 562985386902049 16413294704548134437 + f16 10204060779103232 576478488371200279 4503874505539585 16847302609257250341 + f16 9086956965282816 1125906349621527 4503874639499297 16847322547336003109 + f16 10204073563341824 36048594671042839 72061992084701185 17426015127015144997 + f16 9086969749521408 1125906349621527 72061992092832257 17426026303494307365 + f16 2260647513703424 1125906349621527 77264881107337217 17431714382389460517 + f16 2261197269255168 1125906349621527 2305847716498112513 18146636530899500581 + f16 10203523841346560 5224175574192554263 2305983746702311425 18149405877796224549 + f16 9086420027526144 1125906349621527 2305983747918397441 18149432516122263077 +bucket b3e29 15913 + f16 10204060621875200 4611688258253947159 563087393423361 16414398518791650857 + f16 9086956808054784 4503606070935831 563088466117129 16414420604388130345 + f16 10204060623045632 2305847448063508759 1126174785798145 16559076648264547881 + f16 9086956809225216 4503606070935831 1126175321621513 16559096551984086569 + f16 10204073507161088 36035400532295959 72075186225020929 17427145424901389865 + f16 9086969693340672 4503606070935831 72075186232362497 17427152186221542953 + f16 2260647482491904 4503606070935831 73887181387595777 17430588482549988905 + f16 2261197204751360 4503606070935831 576478756807376897 17859532071901871657 + f16 10203523785165824 6953557831103611159 576601489792827393 17861179899758132777 + f16 9086419971345408 4503606070935831 576601491410780161 17861202157150682665 +bucket b3e2f 15919 + f16 9025376263883904 36028803469869335 72081783302127617 17427195338228121135 + f16 45123996431961216 36028803469869335 72198331527725057 17428834508000345647 + f16 11610882017348736 6192455938539799 72198331534671873 17428840846331100719 + f16 45124546154220672 36028803469869335 576478344490516577 17859491118885781039 + f16 11611431739608192 4504018395136279 576478344497856513 17859497560294178351 + f16 45124546254097536 36028803469869335 2305847407260467273 18146591197017030191 + f16 11611431839485056 1126215595393303 2305847407268593665 18146602019358916143 + f16 45124546254487680 36028803469869335 4611688217450774569 18290141227526274607 + f16 11611431839875200 563128203018519 4611688217459032065 18290154248857861679 + f16 9024826474251392 36028803469869335 7494130517441249281 18301494050826370607 +bucket b3e31 15921 + f16 10204053430740992 4611686196685373719 565148993454081 16416659114564140593 + f16 9086949616920576 72057600497221911 565150050418729 16416672369842601521 + f16 10204053431911424 2305843324910633239 1130297970130945 16561337244037037617 + f16 9086949618091008 72057600497221911 1130298490224713 16561348317438557745 + f16 10204053531788288 576461171079577879 4521191830192129 16850693502915984945 + f16 9086949717967872 72057600497221911 4521191947632737 16850700195517709873 + f16 2260634964591616 72057600497221911 6333186992766977 16854127730381307441 + f16 2261180425438208 72057600497221911 36052986291552257 17283080150185950769 + f16 10203508071205888 7493989786403799319 36169534524096513 17284727943548255793 + f16 9086404257385472 72057600497221911 36169536252149761 17284741404982001201 +bucket b3e37 15927 + f16 9025397304609920 576460758880157975 4521604264493057 16850725755606679095 + f16 45123996165622912 576460758880157975 4644337132896257 16852382551790468663 + f16 11610881751010432 73746450474926359 4644337249943553 16852388924480437815 + f16 45124541626469504 576460758880157975 36046389221787137 17283039197169860151 + f16 11611427211857024 72064197684429079 36046389339226113 17283045638578257463 + f16 45124554510584960 576460758880157975 2305843284091864073 18144339431563607607 + f16 11611440095972480 1130338889826583 2305843284225818625 18144359015772470839 + f16 45124554510975104 576460758880157975 4611686155866472969 18287889462072852023 + f16 11611440096362624 565189913149719 4611686156000559105 18287911245271416375 + f16 9024843253564544 576460758880157975 6953698562282618881 18301485254868090423 +bucket b3e3b 15931 + f16 9025397402406016 2305843016193081623 1130607727869953 16561369462435626555 + f16 45123996230126720 2305843016193081623 1266637413154817 16564152192818888251 + f16 11610881815514240 77124150598107415 1266637932068865 16564162946442346043 + f16 45124541690973312 2305843016193081623 36033195082256897 17281913314443148859 + f16 11611427276360832 72077392226615575 36033195602345985 17281924136785034811 + f16 45124554475211904 2305843016193081623 576461027182383137 17856113470705647163 + f16 11611440060599424 4521336231756055 576461027718201345 17856133054914510395 + f16 45124554525540480 2305843016193081623 4611686052787257889 18286763562233380411 + f16 11611440110928000 565293395018007 4611686053323997185 18286789743411347003 + f16 9024843318068352 2305843016193081623 5224316305775001601 18300359355028618811 +bucket b3e3d 15933 + f16 9025397402779904 4611686025943646487 565321849110529 16416689125416779325 + f16 45123996230240512 4611686025943646487 703687459864577 16420037004776717885 + f16 11610881815628032 77687101088399639 703688515518465 16420049957389876797 + f16 45124541691087104 4611686025943646487 36030996059001857 17281350364523413053 + f16 11611427276474624 72079591786742039 36030997115961345 17281363385855000125 + f16 45124554475325696 4611686025943646487 576460889743429697 17855550520785911357 + f16 11611440060713216 4521474207580439 576460890816118785 17855572303984475709 + f16 45124554525264128 4611686025943646487 2305843043573695553 18142650581804400189 + f16 11611440110651648 1130580347519255 2305843044647174145 18142676762982366781 + f16 9024843318182144 4611686025943646487 2918473297098178561 18156244166986448445 +bucket b4543 17731 + d16Plus 54327438755274880 282673272652055 9223372043297226753 18357163980835341635 + f16 9013804931285248 1152921534671683863 2261152104972289 16633709605275911491 + f16 9084723431540992 1152921534671683863 2269392018079745 16634520937080374595 + f16 36033753428066560 612771054363934999 2269394147213313 16634537214048552259 + f16 9083087049001216 1152921534671683863 4512395737176065 16849849225276114243 + f16 36034298888913152 576602619368243479 4512397867876353 16849865570962720067 + f16 9083067872643328 1152921534671683863 72058143794794625 17424049381538612547 + f16 36034296758206720 36169633291632919 72058145941225473 17424074489092195651 + f16 9084173675462912 1152921534671683863 9223372041150269569 18357137825527842115 + f16 9014359015885056 1152921534671683863 9299950824853602305 18370721476450534723 +bucket b4643 17987 + d16Plus 54327438755266688 565333660336407 4611686029164806145 18285387866085934659 + f16 2258405490198656 2305843056458400023 1130583568678913 16561369441044678211 + f16 9084723431506560 2305843056458400023 1161084297281537 16562744818019223107 + f16 36033341111175296 306807771859321111 1161086426415105 16562761090675656259 + f16 9083087048966784 2305843056458400023 9011597318035457 16921625344337397315 + f16 36034295667656832 288302991163851031 9011599448735745 16921641685712258627 + f16 9083067872608896 2305843056458400023 144115462954815617 17495825500599895619 + f16 36034296733010048 18084951937319191 144115465101246465 17495850603841734211 + f16 2328774234374272 2305843056458400023 4611686027017848961 18285361706466690627 + f16 9014359015852672 2305843056458400023 4764843592277557249 18298946461195978307 +bucket b4645 17989 + d16Plus 54327438754210048 1130628665901335 2305843028541046785 18141835636587120197 + f16 2258405490442496 4611686074262028567 565305742983169 16416689112582211141 + f16 9084723431295232 4611686074262028567 633318715949057 16419192579896919621 + f16 36033341111419136 154248343072080151 633320845082625 16419208843929863749 + f16 9083087048755456 4611686074262028567 18016597549520897 17065177582459962949 + f16 36034295667900672 144154826329096471 18016599680221185 17065193915211335237 + f16 9083067872397568 4611686074262028567 288230513591718017 17639377738722461253 + f16 36034296733253888 9042714339377431 288230515738148865 17639402833340810821 + f16 2328774234358016 4611686074262028567 2305843026394089601 18141809468344387141 + f16 9014359015901440 4611686074262028567 2612158154766548993 18155396430686864965 +bucket b4943 18755 + f16 9083087073970432 288230457756156183 1161084295717889 16562744761865554243 + f16 36034298880590080 2305984927818121495 1161086426415105 16562761111897721155 + f16 9084723456510208 288230457756156183 9011597320388609 16921625426159552835 + f16 36033753419743488 2342153362813813015 9011599448735745 16921641707473291587 + f16 9013804922962176 288230457756156183 9042939825094657 16923065881334204739 + f16 9083067747797248 288230457756156183 72058143794005121 17424044966311971139 + f16 9084173667139840 288230457756156183 9223372041151848577 18357142240753961283 + f16 9014359007561984 288230457756156183 9296559930993541121 18370717061223893315 +bucket b4945 18757 + f16 9083087074132992 144115278270234903 633318714393089 16419192532299368773 + f16 36034298880492544 4611827945621750039 633320845082625 16419208882365221189 + f16 9084723456672768 144115278270234903 18016597553840129 17065177672838236485 + f16 36033753419645952 4647996380617441559 18016599680221185 17065193954185660741 + f16 9013804922864640 144115278270234903 18085323451924481 17067744019363350853 + f16 9083067746789376 144115278270234903 72058143793873537 17424042758698649925 + f16 9084173667042304 144115278270234903 9223372041153953921 18357144448367020357 + f16 9014359007464448 144115278270234903 9295994782016864257 18370714853610572101 +bucket b4a43 19011 + f16 9083087069774464 576460902627344663 2269392016516097 16634520880926837315 + f16 36034295655172224 1152994222698201367 2269394147213313 16634537226647259715 + f16 9084723452314240 576460902627344663 4512395739529217 16849849307098401347 + f16 36033341098690688 1171499003393671447 4512397867876353 16849865584100395587 + f16 2258405477714048 576460902627344663 4521477428740097 16850725717102971459 + f16 9083067743601280 576460902627344663 144115462954026113 17495821085373254211 + f16 2328774221889664 576460902627344663 4611686027019427969 18285366121692809795 + f16 9014359003368064 576460902627344663 4758061804557434881 18298942045969336899 +bucket b4a46 19014 + f16 9641137837058048 144115364169580823 633318714409217 16419192536577559110 + f16 11264020256811008 4611758762288546071 633320845082625 16419208882348509766 + f16 9640694650120192 144115364169580823 18016597557968897 17065177677116426822 + f16 11263986165508096 4630263542984016151 18016599680221185 17065193954168949318 + f16 9575239384459264 144115364169580823 18085052868984833 17067742924146690630 + f16 9641210046195712 144115364169580823 144115462953828737 17495817773953272390 + f16 9922685058826368 144115364169580823 4611686027025744001 18285369433112398406 + f16 9574719925919872 144115364169580823 4756366357627404289 18298938734549355078 +bucket b4a49 19017 + d16Plus 54327438614798592 4521677144785175 576460823170383873 17854731177589230153 + f16 2258405509169408 4611686228880851223 565254203375617 16416685826932230729 + f16 9084723425052928 4611686228880851223 633318716735489 16419192592731490889 + f16 36033341130146048 150870797970374935 633320845082625 16419208843879729737 + f16 9083087042513152 4611686228880851223 18016597549523969 17065177595294534217 + f16 36034295686627584 144141786808385815 18016599680221185 17065193915161201225 + f16 2328774219792640 4611686228880851223 576460821025005697 17854709407325899337 + f16 9083067716339968 4611686228880851223 1152921538966848641 17926477799740951113 + f16 36034296760303872 2261081238077719 1152921541114068993 17926507292338702921 + f16 9014359009659136 4611686228880851223 1747467026311413761 17940068073503214153 +bucket b4c45 19525 + f16 9083087069725696 576461048656232727 2269392016523777 16634520889483217989 + f16 36034295655318528 1152961383378256151 2269394147213313 16634537226613836869 + f16 9084723452265472 576461048656232727 4512395741495297 16849849315654782021 + f16 36033341098836992 1163054900121239831 4512397867876353 16849865584066972741 + f16 2258405477860352 576461048656232727 4521348579721217 16850723526669651013 + f16 9083067742382080 576461048656232727 288230513590796929 17639371115882499141 + f16 2328774221775872 576461048656232727 2305843026397773953 18141816091183565893 + f16 9014359003319296 576461048656232727 2596333983419596801 18155389807846902853 +bucket b4c46 19526 + f16 9641137838228480 288230689684390167 1161084295741697 16562744774700125254 + f16 11264020257705088 2305882905164972311 1161086426415105 16562761111847586886 + f16 9640694651290624 288230689684390167 9011597326483457 16921625438994123846 + f16 11263986166402176 2315976421907955991 9011599448735745 16921641707423157318 + f16 9575239385353344 288230689684390167 9042540393136129 16923062595684224070 + f16 9641210047366144 288230689684390167 288230513590731137 17639370012075838534 + f16 9922685058436224 288230689684390167 2305843026401984641 18141817194990095430 + f16 9574719926846464 288230689684390167 2595203685466243073 18155388704040242246 +bucket b4c49 19529 + f16 2258405509071872 2305843357106110743 1130403180052481 16561363964961377353 + f16 9084723425215488 2305843357106110743 1161084300034049 16562744839410175049 + f16 36033341130048512 294986123485184279 1161086426415105 16562761090592099401 + f16 9083087042675712 2305843357106110743 9011597318046209 16921625365728349257 + f16 36034295686530048 288257112323195159 9011599448735745 16921641685628701769 + f16 2328774219695104 2305843357106110743 576460821027111041 17854711614938958921 + f16 9083067715332096 2305843357106110743 1152921538966717057 17926475592127630409 + f16 9014359009561600 2305843357106110743 1738424642684583937 17940065865889893449 +bucket b4c4a 19530 + f16 9575239449857152 1152921921218740503 2260701133406209 16633703033975950410 + f16 9640694751167488 1152921921218740503 2269392024961025 16634520962749516874 + f16 11263986230905984 583216568356372759 2269394147213313 16634537213948283978 + f16 9641137938105344 1152921921218740503 4512395737202945 16849849250945256522 + f16 11264020322208896 576487557194383639 4512397867876353 16849865570862451786 + f16 9922684958559360 1152921921218740503 576460821031321729 17854712718745488458 + f16 9641210147243008 1152921921218740503 1152921538966651265 17926474488320969802 + f16 9574719995511808 1152921921218740503 1733903450871169025 17940064762083232842 +bucket b5143 20803 + f16 9083071093672192 18015510906077463 1161084279988289 16562735965637792067 + f16 9083070943856896 18015510906077463 4512395720656961 16849836026656280899 + f16 9084720260450560 18015510906077463 144115462988627969 17495837664298750275 + f16 36033745962270976 2882586348890423575 144115465101246465 17495850660097249603 + f16 9013797465489664 18015510906077463 144159174983417857 17499535429730128195 + f16 9084166209667328 18015510906077463 9223372041183307777 18357151036980678979 + f16 9014351550089472 18015510906077463 9229001813414379521 18368465227049947459 +bucket b5145 20805 + f16 9083071093834752 9008320241271063 633318698663969 16419183736071606597 + f16 9083070942849024 9008320241271063 4512395720525857 16849833827599339845 + f16 9084720260613120 9008320241271063 288230513658953729 17639392101410754885 + f16 36033745962173440 5188429366694052119 288230515738148865 17639402906809618757 + f16 9013797465392128 9008320241271063 288309547431362561 17644213567759274309 + f16 9084166209569792 9008320241271063 9223372041216870401 18357153244593738053 + f16 9014351549991936 9008320241271063 9228438726022004737 18368463019436626245 +bucket b5149 20809 + f16 9083070964827136 2252972339822871 633318697877513 16419179337957724489 + f16 9083070963656704 2252972339822871 1161084279070729 16562729368466968905 + f16 9084720231482368 2252972339822871 1152921539235414017 17926500958522003785 + f16 36033745899750400 6917811675143930135 1152921541114068993 17926507383121596745 + f16 9013797402969088 2252972339822871 1153027064165564417 17932448341957235017 + f16 9084166147146752 2252972339822871 9223372041418203137 18357157642707095881 + f16 9014351487568896 2252972339822871 9225060923222261761 18367337102349652297 +bucket b514f 20815 + f16 9082658139285504 283128539185431 144115462987317289 17495837534945628495 + f16 36034299148928000 18038042304512279 144115465101246465 17495850603758506319 + f16 9082658140455936 283128539185431 288230513657774153 17639391980681253199 + f16 36034299149025536 9028644026515735 288230515738148865 17639402833290875215 + f16 9082658240332800 283128539185431 1152921539235020897 17926500855039742287 + f16 36034299157348608 2260050445926679 1152921541114068993 17926507292288766287 + f16 9011735411819520 283128539185431 1585267075276865537 17939230129676964175 + f16 9082104155997184 283128539185431 9223372041518841857 18357157746188570959 + f16 11263951871151104 29275051140382999 9223372043297226753 18357164032813125967 + f16 9012289496419328 283128539185431 9223372485678858241 18360555314629136719 +bucket b5243 21059 + f16 9083070556799616 36031008927187223 2269392000786497 16634512084699075139 + f16 9083070406984320 36031008927187223 9011597301516353 16921612145717563971 + f16 9084719723577984 36031008927187223 72058143828606977 17424061545237598787 + f16 36033333108541568 1441717042620203287 72058145941225473 17424074536724353603 + f16 2258397487564928 36031008927187223 72079595007901697 17427195265498894915 + f16 2328766231740544 36031008927187223 4611686027050887169 18285374917919527491 + f16 9014351013218944 36031008927187223 4622945569399111681 18296690211795391043 +bucket b5246 21062 + f16 9641145028192256 9009436932768023 633318698680337 16419183740349796934 + f16 9641213774931968 9009436932768023 9011597301319697 16921608847132152390 + f16 9640698378856448 9009436932768023 288230513725997057 17639393200905605702 + f16 11263994421995520 4900481582210547991 288230515738148865 17639402906792907334 + f16 9575247640946688 9009436932768023 288305153679818753 17644212472542614086 + f16 9922693315313792 9009436932768023 4611686027151575041 18285378229339116102 + f16 9574727649730688 9009436932768023 4621256307221987329 18296686900375409222 +bucket b524a 21066 + f16 9641145034434560 2254140570927383 633318697893893 16419179342235914826 + f16 9641213754124288 2254140570927383 2269391999803397 16634504387999781450 + f16 9640698358048768 2254140570927383 1152921539503783937 17926502058016854602 + f16 11263994436560896 5765172813744898327 1152921541114068993 17926507383104885322 + f16 9575247655512064 2254140570927383 1153009476274487297 17932447246740574794 + f16 9922693329879168 2254140570927383 4611686027554234369 18285382627452473930 + f16 9574727660134528 2254140570927383 4614500804701716481 18295560983288435274 +bucket b524f 21071 + f16 9641619653699584 565703027523863 72058143827296277 17424061411572732495 + f16 11264037101522048 36053540325622039 72058145941225473 17424074488992256591 + f16 9641619649292288 565703027523863 288230513724883013 17639393080176169551 + f16 9641619622242304 565703027523863 1152921539503456337 17926501954534658639 + f16 9576237634988032 565703027523863 1513209485533904897 17939229034460369487 + f16 9923683309355136 565703027523863 4611686027721965569 18285382730934014543 + f16 18019382829572224 47290549161492759 4611686029164806145 18285387918046876239 + f16 9575648924328064 565703027523863 4611686742129377281 18288779195567985231 +bucket b5251 21073 + d16Plus 54327419704779008 72082887100399895 36029898678075393 17280522259459756625 + f16 2258401514094848 4611689321257304343 564223411224577 16415844700536984145 + f16 9084716233918720 4611689321257304343 633318732464129 16419195878381474385 + f16 36033337135071488 83319895936270615 633320845082625 16419208831045161553 + f16 2328765963305216 4611689321257304343 36029896564156417 17280509251063403089 + f16 9083067067140352 4611689321257304343 288230513591722049 17639377751557034577 + f16 9083066917325056 4611689321257304343 1152921538966849601 17926477812575523409 + f16 9014351818524928 4611689321257304343 1477251048669184001 17939226947107967569 +bucket b5445 21573 + f16 9083070556750848 36033216540377367 2269392000794657 16634512093255455813 + f16 9083070405765120 36033216540377367 18016597532870689 17065162184783189061 + f16 9084719723529216 36033216540377367 72058143862030337 17424063744227300421 + f16 36033333108687872 1298167012110958871 72058145941225473 17424074536690930757 + f16 2258397487711232 36033216540377367 72077404574580737 17427193075065574469 + f16 2328766231626752 36033216540377367 2305843026460690433 18141824887410283589 + f16 9014351013170176 36033216540377367 2326109759440158721 18153137973672956997 +bucket b5446 21574 + f16 9641145029362688 18018835210764567 1161084280012817 16562735978472363078 + f16 9641213776102400 18018835210764567 18016597532805137 17065161085254718534 + f16 9640698380026880 18018835210764567 144115463089094657 17495840962783302726 + f16 11263994422889600 2451088533897675031 144115465101246465 17495850660047115334 + f16 9575247641840768 18018835210764567 144152590798553089 17499532144080147526 + f16 9922693314923648 18018835210764567 2305843026527815681 18141825991216813126 + f16 9574727650657280 18018835210764567 2324983584655409153 18153136869866296390 +bucket b544c 21580 + f16 9641145035653760 2256477033136407 1161084279095299 16562729381301539916 + f16 9641213755132160 2256477033136407 2269391999811587 16634504396556162124 + f16 9640698359056640 2256477033136407 1152921540040523777 17926504248450176076 + f16 11263994437568768 3459895090946834711 1152921541114068993 17926507374515082316 + f16 9575247656519936 2256477033136407 1152974300492333057 17931884305377088588 + f16 9922693329602816 2256477033136407 2305843027467354113 18141832588386849868 + f16 9574727661142400 2256477033136407 2309220745441443841 18151447994235835468 +bucket b544f 21583 + f16 9641619654707456 1130852004200727 72058143860850707 17424063610562565199 + f16 9641619650511488 1130852004200727 144115463087980579 17495840833430377551 + f16 9641619623250176 1130852004200727 1152921540040327217 17926504144968111183 + f16 9576237635995904 1130852004200727 1369094306047983617 17938666093097014351 + f16 9923683309078784 1130852004200727 2305843027668631553 18141832691868521551 + f16 18019382830580096 56299947439489303 2305843028541046785 18141835679957996623 + f16 9575648925335936 1130852004200727 2305843870354636801 18144666206515516495 +bucket b5451 21585 + f16 2258401513997312 2305848511066865943 1127310803599361 16559962087635965009 + f16 9084716234081280 2305848511066865943 1161084347219969 16562750315493479505 + f16 36033337134973952 92329294214267159 1161086426415105 16562761069201151057 + f16 2328765963207680 2305848511066865943 36029896597719041 17280511458676462673 + f16 9083067067302912 2305848511066865943 144115462954827809 17495825521990849617 + f16 9083066916317184 2305848511066865943 1152921538966718497 17926475613518582865 + f16 9014351818427392 2305848511066865943 1333100676221239297 17938663988564481105 +bucket b5452 21586 + f16 9575255962832000 1152928105971646743 2253485588348929 16632020781185455186 + f16 9640711264142336 1152928105971646743 2269392135061505 16634527534049481810 + f16 11264002743880832 110344792235376919 2269394147213313 16634537188279145554 + f16 9922680430808192 1152928105971646743 36029896664844289 17280512562482992210 + f16 9641157913478144 1152928105971646743 72058143794823185 17424049407207756882 + f16 9641226660217856 1152928105971646743 1152921538966652945 17926474513990112338 + f16 9574736508486656 1152928105971646743 1261025489997266945 17938382509292737618 +bucket b5749 22345 + f16 9082661868021760 290344084242711 9011597303349769 16921619820722607945 + f16 9082661869192192 290344084242711 18016597536932873 17065174266458232649 + f16 9082674753307648 290344084242711 1152921539235022337 17926500889533699913 + f16 9011751924794368 290344084242711 1179943108813520897 17936969533770258249 + f16 9082120668972032 290344084242711 9223372041424470017 18357157711694616393 + f16 11263968384125952 434606233148784919 9223372043297226753 18357164067307083593 + f16 9012306009394176 290344084242711 9223378670431764481 18362815910535845705 +bucket b574a 22346 + f16 9641622849759232 571887780430103 4512395722490117 16849843697349711690 + f16 9641622312675328 571887780430103 18016597541127173 17065175365953148746 + f16 9641618823227392 571887780430103 1152921539503457537 17926501989028616010 + f16 9576236303296512 571887780430103 1175439513481117697 17936968438553663306 + f16 9923681977663616 571887780430103 4611686027564679169 18285382696440059722 + f16 18019382030557312 722836678019973399 4611686029164806145 18285387952540833610 + f16 9575648125313152 571887780430103 4611697050050887681 18291039791474693962 +bucket b574c 22348 + f16 9641622850767104 1134975172804887 4512395724587267 16849845896339543884 + f16 9641622313894528 1134975172804887 9011597309641219 16921623119207356236 + f16 9641618824235264 1134975172804887 1152921540040327937 17926504179462068044 + f16 9576236304304384 1134975172804887 1166432322816311297 17936405497190307660 + f16 9923681977387264 1134975172804887 2305843027479887873 18141832657374566220 + f16 18019382031565184 866952003534782743 2305843028541046785 18141835714451953484 + f16 9575648126321024 1134975172804887 2305856239860449281 18146926802422224716 +bucket b574f 22351 + f16 9576754884706560 2261149957554455 1152921536819101697 17925666554237114191 + f16 9643314296979712 2261149957554455 1152921540845633537 17926504351932045135 + f16 36033787787804928 1979674980843799 1152921541114068993 17926507279639729999 + f16 9589949024190720 2261149957554455 2305843027467304973 18141832484904982351 + f16 18019076008853888 1346356283244823 2305843028541046785 18141835636756010831 + f16 9589949024206976 2261149957554455 4611686027554193419 18285382523970606927 + f16 18019076007846016 748221957734679 4611686029164806145 18285387866288379727 + f16 9642725582373120 2261149957554455 9223372041418178567 18357157539225229135 + f16 11264020053756928 396378236846359 9223372043297226753 18357163981037852495 + f16 9577343599593856 2261149957554455 16140901101003079681 18374118890069776207 +bucket b5849 22601 + f16 9083070400693248 36046462219518231 9011597301530633 16921612171386705993 + f16 9083070399522816 36046462219518231 18016597532876809 17065162201895950409 + f16 9084719667348480 36046462219518231 72058144062570497 17424068125093943369 + f16 36033333077476352 436866829055492375 72058145941225473 17424074519511324745 + f16 2258397456499712 36046462219518231 72064261974654977 17426067192338602057 + f16 2328766167122944 36046462219518231 576460821291360257 17854724809279035465 + f16 9014350956989440 36046462219518231 603482901970944001 17864911995567757385 +bucket b584a 22602 + f16 9641145185420288 18032132429512983 4512395720687621 16849836056603613258 + f16 9641213905110016 18032132429512983 18016597532811269 17065161102367479882 + f16 9640698509034496 18032132429512983 144115463490961409 17495845343649945674 + f16 11263994551897216 725097273926680855 144115465101246465 17495850642867509322 + f16 9575247770848384 18032132429512983 144126254059094017 17498406261353175114 + f16 9922693279550592 18032132429512983 576460821559812097 17854725913085565002 + f16 9574727779664896 18032132429512983 598979027465666561 17864910891761096778 +bucket b584c 22604 + f16 9641145185469056 9025070613725463 4512395720556547 16849833857546672204 + f16 9641213904947456 9025070613725463 9011597301334019 16921608872801294412 + f16 9640698508871936 9025070613725463 288230514664603649 17639399772205570124 + f16 11263994552011008 869212599441490199 288230515738148865 17639402881023498316 + f16 9575247770962176 9025070613725463 288243641158205441 17642523648452155468 + f16 9922693279664384 9025070613725463 576460822096691201 17854728112142243916 + f16 9574727779746176 9025070613725463 589971690771972097 17864347933217609804 +bucket b584f 22607 + f16 9641619779553536 4521745864261911 72058144062177287 17424067991429470287 + f16 9641619779519104 4521745864261911 144115463490633739 17495845214297282639 + f16 9641619779307776 4521745864261911 288230514664407053 17639399651476527183 + f16 9576237760841984 4521745864261911 504403229132455937 17650435734125434959 + f16 9923683269544192 4521745864261911 576460822901948417 17854728232870893647 + f16 18019382955426176 63068541020078359 576460823170383873 17854731203713390671 + f16 9575649050182016 4521745864261911 576461716523581441 17856435847543937103 +bucket b5851 22609 + f16 2258401451574272 576479448296128791 4505113603342337 16848192480967284817 + f16 9084716204950528 576479448296128791 4512395989221377 16849859172604729425 + f16 36033337072550912 99097887794856215 4512397867876353 16849865545446283345 + f16 2328765900784640 576479448296128791 36029896799051777 17280515856789821521 + f16 9083066938295296 576479448296128791 144115462954041353 17495821123876968529 + f16 9083066937124864 576479448296128791 288230513590804489 17639371154386212945 + f16 9014351756004352 576479448296128791 468383159487037441 17650433595232639057 +bucket b5852 22610 + f16 9575256027335808 288250171656044823 9008988108619777 16920251174516774994 + f16 9640711293273088 288250171656044823 9011597838450689 16921636391160731730 + f16 11264002808384640 117113385815965975 9011599448735745 16921641664524277842 + f16 9922680495312000 288250171656044823 36029897067503617 17280516960596351058 + f16 9641157969658880 288250171656044823 72058143794036741 17424045009093875794 + f16 9641226689348608 288250171656044823 288230513590738949 17639370054857742418 + f16 9574736568828928 288250171656044823 396321167402598401 17650152115960895570 +bucket b5854 22612 + f16 9575256027449600 144137182603444503 18016324802314241 17064366371182434388 + f16 9640711293110528 144137182603444503 18016598606675969 17065190819716356180 + f16 11264002808498432 126122784093962519 18016599680221185 17065193902646843476 + f16 9922680495425792 144137182603444503 36029897604382721 17280519159653029972 + f16 9641157969707648 144137182603444503 72058143793905667 17424042810036934740 + f16 9641226689186048 144137182603444503 144115462953844739 17495817825291556948 + f16 9574736568910208 144137182603444503 252203780303486977 17506036919294974036 +bucket b5857 22615 + f16 9641638955911424 72083986612027671 4512395988828167 16849859038940256343 + f16 9641638955876992 72083986612027671 9011597838123019 16921636261808068695 + f16 9641638955665664 72083986612027671 18016598606479373 17065190698987313239 + f16 9576252409448704 72083986612027671 31526299050704897 17071714420275566679 + f16 9923676877424896 72083986612027671 36029898409639937 17280519280381679703 + f16 18019398136709504 1008832709105090839 36029898678075393 17280522285718132823 + f16 9575664231465344 72083986612027671 36044192329236481 17282235725507483735 +bucket b5b45 23365 + f16 9082661847214080 316680823701783 2269392000254497 16634510946498337605 + f16 9082661998199808 316680823701783 18016597536935969 17065174283705211717 + f16 9082674782438400 316680823701783 288230513657778689 17639392032422189893 + f16 9011751987217408 316680823701783 308496580917329921 17648734759572036421 + f16 9082120731395072 316680823701783 9223372041221570561 18357153313580997445 + f16 11263968446548992 1306079097784434967 9223372043297226753 18357164084487215941 + f16 9012306071817216 316680823701783 9223391967650512897 18363941827622558533 +bucket b5b46 23366 + f16 9641622870566912 598172980281623 1161084279456017 16562734823125441350 + f16 9641622306433024 598172980281623 18016597541130257 17065175383200127814 + f16 9641618844035072 598172980281623 288230513724887297 17639393131917105990 + f16 9576236288731136 598172980281623 307370685305454593 17648733664355441478 + f16 9923681963098240 598172980281623 4611686027160453121 18285378298326440774 + f16 18019382020153472 2459000619571151127 4611686029164806145 18285387969720965958 + f16 9575648114909312 598172980281623 4611723541409169409 18292165708561406790 +bucket b5b4c 23372 + f16 9641623000582400 4539063172399383 1161084283126019 16562741420094937932 + f16 9641622463709824 4539063172399383 2269392008118787 16634518642962750284 + f16 9641618974050560 4539063172399383 288230514664407809 17639399703217462092 + f16 9576236418746624 4539063172399383 291608146739200001 17647044840265374540 + f16 9923681927448832 4539063172399383 576460822109224961 17854728181129960268 + f16 18019382150168960 3467807176620310807 576460823170383873 17854731255454325580 + f16 9575648244924800 4539063172399383 576513668447993857 17859826741403999052 +bucket b5b4f 23375 + f16 9576754876383488 9042937677676823 288230459903574017 17638562077992508239 + f16 9643314253283584 9042937677676823 288230514865733633 17639399858440461135 + f16 36033787779481856 5383762980438295 288230515738148865 17639402820574731087 + f16 9589949009625344 9042937677676823 576460822096642097 17854728025907354447 + f16 18019076133699968 4750444282839319 576460823170383873 17854731177691011919 + f16 9589949011722368 9042937677676823 4611686027151540259 18285378143104228175 + f16 9642725574050048 9042937677676823 9223372041216851987 18357153158358850383 + f16 9577343591270784 9042937677676823 14411518947172024321 18374114509203397455 +bucket b5b54 23380 + f16 9641638980880640 72097180751560983 1161084346040339 16562750181828746068 + f16 9641638976684672 72097180751560983 2269392133947427 16634527404696558420 + f16 9641638949423360 72097180751560983 18016598606479409 17065190716234292052 + f16 9576252399044864 72097180751560983 21393199889121281 17070584122322213716 + f16 9923676867021056 72097180751560983 36029897805660161 17280519263134702420 + f16 18019398130467200 3602919288610029847 36029898678075393 17280522302965111636 + f16 9575664225223040 72097180751560983 36083774747836417 17283366023460838228 +bucket b5b57 23383 + f16 9576747418910976 144159172836000023 18015513053495297 17064353125503294295 + f16 9643302268059904 144159172836000023 18016598619062273 17065190871457291095 + f16 36033780322009344 72946003728204055 18016599680221185 17065193902444731223 + f16 9589940753137920 144159172836000023 36029897604334337 17280519107912096599 + f16 18019088917938560 72312685030605079 36029898678075393 17280522259561012055 + f16 9589941021573248 144159172836000023 4611686027025711619 18285369381371468631 + f16 9642718116577536 144159172836000023 9223372041153937667 18357144396626090839 + f16 9577336133798272 144159172836000023 13871089053471866881 18374105747470637911 +bucket b5d43 23875 + f16 9082661848221952 351856605856023 2269392000255041 16634510955121827139 + f16 9082661998037248 351856605856023 9011597303353409 16921619846593076547 + f16 9082674782275840 351856605856023 144115462987322369 17495837595310054723 + f16 9011751987314944 351856605856023 155374193586733057 17504056621542759747 + f16 9082120731492608 351856605856023 9223372041185918977 18357151105967807811 + f16 11263968446646528 1459236660897186071 9223372043297226753 18357164084520901955 + f16 9012306071914752 351856605856023 9223394304112721921 18363944035235749187 +bucket b5d46 23878 + f16 9641622871737344 1196307305791767 633318698123537 16419182585003138374 + f16 9641622307603456 1196307305791767 9011597309644817 16921623145077824838 + f16 9641618845205504 1196307305791767 144115463087984897 17495840893794803014 + f16 9576236289625216 1196307305791767 153685356611371009 17504053335892974918 + f16 9923681962708096 1196307305791767 2305843026536693761 18141826060204137798 + f16 18019382021080064 4918001200487530775 2305843028541046785 18141835740222152006 + f16 9575648115835904 1196307305791767 2305918053029773313 18148615678052293958 +bucket b5d4a 23882 + f16 9641623000744960 4574110105534743 633318699696389 16419186982982802762 + f16 9641622463661056 4574110105534743 2269392008119301 16634518651586239818 + f16 9641618974213120 4574110105534743 144115463490635009 17495845274661707082 + f16 9576236418632832 4574110105534743 146930008709922817 17502927453166263626 + f16 9923681927335040 4574110105534743 576460821570256897 17854725982073150794 + f16 18019382150087680 5782692432021881111 576460823170383873 17854731264044391754 + f16 9575648244843520 4574110105534743 576548990259036161 17860389699947355466 +bucket b5d4f 23887 + f16 9576754876285952 18085321304506647 144115280417652737 17494449088940039503 + f16 9643314252909696 18085321304506647 144115463658405889 17495845421261348175 + f16 36033787779384320 5981897305948439 144115465101246465 17495850582485851471 + f16 9589949009527808 18085321304506647 576460821559771217 17854725835474165071 + f16 9589949011608576 18085321304506647 2305843026527780933 18141825913605414223 + f16 9642725573952512 18085321304506647 9223372041183297557 18357150959369280847 + f16 9577343591173248 18085321304506647 12105676075397283841 18373551567840042319 +bucket b5d52 23890 + f16 9641638981043200 72130166100394263 633318731153429 16419195744716610898 + f16 9641638976635904 72130166100394263 2269392133947461 16634527413320047954 + f16 9641638949585920 72130166100394263 9011597838123089 16921636287678537042 + f16 9576252398931072 72130166100394263 11823050680958977 16926466735223102802 + f16 9923676866907264 72130166100394263 36029897235234817 17280517064077892946 + f16 18019398130385920 6052910471248412951 36029898678075393 17280522311555177810 + f16 9575664225141760 72130166100394263 36121158143180801 17283928982004194642 +bucket b5d57 23895 + f16 9576747418813440 288309545283944727 9008322388688897 16920240136450825559 + f16 9643302267686016 288309545283944727 9011597848608769 16921636434278178135 + f16 36033780321911808 73544138053714199 9011599448735745 16921641664355851607 + f16 9589940753040384 288309545283944727 36029897067463937 17280516917478907223 + f16 9589941021459456 288309545283944727 2305843026401952773 18141817151872654679 + f16 9642718116480000 288309545283944727 9223372041151840517 18357142197636521303 + f16 9577336133700736 288309545283944727 11565248243281428481 18373542806107282775 +bucket b5d5b 23899 + f16 9576747356390400 1153027062018146583 2252974487240705 16632014158345887067 + f16 9643302169889920 1153027062018146583 2269392142860289 16634527559919951195 + f16 36033780259488768 76948226053308695 2269394147213313 16634537188178091355 + f16 9589940690617344 1153027062018146583 36029896664813825 17280512536612527451 + f16 9589940956955648 1153027062018146583 576460821031292945 17854712692875025755 + f16 9642718054056960 1153027062018146583 9223372041150267665 18357137799657381211 + f16 9577336071277696 1153027062018146583 9835879180510691329 18372416923380571483 +bucket b5e43 24131 + f16 9082593128743552 703700326744343 1161084279456833 16562734836060675651 + f16 9082593278558848 703700326744343 4512395722494017 16849843727531925059 + f16 9082606062797440 703700326744343 72058143827301377 17424061476248903235 + f16 2256283826784384 703700326744343 77687104309559297 17431716457311526467 + f16 2326652570960000 703700326744343 4611686027053498369 18285374986906656323 + f16 10138068539804288 2918473308909404439 4611686029164806145 18285387969771494979 + f16 9012237352438400 703700326744343 4611730550795796481 18292169019981192771 +bucket b5e45 24133 + f16 9082593127524352 1266658870100247 633318698123809 16419182589314883141 + f16 9082593278510080 1266658870100247 4512395724591137 16849845926521757253 + f16 9082606062748672 1266658870100247 72058143860855297 17424063675238735429 + f16 2256283826930688 1266658870100247 77124162946072577 17431714266878336581 + f16 2326652570846208 1266658870100247 2305843026465390593 18141824956397542981 + f16 10138068539755520 5224316326713032983 2305843028541046785 18141835740238995013 + f16 9012237352389632 1266658870100247 2305922725954191361 18148616781858889285 +bucket b5e49 24137 + f16 9082593121282048 4644410130235671 633318699696649 16419186987294547529 + f16 9082593122452480 4644410130235671 1161084283126793 16562741433030172233 + f16 9082606006567936 4644410130235671 72058144062178817 17424068056105639497 + f16 2256283795719168 4644410130235671 73746514765152257 17430588384151625289 + f16 2326652506342400 4644410130235671 576460821297627137 17854724878266555977 + f16 10138068483574784 6953698635162910999 576460823170383873 17854731264061234761 + f16 9012237296208896 4644410130235671 576566857322987521 17860390803753950793 +bucket b5e4f 24143 + f16 45041086383279232 36170088558166295 72057690674692097 17422391499197144655 + f16 9082104191929472 36170088558166295 72058144162840577 17424068198393601615 + f16 11266150762302592 6333741026836759 72058145941225473 17424074463424699983 + f16 45111455093902464 36170088558166295 576460821291335777 17854724735979380303 + f16 45111455193779328 36170088558166295 2305843026460672073 18141824814110629455 + f16 45111455194169472 36170088558166295 4611686027050876969 18285374844619873871 + f16 9011735413933184 36170088558166295 7493990331847802881 18301493978097147471 +bucket b5e51 24145 + f16 9082585930147840 72199435332944151 633318731153449 16419195749028355665 + f16 9082585931318272 72199435332944151 1161084346040393 16562750194763980369 + f16 9082586031195136 72199435332944151 4512395988828257 16849859069122469457 + f16 2256271277818880 72199435332944151 6193551146745857 16854127666208464465 + f16 2326635727029248 72199435332944151 36029896899690497 17280515960271298129 + f16 10138052769614848 7494131621239521559 36029898678075393 17280522311572020817 + f16 9012221582248960 72199435332944151 36143148375736321 17283930085810789969 +bucket b5e57 24151 + f16 45041086116940928 576610290179834135 4504727056285697 16848182546707930711 + f16 9082125232655488 576610290179834135 4512395995119617 16849859211410431575 + f16 11266150495964288 73895981774602519 4512397867876353 16849865545294700119 + f16 45111450566151296 576610290179834135 36029896799028737 17280515817984122455 + f16 45111463450266752 576610290179834135 2305843026397758473 18141816052377869911 + f16 45111463450656896 576610290179834135 4611686027019420169 18285366082887114327 + f16 9011752193246336 576610290179834135 6953566622900551681 18301485216364387927 +bucket b5e5b 24155 + f16 45041086181444736 2306018935369171223 1127078875365377 16559956568602992219 + f16 9082125330451584 2306018935369171223 1161084350758913 16562750337052204635 + f16 11266150560468096 77300069774197015 1161086426415105 16562761069116939867 + f16 45111450630655104 2306018935369171223 36029896597705217 17280511437117742683 + f16 45111463414893696 2306018935369171223 576460821027098657 17854711593380240987 + f16 45111463465222272 2306018935369171223 4611686027017847329 18285361684907974235 + f16 9011752257750144 2306018935369171223 5224210754269347841 18300359333637676635 +bucket b5e5d 24157 + f16 45041086181558528 4611897128954954007 564137511878657 16415841389117202013 + f16 9082125330825472 4611897128954954007 633318733774849 16419195891316711005 + f16 11266150560581888 77898204099707159 633320845082625 16419208830994636381 + f16 45111450630768896 4611897128954954007 36029896564151297 17280509238128172637 + f16 45111463415007488 4611897128954954007 576460821025001537 17854709394390670941 + f16 45111463464945920 4611897128954954007 2305843026394088513 18141809455409159773 + f16 9011752257863936 4611897128954954007 2918402929427742721 18156244154151886429 +bucket b6261 25185 + d16Plus 54324726491848960 78531522797306135 422214612549633 16203880473810985569 + f16 2256799222857984 4612530447652552983 283847946141697 16200516343353336417 + f16 2326618211221760 4612530447652552983 422212501241857 16203867534133060193 + f16 9082159386200320 4612530447652552983 18016597566297089 17065180880944521825 + f16 9082146601961728 4612530447652552983 288230513592766529 17639381037207020129 + f16 9082146452146432 4612530447652552983 1152921538967110721 17926481098225508961 + f16 9012340431653120 4612530447652552983 1459307018903879681 17939223661457990241 +bucket b6461 25697 + f16 2256799222760448 2307250388392280343 286184408350721 16201081492329882721 + f16 2326618211124224 2307250388392280343 422212536893441 16203869741746119777 + f16 9082159386362880 2307250388392280343 9011597368365569 16921630841811657825 + f16 9082146602124288 2307250388392280343 144115462957961249 17495830998074156129 + f16 9082146451138560 2307250388392280343 1152921538967110177 17926481089601889377 + f16 9012340431555584 2307250388392280343 1306184631573282817 17938658512481182817 +bucket b6462 25698 + f16 9577301441006720 1154610358762144023 290857332768769 16201364066818155618 + f16 9922032696052864 1154610358762144023 422212608196609 16203870845552649314 + f16 9643268111860736 1154610358762144023 4512395854614785 16849855822245225570 + f16 9643271574258688 1154610358762144023 72058143802134545 17424055978507723874 + f16 9643272138392576 1154610358762144023 1152921538967109905 17926481085290079330 + f16 9576781986661376 1154610358762144023 1229623437907984385 17938375937992778850 +bucket b6861 26721 + f16 2256799160337408 581245831202537751 299481627099137 16202207409416333409 + f16 2326618148701184 581245831202537751 422212739792897 16203874139859478625 + f16 9082159357232128 581245831202537751 2269392268166657 16634530746433169505 + f16 9082146473116672 581245831202537751 144115462957958153 17495830980826916961 + f16 9082146471946240 581245831202537751 288230513592762889 17639381011336161377 + f16 9012340369132544 581245831202537751 434738103677091841 17650423738282698849 +bucket b6862 26722 + f16 9577301505510528 293296930027536663 317348691050497 16202489983904606306 + f16 9922032760556672 293296930027536663 422213012422657 16203875243666008162 + f16 9643268140991488 293296930027536663 1161084815803649 16562755726866737250 + f16 9643271630439424 293296930027536663 72058143802131461 17424055961260484706 + f16 9643272167523328 293296930027536663 288230513592762629 17639381007024351330 + f16 9576782047003648 293296930027536663 361554609732321281 17650141163794294882 +bucket b6864 26724 + f16 9577301505624320 149744691905102103 352670502092801 16203052942447831140 + f16 9922032760670464 149744691905102103 422213551390721 16203877442722687076 + f16 9643268140828928 149744691905102103 633319771341569 16419205679177492580 + f16 9643271630488192 149744691905102103 72058143802130947 17424055952636864612 + f16 9643272167360768 149744691905102103 144115462957957379 17495830967891486820 + f16 9576782047084928 149744691905102103 216876471703044097 17506023776695052388 +bucket b6867 26727 + f16 9577309239838976 78812997774016791 404622426505217 16203066188126775399 + f16 9922040494885120 78812997774016791 422214344114177 16203877494463424615 + f16 18021034519249280 1015561720267079959 422214612549633 16203880499799877735 + f16 9643275338205440 78812997774016791 633319771340813 16419205627436361831 + f16 9643275338416768 78812997774016791 1161084815802379 16562755666501986407 + f16 9643275338451200 78812997774016791 2269392268165127 16634530681756608615 + f16 9576789244461440 78812997774016791 4081389309788161 16637954948519192679 +bucket b6b64 27492 + f16 9577309229435136 82190697494544663 365040007905281 16203061772900395876 + f16 9922040484481280 82190697494544663 422213740134401 16203877477216447332 + f16 18021034513006976 3613012805353013527 422214612549633 16203880517046856548 + f16 9643275331963136 82190697494544663 633319771340849 16419205644683340644 + f16 9643275359224448 82190697494544663 4512395854610467 16849855761880214372 + f16 9643275363420416 82190697494544663 9011597368360979 16921630777134836580 + f16 9576789238219136 82190697494544663 14214488471371777 16927311224577747812 +bucket b6b67 27495 + f16 9574701940736256 155374191439315223 351858753273857 16203039696768691047 + f16 9587793001054464 155374191439315223 422213539004417 16203877390981753703 + f16 18021032122204544 137359792929833239 422214612549633 16203880473912240999 + f16 9640677237735680 155374191439315223 633319771389953 16419205730918427495 + f16 9587827360792704 155374191439315223 4611686027017486339 18285356238771546983 + f16 9640672638402816 155374191439315223 9223372041149825027 18357131254026169191 + f16 9575290655623552 155374191439315223 13835761744871424001 18374092604870716263 +bucket b6d62 28002 + f16 9577309229321344 90634946795864343 327656612560897 16202498814357040482 + f16 9922040484367488 90634946795864343 422213169709057 16203875278159637858 + f16 18021034512925696 6071415251943883031 422214612549633 16203880525636922722 + f16 9643275332125696 90634946795864343 1161084815802449 16562755692372454754 + f16 9643275359175680 90634946795864343 4512395854610501 16849855770503703906 + f16 9643275363582976 90634946795864343 18016597566291989 17065180816267570530 + f16 9576789238137856 90634946795864343 23784637679534081 17071428611676859746 +bucket b6d67 28007 + f16 9574701940638720 308496578769912087 316682971119617 16202478945838656871 + f16 9587793000956928 308496578769912087 422213002264577 16203875200548564327 + f16 9640677237361792 308496578769912087 1161084815843329 16562755769984183655 + f16 9587827360678912 308496578769912087 2305843026393858053 18141806199706053991 + f16 9640672638305280 308496578769912087 9223372041149816837 18357131245469920615 + f16 9575290655526016 308496578769912087 11530481685611151361 18373531853940682087 +bucket b6d6b 28011 + f16 9574701878215680 1179943106666103063 290346231660545 16201357443978587499 + f16 9587792938533888 1179943106666103063 422212600397825 16203870819682184555 + f16 9640677139565696 1179943106666103063 4512395854645249 16849855848115694955 + f16 9587827296175104 1179943106666103063 576460821023981585 17854706121575066987 + f16 9640672575882240 1179943106666103063 9223372041149810705 18357131228357422443 + f16 9575290593102976 1179943106666103063 9804477128421408769 18372410352080612715 +bucket b6e61 28257 + f16 2256782647362560 108367870328635671 305666380005377 16202216239868702305 + f16 2326601635726336 108367870328635671 422212834164737 16203874174353043041 + f16 10138223226129408 7530300056235213079 422214612549633 16203880525653765729 + f16 9082142844257280 108367870328635671 2269392268165217 16634530711938821729 + f16 9082142744380416 108367870328635671 9011597368361033 16921630790070070881 + f16 9082142743209984 108367870328635671 18016597566292009 17065180820579315297 + f16 9012323856157696 108367870328635671 29414137213747201 17071711186165198433 +bucket b6e67 28263 + f16 45040983843032192 614741353431105815 299095080042497 16202197475156979303 + f16 45110802831395968 614741353431105815 422212733894657 16203874101053779559 + f16 9084750262979712 614741353431105815 2269392268189697 16634530785238871655 + f16 45112452098051200 614741353431105815 2305843026393841673 18141806195427929703 + f16 45112452098441344 614741353431105815 4611686027017461769 18285356225937174119 + f16 9013831762723968 614741353431105815 6919921567090606081 18301475359414447719 +bucket b6e6b 28267 + f16 45040983907536000 2350879009782432023 285952480116737 16201075973296909931 + f16 45110802895899776 2350879009782432023 422212533354497 16203869720187399787 + f16 9084750360775808 2350879009782432023 9011597368379393 16921630863370382955 + f16 45112452062678144 2350879009782432023 576460821023965217 17854706117296942699 + f16 45112452113006720 2350879009782432023 4611686027017455649 18285356208824675947 + f16 9013831827227776 2350879009782432023 5197294709621391361 18300353857554378347 +bucket b6e6d 28269 + f16 45040983907649792 4665729218250866967 283762046795777 16200513031933554285 + f16 45110802896013568 4665729218250866967 422212499931137 16203867521197829741 + f16 9084750361149696 4665729218250866967 18016597566302209 17065180893879758445 + f16 45112452062791936 4665729218250866967 576460821023957057 17854706108740693613 + f16 45112452112730368 4665729218250866967 2305843026393827393 18141806169759182445 + f16 9013831827341568 4665729218250866967 2900458899662438401 18156240868501909101 +bucket b7573 30067 + f16 9574685365240832 1585267073129447703 283130686603265 16199675191188092275 + f16 9587776425559040 1585267073129447703 422212490297345 16203864248382223731 + f16 9587810516861952 1585267073129447703 36029896547401985 17280505965312570739 + f16 9640656098839680 1585267073129447703 72058143802163329 17424056004378195315 + f16 9640656062907392 1585267073129447703 9223372041149809025 18357131202688284019 + f16 9575274080128128 1585267073129447703 9331599167547506689 18370728099290117491 +bucket b7673 30323 + f16 45040991631346816 3026418953888006423 282860103663617 16199674095971497587 + f16 45110810619710592 3026418953888006423 422212486168577 16203864244104099443 + f16 45112447002250368 3026418953888006423 36029896547385857 17280505961034446451 + f16 9084762345999488 3026418953888006423 144115462957973633 17495831019632883315 + f16 45112453444698240 3026418953888006423 4611686027017454209 18285356187433727603 + f16 9013839551038592 3026418953888006423 4791970743158046721 18298951980228966003 +bucket b7675 30325 + f16 45040991631460608 5476377151177556247 282731254644737 16199671905538307701 + f16 45110810619824384 5476377151177556247 422212484202497 16203864235547850357 + f16 45112447002364160 5476377151177556247 36029896547378177 17280505952478197365 + f16 9084762346373376 5476377151177556247 288230513592770689 17639381050142258805 + f16 45112453444421888 5476377151177556247 2305843026393826433 18141806156924614261 + f16 9013839551152384 5476377151177556247 2630242922020208641 18155399742106662517 +bucket b7a79 31353 + f16 45040991641864448 8070450536542961943 282679715037185 16199668619888327289 + f16 45110810630228224 8070450536542961943 422212483416065 16203864222713281145 + f16 45112447012768000 8070450536542961943 36029896547375105 17280505939643628153 + f16 45112453404887296 8070450536542961943 576460821023953025 17854706095906126457 + f16 9084762390069504 8070450536542961943 1152921538967111809 17926481111160748665 + f16 9013839561556224 8070450536542961943 1765551793565073409 17940071384923011705 +bucket b837f 33663 + d16Plus 36453777734140032 9223372041149808919 4611686027017454123 18285356187350631295 + d16Plus 36453777734148224 9223372041149808919 9223372041149808919 18357131202588410751 + f16 582749769468032 9223372041149808919 1130581958066187 16561369440961594239 + f16 844570975832192 9223372041149808919 1161084350365707 16562750336969114495 + f16 845528745246976 9223372041149808919 1161084815835411 16562755769817727871 + f16 635526327632128 9223372041149808919 2261150225924103 16633709605176050559 + f16 844983292723456 9223372041149808919 2269392142401543 16634527559820084095 + f16 845525519829120 9223372041149808919 2269392268182051 16634530785089192831 + f16 845528753570048 9223372041149808919 4512395854643463 16849855848015823743 + f16 844570963347584 9223372041149808919 4512395993153571 16849859211260756863 + f16 582749756983424 9223372041149808919 4521475415474211 16850725716953301887 + f16 845525532313728 9223372041149808919 9011597368377867 16921630863287288703 + f16 844983284400384 9223372041149808919 9011597846577171 16921636434111726463 + f16 635526319309056 9223372041149808919 9042937744719891 16923065881167758207 + f16 845526622863616 9223372041149808919 72058143802163223 17424056004278322047 + f16 844562973198464 9223372041149808919 72058144129417731 17424068198110757759 + f16 582741766834304 9223372041149808919 72079592868807171 17427195265216054143 + f16 580628106053760 9223372041149808919 77687102162239491 17431716456828928895 + f16 845526597666944 9223372041149808919 144115462957973547 17495831019549787007 + f16 844975826927872 9223372041149808919 144115463624917251 17495845420961727359 + f16 635518861836544 9223372041149808919 144159172840128771 17499535429430510463 + f16 633473383661824 9223372041149808919 155374191439331331 17504056621043385215 + f16 642686122330752 9223372041149808919 4611686027696832515 18285382730854073215 + f16 633958748785280 9223372041149808919 4611730548648476675 18292169019498595199 + f16 636072409565824 9223372041149808919 4622945567260017155 18296690211512550271 + f16 636080399714944 9223372041149808919 4758061802544168995 18298942045819667327 + f16 636080412199552 9223372041149808919 4764843590666944523 18298946461112894335 + f16 651482215352576 9223372041149808919 9223372041489498115 18357157746091852671 + f16 634027468261632 9223372041149808919 9223394301965320195 18363944034736374655 + f16 636072946436352 9223372041149808919 9229001811271090435 18368465226750329727 + f16 636080403908864 9223372041149808919 9296559928913166355 18370717061057446783 + f16 636080412231936 9223372041149808919 9299950822974554119 18370721476350673791 +bucket b857f 34175 + d16Plus 36453777733083392 9223372041149808919 2305843026393826381 18141806156874941823 + f16 582749769711872 9223372041149808919 565304669241357 16416689112532551039 + f16 844570976076032 9223372041149808919 633318733512717 16419195891267044735 + f16 845528745149440 9223372041149808919 633319771373845 16419205730718549375 + f16 845525519975424 9223372041149808919 2269392268174405 16634530776532944255 + f16 844570963493888 9223372041149808919 4512395991187525 16849859202704508287 + f16 582749757129728 9223372041149808919 4521346566455365 16850723526520112511 + f16 845525532557568 9223372041149808919 18016597566301197 17065180893830088063 + f16 844983284302848 9223372041149808919 18016598614933525 17065190871257417087 + f16 635526319211520 9223372041149808919 18085321337995285 17067744019163481471 + f16 844562973344768 9223372041149808919 72058144095994885 17424068189554509183 + f16 582741766980608 9223372041149808919 72077402435486725 17427193074782864767 + f16 580628106200064 9223372041149808919 77124160798883845 17431714266429162879 + f16 845526597910784 9223372041149808919 288230513592770637 17639381050092586367 + f16 844975826830336 9223372041149808919 288230514798690565 17639399858107417983 + f16 635518861739008 9223372041149808919 288309545285976325 17644213567426233727 + f16 633473383564288 9223372041149808919 308496578769920005 17648734759072531839 + f16 642686122281984 9223372041149808919 2305843027609944069 18141832691754894719 + f16 633958748736512 9223372041149808919 2305922723807002629 18148616781409715583 + f16 636072409517056 9223372041149808919 2326109757301064709 18153137973390247295 + f16 636080399666176 9223372041149808919 2596333981406330949 18155389807697364351 + f16 636080412248320 9223372041149808919 2612158153692807181 18155396430637204863 + f16 651482215255040 9223372041149808919 9223372041453838341 18357157737468233087 + f16 634027468164096 9223372041149808919 9223391965503102981 18363941827123053951 + f16 636072946338816 9223372041149808919 9228438723876618501 18368463019103585663 + f16 636080403811328 9223372041149808919 9295994779902935061 18370714853410702719 +bucket b867f 34431 + f16 651534025517056 9223372041149808919 633319771357737 16419205726440425087 + f16 651534026411136 9223372041149808919 1161084815811657 16562755756983355007 + f16 651499935108224 9223372041149808919 9011597840482377 16921636421277353599 + f16 638408874790016 9223372041149808919 9042538312761417 16923062595517974143 + f16 651499934214144 9223372041149808919 18016598610804777 17065190866979292799 + f16 638408873895936 9223372041149808919 18085050755055657 17067742923946886783 + f16 651508191595648 9223372041149808919 144115463524451337 17495845408127354495 + f16 638417131277440 9223372041149808919 144152588655264777 17499532143780726399 + f16 639405779061888 9223372041149808919 153685354464165897 17504053335443736191 + f16 651508190701568 9223372041149808919 288230514731647497 17639399853829293695 + f16 638417130383360 9223372041149808919 288305151534432777 17644212472209639039 + f16 639405778167808 9223372041149808919 307370683158110217 17648733663872648831 + f16 704272906863616 9223372041149808919 2305843027538624521 18141832687443084927 + f16 638817605272576 9223372041149808919 2305918050882568201 18148615677603055231 + f16 637897140093952 9223372041149808919 2324983582512120841 18153136869566875263 + f16 637889416283136 9223372041149808919 2595203683385868361 18155388703873992319 + f16 704272905937024 9223372041149808919 4611686027589853193 18285382717918643839 + f16 638817604345984 9223372041149808919 4611723539261825033 18292165708078614143 + f16 637897139167360 9223372041149808919 4621256305076601353 18296686900042434175 + f16 637889415356544 9223372041149808919 4756366355513475113 18298938734349551231 +bucket b897f 35199 + d16Plus 36453777593671936 9223372041149808919 576460821023953009 17854706095856716159 + f16 582749788438784 9223372041149808919 565253129633841 16416685826882832767 + f16 844570994802944 9223372041149808919 633318732726321 16419195878432737663 + f16 582749788341248 9223372041149808919 1130401569439825 16561363964878686591 + f16 844570994705408 9223372041149808919 1161084347613265 16562750315578558847 + f16 845525551186944 9223372041149808919 9011597368367185 16921630841896733055 + f16 845525551284480 9223372041149808919 18016597566298161 17065180880995780991 + f16 844562942133248 9223372041149808919 72058143895457809 17424063791575370111 + f16 582741735769088 9223372041149808919 72064259835564049 17426067192056154495 + f16 580628074988544 9223372041149808919 73746512618749969 17430588383769299327 + f16 642686066101248 9223372041149808919 576460822641934353 17854728232689895807 + f16 633958692555776 9223372041149808919 576566855176585233 17860390803371624831 + f16 636072353336320 9223372041149808919 603482899831853073 17864911995285309823 + f16 845526624960768 9223372041149808919 1152921538967111793 17926481111111338367 + f16 844975764407296 9223372041149808919 1152921540577263889 17926504351532157311 + f16 635518799315968 9223372041149808919 1153027062018605329 17932448341557348735 + f16 633473321141248 9223372041149808919 1179943106666104849 17936969533270493567 + f16 636080405908480 9223372041149808919 1738424641073971281 17940065865807202687 + f16 636080406006016 9223372041149808919 1747467025237671985 17940068073453816191 + f16 651482152832000 9223372041149808919 9223372041250932753 18357153339354351999 + f16 634027405741056 9223372041149808919 9223378668284348433 18362815910036081023 + f16 636072883915776 9223372041149808919 9225060921075302673 18367337101949766015 +bucket b8a7f 35455 + f16 638408939293824 9223372041149808919 2260699254358113 16633703033876548223 + f16 651499999612032 9223372041149808919 2269392135520353 16634527534151404159 + f16 651534090914944 9223372041149808919 4512395854616673 16849855822347143807 + f16 651508320603264 9223372041149808919 144115463122587681 17495841010148215423 + f16 638417260285056 9223372041149808919 144126251915808801 17498406261054016127 + f16 639405908069504 9223372041149808919 146930006563504161 17502927452783872639 + f16 704273035871232 9223372041149808919 576460822369288225 17854728228378086015 + f16 638817734280192 9223372041149808919 576548988112617505 17860389699564964479 + f16 637897269101568 9223372041149808919 598979025322381345 17864910891461937791 + f16 651508205266944 9223372041149808919 1152921540308894241 17926504347254033023 + f16 638417144948736 9223372041149808919 1153009474127528481 17932447246340754047 + f16 639405792733184 9223372041149808919 1175439511333767201 17936968438070610559 + f16 637889484948480 9223372041149808919 1733903448992120929 17940064761983830655 + f16 704272916340864 9223372041149808919 4611686027185621025 18285378319804762751 + f16 638817614749824 9223372041149808919 4611697047903537185 18291039790991641215 + f16 637897149571200 9223372041149808919 4614500802554757665 18295560982888614527 +bucket b8c7f 35967 + f16 651508320717056 9223372041149808919 288230513793044545 17639393256860585087 + f16 638417260398848 9223372041149808919 288243639012823105 17642523648119573631 + f16 639405908183296 9223372041149808919 291608144592773185 17647044839882853503 + f16 704273035952512 9223372041149808919 576460821830312001 17854726029321145471 + f16 638817734361472 9223372041149808919 576513666301567041 17859826741021478015 + f16 637897269182848 9223372041149808919 589971688626589761 17864347932885027967 + f16 651508206274816 9223372041149808919 1152921539772154945 17926502148264463487 + f16 638417145956608 9223372041149808919 1152974298345374785 17931884304977398911 + f16 639405793741056 9223372041149808919 1166432320669091905 17936405496740678783 + f16 704272917348736 9223372041149808919 2305843026595416129 18141826090272263295 + f16 638817615757696 9223372041149808919 2305856237713229889 18146926801972595839 + f16 637897150579072 9223372041149808919 2309220743294485569 18151447993836145791 +bucket b8f7f 36735 + f16 915485737372800 9223372041149808919 72057688535629953 17422391498915090303 + f16 653664531008640 9223372041149808919 72058143795216513 17424049433399431039 + f16 651550870228096 9223372041149808919 72058143802136193 17424055978693922687 + f16 639924365722624 9223372041149808919 144115278274379905 17494449088641208191 + f16 845017644041216 9223372041149808919 144115462955155585 17495825552443805567 + f16 845529013584896 9223372041149808919 144115462957962625 17495830998243446655 + f16 639924365820160 9223372041149808919 288230457758195841 17638562077660123007 + f16 845017644138752 9223372041149808919 288230513591918721 17639377781976174463 + f16 845529013682432 9223372041149808919 288230513592767361 17639381037309071231 + f16 639407250278656 9223372041149808919 504403226986025089 17650435733742718847 + f16 703967019483520 9223372041149808919 576460821024006273 17854706121912848255 + f16 704273841209728 9223372041149808919 576460821037584513 17854712783641808767 + f16 638818539618688 9223372041149808919 576461714377150593 17856435847161220991 + f16 639924374143232 9223372041149808919 1152921534672144513 17925666553837621119 + f16 845017652461824 9223372041149808919 1152921538967046273 17926477860174270335 + f16 845529022005504 9223372041149808919 1152921538967111553 17926481098327560063 + f16 639407125432576 9223372041149808919 1369094303900763265 17938666092647190399 + f16 639407124424704 9223372041149808919 1513209483386552961 17939229033976991615 + f16 633456808166400 9223372041149808919 1585267073129447809 17939230129176809343 + f16 703966894637440 9223372041149808919 2305843026393876609 18141806200110944127 + f16 704273716363648 9223372041149808919 2305843026406671489 18141817259819306879 + f16 638818414772608 9223372041149808919 2305843868207416449 18144666206065692543 + f16 703966893629568 9223372041149808919 4611686027017496705 18285356239176568703 + f16 704273715355776 9223372041149808919 4611686027028333185 18285369489351675775 + f16 638818413764736 9223372041149808919 4611686739982025345 18288779195084607359 + f16 633456810280064 9223372041149808919 7493990329708740737 18301493977815093119 + f16 651533822462976 9223372041149808919 9223372041149835393 18357131254431190911 + f16 651465639857152 9223372041149808919 9223372041156559233 18357144508901199743 + f16 634010892766208 9223372041149808919 9223372483531440513 18360555314128981887 + f16 640513080609920 9223372041149808919 12105676073254011009 18373551567541211007 + f16 640513080707456 9223372041149808919 14411518945026646145 18374114508871012223 + f16 640513089030528 9223372041149808919 16140901098856122497 18374118889670283135 +bucket b917f 37247 + d16Plus 36453758683652352 9223372041149808919 36029896547374849 17280505939594744191 + f16 582745793364224 9223372041149808919 564222337483521 16415844700488110463 + f16 844566999728384 9223372041149808919 633318716998401 16419192592783282559 + f16 582745793266688 9223372041149808919 1127309192987905 16559962087553798527 + f16 844566999630848 9223372041149808919 1161084300428545 16562744839495782783 + f16 582745730843648 9223372041149808919 4505111590080769 16848192480818532735 + f16 844566937207808 9223372041149808919 4512395743465729 16849849315808022911 + f16 580615557088256 9223372041149808919 6193549016072449 16854127665959833983 + f16 642670352141312 9223372041149808919 36029898275455233 17280519280334377343 + f16 633942978595840 9223372041149808919 36143146245062913 17283930085562159487 + f16 636073152351232 9223372041149808919 468383157473775873 17650433595083886975 + f16 636073214774272 9223372041149808919 1333100674610627841 17938663988482314623 + f16 636073214871808 9223372041149808919 1477251047595442945 17939226947059093887 +bucket b927f 37503 + f16 638425452268672 9223372041149808919 2253483709302273 16632020781086577279 + f16 651516512586880 9223372041149808919 2269392025421313 16634520962851967615 + f16 638425516772480 9223372041149808919 9008986028249601 16920251174351311487 + f16 651516577090688 9223372041149808919 9011597328519681 16921625439164207743 + f16 639421888367744 9223372041149808919 11823048550269441 16926466734974407295 + f16 704289016169472 9223372041149808919 36029897939894785 17280519276022567551 + f16 638833714578432 9223372041149808919 36121156012491265 17283928981755499135 + f16 637906058265600 9223372041149808919 396321165322228225 17650152115795432063 + f16 637905997923328 9223372041149808919 1261025488118220289 17938382509193859711 +bucket b947f 38015 + f16 638425516886272 9223372041149808919 18016322688390145 17064366370983548031 + f16 651516577204480 9223372041149808919 18016597562102785 17065177677320197247 + f16 639421888481536 9223372041149808919 21393197758424065 17070584122073388159 + f16 704289016250752 9223372041149808919 36029897369461761 17280517076965627007 + f16 638833714659712 9223372041149808919 36083772617139201 17283366023212012671 + f16 637906058346880 9223372041149808919 252203778189562881 17506036919096087679 +bucket b977f 38783 + f16 915485471034496 9223372041149808919 4504725043054593 16848182546559571839 + f16 653664264670336 9223372041149808919 4512395737597953 16849849277002717055 + f16 639916908250112 9223372041149808919 9008320308332545 16920240136285689727 + f16 845010186568704 9223372041149808919 9011597318375425 16921625396047091583 + f16 639916908347648 9223372041149808919 18015510939576321 17064353125304604543 + f16 845010186666240 9223372041149808919 18016597549721601 17065177625579460479 + f16 639421898885376 9223372041149808919 31526296920004609 17071714420026546047 + f16 703979803722112 9223372041149808919 36029896547428353 17280505965516134271 + f16 704289022493056 9223372041149808919 36029896765478913 17280512661739050879 + f16 638833720902016 9223372041149808919 36044190198536193 17282235725258463103 + f16 633473589593216 9223372041149808919 6953566620887320577 18301485216216029055 + f16 640505623137408 9223372041149808919 11565248241201072129 18373542805942146943 + f16 640505623234944 9223372041149808919 13871089051357947905 18374105747271948159 +bucket b9b7f 39807 + f16 915485535538304 9223372041149808919 1127077264793601 16559956568521481087 + f16 653664329174144 9223372041149808919 1161084296929281 16562744817937718143 + f16 639916845827072 9223372041149808919 2252972608217089 16632014158247598975 + f16 845010124145664 9223372041149808919 2269392017645569 16634520936982092671 + f16 633473654097024 9223372041149808919 5224210752658776065 18300359333556165503 + f16 640505560714368 9223372041149808919 9835879178631667713 18372416923282283391 +bucket b9d7f 40319 + f16 915485535652096 9223372041149808919 564136438185985 16415841389069114751 + f16 653664329287936 9223372041149808919 633318715736065 16419192579848838527 + f16 633473654210816 9223372041149808919 2918402928354050049 18156244154103799167 +bucket ba17f 41343 + d16Plus 36451065470722304 9223372041149808919 422212483350529 16203864222665449855 + f16 581143502127360 9223372041149808919 283846872596481 16200516343305511295 + f16 581143502029824 9223372041149808919 286182798065665 16201081492248764799 + f16 581143439606784 9223372041149808919 299479614947329 16202207409268629887 + f16 581126926631936 9223372041149808919 305664257753089 16202216239621120383 + f16 642840808655872 9223372041149808919 422214218350593 16203877494417170815 + f16 634045252504576 9223372041149808919 29414135091494913 17071711185917616511 + f16 634061765479424 9223372041149808919 434738101664940033 17650423738134995327 + f16 634061827902464 9223372041149808919 1306184629962997761 17938658512400064895 + f16 634061828000000 9223372041149808919 1459307017830334465 17939223661410165119 +bucket ba27f 41599 + f16 640470930443392 9223372041149808919 290855454113793 16201364066720326271 + f16 640470994947200 9223372041149808919 317346611855361 16202489983740191359 + f16 640478718758016 9223372041149808919 327654486179841 16202498814109393535 + f16 705925398709248 9223372041149808919 422213878677505 16203877490105361023 + f16 639958727574528 9223372041149808919 23784635553153025 17071428611429212799 + f16 639951536440320 9223372041149808919 361554607653126145 17650141163629879935 + f16 639951476098048 9223372041149808919 1229623436029329409 17938375937894949503 +bucket ba47f 42111 + f16 640470995060992 9223372041149808919 352668389474305 16203052942249993343 + f16 640478718871808 9223372041149808919 365037879558145 16203061772652618879 + f16 705925398790528 9223372041149808919 422213306286081 16203875291048420479 + f16 639958727655808 9223372041149808919 14214486343024641 16927311224329970815 + f16 639951536521600 9223372041149808919 216876469590425601 17506023776497214591 +bucket ba77f 42879 + f16 915383197125760 9223372041149808919 299093075689473 16202197475009668991 + f16 637871430075392 9223372041149808919 316680895463425 16202478945674569599 + f16 637871430172928 9223372041149808919 351856641966081 16203039696571049855 + f16 640478729275648 9223372041149808919 404620297371649 16203066187878803327 + f16 705923007988096 9223372041149808919 422212497047553 16203864248586839935 + f16 705925405032832 9223372041149808919 422212701519873 16203870875821844351 + f16 639958733898112 9223372041149808919 4081387180654593 16637954948271220607 + f16 635553159070848 9223372041149808919 6919921565086253057 18301475359267137407 + f16 638460144962688 9223372041149808919 11530481683535495169 18373531853776594815 + f16 638460145060224 9223372041149808919 13835761742760116225 18374092604673075071 +bucket bab7f 43903 + f16 915383261629568 9223372041149808919 285950879989761 16201075973216447359 + f16 637871367652352 9223372041149808919 290344358903809 16201357443881347967 + f16 635553223574656 9223372041149808919 5197294708021264385 18300353857473915775 + f16 638460082539648 9223372041149808919 9804477126548652033 18372410351983373183 +bucket bad7f 44415 + f16 915383261743360 9223372041149808919 283760985636865 16200513031886515583 + f16 635553223688448 9223372041149808919 2900458898601279489 18156240868454870399 +bucket bb37f 45951 + f16 915390985440384 9223372041149808919 282858660823041 16199674095891559295 + f16 637854854677504 9223372041149808919 283128908218369 16199675191091377023 + f16 635560947385472 9223372041149808919 4791970741715206145 18298951980149027711 + f16 638443569564800 9223372041149808919 9331599165769121793 18370728099193402239 +bucket bb57f 46463 + f16 915390985554176 9223372041149808919 282730382229505 16199671905491793279 + f16 635560947499264 9223372041149808919 2630242921147793409 18155399742060148095 +bucket bb97f 47487 + f16 915390995958016 9223372041149808919 282679446601729 16199668619842075007 + f16 635560957903104 9223372041149808919 1765551793296637953 17940071384876759423 +bucket bbf7f 49023 + d16Plus 36036515227312384 9223372041149808919 282675420069889 16199668607058296703 + d16Plus 36170086419038336 9223372041149808919 16753531353454084097 18374119097041403775 + f16 849924671488384 9223372041149808919 283573068234753 16199675242934157183 + f16 849927068533120 9223372041149808919 296973366198273 16201371815095287679 + f16 849927062290816 9223372041149808919 336607324405761 16202502113098776447 + f16 849927062209536 9223372041149808919 374119568769025 16203065071675555711 + f16 655931868974080 9223372041149808919 396380384264193 16203066175498862463 + f16 849415698989440 9223372041149808919 3941854412275713 16637954884251402111 + f16 849415692747136 9223372041149808919 14075005113466881 16927311160360091519 + f16 849415692665856 9223372041149808919 23645283170648065 17071428547492626303 + f16 655863686368256 9223372041149808919 29275053287800833 17071711121997676415 + f16 849408501612928 9223372041149808919 216738019137290241 17506023725311770495 + f16 849408501531648 9223372041149808919 361418347599888385 17650141121000685439 + f16 655880199343104 9223372041149808919 434606235296202753 17650423699783925631 + f16 849408441189376 9223372041149808919 1229500318375477249 17938375912311668607 + f16 655880261766144 9223372041149808919 1306079099931852801 17938658491094908799 + f16 655880261863680 9223372041149808919 1459236663044603905 17939223648627965823 + f16 849959297548544 9223372041149808919 1693494199527145473 17939230336648986495 + f16 849961161916672 9223372041149808919 1761048193937702913 17940068134343917439 + f16 849381609767168 9223372041149808919 1765534201379028993 17940071372497207167 + f16 849961151512832 9223372041149808919 2615606223231254529 18155396474280591231 + f16 849381599363328 9223372041149808919 2630185747415564289 18155399729613487999 + f16 849373875552512 9223372041149808919 2900389355551981569 18156240855873994623 + f16 849961151399040 9223372041149808919 4767763895160930305 18298946513346215807 + f16 849381599249536 9223372041149808919 4791876185158057985 18298951959145856895 + f16 849373875438720 9223372041149808919 5197189843699892225 18300353836336529279 + f16 849373810934912 9223372041149808919 6919790209810825217 18301475321016729471 + f16 655966499261568 9223372041149808919 9301762820016177153 18370721528600838015 + f16 655898316655744 9223372041149808919 9331482619314962433 18370728073895329663 + f16 655914829630592 9223372041149808919 9804354395435958273 18372410326551084927 + f16 655914892053632 9223372041149808919 11530345655406952449 18373531811231285119 + f16 655914892151168 9223372041149808919 13835623378205016065 18374092553537961855 +end_normalized_weight_sixteen_candidates + +end CryptBoolean diff --git a/lakefile.lean b/lakefile.lean index 6ed00aa..5606c82 100644 --- a/lakefile.lean +++ b/lakefile.lean @@ -1,6 +1,6 @@ import Lake -open Lake DSL System +open Lake DSL require FABL from git "https://github.com/Polarnova/FABL.git" @ "v0.5.6" @@ -14,34 +14,5 @@ package CryptBooleanFunction where ⟨`weak.linter.mathlibStandardSet, true⟩ ] -input_file normalizedWeightSixteenCandidateGenerator where - path := "scripts/generate_normalized_weight_sixteen_candidates.py" - text := true - -input_file rankSevenWeightSixteenPatterns where - path := - "CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteen/RankSevenPatterns.lean" - text := true - -/-- Reconstruct the generated finite certificate table before Lean scans its imports. -/ -target normalizedWeightSixteenCandidates pkg : FilePath := do - let generator ← normalizedWeightSixteenCandidateGenerator.fetch - let patterns ← rankSevenWeightSixteenPatterns.fetch - let inputs := generator.zipWith (sync := true) - (fun generatorPath patternsPath => (generatorPath, patternsPath)) patterns - let output := pkg.dir / - "CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteen/NormalizedCandidates.lean" - inputs.mapM fun (generatorPath, _patternsPath) => do - let traceFile := pkg.buildDir / "normalized-weight-sixteen-candidates.trace" - buildUnlessUpToDate output (← getTrace) traceFile do - proc { - cmd := if Platform.isWindows then "python" else "python3" - args := #[generatorPath.toString, "--lean-output", output.toString, - "--timeout-seconds", "60"] - cwd := some pkg.dir - } (quiet := true) - return output - @[default_target] lean_lib CryptBoolean where - needs := #[normalizedWeightSixteenCandidates] diff --git a/scripts/generate_normalized_weight_sixteen_candidates.py b/scripts/generate_normalized_weight_sixteen_candidates.py index 63f6f41..cecf805 100644 --- a/scripts/generate_normalized_weight_sixteen_candidates.py +++ b/scripts/generate_normalized_weight_sixteen_candidates.py @@ -38,6 +38,7 @@ module public import CryptBoolean.Carlet.Chapter04.HigherOrderOrderTwoWeightSixteen.RankSevenPatterns +import Lean.Elab.Command /-! # Generated normalized weight-sixteen candidates @@ -52,6 +53,8 @@ namespace CryptBoolean +open Lean Elab Command + /-- One normalized-pattern certificate. The affine code stores the source origin in its low seven bits, followed by the seven rows of the normalizing linear map. -/ structure NormalizedWeightSixteenCandidate where @@ -85,6 +88,130 @@ def containsSystematicCode : end NormalizedWeightSixteenCandidateTree +declare_syntax_cat normalizedWeightSixteenCandidateRow +local syntax (name := normalizedWeightSixteenCandidateRowSyntax) + ident num num num num : normalizedWeightSixteenCandidateRow + +declare_syntax_cat normalizedWeightSixteenCandidateBucket +local syntax (name := normalizedWeightSixteenCandidateBucketSyntax) + "bucket" ident num normalizedWeightSixteenCandidateRow* : + normalizedWeightSixteenCandidateBucket + +local syntax (name := normalizedWeightSixteenCandidatesCommand) + "normalized_weight_sixteen_candidates" normalizedWeightSixteenCandidateBucket* + "end_normalized_weight_sixteen_candidates" : command + +private meta def normalizedWeightSixteenCandidateTerm + (row : TSyntax `normalizedWeightSixteenCandidateRow) : + CommandElabM (TSyntax `term) := do + match row with + | `(normalizedWeightSixteenCandidateRowSyntax| + $patternClass:ident $affineCode:num $maskLow:num $maskHigh:num + $systematicCode:num) => + let patternClassName := + `CryptBoolean.RankSevenWeightSixteenPatternClass ++ patternClass.getId + `(term| + { patternClass := $(mkIdent patternClassName):ident + affineCode := BitVec.ofNat 56 $affineCode + maskLow := BitVec.ofNat 64 $maskLow + maskHigh := BitVec.ofNat 64 $maskHigh + systematicCode := BitVec.ofNat 64 $systematicCode }) + | _ => throwUnsupportedSyntax + +private meta def normalizedWeightSixteenCandidateTreeTerm + (rows : Array (TSyntax `term)) : CommandElabM (TSyntax `term) := do + let rec loop (fuel : Nat) (current : Array (TSyntax `term)) : + CommandElabM (TSyntax `term) := do + if current.isEmpty then + throwError "a normalized candidate bucket must be nonempty" + else if current.size = 1 then + `(term| NormalizedWeightSixteenCandidateTree.leaf $(current[0]!)) + else + match fuel with + | 0 => throwError "candidate-tree elaboration exhausted its structural bound" + | fuel + 1 => + let midpoint := current.size / 2 + let left ← loop fuel (current.extract 0 midpoint) + let right ← loop fuel (current.extract midpoint current.size) + `(term| NormalizedWeightSixteenCandidateTree.node $left $right) + loop rows.size rows + +private structure NormalizedWeightSixteenBucketData where + codePrefix : TSyntax `num + codePrefixValue : Nat + declarationName : TSyntax `ident + +private meta def elaborateNormalizedWeightSixteenCandidateBucket + (bucketSyntax : TSyntax `normalizedWeightSixteenCandidateBucket) : + CommandElabM NormalizedWeightSixteenBucketData := do + match bucketSyntax with + | `(normalizedWeightSixteenCandidateBucketSyntax| + bucket $label:ident $codePrefixSyntax:num + $rows:normalizedWeightSixteenCandidateRow*) => + let suffix := label.getId.toString.drop 1 + let declarationName := mkIdent <| + Name.mkSimple s!"normalizedWeightSixteenCandidateBucket_{suffix}" + let candidates ← rows.mapM normalizedWeightSixteenCandidateTerm + let tree ← normalizedWeightSixteenCandidateTreeTerm candidates + elabCommand <| ← `(command| + def $declarationName : NormalizedWeightSixteenCandidateTree := $tree) + pure ⟨codePrefixSyntax, codePrefixSyntax.getNat, declarationName⟩ + | _ => throwUnsupportedSyntax + +private meta def validateNormalizedWeightSixteenBucketOrder + (buckets : Array NormalizedWeightSixteenBucketData) : CommandElabM Unit := do + let rec loop (previous : Option Nat) : + List NormalizedWeightSixteenBucketData → CommandElabM Unit + | [] => pure () + | bucketData :: rest => do + if let some previousPrefix := previous then + unless previousPrefix < bucketData.codePrefixValue do + throwErrorAt bucketData.codePrefix + "candidate bucket prefixes must be strictly increasing" + loop (some bucketData.codePrefixValue) rest + loop none buckets.toList + +private meta def normalizedWeightSixteenCandidateDispatcherTerm + (buckets : Array NormalizedWeightSixteenBucketData) : + CommandElabM (TSyntax `term) := do + let rec loop (fuel : Nat) (current : Array NormalizedWeightSixteenBucketData) : + CommandElabM (TSyntax `term) := do + if current.isEmpty then + `(term| none) + else + match fuel with + | 0 => throwError "candidate-dispatch elaboration exhausted its structural bound" + | fuel + 1 => + let midpoint := current.size / 2 + let some bucketData := current[midpoint]? + | throwError "candidate-dispatch midpoint is out of bounds" + let left ← loop fuel (current.extract 0 midpoint) + let right ← loop fuel (current.extract (midpoint + 1) current.size) + `(term| + if codePrefix.toNat < $(bucketData.codePrefix) then + $left + else if codePrefix.toNat = $(bucketData.codePrefix) then + some $(bucketData.declarationName) + else + $right) + loop buckets.size buckets + +local elab_rules : command + | `(command| normalized_weight_sixteen_candidates + $buckets:normalizedWeightSixteenCandidateBucket* + end_normalized_weight_sixteen_candidates) => do + let bucketData ← + buckets.mapM elaborateNormalizedWeightSixteenCandidateBucket + validateNormalizedWeightSixteenBucketOrder bucketData + let dispatcher ← + normalizedWeightSixteenCandidateDispatcherTerm bucketData + let dispatcherName := mkIdent <| + Name.mkSimple "normalizedWeightSixteenCandidateBucket" + elabCommand <| ← `(command| + def $dispatcherName (codePrefix : BitVec 16) : + Option NormalizedWeightSixteenCandidateTree := + $dispatcher) + """ @@ -288,64 +415,27 @@ def validate_candidates(candidates: Sequence[Candidate]) -> tuple[str, dict[int, return digest, buckets -def render_candidate_tree( - candidates: Sequence[Candidate], - indent: int, - lines: list[str], - deadline: Deadline, -) -> None: - deadline.check("Lean candidate tree rendering") - spaces = " " * indent - if len(candidates) == 1: - candidate = candidates[0] - lines.extend( - ( - f"{spaces}(.leaf", - f"{spaces} {{ patternClass := .{candidate.pattern_class}", - f"{spaces} affineCode := BitVec.ofNat 56 {candidate.affine_code}", - f"{spaces} maskLow := BitVec.ofNat 64 {candidate.mask_low}", - f"{spaces} maskHigh := BitVec.ofNat 64 {candidate.mask_high}", - f"{spaces} systematicCode := BitVec.ofNat 64 {candidate.systematic_code} }})", - ) - ) - return - midpoint = len(candidates) // 2 - lines.append(f"{spaces}(.node") - render_candidate_tree(candidates[:midpoint], indent + 2, lines, deadline) - render_candidate_tree(candidates[midpoint:], indent + 2, lines, deadline) - lines.append(f"{spaces})") - - def render_lean( buckets: dict[int, list[Candidate]], deadline: Deadline ) -> bytes: - lines = [LEAN_PREAMBLE.rstrip("\n")] + lines = [LEAN_PREAMBLE.rstrip("\n"), "normalized_weight_sixteen_candidates"] for prefix in sorted(buckets): deadline.check("Lean bucket rendering") - suffix = f"{prefix:04x}" - lines.extend( - ( - "", - f"/-- Generated candidate shard for systematic prefix 0x{suffix}. -/", - f"def normalizedWeightSixteenCandidateBucket_{suffix} :", - " NormalizedWeightSixteenCandidateTree :=", + lines.append(f"bucket b{prefix:04x} {prefix}") + for candidate in buckets[prefix]: + lines.append( + " " + f"{candidate.pattern_class} {candidate.affine_code} " + f"{candidate.mask_low} {candidate.mask_high} " + f"{candidate.systematic_code}" ) - ) - render_candidate_tree(buckets[prefix], 2, lines, deadline) lines.extend( ( + "end_normalized_weight_sixteen_candidates", "", - "/-- Select the generated candidate shard determined by the first two sorted columns. -/", - "def normalizedWeightSixteenCandidateBucket (codePrefix : BitVec 16) :", - " Option NormalizedWeightSixteenCandidateTree :=", - " match codePrefix.toNat with", + "end CryptBoolean", ) ) - for prefix in sorted(buckets): - lines.append( - f" | {prefix} => some normalizedWeightSixteenCandidateBucket_{prefix:04x}" - ) - lines.extend((" | _ => none", "", "end CryptBoolean")) return ("\n".join(lines) + "\n").encode("utf-8") @@ -359,7 +449,8 @@ def atomic_write(path: Path, content: bytes, deadline: Deadline) -> None: ) temporary_path = Path(temporary_name) try: - os.fchmod(descriptor, 0o644) + if hasattr(os, "fchmod"): + os.fchmod(descriptor, 0o644) with os.fdopen(descriptor, "wb") as output: output.write(content) output.flush() @@ -401,7 +492,9 @@ def run(argv: Sequence[str]) -> int: if arguments.check is not None: deadline.check("Lean output check") actual = arguments.check.read_bytes() - if actual != lean: + actual_canonical = actual.replace(b"\r\n", b"\n") + deadline.check("Lean output check") + if actual_canonical != lean: actual_digest = hashlib.sha256(actual).hexdigest() expected_digest = hashlib.sha256(lean).hexdigest() raise GenerationError( From dd260991b9bcadb4ba721bb77c9b46c0d9a192db Mon Sep 17 00:00:00 2001 From: Asher Yan Date: Thu, 23 Jul 2026 11:33:35 -0400 Subject: [PATCH 5/7] Scope generated heartbeat lint exemptions --- .../HigherOrderOrderTwoWeightSixteen/CandidateCertificates.lean | 1 + .../HigherOrderOrderTwoWeightSixteen/CandidateSoundness.lean | 1 + 2 files changed, 2 insertions(+) diff --git a/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteen/CandidateCertificates.lean b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteen/CandidateCertificates.lean index 9c917d7..9d78cc1 100644 --- a/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteen/CandidateCertificates.lean +++ b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteen/CandidateCertificates.lean @@ -27,6 +27,7 @@ local syntax (name := normalizedWeightSixteenCertificatesCommand) "normalized_weight_sixteen_certificates" ident "where" normalizedWeightSixteenCertificateRow* : command +set_option linter.style.maxHeartbeats false in local macro_rules | `(command| normalized_weight_sixteen_certificates $soundnessName:ident where diff --git a/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteen/CandidateSoundness.lean b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteen/CandidateSoundness.lean index 8ab38b5..3e5a89b 100644 --- a/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteen/CandidateSoundness.lean +++ b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteen/CandidateSoundness.lean @@ -425,6 +425,7 @@ def HasNormalizedWeightSixteenCompactCandidateSoundness : Prop := /-- Declare a kernel-reduced compact-mask certificate for one generated candidate tree while keeping each certificate as an independent declaration. -/ +set_option linter.style.maxHeartbeats false in macro "compact_mask_soundness " theoremName:ident " for " tree:term : command => `(command| set_option Elab.async true in From 6c979808ce0d66b8dbf37294256a003e0d8856a3 Mon Sep 17 00:00:00 2001 From: Asher Yan Date: Thu, 23 Jul 2026 11:35:01 -0400 Subject: [PATCH 6/7] Attach generated macro lint scope --- .../HigherOrderOrderTwoWeightSixteen/CandidateSoundness.lean | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteen/CandidateSoundness.lean b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteen/CandidateSoundness.lean index 3e5a89b..9e8b567 100644 --- a/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteen/CandidateSoundness.lean +++ b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteen/CandidateSoundness.lean @@ -423,9 +423,9 @@ def HasNormalizedWeightSixteenCompactCandidateSoundness : Prop := ∃ candidate : NormalizedWeightSixteenCandidate, candidate.systematicCode = code ∧ candidate.IsCompactMaskSound +set_option linter.style.maxHeartbeats false in /-- Declare a kernel-reduced compact-mask certificate for one generated candidate tree while keeping each certificate as an independent declaration. -/ -set_option linter.style.maxHeartbeats false in macro "compact_mask_soundness " theoremName:ident " for " tree:term : command => `(command| set_option Elab.async true in From 54ae2d56f6532cdf89e6dccb12b555f300372e71 Mon Sep 17 00:00:00 2001 From: Asher Yan Date: Thu, 23 Jul 2026 12:02:02 -0400 Subject: [PATCH 7/7] Derive weight-sixteen certificate names --- .../CandidateCertificates.lean | 561 +++++++++--------- 1 file changed, 281 insertions(+), 280 deletions(-) diff --git a/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteen/CandidateCertificates.lean b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteen/CandidateCertificates.lean index 9d78cc1..47e3dd8 100644 --- a/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteen/CandidateCertificates.lean +++ b/CryptBoolean/Carlet/Chapter04/HigherOrderOrderTwoWeightSixteen/CandidateCertificates.lean @@ -21,7 +21,7 @@ theorem. namespace CryptBoolean syntax normalizedWeightSixteenCertificateRow := - "|" term "," ident "," ident + "|" term "," ident local syntax (name := normalizedWeightSixteenCertificatesCommand) "normalized_weight_sixteen_certificates" ident "where" @@ -34,8 +34,9 @@ local macro_rules $[$rows:normalizedWeightSixteenCertificateRow]*) => do let generated ← rows.mapM fun row => do let `(normalizedWeightSixteenCertificateRow| - | $bucketPrefix:term, $tree:ident, $proofName:ident) := row + | $bucketPrefix:term, $tree:ident) := row | Lean.Macro.throwUnsupported + let proofName := Lean.mkIdent <| tree.getId.appendAfter "_compact" let declaration ← `(command| compact_mask_soundness $proofName for $tree) let branch ← `(tactic| @@ -80,283 +81,283 @@ local macro_rules normalized_weight_sixteen_certificates normalizedWeightSixteenCompactCandidateSoundness where - | 2823, normalizedWeightSixteenCandidateBucket_0b07, normalizedWeightSixteenCandidateBucket_0b07_compact - | 3335, normalizedWeightSixteenCandidateBucket_0d07, normalizedWeightSixteenCandidateBucket_0d07_compact - | 3339, normalizedWeightSixteenCandidateBucket_0d0b, normalizedWeightSixteenCandidateBucket_0d0b_compact - | 3591, normalizedWeightSixteenCandidateBucket_0e07, normalizedWeightSixteenCandidateBucket_0e07_compact - | 3595, normalizedWeightSixteenCandidateBucket_0e0b, normalizedWeightSixteenCandidateBucket_0e0b_compact - | 3597, normalizedWeightSixteenCandidateBucket_0e0d, normalizedWeightSixteenCandidateBucket_0e0d_compact - | 4871, normalizedWeightSixteenCandidateBucket_1307, normalizedWeightSixteenCandidateBucket_1307_compact - | 4875, normalizedWeightSixteenCandidateBucket_130b, normalizedWeightSixteenCandidateBucket_130b_compact - | 5383, normalizedWeightSixteenCandidateBucket_1507, normalizedWeightSixteenCandidateBucket_1507_compact - | 5389, normalizedWeightSixteenCandidateBucket_150d, normalizedWeightSixteenCandidateBucket_150d_compact - | 5395, normalizedWeightSixteenCandidateBucket_1513, normalizedWeightSixteenCandidateBucket_1513_compact - | 5639, normalizedWeightSixteenCandidateBucket_1607, normalizedWeightSixteenCandidateBucket_1607_compact - | 5646, normalizedWeightSixteenCandidateBucket_160e, normalizedWeightSixteenCandidateBucket_160e_compact - | 5651, normalizedWeightSixteenCandidateBucket_1613, normalizedWeightSixteenCandidateBucket_1613_compact - | 5653, normalizedWeightSixteenCandidateBucket_1615, normalizedWeightSixteenCandidateBucket_1615_compact - | 6411, normalizedWeightSixteenCandidateBucket_190b, normalizedWeightSixteenCandidateBucket_190b_compact - | 6413, normalizedWeightSixteenCandidateBucket_190d, normalizedWeightSixteenCandidateBucket_190d_compact - | 6419, normalizedWeightSixteenCandidateBucket_1913, normalizedWeightSixteenCandidateBucket_1913_compact - | 6421, normalizedWeightSixteenCandidateBucket_1915, normalizedWeightSixteenCandidateBucket_1915_compact - | 6667, normalizedWeightSixteenCandidateBucket_1a0b, normalizedWeightSixteenCandidateBucket_1a0b_compact - | 6670, normalizedWeightSixteenCandidateBucket_1a0e, normalizedWeightSixteenCandidateBucket_1a0e_compact - | 6675, normalizedWeightSixteenCandidateBucket_1a13, normalizedWeightSixteenCandidateBucket_1a13_compact - | 6678, normalizedWeightSixteenCandidateBucket_1a16, normalizedWeightSixteenCandidateBucket_1a16_compact - | 6681, normalizedWeightSixteenCandidateBucket_1a19, normalizedWeightSixteenCandidateBucket_1a19_compact - | 7181, normalizedWeightSixteenCandidateBucket_1c0d, normalizedWeightSixteenCandidateBucket_1c0d_compact - | 7182, normalizedWeightSixteenCandidateBucket_1c0e, normalizedWeightSixteenCandidateBucket_1c0e_compact - | 7189, normalizedWeightSixteenCandidateBucket_1c15, normalizedWeightSixteenCandidateBucket_1c15_compact - | 7190, normalizedWeightSixteenCandidateBucket_1c16, normalizedWeightSixteenCandidateBucket_1c16_compact - | 7193, normalizedWeightSixteenCandidateBucket_1c19, normalizedWeightSixteenCandidateBucket_1c19_compact - | 7194, normalizedWeightSixteenCandidateBucket_1c1a, normalizedWeightSixteenCandidateBucket_1c1a_compact - | 8967, normalizedWeightSixteenCandidateBucket_2307, normalizedWeightSixteenCandidateBucket_2307_compact - | 8971, normalizedWeightSixteenCandidateBucket_230b, normalizedWeightSixteenCandidateBucket_230b_compact - | 8979, normalizedWeightSixteenCandidateBucket_2313, normalizedWeightSixteenCandidateBucket_2313_compact - | 8988, normalizedWeightSixteenCandidateBucket_231c, normalizedWeightSixteenCandidateBucket_231c_compact - | 8991, normalizedWeightSixteenCandidateBucket_231f, normalizedWeightSixteenCandidateBucket_231f_compact - | 9479, normalizedWeightSixteenCandidateBucket_2507, normalizedWeightSixteenCandidateBucket_2507_compact - | 9485, normalizedWeightSixteenCandidateBucket_250d, normalizedWeightSixteenCandidateBucket_250d_compact - | 9493, normalizedWeightSixteenCandidateBucket_2515, normalizedWeightSixteenCandidateBucket_2515_compact - | 9498, normalizedWeightSixteenCandidateBucket_251a, normalizedWeightSixteenCandidateBucket_251a_compact - | 9503, normalizedWeightSixteenCandidateBucket_251f, normalizedWeightSixteenCandidateBucket_251f_compact - | 9507, normalizedWeightSixteenCandidateBucket_2523, normalizedWeightSixteenCandidateBucket_2523_compact - | 9735, normalizedWeightSixteenCandidateBucket_2607, normalizedWeightSixteenCandidateBucket_2607_compact - | 9742, normalizedWeightSixteenCandidateBucket_260e, normalizedWeightSixteenCandidateBucket_260e_compact - | 9750, normalizedWeightSixteenCandidateBucket_2616, normalizedWeightSixteenCandidateBucket_2616_compact - | 9753, normalizedWeightSixteenCandidateBucket_2619, normalizedWeightSixteenCandidateBucket_2619_compact - | 9759, normalizedWeightSixteenCandidateBucket_261f, normalizedWeightSixteenCandidateBucket_261f_compact - | 9763, normalizedWeightSixteenCandidateBucket_2623, normalizedWeightSixteenCandidateBucket_2623_compact - | 9765, normalizedWeightSixteenCandidateBucket_2625, normalizedWeightSixteenCandidateBucket_2625_compact - | 10507, normalizedWeightSixteenCandidateBucket_290b, normalizedWeightSixteenCandidateBucket_290b_compact - | 10509, normalizedWeightSixteenCandidateBucket_290d, normalizedWeightSixteenCandidateBucket_290d_compact - | 10518, normalizedWeightSixteenCandidateBucket_2916, normalizedWeightSixteenCandidateBucket_2916_compact - | 10521, normalizedWeightSixteenCandidateBucket_2919, normalizedWeightSixteenCandidateBucket_2919_compact - | 10527, normalizedWeightSixteenCandidateBucket_291f, normalizedWeightSixteenCandidateBucket_291f_compact - | 10531, normalizedWeightSixteenCandidateBucket_2923, normalizedWeightSixteenCandidateBucket_2923_compact - | 10533, normalizedWeightSixteenCandidateBucket_2925, normalizedWeightSixteenCandidateBucket_2925_compact - | 10763, normalizedWeightSixteenCandidateBucket_2a0b, normalizedWeightSixteenCandidateBucket_2a0b_compact - | 10766, normalizedWeightSixteenCandidateBucket_2a0e, normalizedWeightSixteenCandidateBucket_2a0e_compact - | 10773, normalizedWeightSixteenCandidateBucket_2a15, normalizedWeightSixteenCandidateBucket_2a15_compact - | 10778, normalizedWeightSixteenCandidateBucket_2a1a, normalizedWeightSixteenCandidateBucket_2a1a_compact - | 10783, normalizedWeightSixteenCandidateBucket_2a1f, normalizedWeightSixteenCandidateBucket_2a1f_compact - | 10787, normalizedWeightSixteenCandidateBucket_2a23, normalizedWeightSixteenCandidateBucket_2a23_compact - | 10790, normalizedWeightSixteenCandidateBucket_2a26, normalizedWeightSixteenCandidateBucket_2a26_compact - | 10793, normalizedWeightSixteenCandidateBucket_2a29, normalizedWeightSixteenCandidateBucket_2a29_compact - | 11277, normalizedWeightSixteenCandidateBucket_2c0d, normalizedWeightSixteenCandidateBucket_2c0d_compact - | 11278, normalizedWeightSixteenCandidateBucket_2c0e, normalizedWeightSixteenCandidateBucket_2c0e_compact - | 11283, normalizedWeightSixteenCandidateBucket_2c13, normalizedWeightSixteenCandidateBucket_2c13_compact - | 11292, normalizedWeightSixteenCandidateBucket_2c1c, normalizedWeightSixteenCandidateBucket_2c1c_compact - | 11295, normalizedWeightSixteenCandidateBucket_2c1f, normalizedWeightSixteenCandidateBucket_2c1f_compact - | 11301, normalizedWeightSixteenCandidateBucket_2c25, normalizedWeightSixteenCandidateBucket_2c25_compact - | 11302, normalizedWeightSixteenCandidateBucket_2c26, normalizedWeightSixteenCandidateBucket_2c26_compact - | 11305, normalizedWeightSixteenCandidateBucket_2c29, normalizedWeightSixteenCandidateBucket_2c29_compact - | 11306, normalizedWeightSixteenCandidateBucket_2c2a, normalizedWeightSixteenCandidateBucket_2c2a_compact - | 12051, normalizedWeightSixteenCandidateBucket_2f13, normalizedWeightSixteenCandidateBucket_2f13_compact - | 12053, normalizedWeightSixteenCandidateBucket_2f15, normalizedWeightSixteenCandidateBucket_2f15_compact - | 12054, normalizedWeightSixteenCandidateBucket_2f16, normalizedWeightSixteenCandidateBucket_2f16_compact - | 12057, normalizedWeightSixteenCandidateBucket_2f19, normalizedWeightSixteenCandidateBucket_2f19_compact - | 12058, normalizedWeightSixteenCandidateBucket_2f1a, normalizedWeightSixteenCandidateBucket_2f1a_compact - | 12060, normalizedWeightSixteenCandidateBucket_2f1c, normalizedWeightSixteenCandidateBucket_2f1c_compact - | 12063, normalizedWeightSixteenCandidateBucket_2f1f, normalizedWeightSixteenCandidateBucket_2f1f_compact - | 12558, normalizedWeightSixteenCandidateBucket_310e, normalizedWeightSixteenCandidateBucket_310e_compact - | 12563, normalizedWeightSixteenCandidateBucket_3113, normalizedWeightSixteenCandidateBucket_3113_compact - | 12565, normalizedWeightSixteenCandidateBucket_3115, normalizedWeightSixteenCandidateBucket_3115_compact - | 12569, normalizedWeightSixteenCandidateBucket_3119, normalizedWeightSixteenCandidateBucket_3119_compact - | 12575, normalizedWeightSixteenCandidateBucket_311f, normalizedWeightSixteenCandidateBucket_311f_compact - | 12579, normalizedWeightSixteenCandidateBucket_3123, normalizedWeightSixteenCandidateBucket_3123_compact - | 12581, normalizedWeightSixteenCandidateBucket_3125, normalizedWeightSixteenCandidateBucket_3125_compact - | 12585, normalizedWeightSixteenCandidateBucket_3129, normalizedWeightSixteenCandidateBucket_3129_compact - | 12591, normalizedWeightSixteenCandidateBucket_312f, normalizedWeightSixteenCandidateBucket_312f_compact - | 12813, normalizedWeightSixteenCandidateBucket_320d, normalizedWeightSixteenCandidateBucket_320d_compact - | 12819, normalizedWeightSixteenCandidateBucket_3213, normalizedWeightSixteenCandidateBucket_3213_compact - | 12822, normalizedWeightSixteenCandidateBucket_3216, normalizedWeightSixteenCandidateBucket_3216_compact - | 12826, normalizedWeightSixteenCandidateBucket_321a, normalizedWeightSixteenCandidateBucket_321a_compact - | 12831, normalizedWeightSixteenCandidateBucket_321f, normalizedWeightSixteenCandidateBucket_321f_compact - | 12835, normalizedWeightSixteenCandidateBucket_3223, normalizedWeightSixteenCandidateBucket_3223_compact - | 12838, normalizedWeightSixteenCandidateBucket_3226, normalizedWeightSixteenCandidateBucket_3226_compact - | 12842, normalizedWeightSixteenCandidateBucket_322a, normalizedWeightSixteenCandidateBucket_322a_compact - | 12847, normalizedWeightSixteenCandidateBucket_322f, normalizedWeightSixteenCandidateBucket_322f_compact - | 12849, normalizedWeightSixteenCandidateBucket_3231, normalizedWeightSixteenCandidateBucket_3231_compact - | 13323, normalizedWeightSixteenCandidateBucket_340b, normalizedWeightSixteenCandidateBucket_340b_compact - | 13333, normalizedWeightSixteenCandidateBucket_3415, normalizedWeightSixteenCandidateBucket_3415_compact - | 13334, normalizedWeightSixteenCandidateBucket_3416, normalizedWeightSixteenCandidateBucket_3416_compact - | 13340, normalizedWeightSixteenCandidateBucket_341c, normalizedWeightSixteenCandidateBucket_341c_compact - | 13343, normalizedWeightSixteenCandidateBucket_341f, normalizedWeightSixteenCandidateBucket_341f_compact - | 13349, normalizedWeightSixteenCandidateBucket_3425, normalizedWeightSixteenCandidateBucket_3425_compact - | 13350, normalizedWeightSixteenCandidateBucket_3426, normalizedWeightSixteenCandidateBucket_3426_compact - | 13356, normalizedWeightSixteenCandidateBucket_342c, normalizedWeightSixteenCandidateBucket_342c_compact - | 13359, normalizedWeightSixteenCandidateBucket_342f, normalizedWeightSixteenCandidateBucket_342f_compact - | 13361, normalizedWeightSixteenCandidateBucket_3431, normalizedWeightSixteenCandidateBucket_3431_compact - | 13362, normalizedWeightSixteenCandidateBucket_3432, normalizedWeightSixteenCandidateBucket_3432_compact - | 14091, normalizedWeightSixteenCandidateBucket_370b, normalizedWeightSixteenCandidateBucket_370b_compact - | 14093, normalizedWeightSixteenCandidateBucket_370d, normalizedWeightSixteenCandidateBucket_370d_compact - | 14094, normalizedWeightSixteenCandidateBucket_370e, normalizedWeightSixteenCandidateBucket_370e_compact - | 14105, normalizedWeightSixteenCandidateBucket_3719, normalizedWeightSixteenCandidateBucket_3719_compact - | 14106, normalizedWeightSixteenCandidateBucket_371a, normalizedWeightSixteenCandidateBucket_371a_compact - | 14108, normalizedWeightSixteenCandidateBucket_371c, normalizedWeightSixteenCandidateBucket_371c_compact - | 14111, normalizedWeightSixteenCandidateBucket_371f, normalizedWeightSixteenCandidateBucket_371f_compact - | 14121, normalizedWeightSixteenCandidateBucket_3729, normalizedWeightSixteenCandidateBucket_3729_compact - | 14122, normalizedWeightSixteenCandidateBucket_372a, normalizedWeightSixteenCandidateBucket_372a_compact - | 14124, normalizedWeightSixteenCandidateBucket_372c, normalizedWeightSixteenCandidateBucket_372c_compact - | 14127, normalizedWeightSixteenCandidateBucket_372f, normalizedWeightSixteenCandidateBucket_372f_compact - | 14343, normalizedWeightSixteenCandidateBucket_3807, normalizedWeightSixteenCandidateBucket_3807_compact - | 14361, normalizedWeightSixteenCandidateBucket_3819, normalizedWeightSixteenCandidateBucket_3819_compact - | 14362, normalizedWeightSixteenCandidateBucket_381a, normalizedWeightSixteenCandidateBucket_381a_compact - | 14364, normalizedWeightSixteenCandidateBucket_381c, normalizedWeightSixteenCandidateBucket_381c_compact - | 14367, normalizedWeightSixteenCandidateBucket_381f, normalizedWeightSixteenCandidateBucket_381f_compact - | 14377, normalizedWeightSixteenCandidateBucket_3829, normalizedWeightSixteenCandidateBucket_3829_compact - | 14378, normalizedWeightSixteenCandidateBucket_382a, normalizedWeightSixteenCandidateBucket_382a_compact - | 14380, normalizedWeightSixteenCandidateBucket_382c, normalizedWeightSixteenCandidateBucket_382c_compact - | 14383, normalizedWeightSixteenCandidateBucket_382f, normalizedWeightSixteenCandidateBucket_382f_compact - | 14385, normalizedWeightSixteenCandidateBucket_3831, normalizedWeightSixteenCandidateBucket_3831_compact - | 14386, normalizedWeightSixteenCandidateBucket_3832, normalizedWeightSixteenCandidateBucket_3832_compact - | 14388, normalizedWeightSixteenCandidateBucket_3834, normalizedWeightSixteenCandidateBucket_3834_compact - | 14391, normalizedWeightSixteenCandidateBucket_3837, normalizedWeightSixteenCandidateBucket_3837_compact - | 15111, normalizedWeightSixteenCandidateBucket_3b07, normalizedWeightSixteenCandidateBucket_3b07_compact - | 15117, normalizedWeightSixteenCandidateBucket_3b0d, normalizedWeightSixteenCandidateBucket_3b0d_compact - | 15118, normalizedWeightSixteenCandidateBucket_3b0e, normalizedWeightSixteenCandidateBucket_3b0e_compact - | 15125, normalizedWeightSixteenCandidateBucket_3b15, normalizedWeightSixteenCandidateBucket_3b15_compact - | 15126, normalizedWeightSixteenCandidateBucket_3b16, normalizedWeightSixteenCandidateBucket_3b16_compact - | 15132, normalizedWeightSixteenCandidateBucket_3b1c, normalizedWeightSixteenCandidateBucket_3b1c_compact - | 15135, normalizedWeightSixteenCandidateBucket_3b1f, normalizedWeightSixteenCandidateBucket_3b1f_compact - | 15141, normalizedWeightSixteenCandidateBucket_3b25, normalizedWeightSixteenCandidateBucket_3b25_compact - | 15142, normalizedWeightSixteenCandidateBucket_3b26, normalizedWeightSixteenCandidateBucket_3b26_compact - | 15148, normalizedWeightSixteenCandidateBucket_3b2c, normalizedWeightSixteenCandidateBucket_3b2c_compact - | 15151, normalizedWeightSixteenCandidateBucket_3b2f, normalizedWeightSixteenCandidateBucket_3b2f_compact - | 15156, normalizedWeightSixteenCandidateBucket_3b34, normalizedWeightSixteenCandidateBucket_3b34_compact - | 15159, normalizedWeightSixteenCandidateBucket_3b37, normalizedWeightSixteenCandidateBucket_3b37_compact - | 15623, normalizedWeightSixteenCandidateBucket_3d07, normalizedWeightSixteenCandidateBucket_3d07_compact - | 15627, normalizedWeightSixteenCandidateBucket_3d0b, normalizedWeightSixteenCandidateBucket_3d0b_compact - | 15630, normalizedWeightSixteenCandidateBucket_3d0e, normalizedWeightSixteenCandidateBucket_3d0e_compact - | 15635, normalizedWeightSixteenCandidateBucket_3d13, normalizedWeightSixteenCandidateBucket_3d13_compact - | 15638, normalizedWeightSixteenCandidateBucket_3d16, normalizedWeightSixteenCandidateBucket_3d16_compact - | 15642, normalizedWeightSixteenCandidateBucket_3d1a, normalizedWeightSixteenCandidateBucket_3d1a_compact - | 15647, normalizedWeightSixteenCandidateBucket_3d1f, normalizedWeightSixteenCandidateBucket_3d1f_compact - | 15651, normalizedWeightSixteenCandidateBucket_3d23, normalizedWeightSixteenCandidateBucket_3d23_compact - | 15654, normalizedWeightSixteenCandidateBucket_3d26, normalizedWeightSixteenCandidateBucket_3d26_compact - | 15658, normalizedWeightSixteenCandidateBucket_3d2a, normalizedWeightSixteenCandidateBucket_3d2a_compact - | 15663, normalizedWeightSixteenCandidateBucket_3d2f, normalizedWeightSixteenCandidateBucket_3d2f_compact - | 15666, normalizedWeightSixteenCandidateBucket_3d32, normalizedWeightSixteenCandidateBucket_3d32_compact - | 15671, normalizedWeightSixteenCandidateBucket_3d37, normalizedWeightSixteenCandidateBucket_3d37_compact - | 15675, normalizedWeightSixteenCandidateBucket_3d3b, normalizedWeightSixteenCandidateBucket_3d3b_compact - | 15879, normalizedWeightSixteenCandidateBucket_3e07, normalizedWeightSixteenCandidateBucket_3e07_compact - | 15883, normalizedWeightSixteenCandidateBucket_3e0b, normalizedWeightSixteenCandidateBucket_3e0b_compact - | 15885, normalizedWeightSixteenCandidateBucket_3e0d, normalizedWeightSixteenCandidateBucket_3e0d_compact - | 15891, normalizedWeightSixteenCandidateBucket_3e13, normalizedWeightSixteenCandidateBucket_3e13_compact - | 15893, normalizedWeightSixteenCandidateBucket_3e15, normalizedWeightSixteenCandidateBucket_3e15_compact - | 15897, normalizedWeightSixteenCandidateBucket_3e19, normalizedWeightSixteenCandidateBucket_3e19_compact - | 15903, normalizedWeightSixteenCandidateBucket_3e1f, normalizedWeightSixteenCandidateBucket_3e1f_compact - | 15907, normalizedWeightSixteenCandidateBucket_3e23, normalizedWeightSixteenCandidateBucket_3e23_compact - | 15909, normalizedWeightSixteenCandidateBucket_3e25, normalizedWeightSixteenCandidateBucket_3e25_compact - | 15913, normalizedWeightSixteenCandidateBucket_3e29, normalizedWeightSixteenCandidateBucket_3e29_compact - | 15919, normalizedWeightSixteenCandidateBucket_3e2f, normalizedWeightSixteenCandidateBucket_3e2f_compact - | 15921, normalizedWeightSixteenCandidateBucket_3e31, normalizedWeightSixteenCandidateBucket_3e31_compact - | 15927, normalizedWeightSixteenCandidateBucket_3e37, normalizedWeightSixteenCandidateBucket_3e37_compact - | 15931, normalizedWeightSixteenCandidateBucket_3e3b, normalizedWeightSixteenCandidateBucket_3e3b_compact - | 15933, normalizedWeightSixteenCandidateBucket_3e3d, normalizedWeightSixteenCandidateBucket_3e3d_compact - | 17731, normalizedWeightSixteenCandidateBucket_4543, normalizedWeightSixteenCandidateBucket_4543_compact - | 17987, normalizedWeightSixteenCandidateBucket_4643, normalizedWeightSixteenCandidateBucket_4643_compact - | 17989, normalizedWeightSixteenCandidateBucket_4645, normalizedWeightSixteenCandidateBucket_4645_compact - | 18755, normalizedWeightSixteenCandidateBucket_4943, normalizedWeightSixteenCandidateBucket_4943_compact - | 18757, normalizedWeightSixteenCandidateBucket_4945, normalizedWeightSixteenCandidateBucket_4945_compact - | 19011, normalizedWeightSixteenCandidateBucket_4a43, normalizedWeightSixteenCandidateBucket_4a43_compact - | 19014, normalizedWeightSixteenCandidateBucket_4a46, normalizedWeightSixteenCandidateBucket_4a46_compact - | 19017, normalizedWeightSixteenCandidateBucket_4a49, normalizedWeightSixteenCandidateBucket_4a49_compact - | 19525, normalizedWeightSixteenCandidateBucket_4c45, normalizedWeightSixteenCandidateBucket_4c45_compact - | 19526, normalizedWeightSixteenCandidateBucket_4c46, normalizedWeightSixteenCandidateBucket_4c46_compact - | 19529, normalizedWeightSixteenCandidateBucket_4c49, normalizedWeightSixteenCandidateBucket_4c49_compact - | 19530, normalizedWeightSixteenCandidateBucket_4c4a, normalizedWeightSixteenCandidateBucket_4c4a_compact - | 20803, normalizedWeightSixteenCandidateBucket_5143, normalizedWeightSixteenCandidateBucket_5143_compact - | 20805, normalizedWeightSixteenCandidateBucket_5145, normalizedWeightSixteenCandidateBucket_5145_compact - | 20809, normalizedWeightSixteenCandidateBucket_5149, normalizedWeightSixteenCandidateBucket_5149_compact - | 20815, normalizedWeightSixteenCandidateBucket_514f, normalizedWeightSixteenCandidateBucket_514f_compact - | 21059, normalizedWeightSixteenCandidateBucket_5243, normalizedWeightSixteenCandidateBucket_5243_compact - | 21062, normalizedWeightSixteenCandidateBucket_5246, normalizedWeightSixteenCandidateBucket_5246_compact - | 21066, normalizedWeightSixteenCandidateBucket_524a, normalizedWeightSixteenCandidateBucket_524a_compact - | 21071, normalizedWeightSixteenCandidateBucket_524f, normalizedWeightSixteenCandidateBucket_524f_compact - | 21073, normalizedWeightSixteenCandidateBucket_5251, normalizedWeightSixteenCandidateBucket_5251_compact - | 21573, normalizedWeightSixteenCandidateBucket_5445, normalizedWeightSixteenCandidateBucket_5445_compact - | 21574, normalizedWeightSixteenCandidateBucket_5446, normalizedWeightSixteenCandidateBucket_5446_compact - | 21580, normalizedWeightSixteenCandidateBucket_544c, normalizedWeightSixteenCandidateBucket_544c_compact - | 21583, normalizedWeightSixteenCandidateBucket_544f, normalizedWeightSixteenCandidateBucket_544f_compact - | 21585, normalizedWeightSixteenCandidateBucket_5451, normalizedWeightSixteenCandidateBucket_5451_compact - | 21586, normalizedWeightSixteenCandidateBucket_5452, normalizedWeightSixteenCandidateBucket_5452_compact - | 22345, normalizedWeightSixteenCandidateBucket_5749, normalizedWeightSixteenCandidateBucket_5749_compact - | 22346, normalizedWeightSixteenCandidateBucket_574a, normalizedWeightSixteenCandidateBucket_574a_compact - | 22348, normalizedWeightSixteenCandidateBucket_574c, normalizedWeightSixteenCandidateBucket_574c_compact - | 22351, normalizedWeightSixteenCandidateBucket_574f, normalizedWeightSixteenCandidateBucket_574f_compact - | 22601, normalizedWeightSixteenCandidateBucket_5849, normalizedWeightSixteenCandidateBucket_5849_compact - | 22602, normalizedWeightSixteenCandidateBucket_584a, normalizedWeightSixteenCandidateBucket_584a_compact - | 22604, normalizedWeightSixteenCandidateBucket_584c, normalizedWeightSixteenCandidateBucket_584c_compact - | 22607, normalizedWeightSixteenCandidateBucket_584f, normalizedWeightSixteenCandidateBucket_584f_compact - | 22609, normalizedWeightSixteenCandidateBucket_5851, normalizedWeightSixteenCandidateBucket_5851_compact - | 22610, normalizedWeightSixteenCandidateBucket_5852, normalizedWeightSixteenCandidateBucket_5852_compact - | 22612, normalizedWeightSixteenCandidateBucket_5854, normalizedWeightSixteenCandidateBucket_5854_compact - | 22615, normalizedWeightSixteenCandidateBucket_5857, normalizedWeightSixteenCandidateBucket_5857_compact - | 23365, normalizedWeightSixteenCandidateBucket_5b45, normalizedWeightSixteenCandidateBucket_5b45_compact - | 23366, normalizedWeightSixteenCandidateBucket_5b46, normalizedWeightSixteenCandidateBucket_5b46_compact - | 23372, normalizedWeightSixteenCandidateBucket_5b4c, normalizedWeightSixteenCandidateBucket_5b4c_compact - | 23375, normalizedWeightSixteenCandidateBucket_5b4f, normalizedWeightSixteenCandidateBucket_5b4f_compact - | 23380, normalizedWeightSixteenCandidateBucket_5b54, normalizedWeightSixteenCandidateBucket_5b54_compact - | 23383, normalizedWeightSixteenCandidateBucket_5b57, normalizedWeightSixteenCandidateBucket_5b57_compact - | 23875, normalizedWeightSixteenCandidateBucket_5d43, normalizedWeightSixteenCandidateBucket_5d43_compact - | 23878, normalizedWeightSixteenCandidateBucket_5d46, normalizedWeightSixteenCandidateBucket_5d46_compact - | 23882, normalizedWeightSixteenCandidateBucket_5d4a, normalizedWeightSixteenCandidateBucket_5d4a_compact - | 23887, normalizedWeightSixteenCandidateBucket_5d4f, normalizedWeightSixteenCandidateBucket_5d4f_compact - | 23890, normalizedWeightSixteenCandidateBucket_5d52, normalizedWeightSixteenCandidateBucket_5d52_compact - | 23895, normalizedWeightSixteenCandidateBucket_5d57, normalizedWeightSixteenCandidateBucket_5d57_compact - | 23899, normalizedWeightSixteenCandidateBucket_5d5b, normalizedWeightSixteenCandidateBucket_5d5b_compact - | 24131, normalizedWeightSixteenCandidateBucket_5e43, normalizedWeightSixteenCandidateBucket_5e43_compact - | 24133, normalizedWeightSixteenCandidateBucket_5e45, normalizedWeightSixteenCandidateBucket_5e45_compact - | 24137, normalizedWeightSixteenCandidateBucket_5e49, normalizedWeightSixteenCandidateBucket_5e49_compact - | 24143, normalizedWeightSixteenCandidateBucket_5e4f, normalizedWeightSixteenCandidateBucket_5e4f_compact - | 24145, normalizedWeightSixteenCandidateBucket_5e51, normalizedWeightSixteenCandidateBucket_5e51_compact - | 24151, normalizedWeightSixteenCandidateBucket_5e57, normalizedWeightSixteenCandidateBucket_5e57_compact - | 24155, normalizedWeightSixteenCandidateBucket_5e5b, normalizedWeightSixteenCandidateBucket_5e5b_compact - | 24157, normalizedWeightSixteenCandidateBucket_5e5d, normalizedWeightSixteenCandidateBucket_5e5d_compact - | 25185, normalizedWeightSixteenCandidateBucket_6261, normalizedWeightSixteenCandidateBucket_6261_compact - | 25697, normalizedWeightSixteenCandidateBucket_6461, normalizedWeightSixteenCandidateBucket_6461_compact - | 25698, normalizedWeightSixteenCandidateBucket_6462, normalizedWeightSixteenCandidateBucket_6462_compact - | 26721, normalizedWeightSixteenCandidateBucket_6861, normalizedWeightSixteenCandidateBucket_6861_compact - | 26722, normalizedWeightSixteenCandidateBucket_6862, normalizedWeightSixteenCandidateBucket_6862_compact - | 26724, normalizedWeightSixteenCandidateBucket_6864, normalizedWeightSixteenCandidateBucket_6864_compact - | 26727, normalizedWeightSixteenCandidateBucket_6867, normalizedWeightSixteenCandidateBucket_6867_compact - | 27492, normalizedWeightSixteenCandidateBucket_6b64, normalizedWeightSixteenCandidateBucket_6b64_compact - | 27495, normalizedWeightSixteenCandidateBucket_6b67, normalizedWeightSixteenCandidateBucket_6b67_compact - | 28002, normalizedWeightSixteenCandidateBucket_6d62, normalizedWeightSixteenCandidateBucket_6d62_compact - | 28007, normalizedWeightSixteenCandidateBucket_6d67, normalizedWeightSixteenCandidateBucket_6d67_compact - | 28011, normalizedWeightSixteenCandidateBucket_6d6b, normalizedWeightSixteenCandidateBucket_6d6b_compact - | 28257, normalizedWeightSixteenCandidateBucket_6e61, normalizedWeightSixteenCandidateBucket_6e61_compact - | 28263, normalizedWeightSixteenCandidateBucket_6e67, normalizedWeightSixteenCandidateBucket_6e67_compact - | 28267, normalizedWeightSixteenCandidateBucket_6e6b, normalizedWeightSixteenCandidateBucket_6e6b_compact - | 28269, normalizedWeightSixteenCandidateBucket_6e6d, normalizedWeightSixteenCandidateBucket_6e6d_compact - | 30067, normalizedWeightSixteenCandidateBucket_7573, normalizedWeightSixteenCandidateBucket_7573_compact - | 30323, normalizedWeightSixteenCandidateBucket_7673, normalizedWeightSixteenCandidateBucket_7673_compact - | 30325, normalizedWeightSixteenCandidateBucket_7675, normalizedWeightSixteenCandidateBucket_7675_compact - | 31353, normalizedWeightSixteenCandidateBucket_7a79, normalizedWeightSixteenCandidateBucket_7a79_compact - | 33663, normalizedWeightSixteenCandidateBucket_837f, normalizedWeightSixteenCandidateBucket_837f_compact - | 34175, normalizedWeightSixteenCandidateBucket_857f, normalizedWeightSixteenCandidateBucket_857f_compact - | 34431, normalizedWeightSixteenCandidateBucket_867f, normalizedWeightSixteenCandidateBucket_867f_compact - | 35199, normalizedWeightSixteenCandidateBucket_897f, normalizedWeightSixteenCandidateBucket_897f_compact - | 35455, normalizedWeightSixteenCandidateBucket_8a7f, normalizedWeightSixteenCandidateBucket_8a7f_compact - | 35967, normalizedWeightSixteenCandidateBucket_8c7f, normalizedWeightSixteenCandidateBucket_8c7f_compact - | 36735, normalizedWeightSixteenCandidateBucket_8f7f, normalizedWeightSixteenCandidateBucket_8f7f_compact - | 37247, normalizedWeightSixteenCandidateBucket_917f, normalizedWeightSixteenCandidateBucket_917f_compact - | 37503, normalizedWeightSixteenCandidateBucket_927f, normalizedWeightSixteenCandidateBucket_927f_compact - | 38015, normalizedWeightSixteenCandidateBucket_947f, normalizedWeightSixteenCandidateBucket_947f_compact - | 38783, normalizedWeightSixteenCandidateBucket_977f, normalizedWeightSixteenCandidateBucket_977f_compact - | 39807, normalizedWeightSixteenCandidateBucket_9b7f, normalizedWeightSixteenCandidateBucket_9b7f_compact - | 40319, normalizedWeightSixteenCandidateBucket_9d7f, normalizedWeightSixteenCandidateBucket_9d7f_compact - | 41343, normalizedWeightSixteenCandidateBucket_a17f, normalizedWeightSixteenCandidateBucket_a17f_compact - | 41599, normalizedWeightSixteenCandidateBucket_a27f, normalizedWeightSixteenCandidateBucket_a27f_compact - | 42111, normalizedWeightSixteenCandidateBucket_a47f, normalizedWeightSixteenCandidateBucket_a47f_compact - | 42879, normalizedWeightSixteenCandidateBucket_a77f, normalizedWeightSixteenCandidateBucket_a77f_compact - | 43903, normalizedWeightSixteenCandidateBucket_ab7f, normalizedWeightSixteenCandidateBucket_ab7f_compact - | 44415, normalizedWeightSixteenCandidateBucket_ad7f, normalizedWeightSixteenCandidateBucket_ad7f_compact - | 45951, normalizedWeightSixteenCandidateBucket_b37f, normalizedWeightSixteenCandidateBucket_b37f_compact - | 46463, normalizedWeightSixteenCandidateBucket_b57f, normalizedWeightSixteenCandidateBucket_b57f_compact - | 47487, normalizedWeightSixteenCandidateBucket_b97f, normalizedWeightSixteenCandidateBucket_b97f_compact - | 49023, normalizedWeightSixteenCandidateBucket_bf7f, normalizedWeightSixteenCandidateBucket_bf7f_compact + | 2823, normalizedWeightSixteenCandidateBucket_0b07 + | 3335, normalizedWeightSixteenCandidateBucket_0d07 + | 3339, normalizedWeightSixteenCandidateBucket_0d0b + | 3591, normalizedWeightSixteenCandidateBucket_0e07 + | 3595, normalizedWeightSixteenCandidateBucket_0e0b + | 3597, normalizedWeightSixteenCandidateBucket_0e0d + | 4871, normalizedWeightSixteenCandidateBucket_1307 + | 4875, normalizedWeightSixteenCandidateBucket_130b + | 5383, normalizedWeightSixteenCandidateBucket_1507 + | 5389, normalizedWeightSixteenCandidateBucket_150d + | 5395, normalizedWeightSixteenCandidateBucket_1513 + | 5639, normalizedWeightSixteenCandidateBucket_1607 + | 5646, normalizedWeightSixteenCandidateBucket_160e + | 5651, normalizedWeightSixteenCandidateBucket_1613 + | 5653, normalizedWeightSixteenCandidateBucket_1615 + | 6411, normalizedWeightSixteenCandidateBucket_190b + | 6413, normalizedWeightSixteenCandidateBucket_190d + | 6419, normalizedWeightSixteenCandidateBucket_1913 + | 6421, normalizedWeightSixteenCandidateBucket_1915 + | 6667, normalizedWeightSixteenCandidateBucket_1a0b + | 6670, normalizedWeightSixteenCandidateBucket_1a0e + | 6675, normalizedWeightSixteenCandidateBucket_1a13 + | 6678, normalizedWeightSixteenCandidateBucket_1a16 + | 6681, normalizedWeightSixteenCandidateBucket_1a19 + | 7181, normalizedWeightSixteenCandidateBucket_1c0d + | 7182, normalizedWeightSixteenCandidateBucket_1c0e + | 7189, normalizedWeightSixteenCandidateBucket_1c15 + | 7190, normalizedWeightSixteenCandidateBucket_1c16 + | 7193, normalizedWeightSixteenCandidateBucket_1c19 + | 7194, normalizedWeightSixteenCandidateBucket_1c1a + | 8967, normalizedWeightSixteenCandidateBucket_2307 + | 8971, normalizedWeightSixteenCandidateBucket_230b + | 8979, normalizedWeightSixteenCandidateBucket_2313 + | 8988, normalizedWeightSixteenCandidateBucket_231c + | 8991, normalizedWeightSixteenCandidateBucket_231f + | 9479, normalizedWeightSixteenCandidateBucket_2507 + | 9485, normalizedWeightSixteenCandidateBucket_250d + | 9493, normalizedWeightSixteenCandidateBucket_2515 + | 9498, normalizedWeightSixteenCandidateBucket_251a + | 9503, normalizedWeightSixteenCandidateBucket_251f + | 9507, normalizedWeightSixteenCandidateBucket_2523 + | 9735, normalizedWeightSixteenCandidateBucket_2607 + | 9742, normalizedWeightSixteenCandidateBucket_260e + | 9750, normalizedWeightSixteenCandidateBucket_2616 + | 9753, normalizedWeightSixteenCandidateBucket_2619 + | 9759, normalizedWeightSixteenCandidateBucket_261f + | 9763, normalizedWeightSixteenCandidateBucket_2623 + | 9765, normalizedWeightSixteenCandidateBucket_2625 + | 10507, normalizedWeightSixteenCandidateBucket_290b + | 10509, normalizedWeightSixteenCandidateBucket_290d + | 10518, normalizedWeightSixteenCandidateBucket_2916 + | 10521, normalizedWeightSixteenCandidateBucket_2919 + | 10527, normalizedWeightSixteenCandidateBucket_291f + | 10531, normalizedWeightSixteenCandidateBucket_2923 + | 10533, normalizedWeightSixteenCandidateBucket_2925 + | 10763, normalizedWeightSixteenCandidateBucket_2a0b + | 10766, normalizedWeightSixteenCandidateBucket_2a0e + | 10773, normalizedWeightSixteenCandidateBucket_2a15 + | 10778, normalizedWeightSixteenCandidateBucket_2a1a + | 10783, normalizedWeightSixteenCandidateBucket_2a1f + | 10787, normalizedWeightSixteenCandidateBucket_2a23 + | 10790, normalizedWeightSixteenCandidateBucket_2a26 + | 10793, normalizedWeightSixteenCandidateBucket_2a29 + | 11277, normalizedWeightSixteenCandidateBucket_2c0d + | 11278, normalizedWeightSixteenCandidateBucket_2c0e + | 11283, normalizedWeightSixteenCandidateBucket_2c13 + | 11292, normalizedWeightSixteenCandidateBucket_2c1c + | 11295, normalizedWeightSixteenCandidateBucket_2c1f + | 11301, normalizedWeightSixteenCandidateBucket_2c25 + | 11302, normalizedWeightSixteenCandidateBucket_2c26 + | 11305, normalizedWeightSixteenCandidateBucket_2c29 + | 11306, normalizedWeightSixteenCandidateBucket_2c2a + | 12051, normalizedWeightSixteenCandidateBucket_2f13 + | 12053, normalizedWeightSixteenCandidateBucket_2f15 + | 12054, normalizedWeightSixteenCandidateBucket_2f16 + | 12057, normalizedWeightSixteenCandidateBucket_2f19 + | 12058, normalizedWeightSixteenCandidateBucket_2f1a + | 12060, normalizedWeightSixteenCandidateBucket_2f1c + | 12063, normalizedWeightSixteenCandidateBucket_2f1f + | 12558, normalizedWeightSixteenCandidateBucket_310e + | 12563, normalizedWeightSixteenCandidateBucket_3113 + | 12565, normalizedWeightSixteenCandidateBucket_3115 + | 12569, normalizedWeightSixteenCandidateBucket_3119 + | 12575, normalizedWeightSixteenCandidateBucket_311f + | 12579, normalizedWeightSixteenCandidateBucket_3123 + | 12581, normalizedWeightSixteenCandidateBucket_3125 + | 12585, normalizedWeightSixteenCandidateBucket_3129 + | 12591, normalizedWeightSixteenCandidateBucket_312f + | 12813, normalizedWeightSixteenCandidateBucket_320d + | 12819, normalizedWeightSixteenCandidateBucket_3213 + | 12822, normalizedWeightSixteenCandidateBucket_3216 + | 12826, normalizedWeightSixteenCandidateBucket_321a + | 12831, normalizedWeightSixteenCandidateBucket_321f + | 12835, normalizedWeightSixteenCandidateBucket_3223 + | 12838, normalizedWeightSixteenCandidateBucket_3226 + | 12842, normalizedWeightSixteenCandidateBucket_322a + | 12847, normalizedWeightSixteenCandidateBucket_322f + | 12849, normalizedWeightSixteenCandidateBucket_3231 + | 13323, normalizedWeightSixteenCandidateBucket_340b + | 13333, normalizedWeightSixteenCandidateBucket_3415 + | 13334, normalizedWeightSixteenCandidateBucket_3416 + | 13340, normalizedWeightSixteenCandidateBucket_341c + | 13343, normalizedWeightSixteenCandidateBucket_341f + | 13349, normalizedWeightSixteenCandidateBucket_3425 + | 13350, normalizedWeightSixteenCandidateBucket_3426 + | 13356, normalizedWeightSixteenCandidateBucket_342c + | 13359, normalizedWeightSixteenCandidateBucket_342f + | 13361, normalizedWeightSixteenCandidateBucket_3431 + | 13362, normalizedWeightSixteenCandidateBucket_3432 + | 14091, normalizedWeightSixteenCandidateBucket_370b + | 14093, normalizedWeightSixteenCandidateBucket_370d + | 14094, normalizedWeightSixteenCandidateBucket_370e + | 14105, normalizedWeightSixteenCandidateBucket_3719 + | 14106, normalizedWeightSixteenCandidateBucket_371a + | 14108, normalizedWeightSixteenCandidateBucket_371c + | 14111, normalizedWeightSixteenCandidateBucket_371f + | 14121, normalizedWeightSixteenCandidateBucket_3729 + | 14122, normalizedWeightSixteenCandidateBucket_372a + | 14124, normalizedWeightSixteenCandidateBucket_372c + | 14127, normalizedWeightSixteenCandidateBucket_372f + | 14343, normalizedWeightSixteenCandidateBucket_3807 + | 14361, normalizedWeightSixteenCandidateBucket_3819 + | 14362, normalizedWeightSixteenCandidateBucket_381a + | 14364, normalizedWeightSixteenCandidateBucket_381c + | 14367, normalizedWeightSixteenCandidateBucket_381f + | 14377, normalizedWeightSixteenCandidateBucket_3829 + | 14378, normalizedWeightSixteenCandidateBucket_382a + | 14380, normalizedWeightSixteenCandidateBucket_382c + | 14383, normalizedWeightSixteenCandidateBucket_382f + | 14385, normalizedWeightSixteenCandidateBucket_3831 + | 14386, normalizedWeightSixteenCandidateBucket_3832 + | 14388, normalizedWeightSixteenCandidateBucket_3834 + | 14391, normalizedWeightSixteenCandidateBucket_3837 + | 15111, normalizedWeightSixteenCandidateBucket_3b07 + | 15117, normalizedWeightSixteenCandidateBucket_3b0d + | 15118, normalizedWeightSixteenCandidateBucket_3b0e + | 15125, normalizedWeightSixteenCandidateBucket_3b15 + | 15126, normalizedWeightSixteenCandidateBucket_3b16 + | 15132, normalizedWeightSixteenCandidateBucket_3b1c + | 15135, normalizedWeightSixteenCandidateBucket_3b1f + | 15141, normalizedWeightSixteenCandidateBucket_3b25 + | 15142, normalizedWeightSixteenCandidateBucket_3b26 + | 15148, normalizedWeightSixteenCandidateBucket_3b2c + | 15151, normalizedWeightSixteenCandidateBucket_3b2f + | 15156, normalizedWeightSixteenCandidateBucket_3b34 + | 15159, normalizedWeightSixteenCandidateBucket_3b37 + | 15623, normalizedWeightSixteenCandidateBucket_3d07 + | 15627, normalizedWeightSixteenCandidateBucket_3d0b + | 15630, normalizedWeightSixteenCandidateBucket_3d0e + | 15635, normalizedWeightSixteenCandidateBucket_3d13 + | 15638, normalizedWeightSixteenCandidateBucket_3d16 + | 15642, normalizedWeightSixteenCandidateBucket_3d1a + | 15647, normalizedWeightSixteenCandidateBucket_3d1f + | 15651, normalizedWeightSixteenCandidateBucket_3d23 + | 15654, normalizedWeightSixteenCandidateBucket_3d26 + | 15658, normalizedWeightSixteenCandidateBucket_3d2a + | 15663, normalizedWeightSixteenCandidateBucket_3d2f + | 15666, normalizedWeightSixteenCandidateBucket_3d32 + | 15671, normalizedWeightSixteenCandidateBucket_3d37 + | 15675, normalizedWeightSixteenCandidateBucket_3d3b + | 15879, normalizedWeightSixteenCandidateBucket_3e07 + | 15883, normalizedWeightSixteenCandidateBucket_3e0b + | 15885, normalizedWeightSixteenCandidateBucket_3e0d + | 15891, normalizedWeightSixteenCandidateBucket_3e13 + | 15893, normalizedWeightSixteenCandidateBucket_3e15 + | 15897, normalizedWeightSixteenCandidateBucket_3e19 + | 15903, normalizedWeightSixteenCandidateBucket_3e1f + | 15907, normalizedWeightSixteenCandidateBucket_3e23 + | 15909, normalizedWeightSixteenCandidateBucket_3e25 + | 15913, normalizedWeightSixteenCandidateBucket_3e29 + | 15919, normalizedWeightSixteenCandidateBucket_3e2f + | 15921, normalizedWeightSixteenCandidateBucket_3e31 + | 15927, normalizedWeightSixteenCandidateBucket_3e37 + | 15931, normalizedWeightSixteenCandidateBucket_3e3b + | 15933, normalizedWeightSixteenCandidateBucket_3e3d + | 17731, normalizedWeightSixteenCandidateBucket_4543 + | 17987, normalizedWeightSixteenCandidateBucket_4643 + | 17989, normalizedWeightSixteenCandidateBucket_4645 + | 18755, normalizedWeightSixteenCandidateBucket_4943 + | 18757, normalizedWeightSixteenCandidateBucket_4945 + | 19011, normalizedWeightSixteenCandidateBucket_4a43 + | 19014, normalizedWeightSixteenCandidateBucket_4a46 + | 19017, normalizedWeightSixteenCandidateBucket_4a49 + | 19525, normalizedWeightSixteenCandidateBucket_4c45 + | 19526, normalizedWeightSixteenCandidateBucket_4c46 + | 19529, normalizedWeightSixteenCandidateBucket_4c49 + | 19530, normalizedWeightSixteenCandidateBucket_4c4a + | 20803, normalizedWeightSixteenCandidateBucket_5143 + | 20805, normalizedWeightSixteenCandidateBucket_5145 + | 20809, normalizedWeightSixteenCandidateBucket_5149 + | 20815, normalizedWeightSixteenCandidateBucket_514f + | 21059, normalizedWeightSixteenCandidateBucket_5243 + | 21062, normalizedWeightSixteenCandidateBucket_5246 + | 21066, normalizedWeightSixteenCandidateBucket_524a + | 21071, normalizedWeightSixteenCandidateBucket_524f + | 21073, normalizedWeightSixteenCandidateBucket_5251 + | 21573, normalizedWeightSixteenCandidateBucket_5445 + | 21574, normalizedWeightSixteenCandidateBucket_5446 + | 21580, normalizedWeightSixteenCandidateBucket_544c + | 21583, normalizedWeightSixteenCandidateBucket_544f + | 21585, normalizedWeightSixteenCandidateBucket_5451 + | 21586, normalizedWeightSixteenCandidateBucket_5452 + | 22345, normalizedWeightSixteenCandidateBucket_5749 + | 22346, normalizedWeightSixteenCandidateBucket_574a + | 22348, normalizedWeightSixteenCandidateBucket_574c + | 22351, normalizedWeightSixteenCandidateBucket_574f + | 22601, normalizedWeightSixteenCandidateBucket_5849 + | 22602, normalizedWeightSixteenCandidateBucket_584a + | 22604, normalizedWeightSixteenCandidateBucket_584c + | 22607, normalizedWeightSixteenCandidateBucket_584f + | 22609, normalizedWeightSixteenCandidateBucket_5851 + | 22610, normalizedWeightSixteenCandidateBucket_5852 + | 22612, normalizedWeightSixteenCandidateBucket_5854 + | 22615, normalizedWeightSixteenCandidateBucket_5857 + | 23365, normalizedWeightSixteenCandidateBucket_5b45 + | 23366, normalizedWeightSixteenCandidateBucket_5b46 + | 23372, normalizedWeightSixteenCandidateBucket_5b4c + | 23375, normalizedWeightSixteenCandidateBucket_5b4f + | 23380, normalizedWeightSixteenCandidateBucket_5b54 + | 23383, normalizedWeightSixteenCandidateBucket_5b57 + | 23875, normalizedWeightSixteenCandidateBucket_5d43 + | 23878, normalizedWeightSixteenCandidateBucket_5d46 + | 23882, normalizedWeightSixteenCandidateBucket_5d4a + | 23887, normalizedWeightSixteenCandidateBucket_5d4f + | 23890, normalizedWeightSixteenCandidateBucket_5d52 + | 23895, normalizedWeightSixteenCandidateBucket_5d57 + | 23899, normalizedWeightSixteenCandidateBucket_5d5b + | 24131, normalizedWeightSixteenCandidateBucket_5e43 + | 24133, normalizedWeightSixteenCandidateBucket_5e45 + | 24137, normalizedWeightSixteenCandidateBucket_5e49 + | 24143, normalizedWeightSixteenCandidateBucket_5e4f + | 24145, normalizedWeightSixteenCandidateBucket_5e51 + | 24151, normalizedWeightSixteenCandidateBucket_5e57 + | 24155, normalizedWeightSixteenCandidateBucket_5e5b + | 24157, normalizedWeightSixteenCandidateBucket_5e5d + | 25185, normalizedWeightSixteenCandidateBucket_6261 + | 25697, normalizedWeightSixteenCandidateBucket_6461 + | 25698, normalizedWeightSixteenCandidateBucket_6462 + | 26721, normalizedWeightSixteenCandidateBucket_6861 + | 26722, normalizedWeightSixteenCandidateBucket_6862 + | 26724, normalizedWeightSixteenCandidateBucket_6864 + | 26727, normalizedWeightSixteenCandidateBucket_6867 + | 27492, normalizedWeightSixteenCandidateBucket_6b64 + | 27495, normalizedWeightSixteenCandidateBucket_6b67 + | 28002, normalizedWeightSixteenCandidateBucket_6d62 + | 28007, normalizedWeightSixteenCandidateBucket_6d67 + | 28011, normalizedWeightSixteenCandidateBucket_6d6b + | 28257, normalizedWeightSixteenCandidateBucket_6e61 + | 28263, normalizedWeightSixteenCandidateBucket_6e67 + | 28267, normalizedWeightSixteenCandidateBucket_6e6b + | 28269, normalizedWeightSixteenCandidateBucket_6e6d + | 30067, normalizedWeightSixteenCandidateBucket_7573 + | 30323, normalizedWeightSixteenCandidateBucket_7673 + | 30325, normalizedWeightSixteenCandidateBucket_7675 + | 31353, normalizedWeightSixteenCandidateBucket_7a79 + | 33663, normalizedWeightSixteenCandidateBucket_837f + | 34175, normalizedWeightSixteenCandidateBucket_857f + | 34431, normalizedWeightSixteenCandidateBucket_867f + | 35199, normalizedWeightSixteenCandidateBucket_897f + | 35455, normalizedWeightSixteenCandidateBucket_8a7f + | 35967, normalizedWeightSixteenCandidateBucket_8c7f + | 36735, normalizedWeightSixteenCandidateBucket_8f7f + | 37247, normalizedWeightSixteenCandidateBucket_917f + | 37503, normalizedWeightSixteenCandidateBucket_927f + | 38015, normalizedWeightSixteenCandidateBucket_947f + | 38783, normalizedWeightSixteenCandidateBucket_977f + | 39807, normalizedWeightSixteenCandidateBucket_9b7f + | 40319, normalizedWeightSixteenCandidateBucket_9d7f + | 41343, normalizedWeightSixteenCandidateBucket_a17f + | 41599, normalizedWeightSixteenCandidateBucket_a27f + | 42111, normalizedWeightSixteenCandidateBucket_a47f + | 42879, normalizedWeightSixteenCandidateBucket_a77f + | 43903, normalizedWeightSixteenCandidateBucket_ab7f + | 44415, normalizedWeightSixteenCandidateBucket_ad7f + | 45951, normalizedWeightSixteenCandidateBucket_b37f + | 46463, normalizedWeightSixteenCandidateBucket_b57f + | 47487, normalizedWeightSixteenCandidateBucket_b97f + | 49023, normalizedWeightSixteenCandidateBucket_bf7f end CryptBoolean