categories-functors — Claude Code skill: category theory
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.
MIT ★ 3,951 updated 2026-01-26
npx skills add parcadei/Continuous-Claude-v3 --skill categories-functors -a claude-codeWhat categories-functors does
The skill provides a step-by-step strategy for working with categories and functors. It starts by verifying category axioms: whether objects and morphisms exist, each object has an identity morphism, and composition is associative. Next it checks functor properties — preservation of identity and composition.
The skill covers functor types: covariant (preserves arrow direction), contravariant (reverses direction), and properties like faithfulness and fullness. It includes common functors: forgetful (drops structure), free (adjoint to forgetful), Hom-functor, and power set functor.
Verification uses Lean 4 with Mathlib — the lake build command type-checks proofs through the compiler. The skill references Lean 4 category theory syntax and provides theorem examples for associativity and composition.
What it helps with
- verify a structure satisfies category axioms
- prove a functor preserves identity and composition
- classify a functor as covariant, contravariant, or an equivalence
- construct a forgetful or free functor between categories
- verify a Lean 4 proof using the compiler
Example prompts for the agent
- Check whether the category axioms hold for this structure of objects and morphisms
- Prove that this functor preserves composition F(g ∘ f) = F(g) ∘ F(f)
- Write a Lean 4 proof of associativity (f ≫ g) ≫ h = f ≫ (g ≫ h)
How to install categories-functors
1Skills CLI (Vercel)
npx skills add parcadei/Continuous-Claude-v3 --skill categories-functors -a claude-code2Manually: put the files in place
~/.claude/skills/categories-functors/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/categories-functors/
1Skills CLI (Vercel)
npx skills add parcadei/Continuous-Claude-v3 --skill categories-functors -a codex2Manually: put the files in place
.agents/skills/categories-functors/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add parcadei/Continuous-Claude-v3 --skill categories-functors -a cursor2Manually: put the files in place
.cursor/skills/categories-functors/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install parcadei/Continuous-Claude-v3 .claude/skills/math/category-theory/categories-functors2Manually: put the files in place
.github/skills/categories-functors/SKILL.md1Skills CLI (Vercel)
npx skills add parcadei/Continuous-Claude-v3 --skill categories-functors -a gemini-cli2Platform CLI
gemini skills install https://github.com/parcadei/Continuous-Claude-v3 --path .claude/skills/math/category-theory/categories-functorsManually: put the files in place
.devin/skills/categories-functors/SKILL.mdThe legacy .windsurf/skills/ path still works
Claude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about categories-functors
How do I install categories-functors in Claude Code?
Run npx skills add parcadei/Continuous-Claude-v3 --skill categories-functors -a claude-code, then see ~/.claude/skills/categories-functors/SKILL.md for details and examples.
What does the categories-functors skill do?
It offers a step-by-step strategy for category theory problems: checking category axioms, analyzing functor properties, describing functor types, and verifying proofs in Lean 4.
What library does this skill use for proofs?
The skill works with Lean 4 and Mathlib, which has a complete implementation of category theory. Proofs are verified with lake build.
Source text
SKILL.md · MIT
---
name: categories-functors
description: "Problem-solving strategies for categories functors in category theory"
allowed-tools: [Bash, Read]
---
# Categories Functors
## When to Use
Use this skill when working on categories-functors problems in category theory.
## Decision Tree
1. **Verify Category Axioms**
- Objects and morphisms (arrows) defined?
- Identity morphism for each object: id_A: A -> A
- Composition associative: (f . g) . h = f . (g . h)
- Write Lean 4: `theorem assoc : (f ≫ g) ≫ h = f ≫ (g ≫ h) := Category.assoc`
2. **Check Functor Properties**
- F: C -> D maps objects to objects, arrows to arrows
- Preserves identity: F(id_A) = id_{F(A)}
- Preserves composition: F(g . f) = F(g) . F(f)
- Write Lean 4: `theorem comp : F.map (g ≫ f) = F.map g ≫ F.map f := F.map_comp`
3. **Functor Types**
- Covariant: preserves arrow direction
- Contravariant: reverses arrow direction
- Faithful/Full: injective/surjective on Hom-sets
- Equivalence: full, faithful, essentially surjective
4. **Common Functors**
- Forgetful functor: forgets structure (e.g., Grp -> Set)
- Free functor: left adjoint to forgetful
- Hom functor: Hom(A, -) or Hom(-, B)
- Power set functor: Set -> Set via X |-> P(X)
5. **Verify with Lean 4**
- Compiler-in-the-loop: write proof, `lake build` checks
- Mathlib has full category theory library
- See: `.claude/skills/lean4-functors/SKILL.md` for exact syntax
## Tool Commands
### Lean4_Category
```bash
# Lean 4 with Mathlib: import CategoryTheory.Category.Basic
```
### Lean4_Functor
```bash
# Lean 4: theorem map_comp (F : C ⥤ D) : F.map (g ≫ f) = F.map g ≫ F.map f := F.map_comp
```
### 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