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.ParticularWaveBounds |
| 2 | import NavierStokes.HarmonicResidual |
| 3 | import NavierStokes.LiftedMeanResidual |
| 4 | |
| 5 | /-! |
| 6 | # Isometric reindexing of the actual correction state |
| 7 | |
| 8 | Pullback along `e : D ≃ₗᵢ[ℝ] E` sends fields on `E` to fields on `D`. |
| 9 | Vector directions are transported by `e.symm`. The final specialization is |
| 10 | the existing associator from `PressureStream.Lift S` to `((ℝ × S) × Plane)`. |
| 11 | -/ |
| 12 | |
| 13 | noncomputable section |
| 14 | |
| 15 | namespace NavierStokes.StateReindex |
| 16 | |
| 17 | open Set Filter Function HarmonicCalculus |
| 18 | open scoped Topology ContDiff BigOperators ComplexConjugate |
| 19 | |
| 20 | variable {D E F : Type} [NormedAddCommGroup D] [NormedSpace ℝ D] |
| 21 | [NormedAddCommGroup E] [NormedSpace ℝ E] [NormedAddCommGroup F] [NormedSpace ℝ F] |
| 22 | |
| 23 | noncomputable def cylinder (e : D ≃ₗᵢ[ℝ] E) : (D × ℝ) ≃ₗᵢ[ℝ] (E × ℝ) where |
| 24 | toLinearEquiv := e.toLinearEquiv.prodCongr (LinearEquiv.refl ℝ ℝ) |
| 25 | norm_map' x := by |
| 26 | change max ‖e x.1‖ ‖x.2‖ = max ‖x.1‖ ‖x.2‖ |
| 27 | rw [e.norm_map] |
| 28 | |
| 29 | @[simp] theorem cylinder_apply (e : D ≃ₗᵢ[ℝ] E) (x : D × ℝ) : |
| 30 | cylinder e x = (e x.1, x.2) := rfl |
| 31 | |
| 32 | @[simp] theorem cylinder_symm_apply (e : D ≃ₗᵢ[ℝ] E) (x : E × ℝ) : |
| 33 | (cylinder e).symm x = (e.symm x.1, x.2) := rfl |
| 34 | |
| 35 | noncomputable def vector (e : D ≃ₗᵢ[ℝ] E) (V : E → E) : D → D := |
| 36 | ParticularWaveBounds.reindexVector e V |
| 37 | |
| 38 | theorem fderiv_pull (e : D ≃ₗᵢ[ℝ] E) (f : E → F) (x v : D) : |
| 39 | fderiv ℝ (fun y => f (e y)) x v = fderiv ℝ f (e x) (e v) := by |
| 40 | change fderiv ℝ (f ∘ e.toContinuousLinearEquiv) x v = _ |
| 41 | rw [e.toContinuousLinearEquiv.comp_right_fderiv] |
| 42 | rfl |
| 43 | |
| 44 | theorem along_pull (e : D ≃ₗᵢ[ℝ] E) (V : E → E) (f : E → F) : |
| 45 | along (vector e V) (fun x => f (e x)) = fun x => along V f (e x) := by |
| 46 | funext x |
| 47 | unfold along vector ParticularWaveBounds.reindexVector |
| 48 | rw [fderiv_pull, e.apply_symm_apply] |
| 49 | |
| 50 | theorem along_pull_component {ι : Type*} (e : D ≃ₗᵢ[ℝ] E) (V : E → E) |
| 51 | (f : E → ι → F) (i : ι) : |
| 52 | along (vector e V) (fun x => f (e x) i) = |
| 53 | fun x => along V (fun y => f y i) (e x) := along_pull e V (fun y => f y i) |
| 54 | |
| 55 | theorem iteratedFDeriv_pull (e : D ≃ₗᵢ[ℝ] E) (f : E → F) (m : ℕ) (x : D) : |
| 56 | iteratedFDeriv ℝ m (fun y => f (e y)) x = |
| 57 | (iteratedFDeriv ℝ m f (e x)).compContinuousLinearMap |
| 58 | (fun _ => e.toContinuousLinearEquiv.toContinuousLinearMap) := by |
| 59 | have h := e.toContinuousLinearEquiv.iteratedFDerivWithin_comp_right f |
| 60 | uniqueDiffOn_univ (mem_univ (e x)) m |
| 61 | simp only [iteratedFDerivWithin_univ, preimage_univ, Function.comp_def] at h |
| 62 | exact h |
| 63 | |
| 64 | theorem norm_iteratedFDeriv_pull (e : D ≃ₗᵢ[ℝ] E) (f : E → F) (m : ℕ) (x : D) : |
| 65 | ‖iteratedFDeriv ℝ m (fun y => f (e y)) x‖ = ‖iteratedFDeriv ℝ m f (e x)‖ := |
| 66 | e.norm_iteratedFDeriv_comp_right f x m |
| 67 | |
| 68 | noncomputable def field (e : D ≃ₗᵢ[ℝ] E) (f : MeanIncrementBounds.Field E) : |
| 69 | MeanIncrementBounds.Field D := fun n x => f n (e x) |
| 70 | |
| 71 | noncomputable def triple (e : D ≃ₗᵢ[ℝ] E) (b : MeanIncrementBounds.Triple E) : |
| 72 | MeanIncrementBounds.Triple D := ⟨field e b.radial, field e b.angular, field e b.axial⟩ |
| 73 | |
| 74 | noncomputable def operators (e : D ≃ₗᵢ[ℝ] E) (o : MeanIncrementBounds.Operators E) : |
| 75 | MeanIncrementBounds.Operators D where |
| 76 | epsilon := o.epsilon |
| 77 | radialFrequency := o.radialFrequency |
| 78 | fastCoefficient := o.fastCoefficient |
| 79 | radius := fun x => o.radius (e x) |
| 80 | radialProfile := fun x => o.radialProfile (e x) |
| 81 | eR := e.symm o.eR |
| 82 | eZ := e.symm o.eZ |
| 83 | eT := e.symm o.eT |
| 84 | vR := e.symm o.vR |
| 85 | vT := e.symm o.vT |
| 86 | |
| 87 | noncomputable def context (e : D ≃ₗᵢ[ℝ] E) (c : CorrectionState.Context E) : |
| 88 | CorrectionState.Context D where |
| 89 | operators := operators e c.operators |
| 90 | base := triple e c.base |
| 91 | virtualTheta := field e c.virtualTheta |
| 92 | virtualAxial := field e c.virtualAxial |
| 93 | |
| 94 | noncomputable def oscillation (e : D ≃ₗᵢ[ℝ] E) (u : CorrectionState.Oscillation E) : |
| 95 | CorrectionState.Oscillation D := fun n x => u n (cylinder e x) |
| 96 | |
| 97 | noncomputable def errors (e : D ≃ₗᵢ[ℝ] E) (a : CorrectionState.ExcludedErrors E) : |
| 98 | CorrectionState.ExcludedErrors D := |
| 99 | ⟨oscillation e a.base, oscillation e a.gaussian, oscillation e a.aliasError⟩ |
| 100 | |
| 101 | noncomputable def state (e : D ≃ₗᵢ[ℝ] E) (u : CorrectionState.State E) : CorrectionState.State D where |
| 102 | mean := triple e u.mean |
| 103 | pressure := field e u.pressure |
| 104 | oscillation := oscillation e u.oscillation |
| 105 | oscillatoryPressure := fun n x => u.oscillatoryPressure n (cylinder e x) |
| 106 | errors := errors e u.errors |
| 107 | |
| 108 | theorem fderiv_field (e : D ≃ₗᵢ[ℝ] E) (f : MeanIncrementBounds.Field E) |
| 109 | (n : ℕ) (x : D) (v : E) : |
| 110 | fderiv ℝ (field e f n) x (e.symm v) = fderiv ℝ (f n) (e x) v := by |
| 111 | change fderiv ℝ (fun y => f n (e y)) x (e.symm v) = _ |
| 112 | rw [fderiv_pull, e.apply_symm_apply] |
| 113 | |
| 114 | theorem dr_pull (e : D ≃ₗᵢ[ℝ] E) (o : MeanIncrementBounds.Operators E) |
| 115 | (f : MeanIncrementBounds.Field E) : (operators e o).dr (field e f) = field e (o.dr f) := by |
| 116 | funext n x |
| 117 | simp only [MeanIncrementBounds.Operators.dr, WeightedClasses.graphDerivative, |
| 118 | operators, fderiv_field, field] |
| 119 | |
| 120 | theorem dz_pull (e : D ≃ₗᵢ[ℝ] E) (o : MeanIncrementBounds.Operators E) |
| 121 | (f : MeanIncrementBounds.Field E) : (operators e o).dz (field e f) = field e (o.dz f) := by |
| 122 | funext n x |
| 123 | simp only [MeanIncrementBounds.Operators.dz, operators, fderiv_field, field] |
| 124 | |
| 125 | theorem time_pull (e : D ≃ₗᵢ[ℝ] E) (o : MeanIncrementBounds.Operators E) |
| 126 | (f : MeanIncrementBounds.Field E) : (operators e o).time (field e f) = field e (o.time f) := by |
| 127 | funext n x |
| 128 | simp only [MeanIncrementBounds.Operators.time, MeanIncrementBounds.Operators.slowTime, |
| 129 | MeanIncrementBounds.Operators.fastTime, operators, fderiv_field, field, Pi.add_apply] |
| 130 | |
| 131 | theorem radialDiv_pull (e : D ≃ₗᵢ[ℝ] E) (o : MeanIncrementBounds.Operators E) |
| 132 | (k : ℝ) (f : MeanIncrementBounds.Field E) : |
| 133 | (operators e o).radialDiv k (field e f) = field e (o.radialDiv k f) := by |
| 134 | unfold MeanIncrementBounds.Operators.radialDiv |
| 135 | rw [dr_pull] |
| 136 | rfl |
| 137 | |
| 138 | theorem viscosity_pull (e : D ≃ₗᵢ[ℝ] E) (o : MeanIncrementBounds.Operators E) |
| 139 | (k : ℝ) (f : MeanIncrementBounds.Field E) : |
| 140 | (operators e o).viscosity k (field e f) = field e (o.viscosity k f) := by |
| 141 | unfold MeanIncrementBounds.Operators.viscosity |
| 142 | rw [dr_pull, dr_pull, dz_pull, dz_pull] |
| 143 | rfl |
| 144 | |
| 145 | theorem angularAverage_pull (e : D ≃ₗᵢ[ℝ] E) (f : CorrectionState.OscillatoryScalar E) : |
| 146 | CorrectionState.angularAverage (fun n x => f n (cylinder e x)) = |
| 147 | field e (CorrectionState.angularAverage f) := rfl |
| 148 | |
| 149 | theorem covariance_pull (e : D ≃ₗᵢ[ℝ] E) (u : CorrectionState.State E) (i j : Fin 3) : |
| 150 | (state e u).covariance i j = field e (u.covariance i j) := rfl |
| 151 | |
| 152 | theorem totalErrors_pull (e : D ≃ₗᵢ[ℝ] E) (a : CorrectionState.ExcludedErrors E) : |
| 153 | (errors e a).total = oscillation e a.total := rfl |
| 154 | |
| 155 | theorem totalVelocity_pull (e : D ≃ₗᵢ[ℝ] E) |
| 156 | (c : CorrectionState.Context E) (u : CorrectionState.State E) : |
| 157 | (state e u).totalVelocity (context e c) = oscillation e (u.totalVelocity c) := rfl |
| 158 | |
| 159 | theorem totalPressure_pull (e : D ≃ₗᵢ[ℝ] E) (u : CorrectionState.State E) : |
| 160 | (state e u).totalPressureIncrement = |
| 161 | fun n x => u.totalPressureIncrement n (cylinder e x) := rfl |
| 162 | |
| 163 | /-! ## Finite harmonic coefficients -/ |
| 164 | |
| 165 | noncomputable def coefficients (e : D ≃ₗᵢ[ℝ] E) (a : HarmonicFields.Coefficients E) : |
| 166 | HarmonicFields.Coefficients D := |
| 167 | AddMonoidAlgebra.ofCoeff (Finsupp.mapRange (fun f : E → ℂ => fun x => f (e x)) rfl a.coeff) |
| 168 | |
| 169 | @[simp] theorem coefficients_apply (e : D ≃ₗᵢ[ℝ] E) (a : HarmonicFields.Coefficients E) |
| 170 | (j : ℤ) (x : D) : coefficients e a j x = a j (e x) := rfl |
| 171 | |
| 172 | theorem coefficients_fun (e : D ≃ₗᵢ[ℝ] E) (a : HarmonicFields.Coefficients E) (j : ℤ) : |
| 173 | coefficients e a j = fun x => a j (e x) := rfl |
| 174 | |
| 175 | theorem coefficients_support (e : D ≃ₗᵢ[ℝ] E) (a : HarmonicFields.Coefficients E) : |
| 176 | (coefficients e a).support = a.support := by |
| 177 | ext j |
| 178 | simp only [Finsupp.mem_support_iff] |
| 179 | apply not_congr |
| 180 | constructor |
| 181 | · intro h |
| 182 | funext y |
| 183 | obtain ⟨x, rfl⟩ := e.surjective y |
| 184 | exact congrFun h x |
| 185 | · intro h |
| 186 | funext x |
| 187 | exact congrFun h (e x) |
| 188 | |
| 189 | @[simp] theorem coefficients_zero (e : D ≃ₗᵢ[ℝ] E) : coefficients e 0 = 0 := by |
| 190 | ext j x |
| 191 | rfl |
| 192 | |
| 193 | theorem coefficients_add (e : D ≃ₗᵢ[ℝ] E) (a b : HarmonicFields.Coefficients E) : |
| 194 | coefficients e (a + b) = coefficients e a + coefficients e b := by |
| 195 | ext j x |
| 196 | rfl |
| 197 | |
| 198 | theorem coefficients_sub (e : D ≃ₗᵢ[ℝ] E) (a b : HarmonicFields.Coefficients E) : |
| 199 | coefficients e (a - b) = coefficients e a - coefficients e b := by |
| 200 | ext j x |
| 201 | rfl |
| 202 | |
| 203 | theorem coefficients_neg (e : D ≃ₗᵢ[ℝ] E) (a : HarmonicFields.Coefficients E) : |
| 204 | coefficients e (-a) = -coefficients e a := by |
| 205 | ext j x |
| 206 | rfl |
| 207 | |
| 208 | theorem coefficients_mul (e : D ≃ₗᵢ[ℝ] E) (a b : HarmonicFields.Coefficients E) : |
| 209 | coefficients e (a * b) = coefficients e a * coefficients e b := by |
| 210 | ext j x |
| 211 | simp only [coefficients_apply, HarmonicFields.convolution_apply, coefficients_support] |
| 212 | |
| 213 | theorem coefficients_constant (e : D ≃ₗᵢ[ℝ] E) (a : E → ℂ) : |
| 214 | coefficients e (HarmonicFields.constantCoefficient a) = |
| 215 | HarmonicFields.constantCoefficient (fun x => a (e x)) := by |
| 216 | ext j x |
| 217 | by_cases hj : j = 0 |
| 218 | · subst j |
| 219 | simp [coefficients_apply, HarmonicFields.constantCoefficient] |
| 220 | · simp [coefficients_apply, HarmonicFields.constantCoefficient, hj] |
| 221 | |
| 222 | theorem evaluate_pull (e : D ≃ₗᵢ[ℝ] E) (a : HarmonicFields.Coefficients E) |
| 223 | (x : D) (theta : ℝ) : |
| 224 | HarmonicFields.evaluate (coefficients e a) x theta = HarmonicFields.evaluate a (e x) theta := by |
| 225 | simp only [HarmonicFields.evaluate, Finsupp.sum, coefficients_support, coefficients_apply] |
| 226 | |
| 227 | theorem harmonicField_pull (e : D ≃ₗᵢ[ℝ] E) (a : HarmonicFields.Coefficients E) |
| 228 | (k : ℝ) (Phi : E → ℝ) (kp : ℤ) (x : D × ℝ) : |
| 229 | HarmonicFields.field (coefficients e a) k (fun y => Phi (e y)) kp x = |
| 230 | HarmonicFields.field a k Phi kp (cylinder e x) := by |
| 231 | exact evaluate_pull e a x.1 _ |
| 232 | |
| 233 | theorem coefficientMass_pull (e : D ≃ₗᵢ[ℝ] E) (a : HarmonicFields.Coefficients E) (x : D) : |
| 234 | HarmonicFields.coefficientMass (coefficients e a) x = HarmonicFields.coefficientMass a (e x) := by |
| 235 | simp only [HarmonicFields.coefficientMass, coefficients_support, coefficients_apply] |
| 236 | |
| 237 | theorem bandLimited_pull (e : D ≃ₗᵢ[ℝ] E) {a : HarmonicFields.Coefficients E} {N : ℕ} |
| 238 | (ha : HarmonicFields.BandLimited a N) : HarmonicFields.BandLimited (coefficients e a) N := by |
| 239 | simpa only [HarmonicFields.BandLimited, coefficients_support] using ha |
| 240 | |
| 241 | theorem differentiate_pull (e : D ≃ₗᵢ[ℝ] E) (V : E → E) (k : ℝ) |
| 242 | (Phi : E → ℝ) (a : HarmonicFields.Coefficients E) : |
| 243 | HarmonicFields.differentiate (vector e V) k (fun x => Phi (e x)) (coefficients e a) = |
| 244 | coefficients e (HarmonicFields.differentiate V k Phi a) := by |
| 245 | ext j x |
| 246 | simp only [HarmonicFields.differentiate_apply, coefficients_apply, coefficients_fun, |
| 247 | HarmonicFields.derivativeCoefficient, along_pull] |
| 248 | |
| 249 | theorem angularDifferentiate_pull (e : D ≃ₗᵢ[ℝ] E) (kp : ℤ) |
| 250 | (a : HarmonicFields.Coefficients E) : |
| 251 | HarmonicFields.angularDifferentiate kp (coefficients e a) = |
| 252 | coefficients e (HarmonicFields.angularDifferentiate kp a) := by |
| 253 | ext j x |
| 254 | rfl |
| 255 | |
| 256 | theorem realCoefficients_pull (e : D ≃ₗᵢ[ℝ] E) (a : HarmonicFields.Coefficients E) : |
| 257 | HarmonicResidual.realCoefficients (coefficients e a) = |
| 258 | coefficients e (HarmonicResidual.realCoefficients a) := by |
| 259 | ext j x |
| 260 | simp only [HarmonicResidual.realCoefficients_apply, coefficients_apply] |
| 261 | |
| 262 | theorem nonconstant_pull (e : D ≃ₗᵢ[ℝ] E) (a : HarmonicFields.Coefficients E) : |
| 263 | HarmonicResidual.nonconstant (coefficients e a) = |
| 264 | coefficients e (HarmonicResidual.nonconstant a) := by |
| 265 | ext j x |
| 266 | by_cases hj : j = 0 |
| 267 | · subst j |
| 268 | simp [HarmonicResidual.nonconstant, coefficients_apply] |
| 269 | · simp [HarmonicResidual.nonconstant, coefficients_apply, hj] |
| 270 | |
| 271 | noncomputable def block (e : D ≃ₗᵢ[ℝ] E) (b : CorrectionState.HarmonicBlock E) : |
| 272 | CorrectionState.HarmonicBlock D where |
| 273 | velocity n i := coefficients e (b.velocity n i) |
| 274 | pressure n := coefficients e (b.pressure n) |
| 275 | frequency := b.frequency |
| 276 | phase n x := b.phase n (e x) |
| 277 | angularFrequency := b.angularFrequency |
| 278 | |
| 279 | noncomputable def blockCoefficients (e : D ≃ₗᵢ[ℝ] E) (a : HarmonicResidual.BlockCoefficients E) : |
| 280 | HarmonicResidual.BlockCoefficients D := fun n i => coefficients e (a n i) |
| 281 | |
| 282 | theorem block_oscillation (e : D ≃ₗᵢ[ℝ] E) (b : CorrectionState.HarmonicBlock E) : |
| 283 | (block e b).oscillation = oscillation e b.oscillation := by |
| 284 | funext n x i |
| 285 | exact congrArg Complex.re (harmonicField_pull e (b.velocity n i) (b.frequency n) |
| 286 | (b.phase n) (b.angularFrequency n) x) |
| 287 | |
| 288 | theorem block_pressure (e : D ≃ₗᵢ[ℝ] E) (b : CorrectionState.HarmonicBlock E) : |
| 289 | (block e b).oscillatoryPressure = fun n x => b.oscillatoryPressure n (cylinder e x) := by |
| 290 | funext n x |
| 291 | exact congrArg Complex.re (harmonicField_pull e (b.pressure n) (b.frequency n) |
| 292 | (b.phase n) (b.angularFrequency n) x) |
| 293 | |
| 294 | /-! ## The actual coefficient residual -/ |
| 295 | |
| 296 | noncomputable def frame (e : D ≃ₗᵢ[ℝ] E) (g : HarmonicResidual.Frame E) : HarmonicResidual.Frame D where |
| 297 | radius := fun x => g.radius (e x) |
| 298 | radial := vector e g.radial |
| 299 | axial := vector e g.axial |
| 300 | time := vector e g.time |
| 301 | viscosity := g.viscosity |
| 302 | |
| 303 | theorem rotate_pull (e : D ≃ₗᵢ[ℝ] E) (a : HarmonicResidual.VectorCoefficients E) : |
| 304 | HarmonicResidual.rotate (fun i => coefficients e (a i)) = |
| 305 | fun i => coefficients e (HarmonicResidual.rotate a i) := by |
| 306 | funext i |
| 307 | fin_cases i <;> simp [HarmonicResidual.rotate, coefficients_neg] |
| 308 | |
| 309 | theorem scalarLaplacian_pull (e : D ≃ₗᵢ[ℝ] E) (g : HarmonicResidual.Frame E) |
| 310 | (k : ℝ) (Phi : E → ℝ) (kp : ℤ) (a : HarmonicFields.Coefficients E) : |
| 311 | HarmonicResidual.scalarLaplacian (frame e g) k (fun x => Phi (e x)) kp (coefficients e a) = |
| 312 | coefficients e (HarmonicResidual.scalarLaplacian g k Phi kp a) := by |
| 313 | simp only [HarmonicResidual.scalarLaplacian, frame, coefficients_add, coefficients_mul, |
| 314 | coefficients_constant, differentiate_pull, angularDifferentiate_pull] |
| 315 | |
| 316 | theorem vectorLaplacian_pull (e : D ≃ₗᵢ[ℝ] E) (g : HarmonicResidual.Frame E) |
| 317 | (k : ℝ) (Phi : E → ℝ) (kp : ℤ) (a : HarmonicResidual.VectorCoefficients E) : |
| 318 | HarmonicResidual.vectorLaplacian (frame e g) k (fun x => Phi (e x)) kp |
| 319 | (fun i => coefficients e (a i)) = |
| 320 | fun i => coefficients e (HarmonicResidual.vectorLaplacian g k Phi kp a i) := by |
| 321 | funext i |
| 322 | simp only [HarmonicResidual.vectorLaplacian, scalarLaplacian_pull, angularDifferentiate_pull, rotate_pull] |
| 323 | simp only [frame, coefficients_add, |
| 324 | coefficients_mul, coefficients_constant] |
| 325 | |
| 326 | theorem transportCoefficients_pull (e : D ≃ₗᵢ[ℝ] E) (g : HarmonicResidual.Frame E) |
| 327 | (k : ℝ) (Phi : E → ℝ) (kp : ℤ) (a b : HarmonicResidual.VectorCoefficients E) : |
| 328 | HarmonicResidual.transport (frame e g) k (fun x => Phi (e x)) kp |
| 329 | (fun i => coefficients e (a i)) (fun i => coefficients e (b i)) = |
| 330 | fun i => coefficients e (HarmonicResidual.transport g k Phi kp a b i) := by |
| 331 | funext i |
| 332 | simp only [HarmonicResidual.transport, frame, differentiate_pull, angularDifferentiate_pull, |
| 333 | rotate_pull, coefficients_add, coefficients_mul, coefficients_constant] |
| 334 | |
| 335 | theorem gradientCoefficients_pull (e : D ≃ₗᵢ[ℝ] E) (g : HarmonicResidual.Frame E) |
| 336 | (k : ℝ) (Phi : E → ℝ) (kp : ℤ) (a : HarmonicFields.Coefficients E) : |
| 337 | HarmonicResidual.gradient (frame e g) k (fun x => Phi (e x)) kp (coefficients e a) = |
| 338 | fun i => coefficients e (HarmonicResidual.gradient g k Phi kp a i) := by |
| 339 | funext i |
| 340 | fin_cases i <;> simp [HarmonicResidual.gradient, frame, differentiate_pull, |
| 341 | angularDifferentiate_pull, coefficients_mul, coefficients_constant] |
| 342 | |
| 343 | theorem linearCoefficients_pull (e : D ≃ₗᵢ[ℝ] E) (g : HarmonicResidual.Frame E) |
| 344 | (k : ℝ) (Phi : E → ℝ) (kp : ℤ) (B a : HarmonicResidual.VectorCoefficients E) |
| 345 | (p : HarmonicFields.Coefficients E) : |
| 346 | HarmonicResidual.linearResidual (frame e g) k (fun x => Phi (e x)) kp |
| 347 | (fun i => coefficients e (B i)) (fun i => coefficients e (a i)) (coefficients e p) = |
| 348 | fun i => coefficients e (HarmonicResidual.linearResidual g k Phi kp B a p i) := by |
| 349 | funext i |
| 350 | simp only [HarmonicResidual.linearResidual, transportCoefficients_pull, vectorLaplacian_pull, |
| 351 | gradientCoefficients_pull] |
| 352 | simp only [frame, differentiate_pull, coefficients_add, |
| 353 | coefficients_sub, coefficients_mul, coefficients_constant] |
| 354 | |
| 355 | theorem nonlinearCoefficients_pull (e : D ≃ₗᵢ[ℝ] E) (g : HarmonicResidual.Frame E) |
| 356 | (k : ℝ) (Phi : E → ℝ) (kp : ℤ) (B a : HarmonicResidual.VectorCoefficients E) |
| 357 | (p : HarmonicFields.Coefficients E) : |
| 358 | HarmonicResidual.nonlinearResidual (frame e g) k (fun x => Phi (e x)) kp |
| 359 | (fun i => coefficients e (B i)) (fun i => coefficients e (a i)) (coefficients e p) = |
| 360 | fun i => coefficients e (HarmonicResidual.nonlinearResidual g k Phi kp B a p i) := by |
| 361 | funext i |
| 362 | simp only [HarmonicResidual.nonlinearResidual, linearCoefficients_pull, |
| 363 | transportCoefficients_pull, coefficients_add] |
| 364 | |
| 365 | theorem constantVector_pull (e : D ≃ₗᵢ[ℝ] E) (B : E → ComplexVector) : |
| 366 | HarmonicResidual.constantVector (fun x => B (e x)) = |
| 367 | fun i => coefficients e (HarmonicResidual.constantVector B i) := by |
| 368 | funext i |
| 369 | exact (coefficients_constant e (fun x => B x i)).symm |
| 370 | |
| 371 | noncomputable def label (e : D ≃ₗᵢ[ℝ] E) (d : HarmonicResidual.LabelData E) : |
| 372 | HarmonicResidual.LabelData D where |
| 373 | frequency := d.frequency |
| 374 | phase := fun x => d.phase (e x) |
| 375 | angularFrequency := d.angularFrequency |
| 376 | velocity := fun i => coefficients e (d.velocity i) |
| 377 | pressure := coefficients e d.pressure |
| 378 | gaussian := fun i => coefficients e (d.gaussian i) |
| 379 | aliasError := fun i => coefficients e (d.aliasError i) |
| 380 | |
| 381 | theorem labelResidual_pull (e : D ≃ₗᵢ[ℝ] E) (d : HarmonicResidual.LabelData E) |
| 382 | (g : HarmonicResidual.Frame E) (B M : E → ComplexVector) : |
| 383 | (label e d).residualCoefficients (frame e g) (fun x => B (e x)) (fun x => M (e x)) = |
| 384 | fun i => coefficients e (d.residualCoefficients g B M i) := by |
| 385 | have hbase : HarmonicResidual.constantVector ((fun x => B (e x)) + (fun x => M (e x))) = |
| 386 | fun i => coefficients e (HarmonicResidual.constantVector (B + M) i) := |
| 387 | constantVector_pull e (B + M) |
| 388 | funext i |
| 389 | unfold HarmonicResidual.LabelData.residualCoefficients |
| 390 | simp only [label] |
| 391 | rw [← realCoefficients_pull, coefficients_sub, coefficients_sub, hbase, |
| 392 | nonlinearCoefficients_pull] |
| 393 | |
| 394 | theorem labelWaveResidual_pull (e : D ≃ₗᵢ[ℝ] E) (d : HarmonicResidual.LabelData E) |
| 395 | (g : HarmonicResidual.Frame E) (B M : E → ComplexVector) : |
| 396 | (label e d).waveResidualCoefficients (frame e g) (fun x => B (e x)) (fun x => M (e x)) = |
| 397 | fun i => coefficients e (d.waveResidualCoefficients g B M i) := by |
| 398 | funext i |
| 399 | simp only [HarmonicResidual.LabelData.waveResidualCoefficients, labelResidual_pull, |
| 400 | nonconstant_pull] |
| 401 | |
| 402 | theorem contextFrame_pull (e : D ≃ₗᵢ[ℝ] E) (c : CorrectionState.Context E) (n : ℕ) : |
| 403 | HarmonicResidual.contextFrame (context e c) n = frame e (HarmonicResidual.contextFrame c n) := by |
| 404 | unfold HarmonicResidual.contextFrame context operators frame |
| 405 | congr 1 <;> funext x <;> |
| 406 | simp only [vector, ParticularWaveBounds.reindexVector, map_add, map_smul, map_sub] |
| 407 | |
| 408 | theorem contextBase_pull (e : D ≃ₗᵢ[ℝ] E) (c : CorrectionState.Context E) (n : ℕ) : |
| 409 | HarmonicResidual.contextBase (context e c) n = fun x => HarmonicResidual.contextBase c n (e x) := rfl |
| 410 | |
| 411 | theorem stateMean_pull (e : D ≃ₗᵢ[ℝ] E) (u : CorrectionState.State E) (n : ℕ) : |
| 412 | HarmonicResidual.stateMean (state e u) n = fun x => HarmonicResidual.stateMean u n (e x) := rfl |
| 413 | |
| 414 | theorem ofBlock_pull (e : D ≃ₗᵢ[ℝ] E) (b : CorrectionState.HarmonicBlock E) |
| 415 | (G A : HarmonicResidual.BlockCoefficients E) (n : ℕ) : |
| 416 | HarmonicResidual.ofBlock (block e b) (blockCoefficients e G) (blockCoefficients e A) n = |
| 417 | label e (HarmonicResidual.ofBlock b G A n) := by |
| 418 | simp only [HarmonicResidual.ofBlock, block, label, realCoefficients_pull] |
| 419 | rfl |
| 420 | |
| 421 | /-- Exact reindexing of the stripped nonzero coefficients of the actual |
| 422 | current-state residual, including Gaussian and alias subtraction. -/ |
| 423 | theorem residualBlock_pull (e : D ≃ₗᵢ[ℝ] E) |
| 424 | (c : CorrectionState.Context E) (u : CorrectionState.State E) |
| 425 | (b : CorrectionState.HarmonicBlock E) (G A : HarmonicResidual.BlockCoefficients E) : |
| 426 | HarmonicResidual.residualBlock (context e c) (state e u) (block e b) |
| 427 | (blockCoefficients e G) (blockCoefficients e A) = |
| 428 | block e (HarmonicResidual.residualBlock c u b G A) := by |
| 429 | change CorrectionState.HarmonicBlock.mk _ _ _ _ _ = CorrectionState.HarmonicBlock.mk _ _ _ _ _ |
| 430 | congr 1 |
| 431 | · funext n |
| 432 | rw [ofBlock_pull, contextFrame_pull, contextBase_pull, stateMean_pull, labelWaveResidual_pull] |
| 433 | rfl |
| 434 | |
| 435 | /-! ## The full differential residual -/ |
| 436 | |
| 437 | theorem scalarLaplacian_field_pull (e : D ≃ₗᵢ[ℝ] E) (R : E → ℝ) |
| 438 | (Vr Vt Vz : E → E) (f : E → F) (x : D) : |
| 439 | HarmonicCalculus.cylindricalLaplacian (fun y => R (e y)) |
| 440 | (vector e Vr) (vector e Vt) (vector e Vz) (fun y => f (e y)) x = |
| 441 | HarmonicCalculus.cylindricalLaplacian R Vr Vt Vz f (e x) := by |
| 442 | simp only [HarmonicCalculus.cylindricalLaplacian, along_pull] |
| 443 | |
| 444 | theorem scalarLaplacian_component_pull {ι : Type*} (e : D ≃ₗᵢ[ℝ] E) (R : E → ℝ) |
| 445 | (Vr Vt Vz : E → E) (f : E → ι → F) (i : ι) (x : D) : |
| 446 | HarmonicCalculus.cylindricalLaplacian (fun y => R (e y)) |
| 447 | (vector e Vr) (vector e Vt) (vector e Vz) (fun y => f (e y) i) x = |
| 448 | HarmonicCalculus.cylindricalLaplacian R Vr Vt Vz (fun y => f y i) (e x) := |
| 449 | scalarLaplacian_field_pull e R Vr Vt Vz (fun y => f y i) x |
| 450 | |
| 451 | theorem transport_field_pull (e : D ≃ₗᵢ[ℝ] E) (R : E → ℝ) |
| 452 | (Vr Vt Vz : E → E) (u v : E → ComplexVector) (x : D) : |
| 453 | LinearWaveResidual.transport (fun y => R (e y)) (vector e Vr) (vector e Vt) (vector e Vz) |
| 454 | (fun y => u (e y)) (fun y => v (e y)) x = |
| 455 | LinearWaveResidual.transport R Vr Vt Vz u v (e x) := by |
| 456 | funext i |
| 457 | simp only [LinearWaveResidual.transport, along_pull_component] |
| 458 | |
| 459 | theorem vectorLaplacian_field_pull (e : D ≃ₗᵢ[ℝ] E) (R : E → ℝ) |
| 460 | (Vr Vt Vz : E → E) (a : E → ComplexVector) (x : D) : |
| 461 | HarmonicCalculus.cylindricalVectorLaplacian (fun y => R (e y)) |
| 462 | (vector e Vr) (vector e Vt) (vector e Vz) (fun y => a (e y)) x = |
| 463 | HarmonicCalculus.cylindricalVectorLaplacian R Vr Vt Vz a (e x) := by |
| 464 | funext i |
| 465 | simp only [HarmonicCalculus.cylindricalVectorLaplacian, scalarLaplacian_component_pull, |
| 466 | along_pull_component] |
| 467 | |
| 468 | theorem linearResidual_field_pull (e : D ≃ₗᵢ[ℝ] E) (epsilon : ℝ) (R : E → ℝ) |
| 469 | (Vr Vt Vz Vtime : E → E) (B a : E → ComplexVector) (p : E → ℂ) (x : D) : |
| 470 | LinearWaveResidual.linearResidual epsilon (fun y => R (e y)) |
| 471 | (vector e Vr) (vector e Vt) (vector e Vz) (vector e Vtime) |
| 472 | (fun y => B (e y)) (fun y => a (e y)) (fun y => p (e y)) x = |
| 473 | LinearWaveResidual.linearResidual epsilon R Vr Vt Vz Vtime B a p (e x) := by |
| 474 | funext i |
| 475 | simp only [LinearWaveResidual.linearResidual, LinearWaveResidual.gradient, |
| 476 | transport_field_pull, vectorLaplacian_field_pull, along_pull, along_pull_component] |
| 477 | |
| 478 | theorem radialDirection_pull (e : D ≃ₗᵢ[ℝ] E) (c : CorrectionState.Context E) (n : ℕ) : |
| 479 | LiftedMeanResidual.radialDirection (context e c) n = |
| 480 | vector (cylinder e) (LiftedMeanResidual.radialDirection c n) := by |
| 481 | funext x |
| 482 | simp only [LiftedMeanResidual.radialDirection, LiftedMeanResidual.liftDirection, |
| 483 | LiftedMeanResidual.radialVector, context, operators, vector, ParticularWaveBounds.reindexVector, |
| 484 | cylinder_apply, cylinder_symm_apply, map_add, map_smul] |
| 485 | |
| 486 | theorem axialDirection_pull (e : D ≃ₗᵢ[ℝ] E) (c : CorrectionState.Context E) (n : ℕ) : |
| 487 | LiftedMeanResidual.axialDirection (context e c) n = |
| 488 | vector (cylinder e) (LiftedMeanResidual.axialDirection c n) := by |
| 489 | funext x |
| 490 | simp only [LiftedMeanResidual.axialDirection, LiftedMeanResidual.liftDirection, |
| 491 | LiftedMeanResidual.axialVector, context, operators, vector, ParticularWaveBounds.reindexVector, cylinder_symm_apply, map_smul] |
| 492 | |
| 493 | theorem timeDirection_pull (e : D ≃ₗᵢ[ℝ] E) (c : CorrectionState.Context E) (n : ℕ) : |
| 494 | LiftedMeanResidual.timeDirection (context e c) n = |
| 495 | vector (cylinder e) (LiftedMeanResidual.timeDirection c n) := by |
| 496 | funext x |
| 497 | simp only [LiftedMeanResidual.timeDirection, LiftedMeanResidual.liftDirection, |
| 498 | LiftedMeanResidual.temporalVector, context, operators, vector, ParticularWaveBounds.reindexVector, cylinder_symm_apply, map_sub, map_smul] |
| 499 | |
| 500 | theorem angularDirection_pull (e : D ≃ₗᵢ[ℝ] E) : |
| 501 | vector (cylinder e) (LiftedMeanResidual.angularDirection (D := E)) = |
| 502 | LiftedMeanResidual.angularDirection := by |
| 503 | funext x |
| 504 | change (e.symm 0, 1) = (0, 1) |
| 505 | rw [map_zero] |
| 506 | |
| 507 | theorem complexBase_pull (e : D ≃ₗᵢ[ℝ] E) (c : CorrectionState.Context E) (n : ℕ) : |
| 508 | LiftedMeanResidual.complexBase (context e c) n = |
| 509 | fun x => LiftedMeanResidual.complexBase c n (cylinder e x) := rfl |
| 510 | |
| 511 | theorem complexPerturbation_pull (e : D ≃ₗᵢ[ℝ] E) (u : CorrectionState.State E) (n : ℕ) : |
| 512 | LiftedMeanResidual.complexPerturbation (state e u) n = |
| 513 | fun x => LiftedMeanResidual.complexPerturbation u n (cylinder e x) := rfl |
| 514 | |
| 515 | theorem complexPressure_pull (e : D ≃ₗᵢ[ℝ] E) (u : CorrectionState.State E) (n : ℕ) : |
| 516 | LiftedMeanResidual.complexPressure (state e u) n = |
| 517 | fun x => LiftedMeanResidual.complexPressure u n (cylinder e x) := rfl |
| 518 | |
| 519 | theorem virtualDivergence_pull (e : D ≃ₗᵢ[ℝ] E) (c : CorrectionState.Context E) |
| 520 | (n : ℕ) (x : D × ℝ) : |
| 521 | LiftedMeanResidual.virtualDivergence (context e c) n x = |
| 522 | LiftedMeanResidual.virtualDivergence c n (cylinder e x) := by |
| 523 | change ![0, -((operators e c.operators).radialDiv 2 (field e c.virtualTheta) n x.1), |
| 524 | -((operators e c.operators).radialDiv 1 (field e c.virtualAxial) n x.1)] = _ |
| 525 | rw [radialDiv_pull, radialDiv_pull] |
| 526 | rfl |
| 527 | |
| 528 | theorem fullResidual_pull (e : D ≃ₗᵢ[ℝ] E) (c : CorrectionState.Context E) |
| 529 | (u : CorrectionState.State E) (n : ℕ) (x : D × ℝ) (i : Fin 3) : |
| 530 | LiftedMeanResidual.fullResidual (context e c) (state e u) n x i = |
| 531 | LiftedMeanResidual.fullResidual c u n (cylinder e x) i := by |
| 532 | have hl := linearResidual_field_pull (cylinder e) (c.operators.epsilon n) |
| 533 | (fun y : E × ℝ => c.operators.radius y.1) |
| 534 | (LiftedMeanResidual.radialDirection c n) LiftedMeanResidual.angularDirection |
| 535 | (LiftedMeanResidual.axialDirection c n) (LiftedMeanResidual.timeDirection c n) |
| 536 | (LiftedMeanResidual.complexBase c n) (LiftedMeanResidual.complexPerturbation u n) |
| 537 | (LiftedMeanResidual.complexPressure u n) x |
| 538 | have hq := transport_field_pull (cylinder e) (fun y : E × ℝ => c.operators.radius y.1) |
| 539 | (LiftedMeanResidual.radialDirection c n) LiftedMeanResidual.angularDirection |
| 540 | (LiftedMeanResidual.axialDirection c n) |
| 541 | (LiftedMeanResidual.complexPerturbation u n) (LiftedMeanResidual.complexPerturbation u n) x |
| 542 | rw [angularDirection_pull] at hl hq |
| 543 | unfold LiftedMeanResidual.fullResidual LiftedMeanResidual.nonlinearResidual |
| 544 | rw [radialDirection_pull, axialDirection_pull, timeDirection_pull, |
| 545 | complexBase_pull, complexPerturbation_pull, complexPressure_pull] |
| 546 | rw [show (fun y : D × ℝ => (context e c).operators.radius y.1) = |
| 547 | (fun y : D × ℝ => c.operators.radius (cylinder e y).1) from rfl] |
| 548 | change ((LinearWaveResidual.linearResidual (c.operators.epsilon n) |
| 549 | (fun y : D × ℝ => c.operators.radius (cylinder e y).1) |
| 550 | (vector (cylinder e) (LiftedMeanResidual.radialDirection c n)) LiftedMeanResidual.angularDirection |
| 551 | (vector (cylinder e) (LiftedMeanResidual.axialDirection c n)) |
| 552 | (vector (cylinder e) (LiftedMeanResidual.timeDirection c n)) |
| 553 | _ _ _ x + LinearWaveResidual.transport _ _ _ _ _ _ x) i).re + _ + _ = _ |
| 554 | rw [hl, hq, virtualDivergence_pull] |
| 555 | rfl |
| 556 | |
| 557 | theorem fullGoodResidual_pull (e : D ≃ₗᵢ[ℝ] E) (c : CorrectionState.Context E) |
| 558 | (u : CorrectionState.State E) (n : ℕ) (x : D × ℝ) (i : Fin 3) : |
| 559 | LiftedMeanResidual.fullGoodResidual (context e c) (state e u) n x i = |
| 560 | LiftedMeanResidual.fullGoodResidual c u n (cylinder e x) i := by |
| 561 | change LiftedMeanResidual.fullResidual (context e c) (state e u) n x i - _ = _ |
| 562 | rw [fullResidual_pull] |
| 563 | rfl |
| 564 | |
| 565 | /-! ## Exact return from the alternate layout -/ |
| 566 | |
| 567 | theorem coefficients_roundtrip (e : D ≃ₗᵢ[ℝ] E) (a : HarmonicFields.Coefficients D) : |
| 568 | coefficients e (coefficients e.symm a) = a := by |
| 569 | ext j x |
| 570 | simp only [coefficients_apply, e.symm_apply_apply] |
| 571 | |
| 572 | theorem block_roundtrip (e : D ≃ₗᵢ[ℝ] E) (b : CorrectionState.HarmonicBlock D) : |
| 573 | block e (block e.symm b) = b := by |
| 574 | cases b |
| 575 | simp only [block, coefficients_roundtrip, e.symm_apply_apply] |
| 576 | |
| 577 | theorem field_roundtrip (e : D ≃ₗᵢ[ℝ] E) (f : MeanIncrementBounds.Field D) : |
| 578 | field e (field e.symm f) = f := by |
| 579 | funext n x |
| 580 | exact congrArg (f n) (e.symm_apply_apply x) |
| 581 | |
| 582 | theorem oscillation_roundtrip (e : D ≃ₗᵢ[ℝ] E) (f : CorrectionState.Oscillation D) : |
| 583 | oscillation e (oscillation e.symm f) = f := by |
| 584 | funext n x |
| 585 | change f n (e.symm (e x.1), x.2) = f n x |
| 586 | rw [e.symm_apply_apply] |
| 587 | |
| 588 | theorem state_roundtrip (e : D ≃ₗᵢ[ℝ] E) (u : CorrectionState.State D) : |
| 589 | state e (state e.symm u) = u := by |
| 590 | cases u with |
| 591 | | mk m p a q r => |
| 592 | cases m |
| 593 | cases r |
| 594 | simp only [state, triple, errors, cylinder_apply, e.symm_apply_apply, |
| 595 | field_roundtrip, oscillation_roundtrip] |
| 596 | |
| 597 | theorem context_roundtrip (e : D ≃ₗᵢ[ℝ] E) (c : CorrectionState.Context D) : |
| 598 | context e (context e.symm c) = c := by |
| 599 | cases c with |
| 600 | | mk o b t z => |
| 601 | cases o |
| 602 | cases b |
| 603 | simp only [context, operators, triple, LinearIsometryEquiv.symm_symm, |
| 604 | e.symm_apply_apply, field_roundtrip] |
| 605 | |
| 606 | /-! ## The same weighted classes, without loss of exponents -/ |
| 607 | |
| 608 | noncomputable def strip (e : D ≃ₗᵢ[ℝ] E) (s : WeightedClasses.StripData E) : |
| 609 | WeightedClasses.StripData D := ParticularWaveBounds.reindexStrip e s |
| 610 | |
| 611 | theorem memClass_pull (e : D ≃ₗᵢ[ℝ] E) {s : WeightedClasses.StripData E} |
| 612 | {w : ℕ → E → ℝ} {alpha : ℝ} {f : ℕ → E → F} |
| 613 | (hf : WeightedClasses.MemClass s w alpha f) : |
| 614 | WeightedClasses.MemClass (strip e s) (fun n x => w n (e x)) alpha (fun n x => f n (e x)) := |
| 615 | ParticularWaveBounds.memClass_reindex e hf |
| 616 | |
| 617 | theorem block_waveBounds (e : D ≃ₗᵢ[ℝ] E) {s : WeightedClasses.StripData E} |
| 618 | {w : ℕ → E → ℝ} {alpha : ℝ} {b : CorrectionState.HarmonicBlock E} |
| 619 | (hb : b.WaveBounds s w alpha) : |
| 620 | (block e b).WaveBounds (strip e s) (fun n x => w n (e x)) alpha := by |
| 621 | intro i j hj |
| 622 | exact ParticularWaveBounds.waveClass_reindex e (hb i j hj) |
| 623 | |
| 624 | theorem block_pressureBounds (e : D ≃ₗᵢ[ℝ] E) {s : WeightedClasses.StripData E} |
| 625 | {w : ℕ → E → ℝ} {alpha : ℝ} {b : CorrectionState.HarmonicBlock E} |
| 626 | (hb : b.PressureBounds s w alpha) : |
| 627 | (block e b).PressureBounds (strip e s) (fun n x => w n (e x)) alpha := by |
| 628 | intro j hj |
| 629 | exact ParticularWaveBounds.waveClass_reindex e (hb j hj) |
| 630 | |
| 631 | /-! ## Real linearization and the mean equations -/ |
| 632 | |
| 633 | theorem realTransport_pull (e : D ≃ₗᵢ[ℝ] E) (R : E → ℝ) |
| 634 | (Vr Vt Vz : E → E) (u v : E → Fin 3 → ℝ) (x : D) : |
| 635 | LinearWaveResidual.realTransport (fun y => R (e y)) (vector e Vr) (vector e Vt) (vector e Vz) |
| 636 | (fun y => u (e y)) (fun y => v (e y)) x = |
| 637 | LinearWaveResidual.realTransport R Vr Vt Vz u v (e x) := by |
| 638 | funext i |
| 639 | simp only [LinearWaveResidual.realTransport, along_pull_component] |
| 640 | |
| 641 | theorem realFrameLaplacian_pull (e : D ≃ₗᵢ[ℝ] E) (R : E → ℝ) |
| 642 | (Vr Vt Vz : E → E) (a : E → Fin 3 → ℝ) (x : D) : |
| 643 | LinearWaveResidual.realFrameLaplacian (fun y => R (e y)) |
| 644 | (vector e Vr) (vector e Vt) (vector e Vz) (fun y => a (e y)) x = |
| 645 | LinearWaveResidual.realFrameLaplacian R Vr Vt Vz a (e x) := by |
| 646 | funext i |
| 647 | simp only [LinearWaveResidual.realFrameLaplacian, scalarLaplacian_component_pull, |
| 648 | along_pull_component] |
| 649 | |
| 650 | theorem realComponentLinearResidual_pull (e : D ≃ₗᵢ[ℝ] E) (epsilon : ℝ) (R : E → ℝ) |
| 651 | (Vr Vt Vz Vtime : E → E) (B a : E → Fin 3 → ℝ) (p : E → ℝ) (x : D) : |
| 652 | LinearWaveResidual.realComponentLinearResidual epsilon (fun y => R (e y)) |
| 653 | (vector e Vr) (vector e Vt) (vector e Vz) (vector e Vtime) |
| 654 | (fun y => B (e y)) (fun y => a (e y)) (fun y => p (e y)) x = |
| 655 | LinearWaveResidual.realComponentLinearResidual epsilon R Vr Vt Vz Vtime B a p (e x) := by |
| 656 | funext i |
| 657 | simp only [LinearWaveResidual.realComponentLinearResidual, realTransport_pull, |
| 658 | realFrameLaplacian_pull, along_pull, along_pull_component] |
| 659 | |
| 660 | theorem thetaResidual_pull (e : D ≃ₗᵢ[ℝ] E) (c : CorrectionState.Context E) |
| 661 | (u : CorrectionState.State E) : |
| 662 | (state e u).thetaResidual (context e c) = field e (u.thetaResidual c) := by |
| 663 | change (operators e c.operators).time (field e u.mean.angular) + |
| 664 | (operators e c.operators).radialDiv 2 |
| 665 | (field e (MeanIncrementBounds.thetaRadial c.base u.mean + u.covariance 0 1)) + |
| 666 | (operators e c.operators).dz |
| 667 | (field e (MeanIncrementBounds.thetaAxial c.base u.mean + u.covariance 2 1)) - |
| 668 | (operators e c.operators).viscosity 1 (field e u.mean.angular) - |
| 669 | (operators e c.operators).radialDiv 2 (field e c.virtualTheta) = _ |
| 670 | rw [time_pull, radialDiv_pull, dz_pull, viscosity_pull, radialDiv_pull] |
| 671 | rfl |
| 672 | |
| 673 | theorem axialResidual_pull (e : D ≃ₗᵢ[ℝ] E) (c : CorrectionState.Context E) |
| 674 | (u : CorrectionState.State E) : |
| 675 | (state e u).axialResidual (context e c) = field e (u.axialResidual c) := by |
| 676 | change (operators e c.operators).time (field e u.mean.axial) + |
| 677 | (operators e c.operators).radialDiv 1 |
| 678 | (field e (MeanIncrementBounds.axialRadial c.base u.mean + u.covariance 0 2)) + |
| 679 | (operators e c.operators).dz |
| 680 | (field e (MeanIncrementBounds.axialAxial c.base u.mean + u.covariance 2 2 + u.pressure)) - |
| 681 | (operators e c.operators).viscosity 0 (field e u.mean.axial) - |
| 682 | (operators e c.operators).radialDiv 1 (field e c.virtualAxial) = _ |
| 683 | rw [time_pull, radialDiv_pull, dz_pull, viscosity_pull, radialDiv_pull] |
| 684 | rfl |
| 685 | |
| 686 | theorem gr_pull (e : D ≃ₗᵢ[ℝ] E) (c : CorrectionState.Context E) |
| 687 | (u : CorrectionState.State E) : |
| 688 | (state e u).gr (context e c) = field e (u.gr c) := by |
| 689 | change -((operators e c.operators).time (field e u.mean.radial) + |
| 690 | (operators e c.operators).radialDiv 1 |
| 691 | (field e (MeanIncrementBounds.radialRadial c.base u.mean + u.covariance 0 0)) + |
| 692 | (operators e c.operators).dz |
| 693 | (field e (MeanIncrementBounds.axialRadial c.base u.mean + u.covariance 2 0)) - |
| 694 | (operators e c.operators).invRadius * |
| 695 | field e (MeanIncrementBounds.radialAngular c.base u.mean + u.covariance 1 1) - |
| 696 | (operators e c.operators).viscosity 1 (field e u.mean.radial)) = _ |
| 697 | rw [time_pull, radialDiv_pull, dz_pull, viscosity_pull] |
| 698 | rfl |
| 699 | |
| 700 | theorem radialResidual_pull (e : D ≃ₗᵢ[ℝ] E) (c : CorrectionState.Context E) |
| 701 | (u : CorrectionState.State E) : |
| 702 | (state e u).radialResidual (context e c) = field e (u.radialResidual c) := by |
| 703 | unfold CorrectionState.State.radialResidual |
| 704 | rw [gr_pull] |
| 705 | change (operators e c.operators).dr (field e u.pressure) - field e (u.gr c) = _ |
| 706 | rw [dr_pull] |
| 707 | rfl |
| 708 | |
| 709 | theorem reducedMeanResidual_pull (e : D ≃ₗᵢ[ℝ] E) (c : CorrectionState.Context E) |
| 710 | (u : CorrectionState.State E) (n : ℕ) (x : D) : |
| 711 | (state e u).reducedMeanResidual (context e c) n x = u.reducedMeanResidual c n (e x) := by |
| 712 | unfold CorrectionState.State.reducedMeanResidual |
| 713 | rw [radialResidual_pull, thetaResidual_pull, axialResidual_pull] |
| 714 | rfl |
| 715 | |
| 716 | theorem meanResidual_pull (e : D ≃ₗᵢ[ℝ] E) (c : CorrectionState.Context E) |
| 717 | (u : CorrectionState.State E) (n : ℕ) (x : D) (i : Fin 3) : |
| 718 | (state e u).meanResidual (context e c) n x i = u.meanResidual c n (e x) i := by |
| 719 | change (state e u).reducedMeanResidual (context e c) n x i + _ = _ |
| 720 | rw [reducedMeanResidual_pull] |
| 721 | rfl |
| 722 | |
| 723 | theorem meanGoodResidual_pull (e : D ≃ₗᵢ[ℝ] E) (c : CorrectionState.Context E) |
| 724 | (u : CorrectionState.State E) (n : ℕ) (x : D) (i : Fin 3) : |
| 725 | (state e u).meanGoodResidual (context e c) n x i = u.meanGoodResidual c n (e x) i := by |
| 726 | change (state e u).meanResidual (context e c) n x i - _ = _ |
| 727 | rw [meanResidual_pull] |
| 728 | rfl |
| 729 | |
| 730 | theorem block_bandLimited (e : D ≃ₗᵢ[ℝ] E) {b : CorrectionState.HarmonicBlock E} {N : ℕ} |
| 731 | (hb : b.BandLimited N) : (block e b).BandLimited N := |
| 732 | ⟨fun n i => bandLimited_pull e (hb.1 n i), fun n => bandLimited_pull e (hb.2 n)⟩ |
| 733 | |
| 734 | /-! ## The actual association used by the wave assembly -/ |
| 735 | |
| 736 | section Association |
| 737 | |
| 738 | variable {S : Type} [NormedAddCommGroup S] [NormedSpace ℝ S] |
| 739 | |
| 740 | abbrev Associated (S : Type) := (ℝ × S) × TorusInverse.Plane |
| 741 | |
| 742 | /-- The actual auxiliary torus integral in the associated layout. -/ |
| 743 | noncomputable def associatedTorusAverage (f : Associated S → ℝ) (p : ℝ × S) : ℝ := |
| 744 | ∫ y in (0 : ℝ)..1, ∫ x in (0 : ℝ)..1, f (p, (x, y)) |
| 745 | |
| 746 | /-- The actual radial integral of that torus average. -/ |
| 747 | noncomputable def associatedMass (f : Associated S → ℝ) (s : S) : ℝ := |
| 748 | ∫ r, associatedTorusAverage f (r, s) |
| 749 | |
| 750 | theorem torusAverage_liftAssoc (f : Associated S → ℝ) (p : ℝ × S) : |
| 751 | PressureStream.torusAverage (fun x => f (ParticularWaveBounds.liftAssoc S x)) p = |
| 752 | associatedTorusAverage f p := rfl |
| 753 | |
| 754 | theorem pressureMass_liftAssoc (f : Associated S → ℝ) (s : S) : |
| 755 | PressureStream.pressureMass (fun x => f (ParticularWaveBounds.liftAssoc S x)) s = |
| 756 | associatedMass f s := rfl |
| 757 | |
| 758 | theorem radialMoment_liftAssoc (k : ℕ) (f : MeanIncrementBounds.Field (Associated S)) |
| 759 | (n : ℕ) (s : S) : |
| 760 | CorrectionState.radialMoment k (field (ParticularWaveBounds.liftAssoc S) f) n s = |
| 761 | associatedMass (fun x => x.1.1 ^ k * f n x) s := rfl |
| 762 | |
| 763 | theorem covarianceMass_liftAssoc (k : ℕ) (u : CorrectionState.State (Associated S)) |
| 764 | (i j : Fin 3) (n : ℕ) (s : S) : |
| 765 | CorrectionState.radialMoment k ((state (ParticularWaveBounds.liftAssoc S) u).covariance i j) n s = |
| 766 | associatedMass (fun x => x.1.1 ^ k * u.covariance i j n x) s := rfl |
| 767 | |
| 768 | /-- A current state sent into the assembly and returned has exactly its |
| 769 | original stripped residual block, including the actual error coefficients. -/ |
| 770 | theorem residualBlock_liftAssoc_return |
| 771 | (c : CorrectionState.Context (PressureStream.Lift S)) |
| 772 | (u : CorrectionState.State (PressureStream.Lift S)) |
| 773 | (b : CorrectionState.HarmonicBlock (PressureStream.Lift S)) |
| 774 | (G A : HarmonicResidual.BlockCoefficients (PressureStream.Lift S)) : |
| 775 | block (ParticularWaveBounds.liftAssoc S) |
| 776 | (HarmonicResidual.residualBlock |
| 777 | (context (ParticularWaveBounds.liftAssoc S).symm c) |
| 778 | (state (ParticularWaveBounds.liftAssoc S).symm u) |
| 779 | (block (ParticularWaveBounds.liftAssoc S).symm b) |
| 780 | (blockCoefficients (ParticularWaveBounds.liftAssoc S).symm G) |
| 781 | (blockCoefficients (ParticularWaveBounds.liftAssoc S).symm A)) = |
| 782 | HarmonicResidual.residualBlock c u b G A := by |
| 783 | rw [residualBlock_pull, block_roundtrip] |
| 784 | |
| 785 | theorem fullResidual_liftAssoc_return |
| 786 | (c : CorrectionState.Context (PressureStream.Lift S)) |
| 787 | (u : CorrectionState.State (PressureStream.Lift S)) (n : ℕ) |
| 788 | (x : PressureStream.Lift S × ℝ) (i : Fin 3) : |
| 789 | LiftedMeanResidual.fullResidual |
| 790 | (context (ParticularWaveBounds.liftAssoc S).symm c) |
| 791 | (state (ParticularWaveBounds.liftAssoc S).symm u) n |
| 792 | (cylinder (ParticularWaveBounds.liftAssoc S) x) i = |
| 793 | LiftedMeanResidual.fullResidual c u n x i := by |
| 794 | rw [fullResidual_pull] |
| 795 | rfl |
| 796 | |
| 797 | end Association |
| 798 | |
| 799 | end NavierStokes.StateReindex |