import MyNat.Definition
namespace MyNat
open MyNat
Function world.
Level 7: (P → Q) → ((Q → R) → (P → R))
If you start with intro hpq
and then intro hqr
the dust will clear a bit and the level will look like this:
P Q R : Prop,
hpq : P → Q,
hqr : Q → R
⊢ P → R
So this level is really about showing transitivity of ⟹
,
if you like that sort of language.
Lemma : imp_trans
From P ⟹ Q
and Q ⟹ R
we can deduce P ⟹ R
.
lemmaimp_trans (imp_trans: ∀ (P Q R : Prop), (P → Q) → (Q → R) → P → RPP: PropQQ: PropR :R: PropProp) : (Prop: TypeP →P: PropQ) → ((Q: PropQ →Q: PropR) → (R: PropP →P: PropR)) :=R: PropP, Q, R: Prop(P → Q) → (Q → R) → P → RP, Q, R: Prop
hpq: P → Q
hqr: Q → RP → RP, Q, R: Prop
hpq: P → Q
hqr: Q → R
p: PRP, Q, R: Prop
hpq: P → Q
hqr: Q → R
p: PQP, Q, R: Prop
hpq: P → Q
hqr: Q → R
p: PPGoals accomplished! 🐙
Here we finish this proof with a new tactic assumption
instead of exact p
.
The assumption
tactic tries to solve the goal using a
hypothesis of compatible type. Since we have the hypothesis named p
it finds
it and completes the proof.
Next up Level 8