Theorem: ENNReal.Lp_add_le
File: Mathlib/Analysis/MeanInequalities.lean

tactic: by_cases H' : (∑ i in s, f i ^ p) ^ (1 / p) = ⊤ ∨ (∑ i in s, g i ^ p) ^ (1 / p) = ⊤
state_before: ι : Type u
s : Finset ι
f g : ι → ℝ≥0∞
p q : ℝ
hp : 1 ≤ p
⊢ (∑ i in s, (f i + g i) ^ p) ^ (1 / p) ≤ (∑ i in s, f i ^ p) ^ (1 / p) + (∑ i in s, g i ^ p) ^ (1 / p)

tactic: have pos : 0 < p := lt_of_lt_of_le zero_lt_one hp
state_before: case neg
ι : Type u
s : Finset ι
f g : ι → ℝ≥0∞
p q : ℝ
hp : 1 ≤ p
H' : ¬((∑ i in s, f i ^ p) ^ (1 / p) = ⊤ ∨ (∑ i in s, g i ^ p) ^ (1 / p) = ⊤)
⊢ (∑ i in s, (f i + g i) ^ p) ^ (1 / p) ≤ (∑ i in s, f i ^ p) ^ (1 / p) + (∑ i in s, g i ^ p) ^ (1 / p)

tactic: replace H' : (∀ i ∈ s, f i ≠ ⊤) ∧ ∀ i ∈ s, g i ≠ ⊤
state_before: case neg
ι : Type u
s : Finset ι
f g : ι → ℝ≥0∞
p q : ℝ
hp : 1 ≤ p
H' : ¬((∑ i in s, f i ^ p) ^ (1 / p) = ⊤ ∨ (∑ i in s, g i ^ p) ^ (1 / p) = ⊤)
pos : 0 < p
⊢ (∑ i in s, (f i + g i) ^ p) ^ (1 / p) ≤ (∑ i in s, f i ^ p) ^ (1 / p) + (∑ i in s, g i ^ p) ^ (1 / p)

tactic: have :=
  ENNReal.coe_le_coe.2
    (@NNReal.Lp_add_le _ s (fun i => ENNReal.toNNReal (f i)) (fun i => ENNReal.toNNReal (g i)) _
      hp)
state_before: case neg
ι : Type u
s : Finset ι
f g : ι → ℝ≥0∞
p q : ℝ
hp : 1 ≤ p
pos : 0 < p
H' : (∀ (i : ι), i ∈ s → f i ≠ ⊤) ∧ ∀ (i : ι), i ∈ s → g i ≠ ⊤
⊢ (∑ i in s, (f i + g i) ^ p) ^ (1 / p) ≤ (∑ i in s, f i ^ p) ^ (1 / p) + (∑ i in s, g i ^ p) ^ (1 / p)

tactic: push_cast [← ENNReal.coe_rpow_of_nonneg, le_of_lt pos, le_of_lt (one_div_pos.2 pos)] at this
state_before: case neg
ι : Type u
s : Finset ι
f g : ι → ℝ≥0∞
p q : ℝ
hp : 1 ≤ p
pos : 0 < p
H' : (∀ (i : ι), i ∈ s → f i ≠ ⊤) ∧ ∀ (i : ι), i ∈ s → g i ≠ ⊤
this :
  ↑((∑ i in s, ((fun i => ENNReal.toNNReal (f i)) i + (fun i => ENNReal.toNNReal (g i)) i) ^ p) ^ (1 / p)) ≤
    ↑((∑ i in s, (fun i => ENNReal.toNNReal (f i)) i ^ p) ^ (1 / p) +
        (∑ i in s, (fun i => ENNReal.toNNReal (g i)) i ^ p) ^ (1 / p))
⊢ (∑ i in s, (f i + g i) ^ p) ^ (1 / p) ≤ (∑ i in s, f i ^ p) ^ (1 / p) + (∑ i in s, g i ^ p) ^ (1 / p)

tactic: cases' H' with H' H' <;> simp [H', -one_div]
state_before: case pos
ι : Type u
s : Finset ι
f g : ι → ℝ≥0∞
p q : ℝ
hp : 1 ≤ p
H' : (∑ i in s, f i ^ p) ^ (1 / p) = ⊤ ∨ (∑ i in s, g i ^ p) ^ (1 / p) = ⊤
⊢ (∑ i in s, (f i + g i) ^ p) ^ (1 / p) ≤ (∑ i in s, f i ^ p) ^ (1 / p) + (∑ i in s, g i ^ p) ^ (1 / p)

tactic: simpa [ENNReal.rpow_eq_top_iff, asymm pos, pos, ENNReal.sum_eq_top_iff, not_or] using H'
state_before: case H'
ι : Type u
s : Finset ι
f g : ι → ℝ≥0∞
p q : ℝ
hp : 1 ≤ p
H' : ¬((∑ i in s, f i ^ p) ^ (1 / p) = ⊤ ∨ (∑ i in s, g i ^ p) ^ (1 / p) = ⊤)
pos : 0 < p
⊢ (∀ (i : ι), i ∈ s → f i ≠ ⊤) ∧ ∀ (i : ι), i ∈ s → g i ≠ ⊤

tactic: refine Finset.sum_congr rfl fun i hi => ?_
state_before: case h.e'_4.h.e'_6.e_a
ι : Type u
s : Finset ι
f g : ι → ℝ≥0∞
p q : ℝ
hp : 1 ≤ p
pos : 0 < p
H' : (∀ (i : ι), i ∈ s → f i ≠ ⊤) ∧ ∀ (i : ι), i ∈ s → g i ≠ ⊤
this :
  (∑ x in s, (↑(ENNReal.toNNReal (f x)) + ↑(ENNReal.toNNReal (g x))) ^ p) ^ (1 / p) ≤
    (∑ x in s, ↑(ENNReal.toNNReal (f x)) ^ p) ^ (1 / p) + (∑ x in s, ↑(ENNReal.toNNReal (g x)) ^ p) ^ (1 / p)
⊢ ∑ i in s, g i ^ p = ∑ x in s, ↑(ENNReal.toNNReal (g x)) ^ p

tactic: simp [H'.1 i hi, H'.2 i hi]
state_before: case h.e'_4.h.e'_6.e_a
ι : Type u
s : Finset ι
f g : ι → ℝ≥0∞
p q : ℝ
hp : 1 ≤ p
pos : 0 < p
H' : (∀ (i : ι), i ∈ s → f i ≠ ⊤) ∧ ∀ (i : ι), i ∈ s → g i ≠ ⊤
this :
  (∑ x in s, (↑(ENNReal.toNNReal (f x)) + ↑(ENNReal.toNNReal (g x))) ^ p) ^ (1 / p) ≤
    (∑ x in s, ↑(ENNReal.toNNReal (f x)) ^ p) ^ (1 / p) + (∑ x in s, ↑(ENNReal.toNNReal (g x)) ^ p) ^ (1 / p)
i : ι
hi : i ∈ s
⊢ g i ^ p = ↑(ENNReal.toNNReal (g i)) ^ p