legal-argument-lean

Formalizes and audits Brazilian legal arguments in Lean 4 to expose load-bearing premises.

1|Updated May 8, 2026
One-click install
npx skills add https://github.com/franklinbaldo/skills --skill legal-argument-lean-franklinbaldo
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: legal-argument-lean
Source: https://github.com/franklinbaldo/skills/tree/main/legal-argument-lean
Command: npx skills add https://github.com/franklinbaldo/skills --skill legal-argument-lean-franklinbaldo

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Legal arguments in Brazilian court decisions often hide structural defects: implicit premises, truncated warrants, internal contradictions, and omissions that are hard to distinguish from mere absent phrasing. This Skill formalizes arguments in Lean 4 so that every conclusion's exact dependency set becomes auditable via #print axioms, separating logical consequence from interpretive choice. ## Core Features & Use Cases - Formalization gate: Before writing any Lean, the Skill requires a concrete uncertainty the proof will reduce, and may conclude that formalization is not worth it. - Adversarial steelmanning: Reconstructs the challenged decision charitably with explicit STEEL_n premises, runs the mandatory art. 489 §1º III trivialness check, and audits which premises the court never actually stated. - Five-phase pipeline: Argdown argument mapping, Lean formalization with a six-layer architecture, independent substantive review, defeat synthesis with Mermaid graphs, and forensic translation back into conventional legal Portuguese. - Use Case: Given an appellate decision that invokes a binding precedent while ignoring its express caveat, use this Skill to model the ruling in Lean, prove that no legitimate response to the precedent was performed, and translate the finding into grounds for embargos de declaração. ## Quick Start Ask the agent to formalize this acórdão's argument in Lean 4 and show which precedents and facts each conclusion depends on.

Frequently Asked Questions about legal-argument-lean

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

FAQPage Schema
How do I formalize a legal argument in Lean 4?▼

Formalize a legal argument by mapping it into six layers: basic types, opaque legal predicates, norms, precedents as named axioms, case facts anchored in the record, and theorems as the argumentative conclusions. Run #print axioms on each theorem to audit exactly which premises the conclusion depends on.

What is steelmanning a court decision with Lean?▼

Steelmanning formalizes the challenged decision rather than your own thesis, replacing each unjustified step with the most charitable explicit premise labeled STEEL_n. Compilation then reveals, via #print axioms, exactly which premises the court would need but never stated.

When should I not use Lean for legal analysis?▼

Do not formalize when the dispute is predominantly about proportionality, open-ended principles, or evidentiary weight, or when the real goal is just better drafting. The Skill's gate requires a concrete structural uncertainty that the proof will reduce, and it may conclude formalization is not worthwhile.

Does this Skill require Mathlib or other Lean dependencies?▼

No, the reference modules use pure first-order logic with axioms and do not require Mathlib. You need a Lean 4 toolchain installed via Elan, and the reusable library modules compile in topological order with LEAN_PATH pointing at the references directory.

Why does a compiled Lean proof not prove the legal conclusion is correct?▼

Compilation only proves derivability from the declared axioms; it says nothing about whether facts occurred, citations are accurate, or an interpretation is legally superior. That is why the pipeline requires an independent substantive review phase checking each axiom's documentary anchoring before any defeat is marked.