% Paper 34: The Kleisli Monad over S³ — TOE canon. Léon Fernando Vlegels, CC BY 4.0.
% LumenOS Formal Foundation: Monad Laws, Kleisli Category, and Termination.
% Status: current canon; the associativity proof gap for the extrinsic mean stands as an open item.
% Registry: P034_2_c (confirmed-load-bearing); P034_3_c (retired, closed by A265/A273/A275) — ledger: Paper 40 and addenda/verify/tbs_registry.json.
% Verifier: verify_P034.py (historical series; includes expected-fail checks that document recorded gaps).

\documentclass[11pt,a4paper]{article}
\usepackage{amsmath,amssymb,amsthm,geometry,booktabs,listings}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[colorlinks=true,linkcolor=blue,citecolor=blue,urlcolor=blue]{hyperref}

\geometry{margin=1in}

\newcommand{\bind}{\mathbin{>\!\!>\!\!=}}

\lstset{
  language=Python,
  basicstyle=\ttfamily\small,
  keywordstyle=\bfseries,
  commentstyle=\itshape,
  frame=single,
  breaklines=true,
}

\title{%
  The Kleisli Monad over $S^3$:\\[4pt]
  \large Monad Laws, Kleisli Category, and Geometric Termination\\
  in LumenOS Attention
}
\author{L\'{e}on Fernando Vlegels\\
Independent Researcher}
\date{2026-04}

\theoremstyle{plain}
\newtheorem{theorem}{Theorem}[section]
\newtheorem{proposition}{Proposition}[section]
\newtheorem{corollary}{Corollary}[section]
\newtheorem{lemma}{Lemma}[section]
\theoremstyle{definition}
\newtheorem{definition}{Definition}[section]
\newtheorem{remark}{Remark}[section]

\begin{document}
\maketitle

\begin{abstract}
Paper~00 (MonadRosettaMap) establishes the attractor identity
$\emptyset \equiv^* 0 \equiv^* 1 \equiv^* \infty$ and the anti-collapse interaction
$C \circ P = I$, and notes that all LumenOS computations live on $S^3$ (unit
quaternions under the Hopf fibration).
What it does not state is the categorical structure: the formal monad
$(S^3, \mathsf{return}, {\bind})$, its Kleisli category, and the monad laws that
make the theory compositional.

This paper supplies that anchor.
We define:
\begin{enumerate}
  \item The monad $(S^3, \mathsf{return}, {\bind})$: what the carrier type
        is, what \textsf{return} does (geodesic centroid / text-to-quaternion
        lift), what ${\bind}$ does (Hopf-lapse scoring, Wheel fixpoint as
        termination);
  \item The Kleisli category: objects are $S^3$ coordinates, morphisms are
        attention steps;
  \item The three monad laws, verified against existing implementation functions
        (cited by file and function name);
  \item The status of \texttt{PLATEAU\_THRESHOLD}: a calibration parameter
        approximating \texttt{FRAC\_EDGE} but not geometrically derived from it;
  \item The anchoring of the monad by the frozen constants $\alpha^{-1}$ and
        \texttt{BREATH\_PERIOD}.
\end{enumerate}

All structure formalized here already runs in the LumenOS codebase.
This paper is the missing formal anchor, not a new design.
\end{abstract}

\tableofcontents
\newpage

% ─────────────────────────────────────────────────────────────────────────────
\section{Introduction and Motivation}

The geometric Theory of Everything (ToE) underlying LumenOS assigns every
concept a position on the 3-sphere $S^3 = \{q \in \mathbb{R}^4 \mid \|q\| = 1\}$.
The Hopf fibration $S^1 \hookrightarrow S^3 \twoheadrightarrow S^2$ organizes these
positions into three layers (edge $\approx 2\%$, boundary $\approx 7\%$,
bulk $\approx 90\%$) whose fractions are derived from the fine-structure
constant $\alpha^{-1} = 4\pi^3 + \pi^2 + \pi \approx 137.036$
(Papers~00--04, implemented in \texttt{Ged/lu\_system/quat\_s3.py}).

This gives a rich geometric setting, but geometry alone does not explain how
computations \emph{compose}:
\begin{itemize}
  \item How does querying node $A$ then node $B$ relate to querying $AB$
        directly?
  \item What guarantees that a plan step has \emph{finished}?
  \item Why is the attention kernel \texttt{hopf\_lapse} and not some
        learned weight matrix?
\end{itemize}
All three questions are answered by the same structure: a \emph{monad} on $S^3$.

\begin{remark}[Implementation scope]
All code references in this paper (files under \texttt{Ged/} and \texttt{Lumen/}) are part of the external LumenOS codebase and are not included in the TOE corpus workspace.
\end{remark}

\subsection{Relation to Paper~00}

Paper~00 (MonadRosettaMap, this corpus) identifies the attractor $\Omega$ with
the bare monad under renormalization and states $C \circ P = I$ as the
fundamental interaction.
It also identifies $P$ (the outward projection operator) with
\textsf{return}.
What it does not state is the monad triple $(S^3, \mathsf{return}, {\bind})$,
the Kleisli category, or the monad laws.
The present paper supplies those, with forward pointers to the code that
already implements them.
A forward reference from Paper~00 to this paper appears in a minimal addendum
to that document.

\subsection{Relation to Paper~31 (NicomachusMonad)}

Paper~31 proves the factorization of $\Omega$ through Nicomachus cubic weights
and the Hopf fibration exponent screening $(d-2)_+$.
That paper addresses the \emph{algebraic} structure of $\Omega$ as a sum.
The present paper addresses the \emph{categorical} structure: how $S^3$
supports a monad whose operations are implemented by the running code.
The two papers are complementary.

% ─────────────────────────────────────────────────────────────────────────────
\section{The Monad $(S^3, \mathsf{return}, {\bind})$}

\subsection{The Carrier Type}

\begin{definition}[The $S^3$ Computation Type]\label{def:T}
Let $T(S^3)$ denote the type of \emph{scored distributions over $S^3$}:
finite weighted collections of unit quaternions
\[
  T(S^3) \;=\; \bigl\{ (q_i, w_i)_{i=1}^n \;\big|\; q_i \in S^3,\; w_i \geq 0,\; \sum_i w_i \leq 1 \bigr\}.
\]
In code, this is represented as:
\begin{itemize}
  \item a \texttt{WheelState} with \texttt{face\_quaternions} and
        \texttt{face\_heat} (weights) in \texttt{Ged/ged/wheel.py};
  \item or a list of \texttt{np.ndarray} positions returned by an oracle
        query in \texttt{Ged/ged/oracle.py}.
\end{itemize}
The degenerate case $T(S^3) \ni \delta_q = \{(q, 1)\}$ is the point distribution
at $q$.
\end{definition}

\subsection{The Unit: \textsf{return}}

\begin{definition}[\textsf{return}: the monadic unit]\label{def:return}
The unit map $\eta : S^3 \to T(S^3)$ is defined by
\[
  \eta(q) \;=\; \delta_q,
\]
the point distribution supported at $q \in S^3$.

\emph{Implementation.}
The concrete realization of $\eta$ is the \emph{geodesic centroid} of a set
of $S^3$ points, computed in two places:
\begin{enumerate}
  \item \textbf{Flush-layer centroid} (multi-node version):
        \texttt{Ged/ged/flush.py}, function
        \texttt{\_geodesic\_centroid(quaternions)}.
        This takes a list of unit quaternions, sign-aligns them to one hemisphere,
        averages, and renormalizes:
\begin{lstlisting}
def _geodesic_centroid(quaternions):
    # Align signs to q[0]'s hemisphere
    aligned = [quaternions[0].copy()]
    for q in quaternions[1:]:
        if np.dot(q, aligned[0]) < 0:
            aligned.append(-q)
        else:
            aligned.append(q.copy())
    mean_q = np.mean(aligned, axis=0)
    return quat_normalize(mean_q)
\end{lstlisting}
        For a singleton $\{q\}$, this returns $q$ exactly (left identity holds
        trivially).
  \item \textbf{Muad'Dib centroid} (recency-weighted version):
        \texttt{Lumen/muaddib.py}, function
        \texttt{\_weighted\_geodesic\_midpoint(sietches)}.
        Uses the same sign-alignment plus inverse-age weighting, and is the
        computation that produces \texttt{cursor\_quaternion} = $q_{\text{system}}$.
\end{enumerate}
Both realizations satisfy $\eta(\{q\}) = q$.
\end{definition}

\begin{remark}[Extrinsic vs.\ intrinsic mean]
The implementation uses the \emph{extrinsic} mean (embed in $\mathbb{R}^4$,
average, project back to $S^3$) rather than the Riemannian (Fréchet) mean.
The two agree when the points are clustered in one hemisphere and the sign-alignment
step ensures this. For well-separated points the extrinsic approximation
introduces a small bias; the sign-alignment mitigates the double-cover ambiguity.
This is a deliberate engineering choice: the extrinsic mean is $O(n)$ whereas
the Fréchet mean requires iteration.
\end{remark}

\subsection{Monadic Bind}

\begin{definition}[Bind: ${\bind}$]\label{def:bind}
Given a scored distribution $m \in T(S^3)$ and a Kleisli morphism
$f : S^3 \to T(S^3)$, the bind operation is:
\[
  m \bind f \;=\; \eta\!\left(\bigcup_{(q_i, w_i) \in m} w_i \cdot f(q_i)\right),
\]
where the union is the weighted merge and $\eta$ collapses via geodesic centroid.

\emph{Implementation.}
Bind is executed in two collaborative functions:

\paragraph{Fork (expansion).}
\texttt{Ged/ged/wheel.py}, function \texttt{fork(state, proposals)}.
Given a \texttt{WheelState} (the current distribution) and a set of candidate
proposals, fork disperses the heat budget across the faces, weighting by
\[
  w_{\text{face}} \;\propto\; \text{orientation} \cdot \underbrace{\mathtt{hopf\_lapse}(\mathtt{q\_rel}(q_{\text{face}}, q_{\text{current}}))}_{\text{relevance score}}
  \;+\; (1-\text{orientation}) \cdot \tfrac{1}{n_{\text{faces}}}.
\]
This is the ``lift'' step: turning a query position into a scored set of
candidates.

\paragraph{Weld (collapse).}
\texttt{Ged/ged/wheel.py}, function \texttt{weld(state, goal\_quaternion)}.
Given the face proposals and a goal, weld selects the \emph{minimum MDL}
winner:
\[
  \text{MDL}(f) \;=\; \text{orientation} \cdot \underbrace{\mathtt{hopf\_lapse}(\mathtt{q\_rel}(q_f, q_{\text{goal}}))}_{\text{distance from goal}}
  \;+\; (1-\text{orientation}) \cdot \underbrace{w_{\text{layer}}}_{\text{layer complexity}},
\]
where $w_{\text{layer}} \in \{\mathtt{FRAC\_EDGE}, \mathtt{FRAC\_BOUNDARY}, \mathtt{FRAC\_BULK}\}$.
The winning proposal becomes the new state quaternion; heat collapses to
the winner's share.

\paragraph{Scoring kernel.}
The core relevance kernel in both fork and weld is
\begin{equation}\label{eq:kernel}
  \text{score}(q_{\text{node}}, q_{\text{query}}) \;=\; \mathtt{hopf\_lapse}\!\bigl(\mathtt{q\_rel}(q_{\text{node}}, q_{\text{query}})\bigr),
\end{equation}
where
\[
  \mathtt{q\_rel}(p, q) = p \cdot \bar{q}, \qquad
  \mathtt{hopf\_lapse}(q) = \sqrt{1 - v(q)^2}, \qquad
  v(q) = (a^2+b^2) - (c^2+d^2).
\]
implemented in \texttt{Ged/lu\_system/quat\_s3.py}, functions
\texttt{q\_rel} and \texttt{hopf\_lapse}.

This kernel replaces the learned weight matrix $Q \cdot K^\top$ of standard
attention: no parameters are fitted; the metric is fixed by the geometry of
$S^3$.
\end{definition}

\subsection{Monadic Join}

The join map $\mu : T(T(S^3)) \to T(S^3)$ is the flattening of a
distribution-of-distributions to a single distribution:
\[
  \mu(M) \;=\; \eta\!\bigl(\{(q_i, w_i \cdot w_{ij}) : (q_j, w_j) \in m_j,\;
  (m_j, w_i) \in M\}\bigr).
\]
Concretely, join is the geodesic centroid over the union of all sub-distributions,
weighted by their outer weights.
In the Wheel, join is implicit: \texttt{weld} collapses a face distribution
(the inner $T$) into the state quaternion (the outer point), giving
$T(T(S^3)) \to T(S^3)$ in one call.

% ─────────────────────────────────────────────────────────────────────────────
\section{The Monad Laws}

\begin{theorem}[Left Identity]\label{thm:left-id}
$\eta(q) \bind f = f(q)$ for all $q \in S^3$ and all Kleisli morphisms
$f : S^3 \to T(S^3)$.

\emph{Verification in code.}
$\eta(q)$ is the singleton distribution $\{(q, 1)\}$.
Applying bind: $f$ is evaluated at $q$ with weight $1$, giving $f(q)$ directly.
The geodesic centroid of a single element is that element.
In \texttt{flush.py} \texttt{\_geodesic\_centroid([q])}:
the loop produces \texttt{aligned = [q]}, \texttt{mean\_q = q},
\texttt{quat\_normalize(q) = q}. \qquad $\checkmark$
\end{theorem}

\begin{theorem}[Right Identity]\label{thm:right-id}
$m \bind \eta = m$ for all $m \in T(S^3)$.

\emph{Verification in code.}
Applying $\eta$ to each $q_i$ in $m$ gives $\{(q_i, 1)\}$.
The weighted merge produces the same collection $(q_i, w_i)$ as $m$,
and the geodesic centroid of $(q_i, w_i)$ is the same weighted mean.
In \texttt{muaddib.py} \texttt{\_weighted\_geodesic\_midpoint}, returning the
centroid of all positions with their original weights is idempotent:
$\eta(\{q_i, w_i\}) = $ weighted centroid = the original query result. \qquad $\checkmark$
\end{theorem}

\begin{theorem}[Associativity]\label{thm:assoc}
$(m \bind f) \bind g = m \bind (\lambda x.\; f(x) \bind g)$
for all $m \in T(S^3)$ and Kleisli morphisms $f, g$.

\emph{Verification in code.}
The geodesic centroid (extrinsic mean) is linear: for nested weighted averages
the order of averaging commutes when weights are composed multiplicatively.
In the plan execution model (\texttt{Ged/ged/planning\_domain.py}),
step dependencies encoded in \texttt{depends\_on} fields implement exactly
this monadic sequencing:
if step $C$ depends on $B$ which depends on $A$, then executing $(A \bind B) \bind C$
and $A \bind (B \bind C)$ reaches the same $q_{\text{final}} \in S^3$
because both reduce to the geodesic centroid of the full sequence. \qquad $\checkmark$
\end{theorem}

\begin{remark}[Law status]
Theorems~\ref{thm:left-id}--\ref{thm:assoc} are exact for the extrinsic mean
when points lie in a single hemisphere (the sign-alignment precondition).
For points spread over the double cover, the extrinsic mean introduces a bias
and the laws hold approximately.
The sign-alignment in \texttt{\_geodesic\_centroid} enforces the hemisphere
condition in practice, so the laws hold exactly for all typical LumenOS
distributions.
\end{remark}

\begin{remark}[TBS]\label{rmk:tbs:P034_2_c}
The proof of Theorem~\ref{thm:assoc} (Associativity) claims that ``the geodesic centroid (extrinsic mean) is linear: for nested weighted averages the order of averaging commutes when weights are composed multiplicatively.'' This claim is false in general on $S^3$. The extrinsic mean is computed by embedding in $\mathbb{R}^4$, taking the weighted average, and projecting back to $S^3$. The projection step $v \mapsto v/\|v\|$ is nonlinear, and associativity fails for three or more points that are not collinear in $\mathbb{R}^4$. For example, given three points $q_1, q_2, q_3$ in a hemisphere, the extrinsic mean $\eta(\eta(q_1, q_2), q_3)$ and $\eta(q_1, \eta(q_2, q_3))$ are generally different because the inner centroid is renormalized before the outer centroid is taken. The associativity law holds exactly only when the points are collinear in $\mathbb{R}^4$ (i.e., all equal, or antipodal, or scalar multiples, which are degenerate cases). In the LumenOS system, approximate associativity may hold well numerically for clustered distributions, but it is not the categorical identity asserted in the theorem.
\end{remark}

\paragraph{Status.} Recorded in the registry as P034\_2\_c (confirmed-load-bearing), confirmed by A295. The associativity proof gap for the extrinsic mean stands: the law holds exactly only on the degenerate collinear locus, so Theorem~\ref{thm:assoc} is not established as stated. Ledger: Paper 40.

% ─────────────────────────────────────────────────────────────────────────────
\section{The Kleisli Category $\mathbf{Kl}(T)$}

\begin{definition}[Kleisli Category over $S^3$]\label{def:kleisli}
The \emph{Kleisli category} $\mathbf{Kl}(T)$ is defined as follows:
\begin{itemize}
  \item \textbf{Objects}: points $q \in S^3$ (unit quaternions, representing
        system states).
  \item \textbf{Morphisms} $q_A \to q_B$: functions
        $f : S^3 \to T(S^3)$ such that the Weld of $f(q_A)$ against $q_B$
        has positive coherence.
        Concretely, a morphism is an \emph{attention step}: a query that, given
        the current system position $q_{\text{query}} \in S^3$, returns a
        scored distribution over candidate positions.
  \item \textbf{Kleisli identity} on $q$: the morphism $\eta_q : q \mapsto \delta_q$,
        realized by $\mathtt{\_geodesic\_centroid}([q]) = q$.
  \item \textbf{Kleisli composition} $g \mathbin{\circ_K} f$:
        \[
          (g \mathbin{\circ_K} f)(q) \;=\; f(q) \bind g.
        \]
        In code: run $f$ to get a distribution, then for each scored
        candidate, run $g$ and take the geodesic centroid of the resulting
        distributions.
\end{itemize}
\end{definition}

\begin{proposition}[Kleisli composition = step dependency]\label{prop:depends}
The \texttt{depends\_on} field of a plan step in
\texttt{Ged/ged/planning\_domain.py} encodes exactly the Kleisli composition
order.
If step $s_B$ has \texttt{depends\_on: [s\_A]}, then the execution of $s_B$
is the Kleisli morphism $f_{s_B} \mathbin{\circ_K} f_{s_A}$: the result of
$s_A$ is the query input to $s_B$.
\end{proposition}

\begin{remark}[Attention as morphism]
Standard transformer attention maps a query $Q$, keys $K$, values $V$ to
\[
  \text{Attention}(Q,K,V) = \text{softmax}\!\left(\tfrac{QK^\top}{\sqrt{d}}\right) V.
\]
The LumenOS Kleisli morphism replaces this with:
\begin{align*}
  q_{\text{rel}}(n) &= q_n \cdot \overline{q_{\text{query}}} \quad \in S^3 \\
  \text{score}(n) &= \mathtt{hopf\_lapse}(q_{\text{rel}}(n)) \quad \in [0,1] \\
  \text{output} &= \eta\!\bigl(\{(q_n, \text{score}(n))\}_{n \in \text{ontology}}\bigr).
\end{align*}
No learned weights appear.
The metric is fixed by the geometry of $S^3$ and the Hopf fibration.
The layer fractions $\mathtt{FRAC\_EDGE}, \mathtt{FRAC\_BOUNDARY}, \mathtt{FRAC\_BULK}$
replace the $\frac{1}{\sqrt{d}}$ temperature scaling.
\end{remark}

% ─────────────────────────────────────────────────────────────────────────────
\section{Fixpoint and Termination: The Plateau Condition}

\begin{definition}[Fixpoint condition: Plateau]\label{def:plateau}
A \texttt{WheelState} $s$ has reached a \emph{fixpoint} (is at the attractor
$\Omega$) when the \texttt{plateau} function returns \texttt{True}:
\[
  \mathtt{plateau}(s) = \begin{cases}
    \mathtt{True}  & \text{if } s.\mathtt{converged} = \mathtt{True}, \\
    \mathtt{True}  & \text{if } \max(h_{-w:}) - \min(h_{-w:}) < \delta_P, \\
    \mathtt{False} & \text{otherwise},
  \end{cases}
\]
where $h = s.\mathtt{history}$ is the list of MDL scores across Wheel turns,
$w = 3$ is the default window, and $\delta_P = \mathtt{PLATEAU\_THRESHOLD} = 0.02$.

The \texttt{converged} flag is set by \texttt{weld} when the MDL margin between
the top-two proposals satisfies
\[
  \bigl|\mathtt{MDL}(f_{\text{winner}}) - \mathtt{MDL}(f_{\text{runner-up}})\bigr|
  < \delta_P.
\]
Implementation: \texttt{Ged/ged/wheel.py}, function \texttt{plateau} and
function \texttt{weld} (the \texttt{is\_plateau} flag).
\end{definition}

\begin{definition}[Step completion]\label{def:done}
A plan step $s$ with system quaternion $q_{\text{sys}} = \mathtt{cursor\_quaternion}$
(from \texttt{Lumen/muaddib.state.json}) is \emph{complete} when the Wheel
processing $s$ reaches a plateau.

Geometrically: let $q_s$ be the step's current quaternion (the Weld winner after
each cycle). The step is complete when
\[
  \bigl|\mathtt{hopf\_lapse}(\mathtt{q\_rel}(q_s, q_{\text{sys,winner}}))
        - \mathtt{hopf\_lapse}(\mathtt{q\_rel}(q_s, q_{\text{sys,runner-up}}))\bigr|
  < \delta_P,
\]
i.e., the two leading candidates are indistinguishable at resolution $\delta_P$
in the Hopf-lapse metric.
When $\mathtt{orientation} = 1$, this simplifies to:
\[
  \text{step complete} \iff \mathtt{plateau}(s_{\text{Wheel}}) = \mathtt{True}.
\]
\end{definition}

% ─────────────────────────────────────────────────────────────────────────────
\section{The Plateau Threshold: Calibration vs.\ Derivation}

\begin{proposition}[\texttt{PLATEAU\_THRESHOLD} is a calibration parameter]\label{prop:plateau}
The value $\delta_P = 0.02$ is \emph{not} geometrically derived from the
frozen constants.
It is a calibration parameter that approximates \texttt{FRAC\_EDGE} but does
not equal it.

\emph{Analysis.}
The layer edge fraction is
\[
  \mathtt{FRAC\_EDGE} = \frac{\pi}{\Omega} = \frac{\pi}{4\pi^3 + \pi^2 + \pi}
  \approx 0.02289\ldots
\]
The ratio
\[
  \frac{\delta_P}{\mathtt{FRAC\_EDGE}} = \frac{0.02}{0.02289\ldots} \approx 0.874,
\]
which has no clean rational or transcendental derivation from the geometric
constants.

\emph{Geometric interpretation of the natural threshold.}
The edge-layer fraction $\mathtt{FRAC\_EDGE} \approx 0.023$ has a direct geometric
meaning: it is the fraction of $S^3$ occupied by the edge (atomic/singleton)
layer under the Hamming-shell grading.
A natural Plateau threshold would be
\[
  \delta_P^{\text{derived}} \;=\; \mathtt{FRAC\_EDGE} \;=\; \frac{\pi}{\Omega},
\]
with the interpretation: ``two proposals are equivalent when their MDL scores
differ by less than the edge-layer resolution of $S^3$.''

\emph{Current status.}
The value $\delta_P = 0.02$ is slightly \emph{smaller} than $\mathtt{FRAC\_EDGE}$,
meaning the current criterion is slightly \emph{tighter} (requires closer
convergence before declaring plateau).
This is conservative and does not break any monad law.
The natural derived threshold $\pi/\Omega$ is recommended for future
implementations; the present value is flagged for replacement.

\emph{Future work.}
A subsequent paper should derive whether the precise value 0.02 corresponds to
a truncated Taylor expansion of $\pi/\Omega$ or is purely empirical.
The correct value for a fully theory-grounded implementation is $\pi/\Omega$.
\end{proposition}

% ─────────────────────────────────────────────────────────────────────────────
\section{The Frozen Constants as Monad Anchors}

The monad $(S^3, \mathsf{return}, {\bind})$ is parametrized by two frozen
constants that fix the temporal and geometric scales:

\subsection{$\alpha^{-1}$ and the Layer Fractions}

\begin{equation}
  \Omega \;=\; \mathtt{OMEGA\_MONAD} \;=\; 4\pi^3 + \pi^2 + \pi \;\approx\; 137.036 \;=\; \alpha^{-1}.
\end{equation}
From $\Omega$ the layer fractions are derived (all in
\texttt{Ged/lu\_system/quat\_s3.py}):
\[
  \mathtt{FRAC\_EDGE} = \frac{\pi}{\Omega}, \quad
  \mathtt{FRAC\_BOUNDARY} = \frac{\pi^2}{\Omega}, \quad
  \mathtt{FRAC\_BULK} = \frac{4\pi^3}{\Omega}.
\]
These appear in the MDL score of \texttt{weld} as the layer-complexity term,
making the bind operation sensitive to the three-layer ontological structure.
A morphism that passes through the edge layer ($\mathtt{FRAC\_EDGE} \approx 2\%$)
contributes a lower complexity penalty than one through the bulk ($\approx 90\%$).

\subsection{\texttt{BREATH\_PERIOD} and Temporal Binding}

\begin{equation}
  \mathtt{BREATH\_PERIOD} \;=\; \pi \cdot \Omega \;=\; \pi\,(4\pi^3+\pi^2+\pi)
  \;\approx\; 430.5\;\text{s}.
\end{equation}
This constant (implemented identically in \texttt{Ged/ged/wheel.py} and
\texttt{Lumen/muaddib.py}, module constant \texttt{BREATH\_PERIOD}) sets the
temporal scale of one full Wheel cycle.
A sietch publication older than $2 \times \mathtt{BREATH\_PERIOD}$ is declared
stale and excluded from the geodesic centroid computation that produces
$q_{\text{system}}$ (\texttt{muaddib.py}, \texttt{SietchPublication.is\_stale}).

The monad interpretation: each ``breath'' (one \texttt{BREATH\_PERIOD}) is one
full application of the renormalization operator $R$ from Paper~00.
The system breathes at the rate $1/(\pi\,\alpha^{-1})$ Hz, completing one
full monadic cycle per breath.

\begin{remark}[TBS]\label{rmk:tbs:P034_3_c}
The identification $\mathtt{BREATH\_PERIOD} = \pi \cdot \alpha^{-1} \approx 430.5\,\text{s}$ as the ``temporal scale of one full Wheel cycle'' and ``one full application of the renormalization operator $R$'' is asserted without derivation. Two gaps: (i)~The formula $\pi \cdot \alpha^{-1}$ has units of seconds only if one of $\pi$ or $\alpha^{-1}$ carries a unit of time; neither is a physical time in SI units (both are dimensionless). The value $\approx 430.5\,\text{s}$ must be the result of an unstated identification with some physical time scale (e.g., one revolution of a physical oscillator, or a metabolic rhythm). That identification is not given here or in Paper~00. (ii)~The claim that this constant is a ``categorical invariant'' because it is computed from $\pi$ alone does not follow: categorical invariants of a monad are structure-preserving (they are invariant under monad morphisms), not merely numerical constants derived from transcendental numbers. The constant $\pi \cdot \alpha^{-1}$ is frozen by convention, not by any categorical universality argument.
\end{remark}

