Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsBlogPro
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges
  • Chrome Extension
  • Skill Manager

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

Acprk Lean Bridge

ASecurity

Connect paper propositions to Lean4/Mathlib theorems with a proposition-to-Lean-name table, a zero-sorry policy and an axiom audit. Use when formalising the algebraic core of a paper, when a reviewer questions a proof, or before claiming "machine-checked" anywhere. Covers Mathlib cache pitfalls and the lean-lsp MCP tools.

78 stars
0 votes
0 copies
0 views
Added 9/26/2026
researchgoperformance

Works with

mcp

Security Analysis

A100/100

Pro scans all 4 files and shows the line behind each finding

Scanned 9/26/2026

$npx -y skills add jiayaoqijia/cryptoskill --skill acprk-lean-bridge --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Acprk Lean Bridge?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Acprk Lean Bridge
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/jiayaoqijia-acprk-lean-bridge/badge)](https://www.skillsdirectory.com/skills/jiayaoqijia-acprk-lean-bridge)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
Files
SKILL.md
---
name: lean-bridge
description: Connect paper propositions to Lean4/Mathlib theorems with a proposition-to-Lean-name table, a zero-sorry policy and an axiom audit. Use when formalising the algebraic core of a paper, when a reviewer questions a proof, or before claiming "machine-checked" anywhere. Covers Mathlib cache pitfalls and the lean-lsp MCP tools.
---
# lean-bridge: paper proposition ↔ Lean theorem

## Scope: what to formalise

Formalise the **finite algebraic core**: identities, support and character arguments,
counting bounds, injectivity and admissibility conditions, cost-ratio identities and
limits. Do **not** try to formalise lattice hardness, concrete noise distributions or
performance.

If a quantity is only *modelled*, say so in the table and in the paper. An example is a
noise bound taken as a definition rather than derived from ciphertext semantics. The
paper may then claim only "operation/level counts are machine-checked relative to the
model". It may **not** claim "noise growth is machine-checked".

## Procedure

1. Start from `lib/lean-template/`. Copy it and keep `lean-toolchain` and the Mathlib
   `rev` in sync.
2. **Run a numeric check first** (`skills/sage-check`). Never start formalising a
   statement that has not survived toy parameters.
3. For each proposition, write the Lean *statement* first, with the proof as a
   placeholder on a WIP branch. Get the statement reviewed against the paper text.
   Most mismatches are in the statement, not the proof. Common ones: the Lean version
   is weaker, uses ℕ where the paper needs ℤ, or adds a hypothesis the paper omits.
4. Prove it. Useful tactics: `decide` for tiny concrete finite facts; `ring`,
   `field_simp`, `linear_combination` for identities; `omega` for linear
   ℕ/ℤ arithmetic; `norm_num`, `simp` for evaluation. Avoid `native_decide`.
5. Fill in the **table**, which is kept in the Lean project README and mirrored in
   THEORY.md:

   | paper statement | Lean name (fully qualified) | file | modelling notes |
   |---|---|---|---|
   | Lemma 3.2 (support stability) | `Proj.Support.stable` | `Support.lean` | coefficient level |

6. **Gate** (all must pass before the table is cited in the paper):
   - `lake build` is green on a clean checkout at the recorded commit;
   - `scripts_check_no_sorry.sh` reports no `sorry`/`admit`/`axiom`/`native_decide`;
   - an axiom audit of every headline theorem (`#print axioms T` or `lean_verify`)
     shows only `propext`, `Classical.choice`, `Quot.sound`;
   - the table rows match the paper numbering on the final PDF.
7. Record the Lean commit and the "green build" log in EVIDENCE.md, for example
   "N results, zero sorry" as the printed fact and the `lake build` log as its source.

## Lessons

- Lean often **finds redundant or insufficient hypotheses**. Run
  `lean_minimal_hypotheses` on key theorems. Sometimes a hypothesis the paper states
  is not needed, which gives a stronger theorem. Sometimes the Lean proof needs one
  the paper forgot, which is a correctness fix. Report both to `theorist` and
  `falsifier`.
- Formalising the *coefficient-level* statement is usually much easier than the
  *polynomial-ring* statement. Prove a bridge lemma (for example, the coefficient of
  `P.comp (C a * X)`) once and reuse it.
- Keep each file under a few hundred lines, with one namespace per paper section.
- A cost-ratio "→ 2 as d → ∞" claim can be formalised with `Filter.Tendsto`. Pair it
  with an explicit finite bound, because reviewers care about concrete sizes.

## Mathlib cache pitfalls

See `lib/lean-template/README.md`. In short: match the toolchain and the Mathlib rev;
run `lake exe cache get` after every `lake update`; never `import Mathlib` in project
files; allow minutes for the first cold import; look up renamed lemmas with search
tools, not from memory.

## lean-lsp MCP tools (if configured)

| need | tool | tip |
|---|---|---|
| quick compile of a snippet | `lean_run_code` | self-contained with imports; the server needs `lake` on PATH |
| goal at a line | `lean_goal` | omit the column to see the state before and after the line |
| errors | `lean_diagnostic_messages` | "no goals to be solved" means delete tactics |
| lemma by name fragment | `lean_local_search` | use before guessing a name |
| lemma by meaning | `lean_leansearch` / `lean_leanfinder` | rate-limited |
| lemma by type | `lean_loogle` | rate-limited, a few calls per 30 s |
| try tactics | `lean_multi_attempt` | `["simp", "ring", "omega", "decide", "norm_num"]` |
| which hypotheses are needed | `lean_minimal_hypotheses` | |
| axiom audit | `lean_verify` | fully qualified name |
| after adding imports | `lean_build` | slow; `fetch_cache=true` only for missing oleans |

Attribution

jiayaoqijiajiayaoqijia
View sourceSee grades on GitHubMore from jiayaoqijia →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

Competitor Analysis

This skill provides comprehensive analysis of competitor SEO and GEO strategies, revealing what's working in your market and identifying opportunities to outperform the competition.

1823 votes

Deep Research

Universal deep research agent team. 13-agent pipeline for rigorous academic research on any topic. 8 modes: full research, quick brief, paper review, lit-review, fact-check, three-way literature scan, Socratic guided research dialogue, and systematic review with optional meta-analysis. Covers research question formulation, Socratic mentoring, methodology design, systematic literature search, source verification, cross-source synthesis, risk of bias assessment, meta-analysis, APA 7.0 report co...

502942 votes

Paperclip Distill

Use when an operation issue is a Paperclip cursor-window, distill, or backfill — `operationType: "distill"` or `"backfill"` and the body references a Paperclip source bundle for a project or root issue. Turn raw Paperclip activity into a wiki-insightful project page, decisions log, and history note. This skill exists specifically to replace the stiff, datestamp-heavy templated output that the deterministic distiller produces.

953191 votes

Academic Pipeline

Orchestrator for the full academic research pipeline: research -> write -> integrity check -> review -> revise -> re-review -> re-revise -> final integrity check -> finalize. Coordinates deep-research, academic-paper, and academic-paper-reviewer into a seamless 10-stage workflow with mandatory, coverage-bounded integrity checks, two-stage peer review, and auditable quality-assurance artifacts. Triggers on: academic pipeline, research to paper, full paper workflow, paper pipeline, end-to-end p...

502941 votes

Literature Review

Assistance with writing literature reviews by searching for academic sources via Semantic Scholar, OpenAlex, Crossref and PubMed APIs. Use when the user needs to find papers on a topic, get details for specific DOIs, or draft sections of a literature review with proper citations.

6511 votes
View all in research →