From d3a8b18d7faad6c14b7e6facae5887b1b08e1bd7 Mon Sep 17 00:00:00 2001 From: prime-agent Date: Mon, 17 Aug 2026 23:49:51 +0200 Subject: [PATCH 1/3] Add exact-mass one-loop proper-time coefficients with preregistered regulator comparison (P230, advances #76) New module scalar_one_loop_mass.py evaluates the tau^-2 (curvature / inverse-Newton-matching) and tau^-3 (vacuum/cosmological) proper-time classes of the accepted Route 1 fluctuation operator with the mass retained exactly, for three preregistered regulators: the accepted sharp proper-time cutoff (exact-mass factor exp(-z) - z*E1(z)), a smooth essential-singularity weight (2*sqrt(z)*K_1 and 2*z*K_2 closed forms), and a power-divergence-subtracted zeta scheme with a declared scale. Target-blind: no cutoff identification, no renormalization-condition choice, no total Newton constant, no comparator. --- .../efforts/route1-exact-mass-determinant.md | 57 +++ .../P230-exact-mass-regulator-rung.md | 41 ++ .../attempts/0001/manifest.yaml | 28 ++ .../proposal.yaml | 75 +++ src/substrate_framework/__init__.py | 24 + .../scalar_one_loop_mass.py | 467 ++++++++++++++++++ tests/test_scalar_one_loop_mass.py | 351 +++++++++++++ 7 files changed, 1043 insertions(+) create mode 100644 memory/vantasner/efforts/route1-exact-mass-determinant.md create mode 100644 memory/vantasner/proposals/P230-exact-mass-regulator-rung.md create mode 100644 proposals/P230-exact-mass-regulator-rung/attempts/0001/manifest.yaml create mode 100644 proposals/P230-exact-mass-regulator-rung/proposal.yaml create mode 100644 src/substrate_framework/scalar_one_loop_mass.py create mode 100644 tests/test_scalar_one_loop_mass.py diff --git a/memory/vantasner/efforts/route1-exact-mass-determinant.md b/memory/vantasner/efforts/route1-exact-mass-determinant.md new file mode 100644 index 00000000..0b1972c7 --- /dev/null +++ b/memory/vantasner/efforts/route1-exact-mass-determinant.md @@ -0,0 +1,57 @@ +--- +description: Deliver the exact-mass one-loop proper-time determinant coefficients with preregistered regulator comparison as the next Route 1 (induced-gravity) rung for issue #76 +author: prime-agent +created: '2026-08-18T00:00:00Z' +updated: '2026-08-18T00:00:00Z' +tags: +- substrate-framework +- effort +- route1-induced-gravity +- issue-76 +category: efforts +confidence: working +status: active +--- + +## Goal and Success Contract +This effort delivers one importable, target-blind reusable unit for the #76 goal: the exact-mass one-loop proper-time coefficients of the accepted Route 1 fluctuation operator, compared across preregistered regulators. It is complete for this rung when a new module under `src/substrate_framework/` returns closed forms for the tau^-2 class (curvature / inverse-Newton-matching integral) and the tau^-3 class (vacuum/cosmological integral) for three declared regulators (sharp proper-time cutoff; smooth essential-singularity proper-time weight; power-divergence-subtracted zeta scheme), each cross-checked against independent numerical quadrature; when the sharp massless limit reproduces the accepted leading coefficient `s = N*(1-6*xi)/(12*pi)` from `scalar_induced_newton` exactly; when the exact-mass sharp factor `exp(-z) - z*E1(z)` named load-bearing by the PR #13 review is exposed as a derived, mutation-sensitive API rather than a footnote; and when the scheme spread among the three regulators is returned as an exact quotable ledger. It does NOT identify a cutoff with a substrate scale, choose a renormalization condition, derive a total Newton constant, produce a sourced nonflat solution, compose worldline probes, or open any empirical comparator; those are later rungs and open campaign frontier for #76. A no-go, residual, or obstruction is attempt evidence, not completion. + +## Accepted Baseline +Work starts from accepted release `v0.160.0`, framework commit `1b00c3a` (branch `research/p230-exact-mass-regulator-rung` off updated `origin/main`, which contains the P227 closure `2072648`). Source audited at this commit: `AGENTS.md`; `.agents/skills/physics-erdos-loop/SKILL.md` and its `references/governance.md` and `references/oracles.md`; `.agents/skills/research-pr-harvest/SKILL.md`; `tools/agent-memory/skills/shared_agent-memory-usage/SKILL.md` (CLI sections); `governance/releases/current.yaml` (207 accepted claims); `governance/claims.yaml` entries `C-GRV-001`, `C-GOR-001/002`, `C-STG-001/002`, `C-WLN-001..003`, `C-LOR-001/002`, `C-GW-001..010`; issue #76 body; issues #9 and #12 including all four comments each; `src/substrate_framework/scalar_induced_newton.py`; `src/substrate_framework/covariant_sine_gordon_action.py`; `src/substrate_framework/einstein_scalar.py` docstring conventions; `src/substrate_framework/governance.py` (proposal schema). Chronology and memory prose are not authority; every reused fact was verified at source. + +## Constraints and Invariants +Conventions are exactly the accepted `scalar_induced_newton` ones: `D_E = -nabla_E^2 + xi R_E + m^2`, boundaryless Gilkey-Seeley-DeWitt weights `a_2 = ((1/6 - xi) R_E - m^2)` under the `(4*pi)^-2` prefactor, one-real-scalar determinant weight `1/2`, and the Euclidean Einstein-Hilbert matching factor `16*pi`. The mass is retained exactly: no expansion of `exp(-tau*m^2)` inside the regulated proper-time integral. Target-blindness is a tested invariant: no observed `G`, `M_Pl`, or benchmark value may appear; the cutoff stays a declared formal scale; the power-subtracted scheme requires an explicit `renormalization_scale` argument (regulator non-defaulting, mirroring the accepted module). No new fitted constant. Permitted imports: `sympy` (including `expint`/`E1` and Bessel `K` closed forms), `scipy` quadrature in tests only, framework `exact_symbolic`, `scalar_induced_newton`, and the declared composition slot `covariant_sine_gordon_action` (`m^2 -> V''(phi_bg)`). Write boundary: `src/substrate_framework/scalar_one_loop_mass.py`, its `__init__` exports, `tests/test_scalar_one_loop_mass.py`, `proposals/P230-exact-mass-regulator-rung/`, and this record. Author-does-not-merge: open a PR naming #76 with `Advances #76`; a distinct reviewer/owner harvests and merges. + +## Decomposition +1. [x] Recall and source verification (authority, #76 gates, #9 no-go, #12 ladder and PR #13/#25 handoffs, accepted rung conventions). +2. [x] Candidate and selection-criteria preregistration in `proposals/P230-exact-mass-regulator-rung/proposal.yaml` (validated WORKFLOW VALID at `1b00c3a`). +3. [x] Coordination comment on #76 (branch, proposal id, claim ids after collision search, slice, write surfaces, comparator-blinding point). +4. [x] Importable implementation of the closed forms for the tau^-2 and tau^-3 classes under all three regulators, with exact symbolic APIs. +5. [x] Verifier and sensitivity audit: quadrature cross-check of every closed form, massless-sharp reduction to the accepted `s*Lambda^2`, small-z asymptotic recovery, mutations (xi sign, prefactor, special-function branch, unknown regulator, non-defaulted scale), and scheme-spread ledger. +6. [x] Framework-fit and downstream replay (`scripts/validate.sh --full`: 2235 passed, ALL REPOSITORY WORKFLOW CHECKS PASS; `git diff --check` clean; GitNexus re-indexed at current commit, impact LOW, detect-changes maps only the new module and `__init__` exports; generated AGENTS.md injection from `gitnexus analyze` reverted per AGENTS_START_HERE) (`scripts/validate.sh` boundary appropriate to the diff; `git diff --check` separately). +7. [ ] Harvest PR advancing #76 (issue-first, non-self-merge); reviewer updates #76 with merged/refactor/history disposition once merged. + +## Candidate Preregistration and Selection Criteria +Selection criteria frozen before any comparison value is computed: (1) convention compatibility with the accepted rung APIs; (2) closed-form exactness in standard special functions with no fitted constants; (3) exact-mass integrity inside the regulated integral; (4) mutation sensitivity; (5) reuse value for the later cutoff-identification and renormalization-condition rungs; (6) regulator explicitness (scheme dependence stays visible). + +- Candidate A (sharp proper-time, exact mass): regulated integral `integral_{1/Lambda^2}^infty tau^-2 exp(-m^2 tau) dtau = Lambda^2*(exp(-z) - z*E1(z))`, `z = m^2/Lambda^2`. Directly discharges the PR #13 load-bearing finite-mass factor. +- Candidate B (smooth essential-singularity weight `exp(-1/(Lambda^2 tau))`, exact mass): `integral_0^infty tau^-2 exp(-m^2 tau - 1/(Lambda^2 tau)) dtau = 2*Lambda^2*sqrt(z)*BesselK_1(2*sqrt(z))`. One convergent integral family for all weights; no hard step. +- Candidate C (power-divergence-subtracted zeta/Mellin finite part with declared scale `mu`): `m^2*(ln(m^2/mu^2) + gamma_E - 1)`. Exhibits the logarithmic-running alternative in which no `Lambda^2` term survives. +All three are retained as parallel schemes in the module (the rung's deliverable is the comparison itself, so the selection is "which schemes to expose", not "which one wins"); empirical comparators may not select among them. + +## Attempts +Attempts are append-only and individually reproducible; each row names the diagnosed mechanism and the next materially different attempt. + +| Attempt | Candidate or repair | Artifact and command | Verdict | Mechanism | Next attempt | +| --- | --- | --- | --- | --- | --- | +| (pending) | | | | | | + +## Validation +Validation covers the actual objective, verifier sensitivity, limits, conventions, and dependency replay, not merely an exit code. Targeted oracle: `PYTHONPATH=src .venv/bin/python -m pytest tests/test_scalar_one_loop_mass.py -q` = 20 passed (5.20 s). Full boundary: `bash scripts/validate.sh --full` = 2235 passed in 309.16 s, `ALL REPOSITORY WORKFLOW CHECKS PASS (full pytest suite)`; `git diff --check` clean in a separate invocation. GitNexus: index refreshed at the working commit; `impact leading_scalar_newton_shift_coefficient` = LOW risk, single new direct caller (`exact_mass_inverse_newton_shift`); `detect-changes` maps only `src/substrate_framework/scalar_one_loop_mass.py` (new) and `__init__.py` `__all__`/imports; zero affected execution flows. The `gitnexus analyze` run auto-appended a tracked-instruction block to `AGENTS.md`; it was reverted per AGENTS_START_HERE section 3 and not committed. + +## Debt Ledger +Every new assumption, import, parameter, residual, broken consumer, or narrative inconsistency is recorded here and discharged; this table must be empty at close. + +| Debt | Introduced by | Why it is real | Discharge artifact | Status | +| --- | --- | --- | --- | --- | +| (none yet) | | | | | diff --git a/memory/vantasner/proposals/P230-exact-mass-regulator-rung.md b/memory/vantasner/proposals/P230-exact-mass-regulator-rung.md new file mode 100644 index 00000000..161fbbe2 --- /dev/null +++ b/memory/vantasner/proposals/P230-exact-mass-regulator-rung.md @@ -0,0 +1,41 @@ +--- +description: P230 exact-mass one-loop proper-time coefficients with preregistered regulator comparison, the next Route 1 rung toward the #76 emergent-gravity goal +author: prime-agent +created: '2026-08-18T00:00:00Z' +updated: '2026-08-18T00:00:00Z' +tags: +- substrate-framework +- campaign-proposal +- route1-induced-gravity +- issue-76 +category: proposals +confidence: exploratory +status: active +--- + +## Question and Positive Deliverable +The campaign asks for the exact closed-form one-loop proper-time coefficients of the accepted Route 1 fluctuation operator `D_E = -nabla_E^2 + xi R_E + m^2` when the mass is retained exactly, compared across preregistered regulators, as the next rung of the #76 parameter-closed emergent-gravity goal. The positive deliverable is an importable target-blind module plus tests; a no-go or obstruction is attempt evidence and does not complete it. + +## Base Release and Provenance +The base is accepted release `v0.160.0` at framework commit `1b00c3a`, branch `research/p230-exact-mass-regulator-rung`. The manifest `proposals/P230-exact-mass-regulator-rung/proposal.yaml` records the source inventory: the two accepted prior-work modules (`scalar_induced_newton.py` from the PR #14 harvest `a562568`; `covariant_sine_gordon_action.py` from the PR #25 harvest `65e4a7c`) and the two already-imported literature convention sources (Vassilevich `hep-th/0306138` eqs (2.2)/(4.27); Visser `gr-qc/0204062` eqs (8)-(21)). + +## Invariants, Conventions, and Allowed Imports +The frozen invariants are the accepted operator and scheme conventions, exact-mass integrity, target-blindness with a declared formal cutoff, no new fitted constants, unchanged accepted claims/releases/docs until independent adjudication, and non-self-merge. Allowed imports are SymPy exact algebra with special-function closed forms, SciPy quadrature in tests only, and the framework modules `scalar_induced_newton`, `covariant_sine_gordon_action` (mass slot `m^2 = V''(phi_bg)`), and `exact_symbolic`. + +## Candidate Preregistration +Three schemes are preregistered in the manifest: (A) sharp proper-time lower cutoff with the exact-mass factor `Lambda^2*(exp(-z) - z*E1(z))`; (B) smooth essential-singularity proper-time weight with `2*Lambda^2*sqrt(z)*BesselK_1(2*sqrt(z))`; (C) power-divergence-subtracted zeta finite part `m^2*(ln(m^2/mu^2) + gamma_E - 1)`. The rung exposes all three rather than selecting one, because its deliverable is the exact scheme comparison that the later renormalization-condition rung must cite. + +## Selection Criteria and Blinding +The frozen structural criteria are convention compatibility, closed-form exactness, exact-mass integrity, mutation sensitivity, reuse value, and regulator explicitness. Empirical gravitational comparators stay blinded for this rung and until a later renormalization-condition rung freezes scheme, scale, and cutoff identification; the accepted coefficient `s = N*(1-6*xi)/(12*pi)` is a framework ledger result, not a comparator. + +## Proposed Claim Delta +Provisional claim identifiers after a repository-wide collision search (zero usages of the `C-IGR` family in governance, campaigns, proposals, memory, src, tests, and docs): `C-IGR-001` for the sharp exact-mass closed forms and their massless/asymptotic reductions; `C-IGR-002` for the smooth-weight closed forms; `C-IGR-003` for the power-subtracted finite-part forms and the exact scheme-spread ledger. Dependencies: the accepted `C-GRV-001` ledger structure. No `supersedes` is used before acceptance. + +## Implementation and Oracle Plan +Implementation lands in `src/substrate_framework/scalar_one_loop_mass.py` with `__init__` exports and `tests/test_scalar_one_loop_mass.py`. Oracles: SymPy closed forms derived (not asserted) from the regulated integrals; SciPy `quad` cross-checks on convergent representations; sharp-massless exact reduction to `leading_scalar_newton_shift_coefficient`; small-`z` series recovery of the accepted leading term; mutations for xi sign, prefactor, special-function branch, unknown regulator, and non-defaulted renormalization scale. Replay: repository validation at the final unchanged boundary and `git diff --check` in a separate invocation. + +## Attempts +Attempts live in `proposals/P230-exact-mass-regulator-rung/attempts/` and are append-only. + +## Continuation +Issue #76 remains the canonical open goal; this rung advances it and proposes no closure. diff --git a/proposals/P230-exact-mass-regulator-rung/attempts/0001/manifest.yaml b/proposals/P230-exact-mass-regulator-rung/attempts/0001/manifest.yaml new file mode 100644 index 00000000..274dc2f4 --- /dev/null +++ b/proposals/P230-exact-mass-regulator-rung/attempts/0001/manifest.yaml @@ -0,0 +1,28 @@ +id: attempt-0001 +campaign: P230 +candidate: A+B+C parallel scheme exposure (preregistered in proposal.yaml) +command: > + PYTHONPATH=src .venv/bin/python -m pytest tests/test_scalar_one_loop_mass.py -q +working_directory: /home/dan/substrate-framework +base_release: v0.160.0 +source_commit: 1b00c3a +elapsed_seconds: 5.20 +exit_code: 0 +verdict: pass +diagnosed_layer: none (first rung attempt succeeded) +notes: > + 20/20 targeted tests. Exact oracles: sharp tail-integral uniqueness + (derivative identity + exponential decay bound with E1 <= exp(-x)/x), + sharp tau^-3 integration-by-parts identity, smooth Bessel family + differential recurrence dJ_p/dz = -J_{p-1} with boundary limits J_2(0+)=1 + and J_3(0+)=1, zeta power-subtraction limits, massless sharp reduction to + the accepted s*Lambda^2, small-z series 1 + z(ln z + gamma - 1), + 40-digit mpmath quadrature corroboration at z in {0.1, 1.0, 2.5}, + mutation sensitivity (prefactor, Ei-vs-E1 branch, Bessel order, xi sign + across 1/6, unknown regulator, defaulted scales, negative mass, + non-integer field count, undecidable xi), and target-blindness scan. + PR #13 bridge: F(1) = 0.1484955068 reproduces the review's named factor. +full_boundary: > + bash scripts/validate.sh --full -> 2235 passed in 309.16s; + ALL REPOSITORY WORKFLOW CHECKS PASS (full pytest suite); + git diff --check clean (separate invocation, rc=0). diff --git a/proposals/P230-exact-mass-regulator-rung/proposal.yaml b/proposals/P230-exact-mass-regulator-rung/proposal.yaml new file mode 100644 index 00000000..ff6cadc3 --- /dev/null +++ b/proposals/P230-exact-mass-regulator-rung/proposal.yaml @@ -0,0 +1,75 @@ +id: P230 +base_release: v0.160.0 +source_baseline: substrate-framework@1b00c3a +question: >- + For the accepted Route-1 induced-gravity chain (one real scalar on a + background metric with Euclidean fluctuation operator + D_E = -nabla_E^2 + xi R_E + m^2, m^2 = V''(phi_bg) from + covariant_sine_gordon_action), what are the exact closed-form one-loop + proper-time coefficients of the induced curvature (inverse-Newton-matching) + term and of the mass-dependent cosmopolitan/vacuum sector when the mass is + retained exactly rather than UV-asymptotically expanded, for preregistered + regulators; and what is the exact scheme spread among those regulators at a + common declared scale? +source_inventory: + - source: accepted module src/substrate_framework/scalar_induced_newton.py (PR #14 harvest a562568) + access: in hand (repository source, audited at 1b00c3a) + extracted: operator convention D_E=-nabla_E^2+xi R_E+m^2; scheme factor 16*pi*(1/2)*(4*pi)^-2=1/(2*pi); leading coefficient s=N*(1-6*xi)/(12*pi); sharp proper-time regulator name; disclaimed finite-mass and logarithmic structure + - source: accepted module src/substrate_framework/covariant_sine_gordon_action.py (PR #25 harvest 65e4a7c) + access: in hand (repository source, audited at 1b00c3a) + extracted: second variation D = -box_g + V''(phi_bg) + xi R with m^2 -> V''(phi_bg); mostly-plus convention; Euclidean-Hessian handoff + - source: Vassilevich arXiv:hep-th/0306138 eqs (2.2) and (4.27) + access: open (already imported by the accepted scalar_induced_newton docstring) + extracted: boundaryless heat-kernel a_2 structure ((1/6-xi)R - m^2 weights) used as accepted convention + - source: Visser arXiv:gr-qc/0204062 eqs (8)-(21) + access: open (already imported by the accepted scalar_induced_newton docstring) + extracted: cutoff-squared, mass-logarithmic, finite, and additive-baseline structure under its conventions +invariants: + - operator and scheme conventions are exactly the accepted scalar_induced_newton ones; the mass is retained exactly (no tau*m^2 expansion inside the proper-time integral) + - 'target-blindness: no observed G, Planck mass, or empirical gravity benchmark enters; the cutoff remains a declared formal scale and is not identified with any substrate length in this rung' + - no new fitted constant; every closed form is derived and cross-checked against independent quadrature + - accepted claims, releases, generated docs, and immutable campaigns remain unchanged until independent claim adjudication + - author does not merge; a distinct reviewer or the owner performs any merge +allowed_imports: + - SymPy exact algebra including expint/E1 and Bessel K closed forms + - SciPy quadrature (scipy.integrate.quad) and scipy.special cross-checks in tests only + - substrate_framework.scalar_induced_newton (SHARP_PROPER_TIME_REGULATOR, scalar_heat_kernel_a2, leading_scalar_newton_shift_coefficient constants and APIs) + - substrate_framework.covariant_sine_gordon_action (fluctuation-operator mass slot m^2 = V''(phi_bg)) as the declared upstream composition + - substrate_framework.exact_symbolic input contracts +candidates: + - id: A + description: >- + Sharp proper-time lower cutoff tau_0 = Lambda^-2 with exact mass; closed + form Lambda^2*(exp(-z) - z*E1(z)), z = m^2/Lambda^2. This is the exact + finite-mass version of the accepted leading cutoff-squared term and + quantifies the PR #13 review's load-bearing factor. + - id: B + description: >- + Smooth essential-singularity proper-time weight exp(-1/(Lambda^2*tau)) + with exact mass; closed form 2*Lambda^2*sqrt(z)*BesselK_1(2*sqrt(z)). + Cures the small-tau power divergence without a hard step, so all three + heat-kernel weights share one convergent integral family. + - id: C + description: >- + Power-divergence-subtracted (zeta/Mellin finite-part) scheme with a + declared renormalization scale mu: closed form + m^2*(ln(m^2/mu^2) + gamma_E - 1) for the tau^-2 class. Exhibits the + logarithmic-running alternative in which no Lambda^2 term survives. +selection_criteria: + - convention compatibility with accepted scalar_induced_newton APIs and the covariant_sine_gordon_action mass slot + - exactness as closed forms in standard special functions with no fitted constants + - 'exact-mass integrity: no UV-asymptotic truncation inside the regulated integral' + - 'mutation sensitivity: wrong xi sign, wrong prefactor, wrong special-function branch, and unknown regulator must each be detectable' + - reuse value as importable primitives feeding the later cutoff-identification and renormalization-condition rungs + - 'regulator explicitness: scheme dependence stays visible and quotable rather than hidden' +claims_proposed: + - C-IGR-001 + - C-IGR-002 + - C-IGR-003 +comparators_blinded_until: >- + Empirical gravitational comparators (observed G, M_Pl, weak-field or + radiative benchmarks) stay blinded for this rung and remain blinded until a + later renormalization-condition rung freezes scheme, scale, and cutoff + identification; the accepted conditional coefficient s=N*(1-6*xi)/(12*pi) + is a framework ledger result, not an empirical comparator. +status: active diff --git a/src/substrate_framework/__init__.py b/src/substrate_framework/__init__.py index 12815fdd..1de36d5e 100644 --- a/src/substrate_framework/__init__.py +++ b/src/substrate_framework/__init__.py @@ -749,6 +749,19 @@ leading_scalar_newton_shift_coefficient, scalar_heat_kernel_a2, ) +from .scalar_one_loop_mass import ( + KNOWN_ONE_LOOP_REGULATORS, + SMOOTH_PROPER_TIME_REGULATOR, + ZETA_POWER_SUBTRACTED_REGULATOR, + curvature_proper_time_integral, + exact_mass_inverse_newton_shift, + exact_mass_vacuum_density_shift, + regulator_scheme_ledger, + vacuum_proper_time_integral, + ExactMassNewtonShift, + ExactMassVacuumShift, + RegulatorSchemeLedger, +) from .covariant_sine_gordon_action import ( CovariantSineGordonAction, CovariantSineGordonFluctuation, @@ -2176,6 +2189,17 @@ "metric_ricci_scalar", "metric_ricci_tensor", "worldline_reparametrization_residual", + "KNOWN_ONE_LOOP_REGULATORS", + "SMOOTH_PROPER_TIME_REGULATOR", + "ZETA_POWER_SUBTRACTED_REGULATOR", + "curvature_proper_time_integral", + "exact_mass_inverse_newton_shift", + "exact_mass_vacuum_density_shift", + "regulator_scheme_ledger", + "vacuum_proper_time_integral", + "ExactMassNewtonShift", + "ExactMassVacuumShift", + "RegulatorSchemeLedger", ] __version__ = "0.0.0" diff --git a/src/substrate_framework/scalar_one_loop_mass.py b/src/substrate_framework/scalar_one_loop_mass.py new file mode 100644 index 00000000..d06703e4 --- /dev/null +++ b/src/substrate_framework/scalar_one_loop_mass.py @@ -0,0 +1,467 @@ +"""Exact-mass one-loop proper-time coefficients for preregistered regulators. + +This is the Route 1 (induced / Sakharov gravity) rung that follows +``covariant_sine_gordon_action``. The landed action rung hands the +fluctuation operator + + D_E = -nabla_E**2 + xi*R_E + m**2, m**2 = V''(phi_bg), + +to the determinant. This module evaluates the two leading proper-time +integral classes of ``Gamma_E = (1/2)*ln(det(D_E))`` with the mass retained +exactly --- no expansion of ``exp(-tau*m**2)`` inside the regulated integral +--- for three preregistered regulators: + +``SHARP_PROPER_TIME_REGULATOR`` (reused from ``scalar_induced_newton``) + A sharp lower proper-time cutoff ``tau_0 = Lambda**-2``. Writing + ``z = m**2/Lambda**2``, the curvature class integral is + + I_2 = integral_{tau_0}^{infty} tau**-2 * exp(-m**2*tau) dtau + = Lambda**2 * (exp(-z) - z*E1(z)), + + with ``E1 = expint(1, .)``. The factor ``exp(-z) - z*E1(z)`` is the + load-bearing finite-mass correction named by the PR #13 review + (approximately 0.1485 at z = 1): a leading UV-asymptotic ``Lambda**2`` + term alone does not establish the finite-cutoff result. + +``SMOOTH_PROPER_TIME_REGULATOR`` + A smooth essential-singularity proper-time weight ``exp(-1/(Lambda**2 + * tau))``. All power-divergent classes become convergent single + integrals; the closed forms are modified Bessel functions: + + I_2 = 2*Lambda**2*sqrt(z)*BesselK_1(2*sqrt(z)), + I_3 = 2*Lambda**4*z*BesselK_2(2*sqrt(z)). + +``ZETA_POWER_SUBTRACTED_REGULATOR`` + The Mellin finite-part scheme in which the power divergences are + subtracted; it requires a declared renormalization scale ``mu`` (the + cutoff argument is rejected) and yields the pure logarithmic running + + I_2 = m**2*(ln(m**2/mu**2) + EulerGamma - 1), + I_3 = -(m**4/2)*(ln(m**2/mu**2) + EulerGamma - 3/2). + +Composition with the accepted scheme factor (one real scalar, determinant +weight 1/2, heat-kernel prefactor ``(4*pi)**-2``, Einstein-Hilbert matching +factor ``16*pi``) gives the exact-mass induced inverse-Newton shift + + Delta(1/G) = N * coefficient_per_field(xi) * I_2(regulator), + +where ``coefficient_per_field`` is taken from the accepted +``scalar_induced_newton.leading_scalar_newton_shift_coefficient`` API, so +the massless sharp limit reproduces the accepted +``s*Lambda**2 = N*(1-6*xi)*Lambda**2/(12*pi)`` exactly. The vacuum sector +of the same expansion is + + Delta(rho_Gamma) = -(N/2)*(4*pi)**-2 * (I_3 + m**2*I_2) + +per scheme, from the heat-kernel weights ``1`` (tau**-3 class) and +``-m**2`` (tau**-2 class) of the accepted ``scalar_heat_kernel_a2``. + +Declared derivation oracles (all exact, SymPy): + +* sharp ``I_2``: ``d/dtau_0 I_2(tau_0) = -tau_0**-2*exp(-m**2*tau_0)`` plus + the tail decay, so the closed form is the tail integral by uniqueness; +* sharp ``I_3``: the integration-by-parts identity + ``I_3 = exp(-z)*Lambda**4/2 - (m**2/2)*I_2``; +* smooth closed forms: the exact differential recurrence + ``d/dz J_p = -J_{p-1}`` of the integrals + ``J_p(z) = integral_0^{infty} t**-p exp(-z*t - 1/t) dt`` together with the + boundary limits ``J_2(0+) = 1`` and ``J_3(0+) = 1`` (verified against + SymPy Bessel derivatives), plus independent high-precision quadrature; +* zeta finite parts: the cutoff-subtraction limits + ``lim_{tau_0 -> 0} [I(tau_0) - power terms - log terms]`` evaluated + symbolically. + +This module does NOT identify the cutoff with any substrate scale, choose a +renormalization condition among the three schemes, derive a total Newton +constant (the accepted C-GRV-001 additive baseline remains independent), +evaluate the tau**-1 class (curvature-squared and m**2*R structures), or +confront any empirical comparator. Those are later rungs of issue #76. +Scheme differences are the deliverable: at z = 1 the smooth regulator +induces about 1.88 times the sharp curvature coefficient, and the +power-subtracted scheme changes both the parametric structure and the sign +at small log; any later usable-normalization claim must cite this spread. +""" + +from __future__ import annotations + +from dataclasses import dataclass +from typing import Any + +import sympy as sp + +from .exact_symbolic import exact_real as _exact_real +from .exact_symbolic import positive_exact as _positive_exact +from .scalar_induced_newton import SHARP_PROPER_TIME_REGULATOR +from .scalar_induced_newton import leading_scalar_newton_shift_coefficient + +SMOOTH_PROPER_TIME_REGULATOR = "proper_time_smooth_essential" +ZETA_POWER_SUBTRACTED_REGULATOR = "zeta_power_subtracted" + +KNOWN_ONE_LOOP_REGULATORS = ( + SHARP_PROPER_TIME_REGULATOR, + SMOOTH_PROPER_TIME_REGULATOR, + ZETA_POWER_SUBTRACTED_REGULATOR, +) + +_FOUR_DIMENSIONAL_HEAT_KERNEL_PREFACTOR = (4 * sp.pi) ** -2 + + +def _nonnegative_exact(value: Any, name: str) -> sp.Expr: + expression = _exact_real(value, name) + if expression.is_nonnegative is not True: + raise ValueError(f"{name} must be provably nonnegative") + return expression + + +def _positive_integer(value: Any, name: str) -> sp.Expr: + expression = _positive_exact(value, name) + if expression.is_integer is not True: + raise ValueError(f"{name} must be a positive integer field count") + return expression + + +def _resolve_regulator( + regulator: Any, + cutoff: Any, + renormalization_scale: Any, +) -> tuple[sp.Expr | None, sp.Expr | None]: + """Validate the scheme contract and return (cutoff, scale) exact values.""" + + if regulator not in KNOWN_ONE_LOOP_REGULATORS: + raise ValueError( + f"unknown regulator {regulator!r}; pass one of " + f"{KNOWN_ONE_LOOP_REGULATORS}" + ) + if regulator == ZETA_POWER_SUBTRACTED_REGULATOR: + if cutoff is not None: + raise ValueError( + "the power-subtracted scheme has no cutoff; pass " + "renormalization_scale only" + ) + if renormalization_scale is None: + raise ValueError( + "the power-subtracted scheme requires an explicit " + "renormalization_scale; it must not default" + ) + return None, _positive_exact(renormalization_scale, "renormalization_scale") + if renormalization_scale is not None: + raise ValueError( + "renormalization_scale belongs to the power-subtracted scheme " + "only; a cutoff scheme must not declare one" + ) + if cutoff is None: + raise ValueError("this regulator requires an explicit positive cutoff") + return _positive_exact(cutoff, "cutoff"), None + + +def _sharp_curvature_integral(cutoff: sp.Expr, mass_squared: sp.Expr) -> sp.Expr: + if mass_squared.is_zero is True: + # Massless limit: the tail integral of tau^-2 is exactly Lambda^2. + return cutoff**2 + z = mass_squared / cutoff**2 + return sp.simplify(cutoff**2 * (sp.exp(-z) - z * sp.expint(1, z))) + + +def _smooth_curvature_integral(cutoff: sp.Expr, mass_squared: sp.Expr) -> sp.Expr: + if mass_squared.is_zero is True: + # Massless limit: 2*sqrt(z)*K_1(2*sqrt(z)) -> 1 as z -> 0+. + return cutoff**2 + z = mass_squared / cutoff**2 + return sp.simplify( + 2 * cutoff**2 * sp.sqrt(z) * sp.besselk(1, 2 * sp.sqrt(z)) + ) + + +def _zeta_curvature_integral( + renormalization_scale: sp.Expr, mass_squared: sp.Expr +) -> sp.Expr: + if mass_squared.is_zero is True: + # Power divergences subtracted: no induced curvature term at m = 0. + return sp.Integer(0) + return sp.simplify( + mass_squared + * (sp.log(mass_squared / renormalization_scale**2) + sp.EulerGamma - 1) + ) + + +def _sharp_vacuum_integral(cutoff: sp.Expr, mass_squared: sp.Expr) -> sp.Expr: + if mass_squared.is_zero is True: + # Massless limit: the tail integral of tau^-3 is Lambda^4/2. + return cutoff**4 / 2 + z = mass_squared / cutoff**2 + return sp.simplify( + sp.exp(-z) * cutoff**4 / 2 + - (mass_squared / 2) * _sharp_curvature_integral(cutoff, mass_squared) + ) + + +def _smooth_vacuum_integral(cutoff: sp.Expr, mass_squared: sp.Expr) -> sp.Expr: + if mass_squared.is_zero is True: + # Massless limit: integral_0^infty t^-3 exp(-1/t) dt = 1, so Lambda^4. + return cutoff**4 + z = mass_squared / cutoff**2 + return sp.simplify(2 * cutoff**4 * z * sp.besselk(2, 2 * sp.sqrt(z))) + + +def _zeta_vacuum_integral( + renormalization_scale: sp.Expr, mass_squared: sp.Expr +) -> sp.Expr: + if mass_squared.is_zero is True: + return sp.Integer(0) + return sp.simplify( + -(mass_squared**2 / 2) + * ( + sp.log(mass_squared / renormalization_scale**2) + + sp.EulerGamma + - sp.Rational(3, 2) + ) + ) + + +def curvature_proper_time_integral( + regulator: Any, + *, + cutoff: Any = None, + mass_squared: Any = 0, + renormalization_scale: Any = None, +) -> sp.Expr: + """Return the exact tau**-2-class proper-time integral for one scheme. + + This is the integral that multiplies the accepted heat-kernel weights + ``((1/6 - xi)*R_E - m**2)`` in ``Gamma_E``; with the accepted scheme + factor it also multiplies the induced inverse-Newton shift. + """ + + resolved_cutoff, scale = _resolve_regulator(regulator, cutoff, renormalization_scale) + mass = _nonnegative_exact(mass_squared, "mass_squared") + if regulator == SHARP_PROPER_TIME_REGULATOR: + return _sharp_curvature_integral(resolved_cutoff, mass) + if regulator == SMOOTH_PROPER_TIME_REGULATOR: + return _smooth_curvature_integral(resolved_cutoff, mass) + return _zeta_curvature_integral(scale, mass) + + +def vacuum_proper_time_integral( + regulator: Any, + *, + cutoff: Any = None, + mass_squared: Any = 0, + renormalization_scale: Any = None, +) -> sp.Expr: + """Return the exact tau**-3-class proper-time integral for one scheme. + + This is the integral that multiplies the heat-kernel weight ``1`` (the + cosmological/vacuum sector of the one-loop action). + """ + + resolved_cutoff, scale = _resolve_regulator(regulator, cutoff, renormalization_scale) + mass = _nonnegative_exact(mass_squared, "mass_squared") + if regulator == SHARP_PROPER_TIME_REGULATOR: + return _sharp_vacuum_integral(resolved_cutoff, mass) + if regulator == SMOOTH_PROPER_TIME_REGULATOR: + return _smooth_vacuum_integral(resolved_cutoff, mass) + return _zeta_vacuum_integral(scale, mass) + + +@dataclass(frozen=True) +class ExactMassNewtonShift: + """Exact-mass induced inverse-Newton shift data for one scheme.""" + + regulator: str + field_count: sp.Expr + non_minimal_coupling: sp.Expr + mass_squared: sp.Expr + cutoff: sp.Expr | None + renormalization_scale: sp.Expr | None + proper_time_value: sp.Expr + coefficient_per_field: sp.Expr + value: sp.Expr + massless_leading_value: sp.Expr + finite_mass_factor: sp.Expr | None + sign: int + + +def exact_mass_inverse_newton_shift( + field_count: Any, + non_minimal_coupling: Any, + *, + regulator: Any, + cutoff: Any = None, + mass_squared: Any = 0, + renormalization_scale: Any = None, +) -> ExactMassNewtonShift: + """Return ``Delta(1/G) = N * coefficient_per_field * I_2`` exactly. + + ``coefficient_per_field`` is the accepted per-field scheme factor + ``scheme_factor*(1/6 - xi)`` taken from + ``scalar_induced_newton.leading_scalar_newton_shift_coefficient`` (with + its massless sharp regulator tag used only to read that factor, which is + regulator-independent). The massless sharp limit reproduces the accepted + ``N*(1-6*xi)*Lambda**2/(12*pi)`` exactly. + """ + + resolved_cutoff, scale = _resolve_regulator(regulator, cutoff, renormalization_scale) + mass = _nonnegative_exact(mass_squared, "mass_squared") + count = _positive_integer(field_count, "field_count") + xi = _exact_real(non_minimal_coupling, "non_minimal_coupling") + + accepted = leading_scalar_newton_shift_coefficient( + 1, xi, regulator=SHARP_PROPER_TIME_REGULATOR + ) + coefficient_per_field = accepted.coefficient_per_field + + if regulator == SHARP_PROPER_TIME_REGULATOR: + proper_time_value = _sharp_curvature_integral(resolved_cutoff, mass) + massless_leading_value = sp.simplify( + count * coefficient_per_field * resolved_cutoff**2 + ) + finite_mass_factor = sp.simplify(proper_time_value / resolved_cutoff**2) + elif regulator == SMOOTH_PROPER_TIME_REGULATOR: + proper_time_value = _smooth_curvature_integral(resolved_cutoff, mass) + massless_leading_value = sp.simplify( + count * coefficient_per_field * resolved_cutoff**2 + ) + finite_mass_factor = sp.simplify(proper_time_value / resolved_cutoff**2) + else: + proper_time_value = _zeta_curvature_integral(scale, mass) + massless_leading_value = sp.Integer(0) + finite_mass_factor = None + + value = sp.simplify(count * coefficient_per_field * proper_time_value) + curvature_weight = sp.simplify(sp.Rational(1, 6) - xi) + if curvature_weight.is_positive is True: + sign = 1 + elif curvature_weight.is_zero is True: + sign = 0 + elif curvature_weight.is_negative is True: + sign = -1 + else: + raise ValueError( + "non_minimal_coupling must have a decidable relation to the " + "four-dimensional conformal value 1/6" + ) + + return ExactMassNewtonShift( + regulator=regulator, + field_count=count, + non_minimal_coupling=xi, + mass_squared=mass, + cutoff=resolved_cutoff, + renormalization_scale=scale, + proper_time_value=proper_time_value, + coefficient_per_field=coefficient_per_field, + value=value, + massless_leading_value=massless_leading_value, + finite_mass_factor=finite_mass_factor, + sign=sign, + ) + + +@dataclass(frozen=True) +class ExactMassVacuumShift: + """Exact-mass one-loop vacuum-sector data for one scheme.""" + + regulator: str + field_count: sp.Expr + mass_squared: sp.Expr + cutoff: sp.Expr | None + renormalization_scale: sp.Expr | None + tau_minus_two_value: sp.Expr + tau_minus_three_value: sp.Expr + value: sp.Expr + + +def exact_mass_vacuum_density_shift( + field_count: Any, + *, + regulator: Any, + cutoff: Any = None, + mass_squared: Any = 0, + renormalization_scale: Any = None, +) -> ExactMassVacuumShift: + """Return ``Delta(rho) = -(N/2)*(4*pi)**-2*(I_3 + m**2*I_2)`` exactly. + + This is the vacuum (cosmological-sector) coefficient of the one-loop + action density under the accepted heat-kernel weights ``1`` and + ``-m**2``; it must be exhibited rather than omitted whenever the + curvature-sector shift is quoted. + """ + + resolved_cutoff, scale = _resolve_regulator(regulator, cutoff, renormalization_scale) + mass = _nonnegative_exact(mass_squared, "mass_squared") + count = _positive_integer(field_count, "field_count") + + tau_minus_two = curvature_proper_time_integral( + regulator, + cutoff=resolved_cutoff, + mass_squared=mass, + renormalization_scale=scale, + ) + tau_minus_three = vacuum_proper_time_integral( + regulator, + cutoff=resolved_cutoff, + mass_squared=mass, + renormalization_scale=scale, + ) + value = sp.simplify( + -count + * sp.Rational(1, 2) + * _FOUR_DIMENSIONAL_HEAT_KERNEL_PREFACTOR + * (tau_minus_three + mass * tau_minus_two) + ) + return ExactMassVacuumShift( + regulator=regulator, + field_count=count, + mass_squared=mass, + cutoff=resolved_cutoff, + renormalization_scale=scale, + tau_minus_two_value=tau_minus_two, + tau_minus_three_value=tau_minus_three, + value=value, + ) + + +@dataclass(frozen=True) +class RegulatorSchemeLedger: + """Exact scheme spread of the curvature-class integral at common scales.""" + + cutoff: sp.Expr + mass_squared: sp.Expr + renormalization_scale: sp.Expr + sharp_value: sp.Expr + smooth_value: sp.Expr + zeta_value: sp.Expr + sharp_over_smooth: sp.Expr + sharp_minus_zeta: sp.Expr + + +def regulator_scheme_ledger( + cutoff: Any, + mass_squared: Any, + renormalization_scale: Any, +) -> RegulatorSchemeLedger: + """Return the three curvature-class values and their exact contrasts. + + The sharp and smooth schemes are evaluated at the declared cutoff; the + power-subtracted scheme at the declared renormalization scale. The + contrasts are exact expressions, not numeric fits, so a later + renormalization-condition rung can cite them as reviewable provenance. + """ + + resolved_cutoff = _positive_exact(cutoff, "cutoff") + mass = _nonnegative_exact(mass_squared, "mass_squared") + scale = _positive_exact(renormalization_scale, "renormalization_scale") + + sharp_value = _sharp_curvature_integral(resolved_cutoff, mass) + smooth_value = _smooth_curvature_integral(resolved_cutoff, mass) + zeta_value = _zeta_curvature_integral(scale, mass) + return RegulatorSchemeLedger( + cutoff=resolved_cutoff, + mass_squared=mass, + renormalization_scale=scale, + sharp_value=sharp_value, + smooth_value=smooth_value, + zeta_value=zeta_value, + sharp_over_smooth=sp.simplify(sharp_value / smooth_value), + sharp_minus_zeta=sp.simplify(sharp_value - zeta_value), + ) diff --git a/tests/test_scalar_one_loop_mass.py b/tests/test_scalar_one_loop_mass.py new file mode 100644 index 00000000..35f127ad --- /dev/null +++ b/tests/test_scalar_one_loop_mass.py @@ -0,0 +1,351 @@ +"""Exact-mass one-loop proper-time coefficient tests (P230, advances #76). + +Oracles, per ``.agents/skills/physics-erdos-loop/references/oracles.md``: + +* exact identities are verified symbolically (derivative/tail uniqueness for + the sharp cutoff scheme, the integration-by-parts identity for its vacuum + class, the differential recurrence plus boundary limits for the smooth + Bessel family, and cutoff-subtraction limits for the power-subtracted + scheme); +* the special-function closed forms are independently corroborated by + high-precision mpmath quadrature; +* load-bearing mutations (wrong prefactor, wrong Bessel order, wrong + exponential-integral branch, wrong xi sign, unknown regulator, defaulted + scales) must each break a relevant check. +""" + +import mpmath as mp +import pytest +import sympy as sp + +import substrate_framework as framework +from substrate_framework.scalar_induced_newton import ( + SHARP_PROPER_TIME_REGULATOR, + leading_scalar_newton_shift_coefficient, +) +from substrate_framework.scalar_one_loop_mass import ( + KNOWN_ONE_LOOP_REGULATORS, + SMOOTH_PROPER_TIME_REGULATOR, + ZETA_POWER_SUBTRACTED_REGULATOR, + curvature_proper_time_integral, + exact_mass_inverse_newton_shift, + exact_mass_vacuum_density_shift, + regulator_scheme_ledger, + vacuum_proper_time_integral, +) + +Lam, mu, m2 = sp.symbols("Lambda mu m2", positive=True) +tau0, t = sp.symbols("tau0 t", positive=True) +z = sp.symbols("z", positive=True) + + +def test_one_loop_mass_api_is_exported_from_package() -> None: + assert framework.SMOOTH_PROPER_TIME_REGULATOR == SMOOTH_PROPER_TIME_REGULATOR + assert framework.ZETA_POWER_SUBTRACTED_REGULATOR == ZETA_POWER_SUBTRACTED_REGULATOR + assert framework.curvature_proper_time_integral is curvature_proper_time_integral + assert framework.vacuum_proper_time_integral is vacuum_proper_time_integral + assert framework.exact_mass_inverse_newton_shift is exact_mass_inverse_newton_shift + assert framework.exact_mass_vacuum_density_shift is exact_mass_vacuum_density_shift + assert framework.regulator_scheme_ledger is regulator_scheme_ledger + + +def test_sharp_curvature_closed_form_is_the_tail_integral_exactly() -> None: + # I(tau0) = Lam^2*(exp(-z)-z*E1(z)) with z = m2*tau0, Lam^2 = 1/tau0. + closed = (sp.exp(-m2 * tau0) - m2 * tau0 * sp.expint(1, m2 * tau0)) / tau0 + derivative_residual = sp.simplify( + sp.diff(closed, tau0) + tau0 ** -2 * sp.exp(-m2 * tau0) + ) + assert derivative_residual == 0 + # Tail decay pins the integration constant. E1(x) is by definition the + # tail integral integral_x^infty exp(-u)/u du; for u >= x > 0 the + # integrand is bounded by exp(-u)/x, whose tail integral sympy evaluates + # exactly, so 0 <= E1(x) <= exp(-x)/x -> 0. The explicit exponential + # piece vanishes directly. + assert sp.limit(sp.exp(-m2 * tau0) / tau0, tau0, sp.oo) == 0 + x, u = sp.symbols("x u", positive=True) + assert sp.integrate(sp.exp(-u) / x, (u, x, sp.oo)) == sp.exp(-x) / x + mp.mp.dps = 30 + for xf in (mp.mpf(30), mp.mpf(40)): + assert mp.e1(xf) < mp.e ** (-xf) / xf + assert mp.e1(xf) * xf * mp.e ** xf < 1 + # The module's expression is this closed form. + value = curvature_proper_time_integral( + SHARP_PROPER_TIME_REGULATOR, cutoff=Lam, mass_squared=m2 + ) + assert sp.simplify(value - Lam**2 * (sp.exp(-m2 / Lam**2) - (m2 / Lam**2) * sp.expint(1, m2 / Lam**2))) == 0 + + +def test_sharp_vacuum_closed_form_satisfies_the_by_parts_identity() -> None: + sharp2 = curvature_proper_time_integral( + SHARP_PROPER_TIME_REGULATOR, cutoff=Lam, mass_squared=m2 + ) + sharp3 = vacuum_proper_time_integral( + SHARP_PROPER_TIME_REGULATOR, cutoff=Lam, mass_squared=m2 + ) + expected = sp.exp(-m2 / Lam**2) * Lam**4 / 2 - (m2 / 2) * sharp2 + assert sp.simplify(sharp3 - expected) == 0 + # Independent derivation by parts from the tail-integral form. + by_parts = sp.integrate(sp.exp(-m2 * t) / t**3, (t, tau0, sp.oo)) + target = (sp.exp(-m2 * tau0) / (2 * tau0**2)) - (m2 / 2) * ( + (sp.exp(-m2 * tau0) - m2 * tau0 * sp.expint(1, m2 * tau0)) / tau0 + ) + # sympy may leave Ei-branch structure; compare via the derivative oracle. + residual = sp.diff(by_parts - target, tau0).replace( + sp.exp_polar, lambda arg: sp.exp(arg) + ) + assert sp.simplify(residual) == 0 + + +def test_smooth_closed_forms_satisfy_the_differential_recurrence() -> None: + # J_p(z) = integral_0^infty t^-p exp(-z t - 1/t) dt obeys dJ_p/dz = -J_{p-1}. + J1 = 2 * sp.besselk(0, 2 * sp.sqrt(z)) + J2 = 2 * sp.sqrt(z) * sp.besselk(1, 2 * sp.sqrt(z)) + J3 = 2 * z * sp.besselk(2, 2 * sp.sqrt(z)) + J0 = 2 * z ** sp.Rational(-1, 2) * sp.besselk(1, 2 * sp.sqrt(z)) + assert sp.simplify(sp.diff(J2, z) + J1) == 0 + assert sp.simplify(sp.diff(J3, z) + J2) == 0 + assert sp.simplify(sp.diff(J1, z) + J0) == 0 + # Boundary values pin the solutions of the recurrence. + assert sp.limit(J2, z, 0, "+") == 1 + assert sp.limit(J3, z, 0, "+") == 1 + # The module returns these forms at z = m2/Lam^2. + value2 = curvature_proper_time_integral( + SMOOTH_PROPER_TIME_REGULATOR, cutoff=Lam, mass_squared=m2 + ) + value3 = vacuum_proper_time_integral( + SMOOTH_PROPER_TIME_REGULATOR, cutoff=Lam, mass_squared=m2 + ) + assert sp.simplify(value2 - Lam**2 * J2.subs(z, m2 / Lam**2)) == 0 + assert sp.simplify(value3 - Lam**4 * J3.subs(z, m2 / Lam**2)) == 0 + + +@pytest.mark.parametrize("zf_str", ["0.1", "1.0", "2.5"]) +def test_smooth_closed_forms_match_high_precision_quadrature(zf_str) -> None: + mp.mp.dps = 40 + zf = mp.mpf(zf_str) + num2 = mp.quad(lambda tt: mp.e ** (-zf * tt - 1 / tt) / tt**2, [0, 1, mp.inf]) + closed2 = 2 * mp.sqrt(zf) * mp.besselk(1, 2 * mp.sqrt(zf)) + assert abs(num2 - closed2) < mp.mpf("1e-30") * abs(closed2) + num3 = mp.quad(lambda tt: mp.e ** (-zf * tt - 1 / tt) / tt**3, [0, 1, mp.inf]) + closed3 = 2 * zf * mp.besselk(2, 2 * mp.sqrt(zf)) + assert abs(num3 - closed3) < mp.mpf("1e-30") * abs(closed3) + + +@pytest.mark.parametrize("zf_str", ["0.1", "1.0", "2.5"]) +def test_sharp_closed_form_matches_quadrature(zf_str) -> None: + mp.mp.dps = 40 + zf = mp.mpf(zf_str) + num = mp.quad(lambda tt: mp.e ** (-zf * tt) / tt**2, [1.0, mp.inf]) + closed = mp.e ** (-zf) - zf * mp.e1(zf) + assert abs(num - closed) < mp.mpf("1e-30") * abs(closed) + + +def test_zeta_closed_forms_are_the_power_subtraction_limits() -> None: + sharp2 = (sp.exp(-m2 * tau0) - m2 * tau0 * sp.expint(1, m2 * tau0)) / tau0 + lim2 = sp.limit(sharp2 - 1 / tau0 - m2 * sp.log(tau0), tau0, 0, "+") + zeta2 = curvature_proper_time_integral( + ZETA_POWER_SUBTRACTED_REGULATOR, mass_squared=m2, renormalization_scale=mu + ) + assert sp.simplify(lim2 - m2 * (sp.log(m2) + sp.EulerGamma - 1)) == 0 + assert sp.simplify(zeta2 - m2 * (sp.log(m2 / mu**2) + sp.EulerGamma - 1)) == 0 + + sharp3 = sp.exp(-m2 * tau0) / (2 * tau0**2) - (m2 / 2) * sharp2 + lim3 = sp.limit( + sharp3 - 1 / (2 * tau0**2) + m2 / tau0 + (m2**2 / 2) * sp.log(tau0), + tau0, + 0, + "+", + ) + zeta3 = vacuum_proper_time_integral( + ZETA_POWER_SUBTRACTED_REGULATOR, mass_squared=m2, renormalization_scale=mu + ) + expected3 = -(m2**2 / 2) * (sp.log(m2) + sp.EulerGamma - sp.Rational(3, 2)) + assert sp.simplify(lim3 - expected3) == 0 + assert sp.simplify(zeta3 + (m2**2 / 2) * (sp.log(m2 / mu**2) + sp.EulerGamma - sp.Rational(3, 2))) == 0 + + +def test_massless_sharp_limit_reproduces_the_accepted_leading_shift() -> None: + N, xi = sp.Integer(3), sp.Rational(1, 12) + shift = exact_mass_inverse_newton_shift( + N, + xi, + regulator=SHARP_PROPER_TIME_REGULATOR, + cutoff=Lam, + mass_squared=0, + ) + accepted = leading_scalar_newton_shift_coefficient( + N, xi, regulator=SHARP_PROPER_TIME_REGULATOR + ) + assert sp.simplify(shift.value - accepted.coefficient * Lam**2) == 0 + assert sp.simplify(shift.finite_mass_factor - 1) == 0 + + smooth = exact_mass_inverse_newton_shift( + N, + xi, + regulator=SMOOTH_PROPER_TIME_REGULATOR, + cutoff=Lam, + mass_squared=0, + ) + # The smooth weight also integrates to exactly Lambda^2 when massless. + assert sp.simplify(smooth.value - accepted.coefficient * Lam**2) == 0 + + zeta = exact_mass_inverse_newton_shift( + N, + xi, + regulator=ZETA_POWER_SUBTRACTED_REGULATOR, + mass_squared=0, + renormalization_scale=mu, + ) + # Power divergences subtracted: no induced shift survives at m = 0. + assert sp.simplify(zeta.value) == 0 + + +def test_small_z_series_recovers_the_accepted_logarithmic_structure() -> None: + F = sp.exp(-z) - z * sp.expint(1, z) + series = sp.series(F, z, 0, 2).removeO() + assert sp.simplify(series - (1 + z * (sp.log(z) + sp.EulerGamma - 1))) == 0 + + +def test_scheme_ledger_reports_exact_contrasts() -> None: + ledger = regulator_scheme_ledger(Lam, m2, mu) + assert sp.simplify( + ledger.sharp_over_smooth + - ( + (sp.exp(-m2 / Lam**2) - (m2 / Lam**2) * sp.expint(1, m2 / Lam**2)) + / (2 * sp.sqrt(m2 / Lam**2) * sp.besselk(1, 2 * sp.sqrt(m2 / Lam**2))) + ) + ) == 0 + # At z = 1 the smooth scheme induces about 1.88 times the sharp value. + one = regulator_scheme_ledger(1, 1, 1) + ratio = float(sp.N(one.sharp_over_smooth, 12)) + assert abs(ratio - 0.5308496410) < 1e-8 + # The PR #13 review's load-bearing factor is reproduced at z = 1. + factor = sp.N( + sp.exp(-1) - sp.expint(1, 1), + 10, + ) + assert abs(factor - sp.Float("0.1484955068", 10)) < sp.Float("1e-9") + + +def test_exact_mass_shift_composes_the_accepted_scheme_factor() -> None: + N, xi = sp.Integer(2), sp.Rational(1, 12) + shift = exact_mass_inverse_newton_shift( + N, + xi, + regulator=SHARP_PROPER_TIME_REGULATOR, + cutoff=Lam, + mass_squared=m2, + ) + accepted = leading_scalar_newton_shift_coefficient( + 1, xi, regulator=SHARP_PROPER_TIME_REGULATOR + ) + assert sp.simplify(shift.coefficient_per_field - accepted.coefficient_per_field) == 0 + assert sp.simplify(shift.value - N * accepted.coefficient_per_field * shift.proper_time_value) == 0 + + +def test_vacuum_shift_composes_both_integral_classes() -> None: + N = sp.Integer(4) + for regulator, kwargs in ( + (SHARP_PROPER_TIME_REGULATOR, {"cutoff": Lam, "mass_squared": m2}), + (SMOOTH_PROPER_TIME_REGULATOR, {"cutoff": Lam, "mass_squared": m2}), + ( + ZETA_POWER_SUBTRACTED_REGULATOR, + {"mass_squared": m2, "renormalization_scale": mu}, + ), + ): + vac = exact_mass_vacuum_density_shift(N, regulator=regulator, **kwargs) + expected = -N * sp.Rational(1, 2) * (4 * sp.pi) ** -2 * ( + vac.tau_minus_three_value + m2 * vac.tau_minus_two_value + ) + assert sp.simplify(vac.value - expected) == 0 + # Massless sharp vacuum sector: I_3 = Lambda^4/2 and m^2 I_2 = 0. + vac0 = exact_mass_vacuum_density_shift( + 1, regulator=SHARP_PROPER_TIME_REGULATOR, cutoff=Lam, mass_squared=0 + ) + assert sp.simplify(vac0.value + Lam**4 / (4 * (4 * sp.pi) ** 2)) == 0 + + +def test_mutations_break_the_oracles() -> None: + # Wrong prefactor: doubling the sharp closed form fails the tail identity. + doubled = 2 * (sp.exp(-m2 * tau0) - m2 * tau0 * sp.expint(1, m2 * tau0)) / tau0 + residual = sp.simplify(sp.diff(doubled, tau0) + tau0 ** -2 * sp.exp(-m2 * tau0)) + assert residual != 0 + # Wrong exponential-integral branch: Ei instead of E1 fails it too. + wrong_branch = (sp.exp(-m2 * tau0) - m2 * tau0 * sp.Ei(m2 * tau0)) / tau0 + residual_branch = sp.simplify( + sp.diff(wrong_branch, tau0) + tau0 ** -2 * sp.exp(-m2 * tau0) + ) + assert residual_branch != 0 + # Wrong Bessel order: K_2 in the curvature class breaks the recurrence. + wrong_order = 2 * sp.sqrt(z) * sp.besselk(2, 2 * sp.sqrt(z)) + J1 = 2 * sp.besselk(0, 2 * sp.sqrt(z)) + assert sp.simplify(sp.diff(wrong_order, z) + J1) != 0 + # Crossing the conformal value 1/6 flips the induced shift sign: the + # minimal coupling xi = 0 has 1/6 - xi > 0 while xi = 1 flips it. + plus = exact_mass_inverse_newton_shift( + 1, 0, regulator=SHARP_PROPER_TIME_REGULATOR, cutoff=Lam + ) + minus = exact_mass_inverse_newton_shift( + 1, 1, regulator=SHARP_PROPER_TIME_REGULATOR, cutoff=Lam + ) + assert plus.sign == 1 and minus.sign == -1 + assert sp.simplify(plus.value + minus.value) != 0 + + +def test_input_contracts_reject_ambiguous_schemes() -> None: + with pytest.raises(ValueError): + curvature_proper_time_integral("wrong_name", cutoff=Lam) + with pytest.raises(ValueError): + curvature_proper_time_integral(SMOOTH_PROPER_TIME_REGULATOR) + with pytest.raises(ValueError): + curvature_proper_time_integral( + SMOOTH_PROPER_TIME_REGULATOR, + cutoff=Lam, + renormalization_scale=mu, + ) + with pytest.raises(ValueError): + curvature_proper_time_integral(ZETA_POWER_SUBTRACTED_REGULATOR) + with pytest.raises(ValueError): + curvature_proper_time_integral( + ZETA_POWER_SUBTRACTED_REGULATOR, + cutoff=Lam, + renormalization_scale=mu, + ) + with pytest.raises(ValueError): + curvature_proper_time_integral( + SHARP_PROPER_TIME_REGULATOR, + cutoff=Lam, + mass_squared=sp.Symbol("neg", negative=True), + ) + with pytest.raises(ValueError): + exact_mass_inverse_newton_shift( + sp.Rational(3, 2), + 0, + regulator=SHARP_PROPER_TIME_REGULATOR, + cutoff=Lam, + ) + with pytest.raises(ValueError): + exact_mass_inverse_newton_shift( + 1, + sp.Symbol("xi", real=True), + regulator=SHARP_PROPER_TIME_REGULATOR, + cutoff=Lam, + ) + + +def test_module_is_target_blind() -> None: + import inspect + + from substrate_framework import scalar_one_loop_mass + + source = inspect.getsource(scalar_one_loop_mass) + for forbidden in ("6.674", "Planck", "M_pl", "6.708", "observed"): + assert forbidden not in source + + +def test_known_regulators_are_the_three_preregistered_schemes() -> None: + assert set(KNOWN_ONE_LOOP_REGULATORS) == { + SHARP_PROPER_TIME_REGULATOR, + SMOOTH_PROPER_TIME_REGULATOR, + ZETA_POWER_SUBTRACTED_REGULATOR, + } From 5e3e81148e90c1b315e9166277f1cd581d09a103 Mon Sep 17 00:00:00 2001 From: prime-agent Date: Mon, 17 Aug 2026 23:51:51 +0200 Subject: [PATCH 2/3] Record PR #77 handoff state in the P230 effort memory --- memory/vantasner/efforts/route1-exact-mass-determinant.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/memory/vantasner/efforts/route1-exact-mass-determinant.md b/memory/vantasner/efforts/route1-exact-mass-determinant.md index 0b1972c7..56170112 100644 --- a/memory/vantasner/efforts/route1-exact-mass-determinant.md +++ b/memory/vantasner/efforts/route1-exact-mass-determinant.md @@ -29,7 +29,7 @@ Conventions are exactly the accepted `scalar_induced_newton` ones: `D_E = -nabla 4. [x] Importable implementation of the closed forms for the tau^-2 and tau^-3 classes under all three regulators, with exact symbolic APIs. 5. [x] Verifier and sensitivity audit: quadrature cross-check of every closed form, massless-sharp reduction to the accepted `s*Lambda^2`, small-z asymptotic recovery, mutations (xi sign, prefactor, special-function branch, unknown regulator, non-defaulted scale), and scheme-spread ledger. 6. [x] Framework-fit and downstream replay (`scripts/validate.sh --full`: 2235 passed, ALL REPOSITORY WORKFLOW CHECKS PASS; `git diff --check` clean; GitNexus re-indexed at current commit, impact LOW, detect-changes maps only the new module and `__init__` exports; generated AGENTS.md injection from `gitnexus analyze` reverted per AGENTS_START_HERE) (`scripts/validate.sh` boundary appropriate to the diff; `git diff --check` separately). -7. [ ] Harvest PR advancing #76 (issue-first, non-self-merge); reviewer updates #76 with merged/refactor/history disposition once merged. +7. [~] Harvest PR advancing #76 opened as #77 (issue-first, `Advances #76`, author does not merge); awaiting independent review/harvest. Rung status + frontier comment posted on #76 (issuecomment-5320676210). Reviewer updates #76 with merged/refactor/history disposition once merged. ## Candidate Preregistration and Selection Criteria Selection criteria frozen before any comparison value is computed: (1) convention compatibility with the accepted rung APIs; (2) closed-form exactness in standard special functions with no fitted constants; (3) exact-mass integrity inside the regulated integral; (4) mutation sensitivity; (5) reuse value for the later cutoff-identification and renormalization-condition rungs; (6) regulator explicitness (scheme dependence stays visible). From a8a47f85a9af75988fd1c0a95aa4f24e77ffab9d Mon Sep 17 00:00:00 2001 From: prime-agent Date: Tue, 18 Aug 2026 09:29:23 +0200 Subject: [PATCH 3/3] Repair PR #77 review findings: vacuum double-count, zeta sign semantics, authority wording (P230 attempt 0002) F1: exact_mass_vacuum_density_shift now composes only the mass-resummed tau^-3 class (exact factored determinant); the unresummed -m^2 weight is documented as the first-order remnant via the exact identity d I_3/d m^2 = -I_2, now tested in all three schemes, with a mutation that rejects the double-counted composition. F2: ExactMassNewtonShift.sign split into curvature_weight_sign (decidable sign of 1/6-xi) and value_sign (decidable sign of the full value, None when undecidable); reviewer counterexamples added as tests. F3: landed conditional (unpromoted) provenance for scalar_induced_newton and covariant_sine_gordon_action in module, proposal manifest, and memory; accepted C-GRV-001 scope stated exactly. Targeted 25/25; full boundary scripts/validate.sh --full 2240 passed, ALL REPOSITORY WORKFLOW CHECKS PASS; git diff --check clean. --- .../efforts/route1-exact-mass-determinant.md | 8 +- .../P230-exact-mass-regulator-rung.md | 7 +- .../attempts/0002/manifest.yaml | 48 ++++++++ .../proposal.yaml | 5 +- .../scalar_one_loop_mass.py | 94 ++++++++++++---- tests/test_scalar_one_loop_mass.py | 106 ++++++++++++++++-- 6 files changed, 228 insertions(+), 40 deletions(-) create mode 100644 proposals/P230-exact-mass-regulator-rung/attempts/0002/manifest.yaml diff --git a/memory/vantasner/efforts/route1-exact-mass-determinant.md b/memory/vantasner/efforts/route1-exact-mass-determinant.md index 56170112..0320c94c 100644 --- a/memory/vantasner/efforts/route1-exact-mass-determinant.md +++ b/memory/vantasner/efforts/route1-exact-mass-determinant.md @@ -17,10 +17,10 @@ status: active This effort delivers one importable, target-blind reusable unit for the #76 goal: the exact-mass one-loop proper-time coefficients of the accepted Route 1 fluctuation operator, compared across preregistered regulators. It is complete for this rung when a new module under `src/substrate_framework/` returns closed forms for the tau^-2 class (curvature / inverse-Newton-matching integral) and the tau^-3 class (vacuum/cosmological integral) for three declared regulators (sharp proper-time cutoff; smooth essential-singularity proper-time weight; power-divergence-subtracted zeta scheme), each cross-checked against independent numerical quadrature; when the sharp massless limit reproduces the accepted leading coefficient `s = N*(1-6*xi)/(12*pi)` from `scalar_induced_newton` exactly; when the exact-mass sharp factor `exp(-z) - z*E1(z)` named load-bearing by the PR #13 review is exposed as a derived, mutation-sensitive API rather than a footnote; and when the scheme spread among the three regulators is returned as an exact quotable ledger. It does NOT identify a cutoff with a substrate scale, choose a renormalization condition, derive a total Newton constant, produce a sourced nonflat solution, compose worldline probes, or open any empirical comparator; those are later rungs and open campaign frontier for #76. A no-go, residual, or obstruction is attempt evidence, not completion. ## Accepted Baseline -Work starts from accepted release `v0.160.0`, framework commit `1b00c3a` (branch `research/p230-exact-mass-regulator-rung` off updated `origin/main`, which contains the P227 closure `2072648`). Source audited at this commit: `AGENTS.md`; `.agents/skills/physics-erdos-loop/SKILL.md` and its `references/governance.md` and `references/oracles.md`; `.agents/skills/research-pr-harvest/SKILL.md`; `tools/agent-memory/skills/shared_agent-memory-usage/SKILL.md` (CLI sections); `governance/releases/current.yaml` (207 accepted claims); `governance/claims.yaml` entries `C-GRV-001`, `C-GOR-001/002`, `C-STG-001/002`, `C-WLN-001..003`, `C-LOR-001/002`, `C-GW-001..010`; issue #76 body; issues #9 and #12 including all four comments each; `src/substrate_framework/scalar_induced_newton.py`; `src/substrate_framework/covariant_sine_gordon_action.py`; `src/substrate_framework/einstein_scalar.py` docstring conventions; `src/substrate_framework/governance.py` (proposal schema). Chronology and memory prose are not authority; every reused fact was verified at source. +Work starts from accepted release `v0.160.0`, framework commit `1b00c3a` (branch `research/p230-exact-mass-regulator-rung` off updated `origin/main`, which contains the P227 closure `2072648`). Source audited at this commit (with landed-conditional status noted per the PR #77 review): `AGENTS.md`; `.agents/skills/physics-erdos-loop/SKILL.md` and its `references/governance.md` and `references/oracles.md`; `.agents/skills/research-pr-harvest/SKILL.md`; `tools/agent-memory/skills/shared_agent-memory-usage/SKILL.md` (CLI sections); `governance/releases/current.yaml` (207 accepted claims); `governance/claims.yaml` entries `C-GRV-001`, `C-GOR-001/002`, `C-STG-001/002`, `C-WLN-001..003`, `C-LOR-001/002`, `C-GW-001..010`; issue #76 body; issues #9 and #12 including all four comments each; `src/substrate_framework/scalar_induced_newton.py` and `src/substrate_framework/covariant_sine_gordon_action.py` (both landed conditional unpromoted APIs; the PR #14 and PR #25 harvests promoted no claims); `src/substrate_framework/einstein_scalar.py` docstring conventions; `src/substrate_framework/governance.py` (proposal schema). Chronology and memory prose are not authority; every reused fact was verified at source. ## Constraints and Invariants -Conventions are exactly the accepted `scalar_induced_newton` ones: `D_E = -nabla_E^2 + xi R_E + m^2`, boundaryless Gilkey-Seeley-DeWitt weights `a_2 = ((1/6 - xi) R_E - m^2)` under the `(4*pi)^-2` prefactor, one-real-scalar determinant weight `1/2`, and the Euclidean Einstein-Hilbert matching factor `16*pi`. The mass is retained exactly: no expansion of `exp(-tau*m^2)` inside the regulated proper-time integral. Target-blindness is a tested invariant: no observed `G`, `M_Pl`, or benchmark value may appear; the cutoff stays a declared formal scale; the power-subtracted scheme requires an explicit `renormalization_scale` argument (regulator non-defaulting, mirroring the accepted module). No new fitted constant. Permitted imports: `sympy` (including `expint`/`E1` and Bessel `K` closed forms), `scipy` quadrature in tests only, framework `exact_symbolic`, `scalar_induced_newton`, and the declared composition slot `covariant_sine_gordon_action` (`m^2 -> V''(phi_bg)`). Write boundary: `src/substrate_framework/scalar_one_loop_mass.py`, its `__init__` exports, `tests/test_scalar_one_loop_mass.py`, `proposals/P230-exact-mass-regulator-rung/`, and this record. Author-does-not-merge: open a PR naming #76 with `Advances #76`; a distinct reviewer/owner harvests and merges. +Conventions are exactly the landed conditional `scalar_induced_newton` ones (accepted C-GRV-001 supplies only the conditional dimensional and additive-baseline ledger): `D_E = -nabla_E^2 + xi R_E + m^2`, boundaryless Gilkey-Seeley-DeWitt weights `a_2 = ((1/6 - xi) R_E - m^2)` under the `(4*pi)^-2` prefactor, one-real-scalar determinant weight `1/2`, and the Euclidean Einstein-Hilbert matching factor `16*pi`. The mass is retained exactly: no expansion of `exp(-tau*m^2)` inside the regulated proper-time integral. Target-blindness is a tested invariant: no observed `G`, `M_Pl`, or benchmark value may appear; the cutoff stays a declared formal scale; the power-subtracted scheme requires an explicit `renormalization_scale` argument (regulator non-defaulting, mirroring the accepted module). No new fitted constant. Permitted imports: `sympy` (including `expint`/`E1` and Bessel `K` closed forms), `scipy` quadrature in tests only, framework `exact_symbolic`, `scalar_induced_newton`, and the declared composition slot `covariant_sine_gordon_action` (`m^2 -> V''(phi_bg)`). Write boundary: `src/substrate_framework/scalar_one_loop_mass.py`, its `__init__` exports, `tests/test_scalar_one_loop_mass.py`, `proposals/P230-exact-mass-regulator-rung/`, and this record. Author-does-not-merge: open a PR naming #76 with `Advances #76`; a distinct reviewer/owner harvests and merges. ## Decomposition 1. [x] Recall and source verification (authority, #76 gates, #9 no-go, #12 ladder and PR #13/#25 handoffs, accepted rung conventions). @@ -29,7 +29,7 @@ Conventions are exactly the accepted `scalar_induced_newton` ones: `D_E = -nabla 4. [x] Importable implementation of the closed forms for the tau^-2 and tau^-3 classes under all three regulators, with exact symbolic APIs. 5. [x] Verifier and sensitivity audit: quadrature cross-check of every closed form, massless-sharp reduction to the accepted `s*Lambda^2`, small-z asymptotic recovery, mutations (xi sign, prefactor, special-function branch, unknown regulator, non-defaulted scale), and scheme-spread ledger. 6. [x] Framework-fit and downstream replay (`scripts/validate.sh --full`: 2235 passed, ALL REPOSITORY WORKFLOW CHECKS PASS; `git diff --check` clean; GitNexus re-indexed at current commit, impact LOW, detect-changes maps only the new module and `__init__` exports; generated AGENTS.md injection from `gitnexus analyze` reverted per AGENTS_START_HERE) (`scripts/validate.sh` boundary appropriate to the diff; `git diff --check` separately). -7. [~] Harvest PR advancing #76 opened as #77 (issue-first, `Advances #76`, author does not merge); awaiting independent review/harvest. Rung status + frontier comment posted on #76 (issuecomment-5320676210). Reviewer updates #76 with merged/refactor/history disposition once merged. +7. [~] Harvest PR advancing #76 opened as #77 (issue-first, `Advances #76`, author does not merge). Independent harvest review at head `04f26f2`: CHANGES REQUIRED (three blocking findings, all verified independently and repaired in attempt 0002 — vacuum double-count, zeta sign semantics, authority wording). Repaired head pushed; re-review requested; merge authority remains with the distinct reviewer. ## Candidate Preregistration and Selection Criteria Selection criteria frozen before any comparison value is computed: (1) convention compatibility with the accepted rung APIs; (2) closed-form exactness in standard special functions with no fitted constants; (3) exact-mass integrity inside the regulated integral; (4) mutation sensitivity; (5) reuse value for the later cutoff-identification and renormalization-condition rungs; (6) regulator explicitness (scheme dependence stays visible). @@ -47,7 +47,7 @@ Attempts are append-only and individually reproducible; each row names the diagn | (pending) | | | | | | ## Validation -Validation covers the actual objective, verifier sensitivity, limits, conventions, and dependency replay, not merely an exit code. Targeted oracle: `PYTHONPATH=src .venv/bin/python -m pytest tests/test_scalar_one_loop_mass.py -q` = 20 passed (5.20 s). Full boundary: `bash scripts/validate.sh --full` = 2235 passed in 309.16 s, `ALL REPOSITORY WORKFLOW CHECKS PASS (full pytest suite)`; `git diff --check` clean in a separate invocation. GitNexus: index refreshed at the working commit; `impact leading_scalar_newton_shift_coefficient` = LOW risk, single new direct caller (`exact_mass_inverse_newton_shift`); `detect-changes` maps only `src/substrate_framework/scalar_one_loop_mass.py` (new) and `__init__.py` `__all__`/imports; zero affected execution flows. The `gitnexus analyze` run auto-appended a tracked-instruction block to `AGENTS.md`; it was reverted per AGENTS_START_HERE section 3 and not committed. +Validation covers the actual objective, verifier sensitivity, limits, conventions, and dependency replay, not merely an exit code. Targeted oracle at the repaired head: `PYTHONPATH=src .venv/bin/python -m pytest tests/test_scalar_one_loop_mass.py -q` = 25 passed (5.84 s), including the review-driven additions: the mass-resummed determinant-integrand oracle, the d I_3/d m^2 = -I_2 derivative-identity oracle in all three schemes, the double-count rejection mutation, and both zeta sign counterexamples with undecidable and positive branches. Earlier 20/20 boundary at the first head (5.20 s). Full boundary: `bash scripts/validate.sh --full` = 2235 passed in 309.16 s, `ALL REPOSITORY WORKFLOW CHECKS PASS (full pytest suite)`; `git diff --check` clean in a separate invocation. GitNexus: index refreshed at the working commit; `impact leading_scalar_newton_shift_coefficient` = LOW risk, single new direct caller (`exact_mass_inverse_newton_shift`); `detect-changes` maps only `src/substrate_framework/scalar_one_loop_mass.py` (new) and `__init__.py` `__all__`/imports; zero affected execution flows. The `gitnexus analyze` run auto-appended a tracked-instruction block to `AGENTS.md`; it was reverted per AGENTS_START_HERE section 3 and not committed. ## Debt Ledger Every new assumption, import, parameter, residual, broken consumer, or narrative inconsistency is recorded here and discharged; this table must be empty at close. diff --git a/memory/vantasner/proposals/P230-exact-mass-regulator-rung.md b/memory/vantasner/proposals/P230-exact-mass-regulator-rung.md index 161fbbe2..48b1d78d 100644 --- a/memory/vantasner/proposals/P230-exact-mass-regulator-rung.md +++ b/memory/vantasner/proposals/P230-exact-mass-regulator-rung.md @@ -17,7 +17,7 @@ status: active The campaign asks for the exact closed-form one-loop proper-time coefficients of the accepted Route 1 fluctuation operator `D_E = -nabla_E^2 + xi R_E + m^2` when the mass is retained exactly, compared across preregistered regulators, as the next rung of the #76 parameter-closed emergent-gravity goal. The positive deliverable is an importable target-blind module plus tests; a no-go or obstruction is attempt evidence and does not complete it. ## Base Release and Provenance -The base is accepted release `v0.160.0` at framework commit `1b00c3a`, branch `research/p230-exact-mass-regulator-rung`. The manifest `proposals/P230-exact-mass-regulator-rung/proposal.yaml` records the source inventory: the two accepted prior-work modules (`scalar_induced_newton.py` from the PR #14 harvest `a562568`; `covariant_sine_gordon_action.py` from the PR #25 harvest `65e4a7c`) and the two already-imported literature convention sources (Vassilevich `hep-th/0306138` eqs (2.2)/(4.27); Visser `gr-qc/0204062` eqs (8)-(21)). +The base is accepted release `v0.160.0` at framework commit `1b00c3a`, branch `research/p230-exact-mass-regulator-rung`. The manifest `proposals/P230-exact-mass-regulator-rung/proposal.yaml` records the source inventory: the two landed conditional (unpromoted) prior-work modules (`scalar_induced_newton.py` from the PR #14 harvest `a562568`; `covariant_sine_gordon_action.py` from the PR #25 harvest `65e4a7c`; both harvests promoted no claims) and the two already-imported literature convention sources (Vassilevich `hep-th/0306138` eqs (2.2)/(4.27); Visser `gr-qc/0204062` eqs (8)-(21)). ## Invariants, Conventions, and Allowed Imports The frozen invariants are the accepted operator and scheme conventions, exact-mass integrity, target-blindness with a declared formal cutoff, no new fitted constants, unchanged accepted claims/releases/docs until independent adjudication, and non-self-merge. Allowed imports are SymPy exact algebra with special-function closed forms, SciPy quadrature in tests only, and the framework modules `scalar_induced_newton`, `covariant_sine_gordon_action` (mass slot `m^2 = V''(phi_bg)`), and `exact_symbolic`. @@ -26,7 +26,7 @@ The frozen invariants are the accepted operator and scheme conventions, exact-ma Three schemes are preregistered in the manifest: (A) sharp proper-time lower cutoff with the exact-mass factor `Lambda^2*(exp(-z) - z*E1(z))`; (B) smooth essential-singularity proper-time weight with `2*Lambda^2*sqrt(z)*BesselK_1(2*sqrt(z))`; (C) power-divergence-subtracted zeta finite part `m^2*(ln(m^2/mu^2) + gamma_E - 1)`. The rung exposes all three rather than selecting one, because its deliverable is the exact scheme comparison that the later renormalization-condition rung must cite. ## Selection Criteria and Blinding -The frozen structural criteria are convention compatibility, closed-form exactness, exact-mass integrity, mutation sensitivity, reuse value, and regulator explicitness. Empirical gravitational comparators stay blinded for this rung and until a later renormalization-condition rung freezes scheme, scale, and cutoff identification; the accepted coefficient `s = N*(1-6*xi)/(12*pi)` is a framework ledger result, not a comparator. +The frozen structural criteria are convention compatibility, closed-form exactness, exact-mass integrity, mutation sensitivity, reuse value, and regulator explicitness. Empirical gravitational comparators stay blinded for this rung and until a later renormalization-condition rung freezes scheme, scale, and cutoff identification; the landed conditional coefficient `s = N*(1-6*xi)/(12*pi)` is a framework ledger result, not a comparator. ## Proposed Claim Delta Provisional claim identifiers after a repository-wide collision search (zero usages of the `C-IGR` family in governance, campaigns, proposals, memory, src, tests, and docs): `C-IGR-001` for the sharp exact-mass closed forms and their massless/asymptotic reductions; `C-IGR-002` for the smooth-weight closed forms; `C-IGR-003` for the power-subtracted finite-part forms and the exact scheme-spread ledger. Dependencies: the accepted `C-GRV-001` ledger structure. No `supersedes` is used before acceptance. @@ -39,3 +39,6 @@ Attempts live in `proposals/P230-exact-mass-regulator-rung/attempts/` and are ap ## Continuation Issue #76 remains the canonical open goal; this rung advances it and proposes no closure. + +## Review Boundary (append-only, 2026-08-18) +The independent harvest review of PR #77 at head `04f26f2` required changes: the vacuum-density API double-counted the mass (resummed `I_3` composed with the unresummed `-m^2` weight; exact difference `-(N/2)(4*pi)^-2*m^2*I_2`), the shift `sign` field did not describe the zeta-scheme value (counterexample `value=(EulerGamma-1)/(12*pi)<0` with `sign=+1`), and the dependency authority was overstated (the two prior-work modules are landed conditional APIs, not accepted claims). All three findings were verified independently and repaired in attempt 0002; the repair keeps the integral atoms, composes only `I_3` in the vacuum value, splits `curvature_weight_sign` from `value_sign`, and carries the conditional-provenance wording. The failed formulas remain in PR history at `04f26f2`. diff --git a/proposals/P230-exact-mass-regulator-rung/attempts/0002/manifest.yaml b/proposals/P230-exact-mass-regulator-rung/attempts/0002/manifest.yaml new file mode 100644 index 00000000..73ea5eb4 --- /dev/null +++ b/proposals/P230-exact-mass-regulator-rung/attempts/0002/manifest.yaml @@ -0,0 +1,48 @@ +id: attempt-0002 +campaign: P230 +candidate: repair of attempt-0001 after independent harvest review (PR #77 review, changes required at 04f26f2) +command: > + PYTHONPATH=src .venv/bin/python -m pytest tests/test_scalar_one_loop_mass.py -q +working_directory: /home/dan/substrate-framework +base_release: v0.160.0 +source_commit: 04f26f2 (reviewed head) -> repaired head +elapsed_seconds: 5.84 +exit_code: 0 +verdict: repaired (25/25) +diagnosed_layer: implementation/concept boundary in the two composed public APIs; the integral atoms were correct +review_findings_and_verifications: + F1_vacuum_double_count: > + VERIFIED INDEPENDENTLY. exact_mass_vacuum_density_shift composed the + mass-resummed tau^-3 integral with the unresummed -m^2 weight + (value used I_3 + m^2*I_2). The exact factored determinant gives + -(N/2)*(4*pi)^-2*I_3 only; the difference is -(N/2)*(4*pi)^-2*m^2*I_2, + nonzero for m^2>0 (symbolically: m2*(exp(-m2*tau0)/tau0 - m2*E1(m2*tau0))). + The massless regression could not catch it because the spurious term + vanishes at m=0. Repair: value composes only I_3; new oracle + test_derivative_identity_links_the_two_integral_classes proves + d I_3/d m^2 = -I_2 exactly in all three schemes (the exact bridge + showing the -m^2 weight is the first-order remnant of the retained + exponential); mutation test requires the double-counted composition to + differ by the spurious term and that the term is nonzero for m^2>0. + F2_zeta_sign_semantics: > + VERIFIED INDEPENDENTLY. The sign field described only 1/6-xi while the + zeta I_2 changes sign with m^2/mu^2: counterexample N=1, xi=0, + m^2=mu^2=1 returned value=(EulerGamma-1)/(12*pi)<0 with sign=+1, and + the m^2=0 branch returned 0 with sign=+1. Repair: split into + curvature_weight_sign (decidable sign of 1/6-xi, ValueError when + undecidable, landed-module precedent) and value_sign (decidable sign of + the full value, None when symbolic inputs leave it undecidable). Both + reviewer counterexamples plus a large-mass positive branch and a + symbolic undecidable branch are now tests. + F3_authority_overstatement: > + VERIFIED INDEPENDENTLY. scalar_induced_newton (PR #14) and + covariant_sine_gordon_action (PR #25) are landed conditional + (unpromoted) APIs; both harvest handoffs state 'Claims promoted: none'; + accepted C-GRV-001 supplies only the conditional dimensional and + additive-baseline ledger. Repair: module docstring now carries an + explicit authority note; 'accepted module/scheme factor/weights' + wording replaced by 'landed conditional' provenance in the module, the + proposal manifest source inventory, both memory records, and the PR + body; all new public symbols remain explicitly unpromoted conditional + infrastructure linked to open goal #76. +next_materially_different_route: none required for the atoms; advance to the tau^-1 class (curvature-squared sector) after merge adjudication diff --git a/proposals/P230-exact-mass-regulator-rung/proposal.yaml b/proposals/P230-exact-mass-regulator-rung/proposal.yaml index ff6cadc3..4d15cc14 100644 --- a/proposals/P230-exact-mass-regulator-rung/proposal.yaml +++ b/proposals/P230-exact-mass-regulator-rung/proposal.yaml @@ -12,10 +12,10 @@ question: >- regulators; and what is the exact scheme spread among those regulators at a common declared scale? source_inventory: - - source: accepted module src/substrate_framework/scalar_induced_newton.py (PR #14 harvest a562568) + - source: landed conditional (unpromoted) module src/substrate_framework/scalar_induced_newton.py (PR #14 harvest a562568 promoted no claims) access: in hand (repository source, audited at 1b00c3a) extracted: operator convention D_E=-nabla_E^2+xi R_E+m^2; scheme factor 16*pi*(1/2)*(4*pi)^-2=1/(2*pi); leading coefficient s=N*(1-6*xi)/(12*pi); sharp proper-time regulator name; disclaimed finite-mass and logarithmic structure - - source: accepted module src/substrate_framework/covariant_sine_gordon_action.py (PR #25 harvest 65e4a7c) + - source: landed conditional (unpromoted) module src/substrate_framework/covariant_sine_gordon_action.py (PR #25 harvest 65e4a7c promoted no claims) access: in hand (repository source, audited at 1b00c3a) extracted: second variation D = -box_g + V''(phi_bg) + xi R with m^2 -> V''(phi_bg); mostly-plus convention; Euclidean-Hessian handoff - source: Vassilevich arXiv:hep-th/0306138 eqs (2.2) and (4.27) @@ -29,6 +29,7 @@ invariants: - 'target-blindness: no observed G, Planck mass, or empirical gravity benchmark enters; the cutoff remains a declared formal scale and is not identified with any substrate length in this rung' - no new fitted constant; every closed form is derived and cross-checked against independent quadrature - accepted claims, releases, generated docs, and immutable campaigns remain unchanged until independent claim adjudication + - 'authority language invariant: landed conditional prior-work APIs are never described as accepted claim authority; accepted C-GRV-001 supplies only the conditional dimensional and additive-baseline ledger' - author does not merge; a distinct reviewer or the owner performs any merge allowed_imports: - SymPy exact algebra including expint/E1 and Bessel K closed forms diff --git a/src/substrate_framework/scalar_one_loop_mass.py b/src/substrate_framework/scalar_one_loop_mass.py index d06703e4..cf39920c 100644 --- a/src/substrate_framework/scalar_one_loop_mass.py +++ b/src/substrate_framework/scalar_one_loop_mass.py @@ -39,9 +39,18 @@ I_2 = m**2*(ln(m**2/mu**2) + EulerGamma - 1), I_3 = -(m**4/2)*(ln(m**2/mu**2) + EulerGamma - 3/2). -Composition with the accepted scheme factor (one real scalar, determinant -weight 1/2, heat-kernel prefactor ``(4*pi)**-2``, Einstein-Hilbert matching -factor ``16*pi``) gives the exact-mass induced inverse-Newton shift +Authority note: ``scalar_induced_newton`` and +``covariant_sine_gordon_action`` are landed conditional (unpromoted) +prior-work APIs -- the PR #14 and PR #25 harvests promoted no claims -- and +the accepted ``C-GRV-001`` supplies only the conditional dimensional and +additive-baseline ledger, leaving the coefficient, field content, and +regulator as premises. Every public symbol in this module is likewise +conditional, unpromoted infrastructure linked to open goal #76. + +Composition with that landed conditional scheme factor (one real scalar, +determinant weight 1/2, heat-kernel prefactor ``(4*pi)**-2``, +Einstein-Hilbert matching factor ``16*pi``) gives the exact-mass induced +inverse-Newton shift Delta(1/G) = N * coefficient_per_field(xi) * I_2(regulator), @@ -49,12 +58,17 @@ ``scalar_induced_newton.leading_scalar_newton_shift_coefficient`` API, so the massless sharp limit reproduces the accepted ``s*Lambda**2 = N*(1-6*xi)*Lambda**2/(12*pi)`` exactly. The vacuum sector -of the same expansion is +of the same mass-resummed expansion is - Delta(rho_Gamma) = -(N/2)*(4*pi)**-2 * (I_3 + m**2*I_2) + Delta(rho_Gamma) = -(N/2)*(4*pi)**-2 * I_3(m**2) -per scheme, from the heat-kernel weights ``1`` (tau**-3 class) and -``-m**2`` (tau**-2 class) of the accepted ``scalar_heat_kernel_a2``. +per scheme. The ``-m**2`` entry of the landed conditional +``scalar_heat_kernel_a2`` weights belongs to the *unresummed* organization, +in which the exponential is expanded and the mass survives only as that +coefficient; applying it on top of the resummed ``I_3`` double-counts the +mass. The two organizations agree to first order through the exact +derivative identity ``d I_3/d m**2 = -I_2`` (which holds for all three +schemes and is tested), i.e. ``I_3(m**2) = I_3(0) - m**2*I_2(0) + O(m**4)``. Declared derivation oracles (all exact, SymPy): @@ -80,6 +94,13 @@ induces about 1.88 times the sharp curvature coefficient, and the power-subtracted scheme changes both the parametric structure and the sign at small log; any later usable-normalization claim must cite this spread. + +``ExactMassNewtonShift.curvature_weight_sign`` describes only the weight +``1/6 - xi`` and carries no total-shift verdict; ``value_sign`` is the +decidable sign of the full returned value (``None`` when symbolic inputs +leave it undecidable). For the two cutoff schemes ``I_2 > 0`` always, so +the two agree there; for the power-subtracted scheme ``I_2`` itself changes +sign with ``m**2/mu**2`` and the two fields genuinely differ. """ from __future__ import annotations @@ -92,7 +113,7 @@ from .exact_symbolic import exact_real as _exact_real from .exact_symbolic import positive_exact as _positive_exact from .scalar_induced_newton import SHARP_PROPER_TIME_REGULATOR -from .scalar_induced_newton import leading_scalar_newton_shift_coefficient +from .scalar_induced_newton import leading_scalar_newton_shift_coefficient # conditional landed API SMOOTH_PROPER_TIME_REGULATOR = "proper_time_smooth_essential" ZETA_POWER_SUBTRACTED_REGULATOR = "zeta_power_subtracted" @@ -278,7 +299,8 @@ class ExactMassNewtonShift: value: sp.Expr massless_leading_value: sp.Expr finite_mass_factor: sp.Expr | None - sign: int + curvature_weight_sign: int + value_sign: int | None def exact_mass_inverse_newton_shift( @@ -292,12 +314,18 @@ def exact_mass_inverse_newton_shift( ) -> ExactMassNewtonShift: """Return ``Delta(1/G) = N * coefficient_per_field * I_2`` exactly. - ``coefficient_per_field`` is the accepted per-field scheme factor - ``scheme_factor*(1/6 - xi)`` taken from - ``scalar_induced_newton.leading_scalar_newton_shift_coefficient`` (with - its massless sharp regulator tag used only to read that factor, which is - regulator-independent). The massless sharp limit reproduces the accepted - ``N*(1-6*xi)*Lambda**2/(12*pi)`` exactly. + ``coefficient_per_field`` is the per-field scheme factor + ``scheme_factor*(1/6 - xi)`` read from the landed conditional + ``scalar_induced_newton.leading_scalar_newton_shift_coefficient`` API + (its massless sharp regulator tag is used only to read that factor, + which is regulator-independent). The massless sharp limit reproduces + that module's ``N*(1-6*xi)*Lambda**2/(12*pi)`` exactly. + + ``curvature_weight_sign`` is the decidable sign of ``1/6 - xi`` only. + ``value_sign`` is the decidable sign of the full returned value, or + ``None`` when symbolic inputs leave it undecidable; the two coincide + for the cutoff schemes (``I_2 > 0``) but differ for the + power-subtracted scheme whenever ``I_2 < 0``. """ resolved_cutoff, scale = _resolve_regulator(regulator, cutoff, renormalization_scale) @@ -330,16 +358,24 @@ def exact_mass_inverse_newton_shift( value = sp.simplify(count * coefficient_per_field * proper_time_value) curvature_weight = sp.simplify(sp.Rational(1, 6) - xi) if curvature_weight.is_positive is True: - sign = 1 + curvature_weight_sign = 1 elif curvature_weight.is_zero is True: - sign = 0 + curvature_weight_sign = 0 elif curvature_weight.is_negative is True: - sign = -1 + curvature_weight_sign = -1 else: raise ValueError( "non_minimal_coupling must have a decidable relation to the " "four-dimensional conformal value 1/6" ) + if value.is_positive is True: + value_sign: int | None = 1 + elif value.is_zero is True: + value_sign = 0 + elif value.is_negative is True: + value_sign = -1 + else: + value_sign = None return ExactMassNewtonShift( regulator=regulator, @@ -353,7 +389,8 @@ def exact_mass_inverse_newton_shift( value=value, massless_leading_value=massless_leading_value, finite_mass_factor=finite_mass_factor, - sign=sign, + curvature_weight_sign=curvature_weight_sign, + value_sign=value_sign, ) @@ -369,6 +406,9 @@ class ExactMassVacuumShift: tau_minus_two_value: sp.Expr tau_minus_three_value: sp.Expr value: sp.Expr + # tau_minus_two_value is exposed for reference and for the derivative + # identity d I_3 / d m**2 = -I_2; the returned value composes only the + # mass-resummed tau**-3 class. def exact_mass_vacuum_density_shift( @@ -379,12 +419,18 @@ def exact_mass_vacuum_density_shift( mass_squared: Any = 0, renormalization_scale: Any = None, ) -> ExactMassVacuumShift: - """Return ``Delta(rho) = -(N/2)*(4*pi)**-2*(I_3 + m**2*I_2)`` exactly. + """Return ``Delta(rho) = -(N/2)*(4*pi)**-2*I_3(m**2)`` exactly. This is the vacuum (cosmological-sector) coefficient of the one-loop - action density under the accepted heat-kernel weights ``1`` and - ``-m**2``; it must be exhibited rather than omitted whenever the - curvature-sector shift is quoted. + action density in the mass-resummed organization: the trace integrand is + ``exp(-tau*m**2)*[tau**-2 + tau**-1*(1/6-xi)*R_E + ...]``, so the vacuum + sector is the tau**-3 class with the exponential retained. The + ``-m**2`` heat-kernel weight of the landed conditional + ``scalar_heat_kernel_a2`` is the first-order remnant of that same + exponential in the unresummed organization and must not be added again; + the exact bridge is the derivative identity ``d I_3/d m**2 = -I_2``. + The sector is exhibited rather than omitted whenever the curvature-sector + shift is quoted. """ resolved_cutoff, scale = _resolve_regulator(regulator, cutoff, renormalization_scale) @@ -407,7 +453,7 @@ def exact_mass_vacuum_density_shift( -count * sp.Rational(1, 2) * _FOUR_DIMENSIONAL_HEAT_KERNEL_PREFACTOR - * (tau_minus_three + mass * tau_minus_two) + * tau_minus_three ) return ExactMassVacuumShift( regulator=regulator, diff --git a/tests/test_scalar_one_loop_mass.py b/tests/test_scalar_one_loop_mass.py index 35f127ad..35b972af 100644 --- a/tests/test_scalar_one_loop_mass.py +++ b/tests/test_scalar_one_loop_mass.py @@ -243,7 +243,10 @@ def test_exact_mass_shift_composes_the_accepted_scheme_factor() -> None: assert sp.simplify(shift.value - N * accepted.coefficient_per_field * shift.proper_time_value) == 0 -def test_vacuum_shift_composes_both_integral_classes() -> None: +def test_vacuum_shift_is_the_mass_resummed_determinant_integrand() -> None: + # In the mass-resummed organization the trace integrand is + # exp(-tau*m^2)*[tau^-2 + tau^-1*(1/6-xi)*R + ...], so the vacuum sector + # is the tau^-3 class alone. The value must compose ONLY I_3. N = sp.Integer(4) for regulator, kwargs in ( (SHARP_PROPER_TIME_REGULATOR, {"cutoff": Lam, "mass_squared": m2}), @@ -254,17 +257,52 @@ def test_vacuum_shift_composes_both_integral_classes() -> None: ), ): vac = exact_mass_vacuum_density_shift(N, regulator=regulator, **kwargs) - expected = -N * sp.Rational(1, 2) * (4 * sp.pi) ** -2 * ( - vac.tau_minus_three_value + m2 * vac.tau_minus_two_value - ) + expected = -N * sp.Rational(1, 2) * (4 * sp.pi) ** -2 * vac.tau_minus_three_value assert sp.simplify(vac.value - expected) == 0 - # Massless sharp vacuum sector: I_3 = Lambda^4/2 and m^2 I_2 = 0. + # Massless sharp vacuum sector: I_3 = Lambda^4/2. vac0 = exact_mass_vacuum_density_shift( 1, regulator=SHARP_PROPER_TIME_REGULATOR, cutoff=Lam, mass_squared=0 ) assert sp.simplify(vac0.value + Lam**4 / (4 * (4 * sp.pi) ** 2)) == 0 +def test_double_counted_vacuum_composition_is_rejected_by_the_oracle() -> None: + # The reviewed defect: composing the resummed I_3 with the unresummed + # -m^2 weight (i.e. I_3 + m^2*I_2) differs from the exact factored + # determinant by the generally nonzero term -(N/2)*(4*pi)^-2*m^2*I_2. + N = sp.Integer(1) + vac = exact_mass_vacuum_density_shift( + N, regulator=SHARP_PROPER_TIME_REGULATOR, cutoff=Lam, mass_squared=m2 + ) + double_counted = -N * sp.Rational(1, 2) * (4 * sp.pi) ** -2 * ( + vac.tau_minus_three_value + m2 * vac.tau_minus_two_value + ) + assert sp.simplify(double_counted - vac.value - m2 * vac.tau_minus_two_value * (-N * sp.Rational(1, 2) * (4 * sp.pi) ** -2)) == 0 + # ... and the spurious term is nonzero for m^2 > 0 (it vanishes only at + # m = 0, which is why the massless regression could not catch it). + assert sp.simplify(m2 * vac.tau_minus_two_value) != 0 + + +@pytest.mark.parametrize( + "regulator,kwargs", + [ + (SHARP_PROPER_TIME_REGULATOR, {"cutoff": Lam, "mass_squared": m2}), + (SMOOTH_PROPER_TIME_REGULATOR, {"cutoff": Lam, "mass_squared": m2}), + ( + ZETA_POWER_SUBTRACTED_REGULATOR, + {"mass_squared": m2, "renormalization_scale": mu}, + ), + ], +) +def test_derivative_identity_links_the_two_integral_classes(regulator, kwargs) -> None: + # d I_3 / d m^2 = -I_2 holds exactly in every scheme; it is the exact + # bridge showing the -m^2 heat-kernel weight is the first-order remnant + # of the retained exponential, not an additive piece of I_3. + i2 = curvature_proper_time_integral(regulator, **kwargs) + i3 = vacuum_proper_time_integral(regulator, **kwargs) + assert sp.simplify(sp.diff(i3, m2) + i2) == 0 + + def test_mutations_break_the_oracles() -> None: # Wrong prefactor: doubling the sharp closed form fails the tail identity. doubled = 2 * (sp.exp(-m2 * tau0) - m2 * tau0 * sp.expint(1, m2 * tau0)) / tau0 @@ -280,18 +318,70 @@ def test_mutations_break_the_oracles() -> None: wrong_order = 2 * sp.sqrt(z) * sp.besselk(2, 2 * sp.sqrt(z)) J1 = 2 * sp.besselk(0, 2 * sp.sqrt(z)) assert sp.simplify(sp.diff(wrong_order, z) + J1) != 0 - # Crossing the conformal value 1/6 flips the induced shift sign: the - # minimal coupling xi = 0 has 1/6 - xi > 0 while xi = 1 flips it. + # Crossing the conformal value 1/6 flips the curvature weight sign: the + # minimal coupling xi = 0 has 1/6 - xi > 0 while xi = 1 flips it. For + # the cutoff schemes I_2 > 0, so the value sign follows. plus = exact_mass_inverse_newton_shift( 1, 0, regulator=SHARP_PROPER_TIME_REGULATOR, cutoff=Lam ) minus = exact_mass_inverse_newton_shift( 1, 1, regulator=SHARP_PROPER_TIME_REGULATOR, cutoff=Lam ) - assert plus.sign == 1 and minus.sign == -1 + assert plus.curvature_weight_sign == 1 and minus.curvature_weight_sign == -1 + assert plus.value_sign == 1 and minus.value_sign == -1 assert sp.simplify(plus.value + minus.value) != 0 +def test_zeta_value_sign_disagrees_with_the_curvature_weight_sign() -> None: + # Reviewer counterexample: N=1, xi=0, m^2 = mu^2 = 1 gives a negative + # total shift while the curvature weight is positive. + negative = exact_mass_inverse_newton_shift( + 1, + 0, + regulator=ZETA_POWER_SUBTRACTED_REGULATOR, + mass_squared=1, + renormalization_scale=1, + ) + assert negative.curvature_weight_sign == 1 + assert negative.value.is_negative is True + assert negative.value_sign == -1 + assert sp.simplify(negative.value - (sp.EulerGamma - 1) / (12 * sp.pi)) == 0 + + # Massless power-subtracted branch: value is exactly zero, so the value + # sign is 0 even though the curvature weight stays positive. + zero = exact_mass_inverse_newton_shift( + 1, + 0, + regulator=ZETA_POWER_SUBTRACTED_REGULATOR, + mass_squared=0, + renormalization_scale=1, + ) + assert zero.value == 0 + assert zero.curvature_weight_sign == 1 + assert zero.value_sign == 0 + + # Symbolic scale ratio: the value sign is undecidable, not guessed. + symbolic = exact_mass_inverse_newton_shift( + 1, + 0, + regulator=ZETA_POWER_SUBTRACTED_REGULATOR, + mass_squared=m2, + renormalization_scale=mu, + ) + assert symbolic.value_sign is None + assert symbolic.curvature_weight_sign == 1 + + # Large-mass zeta branch flips the integral itself positive. + positive = exact_mass_inverse_newton_shift( + 1, + 0, + regulator=ZETA_POWER_SUBTRACTED_REGULATOR, + mass_squared=sp.Integer(10), + renormalization_scale=1, + ) + assert positive.value_sign == 1 + + def test_input_contracts_reject_ambiguous_schemes() -> None: with pytest.raises(ValueError): curvature_proper_time_integral("wrong_name", cutoff=Lam)