Skip to content

Commit 1a80eff

Browse files
author
TNFR AI Agent
committed
feat: certify antisymmetric half-alpha remesh class
1 parent 4bff1b1 commit 1a80eff

16 files changed

Lines changed: 2172 additions & 52 deletions

‎.github/agents/my-agent.md‎

Lines changed: 40 additions & 6 deletions
Large diffs are not rendered by default.

‎AGENTS.md‎

Lines changed: 40 additions & 6 deletions
Large diffs are not rendered by default.

‎CHANGELOG.md‎

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,19 @@ All notable changes to this project will be documented in this file.
1919
has uniform relative defect `eta=0`, and preserves the class under REMESH.
2020
Signed-zero bits, schedules, repeated event execution and future runtime
2121
behavior remain outside this certificate.
22+
- Added the first useful uniform represented class with `0<alpha<1`. On
23+
ordered P2 support, any fixed positive diagonal metric, fixed delays,
24+
`alpha=0.5`, a symmetric hard interval `[-B,B]` with
25+
`B>=4*2^-1074`, and sufficient antisymmetric history rows `(a,-a)`, the
26+
production REMESH map preserves the class and has sharp uniform relative
27+
defect `eta*=135/124`. The proof combines an analytic IEEE error bound for
28+
`sqrt(D)>=11*2^-1074` with exact enumeration of 6,615 integer-core candidates,
29+
3,890 of them admissible; `(-3,-2,-3)*2^-1074` attains equality. Robust
30+
composition is strict for `q<124/259`: `q=4/9` gives `q_eff=259/279` and
31+
margin `20/279`, while equality at `q=124/259` has zero margin and `q=9/16`
32+
is rejected. REMESH-only forward invariance does not extend to arbitrary
33+
metric-centered rows, unrestricted fixed lattices, graph execution or future
34+
complete-runtime behavior.
2235
- Added the restricted global binary64 P2 half-Reception composition. With two
2336
mutual singleton neighbors, an immutable all-target EPI snapshot, the exact
2437
configured mix `0.5` and one common hard clamp, both proposals are
@@ -51,12 +64,14 @@ All notable changes to this project will be documented in this file.
5164
occur inside one outer graph transaction, so a zero pair or any other failure
5265
restores graph-owned state. Success certifies only that invocation; future,
5366
unobserved-repetition and auxiliary-state claims remain false.
54-
- Added examples 173–177, including
67+
- Added examples 173–178, including
5568
`176_runtime_p2_reception_remesh_sequence.py`, exact public stubs, facade
5669
exports and adversarial tests covering normal/subnormal extremes, signed
5770
zero, inactive and active clipping, hostile inputs, private reseals and the
5871
exact energy-gain-four witness for the canonical default EN factor. Example
59-
177 demonstrates two independently revalidated policy invocations.
72+
177 demonstrates two independently revalidated policy invocations. Example
73+
178 records the sharp half-alpha class, exact proof partition, robust gain
74+
boundaries and the metric-centering and fixed-lattice falsifiers.
6075

6176
### Added — 2026-09-11 Relative-defect REMESH/schedule stability
6277

‎README.md‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -693,6 +693,29 @@ execution and future runtime behavior remain outside the certificate. Example
693693
[`173_binary64_remesh_relative_defect.py`](examples/02_physics_regimes/173_binary64_remesh_relative_defect.py)
694694
shows both the obstruction and this boundary class.
695695

696+
[`certify_half_alpha_antisymmetric_hard_clip_remesh_class(...)`](src/tnfr/physics/binary64_remesh_relative_defect.py)
697+
closes the first useful represented subclass with `0<alpha<1`. It fixes an
698+
ordered two-node support, any positive diagonal metric, positive delays,
699+
`alpha=0.5`, a symmetric hard interval `[-B,B]` with
700+
`B>=4*2**-1074`, and sufficient histories whose rows are `(a,-a)`. Binary64
701+
round-to-nearest-even and the symmetric clamp preserve numeric antisymmetry,
702+
so this class is forward invariant under the REMESH map alone. Writing
703+
`s=2**-1074`, `u=2**-53`, `D=c**2+l**2+2*g**2` and `x=sqrt(D)`, the exact IEEE
704+
error proof gives `|r-y|<=A*x+C*s`, where
705+
`A=3*u/2+u**2/2` and `C=9/4+9*u/4+u**2/2`. For `x>=11*s`, its analytic tail is
706+
strictly below `135/124`. For `x<11*s`, exact integer enumeration checks 6,615
707+
candidates, of which 3,890 satisfy `0<D<121*s**2`, and attains
708+
`eta*=135/124` at `(c,l,g)=(-3,-2,-3)*s`. The robust composition is strict
709+
exactly for `q<124/259`: `q=4/9` gives `q_eff=259/279` and margin `20/279`,
710+
whereas `q=124/259` gives only nonincrease with zero margin and `q=9/16` is
711+
rejected. General positive-metric centering and fixed lattices are outside the
712+
class: represented rounding can move the former's center, and `(h,0,0)` maps
713+
to `h/4`. Schedule verification, graph/event execution, repeated complete
714+
runtime behavior and future stability remain unproved. Example
715+
[`178_half_alpha_antisymmetric_remesh_class.py`](examples/02_physics_regimes/178_half_alpha_antisymmetric_remesh_class.py)
716+
records the sharp witness, both composition boundaries and both excluded
717+
generalizations.
718+
696719
[`certify_p2_half_reception_remesh_stability(...)`](src/tnfr/physics/binary64_p2_reception_stability.py)
697720
closes a restricted global numeric EPI-kernel composition. On two mutual singleton
698721
neighbors, an immutable all-target EPI snapshot, the exact configured

‎docs/API_CONTRACTS.md‎

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -786,6 +786,35 @@ preserves the class. Equality does not promise preservation of the signed-zero
786786
bit. Schedule, repeated event execution, future-runtime, solver and full-TNFR
787787
properties are explicitly false.
788788

