An excursion into Dialectica and Differentiation
Davide Barbarossa
TL;DR
This paper analyzes the link between Gödel's Dialectica and differentiation from a program- and geometry-inspired viewpoint. By embedding forward differentiation in Cartesian differential categories and leveraging lenses, it recasts Dialectica as a differentiable program transformation whose reverse-differential behavior arises from lens composition; it further shows that Dialectica factors through Euclidean lenses, providing a coherent categorical bridge between the two concepts. The work clarifies why Dialectica aligns with reverse differentiation at a structural level via $M^\bullet$ and $M_x$ and discusses limits and potential extensions to dependent types and richer reverse-differential frameworks. Overall, it offers a geometric, lens-based interpretation of the Dialectica transformation as a compositional mechanism for reverse-mode differentiation with implications for higher-order program transformation and automatic differentiation.
Abstract
Gödel's Dialectica has been introduced and developed in the tradition of the so-called functional interpretations. Only recently has it been related with the a priori unrelated notion of differentiation, by taking a program-theoretic approach. We revisit the deep connection between these two notions in order to understand its structural reasons, as well as to express it in an arguably more natural way by following a geometric intuition. More specifically, we give a logical relation between a Dialectica transformed term and its reverse differential in a differential category and, then, we phrase the Dialectica program transformation in the language of lenses, often used indeed in Automatic Differentiation in order to model reverse differentiation. We illustrate how this clarifies why Dialectica behaves as a differentiable program transformation, and what the limits of this correspondence are.
