import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Coordinates.CenteredChartOperators import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Coordinates.ConnectionFrame import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Tensor.ManifoldTraceDerivative /-! # The connection on a variable centered coordinate field A finite smooth frame expansion establishes differentiability and then computes the actual connection using its Leibniz rule. -/ set_option autoImplicit false set_option maxSynthPendingDepth 3 open scoped Manifold ContDiff Bundle BigOperators Topology open Filter universe u namespace PoincareMT.ReducedLength variable {n : โ„•} {M : Type u} [TopologicalSpace M] [ChartedSpace (EuclideanSpace โ„ (Fin n)) M] [IsManifold (๐“ก n) โˆž M] local notation "E" => EuclideanSpace โ„ (Fin n) set_option backward.isDefEq.respectTransparency false in theorem chartVectorField_variable_expansion (p : M) (c : M โ†’ E) {ฮน : Type*} [Fintype ฮน] (b : Module.Basis ฮน โ„ E) : (fun q โ†ฆ chartVectorField p (c q) q) = (fun q โ†ฆ โˆ‘ i, b.repr (c q) i โ€ข chartVectorField p (b i) q) := by funext q let L : E โ†’L[โ„] TangentSpace (๐“ก n) q := (mfderiv (๐“ก n) (๐“ก n) (chartAt E p) q).inverse change L (c q) = โˆ‘ i, b.repr (c q) i โ€ข L (b i) calc _ = L (โˆ‘ i, b.repr (c q) i โ€ข b i) := congrArg L (b.sum_repr (c q)).symm _ = _ := by simp only [map_sum, map_smul] theorem mdifferentiableAt_chartVectorField_variable (p : M) (c : M โ†’ E) (hc : MDifferentiableAt (๐“ก n) (๐“ก n) c p) : MDifferentiableAt (๐“ก n) ((๐“ก n).prod (๐“ก n)) (T% (fun q โ†ฆ chartVectorField p (c q) q)) p := by let b := (stdOrthonormalBasis โ„ E).toBasis have hsum : MDifferentiableAt (๐“ก n) ((๐“ก n).prod (๐“ก n)) (T% (fun q โ†ฆ โˆ‘ i, b.repr (c q) i โ€ข chartVectorField p (b i) q)) p := by apply MDifferentiableAt.sum_section intro i _ have ha : MDifferentiableAt (๐“ก n) (๐“˜(โ„, โ„)) (fun q โ†ฆ b.repr (c q) i) p := (b.coord i).toContinuousLinearMap.mdifferentiableAt.comp p hc have hv := ((chartVectorField_smooth p (b i)).contMDiffAt ((chartAt E p).open_source.mem_nhds (mem_chart_source E p))).mdifferentiableAt (by simp) exact ha.smul_section hv apply hsum.congr_of_eventuallyEq exact Filter.Eventually.of_forall fun q โ†ฆ congrArg (Bundle.TotalSpace.mk q) (congrFun (chartVectorField_variable_expansion p c b) q) set_option backward.isDefEq.respectTransparency false in theorem connection_chartVectorField_variable {g : RiemannianMetric n M} (D : LeviCivitaData g) (p : M) (c : M โ†’ E) (hc : MDifferentiableAt (๐“ก n) (๐“ก n) c p) (X : TangentSpace (๐“ก n) p) : let A : E := frozenConnectionEndomorphism D p X (c p) (D.connection (fun q โ†ฆ chartVectorField p (c q) q) p X : E) = A + mvfderiv (๐“ก n) c p X := by dsimp only let b := (stdOrthonormalBasis โ„ E).toBasis let a := fun i q โ†ฆ b.repr (c q) i let B := frozenConnectionEndomorphism D p X have ha (i : Fin (Module.finrank โ„ E)) : MDifferentiableAt (๐“ก n) (๐“˜(โ„, โ„)) (a i) p := (b.coord i).toContinuousLinearMap.mdifferentiableAt.comp p hc have hframe (i : Fin (Module.finrank โ„ E)) : MDifferentiableAt (๐“ก n) ((๐“ก n).prod (๐“ก n)) (T% (chartVectorField p (b i))) p := ((chartVectorField_smooth p (b i)).contMDiffAt ((chartAt E p).open_source.mem_nhds (mem_chart_source E p))).mdifferentiableAt (by simp) have h := connection_germ_expansion D (fun q โ†ฆ chartVectorField p (c q) q) (fun i โ†ฆ chartVectorField p (b i)) a p X (mdifferentiableAt_chartVectorField_variable p c hc) hframe ha (Filter.Eventually.of_forall (congrFun (chartVectorField_variable_expansion p c b))) have hconn (i : Fin (Module.finrank โ„ E)) : D.connection (chartVectorField p (b i)) p X = B (b i) := (connection_frozenExtend_eq_chartVectorField D p X (b i)).symm have hder (i : Fin (Module.finrank โ„ E)) : mvfderiv (๐“ก n) (a i) p X = b.repr (mvfderiv (๐“ก n) c p X) i := mvfderiv_const_clm (b.coord i).toContinuousLinearMap c p hc X rw [h] simp only [hconn, hder, chartVectorField_self, Finset.sum_add_distrib] have hfirst : (โˆ‘ i, a i p โ€ข B (b i)) = B (c p) := by simp only [โ† map_smul, โ† map_sum] change B (โˆ‘ i, b.repr (c p) i โ€ข b i) = B (c p) rw [b.sum_repr] rw [hfirst, b.sum_repr] theorem connection_of_eventuallyEq_chartVectorField {g : RiemannianMetric n M} (D : LeviCivitaData g) (p : M) (c : M โ†’ E) (hc : MDifferentiableAt (๐“ก n) (๐“ก n) c p) (ฯƒ : (q : M) โ†’ TangentSpace (๐“ก n) q) (heq : ฯƒ =แถ [๐“ p] (fun q โ†ฆ chartVectorField p (c q) q)) (X : TangentSpace (๐“ก n) p) : let A : E := frozenConnectionEndomorphism D p X (c p) (D.connection ฯƒ p X : E) = A + mvfderiv (๐“ก n) c p X := by dsimp only have hv := mdifferentiableAt_chartVectorField_variable p c hc have hฯƒ : MDifferentiableAt (๐“ก n) ((๐“ก n).prod (๐“ก n)) (T% ฯƒ) p := by apply hv.congr_of_eventuallyEq filter_upwards [heq] with q hq exact congrArg (Bundle.TotalSpace.mk q) hq rw [D.connection.isCovariantDerivativeOnUniv.congr_of_eventuallyEq hฯƒ hv (by simp) heq] exact connection_chartVectorField_variable D p c hc X end PoincareMT.ReducedLength