import MyNat.Definition
namespace MyNat
open MyNat
Advanced proposition world.
Level 4: iff_trans
.
The mathematical statement P ↔ Q
is equivalent to (P ⟹ Q) ∧ (Q ⟹ P)
. The cases
and split
tactics work on hypotheses and goals (respectively) of the form P ↔ Q
.
If you need to write an
↔
arrow in Visual Studio Code you can do so by typing\iff
. See the "Lean 4: Show All Abbreviations" command.
After an initial intro h
you can type cases h with hpq hqp
to break h : P ↔ Q
into its constituent parts.
Lemma
If P
, Q
and R
are true/false statements, then P ↔ Q
and Q ↔ R
together imply P ↔ R
.
lemmaiff_trans (iff_trans: ∀ (P Q R : Prop), (P ↔ Q) → (Q ↔ R) → (P ↔ R)PP: 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 ↔ R)P, Q, R: Prop
hpq: P ↔ Q(Q ↔ R) → (P ↔ R)P, Q, R: Prop
hpq: P ↔ Q
hqr: Q ↔ RP ↔ RP, Q, R: Prop
hpq: P ↔ Q
hqr: Q ↔ R
mpP → RP, Q, R: Prop
hpq: P ↔ Q
hqr: Q ↔ RR → PP, Q, R: Prop
hpq: P ↔ Q
hqr: Q ↔ R
mpP → RP, Q, R: Prop
hqr: Q ↔ R
pq: P → Q
qp: Q → P
mp.introP → RP, Q, R: Prop
hqr: Q ↔ R
pq: P → Q
qp: Q → P
mp.introP → RP, Q, R: Prop
pq: P → Q
qp: Q → P
qr: Q → R
rq: R → Q
mp.intro.introP → RP, Q, R: Prop
pq: P → Q
qp: Q → P
qr: Q → R
rq: R → Q
p: P
mp.intro.introRP, Q, R: Prop
pq: P → Q
qp: Q → P
qr: Q → R
rq: R → Q
p: P
mp.intro.introQP, Q, R: Prop
pq: P → Q
qp: Q → P
qr: Q → R
rq: R → Q
p: P
mp.intro.introPGoals accomplished! 🐙P, Q, R: Prop
hpq: P ↔ Q
hqr: Q ↔ R
mprR → PP, Q, R: Prop
hqr: Q ↔ R
pq: P → Q
qp: Q → P
mpr.introR → PP, Q, R: Prop
hqr: Q ↔ R
pq: P → Q
qp: Q → P
mpr.introR → PP, Q, R: Prop
pq: P → Q
qp: Q → P
qr: Q → R
rq: R → Q
mpr.intro.introR → PP, Q, R: Prop
pq: P → Q
qp: Q → P
qr: Q → R
rq: R → Q
r: R
mpr.intro.introPP, Q, R: Prop
pq: P → Q
qp: Q → P
qr: Q → R
rq: R → Q
r: R
mpr.intro.introQP, Q, R: Prop
pq: P → Q
qp: Q → P
qr: Q → R
rq: R → Q
r: R
mpr.intro.introRGoals accomplished! 🐙
Next up Level 5