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.

lemma 
iff_trans: ∀ (P Q R : Prop), (P ↔ Q) → (Q ↔ R) → (P ↔ R)
iff_trans
(
P: Prop
P
Q: Prop
Q
R: Prop
R
:
Prop: Type
Prop
) : (
P: Prop
P
Q: Prop
Q
) (
Q: Prop
Q
R: Prop
R
) (
P: Prop
P
R: Prop
R
) :=
P, 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 R

P R
P, Q, R: Prop
hpq: P Q
hqr: Q R

mp
P R
P, Q, R: Prop
hpq: P Q
hqr: Q R
R P
P, Q, R: Prop
hpq: P Q
hqr: Q R

mp
P R
P, Q, R: Prop
hqr: Q R
pq: P Q
qp: Q P

mp.intro
P R
P, Q, R: Prop
hqr: Q R
pq: P Q
qp: Q P

mp.intro
P R
P, Q, R: Prop
pq: P Q
qp: Q P
qr: Q R
rq: R Q

mp.intro.intro
P R
P, Q, R: Prop
pq: P Q
qp: Q P
qr: Q R
rq: R Q
p: P

mp.intro.intro
R
P, Q, R: Prop
pq: P Q
qp: Q P
qr: Q R
rq: R Q
p: P

mp.intro.intro
Q
P, Q, R: Prop
pq: P Q
qp: Q P
qr: Q R
rq: R Q
p: P

mp.intro.intro
P

Goals accomplished! 🐙
P, Q, R: Prop
hpq: P Q
hqr: Q R

mpr
R P
P, Q, R: Prop
hqr: Q R
pq: P Q
qp: Q P

mpr.intro
R P
P, Q, R: Prop
hqr: Q R
pq: P Q
qp: Q P

mpr.intro
R P
P, Q, R: Prop
pq: P Q
qp: Q P
qr: Q R
rq: R Q

mpr.intro.intro
R P
P, Q, R: Prop
pq: P Q
qp: Q P
qr: Q R
rq: R Q
r: R

mpr.intro.intro
P
P, Q, R: Prop
pq: P Q
qp: Q P
qr: Q R
rq: R Q
r: R

mpr.intro.intro
Q
P, Q, R: Prop
pq: P Q
qp: Q P
qr: Q R
rq: R Q
r: R

mpr.intro.intro
R

Goals accomplished! 🐙

Next up Level 5