\documentclass[11pt]{article}
\usepackage[margin=0.82in]{geometry}
\usepackage{amsmath,amssymb}
\usepackage{booktabs,array}
\usepackage{enumitem}
\usepackage{xcolor}
\usepackage{hyperref}
\usepackage{url}
\usepackage[T1]{fontenc}
\hypersetup{colorlinks=true,linkcolor=blue!45!black,urlcolor=blue!45!black}
\setlist{nosep,leftmargin=1.4em}
\setlength{\parindent}{0pt}
\setlength{\parskip}{0.45em}
\setlength{\emergencystretch}{3em}
\newcommand{\FV}{\textsc{Frostyverse}}
\newcommand{\code}[1]{\texttt{#1}}
\newcommand{\statusbox}[1]{\noindent\fbox{\begin{minipage}{0.94\linewidth}\small #1\end{minipage}}}

\begin{document}
\title{FrostTanglement / Bell--CHSH Rule Audit\\\large Declared Compatibility Mathematics, Monte Carlo Consequences, and Open 3-D FrostGrid Derivation}
\author{Frostyverse Laboratory}
\date{Website Laboratory v1.0.48}
\maketitle

\statusbox{\textbf{Scientific status.} This is a \emph{declared-rule consequence audit}. The two-component $\cos^2\delta$ compatibility rule is supplied as a Frostyverse postulate and is not independently derived here from raw FrostNode positions, FrostSpace distances, FrostSegment/FrostLine dynamics, FrostCell handoffs, detector boundary conditions, or a complete 3-D FrostGrid update. A software PASS means that the supplied rule has the stated mathematical/statistical consequences. It is not experimental confirmation of Frostyverse and is not a lower-level derivation of Bell correlations.}

\begin{abstract}
This note exposes the exact mathematics executed by the public FrostTanglement Python Test. Unlike the gravitational and kinematic Frostyverse Labs, the central Bell-compatible functional form is not presently the output of a frozen microscopic H-test. It is a declared compatibility postulate. Given that postulate, the audit constructs balanced joint probabilities, verifies exact $50/50$ local marginals, derives $E(\delta)=\cos(2\delta)$ in the ideal same-result convention, obtains the canonical CHSH value $S=2\sqrt2$, samples those probabilities by Monte Carlo, exposes a provisional coherence control $C$, and checks the stated parity-key consequence used in the entanglement-swapping narrative. The decisive unresolved problem is to obtain the compatibility rule, or an equivalent, independently from ordinary 3-D FrostGrid mechanics without inserting the Bell-compatible angular law by hand.
\end{abstract}

\section{Question under attack}
The physical FrostTanglement proposal is that two daughter structures may remain part of one shared relational state carried through the connected FrostGrid/FrostLine/FrostCell network. As the daughters move, the relationship is proposed to be relayed through successive local grid handoffs rather than by stretching one original literal segment indefinitely.

That narrative is not yet enough. The mathematical question is whether ordinary lower-level FrostGrid mechanics generate the required detector-angle dependence. The present public Lab therefore starts at a clearly marked boundary:
\[
\boxed{\text{declared compatibility rule}}
\quad\Longrightarrow\quad
\boxed{\text{joint probabilities and CHSH consequences}}.
\]
The left-hand box is supplied. The right-hand box is what this Lab audits.

A future complete detector simulation must instead establish a chain of the form
\[
\begin{gathered}
\boxed{\text{raw 3-D FrostGrid mechanics}}\\[2pt]
\Downarrow\\[2pt]
\boxed{\text{compatibility rule}}
\quad\Longrightarrow\quad
\boxed{\text{Bell/CHSH statistics}}.
\end{gathered}
\]
Failure of the first arrow would require the proposed physical mechanism to be revised or rejected.

\section{Declared two-component compatibility rule}
Let detector settings about the common propagation axis be $a$ and $b$. The Python wrapper retains the signed relative angle
\[
\delta=a-b,
\]
which is sufficient because the relevant functions are $180^\circ$ periodic.

For a constituent relation $i$, let $(\hat f_{1,i},\hat f_{2,i})$ denote two orthogonal transverse directions associated with the shared FrostArc/FrostLine frame, and let $(\hat d_1,\hat d_2)$ denote the corresponding detector frame. The current proposal supplies the two-component product
\[
\boxed{
w_i=(\hat f_{1,i}\cdot\hat d_1)
    (\hat f_{2,i}\cdot\hat d_2)
}.
\]
In the ideal coherent symmetric case, both component misalignments are the same relative rotation. Each overlap contributes a factor $\cos\delta$, giving the declared aggregate weight
\[
\boxed{W(\delta)=\cos^2\delta}.
\]
This multiplication is the key \emph{postulate}. The present Lab does not derive it from lower-level grid geometry.

\section{Provisional coherence control}
The public test also exposes a deliberately provisional scalar coherence parameter
\[
0\le C\le1.
\]
The declared degraded weight is
\[
\boxed{
W_C(\delta)=C\,W(\delta)+(1-C)\frac12
}.
\]
Using $\cos^2\delta=(1+\cos2\delta)/2$,
\[
W_C(\delta)=\frac12\left[1+C\cos(2\delta)\right].
\]
Thus $C=1$ returns the ideal rule, while $C=0$ returns a random favored/complementary relation with probability $1/2$.

\statusbox{\textbf{Important boundary.} No physical law currently maps separation distance, intervening material, field deformation, temperature, detector properties, or any other environmental variable to $C$. The coherence control is an exposed rule parameter for stress testing. It is not presently a prediction of an entanglement range or decoherence length.}

\section{Exact routing algorithm used by the Python audit}
The implementation separates the local outcome choice from the shared relation choice. For each trial it draws two independent uniform random coordinates:
\[
u_{\rm local},u_{\rm route}\sim U[0,1).
\]
The first coordinate assigns the local A outcome without reference to detector B:
\[
A=
\begin{cases}
+1,&u_{\rm local}<1/2,\\
-1,&u_{\rm local}\ge1/2.
\end{cases}
\]
The second coordinate determines whether the favored joint relation occurs:
\[
u_{\rm route}<W_C(\delta)
\quad\Longrightarrow\quad
\text{favored relation}.
\]

The program exposes two parity conventions. Define
\[
\eta=
\begin{cases}
+1,&\text{same-result favored},\\
-1,&\text{opposite-result favored}.
\end{cases}
\]
For the same-result convention the favored branch sets $B=A$; for the opposite-result convention the favored branch sets $B=-A$. The resulting same/opposite probabilities can be written compactly as
\[
\boxed{
P_{\rm same}
=\frac12\left[1+\eta C\cos(2\delta)\right]
},
\]
\[
\boxed{
P_{\rm opposite}
=\frac12\left[1-\eta C\cos(2\delta)\right]
}.
\]

Because the local A choice is exactly balanced and each same/opposite relation is split symmetrically between its two sign combinations,
\[
P(++)=P(--)=\frac12P_{\rm same},
\]
\[
P(+-)=P(-+)=\frac12P_{\rm opposite}.
\]
Therefore
\[
\boxed{
P(A=+)=P(A=-)=P(B=+)=P(B=-)=\frac12
}.
\]
The analytic declared routing rule therefore has setting-independent $50/50$ local marginals even though its \emph{joint} distribution depends on the relative detector setting.

\section{Correlation and CHSH consequence}
With equal outcomes assigned product $+1$ and opposite outcomes product $-1$,
\[
E(\delta)
=P_{\rm same}-P_{\rm opposite}
=\boxed{\eta C\cos(2\delta)}.
\]
For the public reference, the convention is same-result favored ($\eta=+1$) and ideal coherence ($C=1$), so
\[
\boxed{E(\delta)=\cos(2\delta)}.
\]

For arbitrary settings $a,a',b,b'$, the program evaluates
\[
\boxed{
S=
\left|
E(a,b)+E(a,b')+E(a',b)-E(a',b')
\right|
}.
\]
For the canonical settings
\[
a=0^\circ,\qquad
 a'=45^\circ,\qquad
 b=22.5^\circ,\qquad
 b'=-22.5^\circ,
\]
the declared ideal rule gives
\[
\boxed{S=2\sqrt2=2.828427124746\ldots}.
\]
Under the usual CHSH assumptions, a Bell-local factorizable model obeys $S\le2$. Therefore the supplied joint rule, by construction, is not representable as two independent local-only response functions satisfying those assumptions. This mathematical fact does \emph{not} show that the proposed FrostGrid narrative has supplied a valid microscopic mechanism for the nonfactorizable joint rule.

For the canonical settings and the provisional coherence interpolation,
\[
\boxed{S(C)=2\sqrt2\,C}.
\]
Thus this particular declared interpolation crosses the Bell-local bound at
\[
C=\frac1{\sqrt2}\approx0.7071068.
\]
That threshold is only an algebraic consequence of the provisional $C$ rule; it is not a derived physical decoherence threshold.

\section{Canonical analytic reference}
For $C=1$ and the same-result favored convention, the public Python package reports:
\begin{center}
\small
\begin{tabular}{rccc}
\toprule
$\delta$ & $P_{\rm same}$ & $P_{\rm opposite}$ & $E$\\
\midrule
$0^\circ$    & 1.000000000000 & 0.000000000000 & $+1.000000000000$\\
$22.5^\circ$ & 0.853553390593 & 0.146446609407 & $+0.707106781187$\\
$45^\circ$   & 0.500000000000 & 0.500000000000 & $+0.000000000000$\\
$67.5^\circ$ & 0.146446609407 & 0.853553390593 & $-0.707106781187$\\
\bottomrule
\end{tabular}
\end{center}
The analytic CHSH value is
\[
S_{\rm analytic}=2.828427124746.
\]
The local marginals are exactly $1/2$ by the declared routing construction, not a statistical fit.

\section{Finite Monte Carlo audit}
The Monte Carlo does not discover the compatibility law. It samples the supplied distribution and checks that finite-trial statistics approach the analytic consequence.

For one setting pair with analytic correlation $E_i$ and $N$ independent trials, the estimator
\[
\hat E_i=\frac1N\sum_{n=1}^N A_nB_n
\]
has approximate standard deviation
\[
\boxed{
\sigma_{E_i}=\sqrt{\frac{1-E_i^2}{N}}
}.
\]
For four independently sampled CHSH setting pairs the wrapper reports
\[
\boxed{
\sigma_S\approx\sqrt{\sum_{i=1}^4\sigma_{E_i}^2}
}.
\]
Finite Monte Carlo estimates may therefore fall above or below $2\sqrt2$. Such sampling fluctuation is not a claim to exceed the analytic rule or the quantum-mechanical Tsirelson value.

A fresh run of the public reference command with $200{,}000$ trials per setting pair and seed $7$ produced
\[
\boxed{S_{\rm MC}=2.831600\pm0.003162}
\]
(approximate one-standard-deviation uncertainty). The four sampled local $A+$ and $B+$ frequencies remained close to $0.5$, while the exact analytic marginals remain exactly $0.5$.

\section{Custom-input modes}
The public wrapper is intended to let a reviewer attack the declared rule away from the canonical demonstration.

\subsection{Arbitrary detector pair}
The reviewer may choose any relative angle $\delta$, any $C\in[0,1]$, either favored parity, a sample count, and a seed. The code prints both the analytic joint distribution and a fresh Monte Carlo sample.

For example,
\begin{verbatim}
python lab_test.py --custom-pair --delta 31.7 --coherence 0.73 \
  --samples 100000 --seed 11
\end{verbatim}
gives analytically
\[
W=0.723879543919,
\qquad
W_C=0.663432067061,
\]
\[
P_{\rm same}=0.663432067061,
\qquad
E=+0.326864134122,
\]
with exact analytic local marginals $P(A+)=P(B+)=0.5$. The corresponding fixed-seed Monte Carlo produced
\[
\hat E=0.324880000000\pm0.002988577986.
\]

\subsection{Arbitrary CHSH settings}
The four detector settings, $C$, favored parity, sample count, and seed are all exposed. For example,
\begin{verbatim}
python lab_test.py --custom-chsh --a 0 --ap 45 --b 22.5 --bp -22.5 \
  --coherence 0.8 --samples 100000 --seed 7
\end{verbatim}
produces the analytic consequence
\[
S=2.262741699797
\]
and, for that fixed Monte Carlo run,
\[
S_{\rm MC}=2.261500\pm0.005215.
\]

\subsection{Coherence sweep}
The built-in sweep evaluates
\[
C\in\{1.0,0.9,0.75,0.5,0.25,0.1,0\}
\]
and prints $P_{\rm same}$, $E$, and canonical $S(C)$. At $C=0$, the declared rule becomes random and the canonical correlation convention gives $S=0$.

\section{Entanglement-swapping parity-key consistency}
The public wrapper contains a deliberately narrow test of the stated swapping narrative. It is \emph{not} a microscopic Bell-state measurement simulation.

Let a joint key $k\in\{0,1\}$ be equally likely. The declared rule interprets
\[
k=0:\quad \text{same-result favored},
\]
\[
k=1:\quad \text{opposite-result favored}.
\]
At fixed $\delta$ and $C$,
\[
P_{\rm same}\mid k=0=W_C,
\qquad
P_{\rm same}\mid k=1=1-W_C.
\]
If the key is ignored and both keys are equally likely,
\[
\boxed{
P_{\rm same}
=\frac12W_C+\frac12(1-W_C)
=\frac12
}.
\]
Thus conditioning on the declared key separates complementary parity relations, whereas erasing the key produces an uncorrelated $50/50$ same/opposite mixture.

The public reference command
\begin{verbatim}
python lab_test.py --swap --delta 22.5 --coherence 1 \
  --samples 240000 --seed 7
\end{verbatim}
produced
\[
P_{\rm same}^{(k=0)}=0.854798148025,
\qquad
P_{\rm same}^{(k=1)}=0.146574154380,
\]
and, with the key ignored,
\[
P_{\rm same}^{(\rm mixed)}=0.500945833333,
\]
consistent with the exact declared expectations $0.853553390593$, $0.146446609407$, and $0.5$ respectively.

\section{Why this Lab has no ordinary ``QM comparison firewall''}
Several other Frostyverse Labs generate an FV prediction, seal it, and only then open an external GR/SR ruler. That structure would be misleading here. The Bell-compatible angular dependence
\[
W(\delta)=\cos^2\delta
\]
is already the declared input to this Lab. Therefore agreement of its consequences with the corresponding ideal quantum correlation is not an independent prediction produced from lower-level FrostGrid mechanics.

The meaningful firewall is instead conceptual:
\[
\boxed{\text{do not count consequences of the supplied rule as a derivation of the rule}}.
\]
The current Python Test is valuable because it makes the supplied rule, routing algorithm, marginals, CHSH algebra, coherence interpolation, swapping-key consequence, and statistical implementation transparent and attackable. The unresolved scientific burden remains upstream.

\section{Historical record versus current public wrapper}
The Frostyverse manuscript records an earlier rule-based Monte Carlo using 48 segments per photon, $0.25^\circ$ jitter, $C=1$, and $200{,}000$ trials per angle. It reported a CHSH result near $S=2.8235$. A corresponding rule-level swapping exercise with $240{,}000$ trials per angle reported approximately $S=2.8243$ after sorting by the declared joint key, while ignoring that key returned approximately $50/50$ mixtures.

The exact historical implementation was not preserved as a frozen H-test artifact. The current package therefore does \emph{not} claim bit-for-bit reconstruction of that unavailable simulation. It instead preserves the dedicated publication-facing declared-rule packet unchanged and audits the formal equations/routing algorithm transparently.

\section{Reproduction interface}
Recommended Python is 3.10 or later. The package uses only the Python standard library; no third-party dependencies are required.

Interactive entry point:
\begin{verbatim}
python lab_test.py
\end{verbatim}

Useful command-line attacks are:
\begin{verbatim}
python lab_test.py --reference --samples 200000 --seed 7
python lab_test.py --custom-pair --delta 31.7 --coherence 0.73 \
  --samples 100000 --seed 11
python lab_test.py --custom-chsh --a 0 --ap 45 --b 22.5 --bp -22.5 \
  --coherence 0.8
python lab_test.py --coherence-sweep --delta 22.5
python lab_test.py --swap --delta 22.5 --coherence 1 --samples 240000
python lab_test.py --original
python lab_test.py --verify
\end{verbatim}
The option \code{--parity opposite} may be added to the pair, CHSH, or coherence-sweep modes. The option \code{--no-save} suppresses result-file creation. Otherwise main wrapper runs save matching text and JSON records under \code{results/} when writable.

\section{Preserved source and integrity}
The public Python Test ZIP contains:
\begin{itemize}
\item \code{README\_FIRST.md}: run instructions and scientific status;
\item \code{lab\_test.py}: current analytic/Monte Carlo wrapper;
\item \code{EXPECTED\_RESULTS.txt}: compact reference consequences;
\item \code{CLAIM\_BOUNDARY.md}: explicit evidence boundary;
\item the preserved publication-facing declared-rule packet under \code{original/};
\item \code{SHA256SUMS.txt}, \code{VERSION.txt}, launcher scripts, and \code{results/README.txt}.
\end{itemize}

The preserved declared-rule packet carried inside the Python Test has SHA-256
\begin{verbatim}
4c3d22886e749d3984f37781fac681ab5a223b92aadd68d62a06a8041b3c8e58
\end{verbatim}
The current public Python Test ZIP has SHA-256
\begin{verbatim}
1147c0e47622041b4eacf9cb6aa5c55aadd082ead3f5599edb044515f912fae3
\end{verbatim}
The wrapper verifies the preserved packet hash before executing its unchanged historical/publication-facing \code{lab\_test.py}.

\section{What a PASS does and does not mean}
A PASS or expected output establishes only that, once the declared compatibility/routing rule is supplied:
\begin{itemize}
\item the stated $\cos^2\delta$ same/opposite probabilities follow;
\item local marginals remain exactly balanced in the analytic routing rule;
\item $E=\eta C\cos(2\delta)$ follows;
\item the canonical ideal same-result convention gives $S=2\sqrt2$;
\item finite Monte Carlo sampling behaves consistently with those supplied probabilities;
\item the provisional coherence interpolation degrades correlations as stated; and
\item the declared swapping parity key has the stated conditioning/mixing consequence.
\end{itemize}

It does \emph{not} establish that FrostTanglement has been experimentally confirmed, that Bell's theorem has been evaded by a Bell-local hidden-variable model, that a complete 3-D FrostGrid independently generates the compatibility rule, that the physical shared-grid narrative is correct, or that $C$ has a known dependence on distance or environment.

\section{Recommended reviewer attacks}
A critical reviewer should independently rederive every probability and the CHSH value; test arbitrary detector angles and both parity conventions; verify the exact local-marginal algebra; rerun finite samples over many seeds and $N$; attack the provisional coherence interpolation; test alternative lower-level compatibility constructions; and, most importantly, attempt a complete 3-D FrostGrid detector/relay simulation in which the $\cos^2\delta$ product rule is \emph{not} inserted as an input.

\section{Final claim boundary}
This Laboratory is intentionally weaker in evidentiary status than a Lab whose key law is generated from previously frozen microscopic mechanics. Its strength is transparency: the mathematical rule is stated openly, its consequences are reproducible, and the missing derivation is not hidden. A future lower-level FrostGrid simulation that fails to independently generate the compatibility rule, or an observationally equivalent rule, would require the physical FrostTanglement proposal to be revised or rejected.

\end{document}
