Utilities for cospans, wiring diagrams, frobenius algebras, en operads and spans along with more basic utilities for morphisms in (symmetric) monoidal categories, flavors of FinSet and utilities for nicely presented monoids
Fong-Spivak Hypergraph Categories
The notion of cospan here is for finite sets sliced over some Lambda. So the domain and codomain are sets equipped with a map to Lambda. The middle finite set is also such a set and there are left and right maps coming from the domain/codomain respectively. The lambda labels on all must line up for those maps. The type called Cospan here is for the morphisms in this category. Use Lambda = () to avoid the extra baggage of Cospan_\Lambda vs the usual Cospan category.
In order to make adding, removing and changing the domain/codomain easier, there is a NamedCospan which names all of the elements in the boundary sets. Then one can delete and change the maps based on these names.
This operad is built on top of Cospans.
Wiring Diagram as drawn in Spivak 13
Again over Lambda which can be taken to be () for a first pass.
Encode morphisms built from the 4 distinguished morphisms of a Frobenius object, the braiding and allow black boxes for any other morphism. These black boxes are labelled with some BlackBoxLabel and one must provide a function that takes that label and the domain/codomain to some type T which represents the morphisms in a symmetric monoidal category where each object labelled by Lambda has been given the structure of a Frobenius object. The more general objects are presented as tensor products of these basic objects.
TODO
Also using the same Operad trait that WiringDiagram uses, there are E1 and E2 operads. The operad substitution performs the requisite substitution of interval/disk configurations. Conversely in both we are also allowed to coalesce parts of the configuration back into a single larger interval/disk.
There are traits which when implemented indicate that is a morphism in some category. That category can also be monoidal and symmetric monoidal. For example, if one implements the trait to say T indicates a morphism in a monoidal category, then we have functions which give the identity morphisms on specified objects, compose T's to another (there are two versions of this for whether this is done by mutating one of the inputs or producing a fresh T). Because the category is not symmetric monoidal in this case, there isn't the trait that provides the functions for producing and manipulating morphisms from Permutations.
Similar to Frobenius we can interpret a generic monoidal morphism in any such trait. The generic monoidal morphism encodes how to build up a morphism from some BlackBox, monoidal product and composition. Suppose T implements all the traits needed to be a morphism in a monoidal category. Then if one also gives a function that takes that BlackBox label and the domain/codomain then the interpret function produces the corresponding T using the functions of the monoidal and composition traits.
Abstracting from the last paragraph, we have a system where we give names to several morphisms. These morphisms can either directly be T or they can be general monoidal/general Frobenius as above where they have black boxes that need to be filled in by other morphisms. We can then interpret this system by plugging in all the black boxes with other morphisms in the collection as their name indicates. How the black boxed portions are organized is required to be acyclic, so that if desired we may substitute them all as much as possible (though we usually leave them not so inlined).
This is also for morphisms that are black boxed and put into other morphisms. For details, see the following paper.
One such utility is an iterator for finitely generated groups. The next iterate is produced from the previous with a similar word in such a way that we try to keep the number of group operations used minimal. The iterator is not guaranteed to produce distinct elements, since it works in general without access to the relations in specifics.
There are utilities for sub-monoids which are generated by a particular subset from the ambient M.
There are also utilities for systems related to the free product of two monoids quotiented by only particularly nice relations of the form b_1 a_1 = a_2 b_2 a_3 b_3.