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

Enforcing the new algebra naming conventions for Algebraic Structures #824

Merged
merged 45 commits into from
Jun 9, 2022

Conversation

thomas-lamiaux
Copy link
Contributor

@thomas-lamiaux thomas-lamiaux commented May 27, 2022

I have started to enforce the algebra naming convention for algebraic structure.
I will just modify the Base.agda and fix the dependencies.
However, I will not enforce notation like Invol in the properties files that might be done in a next PR.

@thomas-lamiaux thomas-lamiaux changed the title Enforrcing the new algebra naming convention for Algebraic Structures Enforcing the new algebra naming convention for Algebraic Structures May 27, 2022
@thomas-lamiaux thomas-lamiaux changed the title Enforcing the new algebra naming convention for Algebraic Structures Enforcing the new algebra naming conventions for Algebraic Structures May 27, 2022
@thomas-lamiaux
Copy link
Contributor Author

@felixwellen or @mortberg is there a reason for https://github.com/agda/cubical/blob/master/Cubical/Algebra/Monoid/Base.agda#L36 ?
Because IdL and IdR are beneath, and in practice one always use that and not identity.
So I don't see the point of having such constructors ?
Shouldn't we replace it by two constructors IdL and IdR ?

@kangrongji
Copy link
Contributor

kangrongji commented May 27, 2022

I guess the reason is, identity is an h-proposition. One-side unit is not unique under non-commutative multiplication.

@mortberg
Copy link
Collaborator

@felixwellen or @mortberg is there a reason for https://github.com/agda/cubical/blob/master/Cubical/Algebra/Monoid/Base.agda#L36 ? Because IdL and IdR are beneath, and in practice one always use that and not identity. So I don't see the point of having such constructors ? Shouldn't we replace it by two constructors IdL and IdR ?

I don't think there's any deep reason for this and it could as well be split into two fields

@thomas-lamiaux
Copy link
Contributor Author

One-side unit is not unique under non-commutative multiplication.

I don't really understand what you mean ?
Because the way, one proved that it is a proposition is by using
isPropΣ : isProp A → ((x : A) → isProp (B x)) → isProp (Σ A B)
and so by having as in hypothesis that it is a Set then by funExt it follows.

This would be case whether it separated or not.
Actually the current proof is done by proving them separately using
(λ semi → isPropΠ λ _ → isProp× (semi .is-set _ _) (semi .is-set _ _)))

@thomas-lamiaux
Copy link
Contributor Author

@mortberg Then should I replace it by two fields ? (and the similar ones)
Because It seems to me as adding a useless construction in the basic files.

@kangrongji
Copy link
Contributor

kangrongji commented May 27, 2022

One-side unit is not unique under non-commutative multiplication.

I don't really understand what you mean ? Because the way, one proved that it is a proposition is by using isPropΣ : isProp A → ((x : A) → isProp (B x)) → isProp (Σ A B) and so by having as in hypothesis that it is a Set then by funExt it follows.

This would be case whether it separated or not. Actually the current proof is done by proving them separately using (λ semi → isPropΠ λ _ → isProp× (semi .is-set _ _) (semi .is-set _ _)))

Oh... You're right, the ε is given as parameter.

I thought the ordinary definition of "having a unit" is Σ[ ε ∈ A ] (x · ε ≡ x) × (ε · x ≡ x), and it is h-proposition, so that one don't need ε as a constructor. But since here ε is given explicitly, it's irrelevant.

@mortberg
Copy link
Collaborator

@mortberg Then should I replace it by two fields ? (and the similar ones) Because It seems to me as adding a useless construction in the basic files.

Sure, sounds good

@thomas-lamiaux
Copy link
Contributor Author

@mortberg
Copy link
Collaborator

Should the following be deleted ? https://github.com/agda/cubical/blob/master/Cubical/Algebra/Group/Base.agda#L32

Maybe not deleted, but maybe moved to abelian groups? Additive groups are usually abelian...

@thomas-lamiaux
Copy link
Contributor Author

Yes this what I meant, this shouldn't be in Group but AbGroup

@thomas-lamiaux
Copy link
Contributor Author

thomas-lamiaux commented May 29, 2022

should be merge after the others PR

@thomas-lamiaux
Copy link
Contributor Author

I have introduced nice notation for AbGroup

  open IsGroup isGroup public
    renaming
      ( ·Assoc      to +Assoc
      ; ·IdL        to +IdL
      ; ·IdR        to +IdR
      ; ·InvL       to +InvL
      ; ·InvR       to +InvR)

but then, it would also be nice to be able to do something like

pres1       to pres0
presinv    to pres-
pres·        to pres+

but I don't really know how to that as right now the definition is just calling back the definition of group

@thomas-lamiaux thomas-lamiaux marked this pull request as draft May 31, 2022 00:10
@mortberg
Copy link
Collaborator

I have introduced nice notation for AbGroup

  open IsGroup isGroup public
    renaming
      ( ·Assoc      to +Assoc
      ; ·IdL        to +IdL
      ; ·IdR        to +IdR
      ; ·InvL       to +InvL
      ; ·InvR       to +InvR)

but then, it would also be nice to be able to do something like

pres1       to pres0
presinv    to pres-
pres·        to pres+

but I don't really know how to that as right now the definition is just calling back the definition of group

Won't we have the same problem for pretty much all the theory about groups? If lemmas are named using the multiplicative notation then they will look ugly for the additive notation. I don't know if it matters or what we can do.

@felixwellen
Copy link
Collaborator

I think it does matter, since it adds to the confusion, if things don't look like they would look in math.
But I also don't know a good solution. Redefining things as records that could also just be definitionally equal (like AbGroupHom and GroupHom, CommRingHom and RingHom, ...) is also annoying.

@mortberg mortberg marked this pull request as ready for review June 1, 2022 15:18
@thomas-lamiaux thomas-lamiaux mentioned this pull request Jun 2, 2022
17 tasks
@thomas-lamiaux
Copy link
Contributor Author

@felixwellen I am currently fixing the dependencies.
In you PR, why did you put stuff like AbGroup->Group or makeAbGroup in a module ?
Is that to prevent it to unfold ?

If there is really some specific trick that is known hat prevent unfolding or thing like this, that really made working easier, maybe it should be mention in contributing ?
Like recommended practice to enhanced the code and computation, so people can be aware ?

@thomas-lamiaux
Copy link
Contributor Author

@mortberg Would it be possible to merge this before others conflict are added ?
There is currently no PR that conflict it except mine but I rather fix the direct sum PR directly than fixing this one again

@mortberg
Copy link
Collaborator

mortberg commented Jun 8, 2022

@mortberg Would it be possible to merge this before others conflict are added ? There is currently no PR that conflict it except mine but I rather fix the direct sum PR directly than fixing this one again

Ignore my other message

Copy link
Collaborator

@mortberg mortberg left a comment

Choose a reason for hiding this comment

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

Looks great! Massive improvement to the Algebra package!

I found a few small things that should be fixed before we can merge

Cubical/Algebra/CommAlgebra/Base.agda Outdated Show resolved Hide resolved
Cubical/Algebra/Group/Base.agda Show resolved Hide resolved
Cubical/Algebra/Group/Instances/Bool.agda Show resolved Hide resolved
Cubical/Algebra/Group/Properties.agda Show resolved Hide resolved
Cubical/Algebra/Ring/Base.agda Outdated Show resolved Hide resolved
Cubical/Algebra/Ring/Base.agda Outdated Show resolved Hide resolved
Cubical/Algebra/Ring/BigOps.agda Show resolved Hide resolved
Cubical/Data/Int/Divisibility.agda Outdated Show resolved Hide resolved
@mortberg
Copy link
Collaborator

mortberg commented Jun 8, 2022

Puh, no conflicts after I merged my PR about induced structures!

@felixwellen @ecavallo @mzeuner Are there any other PRs that should be merged before this one or can we go ahead and merge it once @thomas-lamiaux has fixed my comments? I hope we can merge this one very soon to avoid having any more conflicts in it...

@thomas-lamiaux
Copy link
Contributor Author

Ha probably a bug because my branch is not up to date

@thomas-lamiaux
Copy link
Contributor Author

thomas-lamiaux commented Jun 8, 2022

The bug that broke the last check is a bit unexpected. I think that I removed some useless import.
But then someone used them to add something in an other branch and then when merging it removed them even though they were now needed.
Should be good now

@thomas-lamiaux
Copy link
Contributor Author

@mortberg good to go

@mortberg mortberg merged commit fd19499 into agda:master Jun 9, 2022
@mortberg
Copy link
Collaborator

mortberg commented Jun 9, 2022

No objections, so merged!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants