Derivative Flipping
Dan Piponi shows how swapping operands in differential operator pairings bounds intermediate expression complexity, enabling efficient computation of operators like the Laplacian.
read it The post provides a clever pedagogical and technical bridge between regex matching derivatives and efficient higher-order automatic differentiation.
summary
The article draws an analogy between Brzozowski derivatives used in regular expression matching and polynomial differential operators. By defining an algebraic pairing and swapping the roles of the differentiator and target expression, the intermediate results remain bounded in complexity. This technique simplifies computing multidimensional operators like the Laplacian without tracking full Hessians, linking back to methods used in physics-informed neural networks.
key points
- Brzozowski derivatives for regexes share structural similarities with differential operators acting on polynomial rings.
- Flipping the operand order of the differential pairing bounds the complexity of intermediate terms during evaluation.
- This approach efficiently computes operators like the Laplacian by tracking a small fixed number of coefficients rather than full power series.
who should read it
Haskell programmers, numerical computing engineers, and mathematicians interested in automatic differentiation.
discussion positive
consensus
Commenters spend most of their time trying to unpack the mathematical definition of Brzozowski derivatives and how they relate to traditional calculus.
pushback
A minority participant questions the utility of abstract mathematical blog posts that do not directly tie into software engineering productivity or financial gain.
There are some other good answers pointing to concrete leads. There is the formal notion of a derivation (see https://en.wikipedia.org/wiki/Derivation_(differential_algeb... ) which generalizes the derivatives in differential calculus you are familiar with to other more exotic objects. For example, this allows defining derivatives on combinatorial species.
The Brzozowski derivative is not strictly one of these, due to its odd product rule expression for concatenation. https://math.stackexchange.com/questions/5024248/are-brzozow... has some good explanations if you have any algebra …
It introduces the formal mathematical concept of a derivation to help ground the exotic definition of derivatives used in the post.
Generated by an LLM from the article and thread. Check the sources before relying on it.