[Paper Review] Evolving the Incremental Lambda Calculus into a Model of Forward Automatic Differentiation (AD)
This paper evolves the Incremental Lambda Calculus (ILC) into a formal model of forward automatic differentiation (AD) by transforming finite changes into power series and bundling primal and tangent values. The approach enables machine-checked proofs of correctness and efficiency, culminating in a dual-number-based forward AD system with uncurried, bundled outputs that satisfy the chain rule.
Formal transformations somehow resembling the usual derivative are surprisingly common in computer science, with two notable examples being derivatives of regular expressions and derivatives of types. A newcomer to this list is the incremental λ-calculus, or ILC, a "theory of changes" that deploys a formal apparatus allowing the automatic generation of efficient update functions which perform incremental computation. The ILC is not only defined, but given a formal machine-understandable definition---accompanied by mechanically verifiable proofs of various properties, including in particular correctness of various sorts. Here, we show how the ILC can be mutated into propagating tangents, thus serving as a model of Forward Accumulation Mode Automatic Differentiation. This mutation is done in several steps. These steps can also be applied to the proofs, resulting in machine-checked proofs of the correctness of this model of forward AD.
Motivation & Objective
- To formalize forward automatic differentiation (AD) using the Incremental Lambda Calculus (ILC) as a foundation.
- To address the mismatch between ILC’s finite changes and AD’s need for infinitesimal tangents by introducing power series representations.
- To unify primal and tangent values through uncurrying and bundling, enabling correct chain rule propagation.
- To provide a machine-verifiable framework for proving correctness and efficiency of forward AD.
- To distinguish numeric basis functions from lifted operations, improving confluence and modularity compared to prior typed λ-calculus approaches.
Proposed method
- Represents changes to real numbers as power series in ε with zero constant term, using a recursive type ⟨zpsε⟩.
- Defines a coefficient extraction operator coeffi to retrieve the i-th coefficient of a power series, enabling directional derivatives.
- Extends coeff to algebraic datatypes and functions via structural recursion and α-renaming to avoid variable capture.
- Transforms the ILC derivative operator D into ˆD by uncurrying inputs and bundling primal and change set values into a product type Ft ≡ t × ∆t.
- Modifies ILC reduction rules to support the new bundled, uncurried derivative semantics.
- Truncates power series at ε² to yield dual numbers, recovering the standard forward AD formalism.
Experimental results
Research questions
- RQ1How can the Incremental Lambda Calculus be systematically evolved into a model of forward automatic differentiation?
- RQ2What modifications are required to transform finite changes into infinitesimal tangents suitable for AD?
- RQ3How can primal and tangent values be consistently bundled and propagated through function composition?
- RQ4Can the resulting system preserve the chain rule and support machine-checked proofs of correctness?
- RQ5How does this approach improve upon prior typed λ-calculus models of forward AD in terms of modularity and confluence?
Key findings
- The power series representation of changes allows for systematic derivation of directional derivatives via coefficient extraction, with coeff1 recovering the standard derivative.
- The transformation from ILC to forward AD is achieved through two well-defined steps: power series extension and uncurrying with bundling, which commute.
- The resulting ˆD operator satisfies the simplified chain rule ˆD(f ◦g) ⇝ ˆDf ◦ ˆDg, matching the behavior of standard forward AD.
- Machine-checked proofs of correctness and efficiency are enabled by the formal, type-safe structure of the framework.
- The separation of numeric basis functions from lifted operations improves confluence and avoids type-level ambiguities present in prior systems.
- The approach supports Church-encoded data and higher-order functions with correct tangent propagation through α-renaming and structural coeffi extension.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.