import Mathlib 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 namespace PeriodicCutoff lemma transition_derivative (x : ℝ) : HasDerivAt Real.smoothTransition (deriv Real.smoothTransition x) x := ((Real.smoothTransition.contDiff (n := 1)).differentiable (by norm_num) x).hasDerivAt lemma transition_deriv_eq_zero {x : ℝ} (hx : x∉Icc (0:ℝ) 1) : deriv Real.smoothTransition x=0 := by have he : (Real.smoothTransition =ᶠ[𝓝 x] fun _ ↦ (Real.smoothTransition x)) := by rcases not_and_or.mp hx with h | h · have hx : x<0 := lt_of_not_ge h filter_upwards [isOpen_Iio.mem_nhds hx] with y hy rw [Real.smoothTransition.zero_of_nonpos hy.le,Real.smoothTransition.zero_of_nonpos hx.le] · have hx : 1