Skip to content
LeanLearn
Level 4~35 minLean 4

Propositions as types

In Lean a statement is a type and a proof is a program of that type. Implications are functions, conjunctions are pairs, ∀ is a dependent function. Write proofs as terms and meet dependent types and universes.

You will be able to
  • Read a proposition as a type and a proof as a term of that type.
  • Write short proofs directly as terms (functions, pairs, pattern matching).
  • Explain dependent types and the hierarchy Prop, Type, Type 1, ….

Recommended first: Proving with ∀ and ∃, Choosing the next tactic. You can start anyway. Nothing is locked.

EncounterActivity 1 of 9

Encounter

You have written proofs with tactics. Underneath, every tactic proof builds a term: a small program. This is the Curry–Howard correspondence:

  • A proposition is a type. P → Q is the type of functions from proofs of P to proofs of Q.
  • A proof is a value of that type. fun hp => hp is a proof of P → P.
  • Checking a proof is type checking: the kernel checks that the term has the type of the statement.

That is why Lean can be a programming language and a proof assistant at the same time.