# Typing Tensor Calculus in 2-Categories (I)

**Authors:** Fatimah Rita Ahmadi

arXiv: 1908.01212 · 2025-08-01

## TL;DR

This paper develops a formal, index-free framework for linear algebra using 2-categories, enabling efficient tensor calculations and extending traditional matrix algebra to higher-rank tensors within a categorical setting.

## Contribution

It introduces semiadditive 2-categories to formalize tensors as 2-morphisms, generalizing matrix calculus to higher dimensions in a categorical framework.

## Key findings

- Defines semiadditive 2-categories for tensors
- Extends matrix operations to 2-categories
- Demonstrates vectorization in 2Vec category

## 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, $\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 $T_{ij}$ are represented as 1-morphisms, and tensors with four indices $T_{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.

## Full text

_Full body text omitted from this summary view._ Fetch the complete paper as Markdown: https://tomesphere.com/paper/1908.01212/full.md

## Figures

5 figures with captions in the complete paper: https://tomesphere.com/paper/1908.01212/full.md

## References

12 references — full list in the complete paper: https://tomesphere.com/paper/1908.01212/full.md

---
Source: https://tomesphere.com/paper/1908.01212