Skip to content

Instantly share code, notes, and snippets.

@gmalecha
gmalecha / ApproxNat.v
Created January 15, 2016 06:59
Approximating inductive types
Require Import Coq.Classes.RelationClasses.
Require Import Coq.Classes.Morphisms.
Fail Inductive X : Type := BAD : (X -> X) -> X.
Definition natF (T : Type) : Type :=
T + unit.
(* We define approximation using a fixpoint which computes a Type
* by repeatedly applying a function. The base case is the empty set.
@gmalecha
gmalecha / even_refl.v
Created October 5, 2015 06:28
Simple computational reflection example.
Set Implicit Arguments.
Set Strict Implicit.
Inductive Even : nat -> Prop :=
| Even_O : Even 0
| Even_SS : forall n, Even n -> Even (S (S n)).
Goal Even 0.
apply Even_O.
Qed.
@gmalecha
gmalecha / gist:899d0594a67b2d35da73
Created March 4, 2014 00:05
"Compilation" of univalence in Coq.
Require Import MirrorCore.Iso.
Set Implicit Arguments.
Set Strict Implicit.
Definition Pi (T : Type) (F : T -> Type) : Type :=
forall x : T, F x.
(** What is the generalization of [Functor] to a dependent function? **)
Class DFunctor (Q : Type -> Type) (F : Pi Q)