import Mathlib import OAI.Analysis.HardSphere.Geometry.ParticleGradSq namespace OAI noncomputable section open MeasureTheory Filter Set open scoped ENNReal Topology BigOperators open scoped BigOperators ComplexConjugate open MeasureTheory ProbabilityTheory Filter Set open scoped ENNReal NNReal Topology BigOperators open MeasureTheory ProbabilityTheory Real Complex open scoped ENNReal ComplexConjugate open ProbabilityTheory open MeasureTheory Filter Set open scoped ENNReal Topology open MeasureTheory Set open scoped ENNReal namespace HardSphere.SphericalCoordinates open scoped BigOperators noncomputable def activeLabels {α ι : Type*} [Fintype α] (σ : α → ι) : Finset α := by classical exact Finset.univ.filter (fun i ↦ ∃ j, j≠i ∧ σ j=σ i) lemma mem_activeLabels {α ι : Type*} [Fintype α] (σ : α → ι) (i : α) : i∈activeLabels σ ↔ ∃ j, j≠i ∧ σ j=σ i := by classical simp only [activeLabels,Finset.mem_filter,Finset.mem_univ,true_and] lemma inactive_card_le {α ι : Type*} [Fintype α] [Fintype ι] [DecidableEq α] (σ : α → ι) : (activeLabels σ)ᶜ.card≤Fintype.card ι := by classical apply Finset.card_le_card_of_injOn σ (by simp) intro a ha b _ hab by_contra hne have ha' : a∉activeLabels σ := Finset.mem_compl.mp ha apply ha' simp only [activeLabels,Finset.mem_filter,Finset.mem_univ,true_and] exact ⟨b,(fun h ↦ hne h.symm),hab.symm⟩ lemma active_card_lower {α ι : Type*} [Fintype α] [Fintype ι] (σ : α → ι) : Fintype.card α-Fintype.card ι≤(activeLabels σ).card := by classical have h := inactive_card_le σ rw [Finset.card_compl] at h have hc := (activeLabels σ).card_le_univ omega lemma sector_capacity {n : ℕ} {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] {F : (Fin (n+1) → Point) → E} (hF : ContDiff ℝ 1 F) {r l : ℝ} (hr : 0