Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expanding on the naming conventions #793

Draft
wants to merge 36 commits into
base: master
Choose a base branch
from

Conversation

EgbertRijke
Copy link
Collaborator

No description provided.

NAMING.md Outdated Show resolved Hide resolved
Copy link
Collaborator

@fredrik-bakke fredrik-bakke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like to review this PR carefully before it is merged, but that will have to wait at the moment.

NAMING.md Outdated Show resolved Hide resolved
NAMING.md Outdated Show resolved Hide resolved
NAMING.md Outdated Show resolved Hide resolved
NAMING.md Outdated Show resolved Hide resolved
Copy link
Collaborator

@VojtechStep VojtechStep left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for putting it all together. I do feel like there are some inconsistencies in the description of some of the examples, could you elaborate a bit on the comments?

NAMING-CONVENTIONS.md Outdated Show resolved Hide resolved
NAMING-CONVENTIONS.md Outdated Show resolved Hide resolved
NAMING-CONVENTIONS.md Outdated Show resolved Hide resolved
this happens is in `hom-iso-Group`, which is the construction that returns the
underlying group homomorphism of an isomorphism of group. The fact that a group
isomorphism is an isomorphsim is called `is-iso-iso-Group`, which also uses the
pattern `[type]-[Namespace]`. One could also consider calling it
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this [type]-[hypotheses]-[Namespace]? is-iso being the type and iso being the hypothesis. If not, what's the difference between this and the example is-ideal-ideal-Ring below?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Things that go under [type] are the output types of the specification of an entry. In the case of is-iso-hom-Ring the output type of its specification is UU. We don't put this in the name. Instead is-iso is a descriptor of the specification, falling under [name] in the general pattern.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think I follow. What I'm reading is that

  • is-iso-iso-Group : (f : iso) -> is-iso f follows [type]-[Namespace], but
  • is-ideal-ideal-Ring : (I : ideal) -> is-ideal I follows [type]-[hypotheses]-[Namespace]

Is that correct?

NAMING-CONVENTIONS.md Outdated Show resolved Hide resolved
there is an interchange law for addition over addition, which states that
`(a + b) + (c + d) = (a + c) + (b + d)`. This law is called
`interchange-law-add-add-ℤ`. Again, this naming follows the pattern
`[type]-[Namespace]`, because it states the type of which an element is
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again I'd say this is [type]-[name]-[Namespace]

Copy link
Collaborator Author

@EgbertRijke EgbertRijke Sep 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The type of the output of this entry is interchange-law add-ℤ add-ℤ, so the name here merely describes the type, and the namespace for the integers. In the case is-equiv-succ-ℤ : is-equiv succ-ℤ this would also fall under [type]-[Namespace].

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The explanation on left-unit-law-mul-ℤ makes this clear now 👌

