Skip to content

Commit 2dfd8cb

Browse files
committed
refactor(riemannian): consolidate operator simp utilities
Implements issue #6 by merging the connection-Laplacian and divergence simp modules into Util/Simp/OperatorSimp.lean. CovDerivBridges.lean is intentionally kept as a separate post-LeviCivita bridge module because moving those lemmas into CovDerivSmoothness.lean would introduce an import cycle: CovDerivSmoothness is imported by LeviCivita, while the bridge lemmas depend on LeviCivita definitions.
1 parent 666268d commit 2dfd8cb

7 files changed

Lines changed: 61 additions & 121 deletions

File tree

OpenGALib/Riemannian.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import OpenGALib.Riemannian.TensorBundle.BundleSectionContinuity
1313
import OpenGALib.Riemannian.Util.Chart.ChartJacobianCLM
1414
import OpenGALib.Riemannian.Util.Chart.ChartJacobianEntries
1515
import OpenGALib.Riemannian.Util.CovDeriv.CovDerivBridges
16-
import OpenGALib.Riemannian.Util.Simp.DivergenceSimp
16+
import OpenGALib.Riemannian.Util.Simp.OperatorSimp
1717
import OpenGALib.Riemannian.Util.Metric.MetricInnerSmoothness
1818
import OpenGALib.Riemannian.TensorBundle.Defs
1919
import OpenGALib.Riemannian.TangentBundle.TangentSmooth

OpenGALib/Riemannian/Operators/Bochner/PerSummand.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import OpenGALib.Riemannian.Operators.Bochner.HessianExpansion
22
import OpenGALib.Riemannian.Operators.Bochner.BochnerExpansion
33
import OpenGALib.Riemannian.Operators.ConnectionLaplacian
4-
import OpenGALib.Riemannian.Util.Simp.ConnectionLaplacianSimp
4+
import OpenGALib.Riemannian.Util.Simp.OperatorSimp
55
import OpenGALib.Util.MFDeriv
66
import OpenGALib.Riemannian.Util.Metric.MetricInnerSmoothness
77
import OpenGALib.Riemannian.Util.CovDeriv.CovDerivBridges
Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
# `Util/CovDeriv/`
1+
# CovDeriv
22

3-
Covariant-derivative smoothness and bridge modules.
3+
Covariant-derivative utilities are split by import direction.
4+
`CovDerivSmoothness.lean` is pre-`LeviCivita` scaffolding used to construct the
5+
connection. `CovDerivBridges.lean` is post-`LeviCivita` simp glue for
6+
`covDeriv` and `covDerivAt`, kept separate to avoid an import cycle.
47

5-
| File | Role |
6-
|------|------|
7-
| [`CovDerivSmoothness.lean`](./CovDerivSmoothness.lean) | Tensoriality and smoothness machinery for `koszulCovDeriv`. |
8-
| [`CovDerivBridges.lean`](./CovDerivBridges.lean) | `covDeriv` / `covDerivAt` simp bridge lemmas. |
Lines changed: 33 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,38 @@
11
# `Riemannian/Util/` — engineering tax for the Riemannian layer
22

3-
Per OpenGA's anchor-purity discipline (CLAUDE.md §"Engineering tax encapsulation"),
4-
anchor files expose only `**Math.**`-tagged declarations; all `**Eng.**` and
5-
`**Mixed.**` plumbing supporting those proofs lives here. Files inside `Util/`
6-
are content-named — the folder name carries the `Util` role; individual files
7-
describe their concrete content. No `Helpers` / `Base` / `Foundation` suffixes.
8-
9-
## Files, grouped by theme
10-
11-
### Chart Jacobian (smoothness of chart-frame derivatives)
12-
13-
| File | Role |
14-
|------|------|
15-
| [`Chart/ChartJacobianCLM.lean`](./Chart/ChartJacobianCLM.lean) | **Smoothness of chart-Jacobian CLM-valued functions**: CLM-valued composites (e.g. `(triv α).symmL ℝ b`, `(triv α).continuousLinearMapAt ℝ b`) in `inTangentCoordinates` form. CLM-level operators. |
16-
| [`Chart/ChartJacobianEntries.lean`](./Chart/ChartJacobianEntries.lean) | **Smoothness of chart-Jacobian matrix entries**: scalar-valued entries obtained by composing the CLM with model-basis vectors and projections. Scalar-level. |
17-
| [`Chart/FlatChartDerivs.lean`](./Chart/FlatChartDerivs.lean) | **Tangent bundle — chart-derivative engineering**: `mfderiv` of chart maps under the flat (Euclidean-modeled) setup. |
18-
19-
### Tangent bundle / section glue
20-
21-
| File | Role |
22-
|------|------|
23-
| [`Tangent/TangentHelpers.lean`](./Tangent/TangentHelpers.lean) | **Tangent helpers — chart-bundle smoothness bridges**: general-purpose smoothness lemmas for chart-induced tangent-bundle constructions. |
24-
| [`Tangent/TangentSpaceInstances.lean`](./Tangent/TangentSpaceInstances.lean) | **Typeclass instances on `TangentSpace I x` and the tangent bundle**: `instFiniteDimensionalTangent` (def-eq lift of `FiniteDimensional ℝ E`); `instRiemannianBundleOfHasMetric` (activates Mathlib's scoped fibre instances when `[HasMetric I M]` is in scope). |
25-
| [`Tangent/TensorBundleCoercions.lean`](./Tangent/TensorBundleCoercions.lean) | **Riemannian (r,s)-tensor bundle — fiber-to-model coercion algebra**: coercion-level lemmas for `Tensor⟨r,s⟩` bundle. |
26-
| [`Tangent/MfderivApplySection.lean`](./Tangent/MfderivApplySection.lean) | **Smoothness of `mfderiv f` applied to a tangent-bundle section**: machinery for proving that `(mfderiv f x).comp (v x)` is smooth when `f, v` are. |
27-
28-
### Metric inner / Riesz / notation
29-
30-
| File | Role |
31-
|------|------|
32-
| [`Metric/MetricNotation.lean`](./Metric/MetricNotation.lean) | **Polymorphic metric notation `⟪·, ·⟫_g` and `‖·‖²_g`**: dispatches over tangent-vector vs. section forms via `MetricInnerHom` / `MetricNormSq` typeclasses, resolved through `[HasMetric I M]`. |
33-
| [`Metric/MetricInnerSmoothness.lean`](./Metric/MetricInnerSmoothness.lean) | **`metricInner` smoothness — pointwise / set / global variants**: `ContMDiffWithinAt` / `ContMDiff` / `MDifferentiable` parity siblings of the headline `metricInner_contMDiffWithinAt` in `Metric/RiemannianMetric.lean`. |
34-
| [`Metric/MetricRieszBilinForm.lean`](./Metric/MetricRieszBilinForm.lean) | **Bridge from `RiemannianMetric.inner` to `BilinearForm.Form ℝ E`**: `toBilinForm`, `toBilinForm_isPosDef`. Supports the Riesz duality methods in `Metric/RiemannianMetric.lean`. |
35-
| [`Metric/CotangentFunctional.lean`](./Metric/CotangentFunctional.lean) | **Half-Koszul cotangent functional**: bilinear-form construction in the Koszul formula. |
36-
37-
### Covariant derivative
38-
39-
| File | Role |
40-
|------|------|
41-
| [`CovDeriv/CovDerivBridges.lean`](./CovDeriv/CovDerivBridges.lean) | **`covDeriv` / `covDerivAt` simp bridges**: definitional unfolding lemmas. |
42-
| [`CovDeriv/CovDerivSmoothness.lean`](./CovDeriv/CovDerivSmoothness.lean) | **Tensoriality + smoothness machinery for `koszulCovDeriv`**: the proof-level workhorse behind Levi-Civita smoothness. |
43-
44-
### Operator simp lemmas
45-
46-
| File | Role |
47-
|------|------|
48-
| [`Simp/ConnectionLaplacianSimp.lean`](./Simp/ConnectionLaplacianSimp.lean) | **Connection Laplacian — simp def-unfold**: `@[simp]` lemmas exposing the definitional shape of `Δ_g` for use in `rw` and `simp` calls. |
49-
| [`Simp/DivergenceSimp.lean`](./Simp/DivergenceSimp.lean) | **Divergence — simp def-unfold**: same pattern for the manifold divergence operator. |
3+
Per OpenGA's anchor-purity discipline, anchor files expose only
4+
`**Math.**`-tagged declarations; `**Eng.**` and `**Mixed.**` plumbing lives
5+
under `Util/`. The files are grouped by the downstream layer they support.
6+
7+
## Directories
8+
9+
| Theme | Directory | Files |
10+
| --- | --- | --- |
11+
| Chart Jacobian | [`Chart/`](./Chart/) | `ChartJacobianCLM.lean`, `ChartJacobianEntries.lean`, `FlatChartDerivs.lean` |
12+
| Tangent / section glue | [`Tangent/`](./Tangent/) | `TangentHelpers.lean`, `TangentSpaceInstances.lean`, `TensorBundleCoercions.lean`, `MfderivApplySection.lean` |
13+
| Metric inner / Riesz / notation | [`Metric/`](./Metric/) | `MetricInnerSmoothness.lean`, `MetricNotation.lean`, `MetricRieszBilinForm.lean`, `CotangentFunctional.lean` |
14+
| Covariant derivative | [`CovDeriv/`](./CovDeriv/) | `CovDerivSmoothness.lean`, `CovDerivBridges.lean` |
15+
| Operator simp lemmas | [`Simp/`](./Simp/) | `OperatorSimp.lean` |
16+
17+
`ChartJacobianSmooth.lean` was renamed to `Chart/ChartJacobianCLM.lean`
18+
because it proves smoothness of continuous-linear-map-valued chart-Jacobian
19+
composites. `ChartJacobianSmoothness.lean` was renamed to
20+
`Chart/ChartJacobianEntries.lean` because it proves scalar matrix-entry
21+
smoothness.
22+
23+
`ConnectionLaplacianSimp.lean` and `DivergenceSimp.lean` were merged into
24+
`Simp/OperatorSimp.lean`. `CovDerivBridges.lean` remains a separate
25+
post-`LeviCivita` bridge file: it imports `Connection.LeviCivita`, while
26+
`Connection.LeviCivita` imports `CovDerivSmoothness.lean`; absorbing the bridge
27+
lemmas into `CovDerivSmoothness.lean` would create an import cycle.
5028

5129
## Conventions
5230

53-
* **Math/Eng/Mixed tag** — every declaration begins its docstring with one of
54-
`**Math.**`, `**Eng.**`, `**Mixed.**`. `Util/` files are predominantly
55-
`**Eng.**` (engineering plumbing) and `**Mixed.**` (math statement on top of
56-
engineering proof body); occasional `**Math.**` declarations are the math
57-
parity variants that match `Metric/`-anchor-headline statements at a
58-
different smoothness parameter.
59-
* **No `set_option linter.xxx false`** — linter regressions are fixed at the
60-
declaration level via `omit [...] in <decl>` or proper refactor, never by
61-
blanket disable.
62-
* **Anchor purity** — anchor files in sibling folders (`Connection/`,
63-
`Curvature/`, `Metric/`, `Operators/`, `Volume/`, `TensorBundle/`,
64-
`Instances/`, `Manifold/`) expose only `**Math.**`. Anything else lands
65-
here.
31+
* Every declaration docstring starts with `**Math.**`, `**Eng.**`, or
32+
`**Mixed.**`.
33+
* Util files may contain engineering declarations; sibling anchor folders keep
34+
the mathematical surface clean.
35+
* Subdirectory names carry the grouping role. File names describe concrete
36+
content and avoid generic `Helpers` / `Base` / `Foundation` suffixes except
37+
where the historical API name is retained.
38+

OpenGALib/Riemannian/Util/Simp/DivergenceSimp.lean

Lines changed: 0 additions & 41 deletions
This file was deleted.

OpenGALib/Riemannian/Util/Simp/ConnectionLaplacianSimp.lean renamed to OpenGALib/Riemannian/Util/Simp/OperatorSimp.lean

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
import OpenGALib.Riemannian.Operators.ConnectionLaplacian
2+
import OpenGALib.Riemannian.Operators.Divergence
23

34
/-!
4-
# Connection Laplacian — simp def-unfold
5+
# Operator simp def-unfolds
56
6-
Engineering simp lemma exposing the definition of `connectionLaplacian`
7-
as a sum of `secondCovDerivSection` over the smooth $g$-orthonormal
8-
frame. Imported by callers that need to rewrite at the level of the
9-
frame sum rather than against the opaque operator name.
7+
Engineering simp lemmas exposing definitions of small Riemannian operators
8+
against the smooth $g$-orthonormal frame. Imported by callers that need to
9+
rewrite at the level of frame sums rather than against opaque operator names.
1010
-/
1111

1212
noncomputable section
1313

1414
open Bundle
15-
open scoped ContDiff Manifold Bundle Riemannian
15+
open scoped ContDiff Manifold Bundle Riemannian InnerProductSpace
1616

1717
namespace Riemannian
1818
namespace Operators
@@ -35,6 +35,17 @@ variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [InnerProductSpa
3535
(Riemannian.Tensor.smoothOrthoFrame (I := I) hm.metric α i) α :=
3636
rfl
3737

38+
/-- **Eng.** Definitional unfold of `divergence` as a sum of
39+
`metricInner (∇_{B_i} X) B_i` over the smooth $g$-orthonormal frame. Pure
40+
`rfl`; tagged `@[simp]` for tactic-level rewrites. -/
41+
@[simp] lemma divergence_def
42+
(X : VectorFieldSection I M) (x : M) :
43+
divergence (I := I) (M := M) X x =
44+
∑ i, metricInner x
45+
((∇[Riemannian.Tensor.smoothOrthoFrame (I := I) hm.metric x i] X) x)
46+
(Riemannian.Tensor.smoothOrthoFrame (I := I) hm.metric x i x) :=
47+
rfl
48+
3849
end Operators
3950
end Riemannian
4051

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
# `Util/Simp/`
1+
# Simp
22

3-
Operator simp modules.
3+
Simp utilities collect small operator unfoldings used explicitly by downstream
4+
proofs. `OperatorSimp.lean` combines the connection-Laplacian and divergence
5+
definitional simp lemmas.
46

5-
| File | Role |
6-
|------|------|
7-
| [`ConnectionLaplacianSimp.lean`](./ConnectionLaplacianSimp.lean) | Connection Laplacian simp def-unfold lemmas. |
8-
| [`DivergenceSimp.lean`](./DivergenceSimp.lean) | Divergence simp def-unfold lemmas. |

0 commit comments

Comments
 (0)