import MyNat.Definition
import MyNat.Inequality -- le_iff_exists_add
import Mathlib.Tactic.Use -- use tactic
import AdditionWorld.Level2 -- add_assoc
namespace MyNat
open MyNat
Inequality world.
Level 14: add_le_add_left
I know these are easy and we've done several already, but this is one
of the axioms for an ordered commutative monoid! The nature of formalizing
is that we should formalize all "obvious" lemmas, and then when we're
actually using ≤
in real life, everything will be there. Note also,
of course, that all of these lemmas are already formalized in Lean's
maths library already, for Lean's inbuilt natural numbers.
Lemma : add_le_add_left
If a ≤ b
then for all t
, t+a ≤ t+b
.
theoremadd_le_add_left {add_le_add_left: ∀ {a b : MyNat}, a ≤ b → ∀ (t : MyNat), t + a ≤ t + baa: MyNatb :b: MyNatMyNat} (MyNat: Typeh :h: a ≤ ba ≤a: MyNatb) (b: MyNatt :t: MyNatMyNat) :MyNat: Typet +t: MyNata ≤a: MyNatt +t: MyNatb :=b: MyNata, b: MyNat
h: a ≤ b
t: MyNatt + a ≤ t + ba, b: MyNat
h: a ≤ b
t: MyNatt + a ≤ t + ba, b, t, c: MyNat
hc: b = a + c
introt + a ≤ t + ba, b, t, c: MyNat
hc: b = a + c
introt + b = t + a + ca, b, t, c: MyNat
hc: b = a + c
introt + b = t + a + ca, b, t, c: MyNat
hc: b = a + c
introt + (a + c) = t + a + ca, b, t, c: MyNat
hc: b = a + c
introt + (a + c) = t + a + ca, b, t, c: MyNat
hc: b = a + c
introt + (a + c) = t + a + ca, b, t, c: MyNat
hc: b = a + c
introt + (a + c) = t + (a + c)Goals accomplished! 🐙
Next up Level 15