roseking commited on
Commit
be3f8f1
·
verified ·
1 Parent(s): 633d70f

Add lean source and binary files (part 77)

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. lean/OAI/Geometry/SurfaceImmersion/Geometry/CompactTranslationStability.lean +50 -0
  2. lean/OAI/Geometry/SurfaceImmersion/Geometry/CompactVaryingFrameTube.lean +58 -0
  3. lean/OAI/Geometry/SurfaceImmersion/Geometry/ComplexFirstVariation.lean +80 -0
  4. lean/OAI/Geometry/SurfaceImmersion/Geometry/ComplexJetDecomposition.lean +66 -0
  5. lean/OAI/Geometry/SurfaceImmersion/Geometry/ComplexMixedJets.lean +74 -0
  6. lean/OAI/Geometry/SurfaceImmersion/Geometry/ComplexQuadraticVariation.lean +93 -0
  7. lean/OAI/Geometry/SurfaceImmersion/Geometry/ComplexSlotAdditivity.lean +69 -0
  8. lean/OAI/Geometry/SurfaceImmersion/Geometry/ConditionalMain.lean +146 -0
  9. lean/OAI/Geometry/SurfaceImmersion/Geometry/ConjugatedMultilinearBounds.lean +74 -0
  10. lean/OAI/Geometry/SurfaceImmersion/Geometry/ConjugatedOperatorBounds.lean +94 -0
  11. lean/OAI/Geometry/SurfaceImmersion/Geometry/ConjugatedVariationBounds.lean +85 -0
  12. lean/OAI/Geometry/SurfaceImmersion/Geometry/ConnectedOpenPieces.lean +37 -0
  13. lean/OAI/Geometry/SurfaceImmersion/Geometry/ConstantNormBoundaryGeometry.lean +88 -0
  14. lean/OAI/Geometry/SurfaceImmersion/Geometry/ConvexDerivativeInjectivity.lean +57 -0
  15. lean/OAI/Geometry/SurfaceImmersion/Geometry/ConvolutionDerivativeBounds.lean +55 -0
  16. lean/OAI/Geometry/SurfaceImmersion/Geometry/CorrectedNormalSeed.lean +75 -0
  17. lean/OAI/Geometry/SurfaceImmersion/Geometry/CovarianceParameter.lean +229 -0
  18. lean/OAI/Geometry/SurfaceImmersion/Geometry/CovarianceRealOperator.lean +116 -0
  19. lean/OAI/Geometry/SurfaceImmersion/Geometry/CovectorPullbackParameters.lean +90 -0
  20. lean/OAI/Geometry/SurfaceImmersion/Geometry/CriticalSetClosed.lean +49 -0
  21. lean/OAI/Geometry/SurfaceImmersion/Geometry/CubicTaylorRemainder.lean +67 -0
  22. lean/OAI/Geometry/SurfaceImmersion/Geometry/CurveEdgeLocalization.lean +60 -0
  23. lean/OAI/Geometry/SurfaceImmersion/Geometry/CurveEdgeParametrization.lean +53 -0
  24. lean/OAI/Geometry/SurfaceImmersion/Geometry/CurveEdgePaths.lean +61 -0
  25. lean/OAI/Geometry/SurfaceImmersion/Geometry/CurveEdgeWitness.lean +45 -0
  26. lean/OAI/Geometry/SurfaceImmersion/Geometry/CurveFrameInverse.lean +69 -0
  27. lean/OAI/Geometry/SurfaceImmersion/Geometry/CurveIncidenceBoundaryPair.lean +79 -0
  28. lean/OAI/Geometry/SurfaceImmersion/Geometry/CurveIncidenceGraph.lean +102 -0
  29. lean/OAI/Geometry/SurfaceImmersion/Geometry/CurveNormalFrame.lean +57 -0
  30. lean/OAI/Geometry/SurfaceImmersion/Geometry/CurveSecondFields.lean +122 -0
  31. lean/OAI/Geometry/SurfaceImmersion/Geometry/CurveSecondTransition.lean +49 -0
  32. lean/OAI/Geometry/SurfaceImmersion/Geometry/CurveTransverseVector.lean +46 -0
  33. lean/OAI/Geometry/SurfaceImmersion/Geometry/CycleCorrectedGeometry.lean +341 -0
  34. lean/OAI/Geometry/SurfaceImmersion/Geometry/DegreeOneReachability.lean +40 -0
  35. lean/OAI/Geometry/SurfaceImmersion/Geometry/DensityNormalizedPath.lean +47 -0
  36. lean/OAI/Geometry/SurfaceImmersion/Geometry/DirectionalJetBounds.lean +67 -0
  37. lean/OAI/Geometry/SurfaceImmersion/Geometry/DisjointJetBounds.lean +55 -0
  38. lean/OAI/Geometry/SurfaceImmersion/Geometry/DisplacementSum.lean +25 -0
  39. lean/OAI/Geometry/SurfaceImmersion/Geometry/EmbeddedCurveGraphPath.lean +106 -0
  40. lean/OAI/Geometry/SurfaceImmersion/Geometry/EmbeddedOpenSubset.lean +48 -0
  41. lean/OAI/Geometry/SurfaceImmersion/Geometry/EuclideanImmersionLocalInjective.lean +41 -0
  42. lean/OAI/Geometry/SurfaceImmersion/Geometry/EuclideanRestoration.lean +62 -0
  43. lean/OAI/Geometry/SurfaceImmersion/Geometry/EuclideanSurfaceImageNull.lean +51 -0
  44. lean/OAI/Geometry/SurfaceImmersion/Geometry/ExactFastFamily.lean +193 -0
  45. lean/OAI/Geometry/SurfaceImmersion/Geometry/ExactGeometricFastFamily.lean +102 -0
  46. lean/OAI/Geometry/SurfaceImmersion/Geometry/ExactInputRecurrence.lean +55 -0
  47. lean/OAI/Geometry/SurfaceImmersion/Geometry/ExactInputRecurrenceBound.lean +51 -0
  48. lean/OAI/Geometry/SurfaceImmersion/Geometry/ExactScaleOrdering.lean +39 -0
  49. lean/OAI/Geometry/SurfaceImmersion/Geometry/ExplicitFixedOrderThreshold.lean +112 -0
  50. lean/OAI/Geometry/SurfaceImmersion/Geometry/ExplicitPowerThreshold.lean +65 -0
