theorem extracted_formal_statement_8.{u} {Ω : Type u} [inst : MeasurableSpace Ω] {n : ℕ} (i : Fin (n + 1)) (h : ↑i < n)
  (this : (fun c => if h : ↑i < n then c.2 (i.castLT h) else c.1) = fun c => c.2 (i.castLT h))
  (h_original_goal : Measurable fun c => if h : ↑i < n then c.2 (i.castLT h) else c.1) :
  Measurable fun c => c.2 (i.castLT h) := sorry

State before:
Ω : Type u
inst✝ : MeasurableSpace Ω
n : ℕ
i : Fin (n + 1)
h : ↑i < n
this : (fun c => if h : ↑i < n then c.2 (i.castLT h) else c.1) = fun c => c.2 (i.castLT h)
⊢ Measurable fun c => if h : ↑i < n then c.2 (i.castLT h) else c.1

Tactic: rw [this]

State after:
[Ω : Type u
 inst✝ : MeasurableSpace Ω
 n : ℕ
 i : Fin (n + 1)
 h : ↑i < n
 this : (fun c => if h : ↑i < n then c.2 (i.castLT h) else c.1) = fun c => c.2 (i.castLT h)
 ⊢ Measurable fun c => c.2 (i.castLT h)]

Relevant lemmas: