case left
ι : Type u
s : Finset ι
f : ι → ℝ≥0
p q : ℝ
hpq : Real.IsConjugateExponent p q
⊢ (∑ i in s, f i ^ p) ^ (1 / p) ∈ (fun g => ∑ i in s, f i * g i) '' {g | ∑ i in s, g i ^ q ≤ 1}

case right
ι : Type u
s : Finset ι
f : ι → ℝ≥0
p q : ℝ
hpq : Real.IsConjugateExponent p q
⊢ (∑ i in s, f i ^ p) ^ (1 / p) ∈ upperBounds ((fun g => ∑ i in s, f i * g i) '' {g | ∑ i in s, g i ^ q ≤ 1})
ι : Type u
s : Finset ι
f : ι → ℝ≥0
p q : ℝ
hpq : Real.IsConjugateExponent p q
⊢ IsGreatest ((fun g => ∑ i in s, f i * g i) '' {g | ∑ i in s, g i ^ q ≤ 1}) ((∑ i in s, f i ^ p) ^ (1 / p))
constructor
case left
ι : Type u
s : Finset ι
f : ι → ℝ≥0
p q : ℝ
hpq : Real.IsConjugateExponent p q
⊢ (fun i => f i ^ p / f i / (∑ i in s, f i ^ p) ^ (1 / q)) ∈ {g | ∑ i in s, g i ^ q ≤ 1} ∧
    ((fun g => ∑ i in s, f i * g i) fun i => f i ^ p / f i / (∑ i in s, f i ^ p) ^ (1 / q)) =
      (∑ i in s, f i ^ p) ^ (1 / p)
case left
ι : Type u
s : Finset ι
f : ι → ℝ≥0
p q : ℝ
hpq : Real.IsConjugateExponent p q
⊢ (∑ i in s, f i ^ p) ^ (1 / p) ∈ (fun g => ∑ i in s, f i * g i) '' {g | ∑ i in s, g i ^ q ≤ 1}
use fun i => f i ^ p / f i / (∑ i in s, f i ^ p) ^ (1 / q)
case pos
ι : Type u
s : Finset ι
f : ι → ℝ≥0
p q : ℝ
hpq : Real.IsConjugateExponent p q
hf : ∑ i in s, f i ^ p = 0
⊢ (fun i => f i ^ p / f i / (∑ i in s, f i ^ p) ^ (1 / q)) ∈ {g | ∑ i in s, g i ^ q ≤ 1} ∧
    ((fun g => ∑ i in s, f i * g i) fun i => f i ^ p / f i / (∑ i in s, f i ^ p) ^ (1 / q)) =
      (∑ i in s, f i ^ p) ^ (1 / p)

case neg
ι : Type u
s : Finset ι
f : ι → ℝ≥0
p q : ℝ
hpq : Real.IsConjugateExponent p q
hf : ¬∑ i in s, f i ^ p = 0
⊢ (fun i => f i ^ p / f i / (∑ i in s, f i ^ p) ^ (1 / q)) ∈ {g | ∑ i in s, g i ^ q ≤ 1} ∧
    ((fun g => ∑ i in s, f i * g i) fun i => f i ^ p / f i / (∑ i in s, f i ^ p) ^ (1 / q)) =
      (∑ i in s, f i ^ p) ^ (1 / p)
case left
ι : Type u
s : Finset ι
f : ι → ℝ≥0
p q : ℝ
hpq : Real.IsConjugateExponent p q
⊢ (fun i => f i ^ p / f i / (∑ i in s, f i ^ p) ^ (1 / q)) ∈ {g | ∑ i in s, g i ^ q ≤ 1} ∧
    ((fun g => ∑ i in s, f i * g i) fun i => f i ^ p / f i / (∑ i in s, f i ^ p) ^ (1 / q)) =
      (∑ i in s, f i ^ p) ^ (1 / p)
by_cases hf : (∑ i in s, f i ^ p) = 0
no goals
case pos
ι : Type u
s : Finset ι
f : ι → ℝ≥0
p q : ℝ
hpq : Real.IsConjugateExponent p q
hf : ∑ i in s, f i ^ p = 0
⊢ (fun i => f i ^ p / f i / (∑ i in s, f i ^ p) ^ (1 / q)) ∈ {g | ∑ i in s, g i ^ q ≤ 1} ∧
    ((fun g => ∑ i in s, f i * g i) fun i => f i ^ p / f i / (∑ i in s, f i ^ p) ^ (1 / q)) =
      (∑ i in s, f i ^ p) ^ (1 / p)
