How statement and proof provenance work
The first chip identifies the source of the statement or construction; the second identifies the source of its local proof or verification.
- Literature-sourced: the exact statement appears in a cited source; only wording and notation differ.
- AI-adapted: a semantically identical restatement of literature-sourced material, modulo indexing, notation, and boundary cases adopted by the library.
- AI-generated: a genuinely novel statement formulated by AI, with no source for the claim itself.
These labels describe origin, not correctness: citations and verification chips remain separate evidence.
Automatic differentiation and computational graphs
1 · Prerequisites
- Algebraic Closure, Embeddings, and Separability
- Algebraic Extensions, Extension Degree, and Finite Fields
- Banach-Space Differential Calculus and Banach Manifolds
- Binary Operations, Monoids, Groups and Subgroups
- Bounded Linear Operators and Quotient Spaces
- Compactness in Metric Spaces
- Completeness, Completion, and Uniform Continuity
- Complex Norms and Realification
- Complexification, Realification and Real Structures
- Composition Series, the Jordan–Hölder Theorem and Solvable Groups
- Congruences, the Integers Modulo n and the Chinese Remainder Theorem
- Construction of the Natural Numbers
- Construction of the Real Numbers via Cauchy Sequences
- Construction of the Real Numbers via Dedekind Cuts
- Continuity, IVT, EVT, and Uniform Continuity
- Cosets, Index and Lagrange's Theorem
- Countability and Uncountability
- Cyclic Groups and Direct Products
- Determinants of Matrices over a Commutative Ring
- Diagonalisation and the Minimal Polynomial
- Divisibility, Euclidean Domains, Principal Ideal Domains and Unique Factorisation
- Divisibility, Greatest Common Divisors and Bézout's Identity
- Dual Spaces, Bilinear and Quadratic Forms, and Sylvester's Law of Inertia
- Eigenvalues, Eigenvectors and the Characteristic Polynomial
- Filters and Ultrafilters
- Finite Counting, Factorials and Binomial Coefficients
- Finite-precision direct factorizations and least squares
- Foundations of the Real Numbers for Analysis
- Group Actions, Orbits, Stabilisers and Cayley's Theorem
- Group Homomorphisms and the Isomorphism Theorems
- Hilbert Space Geometry and Riesz Representation
- Ideals, Quotient Rings and the Isomorphism Theorems for Rings
- Inner Product Spaces, Gram-Schmidt, Projections and Adjoints
- Limits of Real Functions
- limsup, liminf, and Subsequential Limits
- Linear Independence, Bases and Dimension
- Linear Transformations, Rank-Nullity and Quotient Spaces
- Matrices, the Matrix of a Linear Map, and Change of Basis
- Matrix Norms, Condition Numbers and Numerical Stability
- Metric Spaces
- Monotone Functions, Discontinuities, and Continuity Sets
- Monotone Sequences, Bolzano-Weierstrass, and Cauchy Completeness
- Normal Subgroups and Quotient Groups
- Normed and Banach Spaces
- Order, Zorn's Lemma, and the Axiom of Choice
- Polynomial Rings, the Division Algorithm and Roots
- Primes, Euclid's Lemma and the Fundamental Theorem of Arithmetic
- Properties of the Integral and the Working FTC
- Relations, Functions, and Quotients
- Rings, Subrings, Integral Domains and Fields
- Rⁿ as a Normed Space; Vector-Valued Functions
- Roots, Rational Powers, and Classical Inequalities
- Sequences and Limits
- Series: Convergence and the Nonnegative Tests
- Simple Field Extensions and the Construction of the Complex Numbers
- Splitting Fields
- Subspaces, Products, and Quotients
- Suprema and Infima
- Sylow's Theorems, p-Groups and Nilpotent Groups
- Symmetric Groups, Cycle Decomposition and the Sign Homomorphism
- The Derivative and the Mean Value Theorems
- The Determinant of a Linear Operator, Cofactors and Cramer's Rule
- The Fundamental Theorem of Algebra
- The Fundamental Theorem of Finite Abelian Groups
- The Galois Correspondence
- The Inverse and Implicit Function Theorems
- The Riemann Integral: Definition and Integrability
- The Spectral Theorem, Positive Operators and Singular Value Decomposition
- The Total Derivative in ℝᵐ → ℝⁿ
- The ZFC Axioms and the Basic Set Constructions
- Topological Spaces and Continuity
- Topology of ℝ
- Triangularisation, Generalised Eigenspaces and Jordan Canonical Form
- Vector Spaces, Linear Subspaces, Span and Direct Sums
2 · Summary
A computational graph here is a finite, topologically ordered real-arithmetic program with differentiable primitive maps and a scalar output. The primal tape records exact graph values and parent slots. Forward mode propagates a tangent in one pass; reverse mode accumulates cotangents from the scalar output. Their correctness follows from the chain rule along the graph, including repeated parent slots. The stated work bound assumes a fixed bounded-arity primitive set whose local pullbacks cost a bounded multiple of their primal work; opaque solver calls need their own rules and costs.
For primitives, forward-over-reverse differentiates the reverse recurrence to produce a Hessian-vector product without forming a Hessian matrix. Branchwise derivatives apply only on a strict active branch; a branch boundary returns NONDIFFERENTIABLE. Checkpointing includes a uniform finite-memory fallback and a separate binomial schedule with explicit replay, storage, and work bounds. Both rely on deterministic replay of the same state and primitive inputs.
Implicit differentiation gives the derivative of a local solution branch only when the residual state Jacobian is nonsingular. A stopped iteration instead differentiates its finite composition; the page bounds that sensitivity under a contraction and gives a residual bound for the implicit sensitivity formula evaluated at an approximate state. The graph-gradient perturbation theorem propagates specified local Jacobian errors. The certified mathematical solve-Jacobian lemma supplies explicit inverse-defect, primal-residual, and rounded-pullback allowances using the finite-precision residual interface; factor-output derivatives retain their own primitive rules.
3 · Logical flowchart
4 · Definitions, theorems and proofs
Finite straight-line computational programs and real-arithmetic tapes
Definition
Fix an input dimension , finitely many operation nodes , and a designated output node , either an input coordinate or an operation, whose value space is . Give input coordinate a label distinct from all operation indices, and set and with its standard Euclidean inner product. Operation node has an ordered list of parent slots ; each slot is either an input label or an operation index . Repeated parent slots are allowed and count separately. The graph is a finite straight-line program because every operation reads only earlier values and there are no data-dependent loops.
For each operation , choose a dimension , set with its standard Euclidean inner product, take an open set with the product inner product, and choose a primitive map . A smooth primitive is : it is totally differentiable and its derivative matrix is continuous. For Hessian-vector products require the primitive to be , meaning with a continuously differentiable derivative map. Derivatives are represented in these coordinates, and every transpose is the Euclidean transpose for the stated inner products; the gradient of a scalar output is the Euclidean gradient. The real-arithmetic primal recursion is whenever the parent tuple lies in . Its admissible input domain is the set of for which every operation in this recursion is defined. The graph's scalar output function is the value at : it is when is input coordinate , and when is operation node .
The primal tape is the finite ordered record of input and node values, parent-slot indices, primitive identities, and (when applicable) selected branch labels. A deterministic replay starts from the identical checkpoint state and applies the identical primitive maps in the identical order, so it reproduces the same real-arithmetic values and local derivative inputs. Opaque solver calls are not primitive operations unless their complete deterministic map and derivative rule are explicitly supplied.
A piecewise- primitive is specified by finitely many open branch regions and a formula on each region; its primal boundary value, if any, is specified separately. If the current parent tuple lies strictly inside exactly one declared branch, the program uses that branch and its derivative. At a branch boundary or ambiguous branch selection, forward or reverse AD returns NONDIFFERENTIABLE; it does not silently choose a subgradient or generalized derivative. If no primal value is specified at a boundary, that input is outside the program's domain. All correctness theorems below apply on a fixed strict branch. The same convention applies to piecewise- primitives for Hessian-vector products.
An implicit sensitivity evaluated at an approximate state has a local residual bound
Statement
Let be near an exact solution , with invertible and . The implicit sensitivity at a state is . Suppose the local inverse of , supplied near by the implicit function theorem, is defined on a convex residual neighborhood containing and , with along their segment. Suppose also that the segment from to lies in a convex neighborhood where , , and are Lipschitz with constants . Then This bounds the implicit sensitivity formula evaluated at an approximate state. It is not by itself a bound for the derivative of a stopped iteration.
Facts & Assumptions
Given: The exact root, local inverse chart, residual, inverse-norm and Lipschitz bounds in the statement.
The Euclidean implicit function theorem with derivative formula: if the state Jacobian of a residual is invertible at a zero, there is a local solution branch and its derivative formula; applying the theorem to gives the local inverse .
On a convex open set, a uniform bound implies : on a convex open set, a uniform derivative bound implies .
The chain rule for total derivatives: : the derivative of a composition is the composition of the derivatives at the corresponding points.
The residual segment lies inside the inverse chart and the state segment lies inside the neighborhood where all stated bounds hold.
Proof
For , put . By [F1] and [F3], is differentiable and . For , apply [F2] to on the convex open interval at and to obtain . Letting and using continuity of at and gives .
Put , , , and . The identities and follow by expansion and multiplication.
The inverse bounds, bound, and Lipschitz bounds give and . The triangle and product inequalities then yield .
Substitute step 1.1 into step 2.1 to obtain the asserted residual bound. If , local uniqueness gives and the same inequality reads .
Implicit differentiation and adjoint formulas under a nonsingular residual Jacobian
Statement
Let be , where and are open. Suppose and the state Jacobian is invertible. The Euclidean implicit function theorem gives a local solution branch , and For a scalar objective , its derivative along that branch is Equivalently, if solves , this derivative is . These formulas concern the exact local solution branch; differentiating a stopped iteration is a separate finite-map derivative.
Facts & Assumptions
Given: The residual equation, a residual, a square nonsingular state Jacobian, and a scalar objective.
The Euclidean implicit function theorem with derivative formula: when both block dimensions are positive, a Euclidean residual with zero value and invertible state-block derivative has a unique local solution branch and .
The chain rule for total derivatives: : for maps , .
Proof
If , the state space is a singleton, its unique linear map is its own two-sided inverse, and the sole branch has zero derivative, as does the displayed formula. If and , the parameter space is a singleton. Write . Differentiability gives ; since , this has no other zero for sufficiently small nonzero . Thus the singleton branch is locally unique and has zero derivative, again the displayed formula. If , apply [F1] to obtain the local branch and .
The map is . By [F2], its derivative at is . Substituting step 1.1 yields .
Since is invertible, is invertible. The adjoint equation has the unique solution satisfying , by transposing . Therefore , giving the stated adjoint formula.
Forward-mode automatic differentiation on a finite computational graph
Definition
Input a graph from Finite straight-line computational programs and real-arithmetic tapes, an admissible point , and a direction . Require every primitive to be on its declared open domain or supplied as a piecewise- primitive with the branch rules of the graph definition. Evaluate all primal node values in topological order and store the tape. Set each input tangent to , using the distinct input labels of the graph. For each operation , compute Return the primal scalar output and its tangent: return if is an operation node, and if is input coordinate . If the input is outside the admissible domain, return DOMAIN_ERROR; if a piecewise primitive is at a branch boundary or has no unique strict active branch, return NONDIFFERENTIABLE and no tangent. All derivative evaluations in this definition are exact real-arithmetic operations on the specified primitive maps.
Reverse-mode automatic differentiation for a scalar graph output
Definition
Input a graph from Finite straight-line computational programs and real-arithmetic tapes and an admissible point . Require every primitive to be on its declared open domain or supplied as a piecewise- primitive with the branch rules of the graph definition. Evaluate and store all primal values in topological order. Initialize every operation cotangent and every input cotangent to zero. Seed the scalar output by setting its cotangent to : if is an operation, set ; if is input coordinate , set . For , and for every parent slot , compute the contribution and add it to the cotangent accumulator of that parent: use if the parent is input coordinate , and if it is operation node . If the same parent node occurs in multiple slots, add every slot contribution. Return the scalar output and the input cotangents as the Euclidean gradient. A point outside the admissible domain returns DOMAIN_ERROR; a branch boundary or ambiguous active branch returns NONDIFFERENTIABLE and no gradient. The procedure differentiates the real-arithmetic graph; it makes no floating-point error claim.
A finite straight-line C1 program defines a C1 map on each fixed strict branch
Statement
For a finite straight-line program whose primitives are , the recursively defined admissible input domain is open on each fixed strict branch. The scalar output is there, and its total derivative is obtained by the ordinary chain rule through the primitive maps.
Facts & Assumptions
Given: The finite topologically ordered graph and its primitive maps.
Finite straight-line computational programs and real-arithmetic tapes: each node reads only earlier parent slots, each primitive is on an open domain, and the admissible input set requires every parent tuple to lie in that domain.
Continuously differentiable maps, local inverses, and local diffeomorphisms: a map is when it is totally differentiable at every point and its derivative matrix varies continuously.
Total differentiability gives a local increment bound and therefore continuity: total differentiability at a point implies continuity there.
The chain rule for total derivatives: : if is totally differentiable at and is totally differentiable at , then is totally differentiable at , with derivative .
Proof
Begin with the open input domain , whose coordinate maps are continuous and . Suppose the values through node are defined and continuous on an open set . The parent tuple is continuous there. Thus is open in , hence open in , because is open. This proves by finite induction that the full admissible domain is open.
For each operation , assume its parent-node maps are on . Their tuple is componentwise. Since , [F4] gives . Both matrix factors vary continuously because and the parent maps are ; hence is continuous and is by [F2]. Thus every operation value is ; the scalar output is whether it is one of these operation values or an input coordinate projection.
On a strict piecewise branch, the branch label is fixed on the open branch region and its primitive formula is ; steps 1.1–2.1 therefore apply unchanged on that region. At a boundary the definition in [F1] returns NONDIFFERENTIABLE, so no derivative assertion is made there.
A finite straight-line C2 program defines a C2 map on each fixed branch
Statement
If every primitive of a finite straight-line program is on the selected open branch domains, then the real-arithmetic scalar output is on each fixed strict branch.
Facts & Assumptions
Given: The finite graph has primitive maps on its selected open branch domains.
Finite straight-line computational programs and real-arithmetic tapes: nodes are finite and topologically ordered; each primitive is a finite-dimensional map, and means that its derivative map is .
Chain sum product and composition rules for Banach derivatives: compositions of differentiable maps obey the chain rule, and products under bounded bilinear maps obey the product rule. In particular this applies to multiplication of finite-dimensional linear maps.
A finite straight-line C1 program defines a C1 map on each fixed strict branch: the admissible input domain is open on each fixed strict branch.
Proof
Each input coordinate map is linear and has constant derivative, so it is . Suppose all parent-node maps of operation are . The tuple of parent values is , since it is a finite product of their coordinate maps; its domain is open by [F3].
Write . By [F2], . The map is by the hypothesis, and is , so is by the chain rule. The derivative map is because is . Matrix multiplication is a bounded bilinear map in finite dimensions, so the product rule in [F2] makes . Thus is by the definition in [F1].
Induction through the finite operation list gives for every operation value. The scalar output is therefore whether it is one of these values or an input coordinate projection. On a strict branch the selected primitive maps stay fixed on an open neighborhood; no claim is made at branch switches.
Uniform-block and binomial checkpoint schedules for reverse sweeps
Definition
The input is a finite sequence of deterministic transitions , , between compatible finite-dimensional Euclidean spaces with open domains, a starting state , and a terminal cotangent . Every transition is evaluated on one fixed strict branch and has its exact local reverse rule. For , require the last transition's output space to be ; when that scalar output is the objective, take . For , the terminal value is and its matching cotangent is supplied. A transition tape stores the local values needed by its exact reverse rule. A deterministic replay applies the same transition maps, in the same order, to the identical checkpoint state and therefore reproduces the same values and local derivative inputs. The procedure returns the terminal value and cotangent at ; an invalid domain evaluation returns DOMAIN_ERROR, and a branch boundary returns NONDIFFERENTIABLE. A checkpoint schedule is permitted only when its saved states and all deterministic replays lie in these declared domains.
Uniform-block mode. For , return and the supplied cotangent without work. For , require an integer slot budget , set , and during one forward pass save for (all indices are below ). This uses at most saved states. Partition the steps into blocks with and . Process the blocks from last to first. Within one block, for , restore , replay without recording, evaluate once while recording its local tape, apply its reverse rule to the current cotangent, and discard the one-step tape and replay workspace. Retain only the checkpoint states, the live state/cotangent, and the ordinary one-step reverse tape. Do not infer any optimality property of this schedule.
Binomial mode. Define , and for integers . The top-level call takes nonnegative integer budgets satisfying . For , return . For , allocate one scalar output register . The recursive procedure REVERSE consumes its starting state as the live primal state and its terminal cotangent as the mutable cotangent buffer; it returns only the cotangent at , retaining no terminal primal state. It requires integer indices , nonnegative integer budgets , and . If , return the unchanged cotangent. If , evaluate and record the unique transition, copy its scalar output to if , apply its local reverse rule, discard the tape and primal state, and return the input cotangent. If , then . Put , . Save in one checkpoint slot and replay the first transitions into the live state without recording. Call REVERSE on the right block, keeping the saved but no other primal state in the caller. Move the saved back into the live state, release its checkpoint slot, and tail-call REVERSE, using the cotangent returned by the right child. Return this left child's cotangent. No call frame retains a primal vector outside the explicit checkpoint slots. Invoke this procedure at and return with its returned initial cotangent. A recursive call with and or is a schedule failure; the capacity condition makes that branch unreachable.
The parameter bounds the number of simultaneously saved state snapshots. The parameter bounds, for each transition, the number of additional unrecorded forward evaluations beyond its one recorded evaluation. Both are finite integer inputs. This mode provides no numerical error estimate or optimality guarantee for arbitrary nonuniform primitive costs. For the storage count in the paired theorem, bounds scalar storage for one full primal state. The binomial recursion may reuse one mutable cotangent workspace: each call consumes its terminal cotangent and returns the cotangent at its start, reusing the same buffer through both children. Let bound the largest one-step tape and local reverse scratch, the constant number of live cotangent/work vectors, the scalar output register, and the scalar call-frame records; it excludes the saved primal states and one live primal state.
Differentiate a finite fixed-point iteration as a finite composed map
Definition
Input a finite-dimensional map , a initial-state map , a parameter in an open subset of , and an integer budget ; the states lie in , with . Use the specified maps and , with their exact derivative evaluations, as primitive maps on their declared open domains. Evaluate and then for . A primitive-domain failure returns DOMAIN_ERROR; a branch boundary or ambiguous active branch returns NONDIFFERENTIABLE and no derivative. The admissible case requires every evaluation to remain in its declared domain and, for piecewise primitives, on a unique strict active branch.
Allocate an Jacobian array . For each state coordinate , form the finite scalar-output graph for by appending the coordinate projection to the finite recursion. For each parameter coordinate , call Forward-mode automatic differentiation on a finite computational graph on this graph at with direction , the th standard basis vector of , and put its returned tangent in . Propagate any DOMAIN_ERROR or NONDIFFERENTIABLE status from a call. Return with status ITERATES_DIFFERENTIATED. For the recursion contains only the initial-state map. If or , the corresponding loops are empty and has the specified empty shape; the primal recursion is still evaluated. This procedure differentiates the -step map actually specified by ; it does not substitute the derivative of an exact fixed point.
Forward-over-reverse Hessian-vector products
Definition
Input a graph, a point , and direction . Run Forward-mode automatic differentiation on a finite computational graph and retain its primal tape and all input and operation tangents. If that call returns DOMAIN_ERROR or NONDIFFERENTIABLE, return the same status and stop without a Hessian-vector product. Otherwise initialize every operation and input cotangent and tangent-cotangent accumulator to zero. Seed the output by setting its cotangent/tangent-cotangent pair to : if is an operation, set ; if is input coordinate , set . In reverse topological order, for each node and parent slot , let , compute and add and to the parent's cotangent and tangent-cotangent accumulators. Use for input coordinate and for operation node . If the same parent occurs in multiple slots, add every slot contribution. Return . Repeated parent slots receive separate additions. The admissible case requires every primitive evaluation to be in its declared domain and, for a piecewise primitive, on a unique strict active branch; a branch boundary or ambiguous selection returns NONDIFFERENTIABLE through the initial call. The transpose is the real Euclidean transpose, not a complex adjoint.
Forward mode computes the exact directional derivative of the real-arithmetic graph
Statement
Let be the output of a finite program on a fixed strict branch. For every admissible and direction , the forward-mode algorithm returns .
Facts & Assumptions
Given: The graph, admissible input, fixed strict branch, and direction .
Finite straight-line computational programs and real-arithmetic tapes: each operation node is a primitive applied to its earlier parent values; the scalar output is either an input coordinate or an operation value.
A finite straight-line C1 program defines a C1 map on each fixed strict branch: every node is on the fixed branch, with derivative given by the chain rule through its parents.
Forward-mode automatic differentiation on a finite computational graph: input tangents are , and each node tangent is the local derivative applied to its parent tangents.
The chain rule for total derivatives: : under the stated finite-dimensional differentiability hypotheses.
Proof
For each input coordinate map , its directional derivative in direction is , exactly the initialized tangent in [F3].
Suppose the tangent at every parent of node equals the derivative of that parent value in direction . The node map is the composition of its primitive with the tuple of parent maps. By [F2] and [F4], its directional derivative is applied to that parent-direction tuple, which is exactly the tangent assigned by [F3]. Finite induction proves this identity for every node.
If is an operation node, step 2.1 gives . If is input coordinate , then and step 1.1 gives the returned tangent . Thus in either case the algorithm returns the asserted directional derivative.
Reverse mode computes the exact gradient of the real-arithmetic graph
Statement
For a finite program with one scalar output , on a fixed strict branch and at every admissible , the reverse-mode algorithm returns , the gradient of . More precisely, at any operation node , if its value is temporarily treated as an independent variable and all later operations are recomputed from it, then the accumulated cotangent at is the derivative of the scalar output with respect to that independent node value.
Facts & Assumptions
Given: The graph, its admissible input , and a fixed strict branch.
Finite straight-line computational programs and real-arithmetic tapes: the output is obtained from finitely many primitive nodes in topological order, and repeated parent slots are distinct edges.
A finite straight-line C1 program defines a C1 map on each fixed strict branch: every node map is on the fixed branch.
Reverse-mode automatic differentiation for a scalar graph output: reverse mode initializes operation and input cotangents to zero, seeds the scalar output node with cotangent , and adds to each parent slot in reverse topological order.
The chain rule for total derivatives: : the derivative of a composition is the ordered composition of its total derivatives.
Proof
For each input or operation node , define a directed path from to the output by choosing one parent slot at each successive operation; when , include the length-zero path. Associate to an edge from parent slot of node the linear map at the stored primal arguments. Repeated slots give separate edges.
Fix a node and form the downstream map by replacing its value with an independent while holding earlier node values fixed and then evaluating later operations in topological order. Repeated use of [F4] shows that the derivative contribution along a fixed path from to is the ordered product of its edge maps. At each operation, its derivative is linear in the concatenated parent direction, so contributions from distinct parent slots add. If , the output is and the length-zero path contributes the identity; if there is no path from to , is locally constant and the sum is zero. Thus is the sum of the path products over all paths from to , and its cotangent is the transpose of that sum applied to .
The output-node path sum is the identity scalar , matching the unit seed in [F3], whether the output is an input or an operation. For every other node, each path to begins with exactly one outgoing parent-slot edge , followed by a path from to . Hence its path-sum recurrence is , with an additional identity seed only when ; this is exactly the initialization and accumulation in [F3]. Reverse induction gives at operation nodes and, at inputs, .
The algorithm returns precisely those input cotangents, proving the statement.
Reverse-mode work is a fixed multiple of primal work under explicit primitive-cost bounds
Statement
For a finite graph on a fixed strict branch, fix a finite set of scalar/vector primitive types with at most parent slots per operation and bounded dimensions. Suppose each operation has primal work , its local vector-Jacobian product costs at most operations, and accumulating each parent-slot contribution costs at most operations. Assume each invocation's retained local tape and peak pullback scratch use at most a fixed number of scalar entries. Let be the scalar storage in the primal tape and input-gradient buffer, counting all input and node-value coordinates, per-node and per-parent metadata, branch labels, and retained local-tape entries. Then the exact reverse-mode algorithm for a scalar output uses at most operations for the primal evaluation, reverse sweep, and parent accumulations, and stores scalar entries. Opaque solver calls are excluded unless their primal and derivative costs satisfy the same hypotheses.
Facts & Assumptions
Given: A finite graph and the stated primitive-cost model, with .
Finite straight-line computational programs and real-arithmetic tapes: there are finitely many topologically ordered nodes and the primal tape stores their values and parent slots.
Reverse-mode automatic differentiation for a scalar graph output: reverse mode evaluates each primitive once in the primal pass, then visits each node once and applies one local vector-Jacobian product per node while accumulating a contribution for each parent slot.
The primitive set has fixed finite type and bounded dimensions. Local primal, pullback, and parent-accumulation costs obey the constants in the statement; an opaque solver call has no uncharged derivative cost.
The operation count is arithmetic work; allocating or zero-initializing the cotangent buffers is counted in storage rather than arithmetic operations.
Each primitive invocation's retained local tape and peak pullback scratch use a uniformly bounded number of scalar entries; parent-slot temporary vectors have bounded dimensions because the primitive types and arities are fixed.
Proof
The primal pass evaluates each node once, so its cost is . The reverse pass makes one local pullback call at node , costing at most , and handles at most parent slots, costing at most arithmetic operations. Since , this node's reverse arithmetic work is at most . Summing over all nodes gives total arithmetic work at most ; cotangent-buffer initialization is storage under [A2].
The primal tape, per-node local tapes, metadata, and input-gradient entries are counted in . Reverse cotangents require one vector of the corresponding dimension per node; all these dimensions are among the node/input-value coordinates counted in . At each node, [A3] bounds local scratch and parent-slot temporaries by a constant, so their peak storage is . Hence total storage is ; the bound says nothing about an opaque solver whose local tape or pullback cost was excluded in [A1].
Remarks
Baur–Strassen proves a separate nonscalar arithmetic-circuit complexity theorem over an infinite field. The local bound above is proved directly for a fixed smooth primitive set with explicit primal/pullback cost ratios; it does not extend the arithmetic-circuit theorem to arbitrary opaque procedures or claim that every differentiable primitive has a cheap derivative.
Uniform-block and binomial checkpoint schedules preserve reverse adjoints with stated costs
Statement
For the finite-dimensional transition sequences on a fixed strict branch defined in Uniform-block and binomial checkpoint schedules for reverse sweeps, provided every schedule replay remains in the declared domains, both schedules return the same terminal value and initial-state cotangent as an uncheckpointed reverse sweep. In uniform-block mode, if , , and the block lengths are , excluding the initial forward pass used to save checkpoints, the number of additional unrecorded forward evaluations is exactly , at most . At most checkpoint states are saved, with one live replay state and one local step tape. In binomial mode, ; any steps can be reversed with at most saved snapshots, one recorded forward evaluation and one reverse evaluation per step, at most additional unrecorded forward evaluations per step, total work at most , and storage . Here is the total cost of one unrecorded full forward pass, the sum of recorded one-step forward costs, the sum of local reverse costs, bounds scalar storage for one primal state, and bounds the largest one-step tape and local reverse scratch, the constant number of live cotangent/work vectors, the scalar output register, and scalar recursion-frame records, excluding saved states and one live primal state.
Facts & Assumptions
Given: The deterministic transitions, exact local reverse rules, and either schedule mode with its stated finite integer parameters.
Uniform-block and binomial checkpoint schedules for reverse sweeps: uniform mode restores a saved block start and replays to each step; binomial mode splits a block into a left and right interval and reverses the right interval before the left.
Reverse mode computes the exact gradient of the real-arithmetic graph: applying each exact local reverse rule once in reverse transition order gives the derivative of the composed real-arithmetic map.
Finite straight-line computational programs and real-arithmetic tapes: replay is deterministic and a graph node's local reverse rule uses the primitive inputs on its tape.
Proof
If , both schedules return the supplied pair unchanged. For in uniform mode, deterministic replay from any block start reproduces the original : the first replayed transition starts from the identical , and induction applies each same map to the same preceding state. Thus the recorded local tape at step has the same primitive inputs as the original forward trajectory, so its reverse rule is the same one used by the full tape. Processing blocks and then their steps in decreasing order is exactly reverse transition order; [F2] gives the same terminal and initial cotangents.
A block of length has replay prefix lengths before its recorded local evaluations. Therefore its additional unrecorded evaluations total . The number of blocks is , each , so the sum is at most . The checkpoint indices are ; , so . The initial forward pass uses unrecorded evaluations; the displayed additional count concerns the subsequent block replays. Only those states, one live state, and one local tape are retained.
In binomial mode the recurrence and boundary values give : the binomial coefficients have the same boundary values and Pascal recurrence, so induction on identifies them. For , write , , so . If , satisfies ; if , then , and otherwise and . Thus both recursive capacities hold and both child lengths are strictly less than ; the recursion terminates at or .
Induct on . For , the recursive procedure returns the unchanged cotangent. For , deterministic evaluation records the exact transition inputs and its reverse rule returns the exact input cotangent. For , midpoint replay produces the exact by [F3]. By induction the right child returns the exact cotangent at that midpoint, and the left child returns the exact cotangent at . Every split partitions its steps into disjoint left and right intervals, processed in reverse order, so every step is recorded and reversed once. In particular the unique recorded evaluation of writes its exact scalar output into ; no other leaf changes . Thus the top-level return has the same terminal value and initial cotangent as the ordinary reverse sweep.
At a split, the saved starting state occupies one slot while the right child uses at most further slots and one live primal state. Once that child returns only its cotangent, the saved start is restored into the live state and its slot released; the left tail call has all slots available. The leaves use no snapshots, so induction bounds the peak snapshot count by . No recursive terminal vectors are retained; only the scalar output register survives the leaf for . A step in a right child has at most replays by induction. A step in the left child is replayed once at the current split and then at most times in that child, hence at most times total. Each step also has one recorded forward and one reverse call, giving work at most . Each child decreases by one, so even without eliminating tail frames there are at most active frames, each holding only a fixed number of scalar indices and flags. The cotangent buffer is reused, and the one-step tape, local scratch, scalar output and frame records are included in . The saved states and one live primal state use at most entries, giving storage at most .
Finite fixed-point iteration sensitivity error bounds and the limits of residual control
Statement
Let , let be open with , and let be on an open neighborhood of . Suppose is an open convex neighborhood of and . Assume , on , and are Lipschitz in with constants . Let be , with the iterates at lying in . Write for the local exact fixed-point branch (supplied by the implicit function theorem when ), , , , and . For every integer , with when . If and , then . The derivative error is not bounded by the residual alone: for , , and , every finite has residual zero at but when .
Facts & Assumptions
Given: The iteration map, invariant convex state neighborhood, contraction and derivative-Lipschitz bounds, fixed point, differentiable initial map, and finite iteration count.
Differentiate a finite fixed-point iteration as a finite composed map: , and the procedure applies forward mode to the finite composition.
The Euclidean implicit function theorem with derivative formula: for , an invertible at a fixed point gives a local solution branch and its derivative formula.
Forward mode computes the exact directional derivative of the real-arithmetic graph: exact forward mode returns the derivative of the finite graph in every input direction.
The chain rule for total derivatives: : derivatives of finite compositions satisfy the chain rule.
The stated invariant-neighborhood, uniform derivative, Lipschitz, and initial-map hypotheses hold on the neighborhoods used below.
On a convex open set, a uniform bound implies : on a convex open set, a uniform derivative bound implies .
Every linear map between finite-dimensional real or complex inner product spaces admits a singular value decomposition: a finite-dimensional linear map has orthonormal singular-vector bases; a square map with no zero singular value is invertible.
Proof
Put . For , the unique endomorphism of is invertible. For , the derivative bound gives for every . By [F6], if had a zero singular value then it would annihilate a nonzero basis vector; hence all its singular values are positive, and the SVD bases show is invertible. Thus is invertible in every state dimension.
Since , we have . Applying [F5] to on the convex open set gives ; induction on the primal recurrence yields . If , apply [F2] to ; the exact branch derivative satisfies , where . If and , then ; contraction on makes the unique fixed point there, so the constant branch has and the same identity. If , the state space and all state-valued derivatives are zero-dimensional, and that identity is again immediate. Thus the fixed-point branch and identity used below hold in all allowed dimensions.
Because is open, is continuous, and the finite trajectory at lies in , induction gives a neighborhood of on which each of the first evaluations stays in ; hence every below exists. By [F4], the derivative of is , where and ; [F3] computes that exact finite-graph derivative. Subtract to obtain .
Set . Taking norms and applying the hypotheses gives by step 2.1. For this gives . If , then Induction proves the sum bound for every . Each summand equals , including the stated convention at , so the sum is .
The residual identity and the triangle inequality imply . For the stated scalar example, , and ; differentiating the recurrence gives , , hence , whereas . Thus a finite-iteration derivative is a different target even at zero primal residual, with its discrepancy still bounded by step 4.1.
Forward-over-reverse mode computes the Hessian-vector product
Statement
Let be the scalar output of a finite graph on a fixed strict branch. At every admissible and direction , the forward-over-reverse algorithm returns , the Hessian-vector product . No Hessian symmetry assumption is needed for this identity.
Facts & Assumptions
Given: The graph, input , and direction .
Finite straight-line computational programs and real-arithmetic tapes: the program uses finite real primitive maps on a fixed strict branch.
A finite straight-line C2 program defines a C2 map on each fixed branch: the scalar output is , so its gradient map is differentiable.
Forward mode computes the exact directional derivative of the real-arithmetic graph: the forward tangent at each node equals the directional derivative of that node value.
Reverse mode computes the exact gradient of the real-arithmetic graph: at each internal node, the reverse accumulator is the derivative of the downstream output with respect to an independent node value; at inputs it is the gradient of .
Forward-over-reverse Hessian-vector products: the reverse update is and its directional derivative update is .
Chain sum product and composition rules for Banach derivatives: composition and bounded-bilinear product obey the chain and product rules; finite-dimensional matrix multiplication is such a product.
Proof
By [F4], the input reverse accumulator is the function . Since is by [F2] under the primitive hypotheses in [F1], its directional derivative at exists. By [F3], the forward recurrence supplies every primitive-input direction .
At a node , the exact reverse contribution to parent slot is . Since each primitive is , is ; the finite reverse recurrence is therefore differentiable, as it consists of sums and bounded bilinear matrix-vector products of maps. Differentiate this matrix-vector product along . The product rule [F6] gives , exactly the second recurrence in [F5]. Reverse topological induction therefore shows that every equals the directional derivative of the corresponding exact reverse accumulator. If the scalar output is an input coordinate, its seeded gradient is the constant coordinate vector and the initialized tangent-cotangent remains zero, as this recurrence also gives.
At the inputs, step 2.1 identifies the returned vector with , which by definition is .
Local Jacobian perturbations give a pathwise bound for graph-gradient error
Statement
For a finite scalar-output graph on one fixed strict branch, associate to each parent-slot edge the exact local derivative map at the exact real-arithmetic primal values. Use induced Euclidean operator norms on all edge spaces. Suppose a reverse recurrence instead uses local maps from the same branch satisfying , with exact accumulation arithmetic. For an input block , let be the finite directed paths from that block to output , and order the edges of a path from input to output. The exact gradient contribution is the transpose of , and the perturbed recurrence returns the corresponding sum using . It obeys The bound covers local Jacobian and derivative-evaluation errors represented by . It does not include roundoff in the reverse accumulation additions.
Facts & Assumptions
Given: A finite graph on a fixed strict branch, exact edge Jacobians , perturbed edge Jacobians , and exact real accumulation of the perturbed reverse recurrence.
Finite straight-line computational programs and real-arithmetic tapes: a graph is finite and acyclic, and each parent slot defines a separate edge with a local derivative map.
Reverse mode computes the exact gradient of the real-arithmetic graph: exact reverse accumulation returns the gradient of the graph's scalar output.
Composition satisfies |ST|\le|S|,|T|: induced operator norms satisfy for composable bounded linear maps.
Cauchy–Schwarz: , with equality exactly for dependent pairs: Euclidean inner products satisfy .
Each edge perturbation satisfies the stated operator-norm bound; all sums and products in this theorem are exact real arithmetic.
Proof
Starting with output cotangent , the exact reverse recurrence at a node sums one local derivative-transpose contribution from each outgoing parent-slot edge. By induction in reverse topological order, its expansion at input block has one ordered derivative product for every path from to the output: the length-zero path at the output node has product (including when the output itself is an input), and extending a path by one edge multiplies its product by that edge's local derivative. The same finite recurrence with yields the sum of perturbed path products; the output seed is unchanged. By [F2], the exact path sum is .
Fix a path . Insert one factor at a time to write This identity follows by cancellation of consecutive products in the telescoping sum.
Submultiplicativity [F3] and [A1] bound the th summand by . A path product maps an input block to ; writing , Cauchy--Schwarz [F4] gives , with equality at when , and both norms are zero when . Hence , so the operator-norm estimate also bounds the path's gradient-contribution error. Summing these bounds over controls the error on this path.
The perturbed and exact gradients are finite sums over the same paths by step 1.1. The triangle inequality therefore bounds their difference by the sum of the pathwise errors from step 2.1, which is exactly the displayed bound.
Real-arithmetic graph derivatives and rounded execution are different objects
Remarks
The exact AD identities refer to the real-arithmetic graph and its exact primitive derivatives. A floating execution uses rounded primal values and derivative arithmetic; its returned AD quantity is not asserted to be the ordinary derivative of the end-to-end rounded machine map. The theorem Local Jacobian perturbations give a pathwise bound for graph-gradient error propagates specified local Jacobian discrepancies with exact accumulation and excludes rounding in reverse accumulation additions.
For a concrete mathematical solve primitive, Certified inverse defects and primal residuals bound linear-solve Jacobian and pullback errors supplies those discrepancies. With stored primal , fixed approximate inverse assembled from basis solves, certified , , , and , the vector and matrix edges have and . Its additional explicit dot/outer-product allowances cover rounded pullback evaluation. Triangular, successful Cholesky, and QR backends are admissible once those residuals are certified; a small factorization residual alone is insufficient. The lemma includes the derivative-evaluation-point error, conditioning, arithmetic success and replay hypotheses.
For the implicit example, specify , , , and objective . Then and . At , ordinary triangular substitution for the primal and basis solves gives , , and . In Operationwise real and complex floating point arithmetic with rounded square roots and fused multiply-add, assume are normal representable numbers. The solves, sequential dot products for with , and outer product have only representable results . Round-to-nearest therefore leaves every result exact. Contracting the matrix cotangent with returns . This exactness follows from the specified operations and rounding rule; zero solve defects alone only remove the fixed-map discrepancy.
A Cholesky or QR factor-output primitive is a different smooth map from the mathematical solve. Its derivative must be evaluated on one fixed strict branch, with its own local derivative errors, or its finite loop must be expanded into the scalar primitives of the graph. The solve bound does not identify a factorization residual with a factor-output derivative bound.
Certified inverse defects and primal residuals bound linear-solve Jacobian and pullback errors
Statement
For the real mathematical solve primitive , let , , , and suppose certified exact-residual bounds satisfy Then is invertible; writing , the fixed linear derivative approximations and obey Use Euclidean vector norms and Frobenius matrix-input norm. For any stored matrix and stored cotangent , the exact adjoints are and . Let be the unit roundoff in The standard relative floating-point model and unit roundoff, and assume . For each , compute by the sequential real dot rule: for , , and for , with each product and addition rounded separately; set . Form the matrix cotangent as the componentwise rounded outer product . Assume every operation succeeds in the operationwise model Operationwise real and complex floating point arithmetic with rounded square roots and fused multiply-add: each exact intermediate is zero or normal and every rounded output is finite. Put and . The resulting cotangent errors are bounded by and , respectively. These are derivative approximations to the mathematical solve map, not derivatives of the rounded program.
The fixed may be assembled from stored basis-vector solves using a triangular, Cholesky or QR backend; its defect must be certified rather than inferred from a factor residual. Replay must preserve the same and strict graph branch. Reverse accumulation additions are excluded.
Facts & Assumptions
Given: The stated exact-residual and norm certificates, with arithmetic success for any evaluated pullbacks.
Implicit differentiation and adjoint formulas under a nonsingular residual Jacobian gives , by differentiating .
Rounded matrix products give certified linear and normal-equation residual allowances supplies explicit linear residual allowances for the primal and stored basis-column solves.
Every linear map between finite-dimensional real or complex inner product spaces admits a singular value decomposition supplies finite square-matrix singular-value and invertibility criteria.
Operationwise real and complex floating point arithmetic with rounded square roots and fused multiply-add: real products and additions are separately rounded operations, and the operationwise success condition excludes nonzero out-of-range exact intermediates.
The standard relative floating-point model and unit roundoff: a successful nonzero real rounded operation has relative error at most , and exact zero operations are exact.
If |delta_i| <= u and n u < 1, then prod (1+delta_i) = 1 + theta_n with |theta_n| <= gamma_n: if for factors and , then .
Cauchy–Schwarz: , with equality exactly for dependent pairs: for Euclidean vectors; applying it rowwise gives .
Composition satisfies |ST|\le|S|,|T|: induced operator norms satisfy for composable maps.
The operator norm as the least bound and as the unit-sphere or unit-ball supremum: the operator norm is the unit-ball supremum and satisfies .
Proof
For every , by [F9]. Applying [F3] to the square map , a zero singular value would give a nonzero right singular vector in its kernel, contradicting this lower bound; thus is invertible. Then is injective and is surjective. The square SVDs of and therefore also have no zero singular values, so [F3] makes both invertible. Applying the lower bound to gives . Since , [F8] gives . The identity gives , while gives . The residuals in these identities are exact; [F2] explains how to certify them from rounded evaluations.
Apply [F1] at the exact point . For the matrix edge, . Since by [F7], submultiplicativity [F8], the operator action bound [F9], and step 1.1 give ; the vector edge gives . For any linear map between Euclidean spaces, by [F7], so ; applying this to gives equality. Thus the adjoint discrepancies have the same norm bounds. This explicitly accounts for the perturbed primal evaluation point through .
Fix an output coordinate of and put . By success in [F4] and the relative bound in [F5], with ; exact-zero products have . For each addition , write with , taking when the exact sum is zero. Expanding gives , with an empty product interpreted as . Each coefficient has at most factors: for it has one product factor and addition factors, while for it has one product factor and addition factors. Thus [F6], , and monotonicity of imply that each coefficient differs from by at most . Hence . Stacking these bounds and applying [F7] to gives . By the adjoint norm equality in step 2.1 and the action bound [F9], , so . Each rounded outer-product entry has error at most , so its Frobenius error is at most . Combining these bounds with step 2.1 gives the stated vector and matrix cotangent estimates.
For each realized nonzero , any cotangent error vector is the action on of the linear map , whose induced norm is by Cauchy--Schwarz [F7] and equality on [F9]; vectorize the matrix cotangent for the matrix edge. When , successful operations return exact zero. Thus the realized rounded pullbacks admit local linear-map perturbations with the displayed bounds, without asserting global linearity of rounding. The graph perturbation theorem may propagate these realized maps with exact accumulation.
5 · Examples, counterexamples and false statements
None yet.
Sources
- MIT OpenCourseWare 18.S096, Matrix Calculus for Machine Learning and Beyond, complete lecture notes, Chapter 8 §§8.3–8.4.1
- A. Griewank, Achieving Logarithmic Growth of Temporal and Spatial Complexity in Reverse Automatic Differentiation, §§1, 3–6
- J. Lebl, Basic Analysis II, Theorem 8.5.6 and proof, §8.5.1
- J. Lebl, Basic Analysis I, Theorem 8.3.7 and proof, §8.3.1
- MIT OpenCourseWare 18.S096, Matrix Calculus for Machine Learning and Beyond, complete lecture notes, Chapter 8 §8.4.1
- A. Griewank, Achieving Logarithmic Growth of Temporal and Spatial Complexity in Reverse Automatic Differentiation, §§3–6 and Theorem 6.1
- Atilım Güneş Baydin and Barak A. Pearlmutter, Automatic Differentiation of Algorithms for Machine Learning, complete arXiv text, §§2–3
- MIT OpenCourseWare 18.S096, Matrix Calculus for Machine Learning and Beyond, complete lecture notes, Chapter 8 §§8.3–8.4
- W. Baur and V. Strassen, The Complexity of Partial Derivatives, Theoretical Computer Science 22 (1983), §§2 and 4
- A. Griewank, Achieving Logarithmic Growth of Temporal and Spatial Complexity in Reverse Automatic Differentiation, §§4–6 and Theorem 6.1
- A. Griewank, Achieving Logarithmic Growth of Temporal and Spatial Complexity in Reverse Automatic Differentiation, §1
- A. Griewank, Achieving Logarithmic Growth of Temporal and Spatial Complexity in Reverse Automatic Differentiation, §2
- Stuart and Voss, Matrix Analysis and Algorithms