Build a two-part proof

constructor splits P ∧ Q, bullets keep the branches tidy.

14 minBeginnerconjunctionconstructorbulletsseveral open goals
0/13 completed in this course

A proof of P ∧ Q is a proof of P together with a proof of Q. constructor splits such a goal into those two parts. From that point your proof has two goals open, and the Goal panel numbers them so you can see which one you are working on.

A bullet · focuses the first open goal and requires it to be closed before you move on. Bulleted proofs read like an outline, and when a branch fails Lean points at that bullet rather than at the end of the proof. Type \. followed by a space, or click · in the symbol bar under the editor.

The branches are independent and often need different tactics. In the worked example the first is closed with a hypothesis and the second by computation. Treat each bullet as its own small proof with its own goal. Bullets nest: a branch that splits again gets bullets of its own, indented one step further.

One shortcut in this editor: press Enter at the end of a constructor line and both bullets are inserted for you, already indented.

Worked example

example (A : Prop) (ha : A) : A ∧ (2 + 2 = 4) := by
  constructor
  · exact ha
  · rfl

The two branches are closed by different tactics, because the two halves of the conjunction are different kinds of claim. In your exercise both halves are hypotheses, but check which name belongs to which side.

Takeaway

constructor splits P ∧ Q into two goals. Bullets keep the branches separate and the errors local.

Practise on Problems
Exercise 1 of 3

Combine hp and hq into a proof of P ∧ Q.

Suggested steps
  1. Split the conjunction into two goals
  2. Prove the left half
  3. Prove the right half

These marks only recognize text. Another correct proof may use different steps; Lean checks whether it works.

Exercise.lean
1theorem exercise (P Q : Prop) (hp : P) (hq : Q) : P ∧ Q := by
given
Loading editor…

Where you start. Everything above ⊢ may be assumed; the line below it is what you must prove.

P Q:Prop
hp:P
hq:Q
⊢P ∧ Q
ReadyLn 1, Col 1Lean 4
Draft saved in this browser
Stuck?
Recall and apply

Knowledge check

Answer without looking back, then check your reasoning.

0of 3
correct
Question 1 of 3How many goals are open right after constructor on P ∧ Q?
Question 2 of 3What does the bullet · do?
Question 3 of 3Must both bullets use the same tactic?