import Mathlib import OAI.Probability.CriticalPercolation.Harmonic.GraphWalkEnergy import OAI.Probability.CriticalPercolation.Harmonic.GraphWalkProbability namespace OAI section noncomputable section open Set Function open scoped Classical BigOperators namespace CriticalPercolation.HomogeneousAnalysis.Geometry open HarmonicAnalysis variable {X : Type*} (W : Geometry X) def projectedFunction (n : ℕ) (t x : X) : ℝ := inner ℝ (W.walkFeature n x-W.walkState n) (W.walkFeature n t-W.walkState n) / (4*(W.degree:ℝ)*W.walkEnergy (W.walkState n)) lemma exists_large_neighbor_gradient (hD : 0 h t ht) rw [W.walkEnergy_gradient] at hh simp only [Finset.sum_const,nsmul_eq_mul] at hh nlinarith lemma projectedFunction_root (n : ℕ) (t : X) : W.projectedFunction n t W.root=0 := by simp [projectedFunction,walkState] lemma projectedFunction_edge_bound [Infinite X] (n : ℕ) (t : X) (ht : t∈W.neighbors W.root) {x y : X} (hxy : W.graph.Adj x y) : |W.projectedFunction n t y-W.projectedFunction n t x|≤1 := by let q := 4*(W.degree:ℝ)*W.walkEnergy (W.walkState n) have hc : (0:ℝ) ‖W.walkFeature n y-W.walkState n‖^2) (fun y hy => sq_nonneg _) ht).trans_eq (W.walkEnergy_gradient n) have hi := abs_real_inner_le_norm (W.walkFeature n x-W.lazyWalk (W.walkFeature n x)) (W.walkFeature n t-W.walkState n) rw [W.feature_residual_norm] at hi have hisq := pow_le_pow_left₀ (abs_nonneg _) hi 2 rw [sq_abs,mul_pow] at hisq have hb := mul_le_mul_of_nonneg_left hgrad (sq_nonneg ‖W.walkState n-W.lazyWalk (W.walkState n)‖) rw [W.projectedFunction_residual,div_pow] apply (div_le_div_iff₀ (sq_pos_of_pos (show 0<4*(W.degree:ℝ)*W.walkEnergy (W.walkState n) by positivity)) hf).mpr have hm := mul_le_mul_of_nonneg_left (hisq.trans hb) (show 0≤4*(W.degree:ℝ)^2*W.walkEnergy (W.walkState n) by positivity) nlinarith only [hm] end CriticalPercolation.HomogeneousAnalysis.Geometry end end end OAI