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 Euler.ExactLiftedJointDifferentiability |
| 2 | import Euler.PacketCorrectionSourceData |
| 3 | import Euler.PacketCoordinateResidual |
| 4 | import Euler.TransversePacketPiolaData |
| 5 | import Euler.ExactLiftedGraphPressure |
| 6 | import Euler.PacketParentFlowDifferentiation |
| 7 | import Euler.PacketVolumeDivergence |
| 8 | |
| 9 | /-! The actual parent velocity plus the constructed exact packet satisfies |
| 10 | both classical Euler equations in physical coordinates. -/ |
| 11 | |
| 12 | /-! ## From `Euler/PacketExactSourceEquation.lean` |
| 13 | |
| 14 | The text of `Euler/PacketExactSourceEquation.lean`, folded into this file, which was its only importer. -/ |
| 15 | |
| 16 | section |
| 17 | |
| 18 | /-! The actual pointwise equation of the exact packet, expressed with the |
| 19 | prescribed deformation and its genuine time and spatial derivatives. -/ |
| 20 | |
| 21 | noncomputable section |
| 22 | |
| 23 | namespace EulerPacketPhysicalTransform |
| 24 | |
| 25 | open Set Filter ContinuousLinearMap EulerSmoothLimit EulerVolterraConvolution |
| 26 | open scoped Topology |
| 27 | |
| 28 | variable {U : Type*} [NormedAddCommGroup U] [InnerProductSpace ℝ U] |
| 29 | (D : EulerTransversePacketProvider.Data U) |
| 30 | |
| 31 | theorem source_frame_time (F : ℝ × Space → Space →L[ℝ] Space) |
| 32 | (hmatch : ∀ s : Icc (0 : ℝ) D.T, ∀ x, F (s,x) = D.F.field s x) |
| 33 | (t : ℝ) (ht : t ∈ Ioo 0 D.T) (x : Space) |
| 34 | (DF : (ℝ × Space) →L[ℝ] (Space →L[ℝ] Space)) |
| 35 | (hF : HasFDerivAt F DF (t,x)) : |
| 36 | DF (1,0) = D.F₁.field ⟨t,ht.1.le,ht.2.le⟩ x := by |
| 37 | have he : (fun s => F (s,x)) =ᶠ[𝓝 t] |
| 38 | (fun s => extendPath D.T D.T_pos.le D.F.field s x) := by |
| 39 | filter_upwards [Icc_mem_nhds ht.1 ht.2] with s hs |
| 40 | simpa only [extendPath,projIcc_of_mem D.T_pos.le hs] using hmatch ⟨s,hs⟩ x |
| 41 | have hf := hF.comp_hasDerivAt t |
| 42 | ((hasDerivAt_id t).prodMk (hasDerivAt_const t x)) |
| 43 | have hd := (D.frame_time t ⟨ht.1.le,ht.2.le⟩ x).hasDerivAt (Icc_mem_nhds ht.1 ht.2) |
| 44 | simpa only [extendPath,projIcc_of_mem D.T_pos.le ⟨ht.1.le,ht.2.le⟩] using |
| 45 | hf.unique (hd.congr_of_eventuallyEq he) |
| 46 | |
| 47 | theorem source_frame_spatial (F : ℝ × Space → Space →L[ℝ] Space) |
| 48 | (hmatch : ∀ s : Icc (0 : ℝ) D.T, ∀ x, F (s,x) = D.F.field s x) |
| 49 | (t : Icc (0 : ℝ) D.T) (x v : Space) |
| 50 | (DF : (ℝ × Space) →L[ℝ] (Space →L[ℝ] Space)) |
| 51 | (hF : HasFDerivAt F DF (t,x)) : |
| 52 | DF (0,v) = fderiv ℝ (D.F.field t : Space → Space →L[ℝ] Space) x v := by |
| 53 | have hd := hF.comp x (hasFDerivAt_prodMk_right (t : ℝ) x) |
| 54 | have he : (fun y => F (t,y)) = (D.F.field t : Space → Space →L[ℝ] Space) := |
| 55 | funext (hmatch t) |
| 56 | change HasFDerivAt (fun y => F (t,y)) (DF.comp (inr ℝ ℝ Space)) x at hd |
| 57 | rw [he] at hd |
| 58 | rw [hd.fderiv] |
| 59 | rfl |
| 60 | |
| 61 | end EulerPacketPhysicalTransform |
| 62 | |
| 63 | namespace EulerAllOrderDriftCorrection.ExactLiftedPacket |
| 64 | |
| 65 | open Set InnerProductSpace ContinuousLinearMap EulerSmoothLimit |
| 66 | EulerAllOrderCorrectionData EulerLiftedGradientSpace EulerPacketCorrectionCoefficients |
| 67 | EulerPacketCoordinates EulerMetricTransport |
| 68 | |
| 69 | variable {U : Type*} [NormedAddCommGroup U] [InnerProductSpace ℝ U] |
| 70 | (D : EulerTransversePacketProvider.Data U) {P : ℝ} [Fact (0 < P)] |
| 71 | {κ : ℝ} {hκ : |κ| ≤ 1} {Z R : FieldTower P D.T} |
| 72 | {B : Budget P D.T_pos (correctionData D P κ hκ Z R)} |
| 73 | (S : ExactLiftedPacket P D.T_pos (correctionData D P κ hκ Z R) B) |
| 74 | |
| 75 | theorem source_equation (t : ℝ) (ht : t ∈ Ioo 0 D.T) (z : LiftTangent) : |
| 76 | fderiv ℝ S.rawVelocity (t,z) (1,0) + |
| 77 | (2 : ℝ) • D.FInv.field ⟨t,ht.1.le,ht.2.le⟩ z.1 |
| 78 | (D.F₁.field ⟨t,ht.1.le,ht.2.le⟩ z.1 (S.rawVelocity (t,z))) + |
| 79 | fderiv ℝ S.rawVelocity (t,z) (0,(κ • S.rawVelocity (t,z),⟪D.m₀,S.rawVelocity (t,z)⟫_ℝ)) + |
| 80 | κ • D.FInv.field ⟨t,ht.1.le,ht.2.le⟩ z.1 |
| 81 | (fderiv ℝ (D.F.field ⟨t,ht.1.le,ht.2.le⟩ : Space → Space →L[ℝ] Space) |
| 82 | z.1 (S.rawVelocity (t,z)) (S.rawVelocity (t,z))) + |
| 83 | D.FInv.field ⟨t,ht.1.le,ht.2.le⟩ z.1 |
| 84 | ((D.FInv.field ⟨t,ht.1.le,ht.2.le⟩ z.1).adjoint (S.rawPressure (t,z))) = 0 := by |
| 85 | have h := S.raw_normalized_equation t ht z |
| 86 | simp only [correctionData_linear,correctionData_quadratic,correctionData_metric, |
| 87 | coveringMap,smul_apply,comp_apply] at h |
| 88 | have hquad := algebraic_formula D κ S.rawVelocity (t,z) |
| 89 | simp only [algebraic,rawQuadratic,rawFrame,rawInverse,EulerTransversePacketProvider.Data.clamp, |
| 90 | projIcc_of_mem D.T_pos.le ⟨ht.1.le,ht.2.le⟩,smul_apply,comp_apply] at hquad |
| 91 | rw [hquad] at h |
| 92 | exact h |
| 93 | |
| 94 | theorem source_equation_of_frame (F : ℝ × Space → Space →L[ℝ] Space) |
| 95 | (hmatch : ∀ s : Icc (0 : ℝ) D.T, ∀ x, F (s,x) = D.F.field s x) |
| 96 | (t : ℝ) (ht : t ∈ Ioo 0 D.T) (z : LiftTangent) |
| 97 | (DF : (ℝ × Space) →L[ℝ] (Space →L[ℝ] Space)) |
| 98 | (hF : HasFDerivAt F DF (t,z.1)) : |
| 99 | fderiv ℝ S.rawVelocity (t,z) (1,0) + |
| 100 | (2 : ℝ) • (D.deformationEquiv ⟨t,ht.1.le,ht.2.le⟩ z.1).symm |
| 101 | (DF (1,0) (S.rawVelocity (t,z))) + |
| 102 | fderiv ℝ S.rawVelocity (t,z) (0,(κ • S.rawVelocity (t,z),⟪D.m₀,S.rawVelocity (t,z)⟫_ℝ)) + |
| 103 | κ • (D.deformationEquiv ⟨t,ht.1.le,ht.2.le⟩ z.1).symm |
| 104 | (DF (0,S.rawVelocity (t,z)) (S.rawVelocity (t,z))) + |
| 105 | (D.deformationEquiv ⟨t,ht.1.le,ht.2.le⟩ z.1).symm |
| 106 | ((D.deformationEquiv ⟨t,ht.1.le,ht.2.le⟩ z.1).symm.toContinuousLinearMap.adjoint |
| 107 | (S.rawPressure (t,z))) = 0 := by |
| 108 | rw [EulerPacketPhysicalTransform.source_frame_time D F hmatch t ht z.1 DF hF, |
| 109 | EulerPacketPhysicalTransform.source_frame_spatial D F hmatch |
| 110 | ⟨t,ht.1.le,ht.2.le⟩ z.1 (S.rawVelocity (t,z)) DF hF] |
| 111 | exact S.source_equation D t ht z |
| 112 | |
| 113 | end EulerAllOrderDriftCorrection.ExactLiftedPacket |
| 114 | end |
| 115 | |
| 116 | end |
| 117 | |
| 118 | /-! ## From `Euler/PacketExactPhysicalMomentum.lean` |
| 119 | |
| 120 | The text of `Euler/PacketExactPhysicalMomentum.lean`, folded into this file, which was its only importer. -/ |
| 121 | |
| 122 | section |
| 123 | |
| 124 | /-! The constructed exact lifted packet gives the actual momentum equation |
| 125 | after the genuine parent-flow change of coordinates. The scalar pressure |
| 126 | is the normalized radial potential of the constructed pressure tower. -/ |
| 127 | |
| 128 | noncomputable section |
| 129 | |
| 130 | namespace EulerPacketPhysicalTransform |
| 131 | |
| 132 | open Set Filter InnerProductSpace ContinuousLinearMap EulerSmoothLimit EulerLiftedGradientSpace |
| 133 | EulerAllOrderCorrectionData EulerAllOrderDriftCorrection |
| 134 | EulerPacketCorrectionCoefficients EulerLagrangian |
| 135 | open scoped Topology ContDiff |
| 136 | |
| 137 | variable {U : Type*} [NormedAddCommGroup U] [InnerProductSpace ℝ U] |
| 138 | (D : EulerTransversePacketProvider.Data U) {P : ℝ} [Fact (0 < P)] |
| 139 | {κ : ℝ} {hκ : |κ| ≤ 1} {Z R : FieldTower P D.T} |
| 140 | {B : Budget P D.T_pos (correctionData D P κ hκ Z R)} |
| 141 | (S : ExactLiftedPacket P D.T_pos (correctionData D P κ hκ Z R) B) |
| 142 | |
| 143 | /-- All derivatives and the pressure of the perturbation are constructed |
| 144 | from the exact lifted solution. Only the actual parent flow and its inverse |
| 145 | enter as geometric data. -/ |
| 146 | theorem exact_source_momentum |
| 147 | (k : ℝ) (hk : k*κ=1) |
| 148 | (F : ℝ × Space → Space →L[ℝ] Space) |
| 149 | (u : ℝ × Space → Space) (p : ℝ × Space → ℝ) (X Y : ℝ × Space → Space) |
| 150 | (hmatch : ∀ s : Icc (0 : ℝ) D.T, ∀ y, F (s,y) = D.F.field s y) |
| 151 | (t : ℝ) (ht : t ∈ Ioo 0 D.T) (x : Space) |
| 152 | (hleft : ∀ s y, Y (s,X (s,y)) = y) |
| 153 | (hY : DifferentiableAt ℝ (inverseCoordinates Y) (t,X (t,x))) |
| 154 | (hX : ContDiffAt ℝ 2 X (t,x)) |
| 155 | (hframe : F =ᶠ[𝓝 (t,x)] fun r => (fderiv ℝ X r).comp (inr ℝ ℝ Space)) |
| 156 | (hflow : (fun r => fderiv ℝ X r (1,0)) =ᶠ[𝓝 (t,x)] fun r => u (r.1,X r)) |
| 157 | (hu : DifferentiableAt ℝ u (t,X (t,x))) |
| 158 | (hp : DifferentiableAt ℝ (fun y => p (t,y)) (X (t,x))) |
| 159 | (hparent : momentumResidual u p (t,X (t,x)) = 0) : |
| 160 | momentumResidual (fun q => u q+physicalVelocity κ k D.m₀ F S.rawVelocity Y q) |
| 161 | (fun q => p q+physicalPressure (S.rawGraphPotential k) Y q) (t,X (t,x)) = 0 := by |
| 162 | have hDF : DifferentiableAt ℝ (fun r => (fderiv ℝ X r).comp (inr ℝ ℝ Space)) (t,x) := |
| 163 | ((hX.fderiv_right (m := 1) le_rfl).differentiableAt one_ne_zero).clm_comp |
| 164 | (differentiableAt_const (inr ℝ ℝ Space)) |
| 165 | have hF : HasFDerivAt F (fderiv ℝ F (t,x)) (t,x) := |
| 166 | (hDF.congr_of_eventuallyEq hframe).hasFDerivAt |
| 167 | have hz : HasFDerivAt S.rawVelocity |
| 168 | (fderiv ℝ S.rawVelocity (spaceTimeGraph k D.m₀ (t,x))) |
| 169 | (spaceTimeGraph k D.m₀ (t,x)) := |
| 170 | (S.rawVelocity_hasFDerivAt t ht (x,k*⟪D.m₀,x⟫_ℝ)).differentiableAt.hasFDerivAt |
| 171 | have hA : F (t,x) = (D.deformationEquiv ⟨t,ht.1.le,ht.2.le⟩ x).toContinuousLinearMap := |
| 172 | hmatch ⟨t,ht.1.le,ht.2.le⟩ x |
| 173 | exact physical_euler_momentum_of_flow κ k hk D.m₀ F S.rawVelocity u p |
| 174 | (S.rawGraphPotential k) X Y t x (D.deformationEquiv ⟨t,ht.1.le,ht.2.le⟩ x) |
| 175 | (fderiv ℝ F (t,x)) (fderiv ℝ S.rawVelocity (spaceTimeGraph k D.m₀ (t,x))) |
| 176 | (fderiv ℝ u (t,X (t,x))) (S.rawPressure (spaceTimeGraph k D.m₀ (t,x))) |
| 177 | hleft hY hX hframe hflow hF hz hA hu.hasFDerivAt hp |
| 178 | ((S.rawGraphPotential_smooth k hk t).differentiable (by simp) x) |
| 179 | (S.rawGraphPotential_gradient k hk t x) hparent |
| 180 | (S.source_equation_of_frame D F hmatch t ht (x,k*⟪D.m₀,x⟫_ℝ) _ hF) |
| 181 | |
| 182 | end EulerPacketPhysicalTransform |
| 183 | end |
| 184 | |
| 185 | end |
| 186 | |
| 187 | /-! ## From `Euler/PacketExactPhysicalDivergence.lean` |
| 188 | |
| 189 | The text of `Euler/PacketExactPhysicalDivergence.lean`, folded into this file, which was its only importer. -/ |
| 190 | |
| 191 | section |
| 192 | |
| 193 | /-! The actual exact packet remains incompressible after the genuine |
| 194 | unit-Jacobian parent-flow coordinate change. -/ |
| 195 | |
| 196 | noncomputable section |
| 197 | |
| 198 | namespace EulerPacketPhysicalTransform |
| 199 | |
| 200 | open Set Filter InnerProductSpace ContinuousLinearMap EulerSmoothLimit |
| 201 | EulerLiftedGradientSpace EulerAllOrderCorrectionData EulerAllOrderDriftCorrection |
| 202 | EulerPacketCorrectionCoefficients EulerPacketVolumeDivergence EulerGraphPressurePotential |
| 203 | EulerCylinderSmoothOrbit EulerGraphPullback |
| 204 | open scoped Topology ContDiff |
| 205 | |
| 206 | variable {U : Type*} [NormedAddCommGroup U] [InnerProductSpace ℝ U] |
| 207 | (D : EulerTransversePacketProvider.Data U) {P : ℝ} [Fact (0 < P)] |
| 208 | {κ : ℝ} {hκ : |κ| ≤ 1} {Z R : FieldTower P D.T} |
| 209 | {B : Budget P D.T_pos (correctionData D P κ hκ Z R)} |
| 210 | (S : ExactLiftedPacket P D.T_pos (correctionData D P κ hκ Z R) B) |
| 211 | |
| 212 | theorem exact_source_divergence |
| 213 | (k : ℝ) (hk : k*κ=1) |
| 214 | (F : ℝ × Space → Space →L[ℝ] Space) (X Y : ℝ × Space → Space) |
| 215 | (t : Icc (0 : ℝ) D.T) (x : Space) |
| 216 | (hmatch : ∀ y, F (t,y) = D.F.field t y) |
| 217 | (hX : ContDiffAt ℝ 2 (fun y => X (t,y)) x) |
| 218 | (hspace : ∀ y, fderiv ℝ (fun a => X (t,a)) y = F (t,y)) |
| 219 | (hdet : ∀ y, (EulerPacketPiola.operatorMatrix (F (t,y))).det = 1) |
| 220 | (hleft : ∀ y, Y (t,X (t,y)) = y) |
| 221 | (hY : DifferentiableAt ℝ (fun y => Y (t,y)) (X (t,x))) : |
| 222 | divergence (fun y => physicalVelocity κ k D.m₀ F S.rawVelocity Y (t,y)) (X (t,x)) = 0 := by |
| 223 | let g : Space → Space := fun y => S.velocity.pointField t (cylinderGraph P k D.m₀ y) |
| 224 | have hg : ContDiff ℝ ∞ g := by |
| 225 | have h := (coverField_contDiff P (S.velocity.pointField t) (S.velocity.pointField_smooth t)).comp |
| 226 | (graphMap k D.m₀).contDiff |
| 227 | simpa only [g,Function.comp_def,graphMap_apply,cylinderGraph] using h |
| 228 | have hdg : divergence g x = 0 := by |
| 229 | rw [divergence_eq_coordinate_sum] |
| 230 | exact S.graphVelocity_divergence k hk t x |
| 231 | have hv : DifferentiableAt ℝ (fun y => κ • g y) x := |
| 232 | (hg.differentiable (by simp) x).const_smul κ |
| 233 | have hvzero : divergence (fun y => κ • g y) x = 0 := by |
| 234 | rw [divergence_eq_trace,← coordinateTrace_eq_linearTrace] |
| 235 | change coordinateTrace (fderiv ℝ (κ • g) x) = 0 |
| 236 | rw [ |
| 237 | ((hg.differentiable (by simp) x).hasFDerivAt.const_smul κ).fderiv, |
| 238 | map_smul,coordinateTrace_eq_linearTrace] |
| 239 | change κ • divergence g x = 0 |
| 240 | rw [hdg,smul_zero] |
| 241 | have he : (fun y => physicalVelocity κ k D.m₀ F S.rawVelocity Y (t,y)) = |
| 242 | (fun y => fderiv ℝ (fun a => X (t,a)) (Y (t,y)) (κ • g (Y (t,y)))) := by |
| 243 | funext y |
| 244 | simp only [physicalVelocity,inverseCoordinates,graphVelocity,spaceTimeGraph_apply, |
| 245 | ExactLiftedPacket.rawVelocity,FieldTower.rawField,projIcc_of_mem D.T_pos.le t.property, |
| 246 | g,cylinderGraph,coveringMap,hspace,map_smul] |
| 247 | rw [he] |
| 248 | have hdet' : (fun y => (EulerPacketPiola.operatorMatrix |
| 249 | (fderiv ℝ (fun a => X (t,a)) y)).det) =ᶠ[𝓝 x] fun _ => (1 : ℝ) := |
| 250 | Filter.Eventually.of_forall (fun y => by |
| 251 | change (EulerPacketPiola.operatorMatrix (fderiv ℝ (fun a => X (t,a)) y)).det = 1 |
| 252 | rw [hspace,hdet]) |
| 253 | exact (divergence_pushforward (fun y => X (t,y)) (fun y => Y (t,y)) |
| 254 | (fun y => κ • g y) x (D.deformationEquiv t x) hX |
| 255 | ((hspace x).trans (hmatch x)) hdet' hleft hY hv).trans hvzero |
| 256 | |
| 257 | end EulerPacketPhysicalTransform |
| 258 | end |
| 259 | |
| 260 | end |
| 261 | |
| 262 | noncomputable section |
| 263 | |
| 264 | namespace EulerPacketPhysicalTransform |
| 265 | |
| 266 | open Set Filter InnerProductSpace ContinuousLinearMap EulerSmoothLimit |
| 267 | EulerLiftedGradientSpace EulerAllOrderCorrectionData EulerAllOrderDriftCorrection |
| 268 | EulerPacketCorrectionCoefficients EulerLagrangian |
| 269 | open scoped Topology ContDiff |
| 270 | |
| 271 | variable {U : Type*} [NormedAddCommGroup U] [InnerProductSpace ℝ U] |
| 272 | (D : EulerTransversePacketProvider.Data U) {P : ℝ} [Fact (0 < P)] |
| 273 | {κ : ℝ} {hκ : |κ| ≤ 1} {Z R : FieldTower P D.T} |
| 274 | {B : Budget P D.T_pos (correctionData D P κ hκ Z R)} |
| 275 | (S : ExactLiftedPacket P D.T_pos (correctionData D P κ hκ Z R) B) |
| 276 | |
| 277 | theorem exact_source_velocity_differentiableAt |
| 278 | (k : ℝ) (F : ℝ × Space → Space →L[ℝ] Space) (X Y : ℝ × Space → Space) |
| 279 | (t : ℝ) (ht : t ∈ Ioo 0 D.T) (x : Space) |
| 280 | (hleft : Y (t,X (t,x)) = x) |
| 281 | (hY : DifferentiableAt ℝ (inverseCoordinates Y) (t,X (t,x))) |
| 282 | (hX : ContDiffAt ℝ 2 X (t,x)) |
| 283 | (hframe : F =ᶠ[𝓝 (t,x)] fun r => (fderiv ℝ X r).comp (inr ℝ ℝ Space)) : |
| 284 | DifferentiableAt ℝ (physicalVelocity κ k D.m₀ F S.rawVelocity Y) (t,X (t,x)) := by |
| 285 | have hDF : DifferentiableAt ℝ (fun r => (fderiv ℝ X r).comp (inr ℝ ℝ Space)) (t,x) := |
| 286 | ((hX.fderiv_right (m := 1) le_rfl).differentiableAt one_ne_zero).clm_comp |
| 287 | (differentiableAt_const (inr ℝ ℝ Space)) |
| 288 | have hF : HasFDerivAt F (fderiv ℝ F (t,x)) (t,x) := |
| 289 | (hDF.congr_of_eventuallyEq hframe).hasFDerivAt |
| 290 | have hz : HasFDerivAt S.rawVelocity |
| 291 | (fderiv ℝ S.rawVelocity (spaceTimeGraph k D.m₀ (t,x))) |
| 292 | (spaceTimeGraph k D.m₀ (t,x)) := |
| 293 | (S.rawVelocity_hasFDerivAt t ht (x,k*⟪D.m₀,x⟫_ℝ)).differentiableAt.hasFDerivAt |
| 294 | have hG := graphVelocity_hasFDerivAt κ k D.m₀ F S.rawVelocity (t,x) _ _ hF hz |
| 295 | have hyx : inverseCoordinates Y (t,X (t,x)) = (t,x) := by |
| 296 | simp only [inverseCoordinates,hleft] |
| 297 | apply DifferentiableAt.comp _ _ hY |
| 298 | rw [hyx] |
| 299 | exact hG.differentiableAt |
| 300 | |
| 301 | /-- The classical momentum and incompressibility equations for the actual |
| 302 | new velocity, using the constructed normalized scalar pressure. -/ |
| 303 | theorem exact_source_euler |
| 304 | (k : ℝ) (hk : k*κ=1) |
| 305 | (F : ℝ × Space → Space →L[ℝ] Space) |
| 306 | (u : ℝ × Space → Space) (p : ℝ × Space → ℝ) (X Y : ℝ × Space → Space) |
| 307 | (hmatch : ∀ s : Icc (0 : ℝ) D.T, ∀ y, F (s,y) = D.F.field s y) |
| 308 | (t : ℝ) (ht : t ∈ Ioo 0 D.T) (x : Space) |
| 309 | (hleft : ∀ s y, Y (s,X (s,y)) = y) |
| 310 | (hY : DifferentiableAt ℝ (inverseCoordinates Y) (t,X (t,x))) |
| 311 | (hX : ContDiffAt ℝ 2 X (t,x)) |
| 312 | (hframe : F =ᶠ[𝓝 (t,x)] fun r => (fderiv ℝ X r).comp (inr ℝ ℝ Space)) |
| 313 | (hflow : (fun r => fderiv ℝ X r (1,0)) =ᶠ[𝓝 (t,x)] fun r => u (r.1,X r)) |
| 314 | (hspace : ∀ y, fderiv ℝ (fun a => X (t,a)) y = F (t,y)) |
| 315 | (hdet : ∀ y, (EulerPacketPiola.operatorMatrix (F (t,y))).det = 1) |
| 316 | (hu : DifferentiableAt ℝ u (t,X (t,x))) |
| 317 | (hp : DifferentiableAt ℝ (fun y => p (t,y)) (X (t,x))) |
| 318 | (hparent : momentumResidual u p (t,X (t,x)) = 0) |
| 319 | (hdiv : divergence (fun y => u (t,y)) (X (t,x)) = 0) : |
| 320 | momentumResidual (fun q => u q+physicalVelocity κ k D.m₀ F S.rawVelocity Y q) |
| 321 | (fun q => p q+physicalPressure (S.rawGraphPotential k) Y q) (t,X (t,x)) = 0 ∧ |
| 322 | divergence (fun y => u (t,y)+physicalVelocity κ k D.m₀ F S.rawVelocity Y (t,y)) |
| 323 | (X (t,x)) = 0 := by |
| 324 | refine ⟨exact_source_momentum D S k hk F u p X Y hmatch t ht x |
| 325 | hleft hY hX hframe hflow hu hp hparent,?_⟩ |
| 326 | have hXs : ContDiffAt ℝ 2 (fun y => X (t,y)) x := |
| 327 | hX.comp x (contDiffAt_const.prodMk contDiffAt_id) |
| 328 | have hYs := hY.snd.comp (X (t,x)) (hasFDerivAt_prodMk_right t (X (t,x))).differentiableAt |
| 329 | change DifferentiableAt ℝ (fun y => Y (t,y)) (X (t,x)) at hYs |
| 330 | have hWdiv := exact_source_divergence D S k hk F X Y ⟨t,ht.1.le,ht.2.le⟩ x |
| 331 | (hmatch ⟨t,ht.1.le,ht.2.le⟩) hXs hspace hdet (hleft t) hYs |
| 332 | have huS : DifferentiableAt ℝ (fun y => u (t,y)) (X (t,x)) := |
| 333 | hu.comp (X (t,x)) (hasFDerivAt_prodMk_right t (X (t,x))).differentiableAt |
| 334 | have hW := exact_source_velocity_differentiableAt D S k F X Y t ht x |
| 335 | (hleft t x) hY hX hframe |
| 336 | have hWS : DifferentiableAt ℝ |
| 337 | (fun y => physicalVelocity κ k D.m₀ F S.rawVelocity Y (t,y)) (X (t,x)) := |
| 338 | hW.comp (X (t,x)) (hasFDerivAt_prodMk_right t (X (t,x))).differentiableAt |
| 339 | rw [divergence_eq_trace,← coordinateTrace_eq_linearTrace,fderiv_fun_add huS hWS, |
| 340 | map_add,coordinateTrace_eq_linearTrace,coordinateTrace_eq_linearTrace] |
| 341 | change divergence (fun y => u (t,y)) (X (t,x)) + |
| 342 | divergence (fun y => physicalVelocity κ k D.m₀ F S.rawVelocity Y (t,y)) (X (t,x)) = 0 |
| 343 | rw [hdiv,hWdiv,add_zero] |
| 344 | |
| 345 | end EulerPacketPhysicalTransform |