import MyNat.Definition
import MyNat.Inequality -- le_iff_exists_add
import Mathlib.Tactic.Use -- use tactic
import AdditionWorld.Level2 -- add_assoc
import AdvancedAdditionWorld.Level8 -- eq_zero_of_add_right_eq_self
import AdvancedAdditionWorld.Level11 -- add_right_eq_zero
namespace MyNat
open MyNat
Inequality world.
Level 6: le_antisymm
In Advanced Addition World you proved
eq_zero_of_add_right_eq_self (a b : MyNat) : a + b = a → b = 0
.
This might be useful in this level.
Another tip: if you want to create a new hypothesis, you can use the have
tactic.
For example, if you have a hypothesis hd : a + (c + d) = a
and you want
a hypothesis h : c + d = 0
then you can write
have h := eq_zero_of_add_right_eq_self hd
Lemma : le_antisymm
≤
is antisymmetric. In other words, if a ≤ b
and b ≤ a
then a = b
.
theoremle_antisymm (le_antisymm: ∀ (a b : MyNat), a ≤ b → b ≤ a → a = baa: MyNatb :b: MyNatMyNat) (MyNat: Typehab :hab: a ≤ ba ≤a: MyNatb) (b: MyNathba :hba: b ≤ ab ≤b: MyNata) :a: MyNata =a: MyNatb :=b: MyNata, b: MyNat
hab: a ≤ b
hba: b ≤ aa = ba, b: MyNat
hab: a ≤ b
hba: b ≤ aa = ba, b: MyNat
hba: b ≤ a
c: MyNat
hc: b = a + c
introa = ba, b: MyNat
hba: b ≤ a
c: MyNat
hc: b = a + c
introa = ba, b, c: MyNat
hc: b = a + c
d: MyNat
hd: a = b + d
intro.introa = ba, b, c: MyNat
hc: b = a + c
d: MyNat
hd: a = b + d
intro.introa = ba, b, c: MyNat
hc: b = a + c
d: MyNat
hd: a = a + c + d
intro.introa = ba, b, c: MyNat
hc: b = a + c
d: MyNat
hd: a = a + (c + d)
intro.introa = ba, b, c: MyNat
hc: b = a + c
d: MyNat
hd: a = a + (c + d)
intro.introa = ba, b, c: MyNat
hc: b = a + c
d: MyNat
hd: a = a + (c + d)
intro.introa = ba, b, c: MyNat
hc: b = a + c
d: MyNat
hd✝: a = a + (c + d)
hd: a + (c + d) = a
intro.introa = ba, b, c: MyNat
hc: b = a + c
d: MyNat
hd✝: a = a + (c + d)
hd: a + (c + d) = a
h: c + d = 0
intro.introa = ba, b, c: MyNat
hc: b = a + c
d: MyNat
hd✝: a = a + (c + d)
hd: a + (c + d) = a
h: c + d = 0
h2: c = 0
intro.introa = ba, b, c: MyNat
hc: b = a + c
d: MyNat
hd✝: a = a + (c + d)
hd: a + (c + d) = a
h: c + d = 0
h2: c = 0
intro.introa = ba, b, c: MyNat
hc: b = a + 0
d: MyNat
hd✝: a = a + (c + d)
hd: a + (c + d) = a
h: c + d = 0
h2: c = 0
intro.introa = ba, b, c: MyNat
hc: b = a + 0
d: MyNat
hd✝: a = a + (c + d)
hd: a + (c + d) = a
h: c + d = 0
h2: c = 0
intro.introa = ba, b, c: MyNat
hc: b = a + 0
d: MyNat
hd✝: a = a + (c + d)
hd: a + (c + d) = a
h: c + d = 0
h2: c = 0
intro.introa = ba, b, c: MyNat
hc: b = a + 0
d: MyNat
hd✝: a = a + (c + d)
hd: a + (c + d) = a
h: c + d = 0
h2: c = 0
intro.introa = ba, b, c: MyNat
hc: b = a + 0
d: MyNat
hd✝: a = a + (c + d)
hd: a + (c + d) = a
h: c + d = 0
h2: c = 0
intro.introa = a + 0a, b, c: MyNat
hc: b = a + 0
d: MyNat
hd✝: a = a + (c + d)
hd: a + (c + d) = a
h: c + d = 0
h2: c = 0
intro.introa = a + 0Goals accomplished! 🐙
This proved that the natural numbers are a partial order!
-- BUGBUG : collectibles
-- instance : partial_order MyNat := by structure_helper
Next up Level 7