Git Product home page Git Product logo

Comments (17)

vladimirias avatar vladimirias commented on June 6, 2024

On Nov 5, 2014, at 3:52 PM, Benedikt Ahrens [email protected] wrote:

Notation "∀ x .. y , P" := (forall x, .. (forall y, P) ..)
(at level 200, x binder, y binder, right associativity) : type_scope.

Can you explain what it means (e.g. give a few examples)?

V.

from unimath.

benediktahrens avatar benediktahrens commented on June 6, 2024

On 11/05/2014 04:58 PM, Vladimir Voevodsky wrote:

On Nov 5, 2014, at 3:52 PM, Benedikt Ahrens [email protected] wrote:

Notation "∀ x .. y , P" := (forall x, .. (forall y, P) ..)
(at level 200, x binder, y binder, right associativity) : type_scope.

Can you explain what it means (e.g. give a few examples)?

This particular notation is actually also defined in the Coq standard
library [1].

I use it in [2, see e.g. lines 87 - 91], where I also indicate implicit
arguments via {} as in the type annotation of
Definition I {C : folds_3_id_comp_eq} : ∀ {a : C}, a ⇒ a → UU := pr1
(pr1 (pr2 C)).

Concerning the individual data of the "Notation" command:
i) The level assigns a precedence to the notation - 200 is the lowest
precedence.
ii)saying that x and y are binders allows to write, e.g.,
∀ a b : T
instead of
∀ (a : T) (b : T)
(there are more variants for binders, documented in [3, sec. 12.1.13])
iii) right associativity is the same as for function spaces

So far, I have not come across a situation where ∀ behaves differently
from "forall".

[1] https://coq.inria.fr/distrib/current/stdlib/Coq.Unicode.Utf8_core.html

[2]
https://github.com/benediktahrens/folds/blob/master/coq/folds_pre_2_cat.v

[3] https://coq.inria.fr/distrib/current/refman/Reference-Manual014.html

from unimath.

lambdabetaeta avatar lambdabetaeta commented on June 6, 2024

Even though environments for other dependently typed systems (for example the Agda Emacs mode) make inputting Unicode very easy, they are essentially limited to either mimicking LaTeX commands, or support only few symbols; the rest has to be done by hand -- see e.g. [1]. What is your preferred approach in this case?

It may be old-fashioned, but not many things can go wrong when sticking with ASCII.

[1] http://wiki.portal.chalmers.se/agda/pmwiki.php?n=Docs.UnicodeInput

from unimath.

benediktahrens avatar benediktahrens commented on June 6, 2024

On 11/05/2014 06:09 PM, Alex Kavvos wrote:

Even though environments for other dependently typed systems (for
example the Agda Emacs mode) make inputting Unicode very easy, they
are essentially limited to either mimicking LaTeX commands, or
support only few symbols; the rest has to be done by hand -- see e.g.
[1]. What is your preferred approach in this case?

I am using the Agda input method in ProofGeneral for writing Unicode
characters in Coq files.

from unimath.

vladimirias avatar vladimirias commented on June 6, 2024

Actually the part that I did not understand is .. what does it stand for? Can I write

Sigma { x : A } ( y : B ) , P x y .

? If so then what will it mean? I am using Sigma instead of you unicode thing.

V.

On Nov 5, 2014, at 4:32 PM, Benedikt Ahrens [email protected] wrote:

On 11/05/2014 04:58 PM, Vladimir Voevodsky wrote:

On Nov 5, 2014, at 3:52 PM, Benedikt Ahrens [email protected] wrote:

Notation "∀ x .. y , P" := (forall x, .. (forall y, P) ..)
(at level 200, x binder, y binder, right associativity) : type_scope.

Can you explain what it means (e.g. give a few examples)?

This particular notation is actually also defined in the Coq standard
library [1].

I use it in [2, see e.g. lines 87 - 91], where I also indicate implicit
arguments via {} as in the type annotation of
Definition I {C : folds_3_id_comp_eq} : ∀ {a : C}, a ⇒ a → UU := pr1
(pr1 (pr2 C)).

Concerning the individual data of the "Notation" command:
i) The level assigns a precedence to the notation - 200 is the lowest
precedence.
ii)saying that x and y are binders allows to write, e.g.,
∀ a b : T
instead of
∀ (a : T) (b : T)
(there are more variants for binders, documented in [3, sec. 12.1.13])
iii) right associativity is the same as for function spaces

So far, I have not come across a situation where ∀ behaves differently
from "forall".

[1] https://coq.inria.fr/distrib/current/stdlib/Coq.Unicode.Utf8_core.html

[2]
https://github.com/benediktahrens/folds/blob/master/coq/folds_pre_2_cat.v

[3] https://coq.inria.fr/distrib/current/refman/Reference-Manual014.html

Reply to this email directly or view it on GitHub #46 (comment).

from unimath.

