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

22 lines
380 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
example : (1 : ) ^ (1 : ) = 1 := rfl
lemma pow_zero (m : ) : m ^ (0 : ) = 1 := rfl
lemma pow_succ (m n : ) : m ^ (succ n) = m ^ n * m := rfl
end MyNat