proof_by_contradiction

Derive proofs by contradiction in Lean 4 using by_contra and absurd.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Proof by contradiction provides a structured method to prove statements by assuming the negation and deriving False, letting you conclude the original assertion holds. In Lean 4, this approach supports both constructive and non-constructive arguments and helps formalize classical reasoning when explicit witnesses are unavailable.

Core Features & Use Cases

  • Tactic guidance: use by_contra to introduce a negated goal, push_neg to simplify it, and absurd to close the contradiction.
  • Education & verification: ideal for teaching reductio ad absurdum, and for proving irrationality or non-existence results within Lean 4.
  • Applicability in formal proofs: supports classical reasoning in mathematical libraries where existence or equality cannot be constructed directly.

Quick Start

Start a Lean proof by assuming the negation of the goal with by_contra and derive a contradiction to conclude the goal.

Frequently Asked Questions about proof_by_contradiction

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

FAQPage Schema
How do I prove statements via contradiction in Lean 4?

Proof by contradiction in Lean 4 uses the by_contra tactic to assume the negation of a goal, then derives False to conclude the original assertion. You typically combine push_neg and absurd to simplify and close the contradiction.

When do I need proof by contradiction for formalized mathematical results?

Proof by contradiction is needed for mathematical results requiring non-constructive arguments, such as irrationality proofs and non-existence claims, where explicit witnesses are unavailable and classical reasoning is permitted.

How do I use by_contra and push_neg tactics in a Lean 4 environment?

Start a Lean proof with by_contra to introduce a negated goal, apply push_neg to simplify the assumption, and use absurd to derive a contradiction, establishing the original statement.

Does proof by contradiction in Lean 4 require Mathlib?

Deriving proofs by contradiction in Lean 4 requires a Lean 4 environment with Mathlib and familiarity with classical reasoning tactics like by_contra, push_neg, and absurd to extract contradictions.

Can I use proof by contradiction for constructive logic arguments in Lean 4?

Proof by contradiction in Lean 4 supports both constructive and non-constructive arguments, helping formalize classical reasoning in mathematical libraries when explicit witnesses cannot be constructed directly.

Why does my by_contra tactic fail to close a Lean 4 proof?

The by_contra tactic introduces a negated goal but requires deriving False to succeed. If the contradiction is not explicit, use push_neg to simplify assumptions and absurd to close the logical gap.