Advertisement
Guest User

Untitled

a guest
Jul 11th, 2017
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- let's use parametricity in a useful way: prove that any
  2. -- function of type (X : *) -> X -> X is the identity.
  3.  
  4. -- To simplify the example we use impredicativity here, use
  5. -- the -I flag to enable it.
  6.  
  7. Eq = \A a b -> (P : A -> *) -> P a -> P b
  8.    : (A : *<) -> A -> A -> *
  9.    ,
  10.  
  11. Theorem =
  12.   (f : (A : *) -> A -> A) ->
  13.   (A : *) ->
  14.   (x : A) ->
  15.   Eq A< x< (f A x)<,
  16.  
  17.  
  18. proof = \(f : (A : *) -> (a : A) -> A) ->
  19.         \(A : *) ->
  20.         \(x : A) -> f! A< (Eq A< x<) x< (\_ p -> p)
  21.       : Theorem
  22.  
  23.  
  24. ,
  25. *
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement