--- name: directed-interval description: Directed interval type 2 axiomatizing (0 โ†’ 1). Time-directed homotopy version: 1.0.0 --- # Directed Interval Skill > *"The directed interval 2 is the walking arrow: a single morphism 0 โ†’ 1."* > โ€” Riehl-Shulman ## Overview The **directed interval 2** replaces the undirected interval ๐•€ of cubical type theory with a directed version. This axiomatizes the notion of "time flows forward" essential for modeling reactions. ## Core Definitions (Rzk) ```rzk #lang rzk-1 -- CUBES: The category of directed cubes -- 2 is the basic directed interval [0 โ†’ 1] -- The directed interval (primitive) #define 2 : CUBE -- Endpoints #define 0โ‚‚ : 2 #define 1โ‚‚ : 2 -- The unique arrow (built-in) -- There is a morphism 0โ‚‚ โ†’ 1โ‚‚ but NOT 1โ‚‚ โ†’ 0โ‚‚ -- Higher cubes built from 2 #define 2ร—2 : CUBE := 2 ร— 2 -- Directed square (all arrows point same way) #define โ–ก : CUBE := 2 ร— 2 -- Simplex shapes #define ฮ”ยน : CUBE := 2 #define ฮ”ยฒ : CUBE := { (tโ‚, tโ‚‚) : 2 ร— 2 | tโ‚ โ‰ค tโ‚‚ } #define ฮ”ยณ : CUBE := { (tโ‚, tโ‚‚, tโ‚ƒ) : 2 ร— 2 ร— 2 | tโ‚ โ‰ค tโ‚‚ โˆง tโ‚‚ โ‰ค tโ‚ƒ } -- Hom type as extension type #define hom (A : U) (x y : A) : U := { f : 2 โ†’ A | f 0โ‚‚ = x โˆง f 1โ‚‚ = y } -- equivalently: (t : 2) โ†’ A [t โ‰ก 0โ‚‚ โ†ฆ x, t โ‰ก 1โ‚‚ โ†ฆ y] ``` ## Chemputer Semantics | Directed Cube Concept | Chemical Interpretation | |----------------------|------------------------| | 2 (interval) | Reaction progress (0% โ†’ 100%) | | 0โ‚‚ | Reactants (starting materials) | | 1โ‚‚ | Products | | hom A x y | Reaction pathway from x to y | | ฮ”ยฒ | Two-step synthesis (A โ†’ B โ†’ C) | | ฮ”ยณ | Three-step synthesis with associativity | | โ–ก (square) | Commuting reaction pathways | ## GF(3) Triad ``` segal-types (-1) โŠ— directed-interval (0) โŠ— rezk-types (+1) = 0 โœ“ ``` As a **Coordinator (0)**, directed-interval: - Mediates between validators and generators - Provides the "time axis" for computation - Enables transport along directed paths ## Extension Types The key innovation is **extension types** for partial elements: ```rzk -- Extension type: functions with prescribed boundary #define extension-type (I : CUBE) (ฯˆ : I โ†’ TOPE) (A : I โ†’ U) (a : (t : ฯˆ) โ†’ A t) : U := { f : (t : I) โ†’ A t | (t : ฯˆ) โ†’ f t = a t } -- This generalizes path types of cubical TT to directed setting ``` ## SplitMix64 Time Axis ```ruby # The directed interval in our system module DirectedInterval # Map SplitMix64 index to directed interval position def self.to_interval(index, max_index) # 0โ‚‚ = index 0, 1โ‚‚ = index max_index index.to_f / max_index.to_f end # Check if one interaction is "after" another in directed time def self.after?(i1, i2) i1.epoch > i2.epoch # Epoch = position on directed interval end # Directed hom: all interactions from x to y def self.hom(manager, x_epoch, y_epoch) manager.interactions.select do |i| i.epoch > x_epoch && i.epoch <= y_epoch end end end ``` ## Julia ACSet Integration ```julia # Directed interval as ACSet @present SchDirectedInterval(FreeSchema) begin Point::Ob Arrow::Ob src::Hom(Arrow, Point) tgt::Hom(Arrow, Point) # The unique arrow 0 โ†’ 1 # No arrow 1 โ†’ 0 (directedness) end @acset_type DirectedIntervalGraph(SchDirectedInterval) function walking_arrow() g = DirectedIntervalGraph() add_parts!(g, :Point, 2) # 0โ‚‚ and 1โ‚‚ add_part!(g, :Arrow, src=1, tgt=2) # The unique arrow g end ``` ## Key Properties 1. **No loops**: There is no morphism 1โ‚‚ โ†’ 0โ‚‚ (time irreversibility) 2. **Higher simplices**: ฮ”โฟ built from directed cubes model n-step processes 3. **Extension types**: Generalize path types to directed setting 4. **Cubical structure**: Compatible with cubical type theory machinery ## References - Riehl, E. & Shulman, M. (2017). "A type theory for synthetic โˆž-categories." ยง3. - [Rzk documentation](https://rzk-lang.github.io/rzk/) - Licata, D. & Harper, R. (2011). "2-Dimensional Directed Type Theory." ## Scientific Skill Interleaving This skill connects to the K-Dense-AI/claude-scientific-skills ecosystem: ### Graph Theory - **networkx** [โ—‹] via bicomodule - Universal graph hub ### Bibliography References - `general`: 734 citations in bib.duckdb ## Cat# Integration This skill maps to **Cat# = Comod(P)** as a bicomodule in the equipment structure: ``` Trit: 0 (ERGODIC) Home: Prof Poly Op: โŠ— Kan Role: Adj Color: #26D826 ``` ### GF(3) Naturality The skill participates in triads satisfying: ``` (-1) + (0) + (+1) โ‰ก 0 (mod 3) ``` This ensures compositional coherence in the Cat# equipment structure.