zzhisthebest/LeanBenchmark huggingface dataset:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory

theorem extracted_formal_statement_0.{u_2, u_1} {ι : Type u_1} {Ω : ι → Type u_2} [inst : Fintype ι]
  [inst_1 : (i : ι) → MeasurableSpace (Ω i)] {μ : (i : ι) → Measure (Ω i)}
  [inst_2 : ∀ (i : ι), IsProbabilityMeasure (μ i)] (k : ι)
  (h_original_goal : Measure.map (Function.eval k) (Measure.pi μ) = μ k) (s : Set (Ω k)) :
  MeasurableSet s → (Measure.map (Function.eval k) (Measure.pi μ)) s = (μ k) s := sorry

Tactic state before:
ι : Type u_1
Ω : ι → Type u_2
inst✝³ : Fintype ι
inst✝² : DecidableEq ι
inst✝¹ : (i : ι) → MeasurableSpace (Ω i)
μ : (i : ι) → Measure (Ω i)
inst✝ : ∀ (i : ι), IsProbabilityMeasure (μ i)
k : ι
⊢ Measure.map (Function.eval k) (Measure.pi μ) = μ k

Tactic:
apply Measure.ext_iff.mpr

Tactic state after:
[ι : Type u_1
 Ω : ι → Type u_2
 inst✝³ : Fintype ι
 inst✝² : DecidableEq ι
 inst✝¹ : (i : ι) → MeasurableSpace (Ω i)
 μ : (i : ι) → Measure (Ω i)
 inst✝ : ∀ (i : ι), IsProbabilityMeasure (μ i)
 k : ι
 ⊢ ∀ (s : Set (Ω k)), MeasurableSet s → (Measure.map (Function.eval k) (Measure.pi μ)) s = (μ k) s]
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory

theorem extracted_formal_statement_1.{u_2, u_1} {ι : Type u_1} {Ω : ι → Type u_2} [inst : Fintype ι]
  [inst_1 : DecidableEq ι] [inst_2 : (i : ι) → MeasurableSpace (Ω i)] {μ : (i : ι) → Measure (Ω i)}
  [inst_3 : ∀ (i : ι), IsProbabilityMeasure (μ i)] (k : ι) (s : Set (Ω k)) (hs : MeasurableSet s)
  (h_original_goal : (Measure.map (Function.eval k) (Measure.pi μ)) s = (μ k) s) :
  ∏ i, (μ i) (Function.update (fun x => Set.univ) k s i) = (μ k) s := sorry

Tactic state before:
ι : Type u_1
Ω : ι → Type u_2
inst✝³ : Fintype ι
inst✝² : DecidableEq ι
inst✝¹ : (i : ι) → MeasurableSpace (Ω i)
μ : (i : ι) → Measure (Ω i)
inst✝ : ∀ (i : ι), IsProbabilityMeasure (μ i)
k : ι
s : Set (Ω k)
hs : MeasurableSet s
⊢ (Measure.map (Function.eval k) (Measure.pi μ)) s = (μ k) s

Tactic:
rw [Measure.map_apply (measurable_pi_apply k) hs, Set.eval_preimage, Measure.pi_pi]

Tactic state after:
[ι : Type u_1
 Ω : ι → Type u_2
 inst✝³ : Fintype ι
 inst✝² : DecidableEq ι
 inst✝¹ : (i : ι) → MeasurableSpace (Ω i)
 μ : (i : ι) → Measure (Ω i)
 inst✝ : ∀ (i : ι), IsProbabilityMeasure (μ i)
 k : ι
 s : Set (Ω k)
 hs : MeasurableSet s
 ⊢ ∏ i, (μ i) (Function.update (fun x => Set.univ) k s i) = (μ k) s]
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory

theorem extracted_formal_statement_2.{u_2, u_1} {ι : Type u_1} {Ω : ι → Type u_2} [inst : Fintype ι]
  [inst_1 : DecidableEq ι] [inst_2 : (i : ι) → MeasurableSpace (Ω i)] {μ : (i : ι) → Measure (Ω i)}
  [inst_3 : ∀ (i : ι), IsProbabilityMeasure (μ i)] (k : ι) (s : Set (Ω k)) (hs : MeasurableSet s) :
  (∏ i, if i = k then (μ k) s else 1) = (μ k) s := sorry

Tactic state before:
ι : Type u_1
Ω : ι → Type u_2
inst✝³ : Fintype ι
inst✝² : DecidableEq ι
inst✝¹ : (i : ι) → MeasurableSpace (Ω i)
μ : (i : ι) → Measure (Ω i)
inst✝ : ∀ (i : ι), IsProbabilityMeasure (μ i)
k : ι
s : Set (Ω k)
hs : MeasurableSet s
⊢ (∏ i, if i = k then (μ k) s else 1) = (μ k) s

Tactic:
exact Fintype.prod_ite_eq' k fun j ↦ μ k s

Tactic state after:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory

theorem extracted_formal_statement_3.{u_2, u_1} {Ω : Type u_1} {ι : Type u_2} [inst : MeasurableSpace Ω] {μ : Measure Ω}
  [inst_1 : IsProbabilityMeasure μ] [inst_2 : Fintype ι]
  (h_original_goal : iIndepFun Function.eval (Measure.pi fun x => μ)) (s : Finset ι) {f : ι → Set (ι → Ω)}
  (_H : ∀ i ∈ s, MeasurableSet (f i)) :
  (Measure.pi fun x => μ) (⋂ i ∈ s, f i) = ∏ x ∈ s, (Measure.pi fun x => μ) (f x) := sorry

Tactic state before:
Ω : Type u_1
ι : Type u_2
inst✝³ : MeasurableSpace Ω
μ : Measure Ω
inst✝² : IsProbabilityMeasure μ
inst✝¹ : Fintype ι
inst✝ : DecidableEq ι
⊢ iIndepFun Function.eval (Measure.pi fun x => μ)

Tactic:
simp only [iIndepFun, Kernel.iIndepFun, Kernel.iIndep, Kernel.iIndepSets, Set.mem_setOf_eq,
  Kernel.const_apply, ae_dirac_eq, Filter.eventually_pure]

Tactic state after:
[Ω : Type u_1
 ι : Type u_2
 inst✝³ : MeasurableSpace Ω
 μ : Measure Ω
 inst✝² : IsProbabilityMeasure μ
 inst✝¹ : Fintype ι
 inst✝ : DecidableEq ι
 ⊢ ∀ (s : Finset ι) {f : ι → Set (ι → Ω)},
     (∀ i ∈ s, MeasurableSet (f i)) → (Measure.pi fun x => μ) (⋂ i ∈ s, f i) = ∏ x ∈ s, (Measure.pi fun x => μ) (f x)]
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory

theorem extracted_formal_statement_4.{u_2, u_1} {Ω : Type u_1} {ι : Type u_2} [inst : MeasurableSpace Ω] {μ : Measure Ω}
  [inst_1 : IsProbabilityMeasure μ] [inst_2 : Fintype ι] [inst_3 : DecidableEq ι] (s : Finset ι) {f : ι → Set (ι → Ω)}
  (hf : ∀ i ∈ s, ∃ s', inst.MeasurableSet' s' ∧ Function.eval i ⁻¹' s' = f i) :
  let f' := fun i hi => Classical.choose (hf i hi);
  let hf' := fun i hi => Classical.choose_spec (hf i hi);
  ∀ x ∈ ⋂ i ∈ s, f i,
    ∀ i ∈ Set.univ, ∀ (h : i ∈ s), (x i ∈ if h : i ∈ s then f' i h else Set.univ) → x i ∈ f' i h := sorry

Tactic state before:
Ω : Type u_1
ι : Type u_2
inst✝³ : MeasurableSpace Ω
μ : Measure Ω
inst✝² : IsProbabilityMeasure μ
inst✝¹ : Fintype ι
inst✝ : DecidableEq ι
s : Finset ι
f : ι → Set (ι → Ω)
hf : ∀ i ∈ s, ∃ s', inst✝³.MeasurableSet' s' ∧ Function.eval i ⁻¹' s' = f i
f' : (i : ι) → i ∈ s → Set Ω := fun i hi => Classical.choose ⋯
hf' : ∀ (i : ι) (hi : i ∈ s),
  inst✝³.MeasurableSet' (Classical.choose ⋯) ∧ Function.eval i ⁻¹' Classical.choose ⋯ = f i :=
  fun i hi => Classical.choose_spec (hf i hi)
f'' : ι → Set Ω := fun i => if h : i ∈ s then f' i h else Set.univ
x : ι → Ω
hx : x ∈ ⋂ i ∈ s, f i
i : ι
a✝ : i ∈ Set.univ
h : i ∈ s
⊢ x i ∈ if h : i ∈ s then f' i h else Set.univ

Tactic:
rw [dif_pos h]

Tactic state after:
[Ω : Type u_1
 ι : Type u_2
 inst✝³ : MeasurableSpace Ω
 μ : Measure Ω
 inst✝² : IsProbabilityMeasure μ
 inst✝¹ : Fintype ι
 inst✝ : DecidableEq ι
 s : Finset ι
 f : ι → Set (ι → Ω)
 hf : ∀ i ∈ s, ∃ s', inst✝³.MeasurableSet' s' ∧ Function.eval i ⁻¹' s' = f i
 f' : (i : ι) → i ∈ s → Set Ω := fun i hi => Classical.choose ⋯
 hf' : ∀ (i : ι) (hi : i ∈ s),
   inst✝³.MeasurableSet' (Classical.choose ⋯) ∧ Function.eval i ⁻¹' Classical.choose ⋯ = f i :=
   fun i hi => Classical.choose_spec (hf i hi)
 f'' : ι → Set Ω := fun i => if h : i ∈ s then f' i h else Set.univ
 x : ι → Ω
 hx : x ∈ ⋂ i ∈ s, f i
 i : ι
 a✝ : i ∈ Set.univ
 h : i ∈ s
 ⊢ x i ∈ f' i h]
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory

theorem extracted_formal_statement_5.{u_2, u_1} {Ω : Type u_1} {ι : Type u_2} [inst : MeasurableSpace Ω] {μ : Measure Ω}
  [inst_1 : IsProbabilityMeasure μ] [inst_2 : Fintype ι] (s : Finset ι) {f : ι → Set (ι → Ω)}
  (hf : ∀ i ∈ s, ∃ s', inst.MeasurableSet' s' ∧ Function.eval i ⁻¹' s' = f i) :
  let f' := fun i hi => Classical.choose (hf i hi);
  let hf' := fun i hi => Classical.choose_spec (hf i hi);
  ∀ x ∈ ⋂ i ∈ s, f i,
    ∀ i ∈ Set.univ,
      ∀ (h : i ∈ s), x ∈ ⋂ (_ : i ∈ s), f i → x ∈ Function.eval i ⁻¹' Classical.choose (hf i h) → x i ∈ f' i h := sorry

Tactic state before:
Ω : Type u_1
ι : Type u_2
inst✝³ : MeasurableSpace Ω
μ : Measure Ω
inst✝² : IsProbabilityMeasure μ
inst✝¹ : Fintype ι
inst✝ : DecidableEq ι
s : Finset ι
f : ι → Set (ι → Ω)
hf : ∀ i ∈ s, ∃ s', inst✝³.MeasurableSet' s' ∧ Function.eval i ⁻¹' s' = f i
f' : (i : ι) → i ∈ s → Set Ω := fun i hi => Classical.choose ⋯
hf' : ∀ (i : ι) (hi : i ∈ s),
  inst✝³.MeasurableSet' (Classical.choose ⋯) ∧ Function.eval i ⁻¹' Classical.choose ⋯ = f i :=
  fun i hi => Classical.choose_spec (hf i hi)
f'' : ι → Set Ω := fun i => if h : i ∈ s then f' i h else Set.univ
x : ι → Ω
hx : x ∈ ⋂ i ∈ s, f i
i : ι
a✝ : i ∈ Set.univ
h : i ∈ s
this✝ : x ∈ ⋂ (_ : i ∈ s), f i
this : x ∈ Function.eval i ⁻¹' Classical.choose ⋯
⊢ x i ∈ f' i h

Tactic:
exact this

Tactic state after:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory

theorem extracted_formal_statement_6.{u_2, u_1} {Ω : Type u_1} {ι : Type u_2} [inst : MeasurableSpace Ω] {μ : Measure Ω}
  [inst_1 : IsProbabilityMeasure μ] [inst_2 : Fintype ι] [inst_3 : DecidableEq ι] (s : Finset ι) {f : ι → Set (ι → Ω)}
  (hf : ∀ i ∈ s, ∃ s', inst.MeasurableSet' s' ∧ Function.eval i ⁻¹' s' = f i) :
  let f' := fun i hi => Classical.choose (hf i hi);
  let hf' := fun i hi => Classical.choose_spec (hf i hi);
  ∀ x ∈ ⋂ i ∈ s, f i, ∀ i ∈ Set.univ, i ∉ s → (x i ∈ if h : i ∈ s then f' i h else Set.univ) → x i ∈ Set.univ := sorry

Tactic state before:
Ω : Type u_1
ι : Type u_2
inst✝³ : MeasurableSpace Ω
μ : Measure Ω
inst✝² : IsProbabilityMeasure μ
inst✝¹ : Fintype ι
inst✝ : DecidableEq ι
s : Finset ι
f : ι → Set (ι → Ω)
hf : ∀ i ∈ s, ∃ s', inst✝³.MeasurableSet' s' ∧ Function.eval i ⁻¹' s' = f i
f' : (i : ι) → i ∈ s → Set Ω := fun i hi => Classical.choose ⋯
hf' : ∀ (i : ι) (hi : i ∈ s),
  inst✝³.MeasurableSet' (Classical.choose ⋯) ∧ Function.eval i ⁻¹' Classical.choose ⋯ = f i :=
  fun i hi => Classical.choose_spec (hf i hi)
f'' : ι → Set Ω := fun i => if h : i ∈ s then f' i h else Set.univ
x : ι → Ω
hx : x ∈ ⋂ i ∈ s, f i
i : ι
a✝ : i ∈ Set.univ
h : i ∉ s
⊢ x i ∈ if h : i ∈ s then f' i h else Set.univ

Tactic:
rw [dif_neg h]

Tactic state after:
[Ω : Type u_1
 ι : Type u_2
 inst✝³ : MeasurableSpace Ω
 μ : Measure Ω
 inst✝² : IsProbabilityMeasure μ
 inst✝¹ : Fintype ι
 inst✝ : DecidableEq ι
 s : Finset ι
 f : ι → Set (ι → Ω)
 hf : ∀ i ∈ s, ∃ s', inst✝³.MeasurableSet' s' ∧ Function.eval i ⁻¹' s' = f i
 f' : (i : ι) → i ∈ s → Set Ω := fun i hi => Classical.choose ⋯
 hf' : ∀ (i : ι) (hi : i ∈ s),
   inst✝³.MeasurableSet' (Classical.choose ⋯) ∧ Function.eval i ⁻¹' Classical.choose ⋯ = f i :=
   fun i hi => Classical.choose_spec (hf i hi)
 f'' : ι → Set Ω := fun i => if h : i ∈ s then f' i h else Set.univ
 x : ι → Ω
 hx : x ∈ ⋂ i ∈ s, f i
 i : ι
 a✝ : i ∈ Set.univ
 h : i ∉ s
 ⊢ x i ∈ Set.univ]
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory

theorem extracted_formal_statement_7.{u_2, u_1} {Ω : Type u_1} {ι : Type u_2} [inst : MeasurableSpace Ω] {μ : Measure Ω}
  [inst_1 : IsProbabilityMeasure μ] [inst_2 : Fintype ι] [inst_3 : DecidableEq ι] (s : Finset ι) {f : ι → Set (ι → Ω)}
  (hf : ∀ i ∈ s, ∃ s', inst.MeasurableSet' s' ∧ Function.eval i ⁻¹' s' = f i) :
  let f' := fun i hi => Classical.choose (hf i hi);
  let hf' := fun i hi => Classical.choose_spec (hf i hi);
  let f'' := fun i => if h : i ∈ s then f' i h else Set.univ;
  ∀ x ∈ Set.univ.pi f'', x ∈ ⋂ i ∈ s, f i → ∀ (i : ι), x ∈ ⋂ (_ : i ∈ s), f i := sorry

Tactic state before:
case h.mpr
Ω : Type u_1
ι : Type u_2
inst✝³ : MeasurableSpace Ω
μ : Measure Ω
inst✝² : IsProbabilityMeasure μ
inst✝¹ : Fintype ι
inst✝ : DecidableEq ι
s : Finset ι
f : ι → Set (ι → Ω)
hf : ∀ i ∈ s, ∃ s', inst✝³.MeasurableSet' s' ∧ Function.eval i ⁻¹' s' = f i
f' : (i : ι) → i ∈ s → Set Ω := fun i hi => Classical.choose ⋯
hf' : ∀ (i : ι) (hi : i ∈ s),
  inst✝³.MeasurableSet' (Classical.choose ⋯) ∧ Function.eval i ⁻¹' Classical.choose ⋯ = f i :=
  fun i hi => Classical.choose_spec (hf i hi)
f'' : ι → Set Ω := fun i => if h : i ∈ s then f' i h else Set.univ
x : ι → Ω
hx : x ∈ Set.univ.pi f''
⊢ x ∈ ⋂ i ∈ s, f i

Tactic:
apply Set.mem_iInter.mpr

Tactic state after:
[case h.mpr
 Ω : Type u_1
 ι : Type u_2
 inst✝³ : MeasurableSpace Ω
 μ : Measure Ω
 inst✝² : IsProbabilityMeasure μ
 inst✝¹ : Fintype ι
 inst✝ : DecidableEq ι
 s : Finset ι
 f : ι → Set (ι → Ω)
 hf : ∀ i ∈ s, ∃ s', inst✝³.MeasurableSet' s' ∧ Function.eval i ⁻¹' s' = f i
 f' : (i : ι) → i ∈ s → Set Ω := fun i hi => Classical.choose ⋯
 hf' : ∀ (i : ι) (hi : i ∈ s),
   inst✝³.MeasurableSet' (Classical.choose ⋯) ∧ Function.eval i ⁻¹' Classical.choose ⋯ = f i :=
   fun i hi => Classical.choose_spec (hf i hi)
 f'' : ι → Set Ω := fun i => if h : i ∈ s then f' i h else Set.univ
 x : ι → Ω
 hx : x ∈ Set.univ.pi f''
 ⊢ ∀ (i : ι), x ∈ ⋂ (_ : i ∈ s), f i]
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory

theorem extracted_formal_statement_8.{u_2, u_1} {Ω : Type u_1} {ι : Type u_2} [inst : MeasurableSpace Ω] {μ : Measure Ω}
  [inst_1 : IsProbabilityMeasure μ] [inst_2 : Fintype ι] [inst_3 : DecidableEq ι] (s : Finset ι) {f : ι → Set (ι → Ω)}
  (hf : ∀ i ∈ s, ∃ s', inst.MeasurableSet' s' ∧ Function.eval i ⁻¹' s' = f i) :
  let f' := fun i hi => Classical.choose (hf i hi);
  let hf' := fun i hi => Classical.choose_spec (hf i hi);
  let f'' := fun i => if h : i ∈ s then f' i h else Set.univ;
  ∀ x ∈ Set.univ.pi f'', ∀ (i : ι), x ∈ ⋂ (_ : i ∈ s), f i → i ∈ s → x ∈ f i := sorry

Tactic state before:
case h.mpr
Ω : Type u_1
ι : Type u_2
inst✝³ : MeasurableSpace Ω
μ : Measure Ω
inst✝² : IsProbabilityMeasure μ
inst✝¹ : Fintype ι
inst✝ : DecidableEq ι
s : Finset ι
f : ι → Set (ι → Ω)
hf : ∀ i ∈ s, ∃ s', inst✝³.MeasurableSet' s' ∧ Function.eval i ⁻¹' s' = f i
f' : (i : ι) → i ∈ s → Set Ω := fun i hi => Classical.choose ⋯
hf' : ∀ (i : ι) (hi : i ∈ s),
  inst✝³.MeasurableSet' (Classical.choose ⋯) ∧ Function.eval i ⁻¹' Classical.choose ⋯ = f i :=
  fun i hi => Classical.choose_spec (hf i hi)
f'' : ι → Set Ω := fun i => if h : i ∈ s then f' i h else Set.univ
x : ι → Ω
hx : x ∈ Set.univ.pi f''
i : ι
⊢ x ∈ ⋂ (_ : i ∈ s), f i

Tactic:
apply Set.mem_iInter.mpr

Tactic state after:
[case h.mpr
 Ω : Type u_1
 ι : Type u_2
 inst✝³ : MeasurableSpace Ω
 μ : Measure Ω
 inst✝² : IsProbabilityMeasure μ
 inst✝¹ : Fintype ι
 inst✝ : DecidableEq ι
 s : Finset ι
 f : ι → Set (ι → Ω)
 hf : ∀ i ∈ s, ∃ s', inst✝³.MeasurableSet' s' ∧ Function.eval i ⁻¹' s' = f i
 f' : (i : ι) → i ∈ s → Set Ω := fun i hi => Classical.choose ⋯
 hf' : ∀ (i : ι) (hi : i ∈ s),
   inst✝³.MeasurableSet' (Classical.choose ⋯) ∧ Function.eval i ⁻¹' Classical.choose ⋯ = f i :=
   fun i hi => Classical.choose_spec (hf i hi)
 f'' : ι → Set Ω := fun i => if h : i ∈ s then f' i h else Set.univ
 x : ι → Ω
 hx : x ∈ Set.univ.pi f''
 i : ι
 ⊢ i ∈ s → x ∈ f i]
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory

theorem extracted_formal_statement_9.{u_2, u_1} {Ω : Type u_1} {ι : Type u_2} [inst : MeasurableSpace Ω] {μ : Measure Ω}
  [inst_1 : IsProbabilityMeasure μ] [inst_2 : Fintype ι] [inst_3 : DecidableEq ι] (s : Finset ι) {f : ι → Set (ι → Ω)}
  (hf : ∀ i ∈ s, ∃ s', inst.MeasurableSet' s' ∧ Function.eval i ⁻¹' s' = f i) :
  let f' := fun i hi => Classical.choose (hf i hi);
  let hf' := fun i hi => Classical.choose_spec (hf i hi);
  let f'' := fun i => if h : i ∈ s then f' i h else Set.univ;
  ∀ x ∈ Set.univ.pi f'',
    ∀ (i : ι) (hi : i ∈ s), x i ∈ f' i hi → x ∈ f i → x ∈ Function.eval i ⁻¹' Classical.choose (hf i hi) := sorry

Tactic state before:
case h.mpr
Ω : Type u_1
ι : Type u_2
inst✝³ : MeasurableSpace Ω
μ : Measure Ω
inst✝² : IsProbabilityMeasure μ
inst✝¹ : Fintype ι
inst✝ : DecidableEq ι
s : Finset ι
f : ι → Set (ι → Ω)
hf : ∀ i ∈ s, ∃ s', inst✝³.MeasurableSet' s' ∧ Function.eval i ⁻¹' s' = f i
f' : (i : ι) → i ∈ s → Set Ω := fun i hi => Classical.choose ⋯
hf' : ∀ (i : ι) (hi : i ∈ s),
  inst✝³.MeasurableSet' (Classical.choose ⋯) ∧ Function.eval i ⁻¹' Classical.choose ⋯ = f i :=
  fun i hi => Classical.choose_spec (hf i hi)
f'' : ι → Set Ω := fun i => if h : i ∈ s then f' i h else Set.univ
x : ι → Ω
hx : x ∈ Set.univ.pi f''
i : ι
hi : i ∈ s
this : x i ∈ f' i hi
⊢ x ∈ f i

Tactic:
rw [← (hf' i hi).2]

Tactic state after:
[case h.mpr
 Ω : Type u_1
 ι : Type u_2
 inst✝³ : MeasurableSpace Ω
 μ : Measure Ω
 inst✝² : IsProbabilityMeasure μ
 inst✝¹ : Fintype ι
 inst✝ : DecidableEq ι
 s : Finset ι
 f : ι → Set (ι → Ω)
 hf : ∀ i ∈ s, ∃ s', inst✝³.MeasurableSet' s' ∧ Function.eval i ⁻¹' s' = f i
 f' : (i : ι) → i ∈ s → Set Ω := fun i hi => Classical.choose ⋯
 hf' : ∀ (i : ι) (hi : i ∈ s),
   inst✝³.MeasurableSet' (Classical.choose ⋯) ∧ Function.eval i ⁻¹' Classical.choose ⋯ = f i :=
   fun i hi => Classical.choose_spec (hf i hi)
 f'' : ι → Set Ω := fun i => if h : i ∈ s then f' i h else Set.univ
 x : ι → Ω
 hx : x ∈ Set.univ.pi f''
 i : ι
 hi : i ∈ s
 this : x i ∈ f' i hi
 ⊢ x ∈ Function.eval i ⁻¹' Classical.choose ⋯]
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory

theorem extracted_formal_statement_10.{u_2, u_1} {Ω : Type u_1} {ι : Type u_2} [inst : MeasurableSpace Ω] {μ : Measure Ω}
  [inst_1 : IsProbabilityMeasure μ] [inst_2 : Fintype ι] [inst_3 : DecidableEq ι] (s : Finset ι) {f : ι → Set (ι → Ω)}
  (hf : ∀ i ∈ s, ∃ s', inst.MeasurableSet' s' ∧ Function.eval i ⁻¹' s' = f i) :
  let f' := fun i hi => Classical.choose (hf i hi);
  let hf' := fun i hi => Classical.choose_spec (hf i hi);
  let f'' := fun i => if h : i ∈ s then f' i h else Set.univ;
  ∀ x ∈ Set.univ.pi f'',
    ∀ (i : ι) (hi : i ∈ s), x i ∈ f' i hi → x ∈ Function.eval i ⁻¹' Classical.choose (hf i hi) := sorry

Tactic state before:
case h.mpr
Ω : Type u_1
ι : Type u_2
inst✝³ : MeasurableSpace Ω
μ : Measure Ω
inst✝² : IsProbabilityMeasure μ
inst✝¹ : Fintype ι
inst✝ : DecidableEq ι
s : Finset ι
f : ι → Set (ι → Ω)
hf : ∀ i ∈ s, ∃ s', inst✝³.MeasurableSet' s' ∧ Function.eval i ⁻¹' s' = f i
f' : (i : ι) → i ∈ s → Set Ω := fun i hi => Classical.choose ⋯
hf' : ∀ (i : ι) (hi : i ∈ s),
  inst✝³.MeasurableSet' (Classical.choose ⋯) ∧ Function.eval i ⁻¹' Classical.choose ⋯ = f i :=
  fun i hi => Classical.choose_spec (hf i hi)
f'' : ι → Set Ω := fun i => if h : i ∈ s then f' i h else Set.univ
x : ι → Ω
hx : x ∈ Set.univ.pi f''
i : ι
hi : i ∈ s
this : x i ∈ f' i hi
⊢ x ∈ Function.eval i ⁻¹' Classical.choose ⋯

Tactic:
exact this

Tactic state after:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory

theorem extracted_formal_statement_11.{u_2, u_1} {Ω : Type u_1} {ι : Type u_2} [inst : MeasurableSpace Ω] {μ : Measure Ω}
  [inst_1 : IsProbabilityMeasure μ] [inst_2 : Fintype ι] [inst_3 : DecidableEq ι] (s : Finset ι) {f : ι → Set (ι → Ω)}
  (hf : ∀ i ∈ s, ∃ s', inst.MeasurableSet' s' ∧ Function.eval i ⁻¹' s' = f i) :
  let f' := fun i hi => Classical.choose (hf i hi);
  let hf' := fun i hi => Classical.choose_spec (hf i hi);
  let f'' := fun i => if h : i ∈ s then f' i h else Set.univ;
  ⋂ i ∈ s, f i = Set.univ.pi f'' →
    (Measure.pi fun x => μ) (⋂ i ∈ s, f i) = ∏ x ∈ s, (Measure.pi fun x => μ) (f x) →
      ∏ i, μ (f'' i) = ∏ x ∈ s, (Measure.pi fun x => μ) (f x) := sorry

Tactic state before:
Ω : Type u_1
ι : Type u_2
inst✝³ : MeasurableSpace Ω
μ : Measure Ω
inst✝² : IsProbabilityMeasure μ
inst✝¹ : Fintype ι
inst✝ : DecidableEq ι
s : Finset ι
f : ι → Set (ι → Ω)
hf : ∀ i ∈ s, ∃ s', inst✝³.MeasurableSet' s' ∧ Function.eval i ⁻¹' s' = f i
f' : (i : ι) → i ∈ s → Set Ω := fun i hi => Classical.choose ⋯
hf' : ∀ (i : ι) (hi : i ∈ s),
  inst✝³.MeasurableSet' (Classical.choose ⋯) ∧ Function.eval i ⁻¹' Classical.choose ⋯ = f i :=
  fun i hi => Classical.choose_spec (hf i hi)
f'' : ι → Set Ω := fun i => if h : i ∈ s then f' i h else Set.univ
this : ⋂ i ∈ s, f i = Set.univ.pi f''
⊢ (Measure.pi fun x => μ) (⋂ i ∈ s, f i) = ∏ x ∈ s, (Measure.pi fun x => μ) (f x)

Tactic:
rw [this, Measure.pi_pi]

Tactic state after:
[Ω : Type u_1
 ι : Type u_2
 inst✝³ : MeasurableSpace Ω
 μ : Measure Ω
 inst✝² : IsProbabilityMeasure μ
 inst✝¹ : Fintype ι
 inst✝ : DecidableEq ι
 s : Finset ι
 f : ι → Set (ι → Ω)
 hf : ∀ i ∈ s, ∃ s', inst✝³.MeasurableSet' s' ∧ Function.eval i ⁻¹' s' = f i
 f' : (i : ι) → i ∈ s → Set Ω := fun i hi => Classical.choose ⋯
 hf' : ∀ (i : ι) (hi : i ∈ s),
   inst✝³.MeasurableSet' (Classical.choose ⋯) ∧ Function.eval i ⁻¹' Classical.choose ⋯ = f i :=
   fun i hi => Classical.choose_spec (hf i hi)
 f'' : ι → Set Ω := fun i => if h : i ∈ s then f' i h else Set.univ
 this : ⋂ i ∈ s, f i = Set.univ.pi f''
 ⊢ ∏ i, μ (f'' i) = ∏ x ∈ s, (Measure.pi fun x => μ) (f x)]
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory

theorem extracted_formal_statement_12.{u_2, u_1} {Ω : Type u_1} {ι : Type u_2} [inst : MeasurableSpace Ω] {μ : Measure Ω}
  [inst_1 : IsProbabilityMeasure μ] [inst_2 : Fintype ι] [inst_3 : DecidableEq ι] (s : Finset ι) {f : ι → Set (ι → Ω)}
  (hf : ∀ i ∈ s, ∃ s', inst.MeasurableSet' s' ∧ Function.eval i ⁻¹' s' = f i) :
  let f' := fun i hi => Classical.choose (hf i hi);
  let hf' := fun i hi => Classical.choose_spec (hf i hi);
  let f'' := fun i => if h : i ∈ s then f' i h else Set.univ;
  ⋂ i ∈ s, f i = Set.univ.pi f'' →
    ∀ (i : ι) (h : i ∈ s),
      (μ (if h : i ∈ s then f' i h else Set.univ) = if i ∈ s then (Measure.pi fun x => μ) (f i) else 1) →
        μ (f' i h) = (Measure.pi fun x => μ) (Function.eval i ⁻¹' Classical.choose (hf i h)) := sorry

Tactic state before:
Ω : Type u_1
ι : Type u_2
inst✝³ : MeasurableSpace Ω
μ : Measure Ω
inst✝² : IsProbabilityMeasure μ
inst✝¹ : Fintype ι
inst✝ : DecidableEq ι
s : Finset ι
f : ι → Set (ι → Ω)
hf : ∀ i ∈ s, ∃ s', inst✝³.MeasurableSet' s' ∧ Function.eval i ⁻¹' s' = f i
f' : (i : ι) → i ∈ s → Set Ω := fun i hi => Classical.choose ⋯
hf' : ∀ (i : ι) (hi : i ∈ s),
  inst✝³.MeasurableSet' (Classical.choose ⋯) ∧ Function.eval i ⁻¹' Classical.choose ⋯ = f i :=
  fun i hi => Classical.choose_spec (hf i hi)
f'' : ι → Set Ω := fun i => if h : i ∈ s then f' i h else Set.univ
this : ⋂ i ∈ s, f i = Set.univ.pi f''
i : ι
h : i ∈ s
⊢ μ (if h : i ∈ s then f' i h else Set.univ) = if i ∈ s then (Measure.pi fun x => μ) (f i) else 1

Tactic:
rw [dif_pos h, if_pos h, ← (hf' i h).2]

Tactic state after:
[Ω : Type u_1
 ι : Type u_2
 inst✝³ : MeasurableSpace Ω
 μ : Measure Ω
 inst✝² : IsProbabilityMeasure μ
 inst✝¹ : Fintype ι
 inst✝ : DecidableEq ι
 s : Finset ι
 f : ι → Set (ι → Ω)
 hf : ∀ i ∈ s, ∃ s', inst✝³.MeasurableSet' s' ∧ Function.eval i ⁻¹' s' = f i
 f' : (i : ι) → i ∈ s → Set Ω := fun i hi => Classical.choose ⋯
 hf' : ∀ (i : ι) (hi : i ∈ s),
   inst✝³.MeasurableSet' (Classical.choose ⋯) ∧ Function.eval i ⁻¹' Classical.choose ⋯ = f i :=
   fun i hi => Classical.choose_spec (hf i hi)
 f'' : ι → Set Ω := fun i => if h : i ∈ s then f' i h else Set.univ
 this : ⋂ i ∈ s, f i = Set.univ.pi f''
 i : ι
 h : i ∈ s
 ⊢ μ (f' i h) = (Measure.pi fun x => μ) (Function.eval i ⁻¹' Classical.choose ⋯)]
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory

theorem extracted_formal_statement_13.{u_2, u_1} {Ω : Type u_1} {ι : Type u_2} [inst : MeasurableSpace Ω] {μ : Measure Ω}
  [inst_1 : IsProbabilityMeasure μ] [inst_2 : Fintype ι] [inst_3 : DecidableEq ι] (s : Finset ι) {f : ι → Set (ι → Ω)}
  (hf : ∀ i ∈ s, ∃ s', inst.MeasurableSet' s' ∧ Function.eval i ⁻¹' s' = f i) :
  let f' := fun i hi => Classical.choose (hf i hi);
  let hf' := fun i hi => Classical.choose_spec (hf i hi);
  let f'' := fun i => if h : i ∈ s then f' i h else Set.univ;
  ⋂ i ∈ s, f i = Set.univ.pi f'' →
    ∀ i ∈ s,
      μ = Measure.map (Function.eval i) (Measure.pi fun x => μ) →
        Measure.map (Function.eval i) (Measure.pi fun x => μ) = μ := sorry

Tactic state before:
case e_a
Ω : Type u_1
ι : Type u_2
inst✝³ : MeasurableSpace Ω
μ : Measure Ω
inst✝² : IsProbabilityMeasure μ
inst✝¹ : Fintype ι
inst✝ : DecidableEq ι
s : Finset ι
f : ι → Set (ι → Ω)
hf : ∀ i ∈ s, ∃ s', inst✝³.MeasurableSet' s' ∧ Function.eval i ⁻¹' s' = f i
f' : (i : ι) → i ∈ s → Set Ω := fun i hi => Classical.choose ⋯
hf' : ∀ (i : ι) (hi : i ∈ s),
  inst✝³.MeasurableSet' (Classical.choose ⋯) ∧ Function.eval i ⁻¹' Classical.choose ⋯ = f i :=
  fun i hi => Classical.choose_spec (hf i hi)
f'' : ι → Set Ω := fun i => if h : i ∈ s then f' i h else Set.univ
this : ⋂ i ∈ s, f i = Set.univ.pi f''
i : ι
h : i ∈ s
⊢ μ = Measure.map (Function.eval i) (Measure.pi fun x => μ)

Tactic:
apply Eq.symm

Tactic state after:
[case e_a.h
 Ω : Type u_1
 ι : Type u_2
 inst✝³ : MeasurableSpace Ω
 μ : Measure Ω
 inst✝² : IsProbabilityMeasure μ
 inst✝¹ : Fintype ι
 inst✝ : DecidableEq ι
 s : Finset ι
 f : ι → Set (ι → Ω)
 hf : ∀ i ∈ s, ∃ s', inst✝³.MeasurableSet' s' ∧ Function.eval i ⁻¹' s' = f i
 f' : (i : ι) → i ∈ s → Set Ω := fun i hi => Classical.choose ⋯
 hf' : ∀ (i : ι) (hi : i ∈ s),
   inst✝³.MeasurableSet' (Classical.choose ⋯) ∧ Function.eval i ⁻¹' Classical.choose ⋯ = f i :=
   fun i hi => Classical.choose_spec (hf i hi)
 f'' : ι → Set Ω := fun i => if h : i ∈ s then f' i h else Set.univ
 this : ⋂ i ∈ s, f i = Set.univ.pi f''
 i : ι
 h : i ∈ s
 ⊢ Measure.map (Function.eval i) (Measure.pi fun x => μ) = μ]