Physlib

Physlib.Units.ParametricUnits

The unit side, parametrised in the same basis

The dimension basis is parametric (`Dimension B`), but the *unit* side of the bridge is hardwired in parallel: `LTMCTUnitChoices` has five named unit fields and `LTMCTUnitChoices.dimScale` folds over exactly those five. This module provides the generic twin, parametrised in the same basis `B`.

Every PhysLib base unit (`LengthUnit`, `TimeUnit`, …) is, structurally, a positive real (`{ val : ℝ // 0 < val }`); the typed names carry no extra algebraic content. So a unit choice over a basis `B` is a positive real per base dimension, and the scaling homomorphism folds the per-base unit ratio over `B`:

* `UnitScale B` — a positive-real magnitude for each `b : B`. * `UnitScale.dimScale : UnitScale B → UnitScale B → Dimension B →* ℝ≥0` — the `MonoidHom` `d ↦ ∏ b, (u₁ b / u₂ b) ^ d.exponent b`, generic in `B`.

The current five-field `LTMCTUnitChoices.dimScale` is the `LTMCTDimensionBase` instance of this fold, written out by hand; `LTMCTUnitChoices.toScale` exhibits the correspondence.

The current five-field `LTMCTUnitChoices` is the `LTMCTDimensionBase` instance

`LTMCTUnitChoices.toScale` reads the five typed units as a `UnitScale LTMCTDimensionBase`, exhibiting the existing bespoke `dimScale` as the `LTMCTDimensionBase` case of the generic fold.

6 declarations

theorem

The ratio of unit scales u1(b)u2(b)\frac{u_1(b)}{u_2(b)} is non-zero

Let BB be a basis. For any two unit scales u1,u2u_1, u_2 mapping elements of BB to positive real numbers, and for any bBb \in B, the ratio of the magnitudes u1(b)u2(b)\frac{u_1(b)}{u_2(b)} is non-zero.

definition

Dimension-scaling homomorphism dimScale(u1,u2)\text{dimScale}(u_1, u_2)

Let BB be a finite set representing a basis of physical dimensions. Given two unit scales u1u_1 and u2u_2 (which assign a positive real magnitude to each base dimension bBb \in B), the dimension-scaling homomorphism dimScale(u1,u2)\text{dimScale}(u_1, u_2) is a monoid homomorphism from the group of dimensions Dimension B\text{Dimension } B to the non-negative real numbers R0\mathbb{R}_{\ge 0}. For any dimension dd, the scaling factor is defined by the product: dimScale(u1,u2)(d)=bB(u1(b)u2(b))expb(d)\text{dimScale}(u_1, u_2)(d) = \prod_{b \in B} \left( \frac{u_1(b)}{u_2(b)} \right)^{\text{exp}_b(d)} where expb(d)\text{exp}_b(d) denotes the exponent of the base dimension bb in the dimension dd. This map determines how a physical quantity of dimension dd rescales when the unit choice is changed from u1u_1 to u2u_2.

theorem

dimScale(u,u)(d)=1\text{dimScale}(u, u)(d) = 1

Let BB be a finite basis of physical dimensions. For any unit scale uu (which assigns a positive real magnitude to each base dimension bBb \in B) and any physical dimension dDimension Bd \in \text{Dimension } B, the dimension-scaling factor from uu to itself is equal to 1, i.e., dimScale(u,u)(d)=1\text{dimScale}(u, u)(d) = 1

theorem

The scaling factor for a dimensionless quantity is 11

Let BB be a finite set representing a basis of physical dimensions. For any two unit scales u1u_1 and u2u_2 over BB, the dimension-scaling homomorphism dimScale(u1,u2)\text{dimScale}(u_1, u_2) maps the dimensionless identity 1Dimension B1 \in \text{Dimension } B to the multiplicative identity 11 in R0\mathbb{R}_{\ge 0}. That is, dimScale(u1,u2)(1)=1\text{dimScale}(u_1, u_2)(1) = 1 This reflects the fact that dimensionless quantities do not change their numerical value when the system of units is rescaled.

theorem

Transitivity of dimension-scaling factors: dimScale(u1,u2,d)dimScale(u2,u3,d)=dimScale(u1,u3,d)\text{dimScale}(u_1, u_2, d) \cdot \text{dimScale}(u_2, u_3, d) = \text{dimScale}(u_1, u_3, d)

Let BB be a finite set representing a basis of physical dimensions. For any three unit scales u1,u2,u3u_1, u_2, u_3 (which assign positive real magnitudes to each base dimension in BB) and any physical dimension dDimension Bd \in \text{Dimension } B, the dimension-scaling factors satisfy the transitivity property: dimScale(u1,u2)(d)dimScale(u2,u3)(d)=dimScale(u1,u3)(d)\text{dimScale}(u_1, u_2)(d) \cdot \text{dimScale}(u_2, u_3)(d) = \text{dimScale}(u_1, u_3)(d) where dimScale(ui,uj)(d)\text{dimScale}(u_i, u_j)(d) denotes the scaling factor applied to a quantity of dimension dd when changing the system of units from uiu_i to uju_j.

definition

Conversion of `LTMCTUnitChoices` to `UnitScale`

The function maps a set of unit choices uu (of type `LTMCTUnitChoices`) to a `UnitScale` over the basis of base dimensions {L,T,M,C,Θ}\{L, T, M, C, \Theta\}. For each base dimension b{L,T,M,C,Θ}b \in \{L, T, M, C, \Theta\}, the resulting scale is defined as the positive real magnitude of the corresponding field in uu (length, time, mass, charge, or temperature).