ℝ → ℝ → ℝ
Smooth approximation to max x 0: (x + Real.sqrt (x^2+δ^2))/2.
Smooth approximations to max(x,0) and min(x,z) have strictly positive partial derivatives. Their difference detects a valley between two positive values, while remaining nonpositive at spatial collisions and nonpositive endpoints. These elementary functions will be used for parabolic comparison.
smoothPositive: the smooth approximation (x + √(x² + δ²)) / 2 to max x 0.smoothPositiveSlope: its derivative (1 + x / √(x² + δ²)) / 2.smoothMinimum: the smooth approximation x − smoothPositive δ (x − z) to min x z.smoothValley: the three-point detector smoothMinimum δ x z − smoothPositive δ y.smoothPositive_bounds: for 0 ≤ δ, max x 0 ≤ smoothPositive δ x ≤ max x 0 + δ / 2.smoothMinimum_bounds: for 0 ≤ δ, min x z − δ / 2 ≤ smoothMinimum δ x z ≤ min x z.smoothValley_bounds: for 0 ≤ δ, min x z − max y 0 − δ ≤ smoothValley δ x y z, and smoothValley δ x y z ≤ min x z − max y 0.smoothPositive_hasDeriv, smoothPositiveSlope_bounds, smoothPositive_strictMono: for 0 < δ, smoothPositive δ has derivative smoothPositiveSlope δ, which lies in (0, 1), and smoothPositive δ is strictly monotone.smoothMinimum_strictMono_left, smoothMinimum_strictMono_right: for 0 < δ, smoothMinimum δ is strictly monotone in each argument.smoothValley_hasDeriv: for 0 < δ and functions with derivatives at t, the chain-rule derivative of s ↦ smoothValley δ (f s) (g s) (j s).smooth approximation, positive part, valley detector, smooth minimum, MSC 35R35, MSC 91G20, JEL G13
Above: what it imports. Below: what imports it.
ℝ → ℝ → ℝ
Smooth approximation to max x 0: (x + Real.sqrt (x^2+δ^2))/2.
ℝ → ℝ → ℝ
Slope of the smoothed positive part: (1 + x/Real.sqrt (x^2+δ^2))/2.
ℝ → ℝ → ℝ → ℝ
Smooth approximation to min x z: x - smoothPositive δ (x-z).
ℝ → ℝ → ℝ → ℝ → ℝ
Three-point detector smoothMinimum δ x z - smoothPositive δ y, comparing a smoothed minimum of x and z against a smoothed positive part of y.
∀ (δ : ℝ), Continuous (smoothPositive δ)
∀ {δ : ℝ}, 0 < δ → ∀ (x : ℝ), HasDerivAt (smoothPositive δ) (smoothPositiveSlope δ x) x∀ {δ : ℝ}, 0 < δ → ∀ (x : ℝ), 0 < smoothPositiveSlope δ x ∧ smoothPositiveSlope δ x < 1∀ {δ : ℝ}, 0 ≤ δ → ∀ (x : ℝ), max x 0 ≤ smoothPositive δ x ∧ smoothPositive δ x ≤ max x 0 + δ / 2∀ {δ : ℝ}, 0 ≤ δ → ∀ (x z : ℝ), min x z - δ / 2 ≤ smoothMinimum δ x z ∧ smoothMinimum δ x z ≤ min x z∀ {δ : ℝ}, 0 < δ → StrictMono (smoothPositive δ)∀ {δ : ℝ}, 0 < δ → ∀ (x z : ℝ), HasDerivAt (fun y => smoothMinimum δ y z) (1 - smoothPositiveSlope δ (x - z)) x∀ {δ : ℝ}, 0 < δ → ∀ (x z : ℝ), HasDerivAt (smoothMinimum δ x) (smoothPositiveSlope δ (x - z)) z∀ {δ : ℝ}, 0 < δ → ∀ (z : ℝ), StrictMono fun x => smoothMinimum δ x z∀ {δ : ℝ}, 0 < δ → ∀ (x : ℝ), StrictMono (smoothMinimum δ x)∀ {δ : ℝ}, 0 ≤ δ → ∀ (x y z : ℝ), min x z - max y 0 - δ ≤ smoothValley δ x y z ∧ smoothValley δ x y z ≤ min x z - max y 0∀ {δ t f' g' j' : ℝ} {f g j : ℝ → ℝ}, 0 < δ → HasDerivAt f f' t → HasDerivAt g g' t → HasDerivAt j j' t → HasDerivAt (fun s => smoothValley δ (f s) (g s) (j s)) ((1 - smoothPositiveSlope δ (f t - j t)) * f' + smoothPositiveSlope δ (f t - j t) * j' - smoothPositiveSlope δ (g t) * g') t