Skip to content

Commit 52a89f0

Browse files
committed
Use new elaborators in CovariantDerivative
1 parent 4ec3b0f commit 52a89f0

1 file changed

Lines changed: 43 additions & 44 deletions

File tree

Mathlib/Geometry/Manifold/VectorBundle/CovariantDerivative.lean

Lines changed: 43 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import Mathlib.Geometry.Manifold.BumpFunction
1111
import Mathlib.Geometry.Manifold.VectorBundle.MDifferentiable
1212
import Mathlib.Geometry.Manifold.VectorBundle.Tensoriality
1313
import Mathlib.Geometry.Manifold.VectorField.LieBracket
14+
import Mathlib.Geometry.Manifold.Elaborators
1415

1516
/-!
1617
# Covariant derivatives
@@ -56,7 +57,7 @@ variable {E' : Type*} [NormedAddCommGroup E'] [NormedSpace 𝕜 E']
5657

5758
@[simp]
5859
theorem Bundle.Trivial.mdifferentiableAt_iff (σ : (x : E) → Trivial E E' x) (e : E) :
59-
MDifferentiableAt 𝓘(𝕜, E) (𝓘(𝕜, E).prod 𝓘(𝕜, E')) (fun x ↦ TotalSpace.mk' E' x (σ x)) e ↔
60+
MDifferentiableAt% (T% σ) e ↔
6061
DifferentiableAt 𝕜 σ e := by
6162
simp [mdifferentiableAt_totalSpace, mdifferentiableAt_iff_differentiableAt]
6263

@@ -86,9 +87,9 @@ variable {I F V x} in
8687
if one is differentiable at `x` then so is the other.
8788
Issue: EventuallyEq does not work for dependent functions. -/
8889
lemma mdifferentiableAt_dependent_congr {σ σ' : Π x : M, V x} {s : Set M} (hs : s ∈ nhds x)
89-
(hσ₁ : MDifferentiableAt I (I.prod 𝓘(𝕜, F)) (fun x ↦ TotalSpace.mk' F x (σ x)) x)
90+
(hσ₁ : MDifferentiableAt% (T% σ) x)
9091
(hσ₂ : ∀ x ∈ s, σ x = σ' x) :
91-
MDifferentiableAt I (I.prod 𝓘(𝕜, F)) (fun x ↦ TotalSpace.mk' F x (σ' x)) x := by
92+
MDifferentiableAt% (T% σ') x := by
9293
apply MDifferentiableAt.congr_of_eventuallyEq hσ₁
9394
-- TODO: split off a lemma?
9495
apply Set.EqOn.eventuallyEq_of_mem _ hs
@@ -102,8 +103,8 @@ variable {I F V x} in
102103
one is differentiable at `x` iff the other is. -/
103104
lemma mfderiv_dependent_congr_iff {σ σ' : Π x : M, V x} {s : Set M} (hs : s ∈ nhds x)
104105
(hσ : ∀ x ∈ s, σ x = σ' x) :
105-
MDifferentiableAt I (I.prod 𝓘(𝕜, F)) (fun x ↦ TotalSpace.mk' F x (σ x)) x ↔
106-
MDifferentiableAt I (I.prod 𝓘(𝕜, F)) (fun x ↦ TotalSpace.mk' F x (σ' x)) x :=
106+
MDifferentiableAt% (T% σ) x ↔
107+
MDifferentiableAt% (T% σ') x :=
107108
fun h ↦ mdifferentiableAt_dependent_congr hs h hσ,
108109
fun h ↦ mdifferentiableAt_dependent_congr hs h (fun x hx ↦ (hσ x hx).symm)⟩
109110

@@ -175,12 +176,12 @@ structure CovariantDerivative where
175176
smulX : ∀ (X : Π x : M, TangentSpace I x) (σ : Π x : M, V x) (f : M → 𝕜),
176177
toFun (f • X) σ = f • toFun X σ
177178
addσ : ∀ (X : Π x : M, TangentSpace I x) (σ σ' : Π x : M, V x) (x : M),
178-
MDifferentiableAt I (I.prod 𝓘(𝕜, F)) (fun x ↦ TotalSpace.mk' F x (σ x)) x
179-
→ MDifferentiableAt I (I.prod 𝓘(𝕜, F)) (fun x ↦ TotalSpace.mk' F x (σ' x)) x
179+
MDifferentiableAt% (T% σ) x
180+
→ MDifferentiableAt% (T% σ') x
180181
→ toFun X (σ + σ') x = toFun X σ x + toFun X σ' x
181182
leibniz : ∀ (X : Π x : M, TangentSpace I x) (σ : Π x : M, V x) (f : M → 𝕜) (x : M),
182-
MDifferentiableAt I (I.prod 𝓘(𝕜, F)) (fun x ↦ TotalSpace.mk' F x (σ x)) x
183-
→ MDifferentiableAt I 𝓘(𝕜) f x
183+
MDifferentiableAt% (T% σ) x
184+
→ MDifferentiableAt% f x
184185
→ toFun X (f • σ) x = (f • toFun X σ) x + (bar _ <| mfderiv I 𝓘(𝕜) f x (X x)) • σ x
185186
smul_const_σ : ∀ (X : Π x : M, TangentSpace I x) (σ : Π x : M, V x) (a : 𝕜),
186187
toFun X (a • σ) = a • toFun X σ
@@ -193,10 +194,10 @@ This is a class so typeclass inference can deduce this automatically.
193194
-/
194195
class IsCkConnection (cov : CovariantDerivative I F V) (k : ℕ∞) where
195196
regularity : ∀ (X : Π x : M, TangentSpace I x) (σ : Π x : M, V x),
196-
ContMDiff I (I.prod 𝓘(𝕜, F)) (k + 1) (fun x ↦ TotalSpace.mk' F x (σ x)) →
197+
ContMDiff I (I.prod 𝓘(𝕜, F)) (k + 1) (T% σ) →
197198
-- TODO: this condition does not typecheck!
198199
-- ContMDiff I I.tangent k (fun x ↦ (X x : TangentBundle I M)) →
199-
ContMDiff I (I.prod 𝓘(𝕜, F)) k (fun x ↦ TotalSpace.mk' F x (cov.toFun X σ x))
200+
ContMDiff I (I.prod 𝓘(𝕜, F)) k (T% (cov.toFun X σ))
200201

201202
-- future: if g is a C^k metric, the LC connection is of class C^k ?
202203

@@ -221,7 +222,7 @@ omit [IsManifold I 0 M] [∀ (x : M), IsTopologicalAddGroup (V x)]
221222
@[simp]
222223
lemma zeroσ (cov : CovariantDerivative I F V) (X : Π x : M, TangentSpace I x) : cov X 0 = 0 := by
223224
ext x
224-
have : MDifferentiableAt I (I.prod 𝓘(𝕜, F)) (fun x ↦ TotalSpace.mk' F x (0 : V x)) x := by
225+
have : MDifferentiableAt% (T% fun x ↦ (0 : V x)) x := by
225226
exact (contMDiff_zeroSection 𝕜 V).mdifferentiableAt le_rfl
226227
have := cov.addσ X (0 : (x : M) → V x) (0 : (x : M) → V x) x this this
227228
simpa using this
@@ -328,7 +329,7 @@ lemma convexCombination'_isRegular {ι : Type*} {s : Finset ι} [Nonempty s]
328329
unfold convexCombination'
329330
dsimp
330331
have ms (i) (hi : i ∈ s) : ContMDiff I (I.prod 𝓘(𝕜, F)) n
331-
fun x ↦ TotalSpace.mk' F x ((f i • (cov i) X σ) x) := by
332+
(T% (f i • (cov i) X σ)) := by
332333
apply contMDiff_smul_section (hf' i hi)
333334
exact IsCkConnection.regularity X σ hX (self := hcov i hi)
334335
simp only [Finset.sum_apply, Pi.smul_apply']
@@ -371,7 +372,7 @@ lemma trivial_isSmooth : IsCkConnection (𝕜 := 𝕜) (trivial E E') (⊤ : ℕ
371372
specialize hX x
372373
-- TODO: use contMDiffOn instead, to get something like
373374
-- have hX' : ContMDiffOn 𝓘(𝕜, E) (𝓘(𝕜, E).prod 𝓘(𝕜, E')) (∞ + 1)
374-
-- (fun x ↦ TotalSpace.mk' E' x (σ x)) (trivializationAt x).baseSet := hX.contMDiffOn
375+
-- (T% σ) (trivializationAt x).baseSet := hX.contMDiffOn
375376
-- then want a version contMDiffOn_totalSpace
376377
rw [contMDiffAt_totalSpace] at hX ⊢
377378
simp only [Trivial.fiberBundle_trivializationAt', Trivial.trivialization_apply]
@@ -493,7 +494,7 @@ omit [∀ (x : M), IsTopologicalAddGroup (V x)] [∀ (x : M), ContinuousSMul ℝ
493494
[VectorBundle ℝ F V] in
494495
lemma congr_σ_smoothBumpFunction (cov : CovariantDerivative I F V) [T2Space M] [IsManifold I ∞ M]
495496
(X : Π x : M, TangentSpace I x) {σ : Π x : M, V x}
496-
(hσ : MDifferentiableAt I (I.prod 𝓘(ℝ, F)) (fun x ↦ TotalSpace.mk' F x (σ x)) x)
497+
(hσ : MDifferentiableAt% (T% σ) x)
497498
(f : SmoothBumpFunction I x) :
498499
cov X ((f : M → ℝ) • σ) x = cov X σ x := by
499500
rw [cov.leibniz _ _ _ _ hσ]
@@ -511,7 +512,7 @@ omit [∀ (x : M), IsTopologicalAddGroup (V x)] [∀ (x : M), ContinuousSMul ℝ
511512
lemma congr_σ_of_eventuallyEq
512513
(cov : CovariantDerivative I F V) [T2Space M] [IsManifold I ∞ M]
513514
(X : Π x : M, TangentSpace I x) {σ σ' : Π x : M, V x} {x : M} {s : Set M} (hs : s ∈ nhds x)
514-
(hσ : MDifferentiableAt I (I.prod 𝓘(ℝ, F)) (fun x ↦ TotalSpace.mk' F x (σ x)) x)
515+
(hσ : MDifferentiableAt% (T% σ) x)
515516
(hσσ' : ∀ x ∈ s, σ x = σ' x) :
516517
cov X σ x = cov X σ' x := by
517518
-- Choose a smooth bump function ψ with support around `x` contained in `s`
@@ -548,8 +549,8 @@ omit [∀ (x : M), IsTopologicalAddGroup (V x)] [∀ (x : M), ContinuousSMul ℝ
548549
[VectorBundle ℝ F V] [FiniteDimensional ℝ E] in
549550
lemma differenceAux_smul_eq (cov cov' : CovariantDerivative I F V)
550551
(X : Π x : M, TangentSpace I x) (σ : Π x : M, V x) (f : M → ℝ) {x : M}
551-
(hσ : MDifferentiableAt I (I.prod 𝓘(ℝ, F)) (fun x ↦ TotalSpace.mk' F x (σ x)) x)
552-
(hf : MDifferentiableAt I 𝓘(ℝ) f x) :
552+
(hσ : MDifferentiableAt% (T% σ) x)
553+
(hf : MDifferentiableAt% f x) :
553554
differenceAux cov cov' X ((f : M → ℝ) • σ) x = f x • differenceAux cov cov' X σ x:=
554555
calc _
555556
_ = cov X ((f : M → ℝ) • σ) x - cov' X ((f : M → ℝ) • σ) x := rfl
@@ -572,8 +573,8 @@ omit [∀ (x : M), IsTopologicalAddGroup (V x)] [∀ (x : M), ContinuousSMul ℝ
572573
lemma differenceAux_tensorial (cov cov' : CovariantDerivative I F V) [T2Space M] [IsManifold I ∞ M]
573574
[FiniteDimensional ℝ F] [ContMDiffVectorBundle 1 F V I]
574575
{X X' : Π x : M, TangentSpace I x} {σ σ' : Π x : M, V x} {x₀ : M}
575-
(hσ : MDifferentiableAt I (I.prod 𝓘(ℝ, F)) (fun x ↦ TotalSpace.mk' F x (σ x)) x₀)
576-
(hσ' : MDifferentiableAt I (I.prod 𝓘(ℝ, F)) (fun x ↦ TotalSpace.mk' F x (σ' x)) x₀)
576+
(hσ : MDifferentiableAt% (T% σ) x₀)
577+
(hσ' : MDifferentiableAt% (T% σ') x₀)
577578
(hXX' : X x₀ = X' x₀) (hσσ' : σ x₀ = σ' x₀) :
578579
differenceAux cov cov' X σ x₀ = differenceAux cov cov' X' σ' x₀ := by
579580
trans cov.differenceAux cov' X' σ x₀
@@ -647,9 +648,9 @@ This is a vector bundle analogue of `contMDiff_of_tsupport`: the total space of
647648
but we only consider sections of the form `ψ s`. -/
648649
lemma _root_.contMDiff_section_of_smul_smoothBumpFunction [T2Space M] [IsManifold I ∞ M]
649650
{s : Π (x : M), V x} {ψ : SmoothBumpFunction I x} {t : Set M}
650-
(hs : ContMDiffOn I (I.prod 𝓘(ℝ, F)) n (fun x ↦ TotalSpace.mk' F x (s x)) t)
651+
(hs : ContMDiffOn I (I.prod 𝓘(ℝ, F)) n (T% s) t)
651652
(ht : IsOpen t) (ht' : tsupport ψ ⊆ t) (hn : n ≤ ∞) :
652-
ContMDiff I (I.prod 𝓘(ℝ, F)) n (fun x ↦ TotalSpace.mk' F x (ψ x • s x)) := by
653+
ContMDiff I (I.prod 𝓘(ℝ, F)) n (T% fun x ↦ (ψ x • s x)) := by
653654
apply contMDiff_of_contMDiffOn_union_of_isOpen
654655
(contMDiffOn_smul_section (ψ.contMDiff.of_le hn).contMDiffOn hs) ?_ ?_ ht
655656
(isOpen_compl_iff.mpr <| isClosed_tsupport ψ)
@@ -667,15 +668,15 @@ but we only consider sections of the form `ψ s`. -/
667668
lemma _root_.contMDiff_section_of_smul_smoothBumpFunction' [T2Space M] [IsManifold I ∞ M]
668669
{s : Π (x : M), V x} {ψ : SmoothBumpFunction I x} (hn : n ≤ ∞)
669670
(hs : ∀ x ∈ tsupport ψ,
670-
ContMDiffAt I (I.prod 𝓘(ℝ, F)) n (fun x ↦ TotalSpace.mk' F x (ψ x • s x)) x) :
671-
ContMDiff I (I.prod 𝓘(ℝ, F)) n (fun x ↦ TotalSpace.mk' F x (ψ x • s x)) := by
671+
ContMDiffAt I (I.prod 𝓘(ℝ, F)) n (T% fun x ↦ (ψ x • s x)) x) :
672+
ContMDiff I (I.prod 𝓘(ℝ, F)) n (T% fun x ↦ (ψ x • s x)) := by
672673
-- apply contMDiff_of_smul_smoothBumpFunction (s := s) (hn := hn) --?_ ?_ ?_ ?_
673674
sorry
674675

675676
omit [∀ (x : M), IsTopologicalAddGroup (V x)] [∀ (x : M), ContinuousSMul ℝ (V x)] in
676677
lemma contMDiff_extend [IsManifold I ∞ M] [FiniteDimensional ℝ F] [T2Space M]
677678
[ContMDiffVectorBundle ∞ F V I] {x : M} (σ₀ : V x) :
678-
ContMDiff I (I.prod 𝓘(ℝ, F)) ∞ (fun x ↦ TotalSpace.mk' F x (extend I F σ₀ x)) := by
679+
ContMDiff I (I.prod 𝓘(ℝ, F)) ∞ (T% extend I F σ₀) := by
679680
letI t := trivializationAt F V x
680681
letI ht := t.open_baseSet.mem_nhds (FiberBundle.mem_baseSet_trivializationAt' x)
681682
have hx : x ∈ t.baseSet := by exact FiberBundle.mem_baseSet_trivializationAt' x
@@ -689,7 +690,7 @@ lemma contMDiff_extend [IsManifold I ∞ M] [FiniteDimensional ℝ F] [T2Space M
689690
omit [∀ (x : M), IsTopologicalAddGroup (V x)] [∀ (x : M), ContinuousSMul ℝ (V x)] in
690691
lemma mdifferentiable_extend [IsManifold I ∞ M] [FiniteDimensional ℝ F] [T2Space M]
691692
[ContMDiffVectorBundle ∞ F V I] {x : M} (σ₀ : V x) :
692-
MDifferentiable I (I.prod 𝓘(ℝ, F)) (fun x ↦ TotalSpace.mk' F x (extend I F σ₀ x)) :=
693+
MDifferentiable% (T% extend I F σ₀) :=
693694
contMDiff_extend σ₀ |>.mdifferentiable (by simp)
694695

695696
/-- The difference of two covariant derivatives, as a tensorial map -/
@@ -801,8 +802,7 @@ lemma exists_endomorph [FiniteDimensional ℝ E] [FiniteDimensional ℝ E']
801802
(cov : CovariantDerivative 𝓘(ℝ, E) E' (Bundle.Trivial E E')) :
802803
∃ (A : E → E →L[ℝ] E' →L[ℝ] E'),
803804
∀ X : (x : E) → TangentSpace 𝓘(ℝ, E) x, ∀ σ : (x : E) → Trivial E E' x, ∀ x : E,
804-
MDifferentiableAt 𝓘(ℝ, E) (𝓘(ℝ, E).prod 𝓘(ℝ, E'))
805-
(fun x' ↦ TotalSpace.mk' E' x' (σ x')) x →
805+
MDifferentiableAt% (T% σ) x →
806806
cov X σ x = (CovariantDerivative.of_endomorphism A) X σ x := by
807807
use cov.endomorph_of_trivial_aux'''
808808
intro X σ x hσ
@@ -847,10 +847,10 @@ variable [IsManifold I 1 M]
847847
variable {cov : CovariantDerivative I F V}
848848

849849
lemma proj_mderiv {X : Π x : M, TangentSpace I x} {σ : Π x : M, V x} (x : M)
850-
(hX : MDifferentiableAt I I.tangent (fun x ↦ TotalSpace.mk' E x (X x)) x)
851-
(hσ : MDifferentiableAt I (I.prod 𝓘(ℝ, F)) (fun x ↦ TotalSpace.mk' F x (σ x)) x) :
850+
(hX : MDifferentiableAt% (T% X) x)
851+
(hσ : MDifferentiableAt% (T% σ) x) :
852852
cov X σ x = cov.proj (σ x)
853-
(mfderiv I (I.prod 𝓘(ℝ, F)) (fun x ↦ TotalSpace.mk' F x (σ x)) x (X x)) := by
853+
(mfderiv I (I.prod 𝓘(ℝ, F)) (T% σ) x (X x)) := by
854854
sorry
855855

856856
end horiz
@@ -886,47 +886,46 @@ variable (X) in
886886
lemma torsion_zero : torsion cov 0 X = 0 := by
887887
ext x
888888
simp [torsion]
889-
sorry -- missing lemma?
890889

891890
variable (X) in
892891
@[simp]
893892
lemma torsion_zero' : torsion cov X 0 = 0 := by rw [torsion_antisymm, torsion_zero]; simp
894893

895894
variable (Y) in
896895
lemma torsion_add_left [CompleteSpace E]
897-
(hX : MDifferentiable I I.tangent (fun x ↦ TotalSpace.mk' E x (X x)))
898-
(hX' : MDifferentiable I I.tangent (fun x ↦ TotalSpace.mk' E x (X' x))) :
896+
(hX : MDifferentiable% (T% X))
897+
(hX' : MDifferentiable% (T% X')) :
899898
torsion cov (X + X') Y = torsion cov X Y + torsion cov X' Y := by
900899
ext x
901900
simp [torsion, cov.addX]
902901
rw [cov.addσ _ X X' _ (hX x) (hX' x), VectorField.mlieBracket_add_left (hX x) (hX' x)]
903902
module
904903

905904
lemma torsion_add_right [CompleteSpace E]
906-
(hX : MDifferentiable I I.tangent (fun x ↦ TotalSpace.mk' E x (X x)))
907-
(hX' : MDifferentiable I I.tangent (fun x ↦ TotalSpace.mk' E x (X' x))) :
905+
(hX : MDifferentiable% (T% X))
906+
(hX' : MDifferentiable% (T% X')) :
908907
torsion cov Y (X + X') = torsion cov Y X + torsion cov Y X' := by
909908
rw [torsion_antisymm, torsion_add_left _ hX hX', torsion_antisymm X, torsion_antisymm X']; module
910909

911910
-- TODO: prove (for sections in any vector bundle); follow-up to 24932
912-
lemma _root_.VectorField.mlieBracket_fun_smul_left' {f : M → ℝ} (hf : MDifferentiableAt I 𝓘(ℝ) f x)
911+
lemma _root_.VectorField.mlieBracket_fun_smul_left' {f : M → ℝ} (hf : MDifferentiableAt% f x)
913912
{V W : Π x : M, TangentSpace I x}
914-
(hV : MDifferentiableAt I I.tangent (fun x ↦ TotalSpace.mk' E x (V x)) x) :
913+
(hV : MDifferentiableAt% (T% V) x) :
915914
VectorField.mlieBracket I (fun y ↦ f y • V y) W x =
916915
- (mfderiv I 𝓘(ℝ) f x) (W x) • (V x) + (f x) • VectorField.mlieBracket I V W x := by
917916
sorry
918917

919918
-- TODO: prove (for sections in any vector bundle); follow-up to 24932
920-
lemma _root_.VectorField.mlieBracket_smul_left' {f : M → ℝ} (hf : MDifferentiableAt I 𝓘(ℝ) f x)
919+
lemma _root_.VectorField.mlieBracket_smul_left' {f : M → ℝ} (hf : MDifferentiableAt% f x)
921920
{V W : Π x : M, TangentSpace I x}
922-
(hV : MDifferentiableAt I I.tangent (fun x ↦ TotalSpace.mk' E x (V x)) x) :
921+
(hV : MDifferentiableAt% (T% V) x) :
923922
VectorField.mlieBracket I (f • V) W x =
924923
- (mfderiv I 𝓘(ℝ) f x) (W x) • (V x) + (f x) • VectorField.mlieBracket I V W x := by
925924
sorry
926925

927926
variable (Y) in
928-
lemma torsion_smul_left [CompleteSpace E] {f : M → ℝ} (hf : MDifferentiable I 𝓘(ℝ) f)
929-
(hX : MDifferentiable I I.tangent (fun x ↦ TotalSpace.mk' E x (X x))) :
927+
lemma torsion_smul_left [CompleteSpace E] {f : M → ℝ} (hf : MDifferentiable% f)
928+
(hX : MDifferentiable% (T% X)) :
930929
torsion cov (f • X) Y = f • torsion cov X Y := by
931930
simp only [torsion, cov.smulX]
932931
ext x
@@ -936,8 +935,8 @@ lemma torsion_smul_left [CompleteSpace E] {f : M → ℝ} (hf : MDifferentiable
936935
abel
937936

938937
variable (X) in
939-
lemma torsion_smul_right [CompleteSpace E] {f : M → ℝ} (hf : MDifferentiable I 𝓘(ℝ) f)
940-
(hY : MDifferentiable I I.tangent (fun x ↦ TotalSpace.mk' E x (Y x))) :
938+
lemma torsion_smul_right [CompleteSpace E] {f : M → ℝ} (hf : MDifferentiable% f)
939+
(hY : MDifferentiable% (T% Y)) :
941940
torsion cov X (f • Y) = f • torsion cov X Y := by
942941
rw [torsion_antisymm, torsion_smul_left X hf hY, torsion_antisymm X]; module
943942

0 commit comments

Comments
 (0)