import Mathlib import OAI.Analysis.HardSphere.Geometry.GroundPositionLaw import OAI.Analysis.HardSphere.Geometry.SpatialScalarSquare import OAI.Analysis.HardSphere.Geometry.MollifiedCloseJoint 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 open MeasureTheory Set Filter open scoped ComplexConjugate lemma finset_erase_recursion_on {S : Type*} [DecidableEq S] (a : Finset S → ℝ) (P : Finset S → Prop) (hP : ∀ A s, P A → P (A.erase s)) (q : ℝ) (hq : 0≤q) (h0 : a ∅≤1) (hr : ∀ A : Finset S, P A → A.Nonempty → (A.card:ℝ)*a A≤q*∑ s∈A, a (A.erase s)) : ∀ A : Finset S, P A → a A≤q^A.card := by intro A induction A using Finset.strongInductionOn with | _ A ih => intro hPA by_cases hA : A.Nonempty · have hc : 0<(A.card:ℝ) := by exact_mod_cast hA.card_pos have hs : (∑ s∈A, a (A.erase s))≤(A.card:ℝ)*q^(A.card-1) := by calc _ ≤ ∑ _s∈A, q^(A.card-1) := Finset.sum_le_sum fun s hs ↦ by have hh := ih (A.erase s) (Finset.erase_ssubset hs) (hP A s hPA) rwa [Finset.card_erase_of_mem hs] at hh _ = _ := by simp have he : q*((A.card:ℝ)*q^(A.card-1))=(A.card:ℝ)*q^A.card := by rw [show q^A.card=q^(A.card-1)*q by conv_lhs => rw [←Nat.sub_add_cancel hA.card_pos] rw [pow_succ]] ring have ht := (hr A hPA hA).trans ((mul_le_mul_of_nonneg_left hs hq).trans_eq he) exact (mul_le_mul_iff_right₀ hc).mp (by simpa only [mul_comm (A.card:ℝ)] using ht) · have he : A=∅ := Finset.not_nonempty_iff_eq_empty.mp hA simpa [he] using h0 variable {n : ℕ} [Nontrivial (Fin n)] lemma mollifiedCloseJoint_empty_onScalar (L : Length) (s h : ℝ) (φ : ContDiffBump (0 : EuclideanConfiguration (Fin n))) (u : ScalarL2 n L) : (mollifiedCloseJoint L s φ h ∅).onScalar u=u := by apply Lp.ext filter_upwards [(mollifiedCloseJoint L s φ h ∅).coe_onScalar u] with X hX simpa only [mollifiedCloseJoint_apply,Finset.prod_empty,one_mul] using hX lemma groundPositionLaw_le_closeJoint (L : Length) {s h : ℝ} (hs : 0