- We prioritize the readability of the code and avoid subtly different
variations of the same symbol. An important exception is the use of the
[full width equals sign](https://codepoints.net/U+ff1d) for the identity type,
as the standard equals sign is a reserved symbol in Agda.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd also mention the homotopy composition and whiskering situation

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other examples are the asterisk vs asterisk operator, and big vee vs small vee. Maybe rephrase to "try to avoid subtly different"

NAMING-CONVENTIONS.md Outdated Show resolved Hide resolved
NAMING-CONVENTIONS.md Outdated Show resolved Hide resolved
NAMING-CONVENTIONS.md Outdated Show resolved Hide resolved
construction of the underlying set of a group returns for each group a set,
which is an element of type `Set`. Similarly, we have `type-Group]`,
`semigroup-Group`, `type-Ring`, `set-Ring`, and so on. Another instance where
this happens is in `hom-iso-Group`, which is the construction that returns the
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hom-iso-Group has the approximate type iso -> hom, shouldn't it then be [type]-[hypotheses]-[Namespace]?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That looks right

NAMING-CONVENTIONS.md Outdated Show resolved Hide resolved
NAMING-CONVENTIONS.md Outdated Show resolved Hide resolved
EgbertRijke and others added 2 commits September 22, 2023 16:29
Co-authored-by: Vojtěch Štěpančík <vojtechstepancik@outlook.com>
Co-authored-by: Vojtěch Štěpančík <vojtechstepancik@outlook.com>
EgbertRijke and others added 3 commits September 22, 2023 16:47
Co-authored-by: Fredrik Bakke <fredrbak@gmail.com>
Co-authored-by: Fredrik Bakke <fredrbak@gmail.com>
EgbertRijke and others added 2 commits September 22, 2023 17:01
Co-authored-by: Fredrik Bakke <fredrbak@gmail.com>
name adds no extra useful information. This situation is common in instances
where we omit the `[descriptor]` part of a name. For instance
`is-category-Category` and `is-ideal-ideal-Ring` follow the patterns
`[output-type]-[Namespace]` and `[output-type]-[input-types]-[Namespace]`,
Copy link
Collaborator

@VojtechStep VojtechStep Sep 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On second reading I'm not sure why

  • is-category-Category : (C : Category) -> is-category C and
  • is-ideal-ideal-Ring : (I : ideal-Ring) -> is-ideal I

are different? Even the modules where they are defined seem to follow the exact same structure.

Comment on lines +219 to +220
and not `commutative-×`, and the unit of a modality is called `unit-modality`
and not `unit-○`.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although the second example here is also an instance of using a variable in a name, perhaps it still conveys the correct sentiment.

Comment on lines 75 to 76
- **[descriptor]:** This part is used to give a custom descriptive name for the
entry.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- **[descriptor]:** This part is used to give a custom descriptive name for the
entry.
- **[descriptor]:** This part is used to give a custom descriptive name for the
entry, or refer to the custom descriptive name of another entry.

If I didn't misunderstand, this is how it is used in the below example is-iso-prop-hom-Ring.

`[output-type]-[Namespace]`. The construction of the underlying set of a group
returns for each group a set, which is an element of type `Set`. Similarly, we
have `type-Group`, `semigroup-Group`, `type-Ring`, `set-Ring`, and so on.
Another instance where this happens is in `hom-iso-Group`, which is the
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't hom-iso-Group an instance of [output-type]-[input-types]-[Namespace]?

Another instance where this happens is in `hom-iso-Group`, which is the
construction that returns the underlying group homomorphism of an isomorphism of
group. The fact that a group isomorphism is an isomorphsim is called
`is-iso-iso-Group`, which also uses the pattern `[output-type]-[Namespace]`. One
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this also an instance of [output-type]-[input-types]-[Namespace]?

`is-iso-iso-Group`, which also uses the pattern `[output-type]-[Namespace]`. One
could also consider calling it `is-iso-hom-iso-Group`, to emphasize that the
underlying group homomorphism of the isomorphism is an isomorphism. However,
this name does not fit our patterns in any way, and the addition of `hom` to the
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not clear to me how this does not fit our patterns better than the proposed one. Also, the name would be more consistent with is-iso-hom-inv-iso-Group

NAMING-CONVENTIONS.md Show resolved Hide resolved
NAMING-CONVENTIONS.md Show resolved Hide resolved
NAMING-CONVENTIONS.md Outdated Show resolved Hide resolved
| `equiv` | Used for equivalences, and also for names of identity systems of universe-like types |
| `extensionality` | Used for computations of identity types |
| `htpy` | Used for constructions of homotopies, and also for names of identity systems of function-like types |
| `is-property` | Used when `is-prop` is unavailable |
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't remember if I already mentioned this, but did you know we actually define is-property in foundation-core.subtypes? Although IIRC it is not referred to anywhere.

To give a sense of the kind of general descriptors we use, we list some common
descriptors in the table below.

| Descriptor | Purpose |
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add statement

To give a sense of the kind of general descriptors we use, we list some common
descriptors in the table below.

| Descriptor | Purpose |
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be very good to have an example column for this table as well. That's what I did for the sHoTT project

To give a sense of the kind of general descriptors we use, we list some common
descriptors in the table below.

| Descriptor | Purpose |
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another descriptor pair we use a lot is is/has :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you think of them as descriptors? That seems grammatically very weird.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are modifiers signifying that the type is a property/structure, and then we omit them for the associated total types. It just seems consistent with the scheme.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm willing to come up with our own naming convention, but I'm not willing to come up with a new theory that the verbs to be and to have are modifiers. That idea seems out of this world to me.

Comment on lines +195 to +196
| `coh` | Used for proofs of coherence |
| `coherence` | Used to assert coherence |
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like the need for coh is obsoleted by introducing statement.

@EgbertRijke EgbertRijke marked this pull request as draft November 24, 2023 05:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants