Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Dimensional analysis of physical constants: unit changes, dimensionless monomials, natural units

Definition
VaryingConstants_units

by Lucas · Oct 2, 2026 · Mathlib 0df444a (Lean v4.33.1)

dimensional-analysisfundamental-constantslinear-algebramathematical-physics

This file fixes the vocabulary of dimensional analysis used throughout the mission.

We consider nnn dimensional constants x1,…,xnx_1,\dots,x_nx1​,…,xn​ measured with respect to ddd base units U1,…,UdU_1,\dots,U_dU1​,…,Ud​ (for mechanics, d=3d=3d=3: length LLL, mass MMM, time TTT). The dimension matrix D∈Rn×dD\in\mathbb R^{n\times d}D∈Rn×d records that constant iii has dimension ∏jUjDij\prod_j U_j^{D_{ij}}∏j​UjDij​​. Real exponents are allowed (e.g. Gaussian units give the charge the dimension M1/2L3/2T−1M^{1/2}L^{3/2}T^{-1}M1/2L3/2T−1).

  1. Change of units. For a vector s∈Rds\in\mathbb R^ds∈Rd (in practice sj>0s_j>0sj​>0), the rescaled configuration is
(s⋅x)i  =  xi∏j=1dsj Dij.(s\cdot x)_i \;=\; x_i\prod_{j=1}^d s_j^{\,D_{ij}} .(s⋅x)i​=xi​j=1∏d​sjDij​​.

Here sjs_jsj​ is the factor by which numerical values of quantities of dimension UjU_jUj​ change. 2. Positivity. A vector is positive if all its entries are >0>0>0. 3. Unit-invariant observable. f:Rn→Rf:\mathbb R^n\to\mathbb Rf:Rn→R is unit invariant if f(s⋅x)=f(x)f(s\cdot x)=f(x)f(s⋅x)=f(x) for every positive xxx and every positive sss. 4. Dimensionless exponents. The subspace ZD={a∈Rn:∑iaiDij=0 ∀j}\mathcal Z_D=\{a\in\mathbb R^n : \sum_i a_i D_{ij}=0 \ \forall j\}ZD​={a∈Rn:∑i​ai​Dij​=0 ∀j} (the left kernel of DDD). 5. Power monomial. πa(x)=∏ixiai\pi_a(x)=\prod_i x_i^{a_i}πa​(x)=∏i​xiai​​. 6. Natural units. Given ddd chosen constants e1,…,ede_1,\dots,e_de1​,…,ed​, a positive sss is a system of natural units for xxx if (s⋅x)ej=1(s\cdot x)_{e_j}=1(s⋅x)ej​​=1 for all jjj. 7. Planck dimension matrix. With rows (c,G,ℏ)(c,G,\hbar)(c,G,ℏ) and columns (L,M,T)(L,M,T)(L,M,T):

DP=(10−13−1−221−1),D_{\rm P}=\begin{pmatrix}1&0&-1\\ 3&-1&-2\\ 2&1&-1\end{pmatrix},DP​=​132​0−11​−1−2−1​​,

i.e. [c]=LT−1[c]=LT^{-1}[c]=LT−1, [G]=L3M−1T−2[G]=L^3M^{-1}T^{-2}[G]=L3M−1T−2, [ℏ]=L2MT−1[\hbar]=L^2MT^{-1}[ℏ]=L2MT−1.

These objects make precise the statements of Uzan's §2.1: natural units are defined by setting three independent constants to 111, and "only the variation of dimensionless constants can be measured".

Formalization Note Real powers are Real.rpow; positivity is not built into the vectors but carried as explicit hypotheses. ZD\mathcal Z_DZD​ is the kernel of a↦aTDa\mapsto a^{\mathsf T}Da↦aTD.

Definition code
import Mathlib

/-!
Dimensional analysis of physical constants (Uzan 2011, Living Rev. Relativity 14:2, §2.1).

`n` dimensional constants are measured with respect to `d` base units (for mechanics
`d = 3`: length, mass, time).  The dimension matrix `D : Matrix (Fin n) (Fin d) ℝ` records
that constant `i` has dimension `∏ⱼ Uⱼ ^ D i j`.  A configuration `x : Fin n → ℝ` lists the
(positive) numerical values of the constants in some system of units.
-/

namespace VaryingConstants

/-- Change of units: if every base unit `j` is rescaled so that numerical values of quantities
of dimension `Uⱼ` are multiplied by `s j > 0`, the numerical value of constant `i` is multiplied
by `∏ⱼ (s j) ^ (D i j)`. -/
noncomputable def unitRescale {n d : ℕ} (D : Matrix (Fin n) (Fin d) ℝ) (s : Fin d → ℝ)
    (x : Fin n → ℝ) : Fin n → ℝ :=
  fun i => x i * ∏ j, s j ^ D i j

/-- All entries of a vector are strictly positive. -/
def IsPositive {m : ℕ} (x : Fin m → ℝ) : Prop :=
  ∀ i, 0 < x i

/-- A real-valued function of the numerical values of the constants is *unit invariant*
(the outcome of a measurement): on positive configurations it does not change under any
change of units. -/
def IsUnitInvariant {n d : ℕ} (D : Matrix (Fin n) (Fin d) ℝ) (f : (Fin n → ℝ) → ℝ) : Prop :=
  ∀ x : Fin n → ℝ, IsPositive x → ∀ s : Fin d → ℝ, IsPositive s → f (unitRescale D s x) = f x

/-- Exponent vectors `a` for which the power product `∏ᵢ xᵢ ^ aᵢ` is dimensionless,
i.e. `∑ᵢ aᵢ D i j = 0` for every base unit `j`. -/
def dimensionlessExponents {n d : ℕ} (D : Matrix (Fin n) (Fin d) ℝ) :
    Submodule ℝ (Fin n → ℝ) :=
  LinearMap.ker (Matrix.vecMulLinear D)

/-- The power product `∏ᵢ xᵢ ^ aᵢ` (real exponents). -/
noncomputable def powerMonomial {n : ℕ} (a x : Fin n → ℝ) : ℝ :=
  ∏ i, x i ^ a i

/-- `s` is a system of natural units for the configuration `x` built on the constants
`e 0, …, e (d-1)`: `s` is a positive change of units after which each chosen constant
has numerical value `1`. -/
def IsNaturalUnitsFor {n d : ℕ} (D : Matrix (Fin n) (Fin d) ℝ) (e : Fin d → Fin n)
    (x : Fin n → ℝ) (s : Fin d → ℝ) : Prop :=
  IsPositive s ∧ ∀ j, unitRescale D s x (e j) = 1

/-- Dimension matrix of Planck's triple `(c, G, ħ)` in the base units `(L, M, T)`:
`[c] = L T⁻¹`, `[G] = L³ M⁻¹ T⁻²`, `[ħ] = L² M T⁻¹`. -/
def planckDims : Matrix (Fin 3) (Fin 3) ℝ :=
  !![1, 0, -1; 3, -1, -2; 2, 1, -1]

end VaryingConstants
Source
J.-P. Uzan, "Varying Constants, Gravitation and Cosmology", Living Rev. Relativity 14 (2011) 2, http://www.livingreviews.org/lrr-2011-2, §2.1.1 ("Natural units", pp. 15–16; "Fundamental parameters", p. 17) and §2.1.2 (p. 14).
Read-back

What the Lean code literally says, in plain math · Aristotle (Harmonic)

Non-blind read-back. This read-back was written by the same agent that drafted the Lean statement, at the explicit request of the proposal owner. It is not an independent, blind audit and must not be treated as independent testimony; the reviewer should compare the Lean code against the source directly.

The file declares, inside the namespace VaryingConstants, the following objects (all indices range over {0,…,n−1}\{0,\dots,n-1\}{0,…,n−1} or {0,…,d−1}\{0,\dots,d-1\}{0,…,d−1}, and DDD is an arbitrary real n×dn\times dn×d matrix; no hypothesis is placed on DDD).

  1. Unit rescaling. For DDD, a real vector s∈Rds\in\mathbb R^ds∈Rd and x∈Rnx\in\mathbb R^nx∈Rn, the vector with entries xi⋅∏jsjDijx_i\cdot\prod_{j} s_j^{D_{ij}}xi​⋅∏j​sjDij​​, where the power is the real power function. Positivity of sss is not required by the definition; for sj≤0s_j\le 0sj​≤0 the real power returns Mathlib's convention values (e.g. 0t=00^{t}=00t=0 for t≠0t\neq0t=0, 00=10^0=100=1, and for negative bases a value defined via the complex logarithm).

  2. Positive vector. x∈Rmx\in\mathbb R^mx∈Rm is positive iff xi>0x_i>0xi​>0 for every iii (vacuous when m=0m=0m=0).

  3. Unit invariance. A function f:Rn→Rf:\mathbb R^n\to\mathbb Rf:Rn→R is unit invariant for DDD iff for every positive x∈Rnx\in\mathbb R^nx∈Rn and every positive s∈Rds\in\mathbb R^ds∈Rd, fff evaluated at the rescaled vector equals f(x)f(x)f(x). Nothing is required of fff at non-positive arguments; no continuity or measurability is required.

  4. Dimensionless exponents. The linear subspace of Rn\mathbb R^nRn consisting of those aaa with ∑iaiDij=0\sum_i a_i D_{ij}=0∑i​ai​Dij​=0 for every column jjj.

  5. Power monomial. For a,x∈Rna,x\in\mathbb R^na,x∈Rn, the real number ∏ixiai\prod_i x_i^{a_i}∏i​xiai​​ (real powers; convention values at non-positive xix_ixi​).

  6. Natural units. Given DDD, a map e:{0,…,d−1}→{0,…,n−1}e:\{0,\dots,d-1\}\to\{0,\dots,n-1\}e:{0,…,d−1}→{0,…,n−1} (not required to be injective), x∈Rnx\in\mathbb R^nx∈Rn and s∈Rds\in\mathbb R^ds∈Rd: sss is positive and, for every jjj, the e(j)e(j)e(j)-th entry of the rescaled vector equals 111.

  7. Planck matrix. The fixed real 3×33\times33×3 matrix with rows (1,0,−1)(1,0,-1)(1,0,−1), (3,−1,−2)(3,-1,-2)(3,−1,−2), (2,1,−1)(2,1,-1)(2,1,−1).

Human review
  • Endorsed by Shuze Chen · Oct 2, 2026

    Confirmed by the moderator at approval.

  • Endorsed by Lucas · Oct 2, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me