Skip to content

Instantly share code, notes, and snippets.

@bond15
Last active July 18, 2021 02:11
Show Gist options
  • Save bond15/518569f1a84804750b8eb7a3834e6411 to your computer and use it in GitHub Desktop.
Save bond15/518569f1a84804750b8eb7a3834e6411 to your computer and use it in GitHub Desktop.
Axiom Of Choice in DTT
module AOC where
open import Agda.Builtin.Sigma
open import Relation.Binary.PropositionalEquality using (_≡_;refl)
infix 0 _≈_
record _≈_ (A B : Set) : Set where
field
to : A → B
from : B → A
from∘to : ∀ (x : A) → from (to x) ≡ x
to∘from : ∀ (y : B) → to (from y) ≡ y
open _≈_
AOC : ∀ {I : Set} {J : I → Set} {X : (i : I) → J i → Set} →
(∀ (i : I) → Σ (J i) (λ j → (X i j))) ≈ (Σ (∀ (i : I) → J i) (λ ĵ → ∀ (i : I) → X i (ĵ i)))
AOC = record {
to = λ f → (λ i → fst (f i)) , λ i → snd (f i ) ;
from = λ sig → λ i → (fst sig) i , (snd sig) i ;
from∘to = λ x → refl;
to∘from = λ y → refl
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment