Skip to Content.
Sympa Menu

coq-club - [Coq-Club] Strengthening the definitional equality on types?

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

[Coq-Club] Strengthening the definitional equality on types?


chronological Thread 
  • From: Benjamin Pierce <bcpierce AT cis.upenn.edu>
  • To: coq-club AT pauillac.inria.fr
  • Cc: Martin Hofmann <mhofmann AT TCS.IFI.LMU.DE>
  • Subject: [Coq-Club] Strengthening the definitional equality on types?
  • Date: Tue, 4 Aug 2009 17:24:15 -0400
  • List-archive: <http://pauillac.inria.fr/pipermail/coq-club/>

Suppose one wanted to define isomorphisms in the following slightly unusual fashion:

  Inductive Dir : Set := R | L.
  Definition swap (d:Dir) := match d with R => L | L => R end.

  Module Type Iso.
    Parameter S : Dir -> Set.
    Parameter f : forall d, S d -> S (swap d).
    Axiom isoAx : forall d x, f (swap d) (f d x) = x.
  End Iso.

Instead of two separate functions, two axioms, and two sets, we index everything by a direction. This means we can write definitions of composition of isomorphisms, juxtaposition, etc. and prove their properties very compactly (saving 50% of the typing each time).

Unfortunately, this definition doesn't typecheck: the term

   f (swap d) (f d x)

has type S (swap (swap d)), not S d, which is the type of x. Of course, swap (swap d) is provably equal to d for every d, but not convertible.

What to do? We've seen the discussion of John Major equality in CoqArt... is this our only hope, or is there a lighter way?

Thanks!

    - Benjamin Pierce and Martin Hofmann





Archive powered by MhonArc 2.6.16.

Top of Page