"""
Test 14: Compatibility with observed Lorentz-violation bounds

Test 11 showed that at naive leading order, the correlated prediction
η_LIV ~ 26|δw| puts the mechanism in tension with cosmological LIV
bounds by about 7 orders of magnitude.

Test 14 goes channel by channel through the main LIV observables and
asks: assuming the tension is real (Reading 1 of Test 11), which
channels rule out the mechanism first? And: is there any channel
for which the tension is small enough that Paper 2's prediction could
be an observational target rather than an excluded region?

LIV CHANNELS SURVEYED:

  1. Photon time-of-flight (GRB observations, Fermi LAT):
     quantum-gravity scale M_QG > ~10 M_Planck.
     
  2. Electron dispersion (vacuum Cherenkov, photon decay):
     ξ_e < 10^-16.
     
  3. Gravitational wave speed (GW170817):
     |c_gw - c|/c < 10^-15.
     
  4. PPN preferred-frame parameters (α_1, α_2, α_3):
     |α_1| < 10^-4 (lunar laser ranging),
     |α_2| < 10^-7 (solar alignment),
     |α_3| < 10^-20 (pulsar timing).
     
  5. CMB statistical isotropy:
     hemispheric asymmetry and quadrupole/octupole alignments consistent
     with fluctuations of order 10^-5 on horizon scales.

The question: which of these is the right comparison for cosmological-
scale thermal LIV, and is there any channel where |δw| ~ 0.05 (current
DE bound) is observationally allowed?
"""

import numpy as np

print("=" * 72)
print("TEST 14: Compatibility with LIV bounds (channel by channel)")
print("=" * 72)

# -------------------------------------------------------------------
# Channel-by-channel analysis
# -------------------------------------------------------------------

# Naive prediction: η_LIV = (8π^2/3)|δw| at leading order
# Observational DE bound: |δw| < 0.05
# Gives naive η_LIV ≲ 1.3

delta_w_DE_bound = 0.05
eta_LIV_naive = (8 * np.pi**2 / 3) * delta_w_DE_bound

print(f"""
SETUP:
  Observational DE bound:     |δw| < {delta_w_DE_bound}
  Naive LIV from correlation: η_LIV = {eta_LIV_naive:.2f}

  In what follows, "relevant channel?" asks whether the observable
  probes cosmological-scale, slow-time, thermal LIV — as opposed to
  high-energy, local, single-particle LIV.
""")

