Skip to content

Instantly share code, notes, and snippets.

@mjgpy3
Created April 20, 2017 02:25
Show Gist options
  • Save mjgpy3/00c64bfe3b7d131237b1e4ded020b50f to your computer and use it in GitHub Desktop.
Save mjgpy3/00c64bfe3b7d131237b1e4ded020b50f to your computer and use it in GitHub Desktop.
Plus Commutes
myPlusCommutes : (n : Nat) -> (m : Nat) -> n + m = m + n
myPlusCommutes Z Z = Refl
myPlusCommutes Z (S k) = rewrite plusZeroRightNeutral (S k) in Refl
myPlusCommutes (S k) Z = rewrite plusZeroRightNeutral (S k) in Refl
myPlusCommutes (S k) (S j) =
cong {f=S} (rewrite sym (plusSuccRightSucc k j) in (rewrite myPlusCommutes k j in (rewrite plusSuccRightSucc j k in Refl)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment