Created
May 3, 2016 17:54
-
-
Save gallais/5f026ebe33824eecb6db5421ebdd3fb0 to your computer and use it in GitHub Desktop.
Thinning using Sozeau's equations
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
Require Import Equations. | |
Inductive Fin : nat -> Type := | |
| fz {n : nat} : Fin (S n) | |
| fs {n : nat} : Fin n -> Fin (S n). | |
Lemma FinO_elim : Fin O -> False. | |
Proof. | |
inversion 1. | |
Qed. | |
Equations thin {n : nat} (x : Fin (S n)) (y : Fin n) : Fin (S n) | |
:= thin O _ y := False_rect _ (FinO_elim y) | |
; thin n fz y := fs y | |
; thin (S n) (fs x) fz := fz | |
; thin (S n) (fs x) (fs y) := fs (thin x y) | |
. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment