Skip to content

Instantly share code, notes, and snippets.

@gallais
Created May 3, 2016 17:54
Show Gist options
  • Save gallais/5f026ebe33824eecb6db5421ebdd3fb0 to your computer and use it in GitHub Desktop.
Save gallais/5f026ebe33824eecb6db5421ebdd3fb0 to your computer and use it in GitHub Desktop.
Thinning using Sozeau's equations
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