import NavierStokes.R3.H3Products import NavierStokes.R3.H3UniformApproximation /-! # Divergence-free transport for weak H³ limits The compact smooth approximants need not themselves be divergence-free. Their divergence terms converge to the zero weak divergence of the limit. -/ noncomputable section open Set Filter MeasureTheory open scoped ContDiff Topology BigOperators InnerProductSpace namespace NavierStokesR3.H3Comparison open NavierStokes.ProblemStatement open NavierStokes.PeriodicIntegration (spatialPartial) open NavierStokes.PeriodicUniqueness private def transportProduct (i : Fin 3) : Space →L[ℝ] Space →L[ℝ] Space := (ContinuousLinearMap.lsmul ℝ ℝ).comp (EuclideanSpace.proj i) private theorem transportProduct_apply (i : Fin 3) (v w : Space) : transportProduct i v w = (v i) • w := rfl private def realInnerBilinear : Space →L[ℝ] Space →L[ℝ] ℝ := innerSL ℝ private theorem realInnerBilinear_apply (v w : Space) : realInnerBilinear v w = ⟪v, w⟫_ℝ := rfl private theorem compact_transport {w v : Space → Space} (hw : ContDiff ℝ ∞ w) (hv : ContDiff ℝ ∞ v) (hcw : HasCompactSupport w) (hcv : HasCompactSupport v) : 2 * (∑ i : Fin 3, ∫ x, v x i * ⟪w x, spatialPartial i w x⟫_ℝ) = -(∑ i : Fin 3, ∫ x, ‖w x‖ ^ 2 * spatialPartial i v x i) := by have hiL (i : Fin 3) : Integrable (fun x => v x i * ⟪w x, spatialPartial i w x⟫_ℝ) := ((component_contDiff hv i).continuous.mul (hw.inner ℝ (spatial_partial_contDiff hw i)).continuous).integrable_of_hasCompactSupport (CompactEnergy.compact_component hcv i).mul_right have hiR (i : Fin 3) : Integrable (fun x => ‖w x‖ ^ 2 * spatialPartial i v x i) := ((hw.continuous.norm.pow 2).mul (component_contDiff (spatial_partial_contDiff hv i) i).continuous).integrable_of_hasCompactSupport (CompactEnergy.compact_norm_sq hcw).mul_right have h := CompactEnergy.integral_fderiv_apply (hw.norm_sq ℝ) hv hcv have he (x : Space) : fderiv ℝ (fun y => ‖w y‖ ^ 2) x (v x) = 2 * ∑ i : Fin 3, v x i * ⟪w x, spatialPartial i w x⟫_ℝ := by rw [fderiv_normsq hw] have hlin : fderiv ℝ w x (v x) = ∑ i : Fin 3, (v x i) • spatialPartial i w x := by calc fderiv ℝ w x (v x) = fderiv ℝ w x (∑ i : Fin 3, (v x i) • coordinateVector i) := congrArg (fderiv ℝ w x) (sum_coordinates (v x)).symm _ = _ := by simp only [map_sum, map_smul, spatialPartial] rw [hlin, inner_sum] simp only [inner_smul_right] simp_rw [he] at h have hright : (fun x => ‖w x‖ ^ 2 * ∑ i : Fin 3, spatialPartial i v x i) = (fun x => ∑ i : Fin 3, ‖w x‖ ^ 2 * spatialPartial i v x i) := funext (fun _ => Finset.mul_sum _ _ _) rw [hright] at h rw [integral_const_mul, integral_finsetSum _ (fun i _ => hiL i), integral_finsetSum _ (fun i _ => hiR i)] at h exact h end NavierStokesR3.H3Comparison