English

Typing Tensor Calculus in 2-Categories (I)

Category Theory 2025-08-01 v4 Machine Learning Software Engineering

Abstract

To formalize calculations in linear algebra for the development of efficient algorithms and a framework suitable for functional programming languages and faster parallelized computations, we adopt an approach that treats elements of linear algebra, such as matrices, as morphisms in the category of matrices, Matk\mathbf{Mat_{k}}. This framework is further extended by generalizing the results to arbitrary monoidal semiadditive categories. To enrich this perspective and accommodate higher-rank matrices (tensors), we define semiadditive 2-categories, where matrices TijT_{ij} are represented as 1-morphisms, and tensors with four indices TijklT_{ijkl} as 2-morphisms. This formalization provides an index-free, typed linear algebra framework that includes matrices and tensors with up to four indices. Furthermore, we extend the framework to monoidal semiadditive 2-categories and demonstrate detailed operations and vectorization within the 2-category of 2Vec introduced by Kapranov and Voevodsky.

Keywords

Cite

@article{arxiv.1908.01212,
  title  = {Typing Tensor Calculus in 2-Categories (I)},
  author = {Fatimah Rita Ahmadi},
  journal= {arXiv preprint arXiv:1908.01212},
  year   = {2025}
}

Comments

28 pages; extended introduction, more explanation

R2 v1 2026-06-23T10:38:57.919Z