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.HarmonicFields |
| 2 | import NavierStokes.LinearWaveBounds |
| 3 | import NavierStokes.CorrectionState |
| 4 | import NavierStokes.AxisymmetricResidual |
| 5 | |
| 6 | /-! |
| 7 | # Explicit harmonic witnesses for the retained error fields |
| 8 | |
| 9 | Every representation in this file is constructed from its source field. |
| 10 | Gaussian errors retain the original carrier and its conjugate, while actual |
| 11 | mean aliases occupy the zero mode. No full-residual identity is assumed. |
| 12 | -/ |
| 13 | |
| 14 | noncomputable section |
| 15 | |
| 16 | namespace NavierStokes.ErrorHarmonics |
| 17 | |
| 18 | open Set Filter Function MeasureTheory |
| 19 | open HarmonicFields CorrectionState |
| 20 | open scoped BigOperators ContDiff Topology ComplexConjugate |
| 21 | |
| 22 | noncomputable def conjugatePair {D : Type} (j : ℤ) (a : D → ℂ) : Coefficients D := by |
| 23 | let c : Coefficients D := AddMonoidAlgebra.single j (fun x => a x / 2) |
| 24 | exact c + conjugateReverse c |
| 25 | |
| 26 | theorem evaluate_conjugatePair {D : Type} (j : ℤ) (a : D → ℂ) (x : D) (φ : ℝ) : |
| 27 | evaluate (conjugatePair j a) x φ = ((a x * character j φ).re : ℂ) := by |
| 28 | rw [conjugatePair, evaluate_add, evaluate_conjugateReverse, evaluate_single, |
| 29 | Complex.re_eq_add_conj] |
| 30 | simp only [map_mul, map_div₀, map_ofNat] |
| 31 | ring |
| 32 | |
| 33 | theorem field_conjugatePair {D : Type} (j : ℤ) (a : D → ℂ) (k : ℝ) (Φ : D → ℝ) |
| 34 | (kp : ℤ) (p : D × ℝ) : |
| 35 | field (conjugatePair j a) k Φ kp p = |
| 36 | ((a p.1 * character j (k * Φ p.1 + (kp : ℝ) * p.2)).re : ℂ) := |
| 37 | evaluate_conjugatePair j a p.1 _ |
| 38 | |
| 39 | theorem conjugatePair_symmetric {D : Type} (j : ℤ) (a : D → ℂ) : |
| 40 | ConjugateSymmetric (conjugatePair j a) := by |
| 41 | classical |
| 42 | intro m x |
| 43 | let c : Coefficients D := AddMonoidAlgebra.single j (fun x => a x / 2) |
| 44 | change c (-m) x + conj (c (-(-m)) x) = conj (c m x + conj (c (-m) x)) |
| 45 | simp only [map_add, neg_neg, starRingEnd_self_apply] |
| 46 | exact add_comm _ _ |
| 47 | |
| 48 | theorem band_single {D : Type} (j : ℤ) (a : D → ℂ) : |
| 49 | HarmonicFields.BandLimited (AddMonoidAlgebra.single j a : Coefficients D) j.natAbs := by |
| 50 | intro m hm |
| 51 | have he := Finset.mem_singleton.mp (Finsupp.support_single_subset hm) |
| 52 | exact he ▸ le_rfl |
| 53 | |
| 54 | theorem band_conjugateReverse {D : Type} {c : Coefficients D} {N : ℕ} |
| 55 | (hc : HarmonicFields.BandLimited c N) : HarmonicFields.BandLimited (conjugateReverse c) N := by |
| 56 | intro j hj |
| 57 | have hm : -j ∈ c.support := by |
| 58 | by_contra hn |
| 59 | have hz := Finsupp.notMem_support_iff.mp hn |
| 60 | have hzero : conjugateReverse c j = 0 := by |
| 61 | funext x |
| 62 | simp only [conjugateReverse_apply, hz, Pi.zero_apply, map_zero] |
| 63 | exact (Finsupp.mem_support_iff.mp hj) hzero |
| 64 | simpa only [Int.natAbs_neg] using hc (-j) hm |
| 65 | |
| 66 | theorem band_conjugatePair {D : Type} (j : ℤ) (a : D → ℂ) : |
| 67 | HarmonicFields.BandLimited (conjugatePair j a) j.natAbs := |
| 68 | (band_single j (fun x => a x / 2)).add |
| 69 | (band_conjugateReverse (band_single j (fun x => a x / 2))) |
| 70 | |
| 71 | theorem norm_pair_field_le {D : Type} (j : ℤ) (a : D → ℂ) (k : ℝ) (Φ : D → ℝ) |
| 72 | (kp : ℤ) (p : D × ℝ) : ‖field (conjugatePair j a) k Φ kp p‖ ≤ ‖a p.1‖ := by |
| 73 | rw [field_conjugatePair, Complex.norm_real] |
| 74 | apply (Complex.abs_re_le_norm _).trans |
| 75 | rw [norm_mul, norm_character, mul_one] |
| 76 | |
| 77 | noncomputable def pairedBlock {D : Type} (j : ℤ) (k : ℕ → ℝ) (Φ : ℕ → D → ℝ) |
| 78 | (kp : ℕ → ℤ) (a : ℕ → D → HarmonicCalculus.ComplexVector) : HarmonicBlock D where |
| 79 | velocity n i := conjugatePair j (fun x => a n x i) |
| 80 | pressure _ := 0 |
| 81 | frequency := k |
| 82 | phase := Φ |
| 83 | angularFrequency := kp |
| 84 | |
| 85 | theorem pairedBlock_band {D : Type} (j : ℤ) (k : ℕ → ℝ) (Φ : ℕ → D → ℝ) |
| 86 | (kp : ℕ → ℤ) (a : ℕ → D → HarmonicCalculus.ComplexVector) : |
| 87 | HarmonicBlock.BandLimited (pairedBlock j k Φ kp a) j.natAbs := by |
| 88 | refine ⟨fun n i => band_conjugatePair j (fun x => a n x i), ?_⟩ |
| 89 | intro n l hl |
| 90 | simp [pairedBlock] at hl |
| 91 | |
| 92 | theorem pairedBlock_symmetric {D : Type} (j : ℤ) (k : ℕ → ℝ) (Φ : ℕ → D → ℝ) |
| 93 | (kp : ℕ → ℤ) (a : ℕ → D → HarmonicCalculus.ComplexVector) (n : ℕ) (i : Fin 3) : |
| 94 | ConjugateSymmetric ((pairedBlock j k Φ kp a).velocity n i) := |
| 95 | conjugatePair_symmetric j (fun x => a n x i) |
| 96 | |
| 97 | theorem pairedBlock_evaluation {D : Type} (j : ℤ) (k : ℕ → ℝ) (Φ : ℕ → D → ℝ) |
| 98 | (kp : ℕ → ℤ) (a : ℕ → D → HarmonicCalculus.ComplexVector) (n : ℕ) (p : D × ℝ) (i : Fin 3) : |
| 99 | (pairedBlock j k Φ kp a).oscillation n p i = |
| 100 | (a n p.1 i * character j (k n * Φ n p.1 + (kp n : ℝ) * p.2)).re := by |
| 101 | have h := congrArg Complex.re (field_conjugatePair j (fun x => a n x i) (k n) (Φ n) (kp n) p) |
| 102 | simp only [Complex.ofReal_re] at h |
| 103 | exact h |
| 104 | |
| 105 | noncomputable def zeroBlock {D : Type} (k : ℕ → ℝ) (Φ : ℕ → D → ℝ) (kp : ℕ → ℤ) |
| 106 | (a : MeanVector D) : HarmonicBlock D where |
| 107 | velocity n i := constantCoefficient (fun x => (a n x i : ℂ)) |
| 108 | pressure _ := 0 |
| 109 | frequency := k |
| 110 | phase := Φ |
| 111 | angularFrequency := kp |
| 112 | |
| 113 | theorem zeroBlock_evaluation {D : Type} (k : ℕ → ℝ) (Φ : ℕ → D → ℝ) (kp : ℕ → ℤ) |
| 114 | (a : MeanVector D) (n : ℕ) (p : D × ℝ) (i : Fin 3) : |
| 115 | (zeroBlock k Φ kp a).oscillation n p i = a n p.1 i := by |
| 116 | change (field (constantCoefficient (fun x => (a n x i : ℂ))) (k n) (Φ n) (kp n) p).re = _ |
| 117 | unfold field constantCoefficient |
| 118 | rw [evaluate_single, character_zero, mul_one, Complex.ofReal_re] |
| 119 | |
| 120 | theorem zeroBlock_band {D : Type} (k : ℕ → ℝ) (Φ : ℕ → D → ℝ) (kp : ℕ → ℤ) |
| 121 | (a : MeanVector D) : HarmonicBlock.BandLimited (zeroBlock k Φ kp a) 0 := by |
| 122 | refine ⟨fun n i => band_constantCoefficient _, ?_⟩ |
| 123 | intro n l hl |
| 124 | simp [zeroBlock] at hl |
| 125 | |
| 126 | theorem zeroBlock_symmetric {D : Type} (k : ℕ → ℝ) (Φ : ℕ → D → ℝ) (kp : ℕ → ℤ) |
| 127 | (a : MeanVector D) (n : ℕ) (i : Fin 3) : |
| 128 | ConjugateSymmetric ((zeroBlock k Φ kp a).velocity n i) := by |
| 129 | intro j x |
| 130 | classical |
| 131 | by_cases hj : j = 0 |
| 132 | · simp [zeroBlock, constantCoefficient, hj] |
| 133 | · simp [zeroBlock, constantCoefficient, hj] |
| 134 | |
| 135 | section GaussianErrors |
| 136 | |
| 137 | variable {D E : Type} [NormedAddCommGroup D] [NormedSpace ℝ D] |
| 138 | |
| 139 | /-- Independence of the explicit angular coordinate. -/ |
| 140 | def AngleIndependent (f : ℕ → D × ℝ → E) : Prop := |
| 141 | ∀ n x θ, f n (x, θ) = f n (x, 0) |
| 142 | |
| 143 | theorem dfast_angleIndependent (d : LinearWaveBounds.GraphDirections (D × ℝ)) |
| 144 | {ψ : ℕ → D × ℝ → ℝ} (hψ : ∀ n, ContDiff ℝ ∞ (ψ n)) (hψa : AngleIndependent ψ) : |
| 145 | AngleIndependent (d.Dfast ψ) := by |
| 146 | intro n x θ |
| 147 | let q : D → ℝ := fun y => ψ n (y, 0) |
| 148 | let L : D × ℝ →L[ℝ] D := ContinuousLinearMap.fst ℝ D ℝ |
| 149 | have hq : ContDiff ℝ ∞ q := (hψ n).comp (contDiff_id.prodMk contDiff_const) |
| 150 | have he : ψ n = q ∘ L := funext (fun p => hψa n p.1 p.2) |
| 151 | have hd (t : ℝ) := (((hq.differentiable (by simp)) x).hasFDerivAt).comp (x, t) L.hasFDerivAt |
| 152 | simp only [LinearWaveBounds.GraphDirections.Dfast, LinearWaveBounds.GraphDirections.fastField, |
| 153 | HarmonicCalculus.along, he, (hd θ).fderiv, (hd 0).fderiv] |
| 154 | |
| 155 | theorem excludedSlotError_angleIndependent (d : LinearWaveBounds.GraphDirections (D × ℝ)) |
| 156 | {ψ : ℕ → D × ℝ → ℝ} {a source : ℕ → D × ℝ → HarmonicCalculus.ComplexVector} |
| 157 | (hψ : ∀ n, ContDiff ℝ ∞ (ψ n)) (hψa : AngleIndependent ψ) |
| 158 | (ha : AngleIndependent a) (hs : AngleIndependent source) : |
| 159 | AngleIndependent (LinearWaveBounds.excludedSlotError d ψ a source) := by |
| 160 | intro n x θ |
| 161 | simp only [LinearWaveBounds.excludedSlotError, dfast_angleIndependent d hψ hψa n x θ, |
| 162 | hψa n x θ, ha n x θ, hs n x θ] |
| 163 | |
| 164 | theorem slot_coordinate_angleIndependent {s : WeightedClasses.StripData (D × ℝ)} |
| 165 | (g : GaussianTailFlat.SlotFamily s) (hangle : ∀ n, g.linear n ((0 : D), 1) = 0) : |
| 166 | AngleIndependent g.coordinate := by |
| 167 | intro n x θ |
| 168 | have hp : (x, θ) = (x, 0) + θ • ((0 : D), 1) := by ext <;> simp |
| 169 | simp only [GaussianTailFlat.SlotFamily.coordinate, hp, map_add, map_smul, hangle, |
| 170 | smul_zero, add_zero] |
| 171 | |
| 172 | theorem slot_cutoff_angleIndependent {s : WeightedClasses.StripData (D × ℝ)} |
| 173 | (g : GaussianTailFlat.SlotFamily s) (hangle : ∀ n, g.linear n ((0 : D), 1) = 0) : |
| 174 | AngleIndependent g.cutoff := by |
| 175 | intro n x θ |
| 176 | exact congrArg GaussianTailFlat.profile (slot_coordinate_angleIndependent g hangle n x θ) |
| 177 | |
| 178 | /-- The retained Gaussian term as a literal real carrier field. -/ |
| 179 | noncomputable def gaussianField (d : LinearWaveBounds.GraphDirections (D × ℝ)) |
| 180 | (ψ : ℕ → D × ℝ → ℝ) (a source : ℕ → D × ℝ → HarmonicCalculus.ComplexVector) |
| 181 | (j : ℤ) (k : ℕ → ℝ) (Ψ : ℕ → D × ℝ → ℝ) : Oscillation D := |
| 182 | fun n p i => (HarmonicCalculus.vectorMode (k n * (j : ℝ)) (Ψ n) |
| 183 | (LinearWaveBounds.excludedSlotError d ψ a source n) p i).re |
| 184 | |
| 185 | noncomputable def gaussianBlock (d : LinearWaveBounds.GraphDirections (D × ℝ)) |
| 186 | (ψ : ℕ → D × ℝ → ℝ) (a source : ℕ → D × ℝ → HarmonicCalculus.ComplexVector) |
| 187 | (j : ℤ) (k : ℕ → ℝ) (Φ : ℕ → D → ℝ) (kp : ℕ → ℤ) : HarmonicBlock D := |
| 188 | pairedBlock j k Φ kp (fun n x => LinearWaveBounds.excludedSlotError d ψ a source n (x, 0)) |
| 189 | |
| 190 | theorem gaussianBlock_metadata (d : LinearWaveBounds.GraphDirections (D × ℝ)) |
| 191 | (ψ : ℕ → D × ℝ → ℝ) (a source : ℕ → D × ℝ → HarmonicCalculus.ComplexVector) |
| 192 | (j : ℤ) (k : ℕ → ℝ) (Φ : ℕ → D → ℝ) (kp : ℕ → ℤ) : |
| 193 | (gaussianBlock d ψ a source j k Φ kp).frequency = k ∧ |
| 194 | (gaussianBlock d ψ a source j k Φ kp).phase = Φ ∧ |
| 195 | (gaussianBlock d ψ a source j k Φ kp).angularFrequency = kp := ⟨rfl, rfl, rfl⟩ |
| 196 | |
| 197 | theorem gaussianBlock_band (d : LinearWaveBounds.GraphDirections (D × ℝ)) |
| 198 | (ψ : ℕ → D × ℝ → ℝ) (a source : ℕ → D × ℝ → HarmonicCalculus.ComplexVector) |
| 199 | (j : ℤ) (k : ℕ → ℝ) (Φ : ℕ → D → ℝ) (kp : ℕ → ℤ) : |
| 200 | HarmonicBlock.BandLimited (gaussianBlock d ψ a source j k Φ kp) j.natAbs := |
| 201 | pairedBlock_band j k Φ kp _ |
| 202 | |
| 203 | theorem gaussianBlock_symmetric (d : LinearWaveBounds.GraphDirections (D × ℝ)) |
| 204 | (ψ : ℕ → D × ℝ → ℝ) (a source : ℕ → D × ℝ → HarmonicCalculus.ComplexVector) |
| 205 | (j : ℤ) (k : ℕ → ℝ) (Φ : ℕ → D → ℝ) (kp : ℕ → ℤ) (n : ℕ) (i : Fin 3) : |
| 206 | ConjugateSymmetric ((gaussianBlock d ψ a source j k Φ kp).velocity n i) := |
| 207 | conjugatePair_symmetric j |
| 208 | (fun x => LinearWaveBounds.excludedSlotError d ψ a source n (x, 0) i) |
| 209 | |
| 210 | /-- The witness evaluates to the actual error, from primitive angular |
| 211 | independence and the actual phase identity. No error representation is assumed. -/ |
| 212 | theorem gaussianBlock_represents (d : LinearWaveBounds.GraphDirections (D × ℝ)) |
| 213 | {ψ : ℕ → D × ℝ → ℝ} {a source : ℕ → D × ℝ → HarmonicCalculus.ComplexVector} |
| 214 | (j : ℤ) (k : ℕ → ℝ) (Φ : ℕ → D → ℝ) (Ψ : ℕ → D × ℝ → ℝ) (kp : ℕ → ℤ) |
| 215 | (hψ : ∀ n, ContDiff ℝ ∞ (ψ n)) (hψa : AngleIndependent ψ) |
| 216 | (ha : AngleIndependent a) (hs : AngleIndependent source) |
| 217 | (hphase : ∀ n x θ, k n * Ψ n (x, θ) = k n * Φ n x + (kp n : ℝ) * θ) : |
| 218 | (gaussianBlock d ψ a source j k Φ kp).oscillation = gaussianField d ψ a source j k Ψ := by |
| 219 | funext n p i |
| 220 | change (pairedBlock j k Φ kp _).oscillation n p i = _ |
| 221 | rw [pairedBlock_evaluation] |
| 222 | change (LinearWaveBounds.excludedSlotError d ψ a source n (p.1, 0) i * |
| 223 | character j (k n * Φ n p.1 + (kp n : ℝ) * p.2)).re = |
| 224 | (LinearWaveBounds.excludedSlotError d ψ a source n p i * HarmonicCalculus.carrier |
| 225 | (k n * (j : ℝ)) (Ψ n) p).re |
| 226 | rw [← character_eq_carrier j (k n) (Ψ n) p, hphase n p.1 p.2] |
| 227 | rw [excludedSlotError_angleIndependent d hψ hψa ha hs n p.1 p.2] |
| 228 | |
| 229 | /-- The affine Gaussian slot profile supplies the cutoff invariance itself. -/ |
| 230 | theorem gaussianSlotBlock_represents {s : WeightedClasses.StripData (D × ℝ)} |
| 231 | (g : GaussianTailFlat.SlotFamily s) (d : LinearWaveBounds.GraphDirections (D × ℝ)) |
| 232 | {a source : ℕ → D × ℝ → HarmonicCalculus.ComplexVector} |
| 233 | (j : ℤ) (k : ℕ → ℝ) (Φ : ℕ → D → ℝ) (Ψ : ℕ → D × ℝ → ℝ) (kp : ℕ → ℤ) |
| 234 | (hangle : ∀ n, g.linear n ((0 : D), 1) = 0) |
| 235 | (ha : AngleIndependent a) (hs : AngleIndependent source) |
| 236 | (hphase : ∀ n x θ, k n * Ψ n (x, θ) = k n * Φ n x + (kp n : ℝ) * θ) : |
| 237 | (gaussianBlock d g.cutoff a source j k Φ kp).oscillation = |
| 238 | gaussianField d g.cutoff a source j k Ψ := |
| 239 | gaussianBlock_represents d j k Φ Ψ kp |
| 240 | (fun n => GaussianTailFlat.profile_contDiff.comp (g.coordinate_contDiff n)) |
| 241 | (slot_cutoff_angleIndependent g hangle) ha hs hphase |
| 242 | |
| 243 | theorem gaussianField_eq_gaussianTailError {s : WeightedClasses.StripData (D × ℝ)} |
| 244 | (g : GaussianTailFlat.SlotFamily s) (d : LinearWaveBounds.GraphDirections (D × ℝ)) |
| 245 | (hfast : ∀ n, g.linear n (d.fastScale n • d.fast) = (g.length n)⁻¹) |
| 246 | (a source : ℕ → D × ℝ → HarmonicCalculus.ComplexVector) |
| 247 | (j : ℤ) (k : ℕ → ℝ) (Ψ : ℕ → D × ℝ → ℝ) : |
| 248 | gaussianField d g.cutoff a source j k Ψ = |
| 249 | fun n p i => (HarmonicCalculus.vectorMode (k n * (j : ℝ)) (Ψ n) (g.error a source n) p i).re := by |
| 250 | unfold gaussianField |
| 251 | rw [LinearWaveBounds.excludedSlotError_eq_gaussianError g d hfast] |
| 252 | |
| 253 | end GaussianErrors |
| 254 | |
| 255 | section AliasErrors |
| 256 | |
| 257 | variable {S : Type} [NormedAddCommGroup S] [NormedSpace ℝ S] |
| 258 | |
| 259 | /-- The pressure alias already used in the correction state, represented in |
| 260 | mode zero. Its metadata can be chosen to equal any associated label. -/ |
| 261 | noncomputable def pressureAliasBlock (r : ReconstructionData) (c : Context (Lift S)) |
| 262 | (u : State (Lift S)) (k : ℕ → ℝ) (Φ : ℕ → Lift S → ℝ) (kp : ℕ → ℤ) : |
| 263 | HarmonicBlock (Lift S) := |
| 264 | zeroBlock k Φ kp (fun n x => CorrectionState.pressureAlias r c u n (x, 0)) |
| 265 | |
| 266 | theorem pressureAliasBlock_represents (r : ReconstructionData) (c : Context (Lift S)) |
| 267 | (u : State (Lift S)) (k : ℕ → ℝ) (Φ : ℕ → Lift S → ℝ) (kp : ℕ → ℤ) : |
| 268 | (pressureAliasBlock r c u k Φ kp).oscillation = CorrectionState.pressureAlias r c u := by |
| 269 | funext n p i |
| 270 | exact zeroBlock_evaluation k Φ kp _ n p i |
| 271 | |
| 272 | theorem pressureAliasBlock_band (r : ReconstructionData) (c : Context (Lift S)) |
| 273 | (u : State (Lift S)) (k : ℕ → ℝ) (Φ : ℕ → Lift S → ℝ) (kp : ℕ → ℤ) : |
| 274 | HarmonicBlock.BandLimited (pressureAliasBlock r c u k Φ kp) 0 := |
| 275 | zeroBlock_band k Φ kp _ |
| 276 | |
| 277 | theorem pressureAlias_angleIndependent (r : ReconstructionData) (c : Context (Lift S)) |
| 278 | (u : State (Lift S)) : AngleIndependent (CorrectionState.pressureAlias r c u) := |
| 279 | fun _ _ _ => rfl |
| 280 | |
| 281 | /-- The temporal alias retains its actual differentiated shifted integral. -/ |
| 282 | noncomputable def temporalAliasBlock (r : ReconstructionData) (h : ℝ) |
| 283 | (c : Context (Lift S)) (u : State (Lift S)) |
| 284 | (k : ℕ → ℝ) (Φ : ℕ → Lift S → ℝ) (kp : ℕ → ℤ) : HarmonicBlock (Lift S) := |
| 285 | zeroBlock k Φ kp (fun n x => CorrectionState.temporalAlias r h c u n (x, 0)) |
| 286 | |
| 287 | theorem temporalAliasBlock_represents (r : ReconstructionData) (h : ℝ) |
| 288 | (c : Context (Lift S)) (u : State (Lift S)) |
| 289 | (k : ℕ → ℝ) (Φ : ℕ → Lift S → ℝ) (kp : ℕ → ℤ) : |
| 290 | (temporalAliasBlock r h c u k Φ kp).oscillation = |
| 291 | CorrectionState.temporalAlias r h c u := by |
| 292 | funext n p i |
| 293 | exact zeroBlock_evaluation k Φ kp _ n p i |
| 294 | |
| 295 | theorem temporalAliasBlock_band (r : ReconstructionData) (h : ℝ) |
| 296 | (c : Context (Lift S)) (u : State (Lift S)) |
| 297 | (k : ℕ → ℝ) (Φ : ℕ → Lift S → ℝ) (kp : ℕ → ℤ) : |
| 298 | HarmonicBlock.BandLimited (temporalAliasBlock r h c u k Φ kp) 0 := |
| 299 | zeroBlock_band k Φ kp _ |
| 300 | |
| 301 | theorem temporalAlias_angleIndependent (r : ReconstructionData) (h : ℝ) |
| 302 | (c : Context (Lift S)) (u : State (Lift S)) : |
| 303 | AngleIndependent (CorrectionState.temporalAlias r h c u) := fun _ _ _ => rfl |
| 304 | |
| 305 | /-- Replacing a pressure reconstruction changes the saved alias by its exact |
| 306 | new-minus-old value, which is again mode zero. -/ |
| 307 | noncomputable def pressureAliasRefreshBlock (r : ReconstructionData) |
| 308 | (c : Context (Lift S)) (oldState newState : State (Lift S)) |
| 309 | (k : ℕ → ℝ) (Φ : ℕ → Lift S → ℝ) (kp : ℕ → ℤ) : HarmonicBlock (Lift S) := |
| 310 | zeroBlock k Φ kp (fun n x => CorrectionState.pressureAlias r c newState n (x, 0) - |
| 311 | CorrectionState.pressureAlias r c oldState n (x, 0)) |
| 312 | |
| 313 | theorem pressureAliasRefreshBlock_represents (r : ReconstructionData) |
| 314 | (c : Context (Lift S)) (oldState newState : State (Lift S)) |
| 315 | (k : ℕ → ℝ) (Φ : ℕ → Lift S → ℝ) (kp : ℕ → ℤ) : |
| 316 | (pressureAliasRefreshBlock r c oldState newState k Φ kp).oscillation = |
| 317 | CorrectionState.pressureAlias r c newState - CorrectionState.pressureAlias r c oldState := by |
| 318 | funext n p i |
| 319 | exact zeroBlock_evaluation k Φ kp _ n p i |
| 320 | |
| 321 | theorem pressureAliasRefreshBlock_band (r : ReconstructionData) |
| 322 | (c : Context (Lift S)) (oldState newState : State (Lift S)) |
| 323 | (k : ℕ → ℝ) (Φ : ℕ → Lift S → ℝ) (kp : ℕ → ℤ) : |
| 324 | HarmonicBlock.BandLimited (pressureAliasRefreshBlock r c oldState newState k Φ kp) 0 := |
| 325 | zeroBlock_band k Φ kp _ |
| 326 | |
| 327 | end AliasErrors |
| 328 | |
| 329 | /-- Conjugacy is kept for both velocity and pressure coefficients. -/ |
| 330 | def RealBlock {D : Type} (b : HarmonicBlock D) : Prop := |
| 331 | (∀ n i, ConjugateSymmetric (b.velocity n i)) ∧ ∀ n, ConjugateSymmetric (b.pressure n) |
| 332 | |
| 333 | theorem pairedBlock_real {D : Type} (j : ℤ) (k : ℕ → ℝ) (Φ : ℕ → D → ℝ) |
| 334 | (kp : ℕ → ℤ) (a : ℕ → D → HarmonicCalculus.ComplexVector) : |
| 335 | RealBlock (pairedBlock j k Φ kp a) := by |
| 336 | refine ⟨pairedBlock_symmetric j k Φ kp a, ?_⟩ |
| 337 | intro n l x |
| 338 | simp [pairedBlock] |
| 339 | |
| 340 | theorem zeroBlock_real {D : Type} (k : ℕ → ℝ) (Φ : ℕ → D → ℝ) (kp : ℕ → ℤ) |
| 341 | (a : MeanVector D) : RealBlock (zeroBlock k Φ kp a) := by |
| 342 | refine ⟨zeroBlock_symmetric k Φ kp a, ?_⟩ |
| 343 | intro n l x |
| 344 | simp [zeroBlock] |
| 345 | |
| 346 | theorem gaussianBlock_real {D : Type} [NormedAddCommGroup D] [NormedSpace ℝ D] |
| 347 | (d : LinearWaveBounds.GraphDirections (D × ℝ)) |
| 348 | (ψ : ℕ → D × ℝ → ℝ) (a source : ℕ → D × ℝ → HarmonicCalculus.ComplexVector) |
| 349 | (j : ℤ) (k : ℕ → ℝ) (Φ : ℕ → D → ℝ) (kp : ℕ → ℤ) : |
| 350 | RealBlock (gaussianBlock d ψ a source j k Φ kp) := |
| 351 | pairedBlock_real j k Φ kp _ |
| 352 | |
| 353 | theorem pressureAliasBlock_real {S : Type} [NormedAddCommGroup S] [NormedSpace ℝ S] |
| 354 | (r : ReconstructionData) (c : Context (Lift S)) (u : State (Lift S)) |
| 355 | (k : ℕ → ℝ) (Φ : ℕ → Lift S → ℝ) (kp : ℕ → ℤ) : |
| 356 | RealBlock (pressureAliasBlock r c u k Φ kp) := zeroBlock_real k Φ kp _ |
| 357 | |
| 358 | theorem temporalAliasBlock_real {S : Type} [NormedAddCommGroup S] [NormedSpace ℝ S] |
| 359 | (r : ReconstructionData) (h : ℝ) (c : Context (Lift S)) (u : State (Lift S)) |
| 360 | (k : ℕ → ℝ) (Φ : ℕ → Lift S → ℝ) (kp : ℕ → ℤ) : |
| 361 | RealBlock (temporalAliasBlock r h c u k Φ kp) := zeroBlock_real k Φ kp _ |
| 362 | |
| 363 | theorem pressureAliasRefreshBlock_real {S : Type} [NormedAddCommGroup S] [NormedSpace ℝ S] |
| 364 | (r : ReconstructionData) (c : Context (Lift S)) (oldState newState : State (Lift S)) |
| 365 | (k : ℕ → ℝ) (Φ : ℕ → Lift S → ℝ) (kp : ℕ → ℤ) : |
| 366 | RealBlock (pressureAliasRefreshBlock r c oldState newState k Φ kp) := zeroBlock_real k Φ kp _ |
| 367 | |
| 368 | theorem symmetric_add {D : Type} {a b : Coefficients D} |
| 369 | (ha : ConjugateSymmetric a) (hb : ConjugateSymmetric b) : |
| 370 | ConjugateSymmetric (a + b) := by |
| 371 | intro j x |
| 372 | change a (-j) x + b (-j) x = conj (a j x + b j x) |
| 373 | rw [map_add, ha j x, hb j x] |
| 374 | |
| 375 | theorem band_sum {D ι : Type} (s : Finset ι) (a : ι → Coefficients D) (N : ℕ) |
| 376 | (ha : ∀ l ∈ s, HarmonicFields.BandLimited (a l) N) : |
| 377 | HarmonicFields.BandLimited (∑ l ∈ s, a l) N := by |
| 378 | classical |
| 379 | induction s using Finset.induction_on with |
| 380 | | empty => simp [HarmonicFields.BandLimited] |
| 381 | | @insert l s hl ih => |
| 382 | rw [Finset.sum_insert hl] |
| 383 | exact (ha l (Finset.mem_insert_self _ _)).add |
| 384 | (ih (fun m hm => ha m (Finset.mem_insert_of_mem hm))) |
| 385 | |
| 386 | theorem symmetric_sum {D ι : Type} (s : Finset ι) (a : ι → Coefficients D) |
| 387 | (ha : ∀ l ∈ s, ConjugateSymmetric (a l)) : |
| 388 | ConjugateSymmetric (∑ l ∈ s, a l) := by |
| 389 | classical |
| 390 | induction s using Finset.induction_on with |
| 391 | | empty => intro j x; simp |
| 392 | | @insert l s hl ih => |
| 393 | rw [Finset.sum_insert hl] |
| 394 | exact symmetric_add (ha l (Finset.mem_insert_self _ _)) |
| 395 | (ih (fun m hm => ha m (Finset.mem_insert_of_mem hm))) |
| 396 | |
| 397 | /-- Accumulation is coefficient addition within one fixed label. Distinct |
| 398 | labels are left distinct even if their numerical carriers coincide. -/ |
| 399 | noncomputable def sumBlock {D ι : Type} (s : Finset ι) |
| 400 | (k : ℕ → ℝ) (Φ : ℕ → D → ℝ) (kp : ℕ → ℤ) (b : ι → HarmonicBlock D) : |
| 401 | HarmonicBlock D where |
| 402 | velocity n i := ∑ l ∈ s, (b l).velocity n i |
| 403 | pressure n := ∑ l ∈ s, (b l).pressure n |
| 404 | frequency := k |
| 405 | phase := Φ |
| 406 | angularFrequency := kp |
| 407 | |
| 408 | theorem sumBlock_band {D ι : Type} (s : Finset ι) |
| 409 | (k : ℕ → ℝ) (Φ : ℕ → D → ℝ) (kp : ℕ → ℤ) (b : ι → HarmonicBlock D) |
| 410 | (N : ℕ) (hb : ∀ l ∈ s, HarmonicBlock.BandLimited (b l) N) : |
| 411 | HarmonicBlock.BandLimited (sumBlock s k Φ kp b) N := |
| 412 | ⟨fun n i => band_sum s _ N (fun l hl => (hb l hl).1 n i), |
| 413 | fun n => band_sum s _ N (fun l hl => (hb l hl).2 n)⟩ |
| 414 | |
| 415 | theorem sumBlock_real {D ι : Type} (s : Finset ι) |
| 416 | (k : ℕ → ℝ) (Φ : ℕ → D → ℝ) (kp : ℕ → ℤ) (b : ι → HarmonicBlock D) |
| 417 | (hb : ∀ l ∈ s, RealBlock (b l)) : RealBlock (sumBlock s k Φ kp b) := |
| 418 | ⟨fun n i => symmetric_sum s _ (fun l hl => (hb l hl).1 n i), |
| 419 | fun n => symmetric_sum s _ (fun l hl => (hb l hl).2 n)⟩ |
| 420 | |
| 421 | theorem sumBlock_represents {D ι : Type} (s : Finset ι) |
| 422 | (k : ℕ → ℝ) (Φ : ℕ → D → ℝ) (kp : ℕ → ℤ) (b : ι → HarmonicBlock D) |
| 423 | (hk : ∀ l ∈ s, (b l).frequency = k) (hΦ : ∀ l ∈ s, (b l).phase = Φ) |
| 424 | (hkp : ∀ l ∈ s, (b l).angularFrequency = kp) : |
| 425 | (sumBlock s k Φ kp b).oscillation = ∑ l ∈ s, (b l).oscillation := by |
| 426 | classical |
| 427 | funext n p i |
| 428 | simp only [HarmonicBlock.oscillation, sumBlock, field, evaluate_eq_hom, map_sum, |
| 429 | Finset.sum_apply, Complex.re_sum] |
| 430 | apply Finset.sum_congr rfl |
| 431 | intro l hl |
| 432 | rw [hk l hl, hΦ l hl, hkp l hl] |
| 433 | |
| 434 | theorem realBlock_field {D : Type} {b : HarmonicBlock D} (hb : RealBlock b) |
| 435 | (n : ℕ) (p : D × ℝ) (i : Fin 3) : |
| 436 | ((b.oscillation n p i : ℝ) : ℂ) = |
| 437 | field (b.velocity n i) (b.frequency n) (b.phase n) (b.angularFrequency n) p := |
| 438 | field_real (hb.1 n i) _ _ _ _ |
| 439 | |
| 440 | section FiniteStages |
| 441 | |
| 442 | variable {D : Type} [NormedAddCommGroup D] [NormedSpace ℝ D] |
| 443 | |
| 444 | /-- Only primitive data are stored. The error field and its coefficients are |
| 445 | computed from the cutoff derivative, amplitudes, and carrier. -/ |
| 446 | structure GaussianData (D : Type) [NormedAddCommGroup D] [NormedSpace ℝ D] where |
| 447 | directions : LinearWaveBounds.GraphDirections (D × ℝ) |
| 448 | cutoff : ℕ → D × ℝ → ℝ |
| 449 | amplitude : ℕ → D × ℝ → HarmonicCalculus.ComplexVector |
| 450 | source : ℕ → D × ℝ → HarmonicCalculus.ComplexVector |
| 451 | harmonic : ℤ |
| 452 | phase : ℕ → D × ℝ → ℝ |
| 453 | |
| 454 | noncomputable def GaussianData.error (g : GaussianData D) (k : ℕ → ℝ) : Oscillation D := |
| 455 | gaussianField g.directions g.cutoff g.amplitude g.source g.harmonic k g.phase |
| 456 | |
| 457 | noncomputable def GaussianData.block (g : GaussianData D) |
| 458 | (k : ℕ → ℝ) (Φ : ℕ → D → ℝ) (kp : ℕ → ℤ) : HarmonicBlock D := |
| 459 | gaussianBlock g.directions g.cutoff g.amplitude g.source g.harmonic k Φ kp |
| 460 | |
| 461 | def GaussianData.Compatible (g : GaussianData D) |
| 462 | (k : ℕ → ℝ) (Φ : ℕ → D → ℝ) (kp : ℕ → ℤ) : Prop := |
| 463 | (∀ n, ContDiff ℝ ∞ (g.cutoff n)) ∧ AngleIndependent g.cutoff ∧ |
| 464 | AngleIndependent g.amplitude ∧ AngleIndependent g.source ∧ |
| 465 | ∀ n x θ, k n * g.phase n (x, θ) = k n * Φ n x + (kp n : ℝ) * θ |
| 466 | |
| 467 | theorem GaussianData.block_represents (g : GaussianData D) |
| 468 | (k : ℕ → ℝ) (Φ : ℕ → D → ℝ) (kp : ℕ → ℤ) (hg : g.Compatible k Φ kp) : |
| 469 | (g.block k Φ kp).oscillation = g.error k := |
| 470 | gaussianBlock_represents g.directions g.harmonic k Φ g.phase kp |
| 471 | hg.1 hg.2.1 hg.2.2.1 hg.2.2.2.1 hg.2.2.2.2 |
| 472 | |
| 473 | noncomputable def accumulatedGaussianBlock (steps : ℕ) (g : ℕ → GaussianData D) |
| 474 | (k : ℕ → ℝ) (Φ : ℕ → D → ℝ) (kp : ℕ → ℤ) : HarmonicBlock D := |
| 475 | sumBlock (Finset.range steps) k Φ kp (fun s => (g s).block k Φ kp) |
| 476 | |
| 477 | theorem accumulatedGaussianBlock_represents (steps : ℕ) (g : ℕ → GaussianData D) |
| 478 | (k : ℕ → ℝ) (Φ : ℕ → D → ℝ) (kp : ℕ → ℤ) |
| 479 | (hg : ∀ s < steps, (g s).Compatible k Φ kp) : |
| 480 | (accumulatedGaussianBlock steps g k Φ kp).oscillation = |
| 481 | ∑ s ∈ Finset.range steps, (g s).error k := by |
| 482 | rw [accumulatedGaussianBlock, sumBlock_represents (Finset.range steps) k Φ kp |
| 483 | (fun s => (g s).block k Φ kp) |
| 484 | (fun _ _ => rfl) (fun _ _ => rfl) (fun _ _ => rfl)] |
| 485 | apply Finset.sum_congr rfl |
| 486 | intro s hs |
| 487 | exact (g s).block_represents k Φ kp (hg s (Finset.mem_range.mp hs)) |
| 488 | |
| 489 | theorem accumulatedGaussianBlock_band (steps : ℕ) (g : ℕ → GaussianData D) |
| 490 | (k : ℕ → ℝ) (Φ : ℕ → D → ℝ) (kp : ℕ → ℤ) |
| 491 | (N : ℕ) (hj : ∀ s < steps, (g s).harmonic.natAbs ≤ N) : |
| 492 | HarmonicBlock.BandLimited (accumulatedGaussianBlock steps g k Φ kp) N := by |
| 493 | apply sumBlock_band |
| 494 | intro s hs |
| 495 | have he := gaussianBlock_band (g s).directions (g s).cutoff (g s).amplitude |
| 496 | (g s).source (g s).harmonic k Φ kp |
| 497 | exact ⟨fun n i => (he.1 n i).mono (hj s (Finset.mem_range.mp hs)), |
| 498 | fun n => (he.2 n).mono (hj s (Finset.mem_range.mp hs))⟩ |
| 499 | |
| 500 | /-- This bounds the values of the occupied harmonics, not merely their count. -/ |
| 501 | theorem accumulatedGaussianBlock_band_pow (steps : ℕ) (g : ℕ → GaussianData D) |
| 502 | (k : ℕ → ℝ) (Φ : ℕ → D → ℝ) (kp : ℕ → ℤ) |
| 503 | (hj : ∀ s < steps, (g s).harmonic.natAbs ≤ 2 ^ s) : |
| 504 | HarmonicBlock.BandLimited (accumulatedGaussianBlock steps g k Φ kp) (2 ^ steps) := by |
| 505 | apply accumulatedGaussianBlock_band |
| 506 | intro s hs |
| 507 | exact (hj s hs).trans (Nat.pow_le_pow_right (by decide : 1 ≤ 2) (Nat.le_of_lt hs)) |
| 508 | |
| 509 | theorem accumulatedGaussianBlock_real (steps : ℕ) (g : ℕ → GaussianData D) |
| 510 | (k : ℕ → ℝ) (Φ : ℕ → D → ℝ) (kp : ℕ → ℤ) : |
| 511 | RealBlock (accumulatedGaussianBlock steps g k Φ kp) := by |
| 512 | apply sumBlock_real |
| 513 | intro s hs |
| 514 | exact pairedBlock_real (g s).harmonic k Φ kp _ |
| 515 | |
| 516 | end FiniteStages |
| 517 | |
| 518 | section AliasStages |
| 519 | |
| 520 | variable {S : Type} [NormedAddCommGroup S] [NormedSpace ℝ S] |
| 521 | |
| 522 | /-- Actual saved aliases after finitely many temporal stages and the current |
| 523 | pressure reconstruction. The state path may be produced by any correction rule. -/ |
| 524 | noncomputable def accumulatedAlias (steps : ℕ) (r : ReconstructionData) (h : ℝ) |
| 525 | (c : Context (Lift S)) (u : ℕ → State (Lift S)) : Oscillation (Lift S) := |
| 526 | CorrectionState.pressureAlias r c (u steps) + |
| 527 | ∑ s ∈ Finset.range steps, CorrectionState.temporalAlias r h c (u s) |
| 528 | |
| 529 | noncomputable def accumulatedAliasBlock (steps : ℕ) (r : ReconstructionData) (h : ℝ) |
| 530 | (c : Context (Lift S)) (u : ℕ → State (Lift S)) |
| 531 | (k : ℕ → ℝ) (Φ : ℕ → Lift S → ℝ) (kp : ℕ → ℤ) : HarmonicBlock (Lift S) := |
| 532 | zeroBlock k Φ kp (fun n x => accumulatedAlias steps r h c u n (x, 0)) |
| 533 | |
| 534 | theorem accumulatedAlias_angleIndependent (steps : ℕ) (r : ReconstructionData) (h : ℝ) |
| 535 | (c : Context (Lift S)) (u : ℕ → State (Lift S)) : |
| 536 | AngleIndependent (accumulatedAlias steps r h c u) := by |
| 537 | intro n x θ |
| 538 | simp only [accumulatedAlias, Pi.add_apply, Finset.sum_apply, CorrectionState.pressureAlias, |
| 539 | CorrectionState.temporalAlias] |
| 540 | |
| 541 | theorem accumulatedAliasBlock_represents (steps : ℕ) (r : ReconstructionData) (h : ℝ) |
| 542 | (c : Context (Lift S)) (u : ℕ → State (Lift S)) |
| 543 | (k : ℕ → ℝ) (Φ : ℕ → Lift S → ℝ) (kp : ℕ → ℤ) : |
| 544 | (accumulatedAliasBlock steps r h c u k Φ kp).oscillation = accumulatedAlias steps r h c u := by |
| 545 | funext n p i |
| 546 | rw [accumulatedAliasBlock, zeroBlock_evaluation] |
| 547 | exact congrFun (accumulatedAlias_angleIndependent steps r h c u n p.1 p.2).symm i |
| 548 | |
| 549 | theorem accumulatedAliasBlock_band (steps : ℕ) (r : ReconstructionData) (h : ℝ) |
| 550 | (c : Context (Lift S)) (u : ℕ → State (Lift S)) |
| 551 | (k : ℕ → ℝ) (Φ : ℕ → Lift S → ℝ) (kp : ℕ → ℤ) : |
| 552 | HarmonicBlock.BandLimited (accumulatedAliasBlock steps r h c u k Φ kp) 0 := |
| 553 | zeroBlock_band k Φ kp _ |
| 554 | |
| 555 | theorem accumulatedAliasBlock_real (steps : ℕ) (r : ReconstructionData) (h : ℝ) |
| 556 | (c : Context (Lift S)) (u : ℕ → State (Lift S)) |
| 557 | (k : ℕ → ℝ) (Φ : ℕ → Lift S → ℝ) (kp : ℕ → ℤ) : |
| 558 | RealBlock (accumulatedAliasBlock steps r h c u k Φ kp) := zeroBlock_real k Φ kp _ |
| 559 | |
| 560 | theorem accumulatedAlias_succ (steps : ℕ) (r : ReconstructionData) (h : ℝ) |
| 561 | (c : Context (Lift S)) (u : ℕ → State (Lift S)) : |
| 562 | accumulatedAlias (steps + 1) r h c u = accumulatedAlias steps r h c u + |
| 563 | CorrectionState.temporalAlias r h c (u steps) + |
| 564 | (CorrectionState.pressureAlias r c (u (steps + 1)) - |
| 565 | CorrectionState.pressureAlias r c (u steps)) := by |
| 566 | simp only [accumulatedAlias, Finset.sum_range_succ] |
| 567 | abel |
| 568 | |
| 569 | theorem pressure_refreshes_telescope (steps : ℕ) (r : ReconstructionData) |
| 570 | (c : Context (Lift S)) (u : ℕ → State (Lift S)) : |
| 571 | (∑ s ∈ Finset.range steps, (CorrectionState.pressureAlias r c (u (s + 1)) - |
| 572 | CorrectionState.pressureAlias r c (u s))) = |
| 573 | CorrectionState.pressureAlias r c (u steps) - CorrectionState.pressureAlias r c (u 0) := by |
| 574 | induction steps with |
| 575 | | zero => simp |
| 576 | | succ steps ih => rw [Finset.sum_range_succ, ih]; abel |
| 577 | |
| 578 | /-- The two retained error types for one label are added as actual finite |
| 579 | coefficient families. The base error is handled separately in the physical |
| 580 | decomposition and cancels from the good residual. -/ |
| 581 | noncomputable def accumulatedErrorBlock (steps : ℕ) (g : ℕ → GaussianData (Lift S)) |
| 582 | (r : ReconstructionData) (h : ℝ) (c : Context (Lift S)) (u : ℕ → State (Lift S)) |
| 583 | (k : ℕ → ℝ) (Φ : ℕ → Lift S → ℝ) (kp : ℕ → ℤ) : HarmonicBlock (Lift S) where |
| 584 | velocity n i := (accumulatedGaussianBlock steps g k Φ kp).velocity n i + |
| 585 | (accumulatedAliasBlock steps r h c u k Φ kp).velocity n i |
| 586 | pressure _ := 0 |
| 587 | frequency := k |
| 588 | phase := Φ |
| 589 | angularFrequency := kp |
| 590 | |
| 591 | theorem accumulatedErrorBlock_represents (steps : ℕ) (g : ℕ → GaussianData (Lift S)) |
| 592 | (r : ReconstructionData) (h : ℝ) (c : Context (Lift S)) (u : ℕ → State (Lift S)) |
| 593 | (k : ℕ → ℝ) (Φ : ℕ → Lift S → ℝ) (kp : ℕ → ℤ) |
| 594 | (hg : ∀ s < steps, (g s).Compatible k Φ kp) : |
| 595 | (accumulatedErrorBlock steps g r h c u k Φ kp).oscillation = |
| 596 | (∑ s ∈ Finset.range steps, (g s).error k) + accumulatedAlias steps r h c u := by |
| 597 | rw [← accumulatedGaussianBlock_represents steps g k Φ kp hg, |
| 598 | ← accumulatedAliasBlock_represents steps r h c u k Φ kp] |
| 599 | funext n p i |
| 600 | change (evaluate (_ + _) p.1 _).re = (evaluate _ p.1 _).re + (evaluate _ p.1 _).re |
| 601 | rw [evaluate_add, Complex.add_re] |
| 602 | rfl |
| 603 | |
| 604 | theorem accumulatedErrorBlock_band (steps : ℕ) (g : ℕ → GaussianData (Lift S)) |
| 605 | (r : ReconstructionData) (h : ℝ) (c : Context (Lift S)) (u : ℕ → State (Lift S)) |
| 606 | (k : ℕ → ℝ) (Φ : ℕ → Lift S → ℝ) (kp : ℕ → ℤ) |
| 607 | (hj : ∀ s < steps, (g s).harmonic.natAbs ≤ 2 ^ s) : |
| 608 | HarmonicBlock.BandLimited (accumulatedErrorBlock steps g r h c u k Φ kp) (2 ^ steps) := by |
| 609 | refine ⟨fun n i => ?_, ?_⟩ |
| 610 | · exact ((accumulatedGaussianBlock_band_pow steps g k Φ kp hj).1 n i).add |
| 611 | (((accumulatedAliasBlock_band steps r h c u k Φ kp).1 n i).mono (Nat.zero_le _)) |
| 612 | · intro n j hj |
| 613 | simp [accumulatedErrorBlock] at hj |
| 614 | |
| 615 | theorem accumulatedErrorBlock_real (steps : ℕ) (g : ℕ → GaussianData (Lift S)) |
| 616 | (r : ReconstructionData) (h : ℝ) (c : Context (Lift S)) (u : ℕ → State (Lift S)) |
| 617 | (k : ℕ → ℝ) (Φ : ℕ → Lift S → ℝ) (kp : ℕ → ℤ) : |
| 618 | RealBlock (accumulatedErrorBlock steps g r h c u k Φ kp) := by |
| 619 | refine ⟨fun n i => symmetric_add |
| 620 | ((accumulatedGaussianBlock_real steps g k Φ kp).1 n i) |
| 621 | ((accumulatedAliasBlock_real steps r h c u k Φ kp).1 n i), ?_⟩ |
| 622 | intro n j x |
| 623 | simp [accumulatedErrorBlock] |
| 624 | |
| 625 | end AliasStages |
| 626 | |
| 627 | section AxisymmetricBase |
| 628 | |
| 629 | open ProblemStatement AxisymmetricFields |
| 630 | |
| 631 | /-- Cartesian location of the cylindrical point `(r,z,θ)`. -/ |
| 632 | noncomputable def polarSpace (r z θ : ℝ) : Space := |
| 633 | AxisymmetricResidual.pack (r * Real.cos θ) (r * Real.sin θ) z |
| 634 | |
| 635 | noncomputable def polarProfile (q : ProfilePoint) : ProfilePoint := |
| 636 | (q.1, (q.2.1 ^ 2 / 2, q.2.2)) |
| 637 | |
| 638 | theorem profilePoint_polarSpace (q : ProfilePoint) (θ : ℝ) : |
| 639 | profilePoint q.1 (polarSpace q.2.1 q.2.2 θ) = polarProfile q := by |
| 640 | simp only [profilePoint, polarProfile, radialEnergy, polarSpace, |
| 641 | AxisymmetricResidual.pack_zero, AxisymmetricResidual.pack_one, AxisymmetricResidual.pack_two] |
| 642 | congr 2 |
| 643 | calc |
| 644 | _ = q.2.1 ^ 2 * (Real.sin θ ^ 2 + Real.cos θ ^ 2) / 2 := by ring |
| 645 | _ = _ := by rw [Real.sin_sq_add_cos_sq, mul_one] |
| 646 | |
| 647 | /-- Components in the actual orthonormal radial/angular/axial frame. -/ |
| 648 | noncomputable def cylindricalComponents (θ : ℝ) (v : Space) : Fin 3 → ℝ := |
| 649 | ![Real.cos θ * v 0 + Real.sin θ * v 1, |
| 650 | -Real.sin θ * v 0 + Real.cos θ * v 1, v 2] |
| 651 | |
| 652 | theorem cylindricalComponents_pack (r θ A B C : ℝ) : |
| 653 | cylindricalComponents θ (AxisymmetricResidual.pack |
| 654 | (r * Real.cos θ * A + r * Real.sin θ * B) |
| 655 | (r * Real.sin θ * A - r * Real.cos θ * B) C) = ![r * A, -r * B, C] := by |
| 656 | funext i |
| 657 | fin_cases i |
| 658 | · simp [cylindricalComponents] |
| 659 | calc |
| 660 | _ = r * A * (Real.sin θ ^ 2 + Real.cos θ ^ 2) := by ring |
| 661 | _ = _ := by rw [Real.sin_sq_add_cos_sq, mul_one] |
| 662 | · simp [cylindricalComponents] |
| 663 | calc |
| 664 | _ = -r * B * (Real.sin θ ^ 2 + Real.cos θ ^ 2) := by ring |
| 665 | _ = _ := by simp only [Real.sin_sq_add_cos_sq, mul_one, neg_mul] |
| 666 | · simp [cylindricalComponents] |
| 667 | |
| 668 | theorem axisymmetricVelocity_components (B F U : Profile) (q : ProfilePoint) (θ : ℝ) : |
| 669 | cylindricalComponents θ (AxisymmetricResidual.velocity B F U |
| 670 | (q.1, polarSpace q.2.1 q.2.2 θ)) = |
| 671 | ![-q.2.1 * B (polarProfile q), q.2.1 * F (polarProfile q), U (polarProfile q)] := by |
| 672 | have he := cylindricalComponents_pack q.2.1 θ (-B (polarProfile q)) |
| 673 | (-F (polarProfile q)) (U (polarProfile q)) |
| 674 | dsimp only [AxisymmetricResidual.velocity, AxisymmetricResidual.componentX, |
| 675 | AxisymmetricResidual.componentY, AxisymmetricResidual.lift] |
| 676 | rw [profilePoint_polarSpace] |
| 677 | simp only [polarSpace, AxisymmetricResidual.pack_zero, AxisymmetricResidual.pack_one] |
| 678 | convert! he using 2 <;> ring_nf |
| 679 | |
| 680 | /-- The literal Cartesian Navier--Stokes residual, expressed in its cylindrical |
| 681 | frame. This is not an independently specified error oracle. -/ |
| 682 | noncomputable def axisymmetricBaseError (B F U P : ℕ → Profile) : Oscillation ProfilePoint := |
| 683 | fun n p => cylindricalComponents p.2 |
| 684 | (navierStokesResidual (AxisymmetricResidual.velocity (B n) (F n) (U n)) |
| 685 | (AxisymmetricResidual.pressure (P n)) p.1.1 (polarSpace p.1.2.1 p.1.2.2 p.2)) |
| 686 | |
| 687 | noncomputable def axisymmetricBaseValue (B F U P : ℕ → Profile) : MeanVector ProfilePoint := |
| 688 | fun n q => ![q.2.1 * AxisymmetricResidual.residualRadial (B n) (F n) (U n) (P n) (polarProfile q), |
| 689 | -q.2.1 * AxisymmetricResidual.residualAngular (B n) (F n) (U n) (polarProfile q), |
| 690 | AxisymmetricResidual.residualAxial (B n) (U n) (P n) (polarProfile q)] |
| 691 | |
| 692 | theorem axisymmetricBaseError_eq_value (B F U P : ℕ → Profile) (n : ℕ) |
| 693 | (q : ProfilePoint) (θ : ℝ) |
| 694 | (hB : AxisymmetricResidual.SliceC2 (B n) q.1) |
| 695 | (hF : AxisymmetricResidual.SliceC2 (F n) q.1) |
| 696 | (hU : AxisymmetricResidual.SliceC2 (U n) q.1) |
| 697 | (hP : AxisymmetricResidual.SliceDifferentiable (P n) q.1) : |
| 698 | axisymmetricBaseError B F U P n (q, θ) = axisymmetricBaseValue B F U P n q := by |
| 699 | unfold axisymmetricBaseError |
| 700 | rw [AxisymmetricResidual.navierStokesResidual_velocity hB hF hU hP |
| 701 | (polarSpace q.2.1 q.2.2 θ), profilePoint_polarSpace] |
| 702 | simp only [polarSpace, AxisymmetricResidual.pack_zero, AxisymmetricResidual.pack_one] |
| 703 | exact cylindricalComponents_pack q.2.1 θ |
| 704 | (AxisymmetricResidual.residualRadial (B n) (F n) (U n) (P n) (polarProfile q)) |
| 705 | (AxisymmetricResidual.residualAngular (B n) (F n) (U n) (polarProfile q)) |
| 706 | (AxisymmetricResidual.residualAxial (B n) (U n) (P n) (polarProfile q)) |
| 707 | |
| 708 | /-- A local-in-time identity; no smooth continuation through singular time is |
| 709 | required to place the actual base residual in the zero harmonic. -/ |
| 710 | theorem axisymmetricBaseError_angleIndependent_at (B F U P : ℕ → Profile) (n : ℕ) |
| 711 | (q : ProfilePoint) (θ : ℝ) |
| 712 | (hB : AxisymmetricResidual.SliceC2 (B n) q.1) |
| 713 | (hF : AxisymmetricResidual.SliceC2 (F n) q.1) |
| 714 | (hU : AxisymmetricResidual.SliceC2 (U n) q.1) |
| 715 | (hP : AxisymmetricResidual.SliceDifferentiable (P n) q.1) : |
| 716 | axisymmetricBaseError B F U P n (q, θ) = axisymmetricBaseError B F U P n (q, 0) := by |
| 717 | rw [axisymmetricBaseError_eq_value B F U P n q θ hB hF hU hP, |
| 718 | axisymmetricBaseError_eq_value B F U P n q 0 hB hF hU hP] |
| 719 | |
| 720 | noncomputable def axisymmetricBaseBlock (B F U P : ℕ → Profile) |
| 721 | (k : ℕ → ℝ) (Φ : ℕ → ProfilePoint → ℝ) (kp : ℕ → ℤ) : HarmonicBlock ProfilePoint := |
| 722 | zeroBlock k Φ kp (axisymmetricBaseValue B F U P) |
| 723 | |
| 724 | theorem axisymmetricBaseBlock_represents_at (B F U P : ℕ → Profile) |
| 725 | (k : ℕ → ℝ) (Φ : ℕ → ProfilePoint → ℝ) (kp : ℕ → ℤ) |
| 726 | (n : ℕ) (q : ProfilePoint) (θ : ℝ) (i : Fin 3) |
| 727 | (hB : AxisymmetricResidual.SliceC2 (B n) q.1) |
| 728 | (hF : AxisymmetricResidual.SliceC2 (F n) q.1) |
| 729 | (hU : AxisymmetricResidual.SliceC2 (U n) q.1) |
| 730 | (hP : AxisymmetricResidual.SliceDifferentiable (P n) q.1) : |
| 731 | (axisymmetricBaseBlock B F U P k Φ kp).oscillation n (q, θ) i = |
| 732 | axisymmetricBaseError B F U P n (q, θ) i := by |
| 733 | rw [axisymmetricBaseBlock, zeroBlock_evaluation, |
| 734 | axisymmetricBaseError_eq_value B F U P n q θ hB hF hU hP] |
| 735 | |
| 736 | theorem axisymmetricBaseBlock_band (B F U P : ℕ → Profile) |
| 737 | (k : ℕ → ℝ) (Φ : ℕ → ProfilePoint → ℝ) (kp : ℕ → ℤ) : |
| 738 | HarmonicBlock.BandLimited (axisymmetricBaseBlock B F U P k Φ kp) 0 := |
| 739 | zeroBlock_band k Φ kp _ |
| 740 | |
| 741 | theorem axisymmetricBaseBlock_real (B F U P : ℕ → Profile) |
| 742 | (k : ℕ → ℝ) (Φ : ℕ → ProfilePoint → ℝ) (kp : ℕ → ℤ) : |
| 743 | RealBlock (axisymmetricBaseBlock B F U P k Φ kp) := zeroBlock_real k Φ kp _ |
| 744 | |
| 745 | end AxisymmetricBase |
| 746 | |
| 747 | end NavierStokes.ErrorHarmonics |