From 2b57525818e73ffeaeabd0d4edaba26a7f01d451 Mon Sep 17 00:00:00 2001 From: Dylan Roy Date: Thu, 1 Oct 2026 19:33:00 -0500 Subject: [PATCH] Derive separated-fold multiplicity lower bounds for actual ordinary bars Author-side Theorem SF: fixed d>=2,L>0 and n prescribed disjoint regions admit n actual short elder bars with probability >=c_n t^(2n/3). Finite Fourier unfolding with a fixed residual neighborhood; no independence of spatial regions. Complete exit caps and older-reaching paths identify each actual global pairing. The n=2 lower bound rules out an O(t^(10/7)) count excess, so the three integrated intensity coefficients cannot transfer unchanged to occurrence at that remainder. Optional RATE/C52 consequences remain source-conditional; no sharp two-bar upper bound, exact-n count, coefficient, Poisson or specific-mark TV lower bound. 43 tests per mode, five mutants per mode rejected. Historical source authentication remains a hosted requirement. Eleven additive paths, scientific status effect NONE, no self-merge. --- .../workflows/separated-fold-multiplicity.yml | 55 +++ .../MANIFEST.json | 59 +++ .../PROOF.md | 444 ++++++++++++++++++ .../README.md | 53 +++ .../RESULTS.json | 22 + .../SOURCE_BINDINGS.json | 32 ++ .../VALIDATION.md | 38 ++ .../check.py | 160 +++++++ .../test_check.py | 143 ++++++ .../test_sources.py | 71 +++ .../verify_sources.py | 82 ++++ 11 files changed, 1159 insertions(+) create mode 100644 .github/workflows/separated-fold-multiplicity.yml create mode 100644 frontiers/separated_fold_multiplicity_20261002/MANIFEST.json create mode 100644 frontiers/separated_fold_multiplicity_20261002/PROOF.md create mode 100644 frontiers/separated_fold_multiplicity_20261002/README.md create mode 100644 frontiers/separated_fold_multiplicity_20261002/RESULTS.json create mode 100644 frontiers/separated_fold_multiplicity_20261002/SOURCE_BINDINGS.json create mode 100644 frontiers/separated_fold_multiplicity_20261002/VALIDATION.md create mode 100644 frontiers/separated_fold_multiplicity_20261002/check.py create mode 100644 frontiers/separated_fold_multiplicity_20261002/test_check.py create mode 100644 frontiers/separated_fold_multiplicity_20261002/test_sources.py create mode 100644 frontiers/separated_fold_multiplicity_20261002/verify_sources.py diff --git a/.github/workflows/separated-fold-multiplicity.yml b/.github/workflows/separated-fold-multiplicity.yml new file mode 100644 index 000000000..91ae08f43 --- /dev/null +++ b/.github/workflows/separated-fold-multiplicity.yml @@ -0,0 +1,55 @@ +name: Separated-fold multiplicity controls + +'on': + pull_request: + paths: + - 'frontiers/separated_fold_multiplicity_20261002/**' + - '.github/workflows/separated-fold-multiplicity.yml' + workflow_dispatch: + +permissions: + contents: read + +jobs: + exact-and-source: + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 + with: + persist-credentials: false + fetch-depth: 0 + - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 + with: + python-version: '3.11.16' + - name: Authenticate historical interfaces and replay exact controls + env: + PYTHONDONTWRITEBYTECODE: '1' + GIT_NO_REPLACE_OBJECTS: '1' + run: | + set -euo pipefail + git fetch --no-tags origin 6f74f7a77bae15d6aa07506bab38977e34dcc449 c46377738b711a5cc2114b58bf7726ae6e7bc553 + cd frontiers/separated_fold_multiplicity_20261002 + python -B -S verify_sources.py + python -B -S -m unittest -v + python -B -O -S -m unittest -v + python -B -S check.py > "$RUNNER_TEMP/fold-normal.json" + python -B -O -S check.py > "$RUNNER_TEMP/fold-optimized.json" + cmp RESULTS.json "$RUNNER_TEMP/fold-normal.json" + cmp "$RUNNER_TEMP/fold-normal.json" "$RUNNER_TEMP/fold-optimized.json" + for optimized in no yes; do + flags=(-B -S) + if [ "$optimized" = yes ]; then flags=(-B -O -S); fi + for m in M1 M2 M3 M4 M5 BAD; do + expected=1 + if [ "$m" = BAD ]; then expected=2; fi + rc=0 + python "${flags[@]}" check.py --mutant "$m" > "$RUNNER_TEMP/fold-$optimized-$m.out" 2>&1 || rc=$? + if [ "$rc" -ne "$expected" ]; then + cat "$RUNNER_TEMP/fold-$optimized-$m.out" + exit 1 + fi + done + done + python -B -S verify_sources.py + git diff --exit-code diff --git a/frontiers/separated_fold_multiplicity_20261002/MANIFEST.json b/frontiers/separated_fold_multiplicity_20261002/MANIFEST.json new file mode 100644 index 000000000..03029412b --- /dev/null +++ b/frontiers/separated_fold_multiplicity_20261002/MANIFEST.json @@ -0,0 +1,59 @@ +{ + "scientific_effect": "NONE", + "files": [ + { + "path": "PROOF.md", + "bytes": 21587, + "sha256": "3033032c27242e98af6370212e15c5ca057ef96e58f15387b7f1d163738081b2", + "git_blob": "026cf5237510018d466380683b7679c2de977845" + }, + { + "path": "README.md", + "bytes": 2714, + "sha256": "4f0b53b2c5d1a6abb081ed9add6ed527096edb3cd34ba067d5e454e69fb26957", + "git_blob": "023b9bea897eb3b8294fedb935e07039cb47c831" + }, + { + "path": "RESULTS.json", + "bytes": 482, + "sha256": "3ea73f7eaebda9d350b8619fcc6985cda1bd5ec61346fd3f7b96d07fda1ba104", + "git_blob": "3a6577d89843e4bb090bad5c80aff084f5d34dd0" + }, + { + "path": "SOURCE_BINDINGS.json", + "bytes": 1667, + "sha256": "c18ade26a146355893d93cdd242d0ce40c56d84481923bf629f6890a2c75d655", + "git_blob": "5a0280898cb8884a02c71e1189a6e7b58950097a" + }, + { + "path": "VALIDATION.md", + "bytes": 2452, + "sha256": "cf45301b1423519407dda0c191f401c45f30a0643c0268da7254f87ee3daf12e", + "git_blob": "b33af32f32ed66544644b20f5537149d2078a884" + }, + { + "path": "check.py", + "bytes": 5520, + "sha256": "d1f5262dfdd000726f7079ea450730a2ac6e73e620e0b5c4af26b33e2fea6fb1", + "git_blob": "3b476264415933d4d12ac3e6cca8ccecdda69a8b" + }, + { + "path": "test_check.py", + "bytes": 7266, + "sha256": "673b08750fa30cf709d7522fc478f2c413414ae2069c9850d769ca6e1cd74473", + "git_blob": "3cea6dbd17c6b5ca6030884934523941da36a8db" + }, + { + "path": "test_sources.py", + "bytes": 4724, + "sha256": "37acc73f2b916d79ac26a992b843d6da3272cd68bce886f090247c4cf1d6ab5a", + "git_blob": "9939096baf61d96a7b246401488c71f2381c111a" + }, + { + "path": "verify_sources.py", + "bytes": 4266, + "sha256": "8ce117f5582ed3bcd0ec79e7f9bf26f589127c55510835cbcab46dced9b5bcd4", + "git_blob": "0a5b25dc70028efcdf893db03ec8fcf643397e17" + } + ] +} diff --git a/frontiers/separated_fold_multiplicity_20261002/PROOF.md b/frontiers/separated_fold_multiplicity_20261002/PROOF.md new file mode 100644 index 000000000..026cf5237 --- /dev/null +++ b/frontiers/separated_fold_multiplicity_20261002/PROOF.md @@ -0,0 +1,444 @@ +# Separated folds force multiple ordinary short bars + +Object: OA-SEPARATED-FOLD-MULTIPLICITY-20261002-v1. +Actual author: OpenAI / GPT-6 Astra Pro. +Program: Universal Law, initiated, directed and supported by Dylan Roy. +Disposition: new author-side proof candidate; nonauthor review pending. Scientific-status effect NONE. + +This is a successor to the two-bar question in Math-#235 comments 5942428034, +5942496197 and 5942555223, not an amendment of C52 or of a reviewed parent. +Pickup: #235/5943116501. The construction concerns the **original unconditioned +field**, not a pair-Palm law, replacement-bar population or independent-region +model. The proof below does not use the D1 density asymptotic, a Kac–Rice count +expansion, the finite-part coefficient, or independence of spatial regions. +Only the optional consequences in Section 7 consume those separate interfaces. + +## 1. Statement and exact scope + +Fix d >= 2 and L > 0. On the flat torus X = R^d/(L Z^d), let F be the centered +variance-one Gaussian field with covariance + + K_L(z) = sum_{j in Z^d} exp(-|z+Lj|^2/2) + / sum_{j in Z^d} exp(-|Lj|^2/2). + +Use ordinary **superlevel H0 persistence**, with a bar born at the maximum of +the younger component and dying at its actual global elder merging saddle. +Exclude the essential global-maximum class. K_t counts all finite bars with +lifetime in (0,t] in one field on the whole torus; it is not divided by volume. + +**Theorem SF.** Let n >= 1 be a fixed integer, and let U_1,...,U_n be prescribed +pairwise disjoint nonempty open subsets of X. There are constants c_n > 0 and +t_n > 0 such that, for every 0 < t <= t_n, + + P(there is an actual finite elder bar (M_i,S_i) in each U_i, + with t/8 <= F(M_i)-F(S_i) <= t, for i=1,...,n) + >= c_n t^(2n/3). (SF) + +In particular P(K_t >= n) >= c_n t^(2n/3). The endpoints and the separating cap +of each constructed bar lie in its own U_i. The bars are distinct. Constants +depend on d,L,n and the chosen regions; no useful numerical value or parameter- +uniform bound is asserted. The n=2 construction establishes a genuine lower +bound for the original field, rather than only the abstract Bernoulli example. + +No assertion is made that this is the sharp order, that K_t equals n, or that +separated folds exhaust multiple-bar configurations. There is no Poisson law, +region independence, factorial-moment asymptotic, increasing-volume limit or +asymptotic two-bar mark measure in this statement. Higher-corank/clustered events +may produce additional mass. + +## 2. Smoothness, nondegeneracy and the Gaussian coordinates actually used + +Poisson summation, with frequencies 2pi k/L, gives + + K_L(z) = sum_k a_k exp(2pi i k.z/L), + a_k = exp(-2pi^2 |k|^2/L^2) / sum_j exp(-2pi^2 |j|^2/L^2) > 0. (2.1) + +This is the exact model in [P] Sections 1–2. In a real sine/cosine basis all +coordinate variances are positive and distinct coordinates are independent. +The positive constants attached to sine/cosine normalization are immaterial +below. For every integer q >= 0, + + sum_k sqrt(a_k) (1+|k|)^q < infinity. (2.2) + +The expected sum of the C^q norms of the Gaussian Fourier summands is finite. +It follows that the series converges absolutely in C^q almost surely, and its +high-frequency remainder R_N satisfies + + E ||R_N||_{C^4} -> 0. (2.3) + +It is independent of the finitely many Fourier coordinates of P_N = F-R_N. +In particular, for each epsilon > 0, a sufficiently large **fixed** N gives + + P(||R_N||_{C^4} < epsilon/2) >= 1/2. (2.4) + +All finite coordinate changes within the low-frequency space produce a +nondegenerate finite-dimensional Gaussian vector; their coordinates need NOT +remain independent. We use a conditional density, not such an independence +claim, in Section 6. + +For completeness, this field is almost surely Morse with pairwise distinct +critical values. Every finite set of independent point-derivative functionals +has a positive Gram matrix: a zero-variance linear combination would annihilate +all Fourier modes, hence would be the zero distribution. Disjoint bump tests +and arbitrary prescribed finite jets force its coefficients to vanish. At one +site the same conclusion follows from independence of the derivative polynomials. + +Apply this to (grad F(x), H_F(x)v), with |v|=1. Its range dimension is 2d and +its parameter dimension is 2d-1; H -> Hv is surjective on symmetric matrices. +For distinct x,y, use (grad F(x), grad F(y), F(x)-F(y)), whose dimensions are +2d+1 and 2d. On compact domains separated from x=y, covariance continuity gives +bounded densities. A C^1 random map from q parameters to p>q coordinates with +bounded point densities has no zero: on the event its derivative norm is <=M, +a zero requires a mesh value to lie in a ball of radius O(M epsilon). The +union probability is O(M^p epsilon^(p-q)). First send epsilon to zero, then +M to infinity; countable domain exhaustion handles all sites and directions. +This is the elementary genericity argument of [P] Section 8 without its pins. +Compactness and nondegenerate critical roots then give finitely many roots. + +We work on this single unconditional full-probability locus. Removing its null +complement from the constructive event below does not change the probability. +No genericity is demanded separately for every residual sample or for every +uncountable parameter value. + +## 3. A uniform local deterministic family + +Choose a common small a in (0,1/8], with disjoint embedded coordinate cylinders + + D_i = [-a,a] x closed B_{d-1}(0,a) subset U_i, + +and slightly larger disjoint coordinate neighborhoods. Such a is available for +any fixed finite collection of the stated open sets. The coordinates are local +Euclidean coordinates of the flat torus. Choose a smooth periodic template f_* +and smooth periodic parameter directions h_i^* with, on those larger neighborhoods, + + f_*(x,y) = b_i - x^3/3 - |y|^2/2, + h_i^*(x,y) = x, h_j^*(x,y) = 0 for j != i. (3.1) + +One obtains these by bump functions with disjoint supports; their behavior +outside the neighborhoods is unrestricted. The constants b_i may be chosen +arbitrarily and fixed. Put + + delta = a^2/100, eta = a^3/100, + D = [-delta,delta]^n. + +Consider a family + + f_{s,e} = f_0 + sum_j s_j h_j + e, s in D, (3.2) + +where f_0,h_j approximate f_*,h_j^* in C^4 and e is a C^4 error. There is a +single sufficiently small bound on these errors such that the conclusions +below hold for every s in D and every allowed e. The bound is independent of +t and of the specific error sample. Dimension-dependent coordinate norm factors +are included by choosing that bound small enough. + +### 3.1 Transverse ridge and fold discriminant + +The transverse Hessian is <= -I/2 on each D_i. Uniformly small transverse +linear perturbations give a unique maximizer y=h_i(x;s,e) in each closed fibre, +with |h_i| <= a/4. For example, Taylor from y=0 gives strictly negative outward +radial derivative on |y|=a/4 when |grad_y f(x,0)|0, g_i''(a/4)<0. (3.3) + +There is one inflection z_i in (-a/4,a/4). Define its unfolding coordinate + + mu_i(s,e) = g_i'(z_i(s,e);s,e). (3.4) + +In the ideal family mu_i=s_i. For the perturbed family we can ensure + + ||mu(0,e)||_infinity <= delta/4, + sup_{s in D} ||D_s mu(s,e)-I||_{infinity->infinity} <= 1/4. (3.5) + +Here is the derivative that justifies the second assertion. Stationarity in y +implies partial_{s_j}g_i=h_j(x,h_i), and differentiating in x gives + + partial_{s_j}mu_i = (h_j)_x + (h_j)_y . partial_x h_i, + evaluated at x=z_i. (3.6) + +The additional term g_i''(z_i) partial_{s_j}z_i vanishes. At the ideal family +the right side is exactly the identity matrix. Its continuous dependence on +the fixed C^4 neighborhood, uniformly on the compact sets, proves (3.5). +This is a simultaneous n-parameter statement: no neglect of cross-region +parameter effects in the actual approximating functions is permitted. + +The value comparison needed for the outer faces is also uniform: + + |g_i(x;s,e) - (b_i+s_i x-x^3/3)| <= eta. (3.7) + +Indeed f differs from the ideal function by <=eta on the whole cylinder. +Taking the maximum over y preserves that bound, because the ideal transverse +maximum is at y=0. Choose the C^4 neighborhood to include this C^0 bound. + +### 3.2 Two roots and the true gap + +If 0= (7/24)a^3 - (3/2)delta*a - 2eta + = (77/300)a^3 > a^3/4, + death_i-g_i(a) >= (77/300)a^3 > a^3/4. (4.1) + +The first cubic margin uses a^3/3+x_+^3/3 >= 7a^3/24; the second is analogous. +Both parameter and approximation errors are subtracted, not omitted. + +Define the closed cap + + C_i = [x_-,a] x closed B_{d-1}(0,a). + +The derivative sign pattern makes g_i(x)<=birth_i throughout [x_-,a]. Thus +f<=birth_i on C_i. On its left face, transverse maximality gives f<=death_i, +with equality only at S_i. Its right face is strictly below death_i by (4.1). +On the lateral face, strong transverse concavity and |h_i|<=a/4 give + + f(x,y) <= g_i(x) - (1/4)|y-h_i(x)|^2 + <= birth_i - 9a^2/64 < death_i, (4.2) + +because gap_i<=t<=a^2/16. These inequalities cover intersections of faces as +well. M_i is interior. There is no point older than M_i inside C_i. + +On the ridge path from M_i leftwards to (-a,h_i(-a)), the smallest value is +exactly death_i: the ridge decreases to S_i and then increases. The endpoint +is strictly older than M_i by (4.1). Hence the global maximin connection level + + d_f(M_i) = sup_{paths from M_i to {f>birth_i}} min f + +is at least death_i. Conversely, every such path has its endpoint outside C_i +and must first exit through the complete boundary, where f<=death_i. Its +minimum is at most death_i, even if the path subsequently wanders or reenters. +Therefore d_f(M_i)=death_i. + +On the Morse distinct-critical-value locus this is exactly ordinary superlevel +H0 death of the component born at M_i at S_i. To see why, a connection to an +older component above death_i would violate the upper maximin bound; below +that level the explicit path connects to a point above birth_i. Compactness +and distinct critical values identify the unique death critical point. The +older-reaching endpoint excludes an essential class. No unstable-manifold, +Morse–Smale or remote-independence assertion is used. + +The caps are in disjoint U_i, so the maxima, death saddles and bars are distinct. +Among Morse distinct-value extensions, arbitrary changes outside the protected +cylinders preserve these conclusions. + +## 5. The volume of simultaneous near-fold parameters + +For each fixed allowed e, (3.5) implies that mu(s,e)-s is 1/4-Lipschitz in the +infinity norm. If ||v||_infinity<=delta/4, the map + + s -> s + v - mu(s,e) + +is a contraction of D into itself: its norm is at most +(delta/4)+(delta/4)+(delta/4)=3delta/4. There is a unique solution mu(s,e)=v, +and this solution is interior. The same Lipschitz estimate proves that mu is +injective on D. The derivative is nonsingular, since ||Dmu-I||<1, and the +inverse is C^1 on this target cube. + +By the selected t restriction, Q_t is contained in that target cube. Hadamard's +inequality and the row-sum bound in (3.5) give + + |det D_s mu| <= (5/4)^n. + +The usual finite-dimensional change of variables therefore yields + + Leb{s in D: mu(s,e) in Q_t} + >= (4/5)^n Leb(Q_t) + = 5^(-n) t^(2n/3). (5.1) + +A matrix's row **sums**, not just its diagonal entries, control this conclusion. +The map need not be diagonal, its coordinates need not be independent, and +its centre may depend on the residual field. The construction specifically +retunes the finite parameters to that residual-dependent centre. It does NOT +require the residual field to be within O(t) of the template. + +## 6. Positive probability for the original Gaussian field + +Here we realize the deterministic family using the actual Fourier series. +Smooth periodic functions can be approximated in C^4 by real trigonometric +polynomials: repeated integration by parts makes the Fourier coefficients of +the templates absolutely summable with the required derivative weights. +Choose fixed trigonometric polynomials f_0,h_1,...,h_n approximating (3.1) as +accurately as needed in Section 3. The h_i are linearly independent, since +the matrix of their axial derivatives at the n centres is close to the identity. + +Put them in a finite symmetric Fourier space V_N. Enlarge N, if necessary, so +that the tail event (2.4) has probability at least 1/2 for the fixed error +tolerance used in Section 3. The approximants remain fixed elements of the +enlarged space. Complete h_1,...,h_n to a real basis by e_1,...,e_m. Write + + P_N = sum_i A_i h_i + sum_j B_j e_j, + f_0 = sum_i a_i^* h_i + sum_j b_j^* e_j. (6.1) + +The vector (A,B) has a positive definite Gaussian covariance by (2.1). In +particular A|B=b has a positive definite covariance independent of b and an +affine conditional mean. Choose a small compact box B_0 about b^* whose +probability is positive and for which + + ||sum_j (b_j-b_j^*)e_j||_{C^4} < epsilon/2. + +The m=0 case simply omits this factor. The high-frequency field R_N is +independent of (A,B). On B in B_0 and ||R_N||_{C^4} 0. (6.2) + +This does not assert that the A_i or the regions are independent. Combining +(5.1) with (6.2), for each allowed b and residual sample the conditional +probability of the fold-parameter event is at least + + g_* 5^(-n) t^(2n/3). + +The ridge, inflection and parameter inverse depend continuously on the field +in the fixed C^4 neighborhood, so these events are Borel. Conditional Fubini +and independence of the high Fourier tail from (A,B) now give + + P(event in SF) >= [P(B in B_0) g_*/(2*5^n)] t^(2n/3). (6.3) + +The global nongeneric null event from Section 2 may be removed. Define c_n +by the bracket, reduce t_n to the finitely many restrictions in Sections 3–4, +and Theorem SF follows. Every approximation, Fourier cutoff, box and density +floor was fixed before t tended to zero. The probability cost of the residual +neighborhood is a fixed positive constant, not a hidden small-ball rate. + +## 7. Consequences and the precise sampling obstruction + +### 7.1 A lower bound for the missing count correction + +Take n=2 and abbreviate its positive constant by c_*. Define + + m(t)=E K_t, p(t)=P(K_t>0), + D(t)=E[K_t 1{K_t>=2}], delta(t)=E[(K_t-1)_+]. + +When m(t) is finite, delta(t)=m(t)-p(t); the nonnegative expectations also +make sense without that assumption. Pointwise count inequalities and (SF) give + + D(t) >= 2c_* t^(4/3), + delta(t) >= c_* t^(4/3). (7.1) + +Since 4/3-10/7=-2/21, neither quantity is O(t^(10/7)). This is now an +actual-field obstruction. The previous independent-Bernoulli example only +refuted a general logical inference; (SF) establishes the lower order here. +It is consistent with C52's planar D(t)=o(t^(2/3)). It neither proves nor +refutes preservation of the first correction at order t^(5/4). + +### 7.2 The three-term expected count cannot simply become the occurrence law + +Conditionally on the exact pointwise density interface E3+ in [RATE], + + nu_eld(l) = c l^(-1/3)+c1 l^(1/4)+c2 l^(1/3)+O(l^(3/7)), + +integration gives for the WHOLE torus + + m(t)=a0 t^(2/3)+a1 t^(5/4)+a2 t^(4/3)+O(t^(10/7)), + (a0,a1,a2)=L^d ((3/2)c,(4/5)c1,(3/4)c2). (7.2) + +If p(t) had all three identical coefficients and remainder O(t^(10/7)), its +difference from (7.2) would contradict (7.1). Thus that proposed transfer is +false. If a three-term p expansion exists with the first two coefficients +unchanged and third coefficient b2, then a2-b2>=c_*. We do not prove existence +of that expansion or compute b2. + +The needed next object is the actual multi-bar excess, not merely another +single-bar coefficient. The exact identity + + p(t)=m(t)-P(K_t=2)-E[(K_t-1)1{K_t>=3}] + +shows why a two-bar asymptotic and a >=3 control would help. (SF) alone does +not supply either upper estimate and does not identify a two-bar limit law. + +### 7.3 Marked laws: no unjustified lower bound for a particular mark + +For any common measurable bar mark X_i and integrable K_t, define the finite +measures I=E sum_i delta_{X_i} and J=E[1{K_t>0}(1/K_t)sum_i delta_{X_i}]. +Then R=I-J is positive, its mass is delta=m-p, and, when delta>0, + + I/m = (p/m)(J/p) + (delta/m)(R/delta), + TV(I/m,J/p) = (delta/m) TV(R/delta,J/p) <= delta/m. (7.3) + +TV here is the supremum over measurable sets. If every mark is the same, +the TV distance is zero even when delta>0. Therefore (7.1) does NOT give a +lower bound for the lifetime-only or endpoint-only mark discrepancy. + +There is an optional **field-aware count-mark** consequence in d=2. On the +additional [O] premises m(t)~a0 t^(2/3) and P(K_t=1|K_t>0)->1, use the mark +X_i=K_t on every bar. The event X_i=1 has probability p1/m under intensity +selection and p1/p under field-first selection. Its discrepancy is exactly + + p1*delta/(m*p) = (p1/p)(delta/m) >= c' t^(2/3) (7.4) + +for sufficiently small t. Thus a bound O(t^(16/21)) uniformly over ALL +field-aware marks is impossible on these premises. This does not extend [O] +to higher dimensions, prove a rate for its leading convergence, or prevent +cancellation for a specific mark. + +## 8. Sources, controls and review obligations + +[P] is pinned for the exact Fourier model, finite-jet rank and ordinary +maximin interpretation. Sections 2–6 reconstruct the support, genericity, +parameter-volume and global-cap argument explicitly. No P theorem A/B/C or +weighted Kac–Rice estimate is consumed in SF. [RATE] is used only by (7.2), +and [O] only by (7.4) and the stated compatibility comparison. Their original +conditional scopes and review limitations remain. SOURCE_BINDINGS.json names +these exact interfaces; their surrounding proof bodies are not reaccepted. + +The finite controls verify cubic-gap algebra, both cap-face margins, Hessian +inertia under a nontrivial shear, matrix row/Jacobian bounds, correlated linear +unfoldings, exponent arithmetic, count and marked-measure identities, and +falsifiers for missing Jacobians, false exponents and sampling bias. They do +not establish C^4 approximation, the implicit function theorem, a Gaussian +small-ball event, global continuum topology or the positive probability in SF. +Those are the written analytic proof, not a test-grid inference. + +Requested nonauthor scopes: +- A: uniform deterministic family, discriminant derivative, exact roots/gap, + all cap faces and the actual global elder implication (Sections 3–4). +- B: Fourier construction, fixed residual neighborhood, conditional density, + simultaneous inverse map, Jacobian, measurability and probability (2,5,6). +- C: count obstruction, volume factors, optional imported rate and mark-law + hypotheses, especially what does NOT follow (Sections 1,7). + +No self-merge, scientific register change, institutional validation, calibrated +constant, full formalization or priority-over-literature claim is made. diff --git a/frontiers/separated_fold_multiplicity_20261002/README.md b/frontiers/separated_fold_multiplicity_20261002/README.md new file mode 100644 index 000000000..023b9bea8 --- /dev/null +++ b/frontiers/separated_fold_multiplicity_20261002/README.md @@ -0,0 +1,53 @@ +# Separated folds and multiple ordinary short bars + +New author-side mathematical candidate by OpenAI / GPT-6 Astra Pro. +Universal Law is a research program initiated, directed and supported by Dylan Roy. +Read **PROOF.md**. Scientific-status effect NONE; nonauthor review pending. + +For the original periodized Gaussian field, fixed d>=2,L>0 and any fixed n +pairwise disjoint nonempty regions, the manuscript constructs n actual ordinary +finite elder bars, each of lifetime between t/8 and t, with probability at least +c_n t^(2n/3). It uses finite Fourier coordinates and a fixed residual neighborhood, +not independent spatial regions or a shrinking Gaussian small-ball assumption. +Complete local exit barriers identify the global elder pairings. + +For n=2, this gives an actual-field lower bound of order t^(4/3) for the +multiple-bar excess. Thus it cannot be O(t^(10/7)), and the three-term expected +count cannot automatically be transferred unchanged to occurrence probability. +The main theorem does not use the D1 density theorem, C52 isolation or Kac–Rice. +Only the separately labelled consequences use the pinned RATE/O interfaces. + +Not supplied: a matching upper bound, exactly-two probability, asymptotic +coefficient, two-bar mark law, Poisson approximation, uniform large-volume +constants, numerical c_n, human review or full formalization. In particular a +count discrepancy is not a lower bound for the lifetime-only mark discrepancy. + +## Reproduce finite controls + + python -B -S -m unittest -v + python -B -O -S -m unittest -v + python -B -S check.py + python -B -O -S check.py + python -B -S verify_sources.py --local-only + +Each --mutant M1 through M5 must exit1 in both modes; an unknown label exits2. +These finite checks verify algebra and falsifiers, not the continuum proof. + +In a project checkout containing both pinned commits: + + python -B -S frontiers/separated_fold_multiplicity_20261002/verify_sources.py + +The non-local command authenticates three exact historical path/blob bindings. +Local-only explicitly does not claim that authentication. Source-helper code +reuses the existing c2-audit path/inventory implementation, with a small new +three-source caller and real-Git regression fixtures. No dependency is executed. + +## Review + +A: ridge/discriminant uniformity, exact root gap and every global cap face. +B: fixed Fourier approximation/tail event, correlated Gaussian conditional + density, simultaneous parameter inversion, Jacobian and measurability. +C: count/sampling consequences and the exact optional source hypotheses. + +The author will not self-merge. Original #235 files and reviewed source bodies +are unchanged; this is an isolated successor to pickup235/5943116501. diff --git a/frontiers/separated_fold_multiplicity_20261002/RESULTS.json b/frontiers/separated_fold_multiplicity_20261002/RESULTS.json new file mode 100644 index 000000000..3a6577d89 --- /dev/null +++ b/frontiers/separated_fold_multiplicity_20261002/RESULTS.json @@ -0,0 +1,22 @@ +{ + "axial_face_slack": "77/300 * a^3", + "continuum_theorem_verified_by_tests": false, + "excess_vs_proposed_error_exponent": "4/3-10/7=-2/21", + "fold_gap_squared_ratio_bounds": [ + "32/27", + "32/9" + ], + "lateral_face_drop": "9/64 * a^2", + "multiplicity_exponent": "2n/3", + "mutants": [ + "M1", + "M2", + "M3", + "M4", + "M5" + ], + "parameter_volume_lower_constant": "5^(-n)", + "scientific_effect": "NONE", + "tests_passed": 27, + "two_bar_exponent": "4/3" +} diff --git a/frontiers/separated_fold_multiplicity_20261002/SOURCE_BINDINGS.json b/frontiers/separated_fold_multiplicity_20261002/SOURCE_BINDINGS.json new file mode 100644 index 000000000..5a0280898 --- /dev/null +++ b/frontiers/separated_fold_multiplicity_20261002/SOURCE_BINDINGS.json @@ -0,0 +1,32 @@ +{ + "repository": "d6g8k5htny-coder/Math-", + "scientific_effect": "NONE", + "files": [ + { + "tag": "P", + "commit": "6f74f7a77bae15d6aa07506bab38977e34dcc449", + "path": "imports/lifetime_parent_20260925/UNIFORM_MATRIX_CAP_AND_LIFETIME.md", + "git_blob": "dfed3b8d318a3ab1950957f393307733a4bef3f2", + "bytes": 40261, + "sha256": "9350ad6eaba6626b93c3dedeef9e2ff816e5cdf1c8318e85fb27499141c84bc7", + "use": "Sections 1-2 exact model, positive Fourier spectrum, smoothness and finite-jet rank; Section 8 genericity/maximin convention. Reconstructed here for the unconditioned field; no density or selection estimate consumed." + }, + { + "tag": "RATE", + "commit": "6f74f7a77bae15d6aa07506bab38977e34dcc449", + "path": "frontiers/third_order_rate_20261001/PROOF.md", + "git_blob": "110ed33a57902bef11873807e722fde3888b59fb", + "bytes": 37626, + "sha256": "5de5a6c7b942a71675c812000ade30c16766f02ee388e8dc3e1c51dde5297f7d", + "use": "Optional Section 7.2 only: E3+ pointwise elder-density expansion at its retained parent and fixed-radius far-elder premises. Not needed for SF or the count lower bound." + }, + { + "tag": "O", + "commit": "c46377738b711a5cc2114b58bf7726ae6e7bc553", + "path": "frontiers/ordinary_short_bar_occurrence_20261001/PROOF.md", + "git_blob": "69ff20a6c514629373f3ad12eb2db2a2596777d6", + "bytes": 14146, + "use": "Optional Section 7.3 only, d=2: positive leading mean and singleton conditional limit, retaining all C52 premises. Also cited for compatibility. Frozen unmerged draft #235 at authoring; not needed for SF or Sections 7.1-7.2." + } + ] +} diff --git a/frontiers/separated_fold_multiplicity_20261002/VALIDATION.md b/frontiers/separated_fold_multiplicity_20261002/VALIDATION.md new file mode 100644 index 000000000..b33af32f3 --- /dev/null +++ b/frontiers/separated_fold_multiplicity_20261002/VALIDATION.md @@ -0,0 +1,38 @@ +# Author-side execution and source boundaries + +Actual performer: OpenAI / GPT-6 Astra Pro. This is not a nonauthor review or +formal verification of Theorem SF. No Gaussian fields were simulated here. + +The initial eleven-method mathematical scaffold failed all eleven assertions. +After implementation the expanded 27 mathematical tests passed. The separate +sixteen-method source-verification scaffold produced nineteen failed assertions +before the reused identity helpers and new caller were installed. These failures +are retained in the author work receipt, not attributed to another source. + +Final fresh suite: 43 tests PASS normally and 43 PASS with optimization. The +check.py mathematical control command runs its 27 mathematical tests and emits +RESULTS.json, byte-identical in both modes. Every M1-M5 command exits1, and the +unknown label exits2, in both modes. Mutants respectively break cubic scaling, +the inverse-Jacobian volume constant, off-diagonal parameter control, field-first +weighting, and the two-bar exponent. These finite controls do not establish the +infinite-dimensional probability or topology assertions of the written proof. + +Source-helper behavior is tested in real temporary repositories: original object +versus changed worktree, replacement references, wrong blob or object kind, +symlink sources, unsafe paths, source size/hash errors, incomplete source sets, +and packet inventory drift. The path/inventory helpers reuse the existing c2 +interval-audit implementation, rather than a new global custody framework. + +Historical P/RATE/O files were read through the GitHub connector. The local +container could not retrieve a full upstream checkout because DNS resolution +failed. Local-only verification therefore reports historical_sources_checked=false. +The targeted hosted workflow must fetch both exact commits and check all three +source bindings, including the optional unmerged C52 source. No hosted success is +anticipated by this author-time record. Source authentication proves identity, +not acceptance of a parent's theorem or the new construction. + +The payload is additive. Original proof bodies, registers, explicit findings, +review lineage and other authors' branches remain unchanged. The completed +#207/#218/#220/#229 integration lane stays released; this is separately claimed +successor research outside that earlier source cut. Audit-protocol review does +not imply a program-wide freeze or a clean scientific audit. diff --git a/frontiers/separated_fold_multiplicity_20261002/check.py b/frontiers/separated_fold_multiplicity_20261002/check.py new file mode 100644 index 000000000..3b4762644 --- /dev/null +++ b/frontiers/separated_fold_multiplicity_20261002/check.py @@ -0,0 +1,160 @@ +"""Exact finite controls for the separated-fold manuscript. + +These checks verify algebra and finite examples, not Gaussian support, +transversality, an implicit-function theorem, or a continuum persistence law. +Python standard library only. Numerical inputs must be exact integers/Fractions. +""" +from fractions import Fraction as F +import argparse +import json +import sys + +MUTANT = None +MUTANTS = ('M1', 'M2', 'M3', 'M4', 'M5') + + +def rational(x): + if type(x) not in (int, F): + raise TypeError('an exact integer or Fraction is required') + return F(x) + + +def fold_values(q, alpha=F(2)): + q, alpha = rational(q), rational(alpha) + if q <= 0 or not 1 <= alpha <= 3: + raise ValueError('positive root and curvature in [1,3] required') + mu = alpha*q*q/2 + birth = alpha*q**3/3 + gap = 2*birth if MUTANT != 'M1' else 2*alpha*q*q/3 + return mu, birth, -birth, gap + + +def cap_slack(a): + a = rational(a) + if not 0 < a <= F(1,8): + raise ValueError('radius must be in (0,1/8]') + delta, eta = a*a/100, a**3/100 + axial = (F(1,3)-F(1,24))*a**3-F(3,2)*delta*a-2*eta + lateral = F(1,4)*(F(3,4)*a)**2 + return axial, lateral + + +def hessian(x, shear): + x, shear = rational(x), rational(shear) + return ((-2*x-shear*shear,shear),(shear,F(-1))) + + +def matrix(a): + out = [[rational(x) for x in row] for row in a] + if not out or any(len(row) != len(out) for row in out): + raise ValueError('a nonempty square matrix is required') + return out + + +def det(a): + a=matrix(a); n=len(a); out=F(1) + for j in range(n): + pivot=next((i for i in range(j,n) if a[i][j]),None) + if pivot is None: + return F(0) + if pivot != j: + a[j],a[pivot]=a[pivot],a[j]; out=-out + p=a[j][j];out*=p + for i in range(j+1,n): + z=a[i][j]/p + for k in range(j+1,n):a[i][k]-=z*a[j][k] + a[i][j]=0 + return out + + +def solve(a,b): + a=matrix(a);b=[rational(x) for x in b];n=len(a) + if len(b)!=n:raise ValueError('incompatible right-hand side') + a=[row+[z] for row,z in zip(a,b)] + for j in range(n): + pivot=next((i for i in range(j,n) if a[i][j]),None) + if pivot is None:raise ValueError('singular matrix') + a[j],a[pivot]=a[pivot],a[j] + p=a[j][j];a[j]=[v/p for v in a[j]] + for i in range(n): + if i!=j: + z=a[i][j];a[i]=[x-z*y for x,y in zip(a[i],a[j])] + return [row[-1] for row in a] + + +def row_error(a): + a=matrix(a);n=len(a) + if MUTANT=='M3':return max(abs(a[i][i]-1) for i in range(n)) + return max(sum(abs(a[i][j]-(i==j)) for j in range(n)) for i in range(n)) + + +def lower_volume(n): + if type(n) is not int:raise TypeError('integer multiplicity required') + if n<1:raise ValueError('positive multiplicity required') + return F(1,(4 if MUTANT=='M2' else 5)**n) + + +def exponent(n): + lower_volume(n) + return F(10,7) if MUTANT=='M5' and n==2 else F(2*n,3) + + +def measures(law): + law=[(rational(p),tuple(marks)) for p,marks in law] + if sum((p for p,_ in law),F(0))!=1 or any(p<0 for p,_ in law): + raise ValueError('probability weights must sum to one') + if any(type(x) is not str for _,marks in law for x in marks): + raise TypeError('finite test marks must be strings') + out={k:{} for k in ('I','J','R','R2')} + out.update({k:F(0) for k in ('m','p','D','p1','p2','q2','tail')}) + for p,marks in law: + n=len(marks) + out['m']+=p*n + out['p']+=p*(n>0) + out['p1']+=p*(n==1);out['p2']+=p*(n==2) + out['q2']+=p*(n>=2);out['D']+=p*n*(n>=2) + out['tail']+=p*n*(n>=3) + if not n:continue + for x in marks: + out['I'][x]=out['I'].get(x,F(0))+p + weight=p/n if MUTANT!='M4' else p + out['J'][x]=out['J'].get(x,F(0))+weight + out['R'][x]=out['R'].get(x,F(0))+p-weight + if n==2:out['R2'][x]=out['R2'].get(x,F(0))+p/2 + for name in ('I','J','R','R2'): + out[name]={k:v for k,v in out[name].items() if v} + return out + + +def tv(a,b): + a={k:rational(v) for k,v in a.items()};b={k:rational(v) for k,v in b.items()} + if sum(a.values())!=1 or sum(b.values())!=1 or any(x<0 for x in (*a.values(),*b.values())): + raise ValueError('two probability measures are required') + return sum((abs(a.get(k,0)-b.get(k,0)) for k in a.keys()|b.keys()),F(0))/2 + + +def main(): + parser=argparse.ArgumentParser() + parser.add_argument('--mutant') + args=parser.parse_args() + global MUTANT + if args.mutant and args.mutant not in MUTANTS: + parser.error('unknown mutant label') + MUTANT=args.mutant + # The tests import this exact running module, including the selected mutation. + sys.modules['check']=sys.modules[__name__] + import unittest + suite=unittest.defaultTestLoader.loadTestsFromName('test_check') + result=unittest.TextTestRunner(stream=sys.stderr,verbosity=0).run(suite) + if not result.wasSuccessful():return 1 + print(json.dumps({'scientific_effect':'NONE','tests_passed':result.testsRun, + 'continuum_theorem_verified_by_tests':False, + 'fold_gap_squared_ratio_bounds':['32/27','32/9'], + 'axial_face_slack':'77/300 * a^3','lateral_face_drop':'9/64 * a^2', + 'parameter_volume_lower_constant':'5^(-n)', + 'multiplicity_exponent':'2n/3','two_bar_exponent':'4/3', + 'excess_vs_proposed_error_exponent':'4/3-10/7=-2/21', + 'mutants':list(MUTANTS)},sort_keys=True,indent=2)) + return 0 + +if __name__=='__main__':sys.exit(main()) diff --git a/frontiers/separated_fold_multiplicity_20261002/test_check.py b/frontiers/separated_fold_multiplicity_20261002/test_check.py new file mode 100644 index 000000000..3cea6dbd1 --- /dev/null +++ b/frontiers/separated_fold_multiplicity_20261002/test_check.py @@ -0,0 +1,143 @@ +from fractions import Fraction as F +import unittest +import check as c + +class ExactFoldTests(unittest.TestCase): + def test_cubic_values(self): + for q in (F(1,20),F(1,9),F(1,3)): + mu,b,s,gap=c.fold_values(q) + self.assertEqual(mu,q*q);self.assertEqual(b,F(2,3)*q**3) + self.assertEqual(s,-b);self.assertEqual(gap,F(4,3)*q**3) + def test_curvature_sandwich(self): + for alpha in (F(1),F(3,2),F(2),F(5,2),F(3)): + mu,b,s,gap=c.fold_values(F(1,11),alpha) + self.assertGreater(gap,0);self.assertLess(mu**3,gap**2) + self.assertLess(gap**2,4*mu**3) + def test_cap_faces(self): + for a in (F(1,128),F(1,16),F(1,8)): + axial,lateral=c.cap_slack(a) + self.assertEqual(axial,F(77,300)*a**3) + self.assertGreater(axial,a**3/4) + self.assertEqual(lateral,F(9,64)*a*a) + self.assertGreater(lateral,a*a/16) + def test_actual_inertia_under_shear(self): + for q in (F(1,100),F(1,9)): + for v in (F(-1,10),F(0),F(1,8)): + hm=c.hessian(q,v);hs=c.hessian(-q,v) + self.assertLess(hm[1][1],0);self.assertEqual(c.det(hm),2*q) + self.assertEqual(c.det(hs),-2*q) + def test_inverse_parameter_map(self): + a=[[F(9,8),F(1,16)],[F(-1,16),F(7,8)]] + b=[F(1,16),F(-1,32)];x=c.solve(a,b) + self.assertEqual([sum(a[i][j]*x[j] for j in range(2)) for i in range(2)],b) + def test_uniform_volume(self): + for n in range(1,8): + self.assertEqual(c.lower_volume(n),F(1,5**n)) + def test_matrix_closeness(self): + self.assertEqual(c.row_error([[F(9,8),F(1,16)],[F(-1,16),F(7,8)]]),F(3,16)) + def test_multiplicity_exponent(self): + self.assertEqual(c.exponent(2),F(4,3));self.assertEqual(c.exponent(5),F(10,3)) + def test_mixture_measures(self): + law=[(F(1,4),()),(F(1,2),('a',)),(F(1,4),('a','b'))] + z=c.measures(law) + self.assertEqual(z['m'],1);self.assertEqual(z['p'],F(3,4)) + self.assertEqual(z['I'],{'a':F(3,4),'b':F(1,4)}) + self.assertEqual(z['J'],{'a':F(5,8),'b':F(1,8)}) + self.assertEqual(z['R'],{'a':F(1,8),'b':F(1,8)}) + def test_tv(self): + self.assertEqual(c.tv({'a':F(1)},{'b':F(1)}),1) + def test_input_rejections(self): + with self.assertRaises(TypeError):c.fold_values(0.5) + with self.assertRaises(ValueError):c.fold_values(-F(1)) + with self.assertRaises(ValueError):c.lower_volume(0) + with self.assertRaises(ValueError):c.solve([[F(0)]],[F(1)]) + with self.assertRaises(ValueError):c.measures([(F(1,2),('a',))]) + + +class AdditionalControls(unittest.TestCase): + def test_exact_gap_ratio(self): + for alpha in (F(1),F(7,5),F(3)): + for q in (F(1,40),F(2,19),F(1)): + mu,b,s,g=c.fold_values(q,alpha) + self.assertEqual(g*g/mu**3,F(32,9)/alpha) + def test_unfolding_window(self): + self.assertEqual(F(1,4)**3,F(1,64)) + self.assertEqual(4*F(1,2)**3,F(1,2)) + self.assertGreater(F(1,64),0);self.assertLess(F(1,2),1) + def test_curvature_types_not_endpoint_guesses(self): + for a in (F(-1,8),F(1,8)): + h=c.hessian(a,F(1,9)) + self.assertEqual(h[0][0]-h[0][1]*h[1][0]/h[1][1],-2*a) + def test_linear_preimage_cover(self): + # Correlated coordinates are allowed: none of these matrices is diagonal. + for n in range(2,7): + a=[[F(i==j)+F((-1)**(i+j),8*n) for j in range(n)] for i in range(n)] + self.assertLessEqual(c.row_error(a),F(1,4)) + self.assertLessEqual(abs(c.det(a)),F(5,4)**n) + shift=[F((-1)**i,4) for i in range(n)] + target=[F((-1)**(i+1),2) for i in range(n)] + s=c.solve(a,[x-y for x,y in zip(target,shift)]) + self.assertLessEqual(max(map(abs,s)),1) + def test_nonindependent_unfolding_not_required(self): + a=[[F(1),F(1,5)],[F(1,5),F(1)]] + self.assertEqual(c.det(a),F(24,25));self.assertLess(c.row_error(a),F(1,4)) + def test_rank_defect_cannot_unfold_two_folds(self): + a=[[F(1),F(1)],[F(1),F(1)]] + self.assertEqual(c.det(a),0);self.assertGreater(c.row_error(a),F(1,4)) + with self.assertRaises(ValueError):c.solve(a,[F(1),F(0)]) + def test_jacobian_factor_is_required(self): + for n in range(1,7): + actual=(F(1,4)/F(5,4))**n + self.assertEqual(c.lower_volume(n),actual) + self.assertGreater(F(1,4)**n,actual) + def test_support_tail_markov_scale(self): + # Fixed positive-probability tail event, not a t-dependent small ball. + for eps in (F(1,1000),F(1,13),F(1)): + mean=eps/4 + self.assertLessEqual(mean/(eps/2),F(1,2)) + def test_all_count_identities(self): + for n in range(8): + law=[(F(1,3),()),(F(1,3),('a',)),(F(1,3),tuple('b' for _ in range(n)))] + z=c.measures(law);ex=z['m']-z['p'] + self.assertLessEqual(z['D']/2,ex);self.assertLessEqual(ex,z['D']) + self.assertEqual(ex,z['p2']+F(max(n-1,0),3)*(n>=3)) + self.assertEqual(sum(z['R'].values()),ex) + self.assertLessEqual(sum(z['R'].values())-sum(z['R2'].values()),z['tail']) + def test_marked_mixture_identity(self): + law=[(F(1,8),()),(F(3,8),('a',)),(F(1,4),('a','b')),(F(1,4),('b','c','c'))] + z=c.measures(law);m,p=z['m'],z['p'];ex=m-p + a={k:v/m for k,v in z['I'].items()};b={k:v/p for k,v in z['J'].items()} + excess={k:v/ex for k,v in z['R'].items()} + for k in a.keys()|b.keys()|excess.keys(): + self.assertEqual(a.get(k,0),p/m*b.get(k,0)+ex/m*excess.get(k,0)) + self.assertEqual(c.tv(a,b),ex/m*c.tv(excess,b)) + def test_same_marks_no_tv_lower_bound(self): + z=c.measures([(F(1,2),('a',)),(F(1,2),('a','a'))]) + self.assertGreater(z['m']-z['p'],0) + a={k:v/z['m'] for k,v in z['I'].items()};b={k:v/z['p'] for k,v in z['J'].items()} + self.assertEqual(c.tv(a,b),0) + def test_singleton_count_mark_detects_bias(self): + law=[(F(1,2),()),(F(1,3),('one',)),(F(1,6),('two','two'))] + z=c.measures(law);m,p=z['m'],z['p'];ex=m-p + self.assertEqual(z['J']['one']/p-z['I']['one']/m,z['p1']*ex/(m*p)) + def test_bernoulli_falsifier(self): + for k in (2,3,5,9): + q=F(1,k**7);p=q*q + z=c.measures([((1-p)**2,()),(2*p*(1-p),('one',)),(p*p,('two','two'))]) + self.assertEqual(z['m'],2*p);self.assertEqual(z['p'],2*p-p*p) + self.assertEqual(z['D'],2*p*p) + self.assertEqual(z['D']/F(1,k**30),2*k*k) + def test_count_obstruction_exponents(self): + self.assertEqual(c.exponent(2)-F(10,7),-F(2,21)) + self.assertLess(c.exponent(2),F(10,7)) + def test_cumulative_and_mark_rates(self): + self.assertEqual(F(3,7)+1,F(10,7)) + self.assertEqual(F(10,7)-F(2,3),F(16,21)) + self.assertLess(F(2,3),F(16,21)) + def test_negative_inputs_do_not_alias(self): + for x in (True,0.5,'1/2'): + with self.assertRaises(TypeError):c.fold_values(x) + with self.assertRaises(ValueError):c.measures([(F(-1),()),(F(2),('a',))]) + with self.assertRaises(ValueError):c.tv({'a':F(1,2)},{'a':F(1)}) + +if __name__=='__main__':unittest.main() diff --git a/frontiers/separated_fold_multiplicity_20261002/test_sources.py b/frontiers/separated_fold_multiplicity_20261002/test_sources.py new file mode 100644 index 000000000..9939096ba --- /dev/null +++ b/frontiers/separated_fold_multiplicity_20261002/test_sources.py @@ -0,0 +1,71 @@ +"""Real temporary Git fixtures; they do not authenticate the upstream repository.""" +import hashlib,json,os,subprocess,tempfile,unittest +from pathlib import Path +import verify_sources as v + +class SourceTests(unittest.TestCase): + def setUp(self): + t=tempfile.TemporaryDirectory();self.addCleanup(t.cleanup);self.root=Path(t.name) + self.git('init','-q');self.data=b'original exact source\n' + (self.root/'source').write_bytes(self.data);self.git('add','source');self.git('commit','-qm','source') + self.sha=self.git('rev-parse','HEAD').decode().strip() + self.entry={'path':'source','git_blob':self.git('rev-parse','HEAD:source').decode().strip(),'commit':self.sha,'bytes':len(self.data)} + def git(self,*args): + env=dict(os.environ);env.pop('GIT_NO_REPLACE_OBJECTS',None) + return subprocess.run(['git','-c','user.name=Fixture','-c','user.email=f@example.invalid',*args],cwd=self.root, + env=env,capture_output=True,check=True,timeout=15).stdout + def test_original_bytes(self):self.assertEqual(v.read_source(self.root,self.sha,self.entry),self.data) + def test_reject_wrong_blob(self): + with self.assertRaises(ValueError):v.read_source(self.root,self.sha,dict(self.entry,git_blob='0'*40)) + def test_reject_noncommit(self): + with self.assertRaises(ValueError):v.read_source(self.root,self.entry['git_blob'],self.entry) + def test_reject_unsafe_paths(self): + for path in ('../source','/source','x//source','x/./source'): + with self.subTest(path=path),self.assertRaises(ValueError):v.read_source(self.root,self.sha,dict(self.entry,path=path)) + def test_ignore_changed_worktree(self): + (self.root/'source').write_text('new') + self.assertEqual(v.read_source(self.root,self.sha,self.entry),self.data) + def test_ignore_replace_objects(self): + (self.root/'source').write_text('new');self.git('add','source');self.git('commit','-qm','new') + other=self.git('rev-parse','HEAD').decode().strip();self.git('replace',self.sha,other) + self.assertEqual(self.git('show',self.sha+':source'),b'new') + self.assertEqual(v.read_source(self.root,self.sha,self.entry),self.data) + def test_reject_symlink_source(self): + (self.root/'alias').symlink_to('source');self.git('add','alias');self.git('commit','-qm','symlink') + sha=self.git('rev-parse','HEAD').decode().strip();blob=self.git('rev-parse','HEAD:alias').decode().strip() + with self.assertRaises(ValueError):v.read_source(self.root,sha,{'path':'alias','git_blob':blob}) + def test_all_three_distinct_source_refs(self): + entries=[dict(self.entry,tag=tag) for tag in ('P','RATE','O')] + self.assertEqual(v.verify_bound_sources(self.root,{'files':entries}),3) + def test_reject_missing_source(self): + with self.assertRaises(ValueError):v.verify_bound_sources(self.root,{'files':[dict(self.entry,tag='P')]}) + def test_optional_size_and_sha(self): + entries=[dict(self.entry,tag=tag,sha256=hashlib.sha256(self.data).hexdigest()) for tag in ('P','RATE','O')] + self.assertEqual(v.verify_bound_sources(self.root,{'files':entries}),3) + entries[1]['bytes']+=1 + with self.assertRaises(ValueError):v.verify_bound_sources(self.root,{'files':entries}) + def test_reject_sha_drift(self): + entries=[dict(self.entry,tag=tag,sha256='0'*64) for tag in ('P','RATE','O')] + with self.assertRaises(ValueError):v.verify_bound_sources(self.root,{'files':entries}) + +class InventoryTests(unittest.TestCase): + def setUp(self): + t=tempfile.TemporaryDirectory();self.addCleanup(t.cleanup);self.root=Path(t.name) + data=b'exact\n';(self.root/'payload').write_bytes(data) + self.entry={'path':'payload','bytes':len(data),'sha256':hashlib.sha256(data).hexdigest()} + (self.root/'MANIFEST.json').write_text(json.dumps({'files':[self.entry]})) + def test_exact_inventory(self):self.assertEqual(v.inventory(self.root),1) + def test_reject_extra(self): + (self.root/'extra').write_text('extra') + with self.assertRaises(ValueError):v.inventory(self.root) + def test_reject_changed_bytes(self): + (self.root/'payload').write_text('changed') + with self.assertRaises(ValueError):v.inventory(self.root) + def test_reject_symlink_payload(self): + (self.root/'payload').unlink();(self.root/'payload').symlink_to('MANIFEST.json') + with self.assertRaises(ValueError):v.inventory(self.root) + def test_reject_duplicate_json_keys(self): + (self.root/'MANIFEST.json').write_text('{"files":[],"files":[]}') + with self.assertRaises(ValueError):v.inventory(self.root) + +if __name__=='__main__':unittest.main() diff --git a/frontiers/separated_fold_multiplicity_20261002/verify_sources.py b/frontiers/separated_fold_multiplicity_20261002/verify_sources.py new file mode 100644 index 000000000..0a5b25dc7 --- /dev/null +++ b/frontiers/separated_fold_multiplicity_20261002/verify_sources.py @@ -0,0 +1,82 @@ +"""Source identity only, not proof acceptance. + +Path/commit/blob and flat-inventory helpers are reused from the c2 audit verifier +at a7421bbb / blob c6fb38bf91bf76f07c171b0120eb86ed18028513. The small caller +changes bind three distinct source interfaces at their own historical commits. +""" +import argparse,hashlib,json,os,re,subprocess +from pathlib import Path,PurePosixPath + +def read_json(p): + if p.is_symlink() or not p.is_file():raise ValueError('regular JSON required') + def unique(items): + d={} + for k,v in items: + if k in d:raise ValueError('duplicate JSON key') + d[k]=v + return d + out=json.loads(p.read_text(),object_pairs_hook=unique) + if not isinstance(out,dict):raise ValueError('JSON object required') + return out + +def safe(path): + if not isinstance(path,str) or not path:raise ValueError('path required') + p=PurePosixPath(path) + if p.is_absolute() or str(p)!=path or any(x in ('.','..') or not re.fullmatch('[A-Za-z0-9_.-]+',x) for x in p.parts): + raise ValueError('unsafe path') + return p.parts + +def git(root,*args): + r=subprocess.run(['git','--no-replace-objects',*args],cwd=root,env=dict(os.environ,GIT_NO_REPLACE_OBJECTS='1'), + capture_output=True,timeout=30) + if r.returncode:raise ValueError('historical Git read failed') + return r.stdout + +def read_source(root,commit,e): + if not re.fullmatch('[0-9a-f]{40}',commit):raise ValueError('full commit required') + if git(root,'cat-file','-t',commit).strip()!=b'commit':raise ValueError('not a commit') + parts=safe(e['path']) + for j in range(1,len(parts)+1): + path='/'.join(parts[:j]);rows=[x for x in git(root,'ls-tree','--full-tree','-z',commit,'--',path).split(b'\0') if x] + if len(rows)!=1:raise ValueError('missing or ambiguous path') + info,name=rows[0].split(b'\t',1);mode,kind,blob=info.decode().split() + if name.decode()!=path:raise ValueError('path mismatch') + if j