agentsclimarketplace

Lean math dynamical

Skill r-irbe/proof-skills/skills/lean-math-dynamical

APM-installable agent skills for Lean 4 and Mathlib4 — proof tactics, math domains, review and research workflows, generic tooling.

Install
npx -y skills add r-irbe/proof-skills --skill lean-math-dynamical

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 2 stars2 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

USE FOR: nonlinear dynamical systems, Lyapunov stability, bifurcation theory, catastrophe theory, control theory, phase-portrait analysis, attractor classification, and any deterministic system with state evolution over time in Lean 4. DO NOT USE FOR: stochastic dynamics (use @lean-math-stochastic); pure analysis / topology (use @lean-math-analysis); optimization-only control problems (use @lean-math-optimization); writing one specific proof (use @lean-proof). TRIGGERS: Lyapunov, stability, bifurcation, cusp catastrophe, attractor, phase portrait, dynamical system, control theory, equilibrium.

SKILL.md

7.6 KB, as published. Nobody here has run it

Lean 4 Nonlinear Dynamics & Stability

Guide to formalizing dynamical systems, stability theory, and bifurcation in Lean 4.

Routing

  • USE FOR: nonlinear dynamical systems, Lyapunov stability, bifurcation theory, catastrophe theory, control theory, phase-portrait analysis, attractor classification, and any deterministic system with state evolution over time in Lean 4.
  • DO NOT USE FOR: stochastic dynamics (delegate to @lean-math-stochastic); pure analysis / topology (delegate to @lean-math-analysis); optimization-only control problems (delegate to @lean-math-optimization); writing one specific proof (delegate to @lean-proof).
  • TRIGGERS: Lyapunov, stability, bifurcation, cusp catastrophe, attractor, phase portrait, dynamical system, control theory, equilibrium.

Workflow

  1. Classify the system (Part 1) — discrete-time, continuous-time, gradient, conservative, controlled.
  2. Pick the appropriate technique below (Lyapunov, contraction, bifurcation-normal-form, catastrophe-classification).
  3. Handoff to @lean-proof for the concrete proof; if it bottoms out in a derivative / measure step, handoff to @lean-math-analysis.

Recovery & STOP

  • STOP if the proof depends on a manifold or smooth-structure API not in Mathlib at the current pin — escalate to @lean-research.
  • STOP if a stochastic perturbation enters the model — re-route to @lean-math-stochastic; this skill covers only deterministic dynamics.

Handoffs

  • Predecessors: agent:gateway, skill:lean-proof (mid-proof stability goal), skill:lean-research (catastrophe-theory result survey).
  • Successors: skill:lean-proof (apply the dynamical pattern), skill:lean-proof-review (audit Lyapunov candidate), skill:lean-math-analysis (continuous-derivative or contraction reduction).

Detailed reference

Full encyclopaedia content (Parts 1 through 6) lives in references/lean4-math-dynamical.md. Load that file when authoring; the SKILL.md only carries the dispatch contract and the high-frequency pitfalls / recipes (kept inline below).

PartTopicCovers
Part 1Dynamical Systems Taxonomydiscrete-time, continuous-time, gradient, conservative, controlled
Part 2Lyapunov Stability Theorycandidate construction, positive-definiteness, LaSalle
Part 3Bifurcation and Catastrophe Theorycusp / fold / pitchfork normal forms
Part 4Phase Space Analysisphase portraits, equilibria classification
Part 5Control Theory ConnectionsLyapunov-control, control-Lyapunov functions
Part 6Nonlinear Methods Toolboxlinearisation, normal-form reduction, numerical-continuation hints

Part 7 — Research Council Integration

Consolidated into the single canonical routing matrix: references/research-council-skill-map.md (see the "Dynamical" section). When dispatching a question to a council member, cite that table rather than restating the rows here.


Part 8 — IVT Sign-Change Pattern

Extracted to single canonical reference: references/lean4-ivt-patterns.md. That file owns the canonical incantation, the asymmetric_three_roots_ivt walk-through, and the polynomial-continuity prerequisite.


Part 9 — Common Pitfalls (Stability & Bifurcation)

PitfallSymptomRecovery
Lyapunov candidate not positive-definiteV 0 = 0 proved, but V x > 0 for x ≠ 0 failsAdd a quadratic-form witness (x^T Q x with Q PSD); check posDef_iff_eigenvalues_pos family
Contraction map without [CompleteSpace α]ContractingWith.fixedPoint won't applyAdd [CompleteSpace α] instance or restrict to a closed subset and use IsCompact.completeSpace
IVT sign-error in bifurcation diagramExistential ∃ c, f c = 0 won't closeRe-check sign of f a and f b; see references/lean4-ivt-patterns.md for the canonical asymmetric_three_roots_ivt walk-through
Catastrophe normal form drifted from repository canoncusp / fold polynomial signs don't match expectationsCompare against Mathlib.Analysis.SpecialFunctions.Pow.Real; there is no canonical catastrophe API in Mathlib — keep local definitions in the host repository's catastrophe namespace
Discrete- vs continuous-time confusionTendsto with the wrong filterDiscrete: atTop on ; continuous: atTop on (often with a measure-preserving step)
Spurious equilibrium from simp overreachf x = x "proved" by simplifying both sides to 0Disable simp for the candidate equilibrium proof; use linear_combination or explicit substitution

Cross-reference: repository stability tactics

  • Host-repository Lyapunov modules — quadratic-form Lyapunov constructions for local cusp + phase-portrait models.
  • Host-repository catastrophe modules — cusp-form polynomial bifurcation (the 3-real-roots case).
  • references/lean4-ivt-patterns.mdasymmetric_three_roots_ivt walk-through (canonical entry-point for sign-change existence).
  • references/lean4-contraction-catalog.md — catalog of contraction-mapping templates (uses ContractingWith / LipschitzWith).

Part 10 — Banach Fixed-Point Recipe

The most common "I need a fixed point" pattern in this corpus:

-- Given a self-map f : α → α and a contraction constant K < 1:
example {α : Type*} [MetricSpace α] [CompleteSpace α]
    (f : α → α) {K : NNReal} (hK : K < 1)
    (hC : ContractingWith K f) :
    ∃! x, f x = x :=
  ⟨hC.fixedPoint, hC.fixedPoint_isFixedPt,
   fun y hy => hC.fixedPoint_unique hy⟩

Project-relevant adaptations:

  • Sub-Banach setting: IsCompact.completeSpace lets you restrict to a closed ball when global completeness is unwieldy.
  • Iteration bounds: ContractingWith.aux_dist_le gives dist (f^[n] x) (fixedPoint) ≤ K^n * dist x (fixedPoint) / (1 - K).
  • Existence-only (no uniqueness): Schauder fixed-point — not in Mathlib at the current pin; use @lean-research to confirm before authoring.

See also

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.