Stage 04 · Step 16 of 50

What not means.

Core Lean8 minutesLean 4.36.0

01The idea

A “no entry” rule promises that any entry attempt leads to a contradiction. Negation has a similar shape.

Typo · Your guide for this idea
Typo pointing

A proof of not P turns any proof of P into False.

02In maths

If P and ¬P both hold, then False follows.

Picture it

Negation: ¬P turns any proof of P into FalseTop: hn, a proof of not P, is drawn as a machine. Not P means P implies False, so feeding the machine hP, a proof of P, makes it produce False. Bottom: the start card has P : Prop, hP : P and hn : not P, with goal False. The tactic exact hn hP feeds hP into hn, which gives exactly False, leaving no goals.hP : Pa proof of P…hn : ¬P¬P means P → FalseFalse…turns into FalseSTARTP : ProphP : Phn : ¬P⊢ Falseexact hn hPFED hP INTO hnno goals

Swipe sideways to see the whole picture.

In Lean, ¬P means P → False: a machine that turns any proof of P into a proof of False. Here you hold both the machine hn and a proof hP. Feeding one into the other, written hn hP, produces False, which is exactly the goal.

03In Lean

This code comes directly from the file checked by Lean.

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

The symbol ¬ means “not.” Type it with \not. False is a proposition with no constructors.

A contradiction in a context means that the available assumptions can produce a proof of False.

A proof of not P is a function from proofs of P to a proof of False. Applying that function uses the contradictory proof.

04Step by step

Choose a line to see Lean’s recorded goal state after that line.

After line 1
P : Prop
hP : P
hn : ¬P
⊢ False
After line 1: example (P : Prop) (hP : P) (hn : ¬ P) : False := by
P : Prop
hP : P
hn : ¬P
⊢ False
After line 2: exact hn hP
no goals

05Lean says

Captured from Lean 4.36.0
no goals

A goal is what remains to prove. The symbol ⊢ points to it. Meet the turnstile.

07Your turn

sorry is a placeholder for unfinished work. Replace it as you solve each task. A finished proof has no placeholders.

  1. Warm-up

    Use a proof of False to prove an arbitrary proposition P.

  2. A little stretch

    Prove not P from P implies Q and not Q.

Exercises/E16.leanTry it live (opens official Lean editor)
example (P : Prop) (h : False) : P := by
  sorry

example (P Q : Prop) (f : P → Q) (hn : ¬ Q) : ¬ P := by
  sorry

08A quick check

1. What does ¬P mean in Lean?

Read the answer and explanation

P → False. Negation is defined as an implication to False. Type ¬ with \not.

2. Does a failed tactic prove False?

Read the answer and explanation

No. An error means a proof attempt failed. It is not a proof of a contradiction.

One more idea in your toolkit.

Take your time. Progress is yours to mark.