import MyNat.Definition
import MyNat.Inequality -- le_iff_exists_add
import AdvancedAdditionWorld.Level11 -- add_right_eq_zero
import Mathlib.Tactic.LeftRight
import InequalityWorld.Level4 -- zero_le
import InequalityWorld.Level8 -- succ_le_succ
namespace MyNat
open MyNat

Inequality world.

Level 9: le_total

Lemma : le_total

For all naturals a and b, either a ≤ b or b ≤ a.

theorem 
le_total: ∀ (a b : MyNat), a ≤ b ∨ b ≤ a
le_total
(
a: MyNat
a
b: MyNat
b
:
MyNat: Type
MyNat
) :
a: MyNat
a
b: MyNat
b
b: MyNat
b
a: MyNat
a
:=
a, b: MyNat

a b b a
b: MyNat

(a : MyNat), a b b a
b: MyNat

(a : MyNat), a b b a

zero
(a : MyNat), a zero zero a
a: MyNat

zero
a zero zero a
a: MyNat

zero.h
zero a

Goals accomplished! 🐙
d: MyNat
hd: (a : MyNat), a d d a

succ
(a : MyNat), a succ d succ d a
d: MyNat
hd: (a : MyNat), a d d a
a: MyNat

succ
a succ d succ d a
d: MyNat
hd: (a : MyNat), a d d a
a: MyNat

succ
a succ d succ d a
d: MyNat
hd: (a : MyNat), a d d a

succ.zero
zero succ d succ d zero
d: MyNat
hd: (a : MyNat), a d d a

succ.zero.h
zero succ d

Goals accomplished! 🐙
d: MyNat
hd: (a : MyNat), a d d a
a: MyNat

succ.succ
succ a succ d succ d succ a
d: MyNat
hd: (a : MyNat), a d d a
a: MyNat
h2: a d d a

succ.succ
succ a succ d succ d succ a
d: MyNat
hd: (a : MyNat), a d d a
a: MyNat
h2: a d d a

succ.succ
succ a succ d succ d succ a
d: MyNat
hd: (a : MyNat), a d d a
a: MyNat
h: a d

succ.succ.inl
succ a succ d succ d succ a
d: MyNat
hd: (a : MyNat), a d d a
a: MyNat
h: a d

succ.succ.inl.h
succ a succ d

Goals accomplished! 🐙
d: MyNat
hd: (a : MyNat), a d d a
a: MyNat
h: d a

succ.succ.inr
succ a succ d succ d succ a
d: MyNat
hd: (a : MyNat), a d d a
a: MyNat
h: d a

succ.succ.inr.h
succ d succ a

Goals accomplished! 🐙

See the revert tactic

Note in the above proof that exact succ_le_succ a d h is just shorthand for: apply succ_le_succ a d exact h

Another collectible: the naturals are a linear order.

-- BUGBUG: collectibles -- instance : linear_order MyNat := by structure_helper

Next up Level 10