l3lab/ntp-mathlib huggingface dataset:
theorem snd_integral [CompleteSpace E] {f : α → E × F} (hf : Integrable f μ) :
    (∫ x, f x ∂μ).2 = ∫ x, (f x).2 ∂μ := by
  rw [← Prod.fst_swap, swap_integral]
  

Proof state:
α : Type u_1
β : Type u_2
E : Type u_3
F : Type u_4
inst✝⁸ : MeasurableSpace α
ι : Type u_5
inst✝⁷ : NormedAddCommGroup E
μ : Measure α
𝕜 : Type u_6
inst✝⁶ : IsROrC 𝕜
inst✝⁵ : NormedSpace 𝕜 E
inst✝⁴ : NormedAddCommGroup F
inst✝³ : NormedSpace 𝕜 F
p : ℝ≥0∞
inst✝² : NormedSpace ℝ E
inst✝¹ : NormedSpace ℝ F
inst✝ : CompleteSpace E
f : α → E × F
hf : Integrable f
⊢ (∫ (x : α), Prod.swap (f x) ∂μ).1 = ∫ (x : α), (f x).2 ∂μ

Next tactic:
exact fst_integral <| hf.snd.prod_mk hf.fst
theorem integral_smul_const {𝕜 : Type*} [IsROrC 𝕜] [NormedSpace 𝕜 E] [CompleteSpace E]
    (f : α → 𝕜) (c : E) :
    ∫ x, f x • c ∂μ = (∫ x, f x ∂μ) • c := by
  

Proof state:
α : Type u_1
β : Type u_2
E : Type u_3
F : Type u_4
inst✝¹⁰ : MeasurableSpace α
ι : Type u_5
inst✝⁹ : NormedAddCommGroup E
μ : Measure α
𝕜✝ : Type u_6
inst✝⁸ : IsROrC 𝕜✝
inst✝⁷ : NormedSpace 𝕜✝ E
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace 𝕜✝ F
p : ℝ≥0∞
inst✝⁴ : NormedSpace ℝ E
inst✝³ : NormedSpace ℝ F
𝕜 : Type u_7
inst✝² : IsROrC 𝕜
inst✝¹ : NormedSpace 𝕜 E
inst✝ : CompleteSpace E
f : α → 𝕜
c : E
⊢ ∫ (x : α), f x • c ∂μ = (∫ (x : α), f x ∂μ) • c

Next tactic:
by_cases hf : Integrable f μ
theorem integral_smul_const {𝕜 : Type*} [IsROrC 𝕜] [NormedSpace 𝕜 E] [CompleteSpace E]
    (f : α → 𝕜) (c : E) :
    ∫ x, f x • c ∂μ = (∫ x, f x ∂μ) • c := by
  by_cases hf : Integrable f μ
  · 

Proof state:
case pos
α : Type u_1
β : Type u_2
E : Type u_3
F : Type u_4
inst✝¹⁰ : MeasurableSpace α
ι : Type u_5
inst✝⁹ : NormedAddCommGroup E
μ : Measure α
𝕜✝ : Type u_6
inst✝⁸ : IsROrC 𝕜✝
inst✝⁷ : NormedSpace 𝕜✝ E
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace 𝕜✝ F
p : ℝ≥0∞
inst✝⁴ : NormedSpace ℝ E
inst✝³ : NormedSpace ℝ F
𝕜 : Type u_7
inst✝² : IsROrC 𝕜
inst✝¹ : NormedSpace 𝕜 E
inst✝ : CompleteSpace E
f : α → 𝕜
c : E
hf : Integrable f
⊢ ∫ (x : α), f x • c ∂μ = (∫ (x : α), f x ∂μ) • c

Next tactic:
exact ((1 : 𝕜 →L[𝕜] 𝕜).smulRight c).integral_comp_comm hf
theorem integral_smul_const {𝕜 : Type*} [IsROrC 𝕜] [NormedSpace 𝕜 E] [CompleteSpace E]
    (f : α → 𝕜) (c : E) :
    ∫ x, f x • c ∂μ = (∫ x, f x ∂μ) • c := by
  by_cases hf : Integrable f μ
  · exact ((1 : 𝕜 →L[𝕜] 𝕜).smulRight c).integral_comp_comm hf
  · 

Proof state:
case neg
α : Type u_1
β : Type u_2
E : Type u_3
F : Type u_4
inst✝¹⁰ : MeasurableSpace α
ι : Type u_5
inst✝⁹ : NormedAddCommGroup E
μ : Measure α
𝕜✝ : Type u_6
inst✝⁸ : IsROrC 𝕜✝
inst✝⁷ : NormedSpace 𝕜✝ E
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace 𝕜✝ F
p : ℝ≥0∞
inst✝⁴ : NormedSpace ℝ E
inst✝³ : NormedSpace ℝ F
𝕜 : Type u_7
inst✝² : IsROrC 𝕜
inst✝¹ : NormedSpace 𝕜 E
inst✝ : CompleteSpace E
f : α → 𝕜
c : E
hf : ¬Integrable f
⊢ ∫ (x : α), f x • c ∂μ = (∫ (x : α), f x ∂μ) • c

Next tactic:
by_cases hc : c = 0
theorem integral_smul_const {𝕜 : Type*} [IsROrC 𝕜] [NormedSpace 𝕜 E] [CompleteSpace E]
    (f : α → 𝕜) (c : E) :
    ∫ x, f x • c ∂μ = (∫ x, f x ∂μ) • c := by
  by_cases hf : Integrable f μ
  · exact ((1 : 𝕜 →L[𝕜] 𝕜).smulRight c).integral_comp_comm hf
  · by_cases hc : c = 0
    · 

Proof state:
case pos
α : Type u_1
β : Type u_2
E : Type u_3
F : Type u_4
inst✝¹⁰ : MeasurableSpace α
ι : Type u_5
inst✝⁹ : NormedAddCommGroup E
μ : Measure α
𝕜✝ : Type u_6
inst✝⁸ : IsROrC 𝕜✝
inst✝⁷ : NormedSpace 𝕜✝ E
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace 𝕜✝ F
p : ℝ≥0∞
inst✝⁴ : NormedSpace ℝ E
inst✝³ : NormedSpace ℝ F
𝕜 : Type u_7
inst✝² : IsROrC 𝕜
inst✝¹ : NormedSpace 𝕜 E
inst✝ : CompleteSpace E
f : α → 𝕜
c : E
hf : ¬Integrable f
hc : c = 0
⊢ ∫ (x : α), f x • c ∂μ = (∫ (x : α), f x ∂μ) • c

Next tactic:
simp [hc, integral_zero, smul_zero]
theorem integral_smul_const {𝕜 : Type*} [IsROrC 𝕜] [NormedSpace 𝕜 E] [CompleteSpace E]
    (f : α → 𝕜) (c : E) :
    ∫ x, f x • c ∂μ = (∫ x, f x ∂μ) • c := by
  by_cases hf : Integrable f μ
  · exact ((1 : 𝕜 →L[𝕜] 𝕜).smulRight c).integral_comp_comm hf
  · by_cases hc : c = 0
    · simp [hc, integral_zero, smul_zero]
    

Proof state:
case neg
α : Type u_1
β : Type u_2
E : Type u_3
F : Type u_4
inst✝¹⁰ : MeasurableSpace α
ι : Type u_5
inst✝⁹ : NormedAddCommGroup E
μ : Measure α
𝕜✝ : Type u_6
inst✝⁸ : IsROrC 𝕜✝
inst✝⁷ : NormedSpace 𝕜✝ E
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace 𝕜✝ F
p : ℝ≥0∞
inst✝⁴ : NormedSpace ℝ E
inst✝³ : NormedSpace ℝ F
𝕜 : Type u_7
inst✝² : IsROrC 𝕜
inst✝¹ : NormedSpace 𝕜 E
inst✝ : CompleteSpace E
f : α → 𝕜
c : E
hf : ¬Integrable f
hc : ¬c = 0
⊢ ∫ (x : α), f x • c ∂μ = (∫ (x : α), f x ∂μ) • c

Next tactic:
rw [integral_undef hf, integral_undef, zero_smul]
theorem integral_smul_const {𝕜 : Type*} [IsROrC 𝕜] [NormedSpace 𝕜 E] [CompleteSpace E]
    (f : α → 𝕜) (c : E) :
    ∫ x, f x • c ∂μ = (∫ x, f x ∂μ) • c := by
  by_cases hf : Integrable f μ
  · exact ((1 : 𝕜 →L[𝕜] 𝕜).smulRight c).integral_comp_comm hf
  · by_cases hc : c = 0
    · simp [hc, integral_zero, smul_zero]
    rw [integral_undef hf, integral_undef, zero_smul]
    

Proof state:
case neg
α : Type u_1
β : Type u_2
E : Type u_3
F : Type u_4
inst✝¹⁰ : MeasurableSpace α
ι : Type u_5
inst✝⁹ : NormedAddCommGroup E
μ : Measure α
𝕜✝ : Type u_6
inst✝⁸ : IsROrC 𝕜✝
inst✝⁷ : NormedSpace 𝕜✝ E
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace 𝕜✝ F
p : ℝ≥0∞
inst✝⁴ : NormedSpace ℝ E
inst✝³ : NormedSpace ℝ F
𝕜 : Type u_7
inst✝² : IsROrC 𝕜
inst✝¹ : NormedSpace 𝕜 E
inst✝ : CompleteSpace E
f : α → 𝕜
c : E
hf : ¬Integrable f
hc : ¬c = 0
⊢ ¬Integrable fun x => f x • c

Next tactic:
rw [integrable_smul_const hc]
theorem integral_smul_const {𝕜 : Type*} [IsROrC 𝕜] [NormedSpace 𝕜 E] [CompleteSpace E]
    (f : α → 𝕜) (c : E) :
    ∫ x, f x • c ∂μ = (∫ x, f x ∂μ) • c := by
  by_cases hf : Integrable f μ
  · exact ((1 : 𝕜 →L[𝕜] 𝕜).smulRight c).integral_comp_comm hf
  · by_cases hc : c = 0
    · simp [hc, integral_zero, smul_zero]
    rw [integral_undef hf, integral_undef, zero_smul]
    rw [integrable_smul_const hc]
    

Proof state:
case neg
α : Type u_1
β : Type u_2
E : Type u_3
F : Type u_4
inst✝¹⁰ : MeasurableSpace α
ι : Type u_5
inst✝⁹ : NormedAddCommGroup E
μ : Measure α
𝕜✝ : Type u_6
inst✝⁸ : IsROrC 𝕜✝
inst✝⁷ : NormedSpace 𝕜✝ E
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace 𝕜✝ F
p : ℝ≥0∞
inst✝⁴ : NormedSpace ℝ E
inst✝³ : NormedSpace ℝ F
𝕜 : Type u_7
inst✝² : IsROrC 𝕜
inst✝¹ : NormedSpace 𝕜 E
inst✝ : CompleteSpace E
f : α → 𝕜
c : E
hf : ¬Integrable f
hc : ¬c = 0
⊢ ¬Integrable fun x => f x

Next tactic:
simp_rw [hf, not_false_eq_true]
theorem integral_withDensity_eq_integral_smul {f : α → ℝ≥0} (f_meas : Measurable f) (g : α → E) :
    ∫ a, g a ∂μ.withDensity (fun x => f x) = ∫ a, f a • g a ∂μ := by
  

Proof state:
α : Type u_1
β : Type u_2
E : Type u_3
F : Type u_4
inst✝⁷ : MeasurableSpace α
ι : Type u_5
inst✝⁶ : NormedAddCommGroup E
μ : Measure α
𝕜 : Type u_6
inst✝⁵ : IsROrC 𝕜
inst✝⁴ : NormedSpace 𝕜 E
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
p : ℝ≥0∞
inst✝¹ : NormedSpace ℝ E
inst✝ : NormedSpace ℝ F
f : α → ℝ≥0
f_meas : Measurable f
g : α → E
⊢ (∫ (a : α), g a ∂Measure.withDensity μ fun x => ↑(f x)) = ∫ (a : α), f a • g a ∂μ

Next tactic:
by_cases hE : CompleteSpace E
theorem integral_withDensity_eq_integral_smul {f : α → ℝ≥0} (f_meas : Measurable f) (g : α → E) :
    ∫ a, g a ∂μ.withDensity (fun x => f x) = ∫ a, f a • g a ∂μ := by
  by_cases hE : CompleteSpace E; 

Proof state:
case pos
α : Type u_1
β : Type u_2
E : Type u_3
F : Type u_4
inst✝⁷ : MeasurableSpace α
ι : Type u_5
inst✝⁶ : NormedAddCommGroup E
μ : Measure α
𝕜 : Type u_6
inst✝⁵ : IsROrC 𝕜
inst✝⁴ : NormedSpace 𝕜 E
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
p : ℝ≥0∞
inst✝¹ : NormedSpace ℝ E
inst✝ : NormedSpace ℝ F
f : α → ℝ≥0
f_meas : Measurable f
g : α → E
hE : CompleteSpace E
⊢ (∫ (a : α), g a ∂Measure.withDensity μ fun x => ↑(f x)) = ∫ (a : α), f a • g a ∂μ
case neg
α : Type u_1
β : Type u_2
E : Type u_3
F : Type u_4
inst✝⁷ : MeasurableSpace α
ι : Type u_5
inst✝⁶ : NormedAddCommGroup E
μ : Measure α
𝕜 : Type u_6
inst✝⁵ : IsROrC 𝕜
inst✝⁴ : NormedSpace 𝕜 E
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
p : ℝ≥0∞
inst✝¹ : NormedSpace ℝ E
inst✝ : NormedSpace ℝ F
f : α → ℝ≥0
f_meas : Measurable f
g : α → E
hE : ¬CompleteSpace E
⊢ (∫ (a : α), g a ∂Measure.withDensity μ fun x => ↑(f x)) = ∫ (a : α), f a • g a ∂μ

Next tactic:
swap
theorem integral_withDensity_eq_integral_smul {f : α → ℝ≥0} (f_meas : Measurable f) (g : α → E) :
    ∫ a, g a ∂μ.withDensity (fun x => f x) = ∫ a, f a • g a ∂μ := by
  by_cases hE : CompleteSpace E; swap; · 

Proof state:
case neg
α : Type u_1
β : Type u_2
E : Type u_3
F : Type u_4
inst✝⁷ : MeasurableSpace α
ι : Type u_5
inst✝⁶ : NormedAddCommGroup E
μ : Measure α
𝕜 : Type u_6
inst✝⁵ : IsROrC 𝕜
inst✝⁴ : NormedSpace 𝕜 E
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
p : ℝ≥0∞
inst✝¹ : NormedSpace ℝ E
inst✝ : NormedSpace ℝ F
f : α → ℝ≥0
f_meas : Measurable f
g : α → E
hE : ¬CompleteSpace E
⊢ (∫ (a : α), g a ∂Measure.withDensity μ fun x => ↑(f x)) = ∫ (a : α), f a • g a ∂μ

Next tactic:
simp [integral, hE]
theorem integral_withDensity_eq_integral_smul {f : α → ℝ≥0} (f_meas : Measurable f) (g : α → E) :
    ∫ a, g a ∂μ.withDensity (fun x => f x) = ∫ a, f a • g a ∂μ := by
  by_cases hE : CompleteSpace E; swap; · simp [integral, hE]
  

Proof state:
case pos
α : Type u_1
β : Type u_2
E : Type u_3
F : Type u_4
inst✝⁷ : MeasurableSpace α
ι : Type u_5
inst✝⁶ : NormedAddCommGroup E
μ : Measure α
𝕜 : Type u_6
inst✝⁵ : IsROrC 𝕜
inst✝⁴ : NormedSpace 𝕜 E
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
p : ℝ≥0∞
inst✝¹ : NormedSpace ℝ E
inst✝ : NormedSpace ℝ F
f : α → ℝ≥0
f_meas : Measurable f
g : α → E
hE : CompleteSpace E
⊢ (∫ (a : α), g a ∂Measure.withDensity μ fun x => ↑(f x)) = ∫ (a : α), f a • g a ∂μ

Next tactic:
by_cases hg : Integrable g (μ.withDensity fun x => f x)
theorem integral_withDensity_eq_integral_smul {f : α → ℝ≥0} (f_meas : Measurable f) (g : α → E) :
    ∫ a, g a ∂μ.withDensity (fun x => f x) = ∫ a, f a • g a ∂μ := by
  by_cases hE : CompleteSpace E; swap; · simp [integral, hE]
  by_cases hg : Integrable g (μ.withDensity fun x => f x); 

Proof state:
case pos
α : Type u_1
β : Type u_2
E : Type u_3
F : Type u_4
inst✝⁷ : MeasurableSpace α
ι : Type u_5
inst✝⁶ : NormedAddCommGroup E
μ : Measure α
𝕜 : Type u_6
inst✝⁵ : IsROrC 𝕜
inst✝⁴ : NormedSpace 𝕜 E
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
p : ℝ≥0∞
inst✝¹ : NormedSpace ℝ E
inst✝ : NormedSpace ℝ F
f : α → ℝ≥0
f_meas : Measurable f
g : α → E
hE : CompleteSpace E
hg : Integrable g
⊢ (∫ (a : α), g a ∂Measure.withDensity μ fun x => ↑(f x)) = ∫ (a : α), f a • g a ∂μ
case neg
α : Type u_1
β : Type u_2
E : Type u_3
F : Type u_4
inst✝⁷ : MeasurableSpace α
ι : Type u_5
inst✝⁶ : NormedAddCommGroup E
μ : Measure α
𝕜 : Type u_6
inst✝⁵ : IsROrC 𝕜
inst✝⁴ : NormedSpace 𝕜 E
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
p : ℝ≥0∞
inst✝¹ : NormedSpace ℝ E
inst✝ : NormedSpace ℝ F
f : α → ℝ≥0
f_meas : Measurable f
g : α → E
hE : CompleteSpace E
hg : ¬Integrable g
⊢ (∫ (a : α), g a ∂Measure.withDensity μ fun x => ↑(f x)) = ∫ (a : α), f a • g a ∂μ

Next tactic:
swap
theorem integral_withDensity_eq_integral_smul {f : α → ℝ≥0} (f_meas : Measurable f) (g : α → E) :
    ∫ a, g a ∂μ.withDensity (fun x => f x) = ∫ a, f a • g a ∂μ := by
  by_cases hE : CompleteSpace E; swap; · simp [integral, hE]
  by_cases hg : Integrable g (μ.withDensity fun x => f x); swap
  · 

Proof state:
case neg
α : Type u_1
β : Type u_2
E : Type u_3
F : Type u_4
inst✝⁷ : MeasurableSpace α
ι : Type u_5
inst✝⁶ : NormedAddCommGroup E
μ : Measure α
𝕜 : Type u_6
inst✝⁵ : IsROrC 𝕜
inst✝⁴ : NormedSpace 𝕜 E
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
p : ℝ≥0∞
inst✝¹ : NormedSpace ℝ E
inst✝ : NormedSpace ℝ F
f : α → ℝ≥0
f_meas : Measurable f
g : α → E
hE : CompleteSpace E
hg : ¬Integrable g
⊢ (∫ (a : α), g a ∂Measure.withDensity μ fun x => ↑(f x)) = ∫ (a : α), f a • g a ∂μ

Next tactic:
rw [integral_undef hg, integral_undef]
theorem integral_withDensity_eq_integral_smul {f : α → ℝ≥0} (f_meas : Measurable f) (g : α → E) :
    ∫ a, g a ∂μ.withDensity (fun x => f x) = ∫ a, f a • g a ∂μ := by
  by_cases hE : CompleteSpace E; swap; · simp [integral, hE]
  by_cases hg : Integrable g (μ.withDensity fun x => f x); swap
  · rw [integral_undef hg, integral_undef]
    

Proof state:
case neg
α : Type u_1
β : Type u_2
E : Type u_3
F : Type u_4
inst✝⁷ : MeasurableSpace α
ι : Type u_5
inst✝⁶ : NormedAddCommGroup E
μ : Measure α
𝕜 : Type u_6
inst✝⁵ : IsROrC 𝕜
inst✝⁴ : NormedSpace 𝕜 E
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
p : ℝ≥0∞
inst✝¹ : NormedSpace ℝ E
inst✝ : NormedSpace ℝ F
f : α → ℝ≥0
f_meas : Measurable f
g : α → E
hE : CompleteSpace E
hg : ¬Integrable g
⊢ ¬Integrable fun a => f a • g a

Next tactic:
rwa [← integrable_withDensity_iff_integrable_smul f_meas]
theorem integral_withDensity_eq_integral_smul {f : α → ℝ≥0} (f_meas : Measurable f) (g : α → E) :
    ∫ a, g a ∂μ.withDensity (fun x => f x) = ∫ a, f a • g a ∂μ := by
  by_cases hE : CompleteSpace E; swap; · simp [integral, hE]
  by_cases hg : Integrable g (μ.withDensity fun x => f x); swap
  · rw [integral_undef hg, integral_undef]
    rwa [← integrable_withDensity_iff_integrable_smul f_meas]
  

Proof state:
case pos
α : Type u_1
β : Type u_2
E : Type u_3
F : Type u_4
inst✝⁷ : MeasurableSpace α
ι : Type u_5
inst✝⁶ : NormedAddCommGroup E
μ : Measure α
𝕜 : Type u_6
inst✝⁵ : IsROrC 𝕜
inst✝⁴ : NormedSpace 𝕜 E
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
p : ℝ≥0∞
inst✝¹ : NormedSpace ℝ E
inst✝ : NormedSpace ℝ F
f : α → ℝ≥0
f_meas : Measurable f
g : α → E
hE : CompleteSpace E
hg : Integrable g
⊢ (∫ (a : α), g a ∂Measure.withDensity μ fun x => ↑(f x)) = ∫ (a : α), f a • g a ∂μ

Next tactic:
refine' Integrable.induction
    (P := fun g => ∫ a, g a ∂μ.withDensity (fun x => f x) = ∫ a, f a • g a ∂μ) _ _ _ _ hg
theorem integral_withDensity_eq_integral_smul {f : α → ℝ≥0} (f_meas : Measurable f) (g : α → E) :
    ∫ a, g a ∂μ.withDensity (fun x => f x) = ∫ a, f a • g a ∂μ := by
  by_cases hE : CompleteSpace E; swap; · simp [integral, hE]
  by_cases hg : Integrable g (μ.withDensity fun x => f x); swap
  · rw [integral_undef hg, integral_undef]
    rwa [← integrable_withDensity_iff_integrable_smul f_meas]
  refine' Integrable.induction
    (P := fun g => ∫ a, g a ∂μ.withDensity (fun x => f x) = ∫ a, f a • g a ∂μ) _ _ _ _ hg
  · 

Proof state:
case pos.refine'_1
α : Type u_1
β : Type u_2
E : Type u_3
F : Type u_4
inst✝⁷ : MeasurableSpace α
ι : Type u_5
inst✝⁶ : NormedAddCommGroup E
μ : Measure α
𝕜 : Type u_6
inst✝⁵ : IsROrC 𝕜
inst✝⁴ : NormedSpace 𝕜 E
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
p : ℝ≥0∞
inst✝¹ : NormedSpace ℝ E
inst✝ : NormedSpace ℝ F
f : α → ℝ≥0
f_meas : Measurable f
g : α → E
hE : CompleteSpace E
hg : Integrable g
⊢ ∀ (c : E) ⦃s : Set α⦄,
    MeasurableSet s →
      ↑↑(Measure.withDensity μ fun x => ↑(f x)) s < ⊤ →
        (fun g => (∫ (a : α), g a ∂Measure.withDensity μ fun x => ↑(f x)) = ∫ (a : α), f a • g a ∂μ)
          (indicator s fun x => c)

Next tactic:
intro c s s_meas hs
theorem integral_withDensity_eq_integral_smul {f : α → ℝ≥0} (f_meas : Measurable f) (g : α → E) :
    ∫ a, g a ∂μ.withDensity (fun x => f x) = ∫ a, f a • g a ∂μ := by
  by_cases hE : CompleteSpace E; swap; · simp [integral, hE]
  by_cases hg : Integrable g (μ.withDensity fun x => f x); swap
  · rw [integral_undef hg, integral_undef]
    rwa [← integrable_withDensity_iff_integrable_smul f_meas]
  refine' Integrable.induction
    (P := fun g => ∫ a, g a ∂μ.withDensity (fun x => f x) = ∫ a, f a • g a ∂μ) _ _ _ _ hg
  · intro c s s_meas hs
    

Proof state:
case pos.refine'_1
α : Type u_1
β : Type u_2
E : Type u_3
F : Type u_4
inst✝⁷ : MeasurableSpace α
ι : Type u_5
inst✝⁶ : NormedAddCommGroup E
μ : Measure α
𝕜 : Type u_6
inst✝⁵ : IsROrC 𝕜
inst✝⁴ : NormedSpace 𝕜 E
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
p : ℝ≥0∞
inst✝¹ : NormedSpace ℝ E
inst✝ : NormedSpace ℝ F
f : α → ℝ≥0
f_meas : Measurable f
g : α → E
hE : CompleteSpace E
hg : Integrable g
c : E
s : Set α
s_meas : MeasurableSet s
hs : ↑↑(Measure.withDensity μ fun x => ↑(f x)) s < ⊤
⊢ (∫ (a : α), indicator s (fun x => c) a ∂Measure.withDensity μ fun x => ↑(f x)) =
    ∫ (a : α), f a • indicator s (fun x => c) a ∂μ

Next tactic:
rw [integral_indicator s_meas]
theorem integral_withDensity_eq_integral_smul {f : α → ℝ≥0} (f_meas : Measurable f) (g : α → E) :
    ∫ a, g a ∂μ.withDensity (fun x => f x) = ∫ a, f a • g a ∂μ := by
  by_cases hE : CompleteSpace E; swap; · simp [integral, hE]
  by_cases hg : Integrable g (μ.withDensity fun x => f x); swap
  · rw [integral_undef hg, integral_undef]
    rwa [← integrable_withDensity_iff_integrable_smul f_meas]
  refine' Integrable.induction
    (P := fun g => ∫ a, g a ∂μ.withDensity (fun x => f x) = ∫ a, f a • g a ∂μ) _ _ _ _ hg
  · intro c s s_meas hs
    rw [integral_indicator s_meas]
    

Proof state:
case pos.refine'_1
α : Type u_1
β : Type u_2
E : Type u_3
F : Type u_4
inst✝⁷ : MeasurableSpace α
ι : Type u_5
inst✝⁶ : NormedAddCommGroup E
μ : Measure α
𝕜 : Type u_6
inst✝⁵ : IsROrC 𝕜
inst✝⁴ : NormedSpace 𝕜 E
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
p : ℝ≥0∞
inst✝¹ : NormedSpace ℝ E
inst✝ : NormedSpace ℝ F
f : α → ℝ≥0
f_meas : Measurable f
g : α → E
hE : CompleteSpace E
hg : Integrable g
c : E
s : Set α
s_meas : MeasurableSet s
hs : ↑↑(Measure.withDensity μ fun x => ↑(f x)) s < ⊤
⊢ (∫ (x : α) in s, c ∂Measure.withDensity μ fun x => ↑(f x)) = ∫ (a : α), f a • indicator s (fun x => c) a ∂μ

Next tactic:
simp_rw [← indicator_smul_apply, integral_indicator s_meas]
theorem integral_withDensity_eq_integral_smul {f : α → ℝ≥0} (f_meas : Measurable f) (g : α → E) :
    ∫ a, g a ∂μ.withDensity (fun x => f x) = ∫ a, f a • g a ∂μ := by
  by_cases hE : CompleteSpace E; swap; · simp [integral, hE]
  by_cases hg : Integrable g (μ.withDensity fun x => f x); swap
  · rw [integral_undef hg, integral_undef]
    rwa [← integrable_withDensity_iff_integrable_smul f_meas]
  refine' Integrable.induction
    (P := fun g => ∫ a, g a ∂μ.withDensity (fun x => f x) = ∫ a, f a • g a ∂μ) _ _ _ _ hg
  · intro c s s_meas hs
    rw [integral_indicator s_meas]
    simp_rw [← indicator_smul_apply, integral_indicator s_meas]
    

Proof state:
case pos.refine'_1
α : Type u_1
β : Type u_2
E : Type u_3
F : Type u_4
inst✝⁷ : MeasurableSpace α
ι : Type u_5
inst✝⁶ : NormedAddCommGroup E
μ : Measure α
𝕜 : Type u_6
inst✝⁵ : IsROrC 𝕜
inst✝⁴ : NormedSpace 𝕜 E
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
p : ℝ≥0∞
inst✝¹ : NormedSpace ℝ E
inst✝ : NormedSpace ℝ F
f : α → ℝ≥0
f_meas : Measurable f
g : α → E
hE : CompleteSpace E
hg : Integrable g
c : E
s : Set α
s_meas : MeasurableSet s
hs : ↑↑(Measure.withDensity μ fun x => ↑(f x)) s < ⊤
⊢ (∫ (x : α) in s, c ∂Measure.withDensity μ fun x => ↑(f x)) = ∫ (a : α) in s, f a • c ∂μ

Next tactic:
simp only [s_meas, integral_const, Measure.restrict_apply', univ_inter, withDensity_apply]
theorem integral_withDensity_eq_integral_smul {f : α → ℝ≥0} (f_meas : Measurable f) (g : α → E) :
    ∫ a, g a ∂μ.withDensity (fun x => f x) = ∫ a, f a • g a ∂μ := by
  by_cases hE : CompleteSpace E; swap; · simp [integral, hE]
  by_cases hg : Integrable g (μ.withDensity fun x => f x); swap
  · rw [integral_undef hg, integral_undef]
    rwa [← integrable_withDensity_iff_integrable_smul f_meas]
  refine' Integrable.induction
    (P := fun g => ∫ a, g a ∂μ.withDensity (fun x => f x) = ∫ a, f a • g a ∂μ) _ _ _ _ hg
  · intro c s s_meas hs
    rw [integral_indicator s_meas]
    simp_rw [← indicator_smul_apply, integral_indicator s_meas]
    simp only [s_meas, integral_const, Measure.restrict_apply', univ_inter, withDensity_apply]
    

Proof state:
case pos.refine'_1
α : Type u_1
β : Type u_2
E : Type u_3
F : Type u_4
inst✝⁷ : MeasurableSpace α
ι : Type u_5
inst✝⁶ : NormedAddCommGroup E
μ : Measure α
𝕜 : Type u_6
inst✝⁵ : IsROrC 𝕜
inst✝⁴ : NormedSpace 𝕜 E
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
p : ℝ≥0∞
inst✝¹ : NormedSpace ℝ E
inst✝ : NormedSpace ℝ F
f : α → ℝ≥0
f_meas : Measurable f
g : α → E
hE : CompleteSpace E
hg : Integrable g
c : E
s : Set α
s_meas : MeasurableSet s
hs : ↑↑(Measure.withDensity μ fun x => ↑(f x)) s < ⊤
⊢ ENNReal.toReal (∫⁻ (x : α) in s, ↑(f x) ∂μ) • c = ∫ (a : α) in s, f a • c ∂μ

Next tactic:
rw [lintegral_coe_eq_integral, ENNReal.toReal_ofReal, ← integral_smul_const]
theorem integral_withDensity_eq_integral_smul {f : α → ℝ≥0} (f_meas : Measurable f) (g : α → E) :
    ∫ a, g a ∂μ.withDensity (fun x => f x) = ∫ a, f a • g a ∂μ := by
  by_cases hE : CompleteSpace E; swap; · simp [integral, hE]
  by_cases hg : Integrable g (μ.withDensity fun x => f x); swap
  · rw [integral_undef hg, integral_undef]
    rwa [← integrable_withDensity_iff_integrable_smul f_meas]
  refine' Integrable.induction
    (P := fun g => ∫ a, g a ∂μ.withDensity (fun x => f x) = ∫ a, f a • g a ∂μ) _ _ _ _ hg
  · intro c s s_meas hs
    rw [integral_indicator s_meas]
    simp_rw [← indicator_smul_apply, integral_indicator s_meas]
    simp only [s_meas, integral_const, Measure.restrict_apply', univ_inter, withDensity_apply]
    rw [lintegral_coe_eq_integral, ENNReal.toReal_ofReal, ← integral_smul_const]
    · 

Proof state:
case pos.refine'_1
α : Type u_1
β : Type u_2
E : Type u_3
F : Type u_4
inst✝⁷ : MeasurableSpace α
ι : Type u_5
inst✝⁶ : NormedAddCommGroup E
μ : Measure α
𝕜 : Type u_6
inst✝⁵ : IsROrC 𝕜
inst✝⁴ : NormedSpace 𝕜 E
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
p : ℝ≥0∞
inst✝¹ : NormedSpace ℝ E
inst✝ : NormedSpace ℝ F
f : α → ℝ≥0
f_meas : Measurable f
g : α → E
hE : CompleteSpace E
hg : Integrable g
c : E
s : Set α
s_meas : MeasurableSet s
hs : ↑↑(Measure.withDensity μ fun x => ↑(f x)) s < ⊤
⊢ ∫ (x : α) in s, ↑(f x) • c ∂μ = ∫ (a : α) in s, f a • c ∂μ

Next tactic:
rfl
theorem integral_withDensity_eq_integral_smul {f : α → ℝ≥0} (f_meas : Measurable f) (g : α → E) :
    ∫ a, g a ∂μ.withDensity (fun x => f x) = ∫ a, f a • g a ∂μ := by
  by_cases hE : CompleteSpace E; swap; · simp [integral, hE]
  by_cases hg : Integrable g (μ.withDensity fun x => f x); swap
  · rw [integral_undef hg, integral_undef]
    rwa [← integrable_withDensity_iff_integrable_smul f_meas]
  refine' Integrable.induction
    (P := fun g => ∫ a, g a ∂μ.withDensity (fun x => f x) = ∫ a, f a • g a ∂μ) _ _ _ _ hg
  · intro c s s_meas hs
    rw [integral_indicator s_meas]
    simp_rw [← indicator_smul_apply, integral_indicator s_meas]
    simp only [s_meas, integral_const, Measure.restrict_apply', univ_inter, withDensity_apply]
    rw [lintegral_coe_eq_integral, ENNReal.toReal_ofReal, ← integral_smul_const]
    · rfl
    · 

Proof state:
case pos.refine'_1
α : Type u_1
β : Type u_2
E : Type u_3
F : Type u_4
inst✝⁷ : MeasurableSpace α
ι : Type u_5
inst✝⁶ : NormedAddCommGroup E
μ : Measure α
𝕜 : Type u_6
inst✝⁵ : IsROrC 𝕜
inst✝⁴ : NormedSpace 𝕜 E
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
p : ℝ≥0∞
inst✝¹ : NormedSpace ℝ E
inst✝ : NormedSpace ℝ F
f : α → ℝ≥0
f_meas : Measurable f
g : α → E
hE : CompleteSpace E
hg : Integrable g
c : E
s : Set α
s_meas : MeasurableSet s
hs : ↑↑(Measure.withDensity μ fun x => ↑(f x)) s < ⊤
⊢ 0 ≤ ∫ (a : α) in s, ↑(f a) ∂μ

Next tactic:
exact integral_nonneg fun x => NNReal.coe_nonneg _