import numpy as np
print("="*70)
print("SPECTRAL DERIVATION of the chi decay-constant exponent")
print("Manifold: M7 = CP^2 x S^3.  chi = harmonic b_3 3-form (S^3 volume form)")
print("="*70)

# ---- 1. S^3 = SU(2) spectra (exact, standard results) ----
print("\n[1] S^3 = SU(2) spectra (exact):")
print("  Functions/3-forms (Peter-Weyl): reps (j,j) of SU(2)_L x SU(2)_R,")
print("     Laplacian lambda = 4j(j+1)/R^2,  dim (j,j)=(2j+1)^2.  j=0 -> (0,0) = b_3 harmonic.")
print("  Dirac: eigenvalues +-(n+3/2)/R, degeneracy (n+1)(n+2). n=0 -> 9/(4R^2) [this is the")
print("     value the corpus's Toeplitz Case-3 uses]. Lowest spinor = SU(2)_L doublet (1/2,0).")

# ---- 2. The isometry vs gauge group: the crux dimension ----
print("\n[2] The crux: which symmetry sets the exponent?")
print("  Isometry of S^3 = SO(4) = SU(2)_L x SU(2)_R,  dim so(4) = 6.")
print("  GAUGE group on S^3 = weak SU(2)_L only (chiral!),  dim su(2)_L = 3.")
print("    -> SU(2)_R is NOT gauged: there is no right-handed weak force.")
print("    -> the 3 W-bosons live in the (1,0) rep of SU(2)_L x SU(2)_R, dim 3.")

# ---- 3. Establish the RULE from the one clean rung (Higgs), then apply ----
print("\n[3] The rule, fixed by the Higgs (the cleanest rung) and applied to chi:")
print("    EXPONENT = dim of the GAUGE-GROUP ADJOINT of the sector's manifold.")
def dim_su(N): return N*N-1
print(f"    CP^2 <-> color SU(3): dim su(3) = {dim_su(3)}  -> v = M_P alpha^8   [VECTORLIKE -> full group] CHECK")
print(f"    S^3  <-> weak  SU(2): dim su(2) = {dim_su(2)}  -> f_chi = M_P alpha^3 [CHIRAL -> SU(2)_L only]")
print("    Why color keeps full 8 but weak gives 3: color is parity-even (both handed),")
print("    weak is parity-ODD (left only). Chirality is what halves so(4)=6 down to su(2)_L=3.")

# ---- 4. Consequence: mass, abundance, detection at n=3 (rigorous misalignment) ----
Mbar=2.435323e18; alpha=1/137.035999; s158=np.sqrt(158.0)
s0=2.2255e-38; rhoc=8.0992e-47; g=106.75
n=3
m=s158*Mbar*alpha**(16-n); f=Mbar*alpha**n
T=np.sqrt(m*Mbar/(3*np.sqrt(np.pi**2*g/90)))
Y=(0.5*m*f**2)/((2*np.pi**2/45)*g*T**3); Om=m*Y*s0/rhoc
print(f"\n[4] At n=3:  m_chi = {m*1e9:.2f} eV,  f_chi = {f:.2e} GeV")
print(f"    Omega_chi h^2 = {Om:.2f} (theta=1) -> 0.12 at theta_i = {np.sqrt(0.12/Om):.2f}")
print(f"    g_chi-gamma = alpha/(2 pi f) = {alpha/(2*np.pi*f):.1e} GeV^-1 (photon E = {m/2*1e9:.1f} eV)")

# ---- 5. honest residual ----
print("\n[5] WHAT IS RIGOROUS vs WHAT REMAINS:")
print("  RIGOROUS: the dims (su(3)=8, su(2)=3, so(4)=6) are exact group theory;")
print("    the chiral gauging of only SU(2)_L is established physics (parity violation);")
print("    the misalignment Omega, mass, coupling are exact given n.")
print("  REMAINS (the one lemma): proving the spectral-action a_4 heat-kernel coefficient")
print("    assigns f_chi to the GAUGE family (adjoint, d=3) and NOT the matter family")
print("    (chiral channels, d=5, the corpus's choice). The Higgs cannot arbitrate because")
print("    for CP^2: gauge=isometry=8 coincide. This is the unbuilt Toeplitz/Berezin step.")
