theorem extracted_formal_statement_1.{w, v, u} {Ω : Type u} [inst : MeasurableSpace Ω] {Z : Type w} {n : ℕ} {ι : Type v}
  {f : ι → Z → ℝ} {μ : Measure Ω} [inst_1 : Nonempty ι] [inst_2 : IsProbabilityMeasure μ] (hn : 0 < n) (X : Ω → Z)
  (hf : ∀ (i : ι), Measurable (f i ∘ X)) {b : ℝ} (hb : 0 ≤ b) (hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b) (i : Fin n)
  (x : Fin n → Z) (x' : Z) (s' : ∀ (a : ι), |∫ (x : Ω), f a (X x) ∂μ| ≤ b) (j : ι) (pe : (↑n)⁻¹ * 2 * b * ↑n = 2 * b)
  (k : Fin n) :
  f j (x k) - f j (if h : k = i then Eq.symm h ▸ x' else x k) = if i = k then f j (x k) - f j x' else 0 := sorry

State before:
case h.h.h
Ω : Type u
inst✝² : MeasurableSpace Ω
Z : Type w
n : ℕ
ι : Type v
f : ι → Z → ℝ
μ : Measure Ω
inst✝¹ : Nonempty ι
inst✝ : IsProbabilityMeasure μ
hn : 0 < n
X : Ω → Z
hf : ∀ (i : ι), Measurable (f i ∘ X)
b : ℝ
hb : 0 ≤ b
hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b
i : Fin n
x : Fin n → Z
x' : Z
g : ι → ℝ := fun i => (↑n)⁻¹ * ∑ k, f i (x k) - ∫ (x : Ω), f i (X x) ∂μ
h : ι → ℝ := fun i_1 => (↑n)⁻¹ * ∑ k, f i_1 (Function.update x i x' k) - ∫ (x : Ω), f i_1 (X x) ∂μ
s' : ∀ (a : ι), |∫ (x : Ω), f a (X x) ∂μ| ≤ b
j : ι
pe : (↑n)⁻¹ * 2 * b * ↑n = 2 * b
k : Fin n
⊢ f j (x k) - f j (if h : k = i then ⋯ ▸ x' else x k) = if i = k then f j (x k) - f j x' else 0

Tactic: simp only [eq_rec_constant, dite_eq_ite, h, g]
    have t : f j (x k) - f j (if k = i then x' else x k) = if i = k then f j (x k) - f j x' else 0 := by
  calc
    _ = f j (x k) - (if k = i then f j x' else f j (x k)) :=
      by
      simp only [sub_right_inj, h, g]
      exact apply_ite (f j) (k = i) x' (x k)
    _ = (if k = i then f j (x k) - f j x' else f j (x k) - f j (x k)) := by
      exact sub_ite (k = i) (f j (x k)) (f j x') (f j (x k))
    _ = _ := by
      simp only [sub_self, h, g]
      refine Eq.symm (if_congr ?_ rfl rfl)
      exact eq_comm
    exact t

State after:

Relevant lemmas:
error