Types, equations, dimensions and the Pi theorem
Nicola Botta, Patrik Jansson
TL;DR
The paper targets the gap between mathematical physics and dependently typed programming by proposing a minimal Idris-embedded DSL that encodes a grammar of dimensions, physical quantities, and units. It integrates covariance principles and Buckingham's Pi theorem into a type-theoretic framework, highlighting both constructive and non-constructive aspects and offering a pathway for DA-driven program derivation. Key contributions include a concrete DSL for dimensions, a type-theoretic formulation of the Pi theorem, and a constructive methodology (applyPi) to generate covariant functions, demonstrated on pendulum-like relations. The work advances interdisciplinary dialogue by providing verifiable, dimensionally aware programming tools that can assist model specification, analysis, and data-driven formulation in climate and physics contexts.
Abstract
The languages of mathematical physics and modelling are endowed with a rich ``grammar of dimensions'' that common abstractions of programming languages fail to represent. We propose a dependently typed domain-specific language (embedded in Idris) that captures this grammar. We apply it to explain basic notions of dimensional analysis and Buckingham's Pi theorem. We hope that the language makes mathematical physics more accessible to computer scientists and functional programming more palatable to modellers and physicists.
