Last active
October 26, 2017 22:53
-
-
Save copumpkin/6562417 to your computer and use it in GitHub Desktop.
Lawvere's theorem
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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