AFTD Auto-Formalizing Theoretical Domains

directional_deriv

def

The directional derivative of a Boolean function g on (Fin n → ZMod 2) along direction v is defined by D_v g(x) = g(x + v) + g(x).

Statement

def directional_deriv {n : ℕ} (v : Fin n → ZMod 2) (g : (Fin n → ZMod 2) → ZMod 2) : (Fin n → ZMod 2) → ZMod 2
Defined in
arXiv:2610.32239 Section 2
Verified
26 Oct 2026
Axioms
none listed

Read back from the Lean

Given a natural number $n$, a vector $v : \text{Fin } n \to \mathbb{Z}/2\mathbb{Z}$, and a function $g : (\text{Fin } n \to \mathbb{Z}/2\mathbb{Z}) \to \mathbb{Z}/2\mathbb{Z}$, directional_deriv v g is defined as the function from $\text{Fin } n \to \mathbb{Z}/2\mathbb{Z}$ to $\mathbb{Z}/2\mathbb{Z}$ sending $x \mapsto g(x + v) + g(x)$.

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

/-- Directional derivative of a Boolean function along a direction vector. -/
def directional_deriv {n : ℕ} (v : Fin n → ZMod 2) (g : (Fin n → ZMod 2) → ZMod 2) : (Fin n → ZMod 2) → ZMod 2 := fun x => g (x + v) + g x
See it in the graphDiscuss this resultChallenge it