lean-uint-bitvec

Convert between numeric types and BitVec in Lean 4 proofs.

1|Updated Apr 14, 2026
One-click install
npx skills add https://github.com/fmhall/lean-png --skill lean-uint-bitvec-fmhall
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: lean-uint-bitvec
Source: https://github.com/fmhall/lean-png/tree/main/.claude/skills/lean-uint-bitvec
Command: npx skills add https://github.com/fmhall/lean-png --skill lean-uint-bitvec-fmhall

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill aids in Lean 4 proofs by providing utilities for converting between numeric types and BitVec, and by offering strategies for using bv_decide effectively.

Core Features & Use Cases

  • BitVec Conversions: Simplify conversions between UInt8/UInt16/UInt32/BitVec and Nat.
  • Bitwise Operations: Utilize bv_decide for bit-level operations on numeric types.
  • Proof Patterns: Offers guidance on when and how to use bv_decide, bv_omega, and decide_cbv.
  • Use Case: When working on Lean 4 proofs that involve complex bitwise operations and conversions between numeric types, this Skill can streamline the process and reduce the likelihood of errors.

Quick Start

Use the lean-uint-bitvec skill to convert a uint32 value to a bitvec and then use bv_decide to reason about it.

Frequently Asked Questions about lean-uint-bitvec

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

FAQPage Schema
How do I convert between UInt8, UInt16, UInt32 and BitVec in Lean 4 proofs?

This Skill provides utilities to convert between numeric types and BitVec in Lean 4 proofs, simplifying conversions to and from Nat to streamline bitwise reasoning.

When should I use bv_decide versus bv_omega for Lean 4 bitvector proofs?

This Skill offers proof patterns to determine when to apply bv_decide, bv_omega, or decide_cbv based on the specific bit-level operations and numeric type conversions in your Lean 4 proof.

What is the best way to handle complex bitwise operations on numeric types in Lean 4?

Handling complex bitwise operations on numeric types in Lean 4 is best achieved using the bv_decide strategies provided here, which streamline proof construction and reduce errors during type conversions.

Does this Lean 4 bitvec conversion approach work with Nat?

Yes, the Lean 4 bitvec conversion approach works with Nat, providing utilities to bridge conversions between BitVec and Nat alongside UInt8, UInt16, and UInt32 numeric types.

Why does my Lean 4 proof fail when reasoning about uint to bitvec conversions?

Lean 4 proofs involving uint to bitvec conversions often fail without proper strategies; this Skill reduces errors by offering guidance on using bv_decide effectively for bit-level reasoning.