import Mathlib import OAI.Probability.CriticalPercolation.Modular.RelativeModular import OAI.Probability.CriticalPercolation.Modular.ActionOrbitTransport import OAI.Probability.CriticalPercolation.Growth.HomogeneousGeometry import OAI.Probability.CriticalPercolation.Growth.HomogeneousAverage import OAI.Probability.CriticalPercolation.Criticality.NormalClosureGrowth namespace OAI section noncomputable section open Set Function open scoped Classical BigOperators namespace CriticalPercolation.HomogeneousAnalysis.Geometry open ActionOrbitTransport variable {X : Type*} (W : Geometry X) def HasDegree (d : ℕ) : Prop := ∃ C : ℕ, ∀ R : ℕ, ∃ n≥R, (W.ball n).card≤C*n^d lemma not_quadratic_exponential_lower (d : ℕ) (hg : W.HasDegree d) (L : ℕ) (hL : 0 change W.ratio x x=(W.ratio x (g x))^0; rw [W.ratio_self,pow_zero] | succ n ih => have he : (g^(n+1)) x=(g^n) (g x) := by rw [pow_succ]; rfl rw [he,←W.ratio_cocycle x ((g^n) x),W.ratio_aut,ih,pow_succ] lemma aut_pow_ball (g : W.Aut) (x : X) (L : ℕ) (hl : g x∈W.around x L) (n : ℕ) : (g^n) x∈W.around x (n*L) := by induction n with | zero => change x∈W.around x (0*L); simpa only [Nat.zero_mul] using W.self_mem_around x 0 | succ n ih => have hstep : (g^n) (g x)∈W.around ((g^n) x) L := by rw [←W.aut_around_image] exact Finset.mem_image.mpr ⟨g x,hl,rfl⟩ have hh := W.mem_around_add ih hstep have he : (g^(n+1)) x=(g^n) (g x) := by rw [pow_succ]; rfl simpa only [Nat.add_mul,Nat.one_mul,←he] using hh lemma ratio_power_card_bound (g : W.Aut) (x : X) (L : ℕ) (hl : g x∈W.around x L) (n : ℕ) : (W.ratio x (g x))^n≤((W.ball (n*L)).card:ℝ) := by rw [←W.ratio_pow] have hr : W.ratio x ((g^n) x)≤(suborbitCard W.Aut X x ((g^n) x):ℝ) := by apply div_le_self (Nat.cast_nonneg _) exact_mod_cast W.suborbit_card_pos ((g^n) x) x apply hr.trans have hsub : stabilizerOrbit W.Aut X x ((g^n) x)⊆(W.around x (n*L):Set X) := by intro y hy obtain ⟨k,hk,rfl⟩ := (mem_stabilizerOrbit W.Aut X).mp hy change k x=x at hk change k ((g^n) x)∈W.around x (n*L) simpa only [hk] using W.mem_around.mpr (GraphTopology.iso_reachBall W.graph k (W.mem_around.mp (W.aut_pow_ball g x L hl n))) have hc := Set.ncard_le_ncard hsub (W.around x (n*L)).finite_toSet rw [Set.ncard_coe_finset,W.card_around x (n*L)] at hc exact_mod_cast hc lemma ratio_le_one (d : ℕ) (hg : W.HasDegree d) (x y : X) : W.ratio x y≤1 := by by_contra! hr obtain ⟨g,hgxy⟩ := W.transitive x y obtain ⟨k,hk⟩ := pow_unbounded_of_one_lt (2:ℝ) hr let a := g^k have ha : 2≤W.ratio x (a x) := by dsimp [a] rw [W.ratio_pow,hgxy] exact hk.le obtain ⟨p,_,_⟩ := W.connected.exists_path_of_dist x (a x) let L := max p.length 1 have him : a x∈W.around x L := W.mem_around.mpr ⟨p,le_max_left _ _⟩ apply W.not_quadratic_exponential_lower d hg L (lt_of_lt_of_le Nat.zero_lt_one (le_max_right _ _)) intro n have hb := W.ratio_power_card_bound a x L him n have he : (2:ℝ)^n≤((W.ball (n*L)).card:ℝ) := (pow_le_pow_left₀ (by norm_num) ha n).trans hb have hh : 2^n≤(W.ball (n*L)).card := by exact_mod_cast he apply hh.trans (Finset.card_le_card (W.ball_mono ?_)) have hn : n≤n^2 := by nlinarith nlinarith theorem balanced_suborbits (d : ℕ) (hg : W.HasDegree d) (x y : X) : suborbitCard W.Aut X x y=suborbitCard W.Aut X y x := by have h1 := W.ratio_le_one d hg x y have h2 := W.ratio_le_one d hg y x have hp : (0:ℝ)