Zulip Chat Archive

Stream: Is there code for X?

Topic: The derivative of a chart on a smooth manifold is smooth


Dominic Steinitz (Nov 19 2025 at 12:34):

import Mathlib

open ContDiff Manifold

variable
  {EB : Type*} [NormedAddCommGroup EB] [InnerProductSpace  EB]
  {HB : Type*} [TopologicalSpace HB] {IB : ModelWithCorners  EB HB} {n : WithTop }
  {B : Type*} [TopologicalSpace B] [ChartedSpace HB B]

example (i : B) :
  ContMDiffOn (M' := EB L[] EB) IB 𝓘(, EB L[] EB) 
    (fun p => mfderiv IB 𝓘(, EB) (extChartAt IB i) p)
    (extChartAt IB i).source := sorry

Michael Rothgang (Nov 19 2025 at 12:51):

You'll want a new lemma ContMDiffOn.mfderiv (saying "if f is C^{n+1}, then mfderiv f is C^n") and then use docs#contMDiffOn_extChartAt (and docs#contMDiffOn_extChartAt_symm). The former would be a nice PR to mathlib; feel free to ping me for review.

Michael Rothgang (Nov 19 2025 at 12:51):

We have docs#ContDiffOn.fderiv_of_isOpen, for example --- so that's hopefully just a consequence of the fderiv lemma.

Michael Rothgang (Nov 19 2025 at 12:51):

Actually, I might have proven this with Patrick already. Let me take a look...

Sébastien Gouëzel (Nov 19 2025 at 12:53):

What would it mean to say that mfderiv is smooth? You would need to put some coordinates there, otherwise it doesn't really make sense if I understand correctly what you wrote. We have docs#ContMDiffAt.mfderiv for a correct version.

Dominic Steinitz (Nov 19 2025 at 14:18):

Sébastien Gouëzel said:

What would it mean to say that mfderiv is smooth? You would need to put some coordinates there, otherwise it doesn't really make sense if I understand correctly what you wrote. We have docs#ContMDiffAt.mfderiv for a correct version.

Maybe I put my question clumsily. I didn't think I was saying that mfderiv is smooth but

if f:MNf : M \longrightarrow N is Cn+1C^{n+1}, then pmfderiv fp:MTpMTf(p)Np \mapsto mfderiv f p : M \longrightarrow T_p M \longrightarrow T_{f(p)} ​N  is CnC^n in pp.

I think @Michael Rothgang is suggesting I write this as ContMDiffOn.mfderiv

EDIT: And ff in my question is a chart map.

Sébastien Gouëzel (Nov 19 2025 at 14:23):

I still think that what you wrote is not really well defined, because you are not considering a map from a manifold to another manifold. Your map starts from M, which is a manifold, fine, but what space does it go into?
Maybe you're looking for docs#ContMDiffOn.contMDiffOn_tangentMapWithin?

Dominic Steinitz (Nov 19 2025 at 14:32):

Ah in my head the space it goes into is Rn\R^n (it's a chart map) but maybe that is too limiting. Anyway I should be explicit. I hope I have understood correctly.

Sébastien Gouëzel (Nov 19 2025 at 14:39):

You are looking at the map sending p : M to (a linear map from T_p M to Rn\R^n). On the right, we have something which is not a manifold -- it's not even really a target space as it depends on the initial point p.

Dominic Steinitz (Nov 24 2025 at 07:37):

I have done what I wanted via coordinates (or rather nearly done it as I have 2 sorry). I will have no time to work on this further until the new year but I would be interested in any feedback. BTW I seem to have invented the cotangent bundle on my journey :monocle:

import Mathlib
open Bundle Manifold ContDiff

noncomputable section

variable {EB : Type*} [NormedAddCommGroup EB] [InnerProductSpace  EB] [FiniteDimensional  EB]
variable {HB : Type*} [TopologicalSpace HB]
variable {B : Type*} [TopologicalSpace B] [ChartedSpace HB B]
variable (IB : ModelWithCorners  EB HB)
variable {n : WithTop }
variable [IsManifold IB  B]
variable [SigmaCompactSpace B] [T2Space B]

variable {F : Type*} [NormedAddCommGroup F] [NormedSpace  F]
variable {E : B  Type*} [TopologicalSpace (TotalSpace F E)]
variable [ x, TopologicalSpace (E x)] [ x, AddCommGroup (E x)] [ x, Module  (E x)]
variable [FiberBundle F E] [VectorBundle  F E]
variable [ContMDiffVectorBundle  F E IB]

noncomputable instance : TopologicalSpace (TotalSpace EB (@TangentSpace  _ _ _ _ _ _ IB B _ _)) :=
  inferInstanceAs (TopologicalSpace (TangentBundle IB B))

noncomputable instance (p : B) : NormedAddCommGroup (TangentSpace IB p) := by
  change NormedAddCommGroup EB
  infer_instance

noncomputable instance (p : B) : NormedSpace  (TangentSpace IB p) := by
  change NormedSpace  EB
  infer_instance

noncomputable instance (p : B) : InnerProductSpace  (TangentSpace IB p) := by
  change InnerProductSpace  EB
  infer_instance

section CotangentBundle

variable (E) in
/-- This is the bundle `Hom_ℝ(E, T)`, where `T` is the rank one trivial bundle over `B`. -/
private def V : (b : B)  Type _ := (fun b  E b L[] Trivial B  b)

noncomputable instance : (x : B)  TopologicalSpace (V E x) := by
  unfold V
  infer_instance

noncomputable instance : (x : B)  AddCommGroup (V E x) := by
  unfold V
  infer_instance

noncomputable instance (x : B) : Module  (V E x) := by
  unfold V
  infer_instance

noncomputable instance : TopologicalSpace (TotalSpace (F L[] ) (V E)) := by
  unfold V
  infer_instance

noncomputable instance : FiberBundle (F L[] ) (V E) := by
  unfold V
  infer_instance

noncomputable instance : VectorBundle  (F L[] ) (V E) := by
  unfold V
  infer_instance

noncomputable instance :
VectorBundle  (EB L[] ) (V (@TangentSpace  _ _ _ _ _ _ IB B _ _)) := by
  unfold V
  infer_instance

noncomputable instance : ContMDiffVectorBundle n (F L[] ) (V E) IB := by
  unfold V
  infer_instance

noncomputable instance (x : B) : NormedAddCommGroup
 (V (@TangentSpace  _ _ _ _ _ _ IB B _ _) x) := by
  unfold V
  change NormedAddCommGroup (TangentSpace IB x L[] )
  infer_instance

noncomputable instance (x : B) : NormedSpace  (V (@TangentSpace  _ _ _ _ _ _ IB B _ _) x) := by
  unfold V
  change NormedSpace  (TangentSpace IB x L[] )
  infer_instance

noncomputable instance : ContMDiffVectorBundle  (EB L[] )
 (V (@TangentSpace  _ _ _ _ _ _ IB B _ _)) IB := by
  unfold V
  infer_instance

end CotangentBundle

noncomputable
def simple_section (e₀ : EB) (i : B) (x : B) : TangentSpace IB x L[]  :=
  let φ := extChartAt IB i
  let  := mfderiv IB 𝓘(, EB) φ x
  (innerSL  e₀).comp 

theorem simple_section_in_trivialization (e₀ : EB) (i p : B) (hp : p  (extChartAt IB i).source) :
  let e := trivializationAt (EB L[] ) (fun b => TangentSpace IB b L[] ) i
  (e p, simple_section IB e₀ i p).2 = innerSL  e₀ := by

  unfold simple_section

  let e_tangent := trivializationAt EB (TangentSpace IB) i
  have : trivializationAt (EB L[] ) (fun b => TangentSpace IB b L[] ) i =
         Trivialization.continuousLinearMap (RingHom.id ) e_tangent
         (trivializationAt  (fun _ : B => ) i) := rfl
  rw [this]

  change
    (Trivialization.continuousLinearMap (RingHom.id ) e_tangent
    (trivializationAt  (fun _ : B => ) i)
    p, ((innerSL  e₀).comp (mfderiv IB 𝓘(, EB) (extChartAt IB i) p))).2 = innerSL  e₀

  rw [Trivialization.continuousLinearMap_apply]
  simp
  have e_tangent_symmL_eq : e_tangent.symmL  p =
    (tangentBundleCore IB B).coordChange (achart HB i) (achart HB p) p := by
    have hp : p  (chartAt HB i).source := Set.mem_of_mem_inter_left hp
    exact TangentBundle.symmL_trivializationAt_eq_core hp
  rw [e_tangent_symmL_eq, tangentBundleCore_coordChange_achart]

  simp
  rw [ContinuousLinearMap.comp_assoc]

  -- I hope this is obvious and straightforward
  have key : (mfderiv IB 𝓘(, EB) (IB  (chartAt HB i)) p).comp
    (fderivWithin  ((IB  (chartAt HB p))  (chartAt HB i).symm  IB.symm)
      (Set.range IB) (IB ((chartAt HB i) p))) =
    ContinuousLinearMap.id  EB := by
    sorry

  rw [key]
  rw [ContinuousLinearMap.comp_id]

theorem simple_section_smooth (e₀ : EB) (i : B) :
  ContMDiffOn IB (IB.prod 𝓘(, EB L[] )) ω
    (fun p => TotalSpace.mk' (EB L[] ) p (simple_section IB e₀ i p))
    (extChartAt IB i).source := by
  intro p hp
  let e := trivializationAt (EB L[] ) (fun b  TangentSpace IB b L[] ) i

  letI : ChartedSpace (EB L[] ) (TangentSpace IB p L[] ) := by
    change ChartedSpace (EB L[] ) (EB L[] )
    infer_instance

  have h2 :  TotalSpace.mk' (EB L[] ) p (simple_section IB e₀ i p)  e.source := by
    rw [e.mem_source]
    simp
    exact sorry

  have h_iff :=
  Trivialization.contMDiffWithinAt_iff
    (n := ω)
    (e := e)
    (x₀ := p)
    (f := (fun p => TotalSpace.mk' (EB L[] ) p (simple_section IB e₀ i p)))
    (s := (extChartAt IB i).source)
    (IB := IB)
    (IM := IB)
    (M := B)
    (F := EB L[] )
    (E := fun b => TangentSpace IB b L[] )
    h2

  rw [h_iff]
  constructor
  · simp
    have : ContMDiffWithinAt IB IB ω (fun x  x) (chartAt HB i).source p := contMDiffWithinAt_id
    exact this
  · have h_const :  x  (extChartAt IB i).source,
      (e x, simple_section IB e₀ i x).2 = innerSL  e₀ :=
      fun x hx => simple_section_in_trivialization IB e₀ i x hx

    apply ContMDiffWithinAt.congr contMDiffWithinAt_const
    · intro x hx
      change (e x, simple_section IB e₀ i x).2 = innerSL  e₀
      exact h_const x hx
    · exact h_const p hp

Dominic Steinitz (Nov 24 2025 at 07:42):

I don't know why the playground is kicking off about

#synth TopologicalSpace (TotalSpace (EB L[] )
  fun b => (@TangentSpace  _ _ _ _ _ _ IB B _ _) b L[] )

That is fine on my computer.

Dominic Steinitz (Nov 24 2025 at 07:52):

Huh - Zulip has capitalised "i" to "I" causing mayhem - I am trying to fix.

Dominic Steinitz (Nov 24 2025 at 07:53):

I get no errors in playground now :relieved:

Dominic Steinitz (Nov 24 2025 at 09:53):

Does this sound reasonable?

We have

theorem TangentBundle.trivializationAt_baseSet (x : M) : (trivializationAt E (TangentSpace I) x).baseSet = (chartAt H x).source := rfl

so if we can proved the baseSet for the tangent trivialisations are the same as the baseSet for the cotangent trivialisations then we are home and dry. And they should be because the cotangent bundle is derived from the tangent bundle.

Dominic Steinitz (Nov 24 2025 at 10:31):

This solved the sorry

  have h_base' : (trivializationAt (EB L[] ) (fun b  TangentSpace IB b L[] ) i).baseSet =
                 (chartAt HB i).source := by
     dsimp [trivializationAt]
     exact Set.inter_univ (chartAt HB i).source

  have h2 :  TotalSpace.mk' (EB L[] ) p (simple_section IB e₀ i p)  e.source := by
    rw [e.mem_source]
    simp
    have : p  (extChartAt IB i).source := hp
    rw [extChartAt_source] at this
    have : p  (trivializationAt (EB L[] ) (fun b  TangentSpace IB b L[] ) i).baseSet := by
      rw [<-h_base'] at this
      exact this
    exact this

Dominic Steinitz (Nov 24 2025 at 16:57):

This looks very fishy to me

  -- I hope this is obvious and straightforward
  have key : (mfderiv IB 𝓘(, EB) (IB  (chartAt HB i)) p).comp
    (fderivWithin  ((IB  (chartAt HB p))  (chartAt HB i).symm  IB.symm)
      (Set.range IB) (IB ((chartAt HB i) p))) =
    ContinuousLinearMap.id  EB := by
    sorry

but I will repair the actual lemma about trivialisation of the section being the definition in the chart.


Last updated: Dec 20 2025 at 21:32 UTC