A Calculus for Units of Measure with Conversion
This study addresses the lack of conversion support in existing typed unit calculi and the absence of scale-invariance guarantees in practical languages by proposing the ΛS calculus. This method is the first to integrate unit conversion into a rigorous type system, supporting quantification and vector linear mappings while precisely delineating the boundaries of scale invariance. It formally proves global invariance for expressions without constant terms and local invariance for those involving conversions. The entire framework is formally verified in Lean 4, yielding verified decision procedures and checkers alongside native binary compilation for evaluation. Furthermore, this work establishes a consistency-checking method for unit declarations, extracts precise conversion factors, and proves both an erasure theorem and the Buckingham π theorem for dimensional analysis with n variables.