simp [hf, hpq.ne_zero, hpq.symm.ne_zero]
case neg
ι : Type u
s : Finset ι
f : ι → ℝ≥0
p q : ℝ
hpq : Real.IsConjugateExponent p q
hf : ¬∑ i in s, f i ^ p = 0
A : p + q - q ≠ 0
⊢ (fun i => f i ^ p / f i / (∑ i in s, f i ^ p) ^ (1 / q)) ∈ {g | ∑ i in s, g i ^ q ≤ 1} ∧
    ((fun g => ∑ i in s, f i * g i) fun i => f i ^ p / f i / (∑ i in s, f i ^ p) ^ (1 / q)) =
      (∑ i in s, f i ^ p) ^ (1 / p)
case neg
ι : Type u
s : Finset ι
f : ι → ℝ≥0
p q : ℝ
hpq : Real.IsConjugateExponent p q
hf : ¬∑ i in s, f i ^ p = 0
⊢ (fun i => f i ^ p / f i / (∑ i in s, f i ^ p) ^ (1 / q)) ∈ {g | ∑ i in s, g i ^ q ≤ 1} ∧
    ((fun g => ∑ i in s, f i * g i) fun i => f i ^ p / f i / (∑ i in s, f i ^ p) ^ (1 / q)) =
      (∑ i in s, f i ^ p) ^ (1 / p)
have A : p + q - q ≠ 0 := by simp [hpq.ne_zero]
case neg
ι : Type u
s : Finset ι
f : ι → ℝ≥0
p q : ℝ
hpq : Real.IsConjugateExponent p q
hf : ¬∑ i in s, f i ^ p = 0
A : p + q - q ≠ 0
B : ∀ (y : ℝ≥0), y * y ^ p / y = y ^ p
⊢ (fun i => f i ^ p / f i / (∑ i in s, f i ^ p) ^ (1 / q)) ∈ {g | ∑ i in s, g i ^ q ≤ 1} ∧
    ((fun g => ∑ i in s, f i * g i) fun i => f i ^ p / f i / (∑ i in s, f i ^ p) ^ (1 / q)) =
      (∑ i in s, f i ^ p) ^ (1 / p)
case neg
ι : Type u
s : Finset ι
f : ι → ℝ≥0
p q : ℝ
hpq : Real.IsConjugateExponent p q
hf : ¬∑ i in s, f i ^ p = 0
A : p + q - q ≠ 0
⊢ (fun i => f i ^ p / f i / (∑ i in s, f i ^ p) ^ (1 / q)) ∈ {g | ∑ i in s, g i ^ q ≤ 1} ∧
    ((fun g => ∑ i in s, f i * g i) fun i => f i ^ p / f i / (∑ i in s, f i ^ p) ^ (1 / q)) =
      (∑ i in s, f i ^ p) ^ (1 / p)
have B : ∀ y : ℝ≥0, y * y ^ p / y = y ^ p := by
  refine' fun y => mul_div_cancel_left_of_imp fun h => _
  simp [h, hpq.ne_zero]
case neg
ι : Type u
s : Finset ι
f : ι → ℝ≥0
p q : ℝ
hpq : Real.IsConjugateExponent p q
hf : ¬∑ i in s, f i ^ p = 0
A : p + q - q ≠ 0
B : ∀ (y : ℝ≥0), y * y ^ p / y = y ^ p
⊢ (∑ i in s, f i ^ p) / (∑ i in s, f i ^ p) ^ (1 / q) = (∑ i in s, f i ^ p) ^ (1 / p)
case neg
ι : Type u
s : Finset ι
f : ι → ℝ≥0
p q : ℝ
hpq : Real.IsConjugateExponent p q
hf : ¬∑ i in s, f i ^ p = 0
A : p + q - q ≠ 0
B : ∀ (y : ℝ≥0), y * y ^ p / y = y ^ p
⊢ (fun i => f i ^ p / f i / (∑ i in s, f i ^ p) ^ (1 / q)) ∈ {g | ∑ i in s, g i ^ q ≤ 1} ∧
    ((fun g => ∑ i in s, f i * g i) fun i => f i ^ p / f i / (∑ i in s, f i ^ p) ^ (1 / q)) =
      (∑ i in s, f i ^ p) ^ (1 / p)