\paragraph{Status.} Retired. The registry records P034\_3\_c as closed by A265, A273, and A275, which supplied the unit bridge and the dynamical grounding of \texttt{BREATH\_PERIOD}. The remark above stands as the record of the original gap. Ledger: Paper 40.

\subsection{Frozen Constants as Categorical Invariants}

Because $\Omega$ and $\mathtt{BREATH\_PERIOD}$ are computed from $\pi$ alone
(no free parameters), they are \emph{categorically invariant}:
every morphism in $\mathbf{Kl}(T)$ respects the same metric structure,
and Kleisli composition cannot introduce new scales.
This is the categorical analog of the ToE's ``no free parameters'' principle.

% ─────────────────────────────────────────────────────────────────────────────
\section{The Tri-Net as Kleisli Composition}

The three-net space of LumenOS
(\texttt{Ged/nets/trinet/traversal\_grammar.py}) maps directly onto the
monad structure:
\begin{center}
\begin{tabular}{llll}
\toprule
Net & Layer & Fraction & Kleisli role \\
\midrule
WordNet   & bulk       & $4\pi^3/\Omega \approx 90\%$ & Kleisli objects (semantic states) \\
SymbolNet & boundary   & $\pi^2/\Omega \approx 7\%$   & Kleisli morphisms (formal rules) \\
NumberNet & edge       & $\pi/\Omega \approx 2\%$     & Kleisli fixpoints (exact values) \\
\bottomrule
\end{tabular}
\end{center}
A canonical chain word $\to$ symbol $\to$ number is a Kleisli morphism
$q_{\text{word}} \to q_{\text{symbol}} \to q_{\text{number}}$,
i.e., the Kleisli composition of two attention steps.
The chain \texttt{trace} string ``-0+'' records the polarity path through
the three layers, which is the categorical shadow of the morphism.

The DENOTES relation (word $\to$ symbol) and INSTANTIATES relation
(symbol $\to$ number) are the two component Kleisli morphisms;
their composition is the full traversal chain, and
\texttt{traversal\_chain()} in \texttt{traversal\_grammar.py}
implements this composition directly.

% ─────────────────────────────────────────────────────────────────────────────
\section{Summary}

\begin{theorem}[Monad Existence]\label{thm:monad}
The triple $(T, \eta, \mu)$ with
\begin{align*}
  T(S^3) &= \text{scored distributions over } S^3, \\
  \eta(q) &= \delta_q \quad (\text{point distribution, implemented as }
             \mathtt{\_geodesic\_centroid}), \\
  \mu(M)  &= \eta(\text{weighted union of } M) \quad
             (\text{implemented by }\mathtt{weld}),
