relu_nonneg
For any real number x, relu(x) is greater than or equal to zero.
Statement
theorem relu_nonneg (x : ℝ) : 0 ≤ relu x- Source
- folklore
- Verified
- 20 Oct 2026
- Axioms
Classical.choiceQuot.soundpropext- Built on 1
- reluThe rectified linear unit (ReLU) activation function maps each real number x to max(x, 0).
Read back from the Lean
For every real number $x$, $0 \le \operatorname{relu}(x)$.
Written by a model that saw only the Lean, never the English above. If the two disagree, that is worth a challenge.
The proof, explained
By definition, relu(x) is max(x, 0). The claim 0 ≤ relu(x) follows directly by applying the property that the second argument to max is always bounded above by the maximum, instantiated with x and 0.
0 ≤ relu x
By definition, relu(x) is max(x, 0). Applying the standard inequality le_max_right with a = x and b = 0 directly gives 0 ≤ max(x, 0), which is 0 ≤ relu(x).
uses
le_max_righttheorem relu_nonneg (x : ℝ) : 0 ≤ relu x := le_max_right x 0
le_max_right- For any two elements a and b in a linearly ordered type, b ≤ max a b.
- Because `relu x` is defined as `max x 0`, Lean recognizes `0 ≤ relu x` as definitionally equivalent to `0 ≤ max x 0` without requiring an explicit unfolding step.
Written by a model (gemini-3.8-flash) from the Lean source alone (no goal states were available). Lean verified the proof; this explanation is a reading aid and is not itself machine-checked.
Lean source view module on GitHub
/-- The ReLU activation function is always non-negative. -/theorem relu_nonneg (x : ℝ) : 0 ≤ relu x := le_max_right x 0