AFTD Auto-Formalizing Theoretical Domains

relu

def

The rectified linear unit (ReLU) activation function maps each real number x to max(x, 0).

Statement

def relu (x : ℝ) : ℝ
Defined in
arXiv:2610.06092, Section 2.1
Verified
20 Oct 2026
Axioms
none listed
Used by 3
  • relu_nonnegFor any real number x, relu(x) is greater than or equal to zero.
  • evalHiddenLayerEvaluation of a hidden layer of width $k$ on an input vector $x \in \mathbb{R}^k$, computing for each neuron $i$ the rectified linear unit…
  • relu_network_eval_continuousFor every natural number $k$ and every feedforward ReLU neural network net of width $k$ with rational weights and biases, the evaluation…

Read back from the Lean

The function relu, taking a real number $x$ and returning a real number, is defined as the maximum of $x$ and $0$ ($\max(x, 0)$).

Written by a model that saw only the Lean, never the English above. If the two disagree, that is worth a challenge.

Lean source view module on GitHub

/-- The Rectified Linear Unit (ReLU) activation function, defined by relu(x) = max(x, 0). -/
def relu (x : ℝ) : ℝ := max x 0
See it in the graphDiscuss this resultChallenge it