import Mathlib import OAI.Probability.Ballisticity.Estimates.FiniteStage namespace OAI section open MeasureTheory ProbabilityTheory Filter open scoped ENNReal Classical namespace DirectionalTransience lemma cell_radius_comparison {d : ℕ} (ν : Measure (Row d)) [IsProbabilityMeasure ν] (hue : UniformElliptic ν) (e f : Direction d) (hef : e.1 ≠ f.1) (htrans : DirectionallyTransient ν (realPosition (step e))) (C c : ℝ) (hC : 0 < C) (hc : 0 < c) (hc1 : c ≤ 1) : ∃ T : ℝ, 0 < T ∧ ∀ w m i : ℕ, ∀ t : ℝ, T ≤ t → t ≤ c^2/(4*C)*(w:ℝ) → fluctuationRadius (independentConditionedPairLaw ν (realPosition (step e))) (commonIncrementProcess (realPosition (step e)) f 0) t ≤ c*cellRadius ν e f C w m i/2 := by let μ := independentConditionedPairLaw ν (realPosition (step e)) let S := commonIncrementProcess (realPosition (step e)) f 0 let : IsProbabilityMeasure μ := independentConditionedPairLaw_probability ν _ (ne_of_gt (noDrop_positive_of_directionallyTransient ν _ htrans)) have hS : Measurable S := measurable_commonIncrementProcess _ _ _ have hI : Integrable S μ := independent_commonWordIncrement_integrable ν hue _ (signed_direction_unit e) htrans (signedHeight e) (signedHeight_projection e) (signedHeight_step_le e) f have hne : 0 < μ {x | S x ≠ 0} := independent_commonWordIncrement_nonzero ν hue e f hef htrans obtain ⟨R,hR,hr⟩ := fluctuationRadius_scaling_compare μ S hS hI hne refine ⟨max 1 (fluctuationScale μ S R+1),lt_of_lt_of_le (by norm_num) (le_max_left _ _),?_⟩ intro w m i t ht htw have htR : fluctuationScale μ S R < t := by linarith [le_max_right 1 (fluctuationScale μ S R+1)] have hw : (w:ℝ) ≤ cellWidth w m i := by exact_mod_cast cellWidth_min w m i have htw' : t ≤ (c/2)^2*((cellWidth w m i:ℝ)/C) := by calc t ≤ c^2/(4*C)*(w:ℝ) := htw _ ≤ c^2/(4*C)*(cellWidth w m i:ℝ) := mul_le_mul_of_nonneg_left hw (by positivity) _ = (c/2)^2*((cellWidth w m i:ℝ)/C) := by ring have hh := hr ((cellWidth w m i:ℝ)/C) t (c/2) htR htw' (by positivity) (by linarith) simpa only [cellRadius,mul_div_assoc,div_mul_eq_mul_div] using hh end DirectionalTransience end section open scoped Classical namespace DirectionalTransience noncomputable def stageCellStarts (He H w : ℕ) : Fin (((H-He)/w+1)+1) → ℕ := Fin.lastCases H (fun j => He+j.val*w) noncomputable def stageCellWidths (He H w wplus : ℕ) : Fin (((H-He)/w+1)+1) → ℕ := Fin.lastCases wplus (fun _ => w) noncomputable def stageCellGaps (He H w : ℕ) (Gminus Gplus : ℝ) : Fin (((H-He)/w+1)+1) → ℝ := Fin.lastCases Gplus (fun _ => Gminus) lemma stage_cells_geometry (He H m W : ℕ) (hw : W ≤ finestCellWidth He m) (hp : W ≤ finestCellWidth H m) (hW : 0 ?_) j · simp only [stageCellWidths, Fin.lastCases_last] exact hp · simp only [stageCellWidths, Fin.lastCases_castSucc] exact hw · intro j refine Fin.lastCases ?_ (fun i => ?_) j · simp only [stageCellStarts, stageCellWidths, Fin.lastCases_last] exact finestCellWidth_start H m · simp only [stageCellStarts, stageCellWidths, Fin.lastCases_castSucc] exact (finestCellWidth_start He m).trans (Nat.le_add_right _ _) · intro h hHe hH obtain ⟨j,hj₁,hj₂⟩ := integer_cells_cover He H w hw0 h hHe.le hH refine ⟨j.castSucc,?_,?_,?_⟩ · simp only [stageCellStarts, Fin.lastCases_castSucc] exact hj₁ · simp only [stageCellStarts, stageCellWidths, Fin.lastCases_castSucc] exact hj₂ · simp only [stageCellGaps, Fin.lastCases_castSucc] exact le_rfl · refine ⟨Fin.last _,?_,?_,?_⟩ · simp only [stageCellStarts, Fin.lastCases_last] exact le_rfl · simp only [stageCellStarts, stageCellWidths, Fin.lastCases_last] exact Nat.le_add_right _ _ · simp only [stageCellGaps, Fin.lastCases_last] exact le_rfl lemma stage_cells_gap_bounds {d : ℕ} (ν : MeasureTheory.Measure (Row d)) (e f : Direction d) (C c Gminus Gplus : ℝ) (He H m : ℕ) (hminus : ∀ i, i < m → Gminus ≤ c*cellRadius ν e f C (finestCellWidth He m) m i/2) (hplus : ∀ i, i < m → Gplus ≤ c*cellRadius ν e f C (finestCellWidth H m) m i/2) : ∀ j i, i < m → stageCellGaps He H (finestCellWidth He m) Gminus Gplus j ≤ c*cellRadius ν e f C (stageCellWidths He H (finestCellWidth He m) (finestCellWidth H m) j) m i/2 := by intro j i hi refine Fin.lastCases ?_ (fun l => ?_) j · simpa only [stageCellGaps, stageCellWidths, Fin.lastCases_last] using hplus i hi · simpa only [stageCellGaps, stageCellWidths, Fin.lastCases_castSucc] using hminus i hi end DirectionalTransience end section open Filter open scoped Topology namespace DirectionalTransience lemma eventually_exp_affine_le (C a r : ℝ) (h : r < a) : ∀ᶠ b : ℝ in atTop, Real.exp (C-a*b) ≤ Real.exp (-r*b)/2 := by filter_upwards [eventually_ge_atTop ((C+Real.log 2)/(a-r))] with b hb have hh := (div_le_iff₀ (sub_pos.mpr h)).mp hb apply (le_div_iff₀ (by norm_num : (0:ℝ)<2)).mpr rw [← Real.exp_log (by norm_num : (0:ℝ)<2), ← Real.exp_add] apply Real.exp_le_exp.mpr nlinarith only [hh] lemma eventually_mul_exp_le (D a r : ℝ) (h : r < a) : ∀ᶠ b : ℝ in atTop, D*Real.exp (-a*b) ≤ Real.exp (-r*b)/2 := by let E := max D 1 have hE : 0 < E := lt_of_lt_of_le (by norm_num) (le_max_right _ _) filter_upwards [eventually_exp_affine_le (Real.log E) a r h] with b hb calc _ ≤ E*Real.exp (-a*b) := mul_le_mul_of_nonneg_right (le_max_left _ _) (Real.exp_pos _).le _ = Real.exp (Real.log E-a*b) := by rw [sub_eq_add_neg,Real.exp_add,Real.exp_log hE]; congr 2; ring _ ≤ _ := hb lemma eventually_stage_short_bound (lam C K : ℝ) (k L : ℕ) (hC : 0≤C) (hL : 0 < L) (hk : 2*K+3 < lam*k/2) (hLk : 2*K+3 < (L:ℝ)-k/2) : ∀ᶠ b : ℝ in atTop, (Real.exp (C*k-lam*(k*b/2)/L) + (16*C*k*L^2)*Real.exp ((k*b/2)/L-b))^L ≤ Real.exp (-(2*K+3)*b) := by have hLp : (0:ℝ)