A dimension is a product of base dimensions raised to rational powers.
For example, the dimension of force in the SI system is Mass•Length•Time⁻²
can be represented as :
force = {"Mass" ↦ 1, "Length" ↦ 1, "Time" ↦ -2}you build it by combining base dimensions using multiplication and division.- To build a base dimension, use the helper macro
def_base_dimension Length := "L" - To build a derived dimension, use multiplication
*, division/and exponentiation^.
For example, the dimension of Area can be built using the helper macro:
def_derived_dimension Area := Length^2
Note that using macros is encouraged to ensure correct simplification of dimensions when casting.
Instances For
Equations
- Units.instBEqDimension.beq { _impl := a } { _impl := b } = (a == b)
- Units.instBEqDimension.beq x✝¹ x✝ = false
Instances For
Equations
Create a dimension from a string identifier. Each unique string represents a different fundamental dimension. For example, "L" for Length, "M" for Mass, "T" for Time, etc.
Instances For
The dimension with no fundamental dimensions, representing a dimensionless quantity.
Equations
- Units.Dimension.dimensionless = { _impl := 0 }
Instances For
A dimension is a base dimension if it corresponds to a single fundamental dimension, represented by a string identifier and has an exponent of 1.
Equations
- d.IsBase = ∃ (s : String), d = Units.Dimension.ofString s
Instances For
Equations
Instances For
Non computable function to extract the name of the base dimension.
Equations
- h.name = Classical.choose h
Instances For
Non computable function to extract the name and exponent of the single dimension.
ie: dimensions like Length^2 or Time^-1
Equations
- h.name = Classical.choose h
Instances For
Non computable function to extract the exponent of the single dimension.
ie: dimensions like Length^2 or Time^-1
Equations
Instances For
Equations
- Units.Dimension.DecidableNEqZero α = ((x : α) → Decidable (x ≠ 0))
Instances For
Equations
- Units.Dimension.instMulAction = { toSMul := Units.Dimension.instSMul, one_smul := Units.Dimension.instMulAction._proof_1, mul_smul := Units.Dimension.instMulAction._proof_2 }
Equations
- Units.Dimension.instSMulWithZero = { toSMul := Units.Dimension.instSMul, smul_zero := Units.Dimension.instSMulWithZero._proof_1, zero_smul := Units.Dimension.instSMulWithZero._proof_2 }
Equations
- One or more equations did not get rendered due to their size.
Equations
- Units.Dimension.instHasDimension = { dimension := fun (u : Units.Dimension) => u }
Equations
- Units.Dimension.instSetoidUnit = { r := fun (x1 x2 : Units.Dimension) => x1 = x2, iseqv := Units.Dimension.instSetoidUnit._proof_1 }
Equations
Equations
- Units.Dimension.instOne = { one := 0 }
Equations
- Units.Dimension.instMul = { mul := fun (u1 u2 : Units.Dimension) => u1 + u2 }
Equations
- Units.Dimension.instInv = { inv := fun (u : Units.Dimension) => -u }
Equations
- Units.Dimension.instDiv = { div := fun (u1 u2 : Units.Dimension) => u1 - u2 }
Equations
- Units.Dimension.instPowNat = { pow := fun (u : Units.Dimension) (q : ℕ) => q • u }
Equations
- Units.Dimension.instPowInt = { pow := fun (u : Units.Dimension) (n : ℤ) => n • u }
Equations
- Units.Dimension.instPowRat = { pow := fun (u : Units.Dimension) (n : ℚ) => n • u }
Equations
Instances For
Equations
- One or more equations did not get rendered due to their size.
Equations
- Units.Dimension.instToString = { toString := fun (d : Units.Dimension) => reprStr d }