PhysLean Documentation

PhysLean.Thermodynamics.Temperature.Basic

Temperature #

In this module we define the type Temperature, corresponding to the temperature in a given (but arbitrary) set of units which have absolute zero at zero.

This is the version of temperature most often used in undergraduate and non-mathematical physics.

The choice of units can be made on a case-by-case basis, as long as they are done consistently.

structure Temperature :

The type Temperature represents the temperature in a given (but arbitrary) set of units (preserving zero). It currently wraps ℝ≥0, i.e., absolute temperature in nonnegative reals.

  • val : NNReal

    The nonnegative real value of the temperature.

Instances For

    Coercion to ℝ≥0.

    Equations
    noncomputable def Temperature.toReal (T : Temperature) :

    The underlying real-number associated with the temperature.

    Equations
    Instances For
      noncomputable instance Temperature.instCoeReal :

      Coercion to .

      Equations
      theorem Temperature.ext {T₁ T₂ : Temperature} (h : T₁.val = T₂.val) :
      T₁ = T₂
      theorem Temperature.ext_iff {T₁ T₂ : Temperature} :
      T₁ = T₂ T₁.val = T₂.val
      noncomputable def Temperature.β (T : Temperature) :

      The inverse temperature defined as 1/(kB * T) in a given, but arbitrary set of units. This has dimensions equivalent to Energy.

      Equations
      Instances For
        noncomputable def Temperature.ofβ (β : NNReal) :

        The temperature associated with a given inverse temperature β.

        Equations
        Instances For
          theorem Temperature.ofβ_eq :
          ofβ = fun (β : NNReal) => { val := 1 / (Constants.kB * β), }
          @[simp]
          theorem Temperature.β_ofβ (β' : NNReal) :
          (ofβ β').β = β'
          @[simp]
          theorem Temperature.beta_pos (T : Temperature) (hT_pos : 0 < T.val) :
          0 < T.β

          Positivity of β from positivity of temperature.

          Regularity of ofβ #

          Convergence #

          Eventually, ofβ β is positive as β → ∞`.

          Core convergence: as β → ∞, toReal (ofβ β) → 0 in .

          As β → ∞, T = ofβ β → 0+ in ℝ (within Ioi 0).

          Conversion to and from ℝ≥0 #

          Build a Temperature directly from a nonnegative real.

          Equations
          Instances For
            @[simp]
            @[simp]
            theorem Temperature.coe_ofNNReal_real (t : NNReal) :
            { val := t }.toReal = t
            noncomputable def Temperature.ofRealNonneg (t : ) (ht : 0 t) :

            Convenience: build a temperature from a real together with a proof of nonnegativity.

            Equations
            Instances For
              @[simp]
              theorem Temperature.ofRealNonneg_val {t : } (ht : 0 t) :
              (ofRealNonneg t ht).val = t, ht

              Calculus relating T and β #

              noncomputable def Temperature.betaFromReal (t : ) :

              Map a real t to the inverse temperature β corresponding to the temperature Real.toNNReal t (max t 0), returned as a real number.

              Equations
              Instances For
                theorem Temperature.beta_fun_T_formula (t : ) (ht : 0 < t) :

                Explicit closed-form for Beta_fun_T t when t > 0.

                On Ioi 0, Beta_fun_T t equals 1 / (kB * t).

                theorem Temperature.chain_rule_T_beta {F : } {F' : } (T : Temperature) (hT_pos : 0 < T.val) (hF_deriv : HasDerivWithinAt F F' (Set.Ioi 0) T.β) :
                HasDerivWithinAt (fun (t : ) => F (betaFromReal t)) (F' * (-1 / (Constants.kB * T.val ^ 2))) (Set.Ioi 0) T.val

                Chain rule for β(T) : d/dT F(β(T)) = F'(β(T)) * (-1 / (kB * T^2)), within Ioi 0.