Proof Hike · Module 4 · Lean 4.36.0

Logic, part two.

Say exactly what you mean. Then prove it.

The five steps

  1. Example 16: What not means
  2. Example 17: Proof by contradiction
  3. Example 18: A two-way promise
  4. Example 19: For every input
  5. Example 20: Find one witness

New words

Negation
A not statement. In Lean, a proof of not P turns a proof of P into a proof of False.
False
A proposition with no constructors. It is different from the Boolean value false.
Contradiction
A situation where the available assumptions produce a proof of False. A compiler error is not such a proof.
Classical logic
Reasoning that includes excluded middle: every proposition holds or its negation holds.
Equivalence
An if-and-only-if statement, proved by an implication in each direction.

A checked example

E16.leanTry it live (opens official Lean editor)
example (P : Prop) (hP : P) (hn : ¬ P) : False := by
  exact hn hP

Before you move on

  • Explain the claim in everyday words.
  • Identify what Lean expects at each step.
  • Complete the warm-up exercises.
  • Read an error and explain its fix.

The full lesson includes the captured Lean output, hints, stretch tasks, and checked solutions.

Use your browser’s Print command. This course stores progress only in the learner’s browser.