zzhisthebest/LeanBenchmark huggingface dataset:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

theorem extracted_formal_statement_32.{w, v, u} {Z : Type w} {ι : Type v} {f : ι → Z → ℝ} {Ω : Type u}
  [inst : MeasurableSpace Ω] {X : Ω → Z} {μ : Measure Ω} [inst_1 : IsProbabilityMeasure μ] {n : ℕ}
  [inst_2 : Countable ι] [inst_3 : Nonempty ι] (h𝓕 : ∀ (I : ι), Measurable (f I ∘ X)) {b : ℝ}
  (h𝓕' : ∀ (I : ι) (z : Z), |f I z| ≤ b)
  (this :
    (∫ (x : Fin n → Ω × Ω),
        (fun ω => ⨆ I, ∑ i, (f I (X (ω i).1) - f I (X (ω i).2)) + (fun x => 0) I) x ∂Measure.pi fun x => μ.prod μ) =
      ∫ (x : Fin n → Ω × Ω),
        (fun ω => 2⁻¹ ^ n * ∑ σ, ⨆ I, ∑ i, ↑↑(σ i) * (f I (X (ω i).1) - f I (X (ω i).2)) + (fun x => 0) I)
          x ∂Measure.pi fun x => μ.prod μ) :
  (∫ (x : Fin n → Ω × Ω), (fun ω => ⨆ I, ∑ i, (f I (X (ω i).1) - f I (X (ω i).2))) x ∂Measure.pi fun x => μ.prod μ) =
    ∫ (x : Fin n → Ω × Ω),
      (fun ω => 2⁻¹ ^ n * ∑ σ, ⨆ I, ∑ i, ↑↑(σ i) * (f I (X (ω i).1) - f I (X (ω i).2)))
        x ∂Measure.pi fun x => μ.prod μ := sorry

Tactic state before:
Z : Type w
ι : Type v
f : ι → Z → ℝ
Ω : Type u
inst✝³ : MeasurableSpace Ω
X : Ω → Z
μ : Measure Ω
inst✝² : IsProbabilityMeasure μ
n : ℕ
inst✝¹ : Countable ι
inst✝ : Nonempty ι
h𝓕 : ∀ (I : ι), Measurable (f I ∘ X)
b : ℝ
h𝓕' : ∀ (I : ι) (z : Z), |f I z| ≤ b
this :
  (∫ (x : Fin n → Ω × Ω),
      (fun ω => ⨆ I, ∑ i, (f I (X (ω i).1) - f I (X (ω i).2)) + (fun x => 0) I) x ∂Measure.pi fun x => μ.prod μ) =
    ∫ (x : Fin n → Ω × Ω),
      (fun ω => 2⁻¹ ^ n * ∑ σ, ⨆ I, ∑ i, ↑↑(σ i) * (f I (X (ω i).1) - f I (X (ω i).2)) + (fun x => 0) I)
        x ∂Measure.pi fun x => μ.prod μ
⊢ (∫ (x : Fin n → Ω × Ω), (fun ω => ⨆ I, ∑ i, (f I (X (ω i).1) - f I (X (ω i).2))) x ∂Measure.pi fun x => μ.prod μ) =
    ∫ (x : Fin n → Ω × Ω),
      (fun ω => 2⁻¹ ^ n * ∑ σ, ⨆ I, ∑ i, ↑↑(σ i) * (f I (X (ω i).1) - f I (X (ω i).2))) x ∂Measure.pi fun x => μ.prod μ

Tactic:
simp only [Finset.sum_sub_distrib, add_zero, inv_pow, Int.reduceNeg] at this
    simp only [Finset.sum_sub_distrib, inv_pow, Int.reduceNeg]
    exact this

Tactic state after:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

theorem extracted_formal_statement_33.{w, v} {Z : Type w} {ι : Type v} {f : ι → Z → ℝ} [inst : Nonempty ι]
  {V : (Z → ℝ) → ℝ} (hV₀ : ∀ (f : Z → ℝ), V (-f) = -V f) (a : ℝ)
  (ha : ∀ ⦃a_1 : ℝ⦄, (a_1 ∈ Set.range fun i => |V (f i)|) → a_1 ≤ a) ⦃x : ℝ⦄ (s : Fin 2) (i : ι)
  (eq : (fun i => V (if (↑i.1 == 0) = true then f i.2 else -f i.2)) (s, i) = x) (hax : |V (f i)| ≤ a) : x ≤ a := sorry

Tactic state before:
case h.intro.mk
Z : Type w
ι : Type v
f : ι → Z → ℝ
inst✝ : Nonempty ι
V : (Z → ℝ) → ℝ
hV₀ : ∀ (f : Z → ℝ), V (-f) = -V f
a : ℝ
ha : ∀ ⦃a_1 : ℝ⦄, (a_1 ∈ Set.range fun i => |V (f i)|) → a_1 ≤ a
x : ℝ
s : Fin 2
i : ι
eq : (fun i => V (if (↑i.1 == 0) = true then f i.2 else -f i.2)) (s, i) = x
hax : |V (f i)| ≤ a
⊢ x ≤ a

Tactic:
rw [← eq]
    dsimp
    if h : s.1 == 0 then 
  rw [if_pos h]
  exact le_of_max_le_left hax
else
  rw [if_neg h, hV₀]
  exact le_of_max_le_right hax

Tactic state after:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

theorem extracted_formal_statement_34.{w, v} {Z : Type w} {ι : Type v} {f : ι → Z → ℝ} [inst : Nonempty ι]
  {V : (Z → ℝ) → ℝ} (hV₀ : ∀ (f : Z → ℝ), V (-f) = -V f) (hV₁ : BddAbove (Set.range fun i => |V (f i)|))
  (hV₁' : BddAbove (Set.range fun i => V (if (↑i.1 == 0) = true then f i.2 else -f i.2))) :
  ⨆ i, |V (f i)| = ⨆ i, V (if (↑i.1 == 0) = true then f i.2 else -f i.2) := sorry

Tactic state before:
Z : Type w
ι : Type v
f : ι → Z → ℝ
inst✝ : Nonempty ι
V : (Z → ℝ) → ℝ
hV₀ : ∀ (f : Z → ℝ), V (-f) = -V f
hV₁ : BddAbove (Set.range fun i => |V (f i)|)
hV₁' : BddAbove (Set.range fun i => V (if (↑i.1 == 0) = true then f i.2 else -f i.2))
⊢ ⨆ i, |V (f i)| = ⨆ i, V (if (↑i.1 == 0) = true then f i.2 else -f i.2)

Tactic:
apply le_antisymm
    ·
  apply ciSup_le
  intro i
  apply abs_le'.mpr
  constructor
  · exact le_ciSup hV₁' ⟨(0 : Fin 2), i⟩
  · rw [← hV₀]
    exact le_ciSup hV₁' ⟨(1 : Fin 2), i⟩
    ·
  apply ciSup_le
  rintro ⟨s, i⟩
  apply le_trans _ (le_ciSup hV₁ i)
  if h : s.1 == 0 then 
    rw [if_pos h]
    exact le_abs_self (V (f i))
  else
    rw [if_neg h, hV₀]
    exact neg_le_abs (V (f i))

Tactic state after:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

theorem extracted_formal_statement_35.{w, v, u} {Z : Type w} {ι : Type v} {f : ι → Z → ℝ} {Ω : Type u}
  [inst : MeasurableSpace Ω] {X : Ω → Z} {μ : Measure Ω} [inst_1 : IsProbabilityMeasure μ] {n : ℕ}
  [inst_2 : Countable ι] [inst_3 : Nonempty ι] (h𝓕 : ∀ (I : ι), Measurable (f I ∘ X)) {b : ℝ}
  (h𝓕' : ∀ (I : ι) (z : Z), |f I z| ≤ b) (ω : Fin n → Ω × Ω) :
  let V := fun f => ∑ i, (f (X (ω i).1) - f (X (ω i).2));
  (∀ (f : Z → ℝ), V (-f) = -V f) → ∀ ⦃x : ℝ⦄ (I : ι), (fun i => |V (f i)|) I = x → x ≤ ↑n * (b + b) := sorry

Tactic state before:
case h
Z : Type w
ι : Type v
f : ι → Z → ℝ
Ω : Type u
inst✝³ : MeasurableSpace Ω
X : Ω → Z
μ : Measure Ω
inst✝² : IsProbabilityMeasure μ
n : ℕ
inst✝¹ : Countable ι
inst✝ : Nonempty ι
h𝓕 : ∀ (I : ι), Measurable (f I ∘ X)
b : ℝ
h𝓕' : ∀ (I : ι) (z : Z), |f I z| ≤ b
f' : Fin 2 × ι → Z → ℝ := fun i => if (↑i.1 == 0) = true then f i.2 else -f i.2
ω : Fin n → Ω × Ω
V : (Z → ℝ) → ℝ := fun f => ∑ i, (f (X (ω i).1) - f (X (ω i).2))
hV₀ : ∀ (f : Z → ℝ), V (-f) = -V f
x : ℝ
I : ι
eq : (fun i => |V (f i)|) I = x
⊢ x ≤ ↑n * (b + b)

Tactic:
rw [← eq]
    dsimp [V]
    exact bound_lem h𝓕' ω I

Tactic state after:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

theorem extracted_formal_statement_36.{w, v, u} {Z : Type w} {ι : Type v} {f : ι → Z → ℝ} {Ω : Type u}
  [inst : MeasurableSpace Ω] {X : Ω → Z} {μ : Measure Ω} [inst_1 : IsProbabilityMeasure μ] {n : ℕ}
  [inst_2 : Countable ι] [inst_3 : Nonempty ι] (h𝓕 : ∀ (I : ι), Measurable (f I ∘ X)) {b : ℝ}
  (h𝓕' : ∀ (I : ι) (z : Z), |f I z| ≤ b) (s : Fin 2) (I : ι) (h : (↑s == 0) = true) :
  Measurable ((if (↑(s, I).1 == 0) = true then f (s, I).2 else -f (s, I).2) ∘ X) := sorry

Tactic state before:
Z : Type w
ι : Type v
f : ι → Z → ℝ
Ω : Type u
inst✝³ : MeasurableSpace Ω
X : Ω → Z
μ : Measure Ω
inst✝² : IsProbabilityMeasure μ
n : ℕ
inst✝¹ : Countable ι
inst✝ : Nonempty ι
h𝓕 : ∀ (I : ι), Measurable (f I ∘ X)
b : ℝ
h𝓕' : ∀ (I : ι) (z : Z), |f I z| ≤ b
f' : Fin 2 × ι → Z → ℝ := fun i => if (↑i.1 == 0) = true then f i.2 else -f i.2
s : Fin 2
I : ι
h : (↑s == 0) = true
⊢ Measurable ((if (↑(s, I).1 == 0) = true then f (s, I).2 else -f (s, I).2) ∘ X)

Tactic:
rw [if_pos h]
    dsimp
    exact h𝓕 I

Tactic state after:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

theorem extracted_formal_statement_37.{w, v, u} {Z : Type w} {ι : Type v} {f : ι → Z → ℝ} {Ω : Type u}
  [inst : MeasurableSpace Ω] {X : Ω → Z} {μ : Measure Ω} [inst_1 : IsProbabilityMeasure μ] {n : ℕ}
  [inst_2 : Countable ι] [inst_3 : Nonempty ι] (h𝓕 : ∀ (I : ι), Measurable (f I ∘ X)) {b : ℝ}
  (h𝓕' : ∀ (I : ι) (z : Z), |f I z| ≤ b) (s : Fin 2) (I : ι) (h : ¬(↑s == 0) = true) :
  Measurable ((if (↑(s, I).1 == 0) = true then f (s, I).2 else -f (s, I).2) ∘ X) := sorry

Tactic state before:
Z : Type w
ι : Type v
f : ι → Z → ℝ
Ω : Type u
inst✝³ : MeasurableSpace Ω
X : Ω → Z
μ : Measure Ω
inst✝² : IsProbabilityMeasure μ
n : ℕ
inst✝¹ : Countable ι
inst✝ : Nonempty ι
h𝓕 : ∀ (I : ι), Measurable (f I ∘ X)
b : ℝ
h𝓕' : ∀ (I : ι) (z : Z), |f I z| ≤ b
f' : Fin 2 × ι → Z → ℝ := fun i => if (↑i.1 == 0) = true then f i.2 else -f i.2
s : Fin 2
I : ι
h : ¬(↑s == 0) = true
⊢ Measurable ((if (↑(s, I).1 == 0) = true then f (s, I).2 else -f (s, I).2) ∘ X)

Tactic:
rw [if_neg h]
    dsimp
    exact (h𝓕 I).neg

Tactic state after:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

theorem extracted_formal_statement_38.{w, v, u} {Z : Type w} {ι : Type v} {f : ι → Z → ℝ} {Ω : Type u}
  [inst : MeasurableSpace Ω] {X : Ω → Z} {μ : Measure Ω} [inst_1 : IsProbabilityMeasure μ] {n : ℕ}
  [inst_2 : Countable ι] [inst_3 : Nonempty ι] (h𝓕 : ∀ (I : ι), Measurable (f I ∘ X)) {b : ℝ}
  (h𝓕' : ∀ (I : ι) (z : Z), |f I z| ≤ b) :
  let f' := fun i => if (↑i.1 == 0) = true then f i.2 else -f i.2;
  (∀ (I : Fin 2 × ι), Measurable (f' I ∘ X)) →
    ∀ (s : Fin 2) (I : ι) (z : Z), ¬(↑s == 0) = true → |(if (↑s == 0) = true then f I else -f I) z| ≤ b := sorry

Tactic state before:
Z : Type w
ι : Type v
f : ι → Z → ℝ
Ω : Type u
inst✝³ : MeasurableSpace Ω
X : Ω → Z
μ : Measure Ω
inst✝² : IsProbabilityMeasure μ
n : ℕ
inst✝¹ : Countable ι
inst✝ : Nonempty ι
h𝓕 : ∀ (I : ι), Measurable (f I ∘ X)
b : ℝ
h𝓕' : ∀ (I : ι) (z : Z), |f I z| ≤ b
f' : Fin 2 × ι → Z → ℝ := fun i => if (↑i.1 == 0) = true then f i.2 else -f i.2
h𝓕₂ : ∀ (I : Fin 2 × ι), Measurable (f' I ∘ X)
s : Fin 2
I : ι
z : Z
h : ¬(↑s == 0) = true
⊢ |(if (↑s == 0) = true then f I else -f I) z| ≤ b

Tactic:
rw [if_neg h]
    simp only [Pi.neg_apply, abs_neg, f']
    exact h𝓕' I z

Tactic state after:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

theorem extracted_formal_statement_39.{w, v, u} {Z : Type w} {ι : Type v} {f : ι → Z → ℝ} {Ω : Type u}
  [inst : MeasurableSpace Ω] {X : Ω → Z} {μ : Measure Ω} [inst_1 : IsProbabilityMeasure μ] {n : ℕ}
  [inst_2 : Countable ι] [inst_3 : Nonempty ι] (h𝓕 : ∀ (I : ι), Measurable (f I ∘ X)) {b : ℝ}
  (h𝓕' : ∀ (I : ι) (z : Z), |f I z| ≤ b) (ω : Fin n → Ω × Ω) (σ : Signs n) :
  let V := fun f => ∑ i, ↑↑(σ i) * (f (X (ω i).1) - f (X (ω i).2));
  (∀ (f : Z → ℝ), V (-f) = -V f) → ∀ ⦃x : ℝ⦄ (I : ι), (fun i => |V (f i)|) I = x → x ≤ ↑n * (b + b) := sorry

Tactic state before:
case h
Z : Type w
ι : Type v
f : ι → Z → ℝ
Ω : Type u
inst✝³ : MeasurableSpace Ω
X : Ω → Z
μ : Measure Ω
inst✝² : IsProbabilityMeasure μ
n : ℕ
inst✝¹ : Countable ι
inst✝ : Nonempty ι
h𝓕 : ∀ (I : ι), Measurable (f I ∘ X)
b : ℝ
h𝓕' : ∀ (I : ι) (z : Z), |f I z| ≤ b
f' : Fin 2 × ι → Z → ℝ := fun i => if (↑i.1 == 0) = true then f i.2 else -f i.2
ω : Fin n → Ω × Ω
σ : Signs n
V : (Z → ℝ) → ℝ := fun f => ∑ i, ↑↑(σ i) * (f (X (ω i).1) - f (X (ω i).2))
hV₀ : ∀ (f : Z → ℝ), V (-f) = -V f
x : ℝ
I : ι
eq : (fun i => |V (f i)|) I = x
⊢ x ≤ ↑n * (b + b)

Tactic:
rw [← eq]
    dsimp [V]
    exact bound_lem' h𝓕' ω I σ

Tactic state after:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

theorem extracted_formal_statement_0 : 0 ≤ 2⁻¹ := sorry

Tactic state before:
Ω : Type u
inst✝¹ : MeasurableSpace Ω
μ : autoParam (Measure Ω) _auto✝
inst✝ : IsProbabilityMeasure μ
t a b : ℝ
X : Ω → ℝ
ht : 0 ≤ t
hX : AEMeasurable X μ
h : ∀ᵐ (ω : Ω) ∂μ, X ω ∈ Set.Icc a b
h0 : ∫ (x : Ω), X x ∂μ = 0
w : ¬t = 0
f : ℝ → ℝ := fun t => cgf X μ t
hf : f 0 = 0
f' : ℝ → ℝ := fun t => ∫ (x : Ω), X x ∂Measure.tilted μ fun ω => t * X ω
hf' : f' 0 = 0
f'' : ℝ → ℝ := fun t => Var[X; Measure.tilted μ fun ω => t * X ω]
c : ℝ
left✝ : 0 < c ∧ c < t
cq' : f t = f'' c * t ^ 2 / 2
⊢ f'' c * t ^ 2 / 2 ≤ ((b - a) / 2) ^ 2 * t ^ 2 / 2

Tactic:
apply mul_le_mul_of_nonneg_right
    apply mul_le_mul_of_nonneg_right
    dsimp [f'']

Tactic state after:
[case h.h
 Ω : Type u
 inst✝¹ : MeasurableSpace Ω
 μ : autoParam (Measure Ω) _auto✝
 inst✝ : IsProbabilityMeasure μ
 t a b : ℝ
 X : Ω → ℝ
 ht : 0 ≤ t
 hX : AEMeasurable X μ
 h : ∀ᵐ (ω : Ω) ∂μ, X ω ∈ Set.Icc a b
 h0 : ∫ (x : Ω), X x ∂μ = 0
 w : ¬t = 0
 f : ℝ → ℝ := fun t => cgf X μ t
 hf : f 0 = 0
 f' : ℝ → ℝ := fun t => ∫ (x : Ω), X x ∂Measure.tilted μ fun ω => t * X ω
 hf' : f' 0 = 0
 f'' : ℝ → ℝ := fun t => Var[X; Measure.tilted μ fun ω => t * X ω]
 c : ℝ
 left✝ : 0 < c ∧ c < t
 cq' : f t = f'' c * t ^ 2 / 2
 ⊢ Var[X; Measure.tilted μ fun ω => c * X ω] ≤ ((b - a) / 2) ^ 2,
 case h.a0
 Ω : Type u
 inst✝¹ : MeasurableSpace Ω
 μ : autoParam (Measure Ω) _auto✝
 inst✝ : IsProbabilityMeasure μ
 t a b : ℝ
 X : Ω → ℝ
 ht : 0 ≤ t
 hX : AEMeasurable X μ
 h : ∀ᵐ (ω : Ω) ∂μ, X ω ∈ Set.Icc a b
 h0 : ∫ (x : Ω), X x ∂μ = 0
 w : ¬t = 0
 f : ℝ → ℝ := fun t => cgf X μ t
 hf : f 0 = 0
 f' : ℝ → ℝ := fun t => ∫ (x : Ω), X x ∂Measure.tilted μ fun ω => t * X ω
 hf' : f' 0 = 0
 f'' : ℝ → ℝ := fun t => Var[X; Measure.tilted μ fun ω => t * X ω]
 c : ℝ
 left✝ : 0 < c ∧ c < t
 cq' : f t = f'' c * t ^ 2 / 2
 ⊢ 0 ≤ t ^ 2,
 case a0
 Ω : Type u
 inst✝¹ : MeasurableSpace Ω
 μ : autoParam (Measure Ω) _auto✝
 inst✝ : IsProbabilityMeasure μ
 t a b : ℝ
 X : Ω → ℝ
 ht : 0 ≤ t
 hX : AEMeasurable X μ
 h : ∀ᵐ (ω : Ω) ∂μ, X ω ∈ Set.Icc a b
 h0 : ∫ (x : Ω), X x ∂μ = 0
 w : ¬t = 0
 f : ℝ → ℝ := fun t => cgf X μ t
 hf : f 0 = 0
 f' : ℝ → ℝ := fun t => ∫ (x : Ω), X x ∂Measure.tilted μ fun ω => t * X ω
 hf' : f' 0 = 0
 f'' : ℝ → ℝ := fun t => Var[X; Measure.tilted μ fun ω => t * X ω]
 c : ℝ
 left✝ : 0 < c ∧ c < t
 cq' : f t = f'' c * t ^ 2 / 2
 ⊢ 0 ≤ 2⁻¹]
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

theorem extracted_formal_statement_1 (ε a b : ℝ) (m : ℕ) (hm : m > 0) (hε : ε > 0) (hab : b > a) :
  4 * ε / ((b - a) ^ 2 * ↑m) > 0 := sorry

Tactic state before:
ε a b : ℝ
m : ℕ
hm : m > 0
hε : ε > 0
hab : b > a
g : { t // t > 0 } → ℝ := fun t => -↑t * ε + ↑t ^ 2 * ↑m * (b - a) ^ 2 / 8
⊢ 4 * ε / ((b - a) ^ 2 * ↑m) > 0

Tactic:
apply div_pos
    ·
  apply mul_pos
  · norm_num
  · exact hε
    ·
  apply mul_pos
  · exact sq_pos_of_ne_zero (ne_of_gt (sub_pos.mpr hab))
  · exact Nat.cast_pos.mpr hm

Tactic state after:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

theorem extracted_formal_statement_2 (ε a b : ℝ) (m : ℕ) (hm : m > 0) (hε : ε > 0) (hab : b > a) :
  let g := fun t => -↑t * ε + ↑t ^ 2 * ↑m * (b - a) ^ 2 / 8;
  let t_min :=
    ⟨4 * ε / ((b - a) ^ 2 * ↑m),
      div_pos
        (mul_pos
          (Mathlib.Meta.NormNum.isNat_lt_true (Mathlib.Meta.NormNum.isNat_ofNat ℝ Nat.cast_zero)
            (Mathlib.Meta.NormNum.isNat_ofNat ℝ (Eq.refl 4)) (Eq.refl false))
          hε)
        (mul_pos (sq_pos_of_ne_zero (ne_of_gt (sub_pos.mpr hab))) (Nat.cast_pos.mpr hm))⟩;
  (∀ (t : { t // t > 0 }), g t = -↑t * ε + ↑t ^ 2 * ↑m * (b - a) ^ 2 / 8) →
    ∀ (t : { t // t > 0 }), g t = ↑m * (b - a) ^ 2 / 8 * (↑t - ↑t_min) ^ 2 - 2 * ε ^ 2 / ((b - a) ^ 2 * ↑m) := sorry

Tactic state before:
ε a b : ℝ
m : ℕ
hm : m > 0
hε : ε > 0
hab : b > a
g : { t // t > 0 } → ℝ := fun t => -↑t * ε + ↑t ^ 2 * ↑m * (b - a) ^ 2 / 8
t_min : { t // t > 0 } := ⟨4 * ε / ((b - a) ^ 2 * ↑m), ⋯⟩
gt : ∀ (t : { t // t > 0 }), g t = -↑t * ε + ↑t ^ 2 * ↑m * (b - a) ^ 2 / 8
t : { t // t > 0 }
⊢ g t = ↑m * (b - a) ^ 2 / 8 * (↑t - ↑t_min) ^ 2 - 2 * ε ^ 2 / ((b - a) ^ 2 * ↑m)

Tactic:
simp only [g, t_min]
    field_simp [ne_of_gt (sub_pos.mpr hab), Nat.cast_ne_zero.mpr (ne_of_gt hm)]
    ring

Tactic state after:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

theorem extracted_formal_statement_3 (ε a b : ℝ) (m : ℕ) (hm : m > 0) (hε : ε > 0) (hab : b > a) :
  let g := fun t => -↑t * ε + ↑t ^ 2 * ↑m * (b - a) ^ 2 / 8;
  let t_min :=
    ⟨4 * ε / ((b - a) ^ 2 * ↑m),
      div_pos
        (mul_pos
          (Mathlib.Meta.NormNum.isNat_lt_true (Mathlib.Meta.NormNum.isNat_ofNat ℝ Nat.cast_zero)
            (Mathlib.Meta.NormNum.isNat_ofNat ℝ (Eq.refl 4)) (Eq.refl false))
          hε)
        (mul_pos (sq_pos_of_ne_zero (ne_of_gt (sub_pos.mpr hab))) (Nat.cast_pos.mpr hm))⟩;
  (∀ (t : { t // t > 0 }), g t = -↑t * ε + ↑t ^ 2 * ↑m * (b - a) ^ 2 / 8) →
    (∀ (t : { t // t > 0 }), g t = ↑m * (b - a) ^ 2 / 8 * (↑t - ↑t_min) ^ 2 - 2 * ε ^ 2 / ((b - a) ^ 2 * ↑m)) →
      ∀ (t : { t // t > 0 }),
        g t ≥ g t_min →
          ↑m * (b - a) ^ 2 / 8 * (↑t - ↑t_min) ^ 2 - 2 * ε ^ 2 / ((b - a) ^ 2 * ↑m) ≥
            ↑m * (b - a) ^ 2 / 8 * 0 ^ 2 - 2 * ε ^ 2 / ((b - a) ^ 2 * ↑m) := sorry

Tactic state before:
ε a b : ℝ
m : ℕ
hm : m > 0
hε : ε > 0
hab : b > a
g : { t // t > 0 } → ℝ := fun t => -↑t * ε + ↑t ^ 2 * ↑m * (b - a) ^ 2 / 8
t_min : { t // t > 0 } := ⟨4 * ε / ((b - a) ^ 2 * ↑m), ⋯⟩
gt : ∀ (t : { t // t > 0 }), g t = -↑t * ε + ↑t ^ 2 * ↑m * (b - a) ^ 2 / 8
h_rewrite : ∀ (t : { t // t > 0 }), g t = ↑m * (b - a) ^ 2 / 8 * (↑t - ↑t_min) ^ 2 - 2 * ε ^ 2 / ((b - a) ^ 2 * ↑m)
t : { t // t > 0 }
⊢ g t ≥ g t_min

Tactic:
rw [h_rewrite t, h_rewrite t_min]
    simp only [sub_self, mul_zero]
    have h_term_nonneg : ↑m * (b - a) ^ 2 / 8 * (t - t_min) ^ 2 ≥ 0 := by
  to_theorem
    apply mul_nonneg·
      apply div_nonneg
      · apply mul_nonneg
        · exact Nat.cast_nonneg m
        · exact sq_nonneg (b - a)
      · norm_num· exact sq_nonneg (t.val - t_min)

Tactic state after:
[ε a b : ℝ
 m : ℕ
 hm : m > 0
 hε : ε > 0
 hab : b > a
 g : { t // t > 0 } → ℝ := fun t => -↑t * ε + ↑t ^ 2 * ↑m * (b - a) ^ 2 / 8
 t_min : { t // t > 0 } := ⟨4 * ε / ((b - a) ^ 2 * ↑m), ⋯⟩
 gt : ∀ (t : { t // t > 0 }), g t = -↑t * ε + ↑t ^ 2 * ↑m * (b - a) ^ 2 / 8
 h_rewrite : ∀ (t : { t // t > 0 }), g t = ↑m * (b - a) ^ 2 / 8 * (↑t - ↑t_min) ^ 2 - 2 * ε ^ 2 / ((b - a) ^ 2 * ↑m)
 t : { t // t > 0 }
 h_term_nonneg : ↑m * (b - a) ^ 2 / 8 * (↑t - ↑t_min) ^ 2 ≥ 0
 ⊢ ↑m * (b - a) ^ 2 / 8 * (↑t - ↑t_min) ^ 2 - 2 * ε ^ 2 / ((b - a) ^ 2 * ↑m) ≥
     ↑m * (b - a) ^ 2 / 8 * 0 ^ 2 - 2 * ε ^ 2 / ((b - a) ^ 2 * ↑m)]
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

theorem extracted_formal_statement_4 (ε a b : ℝ) (m : ℕ) (hm : m > 0) (hε : ε > 0) (hab : b > a) :
  let g := fun t => -↑t * ε + ↑t ^ 2 * ↑m * (b - a) ^ 2 / 8;
  let t_min :=
    ⟨4 * ε / ((b - a) ^ 2 * ↑m),
      div_pos
        (mul_pos
          (Mathlib.Meta.NormNum.isNat_lt_true (Mathlib.Meta.NormNum.isNat_ofNat ℝ Nat.cast_zero)
            (Mathlib.Meta.NormNum.isNat_ofNat ℝ (Eq.refl 4)) (Eq.refl false))
          hε)
        (mul_pos (sq_pos_of_ne_zero (ne_of_gt (sub_pos.mpr hab))) (Nat.cast_pos.mpr hm))⟩;
  (∀ (t : { t // t > 0 }), g t = -↑t * ε + ↑t ^ 2 * ↑m * (b - a) ^ 2 / 8) →
    (∀ (t : { t // t > 0 }), g t = ↑m * (b - a) ^ 2 / 8 * (↑t - ↑t_min) ^ 2 - 2 * ε ^ 2 / ((b - a) ^ 2 * ↑m)) →
      ∀ (t : { t // t > 0 }), ↑m * (b - a) ^ 2 / 8 * (↑t - ↑t_min) ^ 2 ≥ 0 := sorry

Tactic state before:
ε a b : ℝ
m : ℕ
hm : m > 0
hε : ε > 0
hab : b > a
g : { t // t > 0 } → ℝ := fun t => -↑t * ε + ↑t ^ 2 * ↑m * (b - a) ^ 2 / 8
t_min : { t // t > 0 } := ⟨4 * ε / ((b - a) ^ 2 * ↑m), ⋯⟩
gt : ∀ (t : { t // t > 0 }), g t = -↑t * ε + ↑t ^ 2 * ↑m * (b - a) ^ 2 / 8
h_rewrite : ∀ (t : { t // t > 0 }), g t = ↑m * (b - a) ^ 2 / 8 * (↑t - ↑t_min) ^ 2 - 2 * ε ^ 2 / ((b - a) ^ 2 * ↑m)
t : { t // t > 0 }
⊢ ↑m * (b - a) ^ 2 / 8 * (↑t - ↑t_min) ^ 2 ≥ 0

Tactic:
apply mul_nonneg
    ·
  apply div_nonneg
  · apply mul_nonneg
    · exact Nat.cast_nonneg m
    · exact sq_nonneg (b - a)
  · norm_num
    · exact sq_nonneg (t.val - t_min)

Tactic state after:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

theorem extracted_formal_statement_5 (ε a b : ℝ) (m : ℕ) (hm : m > 0) (hε : ε > 0) (hab : b > a) :
  let g := fun t => -↑t * ε + ↑t ^ 2 * ↑m * (b - a) ^ 2 / 8;
  let t_min :=
    ⟨4 * ε / ((b - a) ^ 2 * ↑m),
      div_pos
        (mul_pos
          (Mathlib.Meta.NormNum.isNat_lt_true (Mathlib.Meta.NormNum.isNat_ofNat ℝ Nat.cast_zero)
            (Mathlib.Meta.NormNum.isNat_ofNat ℝ (Eq.refl 4)) (Eq.refl false))
          hε)
        (mul_pos (sq_pos_of_ne_zero (ne_of_gt (sub_pos.mpr hab))) (Nat.cast_pos.mpr hm))⟩;
  (∀ (t : { t // t > 0 }), g t = -↑t * ε + ↑t ^ 2 * ↑m * (b - a) ^ 2 / 8) →
    (∀ (t : { t // t > 0 }), g t = ↑m * (b - a) ^ 2 / 8 * (↑t - ↑t_min) ^ 2 - 2 * ε ^ 2 / ((b - a) ^ 2 * ↑m)) →
      (∀ (t : { t // t > 0 }), g t ≥ g t_min) →
        (∀ (t : { t // t > 0 }), rexp (g t) ≥ rexp (g t_min)) →
          g t_min = -2 * ε ^ 2 / ((b - a) ^ 2 * ↑m) →
            (-(4 * ε * ε * (((b - a) ^ 2 * ↑m) ^ 2 * 8)) + (4 * ε) ^ 2 * ↑m * (b - a) ^ 2 * ((b - a) ^ 2 * ↑m)) *
                ((b - a) ^ 2 * ↑m) =
              -(2 * ε ^ 2 * ((b - a) ^ 2 * ↑m * (((b - a) ^ 2 * ↑m) ^ 2 * 8))) := sorry

Tactic state before:
ε a b : ℝ
m : ℕ
hm : m > 0
hε : ε > 0
hab : b > a
g : { t // t > 0 } → ℝ := fun t => -↑t * ε + ↑t ^ 2 * ↑m * (b - a) ^ 2 / 8
t_min : { t // t > 0 } := ⟨4 * ε / ((b - a) ^ 2 * ↑m), ⋯⟩
gt : ∀ (t : { t // t > 0 }), g t = -↑t * ε + ↑t ^ 2 * ↑m * (b - a) ^ 2 / 8
h_rewrite : ∀ (t : { t // t > 0 }), g t = ↑m * (b - a) ^ 2 / 8 * (↑t - ↑t_min) ^ 2 - 2 * ε ^ 2 / ((b - a) ^ 2 * ↑m)
h_inf : ∀ (t : { t // t > 0 }), g t ≥ g t_min
h_exp : ∀ (t : { t // t > 0 }), rexp (g t) ≥ rexp (g t_min)
⊢ g t_min = -2 * ε ^ 2 / ((b - a) ^ 2 * ↑m)

Tactic:
simp only [g, t_min]
    have h : m ≠ 0 ∧ (b - a) ≠ 0 := by
  constructor
  · exact ne_of_gt hm
  · exact ne_of_gt (sub_pos.mpr hab)
    field_simp [h.left, h.right]

Tactic state after:
[ε a b : ℝ
 m : ℕ
 hm : m > 0
 hε : ε > 0
 hab : b > a
 g : { t // t > 0 } → ℝ := fun t => -↑t * ε + ↑t ^ 2 * ↑m * (b - a) ^ 2 / 8
 t_min : { t // t > 0 } := ⟨4 * ε / ((b - a) ^ 2 * ↑m), ⋯⟩
 gt : ∀ (t : { t // t > 0 }), g t = -↑t * ε + ↑t ^ 2 * ↑m * (b - a) ^ 2 / 8
 h_rewrite : ∀ (t : { t // t > 0 }), g t = ↑m * (b - a) ^ 2 / 8 * (↑t - ↑t_min) ^ 2 - 2 * ε ^ 2 / ((b - a) ^ 2 * ↑m)
 h_inf : ∀ (t : { t // t > 0 }), g t ≥ g t_min
 h_exp : ∀ (t : { t // t > 0 }), rexp (g t) ≥ rexp (g t_min)
 h : m ≠ 0 ∧ b - a ≠ 0
 ⊢ (-(4 * ε * ε * (((b - a) ^ 2 * ↑m) ^ 2 * 8)) + (4 * ε) ^ 2 * ↑m * (b - a) ^ 2 * ((b - a) ^ 2 * ↑m)) *
       ((b - a) ^ 2 * ↑m) =
     -(2 * ε ^ 2 * ((b - a) ^ 2 * ↑m * (((b - a) ^ 2 * ↑m) ^ 2 * 8)))]
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

theorem extracted_formal_statement_6 (ε a b : ℝ) (m : ℕ) (hm : m > 0) (hε : ε > 0) (hab : b > a) :
  let g := fun t => -↑t * ε + ↑t ^ 2 * ↑m * (b - a) ^ 2 / 8;
  let t_min :=
    ⟨4 * ε / ((b - a) ^ 2 * ↑m),
      div_pos
        (mul_pos
          (Mathlib.Meta.NormNum.isNat_lt_true (Mathlib.Meta.NormNum.isNat_ofNat ℝ Nat.cast_zero)
            (Mathlib.Meta.NormNum.isNat_ofNat ℝ (Eq.refl 4)) (Eq.refl false))
          hε)
        (mul_pos (sq_pos_of_ne_zero (ne_of_gt (sub_pos.mpr hab))) (Nat.cast_pos.mpr hm))⟩;
  (∀ (t : { t // t > 0 }), g t = -↑t * ε + ↑t ^ 2 * ↑m * (b - a) ^ 2 / 8) →
    (∀ (t : { t // t > 0 }), g t = ↑m * (b - a) ^ 2 / 8 * (↑t - ↑t_min) ^ 2 - 2 * ε ^ 2 / ((b - a) ^ 2 * ↑m)) →
      (∀ (t : { t // t > 0 }), g t ≥ g t_min) →
        (∀ (t : { t // t > 0 }), rexp (g t) ≥ rexp (g t_min)) →
          g t_min = -2 * ε ^ 2 / ((b - a) ^ 2 * ↑m) →
            rexp (g t_min) = rexp (-2 * ε ^ 2 / ((b - a) ^ 2 * ↑m)) →
              ⨅ t, rexp (-↑t * ε + ↑t ^ 2 * ↑m * (b - a) ^ 2 / 8) = rexp (-2 * ε ^ 2 / ((b - a) ^ 2 * ↑m)) →
                ⨅ t, rexp (g t) = rexp (g t_min) := sorry

Tactic state before:
ε a b : ℝ
m : ℕ
hm : m > 0
hε : ε > 0
hab : b > a
g : { t // t > 0 } → ℝ := fun t => -↑t * ε + ↑t ^ 2 * ↑m * (b - a) ^ 2 / 8
t_min : { t // t > 0 } := ⟨4 * ε / ((b - a) ^ 2 * ↑m), ⋯⟩
gt : ∀ (t : { t // t > 0 }), g t = -↑t * ε + ↑t ^ 2 * ↑m * (b - a) ^ 2 / 8
h_rewrite : ∀ (t : { t // t > 0 }), g t = ↑m * (b - a) ^ 2 / 8 * (↑t - ↑t_min) ^ 2 - 2 * ε ^ 2 / ((b - a) ^ 2 * ↑m)
h_inf : ∀ (t : { t // t > 0 }), g t ≥ g t_min
h_exp : ∀ (t : { t // t > 0 }), rexp (g t) ≥ rexp (g t_min)
h_g_tmin : g t_min = -2 * ε ^ 2 / ((b - a) ^ 2 * ↑m)
h_exp_tmin : rexp (g t_min) = rexp (-2 * ε ^ 2 / ((b - a) ^ 2 * ↑m))
⊢ ⨅ t, rexp (-↑t * ε + ↑t ^ 2 * ↑m * (b - a) ^ 2 / 8) = rexp (-2 * ε ^ 2 / ((b - a) ^ 2 * ↑m))

Tactic:
rw [← h_exp_tmin]
    have h_inf_rewrite :
  ⨅ t : { t : ℝ // t > 0 }, rexp (-t * ε + t ^ 2 * ↑m * (b - a) ^ 2 / 8) = ⨅ t : { t : ℝ // 0 < t }, rexp (g t) := by
  congr
    rw [h_inf_rewrite]

Tactic state after:
[ε a b : ℝ
 m : ℕ
 hm : m > 0
 hε : ε > 0
 hab : b > a
 g : { t // t > 0 } → ℝ := fun t => -↑t * ε + ↑t ^ 2 * ↑m * (b - a) ^ 2 / 8
 t_min : { t // t > 0 } := ⟨4 * ε / ((b - a) ^ 2 * ↑m), ⋯⟩
 gt : ∀ (t : { t // t > 0 }), g t = -↑t * ε + ↑t ^ 2 * ↑m * (b - a) ^ 2 / 8
 h_rewrite : ∀ (t : { t // t > 0 }), g t = ↑m * (b - a) ^ 2 / 8 * (↑t - ↑t_min) ^ 2 - 2 * ε ^ 2 / ((b - a) ^ 2 * ↑m)
 h_inf : ∀ (t : { t // t > 0 }), g t ≥ g t_min
 h_exp : ∀ (t : { t // t > 0 }), rexp (g t) ≥ rexp (g t_min)
 h_g_tmin : g t_min = -2 * ε ^ 2 / ((b - a) ^ 2 * ↑m)
 h_exp_tmin : rexp (g t_min) = rexp (-2 * ε ^ 2 / ((b - a) ^ 2 * ↑m))
 h_inf_rewrite : ⨅ t, rexp (-↑t * ε + ↑t ^ 2 * ↑m * (b - a) ^ 2 / 8) = ⨅ t, rexp (g t)
 ⊢ ⨅ t, rexp (g t) = rexp (g t_min)]