l3lab/ntp-mathlib huggingface dataset:
/-- The element of `lp E p` which is `a : E i` at the index `i`, and zero elsewhere. -/
protected def single (p) (i : α) (a : E i) : lp E p :=
  ⟨fun j => if h : j = i then Eq.ndrec a h.symm else 0, by
    refine' (memℓp_zero _).of_exponent_ge (zero_le p)
    refine' (Set.finite_singleton i).subset _
    intro j
    

Proof state:
α : Type u_1
E : α → Type u_2
p✝ q : ℝ≥0∞
inst✝⁴ : (i : α) → NormedAddCommGroup (E i)
𝕜 : Type u_3
inst✝³ : NormedRing 𝕜
inst✝² : (i : α) → Module 𝕜 (E i)
inst✝¹ : ∀ (i : α), BoundedSMul 𝕜 (E i)
inst✝ : DecidableEq α
p : ℝ≥0∞
i : α
a : E i
j : α
⊢ j ∈ {i_1 | (fun j => if h : j = i then (_ : i = j) ▸ a else 0) i_1 ≠ 0} → j ∈ {i}

Next tactic:
simp only [forall_exists_index, Set.mem_singleton_iff, Ne.def, dite_eq_right_iff,
      Set.mem_setOf_eq, not_forall]
/-- The element of `lp E p` which is `a : E i` at the index `i`, and zero elsewhere. -/
protected def single (p) (i : α) (a : E i) : lp E p :=
  ⟨fun j => if h : j = i then Eq.ndrec a h.symm else 0, by
    refine' (memℓp_zero _).of_exponent_ge (zero_le p)
    refine' (Set.finite_singleton i).subset _
    intro j
    simp only [forall_exists_index, Set.mem_singleton_iff, Ne.def, dite_eq_right_iff,
      Set.mem_setOf_eq, not_forall]
    

Proof state:
α : Type u_1
E : α → Type u_2
p✝ q : ℝ≥0∞
inst✝⁴ : (i : α) → NormedAddCommGroup (E i)
𝕜 : Type u_3
inst✝³ : NormedRing 𝕜
inst✝² : (i : α) → Module 𝕜 (E i)
inst✝¹ : ∀ (i : α), BoundedSMul 𝕜 (E i)
inst✝ : DecidableEq α
p : ℝ≥0∞
i : α
a : E i
j : α
⊢ ∀ (x : j = i), ¬(_ : i = j) ▸ a = 0 → j = i

Next tactic:
rintro rfl
/-- The element of `lp E p` which is `a : E i` at the index `i`, and zero elsewhere. -/
protected def single (p) (i : α) (a : E i) : lp E p :=
  ⟨fun j => if h : j = i then Eq.ndrec a h.symm else 0, by
    refine' (memℓp_zero _).of_exponent_ge (zero_le p)
    refine' (Set.finite_singleton i).subset _
    intro j
    simp only [forall_exists_index, Set.mem_singleton_iff, Ne.def, dite_eq_right_iff,
      Set.mem_setOf_eq, not_forall]
    rintro rfl
    

Proof state:
α : Type u_1
E : α → Type u_2
p✝ q : ℝ≥0∞
inst✝⁴ : (i : α) → NormedAddCommGroup (E i)
𝕜 : Type u_3
inst✝³ : NormedRing 𝕜
inst✝² : (i : α) → Module 𝕜 (E i)
inst✝¹ : ∀ (i : α), BoundedSMul 𝕜 (E i)
inst✝ : DecidableEq α
p : ℝ≥0∞
j : α
a : E j
⊢ ¬(_ : j = j) ▸ a = 0 → j = j

Next tactic:
simp
protected theorem single_apply_self (p) (i : α) (a : E i) : lp.single p i a i = a := by
  

Proof state:
α : Type u_1
E : α → Type u_2
p✝ q : ℝ≥0∞
inst✝⁴ : (i : α) → NormedAddCommGroup (E i)
𝕜 : Type u_3
inst✝³ : NormedRing 𝕜
inst✝² : (i : α) → Module 𝕜 (E i)
inst✝¹ : ∀ (i : α), BoundedSMul 𝕜 (E i)
inst✝ : DecidableEq α
p : ℝ≥0∞
i : α
a : E i
⊢ ↑(lp.single p i a) i = a

Next tactic:
rw [lp.single_apply, dif_pos rfl]
protected theorem single_apply_ne (p) (i : α) (a : E i) {j : α} (hij : j ≠ i) :
    lp.single p i a j = 0 := by
  

Proof state:
α : Type u_1
E : α → Type u_2
p✝ q : ℝ≥0∞
inst✝⁴ : (i : α) → NormedAddCommGroup (E i)
𝕜 : Type u_3
inst✝³ : NormedRing 𝕜
inst✝² : (i : α) → Module 𝕜 (E i)
inst✝¹ : ∀ (i : α), BoundedSMul 𝕜 (E i)
inst✝ : DecidableEq α
p : ℝ≥0∞
i : α
a : E i
j : α
hij : j ≠ i
⊢ ↑(lp.single p i a) j = 0

Next tactic:
rw [lp.single_apply, dif_neg hij]
@[simp]
protected theorem single_neg (p) (i : α) (a : E i) : lp.single p i (-a) = -lp.single p i a := by
  

Proof state:
α : Type u_1
E : α → Type u_2
p✝ q : ℝ≥0∞
inst✝⁴ : (i : α) → NormedAddCommGroup (E i)
𝕜 : Type u_3
inst✝³ : NormedRing 𝕜
inst✝² : (i : α) → Module 𝕜 (E i)
inst✝¹ : ∀ (i : α), BoundedSMul 𝕜 (E i)
inst✝ : DecidableEq α
p : ℝ≥0∞
i : α
a : E i
⊢ lp.single p i (-a) = -lp.single p i a

Next tactic:
refine' ext (funext (fun (j : α) => _))
@[simp]
protected theorem single_neg (p) (i : α) (a : E i) : lp.single p i (-a) = -lp.single p i a := by
  refine' ext (funext (fun (j : α) => _))
  

Proof state:
α : Type u_1
E : α → Type u_2
p✝ q : ℝ≥0∞
inst✝⁴ : (i : α) → NormedAddCommGroup (E i)
𝕜 : Type u_3
inst✝³ : NormedRing 𝕜
inst✝² : (i : α) → Module 𝕜 (E i)
inst✝¹ : ∀ (i : α), BoundedSMul 𝕜 (E i)
inst✝ : DecidableEq α
p : ℝ≥0∞
i : α
a : E i
j : α
⊢ ↑(lp.single p i (-a)) j = ↑(-lp.single p i a) j

Next tactic:
by_cases hi : j = i
@[simp]
protected theorem single_neg (p) (i : α) (a : E i) : lp.single p i (-a) = -lp.single p i a := by
  refine' ext (funext (fun (j : α) => _))
  by_cases hi : j = i
  · 

Proof state:
case pos
α : Type u_1
E : α → Type u_2
p✝ q : ℝ≥0∞
inst✝⁴ : (i : α) → NormedAddCommGroup (E i)
𝕜 : Type u_3
inst✝³ : NormedRing 𝕜
inst✝² : (i : α) → Module 𝕜 (E i)
inst✝¹ : ∀ (i : α), BoundedSMul 𝕜 (E i)
inst✝ : DecidableEq α
p : ℝ≥0∞
i : α
a : E i
j : α
hi : j = i
⊢ ↑(lp.single p i (-a)) j = ↑(-lp.single p i a) j

Next tactic:
subst hi
@[simp]
protected theorem single_neg (p) (i : α) (a : E i) : lp.single p i (-a) = -lp.single p i a := by
  refine' ext (funext (fun (j : α) => _))
  by_cases hi : j = i
  · subst hi
    

Proof state:
case pos
α : Type u_1
E : α → Type u_2
p✝ q : ℝ≥0∞
inst✝⁴ : (i : α) → NormedAddCommGroup (E i)
𝕜 : Type u_3
inst✝³ : NormedRing 𝕜
inst✝² : (i : α) → Module 𝕜 (E i)
inst✝¹ : ∀ (i : α), BoundedSMul 𝕜 (E i)
inst✝ : DecidableEq α
p : ℝ≥0∞
j : α
a : E j
⊢ ↑(lp.single p j (-a)) j = ↑(-lp.single p j a) j

Next tactic:
simp [lp.single_apply_self]
@[simp]
protected theorem single_neg (p) (i : α) (a : E i) : lp.single p i (-a) = -lp.single p i a := by
  refine' ext (funext (fun (j : α) => _))
  by_cases hi : j = i
  · subst hi
    simp [lp.single_apply_self]
  · 

Proof state:
case neg
α : Type u_1
E : α → Type u_2
p✝ q : ℝ≥0∞
inst✝⁴ : (i : α) → NormedAddCommGroup (E i)
𝕜 : Type u_3
inst✝³ : NormedRing 𝕜
inst✝² : (i : α) → Module 𝕜 (E i)
inst✝¹ : ∀ (i : α), BoundedSMul 𝕜 (E i)
inst✝ : DecidableEq α
p : ℝ≥0∞
i : α
a : E i
j : α
hi : ¬j = i
⊢ ↑(lp.single p i (-a)) j = ↑(-lp.single p i a) j

Next tactic:
simp [lp.single_apply_ne p i _ hi]
@[simp]
protected theorem single_smul (p) (i : α) (a : E i) (c : 𝕜) :
    lp.single p i (c • a) = c • lp.single p i a := by
  

Proof state:
α : Type u_1
E : α → Type u_2
p✝ q : ℝ≥0∞
inst✝⁴ : (i : α) → NormedAddCommGroup (E i)
𝕜 : Type u_3
inst✝³ : NormedRing 𝕜
inst✝² : (i : α) → Module 𝕜 (E i)
inst✝¹ : ∀ (i : α), BoundedSMul 𝕜 (E i)
inst✝ : DecidableEq α
p : ℝ≥0∞
i : α
a : E i
c : 𝕜
⊢ lp.single p i (c • a) = c • lp.single p i a

Next tactic:
refine' ext (funext (fun (j : α) => _))
@[simp]
protected theorem single_smul (p) (i : α) (a : E i) (c : 𝕜) :
    lp.single p i (c • a) = c • lp.single p i a := by
  refine' ext (funext (fun (j : α) => _))
  

Proof state:
α : Type u_1
E : α → Type u_2
p✝ q : ℝ≥0∞
inst✝⁴ : (i : α) → NormedAddCommGroup (E i)
𝕜 : Type u_3
inst✝³ : NormedRing 𝕜
inst✝² : (i : α) → Module 𝕜 (E i)
inst✝¹ : ∀ (i : α), BoundedSMul 𝕜 (E i)
inst✝ : DecidableEq α
p : ℝ≥0∞
i : α
a : E i
c : 𝕜
j : α
⊢ ↑(lp.single p i (c • a)) j = ↑(c • lp.single p i a) j

Next tactic:
by_cases hi : j = i
@[simp]
protected theorem single_smul (p) (i : α) (a : E i) (c : 𝕜) :
    lp.single p i (c • a) = c • lp.single p i a := by
  refine' ext (funext (fun (j : α) => _))
  by_cases hi : j = i
  · 

Proof state:
case pos
α : Type u_1
E : α → Type u_2
p✝ q : ℝ≥0∞
inst✝⁴ : (i : α) → NormedAddCommGroup (E i)
𝕜 : Type u_3
inst✝³ : NormedRing 𝕜
inst✝² : (i : α) → Module 𝕜 (E i)
inst✝¹ : ∀ (i : α), BoundedSMul 𝕜 (E i)
inst✝ : DecidableEq α
p : ℝ≥0∞
i : α
a : E i
c : 𝕜
j : α
hi : j = i
⊢ ↑(lp.single p i (c • a)) j = ↑(c • lp.single p i a) j

Next tactic:
subst hi
@[simp]
protected theorem single_smul (p) (i : α) (a : E i) (c : 𝕜) :
    lp.single p i (c • a) = c • lp.single p i a := by
  refine' ext (funext (fun (j : α) => _))
  by_cases hi : j = i
  · subst hi
    

Proof state:
case pos
α : Type u_1
E : α → Type u_2
p✝ q : ℝ≥0∞
inst✝⁴ : (i : α) → NormedAddCommGroup (E i)
𝕜 : Type u_3
inst✝³ : NormedRing 𝕜
inst✝² : (i : α) → Module 𝕜 (E i)
inst✝¹ : ∀ (i : α), BoundedSMul 𝕜 (E i)
inst✝ : DecidableEq α
p : ℝ≥0∞
c : 𝕜
j : α
a : E j
⊢ ↑(lp.single p j (c • a)) j = ↑(c • lp.single p j a) j

Next tactic:
dsimp
@[simp]
protected theorem single_smul (p) (i : α) (a : E i) (c : 𝕜) :
    lp.single p i (c • a) = c • lp.single p i a := by
  refine' ext (funext (fun (j : α) => _))
  by_cases hi : j = i
  · subst hi
    dsimp
    

Proof state:
case pos
α : Type u_1
E : α → Type u_2
p✝ q : ℝ≥0∞
inst✝⁴ : (i : α) → NormedAddCommGroup (E i)
𝕜 : Type u_3
inst✝³ : NormedRing 𝕜
inst✝² : (i : α) → Module 𝕜 (E i)
inst✝¹ : ∀ (i : α), BoundedSMul 𝕜 (E i)
inst✝ : DecidableEq α
p : ℝ≥0∞
c : 𝕜
j : α
a : E j
⊢ ↑(lp.single p j (c • a)) j = c • ↑(lp.single p j a) j

Next tactic:
simp [lp.single_apply_self]
@[simp]
protected theorem single_smul (p) (i : α) (a : E i) (c : 𝕜) :
    lp.single p i (c • a) = c • lp.single p i a := by
  refine' ext (funext (fun (j : α) => _))
  by_cases hi : j = i
  · subst hi
    dsimp
    simp [lp.single_apply_self]
  · 

Proof state:
case neg
α : Type u_1
E : α → Type u_2
p✝ q : ℝ≥0∞
inst✝⁴ : (i : α) → NormedAddCommGroup (E i)
𝕜 : Type u_3
inst✝³ : NormedRing 𝕜
inst✝² : (i : α) → Module 𝕜 (E i)
inst✝¹ : ∀ (i : α), BoundedSMul 𝕜 (E i)
inst✝ : DecidableEq α
p : ℝ≥0∞
i : α
a : E i
c : 𝕜
j : α
hi : ¬j = i
⊢ ↑(lp.single p i (c • a)) j = ↑(c • lp.single p i a) j

Next tactic:
dsimp
@[simp]
protected theorem single_smul (p) (i : α) (a : E i) (c : 𝕜) :
    lp.single p i (c • a) = c • lp.single p i a := by
  refine' ext (funext (fun (j : α) => _))
  by_cases hi : j = i
  · subst hi
    dsimp
    simp [lp.single_apply_self]
  · dsimp
    

Proof state:
case neg
α : Type u_1
E : α → Type u_2
p✝ q : ℝ≥0∞
inst✝⁴ : (i : α) → NormedAddCommGroup (E i)
𝕜 : Type u_3
inst✝³ : NormedRing 𝕜
inst✝² : (i : α) → Module 𝕜 (E i)
inst✝¹ : ∀ (i : α), BoundedSMul 𝕜 (E i)
inst✝ : DecidableEq α
p : ℝ≥0∞
i : α
a : E i
c : 𝕜
j : α
hi : ¬j = i
⊢ ↑(lp.single p i (c • a)) j = c • ↑(lp.single p i a) j

Next tactic:
simp [lp.single_apply_ne p i _ hi]
protected theorem norm_sum_single (hp : 0 < p.toReal) (f : ∀ i, E i) (s : Finset α) :
    ‖∑ i in s, lp.single p i (f i)‖ ^ p.toReal = ∑ i in s, ‖f i‖ ^ p.toReal := by
  

Proof state:
α : Type u_1
E : α → Type u_2
p q : ℝ≥0∞
inst✝⁴ : (i : α) → NormedAddCommGroup (E i)
𝕜 : Type u_3
inst✝³ : NormedRing 𝕜
inst✝² : (i : α) → Module 𝕜 (E i)
inst✝¹ : ∀ (i : α), BoundedSMul 𝕜 (E i)
inst✝ : DecidableEq α
hp : 0 < ENNReal.toReal p
f : (i : α) → E i
s : Finset α
⊢ ‖∑ i in s, lp.single p i (f i)‖ ^ ENNReal.toReal p = ∑ i in s, ‖f i‖ ^ ENNReal.toReal p

Next tactic:
refine' (hasSum_norm hp (∑ i in s, lp.single p i (f i))).unique _
protected theorem norm_sum_single (hp : 0 < p.toReal) (f : ∀ i, E i) (s : Finset α) :
    ‖∑ i in s, lp.single p i (f i)‖ ^ p.toReal = ∑ i in s, ‖f i‖ ^ p.toReal := by
  refine' (hasSum_norm hp (∑ i in s, lp.single p i (f i))).unique _
  

Proof state:
α : Type u_1
E : α → Type u_2
p q : ℝ≥0∞
inst✝⁴ : (i : α) → NormedAddCommGroup (E i)
𝕜 : Type u_3
inst✝³ : NormedRing 𝕜
inst✝² : (i : α) → Module 𝕜 (E i)
inst✝¹ : ∀ (i : α), BoundedSMul 𝕜 (E i)
inst✝ : DecidableEq α
hp : 0 < ENNReal.toReal p
f : (i : α) → E i
s : Finset α
⊢ HasSum (fun i => ‖↑(∑ i in s, lp.single p i (f i)) i‖ ^ ENNReal.toReal p) (∑ i in s, ‖f i‖ ^ ENNReal.toReal p)

Next tactic:
simp only [lp.single_apply, coeFn_sum, Finset.sum_apply, Finset.sum_dite_eq]
protected theorem norm_sum_single (hp : 0 < p.toReal) (f : ∀ i, E i) (s : Finset α) :
    ‖∑ i in s, lp.single p i (f i)‖ ^ p.toReal = ∑ i in s, ‖f i‖ ^ p.toReal := by
  refine' (hasSum_norm hp (∑ i in s, lp.single p i (f i))).unique _
  simp only [lp.single_apply, coeFn_sum, Finset.sum_apply, Finset.sum_dite_eq]
  

Proof state:
α : Type u_1
E : α → Type u_2
p q : ℝ≥0∞
inst✝⁴ : (i : α) → NormedAddCommGroup (E i)
𝕜 : Type u_3
inst✝³ : NormedRing 𝕜
inst✝² : (i : α) → Module 𝕜 (E i)
inst✝¹ : ∀ (i : α), BoundedSMul 𝕜 (E i)
inst✝ : DecidableEq α
hp : 0 < ENNReal.toReal p
f : (i : α) → E i
s : Finset α
⊢ HasSum (fun i => ‖if i ∈ s then f i else 0‖ ^ ENNReal.toReal p) (∑ i in s, ‖f i‖ ^ ENNReal.toReal p)

Next tactic:
have h : ∀ (i) (_ : i ∉ s), ‖ite (i ∈ s) (f i) 0‖ ^ p.toReal = 0 := by
    intro i hi
    simp [if_neg hi, Real.zero_rpow hp.ne']
protected theorem norm_sum_single (hp : 0 < p.toReal) (f : ∀ i, E i) (s : Finset α) :
    ‖∑ i in s, lp.single p i (f i)‖ ^ p.toReal = ∑ i in s, ‖f i‖ ^ p.toReal := by
  refine' (hasSum_norm hp (∑ i in s, lp.single p i (f i))).unique _
  simp only [lp.single_apply, coeFn_sum, Finset.sum_apply, Finset.sum_dite_eq]
  have h : ∀ (i) (_ : i ∉ s), ‖ite (i ∈ s) (f i) 0‖ ^ p.toReal = 0 := by
    

Proof state:
α : Type u_1
E : α → Type u_2
p q : ℝ≥0∞
inst✝⁴ : (i : α) → NormedAddCommGroup (E i)
𝕜 : Type u_3
inst✝³ : NormedRing 𝕜
inst✝² : (i : α) → Module 𝕜 (E i)
inst✝¹ : ∀ (i : α), BoundedSMul 𝕜 (E i)
inst✝ : DecidableEq α
hp : 0 < ENNReal.toReal p
f : (i : α) → E i
s : Finset α
⊢ ∀ i ∉ s, ‖if i ∈ s then f i else 0‖ ^ ENNReal.toReal p = 0

Next tactic:
intro i hi
protected theorem norm_sum_single (hp : 0 < p.toReal) (f : ∀ i, E i) (s : Finset α) :
    ‖∑ i in s, lp.single p i (f i)‖ ^ p.toReal = ∑ i in s, ‖f i‖ ^ p.toReal := by
  refine' (hasSum_norm hp (∑ i in s, lp.single p i (f i))).unique _
  simp only [lp.single_apply, coeFn_sum, Finset.sum_apply, Finset.sum_dite_eq]
  have h : ∀ (i) (_ : i ∉ s), ‖ite (i ∈ s) (f i) 0‖ ^ p.toReal = 0 := by
    intro i hi
    

Proof state:
α : Type u_1
E : α → Type u_2
p q : ℝ≥0∞
inst✝⁴ : (i : α) → NormedAddCommGroup (E i)
𝕜 : Type u_3
inst✝³ : NormedRing 𝕜
inst✝² : (i : α) → Module 𝕜 (E i)
inst✝¹ : ∀ (i : α), BoundedSMul 𝕜 (E i)
inst✝ : DecidableEq α
hp : 0 < ENNReal.toReal p
f : (i : α) → E i
s : Finset α
i : α
hi : i ∉ s
⊢ ‖if i ∈ s then f i else 0‖ ^ ENNReal.toReal p = 0

Next tactic:
simp [if_neg hi, Real.zero_rpow hp.ne']
protected theorem norm_sum_single (hp : 0 < p.toReal) (f : ∀ i, E i) (s : Finset α) :
    ‖∑ i in s, lp.single p i (f i)‖ ^ p.toReal = ∑ i in s, ‖f i‖ ^ p.toReal := by
  refine' (hasSum_norm hp (∑ i in s, lp.single p i (f i))).unique _
  simp only [lp.single_apply, coeFn_sum, Finset.sum_apply, Finset.sum_dite_eq]
  have h : ∀ (i) (_ : i ∉ s), ‖ite (i ∈ s) (f i) 0‖ ^ p.toReal = 0 := by
    intro i hi
    simp [if_neg hi, Real.zero_rpow hp.ne']
  

Proof state:
α : Type u_1
E : α → Type u_2
p q : ℝ≥0∞
inst✝⁴ : (i : α) → NormedAddCommGroup (E i)
𝕜 : Type u_3
inst✝³ : NormedRing 𝕜
inst✝² : (i : α) → Module 𝕜 (E i)
inst✝¹ : ∀ (i : α), BoundedSMul 𝕜 (E i)
inst✝ : DecidableEq α
hp : 0 < ENNReal.toReal p
f : (i : α) → E i
s : Finset α
h : ∀ i ∉ s, ‖if i ∈ s then f i else 0‖ ^ ENNReal.toReal p = 0
⊢ HasSum (fun i => ‖if i ∈ s then f i else 0‖ ^ ENNReal.toReal p) (∑ i in s, ‖f i‖ ^ ENNReal.toReal p)

Next tactic:
have h' : ∀ i ∈ s, ‖f i‖ ^ p.toReal = ‖ite (i ∈ s) (f i) 0‖ ^ p.toReal := by
    intro i hi
    rw [if_pos hi]
protected theorem norm_sum_single (hp : 0 < p.toReal) (f : ∀ i, E i) (s : Finset α) :
    ‖∑ i in s, lp.single p i (f i)‖ ^ p.toReal = ∑ i in s, ‖f i‖ ^ p.toReal := by
  refine' (hasSum_norm hp (∑ i in s, lp.single p i (f i))).unique _
  simp only [lp.single_apply, coeFn_sum, Finset.sum_apply, Finset.sum_dite_eq]
  have h : ∀ (i) (_ : i ∉ s), ‖ite (i ∈ s) (f i) 0‖ ^ p.toReal = 0 := by
    intro i hi
    simp [if_neg hi, Real.zero_rpow hp.ne']
  have h' : ∀ i ∈ s, ‖f i‖ ^ p.toReal = ‖ite (i ∈ s) (f i) 0‖ ^ p.toReal := by
    

Proof state:
α : Type u_1
E : α → Type u_2
p q : ℝ≥0∞
inst✝⁴ : (i : α) → NormedAddCommGroup (E i)
𝕜 : Type u_3
inst✝³ : NormedRing 𝕜
inst✝² : (i : α) → Module 𝕜 (E i)
inst✝¹ : ∀ (i : α), BoundedSMul 𝕜 (E i)
inst✝ : DecidableEq α
hp : 0 < ENNReal.toReal p
f : (i : α) → E i
s : Finset α
h : ∀ i ∉ s, ‖if i ∈ s then f i else 0‖ ^ ENNReal.toReal p = 0
⊢ ∀ i ∈ s, ‖f i‖ ^ ENNReal.toReal p = ‖if i ∈ s then f i else 0‖ ^ ENNReal.toReal p

Next tactic:
intro i hi
protected theorem norm_sum_single (hp : 0 < p.toReal) (f : ∀ i, E i) (s : Finset α) :
    ‖∑ i in s, lp.single p i (f i)‖ ^ p.toReal = ∑ i in s, ‖f i‖ ^ p.toReal := by
  refine' (hasSum_norm hp (∑ i in s, lp.single p i (f i))).unique _
  simp only [lp.single_apply, coeFn_sum, Finset.sum_apply, Finset.sum_dite_eq]
  have h : ∀ (i) (_ : i ∉ s), ‖ite (i ∈ s) (f i) 0‖ ^ p.toReal = 0 := by
    intro i hi
    simp [if_neg hi, Real.zero_rpow hp.ne']
  have h' : ∀ i ∈ s, ‖f i‖ ^ p.toReal = ‖ite (i ∈ s) (f i) 0‖ ^ p.toReal := by
    intro i hi
    

Proof state:
α : Type u_1
E : α → Type u_2
p q : ℝ≥0∞
inst✝⁴ : (i : α) → NormedAddCommGroup (E i)
𝕜 : Type u_3
inst✝³ : NormedRing 𝕜
inst✝² : (i : α) → Module 𝕜 (E i)
inst✝¹ : ∀ (i : α), BoundedSMul 𝕜 (E i)
inst✝ : DecidableEq α
hp : 0 < ENNReal.toReal p
f : (i : α) → E i
s : Finset α
h : ∀ i ∉ s, ‖if i ∈ s then f i else 0‖ ^ ENNReal.toReal p = 0
i : α
hi : i ∈ s
⊢ ‖f i‖ ^ ENNReal.toReal p = ‖if i ∈ s then f i else 0‖ ^ ENNReal.toReal p

Next tactic:
rw [if_pos hi]
protected theorem norm_sum_single (hp : 0 < p.toReal) (f : ∀ i, E i) (s : Finset α) :
    ‖∑ i in s, lp.single p i (f i)‖ ^ p.toReal = ∑ i in s, ‖f i‖ ^ p.toReal := by
  refine' (hasSum_norm hp (∑ i in s, lp.single p i (f i))).unique _
  simp only [lp.single_apply, coeFn_sum, Finset.sum_apply, Finset.sum_dite_eq]
  have h : ∀ (i) (_ : i ∉ s), ‖ite (i ∈ s) (f i) 0‖ ^ p.toReal = 0 := by
    intro i hi
    simp [if_neg hi, Real.zero_rpow hp.ne']
  have h' : ∀ i ∈ s, ‖f i‖ ^ p.toReal = ‖ite (i ∈ s) (f i) 0‖ ^ p.toReal := by
    intro i hi
    rw [if_pos hi]
  

Proof state:
α : Type u_1
E : α → Type u_2
p q : ℝ≥0∞
inst✝⁴ : (i : α) → NormedAddCommGroup (E i)
𝕜 : Type u_3
inst✝³ : NormedRing 𝕜
inst✝² : (i : α) → Module 𝕜 (E i)
inst✝¹ : ∀ (i : α), BoundedSMul 𝕜 (E i)
inst✝ : DecidableEq α
hp : 0 < ENNReal.toReal p
f : (i : α) → E i
s : Finset α
h : ∀ i ∉ s, ‖if i ∈ s then f i else 0‖ ^ ENNReal.toReal p = 0
h' : ∀ i ∈ s, ‖f i‖ ^ ENNReal.toReal p = ‖if i ∈ s then f i else 0‖ ^ ENNReal.toReal p
⊢ HasSum (fun i => ‖if i ∈ s then f i else 0‖ ^ ENNReal.toReal p) (∑ i in s, ‖f i‖ ^ ENNReal.toReal p)

Next tactic:
simpa [Finset.sum_congr rfl h'] using hasSum_sum_of_ne_finset_zero h
protected theorem norm_single (hp : 0 < p.toReal) (f : ∀ i, E i) (i : α) :
    ‖lp.single p i (f i)‖ = ‖f i‖ := by
  

Proof state:
α : Type u_1
E : α → Type u_2
p q : ℝ≥0∞
inst✝⁴ : (i : α) → NormedAddCommGroup (E i)
𝕜 : Type u_3
inst✝³ : NormedRing 𝕜
inst✝² : (i : α) → Module 𝕜 (E i)
inst✝¹ : ∀ (i : α), BoundedSMul 𝕜 (E i)
inst✝ : DecidableEq α
hp : 0 < ENNReal.toReal p
f : (i : α) → E i
i : α
⊢ ‖lp.single p i (f i)‖ = ‖f i‖

Next tactic:
refine' Real.rpow_left_injOn hp.ne' (norm_nonneg' _) (norm_nonneg _) _
protected theorem norm_single (hp : 0 < p.toReal) (f : ∀ i, E i) (i : α) :
    ‖lp.single p i (f i)‖ = ‖f i‖ := by
  refine' Real.rpow_left_injOn hp.ne' (norm_nonneg' _) (norm_nonneg _) _
  

Proof state:
α : Type u_1
E : α → Type u_2
p q : ℝ≥0∞
inst✝⁴ : (i : α) → NormedAddCommGroup (E i)
𝕜 : Type u_3
inst✝³ : NormedRing 𝕜
inst✝² : (i : α) → Module 𝕜 (E i)
inst✝¹ : ∀ (i : α), BoundedSMul 𝕜 (E i)
inst✝ : DecidableEq α
hp : 0 < ENNReal.toReal p
f : (i : α) → E i
i : α
⊢ (fun y => y ^ ENNReal.toReal p) ‖lp.single p i (f i)‖ = (fun y => y ^ ENNReal.toReal p) ‖f i‖

Next tactic:
simpa using lp.norm_sum_single hp f {i}
protected theorem norm_sub_norm_compl_sub_single (hp : 0 < p.toReal) (f : lp E p) (s : Finset α) :
    ‖f‖ ^ p.toReal - ‖f - ∑ i in s, lp.single p i (f i)‖ ^ p.toReal =
      ∑ i in s, ‖f i‖ ^ p.toReal := by
  

Proof state:
α : Type u_1
E : α → Type u_2
p q : ℝ≥0∞
inst✝⁴ : (i : α) → NormedAddCommGroup (E i)
𝕜 : Type u_3
inst✝³ : NormedRing 𝕜
inst✝² : (i : α) → Module 𝕜 (E i)
inst✝¹ : ∀ (i : α), BoundedSMul 𝕜 (E i)
inst✝ : DecidableEq α
hp : 0 < ENNReal.toReal p
f : ↥(lp E p)
s : Finset α
⊢ ‖f‖ ^ ENNReal.toReal p - ‖f - ∑ i in s, lp.single p i (↑f i)‖ ^ ENNReal.toReal p = ∑ i in s, ‖↑f i‖ ^ ENNReal.toReal p

Next tactic:
refine' ((hasSum_norm hp f).sub (hasSum_norm hp (f - ∑ i in s, lp.single p i (f i)))).unique _
protected theorem norm_sub_norm_compl_sub_single (hp : 0 < p.toReal) (f : lp E p) (s : Finset α) :
    ‖f‖ ^ p.toReal - ‖f - ∑ i in s, lp.single p i (f i)‖ ^ p.toReal =
      ∑ i in s, ‖f i‖ ^ p.toReal := by
  refine' ((hasSum_norm hp f).sub (hasSum_norm hp (f - ∑ i in s, lp.single p i (f i)))).unique _
  

Proof state:
α : Type u_1
E : α → Type u_2
p q : ℝ≥0∞
inst✝⁴ : (i : α) → NormedAddCommGroup (E i)
𝕜 : Type u_3
inst✝³ : NormedRing 𝕜
inst✝² : (i : α) → Module 𝕜 (E i)
inst✝¹ : ∀ (i : α), BoundedSMul 𝕜 (E i)
inst✝ : DecidableEq α
hp : 0 < ENNReal.toReal p
f : ↥(lp E p)
s : Finset α
⊢ HasSum (fun b => ‖↑f b‖ ^ ENNReal.toReal p - ‖↑(f - ∑ i in s, lp.single p i (↑f i)) b‖ ^ ENNReal.toReal p)
    (∑ i in s, ‖↑f i‖ ^ ENNReal.toReal p)

Next tactic:
let F : α → ℝ := fun i => ‖f i‖ ^ p.toReal - ‖(f - ∑ i in s, lp.single p i (f i)) i‖ ^ p.toReal
protected theorem norm_sub_norm_compl_sub_single (hp : 0 < p.toReal) (f : lp E p) (s : Finset α) :
    ‖f‖ ^ p.toReal - ‖f - ∑ i in s, lp.single p i (f i)‖ ^ p.toReal =
      ∑ i in s, ‖f i‖ ^ p.toReal := by
  refine' ((hasSum_norm hp f).sub (hasSum_norm hp (f - ∑ i in s, lp.single p i (f i)))).unique _
  let F : α → ℝ := fun i => ‖f i‖ ^ p.toReal - ‖(f - ∑ i in s, lp.single p i (f i)) i‖ ^ p.toReal
  

Proof state:
α : Type u_1
E : α → Type u_2
p q : ℝ≥0∞
inst✝⁴ : (i : α) → NormedAddCommGroup (E i)
𝕜 : Type u_3
inst✝³ : NormedRing 𝕜
inst✝² : (i : α) → Module 𝕜 (E i)
inst✝¹ : ∀ (i : α), BoundedSMul 𝕜 (E i)
inst✝ : DecidableEq α
hp : 0 < ENNReal.toReal p
f : ↥(lp E p)
s : Finset α
F : α → ℝ := fun i => ‖↑f i‖ ^ ENNReal.toReal p - ‖↑(f - ∑ i in s, lp.single p i (↑f i)) i‖ ^ ENNReal.toReal p
⊢ HasSum (fun b => ‖↑f b‖ ^ ENNReal.toReal p - ‖↑(f - ∑ i in s, lp.single p i (↑f i)) b‖ ^ ENNReal.toReal p)
    (∑ i in s, ‖↑f i‖ ^ ENNReal.toReal p)

Next tactic:
have hF : ∀ i ∉ s, F i = 0 := by
    intro i hi
    suffices ‖f i‖ ^ p.toReal - ‖f i - ite (i ∈ s) (f i) 0‖ ^ p.toReal = 0 by
      simpa only [coeFn_sum, lp.single_apply, coeFn_sub, Pi.sub_apply, Finset.sum_apply,
        Finset.sum_dite_eq] using this
    simp only [if_neg hi, sub_zero, sub_self]
protected theorem norm_sub_norm_compl_sub_single (hp : 0 < p.toReal) (f : lp E p) (s : Finset α) :
    ‖f‖ ^ p.toReal - ‖f - ∑ i in s, lp.single p i (f i)‖ ^ p.toReal =
      ∑ i in s, ‖f i‖ ^ p.toReal := by
  refine' ((hasSum_norm hp f).sub (hasSum_norm hp (f - ∑ i in s, lp.single p i (f i)))).unique _
  let F : α → ℝ := fun i => ‖f i‖ ^ p.toReal - ‖(f - ∑ i in s, lp.single p i (f i)) i‖ ^ p.toReal
  have hF : ∀ i ∉ s, F i = 0 := by
    

Proof state:
α : Type u_1
E : α → Type u_2
p q : ℝ≥0∞
inst✝⁴ : (i : α) → NormedAddCommGroup (E i)
𝕜 : Type u_3
inst✝³ : NormedRing 𝕜
inst✝² : (i : α) → Module 𝕜 (E i)
inst✝¹ : ∀ (i : α), BoundedSMul 𝕜 (E i)
inst✝ : DecidableEq α
hp : 0 < ENNReal.toReal p
f : ↥(lp E p)
s : Finset α
F : α → ℝ := fun i => ‖↑f i‖ ^ ENNReal.toReal p - ‖↑(f - ∑ i in s, lp.single p i (↑f i)) i‖ ^ ENNReal.toReal p
⊢ ∀ i ∉ s, F i = 0

Next tactic:
intro i hi
protected theorem norm_sub_norm_compl_sub_single (hp : 0 < p.toReal) (f : lp E p) (s : Finset α) :
    ‖f‖ ^ p.toReal - ‖f - ∑ i in s, lp.single p i (f i)‖ ^ p.toReal =
      ∑ i in s, ‖f i‖ ^ p.toReal := by
  refine' ((hasSum_norm hp f).sub (hasSum_norm hp (f - ∑ i in s, lp.single p i (f i)))).unique _
  let F : α → ℝ := fun i => ‖f i‖ ^ p.toReal - ‖(f - ∑ i in s, lp.single p i (f i)) i‖ ^ p.toReal
  have hF : ∀ i ∉ s, F i = 0 := by
    intro i hi
    

Proof state:
α : Type u_1
E : α → Type u_2
p q : ℝ≥0∞
inst✝⁴ : (i : α) → NormedAddCommGroup (E i)
𝕜 : Type u_3
inst✝³ : NormedRing 𝕜
inst✝² : (i : α) → Module 𝕜 (E i)
inst✝¹ : ∀ (i : α), BoundedSMul 𝕜 (E i)
inst✝ : DecidableEq α
hp : 0 < ENNReal.toReal p
f : ↥(lp E p)
s : Finset α
F : α → ℝ := fun i => ‖↑f i‖ ^ ENNReal.toReal p - ‖↑(f - ∑ i in s, lp.single p i (↑f i)) i‖ ^ ENNReal.toReal p
i : α
hi : i ∉ s
⊢ F i = 0

Next tactic:
suffices ‖f i‖ ^ p.toReal - ‖f i - ite (i ∈ s) (f i) 0‖ ^ p.toReal = 0 by
      simpa only [coeFn_sum, lp.single_apply, coeFn_sub, Pi.sub_apply, Finset.sum_apply,
        Finset.sum_dite_eq] using this