coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Cedric Auger <sedrikov AT gmail.com>
- To: "coq-club AT inria.fr" <coq-club AT inria.fr>
- Subject: Re: [Coq-Club] mathematical function notation
- Date: Wed, 4 Nov 2015 21:36:56 +0100
- Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=sedrikov AT gmail.com; spf=Pass smtp.mailfrom=sedrikov AT gmail.com; spf=None smtp.helo=postmaster AT mail-io0-f169.google.com
- Ironport-phdr: 9a23:wBagWBSGhVW30Vbpu8YPd3bhstpsv+yvbD5Q0YIujvd0So/mwa64YRyN2/xhgRfzUJnB7Loc0qyN4/2mAjRLuM3d+Fk5M7VyFDY9wf0MmAIhBMPXQWbaF9XNKxIAIcJZSVV+9Gu6O0UGUOz3ZlnVv2HgpWVKQka3CwN5K6zPF5LIiIzvjqbpq8CVOF0D3WHhKZpJbzyI7izp/vEMhoVjLqtjgjDomVBvP9ps+GVzOFiIlAz97MrjtLRq8iBXpu5zv5UYCfayLOwESukSBzM/dmsx+cfDtB/ZTALJ6GFWGjEdlQMNCAzY5jn7WI3wu230rLwu9jOdOJjdQLwuWD/qxrpkRQWg3DwKOyQ482bJosN1haNf5hmmokoskMbvfIiJOa8mLevmdtQASD8ZUw==
2015-11-04 17:05 GMT+01:00 Michael Shulman <shulman AT sandiego.edu>:
On Wed, Nov 4, 2015 at 6:26 AM, Cedric Auger <sedrikov AT gmail.com> wrote:
> Inductive single (T : Type) := Single : T -> single T.
> Inductive pair (T U : Type) := Pair : T -> U -> pair T U.
> Inductive triple (T U V : Type) := Triple : T -> U -> V -> triple T U V.
>
> And so on (or even define it recursively as a "tuple : forall n, n_types n
> -> Type").
>
> And then have a (x) notation for single T type, (x, y) for pair T U type and
> so on.
I tried this, but I couldn't get it to work.
Inductive single (T : Type) := Single : T -> single T.
Notation "( x )" := (Single x).
Definition test T (f : single T -> T) (x : T) : f(x) = f(x).
(* The term "x" has type "T" while it is expected to have type "single T". *)
Did you have something different in mind?
No, but maybe that using other symbols than "(,)", like "⦅,⦆" or playing with notation levels and/or scopes.
Maybe something like
Notation "'( ' x ' )'" := …
Notation "'( ' x ' )'" := …
Which would force use of spaces in parentheses and might change something on the parser (but forcing to write "f( x )" rather than "f(x)"). Not sure on how parenthesis are parsed for now though, so it might not work either.
Mike
- [Coq-Club] mathematical function notation, Michael Shulman, 11/04/2015
- Re: [Coq-Club] mathematical function notation, Clément Pit--Claudel, 11/04/2015
- Re: [Coq-Club] mathematical function notation, Cedric Auger, 11/04/2015
- Message not available
- Re: [Coq-Club] mathematical function notation, Michael Shulman, 11/04/2015
- Re: [Coq-Club] mathematical function notation, Michael Shulman, 11/04/2015
- Re: [Coq-Club] mathematical function notation, Michael Shulman, 11/04/2015
- Message not available
- Re: [Coq-Club] mathematical function notation, Michael Shulman, 11/04/2015
- Re: [Coq-Club] mathematical function notation, Cedric Auger, 11/04/2015
- Re: [Coq-Club] mathematical function notation, Pierre-Marie Pédrot, 11/05/2015
- Message not available
- Re: [Coq-Club] mathematical function notation, Michael Shulman, 11/05/2015
- Re: [Coq-Club] mathematical function notation, Michael Shulman, 11/09/2015
- Re: [Coq-Club] mathematical function notation, Michael Shulman, 11/05/2015
- Re: [Coq-Club] mathematical function notation, Cedric Auger, 11/04/2015
- Re: [Coq-Club] mathematical function notation, Michael Shulman, 11/04/2015
Archive powered by MHonArc 2.6.18.