vero-lean-pitfalls

Identify common pitfalls when translating formally-verified code to Lean 4.

2|Updated Jul 4, 2026
One-click install
npx skills add https://github.com/sunblaze-ucb/vero --skill vero-lean-pitfalls
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vero-lean-pitfalls
Source: https://github.com/sunblaze-ucb/vero/tree/main/.claude/skills/vero-lean-pitfalls
Command: npx skills add https://github.com/sunblaze-ucb/vero --skill vero-lean-pitfalls

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill helps developers avoid common mistakes when translating formally-verified code from Dafny, Verus, or Coq into Lean 4, ensuring more robust and error-free code.

Core Features & Use Cases

  • Avoid Noncomputable Errors: Identifies and resolves issues with noncomputable functions.
  • Standard Library Mappings: Offers guidance on Lean's standard library equivalents.
  • Prop vs Bool Clarification: Differentiates between logical propositions and computational booleans.
  • Natural Number Subtraction and Division: Handles specific Lean behaviors like truncating subtraction and division by zero.
  • Import Order and autoImplicit Rules: Ensures correct file structure and variable declaration.
  • deriving Clause Limitations: Provides guidance on using Lean's type class derivation features.
  • Mutual Recursion and Universe Polymorphism: Offers solutions for complex Lean features.
  • Use Case: For a developer translating a Coq module into Lean 4, this Skill can help avoid common pitfalls and ensure the translated code is both correct and efficient.

Quick Start

Use the vero-lean-pitfalls skill to review the common Lean pitfalls before translating your Coq module to Lean 4.

Frequently Asked Questions about vero-lean-pitfalls

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

FAQPage Schema
How do I avoid noncomputable errors when translating Coq functions to Lean 4?

To avoid noncomputable errors in Lean 4, identify and resolve issues with noncomputable functions during the translation process. This ensures the formally-verified code remains computable and robust.

What is the difference between Prop and Bool in Lean 4 formal verification?

The difference between Prop and Bool in Lean 4 is that Prop represents logical propositions, whereas Bool represents computational booleans. Clarifying this distinction prevents translation errors from Coq or Dafny.

How do I handle natural number subtraction and division by zero in Lean 4?

To handle natural number subtraction and division in Lean 4, account for specific behaviors like truncating subtraction and division by zero. Managing these edge cases ensures translated code executes correctly.

Does translating Dafny code to Lean 4 require special import order and autoImplicit rules?

Yes, translating Dafny code to Lean 4 requires correct file structure and variable declaration. Ensuring proper import order and autoImplicit rules prevents compilation errors in the translated formally-verified code.

What are the limitations of the deriving clause for type class resolution in Lean 4?

The limitations of the deriving clause in Lean 4 involve constraints on type class derivation features. Understanding these limitations and universe polymorphism rules is crucial when translating complex formal verification modules.

How do I manage universe polymorphism and coercions when porting Verus code to Lean 4?

To manage universe polymorphism and coercions when porting Verus code to Lean 4, apply targeted solutions for complex Lean features. Properly handling type-class resolution ensures the translated code maintains logical consistency.