theorem extracted_formal_statement_0.{u} {Ω : Type u} [inst : MeasurableSpace Ω] {μ : Measure Ω}
  [inst_1 : IsProbabilityMeasure μ] {n : ℕ} (s : Fin (n + 1) → Set Ω) (hs : ∀ (i : Fin (n + 1)), MeasurableSet (s i))
  (ω : Ω × (Fin n → Ω))
  (h_original_goal :
    ω ∈ (fun f x => Fin.snoc f.2 f.1 x) ⁻¹' Set.univ.pi s ↔ ω ∈ s (Fin.last n) ×ˢ Set.univ.pi (s ∘ Fin.castSucc)) :
  (ω.1 ∈ s (Fin.last n) ∧ ∀ (i : Fin n), ω.2 i ∈ s i.castSucc) → ∀ (i : Fin (n + 1)), Fin.snoc ω.2 ω.1 i ∈ s i := sorry

State before:
case h
Ω : Type u
inst✝¹ : MeasurableSpace Ω
μ : Measure Ω
inst✝ : IsProbabilityMeasure μ
n : ℕ
s : Fin (n + 1) → Set Ω
hs : ∀ (i : Fin (n + 1)), MeasurableSet (s i)
ω : Ω × (Fin n → Ω)
⊢ ω ∈ (fun f x => Fin.snoc f.2 f.1 x) ⁻¹' Set.univ.pi s ↔ ω ∈ s (Fin.last n) ×ˢ Set.univ.pi (s ∘ Fin.castSucc)

Tactic: simp only [Set.mem_preimage, Set.mem_pi, Set.mem_univ, forall_const, Set.mem_prod, Function.comp_apply]
    constructor
    ·
  intro h
  have := h (Fin.last n)
  to_theorem rw [Fin.snoc_last] at this use this intro i
  have := h i.castSucc
  rw [Fin.snoc_castSucc] at this
  exact this

State after:
[case h.mpr
 Ω : Type u
 inst✝¹ : MeasurableSpace Ω
 μ : Measure Ω
 inst✝ : IsProbabilityMeasure μ
 n : ℕ
 s : Fin (n + 1) → Set Ω
 hs : ∀ (i : Fin (n + 1)), MeasurableSet (s i)
 ω : Ω × (Fin n → Ω)
 ⊢ (ω.1 ∈ s (Fin.last n) ∧ ∀ (i : Fin n), ω.2 i ∈ s i.castSucc) → ∀ (i : Fin (n + 1)), Fin.snoc ω.2 ω.1 i ∈ s i]

Relevant lemmas:
error