You're reading the public-facing archive of the Category Theory Zulip server.
To join the server you need an invite. Anybody can get an invite by contacting Matteo Capucci at name dot surname at gmail dot com.
For all things related to this archive refer to the same person.
Apparently you can "differentiate" a regex and get an efficient algorithm for matching them. This sounds like CT in disguise, http://matt.might.net/articles/implementation-of-regular-expression-matching-in-scheme-with-derivatives/ but I don't know how. Paging Dr. @Jules Hedges for a lensology consult.
if it;s the same thing as this https://en.wikipedia.org/wiki/Brzozowski_derivative
then it's the adjoint to day convolution
but i was just leaving so i cant explain in detail rn :|
day convolution in this case is concatenation of languages, though
so this is the closed monoidal structure on the powerset of strings
err sorry i was actually thinking of this https://en.wikipedia.org/wiki/Quotient_of_a_formal_language
but they are closely related
Not deeply categorical but getting closer is rutten’s usage in discrete coinductive differential stream calculus https://www.cwi.nl/~janr/papers/files-of-papers/tcs308.pdf
ok now i can say a bit more
in (0, 0)-categories—i.e., sets (well, more or less)—the equivalent to taking the category of presheaves is taking the powerset
the equivalent to the yoneda embedding is and the equivalent of the yoneda lemma is
now, a monoidal (0, 0)-category is just a monoid
if you take the monoid Σ* of strings on some alphabet Σ, then day convolution on its "(0, 1)-category of presheaves" (powerset ordered under inclusion) looks like
this is not symmetric monoidal—it's not a commutative monoid—so when i say it's closed i mean it has 2 different internal homs
one satisfying and the other satisfying
these are the "quotients of a formal language" in that wikipedia article
the brzozowski derivative is in particular the quotient of something by a singleton language—i.e., by the result of yoneda-embedding some string
so the derivative of L with respect to a string s is gonna be
incidentally, the | operator in regex is coproduct in this (0, 1)-category, and kleene star is taking the free monoid of something :-)
Following a link chain from Gershom's suggestion: https://ir.cwi.nl/pub/28550/ Rutten's recent textbook on coalgebra. has some category theory, automata, derivatives, what have you. Pretty interesting looking
Jeez, this thread is mind-blowing.
Is it just me or Brzozowski's derivative looks suspisciously like localization of a ring? Which, incidentally, is used by algebraic geometers to talk about derivatives
@sarahzrf I love your "low dimensional" category theory, it's incredible how seemingly advanced machinery was hiding in plain sight down in the / world
Pretty!
come see my talk for the ACT seminar on the 6th then :-)
unless i procrastinate too hard on making slides and have to bail :sob:
regarding kleene star being free monoid:
a monoid has morphisms and ; at level (0, 1), this is all you need, because there can be only one choice for those morphisms, and all diagrams commute automatically—being a monoid is a property of an element in a monoidal proset, not a structure to equip it with
the tensor unit in our monoidal proset is , empty-string language
so a language is a monoid if both
i.e., if it parses the empty string and it parses any concatenation of things in itself
then the sub-proset of P(Σ*) whose elements are the monoids is reflective—has a left adjoint to its inclusion, "taking the free monoid"
the property is that for all languages and languages that are monoids , we have
and of course L* is always a monoid for any L, so we can restrict it to a function of the right type; it is monotone; and it's not hard to check that it satisfies the property i just wrote
so it's takng the free monoid!
alternatively, observe that it literally is defined the same way as this construction of free monoids
image.png
@sarahzrf wow, the "low dimensional" explanation is really cool. Have you seen this paper?
Change Actions: Models of Generalised Differentiation (https://arxiv.org/abs/1902.05465)
It gives a framework in which the derivative of regular expressions fit.
i have not :eyes:
also: hey neat to see you again :)
you should come see my talk too
sarahzrf said:
also: hey neat to see you again :)
Indeed, same :D
Yep, ACT@UCR is on my google calendar :+1:
for the record: the reason i had such a ready-made rant about this topic is that i've literally gone and formalized bits of it in coq before
image.png
(language
there is defined by Definition language : Type := PSh str.
)
This is great. The terminology coincides with the derivative of combinatorial species, which is also exponentiating by a representable: . http://bergeron.math.uqam.ca/wp-content/uploads/2013/11/book.pdf
It's also useful for algebraic data types http://strictlypositive.org/calculus/;
and the derivative of operads describes variable binding, e.g. . https://homepages.inf.ed.ac.uk/gdp/publications/Abstract_Syn.pdf
@Conor McBride, do you have any thoughts as to how this notion of regex derivative is connected to the derivative of data types?
i am reminded that the tangent bundle of a space is given by exponentiating it by a particular infinitesimal object
that's a rather differential thing
and representables are tiny, altho "infinitesimal" is maybe not appropriate here going by the definition im seeing when opening the nlab page again (it seems to be for cartesian closure), and anyway im not sure whether theyre infinitesimal here in addition to tiny, wld have to think about it
re: derivative of operads, an operad is a monoid in species (where ⊗ is species composition), right?
so derivative of species ~ derivative of operads?
...oooooh that's the point you were making? >.<