import MyNat.Power
import MultiplicationWorld.Level2 -- mul_one
import MultiplicationWorld.Level9 -- simp additions
namespace MyNat
open MyNat

Power World

Level 6: mul_pow

Here we use the attribute [simp] additions we made in level 9 of Multiplication World so that the simp tactic can simplify expressions involving *.

Lemma

For all naturals a, b, n, we have (ab) ^ n = a ^ nb ^ n.

lemma 
mul_pow: ∀ (a b n : MyNat), (a * b) ^ n = a ^ n * b ^ n
mul_pow
(
a: MyNat
a
b: MyNat
b
n: MyNat
n
:
MyNat: Type
MyNat
) : (
a: MyNat
a
*
b: MyNat
b
) ^
n: MyNat
n
=
a: MyNat
a
^
n: MyNat
n
*
b: MyNat
b
^
n: MyNat
n
:=
a, b, n: MyNat

(a * b) ^ n = a ^ n * b ^ n
a, b, n: MyNat

(a * b) ^ n = a ^ n * b ^ n
a, b: MyNat

zero
(a * b) ^ zero = a ^ zero * b ^ zero
a, b: MyNat

zero
(a * b) ^ zero = a ^ zero * b ^ zero
a, b: MyNat

zero
(a * b) ^ 0 = a ^ 0 * b ^ 0
a, b: MyNat

zero
(a * b) ^ 0 = a ^ 0 * b ^ 0
a, b: MyNat

zero
(a * b) ^ 0 = a ^ 0 * b ^ 0
a, b: MyNat

zero
1 = 1 * b ^ 0
a, b: MyNat

zero
1 = a ^ 0 * b ^ 0
a, b: MyNat

zero
1 = 1 * 1
a, b: MyNat

zero
1 = 1 * 1
a, b: MyNat

zero
1 = 1

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

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

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

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

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

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

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

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

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

Goals accomplished! 🐙

Next up Level 7