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

/-! The exact cutoff factor in the regularized wave current. -/

noncomputable section
namespace OAI.Analysis.Calculus.Current

open OAI.Analysis.Calculus.Quaternion
open scoped Matrix Matrix.Norms.Elementwise ContDiff

theorem currentDirection_snd {d : β„•} (p : Index d Γ— Fin 3) :
    (currentDirection p).2 = OAI.Analysis.Calculus.Quaternion.imaginaryDirection p.1 p.2 := by
  obtain ⟨a, α⟩ := p
  fin_cases Ξ± <;> simp [currentDirection, OAI.Analysis.Calculus.Quaternion.imaginaryDirection, OAI.Analysis.Calculus.Quaternion.imaginarySlot]
  funext i
  simp [Pi.single_apply]

theorem currentGradient_snd {d : β„•} {g : (Index d β†’ β„‚) β†’ ℝ}
    {x : Index d β†’ ℝ} {z : Index d β†’ β„‚} (hg : DifferentiableAt ℝ g z) :
    OAI.Analysis.Calculus.Quaternion.gradientMap OAI.Analysis.Calculus.Quaternion.threeSlots
      (fun p => fderiv ℝ (fun q : CurrentSpace d => g q.2) (x, z) (currentDirection p)) =
      OAI.Analysis.Calculus.Quaternion.imaginaryGradient g z := by
  have hF : fderiv ℝ (fun q : CurrentSpace d => g q.2) (x, z) =
      (fderiv ℝ g z).comp (ContinuousLinearMap.snd ℝ (Index d β†’ ℝ) (Index d β†’ β„‚)) := by
    simpa only using! (hg.hasFDerivAt.comp (x, z)
      (ContinuousLinearMap.snd ℝ (Index d β†’ ℝ) (Index d β†’ β„‚)).hasFDerivAt).fderiv
  funext a
  simp only [OAI.Analysis.Calculus.Quaternion.gradientMap, OAI.Analysis.Calculus.Quaternion.imaginaryGradient, hF, ContinuousLinearMap.comp_apply]
  change (βˆ‘ Ξ±, fderiv ℝ g z ((currentDirection (a, Ξ±)).2) β€’ OAI.Analysis.Calculus.Quaternion.threeSlots Ξ±) = _
  simp only [currentDirection_snd]

theorem current_smul_divergence_zero {d : β„•}
    {g : (Index d β†’ β„‚) β†’ ℝ}
    {A : (Index d β†’ ℝ) β†’ (Index d β†’ β„‚) β†’ Matrix (Index d) (Index d) OAI.Analysis.Calculus.Quaternion.Q}
    {x : Index d β†’ ℝ} {z : Index d β†’ β„‚}
    (hg : DifferentiableAt ℝ g z)
    (hA : DifferentiableAt ℝ (fun p : CurrentSpace d => A p.1 p.2) (x, z))
    (hG : star (OAI.Analysis.Calculus.Quaternion.imaginaryGradient g z) α΅₯* A x z = 0)
    (hdiv : βˆ€ b, OAI.Analysis.Calculus.Quaternion.strongDivergence OAI.Analysis.Calculus.Quaternion.threeSlots (threeSlotMatrixDerivative A x z) b = 0)
    (b : Index d) :
    OAI.Analysis.Calculus.Quaternion.strongDivergence OAI.Analysis.Calculus.Quaternion.threeSlots
      (threeSlotMatrixDerivative (fun q w => g w β€’ A q w) x z) b = 0 := by
  have hg' : DifferentiableAt ℝ (fun p : CurrentSpace d => g p.2) (x, z) :=
    hg.comp (x, z) differentiableAt_snd
  have hweighted : DifferentiableAt ℝ
      (fun p : CurrentSpace d => g p.2 β€’ A p.1 p.2) (x, z) := hg'.smul hA
  have hG' : star (OAI.Analysis.Calculus.Quaternion.gradientMap OAI.Analysis.Calculus.Quaternion.threeSlots
      (fun p => fderiv ℝ (fun q : CurrentSpace d => g q.2) (x, z) (currentDirection p)))
        α΅₯* A x z = 0 := by
    rw [currentGradient_snd hg]
    exact hG
  have h := OAI.Analysis.Calculus.Quaternion.strongDivergence_current_smul_zero OAI.Analysis.Calculus.Quaternion.threeSlots currentDirection hg' hA hG'
    (fun j => by simpa only [fderiv_currentDirection hA] using hdiv j) b
  simpa only [fderiv_currentDirection (A := fun q w => g w β€’ A q w) hweighted] using h

