diff --git a/Mathlib.lean b/Mathlib.lean index bf25493c66cde3..d2bbd7576603de 100644 --- a/Mathlib.lean +++ b/Mathlib.lean @@ -4480,6 +4480,8 @@ public import Mathlib.Geometry.Manifold.Algebra.SmoothFunctions public import Mathlib.Geometry.Manifold.Algebra.Structures public import Mathlib.Geometry.Manifold.Bordism public import Mathlib.Geometry.Manifold.BumpFunction +public import Mathlib.Geometry.Manifold.Category.MfldCat.Basic +public import Mathlib.Geometry.Manifold.Category.MfldCat.TangentFunctor public import Mathlib.Geometry.Manifold.ChartedSpace public import Mathlib.Geometry.Manifold.Complex public import Mathlib.Geometry.Manifold.ConformalGroupoid diff --git a/Mathlib/Geometry/Manifold/Category/MfldCat/Basic.lean b/Mathlib/Geometry/Manifold/Category/MfldCat/Basic.lean new file mode 100644 index 00000000000000..de10c10dc1b37d --- /dev/null +++ b/Mathlib/Geometry/Manifold/Category/MfldCat/Basic.lean @@ -0,0 +1,257 @@ +/- +Copyright (c) 2026 Jack McCarthy. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Jack McCarthy +-/ +module + +public import Mathlib.Geometry.Manifold.ContMDiffMFDeriv +public import Mathlib.Geometry.Manifold.Diffeomorph +public import Mathlib.Topology.Category.TopCat.Basic + +/-! +# Category instance for smooth manifolds + +We introduce the category `MfldCat ๐•œ n` of `C^n` manifolds over a field `๐•œ`. Each object bundles the +underlying manifold together with its model space `E`, chart space `H`, and +`I : ModelWithCorners ๐•œ E H`. Thus, `MfldCat ๐•œ n` also includes manifolds with boundary and corners. + +We define a forgetful functor `forgetโ‚‚ (MfldCat ๐•œ n) TopCat` taking smooth manifolds to topological +spaces. We also define `MfldCat.ofNormedSpace` turning any `NormedSpace ๐•œ E` into a manifold. In the +future, we plan to define a functor `FGModuleCat ๐•œ โฅค MfldCat ๐•œ n` from the category of +finite-dimensional vector spaces over `๐•œ`. +-/ + +@[expose] public section + +set_option autoImplicit false + +open CategoryTheory +open scoped Manifold + +universe uโ‚ uโ‚‚ uโ‚ƒ uโ‚„ + +/-- The category of `C^n` ๐•œ-manifolds. -/ +@[pp_with_univ, nolint checkUnivs] +structure MfldCat (๐•œ : Type uโ‚) [NontriviallyNormedField ๐•œ] (n : WithTop โ„•โˆž) where + /-- The object in `MfldCat` associated to a type equipped with the appropriate typeclasses. -/ + of :: + /-- The underlying type. -/ + carrier : Type uโ‚‚ + /-- The model normed space. -/ + E : Type uโ‚ƒ + /-- The chart space. -/ + H : Type uโ‚„ + [instNAG : NormedAddCommGroup E] + [instNS : NormedSpace ๐•œ E] + [instTopH : TopologicalSpace H] + /-- The model with corners. -/ + I : ModelWithCorners ๐•œ E H + [instTop : TopologicalSpace carrier] + [instCharted : ChartedSpace H carrier] + [instManifold : IsManifold I n carrier] + +section Notation + +open Lean.PrettyPrinter.Delaborator + +/-- This prevents `MfldCat.of M E H I` being printed as `{ carrier := M, ... }` by +`delabStructureInstance`. -/ +@[app_delab MfldCat.of] +meta def MfldCat.delabOf : Delab := delabApp + +end Notation + +attribute [instance] MfldCat.instNAG MfldCat.instNS MfldCat.instTopH MfldCat.instTop + MfldCat.instCharted MfldCat.instManifold + +initialize_simps_projections MfldCat + (-instNAG, -instNS, -instTopH, -instTop, -instCharted, -instManifold) + +namespace MfldCat + +variable {๐•œ : Type uโ‚} [NontriviallyNormedField ๐•œ] {n : WithTop โ„•โˆž} + {X Y Z : Type uโ‚‚} {E E' E'' : Type uโ‚ƒ} {H H' H'' : Type uโ‚„} + [NormedAddCommGroup E] [NormedSpace ๐•œ E] [TopologicalSpace H] + [NormedAddCommGroup E'] [NormedSpace ๐•œ E'] [TopologicalSpace H'] + [NormedAddCommGroup E''] [NormedSpace ๐•œ E''] [TopologicalSpace H''] + {I : ModelWithCorners ๐•œ E H} {I' : ModelWithCorners ๐•œ E' H'} + {I'' : ModelWithCorners ๐•œ E'' H''} + [TopologicalSpace X] [ChartedSpace H X] [IsManifold I n X] + [TopologicalSpace Y] [ChartedSpace H' Y] [IsManifold I' n Y] + [TopologicalSpace Z] [ChartedSpace H'' Z] [IsManifold I'' n Z] + +instance : CoeSort (MfldCat ๐•œ n) (Type uโ‚‚) := โŸจMfldCat.carrierโŸฉ + +attribute [coe] MfldCat.carrier + +variable (X E H I) in +lemma coe_of : (of (n := n) X E H I : Type uโ‚‚) = X := rfl + +lemma of_carrier (M : MfldCat ๐•œ n) : of (n := n) M.carrier M.E M.H M.I = M := rfl + +/-- The type of morphisms in `MfldCat`. -/ +@[ext] +structure Hom (M N : MfldCat.{uโ‚, uโ‚‚, uโ‚ƒ, uโ‚„} ๐•œ n) where + /-- The underlying `C^n` map. -/ + hom' : ContMDiffMap M.I N.I M N n + +instance : Category (MfldCat ๐•œ n) where + Hom M N := Hom M N + id M := โŸจContMDiffMap.idโŸฉ + comp f g := โŸจg.hom'.comp f.hom'โŸฉ + +instance : ConcreteCategory (MfldCat ๐•œ n) + (fun M N => ContMDiffMap M.I N.I M N n) where + hom f := f.hom' + ofHom f := โŸจfโŸฉ + +/-- Turn a morphism in `MfldCat` back into a `ContMDiffMap`. -/ +abbrev Hom.hom {M N : MfldCat ๐•œ n} (f : Hom M N) := + ConcreteCategory.hom (C := MfldCat ๐•œ n) f + +/-- Typecheck a `ContMDiffMap` as a morphism in `MfldCat`. -/ +abbrev ofHom (f : ContMDiffMap I I' X Y n) : of (n := n) X E H I โŸถ of (n := n) Y E' H' I' := + ConcreteCategory.ofHom (C := MfldCat ๐•œ n) f + +/-- Use the `ConcreteCategory.hom` projection for `@[simps]` lemmas. -/ +def Hom.Simps.hom (M N : MfldCat ๐•œ n) (f : Hom M N) := + f.hom + +initialize_simps_projections Hom (hom' โ†’ hom) + +/-! +The results below duplicate the `ConcreteCategory` simp lemmas, but we can keep them for `dsimp`. +-/ + +@[simp] +lemma hom_id {M : MfldCat ๐•œ n} : + (๐Ÿ™ M : M โŸถ M).hom = ContMDiffMap.id := rfl + +@[simp] +theorem id_app (M : MfldCat ๐•œ n) (x : โ†‘M) : (๐Ÿ™ M : M โŸถ M) x = x := rfl + +@[simp] +theorem coe_id (M : MfldCat ๐•œ n) : (๐Ÿ™ M : M โ†’ M) = _root_.id := rfl + +@[simp] +lemma hom_comp {M N P : MfldCat ๐•œ n} (f : M โŸถ N) (g : N โŸถ P) : + (f โ‰ซ g).hom = g.hom.comp f.hom := rfl + +@[simp] +theorem comp_app {M N P : MfldCat ๐•œ n} (f : M โŸถ N) (g : N โŸถ P) (x : M) : + (f โ‰ซ g : M โ†’ P) x = g (f x) := rfl + +@[simp] +theorem coe_comp {M N P : MfldCat ๐•œ n} (f : M โŸถ N) (g : N โŸถ P) : + (f โ‰ซ g : M โ†’ P) = g โˆ˜ f := rfl + +@[ext] +lemma hom_ext {M N : MfldCat ๐•œ n} {f g : M โŸถ N} (hf : f.hom = g.hom) : f = g := + Hom.ext hf + +@[ext] +lemma ext {M N : MfldCat ๐•œ n} {f g : M โŸถ N} (w : โˆ€ x : M, f x = g x) : f = g := + ConcreteCategory.hom_ext _ _ w + +section ofHom + +@[simp] +lemma hom_ofHom (f : ContMDiffMap I I' X Y n) : (ofHom f).hom = f := rfl + +@[simp] +lemma ofHom_hom {M N : MfldCat ๐•œ n} (f : M โŸถ N) : + ofHom (Hom.hom f) = f := rfl + +@[simp] +lemma ofHom_id : + ofHom (ContMDiffMap.id : ContMDiffMap I I X X n) = ๐Ÿ™ (of (n := n) X E H I) := rfl + +@[simp] +lemma ofHom_comp (f : ContMDiffMap I I' X Y n) (g : ContMDiffMap I' I'' Y Z n) : + ofHom (g.comp f) = ofHom f โ‰ซ ofHom g := rfl + +lemma ofHom_apply (f : ContMDiffMap I I' X Y n) (x : X) : (ofHom f) x = f x := rfl + +lemma hom_inv_id_apply {M N : MfldCat ๐•œ n} (f : M โ‰… N) (x : M) : f.inv (f.hom x) = x := by + simp + +lemma inv_hom_id_apply {M N : MfldCat ๐•œ n} (f : M โ‰… N) (y : N) : f.hom (f.inv y) = y := by + simp + +end ofHom + +/-- Morphisms in `MfldCat` are equivalent to `ContMDiffMap`s. -/ +@[simps] +def Hom.equivContMDiffMap (M N : MfldCat ๐•œ n) : + (M โŸถ N) โ‰ƒ ContMDiffMap M.I N.I M N n where + toFun f := f.hom + invFun f := ofHom f + +/-- Replace a function coercion for a morphism `MfldCat.of X E H I โŸถ MfldCat.of Y E' H' I'` with +the definitionally equal function coercion for a `ContMDiffMap I I' X Y n`. -/ +@[simp] theorem coe_of_of {f : ContMDiffMap I I' X Y n} {x} : + @DFunLike.coe (of (n := n) X E H I โŸถ of (n := n) Y E' H' I') + ((CategoryTheory.forget (MfldCat ๐•œ n)).obj (of (n := n) X E H I)) + (fun _ โ†ฆ (CategoryTheory.forget (MfldCat ๐•œ n)).obj (of (n := n) Y E' H' I')) + ConcreteCategory.instFunLike + (ofHom f) x = + @DFunLike.coe (ContMDiffMap I I' X Y n) X + (fun _ โ†ฆ Y) _ + f x := + rfl + +instance inhabited : Inhabited (MfldCat ๐•œ n) := + โŸจof ๐•œ ๐•œ ๐•œ (modelWithCornersSelf ๐•œ ๐•œ)โŸฉ + +/-- A normed space is a `C^n` manifold (modeled on itself). -/ +abbrev ofNormedSpace (n : WithTop โ„•โˆž) (E : Type uโ‚ƒ) [NormedAddCommGroup E] [NormedSpace ๐•œ E] : + MfldCat ๐•œ n := + of E E E (modelWithCornersSelf ๐•œ E) + +/-- `MfldCat ๐•œ n` has a forgetful functor to `TopCat`. -/ +instance : HasForgetโ‚‚ (MfldCat ๐•œ n) TopCat.{uโ‚‚} where + forgetโ‚‚.obj M := TopCat.of M + forgetโ‚‚.map f := TopCat.ofHom โŸจf.hom, f.hom.contMDiff.continuousโŸฉ + +-- TODO: define a functor `FGModuleCat ๐•œ โฅค MfldCat ๐•œ n`. + +/-- Any diffeomorphism induces an isomorphism in `MfldCat`. -/ +@[simps] +def isoOfDiffeomorph {M N : MfldCat ๐•œ n} (f : M โ‰ƒโ‚˜^nโŸฎM.I, N.IโŸฏ N) : M โ‰… N where + hom := ofHom f.toContMDiffMap + inv := ofHom f.symm.toContMDiffMap + hom_inv_id := by ext x; exact f.left_inv x + inv_hom_id := by ext x; exact f.right_inv x + +/-- Any isomorphism in `MfldCat` induces a diffeomorphism. -/ +@[simps] +def diffeomorphOfIso {M N : MfldCat ๐•œ n} (f : M โ‰… N) : M โ‰ƒโ‚˜^nโŸฎM.I, N.IโŸฏ N where + toFun := f.hom + invFun := f.inv + left_inv _ := by simp + right_inv _ := by simp + contMDiff_toFun := f.hom.hom.contMDiff + contMDiff_invFun := f.inv.hom.contMDiff + +@[simp] +theorem of_isoOfDiffeomorph {M N : MfldCat ๐•œ n} (f : M โ‰ƒโ‚˜^nโŸฎM.I, N.IโŸฏ N) : + diffeomorphOfIso (isoOfDiffeomorph f) = f := by + ext + rfl + +@[simp] +theorem of_diffeomorphOfIso {M N : MfldCat ๐•œ n} (f : M โ‰… N) : + isoOfDiffeomorph (diffeomorphOfIso f) = f := by + ext + rfl + +/-- The constant morphism `M โŸถ N` in `MfldCat` given by `y : N`. -/ +def const {M N : MfldCat ๐•œ n} (y : N) : M โŸถ N := + ofHom โŸจfun _ โ†ฆ y, contMDiff_constโŸฉ + +@[simp] +lemma const_apply {M N : MfldCat ๐•œ n} (y : N) (x : M) : + const y x = y := rfl + +end MfldCat diff --git a/Mathlib/Geometry/Manifold/Category/MfldCat/TangentFunctor.lean b/Mathlib/Geometry/Manifold/Category/MfldCat/TangentFunctor.lean new file mode 100644 index 00000000000000..a2d894aa5ec504 --- /dev/null +++ b/Mathlib/Geometry/Manifold/Category/MfldCat/TangentFunctor.lean @@ -0,0 +1,51 @@ +/- +Copyright (c) 2026 Jack McCarthy. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Jack McCarthy +-/ +module + +public import Mathlib.Geometry.Manifold.Category.MfldCat.Basic +public import Mathlib.Geometry.Manifold.ContMDiffMFDeriv + +/-! +# The tangent functor on `MfldCat` + +We define the tangent functor `MfldCat.tangentFunctor : MfldCat ๐•œ (n + 1) โฅค MfldCat ๐•œ n`, sending a +`C^(n+1)` manifold to its tangent bundle and a `C^(n+1)` map to its pushforward `tangentMap`. + +## References +* [J. M. Lee, *Introduction to Smooth Manifolds*][lee2012] (2nd Edition, p. 75) +-/ + +@[expose] public section + +open CategoryTheory +open scoped Manifold + +universe uโ‚ uโ‚‚ uโ‚ƒ uโ‚„ + +namespace MfldCat + +variable {๐•œ : Type uโ‚} [NontriviallyNormedField ๐•œ] {n : WithTop โ„•โˆž} + +variable (M : MfldCat.{uโ‚, uโ‚‚, uโ‚ƒ, uโ‚„} ๐•œ (n + 1)) + +local instance : IsManifold M.I 1 M := IsManifold.of_le (n := n + 1) le_add_self +local instance : IsManifold M.I n M := IsManifold.of_le (n := n + 1) le_self_add +local instance : ContMDiffVectorBundle n M.E (TangentSpace M.I : M โ†’ Type uโ‚ƒ) M.I := + TangentBundle.contMDiffVectorBundle +-- The above instance implies `TangentBundle M.I M` is a manifold by `Bundle.TotalSpace.isManifold`. + +/-- Sends a `C^(n+1)` manifold to its tangent bundle and a `C^(n+1)` map to its `tangentMap`. -/ +noncomputable def tangentFunctor : + MfldCat ๐•œ (n + 1) โฅค MfldCat ๐•œ n where + obj M := of (TangentBundle M.I M) (M.E ร— M.E) (ModelProd M.H M.E) M.I.tangent + map {M N} f := + ofHom โŸจtangentMap M.I N.I f.hom, ContMDiff.contMDiff_tangentMap f.hom.contMDiff le_rflโŸฉ + map_id _ := Hom.ext <| Subtype.ext tangentMap_id + map_comp f g := Hom.ext <| Subtype.ext <| tangentMap_comp + (g.hom.contMDiff.mdifferentiable (by positivity)) + (f.hom.contMDiff.mdifferentiable (by positivity)) + +end MfldCat diff --git a/Mathlib/Geometry/Manifold/ContMDiffMap.lean b/Mathlib/Geometry/Manifold/ContMDiffMap.lean index e0fce000c3f725..049d54c2b870e1 100644 --- a/Mathlib/Geometry/Manifold/ContMDiffMap.lean +++ b/Mathlib/Geometry/Manifold/ContMDiffMap.lean @@ -79,6 +79,12 @@ instance : ContinuousMapClass C^nโŸฎI, M; I', M'โŸฏ M M' where nonrec def id : C^nโŸฎI, M; I, MโŸฏ := โŸจid, contMDiff_idโŸฉ +@[simp] +theorem id_apply (x : M) : (ContMDiffMap.id : C^nโŸฎI, M; I, MโŸฏ) x = x := rfl + +@[simp] +theorem coe_id : โ‡‘(ContMDiffMap.id : C^nโŸฎI, M; I, MโŸฏ) = _root_.id := rfl + /-- The composition of `C^n` maps, as a `C^n` map. -/ def comp (f : C^nโŸฎI', M'; I'', M''โŸฏ) (g : C^nโŸฎI, M; I', M'โŸฏ) : C^nโŸฎI, M; I'', M''โŸฏ where val a := f (g a) @@ -89,6 +95,10 @@ theorem comp_apply (f : C^nโŸฎI', M'; I'', M''โŸฏ) (g : C^nโŸฎI, M; I', M'โŸฏ) ( f.comp g x = f (g x) := rfl +@[simp] +theorem coe_comp (f : C^nโŸฎI', M'; I'', M''โŸฏ) (g : C^nโŸฎI, M; I', M'โŸฏ) : + โ‡‘(f.comp g) = f โˆ˜ g := rfl + instance [Inhabited M'] : Inhabited C^nโŸฎI, M; I', M'โŸฏ := โŸจโŸจfun _ => default, contMDiff_constโŸฉโŸฉ