TFPT scientific source excerpt Original repository path: experiments/theory-contracts/elliptic-moebius-source-bridge-20261026/neutral_moebius_source_20261029/check_neutral_moebius.py Original file SHA-256: 4016adce04cd143935c6eb7b94fc34c06ab6f2e0baaf89bf8dd3ee0e12444319 Inclusive original lines: 1-123 Line numbers below refer to the original source. This bounded excerpt is source evidence; it is not a new proof/checker run. Conversation metadata and personal execution details are omitted where indicated. 000001 | """Direct old-source checks; the infinite-dimensional theorem is in PROOF.txt. 000002 | 000003 | Reuses the original CAR stress builder. No new source, state or oscillator. 000004 | Finite checks do not prove Reeh-Schlieder, BW or an infinite spectrum. 000005 | """ 000006 | from pathlib import Path 000007 | from fractions import Fraction as F 000008 | from functools import lru_cache 000009 | from math import factorial 000010 | import importlib.util 000011 | import json 000012 | import sympy as s 000013 | 000014 | ROOT = Path(__file__).resolve().parents[4] 000015 | OLD = ROOT / "experiments/theory-contracts/original-admissible-source-closure-20261025/check_w8_stress_cyclic.py" 000016 | spec = importlib.util.spec_from_file_location("old_quarter_stress", OLD) 000017 | old = importlib.util.module_from_spec(spec) 000018 | spec.loader.exec_module(old) 000019 | SEA = {255: F(1)} # original occupied modes -8,...,-1 000020 | 000021 | 000022 | def need(condition, message): 000023 | if not condition: 000024 | raise RuntimeError(message) 000025 | 000026 | 000027 | def clean(v): 000028 | return {k: c for k, c in v.items() if c} 000029 | 000030 | 000031 | def current(v, n): 000032 | # Exact SAME CAR matrix units as the original stress, with coefficient1. 000033 | out = {} 000034 | for mask, c in v.items(): 000035 | for i in range(16 - n): 000036 | move = old.fermion_move(mask, i, i + n) 000037 | if move is not None: 000038 | state, sign = move 000039 | out[state] = out.get(state, F(0)) + c * sign 000040 | return clean(out) 000041 | 000042 | 000043 | @lru_cache(None) 000044 | def pbw_in_car(lam): 000045 | v = SEA 000046 | for n in lam: 000047 | v = current(v, n) 000048 | return v 000049 | 000050 | 000051 | def car_linear(pbw): 000052 | result = {} 000053 | for lam, c in pbw.items(): 000054 | for mask, value in pbw_in_car(lam).items(): 000055 | result[mask] = result.get(mask, F(0)) + c * value 000056 | return clean(result) 000057 | 000058 | 000059 | def weighted_integral(poly, x): 000060 | # integral_0^infinity x exp(-x) poly(x) dx, exactly for polynomials. 000061 | return sum(c * factorial(k[0] + 1) for k, c in s.Poly(s.expand(poly), x).terms()) 000062 | 000063 | 000064 | def main(): 000065 | comparisons = 0 000066 | for alpha in (F(1, 4), F(3, 4)): 000067 | b = alpha - F(1, 2) 000068 | for grade in range(5): 000069 | for lam in old.partitions(grade): 000070 | v = pbw_in_car(lam) 000071 | for n in (1, 2): 000072 | lhs = old.original_stress_action(v, n, alpha) 000073 | for mask, c in current(v, n).items(): 000074 | lhs[mask] = lhs.get(mask, F(0)) - b*c 000075 | rhs = car_linear(old.boson_stress_action({lam: F(1)}, n, F(0))) 000076 | need(clean(lhs) == rhs, "same-source compensated stress identity") 000077 | comparisons += 1 000078 | original = old.original_stress_action(SEA, 1, alpha) 000079 | expected = {k: b*c for k, c in current(SEA, 1).items()} 000080 | need(original == expected, "actual twisted stress vacuum witness") 000081 | 000082 | x = s.Symbol("x", positive=True) 000083 | N = 7 000084 | laguerre = [s.assoc_laguerre(n-1, 1, x)/s.sqrt(n) for n in range(1, N+2)] 000085 | for n in range(1, N+1): 000086 | value = n*laguerre[n-1] - s.sqrt(n*(n+1))*laguerre[n]/2 000087 | if n > 1: 000088 | value -= s.sqrt(n*(n-1))*laguerre[n-2]/2 000089 | need(s.simplify(value - x*laguerre[n-1]/2) == 0, "Laguerre Jacobi recurrence") 000090 | for m in range(1, N+1): 000091 | need(s.simplify(weighted_integral(laguerre[n-1]*laguerre[m-1], x)) == int(n == m), "Laguerre Gram") 000092 | 000093 | f = s.Function("f")(x) 000094 | D = lambda g: s.I*(x*s.diff(g, x)+(1-x/2)*g) 000095 | need(s.simplify(D(x*f/2)-x*D(f)/2-s.I*x*f/2) == 0, "[D,P]=iP") 000096 | r, u = s.symbols("r u", positive=True) 000097 | amplitude = lambda a, y: a*s.exp((1-a)*y/2) 000098 | need(s.simplify(amplitude(r,x)*amplitude(u,r*x)-amplitude(r*u,x)) == 0, "dilation group law") 000099 | need(s.simplify(x*s.exp(-x)*amplitude(r,x)**2-r*(r*x)*s.exp(-r*x)) == 0, "dilation unitarity density") 000100 | theta = s.Symbol("theta", real=True) 000101 | cayley = -s.cot(theta/2) 000102 | need(s.trigsimp(s.diff(cayley,theta)*(1-s.cos(theta))-1) == 0, "Cayley translation vector field") 000103 | need(s.trigsimp(s.diff(cayley,theta)*(-s.sin(theta))-cayley) == 0, "Cayley dilation vector field") 000104 | q = s.Symbol("q", positive=True) 000105 | thermal_commutator = -s.sqrt(2)*(q-q**2)/2 000106 | need(thermal_commutator != 0, "thermal source differs from invariant vacuum") 000107 | result = { 000108 | "status": "PASS_SCOPED", 000109 | "literal_original_CAR_compensated_stress_comparisons": comparisons, 000110 | "quarters": ["1/4", "3/4"], 000111 | "exact_CAR_window": "-8,...,7; all checked total grades<=6, below boundary grade9", 000112 | "laguerre_recurrence_checks": N, 000113 | "laguerre_gram_checks": N*N, 000114 | "thermal_commutator_entry_times_partition_function": str(thermal_commutator), 000115 | "analytic_scope": "Full Laguerre basis, operator closures, positive spectrum, local current net and BW/HSMI are the written theorem with primary references, not inferred from finite checks.", 000116 | "P1_source_map_closed": False, 000117 | "full_TFPT_solution": False, 000118 | } 000119 | print(json.dumps(result, indent=2, sort_keys=True)) 000120 | 000121 | 000122 | if __name__ == "__main__": 000123 | main()