|
1 | 1 | import OpenGALib.Riemannian.Metric.RiemannianMetric |
| 2 | +import OpenGALib.Riemannian.Util.MetricNotation |
2 | 3 | import OpenGALib.Util.Attributes |
3 | 4 |
|
4 | 5 | /-! |
@@ -299,63 +300,9 @@ end Smoothness |
299 | 300 |
|
300 | 301 | end MetricAPI |
301 | 302 |
|
302 | | -/-! ## Polymorphic inner-product and squared-norm notation |
303 | | -
|
304 | | -`⟪·, ·⟫_g` and `‖·‖²_g` dispatch through the `MetricInnerHom` and |
305 | | -`MetricNormSq` typeclasses so the same notation works on tangent |
306 | | -vectors (yielding `ℝ`) and on sections / vector fields (yielding |
307 | | -`M → ℝ`). |
308 | | -
|
309 | | -Reference: do Carmo 1992 §1.2 (inner product). -/ |
310 | | - |
311 | | -/-- **Eng.** Polymorphic squared norm typeclass dispatch. -/ |
312 | | -class MetricNormSq (V : Type*) (R : outParam Type*) where |
313 | | - /-- The squared norm `‖·‖²_g`. -/ |
314 | | - normSqG : V → R |
315 | | - |
316 | | -/-- **Eng.** Polymorphic inner product typeclass dispatch. -/ |
317 | | -class MetricInnerHom (V W : Type*) (R : outParam Type*) where |
318 | | - /-- The inner product `⟪·, ·⟫_g`. -/ |
319 | | - innerG : V → W → R |
320 | | - |
321 | | -section MetricNotationInstances |
322 | | - |
323 | | -variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] |
324 | | - {H : Type*} [TopologicalSpace H] {I : ModelWithCorners ℝ E H} |
325 | | - {M : Type*} [TopologicalSpace M] [ChartedSpace H M] [IsManifold I ∞ M] |
326 | | - [HasMetric I M] |
327 | | - |
328 | | -/-- **Math.** Pointwise tangent-vector squared norm $\|V\|^2_g$. -/ |
329 | | -noncomputable instance instMetricNormSqTangent (x : M) : |
330 | | - MetricNormSq (TangentSpace I x) ℝ where |
331 | | - normSqG v := metricInner x v v |
332 | | - |
333 | | -/-- **Math.** Section-level squared norm: vector field `V` ↦ scalar function |
334 | | -`y ↦ ⟨V(y), V(y)⟩_g`. -/ |
335 | | -noncomputable instance instMetricNormSqSection : |
336 | | - MetricNormSq ((y : M) → TangentSpace I y) (M → ℝ) where |
337 | | - normSqG V := fun y => metricInner y (V y) (V y) |
338 | | - |
339 | | -/-- **Math.** Pointwise tangent-vector inner product $\langle V, W\rangle_g$. -/ |
340 | | -noncomputable instance instMetricInnerHomTangent (x : M) : |
341 | | - MetricInnerHom (TangentSpace I x) (TangentSpace I x) ℝ where |
342 | | - innerG v w := metricInner x v w |
343 | | - |
344 | | -/-- **Math.** Section-level inner product: pair of vector fields ↦ scalar function |
345 | | -`y ↦ ⟨V(y), W(y)⟩_g`. -/ |
346 | | -noncomputable instance instMetricInnerHomSection : |
347 | | - MetricInnerHom ((y : M) → TangentSpace I y) ((y : M) → TangentSpace I y) |
348 | | - (M → ℝ) where |
349 | | - innerG V W := fun y => metricInner y (V y) (W y) |
350 | | - |
351 | | -end MetricNotationInstances |
352 | | - |
353 | | -/-- **Math.** Notation `⟪V, W⟫_g` for the metric inner product. Pointwise on tangent vectors → `ℝ`; |
354 | | -on two sections → `M → ℝ`. -/ |
355 | | -scoped notation:max "⟪" V ", " W "⟫_g" => MetricInnerHom.innerG V W |
356 | | - |
357 | | -/-- **Math.** Notation `‖V‖²_g` for the squared norm. Pointwise on a tangent vector → `ℝ`; |
358 | | -on a section → `M → ℝ`. -/ |
359 | | -scoped notation:max "‖" V "‖²_g" => MetricNormSq.normSqG V |
| 303 | +-- Polymorphic notation `⟪·, ·⟫_g` and `‖·‖²_g` (and the dispatch classes |
| 304 | +-- `MetricInnerHom`, `MetricNormSq`) live in |
| 305 | +-- `OpenGALib/Riemannian/Util/MetricNotation.lean`; the import below |
| 306 | +-- pulls them into scope for every consumer of `SmoothManifold`. |
360 | 307 |
|
361 | 308 | end Riemannian |
0 commit comments