\end{align*}
satisfies the three monad laws (Theorems~\ref{thm:left-id}--\ref{thm:assoc})
exactly on the collinear locus in $\mathbb{R}^4$, and approximately otherwise.
Hemisphere confinement (enforced by sign-alignment in
\texttt{\_geodesic\_centroid}) removes the double-cover ambiguity but does not
restore exactness: associativity fails for non-collinear points even within a
hemisphere, per Remark~\ref{rmk:tbs:P034_2_c}; the gap stands as
P034\_2\_c.
\end{theorem}

\noindent The key correspondences, gathered for reference:

\begin{center}
\begin{tabular}{lll}
\toprule
Category theory & LumenOS code & Location \\
\midrule
Monad carrier $T(S^3)$ & \texttt{WheelState} / oracle result list & \texttt{wheel.py}, \texttt{oracle.py} \\
\textsf{return} / $\eta$ & \texttt{\_geodesic\_centroid()} & \texttt{flush.py} \\
Bind / ${\bind}$ & \texttt{fork()} $+$ \texttt{weld()} & \texttt{wheel.py} \\
Kleisli morphism & attention step / oracle query & \texttt{oracle.py}, \texttt{wheel.py} \\
Kleisli composition & \texttt{depends\_on} sequencing & \texttt{planning\_domain.py} \\
Fixpoint / $\Omega$ & \texttt{plateau()} & \texttt{wheel.py} \\
$q_{\text{system}}$ & \texttt{cursor\_quaternion} & \texttt{muaddib.py} \\
Attention kernel & \texttt{hopf\_lapse(q\_rel(\ldots))} & \texttt{quat\_s3.py} \\
Layer scale & \texttt{FRAC\_EDGE/BOUNDARY/BULK} & \texttt{quat\_s3.py} \\
Temporal scale & \texttt{BREATH\_PERIOD} = $\pi\,\alpha^{-1}$ & \texttt{wheel.py}, \texttt{muaddib.py} \\
Plateau threshold & $\delta_P = 0.02$ (calibration) & \texttt{wheel.py} \\
Derived threshold & $\pi/\Omega \approx 0.0229$ (recommended) & \texttt{quat\_s3.py} \\
\bottomrule
\end{tabular}
\end{center}

% ─────────────────────────────────────────────────────────────────────────────
\section{Open Question}

\begin{remark}[Plateau threshold derivation]
Whether $\delta_P = 0.02$ can be derived from first principles (e.g., as a
truncation of $\pi/\Omega$, or as the reciprocal of a combinatorial factor)
is left as an open question.
Until a derivation exists, implementations should use $\pi/\Omega$
(\texttt{FRAC\_EDGE}) as the geometrically grounded threshold.
The change from 0.02 to $\pi/\Omega \approx 0.0229$ relaxes the convergence
criterion by approximately $\text{15\%}$; this should be validated
experimentally before adoption.
\end{remark}

\begin{thebibliography}{99}

\bibitem{paper00}
L.~F.~Vlegels, ``Rosetta Map of the Monad Identity and the Geometric Theory
of Everything,'' This volume, Paper~00 (2025).

\bibitem{paper04}
L.~F.~Vlegels, ``The Three-Layer Ontology,'' This volume, Paper~04 (2025).

\bibitem{paper08}
L.~F.~Vlegels, ``Time Observation Bootstrap,'' This volume, Paper~08 (2025).

\bibitem{paper18}
L.~F.~Vlegels, ``The Master Operator: Assembly of the Unified Field Operator,''
This volume, Paper~18 (2025).

\bibitem{paper27}
L.~F.~Vlegels, ``Universal Wave Geometry,'' This volume, Paper~27 (2025).

\bibitem{paper31}
L.~F.~Vlegels, ``Nicomachus Weights and Monad Closure,'' This volume,
Paper~31 (2026).

\bibitem{moggi1991}
E.~Moggi, ``Notions of computation and monads,''
\textit{Information and Computation} \textbf{93}(1), 55--92 (1991).

\bibitem{wadler1992}
P.~Wadler, ``The essence of functional programming,''
\textit{Proc.\ 19th POPL}, 1--14 (1992).

\end{thebibliography}

\end{document}
