File size: 6,268 Bytes
59d1c80
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
import OAI.Geometry.IsometricImmersion.Metric
import Mathlib.Geometry.Manifold.ContMDiff.NormedSpace
import Mathlib.Geometry.Manifold.MFDeriv.FDeriv

namespace OAI

noncomputable section
open Set Filter Function TopologicalSpace
open scoped ContDiff Topology Manifold Matrix

namespace SmoothLocal.Geometry

section Extension
variable {E : Type*}

def openDomainExtend (U : Opens Coord) (F : U → E) (outside : E) : Coord → E :=
  Function.extend Subtype.val F (fun _ => outside)

@[simp] theorem openDomainExtend_apply (U : Opens Coord) (F : U → E)
    (outside : E) (p : U) : openDomainExtend U F outside p = F p :=
  Subtype.val_injective.extend_apply F (fun _ => outside) p

theorem openDomainExtend_restrict (U : Opens Coord) (F : U → E)
    (outside : E) : (fun p : U => openDomainExtend U F outside p) = F := by
  funext p
  exact openDomainExtend_apply U F outside p

variable [NormedAddCommGroup E] [NormedSpace ℝ E]

theorem contMDiff_restrict_iff (U : Opens Coord) (F : Coord → E)
    (n : ℕ∞ω) :
    ContMDiff 𝓘(ℝ, Coord) 𝓘(ℝ, E) n (fun p : U => F p) ↔
      ContDiffOn ℝ n F (U : Set Coord) := by
  constructor
  · intro h p hp
    have hs := contMDiffAt_subtype_iff.mp (h ⟨p, hp⟩)
    exact hs.contDiffAt.contDiffWithinAt
  · intro h p
    apply contMDiffAt_subtype_iff.mpr
    exact ((h p p.property).contDiffAt (U.isOpen.mem_nhds p.property)).contMDiffAt

theorem openDomainExtend_contDiffOn (U : Opens Coord) (F : U → E)
    (outside : E) {n : ℕ∞ω}
    (hF : ContMDiff 𝓘(ℝ, Coord) 𝓘(ℝ, E) n F) :
    ContDiffOn ℝ n (openDomainExtend U F outside) (U : Set Coord) := by
  apply (contMDiff_restrict_iff U _ n).mp
  rw [openDomainExtend_restrict]
  exact hF

theorem mfderiv_restrict_eq_fderiv (U : Opens Coord) (F : Coord → E)
    (p : U) (hF : ContDiffAt ℝ ∞ F (p : Coord)) :
    mfderiv 𝓘(ℝ, Coord) 𝓘(ℝ, E) (fun q : U => F q) p =
      fderiv ℝ F (p : Coord) := by
  have hs : ContMDiffAt 𝓘(ℝ, Coord) 𝓘(ℝ, E) ∞
      (fun q : U => F q) p :=
    contMDiffAt_subtype_iff.mpr hF.contMDiffAt
  have hd := hs.mdifferentiableAt (by simp : (∞ : ℕ∞ω) ≠ 0)
  have hc : (fun y : Coord => ((chartAt Coord p).symm y : Coord))
      =ᶠ[𝓝 (p : Coord)] (fun y : Coord => y) := by
    exact (U.chartAt_subtype_val_symm_eventuallyEq (H := Coord) (x := p)).symm
  have he : writtenInExtChartAt 𝓘(ℝ, Coord) 𝓘(ℝ, E) p
      (fun q : U => F q) =ᶠ[𝓝 (p : Coord)] F := by
    exact hc.fun_comp F
  rw [hd.mfderiv]
  change fderivWithin ℝ
    (writtenInExtChartAt 𝓘(ℝ, Coord) 𝓘(ℝ, E) p (fun q : U => F q))
    (range 𝓘(ℝ, Coord)) (p : Coord) = _
  rw [ModelWithCorners.range_eq_univ, fderivWithin_univ]
  exact he.fderiv_eq

theorem fderiv_openDomainExtend_eq_mfderiv (U : Opens Coord) (F : U → E)
    (outside : E) (hF : ContMDiff 𝓘(ℝ, Coord) 𝓘(ℝ, E) ∞ F) (p : U) :
    fderiv ℝ (openDomainExtend U F outside) (p : Coord) =
      mfderiv 𝓘(ℝ, Coord) 𝓘(ℝ, E) F p := by
  have hd := ((openDomainExtend_contDiffOn U F outside hF) p p.property).contDiffAt
    (U.isOpen.mem_nhds p.property)
  have he := mfderiv_restrict_eq_fderiv U (openDomainExtend U F outside) p hd
  rw [openDomainExtend_restrict] at he
  exact he.symm

