Skip to content

9j: delete metricInner typeclass abbrev — end of typeclass-bound metric API#45

Merged
Xinze-Li-Moqian merged 2 commits into
mainfrom
refactor/explicit-g-9j
May 19, 2026
Merged

9j: delete metricInner typeclass abbrev — end of typeclass-bound metric API#45
Xinze-Li-Moqian merged 2 commits into
mainfrom
refactor/explicit-g-9j

Conversation

@Xinze-Li-Moqian
Copy link
Copy Markdown
Contributor

Summary

9j — final step of the explicit-g cascade (umbrella #9). Removes the typeclass-bound metricInner abbrev + its 14 wrapper lemmas + metricToDual / metricRiesz / metricToDualEquiv abbrevs + metricInner_contMDiffWithinAt wrapper from Manifold/SmoothManifold.lean's MetricAPI section (~180 LOC deleted).

After this PR, no typeclass-bound metric abbrev exists in the codebase. All metric access is either:

  • g.metricInner / g.metricRiesz / ... — explicit g via dot-method
  • HasMetric.metric.metricInner / ... — typeclass projection followed by dot-method

Migration

Project-wide perl mass-substitute:

  • metricInner X Y Z (abbrev call) → HasMetric.metric.metricInner X Y Z (dot)
  • metricInner_X (lemma) → HasMetric.metric.metricInner_X (dot-method)
  • Theorem declaration names preserved (exclusion regex on ^theorem|^lemma|^abbrev|^def metricInner)
  • Files defining the abbrev (SmoothManifold.lean, RiemannianMetric.lean) untouched by perl; abbrev deletion done by hand

One external callsite needed a fully-qualified namespace fix (ReducedBoundary.lean: Riemannian.HasMetric.metric.metricInner).

Simp set preservation

RiemannianMetric.metricInner_X lemmas at the def site (Riemannian/Metric/RiemannianMetric.lean) are already tagged @[simp] and @[metric_simp]. Post-substitution dot-method calls (HasMetric.metric.metricInner_X and g.metricInner_X) inherit simp behavior naturally.

Cascade complete

This closes the umbrella issue #9 (explicit-g cascade):

  • 9a / 9b / 9c / 9d / 9e / 9f / 9g / 9h / 9i / 9j → all merged
  • Foundation: RiemannianMetric type with explicit g
  • Operators (Gradient / Hessian / Laplacian / Divergence / SFF / ConnectionLaplacian) — explicit g
  • Curvature stack (Tensoriality / RiemannCurvature / LeviCivita bianchi_first) — explicit g
  • Consumers (BackgroundGeometry / Variation / Stationary / Stable) — explicit g
  • Bochner stack (BochnerExpansion / PerSummand / Bochner) — explicit g via subst hg pattern
  • _g notations dropped
  • metricInner typeclass abbrev deleted

Test plan

  • lake build clean
  • CI green
  • Sorry / shake / MathTag baselines unchanged

…Manifold.lean

- Project-wide mass perl: metricInner (abbrev) → HasMetric.metric.metricInner (dot)
- Project-wide mass perl: metricInner_X (lemma) → HasMetric.metric.metricInner_X (dot-method)
- Theorem declaration names preserved (exclusion regex)
- Files defining the abbrev (SmoothManifold.lean, RiemannianMetric.lean) reverted
- Deleted MetricAPI section (lines 122-302 of SmoothManifold.lean, ~180 LOC):
  - metricInner abbrev + 14 wrapper lemmas
  - metricToDual / metricRiesz / metricToDualEquiv abbrevs
  - metricInner_contMDiffWithinAt wrapper
- Final external callsite fix: ReducedBoundary.lean uses fully-qualified Riemannian.HasMetric.metric.metricInner

Simp set preserved: RiemannianMetric.metricInner_X lemmas already tagged @[simp, metric_simp], so post-substitution dot-method calls inherit simp behavior naturally.

After this PR, no typeclass-bound metric abbrev exists in the codebase.
All metric access is either:
  * g.metricInner / g.metricRiesz / ... — explicit g via dot-method
  * HasMetric.metric.metricInner / ... — typeclass projection followed by dot-method
@Xinze-Li-Moqian Xinze-Li-Moqian merged commit 37746c0 into main May 19, 2026
2 checks passed
@Xinze-Li-Moqian Xinze-Li-Moqian deleted the refactor/explicit-g-9j branch May 19, 2026 00:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant