---
name: categories-functors-71b4b2bc8156
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.


---
Source attribution: vibeeval
Original project: https://github.com/vibeeval/vibecosystem/blob/3b763b1fb288f57bfa3cce76ef18184b96461a78/skills/math/category-theory/categories-functors/SKILL.md
License: MIT
License information: https://opensource.org/license/mit
Original upstream instructions; downloaded from Mega AI Hub.

## Upstream license notice

MIT License

Copyright (c) 2026 vibeeval

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.



# Mega AI Hub resource metadata

Creator / publisher: vibeeval
Original project: https://github.com/vibeeval/vibecosystem/blob/3b763b1fb288f57bfa3cce76ef18184b96461a78/skills/math/category-theory/categories-functors/SKILL.md
Attribution basis: Source repository record

Fields of work: Data & Analytics, Development & Engineering, Education & Research
Roles: Data Scientist, ML / AI Engineer, Researcher
Specialties: API
Tools: Lean4
Country applicability: Country not specified
Classification basis: Source catalog labels
Instruction SHA-256: 15dc40b8f51338da2e4936faaa4c902c8c9576211ba0abed3e872ad7a8a8d659
