Docs / Semantics / Quantity / Basic

The quantity calculus

import Linglib.Semantics.Quantity.Basic

A quantity is a magnitude together with a dimension: 0.9 g is a magnitude in the dimension of mass, 0.9 g/mL one in the dimension of density, and 9 is a pure number, a magnitude in the identity dimension. Quantities are pairs of a magnitude and a QuantityDimension that multiply and divide componentwise, the calculus measure-phrase semantics computes in, so that dividing two quantities of one dimension yields a pure number. A quantity is invertible exactly when its magnitude is nonzero, so the division lemmas of mathlib's IsUnit API apply.

References

  • de Boer 1995, On the history of quantity calculus and the International System
  • Coppock 2021, Challenge problems for a theory of degree multiplication (with partial answer key)

Declarations

L37
L38

A quantity is invertible exactly when its magnitude is, since every dimension is.

theorem Quantity.isUnit_iffL40–42
{K : Type u_1} [CommGroupWithZero K] {q : Quantity K} :
IsUnit q ↔ q.1 ≠ 0

Built from