Physlib.SpaceAndTime.Space.Basic
Space
In this module, we define the the type `Space d` which corresponds to `d`-dimensional flat Euclidean space and prove some properties about it.
The scope of this module is to define on `Space d` basic instances related translations and the metric. We do not here define the structure of a `Module` on `Space d`, as this is done in `Physlib.SpaceAndTime.Space.Module`.
Physlib sits downstream of Mathlib, and above we import the necessary Mathlib modules which contain (perhaps transitively through imports) the definitions and theorems we need.
Implementation details
The exact implementation of `Space d` into Physlib is discussed in numerous places on the Lean Zulip, including:
- https://leanprover.zulipchat.com/#narrow/channel/479953-Physlib/topic/Space.20vs.20EuclideanSpace/with/575332888
There is a choice between defining `Space d` as an `abbrev` of `EuclideanSpace ℝ (Fin d)`, as a `def` of a type with value `EuclideanSpace ℝ (Fin d)` or as a structure with a field `val : Fin d → ℝ` :
+---------------------------------------------------+---------+-------+-----------+ | | abbrev | def | structure | +---------------------------------------------------+---------+-------+-----------+ | allows casting from `EuclideanSpace` | yes | yes | no | | carries instances from `EuclideanSpace` | yes | no | no | | requires reproving of lemmas from `EuclideanSpace`| no | yes | yes | +---------------------------------------------------+---------+-------+-----------+
The `structure` is the most conservative choice, as everything needs redefining. However, there is are two benefits of using it:
1. It allows us to be precise about the instances we define on `Space d`, and makes future refactoring of those instances easier. 2. It allows us to give the necessary physics context to results about `Space d`, which would not otherwise be possible if we reuse results from Mathlib.
In this module we give `Space d` the instances of a `NormedAddTorsor` and a `MetricSpace`. These physically correspond to the statement that you can add a vector to a point in space, and that there is a notion of distance between points in space. This notion of distance corresponds to a choice of length unit.
In `Physlib.SpaceAndTime.Space.Module` we give `Space d` the structure of a `Module` (aka vector space), a `Norm` and an `InnerProductSpace`. These require certain choices, for example the choice of a zero in `Space d`.
This module structure is necessary in numerous places. For example, the normal derivatives used by physicists `∂_x, ∂_y, ∂_z` require a module structure.
Because of this, one should be careful to avoid using the explicit zero in `Space d`, or adding two `Space d` values together. Where possible one should use the `VAdd (EuclideanSpace ℝ (Fin d)) (Space d)` instance instead.
A. The `Space` type
B. Instances on `Space`
B.1. Instance of coercion to functions
B.2. The Non-emptiness
B.3.1. The additive action
B.3.2. Subtraction
B.3.3. AddTorsor instance
B.4. PseudoMetricSpace
B.5. NormAddTorsor instance
B.6. Metric space instance
B.7. Non-trivality
C. Model structure (i.e. structure of a manifold)
23 declarations
For any dimension , let and be points in the -dimensional flat Euclidean space . Let and denote their underlying coordinate representations (of type ). Then, the two points are equal if and only if their coordinate representations are equal, that is, .
Function coercion for to
For any dimension , an element of the -dimensional flat Euclidean space can be treated as a function mapping an index to a real number . This coercion allows a point in space to be evaluated at a specific coordinate index to retrieve its value.
is non-empty
For any dimension , the -dimensional flat Euclidean space is non-empty.
is a subsingleton
The -dimensional flat Euclidean space is a subsingleton. That is, for any two points , it holds that .
Additive action of on
This instance defines the additive action of the Euclidean vector space (modeled as `EuclideanSpace ℝ (Fin d)`) on the -dimensional flat Euclidean space . For a vector and a point , the translation results in a point whose coordinates are the sum of the components of and the coordinates of , specifically for each index .
Coordinate Components of Translation in :
In -dimensional flat Euclidean space (), let be a vector in (modeled as `EuclideanSpace ℝ (Fin d)`) and be a point in . The coordinate representation of the point , which is the result of translating by , is the component-wise sum of the coordinates of and . That is, for every index , .
in
In a -dimensional flat Euclidean space (), let be a vector in (represented by `EuclideanSpace ℝ (Fin d)`) and be a point in . For any coordinate index , the -th component of the point resulting from the translation of by (denoted ) is equal to the sum of the -th component of and the -th component of . That is, .
Transitivity of translation in :
In -dimensional flat Euclidean space (), for any two points , there exists a vector in the Euclidean vector space (represented by `EuclideanSpace ℝ (Fin d)`) such that translating by results in , denoted by .
Additive action of on
This instance defines the additive action of the -dimensional Euclidean vector space (represented by `EuclideanSpace ℝ (Fin d)`) on the flat Euclidean space . This action represents translation, ensuring that for any point and any vectors , the following axioms of an additive group action are satisfied: 1. The zero vector acts as the identity: . 2. The action is compatible with vector addition: .
Vector subtraction in -dimensional space
For a -dimensional flat Euclidean space , this definition provides the vector subtraction (displacement) operation (represented by the `VSub` typeclass). Given two points , the result is a displacement vector in the Euclidean space (specifically `EuclideanSpace ℝ (Fin d)` with the norm) whose components are defined by for each coordinate index .
in -dimensional space
In the -dimensional flat Euclidean space , for any two points and any coordinate index , the -th component of the displacement vector is equal to the difference between the -th coordinates of and : Here, the subtraction (provided by the `VSub` instance) represents the vector in pointing from to .
is an affine space modeled on
The -dimensional flat Euclidean space is an additive torsor (or affine space) modeled on the Euclidean vector space (specifically `EuclideanSpace ℝ (Fin d)`). This structure provides a free and transitive additive action of vectors in on points in , representing translations. It ensures that for any points and any vector , the following identities hold: 1. 2. where denotes the translation of a point by a vector and denotes the displacement vector between two points.
Distance on
For any two points in the -dimensional flat Euclidean space , the distance function is defined as the Euclidean distance: where and denote the -th coordinates of the points and respectively.
in
For any two points and in the -dimensional flat Euclidean space , the distance between them is given by the square root of the sum of the squared differences of their coordinates: where and denote the -th coordinates of the points and respectively, and the sum ranges over all indices .
Pseudo-metric space structure on
The -dimensional flat Euclidean space is equipped with a pseudo-metric space structure. The distance between any two points is defined by the Euclidean metric: This structure satisfies the axioms of a pseudo-metric space, including the property that , symmetry , and the triangle inequality .
is a normed affine space modeled on
The -dimensional flat Euclidean space is a normed additive torsor (or normed affine space) modeled on the Euclidean vector space (specifically `EuclideanSpace ℝ (Fin d)`). This structure identifies the distance between any two points with the Euclidean norm of their displacement vector : where denotes the standard Euclidean norm .
Metric space structure on
The -dimensional flat Euclidean space is equipped with a metric space structure. This structure defines a distance function for any two points using the standard Euclidean metric: As a metric space, it satisfies the identity of indiscernibles, meaning that if and only if , in addition to the properties of a pseudo-metric space (symmetry and the triangle inequality).
is Nontrivial
For any natural number , the -dimensional flat Euclidean space is nontrivial, meaning it contains at least two distinct points.
Manifold structure on
The manifold structure on the -dimensional flat Euclidean space is established by modeling it on the Euclidean vector space . This structure is defined via a global coordinate chart that identifies the affine space with by choosing an arbitrary origin and mapping each point to the displacement vector .
The composition of the manifold structure map and its inverse on is the identity function
For any natural number , let be the map defining the manifold structure on the -dimensional flat Euclidean space , which identifies it with the model space . The composition of and its inverse is the identity function on , i.e., .
for the manifold structure of
Let be the manifold structure map (the global coordinate chart) that identifies the -dimensional flat Euclidean space with the Euclidean vector space . For any vector , applying the map to the image of under the inverse mapping returns the original vector :
The range of the manifold structure map on is
Let be the map defining the manifold structure on the -dimensional flat Euclidean space , which identifies it with the Euclidean model space . The range of is the entire model space :
The coordinate chart of is
For any natural number , the map that defines the manifold structure on the -dimensional flat Euclidean space is infinitely differentiable, i.e., it is of class . This map corresponds to the global coordinate chart that identifies points in the space with their coordinates in the model Euclidean vector space .
