lean4-memories

Persist Lean 4 proof patterns and failed approaches across sessions via MCP memory server.

360|43|Updated Oct 17, 2025
One-click install
npx skills add https://github.com/cameronfreer/lean4-skills --skill lean4-memories
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: lean4-memories
Source: https://github.com/cameronfreer/lean4-skills/tree/main/plugins/lean4-memories/skills/lean4-memories
Command: npx skills add https://github.com/cameronfreer/lean4-skills --skill lean4-memories

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires npx, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill eliminates the frustration of rediscovering proof approaches across sessions by maintaining persistent memory of successful patterns, failed attempts, and project conventions.

Core Features & Use Cases

  • Persistent Learning: Remember successful proof strategies and avoid known dead-ends across multiple work sessions.
  • Project-Specific Expertise: Accumulate domain knowledge and coding conventions specific to your formalization project.
  • Use Case: Imagine you spent 30 minutes finding a successful π-system approach for measure equality. This Skill remembers that pattern so when you encounter similar goals weeks later, it suggests the proven approach in minutes.

Quick Start

Use the lean4-memories skill to retrieve similar proof patterns for the current theorem goal in your Lean 4 project.

Frequently Asked Questions about lean4-memories

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

FAQPage Schema
How do I avoid rediscovering the same Lean 4 proof patterns across work sessions?

Persistent memory for Lean 4 proofs stores successful patterns, failed approaches, and project conventions across sessions using MCP memory server integration. When you encounter similar theorem goals weeks later, the Skill retrieves proven tactics and strategies, eliminating duplicate exploration and accelerating proof discovery.

Can I organize Lean 4 proof patterns by project and entity type?

Yes. The Skill scopes memory by project path, skill context, and entity types—ProofPattern, FailedApproach, ProjectConvention, UserPreference, and TheoremDependency—with metadata including goals, tactics, lemmas, difficulty, and file contexts for precise retrieval and project-specific expertise.

What's the best way to speed up complex Lean 4 formalizations across team projects?

Accumulate domain knowledge and coding conventions specific to your formalization project by persisting successful proof strategies and failed attempts. Team members benefit from shared memory of what works, reducing onboarding time and ensuring consistent proof approaches across collaborative projects.

How does persistent learning improve consistency in Lean 4 theorem proving?

Storing proof patterns, tactics, and conventions creates a queryable knowledge base that enforces consistent approaches and lemma usage. New team members and future sessions apply proven strategies rather than reinventing solutions, improving code quality and reducing proof complexity.

Does this work with recurring proof patterns in complex formalizations?

Yes. The Skill is designed for multi-session Lean 4 formalizations with recurring proof patterns and complex proofs. It remembers which tactics and lemmas succeeded on similar goals, enabling rapid pattern matching and reducing the cognitive load of managing proof strategy across lengthy formalization efforts.