agentleFS
r-irber-irbe/proof-skills/skills/lean-math-foundations/SKILL.md

lean-math-foundations

Skill3 starsChanged 24 days agoApache-2.0View on GitHub

USE FOR: foundational mathematics in Lean 4: Lean's type system (Prop / Type / universes). DO NOT USE FOR: applied lattice instances such as severity / quality-gate lattices. TRIGGERS: type universe, Prop vs Type, classical reasoning.

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 0 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    If the answer is a specific proof, handoff to @lean-proof.

    line 46
  2. Very specific:

    STOP if a foundational choice silently introduces a new axiom — #print axioms must show only propext, Classical.choice, Quot.sound (and …

    line 52
  3. Very specific:

    STOP and handoff to @lean-research if the question is about a result not present in Mathlib at the current pin (e.g., a new …

    line 57

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Lean 4 Mathematical Foundations

Guide to formalizing foundational mathematics in Lean 4, covering the structures and patterns that underpin all domain-specific formalization work.

Routing

  • USE FOR: foundational mathematics in Lean 4 — Lean's type system (Prop / Type / universes), classical vs constructive choices, Mathlib's algebraic typeclass hierarchy (Group / Ring / Order / Lattice / Module / Algebra), category theory basics, and any proof that needs foundational reasoning about types, propositions, or universes.
  • DO NOT USE FOR: applied lattice instances such as severity / quality-gate lattices (delegate to @lean-math-discrete); analysis-flavoured algebra such as normed-space structure (delegate to @lean-math-analysis); writing a specific proof (delegate to @lean-proof); reviewing a finished proof

Workflow

  1. Identify whether the question is about Lean's logical foundation (Part 1), Mathlib's typeclass hierarchy (Parts 2–5), or a category-theoretic construction (later parts).
  2. Locate the relevant Part below and read the project-relevance callouts before applying any pattern.
  3. If the answer is a specific proof, handoff to @lean-proof; if it is a soundness-affecting choice (e.g., adding a new Classical import), handoff to @lean-proof-review and @lean-enforcement.

Recovery & STOP

  • STOP if a foundational choice silently introduces a new axiom — #print axioms must show only propext, Classical.choice, Quot.sound (and funext is a theorem, not an axiom). Escalate to @lean-review-council if uncertain.
  • STOP and handoff to @lean-research if the question is about a result not present in Mathlib at the current pin (e.g., a new universe-polymorphism API).

Handoffs

  • Predecessors: agent:gateway, skill:lean-proof (mid-proof typeclass synthesis failure), skill:lean-research (when a survey turns up a foundational construct).
  • Successors: skill:lean-proof (apply the foundational pattern in a concrete proof), skill:lean-proof-review (verify axiom impact), skill:lean-enforcement (run native-decide / #print axioms checks after the change).

Detailed reference

Full encyclopedic reference, decision trees, and lookup tables live in references/lean-math-foundations-handbook.md .

See also

  • ../../references/lean-math-foundations-handbook.md -- Complete lean-math-foundations Handbook
  • ../lean-gateway/SKILL.md -- Top-level skill router

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.