channels = [
    {
        "name": "Photon time-of-flight (GRB / Fermi)",
        "bound": "ξ_γ ≲ 10^-18 at E ~ GeV",
        "relevant": "NO",
        "why": "High-energy, single-particle dispersion effect. Probes\n"
               "LIV at microscopic scales, not cosmological thermal LIV.",
        "tension": "Not directly comparable. Cosmological thermal LIV\n"
                   "does not modify photon dispersion at fixed energy.",
    },
    {
        "name": "Electron dispersion (vacuum Cherenkov)",
        "bound": "ξ_e ≲ 10^-16",
        "relevant": "NO",
        "why": "Same comment — high-energy single-particle effect.",
        "tension": "Not a direct comparison.",
    },
    {
        "name": "Gravitational wave speed (GW170817)",
        "bound": "|c_gw - c|/c < 10^-15",
        "relevant": "PARTIAL",
        "why": "GW170817 probes propagation over ~40 Mpc, which is\n"
               "intermediate between local and cosmological. If thermal\n"
               "LIV modifies GW dispersion, this bound applies.",
        "tension": "If η_LIV translates directly to |δc_gw|/c ~ η_LIV\n"
                   "then prediction ~1 vs bound ~10^-15 is 15 orders\n"
                   "of magnitude too large. RULED OUT at this level.\n"
                   "BUT: the translation assumes LIV couples to GW\n"
                   "propagation. Thermal-state boost-breaking might\n"
                   "not. Needs a specific calculation.",
    },
    {
        "name": "PPN α_1 (frame dragging vs CMB rest frame)",
        "bound": "|α_1| ≲ 10^-4 (LLR)",
        "relevant": "YES",
        "why": "α_1 measures preferred-frame effects in local physics;\n"
               "any preferred frame (including a cosmological thermal\n"
               "rest frame) contributes.",
        "tension": "η_LIV ~ 1 translates to α_1 ~ 1 which is\n"
                   "4 orders of magnitude too large.",
    },
    {
        "name": "PPN α_2 (solar alignment)",
        "bound": "|α_2| ≲ 10^-7",
        "relevant": "YES",
        "why": "Same as α_1 but tighter.",
        "tension": "~7 orders of magnitude too large.",
    },
    {
        "name": "PPN α_3 (pulsar timing)",
        "bound": "|α_3| ≲ 10^-20",
        "relevant": "YES — TIGHTEST",
        "why": "Pulsar orbital dynamics in preferred frames.",
        "tension": "~20 orders of magnitude too large. Catastrophic if\n"
                   "the direct translation holds.",
    },
    {
        "name": "CMB isotropy / anomalies",
        "bound": "~10^-5 on horizon scales",
        "relevant": "YES — MOST DIRECT MATCH",
        "why": "This IS cosmological-scale, long-wavelength LIV. Any\n"
               "preferred cosmological frame (aside from CMB rest\n"
               "frame) would show up here.",
        "tension": "η_LIV ~ 1 vs ~10^-5 is 5 orders of magnitude too\n"
                   "large. But note: the CMB rest frame ITSELF is a\n"
                   "preferred frame — this is consistent with thermal\n"
                   "LIV at cosmological scales, IF the cosmological\n"
                   "thermal rest frame coincides with the CMB rest\n"
                   "frame (which is physically natural).",
    },
]

for ch in channels:
    print("-" * 72)
    print(f"CHANNEL: {ch['name']}")
    print(f"  Observational bound: {ch['bound']}")
    print(f"  Relevant to thermal cosmological LIV? {ch['relevant']}")
    print(f"  Why: {ch['why']}")
    print(f"  Tension with naive η_LIV: {ch['tension']}")

