SlowGuess/NeurIPS_2023_OCR huggingface dataset:
$$
\begin{array}{l} \max  \left(\eta_ {1} (v), \eta_ {2} (v)\right) - \max  \left(\eta_ {1} \left(v ^ {\prime}\right), \eta_ {2} \left(v ^ {\prime}\right)\right) \geq \eta_ {i ^ {\prime}} (v) - \eta_ {i ^ {\prime}} \left(v ^ {\prime}\right) \geq - | v - v ^ {\prime} |, \quad a n d \\ \max  \left(\eta_ {1} (v), \eta_ {2} (v)\right) - \max  \left(\eta_ {1} \left(v ^ {\prime}\right), \eta_ {2} \left(v ^ {\prime}\right)\right) \leq \eta_ {i} (v) - \eta_ {i} \left(v ^ {\prime}\right) \leq | v - v ^ {\prime} |. \\ \end{array}
$$
This proves that  $\max (\eta_1(v),\eta_2(v))$  is 1-Lipschitz. A similar argument works for  $\min (\eta_1(v),\eta_2(v))$ .
Lemma H.2. Let  $\eta :[0,1]\to [-1,1]$  be a 1-Lipschitz function. Define  $\kappa :[0,1]\to [0,1]$  such that  $\kappa (v) = \mathsf{proj}_{[0,1]}(v + \eta (v))$  for every  $v\in [0,1]$ . Define  $\eta^{\prime}:[0,1]\to [-1,1]$  such that  $\eta^{\prime}(v) = \kappa (v) - v$  for every  $v\in [0,1]$ . Then  $\eta^\prime$  is 1-Lipschitz.
Proof. By the definition of  $\kappa$ , we have  $\kappa(v) = \min(\max(v + \eta(v), 0), 1)$ . Therefore,  $\eta'(v) = \min(\max(\eta(v), -v), 1 - v)$ . The lemma is proved by applying Claim H.1 twice.
Lemma H.3. Let  $V \subseteq [a, b]$  be a non-empty set. For some  $m \in \mathbb{R}$ , let  $\varphi : V \to [m, +\infty)$  be a function lower bounded by  $m$ . Define  $\psi : \mathbb{R} \to \mathbb{R}$  such that  $\psi(t) = \sup_{v \in V} (vt - \varphi(v))$ . Then  $\psi$  is a convex function. Moreover, for  $t_1 < t_2$ , we have
$$
a \left(t _ {2} - t _ {1}\right) \leq \psi \left(t _ {2}\right) - \psi \left(t _ {1}\right) \leq b \left(t _ {2} - t _ {1}\right).
$$
Proof. For any  $p\in [0,1],t_1,t_2\in \mathbb{R}$ , and  $v\in V$
$$
v \left(p t _ {1} + (1 - p) t _ {2}\right) - \varphi (v) = p \left(v t _ {1} - \varphi (v)\right) + (1 - p) \left(v t _ {2} - \varphi (v)\right) \leq p \psi \left(t _ {1}\right) + (1 - p) \psi \left(t _ {2}\right).
$$
Taking supremum over  $v\in V$  , we have
$$
\psi \left(p t _ {1} + (1 - p) t _ {2}\right) \leq p \psi \left(t _ {1}\right) + (1 - p) \psi \left(t _ {2}\right).
$$
This proves the convexity of  $\psi$ . Moreover, if  $t_1, t_2 \in \mathbb{R}$  satisfies  $t_1 < t_2$ , then for any  $v \in V$ ,
$$
v t _ {1} - \varphi (v) = v t _ {2} - \varphi (v) + v \left(t _ {1} - t _ {2}\right) \leq v t _ {2} - \varphi (v) + a \left(t _ {1} - t _ {2}\right) \leq \psi \left(t _ {2}\right) - a \left(t _ {2} - t _ {1}\right).
$$
Taking supremum over  $v \in V$ , we have
$$
\psi (t _ {1}) \leq \psi (t _ {2}) + a (t _ {1} - t _ {2}).
$$
$$
v t _ {2} - \varphi (v) = v t _ {1} - \varphi (v) + v \left(t _ {2} - t _ {1}\right) \leq v t _ {1} - \varphi (v) + b \left(t _ {2} - t _ {1}\right) \leq \psi \left(t _ {1}\right) + b \left(t _ {2} - t _ {1}\right).
$$
$$
\psi (t _ {2}) \leq \psi (t _ {1}) + b (t _ {2} - t _ {1}).
$$