import MyNat.Definition
import MyNat.Addition
namespace MyNat
open MyNat
Advanced Addition World
Level 3: succ_eq_succ_of_eq
.
We are going to prove something completely obvious: if a=b
then
succ a = succ b
. This is not succ_inj
!
This is trivial -- we can just rewrite our proof of a=b
.
But how do we get to that proof? Use the intro
tactic.
Theorem
For all naturals a
and b
, a = b ⟹ succ a = succ b
.
theoremsucc_eq_succ_of_eq {succ_eq_succ_of_eq: ∀ {a b : MyNat}, a = b → succ a = succ baa: MyNatb :b: MyNatMyNat} :MyNat: Typea =a: MyNatb →b: MyNatsuccsucc: MyNat → MyNata =a: MyNatsuccsucc: MyNat → MyNatb :=b: MyNata, b: MyNata = b → succ a = succ ba, b: MyNat
h: a = bsucc a = succ ba, b: MyNat
h: a = bsucc a = succ ba, b: MyNat
h: a = bsucc b = succ bGoals accomplished! 🐙
Next up Level 4