You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
lean4game/server/nng/NNG/MyNat/Power.lean

27 lines
507 B
Plaintext

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

import NNG.MyNat.Multiplication
namespace MyNat
open MyNat
def pow :
| _, zero => one
| m, (succ n) => pow m n * m
instance : Pow where
pow := pow
-- notation a ^ b := pow a b
-- Important note: This here is the real `rfl`, not the weaker game version
example : (1 : ) ^ 1 = 1 := by rfl
theorem pow_zero (m : ) : m ^ 0 = 1 := by rfl
theorem pow_succ (m n : ) : m ^ (succ n) = m ^ n * m := by rfl
def two_eq_succ_one : (2 : ) = succ 1 := by rfl
end MyNat