PhysLean Documentation

PhysLean.Units.Examples

Examples of units in PhysLean #

In this module we give some examples of how to use the units system in PhysLean. This module should not be imported into any other module, and the results here should not be used in the proofs of any other results other then those in this file.

Defining a length dependent on units #

The length corresponding to 400 meters.

Equations
Instances For

    Proving propositions are dimensionally correct #

    Cases with only WithDim #

    An example of dimensions corresponding to s = d/t using WithDim.

    Equations
    Instances For

      An example of dimensions corresponding to E = m c using WithDim with .val, which is not dimensionally correct.

      Equations
      Instances For

        Cases with Dimensionful #

        The equation E = m c^2, in this equation we E and m are implicitly in the units u, while the speed of light is explicitly written in those units.

        Equations
        Instances For

          The equation E = m c^2, in this version everything is written explicitly in terms of a choice of units.

          Equations
          Instances For

            The lemma that the proposition EnergyMass is dimensionally correct

            Examples of using isDimensionallyCorrect #

            We now explore the consequences of energyMass_isDimensionallyCorrect and how we can use it.

            theorem UnitExamples.example1_energyMass :
            EnergyMass { val := 2 } { val := 2 * 299792458 ^ 2 } UnitChoices.SI

            ## Examples with other functions

            An example of a dimensionafully correct result using functions.

            Equations
            Instances For

              ## An example involving derivatives