Skip to content

Instantly share code, notes, and snippets.

@raichoo
Created March 21, 2014 08:51
Show Gist options
  • Save raichoo/9682213 to your computer and use it in GitHub Desktop.
Save raichoo/9682213 to your computer and use it in GitHub Desktop.
Agda Example
data Image : (a -> b) -> b -> Type where
Im : {f : a -> b} -> (x : a) -> Image f (f x)
inv : (f : a -> b) -> (y : b) -> Image f y -> a
inv f y im with (im)
inv f _ im | Im x = x
{-
data Image{A B : Set}(f : A → B) : B → Set where
image : (x : A) → Image f (f x)
inv : ∀ {A B} (f : A → B) → (y : B) → Image f y → A
inv f .(f x) (image x) = x
-}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment