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 #
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.
- interval_union : ∀ (a b c : ℝ), Integrable.integral f a c = Integrable.integral f a b + Integrable.integral f b c
Instances
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.
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.
Equations
- SmoothFunction.derivative f x = (f.jet x).derivative
Instances For
The value of a smooth function, i.e., the value of the one-jet at a point.
Equations
- SmoothFunction.value f x = (f.jet x).value
Instances For
Integrable functions can be obtained from smooth functions via the fundamental theorem of calculus.
Equations
- fundThm f = { integral := fun (a b : ℝ) => SmoothFunction.value f b - SmoothFunction.value f a, interval_union := ⋯ }
Constructions of smooth functions #
To use the above we need to construct a few smooth functions
Constant functions as smooth functions.
Equations
- SmoothFunction.constant c = { jet := fun (x : ℝ) => { value := c, derivative := 0 } }
Instances For
Sum of smooth functions.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Product of smooth functions using Liebnitz rule.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Product of a scalar and a smooth function.
Equations
- SmoothFunction.scalarProd c f = { jet := fun (x : ℝ) => { value := c * SmoothFunction.value f x, derivative := c * SmoothFunction.derivative f x } }
Instances For
Addition operation on smooth functions
Equations
Multiplication operation on smooth functions
Equations
Scalar multiplication for smooth functions
Equations
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
Equations
- SmoothFunction.x = { jet := fun (x : ℝ) => { value := x, derivative := 1 } }
Instances For
The power function for a smooth function (automatic if ring is proved)
Equations
- SmoothFunction.pow f 0 = SmoothFunction.constant 1
- SmoothFunction.pow f (Nat.succ n) = f * SmoothFunction.pow f n
Instances For
Equations
Equations
A polynomial. We can have cleaner notation but the goal is to illustrate the construction