ワンクリックで
mathlib-usage
Mathlib usage principles (imports, search, existence checks, confirmation) for all `.lean` files in this repo.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Mathlib usage principles (imports, search, existence checks, confirmation) for all `.lean` files in this repo.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Policy for non-semantic refactors that keep math meaning unchanged while making Lean/Mathlib code easier to review and harder to break: minimal imports, scoped assumptions, localized `classical`, proof tidying, lint fixes, perf/typeclass risk control, and PR splitting.
I/O contract for proof/counterexample/stuck attempts and post-attempt new-problem proposals.
Rules to apply this repo's Lean workflow (plan → skeleton → error-driven iteration → mathlib search → minimal diffs) consistently across all `.lean` files.
| name | mathlib-usage |
| description | Mathlib usage principles (imports, search, existence checks, confirmation) for all `.lean` files in this repo. |
import Mathlib. Use Mathlib defs/lemmas/theorems without extra imports.open / open scoped / local instead of extra imports..lake/packages/mathlib/Mathlib is missing, run lake update.rg -n "<keyword>" .lake/packages/mathlib/Mathlib.[simp] attributes.#check or a tiny snippet.lake env lean path/to/File.lean.rwsimpasimp only [...]simp_rw [...]Handle subgoal rewrites here first.
fun_propmeasurabilitypositivityfinitenessring_nffield_simplinarithnlinarithomegagcongrlinear_combinationaesopgrindUse these only for small first-order goals; avoid relying on them as the main strategy for structured goals.
simp rulessimp [*] on subgoals.simp with AC lemmas like mul_assoc / mul_comm / add_assoc / add_comm.rw right after simp; insert a have and simpa using it when needed.simp? suggests simp only, consider pinning it.simp_rw when order matters.Continuous*, Measurable*, Differentiable*, etc.)fun_prop, measurability when relevant).positivity or short linarith.ring_nf for polynomial-style normalization.ring / ring_nf work primarily in commutative rings. For noncommutative rings, abelian groups, or modules, consider noncomm_ring, abel, or module instead.field_simp only where denominator management is required.linear_combination when a linear relation should close the goal.simp_rw over broad simp [*].simp only [...]).rw [mul_assoc]) rather than large AC bundles.positivity first for nonnegativity obligations.linarith / nlinarith / omega depending on arithmetic domain.lean_term_goal: expected type at a linelean_goal: goal/contextlean_diagnostic_messages: distinguish import/typeclass issueslean_multi_attempt: trial of multiple tacticsFinal confirmation is via rg / #check / lake env lean.