import MyNat.Definition
import MyNat.Addition
import AdditionWorld.Level6
import AdvancedAdditionWorld.Level1 -- succ_inj
import AdvancedAdditionWorld.Level3 -- succ_eq_succ_of_eq
namespace MyNat
open MyNat
Advanced Addition World
Level 4: eq_iff_succ_eq_succ
Here is an iff
goal. You can split it into two goals (the implications in both
directions) using the constructor
tactic, which is how you're going to have to start.
constructor
Now you have two goals. The first is exactly succ_inj
so you can close
it with
exact succ_inj
and the second one you could solve by looking up the name of the theorem
you proved in the last level and doing exact <that name>
, or alternatively
you could get some more intro
practice and seeing if you can prove it
using intro
and rw
.
Remember that succ_inj
is succ a = succ b → a = b
.
Theorem
Two natural numbers are equal if and only if their successors are equal.
theoremsucc_eq_succ_iff (succ_eq_succ_iff: ∀ (a b : MyNat), succ a = succ b ↔ a = baa: MyNatb :b: MyNatMyNat) :MyNat: Typesuccsucc: MyNat → MyNata =a: MyNatsuccsucc: MyNat → MyNatb ↔b: MyNata =a: MyNatb :=b: MyNata, b: MyNatsucc a = succ b ↔ a = ba, b: MyNat
mpsucc a = succ b → a = ba, b: MyNata = b → succ a = succ ba, b: MyNat
mpra = b → succ a = succ bGoals accomplished! 🐙
Next up Level 5