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/Addition.lean

27 lines
567 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.Definition
namespace MyNat
open MyNat
def add : MyNat → MyNat → MyNat
| a, 0 => a
| a, MyNat.succ b => MyNat.succ (MyNat.add a b)
instance : Add MyNat where
add := MyNat.add
/--
This theorem proves that if you add zero to a MyNat you get back the same number.
-/
theorem add_zero (a : MyNat) : a + 0 = a := by rfl
/--
This theorem proves that (a + (d + 1)) = ((a + d) + 1) for a,d in MyNat.
-/
theorem add_succ (a d : MyNat) : a + (succ d) = succ (a + d) := by rfl
-- TODO: testing. Remove me
axiom zero_add (n : ) : 0 + n = n