agentleFS
r-irber-irbe/proof-skills/skills/lean-convergence-verification/SKILL.md

lean-convergence-verification

Skill3 starsChanged 24 days agoApache-2.0View on GitHub

USE FOR: discrete Lyapunov energy contraction, loop termination bounds, GPU power iteration limits. DO NOT USE FOR: continuous Lyapunov stability via differential equations (@lean-math-dynamical). TRIGGERS: lyapunov, convergence, termination bound, gpu bound.

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Run lean_diagnostics ({"filePath": "..."}) to trigger the lean-analyzer static abstract interpretation engine (Zone DBM decreasing_by …

    line 42
  2. Distinctive:

    STOP if estimated belief in inductive convergence hypothesis is below 0.90 -- ask user via HITL channel.

    line 53
  3. Very specific:

    STOP if lean-analyzer reports NatSubTruncation or NatDivModByZero on the ceiling bound `(v0 + delta -

    line 54
  4. Very specific:

    STOP if omega fails on non-linear division -- check that Nat.div_add_mod has been explicitly introduced into the local context.

    line 59

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Lean 4 Discrete Lyapunov Convergence & Loop Bound Verification

Guide to proving finite convergence and loop termination bounds for iterative algorithms, numerical solvers, and GPU kernels in Lean 4.

Routing

  • USE FOR: discrete Lyapunov energy contraction, loop termination bounds, GPU power iteration limits, Euclidean integer ceiling division proofs via Nat.div_add_mod and Nat.mod_lt, and finite convergence verification in Lean 4.
  • DO NOT USE FOR: continuous Lyapunov stability via differential equations (delegate to @lean-math-dynamical); simple for-loop syntax verification without energy functions (delegate to @lean-build).
  • TRIGGERS: lyapunov, convergence, termination bound, gpu bound, power iteration, ceiling division, div_add_mod, residue decay.

Workflow

  1. Define state space and non-negative integer Lyapunov energy function lyapunov : State -> Nat.
  2. Formulate the strict step decay condition forall t < n, lyapunov (traj (t + 1)) + delta <= lyapunov (traj t) with delta > 0.
  3. Run lean_diagnostics ({"filePath": "..."}) to trigger the lean-analyzer static abstract interpretation engine (Zone DBM decreasing_by synthesis, Octagon conservation ±x_i ± x_j <= c, Bourdoncle WTO loop widening, and trace partitioning) and verify that ceiling division (v0 + delta - 1) / delta and step-decay expressions are free of NatSubTruncation and NatDivModByZero defects (delta > 0 and v0 + delta >= 1). Run

Recovery & STOP

  • STOP if estimated belief in inductive convergence hypothesis is below 0.90 -- ask user via HITL channel.
  • STOP if lean-analyzer reports NatSubTruncation or NatDivModByZero on the ceiling bound `(v0 + delta -
    1. / delta-- add the missing0 < deltahypothesis before attemptingomega`.
  • STOP if omega fails on non-linear division -- check that Nat.div_add_mod has been explicitly introduced into the local context.

Handoffs

  • Predecessors: agent:gateway, skill:lean-math-discrete (discrete structures), skill:lean-proof (tactics).
  • Successors: skill:lean-proof (inductive step discharge), skill:lean-proof-review (lockdown audit).

Detailed reference

Full encyclopedic reference, decision trees, and lookup tables live in references/lean-convergence-verification-handbook.md .

See also

  • ../../references/lean-convergence-verification-handbook.md

    Complete lean-convergence-verification Handbook
  • ../lean-gateway/SKILL.md -- Top-level skill router

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.