Skip to content

Instantly share code, notes, and snippets.

View digama0's full-sized avatar

Mario Carneiro digama0

View GitHub Profile
@digama0
digama0 / induction.lean
Last active October 18, 2020 14:52
Finite basis for inductive types
universes i j k l m
def empty.elim (A : Sort i) (H : empty) : A :=
@empty.rec (λ e, A) H
def iso0 {A} {C : (empty → A) → Sort i} (f : empty → A) (H : C (empty.elim A)) : C f :=
eq.rec H (funext (empty.rec _) : empty.elim A = f)
def iso1 {A} {C : (unit → A) → Sort i} (f : unit → A) (H : C (λu, f ())) : C f :=
eq.rec H (funext (λu, unit.rec rfl u) : (λu, f ()) = f)