Physlib

Physlib.Units.SIUnitChoices

A typed unit choice over the ISQ base quantities (the SI units)

`LTMCTUnitChoices` is the typed unit choice over PhysLib's default dimension basis `LTMCTDimensionBase`. This module gives the *second* typed unit choice — over the seven ISQ base quantities `ISQDimensionBase` — realised through the basis-generic `UnitMagnitudeCatalog` / `UnitSystem` machinery of `Physlib.Units.UnitSystem`. It is the concrete payoff of parametrising the unit side: the same generic layer produces a fully *typed* unit choice over a different basis, and the scaling homomorphism comes for free from `UnitScale.dimScale` — nothing is re-proved by hand.

The ISQ base quantities are length, mass, time, electric current, thermodynamic temperature, amount of substance and luminous intensity. Four of the corresponding typed unit types already exist (`LengthUnit`, `MassUnit`, `TimeUnit`, `TemperatureUnit`); the remaining three — `CurrentUnit`, `AmountUnit`, `LuminousIntensityUnit` — are introduced here. (They follow the `LengthUnit` convention of a positive-real magnitude; the full division/scaling API can be filled in later and, following PhysLib's layout, they would ultimately live under the relevant physics directories.)

`SIUnitChoices := UnitSystem ISQDimensionBase` is then the typed SI unit choice, and `SIUnitChoices.SI` is the coherent SI choice (metre, kilogram, second, ampere, kelvin, mole, candela). Contrast `SIUnitChoices` (current-based, seven typed slots) with `LTMCTUnitChoices` (charge-based, five typed slots): the machinery supports both, and the `Dimension.ltmctToISQ` / `Dimension.isqToLTMCT` bridge relates their bases.

Typed unit types for the ISQ base quantities not already present

The ISQ `UnitMagnitudeCatalog` instance

Each ISQ base quantity is assigned its typed unit type; the magnitude layer is the positive-real `val`, exactly as for the `LTMCTDimensionBase` instance.

Folding over the ISQ base quantities

`SIUnitChoices`

29 declarations

theorem

The magnitude of any current unit is non-zero (x.val0x.\text{val} \neq 0)

For any unit of electric current xx (of type `CurrentUnit`), its numerical magnitude x.valx.\text{val} is non-zero.

theorem

The magnitude of a current unit is positive

For any electric current unit xx, its numerical magnitude x.valx.\text{val} is strictly greater than zero (x.val>0x.\text{val} > 0).

instance

Default current unit with magnitude 11

The type `CurrentUnit` is inhabited, meaning it has a designated default element. This default current unit is defined to have a magnitude of 11.

instance

Division of `CurrentUnit` into R0\mathbb{R}_{\ge 0}

For any two current units xx and yy of type `CurrentUnit`, their division x/yx / y is defined as the ratio of their numerical magnitudes, x.valy.val\frac{x.\text{val}}{y.\text{val}}, resulting in a non-negative real number in R0\mathbb{R}_{\ge 0}.

theorem

Division of electric current units equals the ratio of their magnitudes

For any two electric current units xx and yy of type `CurrentUnit`, the quotient x/yx / y is equal to the ratio of their numerical magnitudes x.valy.val\frac{x.\text{val}}{y.\text{val}}, expressed as a non-negative real number in R0\mathbb{R}_{\ge 0}.

definition

The ampere (AA) as the coherent SI unit of electric current

The constant `CurrentUnit.amperes` represents the ampere, which is the coherent SI unit of electric current. It is defined as an element of the type `CurrentUnit` with a numerical magnitude of 11.

theorem

The magnitude of an amount unit is non-zero (x.val0x.\text{val} \neq 0)

For any unit of amount of substance xx (an element of the type `AmountUnit`), its numerical magnitude x.valx.\text{val} is non-zero, i.e., x.val0x.\text{val} \neq 0.

theorem

The magnitude of an amount of substance unit is strictly positive (x.val>0x.\text{val} > 0)

For any unit of amount of substance xx, its numerical magnitude x.valx.\text{val} is strictly positive, such that x.val>0x.\text{val} > 0.

instance

AmountUnit\text{AmountUnit} is inhabited

The type AmountUnit\text{AmountUnit}, which represents units for the amount of substance, is inhabited. Its default element is defined as the unit with a numerical magnitude of 11.

instance

Division of units of amount of substance x/yR0x/y \in \mathbb{R}_{\ge 0}

The division of two units of amount of substance x,yAmountUnitx, y \in \text{AmountUnit} is defined as the ratio of their magnitudes, resulting in a non-negative real number x/yR0x/y \in \mathbb{R}_{\ge 0}.

theorem

The ratio of two units of amount of substance equals the ratio of their magnitudes x/y=x.val/y.valx/y = x.\text{val} / y.\text{val}

For any two units of amount of substance xx and yy, their quotient x/yx / y is equal to the non-negative real number formed by the ratio of their numerical magnitudes, x.valy.val\frac{x.\text{val}}{y.\text{val}}.

definition

The mole as a unit of amount of substance

The mole (mol\text{mol}) is defined as the coherent SI unit for the base quantity of amount of substance, represented as an element of `AmountUnit` with a magnitude of 11.

theorem

The magnitude of a luminous intensity unit is non-zero

For any unit of luminous intensity xx, its numerical magnitude x.valx.\text{val} is non-zero.

theorem

The magnitude of a luminous intensity unit is positive

For any luminous intensity unit xx, its numerical magnitude x.valx.\text{val} is strictly greater than zero (x.val>0x.\text{val} > 0).

instance

Default `LuminousIntensityUnit` is 11

The type `LuminousIntensityUnit`, which represents units of luminous intensity, is inhabited. Its default element is defined as the unit with a magnitude of 11.

instance

Division of Luminous Intensity Units resulting in R0\mathbb{R}_{\ge 0}

The division operator between two units of luminous intensity, xx and yy, results in a non-negative real number R0\mathbb{R}_{\ge 0}. The value of x/yx / y is defined as the ratio of their underlying magnitudes x.valy.val\frac{x.\text{val}}{y.\text{val}}.

theorem

The ratio of two luminous intensity units x/yx / y is the ratio of their magnitudes x.valy.val\frac{x.\text{val}}{y.\text{val}}

For any two units of luminous intensity xx and yy, the result of the division x/yx / y is the non-negative real number R0\mathbb{R}_{\ge 0} obtained by taking the ratio of their respective numerical magnitudes, x.valy.val\frac{x.\text{val}}{y.\text{val}}.

definition

The candela unit of luminous intensity

The constant represents the candela, which is the coherent SI unit for luminous intensity. It is defined as an element of the `LuminousIntensityUnit` type with a numerical magnitude of 11.

instance

Unit Magnitude Catalog for ISQ Base Dimensions

This instance defines the `UnitMagnitudeCatalog` for the seven base quantities of the International System of Quantities (ISQ). It maps each base dimension in `ISQDimensionBase` to its corresponding unit type: - Length \to `LengthUnit` - Mass \to `MassUnit` - Time \to `TimeUnit` - Electric current \to `CurrentUnit` - Thermodynamic temperature \to `TemperatureUnit` - Amount of substance \to `AmountUnit` - Luminous intensity \to `LuminousIntensityUnit` For any unit uu belonging to one of these types, the magnitude function mag(u)\text{mag}(u) returns its underlying value u.valu.\text{val} as a positive real number in R>0\mathbb{R}_{>0}.

theorem

The product of ff over all ISQDimensionBase\text{ISQDimensionBase} equals the product of its seven elements

Let MM be a commutative monoid and f:ISQDimensionBaseMf : \text{ISQDimensionBase} \to M be a function. The product of f(b)f(b) over all base quantities bb in the International System of Quantities (ISQ) is given by: bISQDimensionBasef(b)=f(length)f(mass)f(time)f(current)f(temperature)f(amount)f(luminousIntensity)\prod_{b \in \text{ISQDimensionBase}} f(b) = f(\text{length}) \cdot f(\text{mass}) \cdot f(\text{time}) \cdot f(\text{current}) \cdot f(\text{temperature}) \cdot f(\text{amount}) \cdot f(\text{luminousIntensity}) Here, ISQDimensionBase\text{ISQDimensionBase} is the set of the seven fundamental base quantities: length, mass, time, electric current, thermodynamic temperature, amount of substance, and luminous intensity.

abbrev

Typed Choice of SI Base Units

`SIUnitChoices` is the type of unit systems defined over the seven base quantities of the International System of Quantities (ISQ). An element of this type is a function uu that assigns a specific typed unit to each of the seven fundamental dimensions: 1. Length (LL) u(L)LengthUnit\to u(L) \in \text{LengthUnit} 2. Mass (MM) u(M)MassUnit\to u(M) \in \text{MassUnit} 3. Time (TT) u(T)TimeUnit\to u(T) \in \text{TimeUnit} 4. Electric current (II) u(I)CurrentUnit\to u(I) \in \text{CurrentUnit} 5. Thermodynamic temperature (Θ\Theta) u(Θ)TemperatureUnit\to u(\Theta) \in \text{TemperatureUnit} 6. Amount of substance (NN) u(N)AmountUnit\to u(N) \in \text{AmountUnit} 7. Luminous intensity (JJ) u(J)LuminousIntensityUnit\to u(J) \in \text{LuminousIntensityUnit} This structure allows for the formal representation of specific unit systems (such as the coherent SI system) by providing a "slot" for a unit of the appropriate type for every ISQ base dimension.

definition

The coherent SI base unit system

The coherent SI unit choice is the specific element of `SIUnitChoices` that maps each of the seven base quantities of the International System of Quantities (ISQ) to its standard coherent SI base unit. This mapping uSIu_{\text{SI}} is defined as: - uSI(length)=metreu_{\text{SI}}(\text{length}) = \text{metre} - uSI(mass)=kilogramu_{\text{SI}}(\text{mass}) = \text{kilogram} - uSI(time)=secondu_{\text{SI}}(\text{time}) = \text{second} - uSI(current)=ampereu_{\text{SI}}(\text{current}) = \text{ampere} - uSI(temperature)=kelvinu_{\text{SI}}(\text{temperature}) = \text{kelvin} - uSI(amount)=moleu_{\text{SI}}(\text{amount}) = \text{mole} - uSI(luminousIntensity)=candelau_{\text{SI}}(\text{luminousIntensity}) = \text{candela}

definition

Dimension scaling homomorphism for SI unit systems u1u_1 and u2u_2

For two unit systems u1,u2SIUnitChoicesu_1, u_2 \in \text{SIUnitChoices} defined over the seven ISQ base quantities (length, mass, time, electric current, thermodynamic temperature, amount of substance, and luminous intensity), `SIUnitChoices.dimScale u1 u2` is the group homomorphism from the group of physical dimensions Dimension(ISQDimensionBase)\text{Dimension}(\text{ISQDimensionBase}) to the non-negative real numbers R0\mathbb{R}_{\ge 0}. For any dimension dd, this homomorphism returns the numerical scaling factor between the units chosen by system u1u_1 and those chosen by system u2u_2.

theorem

The dimension scaling factor from a unit system to itself is 11

For any unit system uSIUnitChoicesu \in \text{SIUnitChoices} and any physical dimension dd defined over the seven ISQ base quantities (length, mass, time, electric current, thermodynamic temperature, amount of substance, and luminous intensity), the numerical scaling factor between the unit system uu and itself for the dimension dd is 11. That is, dimScale(u,u,d)=1\text{dimScale}(u, u, d) = 1.

theorem

scale(r,x)/x=r\text{scale}(r, x) / x = r for luminous intensity units

For any unit of luminous intensity xx and any positive real number rr, the ratio of the unit xx scaled by rr (denoted scale(r,x)\text{scale}(r, x)) to the original unit xx is equal to rr. Here, the division of two units results in a non-negative real number R0\mathbb{R}_{\ge 0}.

theorem

The ratio of a unit of luminous intensity xx to its scaled version scale(r,x)\text{scale}(r, x) equals 1/r1/r

For any unit of luminous intensity xx and any positive real number r>0r > 0, the ratio of xx to the unit xx scaled by rr (denoted by scale(r,x)\text{scale}(r, x)) is equal to the non-negative real number 1/rR01/r \in \mathbb{R}_{\ge 0}.

theorem

scale(1,x)=x\text{scale}(1, x) = x for units of luminous intensity

For any unit of luminous intensity xx, scaling xx by a factor of 11 is equal to xx.

theorem

Ratio of scaled luminous intensity units equals r1r2x1x2\frac{r_1}{r_2} \frac{x_1}{x_2}

For any units of luminous intensity x1x_1 and x2x_2, and any positive real numbers r1,r2>0r_1, r_2 > 0, the ratio of the scaled units is given by scale(r1,x1)scale(r2,x2)=r1r2x1x2\frac{\text{scale}(r_1, x_1)}{\text{scale}(r_2, x_2)} = \frac{r_1}{r_2} \cdot \frac{x_1}{x_2} where scale(r,x)\text{scale}(r, x) denotes the unit xx scaled by the factor rr, and the division of units results in a value in the non-negative real numbers R0\mathbb{R}_{\ge 0}.

theorem

scale(r1,scale(r2,x))=scale(r1r2,x)\text{scale}(r_1, \text{scale}(r_2, x)) = \text{scale}(r_1 r_2, x) for Luminous Intensity Units

Let xx be a unit of luminous intensity. For any positive real numbers r1,r2Rr_1, r_2 \in \mathbb{R}, scaling the unit xx by r2r_2 and then scaling the resulting unit by r1r_1 is equivalent to scaling the original unit xx by the product r1r2r_1 r_2. That is, scale(r1,scale(r2,x))=scale(r1r2,x). \text{scale}(r_1, \text{scale}(r_2, x)) = \text{scale}(r_1 r_2, x).