import MyNat.Addition
import MyNat.Multiplication
import AdditionWorld.Level1 -- zero_add
import AdditionWorld.Level5 -- one_eq_succ_zero, succ_eq_add_one
namespace MyNat
open MyNat
Multiplication World
Level 3: one_mul
These proofs from addition world might be useful here:
one_eq_succ_zero : 1 = succ 0
succ_eq_add_one a : succ a = a + 1
We just proved mul_one
, now let's prove one_mul
. Then we will have proved, in fancy terms, that
1 is a "left and right identity" for multiplication (just like we showed that 0 is a left and right
identity for addition with add_zero
and zero_add
).
Lemma
For any natural number m
, we have 1 * m = m.
lemmaone_mul (one_mul: ∀ (m : MyNat), 1 * m = mm :m: MyNatMyNat) :MyNat: Type1 *1: MyNatm =m: MyNatm :=m: MyNatm: MyNat1 * m = mm: MyNat1 * m = m
zero1 * zero = zero
zero1 * zero = zero
zero1 * 0 = 0
zero1 * 0 = 0
zero1 * 0 = 0
zero0 = 0Goals accomplished! 🐙m: MyNat
ih: 1 * m = m
succ1 * succ m = succ mm: MyNat
ih: 1 * m = m
succ1 * succ m = succ mm: MyNat
ih: 1 * m = m
succ1 * m + 1 = succ mm: MyNat
ih: 1 * m = m
succ1 * m + 1 = succ mm: MyNat
ih: 1 * m = m
succ1 * m + 1 = succ mm: MyNat
ih: 1 * m = m
succm + 1 = succ mm: MyNat
ih: 1 * m = m
succm + 1 = succ mm: MyNat
ih: 1 * m = m
succm + 1 = succ mm: MyNat
ih: 1 * m = m
succm + 1 = m + 1Goals accomplished! 🐙
Next up is Multiplication Level 4.