Navier–Stokes: the Lean blow-up proof, cleaned up together
OpenAI's 2026 Lean proofs of blowup for forced Navier–Stokes and Euler, rerun by others, not refereed, no ruling from Clay; cleaned up together: more readable, faster to build

| 1 | import NavierStokes.HarmonicMeanInteraction |
| 2 | |
| 3 | /-! |
| 4 | # Actual harmonic wave-update interactions |
| 5 | |
| 6 | The nonlinear terms are finite convolutions of actual differentiated fields. |
| 7 | All-jet classes are lifted and restricted by proved norm-one linear pullbacks |
| 8 | before applying the full cylindrical divergence cancellation. |
| 9 | -/ |
| 10 | |
| 11 | noncomputable section |
| 12 | |
| 13 | namespace NavierStokes.HarmonicWaveInteraction |
| 14 | |
| 15 | open Set Filter Function HarmonicCalculus HarmonicFields WeightedClasses WaveInteractionBounds |
| 16 | open HarmonicMeanInteraction |
| 17 | open scoped Topology ContDiff BigOperators ComplexConjugate |
| 18 | |
| 19 | |
| 20 | variable {D : Type} [NormedAddCommGroup D] [NormedSpace ℝ D] |
| 21 | variable {E F : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 22 | [NormedAddCommGroup F] [NormedSpace ℝ F] |
| 23 | |
| 24 | noncomputable def pullbackStrip (s : StripData D) (L : E →L[ℝ] D) : StripData E where |
| 25 | domain := L ⁻¹' s.domain |
| 26 | isOpen_domain := s.isOpen_domain.preimage L.continuous |
| 27 | epsilon := s.epsilon |
| 28 | epsilon_pos := s.epsilon_pos |
| 29 | epsilon_le_one := s.epsilon_le_one |
| 30 | slow := s.slow |
| 31 | one_le_slow := s.one_le_slow |
| 32 | delta := fun x => s.delta (L x) |
| 33 | delta_pos := fun x hx => s.delta_pos (L x) hx |
| 34 | zeta := fun x => s.zeta (L x) |
| 35 | zeta_smooth := s.zeta_smooth.comp L.contDiff.contDiffOn (fun _ hx => hx) |
| 36 | zeta_nonneg := fun x hx => s.zeta_nonneg (L x) hx |
| 37 | |
| 38 | theorem norm_jet_comp_linear {f : D → F} {U : Set D} (hU : IsOpen U) |
| 39 | (hf : ContDiffOn ℝ ∞ f U) (L : E →L[ℝ] D) {x : E} (hx : L x ∈ U) (m : ℕ) : |
| 40 | ‖iteratedFDeriv ℝ m (f ∘ L) x‖ ≤ ‖iteratedFDeriv ℝ m f (L x)‖ * ‖L‖ ^ m := by |
| 41 | have hpre := hU.preimage L.continuous |
| 42 | have he := L.iteratedFDerivWithin_comp_right hf hU.uniqueDiffOn hpre.uniqueDiffOn hx |
| 43 | (i := m) (show (m : WithTop ℕ∞) ≤ ∞ from WithTop.coe_le_coe.mpr le_top) |
| 44 | rw [iteratedFDerivWithin_of_isOpen m hpre hx, iteratedFDerivWithin_of_isOpen m hU hx] at he |
| 45 | rw [he] |
| 46 | simpa using (iteratedFDeriv ℝ m f (L x)).norm_compContinuousLinearMap_le (fun _ => L) |
| 47 | |
| 48 | theorem class_pullback {s : StripData D} {w : ℕ → D → ℝ} {α : ℝ} {f : ℕ → D → F} |
| 49 | (hf : MemClass s w α f) (L : E →L[ℝ] D) (hL : ‖L‖ ≤ 1) : |
| 50 | MemClass (pullbackStrip s L) (fun n x => w n (L x)) α (fun n x => f n (L x)) := by |
| 51 | refine ⟨fun n x hx => hf.weight_nonneg n (L x) hx, |
| 52 | fun n => (hf.smooth n).comp L.contDiff.contDiffOn (fun _ hx => hx), ?_⟩ |
| 53 | intro m |
| 54 | obtain ⟨C, hC, p, hb⟩ := hf.bounds m |
| 55 | refine ⟨C, hC, p, ?_⟩ |
| 56 | intro n x hx j hj |
| 57 | have hc := norm_jet_comp_linear s.isOpen_domain (hf.smooth n) L hx j |
| 58 | have hpow : ‖L‖ ^ j ≤ 1 := pow_le_one₀ (norm_nonneg L) hL |
| 59 | exact (hc.trans (mul_le_of_le_one_right (norm_nonneg _) hpow)).trans (hb n (L x) hx j hj) |
| 60 | |
| 61 | noncomputable def projection : D × ℝ →L[ℝ] D := ContinuousLinearMap.fst ℝ D ℝ |
| 62 | noncomputable def inclusion : D →L[ℝ] D × ℝ := |
| 63 | (ContinuousLinearMap.id ℝ D).prod (0 : D →L[ℝ] ℝ) |
| 64 | |
| 65 | theorem projection_norm : ‖projection (D := D)‖ ≤ 1 := by |
| 66 | apply ContinuousLinearMap.opNorm_le_bound _ zero_le_one |
| 67 | intro x |
| 68 | change ‖x.1‖ ≤ 1 * ‖x‖ |
| 69 | simpa only [one_mul] using norm_fst_le x |
| 70 | |
| 71 | theorem inclusion_norm : ‖inclusion (D := D)‖ ≤ 1 := by |
| 72 | apply ContinuousLinearMap.opNorm_le_bound _ zero_le_one |
| 73 | intro x |
| 74 | simp [inclusion, Prod.norm_def] |
| 75 | |
| 76 | noncomputable def productStrip (s : StripData D) : StripData (D × ℝ) := pullbackStrip s projection |
| 77 | |
| 78 | theorem class_lift {s : StripData D} {w : ℕ → D → ℝ} {α : ℝ} {f : ℕ → D → F} |
| 79 | (hf : MemClass s w α f) : |
| 80 | MemClass (productStrip s) (fun n p => w n p.1) α (fun n p => f n p.1) := |
| 81 | class_pullback hf projection projection_norm |
| 82 | |
| 83 | theorem class_slice {s : StripData D} {w : ℕ → D → ℝ} {α : ℝ} {f : ℕ → D × ℝ → F} |
| 84 | (hf : MemClass (productStrip s) (fun n p => w n p.1) α f) : |
| 85 | MemClass s w α (fun n x => f n (x, 0)) := by |
| 86 | have hh := class_pullback hf inclusion inclusion_norm |
| 87 | have he : pullbackStrip (productStrip s) (inclusion (D := D)) = s := by |
| 88 | cases s |
| 89 | rfl |
| 90 | rw [he] at hh |
| 91 | exact hh |
| 92 | |
| 93 | noncomputable def liftedGeometry {s : StripData D} {κ : ℝ} (G : Geometry s κ) : |
| 94 | Geometry (productStrip s) κ where |
| 95 | radius := fun n p => G.radius n p.1 |
| 96 | radial := fun n p => (G.radial n p.1, 0) |
| 97 | angular := fun _ _ => (0, 1) |
| 98 | axial := fun n p => (G.axial n p.1, 0) |
| 99 | radius_pos := fun n p hp => G.radius_pos n p.1 hp |
| 100 | radial_class := (class_lift G.radial_class).map inclusion |
| 101 | axial_class := (class_lift G.axial_class).map inclusion |
| 102 | inverse_radius_class := class_lift G.inverse_radius_class |
| 103 | |
| 104 | noncomputable def fullPhase (b : CorrectionState.HarmonicBlock D) (n : ℕ) (p : D × ℝ) : ℝ := |
| 105 | b.phase n p.1 + ((b.angularFrequency n : ℝ) / b.frequency n) * p.2 |
| 106 | |
| 107 | theorem fullPhase_smooth {s : StripData D} (b : CorrectionState.HarmonicBlock D) |
| 108 | (hΦ : ∀ n, ContDiffOn ℝ ∞ (b.phase n) s.domain) (n : ℕ) : |
| 109 | ContDiffOn ℝ ∞ (fullPhase b n) (productStrip s).domain := |
| 110 | ((hΦ n).comp contDiffOn_fst (fun _ hx => hx)).add (contDiffOn_const.mul contDiffOn_snd) |
| 111 | |
| 112 | noncomputable def amplitude (b : CorrectionState.HarmonicBlock D) (j : ℤ) |
| 113 | (n : ℕ) (x : D) : ComplexVector := fun i => blockAmplitude b n i j x |
| 114 | |
| 115 | noncomputable def singleMode (b : CorrectionState.HarmonicBlock D) (j : ℤ) |
| 116 | (n : ℕ) (p : D × ℝ) : ComplexVector := |
| 117 | HarmonicResidual.vectorField (fun i => AddMonoidAlgebra.single j (fun x => amplitude b j n x i)) |
| 118 | (b.frequency n) (b.phase n) (b.angularFrequency n) p |
| 119 | |
| 120 | omit [NormedAddCommGroup D] [NormedSpace ℝ D] in |
| 121 | theorem singleMode_eq (b : CorrectionState.HarmonicBlock D) (j : ℤ) (n : ℕ) |
| 122 | (hk : b.frequency n ≠ 0) : |
| 123 | singleMode b j n = vectorMode (b.frequency n * (j : ℝ)) (fullPhase b n) |
| 124 | (fun p => amplitude b j n p.1) := by |
| 125 | ext p i |
| 126 | simp only [singleMode, HarmonicResidual.vectorField, field, evaluate_single, |
| 127 | vectorMode, mode, character, carrier, phaseFactor, fullPhase] |
| 128 | congr 1 |
| 129 | congr 1 |
| 130 | have hkc : (b.frequency n : ℂ) ≠ 0 := Complex.ofReal_ne_zero.mpr hk |
| 131 | push_cast |
| 132 | field_simp |
| 133 | |
| 134 | /-- The primitive divergence condition is imposed on each actual harmonic field. -/ |
| 135 | def ModeSolenoidal (s : StripData D) (c : CorrectionState.Context D) |
| 136 | (b : CorrectionState.HarmonicBlock D) : Prop := |
| 137 | ∀ j : ℤ, j ≠ 0 → ∀ n p, p.1 ∈ s.domain → |
| 138 | cylindricalDivergence (fun q => c.operators.radius q.1) |
| 139 | (HarmonicResidual.liftDirection (HarmonicResidual.contextFrame c n).radial) |
| 140 | HarmonicResidual.angularDirection |
| 141 | (HarmonicResidual.liftDirection (HarmonicResidual.contextFrame c n).axial) |
| 142 | (singleMode b j n) p = 0 |
| 143 | |
| 144 | theorem lifted_amplitude_angularIndependent {s : StripData D} {κ α : ℝ} {P : ℕ → D → ℝ} |
| 145 | (G : Geometry s κ) {b : CorrectionState.HarmonicBlock D} (hb : b.WaveBounds s P α) |
| 146 | {j : ℤ} (hj : j ≠ 0) : |
| 147 | AngularIndependent (liftedGeometry G) (fun n p => amplitude b j n p.1) := by |
| 148 | intro n i p hp |
| 149 | rcases p with ⟨x, θ⟩ |
| 150 | have hs := class_lift (blockAmplitude_class hb hj i) |
| 151 | have hd := ((hs.smooth n).contDiffAt ((productStrip s).isOpen_domain.mem_nhds hp)).differentiableAt (by simp) |
| 152 | change DifferentiableAt ℝ (fun q : D × ℝ => amplitude b j n q.1 i) (x, θ) at hd |
| 153 | change along HarmonicResidual.angularDirection (fun q => amplitude b j n q.1 i) (x, θ) = 0 |
| 154 | rw [HarmonicResidual.along_angularDirection hd] |
| 155 | simp |
| 156 | |
| 157 | theorem along_fst (V : D → D) {f : D → F} {p : D × ℝ} |
| 158 | (hf : DifferentiableAt ℝ f p.1) : |
| 159 | along (HarmonicResidual.liftDirection V) (fun q => f q.1) p = along V f p.1 := by |
| 160 | have hd := hf.hasFDerivAt.comp p (projection (D := D)).hasFDerivAt |
| 161 | change HasFDerivAt (fun q : D × ℝ => f q.1) ((fderiv ℝ f p.1).comp projection) p at hd |
| 162 | simp only [along, hd.fderiv] |
| 163 | rfl |
| 164 | |
| 165 | theorem fullPhase_hasFDerivAt (b : CorrectionState.HarmonicBlock D) (n : ℕ) {p : D × ℝ} |
| 166 | (hΦ : DifferentiableAt ℝ (b.phase n) p.1) : |
| 167 | HasFDerivAt (fullPhase b n) |
| 168 | ((fderiv ℝ (b.phase n) p.1).comp projection + |
| 169 | ((b.angularFrequency n : ℝ) / b.frequency n) • ContinuousLinearMap.snd ℝ D ℝ) p := by |
| 170 | exact (hΦ.hasFDerivAt.comp p (projection (D := D)).hasFDerivAt).add |
| 171 | ((ContinuousLinearMap.snd ℝ D ℝ).hasFDerivAt.const_mul _) |
| 172 | |
| 173 | theorem along_fullPhase_lift (b : CorrectionState.HarmonicBlock D) (n : ℕ) (V : D → D) |
| 174 | {p : D × ℝ} (hΦ : DifferentiableAt ℝ (b.phase n) p.1) : |
| 175 | along (HarmonicResidual.liftDirection V) (fullPhase b n) p = along V (b.phase n) p.1 := by |
| 176 | simp only [along, (fullPhase_hasFDerivAt b n hΦ).fderiv, |
| 177 | _root_.add_apply, ContinuousLinearMap.comp_apply, _root_.smul_apply] |
| 178 | change (fderiv ℝ (b.phase n) p.1) (V p.1) + ((b.angularFrequency n : ℝ) / b.frequency n) * 0 = _ |
| 179 | ring |
| 180 | |
| 181 | theorem along_fullPhase_angular (b : CorrectionState.HarmonicBlock D) (n : ℕ) |
| 182 | {p : D × ℝ} (hΦ : DifferentiableAt ℝ (b.phase n) p.1) : |
| 183 | along HarmonicResidual.angularDirection (fullPhase b n) p = |
| 184 | (b.angularFrequency n : ℝ) / b.frequency n := by |
| 185 | simp only [along, (fullPhase_hasFDerivAt b n hΦ).fderiv, |
| 186 | _root_.add_apply, ContinuousLinearMap.comp_apply, _root_.smul_apply] |
| 187 | change (fderiv ℝ (b.phase n) p.1) 0 + ((b.angularFrequency n : ℝ) / b.frequency n) * 1 = _ |
| 188 | simp |
| 189 | |
| 190 | /-- The exact ordered coefficient from harmonic `j` advecting harmonic `l`. |
| 191 | The first index is carried by the first input function; `l` enters the derivatives. -/ |
| 192 | noncomputable def orderedKernel (g : HarmonicResidual.Frame D) (k : ℝ) (Φ : D → ℝ) (kp l : ℤ) |
| 193 | (a b : D → ComplexVector) (x : D) (i : Fin 3) : ℂ := |
| 194 | a x 0 * derivativeCoefficient g.radial k Φ l (fun y => b y i) x + |
| 195 | (a x 1 / (g.radius x : ℂ)) * |
| 196 | ((((l * kp : ℤ) : ℂ) * Complex.I) * b x i + angularGenerator (b x) i) + |
| 197 | a x 2 * derivativeCoefficient g.axial k Φ l (fun y => b y i) x |
| 198 | |
| 199 | theorem orderedKernel_eq_fullCoefficient {s : StripData D} {κ : ℝ} |
| 200 | (c : CorrectionState.Context D) (ho : MeanIncrementBounds.OperatorBounds s c.operators κ) |
| 201 | (hR : ∀ x ∈ s.domain, 0 < c.operators.radius x) |
| 202 | (carrierData : CorrectionState.HarmonicBlock D) (a b : Family D) (l : ℤ) (n : ℕ) |
| 203 | {x : D} (hx : x ∈ s.domain) (hk : carrierData.frequency n ≠ 0) |
| 204 | (hΦ : DifferentiableAt ℝ (carrierData.phase n) x) |
| 205 | (hb : ∀ i, DifferentiableAt ℝ (fun y => b n y i) x) (i : Fin 3) : |
| 206 | orderedKernel (HarmonicResidual.contextFrame c n) (carrierData.frequency n) |
| 207 | (carrierData.phase n) (carrierData.angularFrequency n) l (a n) (b n) x i = |
| 208 | sameCoefficient (liftedGeometry (slowGeometry c ho hR)) (fullPhase carrierData) |
| 209 | (fun n => carrierData.frequency n * (l : ℝ)) |
| 210 | (fun n p => a n p.1) (fun n p => b n p.1) n (x, 0) i := by |
| 211 | have hp (V : D → D) := along_fullPhase_lift carrierData n V (p := (x, 0)) hΦ |
| 212 | have hθ := along_fullPhase_angular carrierData n (p := (x, 0)) hΦ |
| 213 | have hd (V : D → D) (j : Fin 3) := along_fst V (p := (x, 0)) (hb j) |
| 214 | simp only [sameCoefficient, strippedTransport, liftedGeometry, slowGeometry, normalDot, phaseNormal] |
| 215 | change orderedKernel _ _ _ _ _ _ _ _ _ = |
| 216 | a n x 0 * along (HarmonicResidual.liftDirection _) (fun p => b n p.1 i) (x, 0) + |
| 217 | (a n x 1 / (c.operators.radius x : ℂ)) * angularGenerator (b n x) i + |
| 218 | a n x 2 * along (HarmonicResidual.liftDirection _) (fun p => b n p.1 i) (x, 0) + |
| 219 | phaseFactor (carrierData.frequency n * (l : ℝ)) * |
| 220 | (normalDot (phaseNormal (fun p => c.operators.radius p.1) |
| 221 | (HarmonicResidual.liftDirection (HarmonicResidual.contextFrame c n).radial) |
| 222 | HarmonicResidual.angularDirection |
| 223 | (HarmonicResidual.liftDirection (HarmonicResidual.contextFrame c n).axial) |
| 224 | (fullPhase carrierData n) (x, 0)) (a n x)) * b n x i |
| 225 | simp only [normalDot, phaseNormal, hp, hθ, hd, WithLp.ofLp_toLp, |
| 226 | Matrix.cons_val_zero, Matrix.cons_val_one, Matrix.cons_val_two, Matrix.head_cons, Matrix.tail_cons, |
| 227 | orderedKernel, derivativeCoefficient, HarmonicResidual.contextFrame, |
| 228 | phaseFactor, Complex.ofReal_mul, Complex.ofReal_div, Complex.ofReal_intCast, Int.cast_mul] |
| 229 | have hkc : (carrierData.frequency n : ℂ) ≠ 0 := Complex.ofReal_ne_zero.mpr hk |
| 230 | have hrc : (c.operators.radius x : ℂ) ≠ 0 := Complex.ofReal_ne_zero.mpr (hR x hx).ne' |
| 231 | field_simp ; ring |
| 232 | |
| 233 | /-- The first harmonic is used only through its genuine divergence equation. |
| 234 | Its carrier cancels against the second harmonic with a bounded integer ratio. -/ |
| 235 | theorem orderedKernel_raw_class {s : StripData D} {κ α β : ℝ} {P : ℕ → D → ℝ} |
| 236 | (c : CorrectionState.Context D) (ho : MeanIncrementBounds.OperatorBounds s c.operators κ) |
| 237 | (hR : ∀ x ∈ s.domain, 0 < c.operators.radius x) |
| 238 | {a b : CorrectionState.HarmonicBlock D} |
| 239 | (ha : a.WaveBounds s P α) (hb : b.WaveBounds s P β) |
| 240 | (hΦ : ∀ n, ContDiffOn ℝ ∞ (a.phase n) s.domain) |
| 241 | (hk : ∀ n, a.frequency n ≠ 0) (hdiv : ModeSolenoidal s c a) |
| 242 | {j l : ℤ} (hj : j ≠ 0) (hl : l ≠ 0) (i : Fin 3) : |
| 243 | MemClass s (fun n x => (Real.sqrt (s.zeta x) * P n x) * |
| 244 | (Real.sqrt (s.zeta x) * P n x)) (α + β - κ) |
| 245 | (fun n x => orderedKernel (HarmonicResidual.contextFrame c n) (a.frequency n) |
| 246 | (a.phase n) (a.angularFrequency n) l (amplitude a j n) (amplitude b l n) x i) := by |
| 247 | let G := liftedGeometry (slowGeometry c ho hR) |
| 248 | have ha' : WaveVector (productStrip s) (fun n p => P n p.1) α |
| 249 | (fun n p => amplitude a j n p.1) := fun r => class_lift (blockAmplitude_class ha hj r) |
| 250 | have hb' : WaveVector (productStrip s) (fun n p => P n p.1) β |
| 251 | (fun n p => amplitude b l n p.1) := fun r => class_lift (blockAmplitude_class hb hl r) |
| 252 | have hd : ∀ n p, p ∈ (productStrip s).domain → cylindricalDivergence |
| 253 | (G.radius n) (G.radial n) (G.angular n) (G.axial n) |
| 254 | (vectorMode (a.frequency n * (j : ℝ)) (fullPhase a n) |
| 255 | (fun q => amplitude a j n q.1)) p = 0 := by |
| 256 | intro n p hp |
| 257 | have hh := hdiv j hj n p hp |
| 258 | rw [singleMode_eq a j n (hk n)] at hh |
| 259 | exact hh |
| 260 | have hh := same_label_raw_bound G ho.kappa_nonneg ha' hb' |
| 261 | (fullPhase_smooth a hΦ) |
| 262 | (fun n => mul_ne_zero (hk n) (by exact_mod_cast hj)) |
| 263 | (bandBound_frequency_ratio (productStrip s) hk (fun _ => hj) |
| 264 | (abs_nonneg (l : ℝ)) (fun _ => le_rfl)) |
| 265 | (lifted_amplitude_angularIndependent (slowGeometry c ho hR) ha hj) hd i |
| 266 | have hs := class_slice (s := s) (w := fun n x => |
| 267 | (Real.sqrt (s.zeta x) * P n x) * (Real.sqrt (s.zeta x) * P n x)) hh |
| 268 | apply class_congr hs |
| 269 | intro n x hx |
| 270 | exact (orderedKernel_eq_fullCoefficient c ho hR a (amplitude a j) (amplitude b l) |
| 271 | l n hx (hk n) |
| 272 | (((hΦ n).contDiffAt (s.isOpen_domain.mem_nhds hx)).differentiableAt (by simp)) |
| 273 | (fun r => ((((blockAmplitude_class hb hl r).smooth n).contDiffAt |
| 274 | (s.isOpen_domain.mem_nhds hx)).differentiableAt (by simp))) i).symm |
| 275 | |
| 276 | /-- Oscillatory input blocks have no stored velocity at harmonic zero. -/ |
| 277 | def ZeroMode (b : CorrectionState.HarmonicBlock D) : Prop := |
| 278 | ∀ n i, b.velocity n i 0 = 0 |
| 279 | |
| 280 | omit [NormedAddCommGroup D] [NormedSpace ℝ D] in |
| 281 | theorem amplitude_zero {b : CorrectionState.HarmonicBlock D} (hb : ZeroMode b) (n : ℕ) : |
| 282 | amplitude b 0 n = 0 := by |
| 283 | ext x i |
| 284 | have hzero := hb n i |
| 285 | simp [amplitude, blockAmplitude, HarmonicResidual.realCoefficients_apply, hzero] |
| 286 | |
| 287 | theorem orderedKernel_zero_left (g : HarmonicResidual.Frame D) (k : ℝ) (Φ : D → ℝ) |
| 288 | (kp l : ℤ) (b : D → ComplexVector) (x : D) (i : Fin 3) : |
| 289 | orderedKernel g k Φ kp l 0 b x i = 0 := by |
| 290 | simp [orderedKernel] |
| 291 | |
| 292 | theorem orderedKernel_zero_right (g : HarmonicResidual.Frame D) (k : ℝ) (Φ : D → ℝ) |
| 293 | (kp l : ℤ) (a : D → ComplexVector) (x : D) (i : Fin 3) : |
| 294 | orderedKernel g k Φ kp l a 0 x i = 0 := by |
| 295 | simp only [orderedKernel, Pi.zero_apply, mul_zero] |
| 296 | fin_cases i <;> simp [angularGenerator, derivativeCoefficient, along] |
| 297 | |
| 298 | theorem orderedKernel_raw_class_all {s : StripData D} {κ α β : ℝ} {P : ℕ → D → ℝ} |
| 299 | (c : CorrectionState.Context D) (ho : MeanIncrementBounds.OperatorBounds s c.operators κ) |
| 300 | (hR : ∀ x ∈ s.domain, 0 < c.operators.radius x) |
| 301 | {a b : CorrectionState.HarmonicBlock D} |
| 302 | (ha : a.WaveBounds s P α) (hb : b.WaveBounds s P β) |
| 303 | (ha0 : ZeroMode a) (hb0 : ZeroMode b) |
| 304 | (hΦ : ∀ n, ContDiffOn ℝ ∞ (a.phase n) s.domain) |
| 305 | (hk : ∀ n, a.frequency n ≠ 0) (hdiv : ModeSolenoidal s c a) |
| 306 | (j l : ℤ) (i : Fin 3) : |
| 307 | MemClass s (fun n x => (Real.sqrt (s.zeta x) * P n x) * |
| 308 | (Real.sqrt (s.zeta x) * P n x)) (α + β - κ) |
| 309 | (fun n x => orderedKernel (HarmonicResidual.contextFrame c n) (a.frequency n) |
| 310 | (a.phase n) (a.angularFrequency n) l (amplitude a j n) (amplitude b l n) x i) := by |
| 311 | by_cases hj : j = 0 |
| 312 | · subst j |
| 313 | simpa only [amplitude_zero ha0, orderedKernel_zero_left] using |
| 314 | (MemClass.zero (s := s) (α := α + β - κ) (E := ℂ) |
| 315 | (fun n x _ => mul_self_nonneg (Real.sqrt (s.zeta x) * P n x))) |
| 316 | by_cases hl : l = 0 |
| 317 | · subst l |
| 318 | simpa only [amplitude_zero hb0, orderedKernel_zero_right] using |
| 319 | (MemClass.zero (s := s) (α := α + β - κ) (E := ℂ) |
| 320 | (fun n x _ => mul_self_nonneg (Real.sqrt (s.zeta x) * P n x))) |
| 321 | exact orderedKernel_raw_class c ho hR ha hb hΦ hk hdiv hj hl i |
| 322 | |
| 323 | /-- A common finite range is fixed for the whole family, not chosen anew on |
| 324 | each band. This is the finiteness needed by the uniform class estimates. -/ |
| 325 | noncomputable def harmonicRange (N : ℕ) : Finset ℤ := Finset.Icc (-(N : ℤ)) N |
| 326 | |
| 327 | omit [NormedAddCommGroup D] [NormedSpace ℝ D] in |
| 328 | theorem band_support_range {a : Coefficients D} {N : ℕ} (ha : BandLimited a N) : |
| 329 | a.support ⊆ harmonicRange N := by |
| 330 | intro j hj |
| 331 | have hh := ha j hj |
| 332 | simp only [harmonicRange, Finset.mem_Icc] |
| 333 | omega |
| 334 | |
| 335 | omit [NormedAddCommGroup D] [NormedSpace ℝ D] in |
| 336 | theorem convolution_apply_finset (a b : Coefficients D) (K : Finset ℤ) |
| 337 | (ha : a.support ⊆ K) (m : ℤ) (x : D) : |
| 338 | (a * b) m x = ∑ j ∈ K, a j x * b (m - j) x := by |
| 339 | rw [convolution_apply] |
| 340 | apply Finset.sum_subset ha |
| 341 | intro j _ hj |
| 342 | rw [Finsupp.notMem_support_iff.mp hj] |
| 343 | simp |
| 344 | |
| 345 | theorem transport_convolution (g : HarmonicResidual.Frame D) (k : ℝ) (Φ : D → ℝ) |
| 346 | (kp : ℤ) (a b : HarmonicResidual.VectorCoefficients D) (K : Finset ℤ) |
| 347 | (ha : ∀ i, (a i).support ⊆ K) (m : ℤ) (x : D) (i : Fin 3) : |
| 348 | HarmonicResidual.transport g k Φ kp a b i m x = |
| 349 | ∑ j ∈ K, orderedKernel g k Φ kp (m - j) |
| 350 | (fun y r => a r j y) (fun y r => b r (m - j) y) x i := by |
| 351 | simp only [HarmonicResidual.transport, coeff_add] |
| 352 | rw [mul_assoc, convolution_apply_finset _ _ K (ha 0), |
| 353 | convolution_apply_finset _ _ K (ha 1), convolution_apply_finset _ _ K (ha 2), |
| 354 | ← Finset.sum_add_distrib, ← Finset.sum_add_distrib] |
| 355 | apply Finset.sum_congr rfl |
| 356 | intro j _ |
| 357 | simp only [orderedKernel, constant_mul, coeff_add, angularDifferentiate_apply, |
| 358 | differentiate_apply, rotate_apply, div_eq_mul_inv] |
| 359 | ring |
| 360 | |
| 361 | theorem transport_raw_class {s : StripData D} {κ α β : ℝ} {P : ℕ → D → ℝ} |
| 362 | (c : CorrectionState.Context D) (ho : MeanIncrementBounds.OperatorBounds s c.operators κ) |
| 363 | (hR : ∀ x ∈ s.domain, 0 < c.operators.radius x) |
| 364 | {a b : CorrectionState.HarmonicBlock D} {N : ℕ} |
| 365 | (ha : a.WaveBounds s P α) (hb : b.WaveBounds s P β) |
| 366 | (ha0 : ZeroMode a) (hb0 : ZeroMode b) (hN : a.BandLimited N) |
| 367 | (hΦ : ∀ n, ContDiffOn ℝ ∞ (a.phase n) s.domain) |
| 368 | (hk : ∀ n, a.frequency n ≠ 0) (hdiv : ModeSolenoidal s c a) |
| 369 | (m : ℤ) (i : Fin 3) : |
| 370 | MemClass s (fun n x => (Real.sqrt (s.zeta x) * P n x) * |
| 371 | (Real.sqrt (s.zeta x) * P n x)) (α + β - κ) |
| 372 | (fun n x => HarmonicResidual.transport (HarmonicResidual.contextFrame c n) |
| 373 | (a.frequency n) (a.phase n) (a.angularFrequency n) |
| 374 | (blockAmplitude a n) (blockAmplitude b n) i m x) := by |
| 375 | have hh := MemClass.sum (harmonicRange N) |
| 376 | (fun j n x => orderedKernel (HarmonicResidual.contextFrame c n) (a.frequency n) |
| 377 | (a.phase n) (a.angularFrequency n) (m - j) (amplitude a j n) |
| 378 | (amplitude b (m - j) n) x i) |
| 379 | (fun n x _ => mul_self_nonneg (Real.sqrt (s.zeta x) * P n x)) |
| 380 | (fun j _ => orderedKernel_raw_class_all c ho hR ha hb ha0 hb0 hΦ hk hdiv j (m - j) i) |
| 381 | apply class_congr hh |
| 382 | intro n x _ |
| 383 | exact (transport_convolution _ _ _ _ _ _ (harmonicRange N) |
| 384 | (fun r => band_support_range (HarmonicResidual.band_realCoefficients (hN.1 n r))) m x i).symm |
| 385 | |
| 386 | theorem transport_wave_class {s : StripData D} {κ α β : ℝ} {P : ℕ → D → ℝ} |
| 387 | (c : CorrectionState.Context D) (ho : MeanIncrementBounds.OperatorBounds s c.operators κ) |
| 388 | (hR : ∀ x ∈ s.domain, 0 < c.operators.radius x) |
| 389 | {a b : CorrectionState.HarmonicBlock D} {N : ℕ} |
| 390 | (ha : a.WaveBounds s P α) (hb : b.WaveBounds s P β) |
| 391 | (ha0 : ZeroMode a) (hb0 : ZeroMode b) (hN : a.BandLimited N) |
| 392 | (hΦ : ∀ n, ContDiffOn ℝ ∞ (a.phase n) s.domain) |
| 393 | (hk : ∀ n, a.frequency n ≠ 0) (hdiv : ModeSolenoidal s c a) |
| 394 | (hP0 : ∀ n x, x ∈ s.domain → 0 ≤ P n x) |
| 395 | (hP1 : ∀ n x, x ∈ s.domain → P n x ≤ 1) (m : ℤ) (i : Fin 3) : |
| 396 | WaveClass s P (α + β - κ) |
| 397 | (fun n x => HarmonicResidual.transport (HarmonicResidual.contextFrame c n) |
| 398 | (a.frequency n) (a.phase n) (a.angularFrequency n) |
| 399 | (blockAmplitude a n) (blockAmplitude b n) i m x) := |
| 400 | wave_square_weight_wave |
| 401 | (transport_raw_class c ho hR ha hb ha0 hb0 hN hΦ hk hdiv m i) |
| 402 | ho.weight_le_one hP0 hP1 |
| 403 | |
| 404 | theorem transport_mean_class {s : StripData D} {κ α β : ℝ} {P : ℕ → D → ℝ} |
| 405 | (c : CorrectionState.Context D) (ho : MeanIncrementBounds.OperatorBounds s c.operators κ) |
| 406 | (hR : ∀ x ∈ s.domain, 0 < c.operators.radius x) |
| 407 | {a b : CorrectionState.HarmonicBlock D} {N : ℕ} |
| 408 | (ha : a.WaveBounds s P α) (hb : b.WaveBounds s P β) |
| 409 | (ha0 : ZeroMode a) (hb0 : ZeroMode b) (hN : a.BandLimited N) |
| 410 | (hΦ : ∀ n, ContDiffOn ℝ ∞ (a.phase n) s.domain) |
| 411 | (hk : ∀ n, a.frequency n ≠ 0) (hdiv : ModeSolenoidal s c a) |
| 412 | (hP0 : ∀ n x, x ∈ s.domain → 0 ≤ P n x) |
| 413 | (hP1 : ∀ n x, x ∈ s.domain → P n x ≤ 1) (m : ℤ) (i : Fin 3) : |
| 414 | MeanClass s (α + β - κ) |
| 415 | (fun n x => HarmonicResidual.transport (HarmonicResidual.contextFrame c n) |
| 416 | (a.frequency n) (a.phase n) (a.angularFrequency n) |
| 417 | (blockAmplitude a n) (blockAmplitude b n) i m x) := |
| 418 | wave_square_weight_mean |
| 419 | (transport_raw_class c ho hR ha hb ha0 hb0 hN hΦ hk hdiv m i) hP0 hP1 |
| 420 | |
| 421 | /-- Coefficients evaluated using the original label's carrier. -/ |
| 422 | noncomputable def withCarrier (carrierData b : CorrectionState.HarmonicBlock D) : |
| 423 | CorrectionState.HarmonicBlock D where |
| 424 | velocity := b.velocity |
| 425 | pressure := b.pressure |
| 426 | frequency := carrierData.frequency |
| 427 | phase := carrierData.phase |
| 428 | angularFrequency := carrierData.angularFrequency |
| 429 | |
| 430 | /-- The updated label retains its carrier, including its angular frequency. -/ |
| 431 | noncomputable def addBlock (a b : CorrectionState.HarmonicBlock D) : |
| 432 | CorrectionState.HarmonicBlock D where |
| 433 | velocity := fun n i => a.velocity n i + b.velocity n i |
| 434 | pressure := fun n => a.pressure n + b.pressure n |
| 435 | frequency := a.frequency |
| 436 | phase := a.phase |
| 437 | angularFrequency := a.angularFrequency |
| 438 | |
| 439 | omit [NormedAddCommGroup D] [NormedSpace ℝ D] in |
| 440 | theorem addBlock_oscillation (a b : CorrectionState.HarmonicBlock D) (n : ℕ) |
| 441 | (p : D × ℝ) (i : Fin 3) : |
| 442 | (addBlock a b).oscillation n p i = a.oscillation n p i + |
| 443 | (withCarrier a b).oscillation n p i := by |
| 444 | simp only [addBlock, withCarrier, CorrectionState.HarmonicBlock.oscillation, |
| 445 | HarmonicResidual.field_add, Complex.add_re] |
| 446 | |
| 447 | omit [NormedAddCommGroup D] [NormedSpace ℝ D] in |
| 448 | theorem addBlock_pressure (a b : CorrectionState.HarmonicBlock D) (n : ℕ) (p : D × ℝ) : |
| 449 | (addBlock a b).oscillatoryPressure n p = a.oscillatoryPressure n p + |
| 450 | (withCarrier a b).oscillatoryPressure n p := by |
| 451 | simp only [addBlock, withCarrier, CorrectionState.HarmonicBlock.oscillatoryPressure, |
| 452 | HarmonicResidual.field_add, Complex.add_re] |
| 453 | |
| 454 | omit [NormedAddCommGroup D] [NormedSpace ℝ D] in |
| 455 | theorem blockAmplitude_addBlock (a b : CorrectionState.HarmonicBlock D) (n : ℕ) : |
| 456 | blockAmplitude (addBlock a b) n = blockAmplitude a n + blockAmplitude b n := by |
| 457 | funext i |
| 458 | exact realCoefficients_add _ _ |
| 459 | |
| 460 | noncomputable def blockTransport (c : CorrectionState.Context D) |
| 461 | (carrierData a b : CorrectionState.HarmonicBlock D) : HarmonicResidual.BlockCoefficients D := |
| 462 | fun n => HarmonicResidual.transport (HarmonicResidual.contextFrame c n) |
| 463 | (carrierData.frequency n) (carrierData.phase n) (carrierData.angularFrequency n) |
| 464 | (blockAmplitude a n) (blockAmplitude b n) |
| 465 | |
| 466 | /-- All three actual quadratic terms introduced by adding one wave block. -/ |
| 467 | noncomputable def nonlinearCoefficients (c : CorrectionState.Context D) |
| 468 | (a b : CorrectionState.HarmonicBlock D) : HarmonicResidual.BlockCoefficients D := |
| 469 | blockTransport c a a b + blockTransport c a b a + blockTransport c a b b |
| 470 | |
| 471 | theorem mixed_wave_class {s : StripData D} {κ α β : ℝ} {P : ℕ → D → ℝ} |
| 472 | (c : CorrectionState.Context D) (ho : MeanIncrementBounds.OperatorBounds s c.operators κ) |
| 473 | (hR : ∀ x ∈ s.domain, 0 < c.operators.radius x) |
| 474 | {a b : CorrectionState.HarmonicBlock D} {M N : ℕ} |
| 475 | (ha : a.WaveBounds s P α) (hb : b.WaveBounds s P β) |
| 476 | (ha0 : ZeroMode a) (hb0 : ZeroMode b) (hM : a.BandLimited M) (hN : b.BandLimited N) |
| 477 | (hΦ : ∀ n, ContDiffOn ℝ ∞ (a.phase n) s.domain) (hk : ∀ n, a.frequency n ≠ 0) |
| 478 | (hda : ModeSolenoidal s c a) (hdb : ModeSolenoidal s c (withCarrier a b)) |
| 479 | (hP0 : ∀ n x, x ∈ s.domain → 0 ≤ P n x) |
| 480 | (hP1 : ∀ n x, x ∈ s.domain → P n x ≤ 1) (j : ℤ) (i : Fin 3) : |
| 481 | WaveClass s P (α + β - κ) (fun n x => |
| 482 | blockTransport c a a b n i j x + blockTransport c a b a n i j x) := by |
| 483 | have hab := transport_wave_class c ho hR ha hb ha0 hb0 hM hΦ hk hda hP0 hP1 j i |
| 484 | have hba := transport_wave_class c ho hR (a := withCarrier a b) hb ha hb0 ha0 hN |
| 485 | hΦ hk hdb hP0 hP1 j i |
| 486 | have hba' : WaveClass s P (α + β - κ) |
| 487 | (fun n x => blockTransport c a b a n i j x) := by |
| 488 | simp only [blockTransport, withCarrier, add_comm β α] at hba ⊢ |
| 489 | exact hba |
| 490 | exact hab.add hba' |
| 491 | |
| 492 | theorem square_wave_class {s : StripData D} {κ β : ℝ} {P : ℕ → D → ℝ} |
| 493 | (c : CorrectionState.Context D) (ho : MeanIncrementBounds.OperatorBounds s c.operators κ) |
| 494 | (hR : ∀ x ∈ s.domain, 0 < c.operators.radius x) |
| 495 | (a : CorrectionState.HarmonicBlock D) {b : CorrectionState.HarmonicBlock D} {N : ℕ} |
| 496 | (hb : b.WaveBounds s P β) (hb0 : ZeroMode b) (hN : b.BandLimited N) |
| 497 | (hΦ : ∀ n, ContDiffOn ℝ ∞ (a.phase n) s.domain) (hk : ∀ n, a.frequency n ≠ 0) |
| 498 | (hdb : ModeSolenoidal s c (withCarrier a b)) |
| 499 | (hP0 : ∀ n x, x ∈ s.domain → 0 ≤ P n x) |
| 500 | (hP1 : ∀ n x, x ∈ s.domain → P n x ≤ 1) (j : ℤ) (i : Fin 3) : |
| 501 | WaveClass s P (β + β - κ) (fun n x => blockTransport c a b b n i j x) := |
| 502 | transport_wave_class c ho hR (a := withCarrier a b) hb hb hb0 hb0 hN |
| 503 | hΦ hk hdb hP0 hP1 j i |
| 504 | |
| 505 | theorem nonlinearCoefficients_wave_class {s : StripData D} {κ α β : ℝ} {P : ℕ → D → ℝ} |
| 506 | (c : CorrectionState.Context D) (ho : MeanIncrementBounds.OperatorBounds s c.operators κ) |
| 507 | (hR : ∀ x ∈ s.domain, 0 < c.operators.radius x) |
| 508 | {a b : CorrectionState.HarmonicBlock D} {M N : ℕ} |
| 509 | (ha : a.WaveBounds s P α) (hb : b.WaveBounds s P β) |
| 510 | (ha0 : ZeroMode a) (hb0 : ZeroMode b) (hM : a.BandLimited M) (hN : b.BandLimited N) |
| 511 | (hΦ : ∀ n, ContDiffOn ℝ ∞ (a.phase n) s.domain) (hk : ∀ n, a.frequency n ≠ 0) |
| 512 | (hda : ModeSolenoidal s c a) (hdb : ModeSolenoidal s c (withCarrier a b)) |
| 513 | (hP0 : ∀ n x, x ∈ s.domain → 0 ≤ P n x) |
| 514 | (hP1 : ∀ n x, x ∈ s.domain → P n x ≤ 1) (j : ℤ) (i : Fin 3) : |
| 515 | WaveClass s P (min (α + β - κ) (β + β - κ)) |
| 516 | (fun n x => nonlinearCoefficients c a b n i j x) := by |
| 517 | exact ((mixed_wave_class c ho hR ha hb ha0 hb0 hM hN hΦ hk hda hdb hP0 hP1 j i).mono_exponent |
| 518 | (min_le_left _ _)).add ((square_wave_class c ho hR a hb hb0 hN hΦ hk hdb hP0 hP1 j i).mono_exponent |
| 519 | (min_le_right _ _)) |
| 520 | |
| 521 | noncomputable def nonlinearErrorBlock (c : CorrectionState.Context D) |
| 522 | (a b : CorrectionState.HarmonicBlock D) : CorrectionState.HarmonicBlock D where |
| 523 | velocity := fun n i => HarmonicResidual.nonconstant |
| 524 | (HarmonicResidual.realCoefficients (nonlinearCoefficients c a b n i)) |
| 525 | pressure := fun _ => 0 |
| 526 | frequency := a.frequency |
| 527 | phase := a.phase |
| 528 | angularFrequency := a.angularFrequency |
| 529 | |
| 530 | theorem nonlinearErrorBlock_class {s : StripData D} {κ α β : ℝ} {P : ℕ → D → ℝ} |
| 531 | (c : CorrectionState.Context D) (ho : MeanIncrementBounds.OperatorBounds s c.operators κ) |
| 532 | (hR : ∀ x ∈ s.domain, 0 < c.operators.radius x) |
| 533 | {a b : CorrectionState.HarmonicBlock D} {M N : ℕ} |
| 534 | (ha : a.WaveBounds s P α) (hb : b.WaveBounds s P β) |
| 535 | (ha0 : ZeroMode a) (hb0 : ZeroMode b) (hM : a.BandLimited M) (hN : b.BandLimited N) |
| 536 | (hΦ : ∀ n, ContDiffOn ℝ ∞ (a.phase n) s.domain) (hk : ∀ n, a.frequency n ≠ 0) |
| 537 | (hda : ModeSolenoidal s c a) (hdb : ModeSolenoidal s c (withCarrier a b)) |
| 538 | (hP0 : ∀ n x, x ∈ s.domain → 0 ≤ P n x) |
| 539 | (hP1 : ∀ n x, x ∈ s.domain → P n x ≤ 1) : |
| 540 | (nonlinearErrorBlock c a b).WaveBounds s P (min (α + β - κ) (β + β - κ)) := by |
| 541 | intro i j hj |
| 542 | have hh m := nonlinearCoefficients_wave_class c ho hR ha hb ha0 hb0 hM hN hΦ hk hda hdb hP0 hP1 m i |
| 543 | have hr := realCoefficient_class (fun n => nonlinearCoefficients c a b n i) j (hh j) (hh (-j)) |
| 544 | apply class_congr hr |
| 545 | intro n x _ |
| 546 | exact (nonconstant_apply_of_ne _ hj x).symm |
| 547 | |
| 548 | theorem nonlinearErrorBlock_band (c : CorrectionState.Context D) |
| 549 | {a b : CorrectionState.HarmonicBlock D} {M N : ℕ} |
| 550 | (ha : a.BandLimited M) (hb : b.BandLimited N) : |
| 551 | (nonlinearErrorBlock c a b).BandLimited (max (M + N) (N + N)) := by |
| 552 | refine ⟨fun n i => ?_, fun _ => HarmonicResidual.band_zero _⟩ |
| 553 | apply HarmonicResidual.band_nonconstant |
| 554 | apply HarmonicResidual.band_realCoefficients |
| 555 | have ha' r := HarmonicResidual.band_realCoefficients (ha.1 n r) |
| 556 | have hb' r := HarmonicResidual.band_realCoefficients (hb.1 n r) |
| 557 | have hab := HarmonicResidual.band_transport (HarmonicResidual.contextFrame c n) |
| 558 | (a.frequency n) (a.phase n) (a.angularFrequency n) ha' hb' i |
| 559 | have hba := HarmonicResidual.band_transport (HarmonicResidual.contextFrame c n) |
| 560 | (a.frequency n) (a.phase n) (a.angularFrequency n) hb' ha' i |
| 561 | have hbb := HarmonicResidual.band_transport (HarmonicResidual.contextFrame c n) |
| 562 | (a.frequency n) (a.phase n) (a.angularFrequency n) hb' hb' i |
| 563 | exact ((hab.mono (le_max_left _ _)).add (hba.mono (by omega))).add |
| 564 | (hbb.mono (le_max_right _ _)) |
| 565 | |
| 566 | theorem nonlinearErrorBlock_conjugate (c : CorrectionState.Context D) |
| 567 | (a b : CorrectionState.HarmonicBlock D) (n : ℕ) (i : Fin 3) : |
| 568 | ConjugateSymmetric ((nonlinearErrorBlock c a b).velocity n i) := |
| 569 | HarmonicResidual.nonconstant_conjugate (HarmonicResidual.realCoefficients_conjugate _) |
| 570 | |
| 571 | theorem nonlinearErrorBlock_zero (c : CorrectionState.Context D) |
| 572 | (a b : CorrectionState.HarmonicBlock D) : ZeroMode (nonlinearErrorBlock c a b) := by |
| 573 | intro n i |
| 574 | simp [nonlinearErrorBlock, HarmonicResidual.nonconstant] |
| 575 | |
| 576 | /-! ## Identification with the actual differentiated residual -/ |
| 577 | |
| 578 | omit [NormedAddCommGroup D] [NormedSpace ℝ D] in |
| 579 | theorem coefficient_eq_of_field_eq_at (a b : Coefficients D) (k : ℝ) (Φ : D → ℝ) |
| 580 | {kp : ℤ} (hkp : kp ≠ 0) (j : ℤ) (x : D) |
| 581 | (he : ∀ θ, field a k Φ kp (x, θ) = field b k Φ kp (x, θ)) : a j x = b j x := by |
| 582 | rw [← HarmonicResidual.extract_field a k Φ hkp j x, |
| 583 | ← HarmonicResidual.extract_field b k Φ hkp j x] |
| 584 | unfold HarmonicResidual.extract |
| 585 | congr 1 |
| 586 | funext θ |
| 587 | rw [he θ] |
| 588 | |
| 589 | omit [NormedAddCommGroup D] [NormedSpace ℝ D] in |
| 590 | theorem vectorField_add (a b : HarmonicResidual.VectorCoefficients D) |
| 591 | (k : ℝ) (Φ : D → ℝ) (kp : ℤ) : |
| 592 | HarmonicResidual.vectorField (a + b) k Φ kp = |
| 593 | HarmonicResidual.vectorField a k Φ kp + HarmonicResidual.vectorField b k Φ kp := by |
| 594 | ext p i |
| 595 | exact HarmonicResidual.field_add (a i) (b i) k Φ kp p |
| 596 | |
| 597 | omit [NormedAddCommGroup D] [NormedSpace ℝ D] in |
| 598 | theorem scalarField_add (a b : Coefficients D) (k : ℝ) (Φ : D → ℝ) (kp : ℤ) : |
| 599 | field (a + b) k Φ kp = field a k Φ kp + field b k Φ kp := by |
| 600 | ext p |
| 601 | exact HarmonicResidual.field_add a b k Φ kp p |
| 602 | |
| 603 | /-- The coefficient identity is extracted from the proved product rules for |
| 604 | the actual cylindrical differential operators. -/ |
| 605 | theorem nonlinear_update_coefficients {U : Set D} (hU : IsOpen U) |
| 606 | (g : HarmonicResidual.Frame D) (hr : ContDiffOn ℝ ∞ g.radial U) |
| 607 | (hz : ContDiffOn ℝ ∞ g.axial U) (k : ℝ) {Φ : D → ℝ} |
| 608 | (hΦ : ContDiffOn ℝ ∞ Φ U) {kp : ℤ} (hkp : kp ≠ 0) |
| 609 | (B a b : HarmonicResidual.VectorCoefficients D) (p q : Coefficients D) |
| 610 | (hB : ∀ i, HarmonicResidual.SmoothCoefficients U (B i)) |
| 611 | (ha : ∀ i, HarmonicResidual.SmoothCoefficients U (a i)) |
| 612 | (hb : ∀ i, HarmonicResidual.SmoothCoefficients U (b i)) |
| 613 | (hp : HarmonicResidual.SmoothCoefficients U p) (hq : HarmonicResidual.SmoothCoefficients U q) |
| 614 | {x : D} (hx : x ∈ U) (j : ℤ) (i : Fin 3) : |
| 615 | HarmonicResidual.nonlinearResidual g k Φ kp B (a + b) (p + q) i j x - |
| 616 | HarmonicResidual.nonlinearResidual g k Φ kp B a p i j x = |
| 617 | HarmonicResidual.linearResidual g k Φ kp B b q i j x + |
| 618 | HarmonicResidual.transport g k Φ kp a b i j x + |
| 619 | HarmonicResidual.transport g k Φ kp b a i j x + |
| 620 | HarmonicResidual.transport g k Φ kp b b i j x := by |
| 621 | change (HarmonicResidual.nonlinearResidual g k Φ kp B (a + b) (p + q) i - |
| 622 | HarmonicResidual.nonlinearResidual g k Φ kp B a p i) j x = |
| 623 | (HarmonicResidual.linearResidual g k Φ kp B b q i + |
| 624 | HarmonicResidual.transport g k Φ kp a b i + |
| 625 | HarmonicResidual.transport g k Φ kp b a i + |
| 626 | HarmonicResidual.transport g k Φ kp b b i) j x |
| 627 | apply coefficient_eq_of_field_eq_at _ _ k Φ hkp j x |
| 628 | intro θ |
| 629 | have hxθ : (x, θ) ∈ HarmonicResidual.liftDomain U := ⟨hx, trivial⟩ |
| 630 | have hnew := HarmonicResidual.field_nonlinearResidual hU g hr hz (a := a + b) hB |
| 631 | (fun r => (ha r).add (hb r)) (hp.add hq) hΦ k kp hxθ |
| 632 | have hold := HarmonicResidual.field_nonlinearResidual hU g hr hz hB ha hp hΦ k kp hxθ |
| 633 | have hlin := HarmonicResidual.field_linearResidual hU g hr hz hB hb hq hΦ k kp hxθ |
| 634 | have hab := HarmonicResidual.field_transport hU g a hb hΦ k kp hxθ |
| 635 | have hba := HarmonicResidual.field_transport hU g b ha hΦ k kp hxθ |
| 636 | have hbb := HarmonicResidual.field_transport hU g b hb hΦ k kp hxθ |
| 637 | simp only [HarmonicResidual.field_sub, HarmonicResidual.field_add] |
| 638 | change (HarmonicResidual.vectorField _ k Φ kp (x, θ)) i - |
| 639 | (HarmonicResidual.vectorField _ k Φ kp (x, θ)) i = |
| 640 | (HarmonicResidual.vectorField _ k Φ kp (x, θ)) i + |
| 641 | (HarmonicResidual.vectorField _ k Φ kp (x, θ)) i + |
| 642 | (HarmonicResidual.vectorField _ k Φ kp (x, θ)) i + |
| 643 | (HarmonicResidual.vectorField _ k Φ kp (x, θ)) i |
| 644 | rw [hnew, hold, hlin, hab, hba, hbb, vectorField_add, scalarField_add] |
| 645 | have he := HarmonicResidual.Actual.nonlinearResidual_add_sub (Vθ := HarmonicResidual.angularDirection) |
| 646 | (HarmonicResidual.liftDomain_open hU) g.viscosity (fun y => g.radius y.1) |
| 647 | (HarmonicResidual.liftDirection g.time) (HarmonicResidual.liftDirection_smooth hr) |
| 648 | contDiffOn_const (HarmonicResidual.liftDirection_smooth hz) |
| 649 | (HarmonicResidual.vectorField B k Φ kp) (HarmonicResidual.vectorField a k Φ kp) |
| 650 | (HarmonicResidual.vectorField b k Φ kp) (field p k Φ kp) (field q k Φ kp) |
| 651 | (fun r => HarmonicResidual.field_smoothOn (ha r) hΦ k kp) |
| 652 | (fun r => HarmonicResidual.field_smoothOn (hb r) hΦ k kp) |
| 653 | (HarmonicResidual.field_smoothOn hp hΦ k kp) (HarmonicResidual.field_smoothOn hq hΦ k kp) hxθ |
| 654 | exact congrFun he i |
| 655 | |
| 656 | theorem linear_mean_difference (g : HarmonicResidual.Frame D) (k : ℝ) (Φ : D → ℝ) (kp : ℤ) |
| 657 | (B m : D → ComplexVector) (a : HarmonicResidual.VectorCoefficients D) (p : Coefficients D) {x : D} |
| 658 | (hB : ∀ i, DifferentiableAt ℝ (fun y => B y i) x) |
| 659 | (hm : ∀ i, DifferentiableAt ℝ (fun y => m y i) x) (j : ℤ) (i : Fin 3) : |
| 660 | HarmonicResidual.linearResidual g k Φ kp (HarmonicResidual.constantVector (B + m)) a p i j x - |
| 661 | HarmonicResidual.linearResidual g k Φ kp (HarmonicResidual.constantVector B) a p i j x = |
| 662 | crossCoefficients g k Φ kp m a i j x := by |
| 663 | simp only [HarmonicResidual.linearResidual, crossCoefficients, coeff_add, coeff_sub, |
| 664 | transport_constant_left, transport_constant_right, Pi.add_apply, |
| 665 | along_add _ (hB i) (hm i), HarmonicResidual.Actual.angularGenerator_add] |
| 666 | ring |
| 667 | |
| 668 | theorem nonlinear_update_with_mean {U : Set D} (hU : IsOpen U) |
| 669 | (g : HarmonicResidual.Frame D) (hr : ContDiffOn ℝ ∞ g.radial U) |
| 670 | (hz : ContDiffOn ℝ ∞ g.axial U) (k : ℝ) {Φ : D → ℝ} |
| 671 | (hΦ : ContDiffOn ℝ ∞ Φ U) {kp : ℤ} (hkp : kp ≠ 0) |
| 672 | (B M : D → ComplexVector) (a b : HarmonicResidual.VectorCoefficients D) |
| 673 | (p q : Coefficients D) (hB : ∀ i, ContDiffOn ℝ ∞ (fun y => B y i) U) |
| 674 | (hM : ∀ i, ContDiffOn ℝ ∞ (fun y => M y i) U) |
| 675 | (ha : ∀ i, HarmonicResidual.SmoothCoefficients U (a i)) |
| 676 | (hb : ∀ i, HarmonicResidual.SmoothCoefficients U (b i)) |
| 677 | (hp : HarmonicResidual.SmoothCoefficients U p) (hq : HarmonicResidual.SmoothCoefficients U q) |
| 678 | {x : D} (hx : x ∈ U) (j : ℤ) (i : Fin 3) : |
| 679 | HarmonicResidual.nonlinearResidual g k Φ kp (HarmonicResidual.constantVector (B + M)) |
| 680 | (a + b) (p + q) i j x - |
| 681 | HarmonicResidual.nonlinearResidual g k Φ kp (HarmonicResidual.constantVector (B + M)) a p i j x = |
| 682 | HarmonicResidual.linearResidual g k Φ kp (HarmonicResidual.constantVector B) b q i j x + |
| 683 | crossCoefficients g k Φ kp M b i j x + |
| 684 | HarmonicResidual.transport g k Φ kp a b i j x + |
| 685 | HarmonicResidual.transport g k Φ kp b a i j x + |
| 686 | HarmonicResidual.transport g k Φ kp b b i j x := by |
| 687 | have hn := nonlinear_update_coefficients hU g hr hz k hΦ hkp |
| 688 | (HarmonicResidual.constantVector (B + M)) a b p q |
| 689 | (fun r => HarmonicResidual.smoothCoefficients_constant ((hB r).add (hM r))) ha hb hp hq hx j i |
| 690 | have hm := linear_mean_difference g k Φ kp B M b q |
| 691 | (fun r => ((hB r).contDiffAt (hU.mem_nhds hx)).differentiableAt (by simp)) |
| 692 | (fun r => ((hM r).contDiffAt (hU.mem_nhds hx)).differentiableAt (by simp)) j i |
| 693 | linear_combination hn + hm |
| 694 | |
| 695 | noncomputable def linearCoefficients (c : CorrectionState.Context D) |
| 696 | (carrierData b : CorrectionState.HarmonicBlock D) : HarmonicResidual.BlockCoefficients D := |
| 697 | fun n => HarmonicResidual.linearResidual (HarmonicResidual.contextFrame c n) |
| 698 | (carrierData.frequency n) (carrierData.phase n) (carrierData.angularFrequency n) |
| 699 | (HarmonicResidual.constantVector (HarmonicResidual.contextBase c n)) |
| 700 | (blockAmplitude b n) (HarmonicResidual.realCoefficients (b.pressure n)) |
| 701 | |
| 702 | /-- The complete wave change before removing its zero mode. The Gaussian |
| 703 | increment and the alias difference remain literal coefficient fields. -/ |
| 704 | noncomputable def waveChangeCoefficients (c : CorrectionState.Context D) (u : CorrectionState.State D) |
| 705 | (a b : CorrectionState.HarmonicBlock D) (g A₀ A₁ : HarmonicResidual.BlockCoefficients D) : |
| 706 | HarmonicResidual.BlockCoefficients D := |
| 707 | linearCoefficients c a b + meanCross c u.mean (withCarrier a b) + nonlinearCoefficients c a b - |
| 708 | g - (A₁ - A₀) |
| 709 | |
| 710 | theorem residualCoefficients_wave_update {U : Set D} (hU : IsOpen U) |
| 711 | (c : CorrectionState.Context D) (u₀ u₁ : CorrectionState.State D) (he : u₁.mean = u₀.mean) |
| 712 | (a b : CorrectionState.HarmonicBlock D) (G g A₀ A₁ : HarmonicResidual.BlockCoefficients D) |
| 713 | (n : ℕ) (hr : ContDiffOn ℝ ∞ (HarmonicResidual.contextFrame c n).radial U) |
| 714 | (hz : ContDiffOn ℝ ∞ (HarmonicResidual.contextFrame c n).axial U) |
| 715 | (hΦ : ContDiffOn ℝ ∞ (a.phase n) U) (hkp : a.angularFrequency n ≠ 0) |
| 716 | (hB : ∀ i, ContDiffOn ℝ ∞ (fun y => HarmonicResidual.contextBase c n y i) U) |
| 717 | (hM : ∀ i, ContDiffOn ℝ ∞ (fun y => HarmonicResidual.stateMean u₀ n y i) U) |
| 718 | (ha : ∀ i, HarmonicResidual.SmoothCoefficients U (a.velocity n i)) |
| 719 | (hb : ∀ i, HarmonicResidual.SmoothCoefficients U (b.velocity n i)) |
| 720 | (hp : HarmonicResidual.SmoothCoefficients U (a.pressure n)) |
| 721 | (hq : HarmonicResidual.SmoothCoefficients U (b.pressure n)) |
| 722 | {x : D} (hx : x ∈ U) (j : ℤ) (i : Fin 3) : |
| 723 | (HarmonicResidual.ofBlock (addBlock a b) (G + g) A₁ n).residualCoefficients |
| 724 | (HarmonicResidual.contextFrame c n) (HarmonicResidual.contextBase c n) |
| 725 | (HarmonicResidual.stateMean u₁ n) i j x - |
| 726 | (HarmonicResidual.ofBlock a G A₀ n).residualCoefficients |
| 727 | (HarmonicResidual.contextFrame c n) (HarmonicResidual.contextBase c n) |
| 728 | (HarmonicResidual.stateMean u₀ n) i j x = |
| 729 | HarmonicResidual.realCoefficients (waveChangeCoefficients c u₀ a b g A₀ A₁ n i) j x := by |
| 730 | have hstate : HarmonicResidual.stateMean u₁ n = HarmonicResidual.stateMean u₀ n := by |
| 731 | change tripleField u₁.mean n = tripleField u₀.mean n |
| 732 | rw [he] |
| 733 | let N₀ := HarmonicResidual.nonlinearResidual (HarmonicResidual.contextFrame c n) |
| 734 | (a.frequency n) (a.phase n) (a.angularFrequency n) |
| 735 | (HarmonicResidual.constantVector (HarmonicResidual.contextBase c n + HarmonicResidual.stateMean u₀ n)) |
| 736 | (blockAmplitude a n) (HarmonicResidual.realCoefficients (a.pressure n)) |
| 737 | let N₁ := HarmonicResidual.nonlinearResidual (HarmonicResidual.contextFrame c n) |
| 738 | (a.frequency n) (a.phase n) (a.angularFrequency n) |
| 739 | (HarmonicResidual.constantVector (HarmonicResidual.contextBase c n + HarmonicResidual.stateMean u₀ n)) |
| 740 | (blockAmplitude a n + blockAmplitude b n) |
| 741 | (HarmonicResidual.realCoefficients (a.pressure n) + HarmonicResidual.realCoefficients (b.pressure n)) |
| 742 | have hd (m : ℤ) : N₁ i m x - N₀ i m x = |
| 743 | linearCoefficients c a b n i m x + meanCross c u₀.mean (withCarrier a b) n i m x + |
| 744 | nonlinearCoefficients c a b n i m x := by |
| 745 | have hh := nonlinear_update_with_mean hU (HarmonicResidual.contextFrame c n) hr hz |
| 746 | (a.frequency n) hΦ hkp (HarmonicResidual.contextBase c n) (HarmonicResidual.stateMean u₀ n) |
| 747 | (blockAmplitude a n) (blockAmplitude b n) (HarmonicResidual.realCoefficients (a.pressure n)) |
| 748 | (HarmonicResidual.realCoefficients (b.pressure n)) hB hM |
| 749 | (fun r => (ha r).realCoefficients) (fun r => (hb r).realCoefficients) |
| 750 | hp.realCoefficients hq.realCoefficients hx m i |
| 751 | change N₁ i m x - N₀ i m x = _ at hh |
| 752 | change N₁ i m x - N₀ i m x = _ |
| 753 | simp only [linearCoefficients, meanCross, withCarrier, nonlinearCoefficients, |
| 754 | blockTransport, Pi.add_apply, coeff_add, add_assoc] at hh ⊢ |
| 755 | exact hh |
| 756 | simp only [HarmonicResidual.LabelData.residualCoefficients, HarmonicResidual.ofBlock, |
| 757 | addBlock, realCoefficients_add, hstate] |
| 758 | change HarmonicResidual.realCoefficients (N₁ i - (G n i + g n i) - A₁ n i) j x - |
| 759 | HarmonicResidual.realCoefficients (N₀ i - G n i - A₀ n i) j x = _ |
| 760 | rw [← coeff_sub, ← realCoefficients_sub] |
| 761 | have hdiff (m : ℤ) : ((N₁ i - (G n i + g n i) - A₁ n i) - |
| 762 | (N₀ i - G n i - A₀ n i)) m x = waveChangeCoefficients c u₀ a b g A₀ A₁ n i m x := by |
| 763 | simp only [waveChangeCoefficients, Pi.sub_apply, Pi.add_apply, coeff_sub, coeff_add] |
| 764 | linear_combination hd m |
| 765 | simp only [HarmonicResidual.realCoefficients_apply, hdiff] |
| 766 | |
| 767 | theorem residualBlock_wave_update {U : Set D} (hU : IsOpen U) |
| 768 | (c : CorrectionState.Context D) (u₀ u₁ : CorrectionState.State D) (he : u₁.mean = u₀.mean) |
| 769 | (a b : CorrectionState.HarmonicBlock D) (G g A₀ A₁ : HarmonicResidual.BlockCoefficients D) |
| 770 | (n : ℕ) (hr : ContDiffOn ℝ ∞ (HarmonicResidual.contextFrame c n).radial U) |
| 771 | (hz : ContDiffOn ℝ ∞ (HarmonicResidual.contextFrame c n).axial U) |
| 772 | (hΦ : ContDiffOn ℝ ∞ (a.phase n) U) (hkp : a.angularFrequency n ≠ 0) |
| 773 | (hB : ∀ i, ContDiffOn ℝ ∞ (fun y => HarmonicResidual.contextBase c n y i) U) |
| 774 | (hM : ∀ i, ContDiffOn ℝ ∞ (fun y => HarmonicResidual.stateMean u₀ n y i) U) |
| 775 | (ha : ∀ i, HarmonicResidual.SmoothCoefficients U (a.velocity n i)) |
| 776 | (hb : ∀ i, HarmonicResidual.SmoothCoefficients U (b.velocity n i)) |
| 777 | (hp : HarmonicResidual.SmoothCoefficients U (a.pressure n)) |
| 778 | (hq : HarmonicResidual.SmoothCoefficients U (b.pressure n)) |
| 779 | {x : D} (hx : x ∈ U) (j : ℤ) (i : Fin 3) : |
| 780 | (HarmonicResidual.residualBlock c u₁ (addBlock a b) (G + g) A₁).velocity n i j x - |
| 781 | (HarmonicResidual.residualBlock c u₀ a G A₀).velocity n i j x = |
| 782 | HarmonicResidual.nonconstant |
| 783 | (HarmonicResidual.realCoefficients (waveChangeCoefficients c u₀ a b g A₀ A₁ n i)) j x := by |
| 784 | by_cases hj : j = 0 |
| 785 | · subst j |
| 786 | simp [HarmonicResidual.residualBlock_zero_mode, HarmonicResidual.nonconstant] |
| 787 | change HarmonicResidual.nonconstant _ j x - HarmonicResidual.nonconstant _ j x = _ |
| 788 | simp only [nonconstant_apply_of_ne _ hj] |
| 789 | exact residualCoefficients_wave_update hU c u₀ u₁ he a b G g A₀ A₁ n hr hz hΦ hkp |
| 790 | hB hM ha hb hp hq hx j i |
| 791 | |
| 792 | noncomputable def interactionCoefficients (c : CorrectionState.Context D) (u : CorrectionState.State D) |
| 793 | (a b : CorrectionState.HarmonicBlock D) : HarmonicResidual.BlockCoefficients D := |
| 794 | meanCross c u.mean (withCarrier a b) + nonlinearCoefficients c a b |
| 795 | |
| 796 | noncomputable def interactionBlock (c : CorrectionState.Context D) (u : CorrectionState.State D) |
| 797 | (a b : CorrectionState.HarmonicBlock D) : CorrectionState.HarmonicBlock D where |
| 798 | velocity := fun n i => HarmonicResidual.nonconstant |
| 799 | (HarmonicResidual.realCoefficients (interactionCoefficients c u a b n i)) |
| 800 | pressure := fun _ => 0 |
| 801 | frequency := a.frequency |
| 802 | phase := a.phase |
| 803 | angularFrequency := a.angularFrequency |
| 804 | |
| 805 | noncomputable def linearGoodBlock (c : CorrectionState.Context D) |
| 806 | (a b : CorrectionState.HarmonicBlock D) (g : HarmonicResidual.BlockCoefficients D) : |
| 807 | CorrectionState.HarmonicBlock D where |
| 808 | velocity := fun n i => HarmonicResidual.nonconstant |
| 809 | (HarmonicResidual.realCoefficients (linearCoefficients c a b n i - g n i)) |
| 810 | pressure := fun _ => 0 |
| 811 | frequency := a.frequency |
| 812 | phase := a.phase |
| 813 | angularFrequency := a.angularFrequency |
| 814 | |
| 815 | omit [NormedAddCommGroup D] [NormedSpace ℝ D] in |
| 816 | theorem nonconstant_add (a b : Coefficients D) : |
| 817 | HarmonicResidual.nonconstant (a + b) = |
| 818 | HarmonicResidual.nonconstant a + HarmonicResidual.nonconstant b := by |
| 819 | ext j x |
| 820 | by_cases hj : j = 0 |
| 821 | · subst j |
| 822 | simp [HarmonicResidual.nonconstant] |
| 823 | simp only [nonconstant_apply_of_ne _ hj, coeff_add] |
| 824 | |
| 825 | omit [NormedAddCommGroup D] [NormedSpace ℝ D] in |
| 826 | /-- The zero-mode alias remains in the complete residual but vanishes under |
| 827 | the actual nonconstant projection. -/ |
| 828 | theorem nonconstant_real_sub_axisymmetric (a b : Coefficients D) (hb : BandLimited b 0) : |
| 829 | HarmonicResidual.nonconstant (HarmonicResidual.realCoefficients (a - b)) = |
| 830 | HarmonicResidual.nonconstant (HarmonicResidual.realCoefficients a) := by |
| 831 | ext j x |
| 832 | by_cases hj : j = 0 |
| 833 | · subst j |
| 834 | simp [HarmonicResidual.nonconstant] |
| 835 | simp only [nonconstant_apply_of_ne _ hj, HarmonicResidual.realCoefficients_apply, |
| 836 | coeff_sub, band_zero_coefficient hb hj, band_zero_coefficient hb (neg_ne_zero.mpr hj), |
| 837 | Pi.zero_apply, sub_zero] |
| 838 | |
| 839 | theorem waveChange_projection_split (c : CorrectionState.Context D) (u : CorrectionState.State D) |
| 840 | (a b : CorrectionState.HarmonicBlock D) (g A₀ A₁ : HarmonicResidual.BlockCoefficients D) |
| 841 | (hA : ∀ n i, BandLimited (A₁ n i - A₀ n i) 0) (n : ℕ) (i : Fin 3) : |
| 842 | HarmonicResidual.nonconstant |
| 843 | (HarmonicResidual.realCoefficients (waveChangeCoefficients c u a b g A₀ A₁ n i)) = |
| 844 | (linearGoodBlock c a b g).velocity n i + (interactionBlock c u a b).velocity n i := by |
| 845 | change HarmonicResidual.nonconstant (HarmonicResidual.realCoefficients |
| 846 | ((linearCoefficients c a b n i + meanCross c u.mean (withCarrier a b) n i + |
| 847 | nonlinearCoefficients c a b n i - g n i) - (A₁ n i - A₀ n i))) = _ |
| 848 | rw [nonconstant_real_sub_axisymmetric _ _ (hA n i)] |
| 849 | have he : linearCoefficients c a b n i + meanCross c u.mean (withCarrier a b) n i + |
| 850 | nonlinearCoefficients c a b n i - g n i = |
| 851 | (linearCoefficients c a b n i - g n i) + interactionCoefficients c u a b n i := by |
| 852 | simp only [interactionCoefficients, Pi.add_apply] |
| 853 | abel |
| 854 | rw [he, realCoefficients_add, nonconstant_add] |
| 855 | rfl |
| 856 | |
| 857 | theorem residualBlock_wave_update_split {U : Set D} (hU : IsOpen U) |
| 858 | (c : CorrectionState.Context D) (u₀ u₁ : CorrectionState.State D) (he : u₁.mean = u₀.mean) |
| 859 | (a b : CorrectionState.HarmonicBlock D) (G g A₀ A₁ : HarmonicResidual.BlockCoefficients D) |
| 860 | (hA : ∀ n i, BandLimited (A₁ n i - A₀ n i) 0) |
| 861 | (n : ℕ) (hr : ContDiffOn ℝ ∞ (HarmonicResidual.contextFrame c n).radial U) |
| 862 | (hz : ContDiffOn ℝ ∞ (HarmonicResidual.contextFrame c n).axial U) |
| 863 | (hΦ : ContDiffOn ℝ ∞ (a.phase n) U) (hkp : a.angularFrequency n ≠ 0) |
| 864 | (hB : ∀ i, ContDiffOn ℝ ∞ (fun y => HarmonicResidual.contextBase c n y i) U) |
| 865 | (hM : ∀ i, ContDiffOn ℝ ∞ (fun y => HarmonicResidual.stateMean u₀ n y i) U) |
| 866 | (ha : ∀ i, HarmonicResidual.SmoothCoefficients U (a.velocity n i)) |
| 867 | (hb : ∀ i, HarmonicResidual.SmoothCoefficients U (b.velocity n i)) |
| 868 | (hp : HarmonicResidual.SmoothCoefficients U (a.pressure n)) |
| 869 | (hq : HarmonicResidual.SmoothCoefficients U (b.pressure n)) |
| 870 | {x : D} (hx : x ∈ U) (j : ℤ) (i : Fin 3) : |
| 871 | (HarmonicResidual.residualBlock c u₁ (addBlock a b) (G + g) A₁).velocity n i j x - |
| 872 | (HarmonicResidual.residualBlock c u₀ a G A₀).velocity n i j x = |
| 873 | (linearGoodBlock c a b g).velocity n i j x + (interactionBlock c u₀ a b).velocity n i j x := by |
| 874 | rw [residualBlock_wave_update hU c u₀ u₁ he a b G g A₀ A₁ n hr hz hΦ hkp hB hM ha hb hp hq hx j i, |
| 875 | waveChange_projection_split c u₀ a b g A₀ A₁ hA n i] |
| 876 | rfl |
| 877 | |
| 878 | /-- Mean-wave and wave-wave terms retain their separate gains until the |
| 879 | final minimum. No class hypothesis is imposed on their output. -/ |
| 880 | theorem interactionBlock_class {s : StripData D} {κ α β H : ℝ} {P : ℕ → D → ℝ} |
| 881 | (c : CorrectionState.Context D) (ho : MeanIncrementBounds.OperatorBounds s c.operators κ) |
| 882 | (hκ : κ ≤ 1 / 2) (hR : ∀ x ∈ s.domain, 0 < c.operators.radius x) |
| 883 | {u : CorrectionState.State D} (hm : MeanIncrementBounds.IncrementBounds s H u.mean) |
| 884 | {a b : CorrectionState.HarmonicBlock D} {M N : ℕ} |
| 885 | (ha : a.WaveBounds s P α) (hb : b.WaveBounds s P β) |
| 886 | (ha0 : ZeroMode a) (hb0 : ZeroMode b) (hM : a.BandLimited M) (hN : b.BandLimited N) |
| 887 | (hΦ : ∀ n, ContDiffOn ℝ ∞ (a.phase n) s.domain) (hk : ∀ n, a.frequency n ≠ 0) |
| 888 | (hda : ModeSolenoidal s c a) (hdb : ModeSolenoidal s c (withCarrier a b)) |
| 889 | (hNormal : ∀ i, UnweightedClass s 0 (fun n x => slowNormal c ho hR a.phase n x i)) |
| 890 | (hFreq : BandBound s (-(1 / 2)) a.frequency) |
| 891 | (hAng : BandBound s (-(1 / 2)) (fun n => (a.angularFrequency n : ℝ))) |
| 892 | (hP0 : ∀ n x, x ∈ s.domain → 0 ≤ P n x) |
| 893 | (hP1 : ∀ n x, x ∈ s.domain → P n x ≤ 1) : |
| 894 | (interactionBlock c u a b).WaveBounds s P |
| 895 | (min (β + H - 1 / 2) (min (α + β - κ) (β + β - κ))) := by |
| 896 | intro i j hj |
| 897 | have hmean := realMeanCross_class c ho hκ hR hm (b := withCarrier a b) hb hNormal hFreq hAng hP0 hj i |
| 898 | have hnon m := nonlinearCoefficients_wave_class c ho hR ha hb ha0 hb0 hM hN hΦ hk hda hdb hP0 hP1 m i |
| 899 | have hn := realCoefficient_class (fun n => nonlinearCoefficients c a b n i) j (hnon j) (hnon (-j)) |
| 900 | apply class_congr ((hmean.mono_exponent (min_le_left _ _)).add |
| 901 | (hn.mono_exponent (min_le_right _ _))) |
| 902 | intro n x _ |
| 903 | change _ = HarmonicResidual.nonconstant (HarmonicResidual.realCoefficients |
| 904 | (meanCross c u.mean (withCarrier a b) n i + nonlinearCoefficients c a b n i)) j x |
| 905 | rw [nonconstant_apply_of_ne _ hj, realCoefficients_add] |
| 906 | rfl |
| 907 | |
| 908 | /-! ## Extracting the actual divergence condition -/ |
| 909 | |
| 910 | noncomputable def divergenceCoefficients (g : HarmonicResidual.Frame D) |
| 911 | (k : ℝ) (Φ : D → ℝ) (kp : ℤ) (a : HarmonicResidual.VectorCoefficients D) : Coefficients D := |
| 912 | differentiate g.radial k Φ (a 0) + |
| 913 | constantCoefficient (fun x => ((g.radius x)⁻¹ : ℝ) : D → ℂ) * a 0 + |
| 914 | constantCoefficient (fun x => ((g.radius x)⁻¹ : ℝ) : D → ℂ) * angularDifferentiate kp (a 1) + |
| 915 | differentiate g.axial k Φ (a 2) |
| 916 | |
| 917 | theorem field_divergenceCoefficients {U : Set D} (hU : IsOpen U) |
| 918 | (g : HarmonicResidual.Frame D) (k : ℝ) {Φ : D → ℝ} (hΦ : ContDiffOn ℝ ∞ Φ U) |
| 919 | (kp : ℤ) (a : HarmonicResidual.VectorCoefficients D) |
| 920 | (ha : ∀ i, HarmonicResidual.SmoothCoefficients U (a i)) |
| 921 | {p : D × ℝ} (hp : p ∈ HarmonicResidual.liftDomain U) : |
| 922 | field (divergenceCoefficients g k Φ kp a) k Φ kp p = |
| 923 | cylindricalDivergence (fun y => g.radius y.1) (HarmonicResidual.liftDirection g.radial) |
| 924 | HarmonicResidual.angularDirection (HarmonicResidual.liftDirection g.axial) |
| 925 | (HarmonicResidual.vectorField a k Φ kp) p := by |
| 926 | simp only [divergenceCoefficients, HarmonicResidual.field_add, field_mul, |
| 927 | HarmonicResidual.field_constant, |
| 928 | HarmonicResidual.field_differentiate hU (ha 0) hΦ g.radial k kp hp, |
| 929 | HarmonicResidual.field_differentiate hU (ha 2) hΦ g.axial k kp hp, |
| 930 | HarmonicResidual.field_angularDifferentiate hU (ha 1) hΦ k kp hp, |
| 931 | cylindricalDivergence, HarmonicResidual.vectorField, Complex.real_smul] |
| 932 | |
| 933 | theorem divergenceCoefficients_single (g : HarmonicResidual.Frame D) |
| 934 | (k : ℝ) (Φ : D → ℝ) (kp : ℤ) (a : HarmonicResidual.VectorCoefficients D) (j : ℤ) : |
| 935 | divergenceCoefficients g k Φ kp (fun i => AddMonoidAlgebra.single j (a i j)) = |
| 936 | AddMonoidAlgebra.single j (divergenceCoefficients g k Φ kp a j) := by |
| 937 | ext m x |
| 938 | by_cases hm : m = j |
| 939 | · subst m |
| 940 | simp [divergenceCoefficients, constantCoefficient, -LaurentPolynomial.single_eq_C_mul_T] |
| 941 | · simp [divergenceCoefficients, constantCoefficient, hm, |
| 942 | derivativeCoefficient, along, -LaurentPolynomial.single_eq_C_mul_T] |
| 943 | |
| 944 | theorem smoothCoefficients_single {U : Set D} {f : D → ℂ} |
| 945 | (hf : ContDiffOn ℝ ∞ f U) (j : ℤ) : |
| 946 | HarmonicResidual.SmoothCoefficients U (AddMonoidAlgebra.single j f) := by |
| 947 | intro l |
| 948 | change ContDiffOn ℝ ∞ ((Finsupp.single j f) l) U |
| 949 | by_cases hl : l = j |
| 950 | · subst l |
| 951 | simpa only [Finsupp.single_eq_same] using hf |
| 952 | · rw [Finsupp.single_eq_of_ne hl] |
| 953 | exact contDiffOn_const |
| 954 | |
| 955 | theorem modeSolenoidal_of_full {s : StripData D} (c : CorrectionState.Context D) |
| 956 | (b : CorrectionState.HarmonicBlock D) |
| 957 | (hΦ : ∀ n, ContDiffOn ℝ ∞ (b.phase n) s.domain) |
| 958 | (hkp : ∀ n, b.angularFrequency n ≠ 0) |
| 959 | (hb : ∀ n i, HarmonicResidual.SmoothCoefficients s.domain (b.velocity n i)) |
| 960 | (hdiv : ∀ n p, p.1 ∈ s.domain → |
| 961 | cylindricalDivergence (fun q => c.operators.radius q.1) |
| 962 | (HarmonicResidual.liftDirection (HarmonicResidual.contextFrame c n).radial) |
| 963 | HarmonicResidual.angularDirection |
| 964 | (HarmonicResidual.liftDirection (HarmonicResidual.contextFrame c n).axial) |
| 965 | (fun q i => (b.oscillation n q i : ℂ)) p = 0) : ModeSolenoidal s c b := by |
| 966 | intro j _ n p hp |
| 967 | have hp' : p ∈ HarmonicResidual.liftDomain s.domain := ⟨hp, trivial⟩ |
| 968 | have hb' i := (hb n i).realCoefficients |
| 969 | have hfield : HarmonicResidual.vectorField (blockAmplitude b n) |
| 970 | (b.frequency n) (b.phase n) (b.angularFrequency n) = fun q i => (b.oscillation n q i : ℂ) := by |
| 971 | ext q i |
| 972 | exact HarmonicResidual.field_realCoefficients _ _ _ _ _ |
| 973 | have hz : divergenceCoefficients (HarmonicResidual.contextFrame c n) |
| 974 | (b.frequency n) (b.phase n) (b.angularFrequency n) (blockAmplitude b n) j p.1 = 0 := by |
| 975 | have he := coefficient_eq_of_field_eq_at |
| 976 | (divergenceCoefficients (HarmonicResidual.contextFrame c n) |
| 977 | (b.frequency n) (b.phase n) (b.angularFrequency n) (blockAmplitude b n)) |
| 978 | 0 (b.frequency n) (b.phase n) (hkp n) j p.1 |
| 979 | apply he |
| 980 | intro θ |
| 981 | rw [field_divergenceCoefficients s.isOpen_domain (HarmonicResidual.contextFrame c n) |
| 982 | (b.frequency n) (hΦ n) (b.angularFrequency n) (blockAmplitude b n) hb' |
| 983 | (p := (p.1, θ)) ⟨hp, trivial⟩, |
| 984 | hfield, HarmonicResidual.field_zero] |
| 985 | exact hdiv n (p.1, θ) hp |
| 986 | change cylindricalDivergence (fun q => (HarmonicResidual.contextFrame c n).radius q.1) |
| 987 | (HarmonicResidual.liftDirection (HarmonicResidual.contextFrame c n).radial) |
| 988 | HarmonicResidual.angularDirection |
| 989 | (HarmonicResidual.liftDirection (HarmonicResidual.contextFrame c n).axial) |
| 990 | (HarmonicResidual.vectorField |
| 991 | (fun i => AddMonoidAlgebra.single j (blockAmplitude b n i j)) |
| 992 | (b.frequency n) (b.phase n) (b.angularFrequency n)) p = 0 |
| 993 | rw [← field_divergenceCoefficients s.isOpen_domain (HarmonicResidual.contextFrame c n) |
| 994 | (b.frequency n) (hΦ n) (b.angularFrequency n) |
| 995 | (fun i => AddMonoidAlgebra.single j (blockAmplitude b n i j)) |
| 996 | (fun i => smoothCoefficients_single (hb' i j) j) hp', divergenceCoefficients_single] |
| 997 | simp only [field, evaluate_single, hz, zero_mul] |
| 998 | |
| 999 | theorem waveBounds_smooth {s : StripData D} {P : ℕ → D → ℝ} {α : ℝ} |
| 1000 | {b : CorrectionState.HarmonicBlock D} (hb : b.WaveBounds s P α) (h0 : ZeroMode b) |
| 1001 | (n : ℕ) (i : Fin 3) : HarmonicResidual.SmoothCoefficients s.domain (b.velocity n i) := by |
| 1002 | intro j |
| 1003 | by_cases hj : j = 0 |
| 1004 | · subst j |
| 1005 | rw [h0 n i] |
| 1006 | exact contDiffOn_const |
| 1007 | exact (hb i j hj).smooth n |
| 1008 | |
| 1009 | /-! ## Finite harmonic values, realness, and actual label reconstruction -/ |
| 1010 | |
| 1011 | theorem nonlinearCoefficients_band (c : CorrectionState.Context D) |
| 1012 | {a b : CorrectionState.HarmonicBlock D} {M N : ℕ} |
| 1013 | (ha : a.BandLimited M) (hb : b.BandLimited N) (n : ℕ) (i : Fin 3) : |
| 1014 | BandLimited (nonlinearCoefficients c a b n i) (max (M + N) (N + N)) := by |
| 1015 | have ha' r := HarmonicResidual.band_realCoefficients (ha.1 n r) |
| 1016 | have hb' r := HarmonicResidual.band_realCoefficients (hb.1 n r) |
| 1017 | have hab := HarmonicResidual.band_transport (HarmonicResidual.contextFrame c n) |
| 1018 | (a.frequency n) (a.phase n) (a.angularFrequency n) ha' hb' i |
| 1019 | have hba := HarmonicResidual.band_transport (HarmonicResidual.contextFrame c n) |
| 1020 | (a.frequency n) (a.phase n) (a.angularFrequency n) hb' ha' i |
| 1021 | have hbb := HarmonicResidual.band_transport (HarmonicResidual.contextFrame c n) |
| 1022 | (a.frequency n) (a.phase n) (a.angularFrequency n) hb' hb' i |
| 1023 | exact ((hab.mono (le_max_left _ _)).add (hba.mono (by omega))).add |
| 1024 | (hbb.mono (le_max_right _ _)) |
| 1025 | |
| 1026 | theorem crossCoefficients_band (g : HarmonicResidual.Frame D) |
| 1027 | (k : ℝ) (Φ : D → ℝ) (kp : ℤ) (m : D → ComplexVector) |
| 1028 | {a : HarmonicResidual.VectorCoefficients D} {N : ℕ} |
| 1029 | (ha : ∀ i, BandLimited (a i) N) (i : Fin 3) : |
| 1030 | BandLimited (crossCoefficients g k Φ kp m a i) N := by |
| 1031 | have hleft : BandLimited (HarmonicResidual.transport g k Φ kp |
| 1032 | (HarmonicResidual.constantVector m) a i) N := by |
| 1033 | have h := HarmonicResidual.band_transport g k Φ kp |
| 1034 | (fun j => band_constantCoefficient (fun x => m x j)) ha i |
| 1035 | simp only [zero_add] at h |
| 1036 | exact h |
| 1037 | have hright : BandLimited (HarmonicResidual.transport g k Φ kp a |
| 1038 | (HarmonicResidual.constantVector m) i) N := by |
| 1039 | have h := HarmonicResidual.band_transport g k Φ kp |
| 1040 | ha (fun j => band_constantCoefficient (fun x => m x j)) i |
| 1041 | simp only [add_zero] at h |
| 1042 | exact h |
| 1043 | exact hleft.add hright |
| 1044 | |
| 1045 | theorem interactionBlock_band (c : CorrectionState.Context D) (u : CorrectionState.State D) |
| 1046 | {a b : CorrectionState.HarmonicBlock D} {M N : ℕ} |
| 1047 | (ha : a.BandLimited M) (hb : b.BandLimited N) : |
| 1048 | (interactionBlock c u a b).BandLimited (max (M + N) (N + N)) := by |
| 1049 | refine ⟨fun n i => ?_, fun _ => HarmonicResidual.band_zero _⟩ |
| 1050 | apply HarmonicResidual.band_nonconstant |
| 1051 | apply HarmonicResidual.band_realCoefficients |
| 1052 | have hcross := crossCoefficients_band (HarmonicResidual.contextFrame c n) |
| 1053 | (a.frequency n) (a.phase n) (a.angularFrequency n) (tripleField u.mean n) |
| 1054 | (fun r => HarmonicResidual.band_realCoefficients (hb.1 n r)) i |
| 1055 | exact (hcross.mono (by omega)).add (nonlinearCoefficients_band c ha hb n i) |
| 1056 | |
| 1057 | theorem interactionBlock_conjugate (c : CorrectionState.Context D) (u : CorrectionState.State D) |
| 1058 | (a b : CorrectionState.HarmonicBlock D) (n : ℕ) (i : Fin 3) : |
| 1059 | ConjugateSymmetric ((interactionBlock c u a b).velocity n i) := |
| 1060 | HarmonicResidual.nonconstant_conjugate (HarmonicResidual.realCoefficients_conjugate _) |
| 1061 | |
| 1062 | theorem interactionBlock_zero (c : CorrectionState.Context D) (u : CorrectionState.State D) |
| 1063 | (a b : CorrectionState.HarmonicBlock D) : ZeroMode (interactionBlock c u a b) := by |
| 1064 | intro n i |
| 1065 | simp [interactionBlock, HarmonicResidual.nonconstant] |
| 1066 | |
| 1067 | theorem linearGoodBlock_band (c : CorrectionState.Context D) (a : CorrectionState.HarmonicBlock D) |
| 1068 | {b : CorrectionState.HarmonicBlock D} {g : HarmonicResidual.BlockCoefficients D} {N E : ℕ} |
| 1069 | (hb : b.BandLimited N) (hg : ∀ n i, BandLimited (g n i) E) : |
| 1070 | (linearGoodBlock c a b g).BandLimited (max N E) := by |
| 1071 | refine ⟨fun n i => ?_, fun _ => HarmonicResidual.band_zero _⟩ |
| 1072 | apply HarmonicResidual.band_nonconstant |
| 1073 | apply HarmonicResidual.band_realCoefficients |
| 1074 | have hlin := HarmonicResidual.band_linearResidual (HarmonicResidual.contextFrame c n) |
| 1075 | (a.frequency n) (a.phase n) (a.angularFrequency n) |
| 1076 | (B := HarmonicResidual.constantVector (HarmonicResidual.contextBase c n)) |
| 1077 | (fun _ => band_constantCoefficient _) |
| 1078 | (fun r => HarmonicResidual.band_realCoefficients (hb.1 n r)) |
| 1079 | (HarmonicResidual.band_realCoefficients (hb.2 n)) i |
| 1080 | exact HarmonicResidual.band_sub (hlin.mono (le_max_left _ _)) ((hg n i).mono (le_max_right _ _)) |
| 1081 | |
| 1082 | theorem linearGoodBlock_conjugate (c : CorrectionState.Context D) |
| 1083 | (a b : CorrectionState.HarmonicBlock D) (g : HarmonicResidual.BlockCoefficients D) (n : ℕ) (i : Fin 3) : |
| 1084 | ConjugateSymmetric ((linearGoodBlock c a b g).velocity n i) := |
| 1085 | HarmonicResidual.nonconstant_conjugate (HarmonicResidual.realCoefficients_conjugate _) |
| 1086 | |
| 1087 | theorem linearGoodBlock_zero (c : CorrectionState.Context D) |
| 1088 | (a b : CorrectionState.HarmonicBlock D) (g : HarmonicResidual.BlockCoefficients D) : |
| 1089 | ZeroMode (linearGoodBlock c a b g) := by |
| 1090 | intro n i |
| 1091 | simp [linearGoodBlock, HarmonicResidual.nonconstant] |
| 1092 | |
| 1093 | noncomputable def waveResidualDifferenceBlock (c : CorrectionState.Context D) |
| 1094 | (u₀ u₁ : CorrectionState.State D) (a b : CorrectionState.HarmonicBlock D) |
| 1095 | (G g A₀ A₁ : HarmonicResidual.BlockCoefficients D) : CorrectionState.HarmonicBlock D where |
| 1096 | velocity := fun n i => (HarmonicResidual.residualBlock c u₁ (addBlock a b) (G + g) A₁).velocity n i - |
| 1097 | (HarmonicResidual.residualBlock c u₀ a G A₀).velocity n i |
| 1098 | pressure := fun _ => 0 |
| 1099 | frequency := a.frequency |
| 1100 | phase := a.phase |
| 1101 | angularFrequency := a.angularFrequency |
| 1102 | |
| 1103 | theorem waveResidualDifferenceBlock_field (c : CorrectionState.Context D) |
| 1104 | (u₀ u₁ : CorrectionState.State D) (a b : CorrectionState.HarmonicBlock D) |
| 1105 | (G g A₀ A₁ : HarmonicResidual.BlockCoefficients D) (n : ℕ) (x : D × ℝ) (i : Fin 3) : |
| 1106 | (waveResidualDifferenceBlock c u₀ u₁ a b G g A₀ A₁).oscillation n x i = |
| 1107 | (HarmonicResidual.residualBlock c u₁ (addBlock a b) (G + g) A₁).oscillation n x i - |
| 1108 | (HarmonicResidual.residualBlock c u₀ a G A₀).oscillation n x i := by |
| 1109 | simp only [waveResidualDifferenceBlock, CorrectionState.HarmonicBlock.oscillation, |
| 1110 | HarmonicResidual.field_sub, Complex.sub_re] |
| 1111 | rfl |
| 1112 | |
| 1113 | /-- The grouped difference is the change in the actual good nonconstant PDE |
| 1114 | residual. Cross-label products vanish by the disjoint supports contained in |
| 1115 | `ExtractionRegular`; finite sums alone are not used as uniform estimates. -/ |
| 1116 | theorem grouped_wave_change {ι : Type*} {U : Set D} (hU : IsOpen U) |
| 1117 | {c : CorrectionState.Context D} {u₀ u₁ : CorrectionState.State D} |
| 1118 | {labels : ℕ → Finset ι} {a b : ι → CorrectionState.HarmonicBlock D} |
| 1119 | {G g A₀ A₁ : ι → HarmonicResidual.BlockCoefficients D} |
| 1120 | (hrep₀ : HarmonicResidual.BlockRepresentation labels a G A₀ u₀) |
| 1121 | (hrep₁ : HarmonicResidual.BlockRepresentation labels (fun l => addBlock (a l) (b l)) |
| 1122 | (fun l => G l + g l) A₁ u₁) {n : ℕ} |
| 1123 | (h₀ : HarmonicResidual.ExtractionRegular U c u₀ labels a G A₀ n) |
| 1124 | (h₁ : HarmonicResidual.ExtractionRegular U c u₁ labels (fun l => addBlock (a l) (b l)) |
| 1125 | (fun l => G l + g l) A₁ n) |
| 1126 | {x : D × ℝ} (hx : x ∈ HarmonicResidual.liftDomain U) (i : Fin 3) : |
| 1127 | HarmonicResidual.stateGoodWaveResidual c u₁ n x i - |
| 1128 | HarmonicResidual.stateGoodWaveResidual c u₀ n x i = |
| 1129 | ∑ l ∈ labels n, (waveResidualDifferenceBlock c u₀ u₁ (a l) (b l) |
| 1130 | (G l) (g l) (A₀ l) (A₁ l)).oscillation n x i := by |
| 1131 | rw [HarmonicResidual.stateGoodWaveResidual_grouped hU hrep₁ h₁ hx i, |
| 1132 | HarmonicResidual.stateGoodWaveResidual_grouped hU hrep₀ h₀ hx i] |
| 1133 | simp only [waveResidualDifferenceBlock_field, Finset.sum_sub_distrib] |
| 1134 | |
| 1135 | end NavierStokes.HarmonicWaveInteraction |