789+
[`certify_half_alpha_antisymmetric_hard_clip_remesh_class`](../src/tnfr/physics/binary64_remesh_relative_defect.py)
790+
accepts exactly two ordered nodes, an optional positive diagonal metric,
791+
positive local/global delays and a positive represented radius
792+
`epi_bound>=4*2**-1074`. It fixes `alpha=0.5` and the symmetric hard interval
793+
`[-epi_bound,epi_bound]`. A represented history belongs only when its length is
794+
between `max(tau_local,tau_global)+1` and `history_maxlen` and every row is a
795+
finite in-interval binary64 pair `(a,-a)`. The production nested recurrence and
796+
symmetric clamp preserve numeric antisymmetry and the interval.
797+
798+
The certificate stores the sharp bound `eta*=135/124`. Its executable proof
799+
splits at `x=sqrt(D)=11*s`, where `s=2**-1074` and
800+
`D=c**2+l**2+2*g**2`. For the large-norm tail, it stores the exact constants
801+
`A=3*u/2+u**2/2` and `C=9/4+9*u/4+u**2/2`, with `u=2**-53`, in
802+
`|r-y|<=A*x+C*s`; the resulting tail ratio is strictly below `eta*`. For
803+
`x<11*s`, it exactly enumerates 6,615 bounded integer triples, retains the
804+
3,890 with `0<D/s**2<121`, and finds the maximum at `(-3,-2,-3)`. The stored
805+
subnormal witness has ideal amplitude `-11*s/4`, runtime amplitude `-4*s`, and
806+
relative defect `135/124`.
807+
808+
`certify_schedule_relative_defect_stability(q)` composes that `eta*` through
809+
the existing robust theorem. Its strict threshold is `q<124/259`; `q=4/9`
810+
produces `q_eff=259/279` and normalized block margin `20/279`, equality at
811+
`q=124/259` produces nonincrease with zero margin, and `q=9/16` is rejected.
812+
This method certifies the conditional exact schedule theorem, not a verified
813+
runtime schedule family. The class is REMESH-forward-invariant only. It does
814+
not include arbitrary positive-metric-centered histories or unrestricted fixed
815+
lattices, and it leaves graph/event binding, repeated complete-runtime
816+
execution, solver and full-TNFR properties false.
817+
789818
[`certify_p2_half_reception_remesh_stability`](../src/tnfr/physics/binary64_p2_reception_stability.py)
790819
requires an intact two-node `alpha=1` class certificate. It fixes mutual
791820
singleton neighbor indices, the exact binary64 configured factor `0.5`, a
@@ -1020,6 +1049,14 @@ re-exported from `tnfr.physics`.
10201049
verifies that the planner and observer share the production scalar kernel;
10211050
[`test_binary64_remesh_relative_defect_example.py`](../tests/physics/test_binary64_remesh_relative_defect_example.py)
10221051
checks the public facade and example 173.
1052+
- [`test_half_alpha_antisymmetric_remesh_class.py`](../tests/physics/test_half_alpha_antisymmetric_remesh_class.py)
1053+
verifies the sharp `eta=135/124` class, exact analytic-tail constants,
1054+
exhaustive 6,615/3,890 finite core, subnormal maximizer, strict/equality/
1055+
rejection gain boundaries, history membership, forward invariance, excluded
1056+
centered and lattice generalizations, public types and fail-closed seals;
1057+
[`test_half_alpha_antisymmetric_remesh_class_example.py`](../tests/physics/test_half_alpha_antisymmetric_remesh_class_example.py)
1058+
checks the public facade and example
1059+
[`178_half_alpha_antisymmetric_remesh_class.py`](../examples/02_physics_regimes/178_half_alpha_antisymmetric_remesh_class.py).
10231060
- [`test_binary64_p2_reception_stability.py`](../tests/physics/test_binary64_p2_reception_stability.py)
10241061
verifies global numeric consensus and `q=0` for the exact-half P2 kernel,
10251062
its `eta=q_eff=0` composition and finite extinction horizon, extremes,
Lines changed: 225 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,225 @@
1+
"""Certify a useful binary64 REMESH class at ``alpha=1/2``.
2+
3+
On a two-node antisymmetric history ``(a, -a)``, binary64 division by two,
4+
addition, and a symmetric hard clamp preserve oddness. The class is therefore
5+
REMESH-forward-invariant and has the sharp uniform relative-defect bound
6+
``eta=135/124`` once the represented radius contains ``4*2**-1074``.
7+
8+
Composing this bound with a schedule disagreement gain ``q`` gives
9+
``q_eff=q*(1+eta)``. The example uses ``q=4/9``, for which
10+
``q_eff=259/279<1`` and the normalized block margin is ``20/279``. It also
11+
shows the zero-margin boundary and two excluded generalizations: arbitrary
12+
metric-centered rows and an unrestricted fixed lattice.
13+
"""
14+
15+
from __future__ import annotations
16+
17+
from fractions import Fraction
18+
import json
19+
import math
20+
from typing import Any
21+
22+
from tnfr.physics import (
23+
certify_half_alpha_antisymmetric_hard_clip_remesh_class,
24+
observe_binary64_remesh_pair_relative_defect,
25+
)
26+
27+
28+
def _weighted_center(pair: tuple[float, float]) -> Fraction:
29+
left, right = (Fraction.from_float(value) for value in pair)
30+
return (left + 3 * right) / 4
31+
32+
33+
def _fraction_text(value: Fraction) -> str:
34+
return f"{value.numerator}/{value.denominator}"
35+
36+
37+
def run_protocol() -> dict[str, Any]:
38+
"""Build the class, its schedule compositions, and scope falsifiers."""
39+
40+
certificate = certify_half_alpha_antisymmetric_hard_clip_remesh_class(
41+
("left", "right"),
42+
(1.0, 3.0),
43+
tau_local=2,
44+
tau_global=3,
45+
epi_bound=1.0,
46+
)
47+
strict_policy = certificate.certify_schedule_relative_defect_stability(
48+
Fraction(4, 9)
49+
)
50+
boundary_policy = certificate.certify_schedule_relative_defect_stability(
51+
Fraction(124, 259)
52+
)
53+
54+
smallest = math.ulp(0.0)
55+
sharpness_witness = observe_binary64_remesh_pair_relative_defect(
56+
(-3 * smallest, 3 * smallest),
57+
(-2 * smallest, 2 * smallest),
58+
(-3 * smallest, 3 * smallest),
59+
alpha=0.5,
60+
epi_min=-4 * smallest,
61+
epi_max=4 * smallest,
62+
clip_mode="hard",
63+
)
64+
65+
amplitudes = (
66+
float.fromhex("0x1.37b40d1c51f86p-29"),
67+
float.fromhex("0x1.2be8875fa6dd8p-29"),
68+
float.fromhex("-0x1.0994982458cc8p-28"),
69+
)
70+
centered_inputs = tuple((3 * value, -value) for value in amplitudes)
71+
centered_falsifier = observe_binary64_remesh_pair_relative_defect(
72+
*centered_inputs,
73+
alpha=0.5,
74+
epi_min=-1.0,
75+
epi_max=1.0,
76+
clip_mode="hard",
77+
)
78+
lattice_falsifier = observe_binary64_remesh_pair_relative_defect(
79+
(1.0, -1.0),
80+
(0.0, -0.0),
81+
(0.0, -0.0),
82+
alpha=0.5,
83+
epi_min=-1.0,
84+
epi_max=1.0,
85+
clip_mode="hard",
86+
)
87+
return {
88+
"certificate": certificate,
89+
"strict_policy": strict_policy,
90+
"boundary_policy": boundary_policy,
91+
"sharpness_witness": sharpness_witness,
92+
"centered_inputs": centered_inputs,
93+
"centered_falsifier": centered_falsifier,
94+
"lattice_falsifier": lattice_falsifier,
95+
}
96+
97+
98+
def build_report(protocol: dict[str, Any]) -> dict[str, Any]:
99+
"""Return the exact class result and its explicit boundaries."""
100+
101+
certificate = protocol["certificate"]
102+
strict = protocol["strict_policy"]
103+
boundary = protocol["boundary_policy"]
104+
sharp = protocol["sharpness_witness"]
105+
centered_inputs = protocol["centered_inputs"]
106+
centered = protocol["centered_falsifier"]
107+
lattice = protocol["lattice_falsifier"]
108+
return {
109+
"claim": (
110+
"the alpha=1/2 antisymmetric P2 hard-clip REMESH class has a "
111+
"sharp uniform binary64 relative-defect bound"
112+
),
113+
"class": {
114+
"certificate_valid": (
115+
certificate
116+
.half_alpha_antisymmetric_hard_clip_class_certificate_certified
117+
),
118+
"alpha": _fraction_text(certificate.alpha),
119+
"interval": [
120+
_fraction_text(certificate.epi_min),
121+
_fraction_text(certificate.epi_max),
122+
],
123+
"metric": [
124+
_fraction_text(value)
125+
for value in certificate.exact_normalized_metric
126+
],
127+
"uniform_eta": _fraction_text(
128+
certificate.exact_uniform_relative_defect_upper_bound
129+
),
130+
"strict_q_threshold": _fraction_text(
131+
certificate.exact_strict_schedule_gain_threshold
132+
),
133+
"global_bound_proof": {
134+
"large_norm_tail_bound": _fraction_text(
135+
certificate.exact_tail_relative_defect_upper_bound
136+
),
137+
"large_norm_tail_is_strict": (
138+
certificate.exact_tail_relative_defect_upper_bound
139+
< certificate.exact_uniform_relative_defect_upper_bound
140+
),
141+
"finite_core_candidates": (
142+
certificate.finite_core_candidate_count
143+
),
144+
"finite_core_admissible": (
145+
certificate.finite_core_admissible_count
146+
),
147+
"finite_core_maximizer": list(
148+
certificate.finite_core_maximizer_amplitudes
149+
),
150+
},
151+
"antisymmetry_preserved": (
152+
certificate.binary64_antisymmetry_preserved_certified
153+
),
154+
"remesh_forward_invariant": (
155+
certificate.remesh_class_forward_invariant_certified
156+
),
157+
"repeated_binary64_runtime": (
158+
certificate.repeated_binary64_stability_certified
159+
),
160+
"future_execution": (
161+
certificate.future_binary64_execution_certified
162+
),
163+
"full_tnfr_stability": certificate.full_tnfr_stability_certified,
164+
},
165+
"strict_schedule_composition": {
166+
"q": _fraction_text(strict.schedule_energy_gain_upper_bound),
167+
"q_effective": _fraction_text(
168+
strict.exact_effective_head_energy_gain_upper_bound
169+
),
170+
"normalized_block_margin": _fraction_text(
171+
strict.exact_uniform_normalized_block_margin_lower_bound
172+
),
173+
"geometric_spatial_disagreement_convergence": (
174+
strict.geometric_spatial_disagreement_convergence_certified
175+
),
176+
},
177+
"threshold_boundary": {
178+
"q": _fraction_text(boundary.schedule_energy_gain_upper_bound),
179+
"q_effective": _fraction_text(
180+
boundary.exact_effective_head_energy_gain_upper_bound
181+
),
182+
"normalized_block_margin": _fraction_text(
183+
boundary.exact_uniform_normalized_block_margin_lower_bound
184+
),
185+
"geometric_spatial_disagreement_convergence": (
186+
boundary.geometric_spatial_disagreement_convergence_certified
187+
),
188+
},
189+
"sharp_subnormal_witness": {
190+
"current_in_smallest_subnormal_units": [-3, 3],
191+
"local_in_smallest_subnormal_units": [-2, 2],
192+
"global_in_smallest_subnormal_units": [-3, 3],
193+
"ideal_left_in_smallest_subnormal_units": "-11/4",
194+
"runtime_hex": [value.hex() for value in sharp.runtime_bounded_pair],
195+
"observed_eta": _fraction_text(
196+
sharp.exact_minimum_nonnegative_relative_defect_bound
197+
),
198+
"attains_uniform_bound": (
199+
sharp.exact_minimum_nonnegative_relative_defect_bound
200+
== certificate.exact_uniform_relative_defect_upper_bound
201+
),
202+
},
203+
"excluded_generalizations": {
204+
"general_metric_centered_input_centers": [
205+
_fraction_text(_weighted_center(pair))
206+
for pair in centered_inputs
207+
],
208+
"general_metric_centered_output_center": _fraction_text(
209+
_weighted_center(centered.runtime_bounded_pair)
210+
),
211+
"general_metric_centering_forward_invariant": False,
212+
"unit_lattice_runtime_output": [
213+
value.hex() for value in lattice.runtime_bounded_pair
214+
],
215+
"unit_lattice_forward_invariant": False,
216+
},
217+
}
218+
219+
220+
def main() -> None:
221+
print(json.dumps(build_report(run_protocol()), indent=2, allow_nan=False))
222+
223+
224+
if __name__ == "__main__":
225+
main()

