Last active
August 29, 2015 14:00
-
-
Save sellout/4ebcade5736875af4fc2 to your computer and use it in GitHub Desktop.
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
tightmod : Nat -> (m : Nat) -> Not (m = Z) -> Fin m | |
tightmod _ Z prf = FalseElim (prf refl) | |
tightmod left (S modulus) p = case decLTE left (S modulus) of | |
Yes _ => fromMaybe fZ (natToFin left (S modulus)) | |
No _ => tightmod (left - (S modulus)) (S modulus) p |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment