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
.
theoremle_total (le_total: ∀ (a b : MyNat), a ≤ b ∨ b ≤ aaa: MyNatb :b: MyNatMyNat) :MyNat: Typea ≤a: MyNatb ∨b: MyNatb ≤b: MyNata :=a: MyNata, b: MyNata ≤ b ∨ b ≤ ab: MyNat∀ (a : MyNat), a ≤ b ∨ b ≤ ab: MyNat∀ (a : MyNat), a ≤ b ∨ b ≤ a
zero∀ (a : MyNat), a ≤ zero ∨ zero ≤ aa: MyNat
zeroa ≤ zero ∨ zero ≤ aa: MyNat
zero.hzero ≤ aGoals accomplished! 🐙d: MyNat
hd: ∀ (a : MyNat), a ≤ d ∨ d ≤ a
succ∀ (a : MyNat), a ≤ succ d ∨ succ d ≤ ad: MyNat
hd: ∀ (a : MyNat), a ≤ d ∨ d ≤ a
a: MyNat
succa ≤ succ d ∨ succ d ≤ ad: MyNat
hd: ∀ (a : MyNat), a ≤ d ∨ d ≤ a
a: MyNat
succa ≤ succ d ∨ succ d ≤ ad: MyNat
hd: ∀ (a : MyNat), a ≤ d ∨ d ≤ a
succ.zerozero ≤ succ d ∨ succ d ≤ zerod: MyNat
hd: ∀ (a : MyNat), a ≤ d ∨ d ≤ a
succ.zero.hzero ≤ succ dGoals accomplished! 🐙d: MyNat
hd: ∀ (a : MyNat), a ≤ d ∨ d ≤ a
a: MyNat
succ.succsucc a ≤ succ d ∨ succ d ≤ succ ad: MyNat
hd: ∀ (a : MyNat), a ≤ d ∨ d ≤ a
a: MyNat
h2: a ≤ d ∨ d ≤ a
succ.succsucc a ≤ succ d ∨ succ d ≤ succ ad: MyNat
hd: ∀ (a : MyNat), a ≤ d ∨ d ≤ a
a: MyNat
h2: a ≤ d ∨ d ≤ a
succ.succsucc a ≤ succ d ∨ succ d ≤ succ ad: MyNat
hd: ∀ (a : MyNat), a ≤ d ∨ d ≤ a
a: MyNat
h: a ≤ d
succ.succ.inlsucc a ≤ succ d ∨ succ d ≤ succ ad: MyNat
hd: ∀ (a : MyNat), a ≤ d ∨ d ≤ a
a: MyNat
h: a ≤ d
succ.succ.inl.hsucc a ≤ succ dGoals accomplished! 🐙d: MyNat
hd: ∀ (a : MyNat), a ≤ d ∨ d ≤ a
a: MyNat
h: d ≤ a
succ.succ.inrsucc a ≤ succ d ∨ succ d ≤ succ ad: MyNat
hd: ∀ (a : MyNat), a ≤ d ∨ d ≤ a
a: MyNat
h: d ≤ a
succ.succ.inr.hsucc d ≤ succ aGoals 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