‎examples/README.md‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,3 +151,15 @@ and finite post-certification share one outer graph transaction. The two returne
151151
certificates have independent finite provenance;
152152
neither certifies a later invocation, auxiliary-state stability, solver behavior
153153
or full TNFR stability.
154+
155+
`178_half_alpha_antisymmetric_remesh_class.py` certifies the first useful
156+
represented REMESH subclass with `0<alpha<1`. On ordered P2 support, fixed
157+
positive metric and delays, `alpha=1/2`, a symmetric hard interval containing
158+
`4*2^-1074`, and sufficient antisymmetric rows `(a,-a)`, the production map is
159+
forward invariant and has sharp uniform `eta=135/124`. The report exposes the
160+
analytic `sqrt(D)>=11*2^-1074` tail and the exact 6,615-candidate/3,890-admissible
161+
finite core, whose maximizer is `(-3,-2,-3)`. It then composes `q=4/9` into
162+
`q_eff=259/279` with margin `20/279`, records the zero-margin boundary
163+
`q=124/259`, and shows why general metric-centered rows and a fixed unit lattice
164+
are outside the class. It does not certify a schedule implementation, graph or
165+
event execution, repeated complete-runtime behavior or future stability.

‎src/tnfr/physics/__init__.py‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@
8484
binary64_remesh_relative_defect : Exact runtime-rounding boundary
8585
- Replays one production pair and exposes its signed relative defect
8686
- Certifies the alpha=1 bounded hard-clip REMESH-only class with eta=0
87+
- Certifies the sharp alpha=1/2 antisymmetric P2 class with eta=135/124
8788
- Excludes schedule families, repeated execution and future behavior
8889
binary64_p2_reception_stability : Global restricted P2 kernel composition
8990
- Half-Reception sends every finite represented pair in its interval to consensus
@@ -545,7 +546,9 @@
545546
from .binary64_remesh_relative_defect import (
546547
Binary64RemeshPairRelativeDefectObservation,
547548
UniformAlphaOneHardClipRemeshClassCertificate,
549+
UniformHalfAlphaAntisymmetricHardClipRemeshClassCertificate,
548550
certify_alpha_one_hard_clip_remesh_class,
551+
certify_half_alpha_antisymmetric_hard_clip_remesh_class,
549552
observe_binary64_remesh_pair_relative_defect,
550553
)
551554
from .binary64_p2_reception_stability import (
@@ -905,7 +908,9 @@
905908
# --- Exact binary64 REMESH relative-defect boundary ---
906909
"Binary64RemeshPairRelativeDefectObservation",
907910
"UniformAlphaOneHardClipRemeshClassCertificate",
911+
"UniformHalfAlphaAntisymmetricHardClipRemeshClassCertificate",
908912
"certify_alpha_one_hard_clip_remesh_class",
913+
"certify_half_alpha_antisymmetric_hard_clip_remesh_class",
909914
"observe_binary64_remesh_pair_relative_defect",
910915
# --- Global binary64 P2 half-Reception/REMESH kernel family ---
911916
"P2HalfReceptionRemeshStabilityCertificate",

0 commit comments

Comments
 (0)