vladimirias avatar vladimirias commented on June 6, 2024

Yes, I would prefer ASCII for now as well. But I like this

Notation "'Σ' x .. y , P" := (total2 (fun x => .. (total2 (fun y => P)) ..))
(at level 200, x binder, y binder, right associativity) : type_scope.

with Sigma instead of the unicode thing.

Maybe lambda, also as a word.

We can have an infix for dirprod e.g. times. It would then be (( A times B ) times C) and if
we decide to use unicode later it will be a matter of a simple “replace”.

Does this

| A |

work for ishinh?

V.

On Nov 5, 2014, at 5:09 PM, Alex Kavvos [email protected] wrote:

Even though environments for other dependently typed systems (for example the Agda Emacs mode) make inputting Unicode very easy, they are essentially limited to either mimicking LaTeX commands, or support only few symbols; the rest has to be done by hand -- see e.g. [1]. What is your preferred approach in this case?

It may be old-fashioned, but not many things can go wrong when sticking with ASCII.

[1] http://wiki.portal.chalmers.se/agda/pmwiki.php?n=Docs.UnicodeInput http://wiki.portal.chalmers.se/agda/pmwiki.php?n=Docs.UnicodeInput

Reply to this email directly or view it on GitHub #46 (comment).

from unimath.

benediktahrens avatar benediktahrens commented on June 6, 2024

On 11/05/2014 07:22 PM, Vladimir Voevodsky wrote:

Actually the part that I did not understand is .. what does it stand for? Can I write

Sigma { x : A } ( y : B ) , P x y .

? If so then what will it mean? I am using Sigma instead of you unicode thing.

The ".." stands for recursive patterns. A basic example from the Coq
documentation is for lists (Sec. 12.1.12):

Notation "[ x ; .. ; y ]" := (cons x .. (cons y nil) ..).

Usage examples for Sigma:

Require Import UniMath.Foundations.Generalities.uu0.
Notation "'Sigma' x .. y , P" := (total2 (fun x => .. (total2 (fun y =>
P)) ..))
(at level 200, x binder, y binder, right associativity) : type_scope.

Variable A : UU.
Variable B : A -> UU.
Variable C : forall a : A, B a -> UU.

Definition total3 := Sigma a b, C a b.
Definition total3':= Sigma (a : A) (b : B a), C a b.

Remark: I don't think there is a difference between {} and () for Sigma,
but both work, as in

Definition total3':= Sigma {a : A} b, C a b.

from unimath.

benediktahrens avatar benediktahrens commented on June 6, 2024

On 11/05/2014 07:30 PM, Vladimir Voevodsky wrote:

Does this

| A |

work for ishinh?

The "|" ("pipe") is used also in pattern matching, but that does not
seem to prevent usage in notations - see various usages of the pipe in
notations of the standard library:

https://coq.inria.fr/distrib/current/stdlib/Coq.Init.Notations.html

from unimath.

vladimirias avatar vladimirias commented on June 6, 2024

The I would prefer | | to the unicode one. Also, I have a question. How does one find out the meaning of a notation?

V.

On Nov 5, 2014, at 10:28 PM, Benedikt Ahrens [email protected] wrote:

On 11/05/2014 07:30 PM, Vladimir Voevodsky wrote:

Does this

| A |

work for ishinh?

The "|" ("pipe") is used also in pattern matching, but that does not
seem to prevent usage in notations - see various usages of the pipe in
notations of the standard library:

https://coq.inria.fr/distrib/current/stdlib/Coq.Init.Notations.html

Reply to this email directly or view it on GitHub #46 (comment).

from unimath.

benediktahrens avatar benediktahrens commented on June 6, 2024

On 11/06/2014 05:00 PM, Vladimir Voevodsky wrote:

The I would prefer | | to the unicode one. Also, I have a question.
How does one find out the meaning of a notation?

The Coq vernacular "Locate" should help here, as in

Locate "|".

from unimath.

vladimirias avatar vladimirias commented on June 6, 2024

Maybe we could add a line to README with this hint since we are planning to have all these notations?
V.

On Nov 6, 2014, at 9:16 PM, Benedikt Ahrens [email protected] wrote:

On 11/06/2014 05:00 PM, Vladimir Voevodsky wrote:

The I would prefer | | to the unicode one. Also, I have a question.
How does one find out the meaning of a notation?

The Coq vernacular "Locate" should help here, as in

Locate "|".

Reply to this email directly or view it on GitHub #46 (comment).

from unimath.

benediktahrens avatar benediktahrens commented on June 6, 2024

On 11/06/2014 10:45 PM, Vladimir Voevodsky wrote:

Maybe we could add a line to README with this hint since we are
planning to have all these notations?

I am a bit reluctant to turn the README into a Coq manual; it should
instead convey, as briefly as possible, the contents of the UniMath
repository and how to obtain/compile the code.

