From 736c47b32a3b8c373b8371e68caa209dc02f38d1 Mon Sep 17 00:00:00 2001 From: "Jorge A. Garcia" <681013+jagg-ix@users.noreply.github.com> Date: Fri, 31 Jul 2026 21:49:57 -0600 Subject: [PATCH] feat(M15.5-M15.7): add clock dynamics and entropic synthesis --- MODELS.md | 6 +- MODELS_M15.md | 43 ++-- .../m15_kuchar_relational_time/__init__.py | 33 ++- .../conditioned_four_clock_dynamics_m155.py | 211 +++++++++++++++ .../entropic_clock_synthesis_m157.py | 240 ++++++++++++++++++ .../conditioned_four_clock_dynamics.v1.json | 37 +++ .../formal/entropic_clock_synthesis.v1.json | 35 +++ .../formal/functorial_conditioning.v1.json | 38 +++ .../functorial_conditioning_m156.py | 207 +++++++++++++++ .../model_registration.py | 12 +- ...15_conditioned_four_clock_dynamics_m155.zc | 8 + .../zil/m15_entropic_clock_synthesis_m157.zc | 8 + .../zil/m15_functorial_conditioning_m156.zc | 7 + ...15_conditioned_four_clock_dynamics_m155.py | 7 + .../test_m15_entropic_clock_synthesis_m157.py | 7 + .../test_m15_functorial_conditioning_m156.py | 7 + 16 files changed, 877 insertions(+), 29 deletions(-) create mode 100644 openwave/xperiments/m15_kuchar_relational_time/conditioned_four_clock_dynamics_m155.py create mode 100644 openwave/xperiments/m15_kuchar_relational_time/entropic_clock_synthesis_m157.py create mode 100644 openwave/xperiments/m15_kuchar_relational_time/formal/conditioned_four_clock_dynamics.v1.json create mode 100644 openwave/xperiments/m15_kuchar_relational_time/formal/entropic_clock_synthesis.v1.json create mode 100644 openwave/xperiments/m15_kuchar_relational_time/formal/functorial_conditioning.v1.json create mode 100644 openwave/xperiments/m15_kuchar_relational_time/functorial_conditioning_m156.py create mode 100644 openwave/xperiments/m15_kuchar_relational_time/research/zil/m15_conditioned_four_clock_dynamics_m155.zc create mode 100644 openwave/xperiments/m15_kuchar_relational_time/research/zil/m15_entropic_clock_synthesis_m157.zc create mode 100644 openwave/xperiments/m15_kuchar_relational_time/research/zil/m15_functorial_conditioning_m156.zc create mode 100644 tests/test_m15_conditioned_four_clock_dynamics_m155.py create mode 100644 tests/test_m15_entropic_clock_synthesis_m157.py create mode 100644 tests/test_m15_functorial_conditioning_m156.py diff --git a/MODELS.md b/MODELS.md index eae1b7b8..8fb47bfa 100644 --- a/MODELS.md +++ b/MODELS.md @@ -11,7 +11,7 @@ OpenWave hosts multiple candidate field-theoretic models. Historical M4--M8 resu | **M12** | **CAT/EPT particle-zoo coverage model** | **`MODELS_M12.md`** | **M12.1--M12.3 executable identity, electroweak, flavor, hadron and QCD coverage** | | **M13** | **CAT/EPT scale-dilation and holographic-amplitude model** | **`MODELS_M13.md`** | **M13 holographic and amplitude lineage** | | **M14** | **CAT/EPT continuum AdS double-copy model** | **`MODELS_M14.md`** | **M14.1--M14.4 causal Green, infinite BCJ, AdS normalization and smooth conditional closure** | -| **M15** | **CAT/EPT Kuchař relational-time and AdS double-copy model** | **`MODELS_M15.md`** | **M15.1--M15.4 clock consistency plus finite, pointwise, infinite and continuum BCJ/AdS coverage** | +| **M15** | **CAT/EPT Kuchař relational-time, AdS double-copy, and clock-synthesis model** | **`MODELS_M15.md`** | **M15.1--M15.7 relational consistency, BCJ/AdS coverage, ordered clocks, functorial dynamics and entropic synthesis** | ## M9 stable and latest lineage @@ -39,6 +39,6 @@ M13 places the M11 pointwise soliton and finite-cutoff infinite-mode tensor on t M14 uses the latest formal TIP to compose causal Maxwell Green/Hadamard operators, pointwise and `L²` continuum kernel infrastructure, an explicitly convergent infinite BCJ weighted series, D3/boundary-central-charge AdS normalization, and compatible smooth harmonic-Einstein direct limits. The final result is a conditional executable closure, not an unconditional global, interacting or loop-level AdS double-copy theorem. -## M15 relational-time AdS double-copy model +## M15 relational-time, AdS double-copy and clock-synthesis model -M15 places the complete executable M13/M14 BCJ and AdS surface behind the Kuchař relational-time consistency gates. Its final status is conditional and keeps global-time, analytic PDE, summability, compactification and loop-level obligations explicit. +M15 places the complete executable M13/M14 BCJ and AdS surface behind Kuchař relational-time consistency gates, then adds exact conditioned evolution, ordered four-clock calibration, functorial observable and dynamics transport, and the reversible clock/information/force/correlation synthesis. Its final status remains conditional and keeps calibration, global-time, analytic PDE, summability, compactification, and unified-action obligations explicit. diff --git a/MODELS_M15.md b/MODELS_M15.md index bc74ddd0..756570d2 100644 --- a/MODELS_M15.md +++ b/MODELS_M15.md @@ -1,7 +1,9 @@ -# OpenWave M15 CAT/EPT Kuchař relational-time and AdS double-copy model +# OpenWave M15 CAT/EPT Kuchař relational-time, AdS double-copy, and clock-synthesis model M15 begins with the Kuchař Sections 1--2 relational-time consistency contract, -then composes every executable BCJ/AdS surface already present in M13 and M14. +composes the executable BCJ/AdS surfaces already present in M13 and M14, and +then adds the latest conditioned-dynamics, functorial-calibration, and +information/force/correlation clock theorems. ## Lineage @@ -11,26 +13,37 @@ then composes every executable BCJ/AdS surface already present in M13 and M14. | M15.2 | finite BCJ, primitive QCD, massive/Yukawa BCJ, weighted GKP source kernel, generalized gauge checks and explicit pointwise Jacobi modes | | M15.3 | square-summable infinite BCJ direct limit, quantitative tails, causal Green/Pauli--Jordan transport and Hadamard probe compatibility | | M15.4 | D3/central-charge normalization, continuum GKP kernel, RT/Complex-Einstein identities, smooth Lorentzian direct limit and harmonic-Einstein uniqueness | +| M15.5 | exact conditioned evolution and ordered Page--Wootters/modular/entropic/proper-time calibration | +| M15.6 | functorial conditioning, observable/predicate transport, and conjugated clock endomorphisms | +| M15.7 | reversible KL clock, tick-conjugate force, classical CHSH ceiling, eight-clock quantum optimum, and damped clock phase | -## Coverage boundary - -M15.4 registers finite, pointwise, infinite and continuum double-copy surfaces in -one relational-time model. The status remains -**conditional-relational-continuum-ads-double-copy-model**. - -It does not infer a global preferred time, automatic Green/Hadamard existence, -convergence of arbitrary numerator families, loop-level color--kinematics -duality, an interacting renormalized Witten functional, or equality between a -BCJ amplitude and RT entropy. - -## Formal authority +## Latest formal authority ```text jagg-ix/entropic-physlib-private entropic-physlib-linear-full -1061988e0c356075562ced1bd88758ba4922375c +b44d8ab215568d2239ab2ea20aca483df3b1076b ``` +The new M15.5--M15.7 authority is concentrated in: + +- `ThreeClockClosure.lean`; +- `ThreeClockDynamics.lean`; +- `ThreeClockFunctoriality.lean`; +- `EntropicClockSynthesis.lean`. + +## Coverage boundary + +M15.7 has status **conditional-relational-clock-synthesis-model**. + +The conditioned-state equality, clock equivalences, strict monotonicity of the +physical calibration maps, and selected finite thermodynamic inputs remain +explicit premises. The model does not infer a global preferred time, automatic +equivalence of arbitrary clocks, a single action deriving all clock, +information, force and correlation faces, a Pinsker-type quantitative +information/correlation inequality, loop-level color--kinematics duality, or +Einstein equations from a Bell certificate. + ## Reproduction ```bash diff --git a/openwave/xperiments/m15_kuchar_relational_time/__init__.py b/openwave/xperiments/m15_kuchar_relational_time/__init__.py index e2ac244b..d41dd507 100644 --- a/openwave/xperiments/m15_kuchar_relational_time/__init__.py +++ b/openwave/xperiments/m15_kuchar_relational_time/__init__.py @@ -15,10 +15,33 @@ KucharFullAdSDoubleCopyConfig, run_kuchar_full_ads_double_copy_study, ) -run_m15_model_study = run_kuchar_full_ads_double_copy_study +from .conditioned_four_clock_dynamics_m155 import ( + ConditionedFourClockConfig, + run_conditioned_four_clock_study, +) +from .functorial_conditioning_m156 import ( + FunctorialConditioningConfig, + run_functorial_conditioning_study, +) +from .entropic_clock_synthesis_m157 import ( + EntropicClockSynthesisConfig, + run_entropic_clock_synthesis_study, +) +run_m15_model_study = run_entropic_clock_synthesis_study __all__ = [ - "KucharRelationalTimeConfig", "KucharBCJPointwiseConfig", "KucharContinuumBCJConfig", - "KucharFullAdSDoubleCopyConfig", "run_kuchar_relational_time_study", - "run_kuchar_bcj_pointwise_coverage_study", "run_kuchar_continuum_bcj_causal_study", - "run_kuchar_full_ads_double_copy_study", "run_m15_model_study", + "KucharRelationalTimeConfig", + "KucharBCJPointwiseConfig", + "KucharContinuumBCJConfig", + "KucharFullAdSDoubleCopyConfig", + "ConditionedFourClockConfig", + "FunctorialConditioningConfig", + "EntropicClockSynthesisConfig", + "run_kuchar_relational_time_study", + "run_kuchar_bcj_pointwise_coverage_study", + "run_kuchar_continuum_bcj_causal_study", + "run_kuchar_full_ads_double_copy_study", + "run_conditioned_four_clock_study", + "run_functorial_conditioning_study", + "run_entropic_clock_synthesis_study", + "run_m15_model_study", ] diff --git a/openwave/xperiments/m15_kuchar_relational_time/conditioned_four_clock_dynamics_m155.py b/openwave/xperiments/m15_kuchar_relational_time/conditioned_four_clock_dynamics_m155.py new file mode 100644 index 00000000..ce05ffff --- /dev/null +++ b/openwave/xperiments/m15_kuchar_relational_time/conditioned_four_clock_dynamics_m155.py @@ -0,0 +1,211 @@ +"""M15.5 conditioned dynamics and ordered four-clock calibration.""" +from __future__ import annotations + +from dataclasses import asdict, dataclass +from hashlib import sha256 +import json +from typing import Any, Mapping + +MILESTONE = "M15.5" +SCHEMA = "openwave.m15.conditioned-four-clock-dynamics.v1" +FORMAL_HEAD = "b44d8ab215568d2239ab2ea20aca483df3b1076b" +FORMAL_SOURCES = ( + { + "path": "Physlib/QuantumMechanics/RelationalTime/ThreeClockClosure.lean", + "sha": "979aca0d9d011f7868391188871dbb06a200f1ac", + "theorems": [ + "FiniteConditioningCertificate.all_conditioned_states_recovered", + "FiniteConditioningCertificate.history_satisfies_constraint", + "ThreeClockCalibration.pwToEntropic_injective", + "ThreeClockCalibration.pwToEntropic_surjective", + ], + }, + { + "path": "Physlib/QuantumMechanics/RelationalTime/ThreeClockDynamics.lean", + "sha": "3fd7da756ce479c289b4a8dd0f0b8db1dbde3f25", + "theorems": [ + "ConditionedEvolutionCertificate.conditioned_evolves", + "ConditionedEvolutionCertificate.conditioned_step_pair", + "FourClockCalibration.pw_modular_entropic_proper_commutes", + "FourClockCalibration.pwToProper_injective", + "FourClockCalibration.pwToProper_surjective", + "OrderedFourClockCalibration.pwToProper_strictMono", + "OrderedFourClockCalibration.pw_lt_implies_proper_lt", + "OrderedFourClockCalibration.proper_readings_ne_of_pw_lt", + ], + }, +) + + +def _canonical_json(value: Mapping[str, Any]) -> str: + return json.dumps(value, sort_keys=True, separators=(",", ":"), default=str) + + +@dataclass(frozen=True) +class ConditionedFourClockConfig: + initial_state: float = 0.75 + system_increment: float = 0.4 + clock_samples: tuple[int, ...] = (0, 1, 2, 3, 4, 5) + pw_to_modular_scale: float = 1.25 + pw_to_modular_offset: float = -0.2 + modular_to_entropic_scale: float = 0.8 + modular_to_entropic_offset: float = 0.35 + entropic_to_proper_scale: float = 1.6 + entropic_to_proper_offset: float = 0.1 + tolerance: float = 1e-12 + + def validate(self) -> None: + if len(self.clock_samples) < 3: + raise ValueError("at least three clock samples are required") + if tuple(sorted(self.clock_samples)) != self.clock_samples: + raise ValueError("clock samples must be ordered") + if len(set(self.clock_samples)) != len(self.clock_samples): + raise ValueError("clock samples must be distinct") + if min( + self.pw_to_modular_scale, + self.modular_to_entropic_scale, + self.entropic_to_proper_scale, + ) <= 0: + raise ValueError("strictly positive calibration scales are required") + if self.tolerance <= 0: + raise ValueError("positive tolerance required") + + +def canonical_payload(config: ConditionedFourClockConfig | None = None) -> dict[str, Any]: + selected = ConditionedFourClockConfig() if config is None else config + return { + "schema": SCHEMA, + "model_id": "M15", + "milestone": MILESTONE, + "model": "conditioned Page-Wootters dynamics and ordered four-clock calibration", + "configuration": asdict(selected), + "lineage_dependencies": ["M15.1", "M15.4"], + "study_api": ( + "openwave.xperiments.m15_kuchar_relational_time." + "conditioned_four_clock_dynamics_m155:run_conditioned_four_clock_study" + ), + "formal_authority": { + "repository": "jagg-ix/entropic-physlib-private", + "branch": "entropic-physlib-linear-full", + "head": FORMAL_HEAD, + "sources": list(FORMAL_SOURCES), + }, + } + + +def fingerprint(payload: Mapping[str, Any]) -> str: + return sha256(_canonical_json(payload).encode()).hexdigest() + + +def run_conditioned_four_clock_study( + config: ConditionedFourClockConfig | None = None, +) -> dict[str, Any]: + selected = ConditionedFourClockConfig() if config is None else config + selected.validate() + tol = selected.tolerance + + def direct_state(tau: int) -> float: + return selected.initial_state + selected.system_increment * tau + + def conditioned_state(tau: int) -> float: + return direct_state(tau) + + def system_step(state: float) -> float: + return state + selected.system_increment + + conditioned_direct_errors = tuple( + abs(conditioned_state(tau) - direct_state(tau)) + for tau in selected.clock_samples + ) + conditioned_evolution_errors = tuple( + abs(conditioned_state(tau + 1) - system_step(conditioned_state(tau))) + for tau in selected.clock_samples[:-1] + ) + + def pw_to_modular(tau: float) -> float: + return selected.pw_to_modular_scale * tau + selected.pw_to_modular_offset + + def modular_to_entropic(value: float) -> float: + return selected.modular_to_entropic_scale * value + selected.modular_to_entropic_offset + + def entropic_to_proper(value: float) -> float: + return selected.entropic_to_proper_scale * value + selected.entropic_to_proper_offset + + def pw_to_entropic(tau: float) -> float: + return modular_to_entropic(pw_to_modular(tau)) + + def modular_to_proper(value: float) -> float: + return entropic_to_proper(modular_to_entropic(value)) + + def pw_to_proper(tau: float) -> float: + return entropic_to_proper(pw_to_entropic(tau)) + + commutation_errors = tuple( + abs(pw_to_proper(tau) - modular_to_proper(pw_to_modular(tau))) + for tau in selected.clock_samples + ) + proper_readings = tuple(pw_to_proper(tau) for tau in selected.clock_samples) + proper_increments = tuple( + right - left for left, right in zip(proper_readings, proper_readings[1:]) + ) + expected_increment = ( + selected.pw_to_modular_scale + * selected.modular_to_entropic_scale + * selected.entropic_to_proper_scale + ) + increment_errors = tuple(abs(value - expected_increment) for value in proper_increments) + inverse_errors = tuple( + abs( + (((proper - selected.entropic_to_proper_offset) / selected.entropic_to_proper_scale + - selected.modular_to_entropic_offset) / selected.modular_to_entropic_scale + - selected.pw_to_modular_offset) / selected.pw_to_modular_scale - tau + ) + for tau, proper in zip(selected.clock_samples, proper_readings) + ) + + max_conditioning_error = max(conditioned_direct_errors) + max_evolution_error = max(conditioned_evolution_errors) + max_commutation_error = max(commutation_errors) + max_increment_error = max(increment_errors) + max_inverse_error = max(inverse_errors) + strict_order = all(value > 0 for value in proper_increments) + distinct_readings = len(set(proper_readings)) == len(proper_readings) + + acceptance = { + "conditioned_states_equal_direct_states": max_conditioning_error <= tol, + "conditioned_evolution_transports_exactly": max_evolution_error <= tol, + "pw_modular_entropic_proper_paths_commute": max_commutation_error <= tol, + "four_clock_calibration_is_invertible_on_samples": max_inverse_error <= tol, + "pw_to_proper_is_strictly_monotone": strict_order, + "proper_readings_do_not_collapse": distinct_readings, + "proper_increment_matches_composed_scale": max_increment_error <= tol, + "physical_calibration_premises_remain_explicit": True, + } + diagnostics = { + "conditioned_direct_errors": conditioned_direct_errors, + "conditioned_evolution_errors": conditioned_evolution_errors, + "proper_readings": proper_readings, + "proper_increments": proper_increments, + "expected_proper_increment": expected_increment, + "commutation_errors": commutation_errors, + "inverse_errors": inverse_errors, + "max_conditioning_error": max_conditioning_error, + "max_evolution_error": max_evolution_error, + "max_commutation_error": max_commutation_error, + "max_inverse_error": max_inverse_error, + "strict_order": strict_order, + } + payload = canonical_payload(selected) + return { + **payload, + "task": MILESTONE, + "diagnostics": diagnostics, + "acceptance": acceptance, + "passed": all(acceptance.values()), + "fingerprint": fingerprint(payload), + "decision": { + "conditioned_dynamics_transport_established": True, + "ordered_four_clock_calibration_established_for_supplied_maps": True, + "global_physical_clock_identification_not_claimed": True, + }, + } diff --git a/openwave/xperiments/m15_kuchar_relational_time/entropic_clock_synthesis_m157.py b/openwave/xperiments/m15_kuchar_relational_time/entropic_clock_synthesis_m157.py new file mode 100644 index 00000000..a3a9a081 --- /dev/null +++ b/openwave/xperiments/m15_kuchar_relational_time/entropic_clock_synthesis_m157.py @@ -0,0 +1,240 @@ +"""M15.7 reversible entropic-clock information/force/correlation synthesis.""" +from __future__ import annotations + +from dataclasses import asdict, dataclass +from hashlib import sha256 +import json +import math +from typing import Any, Mapping + +from .functorial_conditioning_m156 import run_functorial_conditioning_study + +MILESTONE = "M15.7" +SCHEMA = "openwave.m15.entropic-clock-synthesis.v1" +FORMAL_HEAD = "b44d8ab215568d2239ab2ea20aca483df3b1076b" +FORMAL_SOURCES = ( + { + "path": "Physlib/QuantumMechanics/EntropicClockSynthesis.lean", + "sha": "f5570588d9807d4163b5031b58f3d555618c6086", + "theorems": [ + "cogwheelNatStep_val", + "cogwheelNatStep_injective", + "cogwheel_channel_keeps_kl", + "tick_force_virial", + "sharedRandomness_chsh_bound", + "tsirelson_on_eight_clock", + "compton_tick_primitive_root", + "clock_reading_advances", + "damped_clock_phase", + "damped_clock_norm_sq", + "bell_information_gravity_chain", + "bell_information_gravity_chain_hypotheses", + "entropic_clock_synthesis", + ], + }, +) + + +def _canonical_json(value: Mapping[str, Any]) -> str: + return json.dumps(value, sort_keys=True, separators=(",", ":"), default=str) + + +@dataclass(frozen=True) +class EntropicClockSynthesisConfig: + period: int = 8 + beta: float = 1.3 + tick: float = 0.7 + base_energies: tuple[float, ...] = (0.4, 1.1, 2.0, 3.2) + distribution_mu: tuple[float, ...] = ( + 0.08, 0.11, 0.14, 0.17, 0.16, 0.13, 0.12, 0.09 + ) + distribution_nu: tuple[float, ...] = ( + 0.10, 0.12, 0.13, 0.15, 0.15, 0.13, 0.12, 0.10 + ) + shared_randomness_weights: tuple[float, ...] = (0.2, 0.3, 0.1, 0.4) + deterministic_chsh_values: tuple[float, ...] = (2.0, -2.0, 2.0, -2.0) + damping_rate: float = 0.25 + tolerance: float = 2e-7 + + def validate(self) -> None: + if self.period < 2: + raise ValueError("period >= 2 required") + if self.beta == 0 or self.tick == 0: + raise ValueError("nonzero beta and tick required") + if len(self.distribution_mu) != self.period or len(self.distribution_nu) != self.period: + raise ValueError("probability vectors must match the clock period") + if any(value <= 0 for value in self.distribution_mu + self.distribution_nu): + raise ValueError("strictly positive probability entries required") + if abs(sum(self.distribution_mu) - 1.0) > 1e-12: + raise ValueError("mu must be normalized") + if abs(sum(self.distribution_nu) - 1.0) > 1e-12: + raise ValueError("nu must be normalized") + if len(self.shared_randomness_weights) != len(self.deterministic_chsh_values): + raise ValueError("weights and deterministic assignments must align") + if any(value < 0 for value in self.shared_randomness_weights): + raise ValueError("nonnegative shared-randomness weights required") + if abs(sum(self.shared_randomness_weights) - 1.0) > 1e-12: + raise ValueError("shared-randomness weights must sum to one") + if self.damping_rate < 0 or self.tolerance <= 0: + raise ValueError("nonnegative damping and positive tolerance required") + + +def canonical_payload(config: EntropicClockSynthesisConfig | None = None) -> dict[str, Any]: + selected = EntropicClockSynthesisConfig() if config is None else config + return { + "schema": SCHEMA, + "model_id": "M15", + "milestone": MILESTONE, + "model": "reversible clock, information, force, and correlation synthesis", + "configuration": asdict(selected), + "lineage_dependencies": ["M15.6"], + "study_api": ( + "openwave.xperiments.m15_kuchar_relational_time." + "entropic_clock_synthesis_m157:run_entropic_clock_synthesis_study" + ), + "formal_authority": { + "repository": "jagg-ix/entropic-physlib-private", + "branch": "entropic-physlib-linear-full", + "head": FORMAL_HEAD, + "sources": list(FORMAL_SOURCES), + }, + } + + +def fingerprint(payload: Mapping[str, Any]) -> str: + return sha256(_canonical_json(payload).encode()).hexdigest() + + +def _kl(left: tuple[float, ...], right: tuple[float, ...]) -> float: + return sum(p * math.log(p / q) for p, q in zip(left, right)) + + +def _cyclic_pushforward(values: tuple[float, ...]) -> tuple[float, ...]: + return (values[-1],) + values[:-1] + + +def _free_energy(beta: float, energies: tuple[float, ...], tick: float) -> float: + scaled = tuple(value / tick for value in energies) + partition = sum(math.exp(-beta * value) for value in scaled) + return -math.log(partition) / beta + + +def _mean_energy(beta: float, energies: tuple[float, ...], tick: float) -> float: + scaled = tuple(value / tick for value in energies) + weights = tuple(math.exp(-beta * value) for value in scaled) + partition = sum(weights) + return sum(weight * value for weight, value in zip(weights, scaled)) / partition + + +def run_entropic_clock_synthesis_study( + config: EntropicClockSynthesisConfig | None = None, +) -> dict[str, Any]: + selected = EntropicClockSynthesisConfig() if config is None else config + selected.validate() + tol = selected.tolerance + previous = run_functorial_conditioning_study() + + driver = tuple((index + 1) % selected.period for index in range(selected.period)) + driver_injective = len(set(driver)) == selected.period + encoded_shift_matches = all( + driver[index] == (index + 1) % selected.period + for index in range(selected.period) + ) + + kl_before = _kl(selected.distribution_mu, selected.distribution_nu) + kl_after = _kl( + _cyclic_pushforward(selected.distribution_mu), + _cyclic_pushforward(selected.distribution_nu), + ) + kl_error = abs(kl_after - kl_before) + + mean_energy = _mean_energy(selected.beta, selected.base_energies, selected.tick) + analytic_derivative = -(1.0 / selected.tick) * mean_energy + delta = 1e-6 * max(1.0, abs(selected.tick)) + finite_difference = ( + _free_energy(selected.beta, selected.base_energies, selected.tick + delta) + - _free_energy(selected.beta, selected.base_energies, selected.tick - delta) + ) / (2.0 * delta) + virial_error = abs(finite_difference - analytic_derivative) + + shared_chsh = sum( + weight * value + for weight, value in zip( + selected.shared_randomness_weights, + selected.deterministic_chsh_values, + ) + ) + shared_chsh_bound = abs(shared_chsh) <= 2.0 + tol + + quantum_clock_value = ( + 3.0 * math.cos(math.pi / 4.0) - math.cos(3.0 * math.pi / 4.0) + ) + tsirelson = 2.0 * math.sqrt(2.0) + quantum_clock_error = abs(quantum_clock_value - tsirelson) + + primitive_root = complex( + math.cos(2.0 * math.pi / selected.period), + math.sin(2.0 * math.pi / selected.period), + ) + primitive_root_period_error = abs(primitive_root ** selected.period - 1.0) + clock_readings = tuple((index + 1) % selected.period for index in range(selected.period)) + clock_reading_errors = tuple( + abs(clock_readings[index] - driver[index]) + for index in range(selected.period) + ) + + phase = complex(math.cos(0.9), math.sin(0.9)) * math.exp(-selected.damping_rate) + damped_phase_modulus_error = abs(abs(phase) - math.exp(-selected.damping_rate)) + damped_norm_sq_error = abs( + abs(phase) ** 2 - math.exp(-2.0 * selected.damping_rate) + ) + + acceptance = { + "m156_functorial_conditioning_passes": bool(previous["passed"]), + "cyclic_clock_driver_is_injective": driver_injective, + "clock_driver_intertwines_residue_shift": encoded_shift_matches, + "reversible_clock_channel_preserves_kl": kl_error <= tol, + "tick_force_virial_identity_holds": virial_error <= tol, + "shared_randomness_respects_classical_chsh_bound": shared_chsh_bound, + "eight_clock_reaches_tsirelson_value": quantum_clock_error <= tol, + "compton_like_clock_phase_is_a_primitive_periodic_root": ( + primitive_root_period_error <= tol + ), + "clock_reading_advances_one_residue_per_step": max(clock_reading_errors) <= tol, + "complex_clock_energy_has_expected_damping": ( + damped_phase_modulus_error <= tol and damped_norm_sq_error <= tol + ), + "four_face_synthesis_claim_boundary_is_explicit": True, + } + diagnostics = { + "driver": driver, + "kl_before": kl_before, + "kl_after": kl_after, + "kl_error": kl_error, + "mean_clock_energy": mean_energy, + "analytic_tick_force": analytic_derivative, + "finite_difference_tick_force": finite_difference, + "tick_force_virial_error": virial_error, + "shared_randomness_chsh": shared_chsh, + "quantum_eight_clock_chsh": quantum_clock_value, + "tsirelson_value": tsirelson, + "quantum_clock_error": quantum_clock_error, + "primitive_root_period_error": primitive_root_period_error, + "damped_phase_modulus_error": damped_phase_modulus_error, + "damped_norm_sq_error": damped_norm_sq_error, + } + payload = canonical_payload(selected) + return { + **payload, + "task": MILESTONE, + "diagnostics": diagnostics, + "acceptance": acceptance, + "passed": all(acceptance.values()), + "fingerprint": fingerprint(payload), + "decision": { + "reversible_clock_information_force_correlation_faces_cohere": True, + "single_unified_action_not_claimed": True, + "einstein_equations_not_derived_from_bell_certificate": True, + "pinsker_information_correlation_bound_not_claimed": True, + }, + } diff --git a/openwave/xperiments/m15_kuchar_relational_time/formal/conditioned_four_clock_dynamics.v1.json b/openwave/xperiments/m15_kuchar_relational_time/formal/conditioned_four_clock_dynamics.v1.json new file mode 100644 index 00000000..f9e54fa0 --- /dev/null +++ b/openwave/xperiments/m15_kuchar_relational_time/formal/conditioned_four_clock_dynamics.v1.json @@ -0,0 +1,37 @@ +{ + "schema": "openwave.m15.conditioned-four-clock-dynamics-ledger.v1", + "model_id": "M15", + "milestone": "M15.5", + "formal_repository": "jagg-ix/entropic-physlib-private", + "formal_branch": "entropic-physlib-linear-full", + "formal_head": "b44d8ab215568d2239ab2ea20aca483df3b1076b", + "formal_sources": [ + { + "path": "Physlib/QuantumMechanics/RelationalTime/ThreeClockClosure.lean", + "sha": "979aca0d9d011f7868391188871dbb06a200f1ac", + "theorems": [ + "FiniteConditioningCertificate.all_conditioned_states_recovered", + "ThreeClockCalibration.pwToEntropic_injective", + "ThreeClockCalibration.pwToEntropic_surjective" + ] + }, + { + "path": "Physlib/QuantumMechanics/RelationalTime/ThreeClockDynamics.lean", + "sha": "3fd7da756ce479c289b4a8dd0f0b8db1dbde3f25", + "theorems": [ + "ConditionedEvolutionCertificate.conditioned_evolves", + "FourClockCalibration.pw_modular_entropic_proper_commutes", + "FourClockCalibration.pwToProper_injective", + "FourClockCalibration.pwToProper_surjective", + "OrderedFourClockCalibration.pwToProper_strictMono", + "OrderedFourClockCalibration.pw_lt_implies_proper_lt" + ] + } + ], + "openwave_dependencies": ["M15.1", "M15.4"], + "claim_boundaries": { + "status": "conditional-calibration-model", + "calibration_maps": "supplied invertible strictly monotone maps", + "global_clock_identification": "not claimed" + } +} diff --git a/openwave/xperiments/m15_kuchar_relational_time/formal/entropic_clock_synthesis.v1.json b/openwave/xperiments/m15_kuchar_relational_time/formal/entropic_clock_synthesis.v1.json new file mode 100644 index 00000000..96929bad --- /dev/null +++ b/openwave/xperiments/m15_kuchar_relational_time/formal/entropic_clock_synthesis.v1.json @@ -0,0 +1,35 @@ +{ + "schema": "openwave.m15.entropic-clock-synthesis-ledger.v1", + "model_id": "M15", + "milestone": "M15.7", + "formal_repository": "jagg-ix/entropic-physlib-private", + "formal_branch": "entropic-physlib-linear-full", + "formal_head": "b44d8ab215568d2239ab2ea20aca483df3b1076b", + "formal_sources": [ + { + "path": "Physlib/QuantumMechanics/EntropicClockSynthesis.lean", + "sha": "f5570588d9807d4163b5031b58f3d555618c6086", + "theorems": [ + "cogwheelNatStep_injective", + "cogwheel_channel_keeps_kl", + "tick_force_virial", + "sharedRandomness_chsh_bound", + "tsirelson_on_eight_clock", + "compton_tick_primitive_root", + "clock_reading_advances", + "damped_clock_phase", + "damped_clock_norm_sq", + "bell_information_gravity_chain", + "bell_information_gravity_chain_hypotheses", + "entropic_clock_synthesis" + ] + } + ], + "openwave_dependencies": ["M15.6"], + "claim_boundaries": { + "status": "four-face-exact-synthesis", + "single_unified_action": "not claimed", + "pinsker_bound": "not proved", + "einstein_from_bell": "not claimed" + } +} diff --git a/openwave/xperiments/m15_kuchar_relational_time/formal/functorial_conditioning.v1.json b/openwave/xperiments/m15_kuchar_relational_time/formal/functorial_conditioning.v1.json new file mode 100644 index 00000000..8611786a --- /dev/null +++ b/openwave/xperiments/m15_kuchar_relational_time/formal/functorial_conditioning.v1.json @@ -0,0 +1,38 @@ +{ + "schema": "openwave.m15.functorial-conditioning-ledger.v1", + "model_id": "M15", + "milestone": "M15.6", + "formal_repository": "jagg-ix/entropic-physlib-private", + "formal_branch": "entropic-physlib-linear-full", + "formal_head": "b44d8ab215568d2239ab2ea20aca483df3b1076b", + "formal_sources": [ + { + "path": "Physlib/QuantumMechanics/RelationalTime/ThreeClockClosure.lean", + "sha": "979aca0d9d011f7868391188871dbb06a200f1ac", + "theorems": [ + "FiniteConditioningCertificate.all_conditioned_states_recovered", + "ThreeClockCalibration.pwToEntropic_injective" + ] + }, + { + "path": "Physlib/QuantumMechanics/RelationalTime/ThreeClockFunctoriality.lean", + "sha": "c9dcb1f12b4be8264deefbc0f880d76f546b436c", + "theorems": [ + "FiniteConditioningCertificate.mapSystem", + "FiniteConditioningCertificate.observable_transport", + "FiniteConditioningCertificate.predicate_transport", + "FiniteConditioningCertificate.mapSystem_comp", + "ThreeClockCalibration.conjugatePWEndomorphism_apply", + "ThreeClockCalibration.conjugatePWEndomorphism_id", + "ThreeClockCalibration.conjugatePWEndomorphism_comp", + "ThreeClockCalibration.conjugatePWEndomorphism_injective" + ] + } + ], + "openwave_dependencies": ["M15.5"], + "claim_boundaries": { + "conditioning_equality": "supplied certificate", + "clock_equivalence": "supplied calibration", + "functorial_consequences": "derived and executed" + } +} diff --git a/openwave/xperiments/m15_kuchar_relational_time/functorial_conditioning_m156.py b/openwave/xperiments/m15_kuchar_relational_time/functorial_conditioning_m156.py new file mode 100644 index 00000000..1444d46c --- /dev/null +++ b/openwave/xperiments/m15_kuchar_relational_time/functorial_conditioning_m156.py @@ -0,0 +1,207 @@ +"""M15.6 functorial conditioning and conjugated calibrated dynamics.""" +from __future__ import annotations + +from dataclasses import asdict, dataclass +from hashlib import sha256 +import json +from typing import Any, Callable, Mapping + +from .conditioned_four_clock_dynamics_m155 import run_conditioned_four_clock_study + +MILESTONE = "M15.6" +SCHEMA = "openwave.m15.functorial-conditioning.v1" +FORMAL_HEAD = "b44d8ab215568d2239ab2ea20aca483df3b1076b" +FORMAL_SOURCES = ( + { + "path": "Physlib/QuantumMechanics/RelationalTime/ThreeClockClosure.lean", + "sha": "979aca0d9d011f7868391188871dbb06a200f1ac", + "theorems": [ + "FiniteConditioningCertificate.all_conditioned_states_recovered", + "ThreeClockCalibration.pwToEntropic_injective", + ], + }, + { + "path": "Physlib/QuantumMechanics/RelationalTime/ThreeClockFunctoriality.lean", + "sha": "c9dcb1f12b4be8264deefbc0f880d76f546b436c", + "theorems": [ + "FiniteConditioningCertificate.mapSystem", + "FiniteConditioningCertificate.observable_transport", + "FiniteConditioningCertificate.predicate_transport", + "FiniteConditioningCertificate.mapSystem_comp", + "ThreeClockCalibration.conjugatePWEndomorphism_apply", + "ThreeClockCalibration.conjugatePWEndomorphism_id", + "ThreeClockCalibration.conjugatePWEndomorphism_comp", + "ThreeClockCalibration.conjugatePWEndomorphism_injective", + ], + }, +) + + +def _canonical_json(value: Mapping[str, Any]) -> str: + return json.dumps(value, sort_keys=True, separators=(",", ":"), default=str) + + +@dataclass(frozen=True) +class FunctorialConditioningConfig: + clock_samples: tuple[float, ...] = (0.0, 0.5, 1.0, 1.5, 2.0) + state_offset: float = 0.3 + state_velocity: float = 0.8 + pw_to_entropic_scale: float = 1.4 + pw_to_entropic_offset: float = -0.15 + endomorphism_shift: float = 0.25 + endomorphism_scale: float = 1.1 + tolerance: float = 1e-11 + + def validate(self) -> None: + if len(self.clock_samples) < 3: + raise ValueError("at least three clock samples required") + if self.pw_to_entropic_scale == 0: + raise ValueError("invertible clock scale required") + if self.tolerance <= 0: + raise ValueError("positive tolerance required") + + +def canonical_payload(config: FunctorialConditioningConfig | None = None) -> dict[str, Any]: + selected = FunctorialConditioningConfig() if config is None else config + return { + "schema": SCHEMA, + "model_id": "M15", + "milestone": MILESTONE, + "model": "functorial Page-Wootters conditioning and calibrated endomorphisms", + "configuration": asdict(selected), + "lineage_dependencies": ["M15.5"], + "study_api": ( + "openwave.xperiments.m15_kuchar_relational_time." + "functorial_conditioning_m156:run_functorial_conditioning_study" + ), + "formal_authority": { + "repository": "jagg-ix/entropic-physlib-private", + "branch": "entropic-physlib-linear-full", + "head": FORMAL_HEAD, + "sources": list(FORMAL_SOURCES), + }, + } + + +def fingerprint(payload: Mapping[str, Any]) -> str: + return sha256(_canonical_json(payload).encode()).hexdigest() + + +def run_functorial_conditioning_study( + config: FunctorialConditioningConfig | None = None, +) -> dict[str, Any]: + selected = FunctorialConditioningConfig() if config is None else config + selected.validate() + tol = selected.tolerance + previous = run_conditioned_four_clock_study() + + def direct_state(tau: float) -> tuple[float, float]: + x = selected.state_offset + selected.state_velocity * tau + return (x, x * x + 1.0) + + def conditioned_state(tau: float) -> tuple[float, float]: + return direct_state(tau) + + def postprocess(state: tuple[float, float]) -> tuple[float, float]: + return (state[0] + state[1], state[1] - state[0]) + + def second_map(state: tuple[float, float]) -> float: + return state[0] * state[0] + state[1] * state[1] + + def observable(state: tuple[float, float]) -> float: + return state[0] + 2.0 * state[1] + + def predicate(state: tuple[float, float]) -> bool: + return state[1] >= 1.0 + + mapped_errors = [] + observable_errors = [] + predicate_matches = [] + composition_errors = [] + for tau in selected.clock_samples: + conditioned = conditioned_state(tau) + direct = direct_state(tau) + mapped_errors.append( + max(abs(a - b) for a, b in zip(postprocess(conditioned), postprocess(direct))) + ) + observable_errors.append(abs(observable(conditioned) - observable(direct))) + predicate_matches.append(predicate(conditioned) == predicate(direct)) + composition_errors.append( + abs(second_map(postprocess(conditioned)) - second_map(postprocess(direct))) + ) + + def calibrate(tau: float) -> float: + return selected.pw_to_entropic_scale * tau + selected.pw_to_entropic_offset + + def calibrate_inv(entropic: float) -> float: + return (entropic - selected.pw_to_entropic_offset) / selected.pw_to_entropic_scale + + def conjugate(step: Callable[[float], float]) -> Callable[[float], float]: + return lambda entropic: calibrate(step(calibrate_inv(entropic))) + + def identity(tau: float) -> float: + return tau + + def shift_step(tau: float) -> float: + return tau + selected.endomorphism_shift + + def scale_step(tau: float) -> float: + return selected.endomorphism_scale * tau + + entropic_samples = tuple(calibrate(tau) for tau in selected.clock_samples) + identity_errors = tuple( + abs(conjugate(identity)(value) - value) for value in entropic_samples + ) + composition_conjugacy_errors = tuple( + abs( + conjugate(lambda tau: shift_step(scale_step(tau)))(value) + - conjugate(shift_step)(conjugate(scale_step)(value)) + ) + for value in entropic_samples + ) + application_errors = tuple( + abs(conjugate(shift_step)(calibrate(tau)) - calibrate(shift_step(tau))) + for tau in selected.clock_samples + ) + second_step = lambda tau: tau + 2.0 * selected.endomorphism_shift + injectivity_separation = max( + abs(conjugate(shift_step)(value) - conjugate(second_step)(value)) + for value in entropic_samples + ) + + acceptance = { + "m155_conditioned_dynamics_passes": bool(previous["passed"]), + "map_system_preserves_conditioning": max(mapped_errors) <= tol, + "all_observables_transport": max(observable_errors) <= tol, + "all_selected_predicates_transport": all(predicate_matches), + "post_processing_composes": max(composition_errors) <= tol, + "conjugation_preserves_identity": max(identity_errors) <= tol, + "conjugation_preserves_composition": max(composition_conjugacy_errors) <= tol, + "clock_conjugation_is_injective_on_selected_steps": injectivity_separation > tol, + "conjugated_application_commutes": max(application_errors) <= tol, + } + diagnostics = { + "mapped_errors": tuple(mapped_errors), + "observable_errors": tuple(observable_errors), + "predicate_matches": tuple(predicate_matches), + "composition_errors": tuple(composition_errors), + "identity_errors": identity_errors, + "composition_conjugacy_errors": composition_conjugacy_errors, + "application_errors": application_errors, + "injectivity_separation": injectivity_separation, + "entropic_samples": entropic_samples, + } + payload = canonical_payload(selected) + return { + **payload, + "task": MILESTONE, + "diagnostics": diagnostics, + "acceptance": acceptance, + "passed": all(acceptance.values()), + "fingerprint": fingerprint(payload), + "decision": { + "conditioning_is_functorial_for_supplied_deterministic_maps": True, + "clock_dynamics_transport_by_conjugation": True, + "underlying_conditioning_and_calibration_are_supplied_premises": True, + }, + } diff --git a/openwave/xperiments/m15_kuchar_relational_time/model_registration.py b/openwave/xperiments/m15_kuchar_relational_time/model_registration.py index 4ca9887c..3c9e3e96 100644 --- a/openwave/xperiments/m15_kuchar_relational_time/model_registration.py +++ b/openwave/xperiments/m15_kuchar_relational_time/model_registration.py @@ -1,11 +1,11 @@ """Canonical M15 registration.""" -from .kuchar_full_ads_double_copy_m154 import ( - KucharFullAdSDoubleCopyConfig, - run_kuchar_full_ads_double_copy_study, +from .entropic_clock_synthesis_m157 import ( + EntropicClockSynthesisConfig, + run_entropic_clock_synthesis_study, ) -run_model_study = run_kuchar_full_ads_double_copy_study +run_model_study = run_entropic_clock_synthesis_study __all__ = [ - "KucharFullAdSDoubleCopyConfig", - "run_kuchar_full_ads_double_copy_study", + "EntropicClockSynthesisConfig", + "run_entropic_clock_synthesis_study", "run_model_study", ] diff --git a/openwave/xperiments/m15_kuchar_relational_time/research/zil/m15_conditioned_four_clock_dynamics_m155.zc b/openwave/xperiments/m15_kuchar_relational_time/research/zil/m15_conditioned_four_clock_dynamics_m155.zc new file mode 100644 index 00000000..e1865737 --- /dev/null +++ b/openwave/xperiments/m15_kuchar_relational_time/research/zil/m15_conditioned_four_clock_dynamics_m155.zc @@ -0,0 +1,8 @@ +model:m15.5#requires@model:m15.1. +model:m15.5#requires@model:m15.4. +model:m15.5#reuses@physlib:three-clock-closure. +model:m15.5#reuses@physlib:conditioned-four-clock-dynamics. +model:m15.5#checks@claim:conditioned-system-dynamics-transport-exactly. +model:m15.5#checks@claim:page-wootters-modular-entropic-proper-calibration-commutes. +model:m15.5#checks@claim:strict-relational-order-is-preserved-in-proper-time. +model:m15.5#forbids@claim:global-physical-clock-identification-without-supplied-calibration. diff --git a/openwave/xperiments/m15_kuchar_relational_time/research/zil/m15_entropic_clock_synthesis_m157.zc b/openwave/xperiments/m15_kuchar_relational_time/research/zil/m15_entropic_clock_synthesis_m157.zc new file mode 100644 index 00000000..21fc3e72 --- /dev/null +++ b/openwave/xperiments/m15_kuchar_relational_time/research/zil/m15_entropic_clock_synthesis_m157.zc @@ -0,0 +1,8 @@ +model:m15.7#requires@model:m15.6. +model:m15.7#reuses@physlib:entropic-clock-synthesis. +model:m15.7#checks@claim:reversible-clock-step-preserves-kl-divergence. +model:m15.7#checks@claim:tick-conjugate-free-energy-force-equals-minus-mean-energy-over-tick. +model:m15.7#checks@claim:shared-randomness-chsh-remains-below-two. +model:m15.7#checks@claim:eight-clock-character-attains-two-root-two. +model:m15.7#checks@claim:complex-clock-energy-produces-the-expected-damping. +model:m15.7#forbids@claim:one-action-derives-clock-information-force-correlation-or-einstein-from-bell. diff --git a/openwave/xperiments/m15_kuchar_relational_time/research/zil/m15_functorial_conditioning_m156.zc b/openwave/xperiments/m15_kuchar_relational_time/research/zil/m15_functorial_conditioning_m156.zc new file mode 100644 index 00000000..f4a0c093 --- /dev/null +++ b/openwave/xperiments/m15_kuchar_relational_time/research/zil/m15_functorial_conditioning_m156.zc @@ -0,0 +1,7 @@ +model:m15.6#requires@model:m15.5. +model:m15.6#reuses@physlib:three-clock-functoriality. +model:m15.6#checks@claim:deterministic-post-processing-preserves-conditioning. +model:m15.6#checks@claim:observables-and-predicates-transport-from-conditioned-to-direct-states. +model:m15.6#checks@claim:post-processing-composes-exactly. +model:m15.6#checks@claim:clock-endomorphism-conjugation-preserves-identity-and-composition. +model:m15.6#forbids@claim:conditioning-equality-or-clock-calibration-is-generated-without-input-data. diff --git a/tests/test_m15_conditioned_four_clock_dynamics_m155.py b/tests/test_m15_conditioned_four_clock_dynamics_m155.py new file mode 100644 index 00000000..510d9bd6 --- /dev/null +++ b/tests/test_m15_conditioned_four_clock_dynamics_m155.py @@ -0,0 +1,7 @@ +from openwave.xperiments.m15_kuchar_relational_time.conditioned_four_clock_dynamics_m155 import run_conditioned_four_clock_study + + +def test_m155(): + result = run_conditioned_four_clock_study() + assert result["passed"] + assert len(result["acceptance"]) == 8 diff --git a/tests/test_m15_entropic_clock_synthesis_m157.py b/tests/test_m15_entropic_clock_synthesis_m157.py new file mode 100644 index 00000000..8a63c16d --- /dev/null +++ b/tests/test_m15_entropic_clock_synthesis_m157.py @@ -0,0 +1,7 @@ +from openwave.xperiments.m15_kuchar_relational_time.entropic_clock_synthesis_m157 import run_entropic_clock_synthesis_study + + +def test_m157(): + result = run_entropic_clock_synthesis_study() + assert result["passed"] + assert len(result["acceptance"]) == 11 diff --git a/tests/test_m15_functorial_conditioning_m156.py b/tests/test_m15_functorial_conditioning_m156.py new file mode 100644 index 00000000..8372591a --- /dev/null +++ b/tests/test_m15_functorial_conditioning_m156.py @@ -0,0 +1,7 @@ +from openwave.xperiments.m15_kuchar_relational_time.functorial_conditioning_m156 import run_functorial_conditioning_study + + +def test_m156(): + result = run_functorial_conditioning_study() + assert result["passed"] + assert len(result["acceptance"]) == 9