l3lab/ntp-mathlib huggingface dataset:
/-- A finite measure coerced into a real function is a signed measure. -/
@[simps]
def toSignedMeasure (μ : Measure α) [hμ : IsFiniteMeasure μ] : SignedMeasure α where
  measureOf' := fun i : Set α => if MeasurableSet i then (μ.measureOf i).toReal else 0
  empty' := by simp [μ.empty]
  not_measurable' _ hi := if_neg hi
  m_iUnion' f hf₁ hf₂ := by
    simp only [*, MeasurableSet.iUnion hf₁, if_true, measure_iUnion hf₂ hf₁]
    rw [ENNReal.tsum_toReal_eq]
    

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ : Measure α
hμ : IsFiniteMeasure μ
f : ℕ → Set α
hf₁ : ∀ (i : ℕ), MeasurableSet (f i)
hf₂ : Pairwise (Disjoint on f)
⊢ HasSum (fun i => ENNReal.toReal (↑↑μ (f i))) (∑' (a : ℕ), ENNReal.toReal (↑↑μ (f a)))
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ : Measure α
hμ : IsFiniteMeasure μ
f : ℕ → Set α
hf₁ : ∀ (i : ℕ), MeasurableSet (f i)
hf₂ : Pairwise (Disjoint on f)
⊢ ∀ (a : ℕ), ↑↑μ (f a) ≠ ⊤

Next tactic:
exacts [(summable_measure_toReal hf₁ hf₂).hasSum, fun _ ↦ measure_ne_top _ _]
theorem toSignedMeasure_congr {μ ν : Measure α} [IsFiniteMeasure μ] [IsFiniteMeasure ν]
    (h : μ = ν) : μ.toSignedMeasure = ν.toSignedMeasure := by
  

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν : Measure α
inst✝¹ : IsFiniteMeasure μ
inst✝ : IsFiniteMeasure ν
h : μ = ν
⊢ toSignedMeasure μ = toSignedMeasure ν

Next tactic:
congr
theorem toSignedMeasure_eq_toSignedMeasure_iff {μ ν : Measure α} [IsFiniteMeasure μ]
    [IsFiniteMeasure ν] : μ.toSignedMeasure = ν.toSignedMeasure ↔ μ = ν := by
  

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν : Measure α
inst✝¹ : IsFiniteMeasure μ
inst✝ : IsFiniteMeasure ν
⊢ toSignedMeasure μ = toSignedMeasure ν ↔ μ = ν

Next tactic:
refine' ⟨fun h => _, fun h => _⟩
theorem toSignedMeasure_eq_toSignedMeasure_iff {μ ν : Measure α} [IsFiniteMeasure μ]
    [IsFiniteMeasure ν] : μ.toSignedMeasure = ν.toSignedMeasure ↔ μ = ν := by
  refine' ⟨fun h => _, fun h => _⟩
  · 

Proof state:
case refine'_1
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν : Measure α
inst✝¹ : IsFiniteMeasure μ
inst✝ : IsFiniteMeasure ν
h : toSignedMeasure μ = toSignedMeasure ν
⊢ μ = ν

Next tactic:
ext1 i hi
theorem toSignedMeasure_eq_toSignedMeasure_iff {μ ν : Measure α} [IsFiniteMeasure μ]
    [IsFiniteMeasure ν] : μ.toSignedMeasure = ν.toSignedMeasure ↔ μ = ν := by
  refine' ⟨fun h => _, fun h => _⟩
  · ext1 i hi
    

Proof state:
case refine'_1.h
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν : Measure α
inst✝¹ : IsFiniteMeasure μ
inst✝ : IsFiniteMeasure ν
h : toSignedMeasure μ = toSignedMeasure ν
i : Set α
hi : MeasurableSet i
⊢ ↑↑μ i = ↑↑ν i

Next tactic:
have : μ.toSignedMeasure i = ν.toSignedMeasure i := by rw [h]
theorem toSignedMeasure_eq_toSignedMeasure_iff {μ ν : Measure α} [IsFiniteMeasure μ]
    [IsFiniteMeasure ν] : μ.toSignedMeasure = ν.toSignedMeasure ↔ μ = ν := by
  refine' ⟨fun h => _, fun h => _⟩
  · ext1 i hi
    have : μ.toSignedMeasure i = ν.toSignedMeasure i := by 

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν : Measure α
inst✝¹ : IsFiniteMeasure μ
inst✝ : IsFiniteMeasure ν
h : toSignedMeasure μ = toSignedMeasure ν
i : Set α
hi : MeasurableSet i
⊢ ↑(toSignedMeasure μ) i = ↑(toSignedMeasure ν) i

Next tactic:
rw [h]
theorem toSignedMeasure_eq_toSignedMeasure_iff {μ ν : Measure α} [IsFiniteMeasure μ]
    [IsFiniteMeasure ν] : μ.toSignedMeasure = ν.toSignedMeasure ↔ μ = ν := by
  refine' ⟨fun h => _, fun h => _⟩
  · ext1 i hi
    have : μ.toSignedMeasure i = ν.toSignedMeasure i := by rw [h]
    

Proof state:
case refine'_1.h
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν : Measure α
inst✝¹ : IsFiniteMeasure μ
inst✝ : IsFiniteMeasure ν
h : toSignedMeasure μ = toSignedMeasure ν
i : Set α
hi : MeasurableSet i
this : ↑(toSignedMeasure μ) i = ↑(toSignedMeasure ν) i
⊢ ↑↑μ i = ↑↑ν i

Next tactic:
rwa [toSignedMeasure_apply_measurable hi, toSignedMeasure_apply_measurable hi,
        ENNReal.toReal_eq_toReal] at this
theorem toSignedMeasure_eq_toSignedMeasure_iff {μ ν : Measure α} [IsFiniteMeasure μ]
    [IsFiniteMeasure ν] : μ.toSignedMeasure = ν.toSignedMeasure ↔ μ = ν := by
  refine' ⟨fun h => _, fun h => _⟩
  · ext1 i hi
    have : μ.toSignedMeasure i = ν.toSignedMeasure i := by rw [h]
    rwa [toSignedMeasure_apply_measurable hi, toSignedMeasure_apply_measurable hi,
        ENNReal.toReal_eq_toReal] at this
      <;> 

Proof state:
case refine'_1.h.ha
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν : Measure α
inst✝¹ : IsFiniteMeasure μ
inst✝ : IsFiniteMeasure ν
h : toSignedMeasure μ = toSignedMeasure ν
i : Set α
hi : MeasurableSet i
this : ENNReal.toReal (↑↑μ i) = ENNReal.toReal (↑↑ν i)
⊢ ↑↑μ i ≠ ⊤

Next tactic:
exact measure_ne_top _ _
theorem toSignedMeasure_eq_toSignedMeasure_iff {μ ν : Measure α} [IsFiniteMeasure μ]
    [IsFiniteMeasure ν] : μ.toSignedMeasure = ν.toSignedMeasure ↔ μ = ν := by
  refine' ⟨fun h => _, fun h => _⟩
  · ext1 i hi
    have : μ.toSignedMeasure i = ν.toSignedMeasure i := by rw [h]
    rwa [toSignedMeasure_apply_measurable hi, toSignedMeasure_apply_measurable hi,
        ENNReal.toReal_eq_toReal] at this
      <;> 

Proof state:
case refine'_1.h.hb
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν : Measure α
inst✝¹ : IsFiniteMeasure μ
inst✝ : IsFiniteMeasure ν
h : toSignedMeasure μ = toSignedMeasure ν
i : Set α
hi : MeasurableSet i
this : ENNReal.toReal (↑↑μ i) = ENNReal.toReal (↑↑ν i)
⊢ ↑↑ν i ≠ ⊤

Next tactic:
exact measure_ne_top _ _
theorem toSignedMeasure_eq_toSignedMeasure_iff {μ ν : Measure α} [IsFiniteMeasure μ]
    [IsFiniteMeasure ν] : μ.toSignedMeasure = ν.toSignedMeasure ↔ μ = ν := by
  refine' ⟨fun h => _, fun h => _⟩
  · ext1 i hi
    have : μ.toSignedMeasure i = ν.toSignedMeasure i := by rw [h]
    rwa [toSignedMeasure_apply_measurable hi, toSignedMeasure_apply_measurable hi,
        ENNReal.toReal_eq_toReal] at this
      <;> exact measure_ne_top _ _
  · 

Proof state:
case refine'_2
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν : Measure α
inst✝¹ : IsFiniteMeasure μ
inst✝ : IsFiniteMeasure ν
h : μ = ν
⊢ toSignedMeasure μ = toSignedMeasure ν

Next tactic:
congr
@[simp]
theorem toSignedMeasure_zero : (0 : Measure α).toSignedMeasure = 0 := by
  

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
⊢ toSignedMeasure 0 = 0

Next tactic:
ext i
@[simp]
theorem toSignedMeasure_zero : (0 : Measure α).toSignedMeasure = 0 := by
  ext i
  

Proof state:
case h
α : Type u_1
β : Type u_2
m : MeasurableSpace α
i : Set α
a✝ : MeasurableSet i
⊢ ↑(toSignedMeasure 0) i = ↑0 i

Next tactic:
simp
@[simp]
theorem toSignedMeasure_add (μ ν : Measure α) [IsFiniteMeasure μ] [IsFiniteMeasure ν] :
    (μ + ν).toSignedMeasure = μ.toSignedMeasure + ν.toSignedMeasure := by
  

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν : Measure α
inst✝¹ : IsFiniteMeasure μ
inst✝ : IsFiniteMeasure ν
⊢ toSignedMeasure (μ + ν) = toSignedMeasure μ + toSignedMeasure ν

Next tactic:
ext i hi
@[simp]
theorem toSignedMeasure_add (μ ν : Measure α) [IsFiniteMeasure μ] [IsFiniteMeasure ν] :
    (μ + ν).toSignedMeasure = μ.toSignedMeasure + ν.toSignedMeasure := by
  ext i hi
  

Proof state:
case h
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν : Measure α
inst✝¹ : IsFiniteMeasure μ
inst✝ : IsFiniteMeasure ν
i : Set α
hi : MeasurableSet i
⊢ ↑(toSignedMeasure (μ + ν)) i = ↑(toSignedMeasure μ + toSignedMeasure ν) i

Next tactic:
rw [toSignedMeasure_apply_measurable hi, add_apply,
    ENNReal.toReal_add (ne_of_lt (measure_lt_top _ _)) (ne_of_lt (measure_lt_top _ _)),
    VectorMeasure.add_apply, toSignedMeasure_apply_measurable hi,
    toSignedMeasure_apply_measurable hi]
@[simp]
theorem toSignedMeasure_smul (μ : Measure α) [IsFiniteMeasure μ] (r : ℝ≥0) :
    (r • μ).toSignedMeasure = r • μ.toSignedMeasure := by
  

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ : Measure α
inst✝ : IsFiniteMeasure μ
r : ℝ≥0
⊢ toSignedMeasure (r • μ) = r • toSignedMeasure μ

Next tactic:
ext i hi
@[simp]
theorem toSignedMeasure_smul (μ : Measure α) [IsFiniteMeasure μ] (r : ℝ≥0) :
    (r • μ).toSignedMeasure = r • μ.toSignedMeasure := by
  ext i hi
  

Proof state:
case h
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ : Measure α
inst✝ : IsFiniteMeasure μ
r : ℝ≥0
i : Set α
hi : MeasurableSet i
⊢ ↑(toSignedMeasure (r • μ)) i = ↑(r • toSignedMeasure μ) i

Next tactic:
rw [toSignedMeasure_apply_measurable hi, VectorMeasure.smul_apply,
    toSignedMeasure_apply_measurable hi, coe_smul, Pi.smul_apply, ENNReal.toReal_smul]
/-- A measure is a vector measure over `ℝ≥0∞`. -/
@[simps]
def toENNRealVectorMeasure (μ : Measure α) : VectorMeasure α ℝ≥0∞ where
  measureOf' := fun i : Set α => if MeasurableSet i then μ i else 0
  empty' := by 

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ : Measure α
⊢ (fun i => if MeasurableSet i then ↑↑μ i else 0) ∅ = 0

Next tactic:
simp [μ.empty]
/-- A measure is a vector measure over `ℝ≥0∞`. -/
@[simps]
def toENNRealVectorMeasure (μ : Measure α) : VectorMeasure α ℝ≥0∞ where
  measureOf' := fun i : Set α => if MeasurableSet i then μ i else 0
  empty' := by simp [μ.empty]
  not_measurable' _ hi := if_neg hi
  m_iUnion' _ hf₁ hf₂ := by
    

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ : Measure α
x✝ : ℕ → Set α
hf₁ : ∀ (i : ℕ), MeasurableSet (x✝ i)
hf₂ : Pairwise (Disjoint on x✝)
⊢ HasSum (fun i => (fun i => if MeasurableSet i then ↑↑μ i else 0) (x✝ i))
    ((fun i => if MeasurableSet i then ↑↑μ i else 0) (⋃ i, x✝ i))

Next tactic:
simp only
/-- A measure is a vector measure over `ℝ≥0∞`. -/
@[simps]
def toENNRealVectorMeasure (μ : Measure α) : VectorMeasure α ℝ≥0∞ where
  measureOf' := fun i : Set α => if MeasurableSet i then μ i else 0
  empty' := by simp [μ.empty]
  not_measurable' _ hi := if_neg hi
  m_iUnion' _ hf₁ hf₂ := by
    simp only
    

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ : Measure α
x✝ : ℕ → Set α
hf₁ : ∀ (i : ℕ), MeasurableSet (x✝ i)
hf₂ : Pairwise (Disjoint on x✝)
⊢ HasSum (fun i => if MeasurableSet (x✝ i) then ↑↑μ (x✝ i) else 0)
    (if MeasurableSet (⋃ i, x✝ i) then ↑↑μ (⋃ i, x✝ i) else 0)

Next tactic:
rw [Summable.hasSum_iff ENNReal.summable, if_pos (MeasurableSet.iUnion hf₁),
      MeasureTheory.measure_iUnion hf₂ hf₁]
/-- A measure is a vector measure over `ℝ≥0∞`. -/
@[simps]
def toENNRealVectorMeasure (μ : Measure α) : VectorMeasure α ℝ≥0∞ where
  measureOf' := fun i : Set α => if MeasurableSet i then μ i else 0
  empty' := by simp [μ.empty]
  not_measurable' _ hi := if_neg hi
  m_iUnion' _ hf₁ hf₂ := by
    simp only
    rw [Summable.hasSum_iff ENNReal.summable, if_pos (MeasurableSet.iUnion hf₁),
      MeasureTheory.measure_iUnion hf₂ hf₁]
    

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ : Measure α
x✝ : ℕ → Set α
hf₁ : ∀ (i : ℕ), MeasurableSet (x✝ i)
hf₂ : Pairwise (Disjoint on x✝)
⊢ (∑' (b : ℕ), if MeasurableSet (x✝ b) then ↑↑μ (x✝ b) else 0) = ∑' (i : ℕ), ↑↑μ (x✝ i)

Next tactic:
exact tsum_congr fun n => if_pos (hf₁ n)
@[simp]
theorem toENNRealVectorMeasure_zero : (0 : Measure α).toENNRealVectorMeasure = 0 := by
  

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
⊢ toENNRealVectorMeasure 0 = 0

Next tactic:
ext i
@[simp]
theorem toENNRealVectorMeasure_zero : (0 : Measure α).toENNRealVectorMeasure = 0 := by
  ext i
  

Proof state:
case h
α : Type u_1
β : Type u_2
m : MeasurableSpace α
i : Set α
a✝ : MeasurableSet i
⊢ ↑(toENNRealVectorMeasure 0) i = ↑0 i

Next tactic:
simp
@[simp]
theorem toENNRealVectorMeasure_add (μ ν : Measure α) :
    (μ + ν).toENNRealVectorMeasure = μ.toENNRealVectorMeasure + ν.toENNRealVectorMeasure := by
  

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν : Measure α
⊢ toENNRealVectorMeasure (μ + ν) = toENNRealVectorMeasure μ + toENNRealVectorMeasure ν

Next tactic:
refine' MeasureTheory.VectorMeasure.ext fun i hi => _
@[simp]
theorem toENNRealVectorMeasure_add (μ ν : Measure α) :
    (μ + ν).toENNRealVectorMeasure = μ.toENNRealVectorMeasure + ν.toENNRealVectorMeasure := by
  refine' MeasureTheory.VectorMeasure.ext fun i hi => _
  

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν : Measure α
i : Set α
hi : MeasurableSet i
⊢ ↑(toENNRealVectorMeasure (μ + ν)) i = ↑(toENNRealVectorMeasure μ + toENNRealVectorMeasure ν) i

Next tactic:
rw [toENNRealVectorMeasure_apply_measurable hi, add_apply, VectorMeasure.add_apply,
    toENNRealVectorMeasure_apply_measurable hi, toENNRealVectorMeasure_apply_measurable hi]
theorem toSignedMeasure_sub_apply {μ ν : Measure α} [IsFiniteMeasure μ] [IsFiniteMeasure ν]
    {i : Set α} (hi : MeasurableSet i) :
    (μ.toSignedMeasure - ν.toSignedMeasure) i = (μ i).toReal - (ν i).toReal := by
  

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν : Measure α
inst✝¹ : IsFiniteMeasure μ
inst✝ : IsFiniteMeasure ν
i : Set α
hi : MeasurableSet i
⊢ ↑(toSignedMeasure μ - toSignedMeasure ν) i = ENNReal.toReal (↑↑μ i) - ENNReal.toReal (↑↑ν i)

Next tactic:
rw [VectorMeasure.sub_apply, toSignedMeasure_apply_measurable hi,
    Measure.toSignedMeasure_apply_measurable hi, sub_eq_add_neg]
theorem ennrealToMeasure_apply {m : MeasurableSpace α} {v : VectorMeasure α ℝ≥0∞} {s : Set α}
    (hs : MeasurableSet s) : ennrealToMeasure v s = v s := by
  

Proof state:
α : Type u_1
β : Type u_2
m✝ m : MeasurableSpace α
v : VectorMeasure α ℝ≥0∞
s : Set α
hs : MeasurableSet s
⊢ ↑↑(ennrealToMeasure v) s = ↑v s

Next tactic:
rw [ennrealToMeasure, ofMeasurable_apply _ hs]
@[simp]
theorem _root_.MeasureTheory.Measure.toENNRealVectorMeasure_ennrealToMeasure
    (μ : VectorMeasure α ℝ≥0∞) :
    toENNRealVectorMeasure (ennrealToMeasure μ) = μ := ext fun s hs => by
  

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ : VectorMeasure α ℝ≥0∞
s : Set α
hs : MeasurableSet s
⊢ ↑(toENNRealVectorMeasure (ennrealToMeasure μ)) s = ↑μ s

Next tactic:
rw [toENNRealVectorMeasure_apply_measurable hs, ennrealToMeasure_apply hs]
@[simp]
theorem ennrealToMeasure_toENNRealVectorMeasure (μ : Measure α) :
    ennrealToMeasure (toENNRealVectorMeasure μ) = μ := Measure.ext fun s hs => by
  

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ : Measure α
s : Set α
hs : MeasurableSet s
⊢ ↑↑(ennrealToMeasure (toENNRealVectorMeasure μ)) s = ↑↑μ s

Next tactic:
rw [ennrealToMeasure_apply hs, toENNRealVectorMeasure_apply_measurable hs]
/-- The pushforward of a vector measure along a function. -/
def map (v : VectorMeasure α M) (f : α → β) : VectorMeasure β M :=
  if hf : Measurable f then
    { measureOf' := fun s => if MeasurableSet s then v (f ⁻¹' s) else 0
      empty' := by 

Proof state:
α : Type u_1
β : Type u_2
m inst✝³ : MeasurableSpace α
inst✝² : MeasurableSpace β
M : Type u_3
inst✝¹ : AddCommMonoid M
inst✝ : TopologicalSpace M
v✝ v : VectorMeasure α M
f : α → β
hf : Measurable f
⊢ (fun s => if MeasurableSet s then ↑v (f ⁻¹' s) else 0) ∅ = 0

Next tactic:
simp
/-- The pushforward of a vector measure along a function. -/
def map (v : VectorMeasure α M) (f : α → β) : VectorMeasure β M :=
  if hf : Measurable f then
    { measureOf' := fun s => if MeasurableSet s then v (f ⁻¹' s) else 0
      empty' := by simp
      not_measurable' := fun i hi => if_neg hi
      m_iUnion' := by
        

Proof state:
α : Type u_1
β : Type u_2
m inst✝³ : MeasurableSpace α
inst✝² : MeasurableSpace β
M : Type u_3
inst✝¹ : AddCommMonoid M
inst✝ : TopologicalSpace M
v✝ v : VectorMeasure α M
f : α → β
hf : Measurable f
⊢ ∀ ⦃f_1 : ℕ → Set β⦄,
    (∀ (i : ℕ), MeasurableSet (f_1 i)) →
      Pairwise (Disjoint on f_1) →
        HasSum (fun i => (fun s => if MeasurableSet s then ↑v (f ⁻¹' s) else 0) (f_1 i))
          ((fun s => if MeasurableSet s then ↑v (f ⁻¹' s) else 0) (⋃ i, f_1 i))

Next tactic:
intro g hg₁ hg₂
/-- The pushforward of a vector measure along a function. -/
def map (v : VectorMeasure α M) (f : α → β) : VectorMeasure β M :=
  if hf : Measurable f then
    { measureOf' := fun s => if MeasurableSet s then v (f ⁻¹' s) else 0
      empty' := by simp
      not_measurable' := fun i hi => if_neg hi
      m_iUnion' := by
        intro g hg₁ hg₂
        

Proof state:
α : Type u_1
β : Type u_2
m inst✝³ : MeasurableSpace α
inst✝² : MeasurableSpace β
M : Type u_3
inst✝¹ : AddCommMonoid M
inst✝ : TopologicalSpace M
v✝ v : VectorMeasure α M
f : α → β
hf : Measurable f
g : ℕ → Set β
hg₁ : ∀ (i : ℕ), MeasurableSet (g i)
hg₂ : Pairwise (Disjoint on g)
⊢ HasSum (fun i => (fun s => if MeasurableSet s then ↑v (f ⁻¹' s) else 0) (g i))
    ((fun s => if MeasurableSet s then ↑v (f ⁻¹' s) else 0) (⋃ i, g i))

Next tactic:
simp only
/-- The pushforward of a vector measure along a function. -/
def map (v : VectorMeasure α M) (f : α → β) : VectorMeasure β M :=
  if hf : Measurable f then
    { measureOf' := fun s => if MeasurableSet s then v (f ⁻¹' s) else 0
      empty' := by simp
      not_measurable' := fun i hi => if_neg hi
      m_iUnion' := by
        intro g hg₁ hg₂
        simp only
        

Proof state:
α : Type u_1
β : Type u_2
m inst✝³ : MeasurableSpace α
inst✝² : MeasurableSpace β
M : Type u_3
inst✝¹ : AddCommMonoid M
inst✝ : TopologicalSpace M
v✝ v : VectorMeasure α M
f : α → β
hf : Measurable f
g : ℕ → Set β
hg₁ : ∀ (i : ℕ), MeasurableSet (g i)
hg₂ : Pairwise (Disjoint on g)
⊢ HasSum (fun i => if MeasurableSet (g i) then ↑v (f ⁻¹' g i) else 0)
    (if MeasurableSet (⋃ i, g i) then ↑v (f ⁻¹' ⋃ i, g i) else 0)

Next tactic:
convert v.m_iUnion (fun i => hf (hg₁ i)) fun i j hij => (hg₂ hij).preimage _
/-- The pushforward of a vector measure along a function. -/
def map (v : VectorMeasure α M) (f : α → β) : VectorMeasure β M :=
  if hf : Measurable f then
    { measureOf' := fun s => if MeasurableSet s then v (f ⁻¹' s) else 0
      empty' := by simp
      not_measurable' := fun i hi => if_neg hi
      m_iUnion' := by
        intro g hg₁ hg₂
        simp only
        convert v.m_iUnion (fun i => hf (hg₁ i)) fun i j hij => (hg₂ hij).preimage _
        · 

Proof state:
case h.e'_5.h
α : Type u_1
β : Type u_2
m inst✝³ : MeasurableSpace α
inst✝² : MeasurableSpace β
M : Type u_3
inst✝¹ : AddCommMonoid M
inst✝ : TopologicalSpace M
v✝ v : VectorMeasure α M
f : α → β
hf : Measurable f
g : ℕ → Set β
hg₁ : ∀ (i : ℕ), MeasurableSet (g i)
hg₂ : Pairwise (Disjoint on g)
x✝ : ℕ
⊢ (if MeasurableSet (g x✝) then ↑v (f ⁻¹' g x✝) else 0) = ↑v (f ⁻¹' g x✝)

Next tactic:
rw [if_pos (hg₁ _)]
/-- The pushforward of a vector measure along a function. -/
def map (v : VectorMeasure α M) (f : α → β) : VectorMeasure β M :=
  if hf : Measurable f then
    { measureOf' := fun s => if MeasurableSet s then v (f ⁻¹' s) else 0
      empty' := by simp
      not_measurable' := fun i hi => if_neg hi
      m_iUnion' := by
        intro g hg₁ hg₂
        simp only
        convert v.m_iUnion (fun i => hf (hg₁ i)) fun i j hij => (hg₂ hij).preimage _
        · rw [if_pos (hg₁ _)]
        · 

Proof state:
case h.e'_6
α : Type u_1
β : Type u_2
m inst✝³ : MeasurableSpace α
inst✝² : MeasurableSpace β
M : Type u_3
inst✝¹ : AddCommMonoid M
inst✝ : TopologicalSpace M
v✝ v : VectorMeasure α M
f : α → β
hf : Measurable f
g : ℕ → Set β
hg₁ : ∀ (i : ℕ), MeasurableSet (g i)
hg₂ : Pairwise (Disjoint on g)
⊢ (if MeasurableSet (⋃ i, g i) then ↑v (f ⁻¹' ⋃ i, g i) else 0) = ↑v (⋃ i, f ⁻¹' g i)

Next tactic:
rw [Set.preimage_iUnion, if_pos (MeasurableSet.iUnion hg₁)]
theorem map_apply {f : α → β} (hf : Measurable f) {s : Set β} (hs : MeasurableSet s) :
    v.map f s = v (f ⁻¹' s) := by
  

Proof state:
α : Type u_1
β : Type u_2
m inst✝³ : MeasurableSpace α
inst✝² : MeasurableSpace β
M : Type u_3
inst✝¹ : AddCommMonoid M
inst✝ : TopologicalSpace M
v : VectorMeasure α M
f : α → β
hf : Measurable f
s : Set β
hs : MeasurableSet s
⊢ ↑(map v f) s = ↑v (f ⁻¹' s)

Next tactic:
rw [map, dif_pos hf]
theorem map_apply {f : α → β} (hf : Measurable f) {s : Set β} (hs : MeasurableSet s) :
    v.map f s = v (f ⁻¹' s) := by
  rw [map, dif_pos hf]
  

Proof state:
α : Type u_1
β : Type u_2
m inst✝³ : MeasurableSpace α
inst✝² : MeasurableSpace β
M : Type u_3
inst✝¹ : AddCommMonoid M
inst✝ : TopologicalSpace M
v : VectorMeasure α M
f : α → β
hf : Measurable f
s : Set β
hs : MeasurableSet s
⊢ ↑{ measureOf' := fun s => if MeasurableSet s then ↑v (f ⁻¹' s) else 0,
          empty' := (_ : (if MeasurableSet ∅ then ↑v (f ⁻¹' ∅) else 0) = 0),
          not_measurable' := (_ : ∀ (i : Set β), ¬MeasurableSet i → (if MeasurableSet i then ↑v (f ⁻¹' i) else 0) = 0),
          m_iUnion' :=
            (_ :
              ∀ ⦃g : ℕ → Set β⦄,
                (∀ (i : ℕ), MeasurableSet (g i)) →
                  Pairwise (Disjoint on g) →
                    HasSum (fun i => (fun s => if MeasurableSet s then ↑v (f ⁻¹' s) else 0) (g i))
                      ((fun s => if MeasurableSet s then ↑v (f ⁻¹' s) else 0) (⋃ i, g i))) }
      s =
    ↑v (f ⁻¹' s)

Next tactic:
exact if_pos hs
@[simp]
theorem map_id : v.map id = v :=
  ext fun i hi => by 

Proof state:
α : Type u_1
β : Type u_2
m inst✝³ : MeasurableSpace α
inst✝² : MeasurableSpace β
M : Type u_3
inst✝¹ : AddCommMonoid M
inst✝ : TopologicalSpace M
v : VectorMeasure α M
i : Set α
hi : MeasurableSet i
⊢ ↑(map v id) i = ↑v i

Next tactic:
rw [map_apply v measurable_id hi, Set.preimage_id]
@[simp]
theorem map_zero (f : α → β) : (0 : VectorMeasure α M).map f = 0 := by
  

Proof state:
α : Type u_1
β : Type u_2
m inst✝³ : MeasurableSpace α
inst✝² : MeasurableSpace β
M : Type u_3
inst✝¹ : AddCommMonoid M
inst✝ : TopologicalSpace M
v : VectorMeasure α M
f : α → β
⊢ map 0 f = 0

Next tactic:
by_cases hf : Measurable f
@[simp]
theorem map_zero (f : α → β) : (0 : VectorMeasure α M).map f = 0 := by
  by_cases hf : Measurable f
  · 

Proof state:
case pos
α : Type u_1
β : Type u_2
m inst✝³ : MeasurableSpace α
inst✝² : MeasurableSpace β
M : Type u_3
inst✝¹ : AddCommMonoid M
inst✝ : TopologicalSpace M
v : VectorMeasure α M
f : α → β
hf : Measurable f
⊢ map 0 f = 0

Next tactic:
ext i hi
@[simp]
theorem map_zero (f : α → β) : (0 : VectorMeasure α M).map f = 0 := by
  by_cases hf : Measurable f
  · ext i hi
    

Proof state:
case pos.h
α : Type u_1
β : Type u_2
m inst✝³ : MeasurableSpace α
inst✝² : MeasurableSpace β
M : Type u_3
inst✝¹ : AddCommMonoid M
inst✝ : TopologicalSpace M
v : VectorMeasure α M
f : α → β
hf : Measurable f
i : Set β
hi : MeasurableSet i
⊢ ↑(map 0 f) i = ↑0 i

Next tactic:
rw [map_apply _ hf hi, zero_apply, zero_apply]
@[simp]
theorem map_zero (f : α → β) : (0 : VectorMeasure α M).map f = 0 := by
  by_cases hf : Measurable f
  · ext i hi
    rw [map_apply _ hf hi, zero_apply, zero_apply]
  · 

Proof state:
case neg
α : Type u_1
β : Type u_2
m inst✝³ : MeasurableSpace α
inst✝² : MeasurableSpace β
M : Type u_3
inst✝¹ : AddCommMonoid M
inst✝ : TopologicalSpace M
v : VectorMeasure α M
f : α → β
hf : ¬Measurable f
⊢ map 0 f = 0

Next tactic:
exact dif_neg hf
/-- Given a vector measure `v` on `M` and a continuous `AddMonoidHom` `f : M → N`, `f ∘ v` is a
vector measure on `N`. -/
def mapRange (v : VectorMeasure α M) (f : M →+ N) (hf : Continuous f) : VectorMeasure α N where
  measureOf' s := f (v s)
  empty' := by 

Proof state:
α : Type u_1
β : Type u_2
m inst✝⁵ : MeasurableSpace α
inst✝⁴ : MeasurableSpace β
M : Type u_3
inst✝³ : AddCommMonoid M
inst✝² : TopologicalSpace M
v✝ : VectorMeasure α M
N : Type u_4
inst✝¹ : AddCommMonoid N
inst✝ : TopologicalSpace N
v : VectorMeasure α M
f : M →+ N
hf : Continuous ⇑f
⊢ (fun s => f (↑v s)) ∅ = 0

Next tactic:
simp only
/-- Given a vector measure `v` on `M` and a continuous `AddMonoidHom` `f : M → N`, `f ∘ v` is a
vector measure on `N`. -/
def mapRange (v : VectorMeasure α M) (f : M →+ N) (hf : Continuous f) : VectorMeasure α N where
  measureOf' s := f (v s)
  empty' := by simp only; 

Proof state:
α : Type u_1
β : Type u_2
m inst✝⁵ : MeasurableSpace α
inst✝⁴ : MeasurableSpace β
M : Type u_3
inst✝³ : AddCommMonoid M
inst✝² : TopologicalSpace M
v✝ : VectorMeasure α M
N : Type u_4
inst✝¹ : AddCommMonoid N
inst✝ : TopologicalSpace N
v : VectorMeasure α M
f : M →+ N
hf : Continuous ⇑f
⊢ f (↑v ∅) = 0

Next tactic:
rw [empty, AddMonoidHom.map_zero]