def cutoffCurrent {d : β„•} (g : β„‚ β†’ ℝ) (a : ℝ)
    (A : (Index d β†’ ℝ) β†’ (Index d β†’ β„‚) β†’ Matrix (Index d) (Index d) OAI.Analysis.Calculus.Quaternion.Q)
    (x : Index d β†’ ℝ) (z : Index d β†’ β„‚) : Matrix (Index d) (Index d) OAI.Analysis.Calculus.Quaternion.Q :=
  g (phi z / (a : β„‚)) β€’ A x z

theorem cutoffCurrent_divergence_zero {d : β„•} (g : β„‚ β†’ ℝ) (a : ℝ)
    {A : (Index d β†’ ℝ) β†’ (Index d β†’ β„‚) β†’ Matrix (Index d) (Index d) OAI.Analysis.Calculus.Quaternion.Q}
    {x : Index d β†’ ℝ} {z : Index d β†’ β„‚} (hY : z none β‰  0)
    (hg : DifferentiableAt ℝ g (phi z / (a : β„‚)))
    (hA : DifferentiableAt ℝ (fun p : CurrentSpace d => A p.1 p.2) (x, z))
    (htan : βˆ€ b, βˆ‘ c, complexK (phaseRow (ratio z) c) * A x z c b = 0)
    (hdiv : βˆ€ b, OAI.Analysis.Calculus.Quaternion.strongDivergence OAI.Analysis.Calculus.Quaternion.threeSlots (threeSlotMatrixDerivative A x z) b = 0)
    (b : Index d) :
    OAI.Analysis.Calculus.Quaternion.strongDivergence OAI.Analysis.Calculus.Quaternion.threeSlots (threeSlotMatrixDerivative (cutoffCurrent g a A) x z) b = 0 := by
  have hφ : DifferentiableAt ℂ (phi : (Index d → ℂ) → ℂ) z := by
    unfold phi
    fun_prop (disch := exact mul_ne_zero (two_ne_zero : (2 : β„‚) β‰  0) hY)
  have hscale : DifferentiableAt ℝ (fun q : β„‚ => q / (a : β„‚)) (phi z) := by fun_prop
  have hgscale : DifferentiableAt ℝ (fun q : β„‚ => g (q / (a : β„‚))) (phi z) :=
    hg.comp (phi z) hscale
  apply current_smul_divergence_zero (hgscale.comp z (hΟ†.restrictScalars ℝ)) hA
    _ hdiv b
  apply OAI.Analysis.Calculus.Quaternion.imaginaryGradient_real_comp_annihilates hφ hgscale
  simpa only [fderiv_phi_single z hY] using htan

theorem cutoffWaveCurrent_divergence_zero {d : β„•} {ΞΉ : Type*} [Fintype ΞΉ]
    (g : β„‚ β†’ ℝ) (a : ℝ) (ΞΊ cR cI : ΞΉ β†’ ℝ) (v : ΞΉ β†’ Fin d β†’ ℝ)
    (x : Index d β†’ ℝ) (z : Index d β†’ β„‚) (hY : z none β‰  0)
    (hg : DifferentiableAt ℝ g (phi z / (a : β„‚))) (b : Index d) :
    OAI.Analysis.Calculus.Quaternion.strongDivergence OAI.Analysis.Calculus.Quaternion.threeSlots
      (threeSlotMatrixDerivative (cutoffCurrent g a (waveCurrent ΞΊ cR cI v)) x z) b = 0 := by
  apply cutoffCurrent_divergence_zero g a hY hg
  Β· apply differentiableAt_pi.mpr
    intro i
    apply differentiableAt_pi.mpr
    intro j
    exact (contDiffAt_waveCurrent ΞΊ cR cI v x z hY i j).differentiableAt (by simp)
  Β· intro j
    simpa only [Matrix.mulVec_single_one, Matrix.col_apply] using
      waveCurrent_image_tangent ΞΊ cR cI v x z (Pi.single j 1)
  Β· exact waveCurrent_strongDivergence ΞΊ cR cI v x z hY

theorem cutoffCurrent_zero_of_outside {d : β„•} (g : β„‚ β†’ ℝ) (a R : ℝ)
    (hg : βˆ€ q : β„‚, R ≀ β€–qβ€– β†’ g q = 0)
    (A : (Index d β†’ ℝ) β†’ (Index d β†’ β„‚) β†’ Matrix (Index d) (Index d) OAI.Analysis.Calculus.Quaternion.Q)
    (x : Index d β†’ ℝ) (z : Index d β†’ β„‚) (hz : R ≀ β€–phi z / (a : β„‚)β€–) :
    cutoffCurrent g a A x z = 0 := by
  simp [cutoffCurrent, hg _ hz]