# -------------------------------------------------------------------
# Summary: is there any channel that survives?
# -------------------------------------------------------------------
print("""
================================================================
SUMMARY: Which channels survive?
================================================================

Channels that are NOT relevant (probe wrong kind of LIV):
  - Photon time-of-flight
  - Electron dispersion

Channels that ARE relevant but give tight bounds:
  - GW speed: ~15 orders tension (if translation is direct)
  - PPN α_1: ~4 orders
  - PPN α_2: ~7 orders  
  - PPN α_3: ~20 orders (tightest)
  - CMB isotropy: ~5 orders

ALL RELEVANT CHANNELS give tension of ≥4 orders of magnitude when
the naive η_LIV ~ 26|δw| is translated directly into the observable.

There is no relevant channel where the naive prediction survives.

================================================================
POSSIBLE ESCAPES
================================================================

Escape 1: The CMB rest frame coincidence.
  Physical observation: the CMB defines a preferred cosmic frame.
  Our motion relative to it is observed (~370 km/s dipole).
  This is NOT considered a Lorentz-violation — it's a cosmological
  boundary condition.
  
  If the brane's thermal rest frame coincides with the CMB rest
  frame, then the "preferred frame" of the thermal state is just
  the CMB rest frame, which is already factored out of PPN bounds.
  
  This is a legitimate escape, but it DOWNGRADES Paper 2's
  distinctive prediction — because the "cosmological LIV" now
  becomes "the CMB rest frame that everyone already accepts
  exists", which is not new physics.
  
  Verdict: escape works, but deflates the correlated prediction.

Escape 2: Suppression by a large scale.
  The naive translation η_LIV ~ 26|δw| assumes O(1) dimensionless
  coupling between thermal drift and observable LIV. If the actual
  coupling is suppressed by (some scale / M_Planck)^n for large n,
  the prediction can be driven below all bounds.
  
  Candidate suppression: (H / M_Planck)^k for some k. With
  H / M_Planck ~ 10^-60, even k = 0.1 gives a factor of 10^-6,
  enough to escape most bounds.
  
  But this is HIGHLY AD HOC — we'd be writing in a suppression
  factor specifically to avoid conflict with data. It would also
  effectively unmake the correlated-prediction claim (because the
  "prediction" would be that LIV is unobservable at current precision).
  
  Verdict: mathematically possible, but violates the spirit of the
  correlated prediction. Paper 2 should not rely on this.

Escape 3: The Bunch-Davies loophole (from Test 13).
  If the brane's thermal state is a genuine Bunch-Davies state on
  dS, it is de Sitter-invariant — i.e., SO(4,1)-invariant including
  "boosts" on dS. In that case there is NO preferred frame at the
  state level, and PPN bounds DO NOT constrain η_LIV the way they
  would for a thermal bath with a preferred rest frame.
  
  This is the most promising escape, but it inherits the
  technical requirement from Test 13 that the state be genuinely
  Bunch-Davies (not a pre-Bunch-Davies thermal state).
  
  Verdict: this is the only escape that preserves the spirit of the
  correlated prediction AND is physically defensible. It depends on
  Test 13's Bunch-Davies loophole actually working.

================================================================
OVERALL VERDICT ON TEST 14
================================================================

Paper 2's correlated prediction, in its naive form, is in serious
tension with multiple classes of LIV bound.

The ONLY escape that preserves the correlated prediction as physics
(rather than gauging it away or hiding it behind ad hoc suppression)
is the Bunch-Davies escape.

If the Bunch-Davies escape works, Paper 2's prediction is LOW
(because dS invariance factors out the preferred-frame effects at the
state level), and the observational target becomes HIGHER-ORDER
deviations from Bunch-Davies — not the naive η_LIV ~ δw correlation.

This means:

(i) The "smoking-gun correlated prediction" of Paper 2 in its simplest
    form is already ruled out or gauged away by existing data.

(ii) The subtler version — "deviations from Bunch-Davies produce
     LIV signatures proportional to some power of δw" — is a genuine
     observational target, but requires computing the specific
     power (could be 2nd-order or higher in δw, which would bring
     predicted LIV below existing bounds).

(iii) Paper 2's most honest claim about observability is:
      "No firm prediction until Bunch-Davies escape is quantified;
       correlated prediction is a DIRECTION, not a specific number."

PRACTICAL CONSEQUENCE: Paper 2 should NOT claim a concrete
observational prediction of the form "η_LIV ~ 26|δw|". It should
claim "a correlated-prediction structure exists, with specific
magnitude dependent on Bunch-Davies analysis (deferred to Paper 3)."

This is much weaker than the original Paper 2 sketch. The paper
becomes a setup for a future paper, rather than a standalone
result with an observational hook.

================================================================
REVISED STATUS
================================================================

After Tests 10-14, the status of Paper 2 is:

  Test 10 (L ∝ ρ microphysics):  OPEN GAP
  Test 11 (correlated prediction magnitude):  TENSION
  Test 12 (geometry mismatch):  RESOLVED (Option B)
  Test 13 (group-level continuation):  PARTIAL (needs Bunch-Davies)
  Test 14 (LIV bounds compatibility):  TENSION without Bunch-Davies

Two of the five are resolved positively. Three have serious open
issues, all of which point in the same direction: the mechanism
delivers less than originally sketched, and to deliver even what's
left requires a Bunch-Davies analysis that would be its own paper.

This is not "Paper 2 is dead". It IS "Paper 2 as currently sketched
is not the paper it thought it was". Reframing is needed.
""")
