Categorical composition

From plurigrid/asi · View interactive version

Categorical composition is an AI agent skill from the GitHub repository plurigrid/asi. **Category:** Phase 3 Core - Compositional Architecture

How to use this skill

Skill file

Categorical Composition

Category: Phase 3 Core - Compositional Architecture

Status: Skeleton Implementation

Dependencies: None (foundational)

Overview

Implements categorical abstractions for compositional learning: Kan extensions for adapting between learning problems, higher adjunctions for bidirectional transformations, and functorial parameter transfer for compositional generalization.

Capabilities

Core Components

  1. Category Theory Primitives (category_theory.jl)
  1. Kan Extensions (kan_extensions.jl)
  1. Adjunctions (adjunctions.jl)
  1. Functorial Parameter Transfer (functorial_transfer.jl)

Integration Points

Usage

using CategoricalComposition

# Define source and target categories
C = FiniteCategory(objects=[:A, :B], morphisms=Dict(:f => (:A, :B)))
D = FiniteCategory(objects=[:X, :Y, :Z], morphisms=Dict(:g => (:X, :Y), :h => (:Y, :Z)))

# Define functor F: C -> D
F = Functor(
    source=C,
    target=D,
    object_map=Dict(:A => :X, :B => :Y),
    morphism_map=Dict(:f => :g)
)

# Compute left Kan extension
G = Functor(source=C, target=Set, object_map=Dict(:A => [1,2], :B => [3,4]))
Lan_F_G = left_kan_extension(F, G)

# Verify adjunction
@assert check_adjunction(Lan_F_G, restriction_functor(F))

References

Implementation Status

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.