l3lab/ntp-mathlib huggingface dataset:
/-- The product measure of the product of two sets is the product of their measures. Note that we
do not need the sets to be measurable. -/
@[simp]
theorem prod_prod (s : Set α) (t : Set β) : μ.prod ν (s ×ˢ t) = μ s * ν t := by
  apply le_antisymm
  · set ST := toMeasurable μ s ×ˢ toMeasurable ν t
    have hSTm : MeasurableSet ST :=
      (measurableSet_toMeasurable _ _).prod (measurableSet_toMeasurable _ _)
    calc
      μ.prod ν (s ×ˢ t) ≤ μ.prod ν ST :=
        measure_mono <| Set.prod_mono (subset_toMeasurable _ _) (subset_toMeasurable _ _)
      _ = μ (toMeasurable μ s) * ν (toMeasurable ν t) := by
        rw [prod_apply hSTm]
        

Proof state:
α : Type u_1
α' : Type u_2
β : Type u_3
β' : Type u_4
γ : Type u_5
E : Type u_6
inst✝⁶ : MeasurableSpace α
inst✝⁵ : MeasurableSpace α'
inst✝⁴ : MeasurableSpace β
inst✝³ : MeasurableSpace β'
inst✝² : MeasurableSpace γ
μ μ' : Measure α
ν ν' : Measure β
τ : Measure γ
inst✝¹ : NormedAddCommGroup E
inst✝ : SFinite ν
s : Set α
t : Set β
ST : Set (α × β) := toMeasurable μ s ×ˢ toMeasurable ν t
hSTm : MeasurableSet ST
⊢ ∫⁻ (x : α), ↑↑ν (Prod.mk x ⁻¹' ST) ∂μ = ↑↑μ (toMeasurable μ s) * ↑↑ν (toMeasurable ν t)

Next tactic:
simp_rw [mk_preimage_prod_right_eq_if, measure_if,
          lintegral_indicator _ (measurableSet_toMeasurable _ _), lintegral_const,
          restrict_apply_univ, mul_comm]
/-- The product measure of the product of two sets is the product of their measures. Note that we
do not need the sets to be measurable. -/
@[simp]
theorem prod_prod (s : Set α) (t : Set β) : μ.prod ν (s ×ˢ t) = μ s * ν t := by
  apply le_antisymm
  · set ST := toMeasurable μ s ×ˢ toMeasurable ν t
    have hSTm : MeasurableSet ST :=
      (measurableSet_toMeasurable _ _).prod (measurableSet_toMeasurable _ _)
    calc
      μ.prod ν (s ×ˢ t) ≤ μ.prod ν ST :=
        measure_mono <| Set.prod_mono (subset_toMeasurable _ _) (subset_toMeasurable _ _)
      _ = μ (toMeasurable μ s) * ν (toMeasurable ν t) := by
        rw [prod_apply hSTm]
        simp_rw [mk_preimage_prod_right_eq_if, measure_if,
          lintegral_indicator _ (measurableSet_toMeasurable _ _), lintegral_const,
          restrict_apply_univ, mul_comm]
      _ = μ s * ν t := by 

Proof state:
α : Type u_1
α' : Type u_2
β : Type u_3
β' : Type u_4
γ : Type u_5
E : Type u_6
inst✝⁶ : MeasurableSpace α
inst✝⁵ : MeasurableSpace α'
inst✝⁴ : MeasurableSpace β
inst✝³ : MeasurableSpace β'
inst✝² : MeasurableSpace γ
μ μ' : Measure α
ν ν' : Measure β
τ : Measure γ
inst✝¹ : NormedAddCommGroup E
inst✝ : SFinite ν
s : Set α
t : Set β
ST : Set (α × β) := toMeasurable μ s ×ˢ toMeasurable ν t
hSTm : MeasurableSet ST
⊢ ↑↑μ (toMeasurable μ s) * ↑↑ν (toMeasurable ν t) = ↑↑μ s * ↑↑ν t

Next tactic:
rw [measure_toMeasurable, measure_toMeasurable]
/-- The product measure of the product of two sets is the product of their measures. Note that we
do not need the sets to be measurable. -/
@[simp]
theorem prod_prod (s : Set α) (t : Set β) : μ.prod ν (s ×ˢ t) = μ s * ν t := by
  apply le_antisymm
  · set ST := toMeasurable μ s ×ˢ toMeasurable ν t
    have hSTm : MeasurableSet ST :=
      (measurableSet_toMeasurable _ _).prod (measurableSet_toMeasurable _ _)
    calc
      μ.prod ν (s ×ˢ t) ≤ μ.prod ν ST :=
        measure_mono <| Set.prod_mono (subset_toMeasurable _ _) (subset_toMeasurable _ _)
      _ = μ (toMeasurable μ s) * ν (toMeasurable ν t) := by
        rw [prod_apply hSTm]
        simp_rw [mk_preimage_prod_right_eq_if, measure_if,
          lintegral_indicator _ (measurableSet_toMeasurable _ _), lintegral_const,
          restrict_apply_univ, mul_comm]
      _ = μ s * ν t := by rw [measure_toMeasurable, measure_toMeasurable]
  · -- Formalization is based on https://mathoverflow.net/a/254134/136589
    

Proof state:
case a
α : Type u_1
α' : Type u_2
β : Type u_3
β' : Type u_4
γ : Type u_5
E : Type u_6
inst✝⁶ : MeasurableSpace α
inst✝⁵ : MeasurableSpace α'
inst✝⁴ : MeasurableSpace β
inst✝³ : MeasurableSpace β'
inst✝² : MeasurableSpace γ
μ μ' : Measure α
ν ν' : Measure β
τ : Measure γ
inst✝¹ : NormedAddCommGroup E
inst✝ : SFinite ν
s : Set α
t : Set β
⊢ ↑↑μ s * ↑↑ν t ≤ ↑↑(Measure.prod μ ν) (s ×ˢ t)

Next tactic:
set ST := toMeasurable (μ.prod ν) (s ×ˢ t)
/-- The product measure of the product of two sets is the product of their measures. Note that we
do not need the sets to be measurable. -/
@[simp]
theorem prod_prod (s : Set α) (t : Set β) : μ.prod ν (s ×ˢ t) = μ s * ν t := by
  apply le_antisymm
  · set ST := toMeasurable μ s ×ˢ toMeasurable ν t
    have hSTm : MeasurableSet ST :=
      (measurableSet_toMeasurable _ _).prod (measurableSet_toMeasurable _ _)
    calc
      μ.prod ν (s ×ˢ t) ≤ μ.prod ν ST :=
        measure_mono <| Set.prod_mono (subset_toMeasurable _ _) (subset_toMeasurable _ _)
      _ = μ (toMeasurable μ s) * ν (toMeasurable ν t) := by
        rw [prod_apply hSTm]
        simp_rw [mk_preimage_prod_right_eq_if, measure_if,
          lintegral_indicator _ (measurableSet_toMeasurable _ _), lintegral_const,
          restrict_apply_univ, mul_comm]
      _ = μ s * ν t := by rw [measure_toMeasurable, measure_toMeasurable]
  · -- Formalization is based on https://mathoverflow.net/a/254134/136589
    set ST := toMeasurable (μ.prod ν) (s ×ˢ t)
    

Proof state:
case a
α : Type u_1
α' : Type u_2
β : Type u_3
β' : Type u_4
γ : Type u_5
E : Type u_6
inst✝⁶ : MeasurableSpace α
inst✝⁵ : MeasurableSpace α'
inst✝⁴ : MeasurableSpace β
inst✝³ : MeasurableSpace β'
inst✝² : MeasurableSpace γ
μ μ' : Measure α
ν ν' : Measure β
τ : Measure γ
inst✝¹ : NormedAddCommGroup E
inst✝ : SFinite ν
s : Set α
t : Set β
ST : Set (α × β) := toMeasurable (Measure.prod μ ν) (s ×ˢ t)
⊢ ↑↑μ s * ↑↑ν t ≤ ↑↑(Measure.prod μ ν) (s ×ˢ t)

Next tactic:
have hSTm : MeasurableSet ST := measurableSet_toMeasurable _ _
/-- The product measure of the product of two sets is the product of their measures. Note that we
do not need the sets to be measurable. -/
@[simp]
theorem prod_prod (s : Set α) (t : Set β) : μ.prod ν (s ×ˢ t) = μ s * ν t := by
  apply le_antisymm
  · set ST := toMeasurable μ s ×ˢ toMeasurable ν t
    have hSTm : MeasurableSet ST :=
      (measurableSet_toMeasurable _ _).prod (measurableSet_toMeasurable _ _)
    calc
      μ.prod ν (s ×ˢ t) ≤ μ.prod ν ST :=
        measure_mono <| Set.prod_mono (subset_toMeasurable _ _) (subset_toMeasurable _ _)
      _ = μ (toMeasurable μ s) * ν (toMeasurable ν t) := by
        rw [prod_apply hSTm]
        simp_rw [mk_preimage_prod_right_eq_if, measure_if,
          lintegral_indicator _ (measurableSet_toMeasurable _ _), lintegral_const,
          restrict_apply_univ, mul_comm]
      _ = μ s * ν t := by rw [measure_toMeasurable, measure_toMeasurable]
  · -- Formalization is based on https://mathoverflow.net/a/254134/136589
    set ST := toMeasurable (μ.prod ν) (s ×ˢ t)
    have hSTm : MeasurableSet ST := measurableSet_toMeasurable _ _
    

Proof state:
case a
α : Type u_1
α' : Type u_2
β : Type u_3
β' : Type u_4
γ : Type u_5
E : Type u_6
inst✝⁶ : MeasurableSpace α
inst✝⁵ : MeasurableSpace α'
inst✝⁴ : MeasurableSpace β
inst✝³ : MeasurableSpace β'
inst✝² : MeasurableSpace γ
μ μ' : Measure α
ν ν' : Measure β
τ : Measure γ
inst✝¹ : NormedAddCommGroup E
inst✝ : SFinite ν
s : Set α
t : Set β
ST : Set (α × β) := toMeasurable (Measure.prod μ ν) (s ×ˢ t)
hSTm : MeasurableSet ST
⊢ ↑↑μ s * ↑↑ν t ≤ ↑↑(Measure.prod μ ν) (s ×ˢ t)

Next tactic:
have hST : s ×ˢ t ⊆ ST := subset_toMeasurable _ _
/-- The product measure of the product of two sets is the product of their measures. Note that we
do not need the sets to be measurable. -/
@[simp]
theorem prod_prod (s : Set α) (t : Set β) : μ.prod ν (s ×ˢ t) = μ s * ν t := by
  apply le_antisymm
  · set ST := toMeasurable μ s ×ˢ toMeasurable ν t
    have hSTm : MeasurableSet ST :=
      (measurableSet_toMeasurable _ _).prod (measurableSet_toMeasurable _ _)
    calc
      μ.prod ν (s ×ˢ t) ≤ μ.prod ν ST :=
        measure_mono <| Set.prod_mono (subset_toMeasurable _ _) (subset_toMeasurable _ _)
      _ = μ (toMeasurable μ s) * ν (toMeasurable ν t) := by
        rw [prod_apply hSTm]
        simp_rw [mk_preimage_prod_right_eq_if, measure_if,
          lintegral_indicator _ (measurableSet_toMeasurable _ _), lintegral_const,
          restrict_apply_univ, mul_comm]
      _ = μ s * ν t := by rw [measure_toMeasurable, measure_toMeasurable]
  · -- Formalization is based on https://mathoverflow.net/a/254134/136589
    set ST := toMeasurable (μ.prod ν) (s ×ˢ t)
    have hSTm : MeasurableSet ST := measurableSet_toMeasurable _ _
    have hST : s ×ˢ t ⊆ ST := subset_toMeasurable _ _
    

Proof state:
case a
α : Type u_1
α' : Type u_2
β : Type u_3
β' : Type u_4
γ : Type u_5
E : Type u_6
inst✝⁶ : MeasurableSpace α
inst✝⁵ : MeasurableSpace α'
inst✝⁴ : MeasurableSpace β
inst✝³ : MeasurableSpace β'
inst✝² : MeasurableSpace γ
μ μ' : Measure α
ν ν' : Measure β
τ : Measure γ
inst✝¹ : NormedAddCommGroup E
inst✝ : SFinite ν
s : Set α
t : Set β
ST : Set (α × β) := toMeasurable (Measure.prod μ ν) (s ×ˢ t)
hSTm : MeasurableSet ST
hST : s ×ˢ t ⊆ ST
⊢ ↑↑μ s * ↑↑ν t ≤ ↑↑(Measure.prod μ ν) (s ×ˢ t)

Next tactic:
set f : α → ℝ≥0∞ := fun x => ν (Prod.mk x ⁻¹' ST)
/-- The product measure of the product of two sets is the product of their measures. Note that we
do not need the sets to be measurable. -/
@[simp]
theorem prod_prod (s : Set α) (t : Set β) : μ.prod ν (s ×ˢ t) = μ s * ν t := by
  apply le_antisymm
  · set ST := toMeasurable μ s ×ˢ toMeasurable ν t
    have hSTm : MeasurableSet ST :=
      (measurableSet_toMeasurable _ _).prod (measurableSet_toMeasurable _ _)
    calc
      μ.prod ν (s ×ˢ t) ≤ μ.prod ν ST :=
        measure_mono <| Set.prod_mono (subset_toMeasurable _ _) (subset_toMeasurable _ _)
      _ = μ (toMeasurable μ s) * ν (toMeasurable ν t) := by
        rw [prod_apply hSTm]
        simp_rw [mk_preimage_prod_right_eq_if, measure_if,
          lintegral_indicator _ (measurableSet_toMeasurable _ _), lintegral_const,
          restrict_apply_univ, mul_comm]
      _ = μ s * ν t := by rw [measure_toMeasurable, measure_toMeasurable]
  · -- Formalization is based on https://mathoverflow.net/a/254134/136589
    set ST := toMeasurable (μ.prod ν) (s ×ˢ t)
    have hSTm : MeasurableSet ST := measurableSet_toMeasurable _ _
    have hST : s ×ˢ t ⊆ ST := subset_toMeasurable _ _
    set f : α → ℝ≥0∞ := fun x => ν (Prod.mk x ⁻¹' ST)
    

Proof state:
case a
α : Type u_1
α' : Type u_2
β : Type u_3
β' : Type u_4
γ : Type u_5
E : Type u_6
inst✝⁶ : MeasurableSpace α
inst✝⁵ : MeasurableSpace α'
inst✝⁴ : MeasurableSpace β
inst✝³ : MeasurableSpace β'
inst✝² : MeasurableSpace γ
μ μ' : Measure α
ν ν' : Measure β
τ : Measure γ
inst✝¹ : NormedAddCommGroup E
inst✝ : SFinite ν
s : Set α
t : Set β
ST : Set (α × β) := toMeasurable (Measure.prod μ ν) (s ×ˢ t)
hSTm : MeasurableSet ST
hST : s ×ˢ t ⊆ ST
f : α → ℝ≥0∞ := fun x => ↑↑ν (Prod.mk x ⁻¹' ST)
⊢ ↑↑μ s * ↑↑ν t ≤ ↑↑(Measure.prod μ ν) (s ×ˢ t)

Next tactic:
have hfm : Measurable f := measurable_measure_prod_mk_left hSTm
/-- The product measure of the product of two sets is the product of their measures. Note that we
do not need the sets to be measurable. -/
@[simp]
theorem prod_prod (s : Set α) (t : Set β) : μ.prod ν (s ×ˢ t) = μ s * ν t := by
  apply le_antisymm
  · set ST := toMeasurable μ s ×ˢ toMeasurable ν t
    have hSTm : MeasurableSet ST :=
      (measurableSet_toMeasurable _ _).prod (measurableSet_toMeasurable _ _)
    calc
      μ.prod ν (s ×ˢ t) ≤ μ.prod ν ST :=
        measure_mono <| Set.prod_mono (subset_toMeasurable _ _) (subset_toMeasurable _ _)
      _ = μ (toMeasurable μ s) * ν (toMeasurable ν t) := by
        rw [prod_apply hSTm]
        simp_rw [mk_preimage_prod_right_eq_if, measure_if,
          lintegral_indicator _ (measurableSet_toMeasurable _ _), lintegral_const,
          restrict_apply_univ, mul_comm]
      _ = μ s * ν t := by rw [measure_toMeasurable, measure_toMeasurable]
  · -- Formalization is based on https://mathoverflow.net/a/254134/136589
    set ST := toMeasurable (μ.prod ν) (s ×ˢ t)
    have hSTm : MeasurableSet ST := measurableSet_toMeasurable _ _
    have hST : s ×ˢ t ⊆ ST := subset_toMeasurable _ _
    set f : α → ℝ≥0∞ := fun x => ν (Prod.mk x ⁻¹' ST)
    have hfm : Measurable f := measurable_measure_prod_mk_left hSTm
    

Proof state:
case a
α : Type u_1
α' : Type u_2
β : Type u_3
β' : Type u_4
γ : Type u_5
E : Type u_6
inst✝⁶ : MeasurableSpace α
inst✝⁵ : MeasurableSpace α'
inst✝⁴ : MeasurableSpace β
inst✝³ : MeasurableSpace β'
inst✝² : MeasurableSpace γ
μ μ' : Measure α
ν ν' : Measure β
τ : Measure γ
inst✝¹ : NormedAddCommGroup E
inst✝ : SFinite ν
s : Set α
t : Set β
ST : Set (α × β) := toMeasurable (Measure.prod μ ν) (s ×ˢ t)
hSTm : MeasurableSet ST
hST : s ×ˢ t ⊆ ST
f : α → ℝ≥0∞ := fun x => ↑↑ν (Prod.mk x ⁻¹' ST)
hfm : Measurable f
⊢ ↑↑μ s * ↑↑ν t ≤ ↑↑(Measure.prod μ ν) (s ×ˢ t)

Next tactic:
set s' : Set α := { x | ν t ≤ f x }
/-- The product measure of the product of two sets is the product of their measures. Note that we
do not need the sets to be measurable. -/
@[simp]
theorem prod_prod (s : Set α) (t : Set β) : μ.prod ν (s ×ˢ t) = μ s * ν t := by
  apply le_antisymm
  · set ST := toMeasurable μ s ×ˢ toMeasurable ν t
    have hSTm : MeasurableSet ST :=
      (measurableSet_toMeasurable _ _).prod (measurableSet_toMeasurable _ _)
    calc
      μ.prod ν (s ×ˢ t) ≤ μ.prod ν ST :=
        measure_mono <| Set.prod_mono (subset_toMeasurable _ _) (subset_toMeasurable _ _)
      _ = μ (toMeasurable μ s) * ν (toMeasurable ν t) := by
        rw [prod_apply hSTm]
        simp_rw [mk_preimage_prod_right_eq_if, measure_if,
          lintegral_indicator _ (measurableSet_toMeasurable _ _), lintegral_const,
          restrict_apply_univ, mul_comm]
      _ = μ s * ν t := by rw [measure_toMeasurable, measure_toMeasurable]
  · -- Formalization is based on https://mathoverflow.net/a/254134/136589
    set ST := toMeasurable (μ.prod ν) (s ×ˢ t)
    have hSTm : MeasurableSet ST := measurableSet_toMeasurable _ _
    have hST : s ×ˢ t ⊆ ST := subset_toMeasurable _ _
    set f : α → ℝ≥0∞ := fun x => ν (Prod.mk x ⁻¹' ST)
    have hfm : Measurable f := measurable_measure_prod_mk_left hSTm
    set s' : Set α := { x | ν t ≤ f x }
    

Proof state:
case a
α : Type u_1
α' : Type u_2
β : Type u_3
β' : Type u_4
γ : Type u_5
E : Type u_6
inst✝⁶ : MeasurableSpace α
inst✝⁵ : MeasurableSpace α'
inst✝⁴ : MeasurableSpace β
inst✝³ : MeasurableSpace β'
inst✝² : MeasurableSpace γ
μ μ' : Measure α
ν ν' : Measure β
τ : Measure γ
inst✝¹ : NormedAddCommGroup E
inst✝ : SFinite ν
s : Set α
t : Set β
ST : Set (α × β) := toMeasurable (Measure.prod μ ν) (s ×ˢ t)
hSTm : MeasurableSet ST
hST : s ×ˢ t ⊆ ST
f : α → ℝ≥0∞ := fun x => ↑↑ν (Prod.mk x ⁻¹' ST)
hfm : Measurable f
s' : Set α := {x | ↑↑ν t ≤ f x}
⊢ ↑↑μ s * ↑↑ν t ≤ ↑↑(Measure.prod μ ν) (s ×ˢ t)

Next tactic:
have hss' : s ⊆ s' := fun x hx => measure_mono fun y hy => hST <| mk_mem_prod hx hy
/-- The product measure of the product of two sets is the product of their measures. Note that we
do not need the sets to be measurable. -/
@[simp]
theorem prod_prod (s : Set α) (t : Set β) : μ.prod ν (s ×ˢ t) = μ s * ν t := by
  apply le_antisymm
  · set ST := toMeasurable μ s ×ˢ toMeasurable ν t
    have hSTm : MeasurableSet ST :=
      (measurableSet_toMeasurable _ _).prod (measurableSet_toMeasurable _ _)
    calc
      μ.prod ν (s ×ˢ t) ≤ μ.prod ν ST :=
        measure_mono <| Set.prod_mono (subset_toMeasurable _ _) (subset_toMeasurable _ _)
      _ = μ (toMeasurable μ s) * ν (toMeasurable ν t) := by
        rw [prod_apply hSTm]
        simp_rw [mk_preimage_prod_right_eq_if, measure_if,
          lintegral_indicator _ (measurableSet_toMeasurable _ _), lintegral_const,
          restrict_apply_univ, mul_comm]
      _ = μ s * ν t := by rw [measure_toMeasurable, measure_toMeasurable]
  · -- Formalization is based on https://mathoverflow.net/a/254134/136589
    set ST := toMeasurable (μ.prod ν) (s ×ˢ t)
    have hSTm : MeasurableSet ST := measurableSet_toMeasurable _ _
    have hST : s ×ˢ t ⊆ ST := subset_toMeasurable _ _
    set f : α → ℝ≥0∞ := fun x => ν (Prod.mk x ⁻¹' ST)
    have hfm : Measurable f := measurable_measure_prod_mk_left hSTm
    set s' : Set α := { x | ν t ≤ f x }
    have hss' : s ⊆ s' := fun x hx => measure_mono fun y hy => hST <| mk_mem_prod hx hy
    

Proof state:
case a
α : Type u_1
α' : Type u_2
β : Type u_3
β' : Type u_4
γ : Type u_5
E : Type u_6
inst✝⁶ : MeasurableSpace α
inst✝⁵ : MeasurableSpace α'
inst✝⁴ : MeasurableSpace β
inst✝³ : MeasurableSpace β'
inst✝² : MeasurableSpace γ
μ μ' : Measure α
ν ν' : Measure β
τ : Measure γ
inst✝¹ : NormedAddCommGroup E
inst✝ : SFinite ν
s : Set α
t : Set β
ST : Set (α × β) := toMeasurable (Measure.prod μ ν) (s ×ˢ t)
hSTm : MeasurableSet ST
hST : s ×ˢ t ⊆ ST
f : α → ℝ≥0∞ := fun x => ↑↑ν (Prod.mk x ⁻¹' ST)
hfm : Measurable f
s' : Set α := {x | ↑↑ν t ≤ f x}
hss' : s ⊆ s'
⊢ ↑↑μ s * ↑↑ν t ≤ ↑↑(Measure.prod μ ν) (s ×ˢ t)

Next tactic:
calc
      μ s * ν t ≤ μ s' * ν t := mul_le_mul_right' (measure_mono hss') _
      _ = ∫⁻ _ in s', ν t ∂μ := by rw [set_lintegral_const, mul_comm]
      _ ≤ ∫⁻ x in s', f x ∂μ := (set_lintegral_mono measurable_const hfm fun x => id)
      _ ≤ ∫⁻ x, f x ∂μ := (lintegral_mono' restrict_le_self le_rfl)
      _ = μ.prod ν ST := (prod_apply hSTm).symm
      _ = μ.prod ν (s ×ˢ t) := measure_toMeasurable _
/-- The product measure of the product of two sets is the product of their measures. Note that we
do not need the sets to be measurable. -/
@[simp]
theorem prod_prod (s : Set α) (t : Set β) : μ.prod ν (s ×ˢ t) = μ s * ν t := by
  apply le_antisymm
  · set ST := toMeasurable μ s ×ˢ toMeasurable ν t
    have hSTm : MeasurableSet ST :=
      (measurableSet_toMeasurable _ _).prod (measurableSet_toMeasurable _ _)
    calc
      μ.prod ν (s ×ˢ t) ≤ μ.prod ν ST :=
        measure_mono <| Set.prod_mono (subset_toMeasurable _ _) (subset_toMeasurable _ _)
      _ = μ (toMeasurable μ s) * ν (toMeasurable ν t) := by
        rw [prod_apply hSTm]
        simp_rw [mk_preimage_prod_right_eq_if, measure_if,
          lintegral_indicator _ (measurableSet_toMeasurable _ _), lintegral_const,
          restrict_apply_univ, mul_comm]
      _ = μ s * ν t := by rw [measure_toMeasurable, measure_toMeasurable]
  · -- Formalization is based on https://mathoverflow.net/a/254134/136589
    set ST := toMeasurable (μ.prod ν) (s ×ˢ t)
    have hSTm : MeasurableSet ST := measurableSet_toMeasurable _ _
    have hST : s ×ˢ t ⊆ ST := subset_toMeasurable _ _
    set f : α → ℝ≥0∞ := fun x => ν (Prod.mk x ⁻¹' ST)
    have hfm : Measurable f := measurable_measure_prod_mk_left hSTm
    set s' : Set α := { x | ν t ≤ f x }
    have hss' : s ⊆ s' := fun x hx => measure_mono fun y hy => hST <| mk_mem_prod hx hy
    calc
      μ s * ν t ≤ μ s' * ν t := mul_le_mul_right' (measure_mono hss') _
      _ = ∫⁻ _ in s', ν t ∂μ := by 

Proof state:
α : Type u_1
α' : Type u_2
β : Type u_3
β' : Type u_4
γ : Type u_5
E : Type u_6
inst✝⁶ : MeasurableSpace α
inst✝⁵ : MeasurableSpace α'
inst✝⁴ : MeasurableSpace β
inst✝³ : MeasurableSpace β'
inst✝² : MeasurableSpace γ
μ μ' : Measure α
ν ν' : Measure β
τ : Measure γ
inst✝¹ : NormedAddCommGroup E
inst✝ : SFinite ν
s : Set α
t : Set β
ST : Set (α × β) := toMeasurable (Measure.prod μ ν) (s ×ˢ t)
hSTm : MeasurableSet ST
hST : s ×ˢ t ⊆ ST
f : α → ℝ≥0∞ := fun x => ↑↑ν (Prod.mk x ⁻¹' ST)
hfm : Measurable f
s' : Set α := {x | ↑↑ν t ≤ f x}
hss' : s ⊆ s'
⊢ ↑↑μ s' * ↑↑ν t = ∫⁻ (x : α) in s', ↑↑ν t ∂μ

Next tactic:
rw [set_lintegral_const, mul_comm]
@[simp] lemma map_fst_prod : Measure.map Prod.fst (μ.prod ν) = (ν univ) • μ := by
  

Proof state:
α : Type u_1
α' : Type u_2
β : Type u_3
β' : Type u_4
γ : Type u_5
E : Type u_6
inst✝⁶ : MeasurableSpace α
inst✝⁵ : MeasurableSpace α'
inst✝⁴ : MeasurableSpace β
inst✝³ : MeasurableSpace β'
inst✝² : MeasurableSpace γ
μ μ' : Measure α
ν ν' : Measure β
τ : Measure γ
inst✝¹ : NormedAddCommGroup E
inst✝ : SFinite ν
⊢ map Prod.fst (Measure.prod μ ν) = ↑↑ν univ • μ

Next tactic:
ext s hs
@[simp] lemma map_fst_prod : Measure.map Prod.fst (μ.prod ν) = (ν univ) • μ := by
  ext s hs
  

Proof state:
case h
α : Type u_1
α' : Type u_2
β : Type u_3
β' : Type u_4
γ : Type u_5
E : Type u_6
inst✝⁶ : MeasurableSpace α
inst✝⁵ : MeasurableSpace α'
inst✝⁴ : MeasurableSpace β
inst✝³ : MeasurableSpace β'
inst✝² : MeasurableSpace γ
μ μ' : Measure α
ν ν' : Measure β
τ : Measure γ
inst✝¹ : NormedAddCommGroup E
inst✝ : SFinite ν
s : Set α
hs : MeasurableSet s
⊢ ↑↑(map Prod.fst (Measure.prod μ ν)) s = ↑↑(↑↑ν univ • μ) s

Next tactic:
simp [Measure.map_apply measurable_fst hs, ← prod_univ, mul_comm]
@[simp] lemma map_snd_prod : Measure.map Prod.snd (μ.prod ν) = (μ univ) • ν := by
  

Proof state:
α : Type u_1
α' : Type u_2
β : Type u_3
β' : Type u_4
γ : Type u_5
E : Type u_6
inst✝⁶ : MeasurableSpace α
inst✝⁵ : MeasurableSpace α'
inst✝⁴ : MeasurableSpace β
inst✝³ : MeasurableSpace β'
inst✝² : MeasurableSpace γ
μ μ' : Measure α
ν ν' : Measure β
τ : Measure γ
inst✝¹ : NormedAddCommGroup E
inst✝ : SFinite ν
⊢ map Prod.snd (Measure.prod μ ν) = ↑↑μ univ • ν

Next tactic:
ext s hs
@[simp] lemma map_snd_prod : Measure.map Prod.snd (μ.prod ν) = (μ univ) • ν := by
  ext s hs
  

Proof state:
case h
α : Type u_1
α' : Type u_2
β : Type u_3
β' : Type u_4
γ : Type u_5
E : Type u_6
inst✝⁶ : MeasurableSpace α
inst✝⁵ : MeasurableSpace α'
inst✝⁴ : MeasurableSpace β
inst✝³ : MeasurableSpace β'
inst✝² : MeasurableSpace γ
μ μ' : Measure α
ν ν' : Measure β
τ : Measure γ
inst✝¹ : NormedAddCommGroup E
inst✝ : SFinite ν
s : Set β
hs : MeasurableSet s
⊢ ↑↑(map Prod.snd (Measure.prod μ ν)) s = ↑↑(↑↑μ univ • ν) s

Next tactic:
simp [Measure.map_apply measurable_snd hs, ← univ_prod]
instance prod.instIsOpenPosMeasure {X Y : Type*} [TopologicalSpace X] [TopologicalSpace Y]
    {m : MeasurableSpace X} {μ : Measure X} [IsOpenPosMeasure μ] {m' : MeasurableSpace Y}
    {ν : Measure Y} [IsOpenPosMeasure ν] [SFinite ν] : IsOpenPosMeasure (μ.prod ν) := by
  

Proof state:
α : Type u_1
α' : Type u_2
β : Type u_3
β' : Type u_4
γ : Type u_5
E : Type u_6
inst✝¹¹ : MeasurableSpace α
inst✝¹⁰ : MeasurableSpace α'
inst✝⁹ : MeasurableSpace β
inst✝⁸ : MeasurableSpace β'
inst✝⁷ : MeasurableSpace γ
μ✝ μ' : Measure α
ν✝ ν' : Measure β
τ : Measure γ
inst✝⁶ : NormedAddCommGroup E
inst✝⁵ : SFinite ν✝
X : Type u_7
Y : Type u_8
inst✝⁴ : TopologicalSpace X
inst✝³ : TopologicalSpace Y
m : MeasurableSpace X
μ : Measure X
inst✝² : IsOpenPosMeasure μ
m' : MeasurableSpace Y
ν : Measure Y
inst✝¹ : IsOpenPosMeasure ν
inst✝ : SFinite ν
⊢ IsOpenPosMeasure (Measure.prod μ ν)

Next tactic:
constructor
instance prod.instIsOpenPosMeasure {X Y : Type*} [TopologicalSpace X] [TopologicalSpace Y]
    {m : MeasurableSpace X} {μ : Measure X} [IsOpenPosMeasure μ] {m' : MeasurableSpace Y}
    {ν : Measure Y} [IsOpenPosMeasure ν] [SFinite ν] : IsOpenPosMeasure (μ.prod ν) := by
  constructor
  

Proof state:
case open_pos
α : Type u_1
α' : Type u_2
β : Type u_3
β' : Type u_4
γ : Type u_5
E : Type u_6
inst✝¹¹ : MeasurableSpace α
inst✝¹⁰ : MeasurableSpace α'
inst✝⁹ : MeasurableSpace β
inst✝⁸ : MeasurableSpace β'
inst✝⁷ : MeasurableSpace γ
μ✝ μ' : Measure α
ν✝ ν' : Measure β
τ : Measure γ
inst✝⁶ : NormedAddCommGroup E
inst✝⁵ : SFinite ν✝
X : Type u_7
Y : Type u_8
inst✝⁴ : TopologicalSpace X
inst✝³ : TopologicalSpace Y
m : MeasurableSpace X
μ : Measure X
inst✝² : IsOpenPosMeasure μ
m' : MeasurableSpace Y
ν : Measure Y
inst✝¹ : IsOpenPosMeasure ν
inst✝ : SFinite ν
⊢ ∀ (U : Set (X × Y)), IsOpen U → Set.Nonempty U → ↑↑(Measure.prod μ ν) U ≠ 0

Next tactic:
rintro U U_open ⟨⟨x, y⟩, hxy⟩