`Refl` thing in Calculus of Constructions?
问题 In languages such as Agda , Idris , or Haskell with type extensions, there is a = type sort of like the following data a :~: b where Refl :: a :~: a a :~: b means that a and b are the same. Can such a type be defined in the calculus of constructions or Morte (which is programming language based on the calculus of construction)? 回答1: The standard Church-encoding of a :~: b in CoC is: (a :~: b) = forall (P :: * -> * -> *). (forall c :: *. P c c) -> P a b Refl being Refl a :: a :~: a Refl a = \