Last active
December 24, 2015 08:19
-
-
Save AndrasKovacs/6769513 to your computer and use it in GitHub Desktop.
Minimal agda definition for induction on natural numbers. (I realize that it's actually just dependent foldr).
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
module NatInduction where | |
data ℕ : Set where | |
zero : ℕ | |
suc : ℕ → ℕ | |
ℕ-ind : (prop : ℕ → Set) | |
→ (zero_proof : prop zero) | |
→ (ind_hyp : ∀ n → prop n → prop (suc n)) | |
→ (n : ℕ) | |
→ prop n | |
ℕ-ind prop zp hyp zero = zp | |
ℕ-ind prop zp hyp (suc n) = hyp n (ℕ-ind prop zp hyp n) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment