import MyNat.Power
import MyNat.Addition -- add_zero
import MultiplicationWorld.Level2 -- mul_one
import MultiplicationWorld.Level5 -- mul_assoc
namespace MyNat
open MyNat

Power World

Level 5: pow_add

Lemma

For all naturals a, m, n, we have a^(m + n) = a ^ m a ^ n.

lemma 
pow_add: ∀ (a m n : MyNat), a ^ (m + n) = a ^ m * a ^ n
pow_add
(
a: MyNat
a
m: MyNat
m
n: MyNat
n
:
MyNat: Type
MyNat
) :
a: MyNat
a
^ (
m: MyNat
m
+
n: MyNat
n
) =
a: MyNat
a
^
m: MyNat
m
*
a: MyNat
a
^
n: MyNat
n
:=
a, m, n: MyNat

a ^ (m + n) = a ^ m * a ^ n
a, m, n: MyNat

a ^ (m + n) = a ^ m * a ^ n
a, m: MyNat

zero
a ^ (m + zero) = a ^ m * a ^ zero
a, m: MyNat

zero
a ^ (m + zero) = a ^ m * a ^ zero
a, m: MyNat

zero
a ^ (m + 0) = a ^ m * a ^ 0
a, m: MyNat

zero
a ^ (m + 0) = a ^ m * a ^ 0
a, m: MyNat

zero
a ^ (m + 0) = a ^ m * a ^ 0
a, m: MyNat

zero
a ^ m = a ^ m * a ^ 0
a, m: MyNat

zero
a ^ m = a ^ m * a ^ 0
a, m: MyNat

zero
a ^ m = a ^ m * a ^ 0
a, m: MyNat

zero
a ^ m = a ^ m * 1
a, m: MyNat

zero
a ^ m = a ^ m * 1
a, m: MyNat

zero
a ^ m = a ^ m * 1
a, m: MyNat

zero
a ^ m = a ^ m

Goals accomplished! 🐙
a, m, n: MyNat
ih: a ^ (m + n) = a ^ m * a ^ n

succ
a ^ (m + succ n) = a ^ m * a ^ succ n
a, m, n: MyNat
ih: a ^ (m + n) = a ^ m * a ^ n

succ
a ^ (m + succ n) = a ^ m * a ^ succ n
a, m, n: MyNat
ih: a ^ (m + n) = a ^ m * a ^ n

succ
a ^ succ (m + n) = a ^ m * a ^ succ n
a, m, n: MyNat
ih: a ^ (m + n) = a ^ m * a ^ n

succ
a ^ succ (m + n) = a ^ m * a ^ succ n
a, m, n: MyNat
ih: a ^ (m + n) = a ^ m * a ^ n

succ
a ^ succ (m + n) = a ^ m * a ^ succ n
a, m, n: MyNat
ih: a ^ (m + n) = a ^ m * a ^ n

succ
a ^ (m + n) * a = a ^ m * a ^ succ n
a, m, n: MyNat
ih: a ^ (m + n) = a ^ m * a ^ n

succ
a ^ (m + n) * a = a ^ m * a ^ succ n
a, m, n: MyNat
ih: a ^ (m + n) = a ^ m * a ^ n

succ
a ^ (m + n) * a = a ^ m * a ^ succ n
a, m, n: MyNat
ih: a ^ (m + n) = a ^ m * a ^ n

succ
a ^ (m + n) * a = a ^ m * (a ^ n * a)
a, m, n: MyNat
ih: a ^ (m + n) = a ^ m * a ^ n

succ
a ^ (m + n) * a = a ^ m * (a ^ n * a)
a, m, n: MyNat
ih: a ^ (m + n) = a ^ m * a ^ n

succ
a ^ (m + n) * a = a ^ m * (a ^ n * a)
a, m, n: MyNat
ih: a ^ (m + n) = a ^ m * a ^ n

succ
a ^ m * a ^ n * a = a ^ m * (a ^ n * a)
a, m, n: MyNat
ih: a ^ (m + n) = a ^ m * a ^ n

succ
a ^ m * a ^ n * a = a ^ m * (a ^ n * a)
a, m, n: MyNat
ih: a ^ (m + n) = a ^ m * a ^ n

succ
a ^ m * a ^ n * a = a ^ m * (a ^ n * a)
a, m, n: MyNat
ih: a ^ (m + n) = a ^ m * a ^ n

succ
a ^ m * (a ^ n * a) = a ^ m * (a ^ n * a)

Goals accomplished! 🐙

Remember you can combine all the rw rules into one with rw [add_succ, pow_succ, pow_succ, ih, mul_assoc] but we have broken it out here so you can more easily see all the intermediate goal states.

Next up Level 6