Instead, I suggest making a wiki page on Github to store such
information. The README can link to the wiki.
This solution scales better in case we turn it into a real "cheat sheet"
for Coq.

from unimath.

vladimirias avatar vladimirias commented on June 6, 2024

Sounds good to me. Such a cheat sheet can be very helpful.

On Nov 6, 2014, at 10:14 PM, Benedikt Ahrens [email protected] wrote:

On 11/06/2014 10:45 PM, Vladimir Voevodsky wrote:

Maybe we could add a line to README with this hint since we are
planning to have all these notations?

I am a bit reluctant to turn the README into a Coq manual; it should
instead convey, as briefly as possible, the contents of the UniMath
repository and how to obtain/compile the code.

Instead, I suggest making a wiki page on Github to store such
information. The README can link to the wiki.
This solution scales better in case we turn it into a real "cheat sheet"
for Coq.

Reply to this email directly or view it on GitHub #46 (comment).

from unimath.

DanGrayson avatar DanGrayson commented on June 6, 2024

ProofGeneral provides that command on C-c C-a C-n

On Thu, Nov 6, 2014 at 9:45 PM, Vladimir Voevodsky <[email protected]

wrote:

Maybe we could add a line to README with this hint since we are planning
to have all these notations?
V.

On Nov 6, 2014, at 9:16 PM, Benedikt Ahrens [email protected]
wrote:

On 11/06/2014 05:00 PM, Vladimir Voevodsky wrote:

The I would prefer | | to the unicode one. Also, I have a question.
How does one find out the meaning of a notation?

The Coq vernacular "Locate" should help here, as in

Locate "|".

Reply to this email directly or view it on GitHub <
https://github.com/UniMath/UniMath/issues/46#issuecomment-62052597>.


Reply to this email directly or view it on GitHub
#46 (comment).

from unimath.

vladimirias avatar vladimirias commented on June 6, 2024

This kind of thing it would be good to have in the help file that Benedikt suggested.

V.

On Nov 7, 2014, at 10:40 AM, Daniel R. Grayson [email protected] wrote:

ProofGeneral provides that command on C-c C-a C-n

On Thu, Nov 6, 2014 at 9:45 PM, Vladimir Voevodsky <[email protected]

wrote:

Maybe we could add a line to README with this hint since we are planning
to have all these notations?
V.

On Nov 6, 2014, at 9:16 PM, Benedikt Ahrens [email protected]
wrote:

On 11/06/2014 05:00 PM, Vladimir Voevodsky wrote:

The I would prefer | | to the unicode one. Also, I have a question.
How does one find out the meaning of a notation?

The Coq vernacular "Locate" should help here, as in

Locate "|".

Reply to this email directly or view it on GitHub <
https://github.com/UniMath/UniMath/issues/46#issuecomment-62052597>.


Reply to this email directly or view it on GitHub
#46 (comment).


Reply to this email directly or view it on GitHub #46 (comment).

from unimath.

DanGrayson avatar DanGrayson commented on June 6, 2024

It would be even better to have it in the ProofGeneral User Manual, where
it seems
not to appear :

11.1 Coq-specific commands

Coq Proof General supplies the following key-bindings:

C-c C-a C-i
Inserts “Intros ”

C-c C-a C-a
Inserts “Apply ”

C-c C-a C-s
Inserts “Section ”

C-c C-a C-e
Inserts “End <section-name>.” (this should work well with nested

sections).

C-c C-a C-o
Prompts for a SearchIsos argument.

On Fri, Nov 7, 2014 at 11:37 AM, Vladimir Voevodsky <
[email protected]> wrote:

This kind of thing it would be good to have in the help file that Benedikt
suggested.

V.

On Nov 7, 2014, at 10:40 AM, Daniel R. Grayson [email protected]
wrote:

ProofGeneral provides that command on C-c C-a C-n

On Thu, Nov 6, 2014 at 9:45 PM, Vladimir Voevodsky <
[email protected]

wrote:

Maybe we could add a line to README with this hint since we are
planning
to have all these notations?
V.

On Nov 6, 2014, at 9:16 PM, Benedikt Ahrens <
[email protected]>
wrote:

On 11/06/2014 05:00 PM, Vladimir Voevodsky wrote:

The I would prefer | | to the unicode one. Also, I have a
question.
How does one find out the meaning of a notation?

The Coq vernacular "Locate" should help here, as in

Locate "|".

Reply to this email directly or view it on GitHub <
https://github.com/UniMath/UniMath/issues/46#issuecomment-62052597>.


Reply to this email directly or view it on GitHub
#46 (comment).


Reply to this email directly or view it on GitHub <
https://github.com/UniMath/UniMath/issues/46#issuecomment-62125721>.


Reply to this email directly or view it on GitHub
#46 (comment).

from unimath.

benediktahrens avatar benediktahrens commented on June 6, 2024

Closing this issue - Unicode will not be used for now.

from unimath.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.