simp only [Set.mem_setOf_eq, div_rpow, ← sum_div, ← rpow_mul,
  div_mul_cancel _ hpq.symm.ne_zero, rpow_one, div_le_iff hf, one_mul, hpq.mul_eq_add, ←
  rpow_sub' _ A, _root_.add_sub_cancel, le_refl, true_and_iff, ← mul_div_assoc, B]
case neg
ι : Type u
s : Finset ι
f : ι → ℝ≥0
p q : ℝ
hpq : Real.IsConjugateExponent p q
hf : ¬∑ i in s, f i ^ p = 0
A : p + q - q ≠ 0
B : ∀ (y : ℝ≥0), y * y ^ p / y = y ^ p
⊢ (∑ i in s, f i ^ p) ^ (1 / q) ≠ 0
case neg
ι : Type u
s : Finset ι
f : ι → ℝ≥0
p q : ℝ
hpq : Real.IsConjugateExponent p q
hf : ¬∑ i in s, f i ^ p = 0
A : p + q - q ≠ 0
B : ∀ (y : ℝ≥0), y * y ^ p / y = y ^ p
⊢ (∑ i in s, f i ^ p) / (∑ i in s, f i ^ p) ^ (1 / q) = (∑ i in s, f i ^ p) ^ (1 / p)
rw [div_eq_iff, ← rpow_add hf, hpq.inv_add_inv_conj, rpow_one]
no goals
case neg
ι : Type u
s : Finset ι
f : ι → ℝ≥0
p q : ℝ
hpq : Real.IsConjugateExponent p q
hf : ¬∑ i in s, f i ^ p = 0
A : p + q - q ≠ 0
B : ∀ (y : ℝ≥0), y * y ^ p / y = y ^ p
⊢ (∑ i in s, f i ^ p) ^ (1 / q) ≠ 0
simpa [hpq.symm.ne_zero] using hf
no goals
ι : Type u
s : Finset ι
f : ι → ℝ≥0
p q : ℝ
hpq : Real.IsConjugateExponent p q
hf : ¬∑ i in s, f i ^ p = 0
⊢ p + q - q ≠ 0
simp [hpq.ne_zero]
ι : Type u
s : Finset ι
f : ι → ℝ≥0
p q : ℝ
hpq : Real.IsConjugateExponent p q
hf : ¬∑ i in s, f i ^ p = 0
A : p + q - q ≠ 0
y : ℝ≥0
h : y = 0
⊢ y ^ p = 0
ι : Type u
s : Finset ι
f : ι → ℝ≥0
p q : ℝ
hpq : Real.IsConjugateExponent p q
hf : ¬∑ i in s, f i ^ p = 0
A : p + q - q ≠ 0
⊢ ∀ (y : ℝ≥0), y * y ^ p / y = y ^ p
refine' fun y => mul_div_cancel_left_of_imp fun h => _
no goals
ι : Type u
s : Finset ι
f : ι → ℝ≥0
p q : ℝ
hpq : Real.IsConjugateExponent p q
hf : ¬∑ i in s, f i ^ p = 0
A : p + q - q ≠ 0
y : ℝ≥0
h : y = 0
⊢ y ^ p = 0
simp [h, hpq.ne_zero]
case right.intro.intro
ι : Type u
s : Finset ι
f : ι → ℝ≥0
p q : ℝ
hpq : Real.IsConjugateExponent p q
g : ι → ℝ≥0
hg : g ∈ {g | ∑ i in s, g i ^ q ≤ 1}
⊢ (fun g => ∑ i in s, f i * g i) g ≤ (∑ i in s, f i ^ p) ^ (1 / p)
case right
ι : Type u
s : Finset ι
f : ι → ℝ≥0
p q : ℝ
hpq : Real.IsConjugateExponent p q
⊢ (∑ i in s, f i ^ p) ^ (1 / p) ∈ upperBounds ((fun g => ∑ i in s, f i * g i) '' {g | ∑ i in s, g i ^ q ≤ 1})
rintro _ ⟨g, hg, rfl⟩
case right.intro.intro
ι : Type u
s : Finset ι
f : ι → ℝ≥0
p q : ℝ
hpq : Real.IsConjugateExponent p q
g : ι → ℝ≥0
hg : g ∈ {g | ∑ i in s, g i ^ q ≤ 1}
⊢ (∑ i in s, f i ^ p) ^ (1 / p) * (∑ i in s, g i ^ q) ^ (1 / q) ≤ (∑ i in s, f i ^ p) ^ (1 / p)
case right.intro.intro
ι : Type u
s : Finset ι
f : ι → ℝ≥0
p q : ℝ
hpq : Real.IsConjugateExponent p q
g : ι → ℝ≥0
hg : g ∈ {g | ∑ i in s, g i ^ q ≤ 1}
⊢ (fun g => ∑ i in s, f i * g i) g ≤ (∑ i in s, f i ^ p) ^ (1 / p)
apply le_trans (inner_le_Lp_mul_Lq s f g hpq)
no goals
case right.intro.intro
ι : Type u
s : Finset ι
f : ι → ℝ≥0
p q : ℝ
hpq : Real.IsConjugateExponent p q
g : ι → ℝ≥0
hg : g ∈ {g | ∑ i in s, g i ^ q ≤ 1}
⊢ (∑ i in s, f i ^ p) ^ (1 / p) * (∑ i in s, g i ^ q) ^ (1 / q) ≤ (∑ i in s, f i ^ p) ^ (1 / p)
simpa only [mul_one] using
  mul_le_mul_left' (NNReal.rpow_le_one hg (le_of_lt hpq.symm.one_div_pos)) _