Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
[Add] Consequences of associativity for
Semigroup
s #2688New 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
base: master
Are you sure you want to change the base?
[Add] Consequences of associativity for
Semigroup
s #2688Changes from 8 commits
0fc076f
3399c61
90fe273
ef3282f
63e88cc
bb7ce15
885d7a0
ad54a5b
2b511c2
8151123
2361b40
503c693
0d5c9ed
1a67eb9
002cfad
a47bcc5
ca9f576
e07f81b
86b06e0
7b72ff2
13b5f0e
f58aceb
74607d5
e3b2550
e63afbd
b2bfa03
14224b9
76b6637
06af327
a22f97d
1283b57
e1304da
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm also not sure whether we should refer to these as
reasoning combinators
. TheReasoning
terminology has quite a specific use in the library for syntax that chains together nicely. I'm not sure these lemmas qualify?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We won't need
CHANGELOG
text if it moves toAdditions to...
, but the opening comment block should be rephrased...There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation is by 2 spaces, not 4 as you have here... see
style-guide
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Elsewhere, the library would use lemma names of the form
p∧q⇒r
, with square brackets for grouping sub-terms, so here:NB. also: you have declared
x
as avariable
, so there's no need to have the quantifier! Although here again, we have the problem that in any deployment in a concreteSemigroup
the typechecker might not be able to inferw
... so there are questions about how the quantifications should be handled.If you can find examples in eg
Data.Rational.Properties
which might be simplified by these lemmas, then you might discover whether Agda can (or not) infer the various implicits?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, the use of
⇒
in the lemma names would avoid the need for the submodules here to be named; they could (more) simply be anonymousmodule _ (hyps) where
...There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While
x∙y≈z⇒[w∙x]∙y≈w∙z
is a logical name, it is also quite long. As these combinators that re-associate are book-keeping things, I'd like to find something shorter / less noisy.I do hate push/pull. I'm partial to
on-right
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, with my suggested notational optimisations, this would/could become...
xy≈z⇒wx∙y≈wz
, which is about as short as I can make it?!There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As for
on-right
I'm really not sure what that is supposed to signify, given that the lemma is notcong
like, nor is the action obviously happening on the right? (Never mind our ongoing debates about left/right distinctions giving rise to confusion...)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
on-right
as inapply this equality on the right
, after a re-focus. It's very muchcong
-like to me, it just has a re-association done first, to put "the right" in focus.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd tried to reply, but my comment (seems to have) got lost: if you're wedded to an ASCII/prefix-Lisp name for these things, then I'd much prefer
refocus-on-right
, or evenrefocus-right
(the-on
isn't then doing much work), or evenrefocusʳ
... in the style of other lemmas in the library.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to make some proposal on naming as a full comments instead of inline.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successive appeals to
sym
suggest that it should be lifted out (permutation ofsym
through proofs), but in fact doing so quickly reveals the following: