Verified DeepPoly Sigmoid Relaxation #
This module implements linear relaxations for the sigmoid activation function, enabling Symbolic Interval Propagation for networks using sigmoid/logistic units.
The Sigmoid Function #
σ(x) = 1 / (1 + exp(-x))
Key properties:
- Strictly monotone increasing
- Range: (0, 1)
- σ'(x) = σ(x) · (1 - σ(x))
- Convex for x < 0, concave for x > 0 (inflection at x = 0)
Relaxation Strategy #
Unlike ReLU (piecewise linear), sigmoid requires careful handling:
Monotonicity bounds: Since σ is increasing, σ(l) ≤ σ(x) ≤ σ(u) for x ∈ [l, u]
Secant line: The chord from (l, σ(l)) to (u, σ(u))
Main Results #
sigmoid_strictMono- Sigmoid is strictly monotone increasingsigmoid_relaxation_sound- Soundness of monotonicity-based bounds
Real Linear Bounds (for transcendental functions) #
A linear bound with real coefficients: y = slope · x + bias
Instances For
Real symbolic bound for transcendental activations
- lower : RealLinearBound
- upper : RealLinearBound
Instances For
Sigmoid Definition and Basic Properties #
The sigmoid (logistic) function: σ(x) = 1 / (1 + exp(-x))
Instances For
Sigmoid is always less than 1
Sigmoid is bounded in [0, 1]
Monotonicity #
Sigmoid is strictly monotone increasing
Relaxation Bounds #
Compute sigmoid relaxation using monotonicity bounds.
For x ∈ [l, u], we use:
- Lower bound: constant σ(l)
- Upper bound: constant σ(u)
This gives tight bounds while being simple to verify.
Equations
- LeanCert.ML.Symbolic.getSigmoidRelaxation l u = { lower := { slope := 0, bias := LeanCert.ML.Symbolic.sigmoid l }, upper := { slope := 0, bias := LeanCert.ML.Symbolic.sigmoid u } }
Instances For
Main soundness theorem for sigmoid relaxation.
For any x in [l, u], the sigmoid value is bounded: σ(l) ≤ σ(x) ≤ σ(u)
Computable Rational Approximations #
Rational lower bound approximation for sigmoid. These are conservative (provably ≤ actual sigmoid).
Equations
- One or more equations did not get rendered due to their size.
Instances For
Rational upper bound approximation for sigmoid. These are conservative (provably ≥ actual sigmoid).
Equations
- One or more equations did not get rendered due to their size.
Instances For
Computable sigmoid relaxation for interval propagation
Equations
- One or more equations did not get rendered due to their size.
Instances For
Secant Line (for future tighter bounds) #
The secant line through (l, σ(l)) and (u, σ(u)). y = σ(l) + λ · (x - l) where λ = (σ(u) - σ(l)) / (u - l)
Equations
- One or more equations did not get rendered due to their size.
Instances For
The secant passes through (l, σ(l))
The secant passes through (u, σ(u)) when l < u
Derivative #
The derivative of sigmoid: σ'(x) = σ(x) · (1 - σ(x))
This is a key identity. The derivative is always positive and achieves maximum 1/4 at x = 0.