import Euler.ParentPacketHistoryNeighbor import Euler.TransverseHistoryParentCost import Euler.PolynomialCostMajorant import Euler.PacketParentLabelCoefficients /-! The actual restricted history sensitivity has a single fixed polynomial dependence on the parent label constant and reciprocal history length. The small physical scale remains a multiplicative factor. -/ /-! ## From `Euler/ParentHistoryCostPolynomial.lean` The text of `Euler/ParentHistoryCostPolynomial.lean`, folded into this file, which was its only importer. -/ section /-! One fixed polynomial controls the complete history sensitivity envelope for all parent label constants and reciprocal time bounds. -/ noncomputable section namespace EulerParentHistoryCost open EulerPacketParentLabelBounds EulerPacketParentMeanCoercivity EulerTransverseHistoryBounds EulerTransverseEndpointDifference EulerPolynomialCost def labelHistoryEnvelope (K Ti : ℝ) : ℝ := parentDifferenceEnvelope Ti (frameAmplitude K) (gradientAmplitude K) (27*(frameAmplitude K)^2*gradientAmplitude K) (coefficientRadius K) def labelHistoryPolynomial : Polynomial ℝ := let X : Polynomial ℝ := Polynomial.X let v := Polynomial.C embeddingCost*X^2 let f := 1+v let h := 27*f^2*v let R := 1024+4*X let ci := (3*f^2+1)^2 let r := 1+(2*ci^2*f^2*v+ci*v)+ci*f let d := v+f let a := 1+h let x := f*R let y := v*R let z := h*R let s := r*(1+d^2*(2*r^2)*a)*(2*X*d) let e := (1+3*d^2*(2*r^2)*a+2*d^4*(2*r^2)^2*a^2)*(y+x)+ (d^3*(2*r^2)+d^5*(2*r^2)^2*a)*z let sd := r*(2*X*e+(y+x)*s) let g := (4*ci^2*f^2*v+2*ci*v)*x+2*ci*f*y x*(2*(X+4*ci*f*v))*s+f*(4*g*s+(2*(X+4*ci*f*v))*sd) theorem labelHistoryPolynomial_eval (P : ℝ) : labelHistoryPolynomial.eval P = parentDifferenceEnvelope P (frameAmplitude P) (gradientAmplitude P) (27*(frameAmplitude P)^2*gradientAmplitude P) (1024+4*P) := by simp [labelHistoryPolynomial,parentDifferenceEnvelope,differenceEnvelope, slopeDifferenceEnvelope,slopeEnvelope,generatorDifferenceEnvelope,endpointDifferenceCost, gramInverseEnvelope,transportEnvelope,frameAmplitude,gradientAmplitude] def labelHistoryConstant : ℝ := coefficientCost labelHistoryPolynomial def labelHistoryPower : ℕ := labelHistoryPolynomial.natDegree theorem labelHistoryConstant_pos : 0 < labelHistoryConstant := coefficientCost_pos _ theorem labelHistoryEnvelope_power (K Ti : ℝ) (hK : 0 ≤ K) (hTi : 0 ≤ Ti) : labelHistoryEnvelope K Ti ≤ labelHistoryConstant*(1+K+Ti)^labelHistoryPower := by let P := 1+K+Ti have hP : 1 ≤ P := by dsimp [P]; linarith have hP0 : 0 ≤ P := zero_le_one.trans hP have hKP : K ≤ P := by dsimp [P]; linarith have hTiP : Ti ≤ P := by dsimp [P]; linarith have hE := embeddingCost_nonneg have hF0 := frameAmplitude_nonneg K have hV0 := gradientAmplitude_nonneg K have hV : gradientAmplitude K ≤ gradientAmplitude P := by unfold gradientAmplitude gcongr have hF : frameAmplitude K ≤ frameAmplitude P := add_le_add (le_refl (1 : ℝ)) hV have hH : 27*(frameAmplitude K)^2*gradientAmplitude K ≤ 27*(frameAmplitude P)^2*gradientAmplitude P := by gcongr have hR : coefficientRadius K ≤ 1024+4*P := by unfold coefficientRadius apply max_le · linarith · linarith have he : labelHistoryEnvelope K Ti ≤ labelHistoryPolynomial.eval P := by rw [labelHistoryPolynomial_eval] exact parentDifferenceEnvelope_mono hTi hF0 hV0 (by positivity) (coefficientRadius_nonneg K) hTiP hF hV hH hR exact he.trans ((le_abs_self _).trans (eval_bound labelHistoryPolynomial P hP)) end EulerParentHistoryCost end end noncomputable section namespace EulerMeanCoefficients.SmoothCoefficientPath open EulerSmoothLimit open scoped BoundedContinuousFunction variable {J V : Type} [TopologicalSpace J] [CompactSpace J] [NormedAddCommGroup V] [NormedSpace ℝ V] private local instance : NormedAddCommGroup (Space →ᵇ V) := inferInstance private local instance : NormedSpace ℝ (Space →ᵇ V) := inferInstance theorem field_norm_le_of_bound (A : SmoothCoefficientPath J V) (C : ℝ) (hC : 0 ≤ C) (hb : ∀ t x, ‖A.field t x‖ ≤ C) : ‖A.field‖ ≤ C := (ContinuousMap.norm_le _ hC).2 fun t => (BoundedContinuousFunction.norm_le hC).2 (hb t) end EulerMeanCoefficients.SmoothCoefficientPath namespace EulerTransversePacketProvider.Data open Set EulerSmoothLimit EulerMeanCoefficients EulerTransverseBoundedFrame open scoped BoundedContinuousFunction variable {U : Type} [NormedAddCommGroup U] [InnerProductSpace ℝ U] (D : Data U) theorem frame_norm_le (C : ℝ) (hC : 0 ≤ C) (hF : ∀ t x, ‖D.F.field t x‖ ≤ C) : ‖D.frame.field‖ ≤ C := by apply SmoothCoefficientPath.field_norm_le_of_bound _ C hC intro t x have h := coefficient_derivative_bound D.m₀ D.R D.F 0 C (fun t x => by simpa only [norm_iteratedFDeriv_zero] using hF t x) t x simpa only [norm_iteratedFDeriv_zero] using h theorem frameDerivative_norm_le (C1 : ℝ) (hC1 : 0 ≤ C1) (hF1 : ∀ t x, ‖D.F₁.field t x‖ ≤ C1) : ‖D.frameDerivative.field‖ ≤ C1 := by apply SmoothCoefficientPath.field_norm_le_of_bound _ C1 hC1 intro t x have h := coefficient_derivative_bound D.m₀ D.R D.F₁ 0 C1 (fun t x => by simpa only [norm_iteratedFDeriv_zero] using hF1 t x) t x simpa only [norm_iteratedFDeriv_zero] using h end EulerTransversePacketProvider.Data namespace EulerParentPacketFrames.LabelData open Set EulerSmoothLimit EulerMeanCoefficients EulerTimeIntervalRestriction EulerPacketParentLabelBounds EulerGevrey EulerPacketCofactor EulerPacketPiola EulerPacketActivationHistory EulerTransverseHistoryBounds EulerParentHistoryCost EulerPacketParentMeanCoercivity variable {G : Parent} (L : LabelData G) {U : Type} [NormedAddCommGroup U] [InnerProductSpace ℝ U] [CompleteSpace U] (m : Space) (hm : ‖m‖=1) (R : U ≃ₗᵢ[ℝ] EulerTransverseFrameCoordinates.referencePlane m) (S : Set Space) (hS : IsCompact S) (H : LowBounds G) (τ : ℝ) (hτ : 0 < τ) (hτT : τ < G.T) (Ti : ℝ) (hτ1 : τ ≤ 1) (hTi : τ⁻¹ ≤ Ti) omit [CompleteSpace U] in include hτ1 hTi in theorem initialHistoryDifferenceScaleCost_bound : L.initialHistoryDifferenceScaleCost m hm R S hS H τ hτ hτT ≤ labelHistoryEnvelope L.K Ti := by let D := (G.transverseData m hm R S hS).initial τ hτ hτT.le let B := G.historyOn H m hm R S hS τ hτ hτT let C := frameAmplitude L.K let C1 := gradientAmplitude L.K let CH := 27*C^2*C1 have hC : 0 ≤ C := frameAmplitude_nonneg L.K have hC1 : 0 ≤ C1 := gradientAmplitude_nonneg L.K have hCH : 0 ≤ CH := by dsimp [CH]; positivity have hF : ∀ t x, ‖D.F.field t x‖ ≤ C := by intro t x have he : D.F.field t x=G.frame.field (initialInclusion G.T τ hτT.le t) x := rfl rw [he] have h := L.frame_scaled_bound 0 (initialInclusion G.T τ hτT.le t) x simpa only [norm_iteratedFDeriv_zero,majorant,Nat.zero_add,Nat.factorial_zero, Nat.cast_one,pow_zero,mul_one,one_pow] using h have hF1 : ∀ t x, ‖D.F₁.field t x‖ ≤ C1 := by intro t x have he : D.F₁.field t x=G.first.field (initialInclusion G.T τ hτT.le t) x := rfl rw [he] have h := L.first_scaled_bound 0 (initialInclusion G.T τ hτT.le t) x simpa only [norm_iteratedFDeriv_zero,majorant,Nat.zero_add,Nat.factorial_zero, Nat.cast_one,pow_zero,mul_one,one_pow] using h have hBH : ‖B.H.field‖ ≤ CH := by apply SmoothCoefficientPath.field_norm_le_of_bound _ CH hCH intro t x have he : B.H.field t x=G.curvature.field (initialInclusion G.T τ hτT.le t) x := rfl rw [he] have h := L.curvature_scaled_bound 0 (initialInclusion G.T τ hτT.le t) x simpa only [norm_iteratedFDeriv_zero,majorant,Nat.zero_add,Nat.factorial_zero, Nat.cast_one,pow_zero,mul_one,one_pow] using h have hdet : ∀ t x, (operatorMatrix (D.F.field t x)).det=1 := fun t x => G.frame_det (initialInclusion G.T τ hτT.le t) x have hci : D.frameLower⁻¹ ≤ gramInverseEnvelope C := by simpa only [gramInverseEnvelope,add_comm] using D.frameLower_inv_le_of_frame C hC hdet hF exact historyDifferenceCost_le_parentEnvelope τ D.frameLower ‖D.frame.field‖ ‖D.frameDerivative.field‖ ‖B.H.field‖ Ti C C1 CH (coefficientRadius L.K) hτ hτ1 hTi D.frameLower_pos hci (norm_nonneg _) (norm_nonneg _) (norm_nonneg _) hC hC1 hCH (coefficientRadius_nonneg L.K) (D.frame_norm_le C hC hF) (D.frameDerivative_norm_le C1 hC1 hF1) hBH end EulerParentPacketFrames.LabelData