"""
dct_bd_frame_dictionary.py

Canonical resolution (May 2026, aligned with site DCT-BAO-01.tex + DCT-FND-V2):
---------------------------------------------------------------------------
For homogeneous FLRW with line element

    ds^2 = P(t) * (-dt^2 + a(t)^2 dchi^2 + ...),

radial null rays satisfy 0 = P(-dt^2 + a^2 dchi^2) => dchi/dt = 1/a.
The positive factor P(t) **drops out**. Therefore the comoving radial
coordinate chi = integral c*dt/a is **identical** to the inner metric
without P, given the same a(t) and H(z).

Consequences:
  * There is **no** homogeneous multiplicative rescaling D_M -> D_M/sqrt(P_0)
    **nor** D_M -> sqrt(P_0)*D_M for **standard photon BAO comoving rulers**
    derived from this null condition.
  * Legacy pipelines that multiplied D_M/r_d by 1/sqrt(P_0) or inserted
    sqrt(P) inside integral c/H dz **without** a separate physical derivation
    are **geometrically inconsistent** with the homogeneous ansatz ---
    they reproduce an audit archaeology number, not a prediction of the
    conformal ansatz.
  * Operational statements H_phys = H_E/sqrt(P_0) (matter-clock / Jordan
    prose in DCT-FND-V2) must be derived from **matter proper time** on
    tilde g = P g, **not** reverse-engineered into the photon null integral.

Exploratory scripts `bao_locally_varying_p.py` / `bao_transverse_condensate.py`
implement **non-null** ansätze (e.g. LOS averages) --- labelled exploratory,
not homogeneous-null predictions.

Run: python3 dct_bd_frame_dictionary.py
"""

from __future__ import annotations

import math


P_0 = 0.851


def main() -> None:
    sp = math.sqrt(P_0)
    isp = 1.0 / sp
    print("=" * 72)
    print("DCT BAO / frame dictionary — GEOMETRIC RESOLUTION (2026-05)")
    print("=" * 72)
    print()
    print("Homogeneous FLRW: ds^2 = P(t)(-dt^2 + a^2 dchi^2).")
    print("Radial null => dchi/dt = 1/a  (**P cancels**).")
    print("=> Standard photon comoving chi(z) = integral c dz'/H(z')")
    print("   matches LambdaCDM for the same H(z) — no sqrt(P_0) fudge factor.")
    print()
    print("Obsolete audit branches (do NOT use as homogeneous-null predictions):")
    print(f"  • D_M * {isp:.6f}  (+8.4%)   # legacy 1/sqrt(P_0) map — RETRACTED")
    print(f"  • D_M * {sp:.6f}  (-7.75%)  # exploratory sqrt(P) integral — not null geodesic")
    print()
    print("Live programme (per DCT-BAO-01, DCT-FND-V2):")
    print("  • Inhomogeneous P(x,t), disformal sectors, ray tracing.")
    print("  • Perturbation-level LCDM background + mu_b, mu_DM, Sigma kernels.")
    print("  • H_phys targets: derive from matter clocks; do not conflate with chi_null.")
    print("=" * 72)


if __name__ == "__main__":
    main()