theorem cutoffCurrent_eq_of_inside {d : β„•} (g : β„‚ β†’ ℝ) (a r : ℝ)
    (hg : βˆ€ q : β„‚, β€–qβ€– ≀ r β†’ g q = 1)
    (A : (Index d β†’ ℝ) β†’ (Index d β†’ β„‚) β†’ Matrix (Index d) (Index d) OAI.Analysis.Calculus.Quaternion.Q)
    (x : Index d β†’ ℝ) (z : Index d β†’ β„‚) (hz : β€–phi z / (a : β„‚)β€– ≀ r) :
    cutoffCurrent g a A x z = A x z := by
  simp [cutoffCurrent, hg _ hz]

/-- A concrete smooth cutoff with the exact inner and outer radii in the source. -/
def phaseBump : ContDiffBump (0 : β„‚) where
  rIn := 1 / 100
  rOut := 1 / 20
  rIn_pos := by norm_num
  rIn_lt_rOut := by norm_num

def phaseCutoff : β„‚ β†’ ℝ := phaseBump

theorem phaseCutoff_contDiff : ContDiff ℝ ∞ phaseCutoff := phaseBump.contDiff

theorem phaseCutoff_nonneg (q : β„‚) : 0 ≀ phaseCutoff q := phaseBump.nonneg

theorem phaseCutoff_le_one (q : β„‚) : phaseCutoff q ≀ 1 := phaseBump.le_one

theorem phaseCutoff_eq_one (q : β„‚) (hq : β€–qβ€– ≀ 1 / 100) : phaseCutoff q = 1 := by
  apply phaseBump.one_of_mem_closedBall
  simpa [phaseBump, Metric.mem_closedBall, dist_zero_right] using hq

theorem phaseCutoff_eq_zero (q : β„‚) (hq : 1 / 20 ≀ β€–qβ€–) : phaseCutoff q = 0 := by
  apply phaseBump.zero_of_le_dist
  simpa [phaseBump, dist_zero_right] using hq

theorem cutoffCurrent_isHermitian {d : β„•} (g : β„‚ β†’ ℝ) (a : ℝ)
    (A : (Index d β†’ ℝ) β†’ (Index d β†’ β„‚) β†’ Matrix (Index d) (Index d) OAI.Analysis.Calculus.Quaternion.Q)
    (x : Index d β†’ ℝ) (z : Index d β†’ β„‚) (hA : (A x z).IsHermitian) :
    (cutoffCurrent g a A x z).IsHermitian := by
  apply Matrix.ext
  intro i j
  simp only [Matrix.conjTranspose_apply, cutoffCurrent, Matrix.smul_apply, Quaternion.star_smul]
  rw [hA.apply]

theorem cutoffCurrent_image_tangent {d : β„•} (g : β„‚ β†’ ℝ) (a : ℝ)
    (A : (Index d β†’ ℝ) β†’ (Index d β†’ β„‚) β†’ Matrix (Index d) (Index d) OAI.Analysis.Calculus.Quaternion.Q)
    (x : Index d β†’ ℝ) (z : Index d β†’ β„‚)
    (hA : βˆ€ v, βˆ‘ b, complexK (phaseRow (ratio z) b) * (A x z *α΅₯ v) b = 0)
    (v : Index d β†’ OAI.Analysis.Calculus.Quaternion.Q) :
    βˆ‘ b, complexK (phaseRow (ratio z) b) * (cutoffCurrent g a A x z *α΅₯ v) b = 0 := by
  simp only [cutoffCurrent, Matrix.smul_mulVec, Pi.smul_apply, mul_smul_comm,
    ← Finset.smul_sum, hA, smul_zero]

theorem cutoffCurrent_quadratic_nonneg {d : β„•} (g : β„‚ β†’ ℝ) (a : ℝ)
    (A : (Index d β†’ ℝ) β†’ (Index d β†’ β„‚) β†’ Matrix (Index d) (Index d) OAI.Analysis.Calculus.Quaternion.Q)
    (x : Index d β†’ ℝ) (z : Index d β†’ β„‚) (hg : 0 ≀ g (phi z / (a : β„‚)))
    (hA : βˆ€ v, 0 ≀ (βˆ‘ b, star (v b) * (A x z *α΅₯ v) b).re) (v : Index d β†’ OAI.Analysis.Calculus.Quaternion.Q) :
    0 ≀ (βˆ‘ b, star (v b) * (cutoffCurrent g a A x z *α΅₯ v) b).re := by
  simp only [cutoffCurrent, Matrix.smul_mulVec, Pi.smul_apply, mul_smul_comm,
    ← Finset.smul_sum, Quaternion.re_smul, smul_eq_mul]
  exact mul_nonneg hg (hA v)

end OAI.Analysis.Calculus.Current