op75_compact_digit_relu
The compact digit selector is the difference of the two rectified affine functions max(4x−1,0) and max(4x−2,0).
Statement
lemma op75_compact_digit_relu (x : ℝ) :
op75_compact_digit x = max (4*x-1) 0 - max (4*x-2) 0- Source
- OP-75, arXiv:2610.06092, one-pass subset-sum construction; a helper toward interval verification.
- Verified
- 15 Nov 2026
- Axioms
Classical.choiceQuot.soundpropext- Built on 1
- op75_compact_digitThe digit selector x ↦ max(0, min(1, 4x−1)) used in the one-pass reduction.
- Used by 1
- op75_compact_block_effectFor an input in the unit interval and a nonnegative accumulator, the seven-layer block for a nonnegative integer weight transforms the…
The proof, explained
The proof verifies the identity by viewing both sides as piecewise linear functions. After expanding the definition of op75_compact_digit and rewriting all min and max operations into conditional expressions, case splitting reduces the problem to linear real arithmetic on each branch. Every branch is then automatically discharged by linarith, which refutes impossible combinations of inequalities and verifies the linear identity on valid intervals.
The goal is restated as max 0 (min 1 (4 * x - 1)) = max (4 * x - 1) 0 - max (4 * x - 2) 0
Expanding the definition of op75_compact_digit replaces the left-hand side with max 0 (min 1 (4 * x - 1)).
unfold op75_compact_digitAll min and max operations are expressed as piecewise conditionals (if-then-else expressions)
Rewriting with min_def and max_def substitutes every occurrence of min and max with its definition via comparison inequalities.
uses
min_def,max_defsimp only [min_def, max_def]The equality holds for all x ∈ ℝ automation
Case splitting on all conditional branches (`split_ifs`) yields 16 subgoals according to the relative orderings of 4x - 1 and 4x - 2 with 0 and 1. In every branch, linear arithmetic (`linarith`) finishes the proof: either the branch conditions are contradictory (e.g. 1 ≤ 4x - 1 and 4x - 1 ≤ 0) and the branch is refuted, or the branch conditions are consistent and the resulting linear identity (such as 1 = (4x - 1) - (4x - 2)) simplifies to a true equality.
split_ifs <;> linarith
min_def- for any elements a and b in a linear order, min a b is equal to a if a ≤ b, and b otherwise
max_def- for any elements a and b in a linear order, max a b is equal to b if a ≤ b, and a otherwise
- The automated case splitting tactic (`split_ifs`) branches on all boolean conditions independently, generating subcases whose inequalities are geometrically impossible (such as $1 \le 4x - 1$ together with $4x - 1 \le 0$). The linear arithmetic solver (`linarith`) refutes those contradictory cases as well as verifying the identity on the consistent intervals.
Written by a model (gemini-3.8-flash) from the Lean proof and the goal states Lean reported at each step. Lean verified the proof; this explanation is a reading aid and is not itself machine-checked.
Lean source view module on GitHub
Choose a tactic — a marked line — to see the goals Lean had before and after it, as in Lean’s infoview. Step with ← → or j k.
lemma op75_compact_digit_relu (x : ℝ) : op75_compact_digit x = max (4*x-1) 0 - max (4*x-2) 0 := by unfold op75_compact_digit simp only [min_def, max_def] split_ifs <;> linarith