end Extension

def LocalIsometric (g : MetricField) (U : Opens Coord) (F : U → Ambient) : Prop :=
  ContMDiff 𝓘(ℝ, Coord) 𝓘(ℝ, Ambient) ∞ F ∧
    ∀ p : U, ∀ v w : Coord,
      (inner ℝ : Ambient → Ambient → ℝ) (mfderiv 𝓘(ℝ, Coord) 𝓘(ℝ, Ambient) F p v)
        (mfderiv 𝓘(ℝ, Coord) 𝓘(ℝ, Ambient) F p w) =
          v ⬝ᵥ (g p *ᵥ w)

theorem localIsometric_restrict_iff (g : MetricField) (U : Opens Coord)
    (F : Coord → Ambient) :
    LocalIsometric g U (fun p : U => F p) ↔ IsometricOn g F (U : Set Coord) := by
  constructor
  · rintro ⟨hF, he⟩
    have hc := (contMDiff_restrict_iff U F ∞).mp hF
    refine ⟨hc, ?_⟩
    intro p hp v w
    have hd := mfderiv_restrict_eq_fderiv U F ⟨p, hp⟩
      ((hc p hp).contDiffAt (U.isOpen.mem_nhds hp))
    have hinner := he ⟨p, hp⟩ v w
    rw [hd] at hinner
    exact hinner
  · rintro ⟨hF, he⟩
    refine ⟨(contMDiff_restrict_iff U F ∞).mpr hF, ?_⟩
    intro p v w
    rw [mfderiv_restrict_eq_fderiv U F p
      ((hF p p.property).contDiffAt (U.isOpen.mem_nhds p.property))]
    exact he p p.property v w

theorem localIsometric_extend_iff (g : MetricField) (U : Opens Coord)
    (F : U → Ambient) (outside : Ambient) :
    LocalIsometric g U F ↔ IsometricOn g (openDomainExtend U F outside) U := by
  rw [← localIsometric_restrict_iff, openDomainExtend_restrict]

theorem localIsometric_injective_differential {g : MetricField} {U : Opens Coord}
    {F : U → Ambient} (hg : SmoothPositiveOn g U) (hF : LocalIsometric g U F)
    (p : U) : Function.Injective (mfderiv 𝓘(ℝ, Coord) 𝓘(ℝ, Ambient) F p) := by
  rw [← fderiv_openDomainExtend_eq_mfderiv U F 0 hF.1 p]
  exact isometricOn_injective_differential hg
    ((localIsometric_extend_iff g U F 0).mp hF) p.property

def LocalSmoothPositive (U : Opens Coord)
    (g : U → Matrix (Fin 2) (Fin 2) ℝ) : Prop :=
  (∀ i j, ContMDiff 𝓘(ℝ, Coord) 𝓘(ℝ, ℝ) ∞ (fun p => g p i j)) ∧
    ∀ p, (g p).PosDef

theorem localSmoothPositive_restrict_iff (U : Opens Coord) (g : MetricField) :
    LocalSmoothPositive U (fun p => g p) ↔ SmoothPositiveOn g U := by
  constructor
  · rintro ⟨hs, hp⟩
    exact ⟨fun i j => (contMDiff_restrict_iff U (fun p => g p i j) ∞).mp (hs i j),
      fun p h => hp ⟨p, h⟩⟩
  · rintro ⟨hs, hp⟩
    exact ⟨fun i j => (contMDiff_restrict_iff U (fun p => g p i j) ∞).mpr (hs i j),
      fun p => hp p p.property⟩

theorem localSmoothPositive_extend_iff (U : Opens Coord)
    (g : U → Matrix (Fin 2) (Fin 2) ℝ) (outside : Matrix (Fin 2) (Fin 2) ℝ) :
    LocalSmoothPositive U g ↔ SmoothPositiveOn
      (Function.extend Subtype.val g (fun _ => outside)) U := by
  rw [← localSmoothPositive_restrict_iff]
  have he : (fun p : U => Function.extend Subtype.val g (fun _ => outside) p) = g := by
    funext p
    exact Subtype.val_injective.extend_apply g (fun _ => outside) p
  rw [he]

end SmoothLocal.Geometry

end

end OAI