AFTD Auto-Formalizing Theoretical Domains

bernoulli_mgf_bound_step1

theoremverifiedimported Lean

First derivative of the Hoeffding auxiliary function. Let $L, x \in \bbr$ and suppose $1 - L + L\,e^{-x} > 0$. Then the auxiliary function \[ \varphi(x) \;=\; -L x + \frac{x^2}{8} - \ln\!\bigl(1 - L + L\,e^{-x}\bigr) \] is differentiable at $x$ with derivative \[ \varphi'(x) \;=\; -L + \frac{x}{4} + \frac{L\,e^{-x}}{1 - L + L\,e^{-x}}. \] This is the $\varphi'$ computation used in the proof of $ bernoulli_mgf_bound$.

Statement

set_option relaxedAutoImplicit false in
set_option autoImplicit false in
open Finset BigOperators Real in
lemma bernoulli_mgf_bound_step1 (L x : ℝ) (hpos : 0 < 1 - L + L * Real.exp (-x)) :
    HasDerivAt (fun x => -L * x + x ^ 2 / 8 - Real.log (1 - L + L * Real.exp (-x)))
      (-L + x / 4 + L * Real.exp (-x) / (1 - L + L * Real.exp (-x))) x
Source
TCSlib, `bernoulli_mgf_bound_step1`
Lean proof
By Arhaan Aggarwal, from github.com/Shilun-Allan-Li/tcslib at c8a02591b1e5 (Copyright (c) 2026 Arhaan Aggarwal. All rights reserved, Apache-2.0). Compiled here against leanprover/lean4:v4.33.1, Mathlib v4.33.1; written for leanprover/lean4:v4.25.0.
What was changed in bernoulli_mgf_bound_step1
--- TCSlib/LearningTheory/Hedge/Hoeffding.lean:189 (bernoulli_mgf_bound_step1)
+++ as compiled here
@@ -1,5 +1,4 @@
-/-- Step lemma for `bernoulli_mgf_bound` (Step 5): at any `x` where `1 - L + L e^{-x} > 0`,
-the function `φ(x) = -L x + x²/8 - log(1 - L + L e^{-x})` has derivative
-`φ'(x) = -L + x/4 + L e^{-x} / (1 - L + L e^{-x})`.  This is the `φ'` computation in the
-proof of [MRT18, Lemma D.1]. -/
+set_option relaxedAutoImplicit false in
+set_option autoImplicit false in
+open Finset BigOperators Real in
 lemma bernoulli_mgf_bound_step1 (L x : ℝ) (hpos : 0 < 1 - L + L * Real.exp (-x)) :
@@ -12,3 +11,3 @@
     (h_den.log hne)
-  convert h using 1
+  convert h using 1 <;> try rfl
   field_simp
Verified
07 Oct 2026
Axioms
Classical.choiceQuot.soundpropext
Used by 2
  • bernoulli_mgf_bound_step2Second derivative of the Hoeffding auxiliary function. Let $L, x \in \bbr$ and suppose $1 - L + L\,e^{-x} > 0$. Then the function…
  • bernoulli_mgf_boundBernoulli MGF bound (Hoeffding's lemma). Let $L \in [0,1]$ and let $\eta$ be a real number. Then the moment generating function of the…

Lean source view module on GitHub

set_option relaxedAutoImplicit false inset_option autoImplicit false inopen Finset BigOperators Real in/-- Step lemma for `bernoulli_mgf_bound` (Step 5): at any `x` where `1 - L + L e^{-x} > 0`, the function `φ(x) = -L x + x²/8 - log(1 - L + L e^{-x})` has derivative `φ'(x) = -L + x/4 + L e^{-x} / (1 - L + L e^{-x})`. This is the `φ'` computation in the proof of [MRT18, Lemma D.1]. -/lemma bernoulli_mgf_bound_step1 (L x : ℝ) (hpos : 0 < 1 - L + L * Real.exp (-x)) :    HasDerivAt (fun x => -L * x + x ^ 2 / 8 - Real.log (1 - L + L * Real.exp (-x)))      (-L + x / 4 + L * Real.exp (-x) / (1 - L + L * Real.exp (-x))) x := by  have hne : 1 - L + L * Real.exp (-x) ≠ 0 := hpos.ne'  have h_den : HasDerivAt (fun x => 1 - L + L * Real.exp (-x)) (L * (Real.exp (-x) * -1)) x :=    ((hasDerivAt_neg' x).exp.const_mul L).const_add (1 - L)  have h := (((hasDerivAt_id' x).const_mul (-L)).fun_add ((hasDerivAt_pow 2 x).div_const 8)).fun_sub    (h_den.log hne)  convert h using 1 <;> try rfl  field_simp  ring
See it in the graphDiscuss this resultChallenge it