invariants_and_monovariants

Identify invariant and monovariant properties for reachability and termination proofs.

1|Updated Mar 14, 2026
One-click install
npx skills add https://github.com/bneb/perqed --skill invariants-and-monovariants
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: invariants_and_monovariants
Source: https://github.com/bneb/perqed/tree/main/.agents/skills/invariants_and_monovariants
Command: npx skills add https://github.com/bneb/perqed --skill invariants-and-monovariants

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Identify invariant or monovariant properties that must hold to prove reachability and termination.

Core Features & Use Cases

  • Demonstrates how invariants constrain reachable states in graph theory and programming proofs.
  • Shows how monovariants imply termination and progress, enabling formal termination arguments.
  • Provides Lean 4 templates and worked examples for parity, loop termination, and unreachability proofs.

Quick Start

Load the template into your Lean environment and adapt the invariant and monovariant templates to your state space before proving termination.

Frequently Asked Questions about invariants_and_monovariants

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prove termination using a monovariant in Lean 4?

To prove termination using a monovariant in Lean 4, you identify a measurable property that strictly decreases across state transitions. This skill provides templates to formalize monotonic progress arguments for loop termination.

What is an invariant in state-transition systems and how does it constrain reachability?

An invariant in state-transition systems is a property that must hold across all reachable states. By proving preservation, invariants constrain reachability and demonstrate that certain invalid states are unreachable.

Can I use these Lean 4 templates for graph theory and unreachability proofs?

Yes, you can use these Lean 4 templates for graph theory and unreachability proofs. They demonstrate how invariants constrain reachable states and provide worked examples for parity and state-transition reasoning.

What's the best way to set up formal proofs for loop termination in Lean?

The best way to set up formal proofs for loop termination is loading the invariant and monovariant templates into your Lean environment, then adapting them to specify measurable properties for your state space.

When do I need a monovariant instead of an invariant for formal methods?

You need a monovariant instead of an invariant when proving termination and progress rather than state preservation. Monovariants imply termination by showing monotonic decrease, while invariants constrain reachable states.