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
PhysLean.SpaceAndTime.Space.Module.
PhysLean 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 PhysLean is discussed in numerous places
on the Lean Zulip, including:
- https://leanprover.zulipchat.com/#narrow/channel/479953-PhysLean/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:
- It allows us to be precise about the instances we define on
Space d, and makes future refactoring of those instances easier. - 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 PhysLean.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.
B.1. Instance of coercion to functions #
B.2. The Non-emptiness #
B.3.1. The additive action #
Equations
- Space.instAddActionEuclideanSpaceRealFin = { toVAdd := Space.instVAddEuclideanSpaceRealFin, add_vadd := ⋯, zero_vadd := ⋯ }
B.3.2. Subtraction #
Equations
- Space.instVSubEuclideanSpaceRealFin = { vsub := fun (s1 s2 : Space d) => WithLp.toLp 2 fun (i : Fin d) => s1.val i - s2.val i }
B.3.3. AddTorsor instance #
Equations
- One or more equations did not get rendered due to their size.
B.4. PseudoMetricSpace #
Equations
- One or more equations did not get rendered due to their size.
B.5. NormAddTorsor instance #
Equations
- Space.instNormedAddTorsorEuclideanSpaceRealFin = { toAddTorsor := Space.instAddTorsorEuclideanSpaceRealFin, dist_eq_norm' := ⋯ }
B.6. Metric space instance #
Equations
- Space.instMetricSpace = { toPseudoMetricSpace := Space.instPseudoMetricSpace, eq_of_dist_eq_zero := ⋯ }
B.7. Non-trivality #
C. Model structure (i.e. structure of a manifold) #
The manifold structure on Space d.
Equations
- One or more equations did not get rendered due to their size.