import MyNat.Definition
import MyNat.Inequality -- le_iff_exists_add
import Mathlib.Tactic.Use -- use tactic
import AdditionWorld.Level6 -- add_right_comm
namespace MyNat
open MyNat
Inequality world.
Level 11: add_le_add_right
If you're faced with a goal of the form forall t, ...
, then the next
line is "so let t
be arbitrary". The way to do this in Lean is intro t
.
Lemma : add_le_add_right
For all naturals a
and b
, a ≤ b
implies that for all naturals t
,
a+t ≤ b+t
.
theoremadd_le_add_right {add_le_add_right: ∀ {a b : MyNat}, a ≤ b → ∀ (t : MyNat), a + t ≤ b + taa: MyNatb :b: MyNatMyNat} :MyNat: Typea ≤a: MyNatb → ∀b: MyNatt, (t: MyNata +a: MyNatt) ≤ (t: MyNatb +b: MyNatt) :=t: MyNata, b: MyNata ≤ b → ∀ (t : MyNat), a + t ≤ b + ta, b: MyNat
h: a ≤ b∀ (t : MyNat), a + t ≤ b + ta, b: MyNat
h: a ≤ b∀ (t : MyNat), a + t ≤ b + ta, b, c: MyNat
hc: b = a + c
intro∀ (t : MyNat), a + t ≤ b + ta, b, c: MyNat
hc: b = a + c
t: MyNat
introa + t ≤ b + ta, b, c: MyNat
hc: b = a + c
t: MyNat
introb + t = a + t + ca, b, c: MyNat
hc: b = a + c
t: MyNat
introb + t = a + t + ca, b, c: MyNat
hc: b = a + c
t: MyNat
introa + c + t = a + t + ca, b, c: MyNat
hc: b = a + c
t: MyNat
introa + c + t = a + t + ca, b, c: MyNat
hc: b = a + c
t: MyNat
introa + c + t = a + t + ca, b, c: MyNat
hc: b = a + c
t: MyNat
introa + t + c = a + t + cGoals accomplished! 🐙
Next up Level 12