Last active
July 5, 2023 19:57
-
-
Save righ1113/7f05fc52938488766289b3944ccd321f to your computer and use it in GitHub Desktop.
自然数の加法の交換法則 in Idris
This file contains hidden or 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
| -- $ chcp 65001 | |
| -- $ idris | |
| -- > :l Comm | |
| module Comm | |
| %default total | |
| comm : (x, y : Nat) -> x + y = y + x | |
| comm Z Z = Refl | |
| comm (S x) Z = rewrite plusZeroRightNeutral x in Refl | |
| comm Z (S y) = rewrite plusZeroRightNeutral y in Refl | |
| comm (S x) (S y) = | |
| rewrite sym (plusSuccRightSucc x y) in | |
| rewrite sym (plusSuccRightSucc y x) in cong {f = S . S} (comm x y) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment