Introduction: prove it. Elimination: use it.
∧ And \and
Introduction
From P and Q, conclude P ∧ Q.
-
apply And.intro ...What Lean needsThe goal
P ∧ Q.What Lean doesReplaces it with two goals,
PandQ. -
conj_intro hpq from hp hqWhat Lean needs
hp : Pandhq : Qin the context.What Lean doesAdds
hpq : P ∧ Qto the context. -
have hpq : P ∧ Q := ⟨hp, hq⟩What Lean needs
hp : Pandhq : Qin the context.What Lean doesAdds
hpq : P ∧ Qto the context.
Elimination
From P ∧ Q, conclude P and conclude Q.
-
conj_elim hp hq from hpqWhat Lean needs
hpq : P ∧ Qin the context.What Lean doesAdds
hp : Pandhq : Qto the context. -
have ⟨hp, hq⟩ := hpqWhat Lean needs
hpq : P ∧ Qin the context.What Lean doesAdds
hp : Pandhq : Qto the context. -
apply And.elim _ hpq intro hp hq ...What Lean needs
hpq : P ∧ Qin the context.What Lean doesAdds
hp : Pandhq : Qto the context while retaining the current goal.
∨ Or \or
Introduction
From P, conclude P ∨ Q; from Q, conclude P ∨ Q.
-
disj_intro_left hpq from hp QWhat Lean needs
hp : Pin the context.What Lean doesAdds
hpq : P ∨ Qto the context. -
disj_intro_right hpq from P hqWhat Lean needs
hq : Qin the context.What Lean doesAdds
hpq : P ∨ Qto the context. -
apply Or.intro_left ...What Lean needsThe goal
P ∨ Q.What Lean doesReplaces it with the goal
P. -
apply Or.intro_right ...What Lean needsThe goal
P ∨ Q.What Lean doesReplaces it with the goal
Q. -
apply Or.inl ...What Lean needsThe goal
P ∨ Q.What Lean doesReplaces it with the goal
P. -
apply Or.inr ...What Lean needsThe goal
P ∨ Q.What Lean doesReplaces it with the goal
Q.
Elimination
From P ∨ Q, derive the same conclusion from P and from Q.
-
disj_elim hp hq from hpq ...What Lean needs
hpq : P ∨ Qin the context.What Lean doesCreates two copies of the current goal: one with
hp : Pin the context and one withhq : Q. -
cases hpq case inl hp => ... case inr hq => ...What Lean needs
hpq : P ∨ Qin the context.What Lean doesCreates a case with
hp : Pand a case withhq : Q; both retain the current goal. -
apply Or.elim hpq · intro hp ... · intro hq ...What Lean needs
hpq : P ∨ Qin the context.What Lean doesCreates two copies of the current goal: one under
hp : Pand one underhq : Q.
→ Implies \to
Introduction
To prove P → Q, assume P and derive Q.
-
intro hp ...What Lean needsThe goal
P → Q.What Lean doesAdds
hp : Pto the context and replaces the goal withQ.
Elimination
From P → Q and P, conclude Q.
-
impl_elim hq from hp hpqWhat Lean needs
hpq : P → Qandhp : Pin the context.What Lean doesAdds
hq : Qto the context. -
have hq := hpq hpWhat Lean needs
hpq : P → Qandhp : Pin the context.What Lean doesAdds
hq : Qto the context. -
apply hpq ...What Lean needs
hpq : P → Qin the context and the goalQ.What Lean doesReplaces the goal with
P.
¬ Not \neg
Introduction
To prove ¬P, assume P and derive a contradiction.
-
change P → FalseWhat Lean needsThe goal
¬ P.What Lean doesRewrites the goal as
P → False. -
change ¬ P at hWhat Lean needs
h : P → Falsein the context.What Lean doesRewrites the hypothesis as
h : ¬ P.
Elimination
From ¬P and P, derive a contradiction.
-
contradictionWhat Lean needsContradictory hypotheses, such as
hp : Pandhnp : ¬ P, in the context.What Lean doesCloses the current goal.
↔ If and only if \iff
Introduction
Prove P → Q and prove Q → P.
-
apply Iff.introWhat Lean needsThe goal
P ↔ Q.What Lean doesReplaces it with the goals
P → QandQ → P.
Elimination
Use either implication: P → Q or Q → P.
-
apply Iff.elim _ h intro hpq hqp ...What Lean needs
h : P ↔ Qin the context.What Lean doesAdds
hpq : P → Qandhqp : Q → Pto the context while retaining the current goal.
∀ For every \forall
Introduction
For arbitrary t : T, derive P t.
-
intro t ...What Lean needsThe goal
∀ x : T, P x.What Lean doesAdds an arbitrary
t : Tto the context and replaces the goal withP t.
Elimination
From ∀ x : T, P x, conclude P t for t : T.
-
have := h t ...What Lean needs
h : ∀ x : T, P xandt : Tin the context.What Lean doesAdds
this : P tto the context. -
have hpt := h t ...What Lean needs
h : ∀ x : T, P xandt : Tin the context.What Lean doesAdds
hpt : P tto the context.
∃ There exists \exists
Introduction
Choose t : T and prove P t.
-
apply Exists.intro t ...What Lean needsThe goal
∃ x : T, P xand an available termt : T.What Lean doesChooses
tas the witness and replaces the goal withP t.
Elimination
From ∃ x : T, P x, introduce a new t : T and assume P t.
-
obtain ⟨t, hpt⟩ := h ...What Lean needs
h : ∃ x : T, P xin the context.What Lean doesAdds a new witness
t : Tandhpt : P tto the context. -
apply Exists.elim h intro t intro hpt ...What Lean needs
h : ∃ x : T, P xin the context.What Lean doesAdds a new
t : Tandhpt : P tto the context while retaining the current goal.