import MyNat.Definition
import MyNat.Inequality -- le_iff_exists_add
import AdvancedAdditionWorld.Level1 --  succ_inj
import AdvancedAdditionWorld.Level9 --  zero_ne_succ
namespace MyNat
open MyNat

Inequality world.

Level 13: not_succ_le_self

Turns out that ¬ P is by definition P → false, so you can just start this one with intro h if you like.

Lemma : not_succ_le_self

For all naturals a, succ a is not at most a.

theorem 
not_succ_le_self: ∀ (a : MyNat), ¬succ a ≤ a
not_succ_le_self
(
a: MyNat
a
:
MyNat: Type
MyNat
) : ¬ (
succ: MyNat → MyNat
succ
a: MyNat
a
a: MyNat
a
) :=
a: MyNat

¬succ a a
a: MyNat
h: succ a a

False
a: MyNat
h: succ a a

False
a, c: MyNat
h: a = succ a + c

intro
False
a, c: MyNat
h: a = succ a + c

intro
False
c: MyNat
h: zero = succ zero + c

intro.zero
False
c: MyNat
h: zero = succ zero + c

intro.zero
False
c: MyNat
h: zero = succ (zero + c)

intro.zero
False
c: MyNat
h: zero = succ (zero + c)

intro.zero
False
c: MyNat
h: zero = succ (zero + c)

intro.zero
False

Goals accomplished! 🐙
c, d: MyNat
hd: d = succ d + c False
h: succ d = succ (succ d) + c

intro.succ
False
c, d: MyNat
hd: d = succ d + c False
h: succ d = succ (succ d) + c

intro.succ
False
c, d: MyNat
hd: d = succ d + c False
h: succ d = succ (succ d + c)

intro.succ
False
c, d: MyNat
hd: d = succ d + c False
h: succ d = succ (succ d + c)

intro.succ
False
c, d: MyNat
hd: d = succ d + c False
h: succ d = succ (succ d + c)

intro.succ
False
c, d: MyNat
hd: d = succ d + c False
h: succ d = succ (succ d + c)

intro.succ
d = succ d + c
c, d: MyNat
hd: d = succ d + c False
h: succ d = succ (succ d + c)

intro.succ.a
succ d = succ (succ d + c)

Goals accomplished! 🐙

Pro tip:

The conv tactic allows you to perform targeted rewriting on a goal or hypothesis, by focusing on particular subexpressions.

  conv =>
    lhs
    rw hc

This is an incantation which rewrites hc only on the left hand side of the goal. You didn't need to use conv in the above proof but it's a helpful trick when rw is rewriting too much.

For a deeper discussion on conv see Conversion Tactic Mode

Next up Level 14