-
Notifications
You must be signed in to change notification settings - Fork 259
/
Sphere.lean
581 lines (496 loc) ยท 27.4 KB
/
Sphere.lean
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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
/-
Copyright (c) 2021 Heather Macbeth. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Heather Macbeth
-/
import Mathlib.Analysis.Calculus.Deriv.Inv
import Mathlib.Analysis.NormedSpace.BallAction
import Mathlib.Analysis.SpecialFunctions.ExpDeriv
import Mathlib.Analysis.InnerProductSpace.Calculus
import Mathlib.Analysis.InnerProductSpace.PiL2
import Mathlib.Geometry.Manifold.Algebra.LieGroup
import Mathlib.Geometry.Manifold.Instances.Real
import Mathlib.Geometry.Manifold.MFDeriv.Basic
/-!
# Manifold structure on the sphere
This file defines stereographic projection from the sphere in an inner product space `E`, and uses
it to put a smooth manifold structure on the sphere.
## Main results
For a unit vector `v` in `E`, the definition `stereographic` gives the stereographic projection
centred at `v`, a partial homeomorphism from the sphere to `(โ โ v)แฎ` (the orthogonal complement of
`v`).
For finite-dimensional `E`, we then construct a smooth manifold instance on the sphere; the charts
here are obtained by composing the partial homeomorphisms `stereographic` with arbitrary isometries
from `(โ โ v)แฎ` to Euclidean space.
We prove two lemmas about smooth maps:
* `contMDiff_coe_sphere` states that the coercion map from the sphere into `E` is smooth;
this is a useful tool for constructing smooth maps *from* the sphere.
* `contMDiff.codRestrict_sphere` states that a map from a manifold into the sphere is
smooth if its lift to a map to `E` is smooth; this is a useful tool for constructing smooth maps
*to* the sphere.
As an application we prove `contMdiffNegSphere`, that the antipodal map is smooth.
Finally, we equip the `circle` (defined in `Analysis.Complex.Circle` to be the sphere in `โ`
centred at `0` of radius `1`) with the following structure:
* a charted space with model space `EuclideanSpace โ (Fin 1)` (inherited from `Metric.Sphere`)
* a Lie group with model with corners `๐ก 1`
We furthermore show that `expMapCircle` (defined in `Analysis.Complex.Circle` to be the natural
map `fun t โฆ exp (t * I)` from `โ` to `circle`) is smooth.
## Implementation notes
The model space for the charted space instance is `EuclideanSpace โ (Fin n)`, where `n` is a
natural number satisfying the typeclass assumption `[Fact (finrank โ E = n + 1)]`. This may seem a
little awkward, but it is designed to circumvent the problem that the literal expression for the
dimension of the model space (up to definitional equality) determines the type. If one used the
naive expression `EuclideanSpace โ (Fin (finrank โ E - 1))` for the model space, then the sphere in
`โ` would be a manifold with model space `EuclideanSpace โ (Fin (2 - 1))` but not with model space
`EuclideanSpace โ (Fin 1)`.
## TODO
Relate the stereographic projection to the inversion of the space.
-/
variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace โ E]
noncomputable section
open Metric FiniteDimensional Function
open scoped Manifold
section StereographicProjection
variable (v : E)
/-! ### Construction of the stereographic projection -/
/-- Stereographic projection, forward direction. This is a map from an inner product space `E` to
the orthogonal complement of an element `v` of `E`. It is smooth away from the affine hyperplane
through `v` parallel to the orthogonal complement. It restricts on the sphere to the stereographic
projection. -/
def stereoToFun (x : E) : (โ โ v)แฎ :=
(2 / ((1 : โ) - innerSL โ v x)) โข orthogonalProjection (โ โ v)แฎ x
variable {v}
@[simp]
theorem stereoToFun_apply (x : E) :
stereoToFun v x = (2 / ((1 : โ) - innerSL โ v x)) โข orthogonalProjection (โ โ v)แฎ x :=
rfl
theorem contDiffOn_stereoToFun :
ContDiffOn โ โค (stereoToFun v) {x : E | innerSL _ v x โ (1 : โ)} := by
refine ContDiffOn.smul ?_ (orthogonalProjection (โ โ v)แฎ).contDiff.contDiffOn
refine contDiff_const.contDiffOn.div ?_ ?_
ยท exact (contDiff_const.sub (innerSL โ v).contDiff).contDiffOn
ยท intro x h h'
exact h (sub_eq_zero.mp h').symm
theorem continuousOn_stereoToFun :
ContinuousOn (stereoToFun v) {x : E | innerSL _ v x โ (1 : โ)} :=
contDiffOn_stereoToFun.continuousOn
variable (v)
/-- Auxiliary function for the construction of the reverse direction of the stereographic
projection. This is a map from the orthogonal complement of a unit vector `v` in an inner product
space `E` to `E`; we will later prove that it takes values in the unit sphere.
For most purposes, use `stereoInvFun`, not `stereoInvFunAux`. -/
def stereoInvFunAux (w : E) : E :=
(โwโ ^ 2 + 4)โปยน โข ((4 : โ) โข w + (โwโ ^ 2 - 4) โข v)
variable {v}
@[simp]
theorem stereoInvFunAux_apply (w : E) :
stereoInvFunAux v w = (โwโ ^ 2 + 4)โปยน โข ((4 : โ) โข w + (โwโ ^ 2 - 4) โข v) :=
rfl
theorem stereoInvFunAux_mem (hv : โvโ = 1) {w : E} (hw : w โ (โ โ v)แฎ) :
stereoInvFunAux v w โ sphere (0 : E) 1 := by
have hโ : (0 : โ) < โwโ ^ 2 + 4 := by positivity
suffices โ(4 : โ) โข w + (โwโ ^ 2 - 4) โข vโ = โwโ ^ 2 + 4 by
simp only [mem_sphere_zero_iff_norm, norm_smul, Real.norm_eq_abs, abs_inv, this,
abs_of_pos hโ, stereoInvFunAux_apply, inv_mul_cancel hโ.ne']
suffices โ(4 : โ) โข w + (โwโ ^ 2 - 4) โข vโ ^ 2 = (โwโ ^ 2 + 4) ^ 2 by
simpa [sq_eq_sq_iff_abs_eq_abs, abs_of_pos hโ] using this
rw [Submodule.mem_orthogonal_singleton_iff_inner_left] at hw
simp [norm_add_sq_real, norm_smul, inner_smul_left, inner_smul_right, hw, mul_pow,
Real.norm_eq_abs, hv]
ring
theorem hasFDerivAt_stereoInvFunAux (v : E) :
HasFDerivAt (stereoInvFunAux v) (ContinuousLinearMap.id โ E) 0 := by
have hโ : HasFDerivAt (fun w : E => โwโ ^ 2) (0 : E โL[โ] โ) 0 := by
convert (hasStrictFDerivAt_norm_sq (0 : E)).hasFDerivAt
simp
have hโ : HasFDerivAt (fun w : E => (โwโ ^ 2 + 4)โปยน) (0 : E โL[โ] โ) 0 := by
convert (hasFDerivAt_inv _).comp _ (hโ.add (hasFDerivAt_const 4 0)) <;> simp
have hโ : HasFDerivAt (fun w => (4 : โ) โข w + (โwโ ^ 2 - 4) โข v)
((4 : โ) โข ContinuousLinearMap.id โ E) 0 := by
convert ((hasFDerivAt_const (4 : โ) 0).smul (hasFDerivAt_id 0)).add
((hโ.sub (hasFDerivAt_const (4 : โ) 0)).smul (hasFDerivAt_const v 0)) using 1
ext w
simp
convert hโ.smul hโ using 1
ext w
simp
theorem hasFDerivAt_stereoInvFunAux_comp_coe (v : E) :
HasFDerivAt (stereoInvFunAux v โ ((โ) : (โ โ v)แฎ โ E)) (โ โ v)แฎ.subtypeL 0 := by
have : HasFDerivAt (stereoInvFunAux v) (ContinuousLinearMap.id โ E) ((โ โ v)แฎ.subtypeL 0) :=
hasFDerivAt_stereoInvFunAux v
convert this.comp (0 : (โ โ v)แฎ) (by apply ContinuousLinearMap.hasFDerivAt)
theorem contDiff_stereoInvFunAux : ContDiff โ โค (stereoInvFunAux v) := by
have hโ : ContDiff โ โค fun w : E => โwโ ^ 2 := contDiff_norm_sq โ
have hโ : ContDiff โ โค fun w : E => (โwโ ^ 2 + 4)โปยน := by
refine (hโ.add contDiff_const).inv ?_
intro x
nlinarith
have hโ : ContDiff โ โค fun w => (4 : โ) โข w + (โwโ ^ 2 - 4) โข v := by
refine (contDiff_const.smul contDiff_id).add ?_
exact (hโ.sub contDiff_const).smul contDiff_const
exact hโ.smul hโ
/-- Stereographic projection, reverse direction. This is a map from the orthogonal complement of a
unit vector `v` in an inner product space `E` to the unit sphere in `E`. -/
def stereoInvFun (hv : โvโ = 1) (w : (โ โ v)แฎ) : sphere (0 : E) 1 :=
โจstereoInvFunAux v (w : E), stereoInvFunAux_mem hv w.2โฉ
@[simp]
theorem stereoInvFun_apply (hv : โvโ = 1) (w : (โ โ v)แฎ) :
(stereoInvFun hv w : E) = (โwโ ^ 2 + 4)โปยน โข ((4 : โ) โข w + (โwโ ^ 2 - 4) โข v) :=
rfl
theorem stereoInvFun_ne_north_pole (hv : โvโ = 1) (w : (โ โ v)แฎ) :
stereoInvFun hv w โ (โจv, by simp [hv]โฉ : sphere (0 : E) 1) := by
refine Subtype.coe_ne_coe.1 ?_
rw [โ inner_lt_one_iff_real_of_norm_one _ hv]
ยท have hw : โชv, wโซ_โ = 0 := Submodule.mem_orthogonal_singleton_iff_inner_right.mp w.2
have hw' : (โ(w : E)โ ^ 2 + 4)โปยน * (โ(w : E)โ ^ 2 - 4) < 1 := by
refine (inv_mul_lt_iff' ?_).mpr ?_
ยท nlinarith
linarith
simpa [real_inner_comm, inner_add_right, inner_smul_right, real_inner_self_eq_norm_mul_norm, hw,
hv] using hw'
ยท simpa using stereoInvFunAux_mem hv w.2
theorem continuous_stereoInvFun (hv : โvโ = 1) : Continuous (stereoInvFun hv) :=
continuous_induced_rng.2 (contDiff_stereoInvFunAux.continuous.comp continuous_subtype_val)
theorem stereo_left_inv (hv : โvโ = 1) {x : sphere (0 : E) 1} (hx : (x : E) โ v) :
stereoInvFun hv (stereoToFun v x) = x := by
ext
simp only [stereoToFun_apply, stereoInvFun_apply, smul_add]
-- name two frequently-occuring quantities and write down their basic properties
set a : โ := innerSL _ v x
set y := orthogonalProjection (โ โ v)แฎ x
have split : โx = a โข v + โy := by
convert (orthogonalProjection_add_orthogonalProjection_orthogonal (โ โ v) x).symm
exact (orthogonalProjection_unit_singleton โ hv x).symm
have hvy : โชv, yโซ_โ = 0 := Submodule.mem_orthogonal_singleton_iff_inner_right.mp y.2
have pythag : 1 = a ^ 2 + โyโ ^ 2 := by
have hvy' : โชa โข v, yโซ_โ = 0 := by simp only [inner_smul_left, hvy, mul_zero]
convert norm_add_sq_eq_norm_sq_add_norm_sq_of_inner_eq_zero _ _ hvy' using 2
ยท simp [โ split]
ยท simp [norm_smul, hv, โ sq, sq_abs]
ยท exact sq _
-- two facts which will be helpful for clearing denominators in the main calculation
have ha : 1 - a โ 0 := by
have : a < 1 := (inner_lt_one_iff_real_of_norm_one hv (by simp)).mpr hx.symm
linarith
-- the core of the problem is these two algebraic identities:
have hโ : (2 ^ 2 / (1 - a) ^ 2 * โyโ ^ 2 + 4)โปยน * 4 * (2 / (1 - a)) = 1 := by
field_simp; simp only [Submodule.coe_norm] at *; nlinarith
have hโ : (2 ^ 2 / (1 - a) ^ 2 * โyโ ^ 2 + 4)โปยน * (2 ^ 2 / (1 - a) ^ 2 * โyโ ^ 2 - 4) = a := by
field_simp
transitivity (1 - a) ^ 2 * (a * (2 ^ 2 * โyโ ^ 2 + 4 * (1 - a) ^ 2))
ยท congr
simp only [Submodule.coe_norm] at *
nlinarith
ring!
convert
congr_argโ Add.add (congr_arg (fun t => t โข (y : E)) hโ) (congr_arg (fun t => t โข v) hโ) using 1
ยท simp [a, inner_add_right, inner_smul_right, hvy, real_inner_self_eq_norm_mul_norm, hv, mul_smul,
mul_pow, Real.norm_eq_abs, sq_abs, norm_smul]
-- Porting note: used to be simp only [split, add_comm] but get maxRec errors
rw [split, add_comm]
ac_rfl
-- Porting note: this branch did not exit in ml3
ยท rw [split, add_comm]
congr!
dsimp
rw [one_smul]
theorem stereo_right_inv (hv : โvโ = 1) (w : (โ โ v)แฎ) : stereoToFun v (stereoInvFun hv w) = w := by
have : 2 / (1 - (โ(w : E)โ ^ 2 + 4)โปยน * (โ(w : E)โ ^ 2 - 4)) * (โ(w : E)โ ^ 2 + 4)โปยน * 4 = 1 := by
field_simp; ring
convert congr_arg (ยท โข w) this
ยท have hโ : orthogonalProjection (โ โ v)แฎ v = 0 :=
orthogonalProjection_orthogonalComplement_singleton_eq_zero v
-- Porting note: was innerSL _ and now just inner
have hโ : inner v w = (0 : โ) := Submodule.mem_orthogonal_singleton_iff_inner_right.mp w.2
-- Porting note: was innerSL _ and now just inner
have hโ : inner v v = (1 : โ) := by simp [real_inner_self_eq_norm_mul_norm, hv]
simp [hโ, hโ, hโ, ContinuousLinearMap.map_add, ContinuousLinearMap.map_smul, mul_smul]
ยท simp
/-- Stereographic projection from the unit sphere in `E`, centred at a unit vector `v` in `E`;
this is the version as a partial homeomorphism. -/
def stereographic (hv : โvโ = 1) : PartialHomeomorph (sphere (0 : E) 1) (โ โ v)แฎ where
toFun := stereoToFun v โ (โ)
invFun := stereoInvFun hv
source := {โจv, by simp [hv]โฉ}แถ
target := Set.univ
map_source' := by simp
map_target' {w} _ := fun h => (stereoInvFun_ne_north_pole hv w) (Set.eq_of_mem_singleton h)
left_inv' x hx := stereo_left_inv hv fun h => hx (by
rw [โ h] at hv
apply Subtype.ext
dsimp
exact h)
right_inv' w _ := stereo_right_inv hv w
open_source := isOpen_compl_singleton
open_target := isOpen_univ
continuousOn_toFun :=
continuousOn_stereoToFun.comp continuous_subtype_val.continuousOn fun w h => by
dsimp
exact
h โ Subtype.ext โ Eq.symm โ (inner_eq_one_iff_of_norm_one hv (by simp)).mp
continuousOn_invFun := (continuous_stereoInvFun hv).continuousOn
theorem stereographic_apply (hv : โvโ = 1) (x : sphere (0 : E) 1) :
stereographic hv x = (2 / ((1 : โ) - inner v x)) โข orthogonalProjection (โ โ v)แฎ x :=
rfl
@[simp]
theorem stereographic_source (hv : โvโ = 1) : (stereographic hv).source = {โจv, by simp [hv]โฉ}แถ :=
rfl
@[simp]
theorem stereographic_target (hv : โvโ = 1) : (stereographic hv).target = Set.univ :=
rfl
@[simp]
theorem stereographic_apply_neg (v : sphere (0 : E) 1) :
stereographic (norm_eq_of_mem_sphere v) (-v) = 0 := by
simp [stereographic_apply, orthogonalProjection_orthogonalComplement_singleton_eq_zero]
@[simp]
theorem stereographic_neg_apply (v : sphere (0 : E) 1) :
stereographic (norm_eq_of_mem_sphere (-v)) v = 0 := by
convert stereographic_apply_neg (-v)
ext1
simp
end StereographicProjection
section ChartedSpace
/-!
### Charted space structure on the sphere
In this section we construct a charted space structure on the unit sphere in a finite-dimensional
real inner product space `E`; that is, we show that it is locally homeomorphic to the Euclidean
space of dimension one less than `E`.
The restriction to finite dimension is for convenience. The most natural `ChartedSpace`
structure for the sphere uses the stereographic projection from the antipodes of a point as the
canonical chart at this point. However, the codomain of the stereographic projection constructed
in the previous section is `(โ โ v)แฎ`, the orthogonal complement of the vector `v` in `E` which is
the "north pole" of the projection, so a priori these charts all have different codomains.
So it is necessary to prove that these codomains are all continuously linearly equivalent to a
fixed normed space. This could be proved in general by a simple case of Gram-Schmidt
orthogonalization, but in the finite-dimensional case it follows more easily by dimension-counting.
-/
-- Porting note: unnecessary in Lean 3
private theorem findim (n : โ) [Fact (finrank โ E = n + 1)] : FiniteDimensional โ E :=
.of_fact_finrank_eq_succ n
/-- Variant of the stereographic projection, for the sphere in an `n + 1`-dimensional inner product
space `E`. This version has codomain the Euclidean space of dimension `n`, and is obtained by
composing the original sterographic projection (`stereographic`) with an arbitrary linear isometry
from `(โ โ v)แฎ` to the Euclidean space. -/
def stereographic' (n : โ) [Fact (finrank โ E = n + 1)] (v : sphere (0 : E) 1) :
PartialHomeomorph (sphere (0 : E) 1) (EuclideanSpace โ (Fin n)) :=
stereographic (norm_eq_of_mem_sphere v) โซโ
(OrthonormalBasis.fromOrthogonalSpanSingleton n
(ne_zero_of_mem_unit_sphere v)).repr.toHomeomorph.toPartialHomeomorph
@[simp]
theorem stereographic'_source {n : โ} [Fact (finrank โ E = n + 1)] (v : sphere (0 : E) 1) :
(stereographic' n v).source = {v}แถ := by simp [stereographic']
@[simp]
theorem stereographic'_target {n : โ} [Fact (finrank โ E = n + 1)] (v : sphere (0 : E) 1) :
(stereographic' n v).target = Set.univ := by simp [stereographic']
/-- The unit sphere in an `n + 1`-dimensional inner product space `E` is a charted space
modelled on the Euclidean space of dimension `n`. -/
instance EuclideanSpace.instChartedSpaceSphere {n : โ} [Fact (finrank โ E = n + 1)] :
ChartedSpace (EuclideanSpace โ (Fin n)) (sphere (0 : E) 1) where
atlas := {f | โ v : sphere (0 : E) 1, f = stereographic' n v}
chartAt v := stereographic' n (-v)
mem_chart_source v := by simpa using ne_neg_of_mem_unit_sphere โ v
chart_mem_atlas v := โจ-v, rflโฉ
instance (n : โ) :
ChartedSpace (EuclideanSpace โ (Fin n)) (sphere (0 : EuclideanSpace โ (Fin (n + 1))) 1) :=
have := Fact.mk (@finrank_euclideanSpace_fin โ _ (n + 1))
EuclideanSpace.instChartedSpaceSphere
end ChartedSpace
section SmoothManifold
theorem sphere_ext_iff (u v : sphere (0 : E) 1) : u = v โ โช(u : E), vโซ_โ = 1 := by
simp [Subtype.ext_iff, inner_eq_one_iff_of_norm_one]
theorem stereographic'_symm_apply {n : โ} [Fact (finrank โ E = n + 1)] (v : sphere (0 : E) 1)
(x : EuclideanSpace โ (Fin n)) :
((stereographic' n v).symm x : E) =
let U : (โ โ (v : E))แฎ โโแตข[โ] EuclideanSpace โ (Fin n) :=
(OrthonormalBasis.fromOrthogonalSpanSingleton n (ne_zero_of_mem_unit_sphere v)).repr
(โ(U.symm x : E)โ ^ 2 + 4)โปยน โข (4 : โ) โข (U.symm x : E) +
(โ(U.symm x : E)โ ^ 2 + 4)โปยน โข (โ(U.symm x : E)โ ^ 2 - 4) โข v.val := by
simp [real_inner_comm, stereographic, stereographic', โ Submodule.coe_norm]
/-! ### Smooth manifold structure on the sphere -/
/-- The unit sphere in an `n + 1`-dimensional inner product space `E` is a smooth manifold,
modelled on the Euclidean space of dimension `n`. -/
instance EuclideanSpace.instSmoothManifoldWithCornersSphere {n : โ} [Fact (finrank โ E = n + 1)] :
SmoothManifoldWithCorners (๐ก n) (sphere (0 : E) 1) :=
smoothManifoldWithCorners_of_contDiffOn (๐ก n) (sphere (0 : E) 1)
(by
rintro _ _ โจv, rflโฉ โจv', rflโฉ
let U :=
(-- Removed type ascription, and this helped for some reason with timeout issues?
OrthonormalBasis.fromOrthogonalSpanSingleton (๐ := โ)
n (ne_zero_of_mem_unit_sphere v)).repr
let U' :=
(-- Removed type ascription, and this helped for some reason with timeout issues?
OrthonormalBasis.fromOrthogonalSpanSingleton (๐ := โ)
n (ne_zero_of_mem_unit_sphere v')).repr
have Hโ := U'.contDiff.comp_contDiffOn contDiffOn_stereoToFun
-- Porting note: need to help with implicit variables again
have Hโ := (contDiff_stereoInvFunAux (v := v.val)|>.comp
(โ โ (v : E))แฎ.subtypeL.contDiff).comp U.symm.contDiff
convert Hโ.comp' (Hโ.contDiffOn : ContDiffOn โ โค _ Set.univ) using 1
-- -- squeezed from `ext, simp [sphere_ext_iff, stereographic'_symm_apply, real_inner_comm]`
simp only [PartialHomeomorph.trans_toPartialEquiv, PartialHomeomorph.symm_toPartialEquiv,
PartialEquiv.trans_source, PartialEquiv.symm_source, stereographic'_target,
stereographic'_source]
simp only [modelWithCornersSelf_coe, modelWithCornersSelf_coe_symm, Set.preimage_id,
Set.range_id, Set.inter_univ, Set.univ_inter, Set.compl_singleton_eq, Set.preimage_setOf_eq]
simp only [id, comp_apply, Submodule.subtypeL_apply, PartialHomeomorph.coe_coe_symm,
innerSL_apply, Ne, sphere_ext_iff, real_inner_comm (v' : E)]
rfl)
instance (n : โ) :
SmoothManifoldWithCorners (๐ก n) (sphere (0 : EuclideanSpace โ (Fin (n + 1))) 1) :=
haveI := Fact.mk (@finrank_euclideanSpace_fin โ _ (n + 1))
EuclideanSpace.instSmoothManifoldWithCornersSphere
/-- The inclusion map (i.e., `coe`) from the sphere in `E` to `E` is smooth. -/
theorem contMDiff_coe_sphere {n : โ} [Fact (finrank โ E = n + 1)] :
ContMDiff (๐ก n) ๐(โ, E) โ ((โ) : sphere (0 : E) 1 โ E) := by
-- Porting note: trouble with filling these implicit variables in the instance
have := EuclideanSpace.instSmoothManifoldWithCornersSphere (E := E) (n := n)
rw [contMDiff_iff]
constructor
ยท exact continuous_subtype_val
ยท intro v _
let U : _ โโแตข[โ] _ :=
(-- Again, partially removing type ascription...
OrthonormalBasis.fromOrthogonalSpanSingleton
n (ne_zero_of_mem_unit_sphere (-v))).repr
exact
((contDiff_stereoInvFunAux.comp (โ โ (-v : E))แฎ.subtypeL.contDiff).comp
U.symm.contDiff).contDiffOn
variable {F : Type*} [NormedAddCommGroup F] [NormedSpace โ F]
variable {H : Type*} [TopologicalSpace H] {I : ModelWithCorners โ F H}
variable {M : Type*} [TopologicalSpace M] [ChartedSpace H M] [SmoothManifoldWithCorners I M]
/-- If a `ContMDiff` function `f : M โ E`, where `M` is some manifold, takes values in the
sphere, then it restricts to a `ContMDiff` function from `M` to the sphere. -/
theorem ContMDiff.codRestrict_sphere {n : โ} [Fact (finrank โ E = n + 1)] {m : โโ} {f : M โ E}
(hf : ContMDiff I ๐(โ, E) m f) (hf' : โ x, f x โ sphere (0 : E) 1) :
ContMDiff I (๐ก n) m (Set.codRestrict _ _ hf' : M โ sphere (0 : E) 1) := by
rw [contMDiff_iff_target]
refine โจcontinuous_induced_rng.2 hf.continuous, ?_โฉ
intro v
let U : _ โโแตข[โ] _ :=
(-- Again, partially removing type ascription... Weird that this helps!
OrthonormalBasis.fromOrthogonalSpanSingleton
n (ne_zero_of_mem_unit_sphere (-v))).repr
have h : ContDiffOn โ โค _ Set.univ := U.contDiff.contDiffOn
have Hโ := (h.comp' contDiffOn_stereoToFun).contMDiffOn
have Hโ : ContMDiffOn _ _ _ _ Set.univ := hf.contMDiffOn
convert (Hโ.of_le le_top).comp' Hโ using 1
ext x
have hfxv : f x = -โv โ โชf x, -โvโซ_โ = 1 := by
have hfx : โf xโ = 1 := by simpa using hf' x
rw [inner_eq_one_iff_of_norm_one hfx]
exact norm_eq_of_mem_sphere (-v)
-- Porting note: unfold more
dsimp [chartAt, Set.codRestrict, ChartedSpace.chartAt]
simp [not_iff_not, Subtype.ext_iff, hfxv, real_inner_comm]
/-- The antipodal map is smooth. -/
theorem contMDiff_neg_sphere {n : โ} [Fact (finrank โ E = n + 1)] :
ContMDiff (๐ก n) (๐ก n) โ fun x : sphere (0 : E) 1 => -x := by
-- this doesn't elaborate well in term mode
apply ContMDiff.codRestrict_sphere
apply contDiff_neg.contMDiff.comp _
exact contMDiff_coe_sphere
/-- Consider the differential of the inclusion of the sphere in `E` at the point `v` as a continuous
linear map from `TangentSpace (๐ก n) v` to `E`. The range of this map is the orthogonal complement
of `v` in `E`.
Note that there is an abuse here of the defeq between `E` and the tangent space to `E` at `(v:E`).
In general this defeq is not canonical, but in this case (the tangent space of a vector space) it is
canonical. -/
theorem range_mfderiv_coe_sphere {n : โ} [Fact (finrank โ E = n + 1)] (v : sphere (0 : E) 1) :
LinearMap.range (mfderiv (๐ก n) ๐(โ, E) ((โ) : sphere (0 : E) 1 โ E) v :
TangentSpace (๐ก n) v โL[โ] E) = (โ โ (v : E))แฎ := by
rw [((contMDiff_coe_sphere v).mdifferentiableAt le_top).mfderiv]
dsimp [chartAt]
-- rw [LinearIsometryEquiv.toHomeomorph_symm]
-- rw [โ LinearIsometryEquiv.coe_toHomeomorph]
simp only [chartAt, stereographic_neg_apply, fderivWithin_univ,
LinearIsometryEquiv.toHomeomorph_symm, LinearIsometryEquiv.coe_toHomeomorph,
LinearIsometryEquiv.map_zero, mfld_simps]
let U := (OrthonormalBasis.fromOrthogonalSpanSingleton (๐ := โ) n
(ne_zero_of_mem_unit_sphere (-v))).repr
-- Porting note: this `suffices` was a `change`
suffices
LinearMap.range (fderiv โ ((stereoInvFunAux (-v : E) โ (โ)) โ U.symm) 0) = (โ โ (v : E))แฎ by
convert this using 3
show stereographic' n (-v) v = 0
dsimp [stereographic']
simp only [AddEquivClass.map_eq_zero_iff]
apply stereographic_neg_apply
have :
HasFDerivAt (stereoInvFunAux (-v : E) โ (Subtype.val : (โ โ (โ(-v) : E))แฎ โ E))
(โ โ (โ(-v) : E))แฎ.subtypeL (U.symm 0) := by
convert hasFDerivAt_stereoInvFunAux_comp_coe (-v : E)
simp
convert congrArg LinearMap.range (this.comp 0 U.symm.toContinuousLinearEquiv.hasFDerivAt).fderiv
symm
convert
(U.symm : EuclideanSpace โ (Fin n) โโแตข[โ] (โ โ (โ(-v) : E))แฎ).range_comp
(โ โ (โ(-v) : E))แฎ.subtype using 1
simp only [Submodule.range_subtype, coe_neg_sphere]
congr 1
-- we must show `Submodule.span โ {v} = Submodule.span โ {-v}`
apply Submodule.span_eq_span
ยท simp only [Set.singleton_subset_iff, SetLike.mem_coe]
rw [โ Submodule.neg_mem_iff]
exact Submodule.mem_span_singleton_self (-v : E)
ยท simp only [Set.singleton_subset_iff, SetLike.mem_coe]
rw [Submodule.neg_mem_iff]
exact Submodule.mem_span_singleton_self (v : E)
/-- Consider the differential of the inclusion of the sphere in `E` at the point `v` as a continuous
linear map from `TangentSpace (๐ก n) v` to `E`. This map is injective. -/
theorem mfderiv_coe_sphere_injective {n : โ} [Fact (finrank โ E = n + 1)] (v : sphere (0 : E) 1) :
Injective (mfderiv (๐ก n) ๐(โ, E) ((โ) : sphere (0 : E) 1 โ E) v) := by
rw [((contMDiff_coe_sphere v).mdifferentiableAt le_top).mfderiv]
simp only [chartAt, stereographic', stereographic_neg_apply, fderivWithin_univ,
LinearIsometryEquiv.toHomeomorph_symm, LinearIsometryEquiv.coe_toHomeomorph,
LinearIsometryEquiv.map_zero, mfld_simps]
let U := (OrthonormalBasis.fromOrthogonalSpanSingleton
(๐ := โ) n (ne_zero_of_mem_unit_sphere (-v))).repr
suffices Injective (fderiv โ ((stereoInvFunAux (-v : E) โ (โ)) โ U.symm) 0) by
convert this using 3
show stereographic' n (-v) v = 0
dsimp [stereographic']
simp only [AddEquivClass.map_eq_zero_iff]
apply stereographic_neg_apply
have : HasFDerivAt (stereoInvFunAux (-v : E) โ (Subtype.val : (โ โ (โ(-v) : E))แฎ โ E))
(โ โ (โ(-v) : E))แฎ.subtypeL (U.symm 0) := by
convert hasFDerivAt_stereoInvFunAux_comp_coe (-v : E)
simp
have := congr_arg DFunLike.coe <| (this.comp 0 U.symm.toContinuousLinearEquiv.hasFDerivAt).fderiv
refine Eq.subst this.symm ?_
rw [ContinuousLinearMap.coe_comp', ContinuousLinearEquiv.coe_coe]
simpa using Subtype.coe_injective
end SmoothManifold
section circle
open Complex
-- Porting note: 1+1 = 2 except when synthing instances
theorem finrank_real_complex_fact' : Fact (finrank โ โ = 1 + 1) :=
finrank_real_complex_fact
attribute [local instance] finrank_real_complex_fact'
/-- The unit circle in `โ` is a charted space modelled on `EuclideanSpace โ (Fin 1)`. This
follows by definition from the corresponding result for `Metric.Sphere`. -/
instance : ChartedSpace (EuclideanSpace โ (Fin 1)) circle :=
EuclideanSpace.instChartedSpaceSphere
instance : SmoothManifoldWithCorners (๐ก 1) circle :=
EuclideanSpace.instSmoothManifoldWithCornersSphere (E := โ)
/-- The unit circle in `โ` is a Lie group. -/
instance : LieGroup (๐ก 1) circle where
smooth_mul := by
apply ContMDiff.codRestrict_sphere
let c : circle โ โ := (โ)
have hโ : ContMDiff (๐(โ, โ).prod ๐(โ, โ)) ๐(โ, โ) โ fun z : โ ร โ => z.fst * z.snd := by
rw [contMDiff_iff]
exact โจcontinuous_mul, fun x y => contDiff_mul.contDiffOnโฉ
-- Porting note: needed to fill in first 3 arguments or could not figure out typeclasses
suffices hโ : ContMDiff ((๐ก 1).prod (๐ก 1)) (๐(โ, โ).prod ๐(โ, โ)) โค (Prod.map c c) from
hโ.comp hโ
apply ContMDiff.prod_map <;>
exact contMDiff_coe_sphere
smooth_inv := by
apply ContMDiff.codRestrict_sphere
simp only [โ coe_inv_circle, coe_inv_circle_eq_conj]
exact Complex.conjCLE.contDiff.contMDiff.comp contMDiff_coe_sphere
/-- The map `fun t โฆ exp (t * I)` from `โ` to the unit circle in `โ` is smooth. -/
theorem contMDiff_expMapCircle : ContMDiff ๐(โ, โ) (๐ก 1) โ expMapCircle :=
(contDiff_exp.comp (contDiff_id.smul contDiff_const)).contMDiff.codRestrict_sphere _
end circle