Physlib.Units.PositiveRealUnit
A. Shared arithmetic for positive-real unit types
`PositiveRealUnitCore` records a unit magnitude and its inverse construction. Each concrete unit declares this instance explicitly and keeps its own structure. The inhabited and same-type division instances, rescaling operation, and arithmetic laws are provided generically. No command or type-specific lemma wrappers are needed.
The arithmetic is adapted from the existing unit modules by Joseph Tooby-Smith. This interface describes an individual unit type, independently of the selection and combination of units by `UnitMagnitudeCatalog` and `UnitSystem`.
A.1. Representation and instances
A.2. Unit ratios
A.3. Positive rescaling
19 declarations
Default unit has magnitude
For a unit type equipped with the `PositiveRealUnitCore` structure, this instance provides a default element by defining it as the unit whose magnitude is .
The magnitude of a unit is non-zero.
For any unit of type , its magnitude is non-zero.
Ratio of unit magnitudes
For two units and of the same type , the ratio is defined as the quotient of their magnitudes , returning a non-negative real number in .
Unit division as a ratio of magnitudes
For two units and of the same type , the division operation is defined as the ratio of their magnitudes , resulting in a non-negative real number in .
for units
For any two units and belonging to a unit type defined under `PositiveRealUnitCore`, the result of the division is equal to the ratio of their magnitudes , represented as a non-negative real number in .
The ratio of two units is strictly positive ()
For any two units and of a positive real unit type , the ratio is strictly greater than in the set of non-negative real numbers .
The ratio for units in
For any two units and belonging to a positive real unit type , the ratio is not equal to in the set of non-negative real numbers .
for any unit
For any unit of type , the ratio of the unit with itself is equal to the non-negative real number , i.e., .
for Unit Ratios
For any two units and of the same unit type , the ratio of their magnitudes is equal to the multiplicative inverse of the ratio in the non-negative real numbers , such that .
for unit ratios
For any units and of the same positive-real unit type , the product of the ratio of to and the ratio of to is equal to the ratio of to in the non-negative real numbers . That is: where denotes the ratio of the magnitudes of units and .
for unit ratios in
Let be a positive-real unit type. For any units , the product of the ratio of to and the ratio of to is equal to the ratio of to , where these ratios are treated as real numbers:
Let be a positive-real unit type. For any unit , any real number , and a proof that , the numerical magnitude of the rescaled unit is given by the product of the scalar and the original magnitude: .
for units
Let be a positive-real unit type. For any two units , if their numerical magnitudes are equal, denoted by , then the units themselves are equal, .
for units
Let be a positive-real unit type. For any unit and any real number , the ratio of the rescaled unit to the original unit is equal to the scaling factor , expressed as . Here, the division of units of the same type results in a non-negative real number in .
For any unit of a positive-real unit type and any positive real number , the ratio of the unit to the unit rescaled by is equal to the reciprocal of the scaling factor, i.e., . Here, the division represents the ratio of the magnitudes of the units in the non-negative real numbers .
Scaling a unit by 1 is the identity operation ()
For any unit of type within the `PositiveRealUnitCore` framework, scaling by the real number leaves the unit unchanged, i.e., .
For any units of type and any positive real numbers , rescaling these units by the factors and respectively results in a ratio equal to the ratio of the factors multiplied by the ratio of the original units: where denotes the ratio of the magnitudes of the units.
For any unit magnitude and any positive real numbers , successive rescalings compose by multiplication of their factors. Specifically, scaling the unit by and then scaling the resulting unit by is equivalent to scaling the original unit by the product , denoted as .
For any two units and of the same type , if the ratio is a positive real number, then scaling the unit by the factor results in the unit . In mathematical terms, this is expressed as .
