Skip to content

Instantly share code, notes, and snippets.

@raichoo
Last active August 29, 2015 13:57
Show Gist options
  • Save raichoo/9512895 to your computer and use it in GitHub Desktop.
Save raichoo/9512895 to your computer and use it in GitHub Desktop.
Theorem of Choice in Agda
module Choice where
record Σ(A : Set)(P : A → Set) : Set where
field
fst : A
snd : P fst
choice : {A : Set}{R : A → A → Set} →
((n : A) → Σ A (λ m → R n m)) →
Σ (A → A) (λ f → (
(n : A) → R n (f n)))
choice g = record { fst = λ x → Σ.fst (g x); snd = λ y → Σ.snd (g y) }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment