Skip to content

Instantly share code, notes, and snippets.

@copumpkin
Last active October 26, 2017 22:53
Show Gist options
  • Save copumpkin/6562417 to your computer and use it in GitHub Desktop.
Save copumpkin/6562417 to your computer and use it in GitHub Desktop.
Lawvere's theorem
module Lawvere where
open import Function.Equality hiding (cong)
open import Function.Surjection
open import Data.Product
open import Relation.Binary.PropositionalEquality
lawvere : {A B : Set} (f : A ↠ (A → B)) (g : B → B) → ∃ λ x → x ≡ g x
lawvere {A} {B} f g = h a , subst (λ r → h a ≡ g r) (cong (λ f → f a) (from-to refl)) refl
where
open Surjection f
h : A → B
h x = g ((to ⟨$⟩ x) x)
a : A
a = from ⟨$⟩ h
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment