from local micro-events to autonomous macro-processes
The event to process boundary
When does a collection of local micro-events become a coherent process? This playground instantiates a sheaf-theoretic answer: a process is a sheaf of trajectories over a site of time-intervals, where local sections glue consistently into global behavior.
Site and presheaf of micro-trajectories
The site is the poset category Int of time-intervals I⊆[0,T] with inclusions as morphisms.
A presheafX:Intop→Set assigns to each interval the set of admissible micro-histories on that interval. Restriction maps ρIJ:X(I)→X(J) truncate histories to sub-intervals.
The sheaf condition states: if local sections xi∈X(Ii) agree on overlaps, they glue to a unique global section x∈X(⋃Ii).
The viewer now surfaces pairwise and triple Čech diagnostics: each overlap reports max∣xi−xj∣ while triple overlaps verify the cocycle condition xi−xj+xj−xk+xk−xi=0. Failures are highlighted when exceeding the glue tolerance ε.
Coarse-graining as a natural transformation
The macro presheaf M assigns coarse-grained observables (here: moving averages) to each interval. Coarse-graining is a natural transformation:
q:X⇒M
Naturality ensures qJ∘ρIJX=ρIJM∘qI: the macro of a restriction equals the restriction of the macro.
We compute a commutativity matrix: each entry records the mean and max deviation between both sides of the square above, so you can see which inclusions are closest to a true natural transformation.
Closure and the Markov limit
A macro description becomes a true process when its dynamics are closed: future evolution depends only on the current macro-state, not the micro-history.
The Mori–Zwanzig formalism makes this precise. Coarse-graining produces an exact equation:
dtdm=R(m)+∫0tK(t−s)m(s)ds+η(t)
with drift R, memory kernel K, and noise η. When the kernel decays rapidly (timescale separation), the memory term vanishes and you get Markovian closure: the macro is a self-contained dynamical system.
The playground now fits a finite impulse-response kernel K(τi) with adjustable lag count, plots its shape, and runs a Ljung–Box test on the residuals to quantify whether the Markov model is statistically adequate.
Statistical diagnostics
Macro observables now expose higher moments, autocorrelation, and mutual information between overlapping intervals. These summaries help you identify when the sheafified process carries long memory, heavy tails, or strongly coupled overlaps.
How to explore
Turn Consistent restrictions off: local sections become independent, and strict sheaf gluing fails.
Add measurement noise: gluing fails unless tolerance ε is large enough.
Toggle Strict sheaf gluing off to see sheafification (best-fit descent repair).
Compare Markov vs memory models. Vary τ and watch the closure RMSE change.
Watch the multi-track panels: micro vs glued trajectory, macro vs reduced model, memory kernel bars, and autocorrelation all update live with the playback scrubber.
claude opus 4.8January 2026·first cut. builds the sheaf-and-closure pipeline: an event-driven micro-trajectory, an overlapping cover of [0, T], local sections with strict gluing or sheafification, pairwise and triple Cech overlap diagnostics, a moving-average coarse-graining checked for naturality, a Mori-Zwanzig memory-kernel fit with a Ljung-Box Markov test, and a calibration suite that pins the deterministic algebraic identities (cover partition, idempotent gluing, identity coarse-graining, exact linear-drift recovery).
v1.0January 2026
site and cover: [0, T] is covered by k overlapping intervals via buildCover, with an adjustable overlap fraction.
micro-process: a drift-plus-jump random walk (event rate lambda, jump scale stepSigma) generated by a seeded LCG for full determinism.
descent: local sections per interval, with consistent (restriction) or inconsistent (independent) mode; strict sheaf gluing versus weighted sheafification.
Cech diagnostics: pairwise overlap mismatch and triple-overlap cocycle spread, flagged against the glue tolerance epsilon.
coarse-graining: a centred moving average as the macro observable, with a commutativity matrix measuring how far q is from a natural transformation.
closure: Mori-Zwanzig reduced model (Markov vs exponential memory kernel), a finite-impulse-response kernel estimate with half-life, and a Ljung-Box residual test for Markovian adequacy.
calibration: six deterministic checks (cover tiles the line, cover cardinality, zero-spread gluing, idempotent gluing, identity coarse-graining, exact linear-drift recovery), all computed from the logic functions.