import MyNat.Definition
namespace MyNat
open MyNat
Advanced proposition world.
Level 3: and_trans.
With this proof we can use the first cases
tactic to extract hypotheses p : P
q : Q
from
hpq : P ∧ Q
and then we can use another cases
tactic to extract hypotheses q' : Q
and r : R
from
hpr : Q ∧ R
then we can split the resulting goal ⊢ P ∧ R
using constructor
and easily pick off the
resulting sub-goals ⊢ P
and ⊢ R
using our given hypotheses.
Lemma
If P
, Q
and R
are true/false statements, then P ∧ Q
and
Q ∧ R
together imply P ∧ R
.
lemmaand_trans (and_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: PropP ∧ Q → Q ∧ R → P ∧ RP, Q, R: Prop
hpq: P ∧ QQ ∧ R → P ∧ RP, Q, R: Prop
hpq: P ∧ Q
hqr: Q ∧ RP ∧ RP, Q, R: Prop
hpq: P ∧ Q
hqr: Q ∧ RP ∧ RP, Q, R: Prop
hqr: Q ∧ R
p: P
q: Q
introP ∧ RP, Q, R: Prop
hqr: Q ∧ R
p: P
q: Q
introP ∧ RP, Q, R: Prop
p: P
q, q': Q
r: R
intro.introP ∧ RP, Q, R: Prop
p: P
q, q': Q
r: R
intro.intro.leftPP, Q, R: Prop
p: P
q, q': Q
r: RRP, Q, R: Prop
p: P
q, q': Q
r: R
intro.intro.rightRGoals accomplished! 🐙
Next up Level 4