-
-
Save LeifW/4f31fb1eb53fb7822100 to your computer and use it in GitHub Desktop.
plus commutes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
plus_comm : (n : Nat) -> (m : Nat) -> (n + m = m + n) | |
-- Base case | |
(O + m = m + O) <== plus_comm = | |
rewrite ((m + O = m) <== plusZeroRightNeutral) ==> | |
(O + m = m) in refl | |
-- Step case | |
(S k + m = m + S k) <== plus_comm = | |
rewrite ((k + m = m + k) <== plus_comm) in | |
rewrite ((S (m + k) = m + S k) <== plusSuccRightSucc) in | |
refl | |
-- QED |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment