SearcharxivSearch

arXiv subjects

Fernando Lucatelli Nunes

Publications and source records attributed to Fernando Lucatelli Nunes.

At least 19 recordsLinked to original sources

Unraveling the iterative CHAD

Combinatory Homomorphic Automatic Differentiation (CHAD) was originally formulated as a semantics-driven source-to-source transformation for reverse-mode automatic differentiation of total functional programs. We extend CHAD to programs with partial operations, data-dependent conditionals, and while-loops, preserving its defining principle of structure-preserving semantics. Our main contribution is the introduction of iteration-extensive indexed categories, which integrate iteration into dependently typed programming languages. Iteration in the base category lifts to parameterized initial algebras in the indexed category, yielding fibred iteration on the op-Grothendieck construction. Its total category is the category of containers associated with the dependently typed target language. This framework characterizes iterative CHAD as the unique iterative Freyd category morphism from the source language's syntactic category to the target language's category of containers that maps each primitive operation to its transposed derivative. Using the universal property of the syntactic model, we prove that the transformed programs compute the reverse-mode derivatives of the original programs. The resulting theory connects fixpoint operators in indexed categories with a structure-preserving construction and correctness proof for iterative CHAD.

cs.PL

Free Doubly-Infinitary Distributive Categories are Cartesian Closed

We study the composite free completion Dist(C) := Fam(Fam(C^op)^op), obtained by first freely adjoining small products and then freely adjoining small coproducts. A natural pseudodistributive law equips this endo-pseudofunctor with a composite pseudomonad structure. Its pseudoalgebras are precisely the categories with small products and small coproducts in which small products distribute over small coproducts. We call such categories doubly-infinitary distributive. This condition is natural, but does not seem to have been systematically isolated in the literature. Thus Dist(C) is the free doubly-infinitary distributive category on C. Our main result is that Dist(C) is cartesian closed. Finally, we compare doubly-infinitary distributivity with extensivity, ordinary infinitary distributivity, and cartesian closedness by means of separating examples.

math.CT

Simply Typed Reverse-Mode Automatic Differentiation with Variants: Denotational Correctness via Idempotent Completion

Reverse-mode automatic differentiation is commonly given a denotational account in which each source type has a single cotangent type. Variant types obstruct this simply typed representation because the valid cotangent space depends on the branch selected at run time. Existing correctness results therefore use primal-indexed families of cotangent spaces, whose natural internal language is dependently typed. We show that the same dependency can be represented in an ordinary nondependent target. The cotangent fibres of each source type are embedded in a common ambient type, and a primal-indexed idempotent selects the valid fibre. Semantically, this amounts to passing from the constant-family model to its Karoubi completion. For a category $\mathcal C$ and a regular infinite cardinal $κ$, we prove that the constant-family inclusion extends to an equivalence $\mathrm{Kar}(\mathrm{Copow}*κ(\mathcal C)) \simeq \mathrm{Fam}*κ(\mathcal C)$ precisely when $\mathcal C$ is Cauchy complete and every $κ$-small family admits a common retract host. We also construct the resulting coproducts explicitly. Applying this theorem, we obtain a bicartesian closed semantics for reverse-mode automatic differentiation with variants using only ordinary target types, projectors, and backpropagators. Splitting the generated idempotents recovers the established dependent semantics. Thus dependent cotangent families and simply typed ambient cotangents equipped with projectors are equivalent presentations of the same denotational transformation.

cs.PL

From Grothendieck cofibrations to factorization systems: a formal 2-monadic account

Grothendieck cofibrations describe transport in a category varying over a base, while factorization systems organize the arrows of a category into two complementary classes. We give a fully 2-categorical account of the passage from the former structure to the latter. The global comma 2-monad on the arrow 2-category encodes Grothendieck transport, whereas the squaring 2-monad encodes factorizations. We prove that split cofibrations are precisely the strict algebras for the comma 2-monad, including their 1-cells and 2-cells, and that normally cloven cofibrations are precisely its normal pseudoalgebras. A canonical colax morphism from the comma 2-monad to the squaring 2-monad then turns cocartesian transport into the cocartesian-vertical factorization of arrows in the total category. At the strict level, this yields the strict factorization system of designated cocartesian and vertical arrows; at the coherent level, it yields the orthogonal factorization system whose left class consists of all cocartesian arrows and whose right class consists of the arrows sent to isomorphisms in the base. We also separate unrestricted global pseudoalgebras, which retain a coherently trivial base action, from fixed-base pseudoalgebras, which correspond to arbitrary cleavages, and record the dual strict result for fibrations. This places the classical cofibration-factorization interaction, in all these variants, within a single change-of-2-monads construction and relates it directly to the existing fibrational and factorization literature.

