Documentation

LeanUnits.Framework.Dimensions.Basic

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
    theorem Units.Dimension.ext {x y : Dimension} (_impl : x._impl = y._impl) :
    x = y
    def Units.instDecidableEqDimension.decEq (x✝ x✝¹ : Dimension) :
    Decidable (x✝ = x✝¹)
    Equations
    Instances For
      Equations
      Instances For

        A typeclass for types that have an associated dimension.

        Instances
          def Units.𝒟 {μ : Type} [self : HasDimension μ] (u : μ) :

          Alias of Units.HasDimension.dimension.

          Equations
          Instances For

            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.

            Equations
            Instances For

              The dimension with no fundamental dimensions, representing a dimensionless quantity.

              Equations
              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
                Instances For
                  Equations
                  Instances For
                    Equations
                    Instances For

                      A dimension is a single dimension if it corresponds to a single fundamental dimension, represented by a string identifier and a rational exponent.

                      Equations
                      Instances For
                        noncomputable def Units.Dimension.IsBase.name {d : Dimension} (h : d.IsBase) :

                        Non computable function to extract the name of the base dimension.

                        Equations
                        Instances For
                          Equations
                          Instances For

                            The specification that the name corresponds to the base dimension.

                            The specification that the name and exponent correspond to the base dimension.

                            noncomputable def Units.Dimension.IsSingle.name {d : Dimension} (h : d.IsSingle) :

                            Non computable function to extract the name and exponent of the single dimension.

                            ie: dimensions like Length^2 or Time^-1

                            Equations
                            Instances For
                              noncomputable def Units.Dimension.IsSingle.exponent {d : Dimension} (h : d.IsSingle) :

                              Non computable function to extract the exponent of the single dimension.

                              ie: dimensions like Length^2 or Time^-1

                              Equations
                              Instances For

                                The specification that the name and exponent correspond to the single dimension.

                                Equations
                                Instances For
                                  Equations
                                  • One or more equations did not get rendered due to their size.
                                  Equations
                                  Equations
                                  noncomputable def Units.Dimension.OneScale :
                                  Equations
                                  Instances For
                                    Equations
                                    • One or more equations did not get rendered due to their size.