The Mathlib Handbook

The volumes of the handbook are not written yet. This site shows the map of Mathlib that they will follow, at Mathlib 4472534b60.

The areas / V15. Real analysis in one variable

Mathlib.Analysis.SpecialFunctions.Sigmoid

59 declarations. Mathlib docs · Source

Sigmoid function

In this file we define the sigmoid function x : ℝ ↦ (1 + exp (-x))⁻¹ and prove some of its analytic properties.

We then show that the sigmoid function can be seen as an order embedding from ℝ to I = [0, 1] and that this embedding is both a topological embedding and a measurable embedding. We also prove that the composition of this embedding with the measurable embedding from a standard Borel space α to ℝ is a measurable embedding from α to I.

Main definitions and results

Sigmoid as a function from ℝ to ℝ

  • Real.sigmoid : the sigmoid function from ℝ to ℝ.
  • Real.sigmoid_strictMono : the sigmoid function is strictly monotone.
  • Real.continuous_sigmoid : the sigmoid function is continuous.
  • Real.tendsto_sigmoid_atTop : the sigmoid function tends to 1 at +∞.
  • Real.tendsto_sigmoid_atBot : the sigmoid function tends to 0 at -∞.
  • Real.hasDerivAt_sigmoid : the derivative of the sigmoid function.
  • Real.analyticAt_sigmoid : the sigmoid function is analytic at every point.

Sigmoid as a function from ℝ to I

  • unitInterval.sigmoid : the sigmoid function from ℝ to I.
  • unitInterval.sigmoid_strictMono : the sigmoid function is strictly monotone.
  • unitInterval.continuous_sigmoid : the sigmoid function is continuous.
  • unitInterval.tendsto_sigmoid_atTop : the sigmoid function tends to 1 at +∞.
  • unitInterval.tendsto_sigmoid_atBot : the sigmoid function tends to 0 at -∞.

Sigmoid as an OrderEmbedding from ℝ to I

  • OrderEmbedding.sigmoid : the sigmoid function as an OrderEmbedding from ℝ to I.
  • Topology.isEmbedding_sigmoid : the sigmoid function from ℝ to I is a topological embedding.
  • measurableEmbedding_sigmoid : the sigmoid function from ℝ to I is a measurable embedding.
  • measurableEmbedding_sigmoid_comp_embeddingReal : the composition of the sigmoid function from ℝ to I with the measurable embedding from a standard Borel space α to ℝ is a measurable embedding from α to I.

Tags

sigmoid, embedding, measurable embedding, topological embedding

def Real.sigmoid E1 #

ℝ → ℝ

The sigmoid function from ℝ to ℝ.

theorem Real.sigmoid_def E0 #

∀ (x : ℝ), x.sigmoid = (1 + Real.exp (-x))⁻¹

theorem Real.sigmoid_zero E0 #

Real.sigmoid 0 = 2⁻¹

theorem Real.sigmoid_pos E1 #

∀ (x : ℝ), 0 < x.sigmoid

theorem Real.sigmoid_nonneg E1 #

∀ (x : ℝ), 0 ≤ x.sigmoid

theorem Real.sigmoid_lt_one E1 #

∀ (x : ℝ), x.sigmoid < 1

theorem Real.sigmoid_le_one E1 #

∀ (x : ℝ), x.sigmoid ≤ 1

theorem Real.sigmoid_strictMono E1 #

StrictMono Real.sigmoid

theorem Real.sigmoid_le_iff E0 #

∀ {a b : ℝ}, a.sigmoid ≤ b.sigmoid ↔ a ≤ b

theorem Real.sigmoid_le E1 #

∀ {a b : ℝ}, a ≤ b → a.sigmoid ≤ b.sigmoid

theorem Real.sigmoid_lt_iff E0 #

∀ {a b : ℝ}, a.sigmoid < b.sigmoid ↔ a < b

theorem Real.sigmoid_lt E1 #

∀ {a b : ℝ}, a < b → a.sigmoid < b.sigmoid

theorem Real.sigmoid_monotone E1 #

Monotone Real.sigmoid

theorem Real.sigmoid_injective E1 #

Function.Injective Real.sigmoid

theorem Real.sigmoid_inj E0 #

∀ {a b : ℝ}, a.sigmoid = b.sigmoid ↔ a = b

theorem Real.sigmoid_neg E1 #

∀ (x : ℝ), (-x).sigmoid = 1 - x.sigmoid

theorem Real.sigmoid_mul_rexp_neg E1 #

∀ (x : ℝ), x.sigmoid * Real.exp (-x) = (-x).sigmoid

theorem Real.range_sigmoid E1 #

Set.range Real.sigmoid = Set.Ioo 0 1

theorem Real.tendsto_sigmoid_atTop E1 #

Filter.Tendsto Real.sigmoid Filter.atTop (nhds 1)

theorem Real.tendsto_sigmoid_atBot E1 #

Filter.Tendsto Real.sigmoid Filter.atBot (nhds 0)

theorem Real.hasDerivAt_sigmoid E1 #

∀ (x : ℝ), HasDerivAt Real.sigmoid (x.sigmoid * (1 - x.sigmoid)) x

theorem Real.deriv_sigmoid E1 #

deriv Real.sigmoid = fun x ↦ x.sigmoid * (1 - x.sigmoid)

theorem analyticAt_sigmoid E1 #

∀ {x : ℝ}, AnalyticAt ℝ Real.sigmoid x

theorem AnalyticAt.sigmoid E1 #

∀ {E : Type u_1} [inst : NormedAddCommGroup E] [inst_1 : NormedSpace ℝ E] {f : E → ℝ} {x : E},
  AnalyticAt ℝ f x → AnalyticAt ℝ (Real.sigmoid ∘ f) x

theorem AnalyticAt.sigmoid' E1 #

∀ {E : Type u_1} [inst : NormedAddCommGroup E] [inst_1 : NormedSpace ℝ E] {f : E → ℝ} {x : E},
  AnalyticAt ℝ f x → AnalyticAt ℝ (fun z ↦ (f z).sigmoid) x

theorem analyticOnNhd_sigmoid E1 #

AnalyticOnNhd ℝ Real.sigmoid Set.univ

theorem AnalyticOnNhd.sigmoid E1 #

∀ {E : Type u_1} [inst : NormedAddCommGroup E] [inst_1 : NormedSpace ℝ E] {f : E → ℝ} {s : Set E},
  AnalyticOnNhd ℝ f s → AnalyticOnNhd ℝ (Real.sigmoid ∘ f) s

theorem analyticOn_sigmoid E1 #

AnalyticOn ℝ Real.sigmoid Set.univ

theorem AnalyticOn.sigmoid E1 #

∀ {E : Type u_1} [inst : NormedAddCommGroup E] [inst_1 : NormedSpace ℝ E] {f : E → ℝ} {s : Set E},
  AnalyticOn ℝ f s → AnalyticOn ℝ (Real.sigmoid ∘ f) s

theorem analyticWithinAt_sigmoid E1 #

∀ {x : ℝ} {s : Set ℝ}, AnalyticWithinAt ℝ Real.sigmoid s x

theorem AnalyticWithinAt.sigmoid E1 #

∀ {E : Type u_1} [inst : NormedAddCommGroup E] [inst_1 : NormedSpace ℝ E] {f : E → ℝ} {s : Set E} {x : E},
  AnalyticWithinAt ℝ f s x → AnalyticWithinAt ℝ (Real.sigmoid ∘ f) s x

theorem contDiff_sigmoid E1 #

ContDiff ℝ ⊤ Real.sigmoid

theorem ContDiff.sigmoid E1 #

∀ {E : Type u_1} [inst : NormedAddCommGroup E] [inst_1 : NormedSpace ℝ E] {f : E → ℝ},
  ContDiff ℝ ⊤ f → ContDiff ℝ ⊤ (Real.sigmoid ∘ f)

theorem differentiable_sigmoid E1 #

Differentiable ℝ Real.sigmoid

