import NavierStokes.GenericDiagonalSchedule import NavierStokes.GenericSupportedPolynomial /-! # A single smooth diagonal realization with finite differential-polynomial tests All estimates are on the actual cutoff series. The same schedule supplies every jet order and an arbitrary finite set of extra tests at each stage. Residual transfer permits independently varying residual gains and coefficient growth only on the common support of each nonconstant monomial. -/ noncomputable section namespace NavierStokes.GenericRealization open Set Filter DiagonalResidual GenericRealizationBounds GenericDifferentialPolynomial open scoped Topology ContDiff BigOperators variable {D : Type*} /-- Approach the singular scale uniformly over the full prescribed domain. -/ def scaleApproach (U : Set D) (q : D β†’ ℝ) : Filter D := comap q (𝓝[>] (0 : ℝ)) βŠ“ π“Ÿ U theorem eventually_domain (U : Set D) (q : D β†’ ℝ) : βˆ€αΆ  x in scaleApproach U q, x ∈ U := Filter.Eventually.filter_mono inf_le_right (show βˆ€αΆ  x in π“Ÿ U, x ∈ U from by simp) theorem scale_tendsto (U : Set D) (q : D β†’ ℝ) : Tendsto q (scaleApproach U q) (𝓝 0) := (tendsto_comap.mono_left inf_le_left).mono_right nhdsWithin_le_nhds variable [NormedAddCommGroup D] [NormedSpace ℝ D] /-- A filter rate yields the literal uniform small-scale estimate, including strictly positive constants and radius. -/ theorem uniform_bound_of_rate {U : Set D} {q : D β†’ ℝ} {f : D β†’ ℝ} {m : β„•} {r : ℝ} (h : JetRate (scaleApproach U q) q f m r) : βˆƒ Ξ΄ C : ℝ, 0 < Ξ΄ ∧ 0 < C ∧ βˆ€ x ∈ U, 0 < q x β†’ q x < Ξ΄ β†’ β€–iteratedFDeriv ℝ m f xβ€– ≀ C * q x ^ r := by obtain ⟨C, hC, hb⟩ := h have hb' : βˆ€αΆ  v in 𝓝[>] (0 : ℝ), βˆ€ x, q x = v β†’ x ∈ U β†’ β€–iteratedFDeriv ℝ m f xβ€– ≀ C * q x ^ r := eventually_comap.mp (eventually_inf_principal.mp hb) obtain ⟨δ, hΞ΄, hd⟩ := mem_nhdsGT_iff_exists_Ioo_subset.mp hb' refine ⟨δ, C + 1, hΞ΄, by linarith, ?_⟩ intro x hx hqx hsmall exact (hd ⟨hqx, hsmall⟩ x rfl hx).trans (mul_le_mul_of_nonneg_right (by linarith) (Real.rpow_nonneg hqx.le _)) variable {ΞΉ : Type*} /-- Properties derived for one selected schedule, rather than new schedules chosen after the derivative order or the polynomial has been supplied. -/ structure Properties (U : Set D) (q : D β†’ ℝ) (base : ΞΉ β†’ D β†’ ℝ) (A : ΞΉ β†’ β„• β†’ D β†’ ℝ) (g L : β„• β†’ ℝ) (a : β„• β†’ β„•) : Prop where positive : βˆ€ j, 0 < a j doubling : βˆ€ j, 2 * a j ≀ a (j + 1) strictMono : StrictMono a tends : Tendsto (fun j => (a j : ℝ)) atTop atTop locallyFinite : βˆ€ i, LocallyFinite (fun j => Function.support (fun x : U => SolenoidalDiagonal.cutStage (fun j => (a j : ℝ)) q (CutStageEstimates.positiveStages (A i)) j x)) smooth : βˆ€ i, ContDiffOn ℝ ∞ (realized (fun j => (a j : ℝ)) q (base i) (A i)) U approximation : βˆ€ i, Nonempty (ApproximationRates (scaleApproach U q) q (fun J => g (J + 1) / 2) (realized (fun j => (a j : ℝ)) q (base i) (A i)) (stage (base i) (A i))) exact_tail : βˆ€ i x, x ∈ U β†’ βˆ€ J m, m ≀ J + 3 β†’ q x < 1 / (2 * (a J : ℝ)) β†’ β€–iteratedFDeriv ℝ m (fun y => realized (fun j => (a j : ℝ)) q (base i) (A i) y - stage (base i) (A i) J y) xβ€– ≀ (1 / 2 : ℝ) ^ J * q x ^ (g (J + 1) / 2 - CutStageEstimates.cutLoss L m) outer_zero : βˆ€ i x, ContinuousAt q x β†’ 1 / (a 0 : ℝ) < q x β†’ SolenoidalDiagonal.potentialSum (fun j => (a j : ℝ)) q (CutStageEstimates.positiveStages (A i)) =αΆ [𝓝 x] (fun _ => 0) /-- Existence from the raw logarithmic increment and base bounds. Auxiliary tests have arbitrary per-test logarithmic weights and positive decay powers. -/ theorem exists_realization [Fintype ΞΉ] {U : Set D} (hU : IsOpen U) {q : D β†’ ℝ} (hq : ContDiffOn ℝ ∞ q U) (hpos : βˆ€ x ∈ U, 0 < q x ∧ q x ≀ 1) (Bq : β„• β†’ ℝ) (hBq : βˆ€ k x, x ∈ U β†’ q x ≀ 1 β†’ β€–iteratedFDeriv ℝ k q xβ€– ≀ Bq k * q x ^ (1 - (k : ℝ))) {base : ΞΉ β†’ D β†’ ℝ} (hbase : βˆ€ i, ContDiffOn ℝ ∞ (base i) U) (Cb Pb Kb : β„• β†’ ℝ) (hbaseBound : βˆ€ i m x, x ∈ U β†’ β€–iteratedFDeriv ℝ m (base i) xβ€– ≀ Cb m * (1 + |Real.log (q x)|) ^ Pb m * q x ^ (-Kb m)) {A : ΞΉ β†’ β„• β†’ D β†’ ℝ} (hA : βˆ€ i j, 1 ≀ j β†’ ContDiffOn ℝ ∞ (A i j) U) (g L : β„• β†’ ℝ) (C P : ΞΉ β†’ β„• β†’ β„• β†’ ℝ) (hraw : βˆ€ i, CutStageEstimates.RawStageBounds q (A i) g L (C i) (P i) U) (hgpos : βˆ€ j, 1 ≀ j β†’ 0 < g j) (hgmono : Monotone g) (lower : β„•) {ΞΊ : Type*} (tests : β„• β†’ Finset ΞΊ) (B Pt Ξ³ : β„• β†’ ΞΊ β†’ ℝ) (hΞ³ : βˆ€ j k, k ∈ tests j β†’ 0 < Ξ³ j k) {q0 : ℝ} (hq0 : 0 < q0) : βˆƒ a : β„• β†’ β„•, lower ≀ a 0 ∧ (βˆ€ j, 1 / (a j : ℝ) < q0) ∧ Properties U q base A g L a ∧ βˆ€ j k, k ∈ tests j β†’ βˆ€ r : ℝ, 0 < r β†’ r ≀ 1 / (a j : ℝ) β†’ |DiagonalScale.logPowerWeight (B j k) (Pt j k) (Ξ³ j k) r| ≀ (1 / 2 : ℝ) ^ j := by obtain ⟨a, hlo, hap, had, ham, hat, hao, hab, hatest⟩ := GenericDiagonalSchedule.exists_finite_diagonal_cut_bounds_with_tests hU Subset.rfl hq (fun x hx => (hpos x hx).1) Bq hBq hA g L C P hraw hgpos lower tests B Pt Ξ³ hΞ³ hq0 have hlU := eventually_domain U q have hlq : βˆ€αΆ  x in scaleApproach U q, 0 < q x ∧ q x ≀ 1 := hlU.mono fun x hx => hpos x hx have hzero := scale_tendsto U q have haReal : Monotone (fun j => (a j : ℝ)) := fun i j hij => by change (a i : ℝ) ≀ (a j : ℝ) exact_mod_cast ham.monotone hij have hapReal : βˆ€ j, 0 < (a j : ℝ) := fun j => by exact_mod_cast hap j have hgHalf : Monotone (fun j => g j / 2) := fun i j hij => div_le_div_of_nonneg_right (hgmono hij) (by norm_num) have hb : βˆ€ i m, JetRate (scaleApproach U q) q (base i) m (-(Kb m + 1)) := by intro i m convert jetRate_of_log_bound (hlq.mono fun _ hx => hx.1) hzero m (Cb m) (Pb m) (-Kb m) (hlU.mono fun x hx => hbaseBound i m x hx) using 1 ring refine ⟨a, hlo, hao, ?_, hatest⟩ refine ⟨hap, had, ham, hat, ?_, ?_, ?_, ?_, ?_⟩ Β· intro i exact SolenoidalDiagonal.locallyFinite_cutStage_support_on hat hq.continuousOn (fun x hx => (hpos x hx).1) _ Β· intro i exact realized_smooth hU hq (fun x hx => (hpos x hx).1) hat (hbase i) (hA i) Β· intro i refine ⟨⟨fun m => max (L m + 1) (Kb m + 1), CutStageEstimates.cutLoss L, id, ?_, ?_⟩⟩ Β· intro J m exact stage_growth hU hlU hlq hzero (hbase i) (hA i) (hraw i) (fun j hj => (hgpos j hj).le) (hb i) J m Β· intro m J hJ change m ≀ J at hJ exact realized_tail_jetRate hat hU hq (hA i) hgHalf (hab i) hlU hlq hzero J m (by omega) Β· intro i x hx J m hm hsmall exact realized_tail_bound hat haReal hapReal hU hq (hA i) hgHalf (hab i) hx (hpos x hx).1 (hpos x hx).2 J m hm hsmall Β· intro i x hqx houter exact correction_eventually_zero haReal hapReal hqx houter _ /-- The full residual assertion, with logarithmic coefficient and finite-stage bounds and an arbitrary all-orders-flat error majorant. Its conclusion is a uniform estimate on the whole domain, with the schedule already fixed. -/ theorem Properties.flat_residual {U : Set D} {q : D β†’ ℝ} {base : ΞΉ β†’ D β†’ ℝ} {A : ΞΉ β†’ β„• β†’ D β†’ ℝ} {g L : β„• β†’ ℝ} {a : β„• β†’ β„•} (H : Properties U q base A g L a) (hU : IsOpen U) (hq : βˆ€ x ∈ U, 0 < q x ∧ q x ≀ 1) (hbase : βˆ€ i, ContDiffOn ℝ ∞ (base i) U) (hA : βˆ€ i j, 1 ≀ j β†’ ContDiffOn ℝ ∞ (A i j) U) (hgtop : Tendsto g atTop atTop) (P : SupportedPolynomial D ΞΉ) (hconst : ContDiffOn ℝ ∞ P.constant U) (hc : βˆ€ t ∈ P.terms, ContDiffOn ℝ ∞ t.1 U) (region : ((D β†’ ℝ) Γ— Expression D ΞΉ Empty) β†’ Set D) (Cc Pc Kc : β„• β†’ ℝ) (hcoeff : βˆ€ t ∈ P.terms, βˆ€ m x, x ∈ U β†’ x ∈ region t β†’ β€–iteratedFDeriv ℝ m t.1 xβ€– ≀ Cc m * (1 + |Real.log (q x)|) ^ Pc m * q x ^ (-Kc m)) (hzero : βˆ€ t ∈ P.terms, βˆ€ x ∈ U, x βˆ‰ region t β†’ t.2.eval (fun k => Empty.elim k) (fun i => realized (fun j => (a j : ℝ)) q (base i) (A i)) =αΆ [𝓝 x] (fun _ => 0)) (hszero : βˆ€ t ∈ P.terms, βˆ€ J x, x ∈ U β†’ x βˆ‰ region t β†’ t.2.eval (fun k => Empty.elim k) (fun i => stage (base i) (A i) J) =αΆ [𝓝 x] (fun _ => 0)) (rho : β„• β†’ ℝ) (hrho : Tendsto rho atTop atTop) (Cr Pr : β„• β†’ β„• β†’ ℝ) (Kr : β„• β†’ ℝ) (error : β„• β†’ β„• β†’ D β†’ ℝ) (hres : βˆ€ J m x, x ∈ U β†’ β€–iteratedFDeriv ℝ m (P.eval (fun i => stage (base i) (A i) J)) xβ€– ≀ Cr J m * (1 + |Real.log (q x)|) ^ Pr J m * q x ^ (rho J - Kr m) + error J m x) (he : βˆ€ J m N, βˆƒ Ce : ℝ, 0 ≀ Ce ∧ βˆ€ x ∈ U, error J m x ≀ Ce * q x ^ (N : β„•)) (m : β„•) (N : ℝ) : βˆƒ Ξ΄ C : ℝ, 0 < Ξ΄ ∧ 0 < C ∧ βˆ€ x ∈ U, 0 < q x β†’ q x < Ξ΄ β†’ β€–iteratedFDeriv ℝ m (P.eval (fun i => realized (fun j => (a j : ℝ)) q (base i) (A i))) xβ€– ≀ C * q x ^ N := by have hlU := eventually_domain U q have hlq := hlU.mono (fun x hx => hq x hx) have hqzero := scale_tendsto U q have hgain : Tendsto (fun J => g (J + 1) / 2) atTop atTop := (hgtop.comp (tendsto_add_atTop_nat 1)).atTop_div_const (by norm_num) have hcoeffRate : βˆ€ t ∈ P.terms, βˆ€ m, JetRate (scaleApproach U q βŠ“ π“Ÿ (region t)) q t.1 m (-(Kc m + 1)) := by intro t ht m have hregion : βˆ€αΆ  x in scaleApproach U q βŠ“ π“Ÿ (region t), x ∈ region t := Filter.Eventually.filter_mono inf_le_right (by simp) have hb : βˆ€αΆ  x in scaleApproach U q βŠ“ π“Ÿ (region t), β€–iteratedFDeriv ℝ m t.1 xβ€– ≀ Cc m * (1 + |Real.log (q x)|) ^ Pc m * q x ^ (-Kc m) := by filter_upwards [hlU.filter_mono inf_le_left, hregion] with x hx hr exact hcoeff t ht m x hx hr convert jetRate_of_log_bound ((hlq.filter_mono inf_le_left).mono fun _ hx => hx.1) (hqzero.mono_left inf_le_left) m (Cc m) (Pc m) (-Kc m) hb using 1 ring have hresRate : βˆ€ J k, JetRate (scaleApproach U q) q (P.eval (fun i => stage (base i) (A i) J)) k (rho J - (Kr k + 1)) := by intro J k have herr : βˆ€ M : β„•, βˆƒ Ce : ℝ, 0 ≀ Ce ∧ βˆ€αΆ  x in scaleApproach U q, error J k x ≀ Ce * q x ^ M := by intro M obtain ⟨Ce, hCe, hb⟩ := he J k M exact ⟨Ce, hCe, hlU.mono fun x hx => hb x hx⟩ convert jetRate_of_log_bound_add_flat hlq hqzero k (Cr J k) (Pr J k) (rho J - Kr k) (hlU.mono fun x hx => hres J k x hx) herr using 1 ring apply uniform_bound_of_rate exact P.flat_of_local_coefficients hU hlU hlq H.smooth (fun J i => stage_smooth (hbase i) (hA i) J) hgain hrho (fun i => (H.approximation i).some) hconst hc region (fun _ m => Kc m + 1) hcoeffRate hzero hszero (fun k => Kr k + 1) hresRate m N end NavierStokes.GenericRealization