Skip to content

Commit 805e84e

Browse files
committed
chore: golf using TangentSpace%, tangentMap[s] and tangentMap%
1 parent 3398784 commit 805e84e

5 files changed

Lines changed: 36 additions & 35 deletions

File tree

Mathlib/Geometry/Manifold/ContMDiffMFDeriv.lean

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ module
88
public import Mathlib.Geometry.Manifold.MFDeriv.Tangent
99
public import Mathlib.Geometry.Manifold.ContMDiffMap
1010
public import Mathlib.Geometry.Manifold.VectorBundle.Hom
11+
public import Mathlib.Geometry.Manifold.Notation
1112

1213
/-!
1314
### Interactions between differentiability, smoothness and manifold derivatives
@@ -283,21 +284,19 @@ variable [Is : IsManifold I 1 M] [I's : IsManifold I' 1 M']
283284
/-- If a function is `C^n` on a domain with unique derivatives, then its bundled derivative
284285
is `C^m` when `m+1 ≤ n`. -/
285286
theorem ContMDiffOn.contMDiffOn_tangentMapWithin
286-
(hf : ContMDiffOn I I' n f s) (hmn : m + 1 ≤ n)
287-
(hs : UniqueMDiffOn I s) :
288-
ContMDiffOn I.tangent I'.tangent m (tangentMapWithin I I' f s)
289-
(π E (TangentSpace I) ⁻¹' s) := by
287+
(hf : CMDiff[s] n f) (hmn : m + 1 ≤ n) (hs : UniqueMDiffOn I s) :
288+
CMDiff[(π E (TangentSpace I) ⁻¹' s)] m (tangentMap[s] f) := by
290289
intro x₀ hx₀
291290
let s' : Set (TangentBundle I M) := (π E (TangentSpace I) ⁻¹' s)
292291
let b₁ : TangentBundle I M → M := fun p ↦ p.1
293-
let v : Π (y : TangentBundle I M), TangentSpace I (b₁ y) := fun y ↦ y.2
292+
let v : Π (y : TangentBundle I M), TangentSpace% (b₁ y) := fun y ↦ y.2
294293
have hv : ContMDiffWithinAt I.tangent I.tangent m (fun y ↦ (v y : TangentBundle I M)) s' x₀ :=
295294
contMDiffWithinAt_id
296295
let b₂ : TangentBundle I M → M' := f ∘ b₁
297296
have hb₂ : ContMDiffWithinAt I.tangent I' m b₂ s' x₀ :=
298297
((hf (b₁ x₀) hx₀).of_le (le_self_add.trans hmn)).comp _
299298
(contMDiffWithinAt_proj (TangentSpace I)) (fun x h ↦ h)
300-
let ϕ : Π (y : TangentBundle I M), TangentSpace I (b₁ y) →L[𝕜] TangentSpace I' (b₂ y) :=
299+
let ϕ : Π (y : TangentBundle I M), TangentSpace% (b₁ y) →L[𝕜] TangentSpace% (b₂ y) :=
301300
fun y ↦ mfderivWithin I I' f s (b₁ y)
302301
have hϕ : ContMDiffWithinAt I.tangent 𝓘(𝕜, E →L[𝕜] E') m
303302
(fun y ↦ ContinuousLinearMap.inCoordinates E (TangentSpace I (M := M)) E'
@@ -315,22 +314,21 @@ theorem ContMDiffOn.contMDiffOn_tangentMapWithin
315314
derivative is continuous there. -/
316315
theorem ContMDiffOn.continuousOn_tangentMapWithin (hf : ContMDiffOn I I' n f s) (hmn : 1 ≤ n)
317316
(hs : UniqueMDiffOn I s) :
318-
ContinuousOn (tangentMapWithin I I' f s) (π E (TangentSpace I) ⁻¹' s) := by
319-
have :
320-
ContMDiffOn I.tangent I'.tangent 0 (tangentMapWithin I I' f s) (π E (TangentSpace I) ⁻¹' s) :=
317+
ContinuousOn (tangentMap[s] f) (π E (TangentSpace I) ⁻¹' s) := by
318+
have : CMDiff[π E (TangentSpace I) ⁻¹' s] 0 (tangentMap[s] f) :=
321319
hf.contMDiffOn_tangentMapWithin hmn hs
322320
exact this.continuousOn
323321

324322
/-- If a function is `C^n`, then its bundled derivative is `C^m` when `m+1 ≤ n`. -/
325-
theorem ContMDiff.contMDiff_tangentMap (hf : ContMDiff I I' n f) (hmn : m + 1 ≤ n) :
326-
ContMDiff I.tangent I'.tangent m (tangentMap I I' f) := by
323+
theorem ContMDiff.contMDiff_tangentMap (hf : CMDiff n f) (hmn : m + 1 ≤ n) :
324+
CMDiff m (tangentMap% f) := by
327325
rw [← contMDiffOn_univ] at hf ⊢
328326
convert hf.contMDiffOn_tangentMapWithin hmn uniqueMDiffOn_univ
329327
rw [tangentMapWithin_univ]
330328

331329
/-- If a function is `C^n`, with `1 ≤ n`, then its bundled derivative is continuous. -/
332-
theorem ContMDiff.continuous_tangentMap (hf : ContMDiff I I' n f) (hmn : 1 ≤ n) :
333-
Continuous (tangentMap I I' f) := by
330+
theorem ContMDiff.continuous_tangentMap (hf : CMDiff n f) (hmn : 1 ≤ n) :
331+
Continuous (tangentMap% f) := by
334332
rw [← contMDiffOn_univ] at hf
335333
rw [← continuousOn_univ]
336334
convert hf.continuousOn_tangentMapWithin hmn uniqueMDiffOn_univ
@@ -359,7 +357,7 @@ may seem.
359357
TODO define splittings of vector bundles; state this result invariantly. -/
360358
theorem tangentMap_tangentBundle_pure [Is : IsManifold I 1 M]
361359
(p : TangentBundle I M) :
362-
tangentMap I I.tangent (zeroSection E (TangentSpace I)) p = ⟨⟨p.proj, 0⟩, ⟨p.2, 0⟩⟩ := by
360+
tangentMap% (zeroSection (B := M) E (TangentSpace I)) p = ⟨⟨p.proj, 0⟩, ⟨p.2, 0⟩⟩ := by
363361
rcases p with ⟨x, v⟩
364362
have N : I.symm ⁻¹' (chartAt H x).target ∈ 𝓝 (I ((chartAt H x) x)) := by
365363
apply IsOpen.mem_nhds
@@ -421,7 +419,7 @@ bundles. -/
421419

422420
lemma equivTangentBundleProd_eq_tangentMap_prod_tangentMap :
423421
equivTangentBundleProd I M I' M' = fun (p : TangentBundle (I.prod I') (M × M')) ↦
424-
(tangentMap (I.prod I') I Prod.fst p, tangentMap (I.prod I') I' Prod.snd p) := by
422+
(tangentMap% (@Prod.fst M M') p, tangentMap% (@Prod.snd M M') p) := by
425423
simp only [tangentMap_prodFst, tangentMap_prodSnd]; rfl
426424

427425
variable [IsManifold I 1 M] [IsManifold I' 1 M']

Mathlib/Geometry/Manifold/GroupLieAlgebra.lean

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,14 @@ variable (I G) in
5353
`GroupLieAlgebra` instead of `LieAlgebra` as the latter is taken as a generic class. -/
5454
@[to_additive /-- The Lie algebra of an additive Lie group, i.e., its tangent space at zero. We use
5555
the word `AddGroupLieAlgebra` instead of `LieAlgebra` as the latter is taken as a generic class. -/]
56-
abbrev GroupLieAlgebra : Type _ := TangentSpace I (1 : G)
56+
abbrev GroupLieAlgebra : Type _ := TangentSpace% (1 : G)
5757

5858
/-- The invariant vector field associated to a vector `v` in the Lie algebra. At a point `g`, it
5959
is given by the image of `v` under left-multiplication by `g`. -/
6060
@[to_additive /-- The invariant vector field associated to a vector `v` in the Lie algebra. At a
6161
point `g`, it is given by the image of `v` under left-addition by `g`. -/]
62-
noncomputable def mulInvariantVectorField (v : GroupLieAlgebra I G) (g : G) : TangentSpace I g :=
63-
mfderiv I I (g * ·) (1 : G) v
62+
noncomputable def mulInvariantVectorField (v : GroupLieAlgebra I G) (g : G) : TangentSpace% g :=
63+
mfderiv% (g * ·) (1 : G) v
6464

6565
set_option backward.isDefEq.respectTransparency false in
6666
@[to_additive]
@@ -134,7 +134,7 @@ lemma mpullback_mulInvariantVectorField (g : G) (v : GroupLieAlgebra I G) :
134134

135135
set_option backward.isDefEq.respectTransparency false in
136136
@[to_additive]
137-
lemma mulInvariantVectorField_eq_mpullback (g : G) (V : Π (g : G), TangentSpace I g) :
137+
lemma mulInvariantVectorField_eq_mpullback (g : G) (V : Π (g : G), TangentSpace% g) :
138138
mulInvariantVectorField (V 1) g = mpullback I I (g⁻¹ * ·) V g := by
139139
have A : 1 = g⁻¹ * g := by simp
140140
simp only [mulInvariantVectorField, mpullback, inverse_mfderiv_mul_left]
@@ -172,8 +172,8 @@ theorem contMDiff_mulInvariantVectorField (v : GroupLieAlgebra I G) :
172172
have S₂ : ContMDiff (I.tangent.prod I.tangent) (I.prod I).tangent (minSmoothness 𝕜 2) F₂ :=
173173
contMDiff_equivTangentBundleProd_symm
174174
let F₃ : TangentBundle (I.prod I) (G × G) → TangentBundle I G :=
175-
tangentMap (I.prod I) I (fun (p : G × G) ↦ p.1 * p.2)
176-
have S₃ : ContMDiff (I.prod I).tangent I.tangent (minSmoothness 𝕜 2) F₃ := by
175+
tangentMap% (fun (p : G × G) ↦ p.1 * p.2)
176+
have S₃ : CMDiff (minSmoothness 𝕜 2) F₃ := by
177177
apply ContMDiff.contMDiff_tangentMap _ (m := minSmoothness 𝕜 2) le_rfl
178178
rw [A]
179179
exact contMDiff_mul I (minSmoothness 𝕜 3)

Mathlib/Geometry/Manifold/IntegralCurve/Basic.lean

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Authors: Winston Yin
66
module
77

88
public import Mathlib.Geometry.Manifold.MFDeriv.Tangent
9+
public import Mathlib.Geometry.Manifold.Notation
910

1011
/-!
1112
# Integral curves of vector fields on a manifold
@@ -62,21 +63,21 @@ variable
6263
/-- If `γ : ℝ → M` is $C^1$ on `s : Set ℝ` and `v` is a vector field on `M`,
6364
`IsMIntegralCurveOn γ v s` means `γ t` is tangent to `v (γ t)` for all `t ∈ s`. The value of `γ`
6465
outside of `s` is irrelevant and considered junk. -/
65-
def IsMIntegralCurveOn (γ : ℝ → M) (v : (x : M) → TangentSpace I x) (s : Set ℝ) : Prop :=
66+
def IsMIntegralCurveOn (γ : ℝ → M) (v : (x : M) → TangentSpace% x) (s : Set ℝ) : Prop :=
6667
∀ t ∈ s, HasMFDerivWithinAt 𝓘(ℝ, ℝ) I γ s t ((1 : ℝ →L[ℝ] ℝ).smulRight <| v (γ t))
6768

6869
/-- If `v` is a vector field on `M` and `t₀ : ℝ`, `IsMIntegralCurveAt γ v t₀` means `γ : ℝ → M` is a
6970
local integral curve of `v` in a neighbourhood containing `t₀`. The value of `γ` outside of this
7071
interval is irrelevant and considered junk. -/
71-
def IsMIntegralCurveAt (γ : ℝ → M) (v : (x : M) → TangentSpace I x) (t₀ : ℝ) : Prop :=
72+
def IsMIntegralCurveAt (γ : ℝ → M) (v : (x : M) → TangentSpace% x) (t₀ : ℝ) : Prop :=
7273
∀ᶠ t in 𝓝 t₀, HasMFDerivAt 𝓘(ℝ, ℝ) I γ t ((1 : ℝ →L[ℝ] ℝ).smulRight <| v (γ t))
7374

7475
/-- If `v : M → TM` is a vector field on `M`, `IsMIntegralCurve γ v` means `γ : ℝ → M` is a global
7576
integral curve of `v`. That is, `γ t` is tangent to `v (γ t)` for all `t : ℝ`. -/
76-
def IsMIntegralCurve (γ : ℝ → M) (v : (x : M) → TangentSpace I x) : Prop :=
77+
def IsMIntegralCurve (γ : ℝ → M) (v : (x : M) → TangentSpace% x) : Prop :=
7778
∀ t : ℝ, HasMFDerivAt 𝓘(ℝ, ℝ) I γ t ((1 : ℝ →L[ℝ] ℝ).smulRight (v (γ t)))
7879

79-
variable {γ γ' : ℝ → M} {v : (x : M) → TangentSpace I x} {s s' : Set ℝ} {t₀ : ℝ}
80+
variable {γ γ' : ℝ → M} {v : (x : M) → TangentSpace% x} {s s' : Set ℝ} {t₀ : ℝ}
8081

8182
lemma IsMIntegralCurve.isMIntegralCurveOn (h : IsMIntegralCurve γ v) (s : Set ℝ) :
8283
IsMIntegralCurveOn γ v s := fun t _ ↦ (h t).hasMFDerivWithinAt

Mathlib/Geometry/Manifold/MFDeriv/SpecificFunctions.lean

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ module
77

88
public import Mathlib.Analysis.Calculus.FDeriv.Mul
99
public import Mathlib.Geometry.Manifold.MFDeriv.FDeriv
10+
public import Mathlib.Geometry.Manifold.Notation
1011

1112
/-!
1213
# Differentiability of specific functions
@@ -160,10 +161,10 @@ theorem mfderivWithin_id (hxs : UniqueMDiffWithinAt I s x) :
160161

161162
set_option backward.isDefEq.respectTransparency false in
162163
@[simp, mfld_simps]
163-
theorem tangentMap_id : tangentMap I I (id : M → M) = id := by ext1 ⟨x, v⟩; simp [tangentMap]
164+
theorem tangentMap_id : tangentMap% (@id M) = id := by ext1 ⟨x, v⟩; simp [tangentMap]
164165

165166
theorem tangentMapWithin_id {p : TangentBundle I M} (hs : UniqueMDiffWithinAt I s p.proj) :
166-
tangentMapWithin I I (id : M → M) s p = p := by
167+
tangentMap[s] (id : M → M) p = p := by
167168
simp only [tangentMapWithin, id]
168169
rw [mfderivWithin_id]
169170
· rcases p with ⟨⟩; rfl
@@ -334,12 +335,12 @@ theorem mfderivWithin_fst {s : Set (M × M')} {x : M × M'}
334335

335336
@[simp, mfld_simps]
336337
theorem tangentMap_prodFst {p : TangentBundle (I.prod I') (M × M')} :
337-
tangentMap (I.prod I') I Prod.fst p = ⟨p.proj.1, p.2.1⟩ := by
338+
tangentMap% (@Prod.fst M M') p = ⟨p.proj.1, p.2.1⟩ := by
338339
simp [tangentMap]; rfl
339340

340341
theorem tangentMapWithin_prodFst {s : Set (M × M')} {p : TangentBundle (I.prod I') (M × M')}
341342
(hs : UniqueMDiffWithinAt (I.prod I') s p.proj) :
342-
tangentMapWithin (I.prod I') I Prod.fst s p = ⟨p.proj.1, p.2.1⟩ := by
343+
tangentMap[s] (@Prod.fst M M') p = ⟨p.proj.1, p.2.1⟩ := by
343344
simp only [tangentMapWithin]
344345
rw [mfderivWithin_fst]
345346
· rcases p with ⟨⟩; rfl
@@ -575,12 +576,12 @@ end prodMap
575576

576577
@[simp, mfld_simps]
577578
theorem tangentMap_prodSnd {p : TangentBundle (I.prod I') (M × M')} :
578-
tangentMap (I.prod I') I' Prod.snd p = ⟨p.proj.2, p.2.2⟩ := by
579+
tangentMap% (@Prod.snd M M') p = ⟨p.proj.2, p.2.2⟩ := by
579580
simp [tangentMap]; rfl
580581

581582
theorem tangentMapWithin_prodSnd {s : Set (M × M')} {p : TangentBundle (I.prod I') (M × M')}
582583
(hs : UniqueMDiffWithinAt (I.prod I') s p.proj) :
583-
tangentMapWithin (I.prod I') I' Prod.snd s p = ⟨p.proj.2, p.2.2⟩ := by
584+
tangentMap[s] (@Prod.snd M M') p = ⟨p.proj.2, p.2.2⟩ := by
584585
simp only [tangentMapWithin]
585586
rw [mfderivWithin_snd hs]
586587
rcases p with ⟨⟩; rfl
@@ -595,8 +596,9 @@ theorem mfderiv_prod_left {x₀ : M} {y₀ : M'} :
595596
refine (mdifferentiableAt_id.mfderiv_prod mdifferentiableAt_const).trans ?_
596597
rw [mfderiv_id, mfderiv_const, ContinuousLinearMap.inl]
597598

599+
-- TODO: better error when the type of x is left open
598600
theorem tangentMap_prod_left {p : TangentBundle I M} {y₀ : M'} :
599-
tangentMap I (I.prod I') (fun x => (x, y₀)) p = ⟨(p.1, y₀), (p.2, 0)⟩ := by
601+
tangentMap% (fun (x : M) ↦ (x, y₀)) p = ⟨(p.1, y₀), (p.2, 0)⟩ := by
600602
simp only [tangentMap, mfderiv_prod_left, TotalSpace.mk_inj]
601603
rfl
602604

@@ -608,7 +610,7 @@ theorem mfderiv_prod_right {x₀ : M} {y₀ : M'} :
608610
rw [mfderiv_id, mfderiv_const, ContinuousLinearMap.inr]
609611

610612
theorem tangentMap_prod_right {p : TangentBundle I' M'} {x₀ : M} :
611-
tangentMap I' (I.prod I') (fun y => (x₀, y)) p = ⟨(x₀, p.1), (0, p.2)⟩ := by
613+
tangentMap% (fun (y : M') (x₀, y)) p = ⟨(x₀, p.1), (0, p.2)⟩ := by
612614
simp only [tangentMap, mfderiv_prod_right, TotalSpace.mk_inj]
613615
rfl
614616

Mathlib/Geometry/Manifold/MFDeriv/Tangent.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ variable {𝕜 : Type*} [NontriviallyNormedField 𝕜]
3535
/-- The derivative of the chart at a base point is the chart of the tangent bundle, composed with
3636
the identification between the tangent bundle of the model space and the product space. -/
3737
theorem tangentMap_chart {p q : TangentBundle I M} (h : q.1 ∈ (chartAt H p.1).source) :
38-
tangentMap I I (chartAt H p.1) q =
38+
tangentMap% (chartAt H p.1) q =
3939
(TotalSpace.toProd _ _).symm
4040
((chartAt (ModelProd H E) p : TangentBundle I M → ModelProd H E) q) := by
4141
dsimp [tangentMap]
@@ -48,7 +48,7 @@ tangent bundle, composed with the identification between the tangent bundle of t
4848
the product space. -/
4949
theorem tangentMap_chart_symm {p : TangentBundle I M} {q : TangentBundle I H}
5050
(h : q.1 ∈ (chartAt H p.1).target) :
51-
tangentMap I I (chartAt H p.1).symm q =
51+
tangentMap% (chartAt H p.1).symm q =
5252
(chartAt (ModelProd H E) p).symm (TotalSpace.toProd H E q) := by
5353
dsimp only [tangentMap]
5454
rw [MDifferentiableAt.mfderiv (mdifferentiableAt_atlas_symm (chart_mem_atlas _ _) h)]

0 commit comments

Comments
 (0)