Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Distance induced by a specified Riemannian metric

Definition
DifferentialGeometry_RiemannianDistance

by Xinze-Li-Moqian · Sep 9, 2026 · Mathlib 0df444a (Lean v4.33.1)

comparison-geometrypoincare-foundationsriemannian-geometry

For a smooth Riemannian metric ggg, define dg(x,y)d_g(x,y)dg​(x,y) as Mathlib's Riemannian extended distance computed using ggg: the infimum of lengths of the admissible differentiable paths from xxx to yyy. The value lies in [0,∞][0,\infty][0,∞], allowing points in different components, and dg(x,x)=0d_g(x,x)=0dg​(x,x)=0. This is the original DifferentialGeometry construction, based on Mathlib's path-length distance.

Definition code
/-
Reuses qinz1yang/differential-geometry, Copyright 2026 The DifferentialGeometry
contributors, Apache-2.0, commit 1b535dd102b94cc42b107cca27059687888f08b3.
The metric and distance are upstream/Mathlib constructions. The ball interface
is curated in OpenGA; source hypotheses and mathematical definitions are preserved.
-/
import Definitions.Def_DifferentialGeometry_SmoothRiemannianMetric
import Mathlib.Geometry.Manifold.Riemannian.Basic

set_option autoImplicit false
noncomputable section
open Bundle Manifold MeasureTheory Set
open scoped Manifold ContDiff ENNReal Topology

namespace DifferentialGeometry

variable {E : Type*} [NormedAddCommGroup E] [NormedSpace Real E]
variable {H : Type*} [TopologicalSpace H]
variable {I : ModelWithCorners Real E H}
variable {M : Type*} [TopologicalSpace M] [ChartedSpace H M]
  [IsManifold I ∞ M]

noncomputable def riemannianEDistOf
    (g : SmoothRiemannianMetric I M) (x y : M) : ℝ≥0∞ :=
  letI : Bundle.RiemannianBundle (TangentSpace I : M → Type _) :=
    ⟨g.toRiemannianMetric⟩
  Manifold.riemannianEDist I x y

theorem riemannianEDistOf_self
    (g : SmoothRiemannianMetric I M) (x : M) :
    riemannianEDistOf (I := I) g x x = 0 := by
  let : Bundle.RiemannianBundle (TangentSpace I : M → Type _) :=
    ⟨g.toRiemannianMetric⟩
  change Manifold.riemannianEDist I x x = 0
  exact Manifold.riemannianEDist_self

end DifferentialGeometry
Source
https://github.com/qinz1yang/differential-geometry/blob/1b535dd102b94cc42b107cca27059687888f08b3/DifferentialGeometry/Geometry/Metric/DistanceScaling.lean#L22-L38

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me