import OAI.AlgebraicGeometry.ComplexMultiplication.HomeomorphInverseDifferentiable import Mathlib.Geometry.Manifold.MFDeriv.Atlas /-! # Open Embedding Differentiable -/ namespace OAI.AlgebraicGeometry.ComplexMultiplication.OpenEmbeddingDifferentiable noncomputable section /-! # The actual open-embedding partial homeomorphism is a complex local diffeomorphism -/ open scoped _root_.Manifold variable {E F M N : Type*} [NormedAddCommGroup E] [NormedSpace โ„‚ E] [CompleteSpace E] [NormedAddCommGroup F] [NormedSpace โ„‚ F] [CompleteSpace F] [TopologicalSpace M] [ChartedSpace E M] [TopologicalSpace N] [ChartedSpace F N] [Nonempty M] theorem openEmbedding_mDifferentiable (f : M โ†’ N) (he : Topology.IsOpenEmbedding f) (hf : MDifferentiable ๐“˜(โ„‚, E) ๐“˜(โ„‚, F) f) (hb : โˆ€ x, Function.Bijective (mfderiv ๐“˜(โ„‚, E) ๐“˜(โ„‚, F) f x)) : (he.toOpenPartialHomeomorph f).MDifferentiable ๐“˜(โ„‚, E) ๐“˜(โ„‚, F) := by let e := he.toOpenPartialHomeomorph f have heq : (e : M โ†’ N) = f := he.toOpenPartialHomeomorph_apply f constructor ยท intro x _ rw [heq] exact (hf x).mdifferentiableWithinAt ยท intro y hy have hr : y โˆˆ Set.range f := by simpa only [e, Topology.IsOpenEmbedding.toOpenPartialHomeomorph_target] using hy obtain โŸจx, rflโŸฉ := hr have hx : x โˆˆ e.source := by simp only [e, Topology.IsOpenEmbedding.toOpenPartialHomeomorph_source, Set.mem_univ] have hfx : MDifferentiableAt ๐“˜(โ„‚, E) ๐“˜(โ„‚, F) e x := heq.symm โ–ธ hf x have hbx : Function.Bijective (mfderiv ๐“˜(โ„‚, E) ๐“˜(โ„‚, F) e x) := heq.symm โ–ธ hb x have hi := HomeomorphInverseDifferentiable.partialHomeomorph_inverse_mDifferentiableAt e x hx hfx hbx rw [heq] at hi exact hi.mdifferentiableWithinAt end end OAI.AlgebraicGeometry.ComplexMultiplication.OpenEmbeddingDifferentiable