import OAI.Analysis.BernoulliCone.HalfspaceGroundstate namespace OAI section noncomputable section open MeasureTheory Set Filter Metric open scoped Topology NNReal ENNReal ContDiff namespace Bernoulli open scoped _root_.Bernoulli variable {d : ℕ} {D : Set (Space d)} lemma dominatedVariation_of_comparison [IsFiniteMeasure (volume.restrict D)] {u v : Space d → ℝ} {G V : Space d → Space d} (hu : H1 D u G) (hv : H10 D v V) (hn : ∀ᵐ x ∂volume.restrict D, 0≤u x) {C : ℝ} (hC : 0w x-u x) (fun x=>W x-G x) → energy D u G≤energy D w W) : (∫ x in D, inner ℝ (G x) (V x))=0 := by apply linear_coefficient_eq_zero _ (∫ x in D, ‖V x‖^2) (inv_pos.mpr hC) intro t ht have htC : |t| * C<1 := by calc |t| * C < C⁻¹*C := mul_lt_mul_of_pos_right ht hC _ = 1 := inv_mul_cancel₀ hC.ne' have hcontrol : ∀ᵐ x ∂volume.restrict D, 0≤u x+t*v x ∧ ((0u x+t*v x) (fun x=>G x+t • V x) (hu.add (hv.1.const_smul t)) (hcontrol.mono fun _ hx=>hx.1) (by simpa only [add_sub_cancel_left] using hv.const_smul t) rw [energy_affine hu.1 hu.2.1 hv.1.2.1 t (hcontrol.mono fun _ hx=>hx.2)] at hc linarith lemma GlobalMinimizer.dominatedVariation {u v : Space d → ℝ} {L : ℝ≥0} (hm : GlobalMinimizer u) (hL : LipschitzWith L u) {a : Space d} {R C : ℝ} (hR : 0