import OAI.Geometry.RCD.Sobolev.BochnerSquareSaturation import OAI.Geometry.RCD.Sobolev.FiniteDimensionalBochnerAE namespace OAI /-! # Exact frame completion from the scalar dimensional Bochner inequality -/ open Finset Set Filter MeasureTheory TopologicalSpace noncomputable section namespace RegularPointCoordinates theorem ae_finite_bochner_bound {X : Type*} [MeasurableSpace X] {m : ℕ} (μ : Measure X) (B : X → Euclidean m →ₗ[ℝ] Euclidean m →ₗ[ℝ] ℝ) (D : X → Euclidean m →ₗ[ℝ] ℝ) (N : ℝ) (h : ∀ a, ∀ᵐ x ∂μ, (D x a)^2≤N*B x a a) : ∀ᵐ x ∂μ, ∀ a, (D x a)^2≤N*B x a a := by obtain ⟨S,hS,hdense⟩ := exists_countable_dense (Euclidean m) let : Countable S := hS.to_subtype filter_upwards [MeasureTheory.ae_all_iff.mpr (fun a : S => h a)] with x hx have hc : IsClosed {a : Euclidean m | (D x a)^2≤N*B x a a} := isClosed_le ((D x).toContinuousLinearMap.continuous.pow 2) (continuous_const.mul (bilinear_diagonal_continuous (B x))) have hall := closure_minimal (fun a ha => hx ⟨a,ha⟩) hc rw [hdense.closure_eq] at hall exact fun a => hall (Set.mem_univ a) theorem dimensional_cross_equality {N r s : ℝ} (hN : 0