-- Mathlib/MeasureTheory/Integral/IntegrableOn.lean
theorem IntegrableOn.restrict_toMeasurable (hf : IntegrableOn f s μ) (h's : ∀ x ∈ s, f x ≠ 0) :
    μ.restrict (toMeasurable μ s) = μ.restrict s

Proof state:
α : Type u_1
E : Type u_4
inst✝¹ : MeasurableSpace α
inst✝ : NormedAddCommGroup E
f : α → E
s : Set α
μ : Measure α
hf : IntegrableOn f s μ
h's : ∀ x ∈ s, f x ≠ 0
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
v : ℕ → Set α := fun n => toMeasurable (μ.restrict s) {x | u n ≤ ‖f x‖}
A : ∀ (n : ℕ), μ (s ∩ v n) ≠ ⊤
⊢ s ⊆ ⋃ n, v n

Tactic:
intro x hx

Result:
α : Type u_1
E : Type u_4
inst✝¹ : MeasurableSpace α
inst✝ : NormedAddCommGroup E
f : α → E
s : Set α
μ : Measure α
hf : IntegrableOn f s μ
h's : ∀ x ∈ s, f x ≠ 0
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
v : ℕ → Set α := fun n => toMeasurable (μ.restrict s) {x | u n ≤ ‖f x‖}
A : ∀ (n : ℕ), μ (s ∩ v n) ≠ ⊤
x : α
hx : x ∈ s
⊢ x ∈ ⋃ n, v n

Proof state:
case intro.intro.intro
α : Type u_1
E : Type u_4
inst✝¹ : MeasurableSpace α
inst✝ : NormedAddCommGroup E
f : α → E
s : Set α
μ : Measure α
hf : IntegrableOn f s μ
h's : ∀ x ∈ s, f x ≠ 0
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
⊢ μ.restrict (toMeasurable μ s) = μ.restrict s

Tactic:
let v n := toMeasurable (μ.restrict s) { x | u n ≤ ‖f x‖ }

Result:
case intro.intro.intro
α : Type u_1
E : Type u_4
inst✝¹ : MeasurableSpace α
inst✝ : NormedAddCommGroup E
f : α → E
s : Set α
μ : Measure α
hf : IntegrableOn f s μ
h's : ∀ x ∈ s, f x ≠ 0
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
v : ℕ → Set α := fun n => toMeasurable (μ.restrict s) {x | u n ≤ ‖f x‖}
⊢ μ.restrict (toMeasurable μ s) = μ.restrict s

Proof state:
case intro.intro.intro
α : Type u_1
E : Type u_4
inst✝¹ : MeasurableSpace α
inst✝ : NormedAddCommGroup E
f : α → E
s : Set α
μ : Measure α
hf : IntegrableOn f s μ
h's : ∀ x ∈ s, f x ≠ 0
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
v : ℕ → Set α := fun n => toMeasurable (μ.restrict s) {x | u n ≤ ‖f x‖}
A : ∀ (n : ℕ), μ (s ∩ v n) ≠ ⊤
⊢ μ.restrict (toMeasurable μ s) = μ.restrict s

Tactic:
apply Measure.restrict_toMeasurable_of_cover _ A

Result:
α : Type u_1
E : Type u_4
inst✝¹ : MeasurableSpace α
inst✝ : NormedAddCommGroup E
f : α → E
s : Set α
μ : Measure α
hf : IntegrableOn f s μ
h's : ∀ x ∈ s, f x ≠ 0
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
v : ℕ → Set α := fun n => toMeasurable (μ.restrict s) {x | u n ≤ ‖f x‖}
A : ∀ (n : ℕ), μ (s ∩ v n) ≠ ⊤
⊢ s ⊆ ⋃ n, v n

Proof state:
case intro.intro.intro
α : Type u_1
E : Type u_4
inst✝¹ : MeasurableSpace α
inst✝ : NormedAddCommGroup E
f : α → E
s : Set α
μ : Measure α
hf : IntegrableOn f s μ
h's : ∀ x ∈ s, f x ≠ 0
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
v : ℕ → Set α := fun n => toMeasurable (μ.restrict s) {x | u n ≤ ‖f x‖}
⊢ μ.restrict (toMeasurable μ s) = μ.restrict s

Tactic:
have A : ∀ n, μ (s ∩ v n) ≠ ∞ := by
  intro n
  rw [inter_comm, ← Measure.restrict_apply (measurableSet_toMeasurable _ _),
    measure_toMeasurable]
  exact (hf.measure_norm_ge_lt_top (u_pos n)).ne

Result:
case intro.intro.intro
α : Type u_1
E : Type u_4
inst✝¹ : MeasurableSpace α
inst✝ : NormedAddCommGroup E
f : α → E
s : Set α
μ : Measure α
hf : IntegrableOn f s μ
h's : ∀ x ∈ s, f x ≠ 0
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
v : ℕ → Set α := fun n => toMeasurable (μ.restrict s) {x | u n ≤ ‖f x‖}
A : ∀ (n : ℕ), μ (s ∩ v n) ≠ ⊤
⊢ μ.restrict (toMeasurable μ s) = μ.restrict s

Proof state:
α : Type u_1
E : Type u_4
inst✝¹ : MeasurableSpace α
inst✝ : NormedAddCommGroup E
f : α → E
s : Set α
μ : Measure α
hf : IntegrableOn f s μ
h's : ∀ x ∈ s, f x ≠ 0
⊢ μ.restrict (toMeasurable μ s) = μ.restrict s

Tactic:
rcases exists_seq_strictAnti_tendsto (0 : ℝ) with ⟨u, _, u_pos, u_lim⟩

Result:
case intro.intro.intro
α : Type u_1
E : Type u_4
inst✝¹ : MeasurableSpace α
inst✝ : NormedAddCommGroup E
f : α → E
s : Set α
μ : Measure α
hf : IntegrableOn f s μ
h's : ∀ x ∈ s, f x ≠ 0
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
⊢ μ.restrict (toMeasurable μ s) = μ.restrict s

Proof state:
α : Type u_1
E : Type u_4
inst✝¹ : MeasurableSpace α
inst✝ : NormedAddCommGroup E
f : α → E
s : Set α
μ : Measure α
hf : IntegrableOn f s μ
h's : ∀ x ∈ s, f x ≠ 0
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
v : ℕ → Set α := fun n => toMeasurable (μ.restrict s) {x | u n ≤ ‖f x‖}
n : ℕ
⊢ (μ.restrict s) {x | u n ≤ ‖f x‖} ≠ ⊤

Tactic:
exact (hf.measure_norm_ge_lt_top (u_pos n)).ne

Result:
no goals

Proof state:
α : Type u_1
E : Type u_4
inst✝¹ : MeasurableSpace α
inst✝ : NormedAddCommGroup E
f : α → E
s : Set α
μ : Measure α
hf : IntegrableOn f s μ
h's : ∀ x ∈ s, f x ≠ 0
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
v : ℕ → Set α := fun n => toMeasurable (μ.restrict s) {x | u n ≤ ‖f x‖}
⊢ ∀ (n : ℕ), μ (s ∩ v n) ≠ ⊤

Tactic:
intro n

Result:
α : Type u_1
E : Type u_4
inst✝¹ : MeasurableSpace α
inst✝ : NormedAddCommGroup E
f : α → E
s : Set α
μ : Measure α
hf : IntegrableOn f s μ
h's : ∀ x ∈ s, f x ≠ 0
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
v : ℕ → Set α := fun n => toMeasurable (μ.restrict s) {x | u n ≤ ‖f x‖}
n : ℕ
⊢ μ (s ∩ v n) ≠ ⊤

Proof state:
α : Type u_1
E : Type u_4
inst✝¹ : MeasurableSpace α
inst✝ : NormedAddCommGroup E
f : α → E
s : Set α
μ : Measure α
hf : IntegrableOn f s μ
h's : ∀ x ∈ s, f x ≠ 0
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
v : ℕ → Set α := fun n => toMeasurable (μ.restrict s) {x | u n ≤ ‖f x‖}
A : ∀ (n : ℕ), μ (s ∩ v n) ≠ ⊤
x : α
hx : x ∈ s
⊢ 0 < ‖f x‖

Tactic:
simp only [h's x hx, norm_pos_iff, Ne, not_false_iff]

Result:
no goals

Proof state:
α : Type u_1
E : Type u_4
inst✝¹ : MeasurableSpace α
inst✝ : NormedAddCommGroup E
f : α → E
s : Set α
μ : Measure α
hf : IntegrableOn f s μ
h's : ∀ x ∈ s, f x ≠ 0
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
v : ℕ → Set α := fun n => toMeasurable (μ.restrict s) {x | u n ≤ ‖f x‖}
A : ∀ (n : ℕ), μ (s ∩ v n) ≠ ⊤
x : α
hx : x ∈ s
this : 0 < ‖f x‖
⊢ x ∈ ⋃ n, v n

Tactic:
obtain ⟨n, hn⟩ : ∃ n, u n < ‖f x‖ := ((tendsto_order.1 u_lim).2 _ this).exists

Result:
case intro
α : Type u_1
E : Type u_4
inst✝¹ : MeasurableSpace α
inst✝ : NormedAddCommGroup E
f : α → E
s : Set α
μ : Measure α
hf : IntegrableOn f s μ
h's : ∀ x ∈ s, f x ≠ 0
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
v : ℕ → Set α := fun n => toMeasurable (μ.restrict s) {x | u n ≤ ‖f x‖}
A : ∀ (n : ℕ), μ (s ∩ v n) ≠ ⊤
x : α
hx : x ∈ s
this : 0 < ‖f x‖
n : ℕ
hn : u n < ‖f x‖
⊢ x ∈ ⋃ n, v n

Proof state:
α : Type u_1
E : Type u_4
inst✝¹ : MeasurableSpace α
inst✝ : NormedAddCommGroup E
f : α → E
s : Set α
μ : Measure α
hf : IntegrableOn f s μ
h's : ∀ x ∈ s, f x ≠ 0
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
v : ℕ → Set α := fun n => toMeasurable (μ.restrict s) {x | u n ≤ ‖f x‖}
A : ∀ (n : ℕ), μ (s ∩ v n) ≠ ⊤
x : α
hx : x ∈ s
⊢ x ∈ ⋃ n, v n

Tactic:
have : 0 < ‖f x‖ := by simp only [h's x hx, norm_pos_iff, Ne, not_false_iff]

Result:
α : Type u_1
E : Type u_4
inst✝¹ : MeasurableSpace α
inst✝ : NormedAddCommGroup E
f : α → E
s : Set α
μ : Measure α
hf : IntegrableOn f s μ
h's : ∀ x ∈ s, f x ≠ 0
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
v : ℕ → Set α := fun n => toMeasurable (μ.restrict s) {x | u n ≤ ‖f x‖}
A : ∀ (n : ℕ), μ (s ∩ v n) ≠ ⊤
x : α
hx : x ∈ s
this : 0 < ‖f x‖
⊢ x ∈ ⋃ n, v n