math.CT

Freely generated $n$-categories, coinserters and presentations of low dimensional categories

A presentation records not only a categorical structure but also how it is assembled. This matters for rewriting, coherence, and minimality: freely adjoining a cell with prescribed boundary is different from imposing an equation between cells already constructed. We show that these two operations are governed, respectively, by coinserters and coequifiers, giving a uniform account of computadic presentations from ordinary categories to strict higher categories. For a graph $G$, the free category on $G$ is the coinserter in $\mathsf{Cat}$ of its domain and codomain maps between discrete categories. More generally, for every $n\geq1$, freely adjoining $n$-cells with prescribed parallel boundaries to a strict $(n-1)$-category is a coinserter in the $2$-category of strict $n$-categories, strict $n$-functors, and $n$-icons. This construction is left adjoint to the underlying derivation-scheme functor. It recovers free strict $n$-categories from computads, while coequifiers impose equations between freely generated cells. In dimension two, it also satisfies a bicategorical universal property for normal pseudofunctors and icons. Replacing the walking arrow by the unit interval yields the topological coinserter of a graph. For a groupoidal $2$-computad $C$, attaching one disk for each relation produces a presentation complex $X_C$ whose fundamental groupoid is the groupoid presented by $C$. Consequently, the rank-finite deficiency of a connected groupoid is the classical deficiency of any isotropy group. Homology gives a sharp lower bound on the relations required to present a thin groupoid over a fixed graph, while crossed modules extend the comparison to relations among relations. Finally, for the descent computad, the identity and associativity confluences form a homotopy basis and attain the corresponding homological lower bounds.

math.CT

Backpropagation for Effectful Languages I: Finite Probability and Discrete Output Algebraic Effects

We analyse reverse-mode automatic differentiation (AD) for discrete probabilistic programs. Our construction is formulated in the framework of Combinatory Homomorphic Automatic Differentiation (CHAD), treating AD as a structure-preserving transformation of programs, guided by a denotational semantics. The main case study is the finite atomic distribution monad, whose computations have finite support and differentiable weights. The key point is that differentiating probabilistic programs requires cotangents to flow backwards not only through deterministic computations, but also through the probabilistic structure itself. We define the corresponding reverse-mode code transformation and prove its correctness, for handled real-output programs, by a categorical logical-relations argument. Although the paper focuses on finite discrete probability, the construction gives a reusable pattern for differentiating discrete-output algebraic effects, including finite multiset non-determinism (e.g., from fork-join parallelism), exceptions, and writer-style accumulation (e.g., for in-place accumulation of high-dimensional vectors). More broadly, we view this work as a foundational step towards extending CHAD to richer probabilistic languages and to other algebraic effects with handlers.

cs.PL

Monoidal closure of Grothendieck constructions via $Σ$-tractable monoidal structures and Dialectica formulas

We examine the categorical structure of the Grothendieck construction $Σ_{\mathsf{C}}\mathsf{L}$ of an indexed category $\mathsf{L} \colon \mathsf{C}^{op} \to \mathsf{CAT}$. Our analysis begins with characterisations of fibred limits, colimits, and monoidal (closed) structures. The study of fibred colimits leads naturally to a generalisation of the notion of extensive indexed category introduced in CHAD for Expressive Total Languages, and gives rise to the concept of left Kan extensivity, which provides a uniform framework for computing colimits in Grothendieck constructions. We then establish sufficient conditions for the (non-fibred) monoidal closure of the total category $Σ_{\mathsf{C}}\mathsf{L}$. This extends Gödel's Dialectica interpretation and rests upon a new notion of $Σ$-tractable monoidal structure. Under this notion, $Σ$-tractable coproducts unify and extend cocartesian coclosed structures, biproducts, and extensive coproducts. Finally, we consider when the induced closed structure is fibred, showing that this need not hold in general, even in the presence of a fibred monoidal structure.

math.CT

Functors Preserving Effective Descent Morphisms

Effective descent morphisms, originally defined in Grothendieck descent theory, form a class of special morphisms within a category. Essentially, an effective descent morphism enables bundles over its codomain to be fully described as bundles over its domain endowed with additional algebraic structure, called descent data. Like the study of epimorphisms, studying effective descent morphisms is interesting in its own right, providing deeper insights into the category under consideration. Moreover, studying these morphisms is part of the foundations of several applications of descent theory, notably including Janelidze-Galois theory, also known as categorical Galois theory. Traditionally, the study of effective descent morphisms has focused on investigating and exploiting the reflection properties of certain functors. In contrast, we introduce a novel approach by establishing general results on the preservation of effective descent morphisms. We demonstrate that these preservation results enhance the toolkit for studying such morphisms, by observing that all Grothendieck (op)fibrations satisfying mild conditions fit our framework. To illustrate these findings, we provide several examples of Grothendieck (op)fibrations that preserve effective descent morphisms, including topological functors and other forgetful functors of significant interest in the literature.

math.CT

Generalized multicategories: change-of-base, embedding, and descent

Via the adjunction $ - \boldsymbol{\cdot} 1 \dashv \mathcal V(1,-) \colon \mathsf{Span}(\mathcal V) \to \mathcal V \text{-} \mathsf{Mat} $ and a cartesian monad $ T $ on an extensive category $ \mathcal V $ with finite limits, we construct an adjunction $ - \boldsymbol{\cdot} 1 \dashv \mathcal V(1,-) \colon \mathsf{Cat}(T,\mathcal V) \to (\overline T, \mathcal V)\text{-}\mathsf{Cat} $ between categories of generalized enriched multicategories and generalized internal multicategories, provided the monad $ T $ satisfies a suitable condition, which is satisfied by several examples. We verify, moreover, that the left adjoint is fully faithful, and preserves pullbacks, provided that the copower functor $ - \boldsymbol{\cdot} 1 \colon \mathsf{Set} \to \mathcal V $ is fully faithful. We also apply this result to study descent theory of generalized enriched multicategorical structures. These results are built upon the study of base-change for generalized multicategories, which, in turn, was carried out in the context of categories of horizontal lax algebras arising out of a monad in a suitable 2-category of pseudodouble categories.

math.CT

Automatic Differentiation for ML-family languages: correctness via logical relations

We give a simple, direct and reusable logical relations technique for languages with term and type recursion and partially defined differentiable functions. We demonstrate it by working out the case of Automatic Differentiation (AD) correctness: namely, we present a correctness proof of a dual numbers style AD code transformation for realistic functional languages in the ML-family. We also show how this code transformation provides us with correct forward- and reverse-mode AD. The starting point is to interpret a functional programming language as a suitable freely generated categorical structure. In this setting, by the universal property of the syntactic categorical structure, the dual numbers AD code transformation and the basic $ω$-cpo semantics arise as structure preserving functors. The proof follows, then, by a novel logical relations argument. The key to much of our contribution is a powerful monadic logical relations technique for term recursion and recursive types. It provides us with a semantic correctness proof based on a simple approach for denotational semantics, making use only of the very basic concrete model of $ω$-cpos.

cs.PL

Lax comma categories: cartesian closedness, extensivity, topologicity, and descent

We investigate the properties of lax comma categories over a base category $X$, focusing on topologicity, extensivity, cartesian closedness, and descent. We establish that the forgetful functor from $\mathsf{Cat}//X$ to $\mathsf{Cat}$ is topological if and only if $X$ is large-complete. Moreover, we provide conditions for $\mathsf{Cat}//X$ to be complete, cocomplete, extensive and cartesian closed. We analyze descent in $\mathsf{Cat}//X$ and identify necessary conditions for effective descent morphisms. Our findings contribute to the literature on lax comma categories and provide a foundation for further research in 2-dimensional Janelidze's Galois theory.

math.CT

Free extensivity via distributivity

We consider the canonical pseudodistributive law between various free limit completion pseudomonads and the free coproduct completion pseudomonad. When the class of limits includes pullbacks, we show that this consideration leads to notions of extensive categories. More precisely, we show that extensive categories with pullbacks and infinitary lextensive categories are the pseudoalgebras for the pseudomonads resulting from the pseudodistributive laws. Moreover, we introduce the notion of doubly-infinitary lextensive category, and we establish that the freely generated such categories are cartesian closed. From this result, we further deduce that, in freely generated infinitary lextensive categories, the objects with a finite number of connected components are exponentiable. We conclude our work with remarks on descent theoretical aspects of this work, along with results concerning non-canonical isomorphisms, and relationship with other work.

math.CT

Lax comma categories of ordered sets

Let $\mathsf{Ord} $ be the category of (pre)ordered sets. Unlike $\mathsf{Ord}/X$, whose behaviour is well-known, not much can be found in the literature about the lax comma 2-category $\mathsf{Ord} //X$. In this paper we show that the forgetful functor $\mathsf{Ord} //X\to \mathsf{Ord} $ is topological if and only if $X$ is complete. Moreover, under suitable hypothesis, $\mathsf{Ord} // X$ is complete and cartesian closed if and only if $X$ is. We end by analysing descent in this category. Namely, when $X$ is complete and cartesian closed, we show that, for a morphism in $\mathsf{Ord} //X$, being pointwise effective for descent in $\mathsf{Ord} $ is sufficient, while being effective for descent in $\mathsf{Ord} $ is necessary, to be effective for descent in $\mathsf{Ord} //X$.

math.CT

Lax comma $2$-categories and admissible $2$-functors

This paper is a contribution towards a two dimensional extension of the basic ideas and results of Janelidze-Galois theory. In the present paper, we give a suitable counterpart notion to that of \textit{absolute admissible Galois structure} for the lax idempotent context, compatible with the context of \textit{lax orthogonal factorization systems}. As part of this work, we study lax comma $2$-categories, giving analogue results to the basic properties of the usual comma categories. We show that each morphism of a $2$-category induces a $2$-adjunction between lax comma $2$-categories and comma $2$-categories, playing the role of the usual \textit{change of base functors}. With these induced $2$-adjunctions, we are able to show that each $2$-adjunction induces $2$-adjunctions between lax comma $2$-categories and comma $2$-categories, which are our analogues of the usual lifting to the comma categories used in Janelidze-Galois theory. We give sufficient conditions under which these liftings are $2$-premonadic and induce a lax idempotent $2$-monad, which corresponds to our notion of $2$-admissible $2$-functor. In order to carry out this work, we analyse when a composition of $2$-adjunctions is a lax idempotent $2$-monad, and when it is $2$-premonadic. We give then examples of our $2$-admissible $2$-functors (and, in particular, simple $2$-functors), specially using a result that says that all admissible ($2$-)functors in the classical sense are also $2$-admissible (and hence simple as well). We finish the paper relating coequalizers in lax comma $2$-categories and Kan extensions.

math.CT

CHAD for Expressive Total Languages

We show how to apply forward and reverse mode Combinatory Homomorphic Automatic Differentiation (CHAD) to total functional programming languages with expressive type systems featuring the combination of - tuple types; - sum types; - inductive types; - coinductive types; - function types. We achieve this by analysing the categorical semantics of such types in $Σ$-types (Grothendieck constructions) of suitable categories. Using a novel categorical logical relations technique for such expressive type systems, we give a correctness proof of CHAD in this setting by showing that it computes the usual mathematical derivative of the function that the original program implements. The result is a principled, purely functional and provably correct method for performing forward and reverse mode automatic differentiation (AD) on total functional programming languages with expressive type systems.

cs.PL

Cauchy Completeness, Lax Epimorphisms and Effective Descent for Split Fibrations

For any suitable base category $\mathcal{V} $, we find that $\mathcal{V} $-fully faithful lax epimorphisms in $\mathcal{V} $-$\mathsf{Cat} $ are precisely those $\mathcal{V}$-functors $F \colon \mathcal{A} \to \mathcal{B}$ whose induced $\mathcal{V} $-functors $\mathsf{Cauchy} F \colon \mathsf{Cauchy} \mathcal{A} \to \mathsf{Cauchy} \mathcal{B} $ between the Cauchy completions are equivalences. For the case $\mathcal{V} = \mathsf{Set} $, this is equivalent to requiring that the induced functor $\mathsf{CAT} \left( F,\mathsf{Cat}\right) $ between the categories of split (op)fibrations is an equivalence. By reducing the study of effective descent functors with respect to the indexed category of split (op)fibrations $\mathcal{F}$ to the study of the codescent factorization, we find that these observations on fully faithful lax epimorphisms provide us with a characterization of (effective) $\mathcal{F}$-descent morphisms in the category of small categories $\mathcal{Cat}$; namely, we find that they are precisely the (effective) descent morphisms with respect to the indexed categories of discrete opfibrations -- previously studied by Sobral. We include some comments on the Beck-Chevalley condition and future work.

math.CT

Logical Relations for Partial Features and Automatic Differentiation Correctness

We present a simple technique for semantic, open logical relations arguments about languages with recursive types, which, as we show, follows from a principled foundation in categorical semantics. We demonstrate how it can be used to give a very straightforward proof of correctness of practical forward- and reverse-mode dual numbers style automatic differentiation (AD) on ML-family languages. The key idea is to combine it with a suitable open logical relations technique for reasoning about differentiable partial functions (a suitable lifting of the partiality monad to logical relations), which we introduce.

cs.PL

Descent for internal multicategory functors

We give sufficient conditions for effective descent in categories of (generalized) internal multicategories. Two approaches to study effective descent morphisms are pursued. The first one relies on establishing the category of internal multicategories as an equalizer of categories of diagrams. The second approach extends the techniques developed by Ivan Le Creurer in his study of descent for internal essentially algebraic structures.

math.CT