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.PhysicalResidualBridge |
| 2 | import Mathlib.Analysis.Calculus.FDeriv.Equiv |
| 3 | |
| 4 | /-! |
| 5 | # Physical residuals in the slow-coordinate order `(T,Z)` |
| 6 | |
| 7 | `PhysicalResidualBridge` uses slow coordinates `(Z,T)`. The correction-state |
| 8 | pipeline uses `(T,Z)`. The map below swaps those two input coordinates and |
| 9 | leaves radius, fast variables, angle, and vector components unchanged. |
| 10 | -/ |
| 11 | |
| 12 | noncomputable section |
| 13 | |
| 14 | namespace NavierStokes.PhysicalResidualTZ |
| 15 | |
| 16 | open Set Filter Function HarmonicCalculus |
| 17 | open scoped Topology ContDiff |
| 18 | |
| 19 | abbrev Plane := PhysicalResidualBridge.Plane |
| 20 | abbrev Lift := PhysicalResidualBridge.Lift |
| 21 | abbrev Cylinder := PhysicalResidualBridge.Cylinder |
| 22 | |
| 23 | /-- The fixed isometric involution `(R,(Z,T),Y) ↔ (R,(T,Z),Y)`. -/ |
| 24 | noncomputable def swapSlow : Lift ≃ₗᵢ[ℝ] Lift where |
| 25 | toFun x := (x.1, ((x.2.1.2, x.2.1.1), x.2.2)) |
| 26 | invFun x := (x.1, ((x.2.1.2, x.2.1.1), x.2.2)) |
| 27 | left_inv _ := rfl |
| 28 | right_inv _ := rfl |
| 29 | map_add' _ _ := rfl |
| 30 | map_smul' _ _ := rfl |
| 31 | norm_map' x := by |
| 32 | change ‖(x.1, ((x.2.1.2, x.2.1.1), x.2.2))‖ = ‖x‖ |
| 33 | simp only [Prod.norm_def] |
| 34 | rw [max_comm ‖x.2.1.2‖ ‖x.2.1.1‖] |
| 35 | |
| 36 | @[simp] theorem swapSlow_apply (x : Lift) : |
| 37 | swapSlow x = (x.1, ((x.2.1.2, x.2.1.1), x.2.2)) := rfl |
| 38 | |
| 39 | @[simp] theorem swapSlow_symm_apply (x : Lift) : swapSlow.symm x = swapSlow x := rfl |
| 40 | |
| 41 | @[simp] theorem swapSlow_swapSlow (x : Lift) : swapSlow (swapSlow x) = x := rfl |
| 42 | |
| 43 | /-- Extension to the actual angular cylinder; the angle is not permuted. -/ |
| 44 | noncomputable def swapCylinder : Cylinder ≃ₗᵢ[ℝ] Cylinder where |
| 45 | toLinearEquiv := swapSlow.toLinearEquiv.prodCongr (LinearEquiv.refl ℝ ℝ) |
| 46 | norm_map' x := by |
| 47 | change max ‖swapSlow x.1‖ ‖x.2‖ = max ‖x.1‖ ‖x.2‖ |
| 48 | rw [swapSlow.norm_map] |
| 49 | |
| 50 | @[simp] theorem swapCylinder_apply (x : Cylinder) : |
| 51 | swapCylinder x = (swapSlow x.1, x.2) := rfl |
| 52 | |
| 53 | @[simp] theorem swapCylinder_symm_apply (x : Cylinder) : |
| 54 | swapCylinder.symm x = swapCylinder x := rfl |
| 55 | |
| 56 | @[simp] theorem swapCylinder_swapCylinder (x : Cylinder) : |
| 57 | swapCylinder (swapCylinder x) = x := rfl |
| 58 | |
| 59 | /-- This is exactly the continuous linear map used for `swapSlow` in the |
| 60 | variable-gauge module, expressed using only frozen dependencies. -/ |
| 61 | theorem swapSlow_toContinuousLinearMap : |
| 62 | swapSlow.toContinuousLinearEquiv.toContinuousLinearMap = |
| 63 | (ContinuousLinearMap.id ℝ ℝ).prodMap |
| 64 | ((ContinuousLinearEquiv.prodComm ℝ ℝ ℝ).toContinuousLinearMap.prodMap |
| 65 | (ContinuousLinearMap.id ℝ Plane)) := by |
| 66 | rfl |
| 67 | |
| 68 | section Calculus |
| 69 | |
| 70 | variable {E F : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 71 | [NormedAddCommGroup F] [NormedSpace ℝ F] |
| 72 | |
| 73 | /-- Pullback of a vector field under a fixed linear change of coordinates. -/ |
| 74 | noncomputable def reindexVector (e : E ≃L[ℝ] E) (V : E → E) (x : E) : E := |
| 75 | e.symm (V (e x)) |
| 76 | |
| 77 | /-- The chain rule is valid even for the total derivative convention at a |
| 78 | nondifferentiable point, because the coordinate change is an equivalence. -/ |
| 79 | theorem fderiv_reindex (e : E ≃L[ℝ] E) (f : E → F) (x v : E) : |
| 80 | fderiv ℝ (fun y => f (e y)) x v = fderiv ℝ f (e x) (e v) := by |
| 81 | change fderiv ℝ (f ∘ e) x v = _ |
| 82 | rw [e.comp_right_fderiv] |
| 83 | rfl |
| 84 | |
| 85 | theorem along_reindex (e : E ≃L[ℝ] E) (V : E → E) (f : E → F) : |
| 86 | along (reindexVector e V) (fun x => f (e x)) = fun x => along V f (e x) := by |
| 87 | funext x |
| 88 | unfold along reindexVector |
| 89 | rw [fderiv_reindex, e.apply_symm_apply] |
| 90 | |
| 91 | theorem along_reindex_component {ι : Type*} (e : E ≃L[ℝ] E) (V : E → E) |
| 92 | (f : E → ι → F) (i : ι) : |
| 93 | along (reindexVector e V) (fun x => f (e x) i) = |
| 94 | fun x => along V (fun y => f y i) (e x) := |
| 95 | along_reindex e V (fun y => f y i) |
| 96 | |
| 97 | theorem cylindricalLaplacian_reindex (e : E ≃L[ℝ] E) (R : E → ℝ) |
| 98 | (Vr Vθ Vz : E → E) (f : E → F) (x : E) : |
| 99 | cylindricalLaplacian (fun y => R (e y)) (reindexVector e Vr) |
| 100 | (reindexVector e Vθ) (reindexVector e Vz) (fun y => f (e y)) x = |
| 101 | cylindricalLaplacian R Vr Vθ Vz f (e x) := by |
| 102 | simp only [cylindricalLaplacian, along_reindex] |
| 103 | |
| 104 | theorem cylindricalLaplacian_reindex_component {ι : Type*} |
| 105 | (e : E ≃L[ℝ] E) (R : E → ℝ) (Vr Vθ Vz : E → E) |
| 106 | (f : E → ι → F) (i : ι) (x : E) : |
| 107 | cylindricalLaplacian (fun y => R (e y)) (reindexVector e Vr) |
| 108 | (reindexVector e Vθ) (reindexVector e Vz) (fun y => f (e y) i) x = |
| 109 | cylindricalLaplacian R Vr Vθ Vz (fun y => f y i) (e x) := |
| 110 | cylindricalLaplacian_reindex e R Vr Vθ Vz (fun y => f y i) x |
| 111 | |
| 112 | theorem transport_reindex (e : E ≃L[ℝ] E) (R : E → ℝ) |
| 113 | (Vr Vθ Vz : E → E) (u v : E → ComplexVector) (x : E) : |
| 114 | LinearWaveResidual.transport (fun y => R (e y)) (reindexVector e Vr) |
| 115 | (reindexVector e Vθ) (reindexVector e Vz) |
| 116 | (fun y => u (e y)) (fun y => v (e y)) x = |
| 117 | LinearWaveResidual.transport R Vr Vθ Vz u v (e x) := by |
| 118 | funext i |
| 119 | simp only [LinearWaveResidual.transport, along_reindex_component] |
| 120 | |
| 121 | theorem cylindricalVectorLaplacian_reindex (e : E ≃L[ℝ] E) (R : E → ℝ) |
| 122 | (Vr Vθ Vz : E → E) (a : E → ComplexVector) (x : E) : |
| 123 | cylindricalVectorLaplacian (fun y => R (e y)) (reindexVector e Vr) |
| 124 | (reindexVector e Vθ) (reindexVector e Vz) (fun y => a (e y)) x = |
| 125 | cylindricalVectorLaplacian R Vr Vθ Vz a (e x) := by |
| 126 | funext i |
| 127 | simp only [cylindricalVectorLaplacian, cylindricalLaplacian_reindex_component, along_reindex_component] |
| 128 | |
| 129 | theorem linearResidual_reindex (e : E ≃L[ℝ] E) (epsilon : ℝ) (R : E → ℝ) |
| 130 | (Vr Vθ Vz Vt : E → E) (B a : E → ComplexVector) (p : E → ℂ) (x : E) : |
| 131 | LinearWaveResidual.linearResidual epsilon (fun y => R (e y)) |
| 132 | (reindexVector e Vr) (reindexVector e Vθ) (reindexVector e Vz) (reindexVector e Vt) |
| 133 | (fun y => B (e y)) (fun y => a (e y)) (fun y => p (e y)) x = |
| 134 | LinearWaveResidual.linearResidual epsilon R Vr Vθ Vz Vt B a p (e x) := by |
| 135 | funext i |
| 136 | simp only [LinearWaveResidual.linearResidual, LinearWaveResidual.gradient, |
| 137 | transport_reindex, cylindricalVectorLaplacian_reindex, along_reindex, along_reindex_component] |
| 138 | |
| 139 | theorem realTransport_reindex (e : E ≃L[ℝ] E) (R : E → ℝ) |
| 140 | (Vr Vθ Vz : E → E) (u v : E → Fin 3 → ℝ) (x : E) : |
| 141 | LinearWaveResidual.realTransport (fun y => R (e y)) (reindexVector e Vr) |
| 142 | (reindexVector e Vθ) (reindexVector e Vz) |
| 143 | (fun y => u (e y)) (fun y => v (e y)) x = |
| 144 | LinearWaveResidual.realTransport R Vr Vθ Vz u v (e x) := by |
| 145 | funext i |
| 146 | simp only [LinearWaveResidual.realTransport, along_reindex_component] |
| 147 | |
| 148 | theorem realFrameLaplacian_reindex (e : E ≃L[ℝ] E) (R : E → ℝ) |
| 149 | (Vr Vθ Vz : E → E) (a : E → Fin 3 → ℝ) (x : E) : |
| 150 | LinearWaveResidual.realFrameLaplacian (fun y => R (e y)) (reindexVector e Vr) |
| 151 | (reindexVector e Vθ) (reindexVector e Vz) (fun y => a (e y)) x = |
| 152 | LinearWaveResidual.realFrameLaplacian R Vr Vθ Vz a (e x) := by |
| 153 | funext i |
| 154 | simp only [LinearWaveResidual.realFrameLaplacian, cylindricalLaplacian_reindex_component, |
| 155 | along_reindex_component] |
| 156 | |
| 157 | theorem graphResidual_reindex (e : E ≃L[ℝ] E) (epsilon : ℝ) (R : E → ℝ) |
| 158 | (Vr Vθ Vz Vt : E → E) (a : E → Fin 3 → ℝ) (p : E → ℝ) (x : E) : |
| 159 | PhysicalResidualBridge.graphResidual epsilon (fun y => R (e y)) |
| 160 | (reindexVector e Vr) (reindexVector e Vθ) (reindexVector e Vz) (reindexVector e Vt) |
| 161 | (fun y => a (e y)) (fun y => p (e y)) x = |
| 162 | PhysicalResidualBridge.graphResidual epsilon R Vr Vθ Vz Vt a p (e x) := by |
| 163 | funext i |
| 164 | simp only [PhysicalResidualBridge.graphResidual, realTransport_reindex, |
| 165 | realFrameLaplacian_reindex, along_reindex, along_reindex_component] |
| 166 | |
| 167 | end Calculus |
| 168 | |
| 169 | noncomputable def swapField (f : MeanIncrementBounds.Field Lift) : MeanIncrementBounds.Field Lift := |
| 170 | fun n x => f n (swapSlow x) |
| 171 | |
| 172 | noncomputable def swapTriple (m : MeanIncrementBounds.Triple Lift) : MeanIncrementBounds.Triple Lift := |
| 173 | ⟨swapField m.radial, swapField m.angular, swapField m.axial⟩ |
| 174 | |
| 175 | noncomputable def swapOperators (o : MeanIncrementBounds.Operators Lift) : |
| 176 | MeanIncrementBounds.Operators Lift where |
| 177 | epsilon := o.epsilon |
| 178 | radialFrequency := o.radialFrequency |
| 179 | fastCoefficient := o.fastCoefficient |
| 180 | radius := fun x => o.radius (swapSlow x) |
| 181 | radialProfile := fun x => o.radialProfile (swapSlow x) |
| 182 | eR := swapSlow o.eR |
| 183 | eZ := swapSlow o.eZ |
| 184 | eT := swapSlow o.eT |
| 185 | vR := swapSlow o.vR |
| 186 | vT := swapSlow o.vT |
| 187 | |
| 188 | noncomputable def swapContext (c : CorrectionState.Context Lift) : CorrectionState.Context Lift where |
| 189 | operators := swapOperators c.operators |
| 190 | base := swapTriple c.base |
| 191 | virtualTheta := swapField c.virtualTheta |
| 192 | virtualAxial := swapField c.virtualAxial |
| 193 | |
| 194 | noncomputable def swapOscillation (f : CorrectionState.Oscillation Lift) : |
| 195 | CorrectionState.Oscillation Lift := fun n x => f n (swapCylinder x) |
| 196 | |
| 197 | noncomputable def swapErrors (e : CorrectionState.ExcludedErrors Lift) : |
| 198 | CorrectionState.ExcludedErrors Lift where |
| 199 | base := swapOscillation e.base |
| 200 | gaussian := swapOscillation e.gaussian |
| 201 | aliasError := swapOscillation e.aliasError |
| 202 | |
| 203 | noncomputable def swapState (s : CorrectionState.State Lift) : CorrectionState.State Lift where |
| 204 | mean := swapTriple s.mean |
| 205 | pressure := swapField s.pressure |
| 206 | oscillation := swapOscillation s.oscillation |
| 207 | oscillatoryPressure := fun n x => s.oscillatoryPressure n (swapCylinder x) |
| 208 | errors := swapErrors s.errors |
| 209 | |
| 210 | theorem fderiv_swapField (f : MeanIncrementBounds.Field Lift) (n : ℕ) (x v : Lift) : |
| 211 | fderiv ℝ (swapField f n) x (swapSlow v) = fderiv ℝ (f n) (swapSlow x) v := by |
| 212 | change fderiv ℝ (fun y => f n (swapSlow.toContinuousLinearEquiv y)) x (swapSlow v) = _ |
| 213 | rw [fderiv_reindex] |
| 214 | rfl |
| 215 | |
| 216 | theorem dr_swap (o : MeanIncrementBounds.Operators Lift) (f : MeanIncrementBounds.Field Lift) : |
| 217 | (swapOperators o).dr (swapField f) = swapField (o.dr f) := by |
| 218 | funext n x |
| 219 | simp only [MeanIncrementBounds.Operators.dr, WeightedClasses.graphDerivative, |
| 220 | swapOperators, fderiv_swapField, swapField] |
| 221 | |
| 222 | theorem dz_swap (o : MeanIncrementBounds.Operators Lift) (f : MeanIncrementBounds.Field Lift) : |
| 223 | (swapOperators o).dz (swapField f) = swapField (o.dz f) := by |
| 224 | funext n x |
| 225 | simp only [MeanIncrementBounds.Operators.dz, swapOperators, fderiv_swapField, swapField] |
| 226 | |
| 227 | theorem time_swap (o : MeanIncrementBounds.Operators Lift) (f : MeanIncrementBounds.Field Lift) : |
| 228 | (swapOperators o).time (swapField f) = swapField (o.time f) := by |
| 229 | funext n x |
| 230 | simp only [MeanIncrementBounds.Operators.time, MeanIncrementBounds.Operators.slowTime, |
| 231 | MeanIncrementBounds.Operators.fastTime, swapOperators, fderiv_swapField, swapField, |
| 232 | Pi.add_apply] |
| 233 | |
| 234 | theorem radialDiv_swap (o : MeanIncrementBounds.Operators Lift) |
| 235 | (k : ℝ) (f : MeanIncrementBounds.Field Lift) : |
| 236 | (swapOperators o).radialDiv k (swapField f) = swapField (o.radialDiv k f) := by |
| 237 | unfold MeanIncrementBounds.Operators.radialDiv |
| 238 | rw [dr_swap] |
| 239 | rfl |
| 240 | |
| 241 | theorem radialDirection_swap (c : CorrectionState.Context Lift) (n : ℕ) : |
| 242 | LiftedMeanResidual.radialDirection (swapContext c) n = |
| 243 | reindexVector swapCylinder.toContinuousLinearEquiv |
| 244 | (LiftedMeanResidual.radialDirection c n) := by |
| 245 | rfl |
| 246 | |
| 247 | theorem axialDirection_swap (c : CorrectionState.Context Lift) (n : ℕ) : |
| 248 | LiftedMeanResidual.axialDirection (swapContext c) n = |
| 249 | reindexVector swapCylinder.toContinuousLinearEquiv |
| 250 | (LiftedMeanResidual.axialDirection c n) := by |
| 251 | rfl |
| 252 | |
| 253 | theorem timeDirection_swap (c : CorrectionState.Context Lift) (n : ℕ) : |
| 254 | LiftedMeanResidual.timeDirection (swapContext c) n = |
| 255 | reindexVector swapCylinder.toContinuousLinearEquiv |
| 256 | (LiftedMeanResidual.timeDirection c n) := by |
| 257 | rfl |
| 258 | |
| 259 | theorem angularDirection_swap : |
| 260 | reindexVector swapCylinder.toContinuousLinearEquiv |
| 261 | (LiftedMeanResidual.angularDirection (D := Lift)) = LiftedMeanResidual.angularDirection := rfl |
| 262 | |
| 263 | theorem complexBase_swap (c : CorrectionState.Context Lift) (n : ℕ) : |
| 264 | LiftedMeanResidual.complexBase (swapContext c) n = |
| 265 | fun x => LiftedMeanResidual.complexBase c n (swapCylinder x) := rfl |
| 266 | |
| 267 | theorem complexPerturbation_swap (s : CorrectionState.State Lift) (n : ℕ) : |
| 268 | LiftedMeanResidual.complexPerturbation (swapState s) n = |
| 269 | fun x => LiftedMeanResidual.complexPerturbation s n (swapCylinder x) := rfl |
| 270 | |
| 271 | theorem complexPressure_swap (s : CorrectionState.State Lift) (n : ℕ) : |
| 272 | LiftedMeanResidual.complexPressure (swapState s) n = |
| 273 | fun x => LiftedMeanResidual.complexPressure s n (swapCylinder x) := rfl |
| 274 | |
| 275 | theorem virtualDivergence_swap (c : CorrectionState.Context Lift) (n : ℕ) (x : Cylinder) : |
| 276 | LiftedMeanResidual.virtualDivergence (swapContext c) n x = |
| 277 | LiftedMeanResidual.virtualDivergence c n (swapCylinder x) := by |
| 278 | change ![0, -((swapOperators c.operators).radialDiv 2 (swapField c.virtualTheta) n x.1), |
| 279 | -((swapOperators c.operators).radialDiv 1 (swapField c.virtualAxial) n x.1)] = _ |
| 280 | rw [radialDiv_swap, radialDiv_swap] |
| 281 | rfl |
| 282 | |
| 283 | /-- Exact covariance of the full nonlinear correction residual. It includes |
| 284 | the fixed base error once, exactly as in the original state definition. -/ |
| 285 | theorem fullResidual_swap (c : CorrectionState.Context Lift) (s : CorrectionState.State Lift) |
| 286 | (n : ℕ) (x : Cylinder) (i : Fin 3) : |
| 287 | LiftedMeanResidual.fullResidual (swapContext c) (swapState s) n x i = |
| 288 | LiftedMeanResidual.fullResidual c s n (swapCylinder x) i := by |
| 289 | have hlin := linearResidual_reindex swapCylinder.toContinuousLinearEquiv |
| 290 | (c.operators.epsilon n) (fun y : Cylinder => c.operators.radius y.1) |
| 291 | (LiftedMeanResidual.radialDirection c n) LiftedMeanResidual.angularDirection |
| 292 | (LiftedMeanResidual.axialDirection c n) (LiftedMeanResidual.timeDirection c n) |
| 293 | (LiftedMeanResidual.complexBase c n) (LiftedMeanResidual.complexPerturbation s n) |
| 294 | (LiftedMeanResidual.complexPressure s n) x |
| 295 | have hquad := transport_reindex swapCylinder.toContinuousLinearEquiv |
| 296 | (fun y : Cylinder => c.operators.radius y.1) |
| 297 | (LiftedMeanResidual.radialDirection c n) LiftedMeanResidual.angularDirection |
| 298 | (LiftedMeanResidual.axialDirection c n) |
| 299 | (LiftedMeanResidual.complexPerturbation s n) (LiftedMeanResidual.complexPerturbation s n) x |
| 300 | rw [angularDirection_swap] at hlin hquad |
| 301 | unfold LiftedMeanResidual.fullResidual LiftedMeanResidual.nonlinearResidual |
| 302 | rw [radialDirection_swap, axialDirection_swap, timeDirection_swap, |
| 303 | complexBase_swap, complexPerturbation_swap, complexPressure_swap] |
| 304 | rw [show (swapContext c).operators.epsilon = c.operators.epsilon from rfl, |
| 305 | show (fun y : Cylinder => (swapContext c).operators.radius y.1) = |
| 306 | (fun y : Cylinder => c.operators.radius (swapCylinder.toContinuousLinearEquiv y).1) from rfl] |
| 307 | have hcoe : (swapCylinder.toContinuousLinearEquiv : Cylinder → Cylinder) = swapCylinder := rfl |
| 308 | simp only [hcoe] at hlin hquad ⊢ |
| 309 | rw [hlin, hquad, virtualDivergence_swap] |
| 310 | rfl |
| 311 | |
| 312 | theorem fullGoodResidual_swap (c : CorrectionState.Context Lift) (s : CorrectionState.State Lift) |
| 313 | (n : ℕ) (x : Cylinder) (i : Fin 3) : |
| 314 | LiftedMeanResidual.fullGoodResidual (swapContext c) (swapState s) n x i = |
| 315 | LiftedMeanResidual.fullGoodResidual c s n (swapCylinder x) i := by |
| 316 | change LiftedMeanResidual.fullResidual (swapContext c) (swapState s) n x i - _ = _ |
| 317 | rw [fullResidual_swap] |
| 318 | rfl |
| 319 | |
| 320 | /-- Literal operator data in the order `(T,Z)`. No derivative identity is |
| 321 | assumed: all derivative transport is supplied by the preceding theorems. -/ |
| 322 | structure MatchesAtTZ (o : MeanIncrementBounds.Operators Lift) |
| 323 | (G : PhysicalResidualBridge.ScaledGraph) (n : ℕ) : Prop where |
| 324 | epsilon : o.epsilon n = G.epsilon |
| 325 | frequency : o.radialFrequency n = G.frequency |
| 326 | fast : o.fastCoefficient n = G.fastCoefficient |
| 327 | radius : o.radius = Prod.fst |
| 328 | profile : o.radialProfile = fun x => GraphCalculus.radialSpeed G.exponent x.1 |
| 329 | eR : o.eR = (1, (0, 0)) |
| 330 | eZ : o.eZ = (0, ((0, 1), 0)) |
| 331 | eT : o.eT = (0, ((1, 0), 0)) |
| 332 | vR : o.vR = (0, (0, G.radialVector)) |
| 333 | vT : o.vT = (0, (0, G.temporalVector)) |
| 334 | |
| 335 | theorem MatchesAtTZ.toMatchesAt {o : MeanIncrementBounds.Operators Lift} |
| 336 | {G : PhysicalResidualBridge.ScaledGraph} {n : ℕ} (H : MatchesAtTZ o G n) : |
| 337 | PhysicalResidualBridge.MatchesAt (swapOperators o) G n := by |
| 338 | constructor |
| 339 | · exact H.epsilon |
| 340 | · exact H.frequency |
| 341 | · exact H.fast |
| 342 | · change (fun x => o.radius (swapSlow x)) = Prod.fst |
| 343 | rw [H.radius] |
| 344 | rfl |
| 345 | · change (fun x => o.radialProfile (swapSlow x)) = _ |
| 346 | rw [H.profile] |
| 347 | rfl |
| 348 | · change swapSlow o.eR = _ |
| 349 | rw [H.eR] |
| 350 | rfl |
| 351 | · change swapSlow o.eZ = _ |
| 352 | rw [H.eZ] |
| 353 | rfl |
| 354 | · change swapSlow o.eT = _ |
| 355 | rw [H.eT] |
| 356 | rfl |
| 357 | · change swapSlow o.vR = _ |
| 358 | rw [H.vR] |
| 359 | rfl |
| 360 | · change swapSlow o.vT = _ |
| 361 | rw [H.vT] |
| 362 | rfl |
| 363 | |
| 364 | theorem matchesAtTZ_graphOperators (r : CorrectionState.ReconstructionData) |
| 365 | (epsilon fast : ℕ → ℝ) (G : PhysicalResidualBridge.ScaledGraph) (n : ℕ) |
| 366 | (hε : epsilon n = G.epsilon) (hM : r.frequency n = G.frequency) |
| 367 | (hc : fast n = G.fastCoefficient) (hd : r.exponent = G.exponent) |
| 368 | (hv : r.radialDirection = G.radialVector) : |
| 369 | MatchesAtTZ (CorrectionState.graphOperators r epsilon fast |
| 370 | (((0, 1) : Plane), (0 : Plane)) (((1, 0) : Plane), (0 : Plane)) G.temporalVector) G n := by |
| 371 | constructor |
| 372 | · exact hε |
| 373 | · exact hM |
| 374 | · exact hc |
| 375 | · rfl |
| 376 | · simp only [CorrectionState.graphOperators, hd, RadialPullback.radialJacobian, |
| 377 | GraphCalculus.radialSpeed] |
| 378 | · rfl |
| 379 | · rfl |
| 380 | · rfl |
| 381 | · simp only [CorrectionState.graphOperators, hv] |
| 382 | · rfl |
| 383 | |
| 384 | /-- The actual scaled physical graph, with the slow coordinates in `(T,Z)` order. -/ |
| 385 | noncomputable def graphMapTZ (G : PhysicalResidualBridge.ScaledGraph) |
| 386 | (p : ProblemStatement.SpaceTime) : Cylinder := swapCylinder (G.map p) |
| 387 | |
| 388 | noncomputable def graphSourceTZ (G : PhysicalResidualBridge.ScaledGraph) (U : Set Cylinder) : |
| 389 | Set ProblemStatement.SpaceTime := {p | 0 < p.2 0 ∧ graphMapTZ G p ∈ U} |
| 390 | |
| 391 | noncomputable def graphRadialTZ (G : PhysicalResidualBridge.ScaledGraph) : Cylinder → Cylinder := |
| 392 | reindexVector swapCylinder.toContinuousLinearEquiv G.radial |
| 393 | |
| 394 | noncomputable def graphAngularTZ : Cylinder → Cylinder := |
| 395 | reindexVector swapCylinder.toContinuousLinearEquiv PhysicalResidualBridge.ScaledGraph.angular |
| 396 | |
| 397 | noncomputable def graphAxialTZ (G : PhysicalResidualBridge.ScaledGraph) : Cylinder → Cylinder := |
| 398 | reindexVector swapCylinder.toContinuousLinearEquiv G.axial |
| 399 | |
| 400 | noncomputable def graphTemporalTZ (G : PhysicalResidualBridge.ScaledGraph) : Cylinder → Cylinder := |
| 401 | reindexVector swapCylinder.toContinuousLinearEquiv G.temporal |
| 402 | |
| 403 | theorem graphAxialTZ_apply (G : PhysicalResidualBridge.ScaledGraph) (x : Cylinder) : |
| 404 | graphAxialTZ G x = ((0, ((0, G.epsilon), 0)), 0) := rfl |
| 405 | |
| 406 | theorem graphTemporalTZ_apply (G : PhysicalResidualBridge.ScaledGraph) (x : Cylinder) : |
| 407 | graphTemporalTZ G x = ((0, ((-G.epsilon, 0), G.fastCoefficient • G.temporalVector)), 0) := rfl |
| 408 | |
| 409 | theorem graphRadialTZ_eq (G : PhysicalResidualBridge.ScaledGraph) : graphRadialTZ G = G.radial := rfl |
| 410 | |
| 411 | theorem graphAngularTZ_eq : graphAngularTZ = PhysicalResidualBridge.ScaledGraph.angular := rfl |
| 412 | |
| 413 | noncomputable def velocityTZ (G : PhysicalResidualBridge.ScaledGraph) |
| 414 | (a : Cylinder → Fin 3 → ℝ) : ProblemStatement.VelocityField := |
| 415 | G.velocity (fun x => a (swapCylinder x)) |
| 416 | |
| 417 | noncomputable def pressureTZ (G : PhysicalResidualBridge.ScaledGraph) |
| 418 | (p : Cylinder → ℝ) : ProblemStatement.PressureField := |
| 419 | G.pressure (fun x => p (swapCylinder x)) |
| 420 | |
| 421 | /-- Exact covariance of the complete real graph equation in the two layouts. -/ |
| 422 | theorem graphResidual_swap (G : PhysicalResidualBridge.ScaledGraph) |
| 423 | (a : Cylinder → Fin 3 → ℝ) (p : Cylinder → ℝ) (x : Cylinder) : |
| 424 | PhysicalResidualBridge.graphResidual G.epsilon PhysicalResidualBridge.ScaledGraph.radius |
| 425 | G.radial PhysicalResidualBridge.ScaledGraph.angular G.axial G.temporal |
| 426 | (fun y => a (swapCylinder y)) (fun y => p (swapCylinder y)) x = |
| 427 | PhysicalResidualBridge.graphResidual G.epsilon PhysicalResidualBridge.ScaledGraph.radius |
| 428 | (graphRadialTZ G) graphAngularTZ (graphAxialTZ G) (graphTemporalTZ G) |
| 429 | a p (swapCylinder x) := by |
| 430 | exact (graphResidual_reindex swapCylinder.toContinuousLinearEquiv G.epsilon |
| 431 | PhysicalResidualBridge.ScaledGraph.radius G.radial PhysicalResidualBridge.ScaledGraph.angular |
| 432 | G.axial G.temporal (fun y => a (swapCylinder y)) (fun y => p (swapCylinder y)) |
| 433 | (swapCylinder x)).symm |
| 434 | |
| 435 | /-- The same fixed linear chart map used by the variable-gauge mean, in `(T,Z)` order. -/ |
| 436 | noncomputable def physicalToChartTZ (h : ℝ) (n k : ℕ) : Lift →L[ℝ] Lift := |
| 437 | swapSlow.toContinuousLinearEquiv.toContinuousLinearMap.comp |
| 438 | ((MeanChartCompatibility.physicalToChart h n k).comp |
| 439 | swapSlow.toContinuousLinearEquiv.toContinuousLinearMap) |
| 440 | |
| 441 | theorem physicalToChartTZ_swap (h : ℝ) (n k : ℕ) (x : Lift) : |
| 442 | physicalToChartTZ h n k (swapSlow x) = |
| 443 | swapSlow (MeanChartCompatibility.physicalToChart h n k x) := rfl |
| 444 | |
| 445 | theorem physicalToChartTZ_eq_formula (h : ℝ) (n k : ℕ) : |
| 446 | physicalToChartTZ h n k = |
| 447 | MeanChartCompatibility.chartLinear (MeanChartCompatibility.chartScale n) |
| 448 | (((ChartScales.Q n ^ (-1 : ℝ) • ContinuousLinearMap.fst ℝ ℝ ℝ).prod |
| 449 | (ChartScales.Q n ^ (-CoordinateAlgebra.D h) • ContinuousLinearMap.snd ℝ ℝ ℝ)).prodMap |
| 450 | (TemporalMeanUpdate.coverMap k)) := rfl |
| 451 | |
| 452 | noncomputable def absoluteLiftTZ (h : ℝ) (p : ProblemStatement.SpaceTime) : Lift := |
| 453 | swapSlow (PhysicalResidualBridge.absoluteLift h p) |
| 454 | |
| 455 | theorem commonGraph_eq_physicalToChartTZ (h : ℝ) (n k : ℕ) {p : ProblemStatement.SpaceTime} |
| 456 | (hr : 0 < p.2 0) : |
| 457 | graphMapTZ (PhysicalResidualBridge.commonGraph (ChartScales.Q n) h k) p = |
| 458 | (physicalToChartTZ h n k (absoluteLiftTZ h p), p.2 1) := by |
| 459 | unfold graphMapTZ |
| 460 | rw [PhysicalResidualBridge.commonGraph_eq_physicalToChart h n k hr] |
| 461 | rfl |
| 462 | |
| 463 | /-- The full correction-state residual in `(T,Z)` coordinates is the actual |
| 464 | scaled Cartesian Navier--Stokes residual. The fixed base-pressure equation |
| 465 | and the neighborhood representation of the actual physical fields remain explicit. -/ |
| 466 | theorem context_fullResidual_physicalTZ {Q : ℝ} (hQ : 0 < Q) (h : ℝ) (k n : ℕ) |
| 467 | (c : CorrectionState.Context Lift) (s : CorrectionState.State Lift) |
| 468 | (H : MatchesAtTZ c.operators (PhysicalResidualBridge.commonGraph Q h k) n) |
| 469 | {U : Set Cylinder} (hU : IsOpen U) (hR : ∀ x ∈ U, x.1.1 ≠ 0) |
| 470 | {p₀ : Cylinder → ℝ} |
| 471 | (hB : ∀ i, ContDiffOn ℝ ∞ (fun x => PhysicalResidualBridge.baseComponents c n x i) U) |
| 472 | (ha : ∀ i, ContDiffOn ℝ ∞ (fun x => PhysicalResidualBridge.incrementComponents s n x i) U) |
| 473 | (hp₀ : ContDiffOn ℝ ∞ p₀ U) (hp : ContDiffOn ℝ ∞ (s.totalPressureIncrement n) U) |
| 474 | {t : ℝ} {q : ProblemStatement.Space} |
| 475 | (hz : (t, q) ∈ graphSourceTZ (PhysicalResidualBridge.commonGraph Q h k) U) |
| 476 | (hbase : ∀ i, PhysicalResidualBridge.graphResidual (Q ^ h) |
| 477 | PhysicalResidualBridge.ScaledGraph.radius |
| 478 | (graphRadialTZ (PhysicalResidualBridge.commonGraph Q h k)) graphAngularTZ |
| 479 | (graphAxialTZ (PhysicalResidualBridge.commonGraph Q h k)) |
| 480 | (graphTemporalTZ (PhysicalResidualBridge.commonGraph Q h k)) |
| 481 | (PhysicalResidualBridge.baseComponents c n) p₀ |
| 482 | (graphMapTZ (PhysicalResidualBridge.commonGraph Q h k) (t, q)) i = |
| 483 | LiftedMeanResidual.virtualDivergence c n |
| 484 | (graphMapTZ (PhysicalResidualBridge.commonGraph Q h k) (t, q)) i + |
| 485 | s.errors.base n (graphMapTZ (PhysicalResidualBridge.commonGraph Q h k) (t, q)) i) |
| 486 | {u : ProblemStatement.VelocityField} {P : ProblemStatement.PressureField} |
| 487 | (hu : ContDiffAt ℝ 2 u (t, CylindricalResidual.chart q)) |
| 488 | (hP : DifferentiableAt ℝ P (t, CylindricalResidual.chart q)) |
| 489 | (hrep : (fun z : ProblemStatement.SpaceTime => u (z.1, CylindricalResidual.chart z.2)) =ᶠ[𝓝 (t, q)] |
| 490 | (fun z => CylindricalResidual.frame (z.2 1) |
| 491 | (velocityTZ (PhysicalResidualBridge.commonGraph Q h k) |
| 492 | (fun y j => PhysicalResidualBridge.baseComponents c n y j + |
| 493 | PhysicalResidualBridge.incrementComponents s n y j) z))) |
| 494 | (hpRep : CylindricalResidual.pressurePullback P =ᶠ[𝓝 (t, q)] |
| 495 | pressureTZ (PhysicalResidualBridge.commonGraph Q h k) |
| 496 | (fun y => p₀ y + s.totalPressureIncrement n y)) (i : Fin 3) : |
| 497 | LiftedMeanResidual.fullResidual c s n |
| 498 | (graphMapTZ (PhysicalResidualBridge.commonGraph Q h k) (t, q)) i = |
| 499 | Q ^ (2 * CoordinateAlgebra.A h + 1 / 2) * |
| 500 | CylindricalResidual.frame (-(q 1)) |
| 501 | (ProblemStatement.navierStokesResidual u P t (CylindricalResidual.chart q)) i := by |
| 502 | let V : Set Cylinder := swapCylinder ⁻¹' U |
| 503 | have hV : IsOpen V := hU.preimage swapCylinder.continuous |
| 504 | have hRV : ∀ x ∈ V, x.1.1 ≠ 0 := fun x hx => hR (swapCylinder x) hx |
| 505 | have hBV (j : Fin 3) : ContDiffOn ℝ ∞ |
| 506 | (fun x => PhysicalResidualBridge.baseComponents (swapContext c) n x j) V := |
| 507 | (hB j).comp swapCylinder.contDiff.contDiffOn (fun _ hx => hx) |
| 508 | have haV (j : Fin 3) : ContDiffOn ℝ ∞ |
| 509 | (fun x => PhysicalResidualBridge.incrementComponents (swapState s) n x j) V := |
| 510 | (ha j).comp swapCylinder.contDiff.contDiffOn (fun _ hx => hx) |
| 511 | have hpV : ContDiffOn ℝ ∞ ((swapState s).totalPressureIncrement n) V := |
| 512 | hp.comp swapCylinder.contDiff.contDiffOn (fun _ hx => hx) |
| 513 | have hp₀V : ContDiffOn ℝ ∞ (fun x => p₀ (swapCylinder x)) V := |
| 514 | hp₀.comp swapCylinder.contDiff.contDiffOn (fun _ hx => hx) |
| 515 | have hbaseV : ∀ j, PhysicalResidualBridge.graphResidual (Q ^ h) |
| 516 | PhysicalResidualBridge.ScaledGraph.radius |
| 517 | (PhysicalResidualBridge.commonGraph Q h k).radial PhysicalResidualBridge.ScaledGraph.angular |
| 518 | (PhysicalResidualBridge.commonGraph Q h k).axial (PhysicalResidualBridge.commonGraph Q h k).temporal |
| 519 | (PhysicalResidualBridge.baseComponents (swapContext c) n) |
| 520 | (fun x => p₀ (swapCylinder x)) ((PhysicalResidualBridge.commonGraph Q h k).map (t, q)) j = |
| 521 | LiftedMeanResidual.virtualDivergence (swapContext c) n |
| 522 | ((PhysicalResidualBridge.commonGraph Q h k).map (t, q)) j + |
| 523 | (swapState s).errors.base n ((PhysicalResidualBridge.commonGraph Q h k).map (t, q)) j := by |
| 524 | intro j |
| 525 | change PhysicalResidualBridge.graphResidual (PhysicalResidualBridge.commonGraph Q h k).epsilon |
| 526 | PhysicalResidualBridge.ScaledGraph.radius |
| 527 | (PhysicalResidualBridge.commonGraph Q h k).radial PhysicalResidualBridge.ScaledGraph.angular |
| 528 | (PhysicalResidualBridge.commonGraph Q h k).axial (PhysicalResidualBridge.commonGraph Q h k).temporal |
| 529 | (fun x => PhysicalResidualBridge.baseComponents c n (swapCylinder x)) |
| 530 | (fun x => p₀ (swapCylinder x)) ((PhysicalResidualBridge.commonGraph Q h k).map (t, q)) j = _ |
| 531 | rw [graphResidual_swap, virtualDivergence_swap] |
| 532 | exact hbase j |
| 533 | have he := PhysicalResidualBridge.context_fullResidual_physical hQ h k n |
| 534 | (swapContext c) (swapState s) H.toMatchesAt hV hRV hBV haV hp₀V hpV hz hbaseV hu hP hrep hpRep i |
| 535 | rw [fullResidual_swap] at he |
| 536 | exact he |
| 537 | |
| 538 | end NavierStokes.PhysicalResidualTZ |