Formal Calculus #

We introduce formal structures for integration and differentiation. Properties should be added to make these mathematically sound. But correctness can be ensured temporarily by making sure individual definitions are correct.

Formal Integrals #

class Integrable (f : ) :

Integrability of f, i.e., given an interval [a, b], we can compute the integral of f over that interval. Additivity over intervals is also required.

    def integral (f : ) [int : Integrable f] (a : ) (b : ) :

    The integral of a function, with the typeclass derived

    Instances For
      theorem integral_point (f : ) [int : Integrable f] (a : ) :
      integral f a a = 0

      The integral over a single point is zero, proved as an illustration.

      As an exercise, prove that flip ends of an interval gives the negative of the integral.

      Formal Derivatives #

      We define so called one-jets as a value and a derivative at a point. A differentiable function has values a one-jet at each point.

      structure OneJet :

      A one-jet is a value and a derivative at a point.

      Instances For
        structure SmoothFunction :

        A differentiable function is a function that has a one-jet at each point.

        Instances For

          Derivative of a smooth function, i.e., the derivative of the one-jet at a point.

          Instances For

            The value of a smooth function, i.e., the value of the one-jet at a point.

            Instances For

              Integrable functions can be obtained from smooth functions via the fundamental theorem of calculus.

              Constructions of smooth functions #

              To use the above we need to construct a few smooth functions

              Constant functions as smooth functions.

              Instances For

                Sum of smooth functions.

                Instances For

                  Product of smooth functions using Liebnitz rule.

                  Instances For

                    Product of a scalar and a smooth function.

                    Instances For

                      Addition operation on smooth functions

                      Multiplication operation on smooth functions

                      Scalar multiplication for smooth functions

                      This gives polynomial functions as a special case. As an exercise, prove that smooth functions form a Ring (indeed an Algebra over ℝ).

                      We will define some polynomials as smooth functions as an example.

                      The coordinate function

                      Instances For

                        The power function for a smooth function (automatic if ring is proved)

                        Instances For

                          A polynomial. We can have cleaner notation but the goal is to illustrate the construction

                          Instances For