Download data/lean/OAI/Geometry/PinnedDistances/SmallCells.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 35.7 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Geometry/PinnedDistances/SmallCells.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Geometry/PinnedDistances/SmallCells.lean
-
curl -L -o SmallCells.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Geometry/PinnedDistances/SmallCells.lean
35.7 kB
| import OAI.Geometry.PinnedDistances.ArithmeticVariance | |
| namespace OAI | |
| universe u1 u2 u3 u4 u5 u6 u7 u8 u9 | |
| section | |
| noncomputable section | |
| open NumberField | |
| open scoped BigOperators | |
| noncomputable section | |
| open MeasureTheory | |
| open scoped Topology | |
| noncomputable section | |
| open MeasureTheory | |
| open scoped Topology ENNReal | |
| noncomputable section | |
| open MeasureTheory NumberField | |
| open scoped BigOperators | |
| noncomputable section | |
| open scoped BigOperators | |
| open MeasureTheory | |
| namespace WeakPinned.Hierarchy.Depth | |
| open MeasureTheory | |
| variable {P : Type u1} [Fintype P] [DecidableEq P] | |
| variable (d : Depth P) | |
| def sourceGiant (x : P) (r : β) : Prop := Fintype.card P < 2*(d.cell r x).card | |
| instance (x : P) (r : β) : Decidable (d.sourceGiant x r) := Classical.propDecidable _ | |
| omit [DecidableEq P] in | |
| lemma sourceGiant_mono (x : P) {r t : β} (htr : t β€ r) (hr : d.sourceGiant x r) : | |
| d.sourceGiant x t := by | |
| classical | |
| have hc := Finset.card_le_card (d.cell_mono htr x) | |
| unfold sourceGiant at * | |
| omega | |
| omit [DecidableEq P] in | |
| lemma sourceGiant_iff (x : P) (r : β) : d.sourceGiant x r β | |
| β C : Finset P, Fintype.card P < 2*C.card β§ β y β C, d.share r x y := by | |
| classical | |
| constructor | |
| Β· intro h; exact β¨d.cell r x,h,fun y hy => (d.mem_cell r x y).mp hyβ© | |
| Β· rintro β¨C,hc,hCβ© | |
| have hsub : C β d.cell r x := fun y hy => (d.mem_cell r x y).mpr (hC y hy) | |
| have := Finset.card_le_card hsub | |
| unfold sourceGiant | |
| omega | |
| lemma isClosed_sourceGiant (x : P) : IsClosed {r : β | d.sourceGiant x r} := by | |
| classical | |
| simp_rw [d.sourceGiant_iff, Set.ofPred_exists] | |
| apply isClosed_iUnion_of_finite | |
| intro C | |
| simp only [Set.ofPred_and] | |
| apply IsClosed.inter | |
| Β· by_cases h : Fintype.card P < 2*C.card <;> simp [h] | |
| Β· simp_rw [Set.ofPred_forall] | |
| apply isClosed_iInter | |
| intro y | |
| apply isClosed_iInter | |
| intro hy | |
| by_cases hxy : x = y | |
| Β· simp [share,hxy] | |
| Β· simp only [share,hxy,false_or] | |
| exact isClosed_le continuous_id continuous_const | |
| def sourceM (x : P) : β := sSup {r : β | d.sourceGiant x r} | |
| lemma sourceGiant_cutoff (hn : 2 β€ Fintype.card P) (x : P) (r : β) : | |
| d.sourceGiant x r β r β€ d.sourceM x := by | |
| classical | |
| have hlo : d.sourceGiant x (-d.radius) := by | |
| classical | |
| unfold sourceGiant | |
| rw [d.cell_of_low le_rfl,Finset.card_univ] | |
| omega | |
| have hle : β t, d.sourceGiant x t β t β€ d.radius := by | |
| classical | |
| intro t ht | |
| exact d.giants_le_radius hn β¨d.cell t x, (d.mem_giants t _).mpr β¨d.cell_mem_cells t x,htβ©β© | |
| have hne : Set.Nonempty {t : β | d.sourceGiant x t} := β¨-d.radius,hloβ© | |
| have hbd : BddAbove {t : β | d.sourceGiant x t} := β¨d.radius, fun t ht => hle t htβ© | |
| have hmem : d.sourceGiant x (d.sourceM x) := (d.isClosed_sourceGiant x).csSup_mem hne hbd | |
| exact β¨fun hr => le_csSup hbd hr, fun hr => d.sourceGiant_mono x hr hmemβ© | |
| lemma sourceM_le_M (hn : 2 β€ Fintype.card P) (x : P) : d.sourceM x β€ d.M := by | |
| classical | |
| apply (d.giants_cutoff hn _).mp | |
| exact β¨d.cell (d.sourceM x) x, (d.mem_giants _ _).mpr | |
| β¨d.cell_mem_cells _ x,(d.sourceGiant_cutoff hn x _).mpr le_rflβ©β© | |
| lemma sourceGiant_mem_giant (x : P) (r : β) : | |
| d.sourceGiant x r β (d.giants r).Nonempty β§ x β d.giant r := by | |
| classical | |
| constructor | |
| Β· intro hs | |
| have hc : d.cell r x β d.giants r := (d.mem_giants r _).mpr β¨d.cell_mem_cells r x,hsβ© | |
| exact β¨β¨_,hcβ©,by rw [d.giant_eq hc]; exact d.self_mem_cell r xβ© | |
| Β· rintro β¨β¨G,hGβ©,hxβ© | |
| rw [d.giant_eq hG] at hx | |
| obtain β¨hGc,hGmβ© := (d.mem_giants r G).mp hG | |
| rwa [d.cell_of_mem hGc hx] at hGm | |
| lemma outsideIndicator_source (hn : 2 β€ Fintype.card P) (x : P) (r : β) : | |
| d.outsideIndicator r x = if d.sourceM x < r β§ r β€ d.M then 1 else 0 := by | |
| classical | |
| have he : ((d.giants r).Nonempty β§ x β d.giant r) β d.sourceM x < r β§ r β€ d.M := by | |
| classical | |
| rw [β not_le, β d.sourceGiant_cutoff hn x r, d.sourceGiant_mem_giant, | |
| β d.giants_cutoff hn r] | |
| tauto | |
| simp only [outsideIndicator,he] | |
| lemma potential_source (hn : 2 β€ Fintype.card P) (x : P) : | |
| d.potential x = d.M - d.sourceM x := by | |
| classical | |
| have he : (fun r => d.outsideIndicator r x) = | |
| (Set.Ioc (d.sourceM x) d.M).indicator (fun _ : β => (1:β)) := by | |
| classical | |
| funext r | |
| simp only [d.outsideIndicator_source hn, Set.indicator_apply, Set.mem_Ioc] | |
| rw [potential,he,integral_indicator measurableSet_Ioc] | |
| rw [β intervalIntegral.integral_of_le (d.sourceM_le_M hn x), intervalIntegral.integral_const] | |
| simp | |
| /-- The level set is an interval of length 2H, regardless of the fiber center-level h. -/ | |
| lemma straddle_integral (hn : 2 β€ Fintype.card P) (x : P) (h H : β) (hH : 0 β€ H) : | |
| (β« r : β, if d.sourceGiant x (h-r-H) β§ Β¬d.sourceGiant x (h-r+H) then (1:β) else 0) = 2*H := by | |
| classical | |
| have he : (fun r : β => if d.sourceGiant x (h-r-H) β§ Β¬d.sourceGiant x (h-r+H) then (1:β) else 0) = | |
| (Set.Ico (h-H-d.sourceM x) (h+H-d.sourceM x)).indicator (fun _ => (1:β)) := by | |
| classical | |
| funext r | |
| simp only [d.sourceGiant_cutoff hn, not_le,Set.indicator_apply,Set.mem_Ico] | |
| congr 1 | |
| apply propext | |
| constructor <;> rintro β¨hβ,hββ© <;> constructor <;> linarith | |
| rw [he,integral_indicator measurableSet_Ico] | |
| rw [integral_Ico_eq_integral_Ioc, β intervalIntegral.integral_of_le (by linarith : h-H-d.sourceM x β€ h+H-d.sourceM x), intervalIntegral.integral_const] | |
| simp | |
| ring | |
| def smallCells (y : P) (T : β) : Finset (Finset P) := by | |
| classical | |
| exact Finset.univ.filter (fun C => β r : β, C = d.cell r y β§ (C.card : β) < T) | |
| def smallNeighbors (y : P) (T : β) : Finset P := (d.smallCells y T).biUnion id | |
| omit [DecidableEq P] in | |
| lemma smallCells_chain (y : P) (T : β) {C E : Finset P} | |
| (hC : C β d.smallCells y T) (hE : E β d.smallCells y T) : C β E β¨ E β C := by | |
| classical | |
| obtain β¨r,rfl,hrβ© := (Finset.mem_filter.mp hC).2 | |
| obtain β¨t,rfl,htβ© := (Finset.mem_filter.mp hE).2 | |
| rcases le_total t r with h | h | |
| Β· exact Or.inl (d.cell_mono h y) | |
| Β· exact Or.inr (d.cell_mono h y) | |
| lemma smallNeighbors_card (y : P) (T : β) (hT : 0 < T) : | |
| ((d.smallNeighbors y T).card : β) < T := by | |
| classical | |
| by_cases hne : (d.smallCells y T).Nonempty | |
| Β· obtain β¨C,hC,hmaxβ© := Finset.exists_max_image (d.smallCells y T) Finset.card hne | |
| have he : d.smallNeighbors y T = C := by | |
| classical | |
| apply Finset.Subset.antisymm | |
| Β· intro x hx | |
| obtain β¨E,hE,hxβ© := Finset.mem_biUnion.mp hx | |
| change x β E at hx | |
| rcases d.smallCells_chain y T hE hC with h | h | |
| Β· exact h hx | |
| Β· have he : C = E := Finset.eq_of_subset_of_card_le h (hmax E hE) | |
| simpa only [he] using hx | |
| Β· intro x hx | |
| exact Finset.mem_biUnion.mpr β¨C,hC,hxβ© | |
| rw [he] | |
| obtain β¨r,hr,htβ© := (Finset.mem_filter.mp hC).2 | |
| exact ht | |
| Β· rw [smallNeighbors,Finset.not_nonempty_iff_eq_empty.mp hne] | |
| simpa using hT | |
| lemma source_mem_smallNeighbors (y x : P) (r T : β) | |
| (hxy : y β d.cell r x) (hT : ((d.cell r x).card : β) < T) : | |
| x β d.smallNeighbors y T := by | |
| classical | |
| have he := d.cell_eq_of_share ((d.mem_cell r x y).mp hxy) | |
| apply Finset.mem_biUnion.mpr | |
| refine β¨d.cell r y, ?_, (d.mem_cell r y x).mpr (d.share_symm ((d.mem_cell r x y).mp hxy))β© | |
| apply Finset.mem_filter.mpr | |
| exact β¨Finset.mem_univ _,r,rfl,by rwa [β he]β© | |
| end WeakPinned.Hierarchy.Depth | |
| namespace WeakPinned.Hierarchy.Depth | |
| open MeasureTheory | |
| variable {P : Type u2} [Fintype P] [DecidableEq P] | |
| variable (d : Depth P) | |
| lemma smallNeighbors_self (y : P) (T : β) (hne : (d.smallNeighbors y T).Nonempty) : | |
| y β d.smallNeighbors y T := by | |
| classical | |
| obtain β¨x,hxβ© := hne | |
| obtain β¨C,hC,hxβ© := Finset.mem_biUnion.mp hx | |
| obtain β¨r,rfl,hrβ© := (Finset.mem_filter.mp hC).2 | |
| apply Finset.mem_biUnion.mpr | |
| exact β¨d.cell r y,hC,d.self_mem_cell r yβ© | |
| lemma smallNeighbors_erase_bound (hn : 2 β€ Fintype.card P) (y : P) | |
| (Ο : β) (hΟ : 0 < Ο) (hΟ1 : Ο β€ 1) : | |
| ((d.smallNeighbors y (Ο*Fintype.card P)).erase y).card β€ Ο*((Fintype.card P : β)-1) := by | |
| classical | |
| have hn0 : 0 < (Fintype.card P : β) := by exact_mod_cast (show 0 < Fintype.card P by omega) | |
| have hn1 : 0 β€ (Fintype.card P : β)-1 := by | |
| have : (2:β) β€ Fintype.card P := by exact_mod_cast hn | |
| linarith | |
| by_cases hne : (d.smallNeighbors y (Ο*Fintype.card P)).Nonempty | |
| Β· have hy := d.smallNeighbors_self y _ hne | |
| have hc := d.smallNeighbors_card y (Ο*Fintype.card P) (mul_pos hΟ hn0) | |
| rw [Finset.card_erase_of_mem hy,Nat.cast_sub (Finset.one_le_card.mpr hne),Nat.cast_one] | |
| nlinarith | |
| Β· rw [Finset.not_nonempty_iff_eq_empty.mp hne] | |
| simp only [Finset.erase_empty,Finset.card_empty,Nat.cast_zero] | |
| exact mul_nonneg hΟ.le hn1 | |
| /-- All candidate sources for each target lie in one small neighborhood, | |
| allowing a level-dependent fiber reparametrization. -/ | |
| lemma smallNeighbors_pair_bound (hn : 2 β€ Fintype.card P) | |
| (q : P β P β β) (B Ο : β) (hB : 0 β€ B) (hΟ : 0 < Ο) (hΟ1 : Ο β€ 1) | |
| (hq : β x y, x β y β q x y β€ B / ((Fintype.card P : β)*((Fintype.card P : β)-1))) | |
| (C : Finset P) : | |
| (β y β C, β x β (d.smallNeighbors y (Ο*Fintype.card P)).erase y, q x y) β€ | |
| B*Ο*((C.card : β)/Fintype.card P) := by | |
| classical | |
| have hn0 : 0 < (Fintype.card P : β) := by exact_mod_cast (show 0 < Fintype.card P by omega) | |
| have hn1 : 0 < (Fintype.card P : β)-1 := by | |
| have : (2:β) β€ Fintype.card P := by exact_mod_cast hn | |
| linarith | |
| have hden : 0 β€ B / ((Fintype.card P : β)*((Fintype.card P : β)-1)) := | |
| div_nonneg hB (mul_pos hn0 hn1).le | |
| have hy (y : P) : (β x β (d.smallNeighbors y (Ο*Fintype.card P)).erase y, q x y) β€ | |
| B*Ο/Fintype.card P := by | |
| classical | |
| calc | |
| _ β€ β x β (d.smallNeighbors y (Ο*Fintype.card P)).erase y, | |
| B / ((Fintype.card P : β)*((Fintype.card P : β)-1)) := | |
| Finset.sum_le_sum (fun x hx => hq x y (Finset.ne_of_mem_erase hx)) | |
| _ = (((d.smallNeighbors y (Ο*Fintype.card P)).erase y).card : β) * | |
| (B / ((Fintype.card P : β)*((Fintype.card P : β)-1))) := by simp | |
| _ β€ (Ο*((Fintype.card P : β)-1)) * | |
| (B / ((Fintype.card P : β)*((Fintype.card P : β)-1))) := | |
| mul_le_mul_of_nonneg_right (d.smallNeighbors_erase_bound hn y Ο hΟ hΟ1) hden | |
| _ = B*Ο/Fintype.card P := by field_simp | |
| calc | |
| _ β€ β y β C, B*Ο/Fintype.card P := Finset.sum_le_sum (fun y _ => hy y) | |
| _ = _ := by simp; ring | |
| end WeakPinned.Hierarchy.Depth | |
| namespace WeakPinned.SmallFiber | |
| open MeasureTheory | |
| variable {P : Type u3} [Fintype P] [DecidableEq P] | |
| /-- Probability of a finite subset; the fiber weights used below will be the | |
| exact uniform probabilities on the original retained distance fibers. -/ | |
| def mass (p : P β β) (C : Finset P) : β := β y β C, p y | |
| omit [Fintype P] [DecidableEq P] in | |
| lemma mass_nonneg {p : P β β} (hp : β y, 0 β€ p y) (C : Finset P) : 0 β€ mass p C := | |
| Finset.sum_nonneg (fun y _ => hp y) | |
| omit [Fintype P] [DecidableEq P] in | |
| lemma mass_mono {p : P β β} (hp : β y, 0 β€ p y) {C D : Finset P} (h : C β D) : | |
| mass p C β€ mass p D := Finset.sum_le_sum_of_subset_of_nonneg h (fun y _ _ => hp y) | |
| omit [DecidableEq P] in | |
| lemma mass_le_one {p : P β β} (hp : β y, 0 β€ p y) (h1 : β y, p y = 1) (C : Finset P) : | |
| mass p C β€ 1 := by rw [β h1]; exact mass_mono hp (Finset.subset_univ C) | |
| omit [Fintype P] in | |
| lemma mass_diff_inter (p : P β β) (C D : Finset P) : | |
| mass p C = mass p (C \ D) + mass p (C β© D) := by | |
| classical | |
| symm | |
| have hh := Finset.sum_sdiff (f:=p) (Finset.inter_subset_left (sβ:=C) (sβ:=D)) | |
| have he : C \ (C β© D) = C \ D := by ext y; simp | |
| rw [he] at hh | |
| exact hh | |
| lemma mass_cover (p : P β β) (hp : β y, 0 β€ p y) (h1 : β y, p y = 1) | |
| (C D : Finset P) : 1 β€ mass p C + mass p D + mass p (C βͺ D)αΆ := by | |
| classical | |
| rw [β h1] | |
| have he := Finset.sum_compl_add_sum (C βͺ D) p | |
| have hu := (Finset.sum_union_inter (sβ:=C) (sβ:=D) (f:=p)) | |
| have hn := mass_nonneg hp (C β© D) | |
| unfold mass at * | |
| linarith | |
| lemma small_case_one (p : P β β) (hp : β y, 0 β€ p y) (h1 : β y, p y = 1) | |
| (C D : Finset P) (lam : β) (hlam : 0 β€ lam) (hlam2 : lam β€ 1/2) | |
| (hC : mass p C β€ lam) : | |
| mass p C β€ 2*lam*mass p D + mass p (C βͺ D)αΆ := by | |
| classical | |
| have hc := mass_cover p hp h1 C D | |
| have hnC := mass_nonneg hp C | |
| have hnD := mass_nonneg hp D | |
| have hnE := mass_nonneg hp (CβͺD)αΆ | |
| have hp2 : mass p C β€ 1/2 := hC.trans hlam2 | |
| nlinarith | |
| end WeakPinned.SmallFiber | |
| namespace WeakPinned.Hierarchy.Depth | |
| open MeasureTheory | |
| variable {P : Type u4} [Fintype P] [DecidableEq P] | |
| variable (d : Depth P) | |
| lemma nongiant_share_overlap {r : β} {x y : P} (hg : Β¬ d.sourceGiant x r) | |
| (hy : y β d.cell r x) : 1 β€ d.pairOverlap r x y := by | |
| classical | |
| have hs := (d.mem_cell r x y).mp hy | |
| rw [d.pairOverlap_formula, ite_eq_left hs] | |
| by_cases he : (d.giants r).Nonempty | |
| Β· have hx : x β d.giant r := by | |
| intro hx | |
| exact hg ((d.sourceGiant_mem_giant x r).mpr β¨he,hxβ©) | |
| have hy' : y β d.giant r := by | |
| intro hy' | |
| have hgy := (d.sourceGiant_mem_giant y r).mpr β¨he,hy'β© | |
| exact hg (by simpa only [sourceGiant, d.cell_eq_of_share hs] using hgy) | |
| simp [giantIndicator,outsideIndicator,he,hx,hy'] | |
| Β· simp [giantIndicator,outsideIndicator,he] | |
| end WeakPinned.Hierarchy.Depth | |
| namespace WeakPinned.SmallFiber | |
| open MeasureTheory Hierarchy | |
| variable {P : Type u5} [Fintype P] [DecidableEq P] | |
| lemma mass_as_sum (p : P β β) (C : Finset P) : | |
| mass p C = β y, if y β C then p y else 0 := by | |
| classical | |
| simp [mass] | |
| lemma mass_as_sum_off (p : P β β) (x : P) (hx : p x = 0) (C : Finset P) : | |
| mass p C = β y, if x β y β§ y β C then p y else 0 := by | |
| classical | |
| rw [mass_as_sum] | |
| apply Finset.sum_congr rfl | |
| intro y _ | |
| by_cases hxy : x = y | |
| Β· subst y; simp [hx] | |
| Β· simp [hxy] | |
| lemma nongiant_mass_bound (d : Depth P) (p : P β β) (hp : β y, 0 β€ p y) | |
| (x : P) (r : β) : | |
| (if Β¬d.sourceGiant x r then mass p (d.cell r x) else 0) β€ | |
| β y, p y * d.pairOverlap r x y := by | |
| classical | |
| by_cases hg : d.sourceGiant x r | |
| Β· simp only [hg,not_true_eq_false,ite_false] | |
| exact Finset.sum_nonneg (fun y _ => mul_nonneg (hp y) (d.pairOverlap_bounds r x y).1) | |
| Β· simp only [hg,not_false_eq_true,ite_true] | |
| rw [mass_as_sum] | |
| apply Finset.sum_le_sum | |
| intro y _ | |
| by_cases hy : y β d.cell r x | |
| Β· simp only [hy,ite_true] | |
| nlinarith [d.nongiant_share_overlap hg hy, hp y] | |
| Β· simpa only [hy,ite_false] using mul_nonneg (hp y) (d.pairOverlap_bounds r x y).1 | |
| lemma integral_open_interval (a b : β) : | |
| (β« r : β, if a < r β§ r < b then (1:β) else 0) = max (b-a) 0 := by | |
| have he : (fun r : β => if a < r β§ r < b then (1:β) else 0) = | |
| (Set.Ioo a b).indicator (fun _ : β => (1:β)) := by | |
| funext r; simp [Set.indicator_apply] | |
| rw [he, integral_indicator measurableSet_Ioo] | |
| simp [integral_const,measureReal_def,Real.volume_Ioo,ENNReal.toReal_ofReal'] | |
| lemma integral_closed_interval (a b : β) : | |
| (β« r : β, if a β€ r β§ r β€ b then (1:β) else 0) = max (b-a) 0 := by | |
| have he : (fun r : β => if a β€ r β§ r β€ b then (1:β) else 0) = | |
| (Set.Icc a b).indicator (fun _ : β => (1:β)) := by | |
| funext r; simp [Set.indicator_apply] | |
| rw [he, integral_indicator measurableSet_Icc] | |
| simp [integral_const,measureReal_def,Real.volume_Icc,ENNReal.toReal_ofReal'] | |
| lemma integrable_open_interval (a b : β) : | |
| Integrable (fun r : β => if a < r β§ r < b then (1:β) else 0) := by | |
| have he : (fun r : β => if a < r β§ r < b then (1:β) else 0) = | |
| (Set.Ioo a b).indicator (fun _ : β => (1:β)) := by | |
| funext r; simp [Set.indicator_apply] | |
| rw [he, integrable_indicator_iff measurableSet_Ioo] | |
| exact integrableOn_const (by rw [Real.volume_Ioo]; exact ENNReal.ofReal_ne_top) | |
| lemma integrable_closed_interval (a b : β) : | |
| Integrable (fun r : β => if a β€ r β§ r β€ b then (1:β) else 0) := by | |
| have he : (fun r : β => if a β€ r β§ r β€ b then (1:β) else 0) = | |
| (Set.Icc a b).indicator (fun _ : β => (1:β)) := by | |
| funext r; simp [Set.indicator_apply] | |
| rw [he, integrable_indicator_iff measurableSet_Icc] | |
| exact integrableOn_const (by rw [Real.volume_Icc]; exact ENNReal.ofReal_ne_top) | |
| def minusError (d d' : Depth P) (p : P β β) (x : P) (h H r : β) : β := | |
| mass p (d.cell r x βͺ d'.cell (h-r-H) x)αΆ | |
| def plusError (d d' : Depth P) (p : P β β) (x : P) (h H r : β) : β := | |
| mass p (d.cell r x β© d'.cell (h-r+H) x) | |
| lemma minusError_formula (d d' : Depth P) (p : P β β) (x : P) (hx : p x = 0) | |
| (h H r : β) : | |
| minusError d d' p x h H r = β y, p y * | |
| (if d.value x y < r β§ r < h-H-d'.value x y then (1:β) else 0) := by | |
| classical | |
| rw [minusError,mass_as_sum] | |
| apply Finset.sum_congr rfl | |
| intro y _ | |
| by_cases hxy : x = y | |
| Β· subst y; simp [hx] | |
| Β· simp only [Finset.mem_compl,Finset.mem_union,Depth.mem_cell,Depth.share,hxy,false_or,not_or,not_le] | |
| have he : (d.value x y < r β§ d'.value x y < h-r-H) β | |
| d.value x y < r β§ r < h-H-d'.value x y := by constructor <;> rintro β¨a,bβ© <;> constructor <;> linarith | |
| simp only [he] | |
| split_ifs <;> simp | |
| lemma plusError_formula (d d' : Depth P) (p : P β β) (x : P) (hx : p x = 0) | |
| (h H r : β) : | |
| plusError d d' p x h H r = β y, p y * | |
| (if h+H-d'.value x y β€ r β§ r β€ d.value x y then (1:β) else 0) := by | |
| classical | |
| rw [plusError,mass_as_sum] | |
| apply Finset.sum_congr rfl | |
| intro y _ | |
| by_cases hxy : x = y | |
| Β· subst y; simp [hx] | |
| Β· simp only [Finset.mem_inter,Depth.mem_cell,Depth.share,hxy,false_or] | |
| have he : (r β€ d.value x y β§ h-r+H β€ d'.value x y) β | |
| h+H-d'.value x y β€ r β§ r β€ d.value x y := by constructor <;> rintro β¨a,bβ© <;> constructor <;> linarith | |
| simp only [he] | |
| split_ifs <;> simp | |
| lemma minusError_integrable (d d' : Depth P) (p : P β β) (x : P) (hx : p x = 0) | |
| (h H : β) : Integrable (minusError d d' p x h H) := by | |
| change Integrable (fun r => minusError d d' p x h H r) | |
| simp_rw [minusError_formula d d' p x hx] | |
| exact integrable_finsetSum _ (fun y _ => (integrable_open_interval _ _).const_mul (p y)) | |
| lemma plusError_integrable (d d' : Depth P) (p : P β β) (x : P) (hx : p x = 0) | |
| (h H : β) : Integrable (plusError d d' p x h H) := by | |
| change Integrable (fun r => plusError d d' p x h H r) | |
| simp_rw [plusError_formula d d' p x hx] | |
| exact integrable_finsetSum _ (fun y _ => (integrable_closed_interval _ _).const_mul (p y)) | |
| lemma minusError_integral (d d' : Depth P) (p : P β β) (x : P) (hx : p x = 0) | |
| (h H : β) : (β« r, minusError d d' p x h H r) = | |
| β y, p y * max (h-d.value x y-d'.value x y-H) 0 := by | |
| simp_rw [minusError_formula d d' p x hx] | |
| rw [integral_finsetSum _ (fun y _ => (integrable_open_interval _ _).const_mul (p y))] | |
| simp_rw [integral_const_mul,integral_open_interval] | |
| apply Finset.sum_congr rfl | |
| intro y _ | |
| congr 2; ring | |
| lemma plusError_integral (d d' : Depth P) (p : P β β) (x : P) (hx : p x = 0) | |
| (h H : β) : (β« r, plusError d d' p x h H r) = | |
| β y, p y * max (d.value x y+d'.value x y-h-H) 0 := by | |
| simp_rw [plusError_formula d d' p x hx] | |
| rw [integral_finsetSum _ (fun y _ => (integrable_closed_interval _ _).const_mul (p y))] | |
| simp_rw [integral_const_mul,integral_closed_interval] | |
| apply Finset.sum_congr rfl | |
| intro y _ | |
| congr 2; ring | |
| lemma two_truncations (a H : β) (hH : 0 β€ H) : | |
| max (-a-H) 0 + max (a-H) 0 = max (|a|-H) 0 := by | |
| rcases le_total 0 a with ha | ha | |
| Β· rw [abs_of_nonneg ha,max_eq_right (by linarith : -a-H β€ 0),zero_add] | |
| Β· rw [abs_of_nonpos ha,max_eq_right (by linarith : a-H β€ 0),add_zero] | |
| lemma errors_integral (d d' : Depth P) (p : P β β) (x : P) (hx : p x = 0) | |
| (h H : β) (hH : 0 β€ H) : | |
| (β« r, minusError d d' p x h H r + plusError d d' p x h H r) = | |
| β y, p y * max (|d.value x y+d'.value x y-h|-H) 0 := by | |
| rw [integral_add (minusError_integrable d d' p x hx h H) (plusError_integrable d d' p x hx h H), | |
| minusError_integral d d' p x hx, plusError_integral d d' p x hx,β Finset.sum_add_distrib] | |
| apply Finset.sum_congr rfl | |
| intro y _ | |
| have he : h-d.value x y-d'.value x y-H = -(d.value x y+d'.value x y-h)-H := by ring | |
| rw [he,β mul_add,two_truncations _ H hH] | |
| end WeakPinned.SmallFiber | |
| namespace WeakPinned.SmallFiber | |
| open MeasureTheory Hierarchy | |
| variable {P : Type u6} [Fintype P] [DecidableEq P] | |
| /-- Actual source cell, not a giant-complement occurrence. -/ | |
| def activeMass (d : Depth P) (p : P β β) (x : P) (T lam r : β) : β := by | |
| classical | |
| exact if Β¬d.sourceGiant x r β§ ((d.cell r x).card : β) < T β§ mass p (d.cell r x) < lam | |
| then mass p (d.cell r x) else 0 | |
| def nongiantMass (d : Depth P) (p : P β β) (x : P) (r : β) : β := | |
| if Β¬d.sourceGiant x r then mass p (d.cell r x) else 0 | |
| def straddle (d : Depth P) (x : P) (h H r : β) : β := | |
| if d.sourceGiant x (h-r-H) β§ Β¬d.sourceGiant x (h-r+H) then 1 else 0 | |
| def neighborMass (d d' : Depth P) (p : P β β) (x : P) (T t : β) : β := by | |
| classical | |
| exact β y, p y * (if x β (d.smallNeighbors y T).erase y then d'.outsideIndicator t y else 0) | |
| lemma neighborMass_nonneg (d d' : Depth P) (p : P β β) (hp : β y, 0 β€ p y) | |
| (x : P) (T t : β) : 0 β€ neighborMass d d' p x T t := by | |
| classical | |
| exact Finset.sum_nonneg (fun y _ => mul_nonneg (hp y) (by split_ifs; exact (d'.outsideIndicator_bounds t y).1; rfl)) | |
| omit [DecidableEq P] in | |
| lemma nongiantMass_nonneg (d : Depth P) (p : P β β) (hp : β y, 0 β€ p y) | |
| (x : P) (r : β) : 0 β€ nongiantMass d p x r := by | |
| unfold nongiantMass | |
| split_ifs <;> first | exact mass_nonneg hp _ | rfl | |
| lemma case_three_bound (d d' : Depth P) (p : P β β) (hp : β y, 0 β€ p y) | |
| (x : P) (hx : p x = 0) (r t T : β) | |
| (hT : ((d.cell r x).card : β) < T) (hg : d'.sourceGiant x t) : | |
| mass p (d.cell r x \ d'.cell t x) β€ neighborMass d d' p x T t := by | |
| classical | |
| rw [mass_as_sum_off p x hx] | |
| unfold neighborMass | |
| apply Finset.sum_le_sum | |
| intro y _ | |
| by_cases hy : x β y β§ y β d.cell r x \ d'.cell t x | |
| Β· obtain β¨hxy,hyDβ© := hy | |
| obtain β¨hyU,hyVβ© := Finset.mem_sdiff.mp hyD | |
| have hn : x β (d.smallNeighbors y T).erase y := | |
| Finset.mem_erase.mpr β¨hxy, d.source_mem_smallNeighbors y x r T hyU hTβ© | |
| have hG : d'.cell t x β d'.giants t := (d'.mem_giants t _).mpr β¨d'.cell_mem_cells t x,hgβ© | |
| have he : (d'.giants t).Nonempty := β¨_,hGβ© | |
| have hyo : y β d'.giant t := by rwa [d'.giant_eq hG] | |
| simp [hxy,hyD,hn,Depth.outsideIndicator,he,hyo] | |
| Β· simp only [hy,ite_false] | |
| exact mul_nonneg (hp y) (by split_ifs; exact (d'.outsideIndicator_bounds t y).1; rfl) | |
| /-- The pointwise small-fiber bound. The only independent error is the exact | |
| pair of intervals already evaluated. -/ | |
| lemma active_pointwise (d d' : Depth P) (p : P β β) (hp : β y, 0 β€ p y) | |
| (h1 : β y, p y = 1) (x : P) (hx : p x = 0) (h H T lam r : β) | |
| (hlam : 0 β€ lam) (hlam2 : lam β€ 1/2) : | |
| activeMass d p x T lam r β€ | |
| 2*lam*nongiantMass d' p x (h-r-H) + lam*straddle d' x h H r + | |
| minusError d d' p x h H r + plusError d d' p x h H r + | |
| neighborMass d d' p x T (h-r+H) := by | |
| classical | |
| have hminus : 0 β€ minusError d d' p x h H r := mass_nonneg hp _ | |
| have hplus : 0 β€ plusError d d' p x h H r := mass_nonneg hp _ | |
| have hnbr := neighborMass_nonneg d d' p hp x T (h-r+H) | |
| have hng := nongiantMass_nonneg d' p hp x (h-r-H) | |
| have hstr : 0 β€ straddle d' x h H r := by unfold straddle; split_ifs <;> norm_num | |
| unfold activeMass | |
| split_ifs with ha | |
| Β· obtain β¨haG,haT,haPβ© := ha | |
| by_cases hg : d'.sourceGiant x (h-r-H) | |
| Β· by_cases hg' : d'.sourceGiant x (h-r+H) | |
| Β· have hthree := case_three_bound d d' p hp x hx r (h-r+H) T haT hg' | |
| have he := mass_diff_inter p (d.cell r x) (d'.cell (h-r+H) x) | |
| change mass p (d.cell r x) = _ + plusError d d' p x h H r at he | |
| nlinarith | |
| Β· have hs : straddle d' x h H r = 1 := by simp [straddle,hg,hg'] | |
| rw [hs] | |
| nlinarith | |
| Β· have hone := small_case_one p hp h1 (d.cell r x) (d'.cell (h-r-H) x) lam hlam hlam2 haP.le | |
| have hnge : nongiantMass d' p x (h-r-H) = mass p (d'.cell (h-r-H) x) := by | |
| simp [nongiantMass,hg] | |
| rw [hnge] | |
| change mass p (d.cell r x) β€ _ + minusError d d' p x h H r at hone | |
| nlinarith | |
| Β· positivity | |
| omit [DecidableEq P] in | |
| lemma nongiantMass_measurable (d : Depth P) (p : P β β) (x : P) : | |
| Measurable (nongiantMass d p x) := by | |
| classical | |
| let f : Finset P β β := fun C => if Β¬Fintype.card P < 2*C.card then mass p C else 0 | |
| have h := (measurable_of_finite f).comp (d.measurable_cell x) | |
| have he : nongiantMass d p x = f β (fun r => d.cell r x) := by | |
| funext r | |
| by_cases hg : Fintype.card P < 2*(d.cell r x).card | |
| Β· simp [nongiantMass,f,Depth.sourceGiant,hg] | |
| Β· simp [nongiantMass,f,Depth.sourceGiant,hg] | |
| rw [he] | |
| exact h | |
| omit [DecidableEq P] in | |
| lemma activeMass_measurable (d : Depth P) (p : P β β) (x : P) (T lam : β) : | |
| Measurable (activeMass d p x T lam) := by | |
| classical | |
| let f : Finset P β β := fun C => if Β¬Fintype.card P < 2*C.card β§ (C.card : β) < T β§ mass p C < lam | |
| then mass p C else 0 | |
| have h := (measurable_of_finite f).comp (d.measurable_cell x) | |
| have he : activeMass d p x T lam = f β (fun r => d.cell r x) := by | |
| funext r | |
| by_cases hg : Fintype.card P < 2*(d.cell r x).card | |
| Β· simp [activeMass,f,Depth.sourceGiant,hg] | |
| Β· simp [activeMass,f,Depth.sourceGiant,hg,Nat.not_lt.mp hg] | |
| rw [he] | |
| exact h | |
| omit [DecidableEq P] in | |
| lemma nongiantMass_integrable (d : Depth P) (hn : 2 β€ Fintype.card P) | |
| (p : P β β) (hp : β y, 0 β€ p y) (h1 : β y, p y = 1) (x : P) (hx : p x = 0) : | |
| Integrable (nongiantMass d p x) := by | |
| classical | |
| apply Depth.integrable_supported_Icc (nongiantMass_measurable d p x) (a:=-d.radius) (b:=d.radius) (C:=1) | |
| Β· intro r | |
| rw [Real.norm_eq_abs,abs_of_nonneg (nongiantMass_nonneg d p hp x r)] | |
| unfold nongiantMass | |
| split_ifs <;> first | exact mass_le_one hp h1 _ | norm_num | |
| Β· intro r hr | |
| by_cases hlo : r β€ -d.radius | |
| Β· have hG : d.sourceGiant x r := by | |
| unfold Depth.sourceGiant | |
| rw [d.cell_of_low hlo x,Finset.card_univ] | |
| omega | |
| simp [nongiantMass,hG] | |
| Β· have hhi : d.radius < r := by | |
| by_contra! hhi | |
| exact hr β¨(not_le.mp hlo).le,hhiβ© | |
| simp only [nongiantMass] | |
| rw [d.cell_of_high hhi x] | |
| have he : mass p {x} = 0 := by simp [mass,hx] | |
| split_ifs <;> simp [he] | |
| omit [DecidableEq P] in | |
| lemma activeMass_integrable (d : Depth P) (hn : 2 β€ Fintype.card P) | |
| (p : P β β) (hp : β y, 0 β€ p y) (h1 : β y, p y = 1) (x : P) (hx : p x = 0) | |
| (T lam : β) : Integrable (activeMass d p x T lam) := by | |
| classical | |
| apply (nongiantMass_integrable d hn p hp h1 x hx).mono' | |
| (activeMass_measurable d p x T lam).aestronglyMeasurable | |
| filter_upwards with r | |
| unfold activeMass nongiantMass | |
| split_ifs <;> simp_all [abs_of_nonneg (mass_nonneg hp (d.cell r x)),mass_nonneg hp] | |
| lemma straddle_integrable (d : Depth P) (hn : 2 β€ Fintype.card P) (x : P) (h H : β) : | |
| Integrable (straddle d x h H) := by | |
| classical | |
| have he : straddle d x h H = | |
| (Set.Ico (h-H-d.sourceM x) (h+H-d.sourceM x)).indicator (fun _ : β => (1:β)) := by | |
| funext r | |
| simp only [straddle,d.sourceGiant_cutoff hn,not_le,Set.indicator_apply,Set.mem_Ico] | |
| congr 1 | |
| apply propext | |
| constructor <;> rintro β¨a,bβ© <;> constructor <;> linarith | |
| rw [he,integrable_indicator_iff measurableSet_Ico] | |
| exact integrableOn_const (by rw [Real.volume_Ico]; exact ENNReal.ofReal_ne_top) | |
| lemma neighborMass_integrable (d d' : Depth P) (hn : 2 β€ Fintype.card P) | |
| (p : P β β) (x : P) (T : β) : Integrable (neighborMass d d' p x T) := by | |
| classical | |
| unfold neighborMass | |
| apply integrable_finsetSum | |
| intro y _ | |
| apply Integrable.const_mul | |
| by_cases h : x β (d.smallNeighbors y T).erase y | |
| Β· simpa only [h,ite_true] using d'.integrable_outsideIndicator hn y | |
| Β· simp only [h,ite_false] | |
| exact integrable_zero _ _ _ | |
| lemma neighborMass_integral (d d' : Depth P) (hn : 2 β€ Fintype.card P) | |
| (p : P β β) (x : P) (T : β) : | |
| (β« r, neighborMass d d' p x T r) = | |
| β y, p y * (if x β (d.smallNeighbors y T).erase y then d'.potential y else 0) := by | |
| classical | |
| unfold neighborMass | |
| rw [integral_finsetSum] | |
| Β· apply Finset.sum_congr rfl | |
| intro y _ | |
| rw [integral_const_mul] | |
| by_cases hh : x β (d.smallNeighbors y T).erase y | |
| Β· simp only [hh,ite_true,Depth.potential] | |
| Β· simp only [hh,ite_false,integral_zero] | |
| Β· intro y _ | |
| apply Integrable.const_mul | |
| by_cases hh : x β (d.smallNeighbors y T).erase y | |
| Β· simpa only [hh,ite_true] using d'.integrable_outsideIndicator hn y | |
| Β· simp only [hh,ite_false]; exact integrable_zero _ _ _ | |
| end WeakPinned.SmallFiber | |
| namespace WeakPinned.SmallFiber | |
| open MeasureTheory Hierarchy | |
| variable {P : Type u7} [Fintype P] [DecidableEq P] | |
| lemma pairMass_integrable (d : Depth P) (hn : 2 β€ Fintype.card P) | |
| (p : P β β) (x : P) (hx : p x = 0) : | |
| Integrable (fun r => β y, p y * d.pairOverlap r x y) := by | |
| apply integrable_finsetSum | |
| intro y _ | |
| by_cases hxy : x = y | |
| Β· subst y; simp only [hx,zero_mul]; exact integrable_zero _ _ _ | |
| Β· exact (d.integrable_pairOverlap hn x y hxy).const_mul _ | |
| lemma integral_nongiantMass_bound (d : Depth P) (hn : 2 β€ Fintype.card P) | |
| (p : P β β) (hp : β y, 0 β€ p y) (h1 : β y, p y = 1) (x : P) (hx : p x = 0) : | |
| (β« r, nongiantMass d p x r) β€ β y, p y * β« r, d.pairOverlap r x y := by | |
| calc | |
| _ β€ β« r : β, β y, p y * d.pairOverlap r x y := | |
| integral_mono (nongiantMass_integrable d hn p hp h1 x hx) (pairMass_integrable d hn p x hx) | |
| (fun r => nongiant_mass_bound d p hp x r) | |
| _ = _ := by | |
| rw [integral_finsetSum] | |
| Β· exact Finset.sum_congr rfl (fun y _ => integral_const_mul (p y) _) | |
| Β· intro y _ | |
| by_cases hxy : x = y | |
| Β· subst y; simp only [hx,zero_mul]; exact integrable_zero _ _ _ | |
| Β· exact (d.integrable_pairOverlap hn x y hxy).const_mul _ | |
| /-- The local small-fiber bound for two entire realized hierarchies. This | |
| includes the exact signed-depth error; it will vanish at finite places | |
| and have an exponentially small grid mean at archimedean places. -/ | |
| lemma active_integral (d d' : Depth P) (hn : 2 β€ Fintype.card P) | |
| (p : P β β) (hp : β y, 0 β€ p y) (h1 : β y, p y = 1) | |
| (x : P) (hx : p x = 0) (h H T lam : β) | |
| (hH : 0 β€ H) (hlam : 0 β€ lam) (hlam2 : lam β€ 1/2) : | |
| (β« r, activeMass d p x T lam r) β€ | |
| 2*lam*(β y, p y * β« r, d'.pairOverlap r x y) + 2*lam*H + | |
| (β y, p y * max (|d.value x y+d'.value x y-h|-H) 0) + | |
| β y, p y * (if x β (d.smallNeighbors y T).erase y then d'.potential y else 0) := by | |
| classical | |
| have hshiftβ (r : β) : h-r-H = (h-H)-r := by ring | |
| have hshiftβ (r : β) : h-r+H = (h+H)-r := by ring | |
| have hiβ : Integrable (fun r => 2*lam*nongiantMass d' p x (h-r-H)) := by | |
| simp_rw [hshiftβ] | |
| exact ((integrable_comp_sub_left _ (h-H)).mpr (nongiantMass_integrable d' hn p hp h1 x hx)).const_mul _ | |
| have hiβ : Integrable (fun r => lam*straddle d' x h H r) := | |
| (straddle_integrable d' hn x h H).const_mul _ | |
| have hiβ := (minusError_integrable d d' p x hx h H).add (plusError_integrable d d' p x hx h H) | |
| have hiβ : Integrable (fun r => neighborMass d d' p x T (h-r+H)) := by | |
| simp_rw [hshiftβ] | |
| exact (integrable_comp_sub_left _ (h+H)).mpr (neighborMass_integrable d d' hn p x T) | |
| have hb := integral_mono (activeMass_integrable d hn p hp h1 x hx T lam) | |
| (((hiβ.add hiβ).add hiβ).add hiβ) (fun r => by | |
| have hh := active_pointwise d d' p hp h1 x hx h H T lam r hlam hlam2 | |
| dsimp only [Pi.add_apply] | |
| linarith) | |
| simp only [Pi.add_apply] at hb | |
| have heβ := integral_add ((hiβ.add hiβ).add hiβ) hiβ | |
| have heβ := integral_add (hiβ.add hiβ) hiβ | |
| have heβ := integral_add hiβ hiβ | |
| simp only [Pi.add_apply] at heβ heβ heβ | |
| rw [heβ,heβ,heβ] at hb | |
| rw [integral_const_mul,integral_const_mul] at hb | |
| simp_rw [hshiftβ,hshiftβ] at hb | |
| rw [integral_sub_left_eq_self,integral_sub_left_eq_self, | |
| neighborMass_integral d d' hn p x T,errors_integral d d' p x hx h H hH] at hb | |
| have hs : (β« r, straddle d' x h H r) = 2*H := d'.straddle_integral hn x h H hH | |
| rw [hs] at hb | |
| have hng := mul_le_mul_of_nonneg_left (integral_nongiantMass_bound d' hn p hp h1 x hx) | |
| (show 0 β€ 2*lam by positivity) | |
| linarith | |
| /-- Exact edge law induced by fiber sampling; no independence of fiber | |
| labels or levels is postulated. -/ | |
| def edgeLaw {I : Type u8} [Fintype I] (w : I β β) (p : I β P β β) (x : I β P) (a b : P) : β := | |
| β i, if x i = a then w i * p i b else 0 | |
| lemma fiber_neighbor_bound {I : Type u9} [Fintype I] | |
| (d d' : Depth P) (hn : 2 β€ Fintype.card P) | |
| (w : I β β) (p : I β P β β) (x : I β P) | |
| (B Ο : β) (hB : 0 β€ B) (hΟ : 0 < Ο) (hΟ1 : Ο β€ 1) | |
| (hdom : β a b, a β b β edgeLaw w p x a b β€ B/((Fintype.card P:β)*((Fintype.card P:β)-1))) : | |
| (β i, w i * β y, p i y * | |
| (if x i β (d.smallNeighbors y (Ο*Fintype.card P)).erase y then d'.potential y else 0)) β€ | |
| B*Ο/Fintype.card P * β y, d'.potential y := by | |
| classical | |
| have hn0 : 0 < (Fintype.card P:β) := by exact_mod_cast (show 0 < Fintype.card P by omega) | |
| have hn1 : 0 < (Fintype.card P:β)-1 := by | |
| have : (2:β) β€ Fintype.card P := by exact_mod_cast hn | |
| linarith | |
| have hid (y : P) : | |
| (β i, w i * (p i y * (if x i β (d.smallNeighbors y (Ο*Fintype.card P)).erase y then d'.potential y else 0))) = | |
| (β a β (d.smallNeighbors y (Ο*Fintype.card P)).erase y, edgeLaw w p x a y) * d'.potential y := by | |
| rw [Finset.sum_mul] | |
| simp only [edgeLaw,Finset.sum_mul] | |
| rw [Finset.sum_comm] | |
| apply Finset.sum_congr rfl | |
| intro i _ | |
| rw [β Finset.sum_mul] | |
| have he : (β a β (d.smallNeighbors y (Ο*Fintype.card P)).erase y, | |
| if x i = a then w i*p i y else 0) = | |
| if x i β (d.smallNeighbors y (Ο*Fintype.card P)).erase y then w i*p i y else 0 := by | |
| simp [eq_comm] | |
| rw [he] | |
| split_ifs <;> ring | |
| simp_rw [Finset.mul_sum] | |
| rw [Finset.sum_comm] | |
| simp_rw [hid] | |
| have hb (y : P) : (β a β (d.smallNeighbors y (Ο*Fintype.card P)).erase y, edgeLaw w p x a y) β€ B*Ο/Fintype.card P := by | |
| calc | |
| _ β€ ((d.smallNeighbors y (Ο*Fintype.card P)).erase y).card * | |
| (B/((Fintype.card P:β)*((Fintype.card P:β)-1))) := by | |
| calc | |
| _ β€ β a β (d.smallNeighbors y (Ο*Fintype.card P)).erase y, | |
| B/((Fintype.card P:β)*((Fintype.card P:β)-1)) := | |
| Finset.sum_le_sum (fun a ha => hdom a y (Finset.ne_of_mem_erase ha)) | |
| _ = _ := by simp | |
| _ β€ (Ο*((Fintype.card P:β)-1)) * (B/((Fintype.card P:β)*((Fintype.card P:β)-1))) := | |
| mul_le_mul_of_nonneg_right (d.smallNeighbors_erase_bound hn y Ο hΟ hΟ1) (by positivity) | |
| _ = _ := by field_simp | |
| exact Finset.sum_le_sum (fun y _ => mul_le_mul_of_nonneg_right (hb y) (d'.potential_nonneg y)) | |
| end WeakPinned.SmallFiber | |
| end | |
| end | |
| end | |
| end | |
| end | |
| end | |
| end OAI | |