Skip to content
ctp-yoneda logo

CTP-Yoneda Skill

ctp-yoneda

CTP-Yoneda Skill

plurigrid/asi0installs67stars

SKILL.md

Full skill instructions

CTP-Yoneda Skill

"The Yoneda lemma is arguably the most important result in category theory." — Emily Riehl

Category Theory in Programming (CTP) by NoahStoryM - Racket tutorial mapping abstract CT concepts to programming constructs with GF(3) colored awareness.

Overview

Source: NoahStoryM/​ctp
Docs: docs.racket-lang.org/​ctp
Local: .topos/​ctp/

Chapters (GF(3) Colored)

#ChapterTritColorStatus
1Category+1#E67F86✓ Complete
2Functor-1#D06546✓ Complete
3Natural Transformation0#1316BB✓ Complete
4Yoneda Lemma+1#BA2645Planned
5Higher Categories-1#49EE54Planned
6(Co)Limits0#11C710Planned
7Adjunctions+1#76B0F0Planned
8(Co)Monads-1#E59798Planned
9CCC & λ-calculus0#5333D9Planned
10Toposes+1#7E90EBPlanned
11Kan Extensions-1#1D9E7EPlanned

GF(3) Sum: (+1) + (-1) + (0) + (+1) + (-1) + (0) + (+1) + (-1) + (0) + (+1) + (-1) = 0 ✓ BALANCED

Core Concepts

Category (Chapter 1)

  • Objects, morphisms, composition, identity
  • Digraphs → Free categories
  • Subcategories, product/​coproduct categories
  • Quotient categories, congruence relations

Functor (Chapter 2)

  • Structure-preserving maps between categories
  • Constant, opposite, binary functors
  • Hom functors (covariant/​contravariant)
  • Free monoid/​category functors
  • Finite automata as functors (DFA, NFA, TDFA)

Natural Transformation (Chapter 3)

  • Morphisms between functors
  • Functor categories
  • Vertical/​horizontal composition
  • Whiskering

Yoneda Lemma (Key Insight)

Nat(Hom(A, -), F) ≅ F(A)

Every object is completely determined by its relationships to all other objects.

Code Examples

Located in .topos/​ctp/​scribblings/​code/:

Category Examples

  • Set.rkt - Category of sets
  • Rel.rkt - Category of relations
  • Proc.rkt - Category of procedures
  • Pair.rkt - Product category
  • Matr.rkt - Matrix categories
  • List.rkt - List monoid as category
  • Nat.rkt - Natural numbers

Functor Examples

  • DFA.rkt - Deterministic finite automata
  • NFA.rkt - Nondeterministic finite automata
  • TDFA.rkt - Typed DFA
  • Set->Rel.rkt - Set to Relation functor
  • P_*.rkt, P^*.rkt, P_!.rkt - Powerset functors
  • SliF.rkt, coSliF.rkt - Slice functors

Racket Integration

# Install CTP package
cd .topos/​ctp && raco pkg install

# Build documentation
raco setup --doc-index ctp

# Open docs
open doc/​ctp/​index.html

Connection to Music-Topos

CTP ConceptMusic-Topos Implementation
CategoryACSets schema
FunctorGeometric morphism
Natural TransformationSchema migration
YonedaRepresentable presheaves
LimitsPullbacks in DuckDB
AdjunctionsGalois connections
MonadsComputation contexts

Colored Awareness Protocol

When reading CTP files, each touched file gets a deterministic color:

# Track file access with Gay.jl colors
seed = 1069
files_touched = []

def touch_file(path, index)
  color = gay_color_at(seed, index)
  files_touched << { path: path, color: color, trit: color[:trit] }
end

Current session colors (seed=1069):

  1. #E67F86 (+1) - info.rkt
  2. #D06546 (-1) - main.rkt
  3. #1316BB (0) - ctp.scrbl
  4. #BA2645 (+1) - category/​main.scrbl
  5. #49EE54 (-1) - functor/​main.scrbl
  6. #11C710 (0) - natural transformation/
  7. #76B0F0 (+1) - code examples

References

Commands

# View CTP docs
just ctp-docs

# Run CTP examples
just ctp-examples

# Verify GF(3) coloring
just ctp-colors

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

  • category-theory: 139 citations in bib.duckdb

Cat# Integration

This skill maps to Cat# = Comod(P) as a bicomodule in the equipment structure:

Trit: 0 (ERGODIC)
Home: Presheaves
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.

More skills from plurigrid

cargo logo
plurigrid/asi

cargo

Rust package manager (36 subcommands).

67 0
View

Translate Figma nodes into production-ready code with 1:1 visual fidelity using the Figma MCP workflow (design context, screenshots, assets, and project-convention translation). Trigger when the user provides Figma URLs or node IDs, or asks to implement designs or components that must match Figma...

67 0
View

**Status**: 🌳 Production Ready (upstream in StringZilla v3+) **Type**: High-Performance String Operations / SIMD-Accelerated Text Processing **Principle**: Zero-copy views, SIMD/SWAR acceleration, deterministic hashing **Frame**: Cross-language interoperability (C, C++, Python, Rust, Go, Swift, ...

67 0
View
conformal-ga logo
plurigrid/asi

conformal-ga

Conformal Geometric Algebra (CGA) for circles, spheres, and Möbius transformations

67 0
View

Verifies code implements exactly what documentation specifies for blockchain audits. Use when comparing code against whitepapers, finding gaps between specs and implementation, or performing compliance checks for protocol implementations.

67 0
View
zig-systems logo
plurigrid/asi

zig-systems

Systems programming and performance optimization using Zig. Provides low-level abstractions, memory-safe compiled code, and performance benchmarking. Use for system-level operations, optimization, and interoperability with C/POSIX APIs.

67 0
View
soliton-detection logo
plurigrid/asi

soliton-detection

Topological soliton detection and agency bridge with anyonic fusion algebra for concept composition

67 0
View
paypal-mcp logo
plurigrid/asi

paypal-mcp

PayPal MCP server integration for invoices, payments, subscriptions, disputes, and transaction reporting via @paypal/mcp.

67 0
View
unison logo
plurigrid/asi

unison

Unison language - content-addressed functional programming with abilities for effects, distributed computing, and structural types. Use for pure functional code, effect management, distributed systems, and refactoring-safe codebases.

67 0
View
tasks-acset logo
plurigrid/asi

tasks-acset

Google Tasks management via TasksACSet. Transforms task operations into GF(3)-typed Interactions, routes to triadic queues, detects saturation for task-zero-as-condensed-state.

67 0
View
c logo
plurigrid/asi

c

World C Skill

67 0
View
syrup logo
plurigrid/asi

syrup

Syrup binary serialization for OCapN/CapTP wire format. Canonical encoding for capability messages.

67 0
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View