-
Notifications
You must be signed in to change notification settings - Fork 257
Add Algebra.Action.*
and friends
#2350
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
base: master
Are you sure you want to change the base?
Conversation
Note to self: 'tipped' lists and the adjunction preserving |
What's a 'tipped' list? |
A datatype I first learnt of from Conor (possibly invented by him? In any case, early 2000s in Durham IIRC): it's analogous to Ralf Hinze pointed out to me last week that one may easily show an isomorphism between that and ... and there may (ought to!) be some relationship with the Minamide construction (POPL, 1998) in connection with tail recursion modulo constructors... in any case, such a tipped list corresponds to a symbolic/'non-materialised' |
Aha, a 2-sorted pointed unar! Nice. record 2PU (A B : Set) : Set where
field
push : (a : A) -> 2PU -> 2PU
point : (b : B) -> 2PU |
Looked at the code itself right now: I expect that in I'm happy for the construction (at the end of the file) to stay where they are, but not so for the definition of the concepts themselves. |
So... as to "belongs elsewhere"... : where do you propose exactly? |
One could go crazy and do |
Re: your data TipList (A B : Set) : Set where
[_] : A ->TipList A B
_::_ : B -> TipList A B -> TipList A B the |
Sorry, I have "free theories" on the brain. Your |
Thanks for the clarification! I think I had at least glimpsed that from my reference to direction... but I hadn't joined all the dots. And so, no need to apologise, the category theory is fine (and helpful ;-))! |
Yes, I agree with @JacquesCarette. I agree, splitting it into something like |
Lots of helpful feedback @MatthewDaggitt thanks! I'm undecided about As for |
Can you have actions on |
The classic example is "module" which is a |
You 'woke it up' but it is still Draft? |
Still DRAFT, yes, it was more a 'note to self' to mark explicit the link with #2558 and to think about more about how to streamline what is here, esp. Plus, still irritated about the (lack of) parametrisation on left/right... and want to make this 'better' if possible...? |
Is perfect the enemy of the good here? Feels like there is quite a lot of quality stuff in here that could go in to v2.3. |
Thanks @JacquesCarette , I just haven't had any spare focus to devote to this. For sure it could be v2.3-able, but given the short timescale, I'm happy to make this v2.4 or even v3.0, when I will have had more time to reconsider things? |
You tagged the 'wrong' Jacques... I was merely asking you to think whether what's here is already (essentially) good enough to go in. |
Thanks for the nudge. I'll try to look at this over the w/e |
Some minimal restructuring (plus profiting from now actually having the |
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.
Given that I need to make a release candidate tomorrow, and there are several questions and at least one suspected bug in this code I'm going to bump this to v2.4
------------------------------------------------------------------------ | ||
-- Basic definitions: fix notation | ||
|
||
record IsLeftAction : Set (a ⊔ r ⊔ c ⊔ ℓ) 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.
Hmm is there a reason why the hierarchy in Structures
is not the same as the hierarchy in Bundles
? e.g. Bundles
talks about setoids and monoids which don't feature here?
m n : M | ||
|
||
|
||
|
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.
Too many empty lines?
Congruentʳ _◁_ = _◁_ Preserves₂ _≈_ ⟶ _≈ᴹ_ ⟶ _≈_ | ||
|
||
IsActionˡ : Actˡ → Op₂ M → Set (c ⊔ a ⊔ r) | ||
IsActionˡ _▷_ _∙_ = ∀ m n x → ((m ∙ n) ▷ x) ≈ (m ▷ (n ▷ x)) |
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 don't like using the word Is
here as it suggests that it is a Structure
? Same for Identityˡ
. Also by convention for the definitions we use Left
and Right
rather than the superscripts? Maybe LeftAction
and LeftIdentity
?
open import Relation.Binary.Core using (Rel; _Preserves₂_⟶_⟶_) | ||
|
||
module Algebra.Action.Definitions | ||
{c a ℓ r} {M : Set c} {A : Set a} (_≈ᴹ_ : Rel M ℓ) (_≈_ : Rel A r) |
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.
This module parameterisation doesn't work as many of these definitions either use neither or only one of the equalities. This will leave them ill-parameterised when this module is opened unapplied.
_▷⁺_ : List⁺ M → A → A | ||
(m ∷ ms) ▷⁺ a = m ▷ ms ▷⋆ a | ||
|
||
▷⋆-cong : Pointwise _≈ᴹ_ ms ns → x ≈ y → (ms ▷⋆ x) ≈ (ns ▷⋆ y) |
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.
Most of these lemmas would go in Algebra.Action.Properties
modules by convention.
------------------------------------------------------------------------ | ||
-- Left- and Right- Actions of a Monoid over itself | ||
|
||
module Regular {c ℓ} (M : Monoid c ℓ) 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.
Why is this module called Regular
and why is it parameterised by a Monoid
? What other algebraic structures do we want to extend this by?
|
||
{-# OPTIONS --cubical-compatible --safe #-} | ||
|
||
module Algebra.Action.Construct.Self 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.
Should this be called Algebra.Action.Construct.Regular
?
|
||
open import Relation.Binary.Bundles using (Setoid) | ||
|
||
module Algebra.Action.Construct.FreeMonoid |
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.
Is this module going to contain other Free
actions? It already contains the free setoid action which suggests that it might be ill named?
Happy to bump while these things get sorted out! |
I'd love to get this one going into v2.4! |
Thank-you. As with a lot of recent comments from me, I take both encouragement from that, while noting that esp. @MatthewDaggitt 's review comments suggest that there is some way to go for a 'mature' design to emerge; despite my personal attachment to what's already here, I agree that it could be improved, but I need time/space/brains to think about it... ... which I'm not getting at the moment. Moving back to DRAFT, and bumping to (at least) v3.0. |
Fixes
the first part of#2348 .Currently in DRAFT for preliminary feedback.DONE:
CHANGELOG
IsX
with those of the correspondingRawX
#2252 ... but this seems debatable here? RESOLVED in favour of introducingSetoidAction
as a distinct thing, and then indexing wrt such a thing;_⋆_
structure definable inRaw*Action
and corresponding lifts in*Action
andFree
; RESOLVED the refactoring seems to have made this less evident than before, plus refactoring⋆-act-cong
to make the 'congruence' property more general...Pointwise
lifting of theSetoid
equality onList
gives rise to aMonoid
structure for[]
and_++_
... but this doesn't seem to be already defined/proved anywhere? DONE, but should be refactored downstreamRaw*Action
might better be described as aSetoid
homomorphism betweenM.setoid × A
andA
, only I can't seem to find a definition of the former (underRelation.Binary.Construct.Product
?) as a product ofSetoid
s? UPDATED: this lives under a mixture ofFunction
andData.Product.Function.NonDependent.Setoid
??? Discoverability epic fail again... sigh.RESOLVED: PR represents a(n uneasy) mixture of the two approachesREFACTORED again to postpone this perhaps in favour of a...Biased
implementation downstream?Issues (WON'T DOs):
*Action
and the correspondingMonoid
homomorphism (cf. Bundles forAlgebra.*Homomorphism
, and their algebra:Hom
-'sets' forAlgebra
#1960 ) betweenM
andEndo A
; BLOCKED on Port two Endomorphism submodules over to new Function hierarchy #2342MonoidAction
s...and where should that thing live?