diff --git a/reviews/iba2_012_log_cap_transfer_20261006/NOTE.md b/reviews/iba2_012_log_cap_transfer_20261006/NOTE.md new file mode 100644 index 000000000..b158965fa --- /dev/null +++ b/reviews/iba2_012_log_cap_transfer_20261006/NOTE.md @@ -0,0 +1,302 @@ +# IBA2-012: full soft power with an optimal logarithmic cap penalty + +Object: IBA2-012-LOG-CAP-TRANSFER-20261006-v1. +Dylan Roy — delegated AI mathematical work. Actual author OpenAI / GPT-6 Astra Pro, +`iba2-log-cap-transfer-20261006-r7`, pickup main#259/6008206382. Author-exposed +continuation of FR/#319/#324; organizational-independence credit0; scientific effect NONE. +**Conditional author-side proof candidate. Nonauthor mathematical review required.** +No prior proof, acceptance record, scientific register or formal target changes. + +## 1. Sources, new scope and ancestry + +Repository `d6g8k5htny-coder/Math-`. Source cut: +`b25cac0bcbb4032d624f14795257d9578c90d105`. + +| Tag | Path | Complete Git blob | Consumed interface | +|---|---|---|---| +| FR | `reviews/iba2_012_finite_radius_20261005/PROOF.md` | `5ed684c9bb446efc9bef5f3980717c6dc039abfd` | Sections3–5/8, original finite-radius mixed-threshold event bound with each fixed derivative-norm power | +| SH | `frontiers/c6_sharpened_20260929/PROOF.md` | `70ba19726a9114bfceae04d021095e6c8eed5026` | Sections3–4 and section5 BEFORE its first-moment assembly: measurable cap Psi, original-law tail(5.1), and fixed moments | +| P | `imports/lifetime_parent_20260925/UNIFORM_MATRIX_CAP_AND_LIFETIME.md` | `dfed3b8d318a3ab1950957f393307733a4bef3f2` | (4.1), (5.1)–(5.5): uniform derivative and W/r^2 moments, and full normalizer Z>=z_*r^2 | +| CT | `reviews/iba2_012_count_transfer_20261006/PROOF.md` | `752bc9da5e49af3d0724d80c91cffc0dde35a2d8` | Provenance/comparison; section3 only for the OPTIONAL minimum with its fixed-order bound | + +FR's spectral integration and CT's count insertion/abstract no-constant-loss +obstruction are already recorded. This note does not duplicate those results or +replace #324's localized-moment addendum. It uses an ADDITIONAL quantitative input: +SH's tail for the analytic critical-count cap. The preceding chat derived a +logarithmic improvement but did not publish or execute it; this packet supplies +full source bindings, a dyadic exact-control sharpness family and finite tests. + +SH's cap statement precedes its later use of G_d/I5 to assemble factorial moments. +The proof of LT below does not consume that first-moment assembly or C6 Palm +Theorem Q. This is a dependency distinction at the quoted interface, NOT a new +independent proof of SH's cap, its multidimensional Rouche/Bezout, covariance, +complexification or protected-cover premises. Their exact stated scope and +unresolved ancestral qualifications remain. No old author-side header, merge or +green workflow is converted into independent mathematical acceptance here. + +All SH first-moment theorem qualifications remain in its source; only the cap-tail +interface is imported. A defect in that tail invalidates its use below. P's +congruence explanation is not used as a new equality: only the quoted uniform +moments and full-normalizer estimate are consumed. No inverse-Hessian bound or +extra soft-sector normalizer is introduced. + +## 2. Setting and statement + +Fix d>=3, torus side L>0, observation radius R>=1, a compact birth interval and +compact positive gap marks 0=1; do not identify this K with another +source's differently named cover radius, derivative constant or gap interval. + +For 1<=q<=d-2, let h_j be FR's ordered eigenvalues of the negative midpoint +transverse Hessian. Choose deterministic ordered thresholds + + 0<=eta_2<=...<=eta_(q+1)<=1/2, 00} intersect S, + Xi=product_(j=2)^(q+1)(eta_j+r)^(j+2), + beta=q(q+7)/2. + +Then r^beta<=Xi<=1. Midpoint eigenvalues may be negative, zero thresholds are +allowed, no unmentioned lower bound on other eigenvalues is assumed, and q=d-2 +includes the all-soft transverse case. FR-mixed states, for each fixed a>=0, + + E_(P_r)[K^a 1_E] <= C_a r^3 Xi. (F) + +For sufficiently small r put + + u=log(1/r), Lambda(r)=u/log u. + +**Theorem LT.** Conditional on the quoted interfaces, for every fixed a>=0 and +s>0 there are C0 such that throughout the fixed parameter set, + + E_(P_r)[K^a N^s 1_E] + <= C r^3 Xi Lambda(r)^(d s), (LT) + E_(P_r)[K^a N_R^s 1_S] + <= C r^3 Xi Lambda(r)^(d s). (LT-local) + +Constants can depend on a,s,q,d,L,R, the fixed cover and the compact marks; no +numerical field constant or radius is evaluated. This is full soft POWER with a +logarithmic penalty, NOT the constant loss-free estimate O(r^3 Xi). + +## 3. Proof: a cutoff and four-factor Holder under the original law + +### 3.1 Exactly the moments and tail used + +SH(5.1) gives constants c,C0,x0>0, uniform in the stated pin parameters, with + + Q_r(Psi>x)<=C0 exp[-c x^(1/d) log x], x>=x0. (T) + +It implies uniformly bounded E_Q Psi^t for every fixed t>0 by tail integration. +P(4.1) gives the same fixed-order moment property for K. P(5.3)'s following +moment statement and (5.5) give + + ||D_r||_(L4(Q_r)) + = ||W_r/r^2||_4 / (Z_r/r^2) <= C. (M) + +In particular E_Q K^(4a) and E_Q Psi^(4s) are bounded. All these orders are +FIXED, independent of r. No joint independence or joint conditional moment +estimate is assumed. The density has integral1 and the full Z is used once. + +### 3.2 Charge both sides of the cutoff + +For any T>=max(1,x0), split the nonnegative expectation at Psi=T. Since N<=Psi, + + E_P[K^a N^s 1_E; Psi<=T] + <= T^s E_P[K^a 1_E] <= C_a T^s r^3 Xi. (1) + +For the other branch, drop E and return to Q: + + E_P[K^a N^s 1_E; Psi>T] + <= E_Q[D_r K^a Psi^s 1_{Psi>T}] + <= ||D_r||_4 ||K^a||_4 ||Psi^s||_4 + Q_r(Psi>T)^(1/4) + <= C_(a,s) exp[-(c/4) T^(1/d) log T]. (2) + +The four conjugate reciprocal exponents sum to1. The quarter in (2) must be +retained when selecting the cutoff. No separate count-moment theorem, random +matrix inverse, witness conditioning or uncharged exceptional branch appears. + +### 3.3 A uniform cutoff and tail absorption + +Take A>=max(1,4(beta+4)/c), fixed, and + + T=A^d (u/log u)^d. + +Reduce r_* so u>=e^2 and T>=max(1,x0). If t=log u>=2, then log t<=t/2: the +function t/2-log t is positive at2 and nondecreasing for t>=2. Thus + + log T=d(log A+log u-loglog u)>=(d/2)log u>=log u, + T^(1/d) log T >= A u. + +The last inequality uses d>=2; our field application has d>=3. Consequently + + exp[-(c/4)T^(1/d)log T] + <= exp[-(beta+4)u]=r^(beta+4)<=r^3 Xi. (3) + +The last step uses Xi>=r^beta and r<=1. At eta_j=0 it remains valid; there is +no missing diagonal layer. Since T^s=A^(ds)Lambda(r)^(ds) and Lambda(r)>=1, +adding (1)–(3) proves LT. For s>0, + + N_R^s 1_S=N_R^s 1_E<=N^s 1_E, + +which proves LT-local. For s=0 use FR directly with the NONEMPTY event E; do not +reinterpret N_R^0 1_S as that event. This completes the ordinary proof. + +## 4. Consequences and comparison with the recorded fixed-order bound + +For eta_j=r^alpha_j with fixed alpha_2>=...>=alpha_(q+1)>0, set + + B=sum_(j=2)^(q+1)(j+2)min(alpha_j,1)>0. + +The same finite-r saturation as FR gives + + E_P[K^a N_R^s 1_S] + =O(r^(3+B) Lambda(r)^(ds))=o(r^3). (4) + +Examples at eta_j=r: + +| d | q | count power s | bound | +|---|---|---|---| +| 3 | 1 | 1 | O(r^7 Lambda^3) | +| 3 | 1 | 2 | O(r^7 Lambda^6) | +| 4 | 2 | 1 | O(r^12 Lambda^4) | + +With the CT interface additionally assumed at one fixed integer p>s, the two +separately proved estimates may be combined: + + E_P[K^a N_R^s 1_S] + <= C r^3 min{Xi^(1-s/p), Xi Lambda(r)^(ds)}. (5) + +The first estimate can be better for very slowly shrinking thresholds. LT ALONE +does not show negligibility for every deterministic Xi->0; one needs +Xi Lambda^(ds)->0. CT supplies the broader qualitative statement under its own +inputs. We do not send p to infinity or claim constants uniform in p. + +For each fixed integer s>=1, (N_R)_s<=N_R^s. Therefore deleting configurations in +S from the r^-3-rescaled positive ordered-s-tuple intensity changes its total +variation mass by at most C Xi Lambda^(ds), with the same K^a-weighted upper bound +for tuple observables bounded by K^a. The convention is total mass for a positive +measure, not half the L1 norm of probabilities. This concerns only the deleted +sector. There is no assertion of a full point-process limit, location density, +normalized factorial Palm law, local nonempty lower bound or elder selection. + +## 5. Sharpness for the NUMERICAL interfaces, not for the actual field + +The logarithmic factor cannot be replaced by o(Lambda^(ds)) solely from the event, +density-moment and cap-tail inequalities used above. The following one family +works for every fixed count order simultaneously. A sequence r_j suffices to +refute any proposed uniform inequality; a continuous interpolation is unnecessary. + +Fix d>=3. For integers j>=2 put + + n=2^j, r_j=2^(-n), v_j=floor(n/j)>=2, M_j=v_j^d. + +On an abstract three-atom probability space set Q_j=P_j. The ordinary atom has +probability r_j^3 and count N_R=N=2. The rare atom has probability r_j^7 and +count N_R=N=M_j. The remaining probability 1-r_j^3-r_j^7 has count0. +Set W_j=r_j^2, Z_j=r_j^2, D_j=1, K=3 and Psi=N+2. These give a normalized +density and all required W/r^2 and K moments. Set h_1=r_j/2 throughout; h_2=r_j +on the rare atom and h_2=2 otherwise. For d>3 take h_3=...=h_(d-1)=3. +These are abstract ordered marks, not an actual field Hessian or derivative norm. + +### 5.1 Event bounds for EVERY threshold + +For q=1 and every eta in [0,1/2], E={N_R>0,h_2<=eta} is empty if eta=0. For q>=2 the extra mark h_3=3 makes E empty throughout +the allowed thresholds. Thus no untested off-diagonal threshold is hidden. + +### 5.2 Uniform cap tail with an explicit numerical constant + +At t>=4 the ordinary cap value4 and the zero-count cap value2 contribute nothing +to {Psi>t}. The tail is either0, or exactly r_j^7 when t=2, + + t^(1/d)log t <= (3/2)d n[(j+1)/j]log2 + <=3d n log2. + +Therefore, for every j>=2 and t>=4, + + Q_j(Psi>t) <= exp[-(1/d)t^(1/d)log t], (6) + +because its nonzero value is exp[-7n log2]. Thus (T) holds with C0=1,c=1/d,x0=4, +not just a vaguely fitted tail. All fixed Psi moments consequently are uniformly +finite. Also, for each fixed real p>0, + + E[N^p]/r_j^3=2^p+2^(-4n)v_j^(dp)<=C_p. + +The final boundedness follows from exponential decay against any fixed polynomial; +all factorial upper bounds follow. Even an added global first/second lower scale +holds: P(N_R>0)>=r_j^3 and E[(N)_2]>=2r_j^3. + +### 5.3 Match the logarithmic order + +At eta=r_j, + + E[N_R^s;S]/[r_j^3(2r_j)^4]=v_j^(ds)/16. (7) + +Now Lambda(r_j)=n log2/(j log2+loglog2). The elementary inequalities +1/2=2, + + n/j <= Lambda(r_j) <= 2n/j, + n/(2j) <= v_j <= n/j. + +Hence Lambda(r_j)/4<=v_j<=Lambda(r_j), and (7) lies between +4^(-ds)Lambda(r_j)^(ds)/16 and Lambda(r_j)^(ds)/16. It is not +O(1) and not o(Lambda(r_j)^(ds)). The same model works for each fixed s>0. + +This establishes numerical-interface sharpness. It does NOT instantiate the +periodic Gaussian law, density on Hessian space, analytic sample paths, Rouche +construction of Psi, independence of a Gaussian residual or geometric relations +between N and K. Those structures might imply a stronger result for the actual +field. A uniform joint sector-conditioned count estimate would be additional +information, not a consequence of this abstract bound. No actual-field lower +asymptotic or impossibility theorem is claimed. + +## 6. Finite controls, execution and review boundaries + +`test_log_cap.py` exercises12 exact finite methods against `log_cap_check.py`. +The initial missing-implementation run produced12 assertion failures and no test +errors. The companion uses Fraction/integer arithmetic only. It checks mixed +powers, the tail quarter/cutoff coefficient, a dyadic sharpness family, correlated +four-factor Holder cases, the event-retaining truncation, one normalizer, zero +threshold absorption, remote-only exclusion, and elementary factorial domination. +It does NOT evaluate log at floating precision or numerically certify a Gaussian +constant; the transcendental cutoff and infinite limits are the written arguments. + +Five intentional wrong variants must fail for their intended assertion reasons: +M1 omits the cutoff's Holder-quarter compensation; M2 uses (d-1)s rather than ds; +M3 drops the common radial r^3; M4 removes the divisor j in the spike scale; +M5 drops the full normalizer. Unexpected exceptions are errors, not mathematical +rejections. Normal/optimized results and exact source identities are recorded in +separate receipts. The original failures remain preserved. + +Smallest nonauthor review: quoted law/scope alignment, (M), four-factor bound(2), +cutoff and absorption(3), plus ALL-threshold/event/tail and order comparison in +section5. Check the optional CT premise in(5) rather than conflating it with LT's +inputs. The whole numerical-interface countermodel must remain explicitly +non-Gaussian. No duplicate review of P/FR/CT ancestors is requested. + +General IBA2-012 and IBA2-009, escaping marks or observation radius, higher-jet +sector exhaustion, remote-only events, lifetime integration, actual conditional +count law, full process convergence, independent formal alignment and scientific +acceptance remain outside this note. No source from #319/#324 is rewritten. diff --git a/reviews/iba2_012_log_cap_transfer_20261006/README.md b/reviews/iba2_012_log_cap_transfer_20261006/README.md new file mode 100644 index 000000000..a8774b57d --- /dev/null +++ b/reviews/iba2_012_log_cap_transfer_20261006/README.md @@ -0,0 +1,49 @@ +# Logarithmic cap transfer — IBA2-012 + +This additive conditional proof uses FR's finite-radius multi-soft event bound, +SH's quantitative original-law critical-count cap tail and P's moments/full +normalizer to obtain full soft power with a logarithmic penalty: + + E[K^a N_R^s; S] <= C r^3 Xi [log(1/r)/loglog(1/r)]^(d s). + +This is NOT O(r^3Xi) with a uniform constant. An explicit dyadic abstract family +satisfies the numerical tail/event/moment bounds and attains this logarithmic +order. It is not an actual Gaussian-field counterexample. Read NOTE.md before +using the formulas. Existing #319 count transfer and #324 input-reduction work +are credited and unchanged. + +## Reproduce finite controls + +Python3.11+ standard library only, from this directory: + +```sh +python3 -B -S test_log_cap.py +python3 -B -O -S test_log_cap.py +python3 -B -S test_log_cap.py --mutant M1 +python3 -B -S test_log_cap.py --mutant M2 +python3 -B -S test_log_cap.py --mutant M3 +python3 -B -S test_log_cap.py --mutant M4 +python3 -B -S test_log_cap.py --mutant M5 +``` + +The baseline reports12 methods with empty errors/failures and exit0. Repeat the +mutants under -O: each must exit1 with its intended assertion failures and no +errors. Invalid labels exit2. Unittest writes diagnostics to stderr; empty +baseline stderr is NOT required. Deterministic JSON stdout is the comparison +surface. A crash or permission failure is never a successful negative control. +These are finite exact controls, not a simulation, Lean replay or proof of the +arbitrary-law/analytic inputs. Existing general CI does not automatically discover +this packet's standalone tests. + +## Scope and offline agents + +SOURCES.json binds complete directly quoted sources. Preserve original files and +save outputs into a new outbox, not inside a sealed packet. The accompanying +private chat delivery includes these source texts and the source/execution audit; +it is a supplement, not a new complete repository or laptop backup. Existing +large archives and the corrected R5 installer stay unchanged. No laptop install, +local inference or toolchain-cache completeness is implied. + +Nonauthor mathematical review and separate eligible integration remain distinct +from these tests and current-candidate required checks. No scientific status, +parent theorem, formal target, workflow, or historical review is promoted. diff --git a/reviews/iba2_012_log_cap_transfer_20261006/SOURCES.json b/reviews/iba2_012_log_cap_transfer_20261006/SOURCES.json new file mode 100644 index 000000000..d947a1ed5 --- /dev/null +++ b/reviews/iba2_012_log_cap_transfer_20261006/SOURCES.json @@ -0,0 +1,66 @@ +{ + "object": "IBA2-012-LOG-CAP-TRANSFER-20261006-v1", + "repository": "d6g8k5htny-coder/Math-", + "source_cut": "b25cac0bcbb4032d624f14795257d9578c90d105", + "author": "OpenAI / GPT-6 Astra Pro / iba2-log-cap-transfer-20261006-r7", + "principal": "Dylan Roy — delegated AI work", + "scientific_effect": "NONE", + "organizational_independence_credit": 0, + "inputs": [ + { + "path": "reviews/iba2_012_finite_radius_20261005/PROOF.md", + "git_blob": "5ed684c9bb446efc9bef5f3980717c6dc039abfd", + "sha256": "cad7fa81a70dc218286d7ec62f7a86daf337677d65398ff906c455157067f93f", + "size": 17362, + "consumed_slice": "FR sections3-5/8" + }, + { + "path": "imports/lifetime_parent_20260925/UNIFORM_MATRIX_CAP_AND_LIFETIME.md", + "git_blob": "dfed3b8d318a3ab1950957f393307733a4bef3f2", + "sha256": "9350ad6eaba6626b93c3dedeef9e2ff816e5cdf1c8318e85fb27499141c84bc7", + "size": 40261, + "consumed_slice": "P(4.1), following(5.3), (5.5)" + }, + { + "path": "reviews/iba2_012_count_transfer_20261006/PROOF.md", + "git_blob": "752bc9da5e49af3d0724d80c91cffc0dde35a2d8", + "sha256": "63eb5fd131d440d918c86269b1b613b3d62b897b1349135405ada04d2a611061", + "size": 14855, + "consumed_slice": "CT section3 for optional minimum only; provenance" + }, + { + "path": "frontiers/c6_sharpened_20260929/PROOF.md", + "git_blob": "70ba19726a9114bfceae04d021095e6c8eed5026", + "sha256": "9f45274ab59d4f4417d1a51e9c97f5916240fdb0a4640ca6f0d3e9e0aea37dd7", + "size": 13278, + "consumed_slice": "SH sections3-4 and cap tail(5.1), before first-moment assembly" + } + ], + "payloads": [ + { + "path": "NOTE.md", + "git_blob": "b158965faf0f4113309d825ce1892743910fc028", + "sha256": "e975dc65e67d8631cbbd16568f92361731eb572fa88687c0b6e8eeb1af7313fe", + "size": 14237 + }, + { + "path": "README.md", + "git_blob": "a8774b57d148c492298a58661d09ce206f66d89c", + "sha256": "587a4b61cb798b4e167d8ba1c31b44f79893da4236b3357c0c24ad09c2259bb4", + "size": 2347 + }, + { + "path": "log_cap_check.py", + "git_blob": "2e6a19bf5907585fbbf63485916876e65dbe8567", + "sha256": "ef6accc5112c1ebc5ea9c07e88e01d8c816705b271aa294a9ffc64e29b7a8089", + "size": 3655 + }, + { + "path": "test_log_cap.py", + "git_blob": "7ef45c589e65fbdf6eaed39142873c2bd383fffc", + "sha256": "add5a4781838daadd56851c0b93714f43f4e37201f811c3eb90797400231d31b", + "size": 6570 + } + ], + "execution_scope": "12 exact finite methods in each Python mode, five intended mutants per mode and invalid-label rejection; not continuum/Lean/model proof. Exact receipts and nonauthor review stay separate." +} diff --git a/reviews/iba2_012_log_cap_transfer_20261006/log_cap_check.py b/reviews/iba2_012_log_cap_transfer_20261006/log_cap_check.py new file mode 100644 index 000000000..2e6a19bf5 --- /dev/null +++ b/reviews/iba2_012_log_cap_transfer_20261006/log_cap_check.py @@ -0,0 +1,103 @@ +"""Exact finite algebra for the log-cap transfer note; no numerical field constants. + +MUTANT is a test-only switch. The tests, not these helpers, assign pass/fail. +Transcendental tail inversion and all infinite-family limits are proved in NOTE.md. +""" +from __future__ import annotations +from fractions import Fraction as F +from math import prod + +MUTANT: str | None = None + + +def beta(q: int) -> int: + if type(q) is not int or q < 1: + raise ValueError('positive integer q required') + return q*(q+7)//2 + + +def mixed_power(alphas) -> F: + values=tuple(F(a) for a in alphas) + if not values or any(a<=0 for a in values) or any(a tuple[F,F]: + values=tuple(alphas);s=F(s) + if type(d) is not int or d<3 or len(values)>d-2 or s<=0: + raise ValueError('fixed d>=3, 1<=q<=d-2 and s>0 required') + radial=(0 if MUTANT=='M3' else 3)+mixed_power(values) + logarithmic=((d-1) if MUTANT=='M2' else d)*s + return radial,logarithmic + + +def holder_powers() -> tuple[F,...]: + return (F(1,4),)*4 + + +def cutoff_constant(q: int, c) -> F: + c=F(c) + if c<=0:raise ValueError('positive tail constant required') + factor=1 if MUTANT=='M1' else 4 + return max(F(1),F(factor*(beta(q)+4))/c) + + +def cutoff_powers(d: int) -> tuple[int,int]: + if type(d) is not int or d<3:raise ValueError('integer d>=3 required') + return d, -d + + +def spike(j: int, d: int) -> dict: + if type(j) is not int or j<2 or type(d) is not int or d<3: + raise ValueError('integers j>=2,d>=3 required') + n=2**j + v=n if MUTANT=='M4' else n//j + r=F(1,2**n) + ordinary=r**3;rare=r**7 + return dict(j=j,d=d,n=n,v=v,count=v**d,r=r,ordinary=ordinary,rare=rare,zero=1-ordinary-rare) + + +def spike_ratio(j:int,d:int,s:int) -> F: + c=spike(j,d) + return c['rare']*c['count']**s/(c['r']**3*(2*c['r'])**4) + + +def holder_finite(probs,densities,K,psi,a:int,s:int,T): + rows=list(zip(probs,densities,K,psi,strict=True)) + lhs=sum((p*z*k**a*x**s for p,z,k,x in rows if x>T),F(0)) + rhs=(sum((p*z**4 for p,z,k,x in rows),F(0)) + *sum((p*k**(4*a) for p,z,k,x in rows),F(0)) + *sum((p*x**(4*s) for p,z,k,x in rows),F(0)) + *sum((p for p,z,k,x in rows if x>T),F(0))) + return lhs,rhs + + +def truncation(probs,K,N,psi,E,a:int,s:int,T): + rows=list(zip(probs,K,N,psi,E,strict=True)) + low=sum((p*k**a*n**s for p,k,n,x,e in rows if e and x<=T),F(0)) + bound=T**s*sum((p*k**a for p,k,n,x,e in rows if e),F(0)) + return low,bound + + +def normalized_weights(weights,Z) -> list[F]: + Z=F(Z);weights=[F(w) for w in weights] + if Z<=0 or any(w<0 for w in weights):raise ValueError('positive full normalizer and nonnegative weights required') + return weights if MUTANT=='M5' else [w/Z for w in weights] + + +def xi(thresholds,r) -> F: + values=[F(x) for x in thresholds];r=F(r) + if not values or not 0b for a,b in zip(values,values[1:])): + raise ValueError('ordered thresholds in [0,1/2], 0 bool: + return local_count>0 and all(x<=eta for x,eta in zip(soft,thresholds,strict=True)) + + +def falling(n:int,s:int) -> int: + if type(n) is not int or type(s) is not int or n<0 or s<1: + raise ValueError('integer n>=0 and integer s>=1 required') + return 0 if n=r else F(0) + self.assertLessEqual(mass,r**3*(eta+r)**4) + + def test_abstract_tail_majorant(self): + # Bounds phi(t)/log2 <= 3*d*n on the only nonzero t>=4 tail interval. + for j in range(2,12): + for d in range(3,8): + c=mod.spike(j,d);n=c['n'];v=c['v'];M=c['count'] + self.assertLessEqual(M+2,(v+1)**d) + self.assertLessEqual(v+1,F(3,2)*v) + self.assertLessEqual(v+1,2**(j+1)) + self.assertLessEqual(F(3,2)*v*d*(j+1),3*d*n) + self.assertLessEqual(F(3*d*n,d),7*n) + + def test_fixed_moments_and_sharp_ratio(self): + for j in range(2,10): + c=mod.spike(j,3);r=c['r'];M=c['count'] + for s in range(1,6): + moment=2**s*c['ordinary']+M**s*c['rare'] + self.assertEqual(moment/r**3,2**s+r**4*M**s) + ratio=mod.spike_ratio(j,3,s) + self.assertEqual(ratio,F(M**s,16)) + self.assertLessEqual(c['v'],F(c['n'],j)) + self.assertGreaterEqual(c['v'],F(c['n'],2*j)) + + def test_four_factor_holder_correlated(self): + probs=[F(1,3)]*3 + densities=[F(1,2),F(1),F(3,2)] + K=[1,3,2];N=[1,2,5];psi=[x+2 for x in N] + self.assertEqual(sum(p*z for p,z in zip(probs,densities)),1) + for a in range(0,4): + for s in range(1,4): + for T in [1,3,4,6,9]: + lhs,rhs=mod.holder_finite(probs,densities,K,psi,a,s,T) + self.assertLessEqual(lhs**4,rhs) + + def test_truncation_keeps_event(self): + probs=[F(1,2),F(1,4),F(1,4)] + K=[2,1,3];N=[0,2,7];psi=[n+2 for n in N];E=[False,True,True] + for T in [1,4,9]: + for s in [1,2,3]: + low,bound=mod.truncation(probs,K,N,psi,E,2,s,T) + self.assertLessEqual(low,bound) + true_low=sum((p*k**2*n**s for p,k,n,z,e in zip(probs,K,N,psi,E) if e and z<=T),F(0)) + self.assertEqual(low,true_low) + + def test_single_full_normalizer(self): + for r in [F(1,2),F(1,8),F(1,32)]: + W=[r*r,3*r*r];probs=[F(1,2),F(1,2)] + Z=sum(p*w for p,w in zip(probs,W)) + densities=mod.normalized_weights(W,Z) + self.assertEqual(densities,[F(1,2),F(3,2)]) + self.assertEqual(sum(p*x for p,x in zip(probs,densities)),1) + + def test_zero_threshold_and_remote_guard(self): + for q in range(1,6): + for r in [F(1,2),F(1,8)]: + Xi=mod.xi([F(0)]*q,r) + self.assertEqual(Xi,r**mod.beta(q)) + self.assertLessEqual(r**(mod.beta(q)+4),r**3*Xi) + self.assertFalse(mod.local_event(0,[F(0)],[F(1,2)])) + self.assertTrue(mod.local_event(1,[F(0)],[F(0)])) + + def test_input_rejection_and_factorial_mass(self): + for call in [lambda:mod.beta(0),lambda:mod.cutoff_constant(1,0), + lambda:mod.spike(1,3),lambda:mod.spike(3,1), + lambda:mod.ledger(3,(F(1),F(1)),1), + lambda:mod.mixed_power((F(1,4),F(1,2))), + lambda:mod.normalized_weights([1],0)]: + with self.assertRaises(ValueError):call() + for n in range(0,12): + for s in range(1,6): + self.assertLessEqual(mod.falling(n,s),n**s) + + +def main(): + parser=argparse.ArgumentParser(description=__doc__) + parser.add_argument('--mutant',choices=['M1','M2','M3','M4','M5']) + args=parser.parse_args() + if mod is not None:mod.MUTANT=args.mutant + result=unittest.TextTestRunner(stream=sys.stderr,verbosity=2).run( + unittest.defaultTestLoader.loadTestsFromTestCase(LogCapTests)) + print(json.dumps({'ok':result.wasSuccessful(),'tests':result.testsRun,'mutant':args.mutant, + 'failures':[str(x) for x,_ in result.failures], + 'errors':[str(x) for x,_ in result.errors], + 'scope':'exact finite controls; not a continuum or kernel proof'},sort_keys=True,separators=(',',':'))) + return 2 if result.errors else (0 if result.wasSuccessful() else 1) +if __name__=='__main__':sys.exit(main())