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