Skip to main content
skill CX Codex

natural-transformations — Claude Code skill for category theory

This skill guides category-theory work on natural transformations, with Lean 4 notation for checking naturality and applying related constructions.

MIT ★ 3,951 updated 2026-01-26

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add parcadei/Continuous-Claude-v3 --skill natural-transformations -a claude-code
Open on GitHub

What natural-transformations does

The skill lays out a way to analyze a natural transformation: check the naturality condition for each morphism, then inspect its components. Further sections cover natural isomorphisms, functor categories, and the Yoneda lemma.

Lean 4 examples name Mathlib constructions such as NatTrans.vcomp, NatTrans.hcomp, and CategoryTheory.yonedaEquiv. The skill also points to lake build for checking a project build. That check depends on having a Lean 4 project set up for compilation; the skill itself is not a compiler.

What it helps with

  • verify the naturality condition for a morphism
  • inspect components of a natural transformation
  • relate two functors through a natural isomorphism
  • choose vertical or horizontal composition
  • apply the Yoneda lemma in Lean 4

Example prompts for the agent

  • Check the naturality condition for this transformation and write it in Lean 4.
  • Show how to define the components of η : F ⟶ G in Lean 4.
  • Explain how to use CategoryTheory.yonedaEquiv in this proof.

How to install natural-transformations

1Skills CLI (Vercel)

npx skills add parcadei/Continuous-Claude-v3 --skill natural-transformations -a claude-code

2Manually: put the files in place

~/.claude/skills/natural-transformations/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/natural-transformations/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about natural-transformations

How do I install natural-transformations in Claude Code?

Run npx skills add parcadei/Continuous-Claude-v3 --skill natural-transformations -a claude-code. The skill file is at ~/.claude/skills/natural-transformations/SKILL.md.

What does natural-transformations do?

It provides a workflow for reasoning about natural transformations, natural isomorphisms, functor categories, and the Yoneda lemma, with Lean 4 examples.

Do I need Lean 4 to use this skill?

Its code examples use Lean 4 and Mathlib notation. To check a build, use lake build in a configured Lean 4 project.

Source text

SKILL.md · MIT
---
name: natural-transformations
description: "Problem-solving strategies for natural transformations in category theory"
allowed-tools: [Bash, Read]
---

# Natural Transformations

## When to Use

Use this skill when working on natural-transformations problems in category theory.

## Decision Tree


1. **Verify Naturality**
   - eta: F => G is natural transformation between functors F, G: C -> D
   - For each f: A -> B in C, diagram commutes:
     G(f) . eta_A = eta_B . F(f)
   - Write Lean 4: `theorem nat : η.app B ≫ G.map f = F.map f ≫ η.app A := η.naturality`

2. **Component Analysis**
   - eta_A: F(A) -> G(A) for each object A
   - Each component is morphism in target category D
   - Lean 4: `def η : F ⟶ G where app := fun X => ...`

3. **Natural Isomorphism**
   - Each component eta_A is isomorphism
   - Functors F and G are naturally isomorphic
   - Notation: F ≅ G (NatIso in Mathlib)

4. **Functor Category**
   - [C, D] has functors as objects
   - Natural transformations as morphisms
   - Vertical composition: Lean 4 `CategoryTheory.NatTrans.vcomp`
   - Horizontal composition: `CategoryTheory.NatTrans.hcomp`

5. **Yoneda Lemma Application**
   - Nat(Hom(A, -), F) ~ F(A) naturally in A
   - Lean 4: `CategoryTheory.yonedaEquiv`
   - Fully embeds C into [C^op, Set]
   - See: `.claude/skills/lean4-nat-trans/SKILL.md` for exact syntax


## Tool Commands

### Lean4_Naturality
```bash
# Lean 4: theorem nat : η.app B ≫ G.map f = F.map f ≫ η.app A := η.naturality
```

### Lean4_Nat_Trans
```bash
# Lean 4: def η : F ⟶ G where app := fun X => component_X
```

### Lean4_Yoneda
```bash
# Lean 4: CategoryTheory.yonedaEquiv -- Yoneda lemma
```

### Lean4_Build
```bash
lake build  # Compiler-in-the-loop verification
```

## Cognitive Tools Reference

See `.claude/skills/math-mode/SKILL.md` for full tool documentation.

© parcadei · MIT · parcadei/Continuous-Claude-v3

Similar skills

All skills for Programming languages →

From the same set161

The whole set →
predicate-logic A skill for tackling predicate logic in mathematical logic. Handles quantifier analysis, normal form conversion, proof construction, and countermodel search. CX Codex +1 1installs prime-numbers Skill for working with prime numbers in graph and number theory. Offers strategies for primality testing (trial division, Miller-Rabin, AKS), factorization, and applications of Fermat's and Wilson's theorems through Bash and Read tools. CX Codex +1 1installs matrices matrices — a skill for matrix operations: identifies types, performs arithmetic, solves linear systems. Includes decompositions like LU, QR, SVD and works across Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, and OpenCode. CX Codex +1 1installs leann-search leann-search runs semantic code queries against a LEANN vector index when exact keyword matches fall short. CX Codex +1 ★ 3,951repo stars categories-functors categories-functors — a skill for solving category and functor problems in category theory. Validates axioms, checks functor properties, and verifies proofs in Lean 4 via compiler. CX Codex +1 ★ 3,951repo stars limits-colimits limits-colimits is a Claude Code skill that provides decision workflows for category theory limits and colimits, including Lean 4 proof formalization and SymPy calculations. CX Codex +1 ★ 3,951repo stars llm-tuning-patterns The llm-tuning-patterns skill recommends LLM settings for theorem proving, code generation, and creative work. Use it to choose token limits and temperature for a specific task. CX Codex +1 ★ 3,951repo stars research-codebase research-codebase — a subagent that automatically documents your codebase. It spawns specialized agents in parallel to locate files, analyze code logic, find usage patterns, and synthesize findings into a single technical report. CX Codex ★ 3,951repo stars

Project sponsors

Companies that keep this analytics open