verify-laws

Generate Lean 4 proofs for categorical laws and verification reports.

37|5|Updated Nov 18, 2025
One-click install
npx skills add https://github.com/BellaBe/lean-os --skill verify-laws
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: verify-laws
Source: https://github.com/BellaBe/lean-os/tree/main/.claude/skills/engineering-verify-laws
Command: npx skills add https://github.com/BellaBe/lean-os --skill verify-laws

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill automates the generation and verification of proofs for categorical laws, producing Lean 4 proofs and a structured verification report.

Core Features & Use Cases

  • Lean proof generation: convert category/monad/functor laws into Lean proofs.
  • Proof orchestration: organize proofs, check for simplifications, and identify unsolved items.
  • Verification reports: produce laws-report.yaml to summarize status.

Quick Start

Example: "Generate Lean proofs for left_id and assoc in LeanOS.Category using artifacts/v1/build/category.yaml."

Frequently Asked Questions about verify-laws

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate Lean 4 proofs for categorical laws?

Lean 4 proofs for categorical laws are generated by translating category, monad, functor, and transformation definitions into Lean syntax, then automatically enumerating and proving associated laws. The Skill converts your artifact definitions, states theorems, attempts proof strategies (reflexivity, simplification, or placeholders), runs lake build, and outputs verified proofs to artifacts/v{N}/verify/proofs with a laws-report.yaml summary.

What input formats does formal verification in Lean require?

Formal verification in Lean requires structured artifact definitions specifying categories, monads, functors, and natural transformations with their types and morphisms. The Skill accepts artifacts/v{N}/build/category.yaml format containing categorical structure definitions, which it translates into Lean definitions to generate and verify proofs.

Can I verify monad laws and functor laws together?

Yes. Formal verification handles multiple categorical structures in a single workflow—monad laws, functor laws, and natural transformations can all be verified together. The Skill enumerates all applicable laws across your definitions and generates proofs for each, consolidating results in the laws-report.yaml.

What does the verification report include?

The verification report (laws-report.yaml) documents proof status for each categorical law, including which proofs succeeded via reflexivity or simplification, which remain unsolved (sorry), and summary statistics. It provides structured output for auditing proof completeness and identifying laws requiring manual intervention.

How does category theory translate to Lean proof automation?

Category theory translates to Lean through type-based representation of categories, morphisms, and lawful structures. The Skill maps categorical definitions to Lean types and morphism compositions, then applies proof tactics (reflexivity for definitional equality, simplification for derived laws) to automatically discharge or scaffold proofs.