import MyNat.Definition
import MyNat.Addition -- add_zero
import AdvancedAdditionWorld.Level1 -- succ_inj
namespace MyNat
open MyNat
Advanced Addition World
Level 5: add_right_cancel
The theorem add_right_cancel
is the theorem that you can cancel on the right
when you're doing addition -- if a + t = b + t
then a = b
. After intro h
I'd recommend induction on t
. Don't forget that rw [add_zero] at h
can be used
to do rewriting of hypotheses rather than the goal.
Theorem
On the set of natural numbers, addition has the right cancellation property.
In other words, if there are natural numbers a, b
and c
such that
a + t = b + t
then we have a = b
.
theoremadd_right_cancel (add_right_cancel: ∀ (a t b : MyNat), a + t = b + t → a = baa: MyNattt: MyNatb :b: MyNatMyNat) :MyNat: Typea +a: MyNatt =t: MyNatb +b: MyNatt →t: MyNata =a: MyNatb :=b: MyNata, t, b: MyNata + t = b + t → a = ba, t, b: MyNat
h: a + t = b + ta = ba, t, b: MyNat
h: a + t = b + ta = ba, b: MyNat
h: a + zero = b + zero
zeroa = ba, b: MyNat
h: a + zero = b + zero
zeroa = ba, b: MyNat
h: a + 0 = b + 0
zeroa = ba, b: MyNat
h: a + 0 = b + 0
zeroa = ba, b: MyNat
h: a + 0 = b + 0
zeroa = ba, b: MyNat
h: a + 0 = b + 0
zeroa = ba, b: MyNat
h: a = b + 0
zeroa = ba, b: MyNat
h: a = b + 0
zeroa = ba, b: MyNat
h: a = b + 0
zeroa = ba, b: MyNat
h: a = b + 0
zeroa = ba, b: MyNat
h: a = b
zeroa = ba, b: MyNat
h: a = b
zeroa = ba, b: MyNat
h: a = b
zeroa = bGoals accomplished! 🐙a, b, d: MyNat
ih: a + d = b + d → a = b
h: a + succ d = b + succ d
succa = ba, b, d: MyNat
ih: a + d = b + d → a = b
h: a + succ d = b + succ d
succa + d = b + da, b, d: MyNat
ih: a + d = b + d → a = b
h: a + succ d = b + succ d
succa + d = b + da, b, d: MyNat
ih: a + d = b + d → a = b
h: succ (a + d) = b + succ d
succa + d = b + da, b, d: MyNat
ih: a + d = b + d → a = b
h: succ (a + d) = b + succ d
succa + d = b + da, b, d: MyNat
ih: a + d = b + d → a = b
h: succ (a + d) = b + succ d
succa + d = b + da, b, d: MyNat
ih: a + d = b + d → a = b
h: succ (a + d) = b + succ d
succa + d = b + da, b, d: MyNat
ih: a + d = b + d → a = b
h: succ (a + d) = succ (b + d)
succa + d = b + da, b, d: MyNat
ih: a + d = b + d → a = b
h: succ (a + d) = succ (b + d)
succa + d = b + da, b, d: MyNat
ih: a + d = b + d → a = b
h: succ (a + d) = succ (b + d)
succa + d = b + dGoals accomplished! 🐙
Next up Level 6