-
Notifications
You must be signed in to change notification settings - Fork 136
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
abstractify QuotientAlgebra #857
abstractify QuotientAlgebra #857
Conversation
Just a note: I can't see how to "abstractify" |
Is it clear that making everything abstract like this is the right way to go? My experience is that constructions should not be opaque, but their properties can often be... Also, the "locking" trick that we use in some files for Z-cohomology could be helpful. It's an alternative to making things abstract |
I think to avoid the unfolding of algebra terms, it has to be the construction ( |
Yeah, maybe a locked version of |
I experimented a bit with the locking trick. In principle it seems very very nice to provide an interface where the user of the module can decide themselves whether they want to see reducing or non-reducing behavior (by plugging in either For example, the definition of quotientHom : CommAlgebraHom A (_/_)
fst quotientHom x = [ x ]
IsAlgebraHom.pres0 (snd quotientHom) = refl
... With the locking method it would be either something like this (taken from here): quotientHomWithKey : (key : lockUnit) → CommAlgebraHom A (_/WithKey_ key)
fst (quotientHomWithKey unlock) x = [ x ]
IsAlgebraHom.pres0 (snd (quotientHomWithKey unlock)) = refl
...
quotientHom : CommAlgebraHom A _/_
quotientHom = quotientHomWithKey key Or something like this (taken from here): quotientHomUnlocked : CommAlgebraHom A (_/Unlocked_)
fst quotientHomUnlocked x = [ x ]
IsAlgebraHom.pres0 (snd quotientHomUnlocked) = refl
...
quotientHom : CommAlgebraHom A (_/_)
quotientHom = lock' key
(λ k → CommAlgebraHom A (lock k _/Unlocked_))
quotientHomUnlocked In particular, I don't see how to avoid writing out all the type signatures two (or even three) times, in slightly modified ways. This feels bad to me as they can become relatively long, e.g.: injectivePrecomp : (B : CommAlgebra R ℓ) (f g : CommAlgebraHom (A / I) B)
→ f ∘a (quotientHom A I) ≡ g ∘a (quotientHom A I)
→ f ≡ g |
I'm certainly ok with using 'abstract' for now. Should I review this PR? |
Was this question directed at me? :-) |
Yes. With a possibility for anders to intervene. |
Oh, ok. Yes, I would be pleased if you could review this PR. |
I can confirm a very nice type checking speed reduction in FPAlgebra! On my notebook, it used to take 80s and now it is down to 20s - which is mostly spend on deserialization, so I guess there is no immediate need to look for further speed improbements to FPAlgebra. |
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.
Only a couple of minor comments/requests for clarifications. Otherwise this is good to merge.
I think we can work with abstract interfaces like this one and see how it goes.
This is ready to be merged from my perspective. |
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 from mine - looks great!
This PR declares almost all definitions in
Cubical.Algebra.CommAlgebra.QuotientAlgebra
asabstract
in an attempt to reduce long type checking times.FPAlgebra
(the only module that usesQuotientAlgebra
so far) had to be slightly adjusted too. A witnessinducedHom∘quotientHom
had to be added toQuotientAlgebra
for an equality that was a definitional equality before.This replaces #856.