import Mathlib import OAI.Probability.CriticalPercolation.Criticality.NormalClosureGrowth namespace OAI section noncomputable section open Set Function open scoped Classical Pointwise namespace CriticalPercolation.SparseGrowth variable {A : Type*} [Group A] [DecidableEq A] lemma quotient_word_lower (S : Finset A) (h1 : (1:A)∈S) (hgen : Subgroup.closure (S : Set A)=⊤) (H : Subgroup A) [H.Normal] [Infinite (A ⧸ H)] (n : ℕ) : n+1 ≤ ((S^n).image (QuotientGroup.mk' H)).card := by let q := QuotientGroup.mk' H have hq1 : (1:A ⧸ H)∈S.image q := Finset.mem_image.mpr ⟨1,h1,map_one q⟩ have hqgen : Subgroup.closure (S.image q : Set (A ⧸ H))=⊤ := by rw [Finset.coe_image,←MonoidHom.map_closure,hgen] exact Subgroup.map_top_of_surjective q (QuotientGroup.mk'_surjective H) have hinf : (Subgroup.closure (S.image q : Set (A ⧸ H)) : Set (A ⧸ H)).Infinite := by rw [hqgen,Subgroup.coe_top] exact Set.infinite_univ rw [Finset.image_pow] exact Finset.add_one_le_card_pow hq1 hinf n lemma subgroup_linear_packing (S : Finset A) (h1 : (1:A)∈S) (hgen : Subgroup.closure (S : Set A)=⊤) (H : Subgroup A) [H.Normal] [Infinite (A ⧸ H)] (T : Finset H) (L : ℕ) (hT : T.image H.subtype ⊆ S^L) (n : ℕ) : (T^n).card*(n+1) ≤ (S^((L+1)*n)).card := by have hTin : (T^n).image H.subtype ⊆ (S^(L*n)).filter (fun a => a∈H) := by intro a ha obtain ⟨b,hb,rfl⟩ := Finset.mem_image.mp ha refine Finset.mem_filter.mpr ⟨?_,b.property⟩ have he : (b : A)∈(T.image H.subtype)^n := by rw [←Finset.image_pow] exact Finset.mem_image.mpr ⟨b,hb,rfl⟩ rw [pow_mul] exact Finset.pow_subset_pow_left hT he calc _ = (n+1)*((T^n).image H.subtype).card := by rw [Finset.card_image_of_injective _ H.subtype_injective,Nat.mul_comm] _ ≤ ((S^n).image (QuotientGroup.mk' H)).card * ((S^(L*n)).filter (fun a => a∈H)).card := Nat.mul_le_mul (quotient_word_lower S h1 hgen H n) (Finset.card_le_card hTin) _ ≤ (S^(n+L*n)).card := Finset.card_pow_quotient_mul_pow_inter_subgroup_le _ = (S^((L+1)*n)).card := by congr 2; ring theorem subgroup_degree_descent (S : Finset A) (h1 : (1:A)∈S) (hgen : Subgroup.closure (S : Set A)=⊤) (H : Subgroup A) [H.Normal] [Infinite (A ⧸ H)] (T : Finset H) (L : ℕ) (hT : T.image H.subtype ⊆ S^L) (d : ℕ) (hg : HasDegree S (d+1)) : HasDegree T d := by obtain ⟨C,hC⟩ := hg refine ⟨C*(2*(L+1))^(d+1),?_⟩ intro R obtain ⟨r,hr,hbound⟩ := hC ((L+1)*max R 1) let n := r/(L+1) have hL : 0