import PoincareLib.Geometry.Riemannian.MinimalSurface.Sphere.Analysis.Lipschitz.Derivative set_option autoImplicit false set_option backward.isDefEq.respectTransparency false noncomputable section open Set Filter Bundle open scoped Manifold ContDiff Topology Bundle NNReal namespace PoincareMT variable {E F M : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [NormedAddCommGroup F] [NormedSpace ℝ F] [EMetricSpace M] [ChartedSpace F M] [IsManifold π“˜(ℝ, F) ∞ M] [RiemannianBundle (TangentSpace π“˜(ℝ, F) : M β†’ Type _)] [IsContinuousRiemannianBundle F (TangentSpace π“˜(ℝ, F) : M β†’ Type _)] [IsRiemannianManifold π“˜(ℝ, F) M] /-- The differential of a metric Lipschitz map has the same norm bound. Normalized target charts allow the coordinate loss to tend to one. -/ theorem m67_norm_mfderiv_apply_le_of_lipschitzOn {f : E β†’ M} {S : Set E} (hS : IsOpen S) {K : ℝβ‰₯0} (hf : LipschitzOnWith K f S) {z : E} (hz : z ∈ S) (v : E) : β€–mfderiv π“˜(ℝ, E) π“˜(ℝ, F) f z vβ€– ≀ (K : ℝ) * β€–vβ€– := by by_cases hd : MDifferentiableAt π“˜(ℝ, E) π“˜(ℝ, F) f z Β· apply (le_iff_forall_one_lt_le_mulβ‚€ (mul_nonneg K.coe_nonneg (norm_nonneg v))).mpr intro c hc let C : ℝβ‰₯0 := ⟨c, zero_lt_one.trans hc |>.le⟩ have hC : 1 < C := hc let e := chartAt F (f z) have he : e.MDifferentiable π“˜(ℝ, F) π“˜(ℝ, F) := mdifferentiable_chart (f z) have hx : f z ∈ e.source := mem_chart_source F (f z) let n := M40.normalizedSmoothChart e he hx have hn : f z ∈ n.source := by simpa only [n, M40.normalizedSmoothChart_source] using hx have hns : ContMDiffOn π“˜(ℝ, F) π“˜(ℝ, TangentSpace π“˜(ℝ, F) (f z)) ∞ n n.source := M40.normalizedSmoothChart_contMDiffOn e he hx contMDiffOn_chart obtain ⟨R, hR, _, _, hLip⟩ := M40.normalizedSmoothChart_exists_lipschitz_ball e he hx contMDiffOn_chart contMDiffOn_chart_symm C hC have hN : n.symm '' Metric.ball (n (f z)) R ∈ 𝓝 (f z) := by simpa only [n.left_inv hn] using n.symm.image_mem_nhds (n.map_source hn) (Metric.ball_mem_nhds _ hR) let U := S ∩ f ⁻¹' (n.symm '' Metric.ball (n (f z)) R) have hU : U ∈ 𝓝 z := inter_mem (hS.mem_nhds hz) (hd.continuousAt.preimage_mem_nhds hN) have hcomp : LipschitzOnWith (C * K) (n ∘ f) U := hLip.comp (hf.mono inter_subset_left) (fun _ hu => hu.2) have hbound := norm_fderiv_le_of_lipschitzOn ℝ hU hcomp have hnd := (hns.contMDiffAt (n.open_source.mem_nhds hn)).mdifferentiableAt (by norm_num) have hchain : fderiv ℝ (n ∘ f) z v = mfderiv π“˜(ℝ, E) π“˜(ℝ, F) f z v := by have hc := M40.normalizedSmoothChart_mfderiv_apply e he hx (mfderiv π“˜(ℝ, E) π“˜(ℝ, F) f z v) rw [← mfderiv_comp_apply z hnd hd, mfderiv_eq_fderiv] at hc exact hc rw [← hchain] calc _ ≀ β€–fderiv ℝ (n ∘ f) zβ€– * β€–vβ€– := ContinuousLinearMap.le_opNorm _ _ _ ≀ ((C * K : ℝβ‰₯0) : ℝ) * β€–vβ€– := mul_le_mul_of_nonneg_right hbound (norm_nonneg _) _ = _ := by change (c * (K : ℝ)) * β€–vβ€– = _; ring Β· rw [mfderiv_zero_of_not_mdifferentiableAt hd] erw [zero_apply, norm_zero] positivity end PoincareMT namespace PoincareMT variable {E F M N : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [NormedAddCommGroup F] [NormedSpace ℝ F] [EMetricSpace M] [ChartedSpace E M] [IsManifold π“˜(ℝ, E) ∞ M] [RiemannianBundle (TangentSpace π“˜(ℝ, E) : M β†’ Type _)] [IsContinuousRiemannianBundle E (TangentSpace π“˜(ℝ, E) : M β†’ Type _)] [IsRiemannianManifold π“˜(ℝ, E) M] [EMetricSpace N] [ChartedSpace F N] [IsManifold π“˜(ℝ, F) ∞ N] [RiemannianBundle (TangentSpace π“˜(ℝ, F) : N β†’ Type _)] [IsContinuousRiemannianBundle F (TangentSpace π“˜(ℝ, F) : N β†’ Type _)] [IsRiemannianManifold π“˜(ℝ, F) N] /-- A smooth Lipschitz map between Riemannian manifolds contracts tangent vectors by at most its metric Lipschitz constant. -/ theorem m67_norm_mfderiv_apply_le_of_lipschitz {f : M β†’ N} (hd : MDifferentiable π“˜(ℝ, E) π“˜(ℝ, F) f) {K : ℝβ‰₯0} (hf : LipschitzWith K f) (x : M) (v : TangentSpace π“˜(ℝ, E) x) : β€–mfderiv π“˜(ℝ, E) π“˜(ℝ, F) f x vβ€– ≀ (K : ℝ) * β€–vβ€– := by apply (le_iff_forall_one_lt_le_mulβ‚€ (mul_nonneg K.coe_nonneg (norm_nonneg v))).mpr intro c hc let C : ℝβ‰₯0 := ⟨c, zero_lt_one.trans hc |>.le⟩ have hC : 1 < C := hc let e := chartAt E x have he : e.MDifferentiable π“˜(ℝ, E) π“˜(ℝ, E) := mdifferentiable_chart x have hx : x ∈ e.source := mem_chart_source E x let n := M40.normalizedSmoothChart e he hx have hn : x ∈ n.source := by simpa only [n, M40.normalizedSmoothChart_source] using hx have hns := M40.normalizedSmoothChart_contMDiffOn e he hx contMDiffOn_chart have hni := SurgeryComparison.Transport.normalizedSmoothChart_symm_contMDiffOn e he hx contMDiffOn_chart_symm obtain ⟨R, hR, htarget, hLip, _⟩ := M40.normalizedSmoothChart_exists_lipschitz_ball e he hx contMDiffOn_chart contMDiffOn_chart_symm C hC have hcomp : LipschitzOnWith (K * C) (f ∘ n.symm) (Metric.ball (n x) R) := hf.comp_lipschitzOnWith hLip have hb := m67_norm_mfderiv_apply_le_of_lipschitzOn (F := F) Metric.isOpen_ball hcomp (Metric.mem_ball_self hR) (mfderiv π“˜(ℝ, E) π“˜(ℝ, TangentSpace π“˜(ℝ, E) x) n x v) have hnd := (hns.contMDiffAt (n.open_source.mem_nhds hn)).mdifferentiableAt (by norm_num) have hnid := (hni.contMDiffAt (n.open_target.mem_nhds (n.map_source hn))).mdifferentiableAt (by norm_num) have hlocal : (f ∘ n.symm) ∘ n =αΆ [𝓝 x] f := by filter_upwards [n.open_source.mem_nhds hn] with y hy exact congrArg f (n.left_inv hy) have hchain := mfderiv_comp x ((hd _).comp (n x) hnid) hnd rw [hlocal.mfderiv_eq] at hchain have hnorm : β€–mfderiv π“˜(ℝ, E) π“˜(ℝ, TangentSpace π“˜(ℝ, E) x) n x vβ€– = β€–vβ€– := by rw [norm_tangentSpace_vectorSpace] exact congrArg norm (M40.normalizedSmoothChart_mfderiv_apply e he hx v) have hb' : β€–mfderiv π“˜(ℝ, E) π“˜(ℝ, F) f x vβ€– ≀ ((K * C : ℝβ‰₯0) : ℝ) * β€–vβ€– := by have hnorm_target (w : TangentSpace π“˜(ℝ, F) (f x)) : β€–(show TangentSpace π“˜(ℝ, F) (f (n.symm (n x))) from w)β€– = β€–wβ€– := by rw [n.left_inv hn] rw [hnorm_target, hnorm] at hb have happ := congrArg (fun L => L v) hchain change mfderiv π“˜(ℝ, E) π“˜(ℝ, F) f x v = mfderiv π“˜(ℝ, TangentSpace π“˜(ℝ, E) x) π“˜(ℝ, F) (f ∘ n.symm) (n x) (mfderiv π“˜(ℝ, E) π“˜(ℝ, TangentSpace π“˜(ℝ, E) x) n x v) at happ rw [← happ] at hb exact hb calc _ ≀ ((K * C : ℝβ‰₯0) : ℝ) * β€–vβ€– := hb' _ = _ := by change ((K : ℝ) * c) * β€–vβ€– = _; ring end PoincareMT