← 研踪 PaperTrailarXiv:2611.19505 · v1
Formalizing $\mathsf{einsum}$ with Named Tensor Notation
首次提交 2026-11-15 00:56
版本更新 2026-11-15 00:56
雷达观测 2026-11-17 12:06
摘要
Einstein notation () is a widely adopted tensor operation that has proven useful in areas such as machine learning and quantum computing. But it had no formal semantics until recently, and its properties had no mechanized verification. We formalize the denotational semantics of a language of tensors (multi-dimensional arrays) that supports and repeated tensors (). With this semantics, we verify equational rewriting rules about and that improve the performance of tensor computation. Whereas typical languages use unnamed tensors, whose shape is a sequence of natural numbers, we found it advantageous for mechanization to use named tensors, whose shape is a finite map from names to natural numbers. To our knowledge, this is the first time that the semantics and rewriting rules of are mechanized in a proof assistant. Our solution is agnostic to proof assistants; we have implemented it in Lean and partially in Agda.
作者备注:14 pages
观测到的版本
相邻记录可能跳过中间版本;首次发现 v2 及以上也会标为版本更新。
v1 · 2026-11-15 00:56 · 最新观测版本
Formalizing $\mathsf{einsum}$ with Named Tensor Notation
Einstein notation () is a widely adopted tensor operation that has proven useful in areas such as machine learning and quantum computing. But it had no formal semantics until recently, and its properties had no mechanized verification. We formalize the denotational semantics of a language of tensors (multi-dimensional arrays) that supports and repeated tensors (). With this semantics, we verify equational rewriting rules about and that improve the performance of tensor computation. Whereas typical languages use unnamed tensors, whose shape is a sequence of natural numbers, we found it advantageous for mechanization to use named tensors, whose shape is a finite map from names to natural numbers. To our knowledge, this is the first time that the semantics and rewriting rules of are mechanized in a proof assistant. Our solution is agnostic to proof assistants; we have implemented it in Lean and partially in Agda.
查看此版本解读 →查看此版本原文 ↗