Skip to main content
skill CX Codex

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

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

What 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-code

2Manually: put the files in place

~/.claude/skills/categories-functors/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/categories-functors/

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

Similar skills

All skills for Science and research →

From the same set161

The whole set →
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 natural-transformations This skill guides category-theory work on natural transformations, with Lean 4 notation for checking naturality and applying related constructions. 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 search-tools search-tools is a Claude Code skill that routes code searches to LEANN, AST-grep, Morph, or Grep based on the task. CX Codex +1 ★ 3,951repo stars

Project sponsors

Companies that keep this analytics open