theorem Differentiable.sigmoid E1 #

∀ {E : Type u_1} [inst : NormedAddCommGroup E] [inst_1 : NormedSpace ℝ E] {f : E → ℝ},
  Differentiable ℝ f → Differentiable ℝ (Real.sigmoid ∘ f)

theorem differentiableAt_sigmoid E1 #

∀ {x : ℝ}, DifferentiableAt ℝ Real.sigmoid x

theorem DifferentiableAt.sigmoid E1 #

∀ {E : Type u_1} [inst : NormedAddCommGroup E] [inst_1 : NormedSpace ℝ E] {f : E → ℝ} {x : E},
  DifferentiableAt ℝ f x → DifferentiableAt ℝ (Real.sigmoid ∘ f) x

theorem continuous_sigmoid E1 #

Continuous Real.sigmoid

theorem Continuous.sigmoid E1 #

∀ {E : Type u_1} [inst : NormedAddCommGroup E] {f : E → ℝ}, Continuous f → Continuous (Real.sigmoid ∘ f)

def unitInterval.sigmoid E1 #

ℝ → ↑unitInterval

The sigmoid function from ℝ to I.

theorem unitInterval.sigmoid_pos E1 #

∀ (x : ℝ), 0 < unitInterval.sigmoid x

theorem unitInterval.sigmoid_lt_one E1 #

∀ (x : ℝ), unitInterval.sigmoid x < 1

theorem unitInterval.sigmoid_strictMono E1 #

StrictMono unitInterval.sigmoid

theorem unitInterval.sigmoid_le_iff E0 #

∀ {a b : ℝ}, unitInterval.sigmoid a ≤ unitInterval.sigmoid b ↔ a ≤ b

theorem unitInterval.sigmoid_le E1 #

∀ {a b : ℝ}, a ≤ b → unitInterval.sigmoid a ≤ unitInterval.sigmoid b

theorem unitInterval.sigmoid_lt_iff E0 #

∀ {a b : ℝ}, unitInterval.sigmoid a < unitInterval.sigmoid b ↔ a < b

theorem unitInterval.sigmoid_lt E1 #

∀ {a b : ℝ}, a < b → unitInterval.sigmoid a < unitInterval.sigmoid b

theorem unitInterval.sigmoid_monotone E1 #

Monotone unitInterval.sigmoid

theorem unitInterval.sigmoid_injective E1 #

Function.Injective unitInterval.sigmoid

theorem unitInterval.sigmoid_inj E0 #

∀ {a b : ℝ}, unitInterval.sigmoid a = unitInterval.sigmoid b ↔ a = b

theorem unitInterval.continuous_sigmoid E1 #

Continuous unitInterval.sigmoid

theorem unitInterval.sigmoid_neg E1 #

∀ (x : ℝ), unitInterval.sigmoid (-x) = unitInterval.symm (unitInterval.sigmoid x)

theorem unitInterval.range_sigmoid E1 #

Set.range unitInterval.sigmoid = Set.Ioo 0 1

theorem unitInterval.tendsto_sigmoid_atTop E1 #

Filter.Tendsto unitInterval.sigmoid Filter.atTop (nhds 1)

theorem unitInterval.tendsto_sigmoid_atBot E1 #

Filter.Tendsto unitInterval.sigmoid Filter.atBot (nhds 0)

def OrderEmbedding.sigmoid E1 #

ℝ ↪o ↑unitInterval

The Sigmoid function as an OrderEmbedding from ℝ to I.

theorem Topology.isEmbedding_sigmoid E1 #

Topology.IsEmbedding unitInterval.sigmoid

theorem measurableEmbedding_sigmoid E1 #

MeasurableEmbedding unitInterval.sigmoid

theorem measurableEmbedding_sigmoid_comp_embeddingReal E1 #

∀ (α : Type u_2) [inst : MeasurableSpace α] [inst_1 : StandardBorelSpace α],
  MeasurableEmbedding (unitInterval.sigmoid ∘ MeasureTheory.embeddingReal α)