import OAI.AlgebraicGeometry.CycleClass.Thom.Product.Immersion import Mathlib.Geometry.Manifold.MFDeriv.SpecificFunctions /-! # Analytic Coordinate Difference -/ namespace OAI.AlgebraicGeometry.CycleClass.Thom.AnalyticCoordinateDifference.Constructions noncomputable section /-! The difference of two copies of a local analytic coordinate map is submersive. On any domain where the coordinates are injective, its zero set is exactly the diagonal. -/ open _root_.TopologicalSpace open scoped _root_.Manifold ContDiff set_option backward.isDefEq.respectTransparency false set_option backward.isDefEq.respectTransparency.types false variable {E M : Type} [NormedAddCommGroup E] [NormedSpace β„‚ E] [TopologicalSpace M] [ChartedSpace E M] [IsManifold π“˜(β„‚, E) Ο‰ M] local instance (priority := low) : ChartedSpace (E Γ— E) (M Γ— M) := prodChartedSpace E M E M local instance : IsManifold π“˜(β„‚, E Γ— E) Ο‰ (M Γ— M) := Product.Immersion.Constructions.productModel_isManifold def coordinateDifference (n : β„•) (c : M β†’ (Fin n β†’ β„‚)) (z : M Γ— M) : Fin n β†’ β„‚ := c z.1 - c z.2 variable (n : β„•) (c : M β†’ (Fin n β†’ β„‚)) (hc : ContMDiff π“˜(β„‚, E) π“˜(β„‚, Fin n β†’ β„‚) Ο‰ c) include hc in omit [IsManifold π“˜(β„‚, E) Ο‰ M] in theorem coordinateDifference_analytic : ContMDiff π“˜(β„‚, E Γ— E) π“˜(β„‚, Fin n β†’ β„‚) Ο‰ (coordinateDifference n c) := by rw [modelWithCornersSelf_prod] exact (hc.comp contMDiff_fst).sub (hc.comp contMDiff_snd) include hc in omit [IsManifold π“˜(β„‚, E) Ο‰ M] in theorem coordinateDifference_submersion (hs : βˆ€ x, Function.Surjective (mfderiv π“˜(β„‚, E) π“˜(β„‚, Fin n β†’ β„‚) c x)) (z : M Γ— M) : Function.Surjective (mfderiv π“˜(β„‚, E Γ— E) π“˜(β„‚, Fin n β†’ β„‚) (coordinateDifference n c) z) := by rcases z with ⟨x, y⟩ let i : M β†’ M Γ— M := fun a => (a, y) have hi : ContMDiff π“˜(β„‚, E) π“˜(β„‚, E Γ— E) Ο‰ i := by rw [modelWithCornersSelf_prod] exact contMDiff_id.prodMk contMDiff_const have he : mfderiv π“˜(β„‚, E) π“˜(β„‚, Fin n β†’ β„‚) (coordinateDifference n c ∘ i) x = mfderiv π“˜(β„‚, E) π“˜(β„‚, Fin n β†’ β„‚) c x := by change mfderiv π“˜(β„‚, E) π“˜(β„‚, Fin n β†’ β„‚) (c - fun _ => c y) x = _ rw [mfderiv_sub (hc.mdifferentiableAt (by simp)) mdifferentiableAt_const, mfderiv_const, sub_zero] have h := mfderiv_comp x ((coordinateDifference_analytic n c hc).mdifferentiableAt (by simp)) (hi.mdifferentiableAt (by simp)) have heq := h.symm.trans he intro w obtain ⟨v, hv⟩ := hs x w refine ⟨mfderiv π“˜(β„‚, E) π“˜(β„‚, E Γ— E) i x v, ?_⟩ exact (congrArg (fun L => L v) heq).trans hv omit [NormedAddCommGroup E] [NormedSpace β„‚ E] [TopologicalSpace M] [ChartedSpace E M] [IsManifold π“˜(β„‚, E) Ο‰ M] in theorem coordinateDifference_zero_iff (U : Set M) (hi : Set.InjOn c U) (z : M Γ— M) (hz : z ∈ U Γ—Λ’ U) : coordinateDifference n c z = 0 ↔ z.1 = z.2 := by change c z.1 - c z.2 = 0 ↔ z.1 = z.2 exact sub_eq_zero.trans ⟨fun h => hi hz.1 hz.2 h, fun h => congrArg c h⟩ end end OAI.AlgebraicGeometry.CycleClass.Thom.AnalyticCoordinateDifference.Constructions