l3lab/ntp-mathlib huggingface dataset:
theorem snorm_indicator_const_le (c : G) (p : ℝ≥0∞) :
    snorm (s.indicator fun _ => c) p μ ≤ ‖c‖₊ * μ s ^ (1 / p.toReal) := by
  

Proof state:
α : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
m m0 : MeasurableSpace α
p✝ : ℝ≥0∞
q : ℝ
μ ν : Measure α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedAddCommGroup F
inst✝ : NormedAddCommGroup G
c✝ : E
f : α → E
hf : AEStronglyMeasurable f μ
s : Set α
c : G
p : ℝ≥0∞
⊢ snorm (Set.indicator s fun x => c) p μ ≤ ↑‖c‖₊ * ↑↑μ s ^ (1 / ENNReal.toReal p)

Next tactic:
rcases eq_or_ne p 0 with (rfl | hp)
theorem snorm_indicator_const_le (c : G) (p : ℝ≥0∞) :
    snorm (s.indicator fun _ => c) p μ ≤ ‖c‖₊ * μ s ^ (1 / p.toReal) := by
  rcases eq_or_ne p 0 with (rfl | hp)
  · 

Proof state:
case inl
α : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
m m0 : MeasurableSpace α
p : ℝ≥0∞
q : ℝ
μ ν : Measure α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedAddCommGroup F
inst✝ : NormedAddCommGroup G
c✝ : E
f : α → E
hf : AEStronglyMeasurable f μ
s : Set α
c : G
⊢ snorm (Set.indicator s fun x => c) 0 μ ≤ ↑‖c‖₊ * ↑↑μ s ^ (1 / ENNReal.toReal 0)

Next tactic:
simp only [snorm_exponent_zero, zero_le']
theorem snorm_indicator_const_le (c : G) (p : ℝ≥0∞) :
    snorm (s.indicator fun _ => c) p μ ≤ ‖c‖₊ * μ s ^ (1 / p.toReal) := by
  rcases eq_or_ne p 0 with (rfl | hp)
  · simp only [snorm_exponent_zero, zero_le']
  

Proof state:
case inr
α : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
m m0 : MeasurableSpace α
p✝ : ℝ≥0∞
q : ℝ
μ ν : Measure α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedAddCommGroup F
inst✝ : NormedAddCommGroup G
c✝ : E
f : α → E
hf : AEStronglyMeasurable f μ
s : Set α
c : G
p : ℝ≥0∞
hp : p ≠ 0
⊢ snorm (Set.indicator s fun x => c) p μ ≤ ↑‖c‖₊ * ↑↑μ s ^ (1 / ENNReal.toReal p)

Next tactic:
rcases eq_or_ne p ∞ with (rfl | h'p)
theorem snorm_indicator_const_le (c : G) (p : ℝ≥0∞) :
    snorm (s.indicator fun _ => c) p μ ≤ ‖c‖₊ * μ s ^ (1 / p.toReal) := by
  rcases eq_or_ne p 0 with (rfl | hp)
  · simp only [snorm_exponent_zero, zero_le']
  rcases eq_or_ne p ∞ with (rfl | h'p)
  · 

Proof state:
case inr.inl
α : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
m m0 : MeasurableSpace α
p : ℝ≥0∞
q : ℝ
μ ν : Measure α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedAddCommGroup F
inst✝ : NormedAddCommGroup G
c✝ : E
f : α → E
hf : AEStronglyMeasurable f μ
s : Set α
c : G
hp : ⊤ ≠ 0
⊢ snorm (Set.indicator s fun x => c) ⊤ μ ≤ ↑‖c‖₊ * ↑↑μ s ^ (1 / ENNReal.toReal ⊤)

Next tactic:
simp only [snorm_exponent_top, ENNReal.top_toReal, _root_.div_zero, ENNReal.rpow_zero, mul_one]
theorem snorm_indicator_const_le (c : G) (p : ℝ≥0∞) :
    snorm (s.indicator fun _ => c) p μ ≤ ‖c‖₊ * μ s ^ (1 / p.toReal) := by
  rcases eq_or_ne p 0 with (rfl | hp)
  · simp only [snorm_exponent_zero, zero_le']
  rcases eq_or_ne p ∞ with (rfl | h'p)
  · simp only [snorm_exponent_top, ENNReal.top_toReal, _root_.div_zero, ENNReal.rpow_zero, mul_one]
    

Proof state:
case inr.inl
α : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
m m0 : MeasurableSpace α
p : ℝ≥0∞
q : ℝ
μ ν : Measure α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedAddCommGroup F
inst✝ : NormedAddCommGroup G
c✝ : E
f : α → E
hf : AEStronglyMeasurable f μ
s : Set α
c : G
hp : ⊤ ≠ 0
⊢ snormEssSup (Set.indicator s fun x => c) μ ≤ ↑‖c‖₊

Next tactic:
exact snormEssSup_indicator_const_le _ _
theorem snorm_indicator_const_le (c : G) (p : ℝ≥0∞) :
    snorm (s.indicator fun _ => c) p μ ≤ ‖c‖₊ * μ s ^ (1 / p.toReal) := by
  rcases eq_or_ne p 0 with (rfl | hp)
  · simp only [snorm_exponent_zero, zero_le']
  rcases eq_or_ne p ∞ with (rfl | h'p)
  · simp only [snorm_exponent_top, ENNReal.top_toReal, _root_.div_zero, ENNReal.rpow_zero, mul_one]
    exact snormEssSup_indicator_const_le _ _
  

Proof state:
case inr.inr
α : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
m m0 : MeasurableSpace α
p✝ : ℝ≥0∞
q : ℝ
μ ν : Measure α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedAddCommGroup F
inst✝ : NormedAddCommGroup G
c✝ : E
f : α → E
hf : AEStronglyMeasurable f μ
s : Set α
c : G
p : ℝ≥0∞
hp : p ≠ 0
h'p : p ≠ ⊤
⊢ snorm (Set.indicator s fun x => c) p μ ≤ ↑‖c‖₊ * ↑↑μ s ^ (1 / ENNReal.toReal p)

Next tactic:
let t := toMeasurable μ s
theorem snorm_indicator_const_le (c : G) (p : ℝ≥0∞) :
    snorm (s.indicator fun _ => c) p μ ≤ ‖c‖₊ * μ s ^ (1 / p.toReal) := by
  rcases eq_or_ne p 0 with (rfl | hp)
  · simp only [snorm_exponent_zero, zero_le']
  rcases eq_or_ne p ∞ with (rfl | h'p)
  · simp only [snorm_exponent_top, ENNReal.top_toReal, _root_.div_zero, ENNReal.rpow_zero, mul_one]
    exact snormEssSup_indicator_const_le _ _
  let t := toMeasurable μ s
  

Proof state:
case inr.inr
α : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
m m0 : MeasurableSpace α
p✝ : ℝ≥0∞
q : ℝ
μ ν : Measure α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedAddCommGroup F
inst✝ : NormedAddCommGroup G
c✝ : E
f : α → E
hf : AEStronglyMeasurable f μ
s : Set α
c : G
p : ℝ≥0∞
hp : p ≠ 0
h'p : p ≠ ⊤
t : Set α := toMeasurable μ s
⊢ snorm (Set.indicator s fun x => c) p μ ≤ ↑‖c‖₊ * ↑↑μ s ^ (1 / ENNReal.toReal p)

Next tactic:
calc
    snorm (s.indicator fun _ => c) p μ ≤ snorm (t.indicator fun _ => c) p μ :=
      snorm_mono (norm_indicator_le_of_subset (subset_toMeasurable _ _) _)
    _ = ‖c‖₊ * μ t ^ (1 / p.toReal) :=
      (snorm_indicator_const (measurableSet_toMeasurable _ _) hp h'p)
    _ = ‖c‖₊ * μ s ^ (1 / p.toReal) := by rw [measure_toMeasurable]
theorem snorm_indicator_const_le (c : G) (p : ℝ≥0∞) :
    snorm (s.indicator fun _ => c) p μ ≤ ‖c‖₊ * μ s ^ (1 / p.toReal) := by
  rcases eq_or_ne p 0 with (rfl | hp)
  · simp only [snorm_exponent_zero, zero_le']
  rcases eq_or_ne p ∞ with (rfl | h'p)
  · simp only [snorm_exponent_top, ENNReal.top_toReal, _root_.div_zero, ENNReal.rpow_zero, mul_one]
    exact snormEssSup_indicator_const_le _ _
  let t := toMeasurable μ s
  calc
    snorm (s.indicator fun _ => c) p μ ≤ snorm (t.indicator fun _ => c) p μ :=
      snorm_mono (norm_indicator_le_of_subset (subset_toMeasurable _ _) _)
    _ = ‖c‖₊ * μ t ^ (1 / p.toReal) :=
      (snorm_indicator_const (measurableSet_toMeasurable _ _) hp h'p)
    _ = ‖c‖₊ * μ s ^ (1 / p.toReal) := by 

Proof state:
α : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
m m0 : MeasurableSpace α
p✝ : ℝ≥0∞
q : ℝ
μ ν : Measure α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedAddCommGroup F
inst✝ : NormedAddCommGroup G
c✝ : E
f : α → E
hf : AEStronglyMeasurable f μ
s : Set α
c : G
p : ℝ≥0∞
hp : p ≠ 0
h'p : p ≠ ⊤
t : Set α := toMeasurable μ s
⊢ ↑‖c‖₊ * ↑↑μ t ^ (1 / ENNReal.toReal p) = ↑‖c‖₊ * ↑↑μ s ^ (1 / ENNReal.toReal p)

Next tactic:
rw [measure_toMeasurable]
theorem snormEssSup_indicator_eq_snormEssSup_restrict {f : α → F} (hs : MeasurableSet s) :
    snormEssSup (s.indicator f) μ = snormEssSup f (μ.restrict s) := by
  

Proof state:
α : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
m m0 : MeasurableSpace α
p : ℝ≥0∞
q : ℝ
μ ν : Measure α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedAddCommGroup F
inst✝ : NormedAddCommGroup G
c : E
f✝ : α → E
hf : AEStronglyMeasurable f✝ μ
s : Set α
f : α → F
hs : MeasurableSet s
⊢ snormEssSup (Set.indicator s f) μ = snormEssSup f (Measure.restrict μ s)

Next tactic:
simp_rw [snormEssSup, nnnorm_indicator_eq_indicator_nnnorm, ENNReal.coe_indicator,
    ENNReal.essSup_indicator_eq_essSup_restrict hs]
theorem snorm_indicator_eq_snorm_restrict {f : α → F} (hs : MeasurableSet s) :
    snorm (s.indicator f) p μ = snorm f p (μ.restrict s) := by
  

Proof state:
α : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
m m0 : MeasurableSpace α
p : ℝ≥0∞
q : ℝ
μ ν : Measure α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedAddCommGroup F
inst✝ : NormedAddCommGroup G
c : E
f✝ : α → E
hf : AEStronglyMeasurable f✝ μ
s : Set α
f : α → F
hs : MeasurableSet s
⊢ snorm (Set.indicator s f) p μ = snorm f p (Measure.restrict μ s)

Next tactic:
by_cases hp_zero : p = 0
theorem snorm_indicator_eq_snorm_restrict {f : α → F} (hs : MeasurableSet s) :
    snorm (s.indicator f) p μ = snorm f p (μ.restrict s) := by
  by_cases hp_zero : p = 0
  · 

Proof state:
case pos
α : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
m m0 : MeasurableSpace α
p : ℝ≥0∞
q : ℝ
μ ν : Measure α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedAddCommGroup F
inst✝ : NormedAddCommGroup G
c : E
f✝ : α → E
hf : AEStronglyMeasurable f✝ μ
s : Set α
f : α → F
hs : MeasurableSet s
hp_zero : p = 0
⊢ snorm (Set.indicator s f) p μ = snorm f p (Measure.restrict μ s)

Next tactic:
simp only [hp_zero, snorm_exponent_zero]
theorem snorm_indicator_eq_snorm_restrict {f : α → F} (hs : MeasurableSet s) :
    snorm (s.indicator f) p μ = snorm f p (μ.restrict s) := by
  by_cases hp_zero : p = 0
  · simp only [hp_zero, snorm_exponent_zero]
  

Proof state:
case neg
α : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
m m0 : MeasurableSpace α
p : ℝ≥0∞
q : ℝ
μ ν : Measure α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedAddCommGroup F
inst✝ : NormedAddCommGroup G
c : E
f✝ : α → E
hf : AEStronglyMeasurable f✝ μ
s : Set α
f : α → F
hs : MeasurableSet s
hp_zero : ¬p = 0
⊢ snorm (Set.indicator s f) p μ = snorm f p (Measure.restrict μ s)

Next tactic:
by_cases hp_top : p = ∞
theorem snorm_indicator_eq_snorm_restrict {f : α → F} (hs : MeasurableSet s) :
    snorm (s.indicator f) p μ = snorm f p (μ.restrict s) := by
  by_cases hp_zero : p = 0
  · simp only [hp_zero, snorm_exponent_zero]
  by_cases hp_top : p = ∞
  · 

Proof state:
case pos
α : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
m m0 : MeasurableSpace α
p : ℝ≥0∞
q : ℝ
μ ν : Measure α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedAddCommGroup F
inst✝ : NormedAddCommGroup G
c : E
f✝ : α → E
hf : AEStronglyMeasurable f✝ μ
s : Set α
f : α → F
hs : MeasurableSet s
hp_zero : ¬p = 0
hp_top : p = ⊤
⊢ snorm (Set.indicator s f) p μ = snorm f p (Measure.restrict μ s)

Next tactic:
simp_rw [hp_top, snorm_exponent_top]
theorem snorm_indicator_eq_snorm_restrict {f : α → F} (hs : MeasurableSet s) :
    snorm (s.indicator f) p μ = snorm f p (μ.restrict s) := by
  by_cases hp_zero : p = 0
  · simp only [hp_zero, snorm_exponent_zero]
  by_cases hp_top : p = ∞
  · simp_rw [hp_top, snorm_exponent_top]
    

Proof state:
case pos
α : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
m m0 : MeasurableSpace α
p : ℝ≥0∞
q : ℝ
μ ν : Measure α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedAddCommGroup F
inst✝ : NormedAddCommGroup G
c : E
f✝ : α → E
hf : AEStronglyMeasurable f✝ μ
s : Set α
f : α → F
hs : MeasurableSet s
hp_zero : ¬p = 0
hp_top : p = ⊤
⊢ snormEssSup (Set.indicator s f) μ = snormEssSup f (Measure.restrict μ s)

Next tactic:
exact snormEssSup_indicator_eq_snormEssSup_restrict hs
theorem snorm_indicator_eq_snorm_restrict {f : α → F} (hs : MeasurableSet s) :
    snorm (s.indicator f) p μ = snorm f p (μ.restrict s) := by
  by_cases hp_zero : p = 0
  · simp only [hp_zero, snorm_exponent_zero]
  by_cases hp_top : p = ∞
  · simp_rw [hp_top, snorm_exponent_top]
    exact snormEssSup_indicator_eq_snormEssSup_restrict hs
  

Proof state:
case neg
α : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
m m0 : MeasurableSpace α
p : ℝ≥0∞
q : ℝ
μ ν : Measure α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedAddCommGroup F
inst✝ : NormedAddCommGroup G
c : E
f✝ : α → E
hf : AEStronglyMeasurable f✝ μ
s : Set α
f : α → F
hs : MeasurableSet s
hp_zero : ¬p = 0
hp_top : ¬p = ⊤
⊢ snorm (Set.indicator s f) p μ = snorm f p (Measure.restrict μ s)

Next tactic:
simp_rw [snorm_eq_lintegral_rpow_nnnorm hp_zero hp_top]
theorem snorm_indicator_eq_snorm_restrict {f : α → F} (hs : MeasurableSet s) :
    snorm (s.indicator f) p μ = snorm f p (μ.restrict s) := by
  by_cases hp_zero : p = 0
  · simp only [hp_zero, snorm_exponent_zero]
  by_cases hp_top : p = ∞
  · simp_rw [hp_top, snorm_exponent_top]
    exact snormEssSup_indicator_eq_snormEssSup_restrict hs
  simp_rw [snorm_eq_lintegral_rpow_nnnorm hp_zero hp_top]
  

Proof state:
case neg
α : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
m m0 : MeasurableSpace α
p : ℝ≥0∞
q : ℝ
μ ν : Measure α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedAddCommGroup F
inst✝ : NormedAddCommGroup G
c : E
f✝ : α → E
hf : AEStronglyMeasurable f✝ μ
s : Set α
f : α → F
hs : MeasurableSet s
hp_zero : ¬p = 0
hp_top : ¬p = ⊤
⊢ (∫⁻ (x : α), ↑‖Set.indicator s f x‖₊ ^ ENNReal.toReal p ∂μ) ^ (1 / ENNReal.toReal p) =
    (∫⁻ (x : α) in s, ↑‖f x‖₊ ^ ENNReal.toReal p ∂μ) ^ (1 / ENNReal.toReal p)

Next tactic:
suffices (∫⁻ x, (‖s.indicator f x‖₊ : ℝ≥0∞) ^ p.toReal ∂μ) =
      ∫⁻ x in s, (‖f x‖₊ : ℝ≥0∞) ^ p.toReal ∂μ by rw [this]
theorem snorm_indicator_eq_snorm_restrict {f : α → F} (hs : MeasurableSet s) :
    snorm (s.indicator f) p μ = snorm f p (μ.restrict s) := by
  by_cases hp_zero : p = 0
  · simp only [hp_zero, snorm_exponent_zero]
  by_cases hp_top : p = ∞
  · simp_rw [hp_top, snorm_exponent_top]
    exact snormEssSup_indicator_eq_snormEssSup_restrict hs
  simp_rw [snorm_eq_lintegral_rpow_nnnorm hp_zero hp_top]
  suffices (∫⁻ x, (‖s.indicator f x‖₊ : ℝ≥0∞) ^ p.toReal ∂μ) =
      ∫⁻ x in s, (‖f x‖₊ : ℝ≥0∞) ^ p.toReal ∂μ by 

Proof state:
α : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
m m0 : MeasurableSpace α
p : ℝ≥0∞
q : ℝ
μ ν : Measure α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedAddCommGroup F
inst✝ : NormedAddCommGroup G
c : E
f✝ : α → E
hf : AEStronglyMeasurable f✝ μ
s : Set α
f : α → F
hs : MeasurableSet s
hp_zero : ¬p = 0
hp_top : ¬p = ⊤
this : ∫⁻ (x : α), ↑‖Set.indicator s f x‖₊ ^ ENNReal.toReal p ∂μ = ∫⁻ (x : α) in s, ↑‖f x‖₊ ^ ENNReal.toReal p ∂μ
⊢ (∫⁻ (x : α), ↑‖Set.indicator s f x‖₊ ^ ENNReal.toReal p ∂μ) ^ (1 / ENNReal.toReal p) =
    (∫⁻ (x : α) in s, ↑‖f x‖₊ ^ ENNReal.toReal p ∂μ) ^ (1 / ENNReal.toReal p)

Next tactic:
rw [this]
theorem snorm_indicator_eq_snorm_restrict {f : α → F} (hs : MeasurableSet s) :
    snorm (s.indicator f) p μ = snorm f p (μ.restrict s) := by
  by_cases hp_zero : p = 0
  · simp only [hp_zero, snorm_exponent_zero]
  by_cases hp_top : p = ∞
  · simp_rw [hp_top, snorm_exponent_top]
    exact snormEssSup_indicator_eq_snormEssSup_restrict hs
  simp_rw [snorm_eq_lintegral_rpow_nnnorm hp_zero hp_top]
  suffices (∫⁻ x, (‖s.indicator f x‖₊ : ℝ≥0∞) ^ p.toReal ∂μ) =
      ∫⁻ x in s, (‖f x‖₊ : ℝ≥0∞) ^ p.toReal ∂μ by rw [this]
  

Proof state:
case neg
α : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
m m0 : MeasurableSpace α
p : ℝ≥0∞
q : ℝ
μ ν : Measure α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedAddCommGroup F
inst✝ : NormedAddCommGroup G
c : E
f✝ : α → E
hf : AEStronglyMeasurable f✝ μ
s : Set α
f : α → F
hs : MeasurableSet s
hp_zero : ¬p = 0
hp_top : ¬p = ⊤
⊢ ∫⁻ (x : α), ↑‖Set.indicator s f x‖₊ ^ ENNReal.toReal p ∂μ = ∫⁻ (x : α) in s, ↑‖f x‖₊ ^ ENNReal.toReal p ∂μ

Next tactic:
rw [← lintegral_indicator _ hs]
theorem snorm_indicator_eq_snorm_restrict {f : α → F} (hs : MeasurableSet s) :
    snorm (s.indicator f) p μ = snorm f p (μ.restrict s) := by
  by_cases hp_zero : p = 0
  · simp only [hp_zero, snorm_exponent_zero]
  by_cases hp_top : p = ∞
  · simp_rw [hp_top, snorm_exponent_top]
    exact snormEssSup_indicator_eq_snormEssSup_restrict hs
  simp_rw [snorm_eq_lintegral_rpow_nnnorm hp_zero hp_top]
  suffices (∫⁻ x, (‖s.indicator f x‖₊ : ℝ≥0∞) ^ p.toReal ∂μ) =
      ∫⁻ x in s, (‖f x‖₊ : ℝ≥0∞) ^ p.toReal ∂μ by rw [this]
  rw [← lintegral_indicator _ hs]
  

Proof state:
case neg
α : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
m m0 : MeasurableSpace α
p : ℝ≥0∞
q : ℝ
μ ν : Measure α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedAddCommGroup F
inst✝ : NormedAddCommGroup G
c : E
f✝ : α → E
hf : AEStronglyMeasurable f✝ μ
s : Set α
f : α → F
hs : MeasurableSet s
hp_zero : ¬p = 0
hp_top : ¬p = ⊤
⊢ ∫⁻ (x : α), ↑‖Set.indicator s f x‖₊ ^ ENNReal.toReal p ∂μ =
    ∫⁻ (a : α), Set.indicator s (fun x => ↑‖f x‖₊ ^ ENNReal.toReal p) a ∂μ

Next tactic:
congr
theorem snorm_indicator_eq_snorm_restrict {f : α → F} (hs : MeasurableSet s) :
    snorm (s.indicator f) p μ = snorm f p (μ.restrict s) := by
  by_cases hp_zero : p = 0
  · simp only [hp_zero, snorm_exponent_zero]
  by_cases hp_top : p = ∞
  · simp_rw [hp_top, snorm_exponent_top]
    exact snormEssSup_indicator_eq_snormEssSup_restrict hs
  simp_rw [snorm_eq_lintegral_rpow_nnnorm hp_zero hp_top]
  suffices (∫⁻ x, (‖s.indicator f x‖₊ : ℝ≥0∞) ^ p.toReal ∂μ) =
      ∫⁻ x in s, (‖f x‖₊ : ℝ≥0∞) ^ p.toReal ∂μ by rw [this]
  rw [← lintegral_indicator _ hs]
  congr
  

Proof state:
case neg.e_f
α : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
m m0 : MeasurableSpace α
p : ℝ≥0∞
q : ℝ
μ ν : Measure α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedAddCommGroup F
inst✝ : NormedAddCommGroup G
c : E
f✝ : α → E
hf : AEStronglyMeasurable f✝ μ
s : Set α
f : α → F
hs : MeasurableSet s
hp_zero : ¬p = 0
hp_top : ¬p = ⊤
⊢ (fun x => ↑‖Set.indicator s f x‖₊ ^ ENNReal.toReal p) = fun a =>
    Set.indicator s (fun x => ↑‖f x‖₊ ^ ENNReal.toReal p) a

Next tactic:
simp_rw [nnnorm_indicator_eq_indicator_nnnorm, ENNReal.coe_indicator]
theorem snorm_indicator_eq_snorm_restrict {f : α → F} (hs : MeasurableSet s) :
    snorm (s.indicator f) p μ = snorm f p (μ.restrict s) := by
  by_cases hp_zero : p = 0
  · simp only [hp_zero, snorm_exponent_zero]
  by_cases hp_top : p = ∞
  · simp_rw [hp_top, snorm_exponent_top]
    exact snormEssSup_indicator_eq_snormEssSup_restrict hs
  simp_rw [snorm_eq_lintegral_rpow_nnnorm hp_zero hp_top]
  suffices (∫⁻ x, (‖s.indicator f x‖₊ : ℝ≥0∞) ^ p.toReal ∂μ) =
      ∫⁻ x in s, (‖f x‖₊ : ℝ≥0∞) ^ p.toReal ∂μ by rw [this]
  rw [← lintegral_indicator _ hs]
  congr
  simp_rw [nnnorm_indicator_eq_indicator_nnnorm, ENNReal.coe_indicator]
  

Proof state:
case neg.e_f
α : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
m m0 : MeasurableSpace α
p : ℝ≥0∞
q : ℝ
μ ν : Measure α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedAddCommGroup F
inst✝ : NormedAddCommGroup G
c : E
f✝ : α → E
hf : AEStronglyMeasurable f✝ μ
s : Set α
f : α → F
hs : MeasurableSet s
hp_zero : ¬p = 0
hp_top : ¬p = ⊤
⊢ (fun x => Set.indicator s (fun x => ↑‖f x‖₊) x ^ ENNReal.toReal p) = fun a =>
    Set.indicator s (fun x => ↑‖f x‖₊ ^ ENNReal.toReal p) a

Next tactic:
have h_zero : (fun x => x ^ p.toReal) (0 : ℝ≥0∞) = 0 := by
    simp [ENNReal.toReal_pos hp_zero hp_top]
theorem snorm_indicator_eq_snorm_restrict {f : α → F} (hs : MeasurableSet s) :
    snorm (s.indicator f) p μ = snorm f p (μ.restrict s) := by
  by_cases hp_zero : p = 0
  · simp only [hp_zero, snorm_exponent_zero]
  by_cases hp_top : p = ∞
  · simp_rw [hp_top, snorm_exponent_top]
    exact snormEssSup_indicator_eq_snormEssSup_restrict hs
  simp_rw [snorm_eq_lintegral_rpow_nnnorm hp_zero hp_top]
  suffices (∫⁻ x, (‖s.indicator f x‖₊ : ℝ≥0∞) ^ p.toReal ∂μ) =
      ∫⁻ x in s, (‖f x‖₊ : ℝ≥0∞) ^ p.toReal ∂μ by rw [this]
  rw [← lintegral_indicator _ hs]
  congr
  simp_rw [nnnorm_indicator_eq_indicator_nnnorm, ENNReal.coe_indicator]
  have h_zero : (fun x => x ^ p.toReal) (0 : ℝ≥0∞) = 0 := by
    

Proof state:
α : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
m m0 : MeasurableSpace α
p : ℝ≥0∞
q : ℝ
μ ν : Measure α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedAddCommGroup F
inst✝ : NormedAddCommGroup G
c : E
f✝ : α → E
hf : AEStronglyMeasurable f✝ μ
s : Set α
f : α → F
hs : MeasurableSet s
hp_zero : ¬p = 0
hp_top : ¬p = ⊤
⊢ (fun x => x ^ ENNReal.toReal p) 0 = 0

Next tactic:
simp [ENNReal.toReal_pos hp_zero hp_top]
theorem snorm_indicator_eq_snorm_restrict {f : α → F} (hs : MeasurableSet s) :
    snorm (s.indicator f) p μ = snorm f p (μ.restrict s) := by
  by_cases hp_zero : p = 0
  · simp only [hp_zero, snorm_exponent_zero]
  by_cases hp_top : p = ∞
  · simp_rw [hp_top, snorm_exponent_top]
    exact snormEssSup_indicator_eq_snormEssSup_restrict hs
  simp_rw [snorm_eq_lintegral_rpow_nnnorm hp_zero hp_top]
  suffices (∫⁻ x, (‖s.indicator f x‖₊ : ℝ≥0∞) ^ p.toReal ∂μ) =
      ∫⁻ x in s, (‖f x‖₊ : ℝ≥0∞) ^ p.toReal ∂μ by rw [this]
  rw [← lintegral_indicator _ hs]
  congr
  simp_rw [nnnorm_indicator_eq_indicator_nnnorm, ENNReal.coe_indicator]
  have h_zero : (fun x => x ^ p.toReal) (0 : ℝ≥0∞) = 0 := by
    simp [ENNReal.toReal_pos hp_zero hp_top]
  -- Porting note: The implicit argument should be specified because the elaborator can't deal with
  --               `∘` well.
  

Proof state:
case neg.e_f
α : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
m m0 : MeasurableSpace α
p : ℝ≥0∞
q : ℝ
μ ν : Measure α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedAddCommGroup F
inst✝ : NormedAddCommGroup G
c : E
f✝ : α → E
hf : AEStronglyMeasurable f✝ μ
s : Set α
f : α → F
hs : MeasurableSet s
hp_zero : ¬p = 0
hp_top : ¬p = ⊤
h_zero : (fun x => x ^ ENNReal.toReal p) 0 = 0
⊢ (fun x => Set.indicator s (fun x => ↑‖f x‖₊) x ^ ENNReal.toReal p) = fun a =>
    Set.indicator s (fun x => ↑‖f x‖₊ ^ ENNReal.toReal p) a

Next tactic:
exact (Set.indicator_comp_of_zero (g := fun x : ℝ≥0∞ => x ^ p.toReal) h_zero).symm
theorem memℒp_indicator_iff_restrict (hs : MeasurableSet s) :
    Memℒp (s.indicator f) p μ ↔ Memℒp f p (μ.restrict s) := by
  

Proof state:
α : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
m m0 : MeasurableSpace α
p : ℝ≥0∞
q : ℝ
μ ν : Measure α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedAddCommGroup F
inst✝ : NormedAddCommGroup G
c : E
f : α → E
hf : AEStronglyMeasurable f μ
s : Set α
hs : MeasurableSet s
⊢ Memℒp (Set.indicator s f) p ↔ Memℒp f p

Next tactic:
simp [Memℒp, aestronglyMeasurable_indicator_iff hs, snorm_indicator_eq_snorm_restrict hs]
/-- If a function is supported on a finite-measure set and belongs to `ℒ^p`, then it belongs to
`ℒ^q` for any `q ≤ p`. -/
theorem Memℒp.memℒp_of_exponent_le_of_measure_support_ne_top
    {p q : ℝ≥0∞} {f : α → E} (hfq : Memℒp f q μ) {s : Set α} (hf : ∀ x, x ∉ s → f x = 0)
    (hs : μ s ≠ ∞) (hpq : p ≤ q) : Memℒp f p μ := by
  

Proof state:
α : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
m m0 : MeasurableSpace α
p✝ : ℝ≥0∞
q✝ : ℝ
μ ν : Measure α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedAddCommGroup F
inst✝ : NormedAddCommGroup G
c : E
f✝ : α → E
hf✝ : AEStronglyMeasurable f✝ μ
p q : ℝ≥0∞
f : α → E
hfq : Memℒp f q
s : Set α
hf : ∀ x ∉ s, f x = 0
hs : ↑↑μ s ≠ ⊤
hpq : p ≤ q
⊢ Memℒp f p

Next tactic:
have : (toMeasurable μ s).indicator f = f := by
    apply Set.indicator_eq_self.2
    apply Function.support_subset_iff'.2 (fun x hx ↦ hf x ?_)
    contrapose! hx
    exact subset_toMeasurable μ s hx
/-- If a function is supported on a finite-measure set and belongs to `ℒ^p`, then it belongs to
`ℒ^q` for any `q ≤ p`. -/
theorem Memℒp.memℒp_of_exponent_le_of_measure_support_ne_top
    {p q : ℝ≥0∞} {f : α → E} (hfq : Memℒp f q μ) {s : Set α} (hf : ∀ x, x ∉ s → f x = 0)
    (hs : μ s ≠ ∞) (hpq : p ≤ q) : Memℒp f p μ := by
  have : (toMeasurable μ s).indicator f = f := by
    

Proof state:
α : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
m m0 : MeasurableSpace α
p✝ : ℝ≥0∞
q✝ : ℝ
μ ν : Measure α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedAddCommGroup F
inst✝ : NormedAddCommGroup G
c : E
f✝ : α → E
hf✝ : AEStronglyMeasurable f✝ μ
p q : ℝ≥0∞
f : α → E
hfq : Memℒp f q
s : Set α
hf : ∀ x ∉ s, f x = 0
hs : ↑↑μ s ≠ ⊤
hpq : p ≤ q
⊢ Set.indicator (toMeasurable μ s) f = f

Next tactic:
apply Set.indicator_eq_self.2
/-- If a function is supported on a finite-measure set and belongs to `ℒ^p`, then it belongs to
`ℒ^q` for any `q ≤ p`. -/
theorem Memℒp.memℒp_of_exponent_le_of_measure_support_ne_top
    {p q : ℝ≥0∞} {f : α → E} (hfq : Memℒp f q μ) {s : Set α} (hf : ∀ x, x ∉ s → f x = 0)
    (hs : μ s ≠ ∞) (hpq : p ≤ q) : Memℒp f p μ := by
  have : (toMeasurable μ s).indicator f = f := by
    apply Set.indicator_eq_self.2
    

Proof state:
α : Type u_1
E : Type u_2
F : Type u_3
G : Type u_4
m m0 : MeasurableSpace α
p✝ : ℝ≥0∞
q✝ : ℝ
μ ν : Measure α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedAddCommGroup F
inst✝ : NormedAddCommGroup G
c : E
f✝ : α → E
hf✝ : AEStronglyMeasurable f✝ μ
p q : ℝ≥0∞
f : α → E
hfq : Memℒp f q
s : Set α
hf : ∀ x ∉ s, f x = 0
hs : ↑↑μ s ≠ ⊤
hpq : p ≤ q
⊢ Function.support f ⊆ toMeasurable μ s

Next tactic:
apply Function.support_subset_iff'.2 (fun x hx ↦ hf x ?_)