directed-interval

Directed interval type 2 axiomatizing (0 → 1). Time-directed homotopy for reactions.

16 stars

Best use case

directed-interval is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Directed interval type 2 axiomatizing (0 → 1). Time-directed homotopy for reactions.

Teams using directed-interval should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/directed-interval/SKILL.md --create-dirs "https://raw.githubusercontent.com/plurigrid/asi/main/ies/music-topos/.codex/skills/directed-interval/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/directed-interval/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How directed-interval Compares

Feature / Agentdirected-intervalStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Directed interval type 2 axiomatizing (0 → 1). Time-directed homotopy for reactions.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# 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."