diff --git a/research/schur-majorant-closure/CROSS-RESULT.json b/research/schur-majorant-closure/CROSS-RESULT.json new file mode 100644 index 0000000000..2578658ee5 --- /dev/null +++ b/research/schur-majorant-closure/CROSS-RESULT.json @@ -0,0 +1,25 @@ +{ + "checker_sha256": "0f0c1a14e7389708062420cbb83601b0f1434a9de1cd92e5d9e5c32b5c841089", + "endpoint_digest": "5b774faf86a7bd5a9070aaa0710f3437f0e7861954780c8984d78aab0023591d", + "families": { + "all_2x2": 2401, + "dense_modulus_3": 8, + "dense_modulus_4": 4, + "dense_mu_3": 16, + "dense_mu_4": 8, + "toeplitz_4": 4 + }, + "input_sha256": { + "independent_oracle.py": "716bb5e5c7ffb0d2ef44951a13fec49bb875a138e07503de8b6e652276e1f8ab", + "primary_verify.py": "c5c9de309ae227eae0c9cead43b7bb0ec724e5d7b80cc68fddb3c80d1bf1c040" + }, + "matrices": 2441, + "oracle_invariants_checked_on_every_partition": true, + "principal_E_K_D_partitions": 13501, + "scope": "Exact agreement of existing primary Gaussian elimination and frozen independent bordered-minor oracle, including modulus-only oracle fixtures. Reusing their code is integration, not a third independent oracle or a universal proof. No source gate compiler, precision or physical program executed.", + "status": "PASS_SCHUR_ALGORITHM_AGREEMENT_INTEGRATION_NO_NEW_KAPPA", + "wrong_sign_control": { + "inverse_identity_rejected": true, + "norm_bound_still_holds": true + } +} diff --git a/research/schur-majorant-closure/INDEPENDENT-REVIEW.json b/research/schur-majorant-closure/INDEPENDENT-REVIEW.json new file mode 100644 index 0000000000..ec434d0a4e --- /dev/null +++ b/research/schur-majorant-closure/INDEPENDENT-REVIEW.json @@ -0,0 +1,87 @@ +{ + "checked_utc": "2026-10-20T15:57:39.533877+00:00", + "files": { + "PROOF.md": { + "bytes": 14113, + "sha256": "45c02c2f5c158b58b88114cf39ee43b681f4274b7bee37c27cc58ea1d355a8fc" + }, + "RESULT.json": { + "bytes": 2440, + "sha256": "a55a2c28e1356835d3d1f26e305cb2408ab97e7e346cffe6a56ae78577298f34" + }, + "canonical_original_check_circuits.py": { + "bytes": 10774, + "sha256": "06d1861bfe8af543908e26557ffda7e451ff176bceb9bacfaf0f04f234b336d5" + }, + "independent_oracle.py": { + "bytes": 13725, + "sha256": "716bb5e5c7ffb0d2ef44951a13fec49bb875a138e07503de8b6e652276e1f8ab" + }, + "primary_verify.py": { + "bytes": 13724, + "sha256": "c5c9de309ae227eae0c9cead43b7bb0ec724e5d7b80cc68fddb3c80d1bf1c040" + }, + "source/PR4205-README.md.txt": { + "bytes": 8507, + "sha256": "54bd0aca6e7108e0be6559e3968db1e4c4a38e1a0c18a06901b3a966302176ec" + }, + "source/PR4205-TRIANGLE-PROOF.md.txt": { + "bytes": 10475, + "sha256": "abea26e3c86a9970225b070be034c47e7970e10fe1b5686f405e0b301acf3159" + }, + "source/PR4205-triangular.py.txt": { + "bytes": 9884, + "sha256": "322e5b821e0db6c97d39ffb65e5e108755a91d91255ef47f7a63ad30c3ef8413" + }, + "source/predecessor_exact.py": { + "bytes": 7685, + "sha256": "270044fc9fd1203a7eee45ec68a7ebb6b6fab668a109ec956434b8a6cbb483ff" + } + }, + "hypotheses": [ + "finite square complex A=I+H", + "nonnegative majorant of modulus or submultiplicative component envelope", + "both row and column budgets<=rho<1 for both conclusions", + "principal restrictions/elimination; simultaneous coordinate permutations only", + "source parity commutation established in truncated lower-Toeplitz algebra", + "component local constants use actual executable component admission" + ], + "no_frontier_change": true, + "no_new_kappa": true, + "proof_assessment": "Same-rho majorant closure is valid under separate row and column budgets with rho<1, for modulus or component mu. Nesting/principal restriction/simultaneous permutation closure and local parity consequence are valid.", + "remaining": [ + "Source-bound integration and final package/source-history/cold/public/hosted binding are coordinator follow-up", + "No revised global prefix/grid/rounding/online-offline width allocator", + "No active compensated-generator program audit", + "No complete setup/coefficient-delivery/physical caller or multiplication theorem", + "No human or formal-kernel acceptance" + ], + "review_prompted_clarifications": [ + "Explicit source E-OE^-1(ZO)=E-ZOK equality uses commuting Toeplitz algebra", + "Modulus-only versus component-admission boundary control z=(3+3i)/10" + ], + "reviewer": "separate OpenAI Codex agent; not human or formal-kernel acceptance", + "source_head": "203d04313c0cb2b4a4663a5a2d4d407e5a5b6d20", + "status": "PASS_TWO_SIDED_SCHUR_CLOSURE_AND_LOCAL_SOURCE_REVIEW", + "substantial_ai_assistance": true, + "unresolved_findings": [], + "verification": { + "canonical_original_source_matches_acquired_raw_bytes": true, + "compiled_source_or_global_precision_rerun": false, + "exact_primary_matrices": 64, + "five_raw_acquired_sources_hashes_checked": true, + "four_retained_source_exports_checked": true, + "nested_quotient_identities": 656, + "nonleaf_shears": 33, + "oracle_method_review": "code inspection; cofactor determinants distinct from primary Gaussian elimination", + "primary_normal_exit": 0, + "primary_receipts_byte_identical": true, + "primary_receipts_match_final_author_RESULT": true, + "primary_result_sha256": "a55a2c28e1356835d3d1f26e305cb2408ab97e7e346cffe6a56ae78577298f34", + "primary_strict_optimized_exit": 0, + "principal_schur_cases": 1440, + "recursive_nodes": 78, + "restriction_identities": 1440, + "toeplitz_roots": 12 + } +} diff --git a/research/schur-majorant-closure/INDEPENDENT-REVIEW.md b/research/schur-majorant-closure/INDEPENDENT-REVIEW.md new file mode 100644 index 0000000000..2d39ffbe93 --- /dev/null +++ b/research/schur-majorant-closure/INDEPENDENT-REVIEW.md @@ -0,0 +1,21 @@ +# Independent Schur-majorant and local-caller review + +Status: PASS for the stated two-sided near-identity envelope theorem and its local parity-caller consequences. Separate OpenAI Codex agent review is not human acceptance or a formal-kernel proof. + +I checked the proof for a counterexample or a missing hypothesis before considering finite receipts. With A=I+H, alpha equal to complex modulus or mu(z)=|Re z|+|Im z|, and P=alpha(H) having every row and column sum at most rho<1, the positive comparison matrix is Q=P_RR+P_RE(I-P_EE)^(-1)P_ER. Principal restriction discards only nonnegative budget terms. The eliminated rows imply P_ER*1<=rho*(I-P_EE)*1; the inverse is entrywise nonnegative, so its product with P_ER*1 is at most rho*1. Therefore Q*1<=rho*1-(1-rho)P_RE*1. Transposing gives the distinct column statement. The component scalar envelope is submultiplicative and dominates modulus, so entrywise Neumann majorization applies to it as well. No positivity, symmetry or Toeplitz property of A itself is assumed. + +The strict rho<1 hypothesis ensures every principal pivot and resulting complement is invertible. Empty elimination reduces to principal restriction; the empty retained case has no nonempty output norm. Reapplying the same-rho conclusion proves arbitrary finite nesting. The quotient identity retains previously eliminated indices inside the appropriate original principal restriction. Simultaneous coordinate permutations preserve the identity and row/column budgets. Nonprincipal selections and arbitrary nonisometric similarities are correctly excluded. + +The Euclidean conclusion uses both usual modulus bounds through ||J||2<=sqrt(||J||1*||J||infinity); one side alone would not suffice. Disjoint coordinate blocks combine by the maximum operator norm. This statement requires actual disjoint supports and does not claim a new compiled scheduling audit. Direct and inverse bounds 1+rho and 1/(1-rho), and the unchanged rho defect, are attained by the written diagonal examples with a nonempty eliminated set. + +At the retained source boundary, triangular.py admits the component coefficient defect sum at most1/2. A full lower triangular Toeplitz matrix has that same component row and column defect envelope. In the parity decomposition T=[[E,ZO],[O,E]], the source S=E-ZOK is the true Schur complement because E,O,E^-1,K and the lower shift Z are in the commuting truncated lower-Toeplitz algebra. This reordering would not hold for arbitrary noncommuting blocks. E is a principal restriction and S a principal Schur complement; the bound therefore propagates through every source E/S descendant, including simultaneous wire relabeling. The local consequences M<=3/2, M^-1<=2, O<=1/2, K/ZK<=1 and completed shears/inverses<=2 are valid. They do not establish revised global prefix, grid, coefficient-width, rounding or physical-caller allocations. + +A suggested scope control was added before freeze: z=(3+3i)/10 has |z|^2=9/50<1/4 but mu(z)=3/5>1/2. Thus modulus-only admission cannot be silently promoted to the stronger component admission used by the executable source. Both variants of the theorem are valid with their corresponding hypotheses and conclusions. The proof also now spells out the source-specific commuting-block equality explicitly. + +The final primary checker was independently replayed in ordinary and strict optimized Python3.12.14. Both exit zero, produce byte-identical receipts, and match the author's final RESULT.json SHA256 a55a2c28e1356835d3d1f26e305cb2408ab97e7e346cffe6a56ae78577298f34. It checks64 exact Gaussian-rational matrices,1440 principal restriction/Schur cases,656 nested quotient identities and1440 restriction identities, plus12 Toeplitz roots/78 recursive nodes/33 nonleaf shear checks. Explicit exceptions retain checks under optimized mode. These finite component-envelope tests corroborate the written proof; they are not its arbitrary-size proof or a compiled-source execution. + +The independently frozen oracle was inspected. Its bordered-minor determinant formula is code-disjoint from the primary Gauss-Jordan inverse routine; rational Pythagorean complex entries exercise modulus majorants separately from component majorants. It includes distinct row-only and column-only failures, rho=1 singularity and nonprincipal controls. Its sign-fault witness is correctly tested by an exact block-of-inverse identity: both correction signs can satisfy the same norm bound, so a norm-only test would not detect that fault. The oracle's full replay and source-bound integration are separate coordinator evidence, not a repeated execution claimed by this review. + +Source binding inspected here: five acquired source documents/modules match their recorded raw byte lengths, SHA256 and Git blob values; the original check_circuits.py is exactly the canonical capped-phase-fusion/evidence/inplace_algebra_ultra baseline, not a reconstructed script. Four minimal retained exports in SOURCE-PINS match those raw source values. This review does not certify the source's complete rounded circuit or its active compensated-generator extension. + +Credit Jose Manuel/jmbarrancoml for PR4205's retained rational parity-triangular execution/precision proof, Vlado Vojdanovski/PR1673 for the parity recursion and descendant argument, Chafik Boukhalfa/PR628 for phases, Cinna Davis for the later caller, and the retained NOTICE lineage. The earlier inverse bound and descendant description remain predecessor work. The new result is the invariant-rho majorant closure and these local consequences. Complete bounded-generator/caller composition, source setup, coefficient delivery, physical tape lowering, global precision/width savings, human/formal acceptance and the multiplication theorem remain open. No new kappa or frontier change follows. diff --git a/research/schur-majorant-closure/ORACLE-NOTES.txt b/research/schur-majorant-closure/ORACLE-NOTES.txt new file mode 100644 index 0000000000..4a80d456eb --- /dev/null +++ b/research/schur-majorant-closure/ORACLE-NOTES.txt @@ -0,0 +1,62 @@ +Independent principal-Schur majorant oracle + +Source read: Jose Manuel (jmbarrancoml), completed PR4205 recursive head +203d04313c0cb2b4a4663a5a2d4d407e5a5b6d20, TRIANGLE-PROOF.md. Its parity +factorization/recursion and Schur-descendant lineage credit Vlado Vojdanovski +PR1673; its phase lineage credits Chafik Boukhalfa PR628, and later caller +context credits Cinna Davis. No new primary implementation was read/imported +before this oracle and receipt were frozen. Substantial OpenAI Codex assistance; +Apache-2.0 repository contribution. + +New candidate statement corroborated here: for A=I+H, a nonnegative entry +majorant P with every row and column sum <=rho<1 retains that SAME bound +after arbitrary principal restriction and principal Schur elimination. +An entry majorant may dominate either complex modulus or +mu(z)=abs(Re z)+abs(Im z), with the corresponding output interpretation. +This sharpens the predecessor's loose rho+rho^2/(1-rho) bound, which is 1 +at rho=1/2. It does not change a precision allocation automatically. + +Written argument, separate from the finite computation: put B=retained, +E=eliminated after first dropping other indices. The entry majorant is +Q=P_BB+P_BE(I-P_EE)^(-1)P_EB. The inverse is nonnegative by the convergent +Neumann series. Since P_EB*1 <= rho*1-P_EE*1, +(I-P_EE)^(-1)P_EB*1 <= 1-(1-rho)(I-P_EE)^(-1)*1 <= rho*1. +Consequently Q*1 <= P_BB*1+rho*P_BE*1 <= rho*1. Transpose the argument for +columns. Each side separately needs its corresponding original budget; +neither side alone implies the other. Entrywise majorization of the true +Schur correction follows from submultiplicativity and the inverse's +Neumann series. Gaussian component norm mu and complex modulus both have +the needed triangle/product inequalities. Principal restrictions reduce +nonnegative row/column budgets. Iterated restrictions/eliminations retain +the original eliminated set in the principal-Schur description. + +Independent method: each complex Schur entry is the ratio of its bordered +minor determinant to the eliminated principal determinant. There is no +Gaussian-elimination routine or primary-source import. Fractions and pairs +of Fractions are exact; no floating comparisons are used. Majorant Q is +computed independently as I minus the corresponding bordered-minor Schur +complement of I-P. All 2401 two-by-two matrices over seven small Gaussian +rationals are checked, plus 36 bounded dense matrices of dimension3/4 and +four lower triangular Toeplitz dimension4 matrices. Every retained, +eliminated and dropped partition is included. Selected dense cases explore +all one-index elimination/drop histories until one index remains. + +Controls: a row-only rho=3/4 three-by-three input gives a Schur correction +with maximum column sum9/8; transpose gives the opposite one-sided failure. +rho=1 admits a singular eliminated block. A nonprincipal submatrix of I2 +can be [0], violating near-identity conclusions. A wrong Schur correction +sign fails the exact block-of-inverse identity although both signs satisfy +the norm bound; the finite checker does not pretend that norm testing +alone detects this fault. Diagonal examples with nonempty elimination +attain rho exactly, proving no smaller uniform scalar bound is possible. + +Finite evidence is not a formal-kernel proof of the arbitrary-size lemma. +The four Toeplitz examples are generic exact matrices, not a fresh replay +of the predecessor's triangle_plan, phase compiler or rounded precision +argument. Full bounded-generator/caller composition, tape delivery, setup, +online/offline coefficient widths and multiplication/outer theorems remain +outside this oracle. No new kappa or physical speedup is claimed. + +Replay: python3 -I -B oracle.py --output ORACLE.json +Strict replay: python3 -I -O -W error -B oracle.py --output ORACLE-O.json +API for crosscheck: matrix_cases(), G, mu(), schur(), principal(), determinant(). diff --git a/research/schur-majorant-closure/ORACLE-PROVENANCE.json b/research/schur-majorant-closure/ORACLE-PROVENANCE.json new file mode 100644 index 0000000000..12f1bafdb5 --- /dev/null +++ b/research/schur-majorant-closure/ORACLE-PROVENANCE.json @@ -0,0 +1,20 @@ +{ + "commands": [ + "python3 -I -B oracle.py --output ORACLE.json", + "python3 -I -O -W error -B oracle.py --output ORACLE-O.json" + ], + "files": { + "NOTES.txt": "38f87bf4f79ffb15c8afacaa8bff32e0dc58c0f367355847372132d64a677db2", + "ORACLE-O.json": "785e4c8f93a4fb38353e28def436d6ec4639fb293a393caf2759baba180b8f93", + "ORACLE.json": "785e4c8f93a4fb38353e28def436d6ec4639fb293a393caf2759baba180b8f93", + "oracle.py": "716bb5e5c7ffb0d2ef44951a13fec49bb875a138e07503de8b6e652276e1f8ab" + }, + "frozen_at": "2026-10-20T15:51:57.203798+00:00", + "normal_optimized_results_identical": true, + "python": "3.12.14", + "source_head": "203d04313c0cb2b4a4663a5a2d4d407e5a5b6d20", + "source_main": "12fa8c5c844be21bfefb38a19503fbd867a11244", + "source_pr": 4205, + "source_proof_sha256": "abea26e3c86a9970225b070be034c47e7970e10fe1b5686f405e0b301acf3159", + "status": "FROZEN_BEFORE_PRIMARY_IMPLEMENTATION_VIEW" +} diff --git a/research/schur-majorant-closure/ORACLE-RESULT.json b/research/schur-majorant-closure/ORACLE-RESULT.json new file mode 100644 index 0000000000..d7845f75f9 --- /dev/null +++ b/research/schur-majorant-closure/ORACLE-RESULT.json @@ -0,0 +1,47 @@ +{ + "controls": { + "column_only_output_max_row": "9/8", + "nonprincipal_restriction_I2_rows0_cols1_is_zero": true, + "rho_1_singular_eliminated_block": true, + "row_only_input_rho": "3/4", + "row_only_output_max_column": "9/8", + "sharpness_diagonal_nonempty_elimination_rhos": [ + "0", + "1/4", + "1/2", + "3/4", + "7/8" + ], + "wrong_schur_sign_also_satisfies_norm_bound": true, + "wrong_schur_sign_rejected_by_inverse_identity": true + }, + "endpoint_digest": "5b774faf86a7bd5a9070aaa0710f3437f0e7861954780c8984d78aab0023591d", + "families": { + "all_2x2": 2401, + "dense_modulus_3": 8, + "dense_modulus_4": 4, + "dense_mu_3": 16, + "dense_mu_4": 8, + "toeplitz_4": 4 + }, + "finite_cap": { + "all_2x2_alphabet_size": 7, + "all_2x2_rho": "1/2", + "max_matrix_dimension": 4, + "other_rhos": [ + "1/4", + "1/2", + "3/4", + "7/8" + ] + }, + "limitations": [ + "Finite corroboration; arbitrary-size lemma needs the separate written proof.", + "No physical tape, full caller/generator precision, multiplication theorem, or new kappa." + ], + "matrices": 2441, + "method": "exact Gaussian-rational bordered-minor ratios; no Gaussian-elimination routine", + "nested_history_states": 1244, + "principal_E_K_D_partitions": 13501, + "status": "PASS" +} diff --git a/research/schur-majorant-closure/PACKAGE-REVIEW.json b/research/schur-majorant-closure/PACKAGE-REVIEW.json new file mode 100644 index 0000000000..57ff2f942f --- /dev/null +++ b/research/schur-majorant-closure/PACKAGE-REVIEW.json @@ -0,0 +1,143 @@ +{ + "canonical_base": "12fa8c5c844be21bfefb38a19503fbd867a11244", + "checked_utc": "2026-10-20T16:06:46.036386+00:00", + "checks": { + "README_TASK_VERIFY_scope_and_remaining_obligations_consistent": true, + "all_current_package_files_except_reviewself_sealed": true, + "all_current_report_alias_and_checker_bindings_match": true, + "all_declared_source_SHA256_and_Git_blobs_match": true, + "cross_agreement_reuse_labeled_integration_not_third_oracle": true, + "eight_registered_argv_are_portable_and_write_no_default_output": true, + "empty_callbacks_not_compiled_gate_or_factory_execution": true, + "no_additional_scientific_reruns_during_final_package_review": true, + "no_private_local_paths_in_public_text": true, + "prior_proof_and_checker_review_preserved_unchanged": true, + "source_ancestor_input_bytes_match_git_objects": true, + "source_ancestor_is_ancestor_of_current_pre_science_HEAD": true, + "source_collector_only_changes_floating_diagnostic_in_five_source_functions": true, + "source_probe_and_cross_code_and_receipts_inspected": true, + "static_component_admission_and_full_permutation_boundary_correct": true, + "wrong_sign_fault_requires_exact_identity_not_norm_failure": true + }, + "credit_clarification": "README credit wording only clarified to Jose Manuel/jmbarrancoml; Vlado Vojdanovski/PR1673 parity recursion/descendants/circuit; Chafik Boukhalfa/PR628 phases; Cinna Davis later caller. No scientific code/proof/data changed.", + "file_bytes": { + "CROSS-RESULT.json": 1152, + "INDEPENDENT-REVIEW.json": 3850, + "INDEPENDENT-REVIEW.md": 5801, + "ORACLE-NOTES.txt": 3879, + "ORACLE-PROVENANCE.json": 917, + "ORACLE-RESULT.json": 1326, + "PROOF.md": 14113, + "README.md": 3907, + "RESULT.json": 2440, + "REVIEW-FILE-MAP.json": 6407, + "SOURCE-PINS.json": 1599, + "SOURCE-RESULT.json": 5554, + "SOURCES.json": 2653, + "TASK.json": 6422, + "VERIFY.json": 2782, + "cross_check.py": 4695, + "independent_oracle.py": 13725, + "primary_verify.py": 13724, + "source/PR4205-README.md.txt": 8507, + "source/PR4205-TRIANGLE-PROOF.md.txt": 10475, + "source/PR4205-triangular.py.txt": 9884, + "source/predecessor_exact.py": 7685, + "source_check.py": 14080 + }, + "file_sha256": { + "CROSS-RESULT.json": "f8860c5886798f171743ea269f4e20057a897c6615ae28150ffe4f6a69ea50f4", + "INDEPENDENT-REVIEW.json": "83394fedf4839c3c279bbd53e40912e8e9c2e8b1edcbf1a93734b986187a9d99", + "INDEPENDENT-REVIEW.md": "f8652c5ddb99158c52b9e4e9b0f2c5cb13c59f53c2c9134b67b004ca6cdd14f7", + "ORACLE-NOTES.txt": "38f87bf4f79ffb15c8afacaa8bff32e0dc58c0f367355847372132d64a677db2", + "ORACLE-PROVENANCE.json": "913c65284548c3026c65bb2d3673c117d7613966e09b0e4f2a8c59aa5fecac08", + "ORACLE-RESULT.json": "785e4c8f93a4fb38353e28def436d6ec4639fb293a393caf2759baba180b8f93", + "PROOF.md": "45c02c2f5c158b58b88114cf39ee43b681f4274b7bee37c27cc58ea1d355a8fc", + "README.md": "962baddd688d4bf457d8aa7d3a1e6d63eeb2673a197f028e8e73926d0ab01a11", + "RESULT.json": "a55a2c28e1356835d3d1f26e305cb2408ab97e7e346cffe6a56ae78577298f34", + "REVIEW-FILE-MAP.json": "a0d23ac8000015ccfa8a915bece9ea8d5c4311ef14717864ccc4e635aba4961d", + "SOURCE-PINS.json": "a075ce70ffa592833c4c4576fe6c0d6a0d2243382952d1f7215e3bb930721a18", + "SOURCE-RESULT.json": "57dc27138e19b961673e244746cd5b8da4f615cffdc7270aab221c6e34a49190", + "SOURCES.json": "f6a44a7d1c804634bb3237bbfa123dd447769edac09f72aad86bc429bc20b308", + "TASK.json": "3a96b06eb8f615eb366c43a93eca42af2d89eafef3c63870ebb246ecb600bec6", + "VERIFY.json": "f90a3242a3b5e504824e9dcc2ae0968a7028418d29f45df102d0a6ef8167b3c6", + "cross_check.py": "0f0c1a14e7389708062420cbb83601b0f1434a9de1cd92e5d9e5c32b5c841089", + "independent_oracle.py": "716bb5e5c7ffb0d2ef44951a13fec49bb875a138e07503de8b6e652276e1f8ab", + "primary_verify.py": "c5c9de309ae227eae0c9cead43b7bb0ec724e5d7b80cc68fddb3c80d1bf1c040", + "source/PR4205-README.md.txt": "54bd0aca6e7108e0be6559e3968db1e4c4a38e1a0c18a06901b3a966302176ec", + "source/PR4205-TRIANGLE-PROOF.md.txt": "abea26e3c86a9970225b070be034c47e7970e10fe1b5686f405e0b301acf3159", + "source/PR4205-triangular.py.txt": "322e5b821e0db6c97d39ffb65e5e108755a91d91255ef47f7a63ad30c3ef8413", + "source/predecessor_exact.py": "270044fc9fd1203a7eee45ec68a7ebb6b6fab668a109ec956434b8a6cbb483ff", + "source_check.py": "e77de066b7f30a10e1549882ad0ac427c65b2514560b030ed389ed511027bfc6" + }, + "no_frontier_change": true, + "no_new_kappa": true, + "own_branch_source_ancestor": "17641226c4e6d9b614ad372b23874617093ff376", + "package": "research/schur-majorant-closure", + "remaining": [ + "No recalculated global prefix/grid/rounding/online-offline width allocation", + "No active compensated-generator implementation audit", + "No full FFT/stored-gate/rounded Triangle.plan execution in source collector", + "No complete setup/coefficient delivery/physical tape or native/outer theorem", + "No human or formal-kernel acceptance" + ], + "report_map_current_binding_count": 22, + "retained_source_head": "203d04313c0cb2b4a4663a5a2d4d407e5a5b6d20", + "reviewer": "separate OpenAI Codex agent; not human or formal-kernel acceptance", + "scope": "Written arbitrary finite-dimension principal Schur same-rho closure for complex modulus/component majorants; local actual parity-algebra conditioning only.", + "seal_scope": "Exactly23 files: all22 existing scientific/metadata/source files plus the newly checked REVIEW-FILE-MAP.json; only PACKAGE-REVIEW.json itself is excluded to avoid a self-hash cycle. Future edits invalidate affected seals and require a fresh follow-up timestamp.", + "source_bindings": [ + { + "git_blob": "b1fea0c94436b236cc2b7d41a7be032811b94c81", + "path": "certificates/selected-result.json", + "sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129", + "usage": "provenance" + }, + { + "git_blob": "64bfc5af6709ed9811171e0a2108f05e1219cb65", + "path": "docs/research/agent-task-catalog.json", + "sha256": "352a6184713b8843d96fd2c2071eb7aeaa655906b7c51d45ad444912666c8a96", + "usage": "provenance" + }, + { + "git_blob": "f80c141c8116b163c2bb5a028c28212077c8d5a9", + "path": "research/capped-phase-fusion/evidence/inplace_algebra_ultra/check_circuits.py", + "sha256": "06d1861bfe8af543908e26557ffda7e451ff176bceb9bacfaf0f04f234b336d5", + "usage": "input" + }, + { + "git_blob": "886a8fdee275f01b459cbd68ae2815dc9269502f", + "path": "research/unconditional-batched-crt/NOTICE.md", + "sha256": "924109837e71c52392191710d49c9deb42780878d1094f0b01e8690dbe799461", + "usage": "input" + }, + { + "git_blob": "c44ab08cf574b73c183ee39b587320c9bb591157", + "path": "research/schur-majorant-closure/source/PR4205-README.md.txt", + "sha256": "54bd0aca6e7108e0be6559e3968db1e4c4a38e1a0c18a06901b3a966302176ec", + "usage": "input" + }, + { + "git_blob": "f923f4ff2dfe40401fa90d83727ade62b2ef5b5f", + "path": "research/schur-majorant-closure/source/PR4205-TRIANGLE-PROOF.md.txt", + "sha256": "abea26e3c86a9970225b070be034c47e7970e10fe1b5686f405e0b301acf3159", + "usage": "input" + }, + { + "git_blob": "0d045d04a989c184b70dc9ae8e0527a7c34bd5d9", + "path": "research/schur-majorant-closure/source/PR4205-triangular.py.txt", + "sha256": "322e5b821e0db6c97d39ffb65e5e108755a91d91255ef47f7a63ad30c3ef8413", + "usage": "input" + }, + { + "git_blob": "9456b0bc39e6b4e5cfe6ec478a7740086510cb8c", + "path": "research/schur-majorant-closure/source/predecessor_exact.py", + "sha256": "270044fc9fd1203a7eee45ec68a7ebb6b6fab668a109ec956434b8a6cbb483ff", + "usage": "input" + } + ], + "status": "PASS_FINAL_SCHUR_PACKAGE_SCIENCE_SCOPE_AND_CURRENT_BYTE_BINDINGS", + "substantial_ai_assistance": true, + "unresolved_findings": [], + "verification_scope": "Independent final primary normal/O results match author RESULT; new source/cross normal/O runs and their receipts were inspected as coordinator evidence, without duplicating them here. Committed-source-history, Git-free cold, remote-byte and hosted-new-head verification remain coordinator follow-up." +} diff --git a/research/schur-majorant-closure/PROOF.md b/research/schur-majorant-closure/PROOF.md new file mode 100644 index 0000000000..b81e1217ab --- /dev/null +++ b/research/schur-majorant-closure/PROOF.md @@ -0,0 +1,324 @@ +# Sharp two-sided Schur-descendant closure near the identity + +## Result + +Let A=I+H be any finite square complex matrix and let 0<=rho<1. +If both induced norms satisfy + + ||H||_1 <= rho, ||H||_infinity <= rho, + +then every principal Schur complement of every principal restriction of A +is S=I+J with + + ||J||_1 <= rho, ||J||_infinity <= rho. (1) + +The same rho is preserved: it does not grow to +rho+rho^2/(1-rho). Both constants are sharp, even for diagonal matrices +and a nonempty eliminated set. Any finite sequence of principal +restrictions, principal Schur eliminations and simultaneous row/column +permutations retains (1). + +The result also holds for the component envelope based on +mu(z)=|Re(z)|+|Im(z)|. This stronger source-compatible statement preserves +the component-sum admission itself, not merely a consequence for usual +complex operator norms. No symmetry, positivity, triangularity, +Toeplitz structure or commuting blocks are needed for the closure theorem. + +For the retained parity-triangular source at commit +`203d04313c0cb2b4a4663a5a2d4d407e5a5b6d20`, the local consequences at +rho=1/2 are descendant norm at most 3/2, inverse norm at most 2, +off-diagonal block norm at most 1/2, normalized K/ZK norm at most 1, and +completed shear/inverse norm at most 2. This note does not change the +source compiler, prefix allocation, grids, rounding proof or selected +frontier. Its author-owned compensated-generator implementation is a +separate active task. + +## 1. Entrywise majorants and the scalar envelope + +The proof works with either + + alpha(z)=|z|, or alpha(z)=mu(z)=|Re(z)|+|Im(z)|. + +Both satisfy alpha(1)=1, alpha(-z)=alpha(z), the triangle inequality and +alpha(zw)<=alpha(z)alpha(w). For mu the product inequality follows by +expanding `(a+ib)(c+id)` and bounding +`|ac-bd|+|ad+bc|` by `(|a|+|b|)(|c|+|d|)`. + +Apply alpha entrywise to a matrix. Write P=alpha(H), a nonnegative real +matrix. The two envelope bounds mean + + P 1 <= rho 1, 1^T P <= rho 1^T. (2) + +For alpha=usual modulus these are exactly the induced infinity- and +one-norm conditions. For alpha=mu they define component row/column +envelopes, which dominate the usual induced norms and are +submultiplicative matrix bounds. The proof only uses their nonnegative +row/column budgets; it does not identify a component envelope with a +usual complex induced operator norm. + +Let E be the eliminated index set and R the retained index set in an +arbitrary principal restriction, with E and R disjoint. Indices outside +E union R are discarded. Principal restriction only removes nonnegative +terms from (2), so the same budgets hold for every block used below. + +The matrix I+H_EE is invertible by its Neumann series. Entrywise triangle +and product inequalities give + + alpha((I+H_EE)^(-1)) + <= sum_(k>=0) P_EE^k = (I-P_EE)^(-1) =: N. (3) + +All series converge, since P_EE has row and column norms at most rho<1; +in particular N is entrywise nonnegative. This uses absolute convergence +of the series, not an assertion that the complex inverse itself is +entrywise positive. + +The Schur complement is + + S = I_R + H_RR - H_RE (I_E+H_EE)^(-1) H_ER. + +Therefore + + alpha(S-I_R) <= Q := P_RR + P_RE N P_ER. (4) + +The next step retains the shared row/column budgets. Independently +bounding every block by rho loses this information and gives the looser +rho+rho^2/(1-rho) estimate. + +## 2. Row and column budgets are preserved + +From the eliminated rows of (2), + + P_ER 1_R + P_EE 1_E <= rho 1_E. + +Consequently + + P_ER 1_R <= rho (I-P_EE)1_E, + +because the difference between the right side and the preceding row +budget is `(1-rho)P_EE 1_E`, which is nonnegative. Multiplying by N>=0 +yields + + N P_ER 1_R <= rho 1_E. (5) + +Use this in (4) and then use the retained rows of (2): + + Q1_R <= P_RR1_R + rho P_RE1_E + <= rho1_R - (1-rho)P_RE1_E + <= rho1_R. (6) + +This proves the infinity-envelope assertion. It requires only the row +budget, rather than both budgets. + +Transposing the entire nonnegative argument proves the column assertion. +Explicitly, the eliminated columns give + + 1_R^T P_RE N <= rho1_E^T, + +and hence + + 1_R^T Q <= 1_R^T P_RR + rho1_E^T P_ER + <= rho1_R^T - (1-rho)1_E^T P_ER + <= rho1_R^T. (7) + +Combining (4), (6) and (7) proves (1), and also the displayed stronger +row/column slack inequalities. Row-only admission proves the row +conclusion; the column conclusion independently requires its column +admission. The two are not interchangeable for a nonsymmetric matrix. + +If E is empty, S is just a principal restriction and the conclusion is +immediate. An empty retained set is harmless but has no nonempty output +norm to bound. Every nonempty retained complement is invertible, since +its defect has the same strict bound rho<1. + +## 3. Arbitrary principal nesting and permutations + +The theorem may simply be reapplied after each operation: its conclusion +is exactly its original hypothesis with the same rho. Thus it already +proves closure for any finite sequence of principal restrictions and +Schur eliminations. Simultaneously permuting rows and columns only +reorders the row and column sums, and preserves the identity, so it also +preserves both assertions. + +For a description relative to the original matrix, write + + M_R = A[R,R] - A[R,E] A[E,E]^(-1) A[E,R]. + +Restricting M_R to B subset R gives the identical expression with R +replaced by B: it is the Schur complement after eliminating E in the +principal restriction on E union B. Previously eliminated indices are +retained in this description; they are not silently discarded. + +If a further set F subset R is Schur-eliminated, block Gaussian +elimination, or the block inverse formula on E union F, gives the quotient +identity + + (A / E) / F = A / (E union F), (8) + +on the remaining indices. Here each expression refers to the appropriate +principal restriction; all pivots are invertible by the same theorem. +For example, its new pivot is +`A_FF-A_FE A_EE^(-1)A_EF`, and substituting the block inverse of +`A[E union F,E union F]` gives exactly the twice-eliminated complement. +This justifies the source's descendant description while the direct +closure argument supplies the sharp bound. It does not require leading +sections or a fixed elimination order. + +The assertion is about principal restrictions and simultaneous +permutations. A nonprincipal row/column selection need not preserve I. +An arbitrary similarity can enlarge one/infinity norms, so it is not +covered merely by calling it a change of basis. + +## 4. Direct, inverse and Euclidean norms + +For either envelope, + + ||S|| <= 1+rho, ||S^(-1)|| <= 1/(1-rho). (9) + +The first follows by triangle inequality, the second by the Neumann +series for S=I+J. For usual complex Euclidean norms, the standard bound + + ||J||_2 <= sqrt(||J||_1 ||J||_infinity) <= rho + +gives `||S||_2<=1+rho` and `||S^(-1)||_2<=1/(1-rho)` as well. +Component-envelope admission implies the required usual-modulus bounds, +so it also implies these Euclidean statements. This is a norm result, +not a claim that all prefix/suffix or coefficient/data-error allocations +in a complete circuit have been reoptimized. + +Sharpness is elementary. In dimension three take +`H=diag(-rho,rho,0)`, and eliminate the last index. The retained defect +has both norms rho, the direct matrix has both norms 1+rho and its +inverse both norms 1/(1-rho). Thus none of these uniform constants can +be improved under these hypotheses alone. + +## 5. Source parity descendants and local consequences + +The retained source admits lower triangular Toeplitz T=L(f) when + + sum_j mu(f_j-delta_(j,0)) <= 1/2. + +For a full lower triangular Toeplitz matrix this coefficient component +sum equals both its component column and row defect envelopes: the first +column and last row contain all coefficients. The executable +`triangular.py` performs precisely this admission and checks an arbitrary +permutation of all wire indices, including reversal. That relabeling is +a simultaneous input/output permutation; it does not grant an arbitrary +nonisometric similarity or a permutation on only one side. + +After the even/odd parity permutation, the source identity is + + T_parity = [[E, ZO], [O,E]], + K = O E^(-1), + S = E-ZOK, + +and its factorization is lower shear, block diagonal (E,S), upper shear +in matrix product order. The executable order is the reverse application +order: upper, middle, lower. E, O, E^(-1), K and the lower shift Z +belong to the same commuting truncated lower-Toeplitz algebra. Therefore + + E - O E^(-1)(ZO) = E - ZO(O E^(-1)) = E-ZOK. + +This is exactly the principal Schur complement after eliminating the E +bank. This reordering is justified by that source algebra, not by a rule +for arbitrary noncommuting blocks. E itself is a principal +restriction. Both recursive children therefore meet the sharp original +rho bound in the component envelope, and remain Toeplitz under this +specific source algebra. The universal closure proof does not need their +Toeplitz property. + +For any descendant M, its off-diagonal block O is a submatrix of M-I. +Thus its row and column component envelopes are at most rho. The E child +has inverse envelopes at most 1/(1-rho), giving + + ||K||_(1,infinity;mu) <= rho/(1-rho), + ||ZK||_(1,infinity;mu) <= rho/(1-rho). (10) + +The latter uses the fixed lower shift's row/column envelopes at most one. +An ideal completed shear and its inverse consequently have envelopes at +most `1+rho/(1-rho)=1/(1-rho)`. A middle block diag(E,S) has direct norm +at most 1+rho and inverse norm at most 1/(1-rho). At rho=1/2 these are: + +| Local quantity | Bound here | Retained conservative bound | +|---|---:|---:| +| descendant M | 3/2 | 2 | +| descendant inverse | 2 | 2 | +| off-diagonal O | 1/2 | 2 | +| K and ZK | 1 | 4 | +| completed shear and inverse | 2 | 5 | + +The retained bounds were valid conservative estimates; this result is a +strengthening, not a counterexample to that proof. It does not assert +that the old allocator, stored coefficients, data grids, physical +prefix/suffix bounds or the active compensated-generator program have +been changed or reverified. + +## 6. Independent finite evidence and controls + +`primary_verify.py` imports no predecessor arithmetic, compiler or receipt. +It implements Gaussian rationals directly with pairs of Fraction values, +uses Gauss-Jordan elimination with exact two-sided inverse checks, and +forms Schur complements directly from the block formula. All tested +envelopes use the exact rational component norm mu; no floating complex +moduli or numerical tolerance enter these tests. + +The general census uses dense complex-rational matrices with exact +component row/column admission, sizes one through four and several rho +values. For every retained/eliminated/discarded labeling with nonempty +output, it checks the defect, direct and inverse bounds, the entrywise +positive-resolvent majorant and both stronger budget slacks. Separate +checks compare principal restriction and nested quotient identities with +the original matrix. Reversal preserves the input envelopes. + +Handwritten Toeplitz/parity fixtures at dyadic sizes through eight check +the source block identities, descendant Toeplitz structure, E/S +recursion, O/K/ZK bounds and completed-shear inverse bounds. This is +independent exact testing of the stated algebraic interface; it does not +execute or authenticate the author-owned compiled gate program. + +Controls keep limitations explicit: + +- The diagonal example attains all three sharp constants. +- At rho=1 an admitted principal pivot may be singular. +- At rho=3/2, `A=[[1/4,3/4],[3/4,1/4]]` has defect norm 3/2, but + eliminating the first index gives S=-2, defect norm 3>3/2. +- Row-only admission need not imply the column conclusion: with rho=3/4, + `A=[[1,rho,0],[rho,1,0],[rho,0,1]]` has row defect norm rho, while + eliminating index zero gives a descendant column defect norm 9/8. +- A nonprincipal one-by-one off-diagonal restriction of I is zero, and + diagonal similarity can amplify an off-diagonal defect. These are + outside the principal/permutation contract. +- Modulus-only admission is not component admission: for + `z=(3+3i)/10`, `|z|^2=9/50<1/4` but `mu(z)=3/5>1/2`. + Eliminating the second index of `diag(1+z,1)` leaves defect z. + The modulus variant applies at rho=1/2, while the component variant + does not meet its hypothesis. The retained triangular source explicitly + admits the stronger component condition; no weaker full-factory + normalization is silently substituted for it. + +The all-size theorem is the written majorant/budget proof in Sections +1-3. Finite exact success is corroboration, not its universal proof and +not formal-kernel verification. + +## Attribution and remaining obligations + +Credit Jose Manuel (`jmbarrancoml`) for the retained rational rounded +parity-triangular source and its precision proof, and Vlado +Vojdanovski/PR1673 for the parity factorization, recursion, descendant +argument and circuit. Retain Chafik Boukhalfa/PR628 for phases and Cinna +Davis for the later caller, along with the source NOTICE/license lineage. +The original descendant description and inverse bound are predecessor +work. This contribution independently proves the invariant rho defect +bound in both modulus and component envelopes and states its local source +consequences. Substantial OpenAI Codex assistance; Apache-2.0. No human +review or formal-kernel acceptance is claimed. + +## Open next questions + +- An author may choose to use these local constants in a separately + reviewed allocation change; no global precision or word-width savings + are certified here. +- The full bounded-generator/caller composition, setup, coefficient + delivery and physical tape lowering remain separate obligations. +- Retain exact source admission and simultaneous permutation hypotheses + when applying the lemma. No new kappa or selected-frontier change + follows from these norm estimates alone. diff --git a/research/schur-majorant-closure/README.md b/research/schur-majorant-closure/README.md new file mode 100644 index 0000000000..a48ac60e07 --- /dev/null +++ b/research/schur-majorant-closure/README.md @@ -0,0 +1,24 @@ +# Same-rho principal Schur closure + +For every finite complex matrix `A=I+H`, if an entrywise nonnegative majorant of H has both row and column sums at most rho<1, every principal Schur descendant of every principal restriction retains the **same rho** defect budget. The majorant can bound complex modulus or the submultiplicative component envelope mu(z)=|Re z|+|Im z|. PROOF.md gives the arbitrary-size argument; finite checks are corroboration. + +This independently audits one conditioning premise of Jose Manuel Barranco's completed recursive PR4205 at203d04313c0cb2b4a4663a5a2d4d407e5a5b6d20. Its actual component admission is rho=1/2. Under that admission, descendant direct norms are at most3/2 and inverses at most2; source K and ZK are at most1 and completed local shears/inverses at most2. Source parity equality uses commuting truncated lower-Toeplitz algebra. No generic noncommuting reorder is asserted. Ordinary modulus admission alone does not imply the component admission; an exact counterexample is included. + +## Evidence + +- Primary:64 exact Gaussian-rational matrices,1440 restriction/Schur cases and656 nested quotient identities;12 Toeplitz roots,78 recursive nodes and33 local shear checks. +- Independently frozen cofactor oracle:2441 matrices,13501 E/K/D partitions,1244 nested histories; no primary imports or Gaussian elimination. +- Source arithmetic probe: unchanged original toep/lower/invseries/conv/triangle_plan functions with only floating diagnostic replaced by a collector. Exact array facade and algebra-only callbacks return empty plans.10 dyadic roots produce74 nodes,32 Schur/commutation checks,104 Cramer entries and64 completed local shear checks. A wrong-sign mutation still passes norm checks but fails the exact Schur identity. +- Separate algorithm comparison and proof review are distinct from human or formal-kernel acceptance. Run every VERIFY.json command from the repository root with Python3.12; no dependencies. Registered commands write no receipts unless explicitly passed --output. + +## Scope and remaining obligations + +The source probe does not run FFTs, stored gates, rounding or the full Triangle.plan factory. This package does not recalculate global prefix/grid/rounding/online-offline allowances, implement the author's active compensated generator, certify physical coefficient delivery, discharge native/outer transfer or claim a multiplication theorem/new kappa. The selected frontier is unchanged. Integrating local constants into a pinned global allocator is separate work. + +## Open next questions + +Can these local constants improve the completed recursive caller's global prefix/grid/rounding allowance? Pin the finished generator and its actual contract, then audit that implication separately. The present result supplies the local invariant; it leaves global allocation and physical delivery open. The author's active compensated-generator implementation is separately claimed and is not duplicated here. + +## Sources and credit + +Jose Manuel (`jmbarrancoml`) supplies the retained rational parity-triangular execution and precision proof. Vlado Vojdanovski/PR1673 supplies the parity factorization, recursion, descendant argument and circuit. Chafik Boukhalfa/PR628 supplies the certified phase lineage, and Cinna Davis supplies the later caller context. Classical Schur-complement, Neumann-series and nonnegative-majorant ideas underlie this lemma; no broad mathematical-priority claim is made. Douglas Colkitt/OpenAI and research/unconditional-batched-crt/NOTICE.md retain their predecessor credit. Four minimal PR4205 exports are unchanged and pinned in an own-branch ancestor, with original authorship recorded in SOURCE-PINS.json. Substantial OpenAI Codex assistance includes coordinating integration, primary proof/checker, a separately frozen determinant oracle and a separate review context. These are not independent human reviewers. diff --git a/research/schur-majorant-closure/RESULT.json b/research/schur-majorant-closure/RESULT.json new file mode 100644 index 0000000000..60a3955168 --- /dev/null +++ b/research/schur-majorant-closure/RESULT.json @@ -0,0 +1,103 @@ +{ + "checker_sha256": "c5c9de309ae227eae0c9cead43b7bb0ec724e5d7b80cc68fddb3c80d1bf1c040", + "controls": { + "modulus_only_component_boundary": "|z|^2=9/50<1/4 but mu(z)=3/5>1/2 for z=(3+3i)/10", + "nonprincipal_and_nonisometric_extensions_rejected": true, + "rho_one_singular_pivot_rejected": true, + "rho_three_halves_counterexample_defect": "3", + "row_only_column_counterexample": "9/8 > 3/4", + "sharp_direct": "3/2", + "sharp_inverse": "2", + "sharp_rho_defect": "1/2" + }, + "finite_scope": "Gaussian-rational component envelopes only; universal modulus/component theorem is written separately; no predecessor module imports or physical compiler execution", + "general_cases": { + "component_envelope": true, + "matrices": 64, + "nested_quotient_identities": 656, + "principal_restriction_schur_cases": 1440, + "restriction_identities": 1440, + "result_digest": "5e41342d95ab1b7c3b16dc30a658bb314cc2f8ba36dcf67982b4a7812c4ae142", + "rhos": [ + "0", + "1/4", + "1/2", + "3/4" + ], + "sizes": [ + 1, + 2, + 3, + 4 + ] + }, + "parity_cases": { + "nonleaf_shear_checks": 33, + "physical_compiler_executed": false, + "recursive_nodes": 78, + "root_cases": 12, + "roots": [ + { + "n": 1, + "seed": 0, + "source_component_defect": "1/2" + }, + { + "n": 1, + "seed": 1, + "source_component_defect": "0" + }, + { + "n": 1, + "seed": 2, + "source_component_defect": "1/2" + }, + { + "n": 2, + "seed": 0, + "source_component_defect": "1/2" + }, + { + "n": 2, + "seed": 1, + "source_component_defect": "1/2" + }, + { + "n": 2, + "seed": 2, + "source_component_defect": "1/2" + }, + { + "n": 4, + "seed": 0, + "source_component_defect": "1/2" + }, + { + "n": 4, + "seed": 1, + "source_component_defect": "1/2" + }, + { + "n": 4, + "seed": 2, + "source_component_defect": "1/2" + }, + { + "n": 8, + "seed": 0, + "source_component_defect": "1/2" + }, + { + "n": 8, + "seed": 1, + "source_component_defect": "1/2" + }, + { + "n": 8, + "seed": 2, + "source_component_defect": "1/2" + } + ] + }, + "status": "PASS_EXACT_COMPONENT_SCHUR_CLOSURE_NO_NEW_KAPPA" +} diff --git a/research/schur-majorant-closure/REVIEW-FILE-MAP.json b/research/schur-majorant-closure/REVIEW-FILE-MAP.json new file mode 100644 index 0000000000..42c87bf0e9 --- /dev/null +++ b/research/schur-majorant-closure/REVIEW-FILE-MAP.json @@ -0,0 +1,162 @@ +{ + "checked_utc": "2026-10-20T16:06:46.036386+00:00", + "current_byte_equalities": [ + { + "current_path": "PROOF.md", + "original_name": "PROOF.md", + "path_root": "package", + "report": "INDEPENDENT-REVIEW.json", + "sha256": "45c02c2f5c158b58b88114cf39ee43b681f4274b7bee37c27cc58ea1d355a8fc" + }, + { + "current_path": "RESULT.json", + "original_name": "RESULT.json", + "path_root": "package", + "report": "INDEPENDENT-REVIEW.json", + "sha256": "a55a2c28e1356835d3d1f26e305cb2408ab97e7e346cffe6a56ae78577298f34" + }, + { + "current_path": "research/capped-phase-fusion/evidence/inplace_algebra_ultra/check_circuits.py", + "original_name": "canonical_original_check_circuits.py", + "path_root": "repository", + "report": "INDEPENDENT-REVIEW.json", + "sha256": "06d1861bfe8af543908e26557ffda7e451ff176bceb9bacfaf0f04f234b336d5" + }, + { + "current_path": "independent_oracle.py", + "original_name": "independent_oracle.py", + "path_root": "package", + "report": "INDEPENDENT-REVIEW.json", + "sha256": "716bb5e5c7ffb0d2ef44951a13fec49bb875a138e07503de8b6e652276e1f8ab" + }, + { + "current_path": "primary_verify.py", + "original_name": "primary_verify.py", + "path_root": "package", + "report": "INDEPENDENT-REVIEW.json", + "sha256": "c5c9de309ae227eae0c9cead43b7bb0ec724e5d7b80cc68fddb3c80d1bf1c040" + }, + { + "current_path": "source/PR4205-README.md.txt", + "original_name": "source/PR4205-README.md.txt", + "path_root": "package", + "report": "INDEPENDENT-REVIEW.json", + "sha256": "54bd0aca6e7108e0be6559e3968db1e4c4a38e1a0c18a06901b3a966302176ec" + }, + { + "current_path": "source/PR4205-TRIANGLE-PROOF.md.txt", + "original_name": "source/PR4205-TRIANGLE-PROOF.md.txt", + "path_root": "package", + "report": "INDEPENDENT-REVIEW.json", + "sha256": "abea26e3c86a9970225b070be034c47e7970e10fe1b5686f405e0b301acf3159" + }, + { + "current_path": "source/PR4205-triangular.py.txt", + "original_name": "source/PR4205-triangular.py.txt", + "path_root": "package", + "report": "INDEPENDENT-REVIEW.json", + "sha256": "322e5b821e0db6c97d39ffb65e5e108755a91d91255ef47f7a63ad30c3ef8413" + }, + { + "current_path": "source/predecessor_exact.py", + "original_name": "source/predecessor_exact.py", + "path_root": "package", + "report": "INDEPENDENT-REVIEW.json", + "sha256": "270044fc9fd1203a7eee45ec68a7ebb6b6fab668a109ec956434b8a6cbb483ff" + }, + { + "current_path": "ORACLE-NOTES.txt", + "original_name": "NOTES.txt", + "path_root": "package", + "report": "ORACLE-PROVENANCE.json", + "sha256": "38f87bf4f79ffb15c8afacaa8bff32e0dc58c0f367355847372132d64a677db2" + }, + { + "current_path": "ORACLE-RESULT.json", + "original_name": "ORACLE-O.json", + "path_root": "package", + "report": "ORACLE-PROVENANCE.json", + "sha256": "785e4c8f93a4fb38353e28def436d6ec4639fb293a393caf2759baba180b8f93" + }, + { + "current_path": "ORACLE-RESULT.json", + "original_name": "ORACLE.json", + "path_root": "package", + "report": "ORACLE-PROVENANCE.json", + "sha256": "785e4c8f93a4fb38353e28def436d6ec4639fb293a393caf2759baba180b8f93" + }, + { + "current_path": "independent_oracle.py", + "original_name": "oracle.py", + "path_root": "package", + "report": "ORACLE-PROVENANCE.json", + "sha256": "716bb5e5c7ffb0d2ef44951a13fec49bb875a138e07503de8b6e652276e1f8ab" + }, + { + "current_path": "source/predecessor_exact.py", + "original_name": "source_sha256.exact", + "path_root": "package", + "report": "SOURCE-RESULT.json", + "sha256": "270044fc9fd1203a7eee45ec68a7ebb6b6fab668a109ec956434b8a6cbb483ff" + }, + { + "current_path": "independent_oracle.py", + "original_name": "source_sha256.oracle", + "path_root": "package", + "report": "SOURCE-RESULT.json", + "sha256": "716bb5e5c7ffb0d2ef44951a13fec49bb875a138e07503de8b6e652276e1f8ab" + }, + { + "current_path": "research/capped-phase-fusion/evidence/inplace_algebra_ultra/check_circuits.py", + "original_name": "source_sha256.original", + "path_root": "repository", + "report": "SOURCE-RESULT.json", + "sha256": "06d1861bfe8af543908e26557ffda7e451ff176bceb9bacfaf0f04f234b336d5" + }, + { + "current_path": "source/PR4205-triangular.py.txt", + "original_name": "source_sha256.triangular", + "path_root": "package", + "report": "SOURCE-RESULT.json", + "sha256": "322e5b821e0db6c97d39ffb65e5e108755a91d91255ef47f7a63ad30c3ef8413" + }, + { + "current_path": "source_check.py", + "original_name": "checker_sha256", + "path_root": "package", + "report": "SOURCE-RESULT.json", + "sha256": "e77de066b7f30a10e1549882ad0ac427c65b2514560b030ed389ed511027bfc6" + }, + { + "current_path": "independent_oracle.py", + "original_name": "input_sha256.independent_oracle.py", + "path_root": "package", + "report": "CROSS-RESULT.json", + "sha256": "716bb5e5c7ffb0d2ef44951a13fec49bb875a138e07503de8b6e652276e1f8ab" + }, + { + "current_path": "primary_verify.py", + "original_name": "input_sha256.primary_verify.py", + "path_root": "package", + "report": "CROSS-RESULT.json", + "sha256": "c5c9de309ae227eae0c9cead43b7bb0ec724e5d7b80cc68fddb3c80d1bf1c040" + }, + { + "current_path": "cross_check.py", + "original_name": "checker_sha256", + "path_root": "package", + "report": "CROSS-RESULT.json", + "sha256": "0f0c1a14e7389708062420cbb83601b0f1434a9de1cd92e5d9e5c32b5c841089" + }, + { + "current_path": "primary_verify.py", + "original_name": "checker_sha256", + "path_root": "package", + "report": "RESULT.json", + "sha256": "c5c9de309ae227eae0c9cead43b7bb0ec724e5d7b80cc68fddb3c80d1bf1c040" + } + ], + "purpose": "Current byte equalities for preserved original review/oracle aliases and integration input/checker pins. Package paths are relative to this directory; repository paths are relative to the repository root.", + "schema_version": 1, + "scope": "Original reports remain untouched. The canonical_original_check_circuits.py review alias names the actual canonical capped-phase-fusion baseline. No map self-reference and no PACKAGE-REVIEW reference are included." +} diff --git a/research/schur-majorant-closure/SOURCE-PINS.json b/research/schur-majorant-closure/SOURCE-PINS.json new file mode 100644 index 0000000000..b7654444e3 --- /dev/null +++ b/research/schur-majorant-closure/SOURCE-PINS.json @@ -0,0 +1,38 @@ +[ + { + "origin_pr": 4205, + "origin_commit": "203d04313c0cb2b4a4663a5a2d4d407e5a5b6d20", + "origin_path": "research/rational-unitary-fft/TRIANGLE-PROOF.md", + "path": "research/schur-majorant-closure/source/PR4205-TRIANGLE-PROOF.md.txt", + "size": 10475, + "sha256": "abea26e3c86a9970225b070be034c47e7970e10fe1b5686f405e0b301acf3159", + "git_blob": "f923f4ff2dfe40401fa90d83727ade62b2ef5b5f" + }, + { + "origin_pr": 4205, + "origin_commit": "203d04313c0cb2b4a4663a5a2d4d407e5a5b6d20", + "origin_path": "research/rational-unitary-fft/triangular.py", + "path": "research/schur-majorant-closure/source/PR4205-triangular.py.txt", + "size": 9884, + "sha256": "322e5b821e0db6c97d39ffb65e5e108755a91d91255ef47f7a63ad30c3ef8413", + "git_blob": "0d045d04a989c184b70dc9ae8e0527a7c34bd5d9" + }, + { + "origin_pr": 4205, + "origin_commit": "203d04313c0cb2b4a4663a5a2d4d407e5a5b6d20", + "origin_path": "research/rational-unitary-fft/README.md", + "path": "research/schur-majorant-closure/source/PR4205-README.md.txt", + "size": 8507, + "sha256": "54bd0aca6e7108e0be6559e3968db1e4c4a38e1a0c18a06901b3a966302176ec", + "git_blob": "c44ab08cf574b73c183ee39b587320c9bb591157" + }, + { + "origin_pr": 4205, + "origin_commit": "203d04313c0cb2b4a4663a5a2d4d407e5a5b6d20", + "origin_path": "research/rational-unitary-fft/exact.py", + "path": "research/schur-majorant-closure/source/predecessor_exact.py", + "size": 7685, + "sha256": "270044fc9fd1203a7eee45ec68a7ebb6b6fab668a109ec956434b8a6cbb483ff", + "git_blob": "9456b0bc39e6b4e5cfe6ec478a7740086510cb8c" + } +] diff --git a/research/schur-majorant-closure/SOURCE-RESULT.json b/research/schur-majorant-closure/SOURCE-RESULT.json new file mode 100644 index 0000000000..b9e0a963b1 --- /dev/null +++ b/research/schur-majorant-closure/SOURCE-RESULT.json @@ -0,0 +1,153 @@ +{ + "cases": [ + { + "Toeplitz_commutation_checks": 0, + "adapted_ast": "1e94b158d45efb45e98e5c1781f57a5d2ab734d9bd16973c69243e2a9c24bdf2", + "completed_shear_checks": 0, + "cramer_entries": 0, + "n": 1, + "nodes": 1, + "reversed_ids": false, + "schur_nodes": 0, + "seed": 0, + "source_ast": "d3e57ae98483b6c2ca83f2f8bbd94263015cfe7eeb7074265084cfc32c77cb7c" + }, + { + "Toeplitz_commutation_checks": 0, + "adapted_ast": "1e94b158d45efb45e98e5c1781f57a5d2ab734d9bd16973c69243e2a9c24bdf2", + "completed_shear_checks": 0, + "cramer_entries": 0, + "n": 1, + "nodes": 1, + "reversed_ids": true, + "schur_nodes": 0, + "seed": 0, + "source_ast": "d3e57ae98483b6c2ca83f2f8bbd94263015cfe7eeb7074265084cfc32c77cb7c" + }, + { + "Toeplitz_commutation_checks": 1, + "adapted_ast": "1e94b158d45efb45e98e5c1781f57a5d2ab734d9bd16973c69243e2a9c24bdf2", + "completed_shear_checks": 2, + "cramer_entries": 1, + "n": 2, + "nodes": 3, + "reversed_ids": false, + "schur_nodes": 1, + "seed": 0, + "source_ast": "d3e57ae98483b6c2ca83f2f8bbd94263015cfe7eeb7074265084cfc32c77cb7c" + }, + { + "Toeplitz_commutation_checks": 1, + "adapted_ast": "1e94b158d45efb45e98e5c1781f57a5d2ab734d9bd16973c69243e2a9c24bdf2", + "completed_shear_checks": 2, + "cramer_entries": 1, + "n": 2, + "nodes": 3, + "reversed_ids": true, + "schur_nodes": 1, + "seed": 0, + "source_ast": "d3e57ae98483b6c2ca83f2f8bbd94263015cfe7eeb7074265084cfc32c77cb7c" + }, + { + "Toeplitz_commutation_checks": 3, + "adapted_ast": "1e94b158d45efb45e98e5c1781f57a5d2ab734d9bd16973c69243e2a9c24bdf2", + "completed_shear_checks": 6, + "cramer_entries": 6, + "n": 4, + "nodes": 7, + "reversed_ids": false, + "schur_nodes": 3, + "seed": 0, + "source_ast": "d3e57ae98483b6c2ca83f2f8bbd94263015cfe7eeb7074265084cfc32c77cb7c" + }, + { + "Toeplitz_commutation_checks": 3, + "adapted_ast": "1e94b158d45efb45e98e5c1781f57a5d2ab734d9bd16973c69243e2a9c24bdf2", + "completed_shear_checks": 6, + "cramer_entries": 6, + "n": 4, + "nodes": 7, + "reversed_ids": true, + "schur_nodes": 3, + "seed": 0, + "source_ast": "d3e57ae98483b6c2ca83f2f8bbd94263015cfe7eeb7074265084cfc32c77cb7c" + }, + { + "Toeplitz_commutation_checks": 7, + "adapted_ast": "1e94b158d45efb45e98e5c1781f57a5d2ab734d9bd16973c69243e2a9c24bdf2", + "completed_shear_checks": 14, + "cramer_entries": 28, + "n": 8, + "nodes": 15, + "reversed_ids": false, + "schur_nodes": 7, + "seed": 0, + "source_ast": "d3e57ae98483b6c2ca83f2f8bbd94263015cfe7eeb7074265084cfc32c77cb7c" + }, + { + "Toeplitz_commutation_checks": 7, + "adapted_ast": "1e94b158d45efb45e98e5c1781f57a5d2ab734d9bd16973c69243e2a9c24bdf2", + "completed_shear_checks": 14, + "cramer_entries": 28, + "n": 8, + "nodes": 15, + "reversed_ids": true, + "schur_nodes": 7, + "seed": 0, + "source_ast": "d3e57ae98483b6c2ca83f2f8bbd94263015cfe7eeb7074265084cfc32c77cb7c" + }, + { + "Toeplitz_commutation_checks": 3, + "adapted_ast": "1e94b158d45efb45e98e5c1781f57a5d2ab734d9bd16973c69243e2a9c24bdf2", + "completed_shear_checks": 6, + "cramer_entries": 6, + "n": 4, + "nodes": 7, + "reversed_ids": false, + "schur_nodes": 3, + "seed": 1, + "source_ast": "d3e57ae98483b6c2ca83f2f8bbd94263015cfe7eeb7074265084cfc32c77cb7c" + }, + { + "Toeplitz_commutation_checks": 7, + "adapted_ast": "1e94b158d45efb45e98e5c1781f57a5d2ab734d9bd16973c69243e2a9c24bdf2", + "completed_shear_checks": 14, + "cramer_entries": 28, + "n": 8, + "nodes": 15, + "reversed_ids": false, + "schur_nodes": 7, + "seed": 1, + "source_ast": "d3e57ae98483b6c2ca83f2f8bbd94263015cfe7eeb7074265084cfc32c77cb7c" + } + ], + "checker_sha256": "e77de066b7f30a10e1549882ad0ac427c65b2514560b030ed389ed511027bfc6", + "completed_shear_checks": 64, + "cramer_entries": 104, + "logical_source_ids": { + "exact": "source/predecessor_exact.py", + "oracle": "independent_oracle.py", + "original": "research/capped-phase-fusion/evidence/inplace_algebra_ultra/check_circuits.py", + "triangular": "source/PR4205-triangular.py.txt" + }, + "root_cases": 10, + "scope": "Authenticated original five source functions; only floating diagnostic replaced by collector. Exact array/convolution facade and diag/parallel/shear callbacks are algebra-only and return empty plans. No FFT, stored gates, rounding, full Triangle.plan factory or physical program executed. Frozen determinant oracle is reused integration evidence, not a second independent oracle.", + "source_nodes": 74, + "source_schur_nodes": 32, + "source_sha256": { + "exact": "270044fc9fd1203a7eee45ec68a7ebb6b6fab668a109ec956434b8a6cbb483ff", + "oracle": "716bb5e5c7ffb0d2ef44951a13fec49bb875a138e07503de8b6e652276e1f8ab", + "original": "06d1861bfe8af543908e26557ffda7e451ff176bceb9bacfaf0f04f234b336d5", + "triangular": "322e5b821e0db6c97d39ffb65e5e108755a91d91255ef47f7a63ad30c3ef8413" + }, + "static_admission": { + "Triangle_plan_factory_executed": false, + "complete_wire_permutation_check_located": true, + "component_l1_half_admission_located": true + }, + "status": "PASS_AUTHENTICATED_SOURCE_SCHUR_ARITHMETIC_ONLY_NO_GATE_REPLAY", + "wrong_sign_control": { + "all_descendant_norms_still_admitted": true, + "exact_identity_rejected": true + } +} diff --git a/research/schur-majorant-closure/SOURCES.json b/research/schur-majorant-closure/SOURCES.json new file mode 100644 index 0000000000..284c69ec3b --- /dev/null +++ b/research/schur-majorant-closure/SOURCES.json @@ -0,0 +1,58 @@ +{ + "schema_version": 1, + "base_commit": "12fa8c5c844be21bfefb38a19503fbd867a11244", + "files": [ + { + "path": "certificates/selected-result.json", + "usage": "provenance", + "git_blob": "b1fea0c94436b236cc2b7d41a7be032811b94c81", + "sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "path": "docs/research/agent-task-catalog.json", + "usage": "provenance", + "git_blob": "64bfc5af6709ed9811171e0a2108f05e1219cb65", + "sha256": "352a6184713b8843d96fd2c2071eb7aeaa655906b7c51d45ad444912666c8a96" + }, + { + "path": "research/capped-phase-fusion/evidence/inplace_algebra_ultra/check_circuits.py", + "usage": "input", + "git_blob": "f80c141c8116b163c2bb5a028c28212077c8d5a9", + "sha256": "06d1861bfe8af543908e26557ffda7e451ff176bceb9bacfaf0f04f234b336d5" + }, + { + "path": "research/unconditional-batched-crt/NOTICE.md", + "usage": "input", + "git_blob": "886a8fdee275f01b459cbd68ae2815dc9269502f", + "sha256": "924109837e71c52392191710d49c9deb42780878d1094f0b01e8690dbe799461" + }, + { + "path": "research/schur-majorant-closure/source/PR4205-README.md.txt", + "usage": "input", + "git_blob": "c44ab08cf574b73c183ee39b587320c9bb591157", + "sha256": "54bd0aca6e7108e0be6559e3968db1e4c4a38e1a0c18a06901b3a966302176ec", + "pin": "head:17641226c4e6d9b614ad372b23874617093ff376:research/schur-majorant-closure/source/PR4205-README.md.txt" + }, + { + "path": "research/schur-majorant-closure/source/PR4205-TRIANGLE-PROOF.md.txt", + "usage": "input", + "git_blob": "f923f4ff2dfe40401fa90d83727ade62b2ef5b5f", + "sha256": "abea26e3c86a9970225b070be034c47e7970e10fe1b5686f405e0b301acf3159", + "pin": "head:17641226c4e6d9b614ad372b23874617093ff376:research/schur-majorant-closure/source/PR4205-TRIANGLE-PROOF.md.txt" + }, + { + "path": "research/schur-majorant-closure/source/PR4205-triangular.py.txt", + "usage": "input", + "git_blob": "0d045d04a989c184b70dc9ae8e0527a7c34bd5d9", + "sha256": "322e5b821e0db6c97d39ffb65e5e108755a91d91255ef47f7a63ad30c3ef8413", + "pin": "head:17641226c4e6d9b614ad372b23874617093ff376:research/schur-majorant-closure/source/PR4205-triangular.py.txt" + }, + { + "path": "research/schur-majorant-closure/source/predecessor_exact.py", + "usage": "input", + "git_blob": "9456b0bc39e6b4e5cfe6ec478a7740086510cb8c", + "sha256": "270044fc9fd1203a7eee45ec68a7ebb6b6fab668a109ec956434b8a6cbb483ff", + "pin": "head:17641226c4e6d9b614ad372b23874617093ff376:research/schur-majorant-closure/source/predecessor_exact.py" + } + ] +} diff --git a/research/schur-majorant-closure/TASK.json b/research/schur-majorant-closure/TASK.json new file mode 100644 index 0000000000..04db309b48 --- /dev/null +++ b/research/schur-majorant-closure/TASK.json @@ -0,0 +1,99 @@ +{ + "schema_version": 1, + "task_id": "uniform-transfer-audit", + "priority_revision": 7, + "base_commit": "12fa8c5c844be21bfefb38a19503fbd867a11244", + "original_card": { + "id": "uniform-transfer-audit", + "question": "Does one quantified step of the proposed #4100 all-size construction hold at its actual caller?", + "starting_points": [ + "docs/research/research-family-status.md", + "certificates/selected-result.json", + "research/unconditional-batched-crt/README.md" + ], + "methods": [ + "Prove one missing implication with explicit quantified hypotheses.", + "Find an exact counterexample at the claimed interface boundary." + ], + "acceptance_gate": "Identify the proposition and what would change downstream; do not equate a finite replay with a universal proof.", + "first_step": { + "command": [ + "python3", + "-B", + "scripts/research_baseline.py" + ], + "expected": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY", + "inspect": "Read PROOF.md and AUDIT.md in #4100. Select one distinct obligation: CRT total repair, native/free-algebra lifting, precision/conditioning, or complete fixed-tape cost. This is an author-submitted proof, not an accepted unconditional theorem.", + "scope": "Source-binding orientation only; no scientific replay, theorem acceptance or supplier admission. Budget any heavy replay separately." + }, + "first_experiment": "Check live handoffs; name one proposition, its caller, quantified domain and dependency closure. Independently prove the implication or exhibit a precise gap/counterexample. Prioritize CRT.md total repair or COMPLEX.md free-algebra lift only if unclaimed. Stop at the chosen obligation; do not substitute finite samples or root arithmetic for an all-size proof, or launch the complete package by default.", + "bottleneck_link": "Finite supplier improvements are useful only under the retained transfer obligations.", + "allowed_variations": [ + "One CRT repair, native lift, precision/conditioning or tape-cost proposition, with its exact caller." + ], + "scope_change_triggers": [ + "Replacing a quantified obligation with another finite smoke test.", + "Treating archive intake, an author PASS receipt or a finite composed fixture as discharge of the universal hypotheses." + ], + "overlap_terms": [ + "uniform transfer", + "all-size", + "precision", + "4100", + "unconditional-batched-crt" + ], + "existing_checks": [ + { + "scope": "PR #4100: proposed unconditional construction and finite checks, without independent acceptance.", + "evidence": "research/unconditional-batched-crt/README.md", + "remaining": "Independent proof audit of one caller-bound all-size implication; all other premises remain explicit.", + "status": "author-checked", + "source_commit": "337d04939571a637aeab54a0f58f54fde811663a", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + } + ] + }, + "budget_minutes": 60, + "author": "ToikY with substantial OpenAI Codex assistance", + "ai_assistance": "Coordinating integration, primary producer/proof, independently frozen oracle and separate contract/cost-review contexts; not independent human or formal-kernel acceptance.", + "upstream_main": "12fa8c5c844be21bfefb38a19503fbd867a11244", + "scope_status": "refined", + "actual_scope": "Two-sided nonnegative majorant closure under arbitrary principal Schur elimination, with local parity-triangular caller consequence.", + "scope_change_reason": "Take completed recursive PR4205 conditioning handoff and independently prove a stronger same-rho descendant invariant; exclude the author active compensated generator implementation.", + "bottleneck_link": "A loose one-step triangle inequality does not by itself show repeated parity Schur children remain admitted. Same-rho closure discharges that local invariant under the actual component admission.", + "stop_rule": "Freeze one quantified lemma and bounded source arithmetic probe before16:26:58UTC; reserve at least final15minutes for exact committed/cold/hosted replay and handoff. Do not revise global precision, active generator, physical compiler or frontier.", + "outcome": "completed", + "evidence": "Written arbitrary finite-dimension majorant proof; exact Gaussian-rational primary, separately frozen determinant oracle, authenticated original source arithmetic and algorithm agreement checks.", + "open_questions": [ + { + "question": "How should the sharper local constants be integrated into the completed recursive caller global prefix/grid/rounding allowance?", + "why_it_matters": "Local descendant admission and local shear bounds do not certify the global allocator or compiled generator.", + "first_step": "Pin a completed generator and its actual prefix/rounding contract; audit that separate implication without claiming that this local lemma recalculates it.", + "blocked_by": "Global precision and physical delivery are outside this package; active author generator work remains separate." + } + ], + "scope_key": "00d5dbf4cb24578dc079", + "predecessor_head": "203d04313c0cb2b4a4663a5a2d4d407e5a5b6d20", + "canonical_claim": "https://github.com/CrocSwap/integer-mult-bounds/discussions/4202#discussioncomment-19076172", + "first_working_example": { + "command": "python3.12 -I -B research/schur-majorant-closure/primary_verify.py", + "reason_for_override": "The live completed child conditioning handoff supplies this exact proposition; no full historical factory replay is needed." + }, + "freshness": { + "open_prs": 323, + "fetched_at": "2026-10-20T15:42:27+00:00", + "live_discussions": [ + 1166, + 4202 + ], + "broader_coverage": "partial; no novelty inferred" + }, + "family_decision": "narrow to one missing descendant-invariant proof; do not repeat completed mechanism or active generator", + "obligation_ledger": { + "principal_schur_same_rho": "written proof plus independent exact finite corroboration; no human/formal acceptance", + "actual_component_admission": "statically authenticated in pinned caller; source arithmetic only exercised", + "completed_local_shear_bounds": "local conditional corollary", + "global_prefix_grid_rounding_allocator": "unknown", + "compiled_generator_physical_delivery_native_outer": "unknown" + } +} diff --git a/research/schur-majorant-closure/VERIFY.json b/research/schur-majorant-closure/VERIFY.json new file mode 100644 index 0000000000..ff5393969d --- /dev/null +++ b/research/schur-majorant-closure/VERIFY.json @@ -0,0 +1,108 @@ +{ + "schema_version": 1, + "status": "ready", + "python": "3.12", + "requirements": [], + "inputs": [ + "research/capped-phase-fusion/evidence/inplace_algebra_ultra/check_circuits.py", + "research/unconditional-batched-crt/NOTICE.md", + "research/schur-majorant-closure/source/PR4205-README.md.txt", + "research/schur-majorant-closure/source/PR4205-TRIANGLE-PROOF.md.txt", + "research/schur-majorant-closure/source/PR4205-triangular.py.txt", + "research/schur-majorant-closure/source/predecessor_exact.py" + ], + "commands": [ + { + "argv": [ + "{python}", + "-I", + "-B", + "{package}/primary_verify.py" + ], + "timeout_seconds": 120, + "checks": "Exact majorant/slack, principal restriction/Schur quotient and local Toeplitz corroboration." + }, + { + "argv": [ + "{python}", + "-I", + "-O", + "-W", + "error", + "-B", + "{package}/primary_verify.py" + ], + "timeout_seconds": 120, + "checks": "Exact majorant/slack, principal restriction/Schur quotient and local Toeplitz corroboration." + }, + { + "argv": [ + "{python}", + "-I", + "-B", + "{package}/independent_oracle.py" + ], + "timeout_seconds": 120, + "checks": "Code-disjoint frozen bordered-determinant oracle and hypothesis boundaries." + }, + { + "argv": [ + "{python}", + "-I", + "-O", + "-W", + "error", + "-B", + "{package}/independent_oracle.py" + ], + "timeout_seconds": 120, + "checks": "Code-disjoint frozen bordered-determinant oracle and hypothesis boundaries." + }, + { + "argv": [ + "{python}", + "-I", + "-B", + "{package}/source_check.py" + ], + "timeout_seconds": 120, + "checks": "Authenticated original five algebra functions; algebra-only callbacks; no gate/factory execution." + }, + { + "argv": [ + "{python}", + "-I", + "-O", + "-W", + "error", + "-B", + "{package}/source_check.py" + ], + "timeout_seconds": 120, + "checks": "Authenticated original five algebra functions; algebra-only callbacks; no gate/factory execution." + }, + { + "argv": [ + "{python}", + "-I", + "-B", + "{package}/cross_check.py" + ], + "timeout_seconds": 120, + "checks": "Hash-bound Gaussian elimination versus bordered-minor algorithm agreement." + }, + { + "argv": [ + "{python}", + "-I", + "-O", + "-W", + "error", + "-B", + "{package}/cross_check.py" + ], + "timeout_seconds": 120, + "checks": "Hash-bound Gaussian elimination versus bordered-minor algorithm agreement." + } + ] +} diff --git a/research/schur-majorant-closure/cross_check.py b/research/schur-majorant-closure/cross_check.py new file mode 100644 index 0000000000..a609a9f215 --- /dev/null +++ b/research/schur-majorant-closure/cross_check.py @@ -0,0 +1,96 @@ +"""Authenticated algorithm-agreement integration, not another oracle. + +Compare primary Gaussian elimination with the already-frozen independent +bordered-determinant oracle on its exact original census and partitions. +""" +import argparse +from fractions import Fraction as Q +from hashlib import sha256 +from itertools import product +import json +from pathlib import Path +import sys +import types + +P = Path(__file__).resolve().parent +PRIMARY_SHA = "c5c9de309ae227eae0c9cead43b7bb0ec724e5d7b80cc68fddb3c80d1bf1c040" +ORACLE_SHA = "716bb5e5c7ffb0d2ef44951a13fec49bb875a138e07503de8b6e652276e1f8ab" +ORACLE_ENDPOINT_DIGEST = "5b774faf86a7bd5a9070aaa0710f3437f0e7861954780c8984d78aab0023591d" + + +def need(ok, message): + if not ok: + raise ValueError(message) + + +def load(name, path, expected): + data = path.read_bytes() + need(sha256(data).hexdigest() == expected, "authenticated integration input: " + name) + module = types.ModuleType(name) + module.__file__ = str(path) + sys.modules[name] = module + exec(compile(data, str(path), "exec", dont_inherit=True, optimize=0), module.__dict__) + return module + + +def as_primary(matrix): + return [[(value.real, value.imag) for value in row] for row in matrix] + + +def main(): + parser = argparse.ArgumentParser() + parser.add_argument("--primary-path", type=Path, default=P/"primary_verify.py") + parser.add_argument("--oracle-path", type=Path, default=P/"independent_oracle.py") + parser.add_argument("--output", type=Path) + args = parser.parse_args() + primary = load("schur_cross_primary", args.primary_path, PRIMARY_SHA) + oracle = load("schur_cross_oracle", args.oracle_path, ORACLE_SHA) + matrices = partitions = 0 + families = {} + digest = sha256() + for label, h, p, rho, kind in oracle.matrix_cases(): + oracle.validate_input(h, p, rho, kind) + original = oracle.identity_plus(h) + matrix = as_primary(original) + n = len(matrix) + for assignment in product((0, 1, 2), repeat=n): + eliminated = tuple(i for i, state in enumerate(assignment) if state == 0) + retained = tuple(i for i, state in enumerate(assignment) if state == 1) + if not retained: + continue + expected = oracle.check_partition(h, p, rho, kind, eliminated, retained) + actual = primary.schur(matrix, eliminated, retained) + need(actual == as_primary(expected), "Gaussian-elimination/bordered-determinant exact disagreement") + digest.update(repr((label, eliminated, retained, expected)).encode()) + partitions += 1 + family = "all_2x2" if label.startswith("all_2x2") else label.rsplit("_", 1)[0] + families[family] = families.get(family, 0)+1 + matrices += 1 + need(matrices == 2441 and partitions == 13501, "frozen independent census coverage") + need(digest.hexdigest() == ORACLE_ENDPOINT_DIGEST, "frozen oracle endpoint census digest") + # The wrong sign still meets a norm bound, but fails the exact + # block-of-inverse identity: success must not mean merely norm success. + matrix = [[primary.ONE, primary.z(Q(1, 4))], [primary.z(Q(1, 4)), primary.ONE]] + proper = primary.schur(matrix, (0,), (1,)) + wrong = [[primary.z(Q(17, 16))]] + inverse_block = primary.inverse(matrix)[1][1] + need(primary.inverse(proper)[0][0] == inverse_block + and primary.inverse(wrong)[0][0] != inverse_block, + "wrong-sign exact identity control") + need(max(primary.norms(primary.minus(wrong, primary.identity(1)))) <= Q(1, 2), + "wrong sign norm-only positive control") + result = {"status": "PASS_SCHUR_ALGORITHM_AGREEMENT_INTEGRATION_NO_NEW_KAPPA", + "input_sha256": {"primary_verify.py": PRIMARY_SHA, "independent_oracle.py": ORACLE_SHA}, + "matrices": matrices, "principal_E_K_D_partitions": partitions, + "families": families, "endpoint_digest": digest.hexdigest(), + "oracle_invariants_checked_on_every_partition": True, + "wrong_sign_control": {"inverse_identity_rejected": True, "norm_bound_still_holds": True}, + "checker_sha256": sha256(Path(__file__).read_bytes()).hexdigest(), + "scope": "Exact agreement of existing primary Gaussian elimination and frozen independent bordered-minor oracle, including modulus-only oracle fixtures. Reusing their code is integration, not a third independent oracle or a universal proof. No source gate compiler, precision or physical program executed."} + if args.output is not None: + args.output.write_text(json.dumps(result, indent=2, sort_keys=True)+"\n") + print(result["status"]) + + +if __name__ == "__main__": + main() diff --git a/research/schur-majorant-closure/independent_oracle.py b/research/schur-majorant-closure/independent_oracle.py new file mode 100644 index 0000000000..5c22e17edf --- /dev/null +++ b/research/schur-majorant-closure/independent_oracle.py @@ -0,0 +1,323 @@ +#!/usr/bin/env python3 +"""Exact bordered-minor oracle for principal Schur majorant preservation. + +No primary implementation/imports. Gaussian rationals use Fraction pairs; +Schur entries are ratios of bordered determinants, not elimination updates. +""" +import argparse +from dataclasses import dataclass +from fractions import Fraction as F +from functools import lru_cache +from itertools import product +import hashlib +import json +from pathlib import Path + + +def need(condition, message): + if not condition: + raise RuntimeError(message) + + +@dataclass(frozen=True, slots=True) +class G: + real: F = F(0) + imag: F = F(0) + + def __add__(self, other): + other = other if isinstance(other, G) else G(F(other)) + return G(self.real + other.real, self.imag + other.imag) + + __radd__ = __add__ + + def __neg__(self): + return G(-self.real, -self.imag) + + def __sub__(self, other): + return self + -as_g(other) + + def __rsub__(self, other): + return as_g(other) + -self + + def __mul__(self, other): + other = as_g(other) + return G(self.real * other.real - self.imag * other.imag, + self.real * other.imag + self.imag * other.real) + + __rmul__ = __mul__ + + def __truediv__(self, other): + other = as_g(other) + denominator = other.real * other.real + other.imag * other.imag + need(denominator != 0, 'Gaussian division by zero') + return G((self.real * other.real + self.imag * other.imag) / denominator, + (self.imag * other.real - self.real * other.imag) / denominator) + + def __bool__(self): + return bool(self.real or self.imag) + + +def as_g(value): + return value if isinstance(value, G) else G(F(value)) + + +def mu(value): + return abs(value.real) + abs(value.imag) + + +def modulus_squared(value): + return value.real * value.real + value.imag * value.imag + + +ZERO, ONE = G(), G(F(1)) + + +@lru_cache(maxsize=100000) +def determinant(matrix): + n = len(matrix) + if n == 0: + return ONE + if n == 1: + return matrix[0][0] + answer = ZERO + for column, entry in enumerate(matrix[0]): + if entry: + minor = tuple(tuple(row[j] for j in range(n) if j != column) for row in matrix[1:]) + term = entry * determinant(minor) + answer = answer + (term if column % 2 == 0 else -term) + return answer + + +def principal(matrix, indices): + return tuple(tuple(matrix[i][j] for j in indices) for i in indices) + + +def schur(matrix, eliminated, retained): + """S_ij = det(A_(E+i,E+j))/det(A_EE), with original E order.""" + eliminated, retained = tuple(eliminated), tuple(retained) + pivot = determinant(principal(matrix, eliminated)) + need(bool(pivot), 'singular eliminated principal block') + return tuple(tuple(determinant(tuple(tuple(matrix[r][c] for c in eliminated + (j,)) + for r in eliminated + (i,))) / pivot + for j in retained) for i in retained) + + +def identity_plus(h): + return tuple(tuple(h[i][j] + (ONE if i == j else ZERO) for j in range(len(h))) + for i in range(len(h))) + + +def row_column_sums(matrix): + n = len(matrix) + return ([sum(matrix[i]) for i in range(n)], + [sum(matrix[i][j] for i in range(n)) for j in range(n)]) + + +def majorant_schur(p, eliminated, retained): + minus = tuple(tuple((ONE if i == j else ZERO) - p[i][j] for j in range(len(p))) + for i in range(len(p))) + s = schur(minus, eliminated, retained) + q = tuple(tuple((ONE if i == j else ZERO) - s[i][j] for j in range(len(s))) + for i in range(len(s))) + need(all(not z.imag and z.real >= 0 for row in q for z in row), + 'nonnegative Schur majorant failed') + return tuple(tuple(z.real for z in row) for row in q) + + +def check_partition(h, p, rho, kind, eliminated, retained): + s = schur(identity_plus(h), eliminated, retained) + q = majorant_schur(p, eliminated, retained) + for i in range(len(s)): + for j in range(len(s)): + delta = s[i][j] - (ONE if i == j else ZERO) + if kind == 'mu': + need(mu(delta) <= q[i][j], 'component-majorant Schur bound failed') + else: + need(modulus_squared(delta) <= q[i][j] * q[i][j], + 'modulus-majorant Schur bound failed') + rows, columns = row_column_sums(q) + need(max(rows, default=F(0)) <= rho and max(columns, default=F(0)) <= rho, + 'same-rho row/column majorant bound failed') + return s + + +def normalize(h, p, rho): + rows, cols = row_column_sums(p) + budget = max(rows + cols, default=F(0)) + scale = rho / budget if budget else F(1) + return (tuple(tuple(z * scale for z in row) for row in h), + tuple(tuple(z * scale for z in row) for row in p)) + + +def matrix_cases(): + alphabet = (ZERO, G(F(1, 8)), G(F(-1, 8)), G(F(0), F(1, 8)), + G(F(0), F(-1, 8)), G(F(1, 8), F(1, 8)), G(F(-1, 8), F(-1, 8))) + for index, values in enumerate(product(alphabet, repeat=4)): + h = (values[:2], values[2:]) + p = tuple(tuple(mu(z) for z in row) for row in h) + yield 'all_2x2_' + str(index), h, p, F(1, 2), 'mu' + seed = 0x51C4 + for n, count in ((3, 16), (4, 8)): + for number in range(count): + entries = [] + for _ in range(n * n): + seed = (1103515245 * seed + 12345) % (1 << 31) + entries.append(alphabet[(seed >> 8) % len(alphabet)]) + h = tuple(tuple(entries[i * n:(i + 1) * n]) for i in range(n)) + p = tuple(tuple(mu(z) for z in row) for row in h) + rho = (F(1, 4), F(1, 2), F(3, 4), F(7, 8))[number % 4] + h, p = normalize(h, p, rho) + yield f'dense_mu_{n}_{number}', h, p, rho, 'mu' + for n, count in ((3, 8), (4, 4)): + for number in range(count): + h_rows, p_rows = [], [] + for _ in range(n): + h_row, p_row = [], [] + for _ in range(n): + seed = (1103515245 * seed + 12345) % (1 << 31) + r, sign = (seed % 3), (-1 if seed & 8 else 1) + h_row.append(G(F(3 * sign * r, 32), F(4 * r, 32))) + p_row.append(F(5 * r, 32)) + h_rows.append(tuple(h_row)) + p_rows.append(tuple(p_row)) + rho = (F(1, 4), F(1, 2), F(3, 4), F(7, 8))[number % 4] + h, p = normalize(tuple(h_rows), tuple(p_rows), rho) + yield f'dense_modulus_{n}_{number}', h, p, rho, 'modulus' + # Toeplitz examples corroborate the source's recursive family without + # importing its coefficient-generation or circuit implementation. + for number in range(4): + coefficients = tuple(alphabet[(2 * j + number) % len(alphabet)] for j in range(4)) + total = sum(mu(z) for z in coefficients) + scale = F(1, 2) / total if total else F(1) + h = tuple(tuple(coefficients[i - j] * scale if i >= j else ZERO + for j in range(4)) for i in range(4)) + p = tuple(tuple(mu(z) for z in row) for row in h) + yield f'toeplitz_4_{number}', h, p, F(1, 2), 'mu' + + +def validate_input(h, p, rho, kind): + need(F(0) <= rho < 1, 'rho outside contracting domain') + for i in range(len(h)): + for j in range(len(h)): + need(p[i][j] >= 0, 'negative entry majorant') + if kind == 'mu': + need(mu(h[i][j]) <= p[i][j], 'input component majorant failed') + else: + need(modulus_squared(h[i][j]) <= p[i][j] ** 2, 'input modulus majorant failed') + rows, columns = row_column_sums(p) + need(max(rows) <= rho and max(columns) <= rho, 'input row/column budget failed') + + +def nested_histories(h, p, rho, kind): + original = identity_plus(h) + n, checked = len(h), 0 + stack = [(original, tuple(range(n)), ())] + while stack: + current, labels, eliminated = stack.pop() + expected = check_partition(h, p, rho, kind, eliminated, labels) + need(current == expected, 'nested elimination/restriction history not principal Schur description') + checked += 1 + if len(labels) > 1: + for position, label in enumerate(labels): + keep_positions = tuple(i for i in range(len(labels)) if i != position) + new_labels = tuple(labels[i] for i in keep_positions) + stack.append((principal(current, keep_positions), new_labels, eliminated)) + stack.append((schur(current, (position,), keep_positions), new_labels, eliminated + (label,))) + return checked + + +def controls(): + rho = F(3, 4) + h = ((ZERO, G(rho), ZERO), (G(rho), ZERO, ZERO), (G(rho), ZERO, ZERO)) + s = schur(identity_plus(h), (0,), (1, 2)) + delta = tuple(tuple(mu(s[i][j] - (ONE if i == j else ZERO)) for j in range(2)) for i in range(2)) + rows, columns = row_column_sums(delta) + need(max(rows) <= rho < max(columns) and max(columns) == F(9, 8), + 'row-only counterexample is not discriminating') + ht = tuple(tuple(h[j][i] for j in range(3)) for i in range(3)) + st = schur(identity_plus(ht), (0,), (1, 2)) + d = tuple(tuple(mu(st[i][j] - (ONE if i == j else ZERO)) for j in range(2)) for i in range(2)) + r, c = row_column_sums(d) + need(max(c) <= rho < max(r), 'column-only counterexample is not discriminating') + column_only_max_row = max(r) + singular_h = ((G(F(-1)),),) + need(mu(singular_h[0][0]) == 1 and not determinant(identity_plus(singular_h)), + 'rho=1 singularity witness failed') + # A=I is perfectly admitted, but selecting different row/column indices + # gives [0], not a near-identity principal restriction. + identity_two = ((ONE, ZERO), (ZERO, ONE)) + nonprincipal = ((identity_two[0][1],),) + need(mu(nonprincipal[0][0] - ONE) == 1, 'nonprincipal witness failed') + # A sign fault can retain the norm bound; distinguish it by the exact + # principal block-of-inverse identity, not an invented norm violation. + a = ((ONE, G(F(1, 4))), (G(F(1, 4)), ONE)) + proper = schur(a, (0,), (1,))[0][0] + wrong = ONE + G(F(1, 16)) + inverse_block = a[0][0] / determinant(a) + need(ONE / proper == inverse_block and ONE / wrong != inverse_block, + 'Schur correction sign control failed to separate inverse identity') + need(mu(proper - ONE) <= F(1, 2) and mu(wrong - ONE) <= F(1, 2), + 'sign-control scope assertion false') + sharp = [] + for r in (F(0), F(1, 4), F(1, 2), F(3, 4), F(7, 8)): + diagonal = ((G(r), ZERO), (ZERO, G(r))) + p = ((r, F(0)), (F(0), r)) + endpoint = check_partition(diagonal, p, r, 'mu', (0,), (1,)) + need(mu(endpoint[0][0] - ONE) == r, 'sharpness equality failed') + sharp.append(str(r)) + return {'row_only_input_rho': str(rho), 'row_only_output_max_column': str(max(columns)), + 'column_only_output_max_row': str(column_only_max_row), + 'rho_1_singular_eliminated_block': True, + 'nonprincipal_restriction_I2_rows0_cols1_is_zero': True, + 'wrong_schur_sign_rejected_by_inverse_identity': True, + 'wrong_schur_sign_also_satisfies_norm_bound': True, + 'sharpness_diagonal_nonempty_elimination_rhos': sharp} + + +def run(): + families, partition_count, histories, matrices = {}, 0, 0, 0 + digest = hashlib.sha256() + for label, h, p, rho, kind in matrix_cases(): + validate_input(h, p, rho, kind) + n, count = len(h), 0 + for assignment in product(range(3), repeat=n): + # 0=eliminate, 1=retain, 2=drop before the principal restriction. + eliminated = tuple(i for i, state in enumerate(assignment) if state == 0) + retained = tuple(i for i, state in enumerate(assignment) if state == 1) + if not retained: + continue + endpoint = check_partition(h, p, rho, kind, eliminated, retained) + digest.update(repr((label, eliminated, retained, endpoint)).encode()) + count += 1 + if (label.startswith('dense_mu_3_') and int(label.rsplit('_', 1)[1]) < 4 + or label.startswith('dense_modulus_3_') and int(label.rsplit('_', 1)[1]) < 4 + or label.startswith('dense_mu_4_') and int(label.rsplit('_', 1)[1]) < 2 + or label.startswith('dense_modulus_4_') and int(label.rsplit('_', 1)[1]) < 2): + histories += nested_histories(h, p, rho, kind) + family = 'all_2x2' if label.startswith('all_2x2') else label.rsplit('_', 1)[0] + families[family] = families.get(family, 0) + 1 + matrices += 1 + partition_count += count + return {'status': 'PASS', 'method': 'exact Gaussian-rational bordered-minor ratios; no Gaussian-elimination routine', + 'matrices': matrices, 'families': families, 'principal_E_K_D_partitions': partition_count, + 'nested_history_states': histories, 'endpoint_digest': digest.hexdigest(), + 'controls': controls(), 'finite_cap': {'max_matrix_dimension': 4, + 'all_2x2_alphabet_size': 7, 'all_2x2_rho': '1/2', + 'other_rhos': ['1/4', '1/2', '3/4', '7/8']}, + 'limitations': ['Finite corroboration; arbitrary-size lemma needs the separate written proof.', + 'No physical tape, full caller/generator precision, multiplication theorem, or new kappa.']} + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument('--output', type=Path) + args = parser.parse_args() + result = run() + payload = json.dumps(result, indent=2, sort_keys=True) + '\n' + if args.output: + args.output.write_text(payload, encoding='utf-8') + print(payload, end='') + + +if __name__ == '__main__': + main() diff --git a/research/schur-majorant-closure/primary_verify.py b/research/schur-majorant-closure/primary_verify.py new file mode 100644 index 0000000000..3ce27dd92e --- /dev/null +++ b/research/schur-majorant-closure/primary_verify.py @@ -0,0 +1,317 @@ +"""Independent Gaussian-Fraction checks for the all-size Schur closure proof. + +Finite evidence uses mu(z)=|Re z|+|Im z|, hence is rational throughout. +No producer module or receipt is imported. The universal complex theorem +is the separate written proof, not an extrapolation of this enumeration. +""" +import argparse +from fractions import Fraction as Q +from hashlib import sha256 +from itertools import product +import json +from pathlib import Path + + +def need(ok, message): + if not ok: + raise ValueError(message) + + +def z(a=0, b=0): + return Q(a), Q(b) + + +ZERO, ONE = z(), z(1) + + +def add(a, b): + return a[0]+b[0], a[1]+b[1] + + +def neg(a): + return -a[0], -a[1] + + +def sub(a, b): + return add(a, neg(b)) + + +def mul(a, b): + return a[0]*b[0]-a[1]*b[1], a[0]*b[1]+a[1]*b[0] + + +def div(a, b): + norm = b[0]*b[0]+b[1]*b[1] + need(norm > 0, "nonzero Gaussian divisor") + value = mul(a, (b[0], -b[1])) + return value[0]/norm, value[1]/norm + + +def mu(a): + return abs(a[0])+abs(a[1]) + + +def identity(n): + return [[ONE if i == j else ZERO for j in range(n)] for i in range(n)] + + +def block(matrix, rows, columns): + return [[matrix[i][j] for j in columns] for i in rows] + + +def minus(left, right): + return [[sub(a, b) for a, b in zip(x, y)] for x, y in zip(left, right)] + + +def times(left, right): + columns = len(right[0]) if right else 0 + return [[sumz(mul(left[i][k], right[k][j]) for k in range(len(right))) + for j in range(columns)] for i in range(len(left))] + + +def sumz(values): + value = ZERO + for entry in values: + value = add(value, entry) + return value + + +def inverse(matrix): + n = len(matrix) + rows = [row[:] + unit for row, unit in zip(matrix, identity(n))] + for pivot in range(n): + selected = next((i for i in range(pivot, n) if rows[i][pivot] != ZERO), None) + need(selected is not None, "singular principal pivot") + rows[pivot], rows[selected] = rows[selected], rows[pivot] + divisor = rows[pivot][pivot] + rows[pivot] = [div(x, divisor) for x in rows[pivot]] + for i in range(n): + if i != pivot: + factor = rows[i][pivot] + rows[i] = [sub(a, mul(factor, b)) for a, b in zip(rows[i], rows[pivot])] + result = [row[n:] for row in rows] + need(times(matrix, result) == times(result, matrix) == identity(n), "two-sided exact inverse") + return result + + +def norms(matrix): + if not matrix: + return Q(0), Q(0) + row = max(sum((mu(x) for x in entries), Q(0)) for entries in matrix) + column = max(sum((mu(entries[j]) for entries in matrix), Q(0)) for j in range(len(matrix[0]))) + return column, row + + +def schur(matrix, eliminated, retained): + result = block(matrix, retained, retained) + if not eliminated: + return result + correction = times(times(block(matrix, retained, eliminated), + inverse(block(matrix, eliminated, eliminated))), + block(matrix, eliminated, retained)) + return minus(result, correction) + + +def positive_matrix(matrix): + return [[z(mu(value)) for value in row] for row in matrix] + + +def check_one(matrix, rho, eliminated, retained): + n = len(matrix) + defect = minus(matrix, identity(n)) + need(max(norms(defect)) <= rho < 1, "two-sided component envelope admission") + current = schur(matrix, eliminated, retained) + delta = minus(current, identity(len(retained))) + need(max(norms(delta)) <= rho, "sharp rho closure") + need(max(norms(current)) <= 1+rho, "descendant direct norm") + need(max(norms(inverse(current))) <= 1/(1-rho), "descendant inverse norm") + if eliminated: + positive = positive_matrix(defect) + pee = block(positive, eliminated, eliminated) + neumann = inverse(minus(identity(len(eliminated)), pee)) + need(all(value[1] == 0 and value[0] >= 0 for row in neumann for value in row), "positive resolvent") + bound = block(positive, retained, retained) + extra = times(times(block(positive, retained, eliminated), neumann), + block(positive, eliminated, retained)) + bound = [[add(a, b) for a, b in zip(x, y)] for x, y in zip(bound, extra)] + for i, row in enumerate(delta): + for j, value in enumerate(row): + need(mu(value) <= bound[i][j][0] and bound[i][j][1] == 0, "entrywise Schur majorant") + for i in range(len(retained)): + escape = sum((positive[retained[i]][j][0] for j in eliminated), Q(0)) + rowbound = sum((x[0] for x in bound[i]), Q(0)) + need(rowbound <= rho-(1-rho)*escape, "strong row budget slack") + for j in range(len(retained)): + escape = sum((positive[i][retained[j]][0] for i in eliminated), Q(0)) + columnbound = sum((row[j][0] for row in bound), Q(0)) + need(columnbound <= rho-(1-rho)*escape, "strong column budget slack") + return current + + +def generated(n, seed, rho): + raw = [[z((3*i+5*j+seed) % 7-3, (5*i+2*j+2*seed) % 5-2) + for j in range(n)] for i in range(n)] + maximum = max(norms(raw)) + factor = rho/maximum if maximum else Q(0) + defect = [[mul(z(factor), entry) for entry in row] for row in raw] + return [[add(entry, identity(n)[i][j]) for j, entry in enumerate(row)] + for i, row in enumerate(defect)] + + +def general_census(): + matrices = comparisons = quotients = restrictions = 0 + digest = sha256() + for n in (1, 2, 3, 4): + for seed in (0, 1, 2, 3): + for rho in (Q(0), Q(1, 4), Q(1, 2), Q(3, 4)): + matrix = generated(n, seed, rho) + matrices += 1 + # 0 discarded, 1 eliminated, 2 retained: all principal + # restrictions and elimination subsets with nonempty output. + for labels in product((0, 1, 2), repeat=n): + eliminated = [i for i, flag in enumerate(labels) if flag == 1] + retained = [i for i, flag in enumerate(labels) if flag == 2] + if not retained: + continue + current = check_one(matrix, rho, eliminated, retained) + comparisons += 1 + digest.update(repr(current).encode()) + # Restricting a current Schur complement retains the + # previously eliminated set in its original description. + reduced = retained[::2] + restricted = block(current, list(range(0, len(retained), 2)), + list(range(0, len(retained), 2))) + need(restricted == schur(matrix, eliminated, reduced), "restriction/elimination closure") + restrictions += 1 + if len(retained) >= 2: + next_eliminate = retained[::2] + next_retain = retained[1::2] + nested = schur(current, list(range(0, len(retained), 2)), + list(range(1, len(retained), 2))) + need(nested == schur(matrix, eliminated+next_eliminate, next_retain), + "principal Schur quotient identity") + quotients += 1 + reversed_matrix = block(matrix, list(reversed(range(n))), list(reversed(range(n)))) + need(max(norms(minus(reversed_matrix, identity(n)))) <= rho, + "simultaneous permutation preserves hypotheses") + return {"matrices": matrices, "principal_restriction_schur_cases": comparisons, + "restriction_identities": restrictions, "nested_quotient_identities": quotients, + "sizes": [1, 2, 3, 4], "rhos": ["0", "1/4", "1/2", "3/4"], + "component_envelope": True, "result_digest": digest.hexdigest()} + + +def toeplitz(symbol): + return [[symbol[i-j] if i >= j else ZERO for j in range(len(symbol))] + for i in range(len(symbol))] + + +def parity_census(): + nodes = shear_checks = 0 + roots = [] + + def walk(matrix, rho): + nonlocal nodes, shear_checks + nodes += 1 + n = len(matrix) + need(max(norms(minus(matrix, identity(n)))) <= rho, "recursive component envelope") + need(matrix == toeplitz([row[0] for row in matrix]), "lower Toeplitz descendant") + if n == 1: + return + evens, odds = list(range(0, n, 2)), list(range(1, n, 2)) + E, O = block(matrix, evens, evens), block(matrix, odds, evens) + upper = block(matrix, evens, odds) + m = n//2 + shift = [[ONE if i == j+1 else ZERO for j in range(m)] for i in range(m)] + K = times(O, inverse(E)) + need(upper == times(shift, O), "parity upper block is ZO") + need(block(matrix, odds, odds) == E, "parity diagonal blocks agree") + S = schur(matrix, evens, odds) + need(S == minus(E, times(times(shift, O), K)), "source Schur coefficient formula") + need(times(O, inverse(E)) == times(inverse(E), O), "Toeplitz commuting K") + need(max(norms(O)) <= rho, "off-diagonal rho bound") + bound = rho/(1-rho) + need(max(norms(K)) <= bound and max(norms(times(shift, K))) <= bound, "local compensated shear bound") + lower = [[ONE if i == j else (K[i-m][j] if i >= m and j < m else ZERO) + for j in range(2*m)] for i in range(2*m)] + need(max(norms(lower)) <= 1+bound and max(norms(inverse(lower))) <= 1+bound, + "completed shear and inverse bound") + shear_checks += 1 + walk(E, rho) + walk(S, rho) + + for n in (1, 2, 4, 8): + for seed in (0, 1, 2): + rho = Q(1, 2) + raw = [z((i+seed) % 3-1, (2*i+seed) % 3-1) for i in range(n)] + total = sum((mu(x) for x in raw), Q(0)) + factor = rho/total if total else Q(0) + symbol = [add(ONE if i == 0 else ZERO, mul(z(factor), value)) + for i, value in enumerate(raw)] + matrix = toeplitz(symbol) + walk(matrix, rho) + roots.append({"n": n, "seed": seed, "source_component_defect": str(sum((mu(sub(value, ONE if i == 0 else ZERO)) for i, value in enumerate(symbol)), Q(0)))}) + return {"root_cases": len(roots), "recursive_nodes": nodes, "nonleaf_shear_checks": shear_checks, + "roots": roots, "physical_compiler_executed": False} + + +def controls(): + rho = Q(1, 2) + sharp = [[z(1-rho), ZERO, ZERO], [ZERO, z(1+rho), ZERO], [ZERO, ZERO, ONE]] + result = schur(sharp, [2], [0, 1]) + need(max(norms(minus(result, identity(2)))) == rho, "rho constant is sharp") + need(max(norms(result)) == 1+rho and max(norms(inverse(result))) == 1/(1-rho), + "direct and inverse constants are sharp") + # At rho=1 an admitted principal pivot may be singular. + rejected = False + try: + schur([[ZERO, ZERO], [ZERO, ONE]], [0], [1]) + except ValueError as exc: + rejected = "singular principal pivot" in str(exc) + need(rejected, "rho<1 pivot margin control") + # For rho>1 even an invertible principal pivot can exceed the bound. + beyond = [[z(Q(1, 4)), z(Q(3, 4))], [z(Q(3, 4)), z(Q(1, 4))]] + need(max(norms(minus(beyond, identity(2)))) == Q(3, 2), "beyond-one premise") + bad = schur(beyond, [0], [1]) + need(max(norms(minus(bad, identity(1)))) == 3 > Q(3, 2), "beyond-one failure witness") + # Row-only input bound does not imply a column conclusion. + r = Q(3, 4) + row_only = [[ONE, z(r), ZERO], [z(r), ONE, ZERO], [z(r), ZERO, ONE]] + need(norms(minus(row_only, identity(3)))[1] == r, "row-only admission") + row_descendant = schur(row_only, [0], [1, 2]) + need(norms(minus(row_descendant, identity(2)))[0] == Q(9, 8) > r, + "column conclusion needs its own column hypothesis") + # Nonprincipal restrictions and arbitrary similarity are not granted. + need(block(identity(2), [0], [1]) == [[ZERO]], "nonprincipal identity block is zero") + similarity = [[ZERO, z(2*r)], [ZERO, ZERO]] + need(max(norms(similarity)) > r, "nonisometric basis may amplify defect") + # A usual-modulus hypothesis cannot silently become a component one. + phase = z(Q(3, 10), Q(3, 10)) + need(phase[0]**2+phase[1]**2 == Q(9, 50) < Q(1, 4), "usual modulus rho-half admission") + component_boundary = [[add(ONE, phase), ZERO], [ZERO, ONE]] + component_result = schur(component_boundary, [1], [0]) + need(mu(sub(component_result[0][0], ONE)) == Q(3, 5) > rho, + "component conclusion requires component admission") + return {"sharp_rho_defect": "1/2", "sharp_direct": "3/2", "sharp_inverse": "2", + "rho_one_singular_pivot_rejected": True, + "rho_three_halves_counterexample_defect": "3", + "row_only_column_counterexample": "9/8 > 3/4", + "modulus_only_component_boundary": "|z|^2=9/50<1/4 but mu(z)=3/5>1/2 for z=(3+3i)/10", + "nonprincipal_and_nonisometric_extensions_rejected": True} + + +def main(): + parser = argparse.ArgumentParser() + parser.add_argument("--output", type=Path) + args = parser.parse_args() + result = {"status": "PASS_EXACT_COMPONENT_SCHUR_CLOSURE_NO_NEW_KAPPA", + "general_cases": general_census(), "parity_cases": parity_census(), + "controls": controls(), + "checker_sha256": sha256(Path(__file__).read_bytes()).hexdigest(), + "finite_scope": "Gaussian-rational component envelopes only; universal modulus/component theorem is written separately; no predecessor module imports or physical compiler execution"} + if args.output is not None: + args.output.write_text(json.dumps(result, indent=2, sort_keys=True) + "\n") + print(result["status"]) + + +if __name__ == "__main__": + main() diff --git a/research/schur-majorant-closure/source/PR4205-README.md.txt b/research/schur-majorant-closure/source/PR4205-README.md.txt new file mode 100644 index 0000000000..c44ab08cf5 --- /dev/null +++ b/research/schur-majorant-closure/source/PR4205-README.md.txt @@ -0,0 +1,165 @@ +# Certified rational FFT and rounded parity-triangular programs + +I connect the retained rational phase construction to the actual FFT and +Toeplitz-shear gate schedule, and prove a complete coefficient/data error +bound for both dirty banks. I execute the adapted one- and two-wire gates. +This advances the child-execution obligation left by PR4198's macro replay. +I also execute the retained near-identity parity-triangular recursion and +its inverse under one coefficient and data-grid allocation. I preserve +the source's parallel even/odd branches, including reversed caller wires. + +For dyadic \(n=2^d\), the target is \((x,y)\mapsto(x,y+Tx)\), with rational +Toeplitz \(T\). I use rational butterflies +\[ +\begin{pmatrix}a&bw\\b&-aw\end{pmatrix}, +\qquad a^2+b^2=|w|^2=1, +\] +and adjoints of the same stored gates. I certify their approximation to +the ideal FFT, prepare the **unnormalized** DFT multipliers, round those +coefficients before online use, and round data after each gate. + +The exact rational circuit restores the source. Fixed-grid execution +generally has nonzero source-restoration error, which I include in the +budget rather than treating exact coefficient unitarity as exact data recovery. + +## Result and source + +For kernel envelopes \(M_g,M_h\), let \(M=M_g+M_h\), phase error +\(\nu=2^{-P}\), multiplier grid \(v=2^{-S}\), and data grid \(u=2^{-F}\). +With \(L=4d+8\) and \(H=1+M+2v\), I prove +\[ +\|\widehat z-S(T)z_0\|_2 +\le\bigl(4(d+1)M\nu+2v\bigr)R+LHnu, +\quad R\ge\max(1,\|z_0\|_2). +\] +I give explicit \(P,S,F\) choices for target \(2^{-t}\), preserve finer +incoming grids, and bound coefficient, signed data-record and temporary +widths. Every exact contiguous circuit segment and inverse segment has +norm at most \(H\); I do not multiply amplification once per layer. +[PROOF.md](PROOF.md) gives the domains, oracle bounds and full derivation. + +For the triangular program I admit a rational symbol \(f\) of dyadic +length \(N\) with component-l1 distance from the identity at most \(1/2\). +I round the scalar leaves and use exact reciprocals of those stored values +for the inverse. I prove forward and inverse endpoint error +\[ +eR+32DBN\,2^{-F}\le2^{-t},\qquad +e=2qB^3\,2^{-s}, +\] +where \(B=100N^3\), \(q=2\log_2N+1\) and +\(D=4(\log_2N)^2+12\log_2N+1\). I give explicit \(s,P,S,F\), preserve +the incoming grid, and bound intermediate states using arbitrary circuit +segments. The online records and gate temporaries need +\(O(F_0+t+\log N+\log R)\) bits. +[TRIANGLE-PROOF.md](TRIANGLE-PROOF.md) separates that claim from exact +offline preparation and physical coefficient delivery. + +I start from canonical main `12fa8c5c844be21bfefb38a19503fbd867a11244`, +priority 7, and pin the retained PR4100 source +`337d04939571a637aeab54a0f58f54fde811663a`. +[SOURCES.json](SOURCES.json) binds the actual bytes. +[Discussion4202](https://github.com/CrocSwap/integer-mult-bounds/discussions/4202) +records the claim, overlap and publication handoff. + +## Verification + +Use CPython 3.12 and its standard library: + +```sh +python3.12 -B scripts/research_package.py \ + --package research/rational-unitary-fft +``` + +I declare four normal/optimized commands, with 240-second limits each. +I authenticate the source before parsing its schedule or executing its +interval oracle. The adapter preserves bit reversal, gate ownership, +disjoint layers, shear orientation and chronological calls. It replaces +four coefficient sites and the relevant NumPy arithmetic with certified +rational operations; it preserves source assertions under optimized execution. + +The finite replay covers 12 cases through \(n=16\), 1,428 gates and +61 rounded data states. I include real/complex Toeplitz inputs, zero and +rank-one matrices, large dirty values, cancellation, an 80-bit incoming +grid and a small-grid source-loss witness. I check exact local unitarity, +FFT adjoint round trips, direct Fourier enclosures, exact Toeplitz +references, both banks' error bounds and canonical signed grid widths. + +The direct DFT reference uses a separate formula but shares the certified +phase oracle. Its squared-Frobenius checks corroborate consequences of +the written operator-norm proof; they do not independently establish the +sharper operator bound. The exact dense matrices serve as checker oracles. +I do not use their accumulated denominators as online data representations. + +Controls cover inverse order, missing bit reversal, wrong multiplier +normalization, the inverse twist, nonunitary coefficient rounding, +underfunded phase/data precision, discarded incoming precision, stale +phase coefficients, floating inputs and source corruption. +I compare the complete typed [RESULT.json](RESULT.json). +Observed temporary heights describe completed complex components, not +an exhaustive trace of internal `Fraction` temporaries. + +The recursive verifier adds ten cases through 16 wires, 1,806 gates and +62 rounded states in forward and inverse directions. I check the exact +macro factorization against a direct Toeplitz matrix and the inverse +against separate Gauss-Jordan elimination. I include complex non-dyadic +leaves, the half-identity admission boundary, a zero odd polynomial, +reversed wires, a 100-bit incoming grid and small-grid data. +Controls reject missing Schur correction, swapped parity banks, serialized +siblings, wrong inverse order and leaf adjoints used as reciprocals. +I check rounded round trips under their separate error and second-pass +width allowances. [TRIANGLE-RESULT.json](TRIANGLE-RESULT.json) records +the complete recursive receipt. Exact dense endpoint arithmetic remains +a checker oracle, outside the online representation claim. + +## Overlap and attribution + +I inspected 100 recent PR records and 35 hub comments, the retained +phase/FFT implementations and targeted local searches. The overlap helper +searched 5,234 records and found one unrelated rational-unitary frame +example, with no usable remote cache. At the next checkpoint I refreshed +unchanged main and source feedback and inspected 60 PR records and +10/707 hub comments. PR4201 concerns CRT tapes and PR4203 concerns D4 +interfaces. I found no equivalent certified unitary child in that coverage; +older comments, arbitrary diffs, unpublished work and literature priority +remain outside the search. +Before publication I rechecked unchanged main, the source head, 60 PR +records and 12/708 hub comments. +Before the recursive extension I refreshed unchanged main and inspected +40 PR records and 12/713 hub comments, following a separate 100-PR/35-comment +orientation. I found no competing rounded parity-child claim in that +coverage. James Reed's claimed finite PR4198 check addresses the generator +identities, a separate question. I extend this PR rather than duplicate +the child package. + +I credit Chafik Boukhalfa/PR628 for exact rational unit phases and the +certified interval machinery; Vlado Vojdanovski/PR1673 for the FFT/shear +circuit; the classical Fourier/FFT lineage; and Cinna Davis for the later +caller. PR3709 already supplies certified inward twiddles and rounded FFT +execution under a different normalization. I claim the connection to this +unitary child and its complete approximation/rounding contract, not the +invention of certified phases or rounded FFTs. +Vlado also supplied the parity identity, recursion and qualitative +near-identity stability argument. I add the explicit global coefficient +perturbation, inverse, rounding and intermediate-width contract, with +source-bound recursive execution. + +I preserve the first completed revision `f02a4ab5ab70a8af80415ac35c5b48cd5a93a475` +and its FFT receipt +`2e203e42d3d617e828e3341ffeb44254c931db2aebb8a040d04d67338b5b4016`. +Its [hosted replay](https://github.com/CrocSwap/integer-mult-bounds/actions/runs/39442494617) +and 18-file export remain evidence for that revision. The recursive +extension has a separate receipt and verification commands. + +Jose Manuel (`jmbarrancoml`), with substantial OpenAI Codex assistance, +including source-analysis agents. I count those agents within the author +process. I retain frozen sources and notices, and claim no independent +human/formal-kernel acceptance, worldwide novelty or selected-frontier change. +Apache-2.0. + +## Open next questions + +In [TASK.json](TASK.json) I specify the next steps and blockers: compose +these children inside the actual bounded-generator program, then bind +their coefficients and data widths to the physical +Gaussian caller. This package supplies neither complete fixed-tape +lowering nor complete multiplication-theorem acceptance. diff --git a/research/schur-majorant-closure/source/PR4205-TRIANGLE-PROOF.md.txt b/research/schur-majorant-closure/source/PR4205-TRIANGLE-PROOF.md.txt new file mode 100644 index 0000000000..f923f4ff2d --- /dev/null +++ b/research/schur-majorant-closure/source/PR4205-TRIANGLE-PROOF.md.txt @@ -0,0 +1,256 @@ +# Rounded parity-triangular execution + +Jose Manuel (`jmbarrancoml`), with substantial OpenAI Codex assistance. +Apache-2.0. + +## Domain and result + +I extend the FFT/shear argument in [PROOF.md](PROOF.md) to Vlado/PR1673's +retained `triangle_plan` and its exact stored-coefficient inverse. +For \(N=2^d\), let \(T=L(f)\) be lower triangular Toeplitz over +\(\mathbb Q(i)\). I admit +\[ +\sum_{j=0}^{N-1}(|\Re(f_j-\delta_{j0})| + +|\Im(f_j-\delta_{j0})|)\le\tfrac12. +\tag{1} +\] +This executable condition implies both induced \(1\)- and infinity-norm +bounds \(\|T-I\|\le1/2\). I do not extend the executable admission to +complex symbols that satisfy only the weaker modulus-sum condition. +The caller may supply a permutation of the \(N\) wires, including reversal. + +For target \(2^{-t}\), input norm at most \(R\ge1\), and an incoming dyadic +grid with \(F_0\) fractional bits, I construct one rational gate program +\(\widehat T\) and its inverse using the same stored coefficients. +After nearest component rounding on one common \(F\)-grid at each gate, +I prove error at most \(2^{-t}\) for either \(Tx\) or \(T^{-1}x\). +The input to each direction must satisfy the stated radius and grid. +I give a separate allowance for a rounded forward/inverse round trip. + +I use the following conservative bounds: +\[ +B=100N^3,\quad q=2d+1,\quad +D=4d^2+12d+1,\quad G=N(2d^2+8d+1). +\tag{2} +\] +Here \(q\) counts macro layers, \(D\) bounds physical gate layers and \(G\) +bounds logical one/two-wire gates. I preserve empty source layers and +zero shears. I claim logical execution and precision, with physical tape +delivery and full bounded-generator composition left for later work. + +## Descendants and ideal prefixes + +I use the predecessor's parity identity. The source executes the upper +shear, then the block diagonal, then the lower shear. After parity +permutation, their ordinary matrix product is +\[ +T\sim\begin{pmatrix}I&0\\K&I\end{pmatrix} +\begin{pmatrix}E&0\\0&S\end{pmatrix} +\begin{pmatrix}I&ZK\\0&I\end{pmatrix}, +\quad +K=OE^{-1},\quad S=E-ZOK. +\tag{3} +\] +All \(E,O,K\) are commuting lower +triangular Toeplitz matrices. The source computes their coefficients +with exact truncated series and convolution. + +Every recursive descendant is a principal Schur complement of a +principal restriction of the original \(T\), after a permutation. +For either induced norm, a principal restriction \(I+H\) still has +\(\|H\|\le1/2\). Its inverse has norm at most two. For a Schur complement +\(M\), the inverse is a principal block of that inverse, so +\(\|M^{-1}\|\le2\). The Schur formula also gives +\[ +\|M-I\|\le\tfrac12+ + \frac{(1/2)^2}{1-1/2}=1,\qquad \|M\|\le2. +\tag{4} +\] +Nested principal restrictions of Schur complements preserve this +description by retaining the previously eliminated set. I need the +original near-identity hypothesis on arbitrary principal restrictions; +conditioning only leading sections would not suffice. + +Thus \(\|O\|_{1,\infty},\|E^{-1}\|_{1,\infty}\le2\), and +\(\|K\|_{1,\infty},\|ZK\|_{1,\infty}\le4\). For a lower triangular +Toeplitz matrix, the full coefficient modulus sum equals its induced +1-norm. The component sum is therefore at most \(4\sqrt2<6\). +An ideal completed shear and its inverse have norm at most five. +An ideal middle block and its inverse have norm at most two. + +I apply the FFT/shear segment lemma to each child, whose cyclic and +negacyclic kernel component envelopes sum to less than six. +Both ideal and compiled child internal prefixes, suffixes and their +inverses have norm at most seven; for compiled children the additional +multiplier allowance \(2v\) still fits because \(v\le1/32\) and +\(4\sqrt2+2v<6\). + +For ideal physical prefixes and their inverses, I obtain +\[ +B(N)\le\max(7,\ 5B(N/2),\ 7\cdot2\cdot5),\qquad B(1)\le2. +\tag{5} +\] +The three cases stop in the first shear, recursive middle or last shear. +For inverse prefixes I reverse the factors in the inverse of that +prefix; the same norm products apply. Equation (2) dominates (5). +Disjoint siblings combine by the maximum of their operator norms. + +## Stored coefficients and aligned macro errors + +At each recursion depth, equal-size siblings emit identical schedules +regardless of their coefficients. I group their disjoint shear children +into one macro layer, recurse on the middle, and group their scalar leaves. +This gives \(q=2d+1\). The source keeps the two siblings in parallel. +The retained shear count gives +\[ +D(d)\le D(d-1)+2(4(d-1)+8),\quad D(0)=1, +\] +and summing the gates at each level gives the bounds in (2). + +Set +\[ +s=t+\left\lceil\log_2(4qB^3(R+1))\right\rceil,\quad +\varepsilon=2^{-s},\quad +P=s+\left\lceil\log_2(48(d+1))\right\rceil,\quad S=s+2. +\tag{6} +\] +I use \(P\) for the existing certified unit phases and \(S\) for stored +spectral multipliers. A child of size \(m\) has unrounded endpoint defect +\[ +4(\log_2m+1)M\,2^{-P}+2^{1-S}\le\varepsilon, +\quad M<6. +\tag{7} +\] +For the scalar leaves I store nearest \(s\)-grid values. Their complex +error is at most \(\varepsilon\). The ideal modulus lies between \(1/2\) +and two; the stored modulus is at least \(1/4\). In the reverse program +I use the exact reciprocal of that same stored scalar. I retain the +unrounded rational coefficients throughout recursive series preparation. +I do not apply leaf rounding to the unitary twist gates. + +For each ideal macro \(A_j\), its compiled counterpart has +\(\|\widehat A_j-A_j\|\le\varepsilon\), because its pieces act on disjoint +supports. Write \(Q_j=A_j\cdots A_1\), \(Q_0=I\), and +\[ +G_j=Q_j^{-1}(\widehat A_j-A_j)Q_{j-1},\qquad +Z_j=Q_j^{-1}\widehat A_j\cdots\widehat A_1. +\] +Then \(Z_j=(I+G_j)Z_{j-1}\) and +\[ +\|G_j\|\le B^2\varepsilon,\qquad +\theta=qB^2\varepsilon\le\tfrac14. +\tag{8} +\] +For a consecutive product \(W\) of these factors, the sum of the bounds +on its perturbations is at most \(\theta\). Expanding the product and +using \(\prod(1+a_j)\le1/(1-\sum a_j)\) gives +\[ +\|W\|,\|W^{-1}\|\le(1-\theta)^{-1}<2,\quad +\|W-I\|,\|W^{-1}-I\|\le\theta/(1-\theta)\le2\theta. +\tag{9} +\] +For the inverse inequality I use +\(\prod(1-a_j)\ge1-\sum a_j\), and the expansion of the inverse factors. +Since \(\widehat T=T Z_q\), both directions satisfy the loose common bound +\[ +\|\widehat T-T\|,\ \|\widehat T^{-1}-T^{-1}\| +\le 2qB^3\varepsilon=:e. +\tag{10} +\] +I use the exact inverse of the stored approximate circuit here. +The proof does not replace a nonunitary scalar's inverse with its adjoint. + +## Suffixes, accumulated rounding and word widths + +Actual macro prefixes and their inverses have norm at most \(2B\). +For a suffix after macro \(j\), I write it as +\[ +Q_q W Q_j^{-1}. +\] +Its inverse has the reversed inverse factors. Since +\(\|Q_q\|,\|Q_q^{-1}\|\le2\), (9) bounds both by \(4B\). +An internal child fragment adds a factor of at most seven. +Thus \(K=32B\) bounds physical prefixes, suffixes and their inverses +in either execution direction. + +An arbitrary physical segment may need the larger bound \(K^2\): +I express it as a prefix times an inverse prefix. I use this bound +for intermediate states after several rounding errors. +One physical layer contributes Euclidean rounding error at most +\(\sqrt{N/2}\,u\le Nu\), where \(u=2^{-F}\). +Therefore I obtain +\[ +\|\widehat z-T^{\pm1}x\|\le eR+DKNu, +\qquad +\max_{\text{intermediate states}}\|z\|\le +A:=KR+DK^2Nu. +\tag{11} +\] +Choose +\[ +F=\max\left(F_0,\ t+\left\lceil\log_2(64DBN)\right\rceil\right). +\tag{12} +\] +Equations (6), (10) and (12) assign at most \(2^{-t}/2\) to each +of coefficient and data error. Also \(A\le K(R+2^{-t}/2)\). +I retain finer incoming grids. + +If \(\widehat a=(a+ib)/2^s\) is a stored leaf, its exact reciprocal is +\(2^s(a-ib)/(a^2+b^2)\). With \(|\widehat a|<3\), its component height +is at most \(2s+6\). I use the still looser common bound +\[ +C_{\rm bits}=\max(4P+24,\ S+5,\ 2s+16),\quad +I=\max(1,\lceil\log_2\max(1,A)\rceil)+2. +\tag{13} +\] +The previous constant-size rational gate evaluation argument then gives +signed canonical grid width \(F+I\) and temporary allowance +\[ +2F+8C_{\rm bits}+2I+32. +\tag{14} +\] +All these online widths are \(O(F_0+t+\log N+\log R)\). +Exact offline series, Schur coefficients and dense checker matrices can +have longer denominators. I do not include them in the online word claim. +The original preprocessing proof supplies the algebraic preparation +context; complete setup and physical coefficient-delivery costs remain open. + +For a rounded forward/inverse round trip, let +\(E=eR+DKNu\). The forward output has norm at most \(2R+E\). +Applying the same inverse program gives the separate allowance +\[ +\|\widehat{\operatorname{inverse}}(\widehat{\operatorname{forward}}(x))-x\| +\le 2E+e(2R+E)+DKNu. +\tag{15} +\] +I do not promise exact restoration after data rounding. +For this extra second pass I use radius \(R'=2R+E\) in the amplitude +and integer-width formulas, keeping the same stored gates and \(F\). +The verifier records that enlarged second-pass width separately. + +## Executable evidence and attribution + +I extract the authenticated `toep`, `lower`, `invseries`, `conv` and +`triangle_plan` functions. I change only the floating diagnostic and the +scalar leaf return. I supply exact array/convolution operations and +certified child callbacks, keeping the source's `parallel` and `inverse`. +I retain even/odd wire order, reversed caller indices, empty layers and +zero shears. The verifier checks exact macro identities against a direct +Toeplitz matrix and the inverse against separate Gauss-Jordan elimination. + +The exact endpoint Frobenius checks corroborate consequences of the +operator proof; they do not independently establish its sharper norm +bound. I compare rounded vectors with exact endpoint images in both +directions and include a nonzero rounded round-trip error witness. +I test mutations of the Schur correction, parity banks, parallel middle +and inverse order, plus the nonunitary-leaf adjoint error. +I label observed temporary heights as completed rational components; +I do not claim exhaustive instrumentation of `Fraction` internals. + +I credit Vlado Vojdanovski/PR1673 for the parity factorization, recursion, +Schur descendant argument and circuit; Chafik Boukhalfa/PR628 for phases; +and Cinna Davis for the later caller. I add the explicit common +coefficient/grid allocation, inverse and intermediate-width accounting, +and source-bound rational execution. Internal source-analysis agents +belong to the author process. Independent mathematical review, +full generator/caller composition and physical lowering remain open. diff --git a/research/schur-majorant-closure/source/PR4205-triangular.py.txt b/research/schur-majorant-closure/source/PR4205-triangular.py.txt new file mode 100644 index 0000000000..0d045d04a9 --- /dev/null +++ b/research/schur-majorant-closure/source/PR4205-triangular.py.txt @@ -0,0 +1,199 @@ +"""Source-bound rational parity recursion with a common precision allocation. + +Jose Manuel (jmbarrancoml), with substantial OpenAI Codex assistance. +Apache-2.0. Parity recursion and its stability premise: Vlado/PR1673. +""" +import ast +import copy +from fractions import Fraction as Q +from hashlib import sha256 +from types import SimpleNamespace + +from exact import (C, Mat, Vec, ceil_log2, component_l1, inverse_gate, need, + rounded) +from engine import Builder, Phases, split_kernel + + +def allocation(n, radius, target, incoming=0): + need(type(n) is int and n > 0 and n & (n - 1) == 0, "dyadic triangle size") + need(type(radius) in (int, Q) and radius >= 1, "exact triangle radius") + need(type(target) is int and target >= 1, "positive triangle target") + need(type(incoming) is int and incoming >= 0, "incoming triangle grid") + d = n.bit_length() - 1 + q, depth, bound = 2 * d + 1, 4 * d * d + 12 * d + 1, 100 * n ** 3 + s = target + ceil_log2(4 * q * bound ** 3 * (radius + 1)) + p = s + ceil_log2(48 * (d + 1)) + multiplier = s + 2 + data = max(incoming, target + ceil_log2(64 * depth * bound * n)) + epsilon, u = Q(1, 1 << s), Q(1, 1 << data) + theta = q * bound ** 2 * epsilon + coefficient = 2 * q * bound ** 3 * epsilon + rounding = 32 * depth * bound * n * u + need(theta <= Q(1, 4) and coefficient * radius + rounding <= Q(1, 1 << target), + "complete triangular error allocation") + amplitude = 32 * bound * radius + 1024 * depth * bound ** 2 * n * u + integer = max(1, ceil_log2(max(Q(1), amplitude))) + 2 + height = max(4 * p + 24, multiplier + 5, 2 * s + 16) + return dict(n=n, radius=radius, target_bits=target, incoming_bits=incoming, + ideal_bound=bound, macro_layers=q, layer_bound=depth, + gate_bound=n * (2 * d * d + 8 * d + 1), + leaf_bits=s, phase_bits=p, multiplier_bits=multiplier, + data_bits=data, epsilon=epsilon, theta=theta, + coefficient_error=coefficient, rounding_error=rounding, + total_error=coefficient * radius + rounding, + physical_prefix_suffix_bound=32 * bound, + segment_bound=1024 * bound ** 2, amplitude_bound=amplitude, + integer_bits=integer, coefficient_height_bound=height, + temporary_bits=2 * data + 8 * height + 2 * integer + 32) + + +class Plan(list): + """Actual layers plus consecutive, disjoint-support macro partitions.""" + def __init__(self, layers, blocks): + super().__init__(layers) + self.blocks = blocks + + def __add__(self, other): + need(isinstance(other, Plan), "typed triangular composition") + offset = len(self) + blocks = [dict(block) for block in self.blocks] + blocks += [dict(start=b["start"] + offset, stop=b["stop"] + offset, + pieces=list(b["pieces"])) for b in other.blocks] + return Plan(list(self) + list(other), blocks) + + +class Concatenate: + def __getitem__(self, parts): + values = [] + for part in parts: + values.extend(part if isinstance(part, (list, tuple)) else [part]) + return Vec(values) + + +def convolution(a, b): + return Vec(sum((a[j] * b[k - j] for j in range(len(a)) + if 0 <= k - j < len(b)), C()) + for k in range(len(a) + len(b) - 1)) + + +class AdaptTriangle(ast.NodeTransformer): + def __init__(self): + self.changes = [] + + def visit_Assign(self, node): + if (len(node.targets) == 1 and isinstance(node.targets[0], ast.Subscript) + and isinstance(node.targets[0].slice, ast.Constant) + and node.targets[0].slice.value == "max_triangle_coefficient"): + self.changes.append("exact-component-diagnostic") + node.value = ast.parse( + "max(STATS['max_triangle_coefficient'], component_l1(f))", + mode="eval").body + return node + return self.generic_visit(node) + + def visit_Return(self, node): + if (isinstance(node.value, ast.Call) and isinstance(node.value.func, ast.Name) + and node.value.func.id == "diag"): + self.changes.append("stored-rounded-leaf") + node.value.func.id = "leaf_diag" + return self.generic_visit(node) + + +class Triangle: + def __init__(self, bound, circuit_source, oracle_source): + self.bound, self.circuit_source = bound, circuit_source + self.phases = Phases(bound["phase_bits"], oracle_source) + base = Builder(self.phases, bound["multiplier_bits"], circuit_source) + self.source_parallel = base.namespace["parallel"] + self.source_inverse = base.namespace["inverse"] + self.children, self.leaves = [], [] + selected = {"toep", "lower", "invseries", "conv", "triangle_plan"} + tree = ast.parse(circuit_source) + tree.body = [copy.deepcopy(node) for node in tree.body + if isinstance(node, ast.FunctionDef) and node.name in selected] + need({node.name for node in tree.body} == selected, "complete parity source") + self.original_ast = sha256(ast.dump(tree).encode()).hexdigest() + adapter = AdaptTriangle() + tree = ast.fix_missing_locations(adapter.visit(tree)) + need(adapter.changes == ["exact-component-diagnostic", "stored-rounded-leaf"], + "exact declared parity adaptations") + self.adapted_ast = sha256(ast.dump(tree).encode()).hexdigest() + facade = SimpleNamespace(asarray=lambda a, dtype=None: Vec(a), + array=lambda a, dtype=None: Mat(a), + zeros=lambda n, dtype=None: Vec([0] * n), + convolve=convolution, r_=Concatenate()) + self.stats = {"triangle_nodes": 0, "max_triangle_coefficient": Q(0)} + self.namespace = dict(np=facade, STATS=self.stats, component_l1=component_l1, + leaf_diag=self.leaf, parallel=self.parallel, + toeplitz_shear=self.shear) + exec(compile(tree, "", "exec", optimize=0), + self.namespace) + + def leaf(self, indices, values): + need(len(indices) == len(values) == 1, "scalar triangular leaf") + wanted = values[0] + stored = rounded(wanted, self.bound["leaf_bits"]) + epsilon = self.bound["epsilon"] + need(Q(1, 4) <= wanted.norm2() <= 4, "ideal scalar leaf margin") + need((stored - wanted).norm2() <= epsilon ** 2 + and stored.norm2() >= Q(1, 16), "stored scalar leaf margin") + gate = Mat([[stored]]) + inverse = inverse_gate(gate) + need(stored * inverse[0][0] == 1, "same stored scalar reciprocal") + piece = dict(kind="leaf", ids=list(indices), ideal=Mat([[wanted]]), + error=epsilon, stored=stored, reciprocal=inverse[0][0]) + self.leaves.append(piece) + return Plan([[(tuple(indices), gate)]], + [dict(start=0, stop=1, pieces=[piece])]) + + def shear(self, target, source, matrix): + n = len(source) + need(len(set(source + target)) == 2 * n, "owned disjoint parity banks") + child = Builder(self.phases, self.bound["multiplier_bits"], self.circuit_source) + local = child.plan(matrix) + g, h = split_kernel(matrix) + envelope = component_l1(g) + component_l1(h) + v = Q(1, 1 << self.bound["multiplier_bits"]) + defect = 4 * (n.bit_length()) * envelope * self.phases.nu + 2 * v + need(envelope + 2 * v <= 6 and defect <= self.bound["epsilon"], + "bounded parity child and allocated operator defect") + mapping = source + target + layers = [[(tuple(mapping[i] for i in ids), gate) for ids, gate in layer] + for layer in local] + piece = dict(kind="shear", ids=list(mapping), ideal=matrix, error=defect, + envelope=envelope, source_ast=child.original_ast, + adapted_ast=child.adapted_ast, local_layers=len(local)) + self.children.append(piece) + return Plan(layers, [dict(start=0, stop=len(layers), pieces=[piece])]) + + def parallel(self, left, right): + need([(b["start"], b["stop"]) for b in left.blocks] + == [(b["start"], b["stop"]) for b in right.blocks], + "equal sibling macro boundary partitions") + blocks = [] + for a, b in zip(left.blocks, right.blocks): + pieces = a["pieces"] + b["pieces"] + ids = [i for piece in pieces for i in piece["ids"]] + need(len(ids) == len(set(ids)), "disjoint sibling macro supports") + blocks.append(dict(start=a["start"], stop=a["stop"], pieces=pieces)) + return Plan(self.source_parallel(left, right), blocks) + + def plan(self, symbol, indices=None): + symbol = Vec(symbol) + n = len(symbol) + need(n == self.bound["n"], "allocated triangle dimension") + need(component_l1(symbol - Vec([1] + [0] * (n - 1))) <= Q(1, 2), + "component-l1 near-identity admission") + indices = list(range(n)) if indices is None else list(indices) + need(len(indices) == n and sorted(indices) == list(range(n)), "triangle wire permutation") + result = self.namespace["triangle_plan"](indices, symbol) + need(self.stats["triangle_nodes"] == 2 * n - 1, "complete parity recursion tree") + need(len(result.blocks) == self.bound["macro_layers"] + and len(result) <= self.bound["layer_bound"] + and sum(map(len, result)) <= self.bound["gate_bound"], "complete schedule bounds") + return result + + def inverse(self, plan): + # Forward pieces certify forward defects. Inverse endpoint bounds use + # the inverse-product proof, not relabelled forward macro certificates. + return self.source_inverse(plan) diff --git a/research/schur-majorant-closure/source/predecessor_exact.py b/research/schur-majorant-closure/source/predecessor_exact.py new file mode 100644 index 0000000000..9456b0bc39 --- /dev/null +++ b/research/schur-majorant-closure/source/predecessor_exact.py @@ -0,0 +1,236 @@ +"""Exact complex rational arithmetic for coefficient and rounded-gate certificates. + +Jose Manuel (jmbarrancoml), with substantial OpenAI Codex assistance. +Apache-2.0. +""" +from fractions import Fraction as Q +from hashlib import sha256 + +TRACK = None + + +def need(ok, message): + if not ok: + raise ValueError(message) + + +def qheight(value): + return max(abs(value.numerator).bit_length(), value.denominator.bit_length()) + + +class C: + __slots__ = ("re", "im") + + def __init__(self, re=0, im=0): + need(type(re) in (int, Q) and type(im) in (int, Q), "exact rational components") + self.re, self.im = Q(re), Q(im) + if TRACK is not None: + TRACK["max_observed_height"] = max(TRACK["max_observed_height"], + qheight(self.re), qheight(self.im)) + + @staticmethod + def wrap(value): + return value if isinstance(value, C) else C(value) + + def __add__(self, other): + other = C.wrap(other) + return C(self.re + other.re, self.im + other.im) + + __radd__ = __add__ + + def __neg__(self): + return C(-self.re, -self.im) + + def __sub__(self, other): + return self + -C.wrap(other) + + def __rsub__(self, other): + return C.wrap(other) + -self + + def __mul__(self, other): + other = C.wrap(other) + return C(self.re * other.re - self.im * other.im, + self.re * other.im + self.im * other.re) + + __rmul__ = __mul__ + + def conjugate(self): + return C(self.re, -self.im) + + def norm2(self): + return self.re * self.re + self.im * self.im + + def __truediv__(self, other): + other = C.wrap(other) + denominator = other.norm2() + need(denominator > 0, "nonzero divisor") + product = self * other.conjugate() + return C(product.re / denominator, product.im / denominator) + + def __rtruediv__(self, other): + return C.wrap(other) / self + + def __eq__(self, other): + if not isinstance(other, C) and type(other) not in (int, Q): + return False + other = C.wrap(other) + return self.re == other.re and self.im == other.im + + def record(self): + return [str(self.re), str(self.im)] + + +class Vec(list): + def __init__(self, values): + super().__init__(C.wrap(x) for x in values) + + def __mul__(self, other): + if isinstance(other, C) or type(other) in (int, Q): + return Vec(x * other for x in self) + need(len(self) == len(other), "elementwise vector dimensions") + return Vec(x * y for x, y in zip(self, other)) + + __rmul__ = __mul__ + + def __sub__(self, other): + need(len(self) == len(other), "vector subtraction dimensions") + return Vec(x - y for x, y in zip(self, other)) + + def copy(self): + return Vec(self) + + +class Mat(list): + def __init__(self, rows): + super().__init__([C.wrap(x) for x in row] for row in rows) + + @property + def shape(self): + return (len(self), len(list.__getitem__(self, 0)) if self else 0) + + def __getitem__(self, key): + if not isinstance(key, tuple): + return list.__getitem__(self, key) + row, column = key + if isinstance(row, slice): + rows = list.__getitem__(self, row) + return Mat([r[column] for r in rows]) if isinstance(column, slice) else Vec(r[column] for r in rows) + selected = list.__getitem__(self, row) + return Vec(selected[column]) if isinstance(column, slice) else selected[column] + + +def eye(n): + return Mat([[int(i == j) for j in range(n)] for i in range(n)]) + + +def adjoint(matrix): + return Mat([[matrix[j][i].conjugate() for j in range(len(matrix))] + for i in range(len(matrix[0]))]) + + +def multiply(left, right): + return Mat([[sum((x * right[k][j] for k, x in enumerate(row)), C()) + for j in range(len(right[0]))] for row in left]) + + +def unitary(matrix): + return multiply(adjoint(matrix), matrix) == eye(len(matrix)) + + +def inverse_gate(matrix): + if unitary(matrix): + return adjoint(matrix) + if matrix.shape == (1, 1): + return Mat([[1 / matrix[0][0]]]) + if matrix.shape == (2, 2) and matrix[0][0] == matrix[1][1] == 1 and matrix[0][1] == 0: + return Mat([[1, 0], [-matrix[1][0], 1]]) + raise ValueError("unsupported nonunitary inverse gate") + + +def round_q(value, bits): + scale = 1 << bits + shifted = value * scale + Q(1, 2) + return Q(shifted.numerator // shifted.denominator, scale) + + +def rounded(value, bits): + return C(round_q(value.re, bits), round_q(value.im, bits)) + + +def norm2(vector): + return sum((x.norm2() for x in vector), Q(0)) + + +def component_l1(vector): + return sum((abs(x.re) + abs(x.im) for x in vector), Q(0)) + + +def ceil_log2(value): + value = Q(value) + need(value > 0, "positive logarithm bound") + result = value.numerator.bit_length() - value.denominator.bit_length() + power = Q(1 << result) if result >= 0 else Q(1, 1 << -result) + while power < value: + result += 1 + power *= 2 + while power / 2 >= value: + result -= 1 + power /= 2 + return result + + +def upper(value, bits=160): + scale = 1 << bits + scaled = value * scale + return Q(-((-scaled.numerator) // scaled.denominator), scale) + + +def vector_hash(vector): + digest = sha256() + for entry in vector: + for value in (entry.re, entry.im): + for integer in (value.numerator, value.denominator): + raw = abs(integer).to_bytes(max(1, (abs(integer).bit_length() + 7) // 8), "big") + digest.update(bytes([integer < 0])) + digest.update(len(raw).to_bytes(8, "big")) + digest.update(raw) + return digest.hexdigest() + + +def apply(plan, vector, bits=None): + global TRACK + state = Vec(vector) + old_track = TRACK + stats = {"max_observed_height": 0, "max_grid_numerator_bits": 0, + "max_reduced_fractional_bits": 0, "rounded_outputs": 0} + if bits is not None: + need(bits >= 1, "positive data precision") + for entry in state: + for value in (entry.re, entry.im): + need((value * (1 << bits)).denominator == 1, "input already on data grid") + TRACK = stats + try: + for layer in plan: + used = set() + for ids, gate in layer: + need(len(ids) == len(gate) in (1, 2), "one- or two-wire gate") + need(not used.intersection(ids) and len(set(ids)) == len(ids), "disjoint layer") + need(all(0 <= i < len(state) for i in ids), "wire bounds") + used.update(ids) + before = [state[i] for i in ids] + outputs = [sum((a * x for a, x in zip(row, before)), C()) for row in gate] + for i, value in zip(ids, outputs): + if bits is not None: + value = rounded(value, bits) + stats["rounded_outputs"] += 1 + for part in (value.re, value.im): + grid_integer = part * (1 << bits) + need(grid_integer.denominator == 1, "rounded output grid") + stats["max_grid_numerator_bits"] = max(stats["max_grid_numerator_bits"], + abs(grid_integer.numerator).bit_length()) + stats["max_reduced_fractional_bits"] = max(stats["max_reduced_fractional_bits"], + part.denominator.bit_length() - 1) + state[i] = value + finally: + TRACK = old_track + return state, stats diff --git a/research/schur-majorant-closure/source_check.py b/research/schur-majorant-closure/source_check.py new file mode 100644 index 0000000000..fc1e09201f --- /dev/null +++ b/research/schur-majorant-closure/source_check.py @@ -0,0 +1,262 @@ +"""Authenticated source-arithmetic probe; callbacks do NOT execute gates. + +Only the source's floating diagnostic is replaced by a node collector. +The determinant oracle is an integration dependency, not new independence. +""" +import argparse +import ast +import copy +from fractions import Fraction as Q +from hashlib import sha256 +import json +from pathlib import Path +import sys +import types + +P = Path(__file__).resolve().parent +ROOT = P.parents[1] +PINS = { + "original": "06d1861bfe8af543908e26557ffda7e451ff176bceb9bacfaf0f04f234b336d5", + "exact": "270044fc9fd1203a7eee45ec68a7ebb6b6fab668a109ec956434b8a6cbb483ff", + "triangular": "322e5b821e0db6c97d39ffb65e5e108755a91d91255ef47f7a63ad30c3ef8413", + "oracle": "716bb5e5c7ffb0d2ef44951a13fec49bb875a138e07503de8b6e652276e1f8ab", +} + + +def need(ok, message): + if not ok: + raise ValueError(message) + + +def authenticated(path, key): + data = path.read_bytes() + need(sha256(data).hexdigest() == PINS[key], "authenticated source: " + key) + return data + + +def module(name, path, data): + result = types.ModuleType(name) + result.__file__ = str(path) + sys.modules[name] = result + exec(compile(data, str(path), "exec", dont_inherit=True, optimize=0), result.__dict__) + return result + + +def selected_tree(data): + wanted = {"toep", "lower", "invseries", "conv", "triangle_plan"} + tree = ast.parse(data) + tree.body = [copy.deepcopy(node) for node in tree.body + if isinstance(node, ast.FunctionDef) and node.name in wanted] + need({node.name for node in tree.body} == wanted, "complete selected source functions") + return tree + + +class Diagnostic(ast.NodeTransformer): + def __init__(self, wrong_sign=False): + self.diagnostic_changes = self.sign_changes = 0 + self.wrong_sign = wrong_sign + + def visit_Assign(self, node): + target = node.targets[0] if len(node.targets) == 1 else None + if (isinstance(target, ast.Subscript) and isinstance(target.value, ast.Name) + and target.value.id == "STATS" and isinstance(target.slice, ast.Constant) + and target.slice.value == "max_triangle_coefficient"): + self.diagnostic_changes += 1 + return ast.copy_location(ast.Expr(ast.Call(ast.Name("trace_node", ast.Load()), + [ast.Name("indices", ast.Load()), ast.Name("f", ast.Load())], [])), node) + if (self.wrong_sign and isinstance(target, ast.Name) and target.id == "s" + and isinstance(node.value, ast.BinOp) and isinstance(node.value.op, ast.Sub)): + node.value.op = ast.Add() + self.sign_changes += 1 + return node + + +def run_source(original, exact, indices, symbol, wrong_sign=False): + nodes, shears, leaves = {}, [], [] + + def trace_node(ids, values): + need(tuple(ids) not in nodes, "one source node per wire subset") + nodes[tuple(ids)] = exact.Vec(values) + + def convolution(left, right): + return exact.Vec(sum((left[j]*right[k-j] for j in range(len(left)) + if 0 <= k-j < len(right)), exact.C()) + for k in range(len(left)+len(right)-1)) + + class Concatenate: + def __getitem__(self, parts): + values = [] + for part in parts: + values.extend(part if isinstance(part, (list, tuple)) else [part]) + return exact.Vec(values) + + def shear(target, source, matrix): + shears.append((tuple(target), tuple(source), exact.Mat(matrix))) + return [] + + def diagonal(ids, values): + leaves.append((tuple(ids), exact.Vec(values))) + return [] + + facade = types.SimpleNamespace(asarray=lambda values, dtype=None: exact.Vec(values), + array=lambda rows, dtype=None: exact.Mat(rows), + zeros=lambda n, dtype=None: exact.Vec([0]*n), + convolve=convolution, r_=Concatenate()) + tree = selected_tree(original) + before = sha256(ast.dump(tree).encode()).hexdigest() + adapter = Diagnostic(wrong_sign) + tree = ast.fix_missing_locations(adapter.visit(tree)) + need(adapter.diagnostic_changes == 1 and adapter.sign_changes == int(wrong_sign), + "only declared diagnostic/source mutation adaptations") + scope = dict(np=facade, STATS={"triangle_nodes": 0}, trace_node=trace_node, + diag=diagonal, parallel=lambda left, right: [], toeplitz_shear=shear) + exec(compile(tree, "", "exec", dont_inherit=True, optimize=0), scope) + plan = scope["triangle_plan"](list(indices), exact.Vec(symbol)) + need(plan == [] and scope["STATS"]["triangle_nodes"] == len(nodes), "algebra-only callbacks, complete source node trace") + return nodes, shears, leaves, scope, before, sha256(ast.dump(tree).encode()).hexdigest() + + +def as_oracle(matrix, oracle): + return tuple(tuple(oracle.G(value.re, value.im) for value in row) for row in matrix) + + +def envelope(matrix, oracle): + n = len(matrix) + return max(max(sum((oracle.mu(x) for x in row), Q(0)) for row in matrix), + max(sum((oracle.mu(matrix[i][j]) for i in range(n)), Q(0)) for j in range(n))) + + +def defect(matrix, oracle): + return tuple(tuple(value-(oracle.ONE if i == j else oracle.ZERO) + for j, value in enumerate(row)) for i, row in enumerate(matrix)) + + +def inspect_trace(trace, exact, oracle): + nodes, shears, leaves, scope, before, after = trace + node_count = schur_count = cramer_entries = shear_count = 0 + rho = Q(1, 2) + lookup = {(target, source): as_oracle(matrix, oracle) for target, source, matrix in shears} + for ids, symbol in nodes.items(): + matrix = as_oracle(scope["lower"](symbol), oracle) + need(envelope(defect(matrix, oracle), oracle) <= rho, "actual source descendant component bound") + node_count += 1 + n = len(ids) + if n == 1: + continue + ev, od = ids[::2], ids[1::2] + local_ev, local_od = tuple(range(0, n, 2)), tuple(range(1, n, 2)) + E = as_oracle(scope["lower"](nodes[ev]), oracle) + S = as_oracle(scope["lower"](nodes[od]), oracle) + need(E == oracle.principal(matrix, local_ev), "actual E is principal restriction") + need(S == oracle.schur(matrix, local_ev, local_od), "actual S equals bordered-determinant Schur") + schur_count += 1 + O = tuple(tuple(matrix[i][j] for j in local_ev) for i in local_od) + K, ZK = lookup[(od, ev)], lookup[(ev, od)] + for i in range(len(E)): + for j in range(len(E)): + need(E[i][j] == (E[i-j][0] if i >= j else oracle.ZERO) + and O[i][j] == (O[i-j][0] if i >= j else oracle.ZERO), + "actual E/O are lower Toeplitz") + need(sum((E[i][k]*O[k][j] for k in range(len(E))), oracle.ZERO) + == sum((O[i][k]*E[k][j] for k in range(len(E))), oracle.ZERO), + "actual E/O Toeplitz commutation") + pivot = oracle.determinant(E) + need(bool(pivot), "source E determinant nonzero") + m = len(E) + for column in range(m): + for row in range(m): + replaced = tuple(tuple(O[i][column] if j == row else E[i][j] + for j in range(m)) for i in range(m)) + need(K[row][column] == oracle.determinant(replaced)/pivot, + "actual K equals Cramer solution E*K=O in commuting Toeplitz algebra") + cramer_entries += 1 + shifted = tuple(tuple(K[i-1][j] if i else oracle.ZERO for j in range(m)) for i in range(m)) + need(ZK == shifted, "actual ZK is one lower shift") + need(envelope(O, oracle) <= rho and envelope(K, oracle) <= 1 and envelope(ZK, oracle) <= 1, + "actual source local O/K/ZK component bounds") + for kernel in (K, ZK): + shear = tuple(tuple((oracle.ONE if i == j else + kernel[i-m][j] if i >= m and j < m else oracle.ZERO) + for j in range(2*m)) for i in range(2*m)) + inverse = tuple(tuple((oracle.ONE if i == j else + -kernel[i-m][j] if i >= m and j < m else oracle.ZERO) + for j in range(2*m)) for i in range(2*m)) + need(envelope(shear, oracle) <= 2 and envelope(inverse, oracle) <= 2, "actual kernel completed shear/inverse bounds") + shear_count += 1 + need(len(shears) == 2*schur_count and len(leaves) == (len(nodes)+1)//2, "complete source callback census") + return {"nodes": node_count, "schur_nodes": schur_count, "cramer_entries": cramer_entries, + "Toeplitz_commutation_checks": schur_count, + "completed_shear_checks": shear_count, "source_ast": before, "adapted_ast": after} + + +def static_admission(data): + tree = ast.parse(data) + triangle = next(node for node in tree.body if isinstance(node, ast.ClassDef) and node.name == "Triangle") + plan = next(node for node in triangle.body if isinstance(node, ast.FunctionDef) and node.name == "plan") + admission = False + for node in ast.walk(plan): + if (isinstance(node, ast.Compare) and isinstance(node.left, ast.Call) + and isinstance(node.left.func, ast.Name) and node.left.func.id == "component_l1" + and len(node.ops) == 1 and isinstance(node.ops[0], ast.LtE)): + bound = node.comparators[0] + admission = (isinstance(bound, ast.Call) and isinstance(bound.func, ast.Name) + and bound.func.id == "Q" and [x.value for x in bound.args if isinstance(x, ast.Constant)] == [1, 2]) + text = ast.unparse(plan) + need(admission and "sorted(indices) == list(range(n))" in text, "source component admission and full wire permutation located") + return {"component_l1_half_admission_located": True, "complete_wire_permutation_check_located": True, + "Triangle_plan_factory_executed": False} + + +def main(): + parser = argparse.ArgumentParser() + parser.add_argument("--source-dir", type=Path, default=P/"source") + parser.add_argument("--original-path", type=Path, default=ROOT/"research/capped-phase-fusion/evidence/inplace_algebra_ultra/check_circuits.py") + parser.add_argument("--oracle-path", type=Path, default=P/"independent_oracle.py") + parser.add_argument("--output", type=Path) + args = parser.parse_args() + original = authenticated(args.original_path, "original") + exact_path = args.source_dir/"predecessor_exact.py" + exact = module("source_probe_exact", exact_path, authenticated(exact_path, "exact")) + oracle = module("source_probe_oracle", args.oracle_path, authenticated(args.oracle_path, "oracle")) + triangular = authenticated(args.source_dir/"PR4205-triangular.py.txt", "triangular") + rows = [] + cases = [(n, 0, reverse) for n in (1, 2, 4, 8) for reverse in (False, True)] + [(4, 1, False), (8, 1, False)] + for n, seed, reverse in cases: + scale = Q(1, (4 if seed == 0 else 8)*n) + symbol = exact.Vec(exact.C((1 if i == 0 else 0) + (scale if (i+seed)%2 == 0 else -scale), + scale if (2*i+seed)%3 else -scale) for i in range(n)) + need(sum((abs(x.re-(1 if i == 0 else 0))+abs(x.im) for i, x in enumerate(symbol)), Q(0)) <= Q(1, 2), "own mathematical source admission") + ids = list(reversed(range(n))) if reverse else list(range(n)) + trace = run_source(original, exact, ids, symbol) + rows.append({"n": n, "seed": seed, "reversed_ids": reverse, **inspect_trace(trace, exact, oracle)}) + # A wrong Schur sign can preserve every tested norm; exact identity is + # the semantic control, rather than treating norm success as correctness. + symbol = exact.Vec([1, Q(1, 4), 0, 0]) + wrong = run_source(original, exact, [0, 1, 2, 3], symbol, True) + nodes, shears, leaves, scope, before, after = wrong + base = as_oracle(scope["lower"](symbol), oracle) + actual_wrong = as_oracle(scope["lower"](nodes[(1, 3)]), oracle) + expected = oracle.schur(base, (0, 2), (1, 3)) + need(actual_wrong != expected, "wrong source Schur sign must fail exact identity") + need(all(envelope(defect(as_oracle(scope["lower"](values), oracle), oracle), oracle) <= Q(1, 2) + for values in nodes.values()), "wrong sign norm-only positive control") + result = {"status": "PASS_AUTHENTICATED_SOURCE_SCHUR_ARITHMETIC_ONLY_NO_GATE_REPLAY", + "logical_source_ids": {"original": "research/capped-phase-fusion/evidence/inplace_algebra_ultra/check_circuits.py", + "exact": "source/predecessor_exact.py", "triangular": "source/PR4205-triangular.py.txt", + "oracle": "independent_oracle.py"}, + "source_sha256": PINS, "static_admission": static_admission(triangular), + "cases": rows, "root_cases": len(rows), + "source_nodes": sum(x["nodes"] for x in rows), + "source_schur_nodes": sum(x["schur_nodes"] for x in rows), + "cramer_entries": sum(x["cramer_entries"] for x in rows), + "completed_shear_checks": sum(x["completed_shear_checks"] for x in rows), + "wrong_sign_control": {"exact_identity_rejected": True, "all_descendant_norms_still_admitted": True}, + "checker_sha256": sha256(Path(__file__).read_bytes()).hexdigest(), + "scope": "Authenticated original five source functions; only floating diagnostic replaced by collector. Exact array/convolution facade and diag/parallel/shear callbacks are algebra-only and return empty plans. No FFT, stored gates, rounding, full Triangle.plan factory or physical program executed. Frozen determinant oracle is reused integration evidence, not a second independent oracle."} + if args.output is not None: + args.output.write_text(json.dumps(result, indent=2, sort_keys=True)+"\n") + print(result["status"]) + + +if __name__ == "__main__": + main()