import YM.Push.PRICE_COMPILER.Authors import YM.UVNext.PRICED_KERNELS.Echo import YM.UVNext.PRICED_KERNELS.Strolling set_option warningAsError false set_option linter.unusedSectionVars false set_option linter.unnecessarySeqFocus false /-! # Pre-L actual tree corrected stationary rows Use Annuity at fixed-root, including integralLink along ANY forest's walk choices. No correction arrays yet. Repaired towers on Permit, but go even to any periodic test of those at the right ratio. The price in L^-1 of A0 means can afford BOTH tree hikes and fixRoot against it without changing width and without unbounded cost in realized output (same within-stage ask). No payment via decreases of width on each invocation. These are statements about the actual matrix rows. Orientation & path-lift tags elsewhere; paths are read HERE literally on the torus step/hike. All per-period claims include tree angles. Does not license changing any subsequent nonlinear forecasts post-L. -/ set_option autoImplicit false noncomputable section namespace YM.UVNext.PricedKernels open Filter Set Function Lattice RG Precision Pressure Laurent Exterior Bloch Matrix Tree open Push.PriceCompiler open scoped Topology Matrix.Norms.Frobenius BigOperators variable {c f : Side} {S : StepData c f} /-- Optional separate geometry check: use parent estimate on all sides. -/ lemma embed_parent (g : Ratio c f) (x : Site f) : (separation x (g.embed (g.parent x)):ℝ) ≤ g.count.val := by have hx := Next.Free.scaled_dist g x (g.parent x) have hL := (show 0<(g.count.val:ℝ) from Nat.cast_pos.mpr g.count.property) simpa using (div_le_iff₀ hL).mp hx section straight variable (S : StepData c f) (s : ℝ) (hs : 0 ≤ s) /-- Factorization of straighten. Use `form` physical index `vac` selectors actual duplicated for every fine start, storing the hike suppliers and fixRoot. -/ def rootAt (g : Ratio c f) : Matrix (Body 0 f) (Body 0 c) ℝ := LinearMap.toMatrix' (LinearMap.pi fun i : Body 0 f => LinearMap.proj (R:=ℝ) (φ:=fun _ => ℝ) (g.parent i.1,vac)) def hiker (F : Forest S.ratio) : Matrix (Body 0 f) (Body 1 f) ℝ := LinearMap.toMatrix' (LinearMap.pi fun i : Body 0 f => integralLink i.1 (F.hike i.1)) lemma factor_tree (F : Forest S.ratio) (A : Matrix (Body 1 f) (Body 1 c) ℝ) : straighten S F A=(hiker S F-rootAt S.ratio*fixRoot S)*A := by -- applying to arbitrary v apply Matrix.toLin'.injective apply LinearMap.ext; intro v; funext i change (straighten S F A *ᵥ v) i = (((hiker S F-rootAt S.ratio * fixRoot S)*A)*ᵥ v) i simp only [books,← Matrix.mulVec_mulVec,Matrix.sub_mulVec, hiker,rootAt,LinearMap.toMatrix'_mulVec]; rfl include hs lemma rootAt_paid : Annuity (site f _) (parent S.ratio _) (rootAt S.ratio) (tollFine S s) (Real.exp s) := by apply Annuity.earned; intro i v hv rw [rootAt, LinearMap.toMatrix'_mulVec]; change |v _| ≤ _ have he := hv (S.ratio.parent i.1,vac) refine he.trans (Real.exp_monotone ?_) have hx := embed_parent S.ratio i.1 let L := (S.patch.L.val:ℝ) have hL : 0 < L := Nat.cast_pos.mpr S.patch.L.property calc _ ≤ s/L*L := mul_le_mul_of_nonneg_left hx (div_nonneg hs hL.le) _ ≤ s := (div_mul_cancel₀ _ hL.ne').le lemma hiker_paid (F : Forest S.ratio) : Annuity (site f _) (site f _) (hiker S F) (tollFine S s) (4*S.patch.L.val*Real.exp (4*s)) := by let L := (S.patch.L.val:ℝ) have hL : 0