\section{The topos-native kernel}\label{sec:kernel} The reasoning kernel is one kernel, and its layers are the units from which every part of the engine reasons. It computes over evidence atoms, covers and cellular sheaves without reference to mathematical worlds; the universe system's localisation, gluing, descent and transport are its operations applied to mathematical content \cite[Part~IV]{Spec2026}. Its theory is that of the second work \cite{TNI2026}. What this section adds is the form in which the engine computes it: each of the nine layers is a Lean module that computes the layer exactly over the rationals, and each verdict a layer returns is stated by a theorem of what it guarantees. \subsection{The tower of nine layers}\label{sec:kernel-tower} The kernel is a tower of nine layers (\cref{fig:layers}), and each constructs an object the next consumes. The dependency is visible in the types: one layer precedes another when the object it constructs appears in the type of the other's input. The order is therefore forced on a sub-poset and free elsewhere, so that an implementation may evaluate the free part in parallel and may not reorder the forced part. The layers are not a pipeline of peers but a tower over a base: the context site of the lowest layer is the base over which every other layer's object lives. In one phrase each, as \cref{fig:layers} labels them: L0, atoms, contexts, covers and the nerve; L1, a cellular sheaf on the nerve; L2, transport along the restriction maps; L3, the activation as a modality; L4, local sections made to agree on overlaps; L5, a class no vertex assignment reproduces; L6, truth as a sieve; L7, transport round the cycles of the nerve; and L8, what happens when the site changes. \begin{figure}[t] \centering \includegraphics[width=\textwidth]{figures/fig-layers.pdf} \caption{The nine layers of the kernel. Each layer constructs an object the next consumes; the computing layers are in cyan, the heads that certify in gold, and the layers that compare sites in blue.}\label{fig:layers} \end{figure} Two disciplines run through the tower. Every module carries a degeneration condition: a specialisation in which it reduces to its counterpart in a standard architecture, so that the construction is a strict extension rather than a replacement, and the degeneration is detectable. And a result is stored under its structure-carrying data, the site, the cover, the nerve, the restriction maps and the coefficient system, never under its values: two results with the same values and different structures are different results. \begin{proposition}[The order of the tower]\label{prop:tower} An evaluation order is accepted only when it lists the nine layers once and respects every forced pair: if the output of one layer appears in the input type of another, the first precedes the second. Two results whose structures differ are stored as two entries. \end{proposition} \lean{GaiMua.Kernel.Tower.checkOrder_sound, GaiMua.Kernel.Tower.insert_distinct} \subsection{L0: the context site}\label{sec:kernel-l0} The lowest layer turns evidence into a site. Evidence arrives as atoms; atoms carry provenance; and the contexts of reasoning are built from them rather than from spans of text. The construction is well defined for any input: for an arbitrary binary relation on atoms, such as the raw output of an entailment classifier, the transitive closure descends to a partial order on the quotient by mutual reachability, so that nothing is assumed about the classifier's quality \cite[Chapter~29]{Spec2026}. The contexts are the down-sets of that poset; they form a frame, and the frame is what makes the internal logic of L6 available. A cover of a target context is a family of contexts whose union is the target. Selecting a cover is where retrieval happens, and the engine keeps apart two notions that are easily confused: a minimal sufficient cover, which covers and of which no proper subfamily covers, and the output of a greedy routine, which maximises coverage relative to a budget and is reported as exactly that. \begin{proposition}[Sites and covers]\label{prop:l0} A site built by the context layer is certified: its coverage satisfies the three axioms of a finite site (\cref{def:site}). A family granted the status of minimal sufficient cover covers the target, and no proper subfamily of it does. The greedy routine never grants that status: its result is named a relative maximum coverage, with the minimality undetermined. \end{proposition} \lean{GaiMua.Context.buildSite_certified, GaiMua.Context.msc_sound, GaiMua.Context.selectGreedy_not_msc} \subsection{L1 and L2: sheaf embedding and descent attention}\label{sec:kernel-l1} Layer L1 is where value-carrying data enters the kernel. Over the nerve of the cover that L0 selected it places a cellular sheaf in the sense of \cite{HansenGhrist2019}: a finite-dimensional inner-product space at each vertex, a smaller one at each edge, and a linear restriction map from a vertex stalk to the stalk of each incident edge. The section channel is an element of \(C^0=\bigoplus_i\mathcal F(U_i)\), and the coboundary on an edge \(e\) oriented from \(i\) to \(j\) is \((\delta x)_e=\rho_{j\to e}x_j-\rho_{i\to e}x_i\). Layer L2 is attention rebuilt as descent: a section at one vertex is transported to another along the restriction maps of the shared edge, by \(P_{j\to i}=\rho_i^\top \rho_j\). Where a transformer mixes values by learned weights over all positions, descent attention moves information only along the restrictions of the sheaf, and a restriction that is the identity everywhere is the detectable degeneration to the standard case. \begin{proposition}[Functoriality and transport]\label{prop:l1} The restriction along a concatenated path is the composite of the restrictions along its pieces, so that the presheaf identity holds identically. The transport from \(j\) to \(i\) is the composite of its factors: for all \(x,y\), \(\langle P_{j\to i}x, y\rangle=\langle\rho_i y,\rho_j x\rangle\). \end{proposition} \lean{GaiMua.Sheaf.restrictPath_append, GaiMua.Sheaf.transport_adjoint} \subsection{L3 and L4: nucleus activation and the descent solver}\label{sec:kernel-l3} The two layers occupy the positions that a transformer block gives to its pointwise non-linearity and to nothing at all. L3 is the non-linearity, read as an operator on the frame of activations: a nucleus that closes a stalk onto a sublocale, so that passing through the activation acquires a logical reading rather than a numerical one. On the frame of extended reals with coordinatewise meets and joins, the closed nucleus at a threshold \(\theta\) is \(x\mapsto\max(x,\theta)\) coordinatewise. L4 has no counterpart in a standard architecture: it is the step at which locally computed sections are made to agree on overlaps, and its absence is the structural reason a transformer can emit a fluent average of two incompatible readings with no internal signal that it has done so \cite[Chapter~31]{Spec2026}. The descent solver minimises \(\lVert y-b\rVert^2+\tau\lVert\delta y\rVert^2\) over sections \(y\), for a declared step size \(\tau\ge0\). \begin{proposition}[The nucleus and the solver]\label{prop:l3} \begin{enumerate}[label=(\alph*)] \item The closed nucleus is idempotent, and the schedule composes: applying the threshold \(s\) and then \(t\) is the closed nucleus at \(s\vee t\). Stride-one pooling, by contrast, is not idempotent; the engine carries the counterexample. \item A checked solution \(x\) of the descent problem minimises the objective, and the excess of every other \(y\) is exactly \(\lVert y-x\rVert^2+\tau\lVert\delta(y-x)\rVert^2\). At step size zero the solver is the identity. \item A refused candidate is inert: if every row \(r\) of a candidate satisfies \(\delta r=0\), the candidate vanishes on every vector \(\delta^\top y\) of the essential subspace. \end{enumerate} \end{proposition} \lean{GaiMua.Nucleus.close_idem, GaiMua.Nucleus.close_comp, GaiMua.Nucleus.pool_not_idempotent, GaiMua.Glue.glue_minimises, GaiMua.Glue.glue_zero, GaiMua.Glue.inert_sound} \subsection{L5: the obstruction head}\label{sec:kernel-l5} Layer L5 is a structural read-out, and its claim runs in one direction only. It certifies that a declared, independently supplied edge datum is not representable as a vertex coboundary, and it certifies nothing else: not that the sheaf has no global section, and not that an answer is false. The source states the direction without qualification: ``a non-vanishing obstruction certifies incoherence, while a vanishing obstruction certifies nothing at all'' \cite[p.~726]{TNI2026}. The object L5 computes is the \v{C}ech complex of the cover, and its certificate is a least-squares decomposition of the edge datum \(b\) into a coboundary part and a residual \(h\). \begin{theorem}[The head reports only what it has checked]\label{thm:head} Let \(N\) be the nerve of a cover, \(b\) an edge datum and \(c\) a certificate that the head's checks accept. Then the squared norm of the residual \(h\) of \(c\) is at most \(\lVert\delta_0y-b'\rVert^2\) for every vertex assignment \(y\), where \(b'\) is the cocycle part of \(b\); and if \(h\neq0\), no vertex assignment \(y\) satisfies \(\delta_0y=b'\). For a relative datum, a checked dual certificate excludes every extension of the given section to a global one. \end{theorem} \lean{GaiMua.Obstruction.head_sound, GaiMua.Relative.relative_obstruction_sound} The fifth thesis asks the system to report where local information fails to glue and to abstain when independent overlap data are absent \cite[Thesis~5]{Theses2026}. L5 is the first half; the second is the rule that a head which cannot obtain independent evidence about an overlap abstains rather than inventing a value for it, and records the abstention (\cref{sec:const-abstain}). \subsection{L6: the internal logic head}\label{sec:kernel-l6} L6 evaluates statements in the internal language of the sheaf topos over the context site, and returns not a boolean but an element of the subobject classifier: a sieve, which records not only whether a proposition holds but on which part of the evidence it holds. At each context the truth values are the closed sieves, which form a complete Heyting algebra under inclusion. A proposition of the geometric fragment, built from atom-level probes by meets and joins, is evaluated to its support sieve, and a stage forces the proposition exactly when it belongs to the support, never when the support is merely non-empty. Implication, negation and the universal quantifier are refused unless a flag admits them, and are then marked as local to the site. Excluded middle holds only where the topos is Boolean, which on the context site happens exactly when the atom poset is an antichain, and the head reports it. \begin{proposition}[Forcing]\label{prop:l6} A stage forces a proposition exactly when it is a member of the proposition's support sieve, and it forces a conjunction exactly when it forces both conjuncts. The logic head is reported deletable exactly when the classifier is Boolean; a trivial shape of the site is not enough. \end{proposition} \lean{GaiMua.Logic.forces_iff_mem, GaiMua.Logic.forces_conj, GaiMua.Logic.deletable_iff_boolean} \subsection{L7 and L8: holonomy and change of base}\label{sec:kernel-l7} The last two layers carry the strongest and the weakest claims of the architecture. L7 computes the group generated by transporting a vector round the cycles of the nerve. A gap theorem of the source makes the natural complexity measure of that group a binary certificate rather than a score: it is either exactly zero or bounded below by a constant that depends only on the stalk dimension \cite[Chapter~34]{Spec2026}. L8 specifies what happens when the site itself changes, and the source predicts an asymmetry between the transport of facts and the transport of refusals along a morphism of sites; a failure of the Beck--Chevalley condition on a square of site maps is itself a certified obstruction (\cref{prop:actions}(b)). \begin{proposition}[Holonomy certificates]\label{prop:l7} A verdict that the holonomy group is virtually abelian carries a finite set of matrices that contains the identity and the generators and is closed under products: the generated group is that finite group. A certified grading rests on a nilpotent that the engine has checked. \end{proposition} \lean{GaiMua.Holonomy.closure_witness_sound, GaiMua.Holonomy.grading_nilpotent} The holonomy of \cref{sec:sub-descent} is the one-dimensional case of L7: for a descent datum with rational comparisons, the holonomy round a closed walk is a single number, and \cref{thm:holonomy} makes a value other than \(1\) a proof that no global object exists. \subsection{Learning under the obligation to glue}\label{sec:kernel-dgspo} The specification also states how the layers are to be trained, and its starting point is an identity proved in the library. For the \(n\) rewards \(r\) of one group of rollouts, the group-relative advantage used by policy-gradient methods is a quantity on the nerve of the group. \begin{proposition}[Advantage as a Laplacian]\label{prop:advantage} For \(r\colon\{1,\dots,n\}\to\Q\), the group-relative advantage at \(i\) equals \(\tfrac1n\) times the Laplacian of the complete graph on the group applied to \(r\), at \(i\). \end{proposition} \lean{GaiMua.advantage_eq_laplacian} The identity reads a training signal as a degree-zero cochain on the nerve of the rollouts, which the descent layers can constrain; the specification builds on it an objective that rewards gluing, and the licence table refuses the overstatements of what such an objective guarantees, among them that it reduces exactly to the published rule it extends and that any training result stands behind it. Version 1.0 trains no layer of the kernel; it computes every layer exactly, and the small rankers of the meta-layer (\cref{sec:evolution}) are its only learned components.