import Mathlib.Geometry.Manifold.MFDeriv.NormedSpace import OAI.AlgebraicGeometry.CycleClass.Geometric.ComplexNormalBlock import OAI.AlgebraicGeometry.CycleClass.Geometric.NormalPlaneNeighborhood import Mathlib.Analysis.Calculus.FDeriv.Prod import Mathlib.Analysis.Calculus.FDeriv.Congr import Mathlib.Analysis.Calculus.FDeriv.OfCompLeft import Mathlib.Geometry.Manifold.MFDeriv.Atlas import Mathlib.Geometry.Manifold.MFDeriv.FDeriv /-! # Normal Derivative -/ namespace OAI.AlgebraicGeometry.CycleClass.Geometric.NormalDerivative.Cycles noncomputable section /-! # Derivatives of genuine normal coordinate changes Restricting a differentiable map to the horizontal coordinate plane and then projecting to its normal coordinate gives a locally zero map when the original map preserves that plane. Uniqueness of the derivative makes the lower-left derivative block zero. Applying the same argument to the actual inverse proves the two preservation hypotheses needed by the previously constructed complex normal-block equivalence. -/ open Filter open scoped _root_.Topology _root_.Manifold section GeneralDerivative variable {๐•œ : Type*} [NontriviallyNormedField ๐•œ] variable {E F G H : Type*} variable [NormedAddCommGroup E] [NormedSpace ๐•œ E] variable [NormedAddCommGroup F] [NormedSpace ๐•œ F] variable [NormedAddCommGroup G] [NormedSpace ๐•œ G] variable [NormedAddCommGroup H] [NormedSpace ๐•œ H] /-- The lower-left derivative block vanishes when the normal component of the restriction to the horizontal plane is locally zero. -/ theorem normalDerivative_lowerLeft_eq_zero {ฮฆ : E ร— F โ†’ G ร— H} {D : (E ร— F) โ†’L[๐•œ] (G ร— H)} (hd : HasFDerivAt ฮฆ D (0, 0)) (hz : โˆ€แถ  x : E in ๐“ 0, (ฮฆ (x, 0)).2 = 0) : (ContinuousLinearMap.snd ๐•œ G H).comp (D.comp (ContinuousLinearMap.inl ๐•œ E F)) = 0 := by have hin : HasFDerivAt (fun x : E => (x, (0 : F))) (ContinuousLinearMap.inl ๐•œ E F) (0 : E) := (ContinuousLinearMap.inl ๐•œ E F).hasFDerivAt have hrestrict : HasFDerivAt (fun x : E => (ฮฆ (x, 0)).2) ((ContinuousLinearMap.snd ๐•œ G H).comp (D.comp (ContinuousLinearMap.inl ๐•œ E F))) 0 := by exact (hd.comp (0 : E) hin).snd exact hrestrict.unique ((hasFDerivAt_const (๐•œ := ๐•œ) (0 : H) (0 : E)).congr_of_eventuallyEq hz) /-- Consequently the actual derivative maps every horizontal tangent vector to a horizontal vector. -/ theorem normalDerivative_preserves_horizontal {ฮฆ : E ร— F โ†’ G ร— H} {D : (E ร— F) โ†’L[๐•œ] (G ร— H)} (hd : HasFDerivAt ฮฆ D (0, 0)) (hz : โˆ€แถ  x : E in ๐“ 0, (ฮฆ (x, 0)).2 = 0) (x : E) : (D (x, 0)).2 = 0 := congrArg (fun L : E โ†’L[๐•œ] H => L x) (normalDerivative_lowerLeft_eq_zero hd hz) /-- Actual source-plane preservation implies preservation by the derivative; the neighborhood condition is derived from source openness. -/ theorem normalCoordinateDerivative_preserves_horizontal (e : OpenPartialHomeomorph (E ร— F) (E ร— F)) (D : (E ร— F) โ†’L[๐•œ] (E ร— F)) (h0 : (0, 0) โˆˆ e.source) (hd : HasFDerivAt e D (0, 0)) (hpres : โˆ€ z โˆˆ e.source, z.2 = 0 โ†’ (e z).2 = 0) : โˆ€ x : E, (D (x, 0)).2 = 0 := normalDerivative_preserves_horizontal hd (NormalPlaneNeighborhood.Cycles.normalPlane_eventually_map_snd_eq_zero e h0 hpres) /-- The actual inverse has the inverse derivative at the origin. -/ theorem normalCoordinateInverse_hasFDerivAt (e : OpenPartialHomeomorph (E ร— F) (E ร— F)) (L : (E ร— F) โ‰ƒL[๐•œ] (E ร— F)) (h0 : (0, 0) โˆˆ e.source) (he0 : e (0, 0) = (0, 0)) (hd : HasFDerivAt e L.toContinuousLinearMap (0, 0)) : HasFDerivAt e.symm L.symm.toContinuousLinearMap (0, 0) := by apply e.hasFDerivAt_symm (NormalPlaneNeighborhood.Cycles.normalPlane_zero_mem_target e h0 he0) simpa only [NormalPlaneNeighborhood.Cycles.normalPlane_symm_apply_zero e h0 he0] using hd /-- Actual preservation of the horizontal plane by the inverse gives the corresponding preservation by the inverse derivative. -/ theorem normalCoordinateInverseDerivative_preserves_horizontal (e : OpenPartialHomeomorph (E ร— F) (E ร— F)) (L : (E ร— F) โ‰ƒL[๐•œ] (E ร— F)) (h0 : (0, 0) โˆˆ e.source) (he0 : e (0, 0) = (0, 0)) (hd : HasFDerivAt e L.toContinuousLinearMap (0, 0)) (hpres : โˆ€ z โˆˆ e.target, z.2 = 0 โ†’ (e.symm z).2 = 0) : โˆ€ x : E, (L.symm (x, 0)).2 = 0 := normalDerivative_preserves_horizontal (normalCoordinateInverse_hasFDerivAt e L h0 he0 hd) (NormalPlaneNeighborhood.Cycles.normalPlane_eventually_symm_snd_eq_zero e h0 he0 hpres) /-- Exact preservation of the zero normal locus supplies both derivative preservation laws, with no independent linear hypothesis. -/ theorem normalCoordinateDerivative_horizontal_pair (e : OpenPartialHomeomorph (E ร— F) (E ร— F)) (L : (E ร— F) โ‰ƒL[๐•œ] (E ร— F)) (h0 : (0, 0) โˆˆ e.source) (he0 : e (0, 0) = (0, 0)) (hd : HasFDerivAt e L.toContinuousLinearMap (0, 0)) (hpres : โˆ€ z โˆˆ e.source, (e z).2 = 0 โ†” z.2 = 0) : (โˆ€ x : E, (L (x, 0)).2 = 0) โˆง (โˆ€ x : E, (L.symm (x, 0)).2 = 0) := by constructor ยท exact normalCoordinateDerivative_preserves_horizontal e L.toContinuousLinearMap h0 hd (fun z hz => (hpres z hz).mpr) ยท exact normalDerivative_preserves_horizontal (normalCoordinateInverse_hasFDerivAt e L h0 he0 hd) (NormalPlaneNeighborhood.Cycles.normalPlane_eventually_symm_snd_eq_zero_of_iff e h0 he0 hpres) end GeneralDerivative variable {E F : Type*} variable [NormedAddCommGroup E] [NormedSpace โ„‚ E] variable [NormedAddCommGroup F] [NormedSpace โ„‚ F] /-- The genuine normal derivative is invertible, using the preservation laws proved from the nonlinear map and its actual inverse. -/ def normalCoordinateDerivativeBlock (e : OpenPartialHomeomorph (E ร— F) (E ร— F)) (L : (E ร— F) โ‰ƒL[โ„‚] (E ร— F)) (h0 : (0, 0) โˆˆ e.source) (he0 : e (0, 0) = (0, 0)) (hd : HasFDerivAt e L.toContinuousLinearMap (0, 0)) (hpres : โˆ€ z โˆˆ e.source, (e z).2 = 0 โ†” z.2 = 0) : F โ‰ƒL[โ„‚] F := Geometric.ComplexNormalBlock.Cycles.normalBlock L (normalCoordinateDerivative_horizontal_pair e L h0 he0 hd hpres).1 (normalCoordinateDerivative_horizontal_pair e L h0 he0 hd hpres).2 @[simp] theorem normalCoordinateDerivativeBlock_apply (e : OpenPartialHomeomorph (E ร— F) (E ร— F)) (L : (E ร— F) โ‰ƒL[โ„‚] (E ร— F)) (h0 : (0, 0) โˆˆ e.source) (he0 : e (0, 0) = (0, 0)) (hd : HasFDerivAt e L.toContinuousLinearMap (0, 0)) (hpres : โˆ€ z โˆˆ e.source, (e z).2 = 0 โ†” z.2 = 0) (y : F) : normalCoordinateDerivativeBlock e L h0 he0 hd hpres y = (L (0, y)).2 := rfl @[simp] theorem normalCoordinateDerivativeBlock_symm_apply (e : OpenPartialHomeomorph (E ร— F) (E ร— F)) (L : (E ร— F) โ‰ƒL[โ„‚] (E ร— F)) (h0 : (0, 0) โˆˆ e.source) (he0 : e (0, 0) = (0, 0)) (hd : HasFDerivAt e L.toContinuousLinearMap (0, 0)) (hpres : โˆ€ z โˆˆ e.source, (e z).2 = 0 โ†” z.2 = 0) (y : F) : (normalCoordinateDerivativeBlock e L h0 he0 hd hpres).symm y = (L.symm (0, y)).2 := rfl /-- The ambient derivative commutes with projection to the actual normal block constructed above. -/ theorem normalCoordinateDerivativeBlock_projection (e : OpenPartialHomeomorph (E ร— F) (E ร— F)) (L : (E ร— F) โ‰ƒL[โ„‚] (E ร— F)) (h0 : (0, 0) โˆˆ e.source) (he0 : e (0, 0) = (0, 0)) (hd : HasFDerivAt e L.toContinuousLinearMap (0, 0)) (hpres : โˆ€ z โˆˆ e.source, (e z).2 = 0 โ†” z.2 = 0) (z : E ร— F) : (L z).2 = normalCoordinateDerivativeBlock e L h0 he0 hd hpres z.2 := Geometric.ComplexNormalBlock.Cycles.normalBlock_projection L (normalCoordinateDerivative_horizontal_pair e L h0 he0 hd hpres).1 (normalCoordinateDerivative_horizontal_pair e L h0 he0 hd hpres).2 z /-- The ambient derivative of a genuine differentiable local homeomorphism, with invertibility derived from its differentiable inverse. -/ def normalDiffeomorphDerivative (e : OpenPartialHomeomorph (E ร— F) (E ร— F)) (he : e.MDifferentiable ๐“˜(โ„‚, E ร— F) ๐“˜(โ„‚, E ร— F)) (h0 : (0, 0) โˆˆ e.source) : (E ร— F) โ‰ƒL[โ„‚] (E ร— F) := he.mfderiv h0 theorem normalDiffeomorphDerivative_coe (e : OpenPartialHomeomorph (E ร— F) (E ร— F)) (he : e.MDifferentiable ๐“˜(โ„‚, E ร— F) ๐“˜(โ„‚, E ร— F)) (h0 : (0, 0) โˆˆ e.source) : (normalDiffeomorphDerivative e he h0).toContinuousLinearMap = fderiv โ„‚ e (0, 0) := mfderiv_eq_fderiv theorem normalDiffeomorphDerivative_hasFDerivAt (e : OpenPartialHomeomorph (E ร— F) (E ร— F)) (he : e.MDifferentiable ๐“˜(โ„‚, E ร— F) ๐“˜(โ„‚, E ร— F)) (h0 : (0, 0) โˆˆ e.source) : HasFDerivAt e (normalDiffeomorphDerivative e he h0).toContinuousLinearMap (0, 0) := by rw [normalDiffeomorphDerivative_coe] exact (he.mdifferentiableAt h0).differentiableAt.hasFDerivAt /-- A genuine complex local diffeomorphism preserving the normal zero locus induces an invertible normal derivative, with no chosen derivative or linear-preservation assumptions. -/ def normalDiffeomorphBlock (e : OpenPartialHomeomorph (E ร— F) (E ร— F)) (he : e.MDifferentiable ๐“˜(โ„‚, E ร— F) ๐“˜(โ„‚, E ร— F)) (h0 : (0, 0) โˆˆ e.source) (he0 : e (0, 0) = (0, 0)) (hpres : โˆ€ z โˆˆ e.source, (e z).2 = 0 โ†” z.2 = 0) : F โ‰ƒL[โ„‚] F := normalCoordinateDerivativeBlock e (normalDiffeomorphDerivative e he h0) h0 he0 (normalDiffeomorphDerivative_hasFDerivAt e he h0) hpres theorem normalDiffeomorphBlock_apply (e : OpenPartialHomeomorph (E ร— F) (E ร— F)) (he : e.MDifferentiable ๐“˜(โ„‚, E ร— F) ๐“˜(โ„‚, E ร— F)) (h0 : (0, 0) โˆˆ e.source) (he0 : e (0, 0) = (0, 0)) (hpres : โˆ€ z โˆˆ e.source, (e z).2 = 0 โ†” z.2 = 0) (y : F) : normalDiffeomorphBlock e he h0 he0 hpres y = (fderiv โ„‚ e (0, 0) (0, y)).2 := by change ((normalDiffeomorphDerivative e he h0).toContinuousLinearMap (0, y)).2 = _ rw [normalDiffeomorphDerivative_coe] end end OAI.AlgebraicGeometry.CycleClass.Geometric.NormalDerivative.Cycles