Skip to content
Back to skills

Lean Formula Function Policy

ASecurity

Use when editing Lean code or repo policy so definitional formulas are plain defs/functions, not prose labels, structure fields, or alias-only theorem wrappers.

  • 3 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added November 24, 2026
databasesdocumentation

Security analysis

A100/100

Scanned November 24, 2026

npx -y skills add nickgou-nuke/info-geometry-lean --skill lean-formula-function-policy --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Lean Formula Function Policy?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Lean Formula Function Policy
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/nickgou-nuke-lean-formula-function-policy/badge)](https://www.skillsdirectory.com/skills/nickgou-nuke-lean-formula-function-policy)

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

Download with Pro
SKILL.md
---
name: lean-formula-function-policy
description: Use when editing Lean code or repo policy so definitional formulas are plain defs/functions, not prose labels, structure fields, or alias-only theorem wrappers.
---

<!-- repository-context-rule -->
## Repository context rule

For repository work, the current checked-out codebase is the context. Search
existing implementation and trace actual carriers, definitions, imports,
instances, theorem statements, and uses before claiming a structure is missing
or incorrect. A local absence is not a repository-wide absence. Names,
heuristics, summaries, and documentation guide discovery but do not override
source. Follow `docs/REPO_DEEP_SEARCH_PROTOCOL.md` before repo-wide gap claims.


# Lean Formula and Function Policy

Use this skill when a Lean declaration is really a formula, and the job is to
make it behave like one in the repository.

## Core rule

Formulas are definitions. Functions are functions. Natural-language labels are
not authority.

If a quantity is used in derivations, expose it as a plain Lean `def` with
explicit arguments and use that `def` directly downstream.

## Required shape

- Raw inputs may live in structures.
- Derived formulas must live in `def`s.
- Non-definitional facts belong in theorems.
- If the formula is needed immediately, define it immediately.
- Downstream code must call the function directly.

## Do not do this

- store a definitional formula as a structure field
- rename the same formula into `massieuFormula`, `forceFormula`, or similar
- keep a prose label and call it authority
- expose an alias-only theorem whose proof is just `rfl` or unfold-and-rename

## Do this

- define the formula as `massieu`, `force`, `partition`, `energy`, or the
  actual semantic name of the quantity
- keep structures for raw analytic or thermodynamic inputs
- let theorem wrappers state the real non-definitional consequence, not the
  same formula with a new name

## Repo policy alignment

Follow:
- `docs/CONSTRUCTIVE_CLOSURE_MANDATE.md`
- `docs/FORMULA_FUNCTION_POLICY.md`

If a formula still appears as a field label, move it to a `def` and use that
function directly in the derivation chain.

Attribution

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

View all in databases →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.