lean/OAI/Geometry/SurfaceImmersion/Geometry/CompactTranslationStability.lean ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Geometry.SurfaceImmersion.Geometry.RegularZeroStability
2
+
3
+ namespace OAI
4
+
5
+ /-! Small scalar-weighted translations preserve compact regular zero sets. -/
6
+ noncomputable section
7
+ open Set Metric
8
+ open scoped ContDiff Topology
9
+ namespace ClosedSurfaceR4.FiniteOrderSmoothing
10
+ variable {E F : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E]
11
+ [NormedAddCommGroup F] [NormedSpace ℝ F] [FiniteDimensional ℝ F]
12
+ local instance translationScalarNormed : NormedAddCommGroup (E →L[ℝ] ℝ) := inferInstance
13
+ local instance translationScalarSpace : NormedSpace ℝ (E →L[ℝ] ℝ) := inferInstance
14
+ local instance translationTargetNormed : NormedAddCommGroup (E →L[ℝ] F) := inferInstance
15
+ local instance translationTargetSpace : NormedSpace ℝ (E →L[ℝ] F) := inferInstance
16
+
17
+ theorem compact_translation_stability {f : E → F} {χ : E → ℝ}
18
+ (hf : ContDiff ℝ ∞ f) (hχ : ContDiff ℝ ∞ χ)
19
+ {K : Set E} (hK : IsCompact K)
20
+ (hreg : ∀ x ∈ K, f x = 0 → Function.Surjective (fderiv ℝ f x)) :
21
+ ∃ δ > 0, ∀ a : F, ‖a‖ < δ → ∀ x ∈ K, f x+χ x • a = 0 →
22
+ Function.Surjective (fderiv ℝ (fun y => f y+χ y • a) x) := by
23
+ obtain ⟨ε,hε,hεreg⟩ := compact_regular_zero_stability hf hK hreg
24
+ obtain ⟨M₀,hM₀⟩ := hK.exists_bound_of_continuousOn hχ.continuous.continuousOn
25
+ obtain ⟨M₁,hM₁⟩ := hK.exists_bound_of_continuousOn (hχ.continuous_fderiv (by simp)).continuousOn
26
+ let B := max M₀ (max M₁ 0)+1
27
+ have hB : 0 < B := by dsimp [B]; have := le_max_right M₀ (max M₁ 0); have := le_max_right M₁ 0; linarith
28
+ refine ⟨ε/B,div_pos hε hB,?_⟩
29
+ intro a ha
30
+ have hab : B*‖a‖ < ε := by
31
+ simpa only [mul_comm] using (lt_div_iff₀ hB).mp ha
32
+ apply hεreg (fun y => f y+χ y • a)
33
+ · intro x hx
34
+ rw [add_sub_cancel_left,norm_smul]
35
+ have hχB : ‖χ x‖ ≤ B := (hM₀ x hx).trans (by dsimp [B]; linarith [le_max_left M₀ (max M₁ 0)])
36
+ exact (mul_le_mul_of_nonneg_right hχB (norm_nonneg a)).trans_lt hab
37
+ · intro x hx
38
+ have hd := ((hf.differentiable (by simp) x).hasFDerivAt.add
39
+ ((hχ.differentiable (by simp) x).hasFDerivAt.smul_const a)).fderiv
40
+ change ‖fderiv ℝ (f + fun y => χ y • a) x-fderiv ℝ f x‖ < ε
41
+ rw [hd,add_sub_cancel_left,ContinuousLinearMap.norm_smulRight_apply]
42
+ have hχB : ‖fderiv ℝ χ x‖ ≤ B := (hM₁ x hx).trans (by
43
+ dsimp [B]; linarith [le_max_right M₀ (max M₁ 0),le_max_left M₁ 0])
44
+ exact (mul_le_mul_of_nonneg_right hχB (norm_nonneg a)).trans_lt hab
45
+
46
+ end ClosedSurfaceR4.FiniteOrderSmoothing
47
+
48
+ end
49
+
50
+ end OAI
lean/OAI/Geometry/SurfaceImmersion/Geometry/CompactVaryingFrameTube.lean ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Geometry.SurfaceImmersion.Whitney.VaryingFramedCurveTube
2
+ import Mathlib.Analysis.Calculus.InverseFunctionTheorem.ContDiff
3
+
4
+ namespace OAI
5
+
6
+ /-! One transverse radius works for all points of a compact regular
7
+ segment of the ruled target tube. -/
8
+ noncomputable section
9
+ open Set Filter Matrix
10
+ open scoped ContDiff Topology
11
+ namespace ClosedSurfaceR4.FiniteOrderSmoothing
12
+ open JetPolynomial (Base)
13
+
14
+ theorem compact_varying_frame_tube {c a : ℝ → (Fin 3 → ℝ)}
15
+ (hc : ContDiff ℝ ∞ c) (ha : ContDiff ℝ ∞ a) {K : Set ℝ}
16
+ (hK : IsCompact K) (hne : K.Nonempty)
17
+ (hv : ∀ t ∈ K, deriv c t ≠ 0) (htrans : ∀ t ∈ K, ∀ r : ℝ, r • deriv c t ≠ a t) :
18
+ ∃ (r : ℝ) (U : Set ℝ), 0 < r ∧ IsOpen U ∧ K ⊆ U ∧
19
+ ∀ x : Base, ‖x‖ < r → ∀ t ∈ U,
20
+ Function.Bijective (fderiv ℝ (varyingFramedCurveTube c a) (x,t)) := by
21
+ obtain ⟨t₀,ht₀⟩ := hne
22
+ have hR := varyingFramedCurveTube_regular_axis hc ha (hv t₀ ht₀) (htrans t₀ ht₀)
23
+ let R : (Base × ℝ) ≃L[ℝ] (Fin 3 → ℝ) :=
24
+ ContinuousLinearEquiv.ofBijective (fderiv ℝ (varyingFramedCurveTube c a) (0,t₀))
25
+ (LinearMap.ker_eq_bot.mpr hR.1) (LinearMap.range_eq_top.mpr hR.2)
26
+ let W : Set (Base × ℝ) :=
27
+ {z | IsUnit (R.symm.toContinuousLinearMap.comp (fderiv ℝ (varyingFramedCurveTube c a) z))}
28
+ have hcont : Continuous (fun z =>
29
+ R.symm.toContinuousLinearMap.comp (fderiv ℝ (varyingFramedCurveTube c a) z)) :=
30
+ continuous_const.clm_comp ((varyingFramedCurveTube_smooth hc ha).continuous_fderiv (by simp))
31
+ have hW : IsOpen W := Units.isOpen.preimage hcont
32
+ have haxis : ({0} : Set Base) ×ˢ K ⊆ W := by
33
+ rintro ⟨x,t⟩ ⟨hx,ht⟩
34
+ obtain rfl : x = 0 := hx
35
+ apply ContinuousLinearMap.isUnit_iff_bijective.mpr
36
+ exact R.symm.bijective.comp (varyingFramedCurveTube_regular_axis hc ha (hv t ht) (htrans t ht))
37
+ obtain ⟨V,U,hV,hU,h0V,hKU,hVU⟩ :=
38
+ generalized_tube_lemma isCompact_singleton hK hW haxis
39
+ obtain ⟨r,hr,hball⟩ := Metric.isOpen_iff.mp hV 0 (h0V (by simp))
40
+ refine ⟨r,U,hr,hU,hKU,?_⟩
41
+ intro x hx t ht
42
+ have hxV : x ∈ V := hball (by simpa [dist_zero_right] using hx)
43
+ have hunit : IsUnit (R.symm.toContinuousLinearMap.comp
44
+ (fderiv ℝ (varyingFramedCurveTube c a) (x,t))) := hVU ⟨hxV,ht⟩
45
+ have hbij := ContinuousLinearMap.isUnit_iff_bijective.mp hunit
46
+ have heq : (R : (Base × ℝ) → (Fin 3 → ℝ)) ∘
47
+ (R.symm.toContinuousLinearMap.comp (fderiv ℝ (varyingFramedCurveTube c a) (x,t))) =
48
+ fderiv ℝ (varyingFramedCurveTube c a) (x,t) := by
49
+ funext v
50
+ exact R.apply_symm_apply _
51
+ rw [← heq]
52
+ exact R.bijective.comp hbij
53
+
54
+ end ClosedSurfaceR4.FiniteOrderSmoothing
55
+
56
+ end
57
+
58
+ end OAI
lean/OAI/Geometry/SurfaceImmersion/Geometry/ComplexFirstVariation.lean ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Geometry.SurfaceImmersion.Geometry.ComplexMixedJets
2
+ import OAI.Geometry.SurfaceImmersion.Geometry.ComplexJetDecomposition
3
+
4
+ namespace OAI
5
+
6
+ /-! The complex polynomial first variation is exactly the complexification
7
+ of the actual real differential. -/
8
+ noncomputable section
9
+ open scoped ContDiff BigOperators
10
+
11
+ namespace ClosedSurfaceR4.JetPolynomial
12
+ open MixedExpression
13
+
14
+ def complexDirectionData (G : Base → Space) (H : Base → Fin 4 → ℂ) : JetData :=
15
+ Fin.cases (fun w a p => (jet G w a p : ℂ))
16
+ (fun j w a p => if j = 0 then complexJet H w a p else 0)
17
+
18
+ lemma evalComplex_sumList {ι : Type*} (l : List ι) (f : ι → MixedExpression)
19
+ (G : Base → Space) (J : JetData) (z : Base × ℝ) :
20
+ (sumList l f).evalComplex G J z = (l.map (fun i => (f i).evalComplex G J z)).sum := by
21
+ induction l with
22
+ | nil => rfl
23
+ | cons i l ih => simp only [sumList, evalComplex, List.map_cons, List.sum_cons, ih]
24
+
25
+ lemma evalComplex_ofExpression (e : Expression) (G : Base → Space)
26
+ (H : Base → Fin 4 → ℂ) (z : Base × ℝ) :
27
+ (ofExpression e).evalComplex G (complexDirectionData G H) z = (e.eval G z : ℂ) := by
28
+ induction e with
29
+ | coeff c => rfl
30
+ | atom w a e ih => simp only [ofExpression, evalComplex, complexDirectionData, Fin.cases_zero,
31
+ ih, Expression.eval, Complex.ofReal_mul]
32
+ | add e f ihe ihf => simp only [ofExpression, evalComplex, ihe, ihf, Expression.eval, Complex.ofReal_add]
33
+
34
+ lemma complex_coefficient_variation (c : LowJet × ℝ → ℝ) (G : Base → Space)
35
+ (H : Base → Fin 4 → ℂ) (z : Base × ℝ) :
36
+ ((coeff c).differentiate 0).evalComplex G (complexDirectionData G H) z =
37
+ ∑ i : Fin 7 × Fin 4, complexJet H (lowWord i.1) i.2 z.1 *
38
+ (coefficientDerivative c i (lowJet G z.1, z.2) : ℂ) := by
39
+ simp only [differentiate, evalComplex_sumList, evalComplex, complexDirectionData,
40
+ Fin.cases_succ, ↓reduceIte]
41
+ exact Finset.sum_map_toList _ _
42
+
43
+ private lemma complex_sum_decompose {ι : Type*} [Fintype ι] (a b d : ι → ℝ) :
44
+ (∑ i, ((a i : ℂ) + Complex.I * (b i : ℂ)) * (d i : ℂ)) =
45
+ (∑ i, a i * d i : ℝ) + Complex.I * (∑ i, b i * d i : ℝ) := by
46
+ simp only [add_mul, mul_assoc, Finset.sum_add_distrib, ← Finset.mul_sum,
47
+ ← Complex.ofReal_mul, ← Complex.ofReal_sum]
48
+
49
+ /-- This identity identifies the algebraic complex evaluation with the
50
+ actual real differential on the real and imaginary parts separately. -/
51
+ theorem complex_first_variation (e : Expression) (G : Base → Space)
52
+ {H : Base → Fin 4 → ℂ} (hH : ContDiff ℝ ∞ H) (z : Base × ℝ) :
53
+ ((ofExpression e).differentiate 0).evalComplex G (complexDirectionData G H) z =
54
+ (e.variation G (realField H) z : ℂ) +
55
+ Complex.I * (e.variation G (imagField H) z : ℂ) := by
56
+ induction e with
57
+ | coeff c =>
58
+ rw [ofExpression, complex_coefficient_variation]
59
+ simp_rw [complexJet_decompose hH]
60
+ rw [complex_sum_decompose]
61
+ rw [Expression.variation, Expression.variation,
62
+ coefficient_variation_sum, coefficient_variation_sum]
63
+ rfl
64
+ | atom w a e ih =>
65
+ simp only [ofExpression, differentiate, ↓reduceIte, evalComplex,
66
+ complexDirectionData, Fin.cases_zero, Fin.cases_succ, evalComplex_ofExpression, ih,
67
+ Expression.variation]
68
+ rw [complexJet_decompose hH]
69
+ push_cast
70
+ ring
71
+ | add e f ihe ihf =>
72
+ simp only [ofExpression, differentiate, evalComplex, ihe, ihf, Expression.variation,
73
+ Complex.ofReal_add]
74
+ ring
75
+
76
+ end ClosedSurfaceR4.JetPolynomial
77
+
78
+ end
79
+
80
+ end OAI
lean/OAI/Geometry/SurfaceImmersion/Geometry/ComplexJetDecomposition.lean ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Geometry.SurfaceImmersion.Geometry.JetVariations
2
+
3
+ namespace OAI
4
+
5
+ /-! Real and imaginary parts commute with all actual ordered jets. -/
6
+ noncomputable section
7
+ open scoped ContDiff
8
+
9
+ namespace ClosedSurfaceR4.JetPolynomial
10
+ open WeightedEstimates
11
+
12
+ lemma directional_clm {A E F : Type*} [NormedAddCommGroup A] [NormedSpace ℝ A]
13
+ [NormedAddCommGroup E] [NormedSpace ℝ E] [NormedAddCommGroup F] [NormedSpace ℝ F]
14
+ (L : E →L[ℝ] F) {f : A → E} (hf : ContDiff ℝ ∞ f) (w : List A) :
15
+ iteratedDirectional w (L ∘ f) = L ∘ iteratedDirectional w f := by
16
+ induction w with
17
+ | nil => rfl
18
+ | cons v w ih =>
19
+ rw [iteratedDirectional, ih]
20
+ funext p
21
+ have hs := contDiffOn_univ.mp (contDiffOn_iteratedDirectional isOpen_univ hf.contDiffOn w)
22
+ exact congrArg (fun T : A →L[ℝ] F => T v)
23
+ ((L.hasFDerivAt.comp p (hs.differentiable (by simp) p).hasFDerivAt).fderiv)
24
+
25
+ def complexJet (H : Base → Fin 4 → ℂ) (w : List (Fin 2)) (a : Fin 4) : Base → ℂ :=
26
+ iteratedDirectional (w.map coordinateVector) (fun p => H p a)
27
+
28
+ def realField (H : Base → Fin 4 → ℂ) : Base → Space := fun p a => (H p a).re
29
+ def imagField (H : Base → Fin 4 → ℂ) : Base → Space := fun p a => (H p a).im
30
+
31
+ lemma realField_smooth {H : Base → Fin 4 → ℂ} (hH : ContDiff ℝ ∞ H) :
32
+ ContDiff ℝ ∞ (realField H) := by
33
+ apply contDiff_pi.mpr
34
+ intro a
35
+ exact Complex.reCLM.contDiff.comp (contDiff_pi.mp hH a)
36
+
37
+ lemma imagField_smooth {H : Base → Fin 4 → ℂ} (hH : ContDiff ℝ ∞ H) :
38
+ ContDiff ℝ ∞ (imagField H) := by
39
+ apply contDiff_pi.mpr
40
+ intro a
41
+ exact Complex.imCLM.contDiff.comp (contDiff_pi.mp hH a)
42
+
43
+ lemma complexJet_re {H : Base → Fin 4 → ℂ} (hH : ContDiff ℝ ∞ H)
44
+ (w : List (Fin 2)) (a : Fin 4) (p : Base) :
45
+ (complexJet H w a p).re = jet (realField H) w a p := by
46
+ exact (congrFun (directional_clm Complex.reCLM (contDiff_pi.mp hH a)
47
+ (w.map coordinateVector)) p).symm
48
+
49
+ lemma complexJet_im {H : Base → Fin 4 → ℂ} (hH : ContDiff ℝ ∞ H)
50
+ (w : List (Fin 2)) (a : Fin 4) (p : Base) :
51
+ (complexJet H w a p).im = jet (imagField H) w a p := by
52
+ exact (congrFun (directional_clm Complex.imCLM (contDiff_pi.mp hH a)
53
+ (w.map coordinateVector)) p).symm
54
+
55
+ lemma complexJet_decompose {H : Base → Fin 4 → ℂ} (hH : ContDiff ℝ ∞ H)
56
+ (w : List (Fin 2)) (a : Fin 4) (p : Base) :
57
+ complexJet H w a p = (jet (realField H) w a p : ℂ) +
58
+ Complex.I * (jet (imagField H) w a p : ℂ) := by
59
+ rw [← complexJet_re hH, ← complexJet_im hH]
60
+ exact Complex.ext (by simp) (by simp)
61
+
62
+ end ClosedSurfaceR4.JetPolynomial
63
+
64
+ end
65
+
66
+ end OAI
lean/OAI/Geometry/SurfaceImmersion/Geometry/ComplexMixedJets.lean ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Geometry.SurfaceImmersion.Correction.PolynomialVariationScaling
2
+
3
+ namespace OAI
4
+
5
+ /-! Complex evaluation of the real polynomial variations, keeping the base
6
+ map fixed and complexifying the direction jets. -/
7
+ noncomputable section
8
+ open scoped ContDiff
9
+
10
+ namespace ClosedSurfaceR4.JetPolynomial.MixedExpression
11
+
12
+ abbrev JetData := Fin 4 → List (Fin 2) → Fin 4 → Base → ℂ
13
+
14
+ def evalComplex : MixedExpression → (Base → Space) → JetData → Base × ℝ → ℂ
15
+ | .coeff c, G, _, z => (c (lowJet G z.1, z.2) : ℂ)
16
+ | .atom i w a e, G, J, z => J i w a z.1 * e.evalComplex G J z
17
+ | .add e f, G, J, z => e.evalComplex G J z + f.evalComplex G J z
18
+
19
+ def scaleJetSlot (J : JetData) (j : Fin 3) (c : Base → ℂ) : JetData :=
20
+ fun i w a p => if i = j.succ then c p * J i w a p else J i w a p
21
+
22
+ lemma DegreeIn.evalComplex_scaleSlot {j : Fin 3} {e : MixedExpression} {n : ℕ}
23
+ (he : DegreeIn j e n) (G : Base → Space) (J : JetData) (c : Base → ℂ) (z : Base × ℝ) :
24
+ e.evalComplex G (scaleJetSlot J j c) z = c z.1 ^ n * e.evalComplex G J z := by
25
+ induction he with
26
+ | coeff d => simp only [evalComplex, pow_zero, one_mul]
27
+ | zero n => simp only [evalComplex, Complex.ofReal_zero, mul_zero]
28
+ | other i w a hi h ih =>
29
+ simp only [evalComplex, scaleJetSlot, hi, ↓reduceIte, ih]
30
+ ring
31
+ | same w a h ih =>
32
+ simp only [evalComplex, scaleJetSlot, ↓reduceIte, ih, pow_succ]
33
+ ring
34
+ | add he hf ihe ihf => simp only [evalComplex, ihe, ihf, mul_add]
35
+
36
+ def scaleJets (J : JetData) (c : Fin 3 → Base → ℂ) : JetData :=
37
+ scaleJetSlot (scaleJetSlot (scaleJetSlot J 0 (c 0)) 1 (c 1)) 2 (c 2)
38
+
39
+ lemma evalComplex_scaleJets {e : MixedExpression} {n : Fin 3 → ℕ}
40
+ (he : ∀ j, DegreeIn j e (n j)) (G : Base → Space) (J : JetData)
41
+ (c : Fin 3 → Base → ℂ) (z : Base × ℝ) :
42
+ e.evalComplex G (scaleJets J c) z =
43
+ ((c 0 z.1) ^ n 0 * (c 1 z.1) ^ n 1 * (c 2 z.1) ^ n 2) * e.evalComplex G J z := by
44
+ simp only [scaleJets, (he 2).evalComplex_scaleSlot, (he 1).evalComplex_scaleSlot,
45
+ (he 0).evalComplex_scaleSlot]
46
+ ring
47
+
48
+ lemma evalComplex_smooth {O : Set LowJet} {U : Set Base} {G : Base → Space}
49
+ (hG : ContDiff ℝ ∞ G) (hQ : Set.MapsTo (lowJet G) U O)
50
+ {J : JetData} (hJ : ∀ i w a, ContDiffOn ℝ ∞ (J i w a) U)
51
+ {e : MixedExpression} (he : e.SmoothCoeffs O) :
52
+ ContDiffOn ℝ ∞ (e.evalComplex G J) (U ×ˢ Set.univ) := by
53
+ induction e with
54
+ | coeff c =>
55
+ exact Complex.ofRealCLM.contDiff.comp_contDiffOn
56
+ (he.comp (((lowJet_smooth hG).comp contDiff_fst).prodMk contDiff_snd).contDiffOn
57
+ (fun z hz => ⟨hQ hz.1, hz.2⟩))
58
+ | atom i w a e ih =>
59
+ exact ((hJ i w a).comp contDiffOn_fst (fun _ hz => hz.1)).mul (ih he)
60
+ | add e f ihe ihf => exact (ihe he.1).add (ihf he.2)
61
+
62
+ lemma evalComplex_parameter_smooth {O : Set LowJet} {U : Set Base} {G : Base → Space}
63
+ (hG : ContDiff ℝ ∞ G) (hQ : Set.MapsTo (lowJet G) U O)
64
+ {J : JetData} (hJ : ∀ i w a, ContDiffOn ℝ ∞ (J i w a) U)
65
+ {e : MixedExpression} (he : e.SmoothCoeffs O) (t : ℝ) :
66
+ ContDiffOn ℝ ∞ (fun p => e.evalComplex G J (p, t)) U :=
67
+ (evalComplex_smooth hG hQ hJ he).comp (contDiffOn_id.prodMk contDiffOn_const)
68
+ (fun _ hp => ⟨hp, Set.mem_univ t⟩)
69
+
70
+ end ClosedSurfaceR4.JetPolynomial.MixedExpression
71
+
72
+ end
73
+
74
+ end OAI
lean/OAI/Geometry/SurfaceImmersion/Geometry/ComplexQuadraticVariation.lean ADDED
@@ -0,0 +1,93 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Geometry.SurfaceImmersion.Geometry.ComplexSlotAdditivity
2
+ import OAI.Geometry.SurfaceImmersion.Geometry.ComplexFirstVariation
3
+
4
+ namespace OAI
5
+
6
+ /-! Actual complexified second polynomial variation, with both direction
7
+ slots and their bilinear algebra made explicit. -/
8
+ noncomputable section
9
+ open scoped ContDiff
10
+ namespace ClosedSurfaceR4.JetPolynomial
11
+ open MixedExpression
12
+
13
+ abbrev DirectionJets := List (Fin 2) → Fin 4 → Base → ℂ
14
+
15
+ def pairJetData (G : Base → Space) (J K : DirectionJets) : JetData :=
16
+ ![fun w a p => (jet G w a p : ℂ), J, K, 0]
17
+
18
+ def quadraticComplex (e : Expression) (G : Base → Space)
19
+ (J K : DirectionJets) (z : Base × ℝ) : ℂ :=
20
+ (e.variations 1).evalComplex G (pairJetData G J K) z
21
+
22
+ lemma quadraticComplex_add_left (e : Expression) (G : Base → Space)
23
+ (J K L : DirectionJets) (z : Base × ℝ) :
24
+ quadraticComplex e G (J + K) L z = quadraticComplex e G J L z + quadraticComplex e G K L z := by
25
+ apply DegreeIn.evalComplex_add (j := 0)
26
+ (show DegreeIn 0 (e.variations 1) 1 by simpa using e.variations_degree 1 0)
27
+ · intro i hi w a
28
+ fin_cases i <;> simp_all [pairJetData]
29
+ · intro i hi w a
30
+ fin_cases i <;> simp_all [pairJetData]
31
+ · intro w a
32
+ rfl
33
+
34
+ lemma quadraticComplex_add_right (e : Expression) (G : Base → Space)
35
+ (J K L : DirectionJets) (z : Base × ℝ) :
36
+ quadraticComplex e G J (K + L) z = quadraticComplex e G J K z + quadraticComplex e G J L z := by
37
+ apply DegreeIn.evalComplex_add (j := 1)
38
+ (show DegreeIn 1 (e.variations 1) 1 by simpa using e.variations_degree 1 1)
39
+ · intro i hi w a
40
+ fin_cases i <;> simp_all [pairJetData]
41
+ · intro i hi w a
42
+ fin_cases i <;> simp_all [pairJetData]
43
+ · intro w a
44
+ rfl
45
+
46
+ lemma quadraticComplex_smul_left (e : Expression) (G : Base → Space)
47
+ (J K : DirectionJets) (c : ℂ) (z : Base × ℝ) :
48
+ quadraticComplex e G (c • J) K z = c * quadraticComplex e G J K z := by
49
+ have hh := (show DegreeIn 0 (e.variations 1) 1 by simpa using e.variations_degree 1 0).evalComplex_scaleSlot
50
+ G (pairJetData G J K) (fun _ => c) z
51
+ have he : scaleJetSlot (pairJetData G J K) 0 (fun _ => c) = pairJetData G (c • J) K := by
52
+ funext i w a p
53
+ fin_cases i <;> simp [scaleJetSlot, pairJetData]
54
+ rw [he, pow_one] at hh
55
+ exact hh
56
+
57
+ lemma quadraticComplex_smul_right (e : Expression) (G : Base → Space)
58
+ (J K : DirectionJets) (c : ℂ) (z : Base × ℝ) :
59
+ quadraticComplex e G J (c • K) z = c * quadraticComplex e G J K z := by
60
+ have hh := (show DegreeIn 1 (e.variations 1) 1 by simpa using e.variations_degree 1 1).evalComplex_scaleSlot
61
+ G (pairJetData G J K) (fun _ => c) z
62
+ have he : scaleJetSlot (pairJetData G J K) 1 (fun _ => c) = pairJetData G J (c • K) := by
63
+ funext i w a p
64
+ fin_cases i <;> simp [scaleJetSlot, pairJetData]
65
+ rw [he, pow_one] at hh
66
+ exact hh
67
+
68
+ def starDirectionJets (J : DirectionJets) : DirectionJets := fun w a p => star (J w a p)
69
+
70
+ lemma evalComplex_star (e : MixedExpression) (G : Base → Space) (J : JetData) (z : Base × ℝ) :
71
+ e.evalComplex G (fun i w a p => star (J i w a p)) z = star (e.evalComplex G J z) := by
72
+ induction e with
73
+ | coeff c => simp only [evalComplex, Complex.star_def, Complex.conj_ofReal]
74
+ | atom i w a e ih => simp only [evalComplex, ih, star_mul']
75
+ | add e f ihe ihf => simp only [evalComplex, ihe, ihf, star_add]
76
+
77
+ lemma quadraticComplex_star (e : Expression) (G : Base → Space)
78
+ (J K : DirectionJets) (z : Base × ℝ) :
79
+ quadraticComplex e G (starDirectionJets J) (starDirectionJets K) z =
80
+ star (quadraticComplex e G J K z) := by
81
+ have he : pairJetData G (starDirectionJets J) (starDirectionJets K) =
82
+ fun i w a p => star (pairJetData G J K i w a p) := by
83
+ funext i w a p
84
+ fin_cases i <;> simp [pairJetData, starDirectionJets]
85
+ change (e.variations 1).evalComplex G _ z = _
86
+ rw [he]
87
+ exact evalComplex_star (e.variations 1) G (pairJetData G J K) z
88
+
89
+ end ClosedSurfaceR4.JetPolynomial
90
+
91
+ end
92
+
93
+ end OAI
lean/OAI/Geometry/SurfaceImmersion/Geometry/ComplexSlotAdditivity.lean ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Geometry.SurfaceImmersion.Geometry.ComplexMixedJets
2
+
3
+ namespace OAI
4
+
5
+ /-! Additivity in each degree-one complex direction slot of the actual
6
+ mixed polynomial variation. -/
7
+ noncomputable section
8
+ namespace ClosedSurfaceR4.JetPolynomial.MixedExpression
9
+
10
+ private theorem degree_addition {j : Fin 3} {e : MixedExpression} {n : ℕ}
11
+ (he : DegreeIn j e n) (G : Base → Space) (J₁ J₂ J₃ : JetData) (z : Base × ℝ)
12
+ (h₂ : ∀ i, i ≠ j.succ → ∀ w a, J₂ i w a z.1 = J₁ i w a z.1)
13
+ (h₃ : ∀ i, i ≠ j.succ → ∀ w a, J₃ i w a z.1 = J₁ i w a z.1)
14
+ (hadd : ∀ w a, J₃ j.succ w a z.1 = J₁ j.succ w a z.1 + J₂ j.succ w a z.1) :
15
+ (n = 0 → e.evalComplex G J₁ z = e.evalComplex G J₂ z ∧
16
+ e.evalComplex G J₃ z = e.evalComplex G J₁ z) ∧
17
+ (n = 1 → e.evalComplex G J₃ z = e.evalComplex G J₁ z + e.evalComplex G J₂ z) := by
18
+ induction he with
19
+ | coeff c =>
20
+ constructor
21
+ · intro _; exact ⟨rfl, rfl⟩
22
+ · intro hn; omega
23
+ | zero k => simp [evalComplex]
24
+ | other i w a hi h ih =>
25
+ constructor
26
+ · intro hn
27
+ obtain ⟨h12, h31⟩ := ih.1 hn
28
+ simp only [evalComplex, h₂ i hi, h₃ i hi, h12, h31, and_self]
29
+ · intro hn
30
+ simp only [evalComplex, h₂ i hi, h₃ i hi, ih.2 hn, mul_add]
31
+ | @same e k w a h ih =>
32
+ constructor
33
+ · intro hn; omega
34
+ · intro hn
35
+ have hk : k = 0 := by omega
36
+ obtain ⟨h12, h31⟩ := ih.1 hk
37
+ simp only [evalComplex, hadd, h31, ← h12, add_mul]
38
+ | add he hf ihe ihf =>
39
+ constructor
40
+ · intro hn
41
+ obtain ⟨he12, he31⟩ := ihe.1 hn
42
+ obtain ⟨hf12, hf31⟩ := ihf.1 hn
43
+ simp only [evalComplex, he12, he31, hf12, hf31, and_self]
44
+ · intro hn
45
+ simp only [evalComplex, ihe.2 hn, ihf.2 hn]
46
+ ring
47
+
48
+ theorem DegreeIn.evalComplex_add {j : Fin 3} {e : MixedExpression}
49
+ (he : DegreeIn j e 1) (G : Base → Space) (J₁ J₂ J₃ : JetData) (z : Base × ℝ)
50
+ (h₂ : ∀ i, i ≠ j.succ → ∀ w a, J₂ i w a z.1 = J₁ i w a z.1)
51
+ (h₃ : ∀ i, i ≠ j.succ → ∀ w a, J₃ i w a z.1 = J₁ i w a z.1)
52
+ (hadd : ∀ w a, J₃ j.succ w a z.1 = J₁ j.succ w a z.1 + J₂ j.succ w a z.1) :
53
+ e.evalComplex G J₃ z = e.evalComplex G J₁ z + e.evalComplex G J₂ z :=
54
+ (degree_addition he G J₁ J₂ J₃ z h₂ h₃ hadd).2 rfl
55
+
56
+ theorem DegreeIn.evalComplex_independent {j : Fin 3} {e : MixedExpression}
57
+ (he : DegreeIn j e 0) (G : Base → Space) (J₁ J₂ : JetData) (z : Base × ℝ)
58
+ (h₂ : ∀ i, i ≠ j.succ → ∀ w a, J₂ i w a z.1 = J₁ i w a z.1) :
59
+ e.evalComplex G J₁ z = e.evalComplex G J₂ z := by
60
+ let J₃ : JetData := fun i w a p => if i = j.succ then J₁ i w a p + J₂ i w a p else J₁ i w a p
61
+ exact ((degree_addition he G J₁ J₂ J₃ z h₂
62
+ (fun i hi w a => by simp only [J₃, hi, ↓reduceIte])
63
+ (fun w a => by simp only [J₃, ↓reduceIte])).1 rfl).1
64
+
65
+ end ClosedSurfaceR4.JetPolynomial.MixedExpression
66
+
67
+ end
68
+
69
+ end OAI
lean/OAI/Geometry/SurfaceImmersion/Geometry/ConditionalMain.lean ADDED
@@ -0,0 +1,146 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Geometry.SurfaceImmersion.Geometry.UniformCorrectedTermC1
2
+ import OAI.Geometry.SurfaceImmersion.Geometry.ReferenceBoundaryStartingFamily
3
+ import OAI.Geometry.SurfaceImmersion.Geometry.UniformScaledPathBounds
4
+ import OAI.Geometry.SurfaceImmersion.Geometry.CycleCorrectedGeometry
5
+ import OAI.Geometry.SurfaceImmersion.Primitive.IndependentCircularRealization
6
+ import OAI.Geometry.SurfaceImmersion.Whitney.WhitneyStartingGeometry
7
+
8
+ namespace OAI
9
+
10
+ /-! Smooth isometric immersions constructed from spherical immersions,
11
+ and from the compact surface case of Whitney (1944), Theorem 8, p.274. -/
12
+ noncomputable section
13
+ open Set Manifold
14
+ open scoped ContDiff Topology
15
+ namespace ClosedSurfaceR4.FiniteOrderSmoothing
16
+ variable {M : Type*} [TopologicalSpace M] [ChartedSpace Plane M]
17
+ [IsManifold planeModel ∞ M] [CompactSpace M] [T2Space M] [SecondCountableTopology M]
18
+ local instance mainFiberNormed : NormedAddCommGroup TensorFiber := inferInstance
19
+ local instance mainFiberSpace : NormedSpace ℝ TensorFiber := inferInstance
20
+ local instance mainDualAdd : ∀ p : M, ContinuousAdd (TangentSpace planeModel p →L[ℝ] ℝ) :=
21
+ fun _ => inferInstanceAs (ContinuousAdd (Plane →L[ℝ] ℝ))
22
+ local instance mainDualSmul : ∀ p : M, ContinuousSMul ℝ (TangentSpace planeModel p →L[ℝ] ℝ) :=
23
+ fun _ => inferInstanceAs (ContinuousSMul ℝ (Plane →L[ℝ] ℝ))
24
+ local instance mainSectionNormed (p : M) : NormedAddCommGroup (CovariantTwoTensor p) :=
25
+ inferInstanceAs (NormedAddCommGroup TensorFiber)
26
+ local instance mainSectionSpace (p : M) : NormedSpace ℝ (CovariantTwoTensor p) :=
27
+ inferInstanceAs (NormedSpace ℝ TensorFiber)
28
+
29
+ omit [SecondCountableTopology M] in
30
+ /-- The construction starting from a smooth unit spherical immersion. All
31
+ primitive amplitudes and the starting scale are chosen uniformly before
32
+ selecting the finite crossings. -/
33
+ theorem isometric_immersion_of_spherical_immersion (g : SmoothMetric M)
34
+ {I : M → Space} (hI : ContMDiff planeModel spaceModel ∞ I)
35
+ (hunit : ∀ p, ‖I p‖ = 1)
36
+ (hImm : ∀ p, Function.Injective (mfderiv planeModel spaceModel I p)) :
37
+ ∃ W : M → Space, IsSmoothIsometricImmersion M g W := by
38
+ classical
39
+ obtain ⟨A⟩ := exists_smoothingAtlas (M := M)
40
+ obtain ⟨r,D,c,hr,hr1,hD,hc,_hIb,_hIm,hIs,hstart⟩ :=
41
+ A.reference_circular_starting_family g hI hunit hImm zero_lt_one
42
+ let gref := A.shortRemainderMetric g (space_smul_contMDiff hI r) hIs
43
+ have href : gref.inner = g.inner-inducedTensor (r • I) := rfl
44
+ obtain ⟨C,hC,hpath⟩ := A.uniform_scaled_path_bound g r hD
45
+ obtain ⟨d⟩ := A.exists_reference_circular_atlas gref g hc (show 0 ≤ C+1 by linarith)
46
+ obtain ⟨pt,wt,mt,hpt,hwt,hmt,hterm⟩ := d.uniform_corrected_term_C1 hI r href hD
47
+ let m := Fintype.card (d.B.centers × Fin 3)
48
+ let e : Fin m ≃ (d.B.centers × Fin 3) := (Fintype.equivFin _).symm
49
+ obtain ⟨mapTol,delta,W,hmapTol,hmapLe,_hdelta,_hdeltaR,hW,hcycles⟩ :=
50
+ d.corrected_cycles hI r href hpt hwt hmt e
51
+ obtain ⟨E,hE,hterms⟩ := hterm (W 1) (hW 1)
52
+ obtain ⟨N,hN,hrealize⟩ := A.independent_circular_realization g c C d.B
53
+ d.radius d.L (fun i => ‖(d.P i).ξ‖+1) d.L_pos d.region
54
+ d.weight_nonneg d.weight_positive d.convex m E hE
55
+ obtain ⟨q,hindex,houter,_hchart,hpart,hell,hphase,hweights,hweightClose,hcorrect⟩ :=
56
+ hcycles N hN
57
+ obtain ⟨G,g₀,normal,hG,_hu,hG₀,hg₀,⟨good⟩,_hn,hnear,hGb,hlower,_hgm,hshort,hgeom⟩ :=
58
+ hstart (N*m) d.B q mapTol hmapTol
59
+ obtain ⟨f,dCirc,hamp,hphi,hcurves,_hrad,_houter',_hchart',hlinear,hconvex,hcycle,hcyclePhase,_htotal⟩ :=
60
+ hcorrect G hG hnear
61
+ have hnear' : A.WeightedBound 1 1 mt (G-I) :=
62
+ fun i => (hnear i).mono_const hmapLe
63
+ have hcopy (k : Fin N) (b : d.B.centers × Fin 3) :
64
+ (finProdFinEquiv (k,e.symm b)).divNat = k ∧
65
+ e (finProdFinEquiv (k,e.symm b)).modNat = b := by
66
+ have hh := Prod.mk.inj (finProdFinEquiv.symm_apply_apply (k,e.symm b))
67
+ exact ⟨hh.1,by rw [hh.2,e.apply_symm_apply]⟩
68
+ have hell' (k : Fin N) (i : d.B.centers) (j : Fin 3) :
69
+ ‖d.cycleLinearParts e q k i j-(d.P i).ξ j‖ < pt := by
70
+ have h := hphase (finProdFinEquiv (k,e.symm (i,j)))
71
+ simpa only [ReferenceCircularAtlas.cycleLinearParts,
72
+ (hcopy k (i,j)).2] using h
73
+ have htermBound (k : Fin N) (a : Fin m) :
74
+ A.TensorWeightedBound 1 1 E ((f k).term a) := by
75
+ let f' := (f k).reindex e.symm
76
+ have hp' : f'.phase = d.perturbedPhases (d.cycleLinearParts e q k) := by
77
+ funext b
78
+ exact (hphi k (e.symm b)).trans (congrArg _ (e.apply_symm_apply b))
79
+ have ha' : f'.amplitude = d.B.correctedPrimitiveAmplitude d.basis
80
+ (d.cycleWeights e q k) (d.perturbedPhases (d.cycleLinearParts e q k))
81
+ (g.inner-inducedTensor (r • G)) := by
82
+ funext b
83
+ exact (hamp k (e.symm b)).trans (congrArg _ (e.apply_symm_apply b))
84
+ have hnon (b : d.B.centers × Fin 3) :
85
+ ContMDiff planeModel 𝓘(ℝ) ∞ (d.cycleWeights e q k b) := by
86
+ let a : Fin (N*m) := finProdFinEquiv (k,e.symm b)
87
+ have hh : e a.modNat = b := (hcopy k b).2
88
+ have hrsmall : (q.radius a)^2 < (d.radius b.1)^2 := by
89
+ have hrpos := q.radius_pos a
90
+ have hro := q.radius_outer a
91
+ rw [houter a,hh] at hro
92
+ nlinarith [d.radius_pos b.1]
93
+ exact (shrinkingCircularWeight_smooth (b.1 : M) (d.B.weight b.1)
94
+ (d.B.weight_smooth b.1) (d.region b.1) hrsmall).1
95
+ have hsupp (b : d.B.centers × Fin 3) :
96
+ tsupport (d.cycleWeights e q k b) ⊆ tsupport (d.B.weight b.1) := by
97
+ apply closure_mono
98
+ intro p hp
99
+ change d.cycleWeights e q k b p ≠ 0 at hp
100
+ change d.B.weight b.1 p ≠ 0
101
+ intro hz
102
+ exact hp (by simp only [ReferenceCircularAtlas.cycleWeights,shrinkingCircularWeight,hz,zero_mul])
103
+ have hb := hterms (d.cycleLinearParts e q k) (d.cycleWeights e q k) (hell' k)
104
+ hnon hsupp (hweightClose k) (fun b => hweights k b 1) G hG hnear' hGb f' hp' ha' (e a)
105
+ change A.TensorWeightedBound 1 1 E ((f k).term (e.symm (e a))) at hb
106
+ simpa only [e.symm_apply_apply] using hb
107
+ have hshort' : ∀ p v, inducedForm (r • G) p v v ≤ (1/2 : ℝ)*g.inner p v v := by
108
+ intro p v
109
+ change inducedTensor (r • G) p v v ≤ _
110
+ rw [← hg₀]
111
+ exact hshort p v
112
+ have hpBound (k : Fin N) : A.TensorWeightedBound 1 1 C
113
+ (g₀.inner+((k.val : ℝ)/(N : ℝ)) • (g.inner-inducedTensor (r • G))) := by
114
+ rw [hg₀]
115
+ exact hpath G hG hGb (hG₀.mfderiv_injective) hshort' _
116
+ (div_nonneg (Nat.cast_nonneg _) (Nat.cast_nonneg _))
117
+ ((div_le_one (by exact_mod_cast hN)).mpr (by exact_mod_cast k.isLt.le))
118
+ have hcv (a : Fin (N*m)) : dCirc.convexPart a = d.L (dCirc.curves a).index := by
119
+ rw [hconvex,hpart,hcurves,hindex]
120
+ have hlin (a : Fin (N*m)) : ‖dCirc.linearPart a‖ ≤ ‖(d.P (dCirc.curves a).index).ξ‖+1 := by
121
+ rw [hlinear,hcurves,hindex]
122
+ exact hell a
123
+ have htarget : g.inner = g₀.inner+(g.inner-inducedTensor (r • G)) := by
124
+ rw [hg₀]
125
+ abel
126
+ have hgeom' : FiniteBoundaryGeometry dCirc.curves
127
+ (boundaryCrossingSet dCirc.curves univ) (r • G) normal := by
128
+ rw [hcurves]
129
+ exact hgeom
130
+ obtain ⟨F,hF,_hgood⟩ := hrealize g₀ hlower _ f htermBound hpBound dCirc
131
+ hcycle hcyclePhase hcv hlin g htarget (r • G) normal hG₀ good hgeom'
132
+ exact ⟨F,hF⟩
133
+
134
+ /-- Main theorem of paper 094-01. The sole published hypothesis is Whitney
135
+ (1944), Theorem 8, p.274, specialized to a closed smooth surface. -/
136
+ theorem smooth_isometric_immersion_conditional (g : SmoothMetric M)
137
+ (hW : PublishedInputs.WhitneySurfaceInput M) :
138
+ ∃ F : M → Space, IsSmoothIsometricImmersion M g F := by
139
+ obtain ⟨I,hI,hunit,hImm,_⟩ := metricPhaseData_of_whitney g hW
140
+ exact isometric_immersion_of_spherical_immersion g hI hunit hImm
141
+
142
+ end ClosedSurfaceR4.FiniteOrderSmoothing
143
+
144
+ end
145
+
146
+ end OAI
lean/OAI/Geometry/SurfaceImmersion/Geometry/ConjugatedMultilinearBounds.lean ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Geometry.SurfaceImmersion.Geometry.ModulatedJetScaling
2
+
3
+ namespace OAI
4
+
5
+ /-! The conjugated polynomial estimates retain the product of the input
6
+ amplitude bounds. -/
7
+ noncomputable section
8
+ open scoped ContDiff
9
+
10
+ namespace ClosedSurfaceR4.JetPolynomial.ModulatedJets
11
+ open WeightedEstimates MixedExpression
12
+
13
+ /-- Product estimate corresponding to the fixed-power perturbation bound
14
+ in the small-modes argument. No output-order or accuracy dependence is
15
+ hidden in the short-scale exponent. -/
16
+ theorem compact_conjugated_multilinear_bound {U : Set Base} {O K : Set LowJet}
17
+ (hU : IsOpen U) (hO : IsOpen O) (hK : IsCompact K) (hKO : K ⊆ O)
18
+ (e : Expression) (he : e.SmoothCoeffs O) (m : ℕ) (B P : ℝ) (hB : 1 ≤ B) (hP : 0 ≤ P) :
19
+ ∃ D : ℝ, 0 ≤ D ∧ ∀ (G : Base → Space) (φ : Fin 3 → Base → ℝ)
20
+ (H : DirectionFields) (s τ : ℝ) (C : Fin 3 → ℝ),
21
+ 0 < τ → 0 < s → τ ≤ s → s ≤ 1 → (∀ j, 0 < C j) →
22
+ ContDiff ℝ ∞ G → (∀ j, ContDiff ℝ ∞ (φ j)) → (∀ j, ContDiff ℝ ∞ (H j)) →
23
+ Set.MapsTo (lowJet G) U K →
24
+ WeightedBound U s (m + e.order) B (lowJet G) →
25
+ (∀ j, WeightedBound U s (m + e.order) (C j) (H j)) →
26
+ (∀ j v, WeightedBound U s (m + e.order) P
27
+ (fun p => fderiv ℝ (φ j) p (coordinateVector v))) →
28
+ ∀ t ∈ Set.Icc (0 : ℝ) 1, ∀ i : Fin 3,
29
+ WeightedBound U s m
30
+ (D * (C 0 * (if 1 ≤ i then C 1 else 1) * (if 2 ≤ i then C 2 else 1)) /
31
+ τ ^ (e.loss + 6)) (fun p => conjugatedVariation e G φ H τ i (p, t)) := by
32
+ obtain ⟨D, hD, hb⟩ := compact_conjugated_variation_bound hU hO hK hKO e he m B P hB hP
33
+ refine ⟨D, hD, ?_⟩
34
+ intro G φ H s τ C hτ hs hτs hs1 hC hG hφ hH hGK hGb hHb hφb t ht i
35
+ let V := scaleDirections H (fun j => (C j)⁻¹)
36
+ have hV := scaleDirections_smooth hH (fun j => (C j)⁻¹)
37
+ have hunit : ∀ j, WeightedBound U s (m + e.order) 1 (V j) := by
38
+ intro j
39
+ have h := (hHb j).const_smul hU.uniqueDiffOn (hH j).contDiffOn (C j)⁻¹
40
+ change WeightedBound U s (m + e.order) 1 (fun p => (C j)⁻¹ • H j p)
41
+ simpa only [abs_of_pos (inv_pos.mpr (hC j)),
42
+ inv_mul_cancel₀ (ne_of_gt (hC j))] using h
43
+ have hbound := hb G φ V s τ hτ hs hτs hs1 hG hφ hV hGK hGb hunit hφb t ht i
44
+ let W : ℝ := C 0 * (if 1 ≤ i then C 1 else 1) * (if 2 ≤ i then C 2 else 1)
45
+ have hW : 0 < W := by
46
+ have h₀ := hC 0
47
+ have h₁ := hC 1
48
+ have h₂ := hC 2
49
+ dsimp only [W]
50
+ split_ifs <;> positivity
51
+ have heq : (fun p => conjugatedVariation e G φ H τ i (p, t)) =
52
+ (fun p => W • conjugatedVariation e G φ V τ i (p, t)) := by
53
+ funext p
54
+ have h := conjugatedVariation_scale e G hφ hV τ C i (p, t)
55
+ rw [scaleDirections_inverse H C (fun j => ne_of_gt (hC j))] at h
56
+ exact h
57
+ rw [heq]
58
+ have hsmooth : ContDiffOn ℝ ∞ (fun p => conjugatedVariation e G φ V τ i (p, t)) U := by
59
+ have h := evalComplex_parameter_smooth hG (fun p hp => hKO (hGK hp))
60
+ (fun j w a => (amplitudeData_smooth hG hφ hV τ j w a).contDiffOn)
61
+ (e := e.variations i) (e.variations_smoothCoeffs hO he i) t
62
+ convert h using 1
63
+ funext p
64
+ exact conjugatedVariation_eq e G hφ hV τ i (p, t)
65
+ have h := hbound.const_smul hU.uniqueDiffOn hsmooth W
66
+ convert h using 1
67
+ rw [abs_of_pos hW]
68
+ ring
69
+
70
+ end ClosedSurfaceR4.JetPolynomial.ModulatedJets
71
+
72
+ end
73
+
74
+ end OAI
lean/OAI/Geometry/SurfaceImmersion/Geometry/ConjugatedOperatorBounds.lean ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Geometry.SurfaceImmersion.Correction.ConjugatedPolynomialOperator
2
+
3
+ namespace OAI
4
+
5
+ /-! The fixed-loss conjugated estimate for the actual supported linear map. -/
6
+ noncomputable section
7
+ open TopologicalSpace
8
+ open scoped ContDiff NNReal
9
+
10
+ namespace ClosedSurfaceR4.JetPolynomial
11
+ open WeightedEstimates MixedExpression ModulatedJets
12
+
13
+ lemma supportedField_eq_zero_of_seminorm_eq_zero {F : Type*} [NormedAddCommGroup F]
14
+ [NormedSpace ℝ F] {K : Compacts Base} (s : ℝ≥0) (m : ℕ)
15
+ {f : SupportedField (F := F) K} (hf : supportedWeightedSeminorm K s m f = 0) : f = 0 := by
16
+ apply DFunLike.ext
17
+ intro p
18
+ have h := (weightedBound_of_supportedSeminorm s m f).norm_le (Set.mem_univ p)
19
+ rw [hf] at h
20
+ exact norm_eq_zero.mp (le_antisymm h (norm_nonneg _))
21
+
22
+ namespace Expression
23
+
24
+ theorem conjugatedVariationLM_bound {U : Set Base} {O Q : Set LowJet}
25
+ (hU : IsOpen U) (hO : IsOpen O) (hQcompact : IsCompact Q) (hQO : Q ⊆ O)
26
+ (e : Expression) (he : e.SmoothCoeffs O) (K : Compacts Base)
27
+ (hKU : (K : Set Base) ⊆ U) (m : ℕ) (B P : ℝ) (hB : 1 ≤ B) (hP : 0 ≤ P) :
28
+ ∃ D : ℝ, 0 ≤ D ∧ ∀ (G : Base → Space) (φ : Base → ℝ)
29
+ (hG : ContDiff ℝ ∞ G) (hφ : ContDiff ℝ ∞ φ)
30
+ (hGQ : Set.MapsTo (lowJet G) U Q) (s : ℝ≥0) (τ : ℝ),
31
+ 0 < τ → 0 < (s : ℝ) → τ ≤ s → s ≤ 1 →
32
+ WeightedBound U s (m + e.order) B (lowJet G) →
33
+ (∀ v, WeightedBound U s (m + e.order) P
34
+ (fun p => fderiv ℝ φ p (coordinateVector v))) →
35
+ ∀ t ∈ Set.Icc (0 : ℝ) 1, ∀ H : SupportedField (F := Fin 4 → ℂ) K,
36
+ supportedWeightedSeminorm K s m
37
+ (conjugatedVariationLM hO hU he hG (fun _ hp => hQO (hGQ hp)) K hKU hφ τ t H) ≤
38
+ D / τ ^ (e.loss + 6) * supportedWeightedSeminorm K s (m + e.order) H := by
39
+ obtain ⟨D, hD, hd⟩ := compact_conjugated_multilinear_bound hU hO hQcompact hQO e he m B P hB hP
40
+ refine ⟨D, hD, ?_⟩
41
+ intro G φ hG hφ hGQ s τ hτ hs hτs hs1 hGb hφb t ht H
42
+ let C := supportedWeightedSeminorm K s (m + e.order) H
43
+ have hC : 0 ≤ C := apply_nonneg _ _
44
+ by_cases hC0 : C = 0
45
+ · have hH0 : H = 0 := supportedField_eq_zero_of_seminorm_eq_zero s (m + e.order) hC0
46
+ simp only [hH0, map_zero, mul_zero, le_refl]
47
+ · have hCpos : 0 < C := lt_of_le_of_ne hC (Ne.symm hC0)
48
+ have hCs : ∀ j : Fin 3, 0 < (![C, 1, 1] j) := by
49
+ intro j
50
+ fin_cases j <;> simp [hCpos]
51
+ have hHb : ∀ j, WeightedBound U s (m + e.order) (![C, 1, 1] j) (singleDirection H j) := by
52
+ intro j
53
+ fin_cases j
54
+ · exact (weightedBound_of_supportedSeminorm s (m + e.order) H).restrict_open hU
55
+ · exact (weightedBound_zero U s (m + e.order)).mono_const zero_le_one
56
+ · exact (weightedBound_zero U s (m + e.order)).mono_const zero_le_one
57
+ have hΦb : ∀ j v, WeightedBound U s (m + e.order) P
58
+ (fun p => fderiv ℝ (singlePhase φ j) p (coordinateVector v)) := by
59
+ intro j v
60
+ fin_cases j
61
+ · exact hφb v
62
+ · change WeightedBound U s (m + e.order) P
63
+ (fun p => fderiv ℝ (fun _ : Base => (0 : ℝ)) p (coordinateVector v))
64
+ simpa only [fderiv_fun_const, Pi.zero_apply, zero_apply] using
65
+ (weightedBound_zero U s (m + e.order) (F := ℝ)).mono_const hP
66
+ · change WeightedBound U s (m + e.order) P
67
+ (fun p => fderiv ℝ (fun _ : Base => (0 : ℝ)) p (coordinateVector v))
68
+ simpa only [fderiv_fun_const, Pi.zero_apply, zero_apply] using
69
+ (weightedBound_zero U s (m + e.order) (F := ℝ)).mono_const hP
70
+ have hv := hd G (singlePhase φ) (singleDirection H) s τ ![C, 1, 1]
71
+ hτ hs hτs hs1 hCs hG (singlePhase_smooth hφ) (singleDirection_smooth H.contDiff)
72
+ hGQ hGb hHb hΦb t ht 0
73
+ have hl : WeightedBound U s m (D * C / τ ^ (e.loss + 6))
74
+ (conjugatedVariationLM hO hU he hG (fun _ hp => hQO (hGQ hp)) K hKU hφ τ t H) := by
75
+ apply (show WeightedBound U s m (D * C / τ ^ (e.loss + 6))
76
+ (fun p => conjugatedVariation e G (singlePhase φ) (singleDirection H) τ 0 (p, t)) by
77
+ simpa using hv).congr
78
+ intro p _
79
+ exact conjugatedVariationLM_apply hO hU he hG (fun _ hp => hQO (hGQ hp)) K hKU hφ τ t H p
80
+ have hg := hl.extend_support hU
81
+ ((conjugatedVariationLM hO hU he hG (fun _ hp => hQO (hGQ hp)) K hKU hφ τ t H).tsupport_subset.trans hKU)
82
+ (by positivity)
83
+ have hn := supportedSeminorm_le_of_weightedBound hs (show 0 ≤ D * C / τ ^ (e.loss + 6) by positivity)
84
+ (conjugatedVariationLM hO hU he hG (fun _ hp => hQO (hGQ hp)) K hKU hφ τ t H) hg
85
+ convert hn using 1
86
+ dsimp only [C]
87
+ ring
88
+
89
+ end Expression
90
+ end ClosedSurfaceR4.JetPolynomial
91
+
92
+ end
93
+
94
+ end OAI
lean/OAI/Geometry/SurfaceImmersion/Geometry/ConjugatedVariationBounds.lean ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Geometry.SurfaceImmersion.Geometry.ModulatedJetDataBounds
2
+
3
+ namespace OAI
4
+
5
+ /-! Sharp slow-scale estimates for the first three conjugated polynomial
6
+ variations. The power E+6 is independent of correction accuracy and order. -/
7
+ noncomputable section
8
+ open scoped ContDiff BigOperators
9
+
10
+ namespace ClosedSurfaceR4.JetPolynomial.ModulatedJets
11
+ open WeightedEstimates MixedExpression
12
+
13
+ def phaseProduct (φ : Fin 3 → Base → ℝ) (τ : ℝ) (i : Fin 3) (p : Base) : ℂ :=
14
+ phase τ (φ 0) p * (if 1 ≤ i then phase τ (φ 1) p else 1) *
15
+ (if 2 ≤ i then phase τ (φ 2) p else 1)
16
+
17
+ lemma phaseProduct_ne_zero (φ : Fin 3 → Base → ℝ) (τ : ℝ) (i : Fin 3) (p : Base) :
18
+ phaseProduct φ τ i p ≠ 0 := by
19
+ have h (j : Fin 3) : phase τ (φ j) p ≠ 0 := Complex.exp_ne_zero _
20
+ apply mul_ne_zero
21
+ · exact mul_ne_zero (h 0) (by split_ifs; exact h 1; exact one_ne_zero)
22
+ · split_ifs
23
+ · exact h 2
24
+ · exact one_ne_zero
25
+
26
+ def conjugatedVariation (e : Expression) (G : Base → Space)
27
+ (φ : Fin 3 → Base → ℝ) (H : DirectionFields) (τ : ℝ) (i : Fin 3) (z : Base × ℝ) : ℂ :=
28
+ (phaseProduct φ τ i z.1)⁻¹ * (e.variations i).evalComplex G (oscillatoryData G φ H τ) z
29
+
30
+ lemma conjugatedVariation_eq (e : Expression) (G : Base → Space) {φ : Fin 3 → Base → ℝ}
31
+ {H : DirectionFields} (hφ : ∀ j, ContDiff ℝ ∞ (φ j))
32
+ (hH : ∀ j, ContDiff ℝ ∞ (H j)) (τ : ℝ) (i : Fin 3) (z : Base × ℝ) :
33
+ conjugatedVariation e G φ H τ i z =
34
+ (e.variations i).evalComplex G (amplitudeData G φ H τ) z := by
35
+ rw [conjugatedVariation, variation_phase_factor e G hφ hH τ z i]
36
+ change (phaseProduct φ τ i z.1)⁻¹ *
37
+ (phaseProduct φ τ i z.1 * (e.variations i).evalComplex G (amplitudeData G φ H τ) z) = _
38
+ rw [← mul_assoc, inv_mul_cancel₀ (phaseProduct_ne_zero φ τ i z.1), one_mul]
39
+
40
+ /-- Unit amplitude bounds give the sharp exponent for every first, second,
41
+ and third variation after removing all participating phase factors. -/
42
+ theorem compact_conjugated_variation_bound {U : Set Base} {O K : Set LowJet}
43
+ (hU : IsOpen U) (hO : IsOpen O) (hK : IsCompact K) (hKO : K ⊆ O)
44
+ (e : Expression) (he : e.SmoothCoeffs O) (m : ℕ) (B P : ℝ) (hB : 1 ≤ B) (hP : 0 ≤ P) :
45
+ ∃ D : ℝ, 0 ≤ D ∧ ∀ (G : Base → Space) (φ : Fin 3 → Base → ℝ)
46
+ (H : DirectionFields) (s τ : ℝ),
47
+ 0 < τ → 0 < s → τ ≤ s → s ≤ 1 →
48
+ ContDiff ℝ ∞ G → (∀ j, ContDiff ℝ ∞ (φ j)) → (∀ j, ContDiff ℝ ∞ (H j)) →
49
+ Set.MapsTo (lowJet G) U K →
50
+ WeightedBound U s (m + e.order) B (lowJet G) →
51
+ (∀ j, WeightedBound U s (m + e.order) 1 (H j)) →
52
+ (∀ j v, WeightedBound U s (m + e.order) P
53
+ (fun p => fderiv ℝ (φ j) p (coordinateVector v))) →
54
+ ∀ t ∈ Set.Icc (0 : ℝ) 1, ∀ i : Fin 3,
55
+ WeightedBound U s m (D / τ ^ (e.loss + 6))
56
+ (fun p => conjugatedVariation e G φ H τ i (p, t)) := by
57
+ classical
58
+ let A := amplitudeBudget e.order m B P
59
+ have hA : 1 ≤ A := amplitudeBudget_ge_one (zero_le_one.trans hB) hP
60
+ have hex := fun i : Fin 3 => compact_complex_mixed_bound hU hO hK hKO (e.variations i)
61
+ (e.variations_smoothCoeffs hO he i) m A hA
62
+ choose D hD hb using hex
63
+ refine ⟨∑ i, D i, Finset.sum_nonneg (fun i _ => hD i), ?_⟩
64
+ intro G φ H s τ hτ hs hτs hs1 hG hφ hH hGK hGb hHb hφb t ht i
65
+ have hdata := weighted_amplitudeData hU hG hφ hH hτ hs hτs (zero_le_one.trans hB) hP
66
+ m e.order hGb hHb hφb
67
+ have h := hb i G (amplitudeData G φ H τ) s τ hs hτ (hτs.trans hs1) hG hGK
68
+ ((hGb.mono_order (by omega)).mono_const (le_amplitudeBudget hP))
69
+ (fun j w a => (amplitudeData_smooth hG hφ hH τ j w a).contDiffOn)
70
+ (fun j w a hw => hdata j w a (hw.trans (e.variations_order i))) t ht
71
+ have hbound : D i / τ ^ (e.variations i).loss ≤ (∑ j, D j) / τ ^ (e.loss + 6) := by
72
+ calc
73
+ _ ≤ D i / τ ^ (e.loss + 6) := div_le_div_of_nonneg_left (hD i) (pow_pos hτ _)
74
+ (pow_le_pow_of_le_one hτ.le (hτs.trans hs1) (e.variations_loss i))
75
+ _ ≤ _ := div_le_div_of_nonneg_right
76
+ (Finset.single_le_sum (fun j _ => hD j) (Finset.mem_univ i)) (pow_nonneg hτ.le _)
77
+ apply (h.mono_const hbound).congr
78
+ intro p _
79
+ exact conjugatedVariation_eq e G hφ hH τ i (p, t)
80
+
81
+ end ClosedSurfaceR4.JetPolynomial.ModulatedJets
82
+
83
+ end
84
+
85
+ end OAI
lean/OAI/Geometry/SurfaceImmersion/Geometry/ConnectedOpenPieces.lean ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Geometry.SurfaceImmersion.Geometry.SubarcTopology
2
+
3
+ namespace OAI
4
+
5
+ /-! Connected open pieces with frontier in a deleted vertex set either
6
+ coincide or are disjoint. -/
7
+ noncomputable section
8
+ open Set
9
+ namespace ClosedSurfaceR4.FiniteOrderSmoothing
10
+ variable {X : Type*} [TopologicalSpace X]
11
+
12
+ theorem connected_open_pieces_equal_or_disjoint
13
+ {S T V : Set X} (hSo : IsOpen S) (hTo : IsOpen T)
14
+ (hSc : IsPreconnected S) (hTc : IsPreconnected T)
15
+ (hSb : closure S \ S ⊆ V) (hTb : closure T \ T ⊆ V)
16
+ (hSV : Disjoint S V) (hTV : Disjoint T V) : S = T ∨ Disjoint S T := by
17
+ by_cases hd : Disjoint S T
18
+ · exact Or.inr hd
19
+ left
20
+ have hi : (S ∩ T).Nonempty := not_disjoint_iff_nonempty_inter.mp hd
21
+ have hTS : T ⊆ S := hTc.subset_of_closure_inter_subset hSo (by simpa only [inter_comm] using hi)
22
+ (by
23
+ intro x hx
24
+ by_contra hn
25
+ exact disjoint_left.mp hTV hx.2 (hSb ⟨hx.1,hn⟩))
26
+ have hST : S ⊆ T := hSc.subset_of_closure_inter_subset hTo hi
27
+ (by
28
+ intro x hx
29
+ by_contra hn
30
+ exact disjoint_left.mp hSV hx.2 (hTb ⟨hx.1,hn⟩))
31
+ exact Subset.antisymm hST hTS
32
+
33
+ end ClosedSurfaceR4.FiniteOrderSmoothing
34
+
35
+ end
36
+
37
+ end OAI
lean/OAI/Geometry/SurfaceImmersion/Geometry/ConstantNormBoundaryGeometry.lean ADDED
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Geometry.SurfaceImmersion.Atlas.SphericalMetricPhaseData
2
+ import OAI.Geometry.SurfaceImmersion.Geometry.RealMetricDerivatives
3
+ import OAI.Geometry.SurfaceImmersion.Geometry.NormalInterpolation
4
+ import OAI.Geometry.SurfaceImmersion.Primitive.VelocityCoordinateData
5
+
6
+ namespace OAI
7
+
8
+ /-! The initial inward normal has a strictly positive pairing with every
9
+ nonzero directional second form, at every point of a constant-radius sphere. -/
10
+ noncomputable section
11
+ open Set Filter
12
+ open scoped ContDiff Matrix Topology
13
+ namespace ClosedSurfaceR4.RealModes
14
+ open SmallModes NormalFrame VelocityFrame
15
+
16
+ lemma constant_norm_radial_first {F : RField 4} {R : ℝ} {x : Base}
17
+ (hF : DifferentiableAt ℝ F x) (hR : ∀ y, F y ⬝ᵥ F y = R) (v : Base) :
18
+ F x ⬝ᵥ coordDeriv v F x = 0 := by
19
+ have he : (fun y => F y ⬝ᵥ F y) = fun _ => R := funext hR
20
+ have hd : coordDeriv v (fun y => F y ⬝ᵥ F y) x = 0 := by
21
+ rw [he]
22
+ simp [coordDeriv]
23
+ rw [real_partial_dot hF hF,dotProduct_comm (coordDeriv v F x) (F x)] at hd
24
+ linarith
25
+
26
+ lemma constant_norm_radial_second {F : RField 4} {U : Set Base} {R : ℝ}
27
+ (hU : IsOpen U) (hF : ContDiffOn ℝ ∞ F U) (hR : ∀ y, F y ⬝ᵥ F y = R)
28
+ {x : Base} (hx : x ∈ U) (v w : Base) :
29
+ F x ⬝ᵥ coordDeriv v (coordDeriv w F) x =
30
+ -(coordDeriv v F x ⬝ᵥ coordDeriv w F x) := by
31
+ have hFx := (hF x hx).contDiffAt (hU.mem_nhds hx)
32
+ have he : (fun y => F y ⬝ᵥ coordDeriv w F y) =ᶠ[𝓝 x] (fun _ => (0 : ℝ)) := by
33
+ filter_upwards [hU.mem_nhds hx] with y hy
34
+ exact constant_norm_radial_first
35
+ (((hF y hy).contDiffAt (hU.mem_nhds hy)).differentiableAt (by simp)) hR w
36
+ have hd : coordDeriv v (fun y => F y ⬝ᵥ coordDeriv w F y) x = 0 := by
37
+ change fderiv ℝ _ x v = 0
38
+ rw [he.fderiv_eq]
39
+ simp
40
+ rw [real_partial_dot (hFx.differentiableAt (by simp))
41
+ ((contDiffAt_coordDeriv hFx w).differentiableAt (by simp))] at hd
42
+ linarith
43
+
44
+ lemma constant_norm_secondForm_inward {F : RField 4} {U : Set Base} {R : ℝ}
45
+ (hU : IsOpen U) (hF : ContDiffOn ℝ ∞ F U) (hR : ∀ y, F y ⬝ᵥ F y = R)
46
+ {x : Base} (hx : x ∈ U) (v w : Base) :
47
+ realSecondForm F v w x ⬝ᵥ (-F x) = coordDeriv v F x ⬝ᵥ coordDeriv w F x := by
48
+ have hFx := ((hF x hx).contDiffAt (hU.mem_nhds hx)).differentiableAt (by simp)
49
+ have hX : coordDeriv dx F x ⬝ᵥ (-F x) = 0 := by
50
+ rw [dotProduct_neg,dotProduct_comm,constant_norm_radial_first hFx hR,neg_zero]
51
+ have hY : coordDeriv dy F x ⬝ᵥ (-F x) = 0 := by
52
+ rw [dotProduct_neg,dotProduct_comm,constant_norm_radial_first hFx hR,neg_zero]
53
+ unfold realSecondForm realNormalPart
54
+ simp only [sub_dotProduct,smul_dotProduct,smul_eq_mul,hX,hY,mul_zero,sub_zero]
55
+ rw [dotProduct_neg,dotProduct_comm,constant_norm_radial_second hU hF hR hx,neg_neg]
56
+
57
+ lemma positive_pairing_excludes_antipode {X n : Vec} (hp : 0 < X ⬝ᵥ n) :
58
+ X ≠ 0 ∧ normalize X ≠ -n := by
59
+ have hn : X ≠ 0 := by
60
+ intro hz
61
+ rw [hz,zero_dotProduct] at hp
62
+ exact lt_irrefl _ hp
63
+ refine ⟨hn,?_⟩
64
+ intro he
65
+ have hs := dot_normalize_self hn
66
+ rw [he,dotProduct_neg] at hs
67
+ linarith [Real.sqrt_nonneg (X ⬝ᵥ X)]
68
+
69
+ theorem constant_norm_boundary_geometry {F : RField 4} {U : Set Base} {R r : ℝ}
70
+ (hU : IsOpen U) (hF : ContDiffOn ℝ ∞ F U) (hR : ∀ y, F y ⬝ᵥ F y = R)
71
+ (hr : 0 < r) {x : Base} (hx : x ∈ U)
72
+ (hI : Function.Injective (fderiv ℝ F x)) {v : Base} (hv : v ≠ 0) :
73
+ 0 < realSecondForm F v v x ⬝ᵥ (r⁻¹ • (-F x)) ∧
74
+ realSecondForm F v v x ≠ 0 ∧
75
+ normalize (realSecondForm F v v x) ≠ -(r⁻¹ • (-F x)) := by
76
+ have hd : coordDeriv v F x ≠ 0 := by
77
+ intro hz
78
+ exact hv (hI (by simpa only [coordDeriv,map_zero] using hz))
79
+ have hp : 0 < realSecondForm F v v x ⬝ᵥ (r⁻¹ • (-F x)) := by
80
+ rw [dotProduct_smul,constant_norm_secondForm_inward hU hF hR hx]
81
+ exact mul_pos (inv_pos.mpr hr) (dot_self_pos hd)
82
+ exact ⟨hp,positive_pairing_excludes_antipode hp⟩
83
+
84
+ end ClosedSurfaceR4.RealModes
85
+
86
+ end
87
+
88
+ end OAI
lean/OAI/Geometry/SurfaceImmersion/Geometry/ConvexDerivativeInjectivity.lean ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Geometry.SurfaceImmersion.Geometry.CompactTranslationImmersion
2
+ import Mathlib.Analysis.Calculus.MeanValue
3
+
4
+ namespace OAI
5
+
6
+ /-! A fixed strict derivative bound excludes distinct coincidences on a
7
+ convex coordinate neighborhood. -/
8
+ noncomputable section
9
+ open Set Metric
10
+ open scoped ContDiff Topology
11
+ namespace ClosedSurfaceR4.FiniteOrderSmoothing
12
+ open JetPolynomial (Base)
13
+
14
+ theorem convex_injective_of_derivative_close
15
+ {f : Base → ProjectionTarget 3} {L : Base →L[ℝ] ProjectionTarget 3}
16
+ {K : NNReal} (hK : 0 < K) (hL : AntilipschitzWith K L)
17
+ {S : Set Base} (hS : Convex ℝ S)
18
+ (hf : ∀ x ∈ S, DifferentiableAt ℝ f x)
19
+ (hclose : ∀ x ∈ S, ‖fderiv ℝ f x-L‖ ≤ 1/(2*(K:ℝ))) :
20
+ Set.InjOn f S := by
21
+ intro x hx y hy he
22
+ have hb := hS.norm_image_sub_le_of_norm_fderiv_le' hf hclose hx hy
23
+ have hl := ZeroHomClass.bound_of_antilipschitz L hL (y-x)
24
+ rw [he,sub_self,zero_sub,norm_neg] at hb
25
+ have hKr : 0 < (K:ℝ) := hK
26
+ have hnum : (K:ℝ)*(1/(2*(K:ℝ))) = 1/2 := by field_simp [ne_of_gt hKr]
27
+ have hnorm : ‖y-x‖ ≤ (1/2)*‖y-x‖ := by
28
+ calc
29
+ ‖y-x‖ ≤ (K:ℝ)*‖L (y-x)‖ := hl
30
+ _ ≤ (K:ℝ)*((1/(2*(K:ℝ)))*‖y-x‖) := mul_le_mul_of_nonneg_left hb hKr.le
31
+ _ = (1/2)*‖y-x‖ := by rw [← mul_assoc,hnum]
32
+ have hz : y-x = 0 := norm_eq_zero.mp (by linarith [norm_nonneg (y-x)])
33
+ exact (sub_eq_zero.mp hz).symm
34
+
35
+ theorem exists_injective_coordinate_ball {f : Base → ProjectionTarget 3}
36
+ (hf : ContDiff ℝ ∞ f) {x : Base} (hi : Function.Injective (fderiv ℝ f x)) :
37
+ ∃ K : NNReal, 0 < K ∧ AntilipschitzWith K (fderiv ℝ f x) ∧
38
+ ∃ r : ℝ, 0 < r ∧ ∀ y ∈ closedBall x r,
39
+ ‖fderiv ℝ f y-fderiv ℝ f x‖ < 1/(4*(K:ℝ)) := by
40
+ obtain ⟨K,hK,hL⟩ := (fderiv ℝ f x).toLinearMap.exists_antilipschitzWith
41
+ (LinearMap.ker_eq_bot.mpr hi)
42
+ have hp : 0 < 1/(4*(K:ℝ)) := by positivity
43
+ have hn : ∀ᶠ y in 𝓝 x, ‖fderiv ℝ f y-fderiv ℝ f x‖ < 1/(4*(K:ℝ)) :=
44
+ by
45
+ simpa only [dist_eq_norm] using
46
+ (Metric.tendsto_nhds.mp (hf.continuous_fderiv (by simp)).continuousAt) _ hp
47
+ obtain ⟨r,hr,hrn⟩ := Metric.mem_nhds_iff.mp hn
48
+ refine ⟨K,hK,hL,r/2,half_pos hr,?_⟩
49
+ intro y hy
50
+ apply hrn
51
+ exact (closedBall_subset_ball (by linarith : r/2 < r)) hy
52
+
53
+ end ClosedSurfaceR4.FiniteOrderSmoothing
54
+
55
+ end
56
+
57
+ end OAI
lean/OAI/Geometry/SurfaceImmersion/Geometry/ConvolutionDerivativeBounds.lean ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Geometry.SurfaceImmersion.Correction.SmoothingDerivativeBounds
2
+
3
+ namespace OAI
4
+
5
+ /-! Differentiating the compact kernel gives derivative gains without using
6
+ uncontrolled derivatives of the input. -/
7
+ noncomputable section
8
+ open scoped ContDiff Convolution
9
+
10
+ universe u v w
11
+ namespace ClosedSurfaceR4.FiniteOrderSmoothing
12
+ open MeasureTheory ContinuousLinearMap
13
+ open JetPolynomial (Base)
14
+
15
+ variable {E : Type u} {F : Type v} {H : Type w} [NormedAddCommGroup E] [NormedSpace ℝ E]
16
+ [NormedAddCommGroup F] [NormedSpace ℝ F] [NormedAddCommGroup H] [NormedSpace ℝ H]
17
+
18
+ /-- All derivatives may be placed on the compactly supported kernel. -/
19
+ theorem convolution_iterated_norm_le (L : E →L[ℝ] F →L[ℝ] H) (n : ℕ)
20
+ {f : Base → E} (hf : ContDiff ℝ ∞ f) (hfc : HasCompactSupport f)
21
+ {g : Base → F} (hg : Continuous g) {C : ℝ} (hb : ∀ x, ‖g x‖ ≤ C) (x : Base) :
22
+ ‖iteratedFDeriv ℝ n (f ⋆[L, volume] g) x‖ ≤
23
+ ‖L‖ * (∫ y, ‖iteratedFDeriv ℝ n f y‖) * C := by
24
+ have hC : 0 ≤ C := (norm_nonneg (g 0)).trans (hb 0)
25
+ induction n generalizing E H with
26
+ | zero =>
27
+ simp only [norm_iteratedFDeriv_zero]
28
+ have hi := (hf.continuous.integrable_of_hasCompactSupport (μ := volume) hfc).norm
29
+ change ‖∫ y, L (f y) (g (x - y))‖ ≤ _
30
+ calc
31
+ _ ≤ ∫ y, ‖L‖ * ‖f y‖ * C := by
32
+ apply norm_integral_le_of_norm_le ((hi.const_mul ‖L‖).mul_const C)
33
+ exact Filter.Eventually.of_forall fun y =>
34
+ (L.le_opNorm₂ _ _).trans (mul_le_mul_of_nonneg_left (hb (x - y))
35
+ (mul_nonneg (norm_nonneg L) (norm_nonneg (f y))))
36
+ _ = _ := by rw [integral_mul_const, integral_const_mul]
37
+ | succ n ih =>
38
+ rw [← norm_iteratedFDeriv_fderiv]
39
+ have heq : fderiv ℝ (f ⋆[L, volume] g) =
40
+ (fderiv ℝ f ⋆[L.precompL Base, volume] g) := by
41
+ funext y
42
+ exact (hfc.hasFDerivAt_convolution_left L (hf.of_le (by simp)) hg.locallyIntegrable y).fderiv
43
+ rw [heq]
44
+ have h := ih (L.precompL Base) (hf.fderiv_right (m := ∞) (by simp))
45
+ (hfc.fderiv ℝ)
46
+ simp_rw [norm_iteratedFDeriv_fderiv] at h
47
+ apply h.trans
48
+ gcongr
49
+ exact L.norm_precompL_le Base
50
+
51
+ end ClosedSurfaceR4.FiniteOrderSmoothing
52
+
53
+ end
54
+
55
+ end OAI
lean/OAI/Geometry/SurfaceImmersion/Geometry/CorrectedNormalSeed.lean ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Geometry.SurfaceImmersion.Correction.UniformFreeModeConstants
2
+ import OAI.Geometry.SurfaceImmersion.Geometry.NormalizedPerturbedDifference
3
+
4
+ namespace OAI
5
+
6
+ /-! Explicit size and difference budgets for the actual corrected normal seed. -/
7
+ noncomputable section
8
+ open TopologicalSpace
9
+ open scoped ContDiff NNReal
10
+ namespace ClosedSurfaceR4.RealModes
11
+ open SmallModes WeightedEstimates
12
+ open JetPolynomial (SupportedField supportedWeightedSeminorm)
13
+
14
+ variable {F : RField 4} {U : Set Base}
15
+
16
+ def correctedNormalSeed (δ τ : ℝ) (hF : ContDiff ℝ ∞ F) (h : RealModeDomain F U)
17
+ (K : Compacts Base) (hKU : (K : Set Base) ⊆ U)
18
+ (R : SupportedField (F := Ambient 4) K →ₗ[ℝ] SupportedField (F := Fin 3 → ℂ) K)
19
+ (q : ℕ) (b : SupportedField (F := ℝ) K) : SupportedField (F := Ambient 4) K :=
20
+ perturbedFreeLM τ (contDiff_complexify hF) (h.complexDomain hF) K hKU R q
21
+ (supportedFreeSeed δ τ hF h K hKU b)
22
+
23
+ def correctedSeedBudget (L : ℕ) (B D : ℕ → ℝ) (q m : ℕ) (N : ℝ) : ℝ :=
24
+ (1 + freeModeBudget 4 L B D q m) *
25
+ (Real.sqrt 2 * 2 ^ (m + (q + 1) * (L + 1)) * N)
26
+
27
+ lemma correctedSeedBudget_nonneg (L : ℕ) (B D : ℕ → ℝ) (hB : ∀ m, 0 ≤ B m)
28
+ (q m : ℕ) {N : ℝ} (hN : 0 ≤ N) : 0 ≤ correctedSeedBudget L B D q m N := by
29
+ have h := freeModeBudget_nonneg 4 L B D hB q m
30
+ dsimp only [correctedSeedBudget]
31
+ positivity
32
+
33
+ lemma correctedNormalSeed_sub (δ τ : ℝ) (hF : ContDiff ℝ ∞ F) (h : RealModeDomain F U)
34
+ (K : Compacts Base) (hKU : (K : Set Base) ⊆ U)
35
+ (R : SupportedField (F := Ambient 4) K →ₗ[ℝ] SupportedField (F := Fin 3 → ℂ) K)
36
+ (q : ℕ) (b c : SupportedField (F := ℝ) K) :
37
+ correctedNormalSeed δ τ hF h K hKU R q (b - c) =
38
+ correctedNormalSeed δ τ hF h K hKU R q b - correctedNormalSeed δ τ hF h K hKU R q c := by
39
+ simp only [correctedNormalSeed, supportedFreeSeed_sub, map_sub]
40
+
41
+ theorem correctedNormalSeed_bound (δ τ : ℝ) (hF : ContDiff ℝ ∞ F) (h : RealModeDomain F U)
42
+ (K : Compacts Base) (hKU : (K : Set Base) ⊆ U) {s : ℝ≥0} {ε : ℝ} {p L : ℕ}
43
+ (hδ : 0 ≤ δ) (hτ : 0 < τ) (hs : 0 < (s : ℝ)) (hτs : τ ≤ s) (hs1 : s ≤ 1) (hε : 0 ≤ ε)
44
+ (hsmall : τ / s + ε / τ ^ p ≤ 1)
45
+ (B D : ℕ → ℝ) (hB : ∀ m, 0 ≤ B m) (hD : ∀ m, 0 ≤ D m)
46
+ (hc : ∀ m, ReconstructionCoefficientBound (fun p => complexify (F p)) U s (m + 1) (B m))
47
+ (R : SupportedField (F := Ambient 4) K →ₗ[ℝ] SupportedField (F := Fin 3 → ℂ) K)
48
+ (hR : ∀ m Z, supportedWeightedSeminorm K s m (R Z) ≤
49
+ ε / τ ^ p * D m * supportedWeightedSeminorm K s (m + L) Z)
50
+ (q m : ℕ) (A N : ℝ) (hA : 0 ≤ A) (hN : 0 ≤ N)
51
+ (hbN : WeightedBound U s (m + (q + 1) * (L + 1)) N (freeNormal F))
52
+ (b : SupportedField (F := ℝ) K)
53
+ (hb : supportedWeightedSeminorm K s (m + (q + 1) * (L + 1)) b ≤ A) :
54
+ supportedWeightedSeminorm K s m (correctedNormalSeed δ τ hF h K hKU R q b) ≤
55
+ correctedSeedBudget L B D q m N * A * (δ * τ) := by
56
+ have hv := supportedFreeSeed_bound hF h K hKU b hδ hτ.le hs hA hN
57
+ (m + (q + 1) * (L + 1)) hb hbN
58
+ have ht := freeModeBudget_size (contDiff_complexify hF) (h.complexDomain hF)
59
+ K hKU hτ hs hτs hs1 hε hsmall B D hB hD hc R hR q m
60
+ (supportedFreeSeed δ τ hF h K hKU b) (supportedFreeSeed_isFree δ τ hF h K hKU b)
61
+ have hbudget := freeModeBudget_nonneg 4 L B D hB q m
62
+ calc
63
+ _ ≤ (1 + freeModeBudget 4 L B D q m) *
64
+ supportedWeightedSeminorm K s (m + (q + 1) * (L + 1))
65
+ (supportedFreeSeed δ τ hF h K hKU b) := ht
66
+ _ ≤ (1 + freeModeBudget 4 L B D q m) *
67
+ ((Real.sqrt 2 * 2 ^ (m + (q + 1) * (L + 1)) * A * N) * (δ * τ)) :=
68
+ mul_le_mul_of_nonneg_left hv (by positivity)
69
+ _ = _ := by dsimp only [correctedSeedBudget]; ring
70
+
71
+ end ClosedSurfaceR4.RealModes
72
+
73
+ end
74
+
75
+ end OAI
lean/OAI/Geometry/SurfaceImmersion/Geometry/CovarianceParameter.lean ADDED
@@ -0,0 +1,229 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Geometry.SurfaceImmersion.Correction.CovarianceCorrector
2
+
3
+ namespace OAI
4
+
5
+ /-!
6
+ Smooth parameter dependence of the actual finite covariance solve. Averaging
7
+ is a bounded linear map on continuous periodic functions; the covariance is
8
+ a quadratic map on that Banach space. Thus no regularity assumption on the
9
+ inverse matrix is needed.
10
+ -/
11
+
12
+ noncomputable section
13
+
14
+ open MeasureTheory
15
+ open scoped ContDiff
16
+
17
+ namespace ClosedSurfaceR4.CovarianceCorrector
18
+
19
+ section PeriodicMaps
20
+
21
+ variable {E F G : Type*}
22
+ [NormedAddCommGroup E] [NormedSpace ℝ E]
23
+ [NormedAddCommGroup F] [NormedSpace ℝ F]
24
+ [NormedAddCommGroup G] [NormedSpace ℝ G]
25
+
26
+ /-- Apply a continuous bilinear map pointwise to continuous periodic maps. -/
27
+ def periodicBilinear (B : E →L[ℝ] F →L[ℝ] G) :
28
+ C(Period, E) →L[ℝ] C(Period, F) →L[ℝ] C(Period, G) := by
29
+ let b : C(Period, E) → C(Period, F) → C(Period, G) := fun f g =>
30
+ ⟨fun t => B (f t) (g t), (B.continuous.comp f.continuous).clm_apply g.continuous⟩
31
+ let L : C(Period, E) →ₗ[ℝ] C(Period, F) →ₗ[ℝ] C(Period, G) :=
32
+ LinearMap.mk₂ ℝ b
33
+ (by intros; ext; simp [b, map_add])
34
+ (by intros; ext; simp [b, map_smul])
35
+ (by intros; ext; simp [b, map_add])
36
+ (by intros; ext; simp [b, map_smul])
37
+ exact L.mkContinuous₂ ‖B‖ (by
38
+ intro f g
39
+ apply (ContinuousMap.norm_le _ (by positivity)).mpr
40
+ intro t
41
+ exact (B.le_opNorm₂ (f t) (g t)).trans (by
42
+ gcongr
43
+ · exact f.norm_coe_le_norm t
44
+ · exact g.norm_coe_le_norm t))
45
+
46
+ @[simp] theorem periodicBilinear_apply (B : E →L[ℝ] F →L[ℝ] G)
47
+ (f : C(Period, E)) (g : C(Period, F)) (t : Period) :
48
+ periodicBilinear B f g t = B (f t) (g t) := rfl
49
+
50
+ variable [CompleteSpace E]
51
+
52
+ /-- The normalized Haar average, bundled with its norm bound. -/
53
+ def averageCLM : C(Period, E) →L[ℝ] E :=
54
+ ({ toFun := fun f => ∫ t, f t ∂AddCircle.haarAddCircle
55
+ map_add' := fun f g => integral_add
56
+ (integrable_of_continuous f.continuous) (integrable_of_continuous g.continuous)
57
+ map_smul' := fun c f => integral_smul c f } : C(Period, E) →ₗ[ℝ] E).mkContinuous
58
+ 1 (by
59
+ intro f
60
+ have h := norm_integral_le_of_norm_le_const
61
+ (μ := AddCircle.haarAddCircle) (f := fun t => f t)
62
+ (Filter.Eventually.of_forall f.norm_coe_le_norm)
63
+ simpa using h)
64
+
65
+ omit [CompleteSpace E] in
66
+ @[simp] theorem averageCLM_apply (f : C(Period, E)) :
67
+ averageCLM f = ∫ t, f t ∂AddCircle.haarAddCircle := rfl
68
+
69
+ def centeredPeriodic (V : C(Period, E)) : C(Period, E) :=
70
+ V - ContinuousMap.const Period (averageCLM V)
71
+
72
+ omit [CompleteSpace E] in
73
+ theorem contDiff_centeredPeriodic : ContDiff ℝ ∞ (centeredPeriodic : C(Period, E) → _) := by
74
+ let L : E →L[ℝ] C(Period, E) := ContinuousLinearMap.const ℝ Period
75
+ exact contDiff_id.sub (L.contDiff.comp (averageCLM (E := E)).contDiff)
76
+
77
+ end PeriodicMaps
78
+
79
+ variable {E P : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E]
80
+ [CompleteSpace E] [FiniteDimensional ℝ E]
81
+ [NormedAddCommGroup P] [NormedSpace ℝ P]
82
+
83
+ /-- The covariance as a quadratic expression in a continuous periodic map. -/
84
+ def covarianceCLM (V : C(Period, E)) : E →L[ℝ] E :=
85
+ averageCLM (periodicBilinear (InnerProductSpace.rankOne ℝ)
86
+ (centeredPeriodic V) (centeredPeriodic V))
87
+
88
+ omit [CompleteSpace E] [FiniteDimensional ℝ E] in
89
+ theorem covarianceCLM_apply (V : C(Period, E)) (m : E) :
90
+ covarianceCLM V m = covariance V (average V) m := by
91
+ unfold covarianceCLM
92
+ rw [averageCLM_apply]
93
+ change (∫ t, periodicBilinear (InnerProductSpace.rankOne ℝ)
94
+ (centeredPeriodic V) (centeredPeriodic V) t ∂AddCircle.haarAddCircle) m = _
95
+ rw [ContinuousLinearMap.integral_apply (integrable_of_continuous
96
+ (periodicBilinear (InnerProductSpace.rankOne ℝ)
97
+ (centeredPeriodic V) (centeredPeriodic V)).continuous)]
98
+ rfl
99
+
100
+ omit [CompleteSpace E] in
101
+ theorem contDiff_covarianceCLM : ContDiff ℝ ∞ (covarianceCLM : C(Period, E) → _) := by
102
+ rw [contDiff_clm_apply_iff]
103
+ intro m
104
+ let L : C(Period, E) →L[ℝ] C(Period, ℝ) :=
105
+ (innerSL ℝ m).compLeftContinuous ℝ Period
106
+ let B : C(Period, ℝ) →L[ℝ] C(Period, E) →L[ℝ] C(Period, E) :=
107
+ periodicBilinear (ContinuousLinearMap.lsmul ℝ ℝ)
108
+ have hB := B.isBoundedBilinearMap.contDiff.comp
109
+ ((L.contDiff.comp contDiff_centeredPeriodic).prodMk contDiff_centeredPeriodic)
110
+ have hh := averageCLM.contDiff.comp hB
111
+ convert hh using 1
112
+ ext V
113
+ rw [covarianceCLM_apply]
114
+ change (∫ t, inner ℝ (V t - average V) m • (V t - average V)
115
+ ∂AddCircle.haarAddCircle) =
116
+ ∫ t, inner ℝ m (V t - average V) • (V t - average V) ∂AddCircle.haarAddCircle
117
+ congr 1
118
+ funext t
119
+ rw [real_inner_comm]
120
+
121
+ def meanCLM (V : C(Period, E)) (q : ℝ) : E →L[ℝ] E :=
122
+ ContinuousLinearMap.id ℝ E - q⁻¹ • covarianceCLM V
123
+
124
+ omit [CompleteSpace E] [FiniteDimensional ℝ E] in
125
+ theorem meanCLM_apply (V : C(Period, E)) (q : ℝ) (m : E) :
126
+ meanCLM V q m = m - q⁻¹ ��� covariance V (average V) m := by
127
+ simp only [meanCLM, sub_apply, ContinuousLinearMap.id_apply,
128
+ smul_apply, covarianceCLM_apply]
129
+
130
+ theorem meanCLM_isInvertible {V : C(Period, E)} {q : ℝ} (hq : 0 < q)
131
+ (hcircle : ∀ t, inner ℝ (V t) (V t) = q) : (meanCLM V q).IsInvertible := by
132
+ have hinj : Function.Injective (meanCLM V q) := by
133
+ intro m n he
134
+ apply sub_eq_zero.mp
135
+ apply meanOperator_kernel_trivial V.continuous rfl hq hcircle
136
+ change (m - n) - q⁻¹ • covariance V (average V) (m - n) = 0
137
+ rw [← meanCLM_apply, map_sub, he, sub_self]
138
+ have hsurj : Function.Surjective (meanCLM V q) :=
139
+ LinearMap.surjective_of_injective (f := (meanCLM V q).toLinearMap) hinj
140
+ refine ⟨(LinearEquiv.ofBijective (meanCLM V q).toLinearMap ⟨hinj, hsurj⟩).toContinuousLinearEquiv, ?_⟩
141
+ rfl
142
+
143
+ def weightedAverage (V : C(Period, E)) (r : C(Period, ℝ)) : E :=
144
+ averageCLM (periodicBilinear (ContinuousLinearMap.lsmul ℝ ℝ) r V)
145
+
146
+ omit [CompleteSpace E] [FiniteDimensional ℝ E] in
147
+ @[simp] theorem weightedAverage_apply (V : C(Period, E)) (r : C(Period, ℝ)) :
148
+ weightedAverage V r = average (fun t => r t • V t) := rfl
149
+
150
+ def covarianceSolution (V : C(Period, E)) (r : C(Period, ℝ)) (q : ℝ) : E :=
151
+ (meanCLM V q).inverse (weightedAverage V r)
152
+
153
+ theorem covarianceSolution_equation {V : C(Period, E)} (r : C(Period, ℝ))
154
+ {q : ℝ} (hq : 0 < q) (hcircle : ∀ t, inner ℝ (V t) (V t) = q) :
155
+ covarianceSolution V r q - q⁻¹ • covariance V (average V) (covarianceSolution V r q) =
156
+ average (fun t => r t • V t) := by
157
+ rw [← meanCLM_apply]
158
+ exact (meanCLM_isInvertible hq hcircle).self_apply_inverse _
159
+
160
+ theorem contDiff_covarianceSolution {V : P → C(Period, E)} {r : P → C(Period, ℝ)}
161
+ {q : P → ℝ} (hV : ContDiff ℝ ∞ V) (hr : ContDiff ℝ ∞ r)
162
+ (hq : ContDiff ℝ ∞ q) (hqpos : ∀ x, 0 < q x)
163
+ (hcircle : ∀ x t, inner ℝ (V x t) (V x t) = q x) :
164
+ ContDiff ℝ ∞ (fun x => covarianceSolution (V x) (r x) (q x)) := by
165
+ have hM : ContDiff ℝ ∞ (fun x => meanCLM (V x) (q x)) :=
166
+ contDiff_const.sub ((hq.inv (fun x => (hqpos x).ne')).smul
167
+ (contDiff_covarianceCLM.comp hV))
168
+ have hMinv : ContDiff ℝ ∞ (fun x => (meanCLM (V x) (q x)).inverse) := by
169
+ rw [contDiff_iff_contDiffAt]
170
+ intro x
171
+ exact (meanCLM_isInvertible (hqpos x) (hcircle x)).contDiffAt_map_inverse.comp x hM.contDiffAt
172
+ have hsource : ContDiff ℝ ∞ (fun x => weightedAverage (V x) (r x)) :=
173
+ by
174
+ let B : C(Period, ℝ) →L[ℝ] C(Period, E) →L[ℝ] C(Period, E) :=
175
+ periodicBilinear (ContinuousLinearMap.lsmul ℝ ℝ)
176
+ exact averageCLM.contDiff.comp (B.isBoundedBilinearMap.contDiff.comp (hr.prodMk hV))
177
+ exact hMinv.clm_apply hsource
178
+
179
+ def parameterCorrector (V : P → C(Period, E)) (r : P → C(Period, ℝ))
180
+ (q : P → ℝ) (x : P) : Period → E :=
181
+ correctedVector (V x) (average (V x)) (q x) (r x)
182
+ (covarianceSolution (V x) (r x) (q x))
183
+
184
+ omit [NormedAddCommGroup P] [NormedSpace ℝ P] in
185
+ theorem parameterCorrector_average {V : P → C(Period, E)} {r : P → C(Period, ℝ)}
186
+ {q : P → ℝ} (hqpos : ∀ x, 0 < q x)
187
+ (hcircle : ∀ x t, inner ℝ (V x t) (V x t) = q x) (x : P) :
188
+ average (parameterCorrector V r q x) = 0 :=
189
+ average_correctedVector (V x).continuous rfl (r x).continuous (q x)
190
+ (covarianceSolution (V x) (r x) (q x))
191
+ (covarianceSolution_equation (r x) (hqpos x) (hcircle x))
192
+
193
+ omit [CompleteSpace E] [FiniteDimensional ℝ E] [NormedAddCommGroup P] [NormedSpace ℝ P] in
194
+ theorem parameterCorrector_projection {V : P → C(Period, E)} {r : P → C(Period, ℝ)}
195
+ {q : P → ℝ} (hr0 : ∀ x, average (r x) = 0) (hqpos : ∀ x, 0 < q x)
196
+ (hcircle : ∀ x t, inner ℝ (V x t) (V x t) = q x) (x : P) :
197
+ fluctuation (fun t => inner ℝ (V x t) (parameterCorrector V r q x t)) = r x :=
198
+ corrected_projection (V x) (average (V x)) (r x).continuous (hr0 x)
199
+ (hqpos x).ne' (hcircle x) _
200
+
201
+ /-- Smoothness in both the finite-dimensional parameters and the angular
202
+ variable. The Banach-space hypotheses ensure uniform parameter smoothness;
203
+ the real-lift hypotheses provide angular smoothness and mixed derivatives. -/
204
+ theorem contDiff_parameterCorrector {V : P → C(Period, E)} {r : P → C(Period, ℝ)}
205
+ {q : P → ℝ} (hV : ContDiff ℝ ∞ V) (hr : ContDiff ℝ ∞ r)
206
+ (hq : ContDiff ℝ ∞ q) (hqpos : ∀ x, 0 < q x)
207
+ (hcircle : ∀ x t, inner ℝ (V x t) (V x t) = q x)
208
+ (hVlift : ContDiff ℝ ∞ (fun p : P × ℝ => V p.1 (p.2 : Period)))
209
+ (hrlift : ContDiff ℝ ∞ (fun p : P × ℝ => r p.1 (p.2 : Period))) :
210
+ ContDiff ℝ ∞ (fun p : P × ℝ => parameterCorrector V r q p.1 (p.2 : Period)) := by
211
+ have hm : ContDiff ℝ ∞ (fun p : P × ℝ =>
212
+ covarianceSolution (V p.1) (r p.1) (q p.1)) :=
213
+ (contDiff_covarianceSolution hV hr hq hqpos hcircle).comp contDiff_fst
214
+ have hv : ContDiff ℝ ∞ (fun p : P × ℝ => average (V p.1)) :=
215
+ (averageCLM.contDiff.comp hV).comp contDiff_fst
216
+ have hi : ContDiff ℝ ∞ (fun p : P × ℝ => (q p.1)⁻¹) :=
217
+ (hq.comp contDiff_fst).inv (fun p => (hqpos p.1).ne')
218
+ have hs : ContDiff ℝ ∞ (fun p : P × ℝ =>
219
+ correctedScalar (V p.1) (average (V p.1)) (q p.1) (r p.1)
220
+ (covarianceSolution (V p.1) (r p.1) (q p.1)) (p.2 : Period)) := by
221
+ simpa only [correctedScalar, div_eq_mul_inv] using
222
+ hrlift.add (((hVlift.sub hv).inner ℝ hm).mul hi)
223
+ exact hi.smul ((hs.smul hVlift).sub hm)
224
+
225
+ end ClosedSurfaceR4.CovarianceCorrector
226
+
227
+ end
228
+
229
+ end OAI
lean/OAI/Geometry/SurfaceImmersion/Geometry/CovarianceRealOperator.lean ADDED
@@ -0,0 +1,116 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Geometry.SurfaceImmersion.Geometry.LocalCovarianceParameter
2
+
3
+ namespace OAI
4
+
5
+ /-! The actual covariance correction acting on real-parameter forcing.
6
+ This form exposes linearity and does not require separate periodicity proofs
7
+ for the individual coefficients of a jet polynomial. -/
8
+ noncomputable section
9
+ open MeasureTheory
10
+ open scoped ContDiff
11
+
12
+ namespace ClosedSurfaceR4.CovarianceCorrector
13
+
14
+ variable {E P : Type} [NormedAddCommGroup E] [InnerProductSpace ℝ E]
15
+ [CompleteSpace E] [FiniteDimensional ℝ E]
16
+ [NormedAddCommGroup P] [NormedSpace ℝ P] [FiniteDimensional ℝ P]
17
+
18
+ def realMoment (V : C(Period, E)) (r : ℝ → ℝ) : E :=
19
+ ∫ t in 0..1, r t • V (t : Period)
20
+
21
+ def realMeanSolution (V : C(Period, E)) (q : ℝ) (r : ℝ → ℝ) : E :=
22
+ (meanCLM V q).inverse (realMoment V r)
23
+
24
+ def realCorrector (V : C(Period, E)) (q : ℝ) (r : ℝ → ℝ) (t : ℝ) : E :=
25
+ let m := realMeanSolution V q r
26
+ q⁻¹ • ((r t + inner ℝ (V (t : Period) - average V) m / q) • V (t : Period) - m)
27
+
28
+ omit [CompleteSpace E] [FiniteDimensional ℝ E] in
29
+ lemma realMeanSolution_add (V : C(Period, E)) (q : ℝ) {f g : ℝ → ℝ}
30
+ (hf : Continuous f) (hg : Continuous g) :
31
+ realMeanSolution V q (fun t => f t + g t) =
32
+ realMeanSolution V q f + realMeanSolution V q g := by
33
+ unfold realMeanSolution realMoment
34
+ simp only [add_smul]
35
+ have hfi : IntervalIntegrable (fun t : ℝ => f t • V (t : Period)) volume 0 1 :=
36
+ (hf.smul (V.continuous.comp (AddCircle.continuous_mk' 1))).intervalIntegrable 0 1
37
+ have hgi : IntervalIntegrable (fun t : ℝ => g t • V (t : Period)) volume 0 1 :=
38
+ (hg.smul (V.continuous.comp (AddCircle.continuous_mk' 1))).intervalIntegrable 0 1
39
+ rw [intervalIntegral.integral_add hfi hgi, map_add]
40
+
41
+ omit [CompleteSpace E] [FiniteDimensional ℝ E] in
42
+ lemma realMeanSolution_smul (V : C(Period, E)) (q a : ℝ) (f : ℝ → ℝ) :
43
+ realMeanSolution V q (fun t => a * f t) = a • realMeanSolution V q f := by
44
+ unfold realMeanSolution realMoment
45
+ simp only [mul_smul, intervalIntegral.integral_smul, map_smul]
46
+
47
+ omit [CompleteSpace E] [FiniteDimensional ℝ E] in
48
+ lemma realCorrector_add (V : C(Period, E)) (q : ℝ) {f g : ℝ → ℝ}
49
+ (hf : Continuous f) (hg : Continuous g) (t : ℝ) :
50
+ realCorrector V q (fun s => f s + g s) t = realCorrector V q f t + realCorrector V q g t := by
51
+ simp only [realCorrector, realMeanSolution_add V q hf hg, inner_add_right, add_div]
52
+ module
53
+
54
+ omit [CompleteSpace E] [FiniteDimensional ℝ E] in
55
+ lemma realCorrector_smul (V : C(Period, E)) (q a : ℝ) (f : ℝ → ℝ) (t : ℝ) :
56
+ realCorrector V q (fun s => a * f s) t = a • realCorrector V q f t := by
57
+ simp only [realCorrector, realMeanSolution_smul, inner_smul_right]
58
+ have ha : a * f t + a * inner ℝ (V (t : Period) - average V) (realMeanSolution V q f) / q =
59
+ a * (f t + inner ℝ (V (t : Period) - average V) (realMeanSolution V q f) / q) := by ring
60
+ rw [ha]
61
+ module
62
+
63
+ omit [CompleteSpace E] [FiniteDimensional ℝ E] [NormedAddCommGroup P]
64
+ [NormedSpace ℝ P] [FiniteDimensional ℝ P] in
65
+ /-- Agreement with the covariance correction already used in the periodic solver. -/
66
+ lemma realCorrector_eq_parameterCorrector (V : P → C(Period, E)) (q : P → ℝ)
67
+ (r : P → C(Period, ℝ)) (p : P) (t : ℝ) :
68
+ realCorrector (V p) (q p) (fun s => r p (s : Period)) t =
69
+ parameterCorrector V r q p (t : Period) := by
70
+ have hm : realMoment (V p) (fun s => r p (s : Period)) = weightedAverage (V p) (r p) := by
71
+ exact PeriodicPrimitive.integral_lift_eq_haar (fun s => r p s • V p s)
72
+ simp only [realCorrector, realMeanSolution, hm, parameterCorrector,
73
+ correctedVector, correctedScalar, covarianceSolution]
74
+
75
+ lemma contDiffOn_realMeanSolution {O : Set P} (hO : IsOpen O)
76
+ {V : P → C(Period, E)} {q : P → ℝ} {c : P × ℝ → ℝ}
77
+ (hV : ContDiffOn ℝ ∞ (fun z : P × ℝ => V z.1 (z.2 : Period)) (O ×ˢ Set.univ))
78
+ (hq : ContDiffOn ℝ ∞ q O) (hqpos : ∀ p ∈ O, 0 < q p)
79
+ (hcircle : ∀ p ∈ O, ∀ t, inner ℝ (V p t) (V p t) = q p)
80
+ (hc : ContDiffOn ℝ ∞ c (O ×ˢ Set.univ)) :
81
+ ContDiffOn ℝ ∞ (fun p => realMeanSolution (V p) (q p) (fun t => c (p, t))) O := by
82
+ have hM : ContDiffOn ℝ ∞ (fun p => meanCLM (V p) (q p)) O :=
83
+ contDiffOn_const.sub ((hq.inv (fun p hp => (hqpos p hp).ne')).smul
84
+ (contDiffOn_covarianceCLM_joint hO hV))
85
+ have hi : ContDiffOn ℝ ∞ (fun p => (meanCLM (V p) (q p)).inverse) O := by
86
+ apply hO.contDiffOn_iff.mpr
87
+ intro p hp
88
+ exact (meanCLM_isInvertible (hqpos p hp) (hcircle p hp)).contDiffAt_map_inverse.comp p
89
+ (hM.contDiffAt (hO.mem_nhds hp))
90
+ exact hi.clm_apply (SmoothParameterIntegral.contDiffOn_integral hO (hc.smul hV) 0 1)
91
+
92
+ lemma contDiffOn_realCorrector {O : Set P} (hO : IsOpen O)
93
+ {V : P → C(Period, E)} {q : P → ℝ} {c : P × ℝ → ℝ}
94
+ (hV : ContDiffOn ℝ ∞ (fun z : P × ℝ => V z.1 (z.2 : Period)) (O ×ˢ Set.univ))
95
+ (hq : ContDiffOn ℝ ∞ q O) (hqpos : ∀ p ∈ O, 0 < q p)
96
+ (hcircle : ∀ p ∈ O, ∀ t, inner ℝ (V p t) (V p t) = q p)
97
+ (hc : ContDiffOn ℝ ∞ c (O ×ˢ Set.univ)) :
98
+ ContDiffOn ℝ ∞ (fun z : P × ℝ => realCorrector (V z.1) (q z.1)
99
+ (fun t => c (z.1, t)) z.2) (O ×ˢ Set.univ) := by
100
+ have hm : ContDiffOn ℝ ∞ (fun z : P × ℝ =>
101
+ realMeanSolution (V z.1) (q z.1) (fun t => c (z.1, t))) (O ×ˢ Set.univ) :=
102
+ (contDiffOn_realMeanSolution hO hV hq hqpos hcircle hc).comp
103
+ contDiffOn_fst (fun _ hz => hz.1)
104
+ have hv : ContDiffOn ℝ ∞ (fun z : P × ℝ => average (V z.1)) (O ×ˢ Set.univ) :=
105
+ (contDiffOn_average_joint hO hV).comp contDiffOn_fst (fun _ hz => hz.1)
106
+ have hq' : ContDiffOn ℝ ∞ (fun z : P × ℝ => q z.1) (O ×ˢ Set.univ) :=
107
+ hq.comp contDiffOn_fst (fun _ hz => hz.1)
108
+ have hi := hq'.inv (fun z hz => (hqpos z.1 hz.1).ne')
109
+ exact hi.smul (((hc.add (((hV.sub hv).inner ℝ hm).div hq'
110
+ (fun z hz => (hqpos z.1 hz.1).ne'))).smul hV).sub hm)
111
+
112
+ end ClosedSurfaceR4.CovarianceCorrector
113
+
114
+ end
115
+
116
+ end OAI
lean/OAI/Geometry/SurfaceImmersion/Geometry/CovectorPullbackParameters.lean ADDED
@@ -0,0 +1,90 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Geometry.SurfaceImmersion.Atlas.IndependentPhaseProjections
2
+ import OAI.Geometry.Immersion.ClosedSurface.AtlasPhases
3
+
4
+ namespace OAI
5
+
6
+ /-! Actual pullback of phase covectors by a chart derivative. Its parameter
7
+ map is open when the chart determinant is nonzero. -/
8
+ noncomputable section
9
+ open Set
10
+ namespace ClosedSurfaceR4.PhaseGeometry
11
+ open SmallModes RealModes
12
+
13
+ def pullCovectorMap (A : CurvePlane →L[ℝ] CurvePlane) : CurvePlane →L[ℝ] CurvePlane :=
14
+ (((A dx).1 • ContinuousLinearMap.fst ℝ ℝ ℝ) +
15
+ ((A dx).2 • ContinuousLinearMap.snd ℝ ℝ ℝ)).prod
16
+ (((A dy).1 • ContinuousLinearMap.fst ℝ ℝ ℝ) +
17
+ ((A dy).2 • ContinuousLinearMap.snd ℝ ℝ ℝ))
18
+
19
+ lemma pullCovectorMap_apply (A : CurvePlane →L[ℝ] CurvePlane) (v : CurvePlane) :
20
+ pullCovectorMap A v = pullCovector A v := by
21
+ ext <;> simp [pullCovectorMap,pullCovector] <;> ring
22
+
23
+ lemma pullCovectorMap_surjective (A : CurvePlane →L[ℝ] CurvePlane)
24
+ (hA : coordDet A ≠ 0) : Function.Surjective (pullCovectorMap A) := by
25
+ intro y
26
+ refine ⟨(((A dy).2*y.1-(A dx).2*y.2)/coordDet A,
27
+ ((A dx).1*y.2-(A dy).1*y.1)/coordDet A),?_⟩
28
+ rw [pullCovectorMap_apply]
29
+ ext <;> dsimp [pullCovector] <;> field_simp [hA] <;> dsimp [coordDet] <;> ring
30
+
31
+ lemma covectorDet_pullback (A : CurvePlane →L[ℝ] CurvePlane) (v w : CurvePlane) :
32
+ covectorDet (pullCovector A v) (pullCovector A w) = coordDet A * covectorDet v w := by
33
+ dsimp [covectorDet,pullCovector,coordDet]
34
+ ring
35
+
36
+ lemma phaseLinear_ne_zero_on_kernel {v w t : CurvePlane}
37
+ (hdet : covectorDet v w ≠ 0) (ht : t ≠ 0) (hv : phaseLinear v t = 0) :
38
+ phaseLinear w t ≠ 0 := by
39
+ intro hw
40
+ by_cases ht1 : t.1 = 0
41
+ · have ht2 : t.2 ≠ 0 := fun ht2 => ht (Prod.ext ht1 ht2)
42
+ have he : covectorDet v w * t.2 = v.1 * phaseLinear w t-w.1 * phaseLinear v t := by
43
+ dsimp [covectorDet,phaseLinear_apply]
44
+ ring
45
+ rw [hv,hw,mul_zero,mul_zero,sub_self] at he
46
+ exact hdet ((mul_eq_zero.mp he).resolve_right ht2)
47
+ · have he : covectorDet v w * t.1 = w.2 * phaseLinear v t-v.2 * phaseLinear w t := by
48
+ dsimp [covectorDet,phaseLinear_apply]
49
+ ring
50
+ rw [hv,hw,mul_zero,mul_zero,sub_self] at he
51
+ exact hdet ((mul_eq_zero.mp he).resolve_right ht1)
52
+
53
+ variable {ι : Type*} [Fintype ι] [DecidableEq ι]
54
+
55
+ lemma independent_pulled_covectors_open_dense {i j : ι} (hij : i ≠ j)
56
+ (A B : CurvePlane →L[ℝ] CurvePlane) (hA : coordDet A ≠ 0) (hB : coordDet B ≠ 0)
57
+ (a b : CurvePlane) :
58
+ IsOpen {ell : ι → CurvePlane |
59
+ covectorDet (pullCovector A (ell i+a)) (pullCovector B (ell j+b)) ≠ 0} ∧
60
+ Dense {ell : ι → CurvePlane |
61
+ covectorDet (pullCovector A (ell i+a)) (pullCovector B (ell j+b)) ≠ 0} := by
62
+ let T : (CurvePlane × CurvePlane) →L[ℝ] (CurvePlane × CurvePlane) :=
63
+ ((pullCovectorMap A).comp (ContinuousLinearMap.fst ℝ CurvePlane CurvePlane)).prod
64
+ ((pullCovectorMap B).comp (ContinuousLinearMap.snd ℝ CurvePlane CurvePlane))
65
+ have hT : Function.Surjective T := by
66
+ intro y
67
+ obtain ⟨v,hv⟩ := pullCovectorMap_surjective A hA y.1
68
+ obtain ⟨w,hw⟩ := pullCovectorMap_surjective B hB y.2
69
+ exact ⟨(v,w),Prod.ext hv hw⟩
70
+ let F : (ι → CurvePlane) → CurvePlane × CurvePlane :=
71
+ fun ell => T (phasePairProjection i j ell+(a,b))
72
+ have hF : Continuous F := by fun_prop
73
+ have hopen : IsOpenMap F := (T.isOpenMap hT).comp
74
+ ((isOpenMap_add_right (a,b)).comp
75
+ ((phasePairProjection i j).isOpenMap (phasePairProjection_surjective hij)))
76
+ have he : {ell : ι → CurvePlane |
77
+ covectorDet (pullCovector A (ell i+a)) (pullCovector B (ell j+b)) ≠ 0} =
78
+ F ⁻¹' {z | covectorDet z.1 z.2 ≠ 0} := by
79
+ ext ell
80
+ change covectorDet (pullCovector A (ell i+a)) (pullCovector B (ell j+b)) ≠ 0 ↔
81
+ covectorDet (pullCovectorMap A (ell i+a)) (pullCovectorMap B (ell j+b)) ≠ 0
82
+ rw [pullCovectorMap_apply,pullCovectorMap_apply]
83
+ rw [he]
84
+ exact ⟨covectorDet_open_dense.1.preimage hF,covectorDet_open_dense.2.preimage hopen⟩
85
+
86
+ end ClosedSurfaceR4.PhaseGeometry
87
+
88
+ end
89
+
90
+ end OAI
lean/OAI/Geometry/SurfaceImmersion/Geometry/CriticalSetClosed.lean ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Geometry.SurfaceImmersion.Geometry.SplitSardCompact
2
+ import Mathlib.Analysis.Normed.Ring.Units
3
+
4
+ namespace OAI
5
+
6
+ /-! Finite-dimensional critical loci are closed. This supplies compact
7
+ exhaustions for the fiberwise critical-value argument. -/
8
+ noncomputable section
9
+ open Set Filter
10
+ open scoped ContDiff Topology
11
+ namespace ClosedSurfaceR4.FiniteOrderSmoothing
12
+ variable {E F : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E]
13
+ [NormedAddCommGroup F] [NormedSpace ℝ F] [FiniteDimensional ℝ F]
14
+
15
+ theorem surjective_clm_open : IsOpen {K : E →L[ℝ] F | Function.Surjective K} := by
16
+ rw [isOpen_iff_mem_nhds]
17
+ intro K hK
18
+ obtain ⟨R,hR⟩ := K.toLinearMap.exists_rightInverse_of_surjective (LinearMap.range_eq_top.mpr hK)
19
+ let R' : F →L[ℝ] E := R.toContinuousLinearMap
20
+ have hKR : K.comp R' = ContinuousLinearMap.id ℝ F := by
21
+ apply ContinuousLinearMap.ext
22
+ intro x
23
+ exact congrArg (fun L : F →ₗ[ℝ] F => L x) hR
24
+ have hc : Continuous (fun L : E →L[ℝ] F => L.comp R') := continuous_id.clm_comp continuous_const
25
+ have hn : ∀ᶠ L in 𝓝 K, IsUnit (L.comp R') := by
26
+ change (fun L : E →L[ℝ] F => L.comp R') ⁻¹' {A | IsUnit A} ∈ 𝓝 K
27
+ apply hc.continuousAt.preimage_mem_nhds
28
+ apply Units.isOpen.mem_nhds
29
+ rw [hKR]
30
+ exact isUnit_one
31
+ filter_upwards [hn] with L hL
32
+ obtain ⟨u,hu⟩ := hL
33
+ intro y
34
+ refine ⟨R' ((↑u⁻¹ : F →L[ℝ] F) y),?_⟩
35
+ have hval : L (R' ((↑u⁻¹ : F →L[ℝ] F) y)) =
36
+ (↑u : F →L[ℝ] F) ((↑u⁻¹ : F →L[ℝ] F) y) := by rw [hu]; rfl
37
+ rw [hval]
38
+ change ((u : F →L[ℝ] F) * (↑u⁻¹ : F →L[ℝ] F)) y = y
39
+ simp
40
+
41
+ theorem smooth_critical_set_closed {f : E → F} (hf : ContDiff ℝ ∞ f) :
42
+ IsClosed {x | ¬ Function.Surjective (fderiv ℝ f x)} :=
43
+ (surjective_clm_open.preimage (hf.continuous_fderiv (by simp))).isClosed_compl
44
+
45
+ end ClosedSurfaceR4.FiniteOrderSmoothing
46
+
47
+ end
48
+
49
+ end OAI
lean/OAI/Geometry/SurfaceImmersion/Geometry/CubicTaylorRemainder.lean ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import Mathlib
2
+
3
+ namespace OAI
4
+
5
+ /-! The third-order integral remainder needed after the finite quadratic
6
+ mean correction. -/
7
+ noncomputable section
8
+ open Set MeasureTheory
9
+ open scoped ContDiff
10
+
11
+ namespace ClosedSurfaceR4
12
+
13
+ variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E]
14
+
15
+ omit [CompleteSpace E] in
16
+ lemma quadraticTaylor_value {f : ℝ → E} (hf : ContDiff ℝ ∞ f) :
17
+ taylorWithinEval f 2 (uIcc (0 : ℝ) 1) 0 1 =
18
+ f 0 + deriv f 0 + (1 / 2 : ℝ) • iteratedDeriv 2 f 0 := by
19
+ have hi (k : ℕ) : iteratedDerivWithin k f (uIcc (0 : ℝ) 1) 0 = iteratedDeriv k f 0 :=
20
+ iteratedDerivWithin_eq_iteratedDeriv (uniqueDiffOn_uIcc (by norm_num))
21
+ ((hf.of_le (by simp : (k : ℕ∞ω) ≤ ∞)).contDiffAt) (by simp)
22
+ rw [show 2 = 1 + 1 from rfl, taylorWithinEval_succ, taylorWithinEval_succ,
23
+ taylor_within_zero_eval, hi 1, hi 2]
24
+ norm_num
25
+
26
+ lemma cubicTaylor_remainder {f : ℝ → E} (hf : ContDiff ℝ ∞ f) :
27
+ f 1 - f 0 - deriv f 0 - (1 / 2 : ℝ) • iteratedDeriv 2 f 0 =
28
+ ∫ t in (0 : ℝ)..1, ((1 - t) ^ 2 / 2) • iteratedDeriv 3 f t := by
29
+ have ht := taylor_integral_remainder (f := f) (n := 2) (x₀ := 0) (x := 1)
30
+ (hf.of_le (by simp : ((2 + 1 : ℕ) : ℕ∞ω) ≤ ∞)).contDiffOn
31
+ rw [quadraticTaylor_value hf] at ht
32
+ have hi : (∫ t in (0 : ℝ)..1, ((1 - t) ^ 2 / (Nat.factorial 2 : ℝ)) •
33
+ iteratedDerivWithin 3 f (uIcc (0 : ℝ) 1) t) =
34
+ ∫ t in (0 : ℝ)..1, ((1 - t) ^ 2 / 2) • iteratedDeriv 3 f t := by
35
+ apply intervalIntegral.integral_congr
36
+ intro t ht
37
+ dsimp only
38
+ rw [iteratedDerivWithin_eq_iteratedDeriv (uniqueDiffOn_uIcc (by norm_num))
39
+ ((hf.of_le (by simp : (3 : ℕ∞ω) ≤ ∞)).contDiffAt) ht]
40
+ norm_num
41
+ rw [hi] at ht
42
+ convert ht using 1
43
+ abel
44
+
45
+ lemma cubicTaylor_bound {f : ℝ → E} (hf : ContDiff ℝ ∞ f) {M : ℝ} (hM : 0 ≤ M)
46
+ (hderiv : ∀ t ∈ Icc (0 : ℝ) 1, ‖iteratedDeriv 3 f t‖ ≤ M) :
47
+ ‖f 1 - f 0 - deriv f 0 - (1 / 2 : ℝ) • iteratedDeriv 2 f 0‖ ≤ M / 2 := by
48
+ rw [cubicTaylor_remainder hf]
49
+ have hbound : ‖∫ t in (0 : ℝ)..1, ((1 - t) ^ 2 / 2) • iteratedDeriv 3 f t‖ ≤
50
+ (M / 2) * |1 - 0| := by
51
+ apply intervalIntegral.norm_integral_le_of_norm_le_const
52
+ intro t ht
53
+ have ht' : t ∈ Icc (0 : ℝ) 1 := by
54
+ simpa using uIoc_subset_uIcc ht
55
+ have hweight : (1 - t) ^ 2 / 2 ≤ (1 / 2 : ℝ) := by nlinarith [ht'.1, ht'.2]
56
+ rw [norm_smul, Real.norm_eq_abs, abs_of_nonneg (by positivity : 0 ≤ (1 - t) ^ 2 / 2)]
57
+ calc
58
+ _ ≤ ((1 - t) ^ 2 / 2) * M := mul_le_mul_of_nonneg_left (hderiv t ht') (by positivity)
59
+ _ ≤ (1 / 2 : ℝ) * M := mul_le_mul_of_nonneg_right hweight hM
60
+ _ = M / 2 := by ring
61
+ simpa using hbound
62
+
63
+ end ClosedSurfaceR4
64
+
65
+ end
66
+
67
+ end OAI
lean/OAI/Geometry/SurfaceImmersion/Geometry/CurveEdgeLocalization.lean ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Geometry.SurfaceImmersion.Geometry.CurveEdgePaths
2
+ import OAI.Geometry.SurfaceImmersion.Geometry.CurveIncidenceGraph
3
+
4
+ namespace OAI
5
+
6
+ /-! Localization of a full edge path at its two graph vertices and its
7
+ single open interval edge. -/
8
+ noncomputable section
9
+ open Set
10
+ namespace ClosedSurfaceR4.FiniteOrderSmoothing
11
+ variable {X : Type*} [TopologicalSpace X] [T2Space X]
12
+
13
+ theorem curve_edge_frontier_endpoints {V : Set X} {E : Set X}
14
+ (w : CurveEdgeWitness V E) (hdis : Disjoint E V) (a b : V) (hne : a ≠ b)
15
+ (ha : a.val ∈ closure E) (hb : b.val ∈ closure E) :
16
+ closure E \ E = {a.val,b.val} := by
17
+ have hne' : a.val ≠ b.val := fun h => hne (Subtype.ext h)
18
+ rcases (w.endpoint_iff hdis a.property).mp ha with hal | har <;>
19
+ rcases (w.endpoint_iff hdis b.property).mp hb with hbl | hbr
20
+ · exact False.elim (hne' (hal.trans hbl.symm))
21
+ · rw [w.frontier_eq,hal,hbr]
22
+ · rw [w.frontier_eq,har,hbl,pair_comm]
23
+ · exact False.elim (hne' (har.trans hbr.symm))
24
+
25
+ theorem curve_edge_path_localization {V : Set X} {P : Finset (Set X)}
26
+ (hP : ∀ E ∈ P, Disjoint E V)
27
+ (hdis : ∀ E ∈ P, ∀ F ∈ P, E ≠ F → Disjoint E F)
28
+ (E : P) (w : CurveEdgeWitness V E.val) (a b : V) (hne : a ≠ b)
29
+ (ha : a.val ∈ closure E.val) (hb : b.val ∈ closure E.val)
30
+ (γ : Path a.val b.val) (hrange : range γ = closure E.val) :
31
+ (∀ v : V, v.val ∈ range γ → v = a ∨ v = b) ∧
32
+ (∀ F : P, (range γ ∩ F.val).Nonempty → F = E) := by
33
+ have hfront := curve_edge_frontier_endpoints w (hP E.val E.property) a b hne ha hb
34
+ constructor
35
+ · intro v hv
36
+ have hn : v.val ∉ E.val := fun h => disjoint_left.mp (hP E.val E.property) h v.property
37
+ have hv' : v.val ∈ closure E.val \ E.val := ⟨hrange ▸ hv,hn⟩
38
+ rw [hfront] at hv'
39
+ rcases hv' with he | he
40
+ · exact Or.inl (Subtype.ext he)
41
+ · exact Or.inr (Subtype.ext (mem_singleton_iff.mp he))
42
+ · rintro F ⟨x,hxγ,hxF⟩
43
+ by_contra hFE
44
+ have hxcl : x ∈ closure E.val := hrange ▸ hxγ
45
+ by_cases hxE : x ∈ E.val
46
+ · exact disjoint_left.mp (hdis F.val F.property E.val E.property
47
+ (fun h => hFE (Subtype.ext h))) hxF hxE
48
+ · have hxV : x ∈ V := by
49
+ have hx : x ∈ closure E.val \ E.val := ⟨hxcl,hxE⟩
50
+ rw [w.frontier_eq] at hx
51
+ rcases hx with he | he
52
+ · exact he ▸ w.left_mem
53
+ · exact (mem_singleton_iff.mp he) ▸ w.right_mem
54
+ exact disjoint_left.mp (hP F.val F.property) hxF hxV
55
+
56
+ end ClosedSurfaceR4.FiniteOrderSmoothing
57
+
58
+ end
59
+
60
+ end OAI
lean/OAI/Geometry/SurfaceImmersion/Geometry/CurveEdgeParametrization.lean ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Geometry.SurfaceImmersion.Geometry.CurveEdgeWitness
2
+ import OAI.Geometry.SurfaceImmersion.Atlas.LineChartEndpointObstruction
3
+
4
+ namespace OAI
5
+
6
+ /-! Retained edge witnesses give actual compact interval
7
+ parametrizations of their closures. -/
8
+ noncomputable section
9
+ open Set Topology
10
+ namespace ClosedSurfaceR4.FiniteOrderSmoothing
11
+ variable {X : Type*} [TopologicalSpace X] [T2Space X]
12
+
13
+ def CurveEdgeWitness.param {V E : Set X} (w : CurveEdgeWitness V E) : Icc w.lo w.hi → X :=
14
+ fun t => w.arc.map ⟨t.val,w.lower.trans t.property.1,t.property.2.trans w.upper⟩
15
+
16
+ lemma CurveEdgeWitness.param_closedEmbedding {V E : Set X} (w : CurveEdgeWitness V E) :
17
+ IsClosedEmbedding w.param := by
18
+ let j : Icc w.lo w.hi → Icc w.arc.left w.arc.right := fun t =>
19
+ ⟨t.val,w.lower.trans t.property.1,t.property.2.trans w.upper⟩
20
+ have hj : Continuous j := continuous_subtype_val.subtype_mk _
21
+ have hc : Continuous w.param := w.arc.embedding.continuous.comp hj
22
+ apply hc.isClosedEmbedding
23
+ intro s t hst
24
+ have he := w.arc.embedding.injective hst
25
+ exact Subtype.ext (congrArg (fun u : Icc w.arc.left w.arc.right => (u:ℝ)) he)
26
+
27
+ omit [T2Space X] in
28
+ lemma CurveEdgeWitness.param_range {V E : Set X} (w : CurveEdgeWitness V E) :
29
+ range w.param = closure E := by
30
+ conv_rhs => rw [w.piece_eq,w.arc.subarc_closure w.lower w.upper w.ordered]
31
+ apply Subset.antisymm
32
+ · rintro x ⟨t,rfl⟩
33
+ exact ⟨⟨t.val,w.lower.trans t.property.1,t.property.2.trans w.upper⟩,t.property,rfl⟩
34
+ · rintro x ⟨t,ht,rfl⟩
35
+ exact ⟨⟨t.val,ht⟩,rfl⟩
36
+
37
+ lemma CurveEdgeWitness.frontier_not_interior_closure {V E : Set X} (w : CurveEdgeWitness V E)
38
+ (d : OpenPartialHomeomorph X ℝ) {p : X} (hp : p ∈ d.source)
39
+ (hb : p ∈ closure E \ E) : p ∉ interior (closure E) := by
40
+ have hend : p = w.param ⟨w.lo,le_rfl,w.ordered.le⟩ ∨
41
+ p = w.param ⟨w.hi,w.ordered.le,le_rfl⟩ := by
42
+ rw [w.frontier_eq] at hb
43
+ rcases hb with h | h
44
+ · exact Or.inl h
45
+ · exact Or.inr (mem_singleton_iff.mp h)
46
+ rw [← w.param_range]
47
+ exact compact_arc_endpoint_not_interior d w.ordered.le w.param w.param_closedEmbedding.isEmbedding hp hend
48
+
49
+ end ClosedSurfaceR4.FiniteOrderSmoothing
50
+
51
+ end
52
+
53
+ end OAI
lean/OAI/Geometry/SurfaceImmersion/Geometry/CurveEdgePaths.lean ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Geometry.SurfaceImmersion.Geometry.GeometricCurvePaths
2
+
3
+ namespace OAI
4
+
5
+ /-! Each retained compact interval edge is parametrized by an injective
6
+ path, in either orientation. -/
7
+ noncomputable section
8
+ open Set Topology unitInterval
9
+ namespace ClosedSurfaceR4.FiniteOrderSmoothing
10
+ variable {X : Type*} [TopologicalSpace X] [T2Space X]
11
+
12
+ def CurveEdgeWitness.path {V E : Set X} (w : CurveEdgeWitness V E) :
13
+ Path w.leftPoint w.rightPoint where
14
+ toFun t := w.param ((iccHomeoI w.lo w.hi w.ordered).symm t)
15
+ continuous_toFun := w.param_closedEmbedding.continuous.comp (iccHomeoI w.lo w.hi w.ordered).symm.continuous
16
+ source' := by
17
+ change w.param _ = w.param ⟨w.lo,le_rfl,w.ordered.le⟩
18
+ congr 1
19
+ apply Subtype.ext
20
+ simp
21
+ target' := by
22
+ change w.param _ = w.param ⟨w.hi,w.ordered.le,le_rfl⟩
23
+ congr 1
24
+ apply Subtype.ext
25
+ simp
26
+
27
+ lemma CurveEdgeWitness.path_injective {V E : Set X} (w : CurveEdgeWitness V E) :
28
+ Function.Injective w.path :=
29
+ w.param_closedEmbedding.injective.comp (iccHomeoI w.lo w.hi w.ordered).symm.injective
30
+
31
+ lemma CurveEdgeWitness.path_range {V E : Set X} (w : CurveEdgeWitness V E) :
32
+ range w.path = closure E := by
33
+ change range (w.param ∘ (iccHomeoI w.lo w.hi w.ordered).symm) = _
34
+ rw [range_comp,(iccHomeoI w.lo w.hi w.ordered).symm.surjective.range_eq,image_univ,w.param_range]
35
+
36
+ lemma CurveEdgeWitness.endpoint_iff {V E : Set X} (w : CurveEdgeWitness V E)
37
+ (hdis : Disjoint E V) {p : X} (hp : p ∈ V) :
38
+ p ∈ closure E ↔ p = w.leftPoint ∨ p = w.rightPoint := by
39
+ have hnot : p ∉ E := fun h => disjoint_left.mp hdis h hp
40
+ have he : p ∈ closure E ↔ p ∈ closure E \ E := by simp only [mem_sdiff,hnot,not_false_eq_true,and_true]
41
+ rw [he,w.frontier_eq]
42
+ simp only [mem_insert_iff,mem_singleton_iff]
43
+
44
+ lemma CurveEdgeWitness.oriented_path {V E : Set X} (w : CurveEdgeWitness V E)
45
+ (hdis : Disjoint E V) {p q : X} (hp : p ∈ V) (hq : q ∈ V) (hne : p ≠ q)
46
+ (hpE : p ∈ closure E) (hqE : q ∈ closure E) :
47
+ ∃ γ : Path p q, Function.Injective γ ∧ range γ = closure E := by
48
+ rcases (w.endpoint_iff hdis hp).mp hpE with hpl | hpr <;>
49
+ rcases (w.endpoint_iff hdis hq).mp hqE with hql | hqr
50
+ · exact False.elim (hne (hpl.trans hql.symm))
51
+ · exact ⟨w.path.cast hpl hqr,w.path_injective,w.path_range⟩
52
+ · refine ⟨w.path.symm.cast hpr hql,?_,?_⟩
53
+ · exact w.path_injective.comp unitInterval.symm_bijective.injective
54
+ · simpa only [Path.cast_coe,Path.symm_range] using w.path_range
55
+ · exact False.elim (hne (hpr.trans hqr.symm))
56
+
57
+ end ClosedSurfaceR4.FiniteOrderSmoothing
58
+
59
+ end
60
+
61
+ end OAI
lean/OAI/Geometry/SurfaceImmersion/Geometry/CurveEdgeWitness.lean ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Geometry.SurfaceImmersion.Geometry.SubarcClosure
2
+
3
+ namespace OAI
4
+
5
+ /-! Each finite curve edge retains its actual compact interval
6
+ parametrization, two distinct endpoints, and exact frontier. -/
7
+ noncomputable section
8
+ open Set
9
+ namespace ClosedSurfaceR4.FiniteOrderSmoothing
10
+ variable {X : Type*} [TopologicalSpace X]
11
+
12
+ structure CurveEdgeWitness (V E : Set X) where
13
+ arc : CompactCurveArc X
14
+ lo : ℝ
15
+ hi : ℝ
16
+ lower : arc.left ≤ lo
17
+ upper : hi ≤ arc.right
18
+ ordered : lo < hi
19
+ piece_eq : E = arc.openSubarc lo hi
20
+ left_mem : arc.map ⟨lo,lower,ordered.le.trans upper⟩ ∈ V
21
+ right_mem : arc.map ⟨hi,lower.trans ordered.le,upper⟩ ∈ V
22
+
23
+ def CurveEdgeWitness.leftPoint {V E : Set X} (w : CurveEdgeWitness V E) : X :=
24
+ w.arc.map ⟨w.lo,w.lower,w.ordered.le.trans w.upper⟩
25
+
26
+ def CurveEdgeWitness.rightPoint {V E : Set X} (w : CurveEdgeWitness V E) : X :=
27
+ w.arc.map ⟨w.hi,w.lower.trans w.ordered.le,w.upper⟩
28
+
29
+ lemma CurveEdgeWitness.endpoints_ne {V E : Set X} (w : CurveEdgeWitness V E) :
30
+ w.leftPoint ≠ w.rightPoint := by
31
+ intro he
32
+ have ht := w.arc.embedding.injective he
33
+ exact w.ordered.ne (congrArg Subtype.val ht)
34
+
35
+ variable [T2Space X]
36
+ lemma CurveEdgeWitness.frontier_eq {V E : Set X} (w : CurveEdgeWitness V E) :
37
+ closure E \ E = {w.leftPoint,w.rightPoint} := by
38
+ conv_lhs => rw [w.piece_eq]
39
+ exact w.arc.subarc_boundary_eq w.lower w.upper w.ordered
40
+
41
+ end ClosedSurfaceR4.FiniteOrderSmoothing
42
+
43
+ end
44
+
45
+ end OAI
lean/OAI/Geometry/SurfaceImmersion/Geometry/CurveFrameInverse.lean ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Geometry.SurfaceImmersion.Whitney.CrosscapStripFrame
2
+
3
+ namespace OAI
4
+
5
+ /-! Smooth inverse frames and the exact normal-coordinate immersion criterion. -/
6
+ noncomputable section
7
+ open Set Filter Matrix
8
+ open scoped ContDiff Topology
9
+ namespace ClosedSurfaceR4.FiniteOrderSmoothing
10
+ open JetPolynomial (Base)
11
+
12
+ lemma curveNormalLinear_invertible {v a : Fin 3 → ℝ}
13
+ (hv : v ≠ 0) (ha : ∀ r : ℝ, r • v ≠ a) : (curveNormalLinear v a).IsInvertible := by
14
+ have hb := curveNormalLinear_bijective hv ha
15
+ exact ⟨ContinuousLinearEquiv.ofBijective (curveNormalLinear v a)
16
+ (LinearMap.ker_eq_bot.mpr hb.1) (LinearMap.range_eq_top.mpr hb.2),rfl⟩
17
+
18
+ lemma curveNormalLinear_inverse_velocity {v a : Fin 3 → ℝ}
19
+ (hv : v ≠ 0) (ha : ∀ r : ℝ, r • v ≠ a) :
20
+ (curveNormalLinear v a).inverse v = ((0 : Base),1) := by
21
+ apply ((curveNormalLinear_invertible hv ha).inverse_apply_eq).mpr
22
+ simp [curveNormalLinear_apply]
23
+
24
+ lemma curveNormalLinear_inverse_smooth {v : ℝ → Fin 3 → ℝ}
25
+ (hv : ContDiff ℝ ∞ v) {a : Fin 3 → ℝ} {J : Set ℝ}
26
+ (hn : ∀ t ∈ J, v t ≠ 0) (ha : ∀ t r : ℝ, r • v t ≠ a) :
27
+ ContDiffOn ℝ ∞ (fun t => (curveNormalLinear (v t) a).inverse) J := by
28
+ intro t ht
29
+ exact ((curveNormalLinear_invertible (hn t ht) (ha t)).contDiffAt_map_inverse.comp t
30
+ (curveNormalLinear_smooth hv a).contDiffAt).contDiffWithinAt
31
+
32
+ lemma normal_coordinates_injective_iff (L : Base →L[ℝ] (Base × ℝ))
33
+ (hL : L (![1,0] : Base) = ((0:Base),1)) :
34
+ Function.Injective L ↔ (L (![0,1] : Base)).1 ≠ 0 := by
35
+ have hsplit : ∀ x : Base, L x = (x 0) • L (![1,0] : Base) + (x 1) • L (![0,1] : Base) := by
36
+ intro x
37
+ have hx : x = (x 0) • (![1,0] : Base) + (x 1) • (![0,1] : Base) := by
38
+ ext i; fin_cases i <;> simp
39
+ conv_lhs => rw [hx]
40
+ rw [map_add,map_smul,map_smul]
41
+ constructor
42
+ · intro h hz
43
+ have hEq : L (![0,1] : Base) = L (((L (![0,1] : Base)).2) • (![1,0] : Base)) := by
44
+ rw [map_smul,hL]
45
+ apply Prod.ext
46
+ · simpa using hz
47
+ · simp
48
+ have h0 := congrFun (h hEq) 1
49
+ norm_num at h0
50
+ · intro hn x y hxy
51
+ have hd : L (x-y) = 0 := by rw [map_sub,hxy,sub_self]
52
+ rw [hsplit,hL] at hd
53
+ have hfst := congrArg Prod.fst hd
54
+ have h1 : (x-y) 1 = 0 := by
55
+ have hm : (x-y) 1 • (L (![0,1] : Base)).1 = 0 := by simpa using hfst
56
+ exact (smul_eq_zero.mp hm).resolve_right hn
57
+ have hsnd := congrArg Prod.snd hd
58
+ have h0 : (x-y) 0 = 0 := by simpa [h1] using hsnd
59
+ apply sub_eq_zero.mp
60
+ ext i
61
+ fin_cases i
62
+ · exact h0
63
+ · exact h1
64
+
65
+ end ClosedSurfaceR4.FiniteOrderSmoothing
66
+
67
+ end
68
+
69
+ end OAI
lean/OAI/Geometry/SurfaceImmersion/Geometry/CurveIncidenceBoundaryPair.lean ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Geometry.SurfaceImmersion.Geometry.BoundaryDegreeOne
2
+ import OAI.Geometry.SurfaceImmersion.Geometry.OrdinaryDegreeTwo
3
+ import OAI.Geometry.SurfaceImmersion.Geometry.DegreeOneReachability
4
+
5
+ namespace OAI
6
+
7
+ /-! Every boundary point of a compact curve is connected to a different
8
+ boundary point in its actual finite interval incidence graph. -/
9
+ noncomputable section
10
+ open Set Topology
11
+ attribute [local instance] Classical.propDecidable
12
+ namespace ClosedSurfaceR4.FiniteOrderSmoothing
13
+ variable {X : Type*} [TopologicalSpace X] [T2Space X]
14
+
15
+ theorem curve_incidence_degrees (D V : Set X) (hV : V.Finite) (P : Finset (Set X))
16
+ (hP : ∀ E ∈ P, IsOpen E ∧ Disjoint E V ∧ closure E \ E ⊆ V)
17
+ (hdis : ∀ E ∈ P, ∀ F ∈ P, E ≠ F → Disjoint E F)
18
+ (hcover : Vᶜ = ⋃ E ∈ P, E) (hwitness : ∀ E ∈ P, Nonempty (CurveEdgeWitness V E))
19
+ (hline : ∀ p ∉ D, ∃ c : OpenPartialHomeomorph X ℝ, p ∈ c.source)
20
+ (hhalf : ∀ p ∈ D, ∃ c : OpenPartialHomeomorph X (Ici (0:ℝ)),
21
+ p ∈ c.source ∧ c p = ⟨0,by simp⟩) [Fintype V] :
22
+ (∀ p : V, (curveIncidenceGraph V P).degree (Sum.inl p) = if p.val ∈ D then 1 else 2) ∧
23
+ (∀ E : P, (curveIncidenceGraph V P).degree (Sum.inr E) = 2) := by
24
+ constructor
25
+ · intro p
26
+ by_cases hp : p.val ∈ D
27
+ · simp only [hp, ↓reduceIte]
28
+ obtain ⟨c,hc,hc0⟩ := hhalf p.val hp
29
+ exact curveIncidenceGraph_degree_left_one V P p
30
+ (boundary_vertex_degree_one V hV P hP hdis hcover p.property c hc hc0)
31
+ · simp only [hp, ↓reduceIte]
32
+ obtain ⟨c,hc⟩ := hline p.val hp
33
+ exact curveIncidenceGraph_degree_left_two V P p
34
+ (ordinary_vertex_degree_two V hV P hP hdis hcover hwitness p.property c hc)
35
+ · intro E
36
+ exact curveIncidenceGraph_degree_right_two V P E (hP E.val E.property).2.1
37
+ (Classical.choice (hwitness E.val E.property))
38
+
39
+ theorem curve_boundary_pair (D V : Set X) (hDV : D ⊆ V) (hV : V.Finite)
40
+ (P : Finset (Set X))
41
+ (hP : ∀ E ∈ P, IsOpen E ∧ Disjoint E V ∧ closure E \ E ⊆ V)
42
+ (hdis : ∀ E ∈ P, ∀ F ∈ P, E ≠ F → Disjoint E F)
43
+ (hcover : Vᶜ = ⋃ E ∈ P, E) (hwitness : ∀ E ∈ P, Nonempty (CurveEdgeWitness V E))
44
+ (hline : ∀ p ∉ D, ∃ c : OpenPartialHomeomorph X ℝ, p ∈ c.source)
45
+ (hhalf : ∀ p ∈ D, ∃ c : OpenPartialHomeomorph X (Ici (0:ℝ)),
46
+ p ∈ c.source ∧ c p = ⟨0,by simp⟩)
47
+ (p : D) : ∃ (q : D), q ≠ p ∧ Nonempty
48
+ ((curveIncidenceGraph V P).Path (Sum.inl ⟨p.val,hDV p.property⟩)
49
+ (Sum.inl ⟨q.val,hDV q.property⟩)) := by
50
+ let : Fintype V := hV.fintype
51
+ let G := curveIncidenceGraph V P
52
+ obtain ⟨hl,hr⟩ := curve_incidence_degrees D V hV P hP hdis hcover hwitness hline hhalf
53
+ have hdegrees : ∀ x, G.degree x = 1 ∨ G.degree x = 2 := by
54
+ rintro (v|E)
55
+ · rw [hl]
56
+ split_ifs <;> simp
57
+ · exact Or.inr (hr E)
58
+ have hp : G.degree (Sum.inl ⟨p.val,hDV p.property⟩) = 1 := by
59
+ rw [hl]
60
+ simp only [p.property, ↓reduceIte]
61
+ obtain ⟨q,hqp,hq,hpath⟩ := degree_one_reaches_degree_one G hdegrees
62
+ (Sum.inl ⟨p.val,hDV p.property⟩) hp
63
+ cases q with
64
+ | inr E => rw [hr] at hq; norm_num at hq
65
+ | inl v =>
66
+ have hvD : v.val ∈ D := by
67
+ rw [hl] at hq
68
+ by_contra hn
69
+ simp only [hn, ↓reduceIte] at hq
70
+ norm_num at hq
71
+ refine ⟨⟨v.val,hvD⟩,?_,hpath⟩
72
+ intro he
73
+ exact hqp (congrArg Sum.inl (Subtype.ext (congrArg (fun z : D => z.val) he)))
74
+
75
+ end ClosedSurfaceR4.FiniteOrderSmoothing
76
+
77
+ end
78
+
79
+ end OAI
lean/OAI/Geometry/SurfaceImmersion/Geometry/CurveIncidenceGraph.lean ADDED
@@ -0,0 +1,102 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Geometry.SurfaceImmersion.Geometry.CurveEdgeWitness
2
+ import Mathlib.Combinatorics.SimpleGraph.DegreeSum
3
+ import Mathlib.Combinatorics.SimpleGraph.Connectivity.Connected
4
+
5
+ namespace OAI
6
+
7
+ /-! The bipartite incidence graph remembers distinct parallel interval edges. -/
8
+ noncomputable section
9
+ open Set
10
+ attribute [local instance] Classical.propDecidable
11
+ namespace ClosedSurfaceR4.FiniteOrderSmoothing
12
+ variable {X : Type*} [TopologicalSpace X]
13
+
14
+ def curveIncidenceGraph (V : Set X) (P : Finset (Set X)) : SimpleGraph (V ⊕ P) where
15
+ Adj a b := match a,b with
16
+ | Sum.inl v, Sum.inr E => v.val ∈ closure E.val
17
+ | Sum.inr E, Sum.inl v => v.val ∈ closure E.val
18
+ | _,_ => False
19
+ symm := ⟨by rintro (v|E) (w|F) h <;> exact h⟩
20
+ loopless := ⟨by rintro (v|E) h <;> exact h⟩
21
+
22
+ @[simp] lemma curveIncidenceGraph_left_right (V : Set X) (P : Finset (Set X)) (v : V) (E : P) :
23
+ (curveIncidenceGraph V P).Adj (Sum.inl v) (Sum.inr E) ↔ v.val ∈ closure E.val := Iff.rfl
24
+
25
+ lemma graph_degree_two {A : Type*} (G : SimpleGraph A) [Fintype A]
26
+ (p a b : A) (hne : a ≠ b) (ha : G.Adj p a) (hb : G.Adj p b)
27
+ (hall : ∀ z, G.Adj p z → z = a ∨ z = b) : G.degree p = 2 := by
28
+ classical
29
+ have hs : G.neighborSet p = {a,b} := by
30
+ ext z
31
+ constructor
32
+ · exact hall z
33
+ · rintro (rfl | hz)
34
+ · exact ha
35
+ · exact (mem_singleton_iff.mp hz) ▸ hb
36
+ rw [← G.ncard_neighborSet,hs]
37
+ simp [hne]
38
+
39
+ lemma curveIncidenceGraph_degree_left_one (V : Set X) (P : Finset (Set X)) [Fintype V]
40
+ (v : V) (h : ∃ E ∈ P, v.val ∈ closure E ∧
41
+ ∀ F ∈ P, v.val ∈ closure F → F = E) :
42
+ (curveIncidenceGraph V P).degree (Sum.inl v) = 1 := by
43
+ apply SimpleGraph.degree_eq_one_iff_existsUnique_adj.mpr
44
+ obtain ⟨E,hE,hv,huniq⟩ := h
45
+ refine ⟨Sum.inr ⟨E,hE⟩,hv,?_⟩
46
+ rintro (w|F) hw
47
+ · exact False.elim hw
48
+ · exact congrArg Sum.inr (Subtype.ext (huniq F.val F.property hw))
49
+
50
+ lemma curveIncidenceGraph_degree_left_two (V : Set X) (P : Finset (Set X)) [Fintype V]
51
+ (v : V) (h : ∃ E ∈ P, ∃ F ∈ P, E ≠ F ∧ v.val ∈ closure E ∧ v.val ∈ closure F ∧
52
+ ∀ G ∈ P, v.val ∈ closure G → G = E ∨ G = F) :
53
+ (curveIncidenceGraph V P).degree (Sum.inl v) = 2 := by
54
+ obtain ⟨E,hE,F,hF,hne,hvE,hvF,hall⟩ := h
55
+ apply graph_degree_two (curveIncidenceGraph V P) (Sum.inl v)
56
+ (Sum.inr ⟨E,hE⟩) (Sum.inr ⟨F,hF⟩)
57
+ · intro he
58
+ exact hne (congrArg (fun z : P => z.val) (Sum.inr.inj he))
59
+ · exact hvE
60
+ · exact hvF
61
+ · rintro (w|G) hg
62
+ · exact False.elim hg
63
+ · rcases hall G.val G.property hg with he | he
64
+ · exact Or.inl (congrArg Sum.inr (Subtype.ext he))
65
+ · exact Or.inr (congrArg Sum.inr (Subtype.ext he))
66
+
67
+ variable [T2Space X]
68
+ lemma curveIncidenceGraph_degree_right_two (V : Set X) (P : Finset (Set X)) [Fintype V]
69
+ (E : P) (hdis : Disjoint E.val V) (w : CurveEdgeWitness V E.val) :
70
+ (curveIncidenceGraph V P).degree (Sum.inr E) = 2 := by
71
+ let l : V := ⟨w.leftPoint,w.left_mem⟩
72
+ let r : V := ⟨w.rightPoint,w.right_mem⟩
73
+ have hboundary : ∀ x ∈ V, x ∈ closure E.val ↔ x = w.leftPoint ∨ x = w.rightPoint := by
74
+ intro x hxV
75
+ have hn : x ∉ E.val := fun h => disjoint_left.mp hdis h hxV
76
+ have h := w.frontier_eq
77
+ constructor
78
+ · intro hx
79
+ have hb : x ∈ closure E.val \ E.val := ⟨hx,hn⟩
80
+ rw [h] at hb
81
+ simpa only [mem_insert_iff,mem_singleton_iff] using hb
82
+ · intro hx
83
+ have hb : x ∈ closure E.val \ E.val := by
84
+ rw [h]
85
+ simpa only [mem_insert_iff,mem_singleton_iff] using hx
86
+ exact hb.1
87
+ apply graph_degree_two (curveIncidenceGraph V P) (Sum.inr E) (Sum.inl l) (Sum.inl r)
88
+ · intro he
89
+ exact w.endpoints_ne (congrArg (fun z : V => z.val) (Sum.inl.inj he))
90
+ · exact (hboundary _ w.left_mem).mpr (Or.inl rfl)
91
+ · exact (hboundary _ w.right_mem).mpr (Or.inr rfl)
92
+ · rintro (v|F) hv
93
+ · rcases (hboundary _ v.property).mp hv with he | he
94
+ · exact Or.inl (congrArg Sum.inl (Subtype.ext he))
95
+ · exact Or.inr (congrArg Sum.inl (Subtype.ext he))
96
+ · exact False.elim hv
97
+
98
+ end ClosedSurfaceR4.FiniteOrderSmoothing
99
+
100
+ end
101
+
102
+ end OAI
lean/OAI/Geometry/SurfaceImmersion/Geometry/CurveNormalFrame.lean ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Geometry.SurfaceImmersion.Geometry.CurveTransverseVector
2
+
3
+ namespace OAI
4
+
5
+ /-! An explicit invertible three-dimensional frame along a regular curve. -/
6
+ noncomputable section
7
+ open Set Matrix
8
+ open scoped ContDiff Topology
9
+ namespace ClosedSurfaceR4.FiniteOrderSmoothing
10
+ open JetPolynomial (Base)
11
+
12
+ def curveNormalLinear (v a : Fin 3 → ℝ) : (Base × ℝ) →L[ℝ] (Fin 3 → ℝ) :=
13
+ (ContinuousLinearMap.snd ℝ Base ℝ).smulRight v +
14
+ ((ContinuousLinearMap.proj (0 : Fin 2)).comp (ContinuousLinearMap.fst ℝ Base ℝ)).smulRight a +
15
+ ((ContinuousLinearMap.proj (1 : Fin 2)).comp (ContinuousLinearMap.fst ℝ Base ℝ)).smulRight (v ⨯₃ a)
16
+
17
+ lemma curveNormalLinear_apply (v a : Fin 3 → ℝ) (z : Base × ℝ) :
18
+ curveNormalLinear v a z = z.2 • v+z.1 0 • a+z.1 1 • (v ⨯₃ a) := rfl
19
+
20
+ lemma curveNormalLinear_bijective {v a : Fin 3 → ℝ}
21
+ (hv : v ≠ 0) (ha : ∀ r : ℝ, r • v ≠ a) :
22
+ Function.Bijective (curveNormalLinear v a) := by
23
+ have hli := curve_transverse_vector_independent hv ha
24
+ have hw := curve_transverse_cross_ne_zero hv ha
25
+ have hwv : (v ⨯₃ a) ⬝ᵥ v = 0 := by rw [dotProduct_comm]; exact dot_self_cross v a
26
+ have hwa : (v ⨯₃ a) ⬝ᵥ a = 0 := by rw [dotProduct_comm]; exact dot_cross_self v a
27
+ have hww : (v ⨯₃ a) ⬝ᵥ (v ⨯₃ a) ≠ 0 := (dotProduct_self_eq_zero).not.mpr hw
28
+ have hz : ∀ z : Base × ℝ, curveNormalLinear v a z = 0 → z = 0 := by
29
+ intro z h
30
+ have hd := congrArg (fun w => (v ⨯₃ a) ⬝ᵥ w) h
31
+ rw [curveNormalLinear_apply] at hd
32
+ simp only [dotProduct_add,dotProduct_smul,hwv,hwa,smul_eq_mul,mul_zero,zero_add,dotProduct_zero] at hd
33
+ have hz1 : z.1 1 = 0 := (mul_eq_zero.mp hd).resolve_right hww
34
+ have hsum : z.2 • v+z.1 0 • a = 0 := by
35
+ simpa only [curveNormalLinear_apply,hz1,zero_smul,add_zero] using h
36
+ obtain ⟨hz2,hz0⟩ := (LinearIndependent.pair_iff.mp hli) z.2 (z.1 0) hsum
37
+ apply Prod.ext
38
+ · ext i
39
+ fin_cases i
40
+ · exact hz0
41
+ · exact hz1
42
+ · exact hz2
43
+ have hi : Function.Injective (curveNormalLinear v a) := by
44
+ intro z w h
45
+ apply sub_eq_zero.mp
46
+ apply hz
47
+ rw [map_sub,h,sub_self]
48
+ refine ⟨hi,?_⟩
49
+ apply (LinearMap.injective_iff_surjective_of_finrank_eq_finrank
50
+ (f := (curveNormalLinear v a).toLinearMap) _).mp hi
51
+ simp [Base]
52
+
53
+ end ClosedSurfaceR4.FiniteOrderSmoothing
54
+
55
+ end
56
+
57
+ end OAI
lean/OAI/Geometry/SurfaceImmersion/Geometry/CurveSecondFields.lean ADDED
@@ -0,0 +1,122 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Geometry.SurfaceImmersion.Atlas.PhaseMetricPositive
2
+ import OAI.Geometry.SurfaceImmersion.Atlas.PhaseMetricRegularity
3
+ import OAI.Geometry.SurfaceImmersion.Correction.CompactSmoothCutoffs
4
+ import OAI.Geometry.SurfaceImmersion.Atlas.PhaseDiskNormalGluing
5
+
6
+ namespace OAI
7
+
8
+ /-! Smooth global representatives of second-form fields along a compact curve.
9
+ A cutoff in its own phase chart extends the field without choosing a normal frame. -/
10
+ noncomputable section
11
+ open Set Filter Manifold
12
+ open scoped ContDiff Topology
13
+ namespace ClosedSurfaceR4.RealModes
14
+ open SmallModes NormalFrame
15
+
16
+ lemma realSecondForm_field_smoothAt {F : RField 4} {v w : Base → Base}
17
+ (hF : ContDiff ℝ ∞ F) (hv : ContDiff ℝ ∞ v) (hw : ContDiff ℝ ∞ w)
18
+ {p : Base} (hD : gramDet (coordDeriv dx F p) (coordDeriv dy F p) ≠ 0) :
19
+ ContDiffAt ℝ ∞ (fun q => realSecondForm F (v q) (w q) q) p := by
20
+ have hDF := hF.fderiv_right (m := ∞) (by simp)
21
+ have hDDF := hDF.fderiv_right (m := ∞) (by simp)
22
+ have heq : (fun q => realSecondForm F (v q) (w q) q) =
23
+ fun q => realNormalPart (coordDeriv dx F q) (coordDeriv dy F q)
24
+ (fderiv ℝ (fderiv ℝ F) q (v q) (w q)) := by
25
+ funext q
26
+ unfold realSecondForm
27
+ rw [real_second_coordDeriv ((hDF.differentiable (by simp)) q)]
28
+ rw [heq]
29
+ exact contDiffAt_realNormalPart (contDiff_real_coordDeriv hF dx).contDiffAt
30
+ (contDiff_real_coordDeriv hF dy).contDiffAt
31
+ ((hDDF.clm_apply hv).clm_apply hw).contDiffAt hD
32
+
33
+ end ClosedSurfaceR4.RealModes
34
+ namespace ClosedSurfaceR4.FiniteOrderSmoothing
35
+ open RealModes SmallModes NormalFrame SurfaceJetCoordinates
36
+ variable {M : Type*} [TopologicalSpace M] [ChartedSpace Plane M]
37
+ [IsManifold planeModel ∞ M] [CompactSpace M]
38
+ namespace SmoothingAtlas
39
+ variable (A : SmoothingAtlas M)
40
+
41
+ lemma phase_gram_ne_zero (i : A.centers)
42
+ (e : OpenPartialHomeomorph JetPolynomial.Base JetPolynomial.Base)
43
+ (he : ContDiff ℝ ∞ e) (hi : ContDiff ℝ ∞ e.symm)
44
+ {g : SmoothMetric M} {F : M → Space} (hF : IsSmoothIsometricImmersion M g F)
45
+ {p : SmallModes.Base} (hp : baseEquiv.symm p ∈ e.target)
46
+ (ha : A.chartWeight i (e.symm (baseEquiv.symm p)) ≠ 0) :
47
+ gramDet (coordDeriv dx (A.phaseRealChartMap i e.symm F) p)
48
+ (coordDeriv dy (A.phaseRealChartMap i e.symm F) p) ≠ 0 := by
49
+ rw [A.phaseMetricRead_isometry_det i hi hF ha]
50
+ have hh := (A.phaseMetricRead_positive i g e he hi hp ha).2.ne'
51
+ simpa only [baseEquiv.apply_symm_apply] using hh
52
+
53
+ /-- This cutoff is selected from the curve and phase chart before selecting
54
+ any later isometric immersion. -/
55
+ lemma phase_curve_cutoff (i : A.centers)
56
+ (e : OpenPartialHomeomorph JetPolynomial.Base JetPolynomial.Base)
57
+ (hi : ContDiff ℝ ∞ e.symm)
58
+ {K : Set SmallModes.Base} (hK : IsCompact K)
59
+ (hKt : ∀ p ∈ K, baseEquiv.symm p ∈ e.target)
60
+ (hKa : ∀ p ∈ K, A.chartWeight i (e.symm (baseEquiv.symm p)) ≠ 0) :
61
+ ∃ β : SmallModes.Base → ℝ, ContDiff ℝ ∞ β ∧ HasCompactSupport β ∧
62
+ (∀ p ∈ K, β p = 1) ∧ ∀ p ∈ tsupport β,
63
+ baseEquiv.symm p ∈ e.target ∧ A.chartWeight i (e.symm (baseEquiv.symm p)) ≠ 0 := by
64
+ let U : Set SmallModes.Base := baseEquiv.symm ⁻¹' e.target ∩
65
+ {p | A.chartWeight i (e.symm (baseEquiv.symm p)) ≠ 0}
66
+ have hU : IsOpen U := (e.open_target.preimage baseEquiv.symm.continuous).inter
67
+ (isOpen_ne.preimage ((A.chartWeight_smooth i).continuous.comp
68
+ (hi.continuous.comp baseEquiv.symm.continuous)))
69
+ obtain ⟨β,hβ,hβc,_,hβs,hβone⟩ := CollarVelocity.compact_cutoff hK hU
70
+ (fun p hp => ⟨hKt p hp,hKa p hp⟩)
71
+ exact ⟨β,hβ,hβc,hβone,fun p hp => hβs hp⟩
72
+
73
+ def phaseCurveSecondField (i : A.centers)
74
+ (e : OpenPartialHomeomorph JetPolynomial.Base JetPolynomial.Base)
75
+ (β : SmallModes.Base → ℝ) (F : M → Space) (v w : SmallModes.Base → SmallModes.Base) : M → Space :=
76
+ restore (i : M) (A.outer i) (fun x => spaceCoordinates.symm
77
+ (β (baseEquiv (e x)) • realSecondForm (A.phaseRealChartMap i e.symm F)
78
+ (v (baseEquiv (e x))) (w (baseEquiv (e x))) (baseEquiv (e x))))
79
+
80
+ lemma phaseCurveSecondField_smooth (i : A.centers)
81
+ (e : OpenPartialHomeomorph JetPolynomial.Base JetPolynomial.Base)
82
+ (he : ContDiff ℝ ∞ e) (hi : ContDiff ℝ ∞ e.symm)
83
+ {g : SmoothMetric M} {F : M → Space} (hF : IsSmoothIsometricImmersion M g F)
84
+ {β : SmallModes.Base → ℝ} (hβ : ContDiff ℝ ∞ β)
85
+ (hs : ∀ p ∈ tsupport β, baseEquiv.symm p ∈ e.target ∧
86
+ A.chartWeight i (e.symm (baseEquiv.symm p)) ≠ 0)
87
+ {v w : SmallModes.Base → SmallModes.Base} (hv : ContDiff ℝ ∞ v) (hw : ContDiff ℝ ∞ w) :
88
+ ContMDiff planeModel spaceModel ∞ (A.phaseCurveSecondField i e β F v w) := by
89
+ have hB : ContDiff ℝ ∞ (fun p => β p •
90
+ realSecondForm (A.phaseRealChartMap i e.symm F) (v p) (w p) p) := by
91
+ rw [contDiff_iff_contDiffAt]
92
+ intro p
93
+ by_cases hp : p ∈ tsupport β
94
+ · exact hβ.contDiffAt.smul (realSecondForm_field_smoothAt
95
+ (A.phaseRealChartMap_smooth i hi hF.1) hv hw (A.phase_gram_ne_zero i e he hi hF
96
+ (hs p hp).1 (hs p hp).2))
97
+ · apply (contDiffAt_const (c := (0 : Vec))).congr_of_eventuallyEq
98
+ filter_upwards [notMem_tsupport_iff_eventuallyEq.mp hp] with q hq
99
+ simp only [Pi.zero_apply] at hq
100
+ simp only [hq,zero_smul]
101
+ exact restore_smooth (i : M) (A.outer_smooth i) (A.outer_support i)
102
+ (spaceCoordinates.symm.contDiff.comp (hB.comp (baseEquiv.contDiff.comp he)))
103
+
104
+ omit [CompactSpace M] in
105
+ lemma phaseCurveSecondField_eq (i : A.centers)
106
+ (e : OpenPartialHomeomorph JetPolynomial.Base JetPolynomial.Base)
107
+ (β : SmallModes.Base → ℝ) (F : M → Space) (v w : SmallModes.Base → SmallModes.Base)
108
+ {p : M} (hp : p ∈ (chart (i : M)).source) (ho : A.outer i p = 1)
109
+ (hβ : β (baseEquiv (e (chart (i : M) p))) = 1) :
110
+ spaceCoordinates (A.phaseCurveSecondField i e β F v w p) =
111
+ realSecondForm (A.phaseRealChartMap i e.symm F)
112
+ (v (baseEquiv (e (chart (i : M) p)))) (w (baseEquiv (e (chart (i : M) p))))
113
+ (baseEquiv (e (chart (i : M) p))) := by
114
+ simp only [phaseCurveSecondField,restore,indicator_of_mem hp,ho,hβ,one_smul,
115
+ spaceCoordinates.apply_symm_apply]
116
+
117
+ end SmoothingAtlas
118
+ end ClosedSurfaceR4.FiniteOrderSmoothing
119
+
120
+ end
121
+
122
+ end OAI
lean/OAI/Geometry/SurfaceImmersion/Geometry/CurveSecondTransition.lean ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Geometry.SurfaceImmersion.Atlas.PhaseTransitionVectors
2
+
3
+ namespace OAI
4
+
5
+ /-! A curve's global second-form representative agrees with its transported
6
+ second form in the current primitive chart. -/
7
+ noncomputable section
8
+ open Set Filter Manifold
9
+ open scoped ContDiff Topology
10
+ namespace ClosedSurfaceR4.FiniteOrderSmoothing
11
+ open SmallModes RealModes SurfaceJetCoordinates
12
+ variable {M : Type*} [TopologicalSpace M] [ChartedSpace Plane M]
13
+ [IsManifold planeModel ∞ M] [CompactSpace M]
14
+ namespace SmoothingAtlas
15
+
16
+ lemma curveSecondField_transition (A B : SmoothingAtlas M)
17
+ (i : A.centers) (j : B.centers)
18
+ (e f : OpenPartialHomeomorph JetPolynomial.Base JetPolynomial.Base)
19
+ (he : ContDiff ℝ ∞ e) (hi : ContDiff ℝ ∞ e.symm)
20
+ (hf : ContDiff ℝ ∞ f) (hfi : ContDiff ℝ ∞ f.symm)
21
+ {g : SmoothMetric M} {F : M → Space} (hF : IsSmoothIsometricImmersion M g F)
22
+ (β : SmallModes.Base → ℝ)
23
+ {x : SmallModes.Base} (hx : x ∈ (surfacePhaseTransition (j : M) f (i : M) e).source)
24
+ (hwB : B.weight j ((surfacePhaseChart (j : M) f).symm x) ≠ 0)
25
+ (hwA : A.weight i ((surfacePhaseChart (j : M) f).symm x) ≠ 0)
26
+ (hβ : β x = 1) :
27
+ let T := surfacePhaseTransition (j : M) f (i : M) e
28
+ spaceCoordinates (B.phaseCurveSecondField j f β F (fun _ => dy) (fun _ => dy)
29
+ ((surfacePhaseChart (j : M) f).symm x)) =
30
+ realSecondForm (A.phaseRealChartMap i e.symm F)
31
+ (fderiv ℝ T x dy) (fderiv ℝ T x dy) (T x) := by
32
+ have hxj : x ∈ (surfacePhaseChart (j : M) f).target := hx.1
33
+ have hp := (surfacePhaseChart (j : M) f).map_target hxj
34
+ have hread := B.phaseCurveSecondField_eq j f β F (fun _ => dy) (fun _ => dy)
35
+ hp.1 (B.outer_one j _ (subset_tsupport (B.weight j) hwB)) (by
36
+ change β ((surfacePhaseChart (j : M) f) ((surfacePhaseChart (j : M) f).symm x)) = 1
37
+ rwa [(surfacePhaseChart (j : M) f).right_inv hxj])
38
+ have hr : baseEquiv (f (chart (j : M) ((surfacePhaseChart (j : M) f).symm x))) = x :=
39
+ (surfacePhaseChart (j : M) f).right_inv hxj
40
+ simp only [hr] at hread
41
+ rw [hread]
42
+ exact B.phase_secondForm_transition A j i f e hf hfi he hi hF hx hwB hwA dy dy
43
+
44
+ end SmoothingAtlas
45
+ end ClosedSurfaceR4.FiniteOrderSmoothing
46
+
47
+ end
48
+
49
+ end OAI
lean/OAI/Geometry/SurfaceImmersion/Geometry/CurveTransverseVector.lean ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Geometry.SurfaceImmersion.Geometry.EuclideanSurfaceImageNull
2
+ import Mathlib.LinearAlgebra.CrossProduct
3
+
4
+ namespace OAI
5
+
6
+ /-! A smooth curve in three-space admits one constant vector transverse
7
+ to every nonzero velocity. This uses the proved two-dimensional image estimate. -/
8
+ noncomputable section
9
+ open Set Filter MeasureTheory Matrix
10
+ open scoped ContDiff Topology
11
+ namespace ClosedSurfaceR4.FiniteOrderSmoothing
12
+ open JetPolynomial (Base)
13
+
14
+ theorem exists_curve_transverse_vector (v : ℝ → (Fin 3 → ℝ))
15
+ (hv : ContDiff ℝ ∞ v) :
16
+ ∃ a : Fin 3 → ℝ, ∀ t r : ℝ, r • v t ≠ a := by
17
+ let E := EuclideanSpace.equiv (Fin 3) ℝ
18
+ let f : Base → ProjectionTarget 3 := fun x => E.symm (x 0 • v (x 1))
19
+ have hf : ContDiff ℝ ∞ f :=
20
+ E.symm.contDiff.comp ((contDiff_apply ℝ ℝ 0).smul (hv.comp (contDiff_apply ℝ ℝ 1)))
21
+ have hn : volume (range f) = 0 := euclidean_surface_image_null f hf
22
+ have hae : ∀ᵐ x ∂volume, x ∉ range f := by
23
+ simp only [ae_iff,not_not]
24
+ exact hn
25
+ obtain ⟨a,_,ha⟩ := (Measure.dense_of_ae hae).inter_open_nonempty
26
+ univ isOpen_univ Set.univ_nonempty
27
+ refine ⟨E a,?_⟩
28
+ intro t r heq
29
+ apply ha
30
+ refine ⟨![r,t],?_⟩
31
+ change E.symm (r • v t) = a
32
+ rw [heq,E.symm_apply_apply]
33
+
34
+ lemma curve_transverse_vector_independent {v a : Fin 3 → ℝ}
35
+ (hv : v ≠ 0) (ha : ∀ r : ℝ, r • v ≠ a) : LinearIndependent ℝ ![v,a] :=
36
+ (LinearIndependent.pair_iff' hv).mpr ha
37
+
38
+ lemma curve_transverse_cross_ne_zero {v a : Fin 3 → ℝ}
39
+ (hv : v ≠ 0) (ha : ∀ r : ℝ, r • v ≠ a) : v ⨯₃ a ≠ 0 :=
40
+ crossProduct_ne_zero_iff_linearIndependent.mpr (curve_transverse_vector_independent hv ha)
41
+
42
+ end ClosedSurfaceR4.FiniteOrderSmoothing
43
+
44
+ end
45
+
46
+ end OAI
lean/OAI/Geometry/SurfaceImmersion/Geometry/CycleCorrectedGeometry.lean ADDED
@@ -0,0 +1,341 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Geometry.SurfaceImmersion.Geometry.ReferenceCorrectedFamily
2
+ import OAI.Geometry.SurfaceImmersion.Primitive.CircularCycleMetrics
3
+ import OAI.Geometry.SurfaceImmersion.Geometry.IndependentRadiusBox
4
+ import OAI.Geometry.SurfaceImmersion.Primitive.PreparedCircularFamilyGeometry
5
+
6
+ namespace OAI
7
+
8
+ /-! Reference charts give the generic finite geometry for any number of
9
+ cycles without shrinking the admissible chart radii after that number is
10
+ chosen. The actual corrected families are then attached to those circles. -/
11
+ noncomputable section
12
+ open Set Filter Manifold Bundle
13
+ open scoped ContDiff Topology BigOperators
14
+ namespace ClosedSurfaceR4.FiniteOrderSmoothing
15
+ open SmallModes PhaseGeometry SurfaceJetCoordinates
16
+ variable {M : Type*} [TopologicalSpace M] [ChartedSpace Plane M]
17
+ [IsManifold planeModel ∞ M] [CompactSpace M] [T2Space M]
18
+ local instance cycleGeometryFiberNormed : NormedAddCommGroup TensorFiber := inferInstance
19
+ local instance cycleGeometryFiberSpace : NormedSpace ℝ TensorFiber := inferInstance
20
+ local instance cycleGeometryDualAdd : ∀ p : M, ContinuousAdd (TangentSpace planeModel p →L[ℝ] ℝ) := fun _ => inferInstance
21
+ local instance cycleGeometryDualSmul : ∀ p : M, ContinuousSMul ℝ (TangentSpace planeModel p →L[ℝ] ℝ) := fun _ => inferInstance
22
+ local instance cycleGeometrySectionNormed (p : M) : NormedAddCommGroup (CovariantTwoTensor p) :=
23
+ inferInstanceAs (NormedAddCommGroup TensorFiber)
24
+ local instance cycleGeometrySectionSpace (p : M) : NormedSpace ℝ (CovariantTwoTensor p) :=
25
+ inferInstanceAs (NormedSpace ℝ TensorFiber)
26
+ namespace ReferenceCircularAtlas
27
+ variable {A : SmoothingAtlas M} {gref g : SmoothMetric M} {c C : ℝ}
28
+ (d : ReferenceCircularAtlas A gref g c C)
29
+
30
+ /-- Use the already selected full-disk reference charts, for arbitrarily many
31
+ copies, rather than choosing a new admissible radius after the copy count. -/
32
+ theorem finite_copy_geometry {ι : Type*} [Fintype ι] [DecidableEq ι]
33
+ (index : ι → d.B.centers) (component : ι → Fin 3)
34
+ (lo hi : ι → ℝ) (hlo : ∀ a, 0 < lo a) (hlohi : ∀ a, lo a < hi a)
35
+ (hhi : ∀ a, hi a < d.radius (index a))
36
+ {eta : ℝ} (heta : 0 < eta) :
37
+ ∃ q : CircularFamilyGeometry d.B ι,
38
+ (∀ a, lo a < q.radius a ∧ q.radius a < hi a) ∧
39
+ (∀ a, (q.curves a).index = index a) ∧
40
+ (∀ a, q.outerRadius a = d.radius (index a)) ∧
41
+ (∀ a, q.chartRadius a = d.radius (index a)) ∧
42
+ (∀ a, q.convexPart a = d.L (index a)) ∧
43
+ (∀ a, ‖q.linearPart a-(d.P (index a)).ξ (component a)‖ < eta) ∧
44
+ ∀ a, q.linearPart a ∈ Metric.closedBall ((d.P (index a)).ξ (component a))
45
+ (d.epsilon (index a)) := by
46
+ classical
47
+ let eps : ι → ℝ := fun a => min eta (d.epsilon (index a))
48
+ let U : Set (ι → Base) := {ell | ∀ a, ‖ell a-(d.P (index a)).ξ (component a)‖ < eps a}
49
+ have hU : IsOpen U := by
50
+ simp only [U,ofPred_forall]
51
+ apply isOpen_iInter_of_finite
52
+ intro a
53
+ exact isOpen_lt (((continuous_apply a).sub continuous_const).norm) continuous_const
54
+ have hne : U.Nonempty := by
55
+ refine ⟨fun a => (d.P (index a)).ξ (component a),?_⟩
56
+ intro a
57
+ simpa only [sub_self,norm_zero] using lt_min heta (d.epsilon_pos (index a))
58
+ obtain ⟨r,ell,hell,hr,hcross,htriple,htrans,htangent,hind⟩ :=
59
+ d.B.finite_circular_preparation index (fun a => d.radius (index a)) lo hi
60
+ (fun a => d.L (index a)) hlo hlohi hhi
61
+ (fun a => d.weight_positive (index a)) (fun a => d.region (index a)) U hU hne
62
+ have hball (a : ι) : ell a ∈ Metric.closedBall ((d.P (index a)).ξ (component a))
63
+ (d.epsilon (index a)) := by
64
+ rw [Metric.mem_closedBall,dist_eq_norm]
65
+ exact ((hell a).trans_le (min_le_right _ _)).le
66
+ choose e he hei hephase hecover using fun a => d.charts (index a) (component a) (ell a) (hball a)
67
+ have hrpos (a : ι) : 0 < r a := (hlo a).trans (hr a).1
68
+ have hrr (a : ι) : r a < d.radius (index a) := (hr a).2.trans (hhi a)
69
+ have hrreg (a : ι) : circularCoordinateRegion (index a : M) (r a) ⊆
70
+ (coordinateChart (index a : M)).target := by
71
+ intro x hx
72
+ change circularRadiusSquared (coordinateChart (index a : M) (index a)) x ≤ (r a)^2 at hx
73
+ exact d.region (index a) (hx.trans (by nlinarith [hrpos a,hrr a]))
74
+ have hcover (a : ι) : ∀ x ∈ circularCoordinateRegion (index a : M) (r a),
75
+ baseEquiv.symm x ∈ (e a).source := by
76
+ intro x hx
77
+ apply hecover a x
78
+ change circularRadiusSquared (coordinateChart (index a : M) (index a)) x ≤ (r a)^2 at hx
79
+ change circularRadiusSquared (coordinateChart (index a : M) (index a)) x ≤ (d.radius (index a))^2
80
+ exact hx.trans (by nlinarith [hrpos a,hrr a])
81
+ let curves : ι → PhaseBoundaryCurve d.B := fun a =>
82
+ d.B.circularPhaseBoundaryCurve (index a) (hrpos a) (by nlinarith [hrpos a,hrr a])
83
+ (d.weight_positive (index a)) (hrreg a) (e a) (he a) (hei a) (hcover a)
84
+ have hcarrier (a : ι) : (curves a).carrier = circularBoundary (index a : M) (r a) := rfl
85
+ have hsub : boundaryCrossingSet curves univ ⊆ circularCrossingSet (fun a => (index a : M)) r := by
86
+ rintro p ⟨a,_,b,_,hab,hpa,hpb⟩
87
+ exact mem_iUnion.mpr ⟨⟨(a,b),hab⟩,⟨hpa,hpb⟩⟩
88
+ let q : CircularFamilyGeometry d.B ι := {
89
+ curves := curves, radius := r, outerRadius := fun a => d.radius (index a),
90
+ chartRadius := fun a => d.radius (index a), linearPart := ell, convexPart := fun a => d.L (index a),
91
+ radius_pos := hrpos, radius_outer := fun a => by nlinarith [hrpos a,hrr a],
92
+ radius_chart := hrr, weight_positive := fun a => d.weight_positive (index a),
93
+ region := hrreg, carrier := hcarrier, cover := hcover, first_coordinate := hephase,
94
+ pair_finite := fun a b hab => hcross.subset (fun _ hp => hsub
95
+ (boundaryCrossingSet_pair curves (mem_univ a) (mem_univ b) hab hp.1 hp.2)),
96
+ triple_empty := htriple, tangencies_finite := htangent,
97
+ independent := fun a b hab p hp hpa hpb => hind a b hab p (hsub hp) hpa hpb }
98
+ exact ⟨q,hr,(fun _ => rfl),(fun _ => rfl),(fun _ => rfl),(fun _ => rfl),
99
+ (fun a => (hell a).trans_le (min_le_left _ _)),hball⟩
100
+
101
+ end ReferenceCircularAtlas
102
+
103
+ namespace SmoothPrimitiveFamily
104
+ variable {u : ∀ p : M, CovariantTwoTensor p} {ι κ : Type*} [Fintype ι] [Fintype κ]
105
+
106
+ /-- Reindex only the genuine finite family, preserving its exact sum. -/
107
+ def reindex (f : SmoothPrimitiveFamily ι u) (e : κ ≃ ι) : SmoothPrimitiveFamily κ u where
108
+ amplitude := f.amplitude ∘ e
109
+ phase := f.phase ∘ e
110
+ smoothAmplitude a := f.smoothAmplitude (e a)
111
+ smoothPhase a := f.smoothPhase (e a)
112
+ sum_eq p := by
113
+ simpa only [Function.comp_apply] using
114
+ (e.sum_comp (fun a => (f.amplitude a p)^2 •
115
+ SmoothingAtlas.phaseDifferentialSquare (f.phase a) p)).trans (f.sum_eq p)
116
+
117
+ end SmoothPrimitiveFamily
118
+
119
+ namespace CircularFamilyGeometry
120
+ variable {B : SmoothingAtlas M} {ι : Type*} [Fintype ι]
121
+
122
+ /-- The actual restored phase, allowing repeated copies of a chart. -/
123
+ def copiedPhases (q : CircularFamilyGeometry B ι) (a : ι) : M → ℝ :=
124
+ B.circularPhase (q.curves a).index (q.linearPart a) (q.convexPart a)
125
+
126
+ omit [CompactSpace M] [T2Space M] in
127
+ lemma copiedPhases_germ (q : CircularFamilyGeometry B ι)
128
+ (houter : ∀ i p, p ∈ tsupport (B.weight i) → B.outer i =ᶠ[𝓝 p] (fun _ => 1))
129
+ (a : ι) {p : M}
130
+ (hp : p ∈ circularCoordinateDisk ((q.curves a).index : M) (q.radius a)) :
131
+ q.copiedPhases a =ᶠ[𝓝 p]
132
+ (fun x => ((q.curves a).phase (chart ((q.curves a).index : M) x)) 0) := by
133
+ have hw : B.weight (q.curves a).index p ≠ 0 := by
134
+ apply ne_of_gt ((q.weight_positive a p).mpr ?_)
135
+ exact ⟨hp.1,hp.2.trans (q.radius_outer a)⟩
136
+ let loc : B.centers → Fin 3 → Base → ℝ := fun i _ =>
137
+ centeredConvexPhase (q.linearPart a) (q.convexPart a) (coordinateChart (i : M) i)
138
+ have hg := B.curvedAtlasPhase_eventually loc ((q.curves a).index,0)
139
+ (houter (q.curves a).index) (subset_tsupport _ hw)
140
+ change q.copiedPhases a =ᶠ[𝓝 p]
141
+ (centeredConvexPhase (q.linearPart a) (q.convexPart a)
142
+ (coordinateChart ((q.curves a).index : M) (q.curves a).index) ∘
143
+ coordinateChart ((q.curves a).index : M)) at hg
144
+ apply hg.trans
145
+ apply Filter.Eventually.of_forall
146
+ intro x
147
+ have hh := q.first_coordinate a (chart ((q.curves a).index : M) x)
148
+ change ((q.curves a).phase (chart ((q.curves a).index : M) x)) 0 = _ at hh
149
+ exact hh.symm
150
+
151
+ omit [CompactSpace M] [T2Space M] in
152
+ /-- Attach cycle amplitudes without changing any selected generic geometry. -/
153
+ theorem with_cycle_families {N m : ℕ} (q : CircularFamilyGeometry B (Fin (N*m)))
154
+ {u : ∀ p : M, CovariantTwoTensor p}
155
+ (f : Fin N → SmoothPrimitiveFamily (Fin m) u) (hN : 0 < N)
156
+ (hamp : ∀ k a p, 0 ≤ (f k).amplitude a p)
157
+ (hpos : ∀ a p, 0 < (f a.divNat).amplitude a.modNat p ↔
158
+ p ∈ circularCoordinateDisk ((q.curves a).index : M) (q.radius a))
159
+ (hphase : ∀ a, (f a.divNat).phase a.modNat = q.copiedPhases a)
160
+ (houter : ∀ i p, p ∈ tsupport (B.weight i) → B.outer i =ᶠ[𝓝 p] (fun _ => 1)) :
161
+ ∃ D : CircularPrimitiveFamily B (Fin (N*m)),
162
+ D.curves = q.curves ∧ D.radius = q.radius ∧ D.outerRadius = q.outerRadius ∧
163
+ D.chartRadius = q.chartRadius ∧ D.linearPart = q.linearPart ∧ D.convexPart = q.convexPart ∧
164
+ (∀ a p, D.amplitude a p = (f a.divNat).cycleAmplitude N a.modNat p) ∧
165
+ (∀ a, D.phase a = (f a.divNat).phase a.modNat) ∧ D.totalTensor = u := by
166
+ let amp := fun a : Fin (N*m) => (f a.divNat).cycleAmplitude N a.modNat
167
+ let phi := fun a : Fin (N*m) => (f a.divNat).phase a.modNat
168
+ have ha : ∀ a, ContMDiff planeModel 𝓘(ℝ) ∞ (amp a) :=
169
+ fun a => (f a.divNat).cycleAmplitude_smooth N a.modNat
170
+ have hp : ∀ a, ContMDiff planeModel 𝓘(ℝ) ∞ (phi a) :=
171
+ fun a => (f a.divNat).smoothPhase a.modNat
172
+ have hn : ∀ a p, 0 ≤ amp a p := fun a p =>
173
+ div_nonneg (hamp _ _ _) (Real.sqrt_nonneg _)
174
+ have hpos' : ∀ a p, 0 < amp a p ↔
175
+ p ∈ circularCoordinateDisk ((q.curves a).index : M) (q.radius a) := by
176
+ intro a p
177
+ exact ((f a.divNat).cycleAmplitude_pos_iff hN a.modNat p).trans (hpos a p)
178
+ have hg : ∀ a p, p ∈ circularCoordinateDisk ((q.curves a).index : M) (q.radius a) →
179
+ phi a =ᶠ[𝓝 p] (fun x => ((q.curves a).phase (chart ((q.curves a).index : M) x)) 0) := by
180
+ intro a p hpa
181
+ change (f a.divNat).phase a.modNat =ᶠ[𝓝 p] _
182
+ rw [hphase a]
183
+ exact q.copiedPhases_germ houter a hpa
184
+ let D := q.withAmplitudes amp phi ha hp hn hpos' hg
185
+ refine ⟨D,rfl,rfl,rfl,rfl,rfl,rfl,(fun _ _ => rfl),(fun _ => rfl),?_⟩
186
+ exact D.totalTensor_cycle f (fun _ _ => rfl) (fun _ => rfl) hN
187
+
188
+ end CircularFamilyGeometry
189
+
190
+ namespace ReferenceCircularAtlas
191
+ variable {A : SmoothingAtlas M} {gref g : SmoothMetric M} {c C : ℝ}
192
+ (d : ReferenceCircularAtlas A gref g c C)
193
+
194
+ def cycleLinearParts {N m : ℕ} (e : Fin m ≃ (d.B.centers × Fin 3))
195
+ (q : CircularFamilyGeometry d.B (Fin (N*m))) (k : Fin N) (i : d.B.centers) (j : Fin 3) : Base :=
196
+ q.linearPart (finProdFinEquiv (k,e.symm (i,j)))
197
+
198
+ def cycleWeights {N m : ℕ} (e : Fin m ≃ (d.B.centers × Fin 3))
199
+ (q : CircularFamilyGeometry d.B (Fin (N*m))) (k : Fin N) (b : d.B.centers × Fin 3) : M → ℝ :=
200
+ shrinkingCircularWeight (b.1 : M) (d.B.weight b.1) (d.radius b.1)
201
+ (q.radius (finProdFinEquiv (k,e.symm b)))
202
+
203
+ /-- One radius box and map neighborhood precede every cycle count. The
204
+ output retains the actual amplitude formula and fixed cutoff bounds, so
205
+ the uniform C1 estimate can be applied without choosing further constants. -/
206
+ theorem corrected_cycles {F : M → Space}
207
+ (hF : ContMDiff planeModel spaceModel ∞ F) (r : ℝ)
208
+ (href : gref.inner = g.inner-inducedTensor (r • F))
209
+ {phaseBound weightBound mapBound : ℝ}
210
+ (hphaseBound : 0 < phaseBound) (hweightBound : 0 < weightBound)
211
+ (hmapBound : 0 < mapBound)
212
+ {m : ℕ} (e : Fin m ≃ (d.B.centers × Fin 3)) :
213
+ ∃ (mapTol delta : ℝ) (W : ℕ → ℝ),
214
+ 0 < mapTol ∧ mapTol ≤ mapBound ∧ 0 < delta ∧
215
+ (∀ i, delta ≤ d.radius i/2) ∧ (∀ j, 0 ≤ W j) ∧
216
+ ∀ N : ℕ, 0 < N →
217
+ ∃ q : CircularFamilyGeometry d.B (Fin (N*m)),
218
+ (∀ a, (q.curves a).index = (e a.modNat).1) ∧
219
+ (∀ a, q.outerRadius a = d.radius (e a.modNat).1) ∧
220
+ (∀ a, q.chartRadius a = d.radius (e a.modNat).1) ∧
221
+ (∀ a, q.convexPart a = d.L (e a.modNat).1) ∧
222
+ (∀ a, ‖q.linearPart a‖ ≤ ‖(d.P (e a.modNat).1).ξ‖+1) ∧
223
+ (∀ a, ‖q.linearPart a-(d.P (e a.modNat).1).ξ (e a.modNat).2‖ < phaseBound) ∧
224
+ (∀ k b j, d.B.WeightedBound 1 j (W j) (d.cycleWeights e q k b)) ∧
225
+ (∀ k b p, |d.cycleWeights e q k b p-d.B.weight b.1 p| < weightBound) ∧
226
+ ∀ G : M → Space, ContMDiff planeModel spaceModel ∞ G →
227
+ A.WeightedBound 1 1 mapTol (G-F) →
228
+ ∃ (f : Fin N → SmoothPrimitiveFamily (Fin m) (g.inner-inducedTensor (r • G)))
229
+ (D : CircularPrimitiveFamily d.B (Fin (N*m))),
230
+ (∀ k a, (f k).amplitude a = d.B.correctedPrimitiveAmplitude d.basis
231
+ (d.cycleWeights e q k) (d.perturbedPhases (d.cycleLinearParts e q k))
232
+ (g.inner-inducedTensor (r • G)) (e a)) ∧
233
+ (∀ k a, (f k).phase a = d.perturbedPhases (d.cycleLinearParts e q k) (e a)) ∧
234
+ D.curves = q.curves ∧ D.radius = q.radius ∧ D.outerRadius = q.outerRadius ∧
235
+ D.chartRadius = q.chartRadius ∧ D.linearPart = q.linearPart ∧ D.convexPart = q.convexPart ∧
236
+ (∀ a p, D.amplitude a p = (f a.divNat).cycleAmplitude N a.modNat p) ∧
237
+ (∀ a, D.phase a = (f a.divNat).phase a.modNat) ∧
238
+ D.totalTensor = g.inner-inducedTensor (r • G) := by
239
+ classical
240
+ obtain ⟨pt,wt,mt,hpt,hwt,hmt,hcorrect⟩ := d.corrected_smooth_family hF r href
241
+ obtain ⟨delta,W,hdelta,hdeltaR,hW,hweights⟩ := d.B.independent_radius_box
242
+ (fun b : d.B.centers × Fin 3 => b.1) (fun b => d.radius b.1)
243
+ (fun b => d.weight_nonneg b.1) (fun b => d.radius_pos b.1) (fun b => d.region b.1)
244
+ (fun b => d.weight_positive b.1) (lt_min hwt hweightBound)
245
+ refine ⟨min mt mapBound,delta,W,lt_min hmt hmapBound,min_le_right _ _,hdelta,
246
+ (fun i => hdeltaR (i,0)),hW,?_⟩
247
+ intro N hN
248
+ let ind := fun a : Fin (N*m) => (e a.modNat).1
249
+ let cmp := fun a : Fin (N*m) => (e a.modNat).2
250
+ let lo := fun a : Fin (N*m) => d.radius (ind a)-delta
251
+ let hi := fun a : Fin (N*m) => d.radius (ind a)-delta/2
252
+ have hlo (a : Fin (N*m)) : 0 < lo a := by
253
+ have hh := hdeltaR (ind a,cmp a)
254
+ have hp := d.radius_pos (ind a)
255
+ dsimp only [lo]
256
+ linarith
257
+ have hmid (a : Fin (N*m)) : lo a < hi a := by dsimp only [lo,hi]; linarith
258
+ have hhi (a : Fin (N*m)) : hi a < d.radius (ind a) := by dsimp only [hi]; linarith
259
+ obtain ⟨q,hr,hindex,houter,hchart,hL,hell,hball⟩ :=
260
+ d.finite_copy_geometry ind cmp lo hi hlo hmid hhi (lt_min hpt hphaseBound)
261
+ let copy := fun (k : Fin N) (b : d.B.centers × Fin 3) => finProdFinEquiv (k,e.symm b)
262
+ have hcopy (k : Fin N) (b : d.B.centers × Fin 3) :
263
+ (copy k b).divNat = k ∧ e (copy k b).modNat = b := by
264
+ have hh := Prod.mk.inj (finProdFinEquiv.symm_apply_apply (k,e.symm b))
265
+ exact ⟨hh.1,by rw [hh.2,e.apply_symm_apply]⟩
266
+ have hcopy' (a : Fin (N*m)) : copy a.divNat (e a.modNat) = a := by
267
+ simp only [copy,e.symm_apply_apply]
268
+ exact finProdFinEquiv.apply_symm_apply a
269
+ let rr := fun (k : Fin N) (b : d.B.centers × Fin 3) => q.radius (copy k b)
270
+ let ell := d.cycleLinearParts e q
271
+ let psi := d.cycleWeights e q
272
+ have hrr (k : Fin N) (b : d.B.centers × Fin 3) :
273
+ d.radius b.1-delta < rr k b ∧ rr k b < d.radius b.1-delta/2 := by
274
+ have hh := hr (copy k b)
275
+ simpa only [lo,hi,ind,(hcopy k b).2,rr] using hh
276
+ have hpsi (k : Fin N) := hweights (rr k) (hrr k)
277
+ have hrsmall (k : Fin N) (b : d.B.centers × Fin 3) : (rr k b)^2 < (d.radius b.1)^2 := by
278
+ have hh := hrr k b
279
+ have hp := (hpsi k).1 b
280
+ have hR := d.radius_pos b.1
281
+ nlinarith
282
+ have hnorm (a : Fin (N*m)) : ‖q.linearPart a‖ ≤ ‖(d.P (ind a)).ξ‖+1 :=
283
+ (d.parameters (ind a) (cmp a) (q.linearPart a) (hball a)).2
284
+ refine ⟨q,hindex,houter,hchart,hL,hnorm,
285
+ (fun a => (hell a).trans_le (min_le_right _ _)),
286
+ (fun k => (hpsi k).2.2.2.2.2),
287
+ (fun k b p => ((hpsi k).2.2.2.2.1 b p).trans_le (min_le_right _ _)),?_⟩
288
+ intro G hG hGF
289
+ have hnon (k : Fin N) (b : d.B.centers × Fin 3) (p : M) : 0 ≤ psi k b p :=
290
+ (shrinkingCircularWeight_nonneg_le (b.1 : M) (d.B.weight b.1)
291
+ (d.weight_nonneg b.1) (hrsmall k b).le p).1
292
+ have hsupp (k : Fin N) (b : d.B.centers × Fin 3) :
293
+ tsupport (psi k b) ⊆ tsupport (d.B.weight b.1) := by
294
+ apply closure_mono
295
+ intro p hp
296
+ change psi k b p ≠ 0 at hp
297
+ change d.B.weight b.1 p ≠ 0
298
+ intro hz
299
+ exact hp (by simp only [psi,cycleWeights,shrinkingCircularWeight,hz,zero_mul])
300
+ have hell' (k : Fin N) (i : d.B.centers) (j : Fin 3) :
301
+ ‖ell k i j-(d.P i).ξ j‖ < pt := by
302
+ have hh := (hell (copy k (i,j))).trans_le (min_le_left _ _)
303
+ simpa only [ind,cmp,(hcopy k (i,j)).2,ell,cycleLinearParts] using hh
304
+ choose fc hphase hamp hnonamp hposamp hsamp using fun k : Fin N =>
305
+ hcorrect (ell k) (psi k) (hell' k) (hpsi k).2.1 (hnon k) (hsupp k)
306
+ (fun b p => ((hpsi k).2.2.2.2.1 b p).trans_le (min_le_left _ _)) G hG
307
+ (fun i => (hGF i).mono_const (min_le_left _ _))
308
+ let f := fun k => (fc k).reindex e
309
+ have hphase' (a : Fin (N*m)) : (f a.divNat).phase a.modNat = q.copiedPhases a := by
310
+ change (fc a.divNat).phase (e a.modNat) = _
311
+ rw [hphase a.divNat]
312
+ change d.B.circularPhase (e a.modNat).1
313
+ (ell a.divNat (e a.modNat).1 (e a.modNat).2) (d.L (e a.modNat).1) = _
314
+ rw [show ell a.divNat (e a.modNat).1 (e a.modNat).2 = q.linearPart a from by
315
+ change q.linearPart (copy a.divNat (e a.modNat)) = q.linearPart a
316
+ rw [hcopy' a]]
317
+ simp only [CircularFamilyGeometry.copiedPhases,hindex a,hL a,ind]
318
+ have hpositive (a : Fin (N*m)) (p : M) :
319
+ 0 < (f a.divNat).amplitude a.modNat p ↔
320
+ p ∈ circularCoordinateDisk ((q.curves a).index : M) (q.radius a) := by
321
+ change 0 < (fc a.divNat).amplitude (e a.modNat) p ↔ _
322
+ rw [hposamp a.divNat (e a.modNat) p]
323
+ have hh := (hpsi a.divNat).2.2.1 (e a.modNat) p
324
+ change 0 < psi a.divNat (e a.modNat) p ↔ _ at hh
325
+ simpa only [rr,hcopy' a,hindex a,ind] using hh
326
+ obtain ⟨D,hD⟩ := q.with_cycle_families f hN
327
+ (fun k a p => hnonamp k (e a) p) hpositive hphase' d.outer
328
+ refine ⟨f,D,?_,?_,hD⟩
329
+ · intro k a
330
+ change (fc k).amplitude (e a) = _
331
+ exact congrFun (hamp k) (e a)
332
+ · intro k a
333
+ change (fc k).phase (e a) = _
334
+ exact congrFun (hphase k) (e a)
335
+
336
+ end ReferenceCircularAtlas
337
+ end ClosedSurfaceR4.FiniteOrderSmoothing
338
+
339
+ end
340
+
341
+ end OAI
lean/OAI/Geometry/SurfaceImmersion/Geometry/DegreeOneReachability.lean ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Geometry.SurfaceImmersion.Geometry.CurveIncidenceGraph
2
+
3
+ namespace OAI
4
+
5
+ /-! A finite graph of degrees one and two joins each degree-one vertex
6
+ to a distinct degree-one vertex by a simple path. -/
7
+ noncomputable section
8
+ open Set
9
+ attribute [local instance] Classical.propDecidable
10
+ namespace ClosedSurfaceR4.FiniteOrderSmoothing
11
+
12
+ theorem degree_one_reaches_degree_one {A : Type*} [Fintype A]
13
+ (G : SimpleGraph A) (hdegrees : ∀ x, G.degree x = 1 ∨ G.degree x = 2)
14
+ (p : A) (hp : G.degree p = 1) :
15
+ ∃ q : A, q ≠ p ∧ G.degree q = 1 ∧ Nonempty (G.Path p q) := by
16
+ classical
17
+ let C : Set A := {x | G.Reachable p x}
18
+ let H := G.induce C
19
+ let p' : C := ⟨p,SimpleGraph.Reachable.rfl⟩
20
+ have hdegree (x : C) : H.degree x = G.degree x.val :=
21
+ G.degree_induce_of_neighborSet_subset (fun _ hy => x.property.trans hy.reachable)
22
+ have hodd : Odd (H.degree p') := by rw [hdegree,hp]; decide
23
+ obtain ⟨q,hne,hq⟩ := H.exists_ne_odd_degree_of_exists_odd_degree p' hodd
24
+ have hqp : q.val ≠ p := by
25
+ intro he
26
+ exact hne (Subtype.ext he)
27
+ have hq1 : G.degree q.val = 1 := by
28
+ rw [hdegree] at hq
29
+ rcases hdegrees q.val with h | h
30
+ · exact h
31
+ · rw [h] at hq
32
+ norm_num at hq
33
+ obtain ⟨w,hw⟩ := q.property.exists_isPath
34
+ exact ⟨q.val,hqp,hq1,⟨⟨w,hw⟩⟩⟩
35
+
36
+ end ClosedSurfaceR4.FiniteOrderSmoothing
37
+
38
+ end
39
+
40
+ end OAI
lean/OAI/Geometry/SurfaceImmersion/Geometry/DensityNormalizedPath.lean ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Geometry.SurfaceImmersion.Primitive.LoopDensityMoments
2
+ import OAI.Geometry.SurfaceImmersion.Primitive.PositiveDensityTurns
3
+
4
+ namespace OAI
5
+
6
+ /-! Actual smooth unit-circle loops with the prescribed uniform mean. -/
7
+ noncomputable section
8
+ open Set
9
+ open scoped ContDiff
10
+
11
+ namespace ClosedSurfaceR4.LoopDensity
12
+
13
+ variable {B : Type} [NormedAddCommGroup B] [NormedSpace ℝ B] [FiniteDimensional ℝ B]
14
+
15
+ def normalizedPath (ρ : B × ℝ → ℝ) (p : B → ℝ → Plane) : B × ℝ → Plane :=
16
+ PositiveDensity.reparametrize ρ (fun z => p z.1 z.2)
17
+
18
+ theorem normalizedPath_properties {ρ : B × ℝ → ℝ} {p : B → ℝ → Plane}
19
+ {c : B → Plane} {U : Set B} (hU : IsOpen U)
20
+ (hρ : ContDiffOn ℝ ∞ ρ (U ×ˢ univ))
21
+ (hp : ContDiffOn ℝ ∞ (fun z : B × ℝ => p z.1 z.2) (U ×ˢ univ))
22
+ (hpos : ∀ b ∈ U, ∀ t, 0 < ρ (b, t))
23
+ (hper : ∀ b ∈ U, Function.Periodic (fun t => ρ (b, t)) 1)
24
+ (hpper : ∀ b ∈ U, Function.Periodic (p b) 1)
25
+ (hmom : ∀ b ∈ U, (∫ t in 0..1, ρ (b, t) • augment (p b t)) = augment (c b))
26
+ (hunit : ∀ b ∈ U, ∀ t, p b t 0 ^ 2 + p b t 1 ^ 2 = 1) :
27
+ ContDiffOn ℝ ∞ (normalizedPath ρ p) (U ×ˢ univ) ∧
28
+ (∀ b ∈ U, Function.Periodic (fun t => normalizedPath ρ p (b, t)) 1) ∧
29
+ (∀ b ∈ U, (∫ t in 0..1, normalizedPath ρ p (b, t)) = c b) ∧
30
+ ∀ b ∈ U, ∀ t, normalizedPath ρ p (b, t) 0 ^ 2 + normalizedPath ρ p (b, t) 1 ^ 2 = 1 := by
31
+ have hmm (b : B) (hb : b ∈ U) := mass_and_mean
32
+ (LocalPeriodicCalculus.smooth_slice hU hρ hb).continuous
33
+ (LocalPeriodicCalculus.smooth_slice hU hp hb).continuous (hmom b hb)
34
+ have hmass : ∀ b ∈ U, (∫ t in 0..1, ρ (b, t)) = 1 := fun b hb => (hmm b hb).1
35
+ refine ⟨PositiveDensity.reparametrize_smoothOn hU hρ hpos hper hmass hp, ?_, ?_, ?_⟩
36
+ · intro b hb
37
+ exact PositiveDensity.reparametrize_periodic hU hρ hpos hper hmass hpper hb
38
+ · intro b hb
39
+ exact (PositiveDensity.reparametrize_mean hU hρ hpos hper hmass hp hb).trans (hmm b hb).2
40
+ · intro b hb t
41
+ exact hunit b hb (PositiveDensity.inverseClock ρ b t)
42
+
43
+ end ClosedSurfaceR4.LoopDensity
44
+
45
+ end
46
+
47
+ end OAI
lean/OAI/Geometry/SurfaceImmersion/Geometry/DirectionalJetBounds.lean ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Geometry.SurfaceImmersion.Correction.WeightedPolynomialBounds
2
+
3
+ namespace OAI
4
+
5
+ /-! Higher directional jets of a controlled second jet lose one scale per
6
+ additional derivative. These are the factors in the finite jet polynomials. -/
7
+ noncomputable section
8
+ open scoped ContDiff
9
+
10
+ namespace ClosedSurfaceR4.WeightedEstimates
11
+
12
+ variable {A E : Type*} [NormedAddCommGroup A] [NormedSpace ℝ A]
13
+ [NormedAddCommGroup E] [NormedSpace ℝ E]
14
+
15
+ def iteratedDirectional : List A → (A → E) → A → E
16
+ | [], f => f
17
+ | v :: vs, f => fun x => fderiv ℝ (iteratedDirectional vs f) x v
18
+
19
+ lemma contDiffOn_iteratedDirectional {U : Set A} (hU : IsOpen U) {f : A → E}
20
+ (hf : ContDiffOn ℝ ∞ f U) (vs : List A) :
21
+ ContDiffOn ℝ ∞ (iteratedDirectional vs f) U := by
22
+ induction vs with
23
+ | nil => exact hf
24
+ | cons v vs ih =>
25
+ exact (ih.fderiv_of_isOpen hU (by simp)).clm_apply contDiffOn_const
26
+
27
+ lemma WeightedBound.iteratedDirectional {U : Set A} (hU : IsOpen U) {f : A → E}
28
+ {s C : ℝ} (hs : 0 < s) (hC : 0 ≤ C) (hf : ContDiffOn ℝ ∞ f U)
29
+ (vs : List A) (hv : ∀ v ∈ vs, ‖v‖ ≤ 1) (m : ℕ)
30
+ (hb : WeightedBound U s (m + vs.length) C f) :
31
+ WeightedBound U s m (C / s ^ vs.length) (iteratedDirectional vs f) := by
32
+ induction vs generalizing m with
33
+ | nil => simpa [ClosedSurfaceR4.WeightedEstimates.iteratedDirectional] using hb
34
+ | cons v vs ih =>
35
+ have he : m + (v :: vs).length = (m + 1) + vs.length := by simp; omega
36
+ have ht := ih (fun w hw => hv w (List.mem_cons_of_mem v hw)) (m + 1) (he ▸ hb)
37
+ have hd := ht.directional hU hs (contDiffOn_iteratedDirectional hU hf vs) v
38
+ apply hd.mono_const
39
+ have hn : ‖v‖ ≤ 1 := hv v (List.mem_cons_self ..)
40
+ have hc : 0 ≤ C / s ^ vs.length / s := by positivity
41
+ calc
42
+ ‖v‖ * (C / s ^ vs.length / s) ≤ C / s ^ vs.length / s := mul_le_of_le_one_left hc hn
43
+ _ = C / s ^ (v :: vs).length := by simp [pow_succ, div_div]
44
+
45
+ /-- Products of higher-jet factors have a loss equal to the sum of their
46
+ additional derivative orders. The sum is independent of the output order. -/
47
+ lemma weighted_higher_jet_monomial {ι : Type*} {U : Set A} (hU : IsOpen U)
48
+ {s : ℝ} (hs : 0 < s) (a : Finset ι) (C : ι → ℝ) (vs : ι → List A)
49
+ (f : ι → A → ℝ) (m : ℕ) (hC : ∀ i ∈ a, 0 ≤ C i)
50
+ (hv : ∀ i ∈ a, ∀ v ∈ vs i, ‖v‖ ≤ 1)
51
+ (hf : ∀ i ∈ a, ContDiffOn ℝ ∞ (f i) U)
52
+ (hb : ∀ i ∈ a, WeightedBound U s (m + (vs i).length) (C i) (f i)) :
53
+ WeightedBound U s m
54
+ (((2 ^ m) ^ a.card * ∏ i ∈ a, C i) / s ^ (∑ i ∈ a, (vs i).length))
55
+ (fun x => ∏ i ∈ a, iteratedDirectional (vs i) (f i) x) := by
56
+ apply WeightedBound.finset_prod_losses hU.uniqueDiffOn hs a C (fun i => (vs i).length)
57
+ (fun i => iteratedDirectional (vs i) (f i)) hC
58
+ · intro i hi
59
+ exact contDiffOn_iteratedDirectional hU (hf i hi) (vs i)
60
+ · intro i hi
61
+ exact (hb i hi).iteratedDirectional hU hs (hC i hi) (hf i hi) (vs i) (hv i hi) m
62
+
63
+ end ClosedSurfaceR4.WeightedEstimates
64
+
65
+ end
66
+
67
+ end OAI
lean/OAI/Geometry/SurfaceImmersion/Geometry/DisjointJetBounds.lean ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Geometry.SurfaceImmersion.Atlas.QuadraticCutoffBounds
2
+ import OAI.Geometry.Immersion.ClosedSurface.WeightedBounds
3
+
4
+ namespace OAI
5
+
6
+ /-! Disjoint supports prevent a factor counting the prescribed points in
7
+ the finite-point preparation estimates. -/
8
+ noncomputable section
9
+ open Set Filter Metric
10
+ open scoped ContDiff Topology BigOperators
11
+ namespace ClosedSurfaceR4.SphericalJets
12
+ variable {E V : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E]
13
+ [NormedAddCommGroup V] [NormedSpace ℝ V]
14
+
15
+ theorem disjoint_sum_jet_bound {ι : Type*} [DecidableEq ι] (s : Finset ι)
16
+ (q : ι → E → V) (hq : ∀ i ∈ s, ContDiff ℝ ∞ (q i))
17
+ (hdisj : (↑s : Set ι).Pairwise fun i j => Disjoint (tsupport (q i)) (tsupport (q j)))
18
+ {C : ℝ} (hC : 0 ≤ C) (j : ℕ)
19
+ (hb : ∀ i ∈ s, ∀ x, ‖iteratedFDeriv ℝ j (q i) x‖ ≤ C) (x : E) :
20
+ ‖iteratedFDeriv ℝ j (fun x => ∑ i ∈ s, q i x) x‖ ≤ C := by
21
+ rw [iteratedFDeriv_fun_sum_apply (fun i hi => ((hq i hi).of_le (by simp)).contDiffAt)]
22
+ have hz (i : ι) (hx : x ∉ tsupport (q i)) : iteratedFDeriv ℝ j (q i) x = 0 := by
23
+ by_contra hn
24
+ exact hx (tsupport_iteratedFDeriv_subset j (subset_closure hn))
25
+ by_cases hex : ∃ i ∈ s, x ∈ tsupport (q i)
26
+ · obtain ⟨i,hi,hxi⟩ := hex
27
+ have hzero : ∀ k ∈ s, k ≠ i → iteratedFDeriv ℝ j (q k) x = 0 := by
28
+ intro k hk hki
29
+ apply hz k
30
+ exact fun hxk => Set.disjoint_left.mp (hdisj hk hi hki) hxk hxi
31
+ rw [Finset.sum_eq_single i hzero (by simp [hi])]
32
+ exact hb i hi x
33
+ · have hzero : ∀ i ∈ s, iteratedFDeriv ℝ j (q i) x = 0 := by
34
+ intro i hi
35
+ exact hz i (fun hxi => hex ⟨i,hi,hxi⟩)
36
+ rw [Finset.sum_eq_zero hzero,norm_zero]
37
+ exact hC
38
+
39
+ theorem disjoint_sum_weighted_bound {ι : Type*} [DecidableEq ι] (s : Finset ι)
40
+ (q : ι → E → V) (hq : ∀ i ∈ s, ContDiff ℝ ∞ (q i))
41
+ (hdisj : (↑s : Set ι).Pairwise fun i j => Disjoint (tsupport (q i)) (tsupport (q j)))
42
+ {C : ℝ} (hC : 0 ≤ C) {m : ℕ}
43
+ (hb : ∀ i ∈ s, WeightedEstimates.WeightedBound univ 1 m C (q i)) :
44
+ WeightedEstimates.WeightedBound univ 1 m C (fun x => ∑ i ∈ s, q i x) := by
45
+ intro j hj x hx
46
+ simp only [one_pow,one_mul,iteratedFDerivWithin_univ]
47
+ apply disjoint_sum_jet_bound s q hq hdisj hC j
48
+ intro i hi y
49
+ simpa only [one_pow,one_mul,iteratedFDerivWithin_univ] using hb i hi j hj y (mem_univ y)
50
+
51
+ end ClosedSurfaceR4.SphericalJets
52
+
53
+ end
54
+
55
+ end OAI
lean/OAI/Geometry/SurfaceImmersion/Geometry/DisplacementSum.lean ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Geometry.Immersion.ClosedSurface.QuadraticMean
2
+
3
+ namespace OAI
4
+
5
+ /-! Exact recombination of phase targets split by a finite partition. -/
6
+ noncomputable section
7
+ open scoped BigOperators
8
+ namespace ClosedSurfaceR4.QuadraticMean
9
+
10
+ lemma realMode_sum {n : ℕ} {ι : Type*} [Fintype ι] (θ : ℝ) (A : ι → CVec n) :
11
+ realMode θ (∑ i, A i) = ∑ i, realMode θ (A i) := by
12
+ funext k
13
+ simp [realMode,realPart,Finset.mul_sum]
14
+
15
+ lemma displacement_sum {n : ℕ} {ι : Type*} [Fintype ι]
16
+ (τ : ℝ) (φ : Base → ℝ) (A : ι → Base → CVec n) :
17
+ displacement τ φ (fun x => ∑ i, A i x) = fun x => ∑ i, displacement τ φ (A i) x := by
18
+ funext x
19
+ exact realMode_sum (φ x / τ) (fun i => A i x)
20
+
21
+ end ClosedSurfaceR4.QuadraticMean
22
+
23
+ end
24
+
25
+ end OAI
lean/OAI/Geometry/SurfaceImmersion/Geometry/EmbeddedCurveGraphPath.lean ADDED
@@ -0,0 +1,106 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Geometry.SurfaceImmersion.Geometry.CurveEdgeLocalization
2
+ import OAI.Geometry.SurfaceImmersion.Geometry.InjectivePathConcatenation
3
+
4
+ namespace OAI
5
+
6
+ /-! A simple path in the interval incidence graph has an actual
7
+ embedded realization in the compact curve. -/
8
+ noncomputable section
9
+ open Set Topology
10
+ namespace ClosedSurfaceR4.FiniteOrderSmoothing
11
+ variable {X : Type*} [TopologicalSpace X] [T2Space X]
12
+
13
+ structure RealizedCurveWalk {V : Set X} {P : Finset (Set X)} {a b : V}
14
+ (p : (curveIncidenceGraph V P).Walk (Sum.inl a) (Sum.inl b)) where
15
+ path : Path a.val b.val
16
+ injective : a ≠ b → Function.Injective path
17
+ vertex : ∀ v : V, v.val ∈ range path → Sum.inl v ∈ p.support
18
+ edge : ∀ E : P, (range path ∩ E.val).Nonempty → Sum.inr E ∈ p.support
19
+
20
+ theorem realize_simple_curve_walk {V : Set X} {P : Finset (Set X)}
21
+ (hP : ∀ E ∈ P, Disjoint E V)
22
+ (hdis : ∀ E ∈ P, ∀ F ∈ P, E ≠ F → Disjoint E F)
23
+ (w : ∀ E : P, CurveEdgeWitness V E.val)
24
+ {a b : V} (p : (curveIncidenceGraph V P).Walk (Sum.inl a) (Sum.inl b))
25
+ (hp : p.IsPath) : Nonempty (RealizedCurveWalk p) := by
26
+ classical
27
+ suffices ∀ n (a b : V) (p : (curveIncidenceGraph V P).Walk (Sum.inl a) (Sum.inl b)),
28
+ p.length = n → p.IsPath → Nonempty (RealizedCurveWalk p) by
29
+ exact this p.length a b p rfl hp
30
+ intro n
31
+ induction n using Nat.strong_induction_on with
32
+ | h n ih =>
33
+ intro a b p hn hp
34
+ cases p with
35
+ | nil =>
36
+ refine ⟨⟨Path.refl a.val,?_,?_,?_⟩⟩
37
+ · intro h
38
+ exact False.elim (h rfl)
39
+ · rintro v ⟨t,ht⟩
40
+ have hv : v = a := Subtype.ext ht.symm
41
+ simp [hv]
42
+ · rintro E ⟨x,⟨t,ht⟩,hxE⟩
43
+ have hx : x = a.val := ht.symm
44
+ exact False.elim (disjoint_left.mp (hP E.val E.property) hxE (hx ▸ a.property))
45
+ | cons h p =>
46
+ rename_i c
47
+ cases c with
48
+ | inl c => exact False.elim h
49
+ | inr E =>
50
+ cases p with
51
+ | cons h' q =>
52
+ rename_i c
53
+ cases c with
54
+ | inr F => exact False.elim h'
55
+ | inl c =>
56
+ obtain ⟨hp',haNot⟩ := (SimpleGraph.Walk.cons_isPath_iff _ _).mp hp
57
+ obtain ⟨hq,hENot⟩ := (SimpleGraph.Walk.cons_isPath_iff _ _).mp hp'
58
+ have hac : a ≠ c := by
59
+ intro he
60
+ apply haNot
61
+ simp [he]
62
+ obtain ⟨σ,hσ,hσrange⟩ := (w E).oriented_path (hP E.val E.property)
63
+ a.property c.property (fun he => hac (Subtype.ext he)) h h'
64
+ obtain ⟨hσV,hσE⟩ := curve_edge_path_localization hP hdis E (w E) a c hac h h' σ hσrange
65
+ by_cases hcb : c = b
66
+ · subst b
67
+ refine ⟨⟨σ,fun _ => hσ,?_,?_⟩⟩
68
+ · intro v hv
69
+ rcases hσV v hv with he | he <;> simp [he]
70
+ · intro F hF
71
+ have he := hσE F hF
72
+ simp [he]
73
+ · have hqn : q.length < n := by
74
+ simp only [SimpleGraph.Walk.length_cons] at hn
75
+ omega
76
+ obtain ⟨r⟩ := ih q.length hqn c b q rfl hq
77
+ have hmeet : range σ ∩ range r.path ⊆ {c.val} := by
78
+ rintro x ⟨hxσ,hxr⟩
79
+ by_cases hxE : x ∈ E.val
80
+ · exact False.elim (hENot (r.edge E ⟨x,hxr,hxE⟩))
81
+ · have hfront : x ∈ closure E.val \ E.val := ⟨hσrange ▸ hxσ,hxE⟩
82
+ rw [curve_edge_frontier_endpoints (w E) (hP E.val E.property) a c hac h h'] at hfront
83
+ rcases hfront with he | he
84
+ · have ha : a.val ∈ range r.path := he ▸ hxr
85
+ exact False.elim (haNot (by simp [r.vertex a ha]))
86
+ · exact he
87
+ refine ⟨⟨σ.trans r.path,fun _ => path_trans_injective_of_range σ r.path hσ
88
+ (r.injective hcb) hmeet,?_,?_⟩⟩
89
+ · intro v hv
90
+ rw [Path.trans_range] at hv
91
+ rcases hv with hv | hv
92
+ · rcases hσV v hv with he | he <;> simp [he]
93
+ · simp [r.vertex v hv]
94
+ · intro F hF
95
+ obtain ⟨x,hx,hxF⟩ := hF
96
+ rw [Path.trans_range] at hx
97
+ rcases hx with hx | hx
98
+ · have he := hσE F ⟨x,hx,hxF⟩
99
+ simp [he]
100
+ · simp [r.edge F ⟨x,hx,hxF⟩]
101
+
102
+ end ClosedSurfaceR4.FiniteOrderSmoothing
103
+
104
+ end
105
+
106
+ end OAI
lean/OAI/Geometry/SurfaceImmersion/Geometry/EmbeddedOpenSubset.lean ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Geometry.SurfaceImmersion.Whitney.CompactCurveArc
2
+
3
+ namespace OAI
4
+
5
+ /-! Open subarcs remain open in the ambient curve. -/
6
+ noncomputable section
7
+ open Set Topology
8
+ namespace ClosedSurfaceR4.FiniteOrderSmoothing
9
+ variable {X Y : Type*} [TopologicalSpace X] [TopologicalSpace Y]
10
+
11
+ theorem embedded_open_subset {f : X → Y} (hf : IsEmbedding f)
12
+ {U S : Set X} (hU : IsOpen (f '' U)) (hS : IsOpen S) (hSU : S ⊆ U) :
13
+ IsOpen (f '' S) := by
14
+ obtain ⟨V,hV,hVS⟩ := hf.isInducing.isOpen_iff.mp hS
15
+ have heq : f '' S = (f '' U) ∩ V := by
16
+ ext y
17
+ constructor
18
+ · rintro ⟨x,hx,rfl⟩
19
+ exact ⟨⟨x,hSU hx,rfl⟩,by rw [← hVS] at hx; exact hx⟩
20
+ · rintro ⟨⟨x,hx,rfl⟩,hy⟩
21
+ exact ⟨x,by rw [← hVS]; exact hy,rfl⟩
22
+ rw [heq]
23
+ exact hU.inter hV
24
+
25
+ variable {Z : Type*} [TopologicalSpace Z]
26
+
27
+ def CompactCurveArc.openSubarc (A : CompactCurveArc Z) (u v : ℝ) : Set Z :=
28
+ A.map '' {t | u < (t:ℝ) ∧ (t:ℝ) < v}
29
+
30
+ def CompactCurveArc.closedSubarc (A : CompactCurveArc Z) (u v : ℝ) : Set Z :=
31
+ A.map '' {t | u ≤ (t:ℝ) ∧ (t:ℝ) ≤ v}
32
+
33
+ lemma CompactCurveArc.openSubarc_open (A : CompactCurveArc Z) {u v : ℝ}
34
+ (hu : A.left ≤ u) (hv : v ≤ A.right) : IsOpen (A.openSubarc u v) := by
35
+ apply embedded_open_subset A.embedding.isEmbedding A.interior_open
36
+ · exact isOpen_Ioo.preimage continuous_subtype_val
37
+ · intro t ht
38
+ exact ⟨hu.trans_lt ht.1,ht.2.trans_le hv⟩
39
+
40
+ lemma CompactCurveArc.closedSubarc_compact (A : CompactCurveArc Z) (u v : ℝ) :
41
+ IsCompact (A.closedSubarc u v) := by
42
+ exact (IsClosed.isCompact (isClosed_Icc.preimage continuous_subtype_val)).image A.embedding.continuous
43
+
44
+ end ClosedSurfaceR4.FiniteOrderSmoothing
45
+
46
+ end
47
+
48
+ end OAI
lean/OAI/Geometry/SurfaceImmersion/Geometry/EuclideanImmersionLocalInjective.lean ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Geometry.SurfaceImmersion.Atlas.SurfaceChartRepresentative
2
+ import Mathlib.Analysis.Calculus.InverseFunctionTheorem.ContDiff
3
+
4
+ namespace OAI
5
+
6
+ /-! A smooth finite-dimensional immersion is locally injective, using
7
+ an actual linear left inverse followed by the inverse function theorem. -/
8
+ noncomputable section
9
+ open Set Filter Topology
10
+ open scoped ContDiff
11
+ namespace ClosedSurfaceR4.FiniteOrderSmoothing
12
+ open JetPolynomial (Base)
13
+
14
+ theorem euclidean_immersion_locally_injective {f : Base → ProjectionTarget 3}
15
+ (hf : ContDiff ℝ ∞ f) (p : Base) (hp : Function.Injective (fderiv ℝ f p)) :
16
+ ∃ U : Set Base, IsOpen U ∧ p ∈ U ∧ U.InjOn f := by
17
+ let L := fderiv ℝ f p
18
+ obtain ⟨A,hA⟩ := L.toLinearMap.exists_leftInverse_of_injective (LinearMap.ker_eq_bot.mpr hp)
19
+ let P : ProjectionTarget 3 →L[ℝ] Base := A.toContinuousLinearMap
20
+ have hPL : P.comp L = ContinuousLinearMap.id ℝ Base := by
21
+ apply ContinuousLinearMap.ext
22
+ intro v
23
+ exact congrArg (fun T : Base →ₗ[ℝ] Base => T v) hA
24
+ let g := P ∘ f
25
+ have hg : ContDiff ℝ ∞ g := P.contDiff.comp hf
26
+ have hd : HasFDerivAt g (ContinuousLinearEquiv.refl ℝ Base).toContinuousLinearMap p := by
27
+ have h := P.hasFDerivAt.comp p (hf.differentiable (by simp) p).hasFDerivAt
28
+ change HasFDerivAt g (P.comp L) p at h
29
+ rw [hPL] at h
30
+ exact h
31
+ let e := hg.contDiffAt.toOpenPartialHomeomorph g hd (by simp)
32
+ refine ⟨e.source,e.open_source,hg.contDiffAt.mem_toOpenPartialHomeomorph_source hd (by simp),?_⟩
33
+ intro x hx y hy hxy
34
+ apply e.injOn hx hy
35
+ exact congrArg P hxy
36
+
37
+ end ClosedSurfaceR4.FiniteOrderSmoothing
38
+
39
+ end
40
+
41
+ end OAI
lean/OAI/Geometry/SurfaceImmersion/Geometry/EuclideanRestoration.lean ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Geometry.SurfaceImmersion.Correction.ManifoldSmoothing
2
+ import OAI.Geometry.SurfaceImmersion.Atlas.FinitePointChartBalls
3
+
4
+ namespace OAI
5
+
6
+ /-! Restore a compactly supported Euclidean chart correction. The support
7
+ and germ formulas are used in finite-point spherical preparation. -/
8
+ noncomputable section
9
+ open Set Filter Manifold
10
+ open scoped ContDiff Topology Manifold
11
+ namespace ClosedSurfaceR4.FiniteOrderSmoothing
12
+ variable {M : Type*} [TopologicalSpace M] [ChartedSpace Plane M]
13
+
14
+ def euclideanRestore (p : M) (χ : M → ℝ) (h : Plane → Space) : M → Space :=
15
+ restore p χ (h ∘ (EuclideanSpace.equiv (Fin 2) ℝ).symm)
16
+
17
+ lemma euclideanRestore_eq (p : M) (χ : M → ℝ) (h : Plane → Space) :
18
+ euclideanRestore p χ h = (chartAt Plane p).source.indicator
19
+ (fun x => χ x • h (chartAt Plane p x)) := by
20
+ funext x
21
+ by_cases hx : x ∈ (chartAt Plane p).source
22
+ · simp [euclideanRestore,restore,chart,hx]
23
+ · simp [euclideanRestore,restore,chart,hx]
24
+
25
+ lemma euclideanRestore_smooth [IsManifold planeModel ∞ M] (p : M) {χ : M → ℝ}
26
+ (hχ : ContMDiff planeModel 𝓘(ℝ) ∞ χ)
27
+ (hχs : tsupport χ ⊆ (chartAt Plane p).source) {h : Plane → Space}
28
+ (hh : ContDiff ℝ ∞ h) : ContMDiff planeModel spaceModel ∞ (euclideanRestore p χ h) := by
29
+ exact restore_smooth p hχ (by simpa only [chart_source] using hχs)
30
+ (hh.comp (EuclideanSpace.equiv (Fin 2) ℝ).symm.contDiff)
31
+
32
+ lemma euclideanRestore_tsupport [T2Space M] (p : M) (χ : M → ℝ) {h : Plane → Space}
33
+ {K : Set Plane} (hK : IsCompact K) (hKt : K ⊆ (chartAt Plane p).target)
34
+ (hs : tsupport h ⊆ K) :
35
+ tsupport (euclideanRestore p χ h) ⊆ (chartAt Plane p).symm '' K := by
36
+ have hclosed : IsClosed ((chartAt Plane p).symm '' K) :=
37
+ (hK.image_of_continuousOn ((chartAt Plane p).continuousOn_symm.mono hKt)).isClosed
38
+ apply closure_minimal _ hclosed
39
+ intro x hx
40
+ by_contra hn
41
+ rw [euclideanRestore_eq] at hx
42
+ by_cases hxs : x ∈ (chartAt Plane p).source
43
+ · have hh : h (chartAt Plane p x) = 0 := by
44
+ apply image_eq_zero_of_notMem_tsupport
45
+ intro hmem
46
+ exact hn ⟨chartAt Plane p x,hs hmem,(chartAt Plane p).left_inv hxs⟩
47
+ exact hx (by simp [indicator_of_mem hxs,hh])
48
+ · exact hx (indicator_of_notMem hxs _)
49
+
50
+ lemma euclideanRestore_chart_germ (p : M) (χ : M → ℝ) (h : Plane → Space)
51
+ {x : Plane} (hx : x ∈ (chartAt Plane p).target)
52
+ (hχ : (fun y => χ ((chartAt Plane p).symm y)) =ᶠ[𝓝 x] (fun _ => (1 : ℝ))) :
53
+ (fun y => euclideanRestore p χ h ((chartAt Plane p).symm y)) =ᶠ[𝓝 x] h := by
54
+ filter_upwards [(chartAt Plane p).open_target.mem_nhds hx,hχ] with y hy hχy
55
+ rw [euclideanRestore_eq,indicator_of_mem ((chartAt Plane p).map_target hy),
56
+ hχy,one_smul,(chartAt Plane p).right_inv hy]
57
+
58
+ end ClosedSurfaceR4.FiniteOrderSmoothing
59
+
60
+ end
61
+
62
+ end OAI
lean/OAI/Geometry/SurfaceImmersion/Geometry/EuclideanSurfaceImageNull.lean ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Geometry.SurfaceImmersion.Geometry.LowerDimensionalImage
2
+ import OAI.Geometry.SurfaceImmersion.Geometry.LinearEquivNullImage
3
+ import OAI.Geometry.SurfaceImmersion.Atlas.SurfaceChartRepresentative
4
+
5
+ namespace OAI
6
+
7
+ /-! Smooth two-dimensional images in three-space are null, in the
8
+ actual coordinate models used by the surface perturbations. -/
9
+ noncomputable section
10
+ open Set MeasureTheory Manifold
11
+ open scoped ContDiff Topology
12
+ namespace ClosedSurfaceR4.FiniteOrderSmoothing
13
+ open JetPolynomial (Base)
14
+ local instance : (volume : Measure (Plane × ℝ)).IsAddHaarMeasure :=
15
+ Measure.prod.instIsAddHaarMeasure _ _
16
+
17
+ theorem euclidean_surface_image_null (f : Base → ProjectionTarget 3) (hf : ContDiff ℝ ∞ f) :
18
+ volume (range f) = 0 := by
19
+ let L : Plane ≃L[ℝ] Base := ContinuousLinearEquiv.ofFinrankEq (by simp [Base])
20
+ let T : ProjectionTarget 3 ≃L[ℝ] Plane × ℝ := ContinuousLinearEquiv.ofFinrankEq (by simp)
21
+ have hnull := PublishedInputs.smooth_surface_image_volume_zero (T ∘ f ∘ L)
22
+ (T.contDiff.comp (hf.comp L.contDiff))
23
+ have hnull' := linear_equiv_null_image T.symm volume volume hnull
24
+ have he : T.symm '' range (T ∘ f ∘ L) = range f := by
25
+ ext y
26
+ constructor
27
+ · rintro ⟨z,⟨x,rfl⟩,rfl⟩
28
+ exact ⟨L x,by simp⟩
29
+ · rintro ⟨x,rfl⟩
30
+ exact ⟨T (f x),⟨L.symm x,by simp⟩,by simp⟩
31
+ rwa [he] at hnull'
32
+
33
+ variable {M : Type*} [TopologicalSpace M] [ChartedSpace Plane M]
34
+ [IsManifold planeModel ∞ M] [CompactSpace M]
35
+ theorem compact_surface_image_null (f : M → ProjectionTarget 3)
36
+ (hf : ContMDiff planeModel 𝓘(ℝ,ProjectionTarget 3) ∞ f) : volume (range f) = 0 := by
37
+ choose U F hU hp hsrc hF he using fun p => surface_chart_representative hf p
38
+ obtain ⟨s,hs⟩ := isCompact_univ.elim_finite_subcover U hU
39
+ (fun p _ => mem_iUnion.mpr ⟨p,hp p⟩)
40
+ have hsub : range f ⊆ ⋃ p ∈ s, range (F p) := by
41
+ rintro y ⟨x,rfl⟩
42
+ obtain ⟨p,hps,hxp⟩ := mem_iUnion₂.mp (hs (mem_univ x))
43
+ exact mem_iUnion₂.mpr ⟨p,hps,⟨chart p x,(he p hxp).symm⟩⟩
44
+ apply measure_mono_null hsub
45
+ exact (measure_biUnion_null_iff s.finite_toSet.countable).mpr (fun p _ => euclidean_surface_image_null (F p) (hF p))
46
+
47
+ end ClosedSurfaceR4.FiniteOrderSmoothing
48
+
49
+ end
50
+
51
+ end OAI
lean/OAI/Geometry/SurfaceImmersion/Geometry/ExactFastFamily.lean ADDED
@@ -0,0 +1,193 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Geometry.SurfaceImmersion.Correction.AnchoredPreparedCorrection
2
+ import OAI.Geometry.SurfaceImmersion.Geometry.RescaledReadBounds
3
+ import OAI.Geometry.SurfaceImmersion.Correction.PolynomialPreparedInitialization
4
+ import OAI.Geometry.SurfaceImmersion.Correction.InitialCorrectionStage
5
+
6
+ namespace OAI
7
+
8
+ /-! Arbitrarily accurate primitive maps give an actual smooth exact metric. -/
9
+ noncomputable section
10
+ open Set Manifold Bundle
11
+ open scoped ContDiff Manifold Topology BigOperators
12
+ namespace ClosedSurfaceR4.FiniteOrderSmoothing
13
+ open RealModes JetPolynomial JetPolynomial.Perturbation
14
+ local instance exactFastFiberNormed : NormedAddCommGroup TensorFiber := inferInstance
15
+ local instance exactFastFiberSpace : NormedSpace ℝ TensorFiber := inferInstance
16
+ variable {M : Type*} [TopologicalSpace M] [ChartedSpace Plane M]
17
+ [IsManifold planeModel ∞ M] [CompactSpace M]
18
+ local instance exactFastDualAdd : ∀ p : M, ContinuousAdd (TangentSpace planeModel p →L[ℝ] ℝ) :=
19
+ fun _ => inferInstanceAs (ContinuousAdd (Plane →L[ℝ] ℝ))
20
+ local instance exactFastDualSmul : ∀ p : M, ContinuousSMul ℝ (TangentSpace planeModel p →L[ℝ] ℝ) :=
21
+ fun _ => inferInstanceAs (ContinuousSMul ℝ (Plane →L[ℝ] ℝ))
22
+ local instance exactFastSectionNormed (p : M) : NormedAddCommGroup (CovariantTwoTensor p) :=
23
+ inferInstanceAs (NormedAddCommGroup TensorFiber)
24
+ local instance exactFastSectionSpace (p : M) : NormedSpace ℝ (CovariantTwoTensor p) :=
25
+ inferInstanceAs (NormedSpace ℝ TensorFiber)
26
+ namespace SmoothingAtlas
27
+ variable (A : SmoothingAtlas M)
28
+
29
+ /-- Quantitative finite-accuracy data supplied by the actual primitive construction. -/
30
+ def GeometricFastFamily (g : SmoothMetric M) (R c b V₀ : ℝ) : Prop :=
31
+ ∀ N : ℕ, ∃ η C Cv : ℝ, 0 < η ∧ 0 ≤ C ∧ 0 ≤ Cv ∧
32
+ ∀ z : ℝ, 0 < z → z < η → ∃ F : M → Space,
33
+ ContMDiff planeModel spaceModel ∞ F ∧
34
+ A.WeightedBound 1 0 V₀ F ∧ A.WeightedBound z 442 Cv F ∧
35
+ A.ShiftedBound 2 440 z (Cv/z^2) F ∧
36
+ A.TensorWeightedBound 1 440 (C*z^(N+1)) (inducedTensor F-g.inner) ∧
37
+ ∀ i x, x ∈ (modeSupport (A.chartWeightCompact i) : Set SmallModes.Base) →
38
+ ‖firstJetPair (spaceCoordinates ∘ A.vectorPlaneRead i F) x‖ ≤ R ∧
39
+ c ≤ NormalFrame.gramDet
40
+ (firstJetPair (spaceCoordinates ∘ A.vectorPlaneRead i F) x).1
41
+ (firstJetPair (spaceCoordinates ∘ A.vectorPlaneRead i F) x).2 ∧
42
+ b ≤ ‖realSecondTensor (spaceCoordinates ∘ A.vectorPlaneRead i F) x‖
43
+
44
+ /-- Retain a proved property of the actual finite-accuracy approximant. -/
45
+ def GeometricFastFamilyWithProperty (g : SmoothMetric M) (R c b V₀ : ℝ) (property : ℝ → (M → Space) → Prop) : Prop :=
46
+ ∀ N : ℕ, ∃ η C Cv : ℝ, 0 < η ∧ 0 ≤ C ∧ 0 ≤ Cv ∧
47
+ ∀ z : ℝ, 0 < z → z < η → ∃ F : M → Space,
48
+ ContMDiff planeModel spaceModel ∞ F ∧ property z F ∧
49
+ A.WeightedBound 1 0 V₀ F ∧ A.WeightedBound z 442 Cv F ∧
50
+ A.ShiftedBound 2 440 z (Cv/z^2) F ∧
51
+ A.TensorWeightedBound 1 440 (C*z^(N+1)) (inducedTensor F-g.inner) ∧
52
+ ∀ i x, x ∈ (modeSupport (A.chartWeightCompact i) : Set SmallModes.Base) →
53
+ ‖firstJetPair (spaceCoordinates ∘ A.vectorPlaneRead i F) x‖ ≤ R ∧
54
+ c ≤ NormalFrame.gramDet
55
+ (firstJetPair (spaceCoordinates ∘ A.vectorPlaneRead i F) x).1
56
+ (firstJetPair (spaceCoordinates ∘ A.vectorPlaneRead i F) x).2 ∧
57
+ b ≤ ‖realSecondTensor (spaceCoordinates ∘ A.vectorPlaneRead i F) x‖
58
+
59
+ theorem exact_metric_with_property (g : SmoothMetric M)
60
+ (houter : ∀ i p, p ∈ tsupport (A.weight i) → A.outer i =ᶠ[𝓝 p] (fun _ => 1))
61
+ (R c b V₀ : ℝ) (hc : 0 < c) (hb : 0 < b) (hV₀ : 0 ≤ V₀)
62
+ (property : ℝ → (M → Space) → Prop)
63
+ (hfamily : A.GeometricFastFamilyWithProperty g R c b V₀ property) :
64
+ ∃ B : ℝ, 1 ≤ B ∧ ∀ ζ : ℝ, 0 < ζ → ∀ K : ℝ, 0 < K →
65
+ ∃ z : ℝ, 0 < z ∧ z < ζ ∧ z ≤ 1 ∧ ∃ F G : M → Space,
66
+ ContMDiff planeModel spaceModel ∞ F ∧ property z F ∧ IsSmoothIsometricImmersion M g G ∧
67
+ A.WeightedBound 1 2 (z^8/K) (G-F) ∧
68
+ (∀ i, WeightedEstimates.WeightedBound univ (z^2) 3 B
69
+ (spaceCoordinates ∘ A.vectorPlaneRead i F)) ∧
70
+ ∀ i x, x ∈ (modeSupport (A.chartWeightCompact i) : Set SmallModes.Base) →
71
+ ‖firstJetPair (spaceCoordinates ∘ A.vectorPlaneRead i F) x‖ ≤ R ∧
72
+ c ≤ NormalFrame.gramDet
73
+ (firstJetPair (spaceCoordinates ∘ A.vectorPlaneRead i F) x).1
74
+ (firstJetPair (spaceCoordinates ∘ A.vectorPlaneRead i F) x).2 ∧
75
+ b ≤ ‖realSecondTensor (spaceCoordinates ∘ A.vectorPlaneRead i F) x‖ := by
76
+ obtain ⟨B,hB,hreads⟩ := A.uniform_rescaled_read_bound V₀ hV₀
77
+ refine ⟨B,hB,?_⟩
78
+ intro ζ hζ
79
+ obtain ⟨z₀,a,D,hz₀,hz₀1,ha,hD,hprep⟩ :=
80
+ A.anchored_prepared_correction g houter R c B b hc (zero_le_one.trans hB) hb
81
+ let P : ℝ → ℝ := fun x => x^2
82
+ have hP : HasPolynomialBound P := polynomialBound_id.pow 2
83
+ obtain ⟨Budget,EpsInv,hBudget,hEpsInv,hdata⟩ := hprep P P hP hP
84
+ obtain ⟨ν,hν,N,hinit⟩ := ExactCorrection.polynomial_prepared_initialization EpsInv hEpsInv
85
+ obtain ⟨ηf,C,Cv,hηf,hC,hCv,hf⟩ := hfamily N
86
+ obtain ⟨Dg,hDg,hg⟩ := A.exists_bundle_bound A.tensorTriv A.tensorTriv_domain 440 g.contMDiff
87
+ let H := max C Cv
88
+ have hH : 0 ≤ H := hC.trans (le_max_left _ _)
89
+ have hCH : C ≤ H := le_max_left _ _
90
+ have hCvH : Cv ≤ H := le_max_right _ _
91
+ obtain ⟨ηr,hηr,hηr1,hr⟩ := hreads Cv hCv
92
+ obtain ⟨ηb,hηb,_,hbase⟩ := ExactCorrection.positive_power_threshold Cv 2 1 (by norm_num) zero_lt_one
93
+ intro K hK
94
+ obtain ⟨ηi,hηi,hηi1,hi⟩ := hinit H Dg (a/16) D K hH hDg (by positivity) hD hK
95
+ let η := min z₀ (min ηf (min ηr (min ηb (min ηi ζ))))
96
+ have hη : 0 < η := lt_min hz₀ (lt_min hηf (lt_min hηr (lt_min hηb (lt_min hηi hζ))))
97
+ let z := η/2
98
+ have hz : 0 < z := half_pos hη
99
+ have hzη : z < η := half_lt_self hη
100
+ have hzz₀ : z < z₀ := hzη.trans_le (min_le_left _ _)
101
+ have hzf : z < ηf := hzη.trans_le ((min_le_right _ _).trans (min_le_left _ _))
102
+ have hzr : z < ηr := hzη.trans_le ((min_le_right _ _).trans ((min_le_right _ _).trans (min_le_left _ _)))
103
+ have hzb : z < ηb := hzη.trans_le ((min_le_right _ _).trans ((min_le_right _ _).trans ((min_le_right _ _).trans (min_le_left _ _))))
104
+ have hziζ : z < min ηi ζ := hzη.trans_le ((min_le_right _ _).trans ((min_le_right _ _).trans ((min_le_right _ _).trans (min_le_right _ _))))
105
+ have hzi := hziζ.trans_le (min_le_left _ _)
106
+ have hzζ := hziζ.trans_le (min_le_right _ _)
107
+ have hz1 : z ≤ 1 := hzz₀.le.trans hz₀1
108
+ have hzsq : z^2 ≤ z := by simpa only [pow_one] using pow_le_pow_of_le_one hz.le hz1 (by norm_num : 1 ≤ 2)
109
+ obtain ⟨F,hF,hproperty,hFzero,hFwb,hFshift,herr,hgeom⟩ := hf z hz hzf
110
+ have hFread := hr z hz hzr F hF hFzero (fun i => (hFwb i).mono_order (by omega))
111
+ have hsmall : Cv*z^2 ≤ 1 := by
112
+ simpa only [Real.rpow_ofNat] using (hbase z hz hzb).le
113
+ have hFbase : A.ShiftedBound 2 0 1 (P ((z^2)⁻¹)) F := by
114
+ intro i j hj x
115
+ have hj0 : j-2 = 0 := by omega
116
+ have hh := hFshift i j (by omega) x
117
+ simp only [hj0,pow_zero,one_mul] at hh ⊢
118
+ apply hh.trans
119
+ change Cv/z^2 ≤ ((z^2)⁻¹)^2
120
+ apply (div_le_iff₀ (pow_pos hz 2)).mpr
121
+ have heq : ((z^2)⁻¹)^2*z^2 = 1/z^2 := by field_simp
122
+ rw [heq]
123
+ exact (le_div_iff₀ (pow_pos hz 2)).mpr hsmall
124
+ obtain ⟨p,hpa,hprho,hpbudget,hpWish,hpε⟩ := hdata (z^2) (pow_pos hz 2)
125
+ (hzsq.trans hzz₀.le)
126
+ F hF hFread hgeom hFbase
127
+ have hρ : p.ρ = z^8/D := by rw [hprho]; congr 1; ring
128
+ have hbudget : 1/z^4 ≤ p.budget := by
129
+ have hPval : P ((z^2)⁻¹) = 1/z^4 := by dsimp [P]; field_simp
130
+ rw [hPval] at hpWish
131
+ linarith [p.budget_pos]
132
+ obtain ⟨htz,ht32,htε,hMB,hHB,hnear,herror,hcontrol⟩ := hi z hz hzi
133
+ have ht : 0 < z^ν := Real.rpow_pos_of_pos hz _
134
+ have ht1 : z^ν ≤ 1 := by linarith
135
+ have hmap : A.ShiftedBound 2 440 z (H/z^2) F := by
136
+ intro i j hj x
137
+ exact (hFshift i j hj x).trans (div_le_div_of_nonneg_right hCvH (sq_nonneg z))
138
+ have hmap0 : A.ShiftedBound 2 0 1 (H/z^2) F := by
139
+ intro i j hj x
140
+ have hj0 : j-2 = 0 := by omega
141
+ simpa only [hj0,pow_zero,one_mul] using hmap i j (by omega) x
142
+ have hmetric0 : A.TensorWeightedBound 1 0 Dg g.inner := fun i => (hg i).mono_order (by omega)
143
+ have herror' : A.TensorWeightedBound (z^ν) 440 (((z^ν)^(10 : ℝ))^2*(a/16))
144
+ (inducedTensor F-g.inner) := by
145
+ intro i
146
+ apply ((herr i).shrink_scale ht.le ht1).mono_const
147
+ exact (mul_le_mul_of_nonneg_right hCH (pow_nonneg hz.le _)).trans herror
148
+ obtain ⟨seed,hseed⟩ := p.initial_stage_of_scaled_bounds hF ht ht32
149
+ (htε _ (p.ε_pos 0) hpε) hz htz (by positivity) (by positivity) hDg (by positivity)
150
+ hmap0 hmap hmetric0 hg herror' (hMB.trans hbudget) (hHB.trans hbudget)
151
+ (by rwa [hρ]) (by rw [hpa]; linarith)
152
+ obtain ⟨G,hG,hclose⟩ := p.exact_correction_initial_displacement hF ht ht32
153
+ (by positivity) hmap0 seed hseed
154
+ rw [hρ] at hclose
155
+ exact ⟨z,hz,hzζ,hz1,F,G,hF,hproperty,hG,(fun i => (hclose i).mono_const hcontrol),hFread,hgeom⟩
156
+
157
+ /-- The original geometric conclusion, with no extra property requested. -/
158
+ theorem exact_metric_from_fast_family (g : SmoothMetric M)
159
+ (houter : ∀ i p, p ∈ tsupport (A.weight i) → A.outer i =ᶠ[𝓝 p] (fun _ => 1))
160
+ (R c b V₀ : ℝ) (hc : 0 < c) (hb : 0 < b) (hV₀ : 0 ≤ V₀)
161
+ (hfamily : A.GeometricFastFamily g R c b V₀) :
162
+ ∃ B : ℝ, 1 ≤ B ∧ ∀ ζ : ℝ, 0 < ζ → ∀ K : ℝ, 0 < K →
163
+ ∃ z : ℝ, 0 < z ∧ z < ζ ∧ z ≤ 1 ∧ ∃ F G : M → Space,
164
+ ContMDiff planeModel spaceModel ∞ F ∧ IsSmoothIsometricImmersion M g G ∧
165
+ A.WeightedBound 1 2 (z^8/K) (G-F) ∧
166
+ (∀ i, WeightedEstimates.WeightedBound univ (z^2) 3 B
167
+ (spaceCoordinates ∘ A.vectorPlaneRead i F)) ∧
168
+ ∀ i x, x ∈ (modeSupport (A.chartWeightCompact i) : Set SmallModes.Base) →
169
+ ‖firstJetPair (spaceCoordinates ∘ A.vectorPlaneRead i F) x‖ ≤ R ∧
170
+ c ≤ NormalFrame.gramDet
171
+ (firstJetPair (spaceCoordinates ∘ A.vectorPlaneRead i F) x).1
172
+ (firstJetPair (spaceCoordinates ∘ A.vectorPlaneRead i F) x).2 ∧
173
+ b ≤ ‖realSecondTensor (spaceCoordinates ∘ A.vectorPlaneRead i F) x‖ := by
174
+ have hdecorated : A.GeometricFastFamilyWithProperty g R c b V₀ (fun _ _ => True) := by
175
+ intro N
176
+ obtain ⟨η,C,Cv,hη,hC,hCv,hf⟩ := hfamily N
177
+ refine ⟨η,C,Cv,hη,hC,hCv,?_⟩
178
+ intro z hz hzη
179
+ obtain ⟨F,hF,hFzero,hFwb,hFshift,herr,hgeom⟩ := hf z hz hzη
180
+ exact ⟨F,hF,trivial,hFzero,hFwb,hFshift,herr,hgeom⟩
181
+ obtain ⟨B,hB,hall⟩ := A.exact_metric_with_property g houter R c b V₀ hc hb hV₀
182
+ (fun _ _ => True) hdecorated
183
+ refine ⟨B,hB,?_⟩
184
+ intro ζ hζ K hK
185
+ obtain ⟨z,hz,hzζ,hz1,F,G,hF,_,hG,hclose,hread,hgeom⟩ := hall ζ hζ K hK
186
+ exact ⟨z,hz,hzζ,hz1,F,G,hF,hG,hclose,hread,hgeom⟩
187
+
188
+ end SmoothingAtlas
189
+ end ClosedSurfaceR4.FiniteOrderSmoothing
190
+
191
+ end
192
+
193
+ end OAI
lean/OAI/Geometry/SurfaceImmersion/Geometry/ExactGeometricFastFamily.lean ADDED
@@ -0,0 +1,102 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Geometry.SurfaceImmersion.Geometry.ExactFastFamily
2
+ import OAI.Geometry.SurfaceImmersion.Geometry.UniformFastNormalMargin
3
+ import OAI.Geometry.SurfaceImmersion.Atlas.AtlasImmersionGeometry
4
+
5
+ namespace OAI
6
+
7
+ /-! Exact limits retain the geometric hypotheses needed for the next primitive. -/
8
+ noncomputable section
9
+ open Set Manifold Bundle
10
+ open scoped ContDiff Manifold Topology BigOperators
11
+ namespace ClosedSurfaceR4.FiniteOrderSmoothing
12
+ open RealModes JetPolynomial JetPolynomial.Perturbation
13
+ local instance exactGeometricFastFiberNormed : NormedAddCommGroup TensorFiber := inferInstance
14
+ local instance exactGeometricFastFiberSpace : NormedSpace ℝ TensorFiber := inferInstance
15
+ variable {M : Type*} [TopologicalSpace M] [ChartedSpace Plane M]
16
+ [IsManifold planeModel ∞ M] [CompactSpace M]
17
+ local instance exactGeometricFastDualAdd : ∀ p : M, ContinuousAdd (TangentSpace planeModel p →L[ℝ] ℝ) :=
18
+ fun _ => inferInstanceAs (ContinuousAdd (Plane →L[ℝ] ℝ))
19
+ local instance exactGeometricFastDualSmul : ∀ p : M, ContinuousSMul ℝ (TangentSpace planeModel p →L[ℝ] ℝ) :=
20
+ fun _ => inferInstanceAs (ContinuousSMul ℝ (Plane →L[ℝ] ℝ))
21
+ local instance exactGeometricFastSectionNormed (p : M) : NormedAddCommGroup (CovariantTwoTensor p) :=
22
+ inferInstanceAs (NormedAddCommGroup TensorFiber)
23
+ local instance exactGeometricFastSectionSpace (p : M) : NormedSpace ℝ (CovariantTwoTensor p) :=
24
+ inferInstanceAs (NormedSpace ℝ TensorFiber)
25
+ namespace SmoothingAtlas
26
+ variable (A : SmoothingAtlas M)
27
+
28
+ theorem exact_geometric_metric_with_property [T2Space M] (g : SmoothMetric M)
29
+ (houter : ∀ i p, p ∈ tsupport (A.weight i) → A.outer i =ᶠ[𝓝 p] (fun _ => 1))
30
+ (R c b V₀ : ℝ) (hc : 0 < c) (hb : 0 < b) (hV₀ : 0 ≤ V₀)
31
+ (property : ℝ → (M → Space) → Prop)
32
+ (hfamily : A.GeometricFastFamilyWithProperty g R c b V₀ property)
33
+ (ζ : ℝ) (hζ : 0 < ζ) :
34
+ ∃ z : ℝ, 0 < z ∧ z < ζ ∧ z ≤ 1 ∧ ∃ F G : M → Space,
35
+ ContMDiff planeModel spaceModel ∞ F ∧ property z F ∧
36
+ IsSmoothIsometricImmersion M g G ∧ Nonempty (MetricGoodPhaseData g G) ∧
37
+ A.WeightedBound 1 2 (z^8) (G-F) := by
38
+ obtain ⟨B,hB,hall⟩ := A.exact_metric_with_property g houter R c b V₀ hc hb hV₀ property hfamily
39
+ obtain ⟨η,hη,hη1,hnormal⟩ := uniform_fast_normal_margin R c B b hc (zero_le_one.trans hB) hb
40
+ obtain ⟨D,hD,hball⟩ := A.readJetBall_radius
41
+ obtain ⟨z,hz,hzcap,hz1,F,G,hF,hproperty,hG,hclose,hread,hgeom⟩ :=
42
+ hall (min η ζ) (lt_min hη hζ) D (zero_lt_one.trans_le hD)
43
+ have hzη := hzcap.trans_le (min_le_left _ _)
44
+ have hzζ := hzcap.trans_le (min_le_right _ _)
45
+ have hclose' : A.WeightedBound 1 2 ((z^2)^4/D) (G-F) := by
46
+ convert hclose using 1; ring
47
+ have hjet := hball (z^2) F G hF hG.1 hclose'
48
+ have hsη : z^2 ≤ η := (show z^2 ≤ z from by
49
+ simpa only [pow_one] using pow_le_pow_of_le_one hz.le hz1 (by norm_num : 1 ≤ 2)).trans hzη.le
50
+ have hlocal := fun i x hx => hnormal (z^2) (pow_pos hz 2) hsη
51
+ (spaceCoordinates ∘ A.vectorPlaneRead i F) (spaceCoordinates ∘ A.vectorPlaneRead i G)
52
+ (spaceCoordinates.contDiff.comp (A.vectorPlaneRead_smooth i hF)) (hread i) x
53
+ (hgeom i x hx).1 (hgeom i x hx).2.1 (hgeom i x hx).2.2
54
+ (hjet.2 i x hx).1 (hjet.2 i x hx).2
55
+ have hgeometry := A.geometry_of_chartwise_good hG.1 houter (by
56
+ intro p
57
+ obtain ⟨i,hi⟩ : ∃ i : A.centers, A.weight i p ≠ 0 := by
58
+ by_contra! hz
59
+ have hh := A.partition p
60
+ simp only [hz,zero_pow (by decide : 2 ≠ 0),Finset.sum_const_zero] at hh
61
+ norm_num at hh
62
+ have hp : p ∈ tsupport (A.weight i) := subset_tsupport _ hi
63
+ have hx : planeCoordinateIsometry (chart (i : M) p) ∈
64
+ (modeSupport (A.chartWeightCompact i) : Set SmallModes.Base) :=
65
+ ⟨chart (i : M) p,⟨p,hp,rfl⟩,rfl⟩
66
+ obtain ⟨hI,hN⟩ := hlocal i _ hx
67
+ have hNZ : realSecondTensor (spaceCoordinates ∘ A.vectorPlaneRead i G)
68
+ (planeCoordinateIsometry (chart (i : M) p)) ≠ 0 :=
69
+ norm_pos_iff.mp ((half_pos hb).trans_le hN)
70
+ obtain ⟨ξ,Q,_,_,hgood,_⟩ := PhaseGeometry.positive_good_phase_data hNZ
71
+ (H₀ := ![(1:ℝ),0,1]) (by simp) (by simp)
72
+ exact ⟨i,hp,hI,ξ 0,hgood 0⟩)
73
+ refine ⟨z,hz,hzζ,hz1,F,G,hF,hproperty,hG,
74
+ MetricGoodPhaseData.nonempty g hG.1 hgeometry.1 hgeometry.2,?_⟩
75
+ intro i
76
+ apply (hclose i).mono_const
77
+ apply (div_le_iff₀ (zero_lt_one.trans_le hD)).mpr
78
+ nlinarith [mul_le_mul_of_nonneg_left hD (pow_nonneg hz.le 8)]
79
+
80
+ /-- The geometric conclusion after forgetting the approximant. -/
81
+ theorem exact_geometric_metric_from_fast_family [T2Space M] (g : SmoothMetric M)
82
+ (houter : ∀ i p, p ∈ tsupport (A.weight i) → A.outer i =ᶠ[𝓝 p] (fun _ => 1))
83
+ (R c b V₀ : ℝ) (hc : 0 < c) (hb : 0 < b) (hV₀ : 0 ≤ V₀)
84
+ (hfamily : A.GeometricFastFamily g R c b V₀) :
85
+ ∃ G : M → Space, IsSmoothIsometricImmersion M g G ∧ Nonempty (MetricGoodPhaseData g G) := by
86
+ have hdecorated : A.GeometricFastFamilyWithProperty g R c b V₀ (fun _ _ => True) := by
87
+ intro N
88
+ obtain ⟨η,C,Cv,hη,hC,hCv,hf⟩ := hfamily N
89
+ refine ⟨η,C,Cv,hη,hC,hCv,?_⟩
90
+ intro z hz hzη
91
+ obtain ⟨F,hF,hFzero,hFwb,hFshift,herr,hgeom⟩ := hf z hz hzη
92
+ exact ⟨F,hF,trivial,hFzero,hFwb,hFshift,herr,hgeom⟩
93
+ obtain ⟨z,hz,hz1,_,F,G,hF,_,hG,hgeometry,_⟩ := A.exact_geometric_metric_with_property
94
+ g houter R c b V₀ hc hb hV₀ (fun _ _ => True) hdecorated 1 zero_lt_one
95
+ exact ⟨G,hG,hgeometry⟩
96
+
97
+ end SmoothingAtlas
98
+ end ClosedSurfaceR4.FiniteOrderSmoothing
99
+
100
+ end
101
+
102
+ end OAI
lean/OAI/Geometry/SurfaceImmersion/Geometry/ExactInputRecurrence.lean ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Geometry.SurfaceImmersion.Geometry.GlobalInputRecurrence
2
+ import OAI.Geometry.SurfaceImmersion.Geometry.ExactInputRecurrenceBound
3
+ import OAI.Geometry.SurfaceImmersion.Geometry.ExactScaleOrdering
4
+
5
+ namespace OAI
6
+
7
+ /-! The actual next map and normalized defect satisfy the waiting recurrence. -/
8
+ noncomputable section
9
+ open Set Manifold Bundle
10
+ open scoped ContDiff Manifold Topology
11
+ namespace ClosedSurfaceR4.FiniteOrderSmoothing
12
+ local instance exactInputFiberNormed : NormedAddCommGroup TensorFiber := inferInstance
13
+ local instance exactInputFiberSpace : NormedSpace ℝ TensorFiber := inferInstance
14
+ variable {M : Type*} [TopologicalSpace M] [ChartedSpace Plane M]
15
+ [IsManifold planeModel ∞ M] [CompactSpace M]
16
+ namespace SmoothingAtlas
17
+ variable (A : SmoothingAtlas M)
18
+
19
+ theorem exact_scale_input_recurrence {g : SmoothMetric M} {G U : M → Space}
20
+ (hG : ContMDiff planeModel spaceModel ∞ G) (hU : ContMDiff planeModel spaceModel ∞ U)
21
+ {t P P₀ Pm B C L B₀ δ' : ℝ} {k m : ℕ}
22
+ (ht : 0 < t) (ht1 : t ≤ 1) (hk : 10 ≤ k)
23
+ (hP : 0 ≤ P) (hP₀ : 0 ≤ P₀) (hPm : 0 ≤ Pm)
24
+ (hB : 0 ≤ B) (hC : 0 ≤ C) (hL : 0 ≤ L) (hB₀ : 0 ≤ B₀)
25
+ (hp : A.ShiftedBound 2 0 t P G)
26
+ (hc : A.ShiftedBound 2 m t C G)
27
+ (hu : A.WeightedBound (t^(6/5 : ℝ)) (2+m) (B*(t^(k : ℝ)*t^(6/5 : ℝ))) U)
28
+ (ht₀ : A.TensorWeightedBound 1 0 P₀ g.inner)
29
+ (htm : A.TensorWeightedBound 1 m Pm g.inner)
30
+ (he : A.TensorWeightedBound (t^(6/5 : ℝ)) m (L*(1+B₀+C)*t^(1/5 : ℝ))
31
+ (normalizedTensorDefect g.inner δ' (G+U)-g.inner)) :
32
+ A.InputBound (t^(6/5 : ℝ)) m
33
+ (P+P₀+(Pm+B+L*(1+B₀)+1+L)*t^(1/5 : ℝ)*(1+C))
34
+ (G+U) (normalizedTensorDefect g.inner δ' (G+U)) := by
35
+ have hτ : 0 < t^(6/5 : ℝ) := Real.rpow_pos_of_pos ht _
36
+ obtain ⟨_,_,hτs,hst⟩ := ExactCorrection.exact_scale_order ht ht1 hk
37
+ have hτt := hτs.trans hst
38
+ have hh := A.next_input_bound g.contMDiff hG hU ht hτ hτt (hτt.trans ht1)
39
+ hP hP₀ hPm hC (mul_nonneg hB (mul_nonneg (Real.rpow_nonneg ht.le _) hτ.le))
40
+ (mul_nonneg (mul_nonneg hL (by linarith)) (Real.rpow_nonneg ht.le _))
41
+ hp hc hu ht₀ htm he
42
+ have hsize := ExactCorrection.exact_input_recurrence_bound ht ht1 hk hPm hB hC hL hB₀
43
+ (P := P) (P₀ := P₀)
44
+ constructor
45
+ · intro i j hj x
46
+ exact (hh.1 i j hj x).trans hsize
47
+ · intro i
48
+ exact (hh.2 i).mono_const hsize
49
+
50
+ end SmoothingAtlas
51
+ end ClosedSurfaceR4.FiniteOrderSmoothing
52
+
53
+ end
54
+
55
+ end OAI
lean/OAI/Geometry/SurfaceImmersion/Geometry/ExactInputRecurrenceBound.lean ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Geometry.SurfaceImmersion.Correction.CorrectionScaleAlgebra
2
+
3
+ namespace OAI
4
+
5
+ /-! The two components of the actual input share a contracting affine bound. -/
6
+ noncomputable section
7
+ namespace ClosedSurfaceR4.ExactCorrection
8
+
9
+ theorem exact_input_recurrence_bound {t P P₀ Pm B C L B₀ : ℝ} {k : ℕ}
10
+ (ht : 0 < t) (ht1 : t ≤ 1) (hk : 10 ≤ k)
11
+ (hPm : 0 ≤ Pm) (hB : 0 ≤ B) (hC : 0 ≤ C) (hL : 0 ≤ L) (hB₀ : 0 ≤ B₀) :
12
+ P+P₀+t^(6/5 : ℝ)*Pm+(t^(6/5 : ℝ)/t)*C+
13
+ (B*(t^(k : ℝ)*t^(6/5 : ℝ)))/(t^(6/5 : ℝ))^2+
14
+ L*(1+B₀+C)*t^(1/5 : ℝ) ≤
15
+ P+P₀+(Pm+B+L*(1+B₀)+1+L)*t^(1/5 : ℝ)*(1+C) := by
16
+ have hk' : (10 : ℝ) ≤ k := by exact_mod_cast hk
17
+ have hτ : t^(6/5 : ℝ) ≤ t^(1/5 : ℝ) :=
18
+ Real.rpow_le_rpow_of_exponent_ge ht ht1 (by norm_num)
19
+ have hratio : t^(6/5 : ℝ)/t = t^(1/5 : ℝ) := by
20
+ conv_lhs => rhs; rw [← Real.rpow_one t]
21
+ rw [← Real.rpow_sub ht]
22
+ norm_num
23
+ have hquotient : (t^(k : ℝ)*t^(6/5 : ℝ))/(t^(6/5 : ℝ))^2 =
24
+ t^((k : ℝ)-(6/5 : ℝ)) := by
25
+ rw [← Real.rpow_natCast,← Real.rpow_mul ht.le,scale_quotient_product ht]
26
+ congr 1
27
+ ring
28
+ have hquotient_le : (t^(k : ℝ)*t^(6/5 : ℝ))/(t^(6/5 : ℝ))^2 ≤ t^(1/5 : ℝ) := by
29
+ rw [hquotient]
30
+ exact Real.rpow_le_rpow_of_exponent_ge ht ht1 (by linarith)
31
+ have hterm : (B*(t^(k : ℝ)*t^(6/5 : ℝ)))/(t^(6/5 : ℝ))^2 ≤ B*t^(1/5 : ℝ) := by
32
+ rw [mul_div_assoc]
33
+ exact mul_le_mul_of_nonneg_left hquotient_le hB
34
+ calc
35
+ _ ≤ P+P₀+t^(1/5 : ℝ)*Pm+t^(1/5 : ℝ)*C+B*t^(1/5 : ℝ)+
36
+ L*(1+B₀+C)*t^(1/5 : ℝ) := by
37
+ rw [hratio]
38
+ gcongr
39
+ _ = P+P₀+(Pm+C+B+L*(1+B₀+C))*t^(1/5 : ℝ) := by ring
40
+ _ ≤ _ := by
41
+ apply add_le_add le_rfl
42
+ rw [mul_assoc _ _ (1+C),mul_comm (t^(1/5 : ℝ)) (1+C),← mul_assoc]
43
+ apply mul_le_mul_of_nonneg_right _ (Real.rpow_nonneg ht.le _)
44
+ nlinarith [mul_nonneg hPm hC,mul_nonneg hB hC,
45
+ mul_nonneg (mul_nonneg hL hB₀) hC]
46
+
47
+ end ClosedSurfaceR4.ExactCorrection
48
+
49
+ end
50
+
51
+ end OAI
lean/OAI/Geometry/SurfaceImmersion/Geometry/ExactScaleOrdering.lean ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Geometry.SurfaceImmersion.Correction.CorrectionScaleAlgebra
2
+
3
+ namespace OAI
4
+
5
+ /-! Positivity and ordering of the actual scales in each correction step. -/
6
+ noncomputable section
7
+
8
+ namespace ClosedSurfaceR4.ExactCorrection
9
+
10
+ theorem exact_scale_positive {t : ℝ} (ht : 0 < t) (k : ℕ) :
11
+ 0 < t^((6/5 : ℝ)*((k : ℝ)+1)) ∧ 0 < t^(k : ℝ) ∧
12
+ 0 < t^(6/5 : ℝ) ∧ 0 < t^(11/10 : ℝ) :=
13
+ ⟨Real.rpow_pos_of_pos ht _,Real.rpow_pos_of_pos ht _,
14
+ Real.rpow_pos_of_pos ht _,Real.rpow_pos_of_pos ht _⟩
15
+
16
+ theorem exact_scale_order {t : ℝ} (ht : 0 < t) (ht1 : t ≤ 1) {k : ℕ} (hk : 10 ≤ k) :
17
+ t^((6/5 : ℝ)*((k : ℝ)+1)) ≤ t^(k : ℝ) ∧
18
+ t^(k : ℝ) ≤ t^(6/5 : ℝ) ∧ t^(6/5 : ℝ) ≤ t^(11/10 : ℝ) ∧
19
+ t^(11/10 : ℝ) ≤ t := by
20
+ have hk' : (10 : ℝ) ≤ k := by exact_mod_cast hk
21
+ refine ⟨Real.rpow_le_rpow_of_exponent_ge ht ht1 (by linarith),
22
+ Real.rpow_le_rpow_of_exponent_ge ht ht1 (by linarith),
23
+ Real.rpow_le_rpow_of_exponent_ge ht ht1 (by norm_num),?_⟩
24
+ simpa only [Real.rpow_one] using
25
+ Real.rpow_le_rpow_of_exponent_ge ht ht1 (show (1 : ℝ) ≤ 11/10 by norm_num)
26
+
27
+ theorem next_amplitude_scale {t : ℝ} (ht : 0 < t) (k : ℕ) :
28
+ t^((6/5 : ℝ)*((k : ℝ)+1)) = (t^(6/5 : ℝ))^(k+1) := by
29
+ rw [← Real.rpow_natCast,← Real.rpow_mul ht.le]
30
+ simp only [Nat.cast_add,Nat.cast_one]
31
+
32
+ theorem amplitude_scale_nat (t : ℝ) (k : ℕ) : t^(k : ℝ) = t^k :=
33
+ Real.rpow_natCast t k
34
+
35
+ end ClosedSurfaceR4.ExactCorrection
36
+
37
+ end
38
+
39
+ end OAI
lean/OAI/Geometry/SurfaceImmersion/Geometry/ExplicitFixedOrderThreshold.lean ADDED
@@ -0,0 +1,112 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Geometry.SurfaceImmersion.Correction.PolynomialPowerThreshold
2
+
3
+ namespace OAI
4
+
5
+ /-! The fixed-order scale conditions with one explicitly specified
6
+ threshold. Its reciprocal is polynomial in the finite numerical budgets. -/
7
+ noncomputable section
8
+ open scoped BigOperators
9
+ namespace ClosedSurfaceR4.ExactCorrection
10
+
11
+ def fixedOrderNumericalBudget (k : ℕ) (D B K : ℝ) (C : ℕ → ℝ) : ℝ :=
12
+ 2+D*B+K+∑ m ∈ Finset.range (k/2+1), |C m|
13
+
14
+ def fixedOrderThreshold (k : ℕ) (ρ a η D B K : ℝ) (C : ℕ → ℝ) : ℝ :=
15
+ powerThreshold 10 (fixedOrderNumericalBudget k D B K C) (min η (min (ρ/4) (a/8)))
16
+
17
+ theorem fixedOrderThreshold_spec (k : ℕ) (hk : 10 ≤ k)
18
+ (ρ a η D B K : ℝ) (hρ : 0 < ρ) (ha : 0 < a) (hη : 0 < η)
19
+ (hD : 0 ≤ D) (hB : 0 ≤ B) (hK : 0 ≤ K) (C : ℕ → ℝ) :
20
+ 0 < fixedOrderThreshold k ρ a η D B K C ∧
21
+ fixedOrderThreshold k ρ a η D B K C ≤ 1 ∧
22
+ ∀ t : ℝ, 0 < t → t < fixedOrderThreshold k ρ a η D B K C →
23
+ ∀ j : ℕ, k ≤ j → j ≤ k+1 →
24
+ t^(6/5 : ℝ)/t^(11/10 : ℝ) ≤ η ∧
25
+ D*B*(t^(11/10 : ℝ)/t)^(40*(k+1)) ≤ min (ρ/4) (a/8) ∧
26
+ (t^((6/5 : ℝ)*(j : ℝ))/t^(k : ℝ))^(2 : ℕ)*K ≤ a/8 ∧
27
+ (∀ m ≤ k/2, C m*(t^(k : ℝ)*t^(6/5 : ℝ))/(t^(6/5 : ℝ))^m ≤ ρ*t) ∧
28
+ t^((6/5 : ℝ)*(j : ℝ)) ≤ t^(k : ℝ) ∧
29
+ t^((6/5 : ℝ)*((k : ℝ)+1)) ≤ t^((6/5 : ℝ)*(j : ℝ)) := by
30
+ let M := 1+∑ m ∈ Finset.range (k/2+1), |C m|
31
+ let S := fixedOrderNumericalBudget k D B K C
32
+ let b := min η (min (ρ/4) (a/8))
33
+ have hsum : 0 ≤ ∑ m ∈ Finset.range (k/2+1), |C m| :=
34
+ Finset.sum_nonneg (fun _ _ => abs_nonneg _)
35
+ have hDB := mul_nonneg hD hB
36
+ have hS : 0 ≤ S := by dsimp [S, fixedOrderNumericalBudget]; linarith
37
+ have hS1 : 1 ≤ S := by dsimp [S, fixedOrderNumericalBudget]; linarith
38
+ have hSDB : D*B ≤ S := by dsimp [S, fixedOrderNumericalBudget]; linarith
39
+ have hSK : K ≤ S := by dsimp [S, fixedOrderNumericalBudget]; linarith
40
+ have hSM : M ≤ S := by dsimp [S, fixedOrderNumericalBudget, M]; linarith
41
+ have hb : 0 < b := lt_min hη (lt_min (by positivity) (by positivity))
42
+ have hε := powerThreshold_spec (n := 10) (by decide) hS hb
43
+ (show ((10 : ℕ) : ℝ)⁻¹ ≤ (1/10 : ℝ) by norm_num)
44
+ refine ⟨hε.1,hε.2.1,?_⟩
45
+ intro t ht htε j hkj hjk
46
+ have ht1 : t ≤ 1 := htε.le.trans hε.2.1
47
+ have hk' : (10 : ℝ) ≤ k := by exact_mod_cast hk
48
+ have hkj' : (k : ℝ) ≤ j := by exact_mod_cast hkj
49
+ have hjk' : (j : ℝ) ≤ (k : ℝ)+1 := by exact_mod_cast hjk
50
+ have hbound (c p : ℝ) (hc : c ≤ S) (hp : (1/10 : ℝ) ≤ p) : c*t^p ≤ b := by
51
+ have hh := (powerThreshold_spec (n := 10) (by decide) hS hb
52
+ (show ((10 : ℕ) : ℝ)⁻¹ ≤ p by norm_num; exact hp)).2.2 t ht htε
53
+ exact (mul_le_mul_of_nonneg_right hc (Real.rpow_nonneg ht.le _)).trans hh.le
54
+ have hr : t^(6/5 : ℝ)/t^(11/10 : ℝ) = t^(1/10 : ℝ) := by
55
+ rw [← Real.rpow_sub ht]
56
+ norm_num
57
+ have hs : t^(11/10 : ℝ)/t = t^(1/10 : ℝ) := by
58
+ conv_lhs => rhs; rw [← Real.rpow_one t]
59
+ rw [← Real.rpow_sub ht]
60
+ norm_num
61
+ have hpow : (t^(11/10 : ℝ)/t)^(40*(k+1)) = t^(4*((k : ℝ)+1)) := by
62
+ rw [hs,← Real.rpow_natCast,← Real.rpow_mul ht.le]
63
+ congr 1
64
+ push_cast
65
+ ring
66
+ have hδ : (t^((6/5 : ℝ)*(j : ℝ))/t^(k : ℝ))^(2 : ℕ) =
67
+ t^((12/5 : ℝ)*(j : ℝ)-2*(k : ℝ)) := by
68
+ rw [← Real.rpow_sub ht,← Real.rpow_natCast,← Real.rpow_mul ht.le]
69
+ congr 1
70
+ ring
71
+ refine ⟨?_,?_,?_,?_,?_,?_⟩
72
+ · rw [hr]
73
+ have hh := hbound 1 (1/10) hS1 le_rfl
74
+ simpa only [one_mul] using hh.trans (min_le_left _ _)
75
+ · rw [hpow]
76
+ exact (hbound (D*B) _ hSDB (by linarith)).trans (min_le_right _ _)
77
+ · rw [hδ,mul_comm]
78
+ exact (hbound K _ hSK (by linarith)).trans
79
+ ((min_le_right _ _).trans (min_le_right _ _))
80
+ · intro m hm
81
+ have hCM : C m ≤ M := by
82
+ have hh := Finset.single_le_sum (fun j (_ : j ∈ Finset.range (k/2+1)) => abs_nonneg (C j))
83
+ (Finset.mem_range.mpr (by omega : m < k/2+1))
84
+ have hc := le_abs_self (C m)
85
+ dsimp [M]
86
+ linarith
87
+ let e : ℝ := (k : ℝ)+(1/5 : ℝ)-(6/5 : ℝ)*(m : ℝ)
88
+ have hmk : 2*m ≤ k := by omega
89
+ have hmk' : (2 : ℝ)*(m : ℝ) ≤ (k : ℝ) := by exact_mod_cast hmk
90
+ have he : (1/10 : ℝ) ≤ e := by dsimp [e]; linarith
91
+ have heρ : C m*t^e ≤ ρ := (hbound (C m) e (hCM.trans hSM) he).trans (by
92
+ have hbρ : b ≤ ρ/4 := (min_le_right _ _).trans (min_le_left _ _)
93
+ linarith)
94
+ have hratio : (t^(k : ℝ)*t^(6/5 : ℝ))/(t^(6/5 : ℝ))^m = t^e*t := by
95
+ rw [← Real.rpow_natCast,← Real.rpow_mul ht.le,scale_quotient_product ht]
96
+ conv_rhs => rhs; rw [← Real.rpow_one t]
97
+ rw [← Real.rpow_add ht]
98
+ congr 1
99
+ dsimp [e]
100
+ ring
101
+ calc
102
+ _ = C m*((t^(k : ℝ)*t^(6/5 : ℝ))/(t^(6/5 : ℝ))^m) := by ring
103
+ _ = (C m*t^e)*t := by rw [hratio]; ring
104
+ _ ≤ ρ*t := mul_le_mul_of_nonneg_right heρ ht.le
105
+ · exact Real.rpow_le_rpow_of_exponent_ge ht ht1 (by linarith)
106
+ · exact Real.rpow_le_rpow_of_exponent_ge ht ht1 (by linarith)
107
+
108
+ end ClosedSurfaceR4.ExactCorrection
109
+
110
+ end
111
+
112
+ end OAI
lean/OAI/Geometry/SurfaceImmersion/Geometry/ExplicitPowerThreshold.lean ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Geometry.SurfaceImmersion.Geometry.FixedOrderThreshold
2
+ import OAI.Geometry.SurfaceImmersion.Correction.PolynomialBudgetAlgebra
3
+
4
+ namespace OAI
5
+
6
+ /-! Explicit integer-power thresholds for the finitely many real powers
7
+ used by the first correction block. -/
8
+ noncomputable section
9
+ namespace ClosedSurfaceR4.ExactCorrection
10
+
11
+ /-- The exponent of this threshold depends only on a lower bound for the
12
+ positive exponent, not on either numerical constant. -/
13
+ def powerThreshold (n : ℕ) (c b : ℝ) : ℝ := (min 1 (b/(c+1)))^n
14
+
15
+ theorem powerThreshold_spec {n : ℕ} (hn : 0 < n) {c b p : ℝ}
16
+ (hc : 0 ≤ c) (hb : 0 < b) (hp : (n : ℝ)⁻¹ ≤ p) :
17
+ 0 < powerThreshold n c b ∧ powerThreshold n c b ≤ 1 ∧
18
+ ∀ t : ℝ, 0 < t → t < powerThreshold n c b → c*t^p < b := by
19
+ let q := min 1 (b/(c+1))
20
+ have hq : 0 < q := lt_min zero_lt_one (div_pos hb (by linarith))
21
+ have hq1 : q ≤ 1 := min_le_left _ _
22
+ have hn' : 0 < (n : ℝ) := by exact_mod_cast hn
23
+ refine ⟨pow_pos hq n, pow_le_one₀ hq.le hq1,?_⟩
24
+ intro t ht hsmall
25
+ have ht1 : t ≤ 1 := hsmall.le.trans (pow_le_one₀ hq.le hq1)
26
+ have hroot : t^((n : ℝ)⁻¹) < q := by
27
+ have h := Real.rpow_lt_rpow ht.le hsmall (inv_pos.mpr hn')
28
+ change t^((n : ℝ)⁻¹) < (q^n)^((n : ℝ)⁻¹) at h
29
+ rwa [← Real.rpow_natCast, Real.rpow_rpow_inv hq.le hn'.ne'] at h
30
+ have htp : t^p < q :=
31
+ (Real.rpow_le_rpow_of_exponent_ge ht ht1 hp).trans_lt hroot
32
+ have hqb : (c+1)*q ≤ b := by
33
+ have h := (le_div_iff₀ (show 0 < c+1 by linarith)).mp
34
+ (show q ≤ b/(c+1) from min_le_right _ _)
35
+ nlinarith
36
+ calc
37
+ c*t^p ≤ (c+1)*t^p := mul_le_mul_of_nonneg_right (by linarith) (Real.rpow_nonneg ht.le _)
38
+ _ < (c+1)*q := mul_lt_mul_of_pos_left htp (by linarith)
39
+ _ ≤ b := hqb
40
+
41
+ /-- An upper bound on the reciprocal threshold follows from upper bounds
42
+ on the coefficient and reciprocal margin. -/
43
+ lemma powerThreshold_inverse_le {n : ℕ} {c b C B : ℝ}
44
+ (hc : 0 ≤ c) (hb : 0 < b) (hC : c ≤ C) (hB : b⁻¹ ≤ B) :
45
+ (powerThreshold n c b)⁻¹ ≤ (1+(C+1)*B)^n := by
46
+ have hC0 : 0 ≤ C := hc.trans hC
47
+ have hB0 : 0 ≤ B := (inv_pos.mpr hb).le.trans hB
48
+ have hq : 0 < min 1 (b/(c+1)) := lt_min zero_lt_one (div_pos hb (by linarith))
49
+ have hi : (min 1 (b/(c+1)))⁻¹ ≤ 1+(C+1)*B := by
50
+ have hh : (c+1)/b ≤ (C+1)*B := by
51
+ rw [div_eq_mul_inv]
52
+ exact mul_le_mul (by linarith) hB (inv_nonneg.mpr hb.le) (by linarith)
53
+ by_cases hle : b/(c+1) ≤ 1
54
+ · rw [min_eq_right hle, inv_div]
55
+ linarith
56
+ · rw [min_eq_left (le_of_not_ge hle), inv_one]
57
+ nlinarith
58
+ rw [powerThreshold, ← inv_pow]
59
+ exact pow_le_pow_left₀ (inv_nonneg.mpr hq.le) hi n
60
+
61
+ end ClosedSurfaceR4.ExactCorrection
62
+
63
+ end
64
+
65
+ end OAI