[ discussion ] alternative design for Algebra.Structures.IsX and Algebra.Properties.X
#2762
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.
This is an alternative design for the
StructuresandPropertieshierarchies underAlgebra, as an experiment following on from my(currently!) failedattempts to find a suitable solution to #2704 ...The main idea can be seen as:
Algebra.Structures(which now re-exports from each of its sub-modules, now embodying the previous singlerecordentries for eachIsXstructure, but with a slightly different grouping of 'cognate' such things;breaking) ofAlgebra.Properties.IsX, which can now be interleaved with those underStructures, so that successively richer structures can inherit not just properties of their vanilla substructures, but their properties as well; cf. Add new operations (cf.RawQuasigroup) toIsGroup#2251 for adding new derived operations as well...Algebra.Consequences, as the relevant structural elements would then be available sur place for proving equational properties;Propertiesmodules are now further able to define otherIsZsubstructural fields (eg.Properties.IsSemigroupcan now package theFlexibleandAlternativeproperties into fully fledgedIsFlexibleMagmaandIsAlternatveMagmasubstructures for subsequent re-export if so desired (previously, trying to do so would have led to a dependency cycle, I think; or at least, have not been considered as 'standard' admissible extensions toIsSemigroup...)isY : IsYsubstructures defined in eachAlgebra.Structures.IsX, but eg.IsGroupshows what was not previously possible (except viaAlgebra.Group.Properties), namely to haveisQuasigroupandisLoopfields defined, and hence the possibility ofIsGroupalso inheriting/re-exporting theirProperties;Algebra.BundlesandAlgebra.Properties.Xfor re-packaging and export of the correspondingIsXdata.It's WIP/
DRAFT, because I stopped once I had got toIsGroup, and with it the decision about how 'wide' to make that API...Discussion welcome!
IsXto be as wide as possible, but currently that's only inIsGroup; a spectrum of possible choices are availableNB Outstanding issues:
Algebra.Structuresmeans that_≈_needs to be supplied explicitly a bit too often on re-export (I hope that can easily be fixed, but later...): in particular, the build fails at the moment for this reason;RawXbundle, is neither here nor there, but this design would certainly fit well with [DRY] Reconciling the indices ofIsXwith those of the correspondingRawX#2252 , which would moreover have the advantage that the fixities could be declared in theRawXbundle, and hence inherited onopening in theIsXstructure, which would make the subsequent statement of additional properties less painful wrt precedence/parsing than at present...Structures, we could simply make each individualIsXmodule put together both definition and properties (but that maybe goes against accepted wisdom)Related: instead of parametrising
Reasoningmodules onSetoid, in favour ofIsEquivalence, we could remove the anomaloussetoidfield inherited fromIsMagmaonwards precisely to facilitate manifest field definition of new equational properties cf. bootstrapping #2692 from #2688 etc.