Guides Lean 4 formalization contributions to Open Math Agents, DeepMind formal-conjectures, or Left to Solve. Handles batch/continuous campaigns, host rules, and pre-claim checks.
Ships in formal-math-conjectures. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Work only on concrete contributions to Open Math Agents (lefttosolve2/open-math-agents), Google DeepMind (google-deepmind/formal-conjectures) or Left to Solve. Identify the host task and the kind of change its rules support before proof development. A publicly open, eligible task is sufficient unless the host requires a claim, lease or prior approval. Local branches and kernel replays serve that contribution. Private math research and personal proof publication are outside this workflow.
sorry upstream in google-deepmind/formal-conjectures. formal-conjectures#8406 duplicated statements already proved in open-math-agents; do not repeat that.ghx --no-cache api repositories/1471973920 --jq .full_name and repeat the search with the returned repo: value. A redirected PR URL can work even when search rejects the former name.unknown_problem. For example, Left to Solve drops Lean’s «» around arXiv identifiers. Confirm matches against the statement and the linked proof.refs/pull/<number>/head in the base repository with git ls-remote. For a known path, read contents/<path>?ref=<head> through the GitHub API. To locate a file, read git/commits/<head>, follow each directory through nonrecursive git/trees/<tree-sha> responses, then read git/blobs/<blob-sha>. Check the declarations in the decoded source and record its head, path and blob ID. A missing entry in a truncated tree leaves the comparison open.open-math-agents, fetch and fast-forward the owner's fork main from upstream before branching; the fork can lag by hundreds of commits. Keep the change scoped: one sourced question and the proofs or tests it needs per PR.git add -- <paths>, then run git diff --cached --check -- <paths>. If the files need to stay unstaged, check their contents directly. Plain git diff --check skips untracked files.#print axioms result to the expected fully qualified name. If a note embeds several Lean bridges, select each block by its declared namespace and compare its bytes with the checked source. Pass the same comparison file to the independent replay.lake build the changed file(s).sorry or admit in changed declarations, unless the project is a statement repository and the leftover sorry is the intended open conjecture.#print axioms of new proofs lists only propext, Classical.choice, and Quot.sound.tools/oma.sh check and beat the lease; release honestly (too_hard or the matching reason) rather than sitting on a stuck problem.tools/oma.sh reduce (or the project's equivalent). Each reduction hypothesis must be self-contained: the Left to Solve linter forbids one hypothesis referencing another. Keep a NOTES.md per deep target. Prepare the proof file for each hypothesis before the reduction PR merges, so it can be submitted as soon as the steps exist.index.json through the ledger procedure. Local proofs, receipts, proposed submissions and held work do not create ledger entries.tt title "$pane_id" "workstream" and tt sync "$pane_id". Shells launched by a shared app server can inherit another client’s TMUX_PANE. Read the command’s usage before calling a mutating subcommand. tt title --help saves --help as the default pane’s title.gwt finish-status, the canonical registration, task ownership, clean branch and expected starting commit. When creation succeeded and only retirement enrollment failed, continue authorized publication in that checkout and report it as retained and unenrolled. Preserve its locks and registration. An unresolved ownership mismatch or a native restriction on using the checkout still needs diagnosis./goal for workers, set it in each existing assigned thread. Check its thread ID, objective and active status. Give the goal the eligible host tasks and their contribution criteria, so a single merge leaves the campaign active. Once verified, retire any campaign-owned mechanism that sends continuation prompts to those threads. Keep ongoing proofs and PRs in place.LEAN_SRC_PATH and LEAN_PATH, then verify the compiler resolves every project source there. Keep earlier receipts tied to their original inputs. Check the theorem’s type against the upstream definitions, its quantifiers and its axioms. Distinguish a solved host declaration, a known theorem newly formalized, a conditional implication and a partial bound.lean, read the package and target leanOptions at the pinned revision. A direct invocation can miss a setting that lake build would pass. If the proof fails, compare the first failing declaration with those options before editing its source. Record the effective options and replay the compiled module in the kernel.private, append a small namespace and export OriginalNamespace (helper) to a replay copy of its pinned source. Import that module in the caller. export preserves the original definition, so lemmas about it still rewrite matching expressions. Check the original blob before appending, keep its license and credit, and replay the caller as a separate module. Checked source appendix and replay instructionslake env lean --src-deps FILE recursively and deduplicate resolved paths before checking their Git blobs against the pin. Quoted Lean name components can contain literal dots. For example, Arxiv.«1104.1579» resolves to the directory Arxiv/1104.1579. Include root-level FC modules such as FormalConjecturesUtil.lean when Lean resolves them. Read the pinned revision’s paths and blob IDs with git ls-tree -rz REV. Match every replayed path. Verify the complete path set inside the process that reads the manifest. Return its count, digest and any mismatches. A tool can shorten a path list while preserving valid JSON. If the manifest uses SHA-256 of file contents, send the matched IDs to one git cat-file --batch process and hash each size-delimited blob. To verify the squash and current main, compare the same paths and blob IDs in their trees.LeanChecker.replayFromImports checks the last available part of a split module. An exported .olean alone can pass while private declarations go unchecked. Before replay, verify the original .olean, .olean.server and .olean.private parts and retain any emitted .ir and .ir.sig files. If a part was omitted, restore it from the checked build and replay that module and any consumers whose dependency receipts changed. Each consumer checks the theorem against its own definitions and replays the application. If two dependency revisions contain different sources under the same Lean module name, build the application with only the compatible revision on its search path. Worked Bombieri–Vinogradov applicationLean.readModuleDataParts loads the exported, server and private parts together. Compare compiler-owned names, declaration kinds, universe parameters, types and definition bodies. If only a theorem proof term differs, compare the named axiom reports on both builds. Kernel-replay the fresh module and check its consuming theorem against the fresh dependencies. Record both sets of hashes and the differing declarations in the new receipt. A changed definition or axiom requires investigating that change before relying on the theorem..olean files into one temporary root with their original module paths. On Lean 4.33.1, if two LEAN_PATH entries contain FormalConjectures/, the first directory shadows the second. Verify the layout by importing the required declarations’ modules together..olean hashes differ, compare the source and direct import hashes for each affected module. Resolve source differences first. For matching sources, rebuild from the original source paths into a separate output directory, starting with modules whose imports match. Recheck their dependents as each import matches. Lean can embed source paths and premise-selection weights in an object. Keep the previous objects until the rebuilt hashes, named axiom reports and exact-module kernel checks agree.Lean.readModuleData. Compare imports, declaration names and persistent extension names. Use Lean.saveModuleData with the same module name and temporary output path for each side. Compare the bytes with entries := #[], then serialize each extension alone in otherwise default ModuleData. If only Lean.Linter.lintLogExt differs, compare the stored warnings and their source positions. Record both original hashes. Rebuild the pinned source from its original path, or correct the warning in task-owned code. Replay the affected module and its dependents against the reconciled object.env.header.moduleData[idx]!.constNames for each module. Check that each name exists and env.getModuleIdxFor? still returns that module’s index in the joined environment. Two independently compiled consumers can generate the same auxiliary lemma and both pass an axiom check. On Lean 4.33.1, generate f.congr_simp in the module defining f using run_cmd Lean.Elab.Command.liftCoreM <| Lean.executeReservedNameAction `MyNamespace.f.congr_simp before compiling its consumers. #check restores the previous environment. For an equation lemma such as f.eq_1, an explicit formula proved by rfl lets both consumers rewrite with the same declaration. When an auxiliary declaration changes owner, follow the source import graph from the changed providers through their transitive consumers in the audited proof. Continue through byte-identical intermediate objects. Rebuild each affected consumer or reuse a receipt whose transitive dependency identities match the new ownership. Rerun the joined ownership check in both import orders.#print axioms report, including trailing primes such as f'. Resolve the intended declaration names against the compiled module using env.constants and env.getModuleIdxFor?. If the generator reads Lean source, use declaration syntax so module documentation, nested comments and string literals cannot introduce spurious names. Set pp.fullNames to true after the imports and module documentation when comparing printed axiom names. Before a long replay, run the complete generated #check and #print axioms file against the development objects. Use the same file for the independent comparison. Lean resolves names in the active namespace. For example, inside namespace Example, #print axioms Perfect.sidon can report Example.Perfect.sidon. Compare the name Lean prints with the intended declaration. If a report is missing, query the fully qualified declaration from the compiled module and check its axioms.Lean.mkPrivateNameCore moduleName userName. The 0 in a printed _private name is a numeric component. Check that env.getModuleIdxFor? identifies the defining module, then pass the kernel name to Lean.collectAxioms.leanchecker -v, run one name at a time and inspect the matches. Lean 4.33.1 treats CLI names as prefixes. To inspect flags, read src/lean/LeanChecker.lean under the pinned toolchain prefix. Running leanchecker --help on this version selects the default target and can scan every object on the search path.replayFromImports check, load LeanChecker from the toolchain and restore the compilation search path with Lean.initSearchPath. Pass a quoted Lean name for a fixed module. For a name assembled from source path components, use parts.foldl Lean.Name.str .anonymous. This preserves numeric filenames such as FormalConjectures.GreensOpenProblems.«51». Run each object in a fresh process.Lean.readModuleData and track names on the current DFS path to identify a cycle without importing it.< and ≤. With mathlib loaded, (1 : ℝ)<i can start the <i notation for PrincipalSeg, and j≤smallPrimePart can start the ≤s notation for spanning subgraphs.∀ s ∈ candidates, P s, inspect #synth Decidable (...). Lean can select Fintype.decidableForallFintype and enumerate the whole type. For a finset, give Finset.decidableDforallFinset local priority at that proof and replay it. In a sixteen-coordinate cube this reduced one check from all 65,536 subsets to the 28 six-subsets of a specified hyperplane.maxRecDepth. Keep the ambient dimensions and counts symbolic in a helper lemma. Rewrite their index equalities there, then instantiate the helper with numerals and by decide proofs. This can keep kernel conversion from expanding the finite sets. Replay the concrete corollary. Dimension-indexed exampleFinset.image or Finset.filter lemma times out at whnf, check which equality instance Lean chose at the declaration and at the call. Give the generic element type an explicit [DecidableEq α] parameter when the construction uses it, then replay the concrete caller at the original heartbeat limit. Worked image-cardinality lemma--no-write-fetch-head --no-tags --no-prune. While a result waits on external review, another independent eligible target can proceed.Finset functor in scope, Lean can apply the cast to the whole finite set and merge equal images. For S : Finset ℕ, (S.filter fun x : ℕ => (x : ZMod q) = r).card counts every source integer in the residue class. Check the elaborated predicate and a pair with the same image. At S = {0, 3} modulo 3, the zero fibre has two elements and the residue image has one. Use the count that matches the original statement.lean-toolchain and lake. After a clone or toolchain bump, run lake exe cache get for Mathlib. If that command stalls, fetch the cache files with parallel curl and retry; do not leave a half-written cache.env.sh that exports ELAN_HOME, XDG_CACHE_HOME, and MATHLIB_CACHE_DIR (and, for Left to Solve, OMA_AGENT and OMA_MODEL) is a good pattern. Example layout on a Mac: ~/formal-math/ for the toolchain, cache, and working clones.timeout is often missing from the default PATH, and Left to Solve's tools/check.sh needs it. From env.sh, add a directory that contains GNU timeout to PATH (for example $FM/bin if that is where you keep it).sorry.open-math-agents. Repeat that check immediately before submit, not only before claim; other agents race.gpgsign globally.git, gh signed in as the owner, and enough disk for Lean and the Mathlib cache (about 10 GB).env.sh, and the owner's preferred agent and model names for OMA_AGENT and OMA_MODEL.stateDiagram-v2
[*] --> SelectMode
SelectMode --> VerifyWorkerGoals: owner requests worker goals
VerifyWorkerGoals --> SelectTarget: goal active in each assigned thread
VerifyWorkerGoals --> Report: wrong thread or unavailable goal
SelectMode --> SelectTarget: finite batch or other continuous run
SelectTarget --> Next: no eligible host task
SelectTarget --> CheckPriorWork: host task and supported contribution identified
CheckPriorWork --> Next: duplicate or claimed
CheckPriorWork --> Prove: eligible and host prerequisites met
CheckPriorWork --> Next: report required claim outside authority
Prove --> Verify
Verify --> Prove: repairable proof failure
Prove --> Next: obstruction and lease resolved
Verify --> RecheckHost: checked against host requirements
RecheckHost --> Next: host route closed or duplicate found
RecheckHost --> Next: checked change handed to owner for submission
RecheckHost --> Submit: authorized and still eligible
Submit --> Next: no host event confirmed and outcome reported
Submit --> RecordEvent: verified host event
RecordEvent --> Next
Next --> SelectTarget: continuous or below cap
Next --> Report: cap or no eligible work
SelectTarget --> Report: owner stop or all routes blocked
Report --> [*]
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
lean4, formal-math, theorem-proving, open-math-agents, deepmind
/formal-math-conjectures:formal-math-conjecturesfrom formal-math-conjectures
npx claudepluginhub vincentkoc/dotskills --plugin formal-math-conjecturesOther plugins' skills for the same job