home / skills / plurigrid / asi / infinity-categories

infinity-categories skill

/skills/infinity-categories

This skill enables you to model and reason about infinity-categories, Kan complexes, and Segal spaces to organize complex topological data workflows.

npx playbooks add skill plurigrid/asi --skill infinity-categories

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
5.8 KB
---
name: infinity-categories
description: Higher category theory via simplicial sets, Kan complexes, (∞,1)-categories, Segal spaces, ∞-cosmos, and straightening-unstraightening
version: 1.0.0
---

# Infinity Categories Skill: Higher Category Theory for BCI

**Status**: Production Ready
**Trit**: +1 (PLUS - generator)
**Color**: #D826A0 (Magenta)
**Principle**: ∞-categories are the universal framework in which all homotopy-coherent algebra lives
**Frame**: ∞-cosmos of BCI signal worlds with Kan complexes as mapping spaces

---

## Overview

**Infinity Categories** provide the universal framework for the entire BCI pipeline. All previous layers (1-22) embed naturally into the ∞-categorical setting. Implements:

1. **Simplicial sets**: X_0 (objects), X_1 (morphisms), X_2 (homotopies), ... with face/degeneracy maps
2. **Kan complexes**: All horns fillable (∞-groupoids)
3. **Quasi-categories**: Inner horns fillable ((∞,1)-categories)
4. **Segal spaces**: Segal condition X_n ~ X_1 ×_{X_0} ... ×_{X_0} X_1
5. **Complete Segal spaces**: X_equiv ~ X_0 (equivalences = objects up to homotopy)
6. **∞-Cosmos** (Riehl-Verity): Model-independent framework with mapping Kan complexes
7. **∞-Functors**: Maps of simplicial sets preserving structure
8. **∞-Adjunctions**: L ⊣ R with unit/counit up to coherent homotopy
9. **∞-Limits/colimits**: Homotopy coherent universal constructions
10. **Straightening-unstraightening**: Grothendieck construction (∞-Yoneda)

**Correct by construction**: GF(3) triadic structure maps to (Cof, W, Fib) in the underlying model structure.

## Core Formulae

```
Simplicial set X : Δ^op → Set
  Face maps d_i : X_n → X_{n-1}  (0 ≤ i ≤ n)
  Degeneracy maps s_i : X_n → X_{n+1}  (0 ≤ i ≤ n)
  Simplicial identities: d_i d_j = d_{j-1} d_i for i < j

Kan complex (∞-groupoid):
  Every horn Λ^n_k → X extends to Δ^n → X  (all 0 ≤ k ≤ n)

Quasi-category ((∞,1)-category):
  Every inner horn Λ^n_k → X extends to Δ^n → X  (0 < k < n)

Segal condition:
  X_n → X_1 ×_{X_0} X_1 ×_{X_0} ... ×_{X_0} X_1  is a weak equivalence

∞-Cosmos K (Riehl-Verity):
  Objects: ∞-categories
  Mapping spaces: Map_K(A, B) are Kan complexes
  Isofibrations: p : E ↠ B with RLP w.r.t. inner horn inclusions
  Comma objects: slice constructions A/f

∞-Adjunction L ⊣ R : A ↔ B:
  Unit η : id_A ⇒ RL
  Counit ε : LR ⇒ id_B
  Triangle identities: (ε∘L)(L∘η) ~ id_L, (R∘ε)(η∘R) ~ id_R

Straightening-Unstraightening:
  Left fibrations over B ≃ ∞-functors B → Spaces
  (∞-categorical Grothendieck construction / Yoneda lemma)
```

## Gadgets

### 1. SimplicialSet

Build simplicial sets from BCI signal chains:

```clojure
(defn world-to-simplicial [world-tag signals]
  (let [n (count signals)
        x0 n, x1 (dec n), x2 (max 0 (- n 2)), x3 (max 0 (- n 3))]
    {:dims [x0 x1 x2 x3]
     :euler (reduce + (map-indexed (fn [i d] (* (if (even? i) 1 -1) d)) [x0 x1 x2 x3]))}))
```

### 2. HornFilling

Check Kan and quasi-category conditions:

```clojure
(defn horn-filling-check [simplicial-set]
  ;; Inner horn filler ratio based on signal regularity
  ;; Outer horn filler = 0.7 × inner
  {:quasi-category? (every? :inner-fillable? checks)
   :kan-complex? (every? #(and (:inner-fillable? %) (:outer-fillable? %)) checks)})
```

### 3. InfinityFunctor

Maps between ∞-categories preserving simplicial structure:

```clojure
(defn infinity-functor [w-source w-target transform-fn]
  ;; Check functoriality: preserves composition (differences map consistently)
  {:functorial? (< variance-of-diff-ratios 0.5)})
```

### 4. StraighteningUnstraightening

Grothendieck construction:

```clojure
(defn straightening [world-base worlds-fiber]
  ;; Left fibration → functor B → Spaces
  ;; For each vertex b in B, compute fiber F_b
  ...)
(defn unstraightening [functor-data]
  ;; Functor B → Spaces → left fibration over B
  ;; Total space E = union of fibers
  ...)
```

## Key Results

```
BCI Simplicial Sets:
  world-a: X_0=4, X_1=3, X_2=2, X_3=1 (Euler=2)
  world-b: X_0=4, X_1=3, X_2=2, X_3=1 (Euler=2)
  world-c: X_0=4, X_1=3, X_2=2, X_3=1 (Euler=2)

Horn Filling:
  world-b: quasi-category YES, Kan complex YES (uniform signals)
  world-a: quasi-category NO (inner fill=0.500, irregular signals)
  world-c: quasi-category NO (inner fill=0.222, high diversity)

Segal Spaces:
  All 3 worlds satisfy Segal condition (ratio=1.000)
  world-a, world-b: complete Segal spaces
  world-c: Segal but not complete (no equivalences)

∞-Cosmos:
  Mapping spaces: dim_0=16, dim_1=9 (Kan complexes)
  Isofibrations: b→a, b→c, a→c verified
  3 ∞-functors constructed, all functorial

∞-Adjunction (compress ⊣ expand):
  ||unit|| = 0.112, ||counit|| = 0.100
  Quality: 0.825, ∞-Adjunction: YES

∞-Limits/Colimits:
  lim^∞ = [0.523, 0.223, 0.413, 0.120] (coherent)
  colim^∞ = [2.053, 1.213, 1.493, 0.840] (coherent)
```

## BCI Integration (Layer 23)

Extends the **Higher Algebra Chain**: L14 → L19 → L20 → L21 → L22 → L23

- **L22 Model Categories**: Model cats present ∞-cats via N(C^cf)
- **L21 Derived Categories**: D(A) embeds as stable ∞-category
- **L20 Operadic Composition**: ∞-operads via dendroidal/Segal operads
- **L19 Sheaf Cohomology**: ∞-sheaves form ∞-topoi
- **L17 de Rham**: Quillen equivalence lifts to ∞-categorical equivalence
- **L8 Persistent Homology**: Persistence modules = ∞-functors from (R,≤)

**L23 is the UNIVERSAL FRAMEWORK**: all 22 previous layers embed naturally.

---

**Skill Name**: infinity-categories
**Type**: Simplicial Sets / Kan Complexes / ∞-Cosmos / Segal Spaces / Straightening
**Trit**: +1 (PLUS)
**GF(3)**: (+1) ∞-functor gen + (0) ∞-cosmos coord + (-1) Kan validator = 0

## Integration with GF(3) Triads

```
infinity-categories (+1) x model-categories (0) x derived-categories (-1) = 0
infinity-categories (+1) x information-geometry (0) x sheaf-cohomology-bci (-1) = 0
```

Overview

This skill implements higher category theory tools for Brain-Computer Integration (BCI) workflows using simplicial sets, Kan complexes, quasi-categories, Segal spaces, and the ∞-cosmos framework. It provides constructors and validators for simplicial data, horn-filling checks, ∞-functors, and straightening/unstraightening to translate fibrations into functors to spaces. The module treats ∞-categories as the universal homotopy-coherent framework that embeds earlier BCI layers into a single formalism.

How this skill works

The skill represents worlds as simplicial sets with explicit face and degeneracy data and computes invariants like Euler characteristics and dimension vectors. Horn-filling routines test inner and outer horn extensions to classify quasi-categories and Kan complexes. It builds ∞-functors by checking coherence of composition and variance, and it implements straightening/unstraightening as the Grothendieck construction to convert left fibrations over a base into functors into spaces and back. Mapping spaces are modeled as Kan complexes inside an ∞-cosmos, enabling model-independent reasoning about adjunctions, limits, and colimits.

When to use it

  • Model BCI signal chains as higher categorical objects when homotopy-coherent structure matters
  • Validate whether a dataset behaves like an ∞-groupoid or an (∞,1)-category via horn-filling tests
  • Construct or verify ∞-functors and adjunctions between BCI signal-worlds
  • Perform straightening/unstraightening to convert fibered data into functorial summaries
  • Compute homotopy-coherent limits and colimits for aggregated signal analyses

Best practices

  • Represent discrete signal stages as simplices with clear face/degeneracy assignments to avoid ambiguous compositions
  • Run inner and outer horn-filling diagnostics separately to distinguish quasi-categorical vs Kan behavior
  • Use Segal checks to confirm composition is homotopy-coherent before claiming categorical structure
  • Prefer ∞-cosmos mapping Kan complexes for model-independent constructions and comparisons
  • Validate unit and counit norms when asserting an ∞-adjunction; check triangle identities up to coherent homotopy

Example use cases

  • Translate layered BCI pipeline states into a simplicial set to detect homotopy-equivalent processing paths
  • Diagnose whether a signal world is an ∞-groupoid (full symmetry) or an (∞,1)-category (directed homotopies) using horn-filling ratios
  • Construct an ∞-functor between two BCI models to compare behaviors and propagate invariants
  • Apply straightening to produce a bundle-of-spaces view over a base experiment and unstraighten a predictive functor back into a fibration
  • Compute coherent ∞-limits/colimits of sensor networks to aggregate distributed observations while keeping homotopy data

FAQ

What distinguishes a Kan complex from a quasi-category in this skill?

A Kan complex requires fillers for all horns (modeling ∞-groupoids); a quasi-category requires only inner horns to fill (modeling (∞,1)-categories). The skill reports separate inner and outer filler ratios.

When should I use straightening versus keeping a left fibration representation?

Use straightening to expose a functorial summary B → Spaces for analysis, and keep the left fibration when you need explicit total-space geometry or to perform fiber-wise constructions.