Skip to content
LeanLearn
Level 2~35 minLean 4

Your first proof: P → Q → P

From a lamp and a door to a proof checked by Lean's kernel. Learn intro and exact, step through real goal states, and prove it yourself.

You will be able to
  • Explain why P → Q → P is true in every situation.
  • Read a Lean goal: hypotheses above ⊢, the goal below.
  • Use intro to assume a hypothesis and exact to close a goal.
  • Write a complete proof that the Lean kernel verifies.
  • Connect the proof to a function (Curry–Howard).

Recommended first: Reading formulas: symbols and grouping, Meet Lean: evaluate, check, define. You can start anyway. Nothing is locked.

EncounterActivity 1 of 17

Encounter

A lamp and a door again. Suppose you know two facts: the lamp is on, and the door is open. Set the room to match what you know. Then ask yourself: is the lamp on?

  • FalseWhat you know: the lamp is on and the door is open.P ∧ Q
  • FalseThe question: is the lamp on?P
  • TrueIf the lamp is on, then (if the door is open, then the lamp is on).P → Q → P

Tasks

  1. Not yetSet the room so that what you know is true.