[GOAL]
𝕜 : Type u_1
E : Type u_2
β : Type u_3
s : Set E
f g : E → β
inst✝⁴ : OrderedSemiring 𝕜
inst✝³ : SMul 𝕜 E
inst✝² : AddCommMonoid E
inst✝¹ : OrderedAddCommMonoid β
inst✝ : SMul 𝕜 β
hf : ConvexOn 𝕜 s f
hfg : EqOn f g s
x : E
hx : x ∈ s
y : E
hy : y ∈ s
a b : 𝕜
ha : 0 ≤ a
hb : 0 ≤ b
hab : a + b = 1
⊢ g (a • x + b • y) ≤ a • g x + b • g y
[PROOFSTEP]
simpa only [← hfg hx, ← hfg hy, ← hfg (hf.1 hx hy ha hb hab)] using hf.2 hx hy ha hb hab
[GOAL]
𝕜 : Type u_1
E : Type u_2
β : Type u_3
s : Set E
f g : E → β
inst✝⁴ : OrderedSemiring 𝕜
inst✝³ : SMul 𝕜 E
inst✝² : AddCommMonoid E
inst✝¹ : OrderedAddCommMonoid β
inst✝ : SMul 𝕜 β
hf : ConcaveOn 𝕜 s f
hfg : EqOn f g s
x : E
hx : x ∈ s
y : E
hy : y ∈ s
a b : 𝕜
ha : 0 ≤ a
hb : 0 ≤ b
hab : a + b = 1
⊢ a • g x + b • g y ≤ g (a • x + b • y)
[PROOFSTEP]
simpa only [← hfg hx, ← hfg hy, ← hfg (hf.1 hx hy ha hb hab)] using hf.2 hx hy ha hb hab
[GOAL]
𝕜 : Type u_1
E : Type u_2
β : Type u_3
s : Set E
f g : E → β
inst✝⁴ : OrderedSemiring 𝕜
inst✝³ : SMul 𝕜 E
inst✝² : AddCommMonoid E
inst✝¹ : OrderedAddCommMonoid β
inst✝ : SMul 𝕜 β
hf : StrictConvexOn 𝕜 s f
hfg : EqOn f g s
x : E
hx : x ∈ s
y : E
hy : y ∈ s
hxy : x ≠ y
a b : 𝕜
ha : 0 < a
hb : 0 < b
hab : a + b = 1
⊢ g (a • x + b • y) < a • g x + b • g y
[PROOFSTEP]
simpa only [← hfg hx, ← hfg hy, ← hfg (hf.1 hx hy ha.le hb.le hab)] using hf.2 hx hy hxy ha hb hab
[GOAL]
𝕜 : Type u_1
E : Type u_2
β : Type u_3
s : Set E
f g : E → β
inst✝⁴ : OrderedSemiring 𝕜
inst✝³ : SMul 𝕜 E
inst✝² : AddCommMonoid E
inst✝¹ : OrderedAddCommMonoid β
inst✝ : SMul 𝕜 β
hf : StrictConcaveOn 𝕜 s f
hfg : EqOn f g s
x : E
hx : x ∈ s
y : E
hy : y ∈ s
hxy : x ≠ y
a b : 𝕜
ha : 0 < a
hb : 0 < b
hab : a + b = 1
⊢ a • g x + b • g y < g (a • x + b • y)
[PROOFSTEP]
simpa only [← hfg hx, ← hfg hy, ← hfg (hf.1 hx hy ha.le hb.le hab)] using hf.2 hx hy hxy ha hb hab
[GOAL]
s t a b : ℝ
hs : 0 < s
ht : 0 < t
ha : 0 < a
hb : 0 < b
hab : a + b = 1
⊢ Gamma (a * s + b * t) ≤ Gamma s ^ a * Gamma t ^ b
[PROOFSTEP]
let f : ℝ → ℝ → ℝ → ℝ := fun c u x => exp (-c * x) * x ^ (c * (u - 1))
[GOAL]
s t a b : ℝ
hs : 0 < s
ht : 0 < t
ha : 0 < a
hb : 0 < b
hab : a + b = 1
f : ℝ → ℝ → ℝ → ℝ := fun c u x => rexp (-c * x) * x ^ (c * (u - 1))
⊢ Gamma (a * s + b * t) ≤ Gamma s ^ a * Gamma t ^ b
[PROOFSTEP]
have e : IsConjugateExponent (1 / a) (1 / b) := Real.isConjugateExponent_one_div ha hb hab
[GOAL]
s t a b : ℝ
hs : 0 < s
ht : 0 < t
ha : 0 < a
hb : 0 < b
hab : a + b = 1
f : ℝ → ℝ → ℝ → ℝ := fun c u x => rexp (-c * x) * x ^ (c * (u - 1))
e : IsConjugateExponent (1 / a) (1 / b)
⊢ Gamma (a * s + b * t) ≤ Gamma s ^ a * Gamma t ^ b
[PROOFSTEP]
have hab' : b = 1 - a := by linarith
[GOAL]
s t a b : ℝ
hs : 0 < s
ht : 0 < t
ha : 0 < a
hb : 0 < b
hab : a + b = 1
f : ℝ → ℝ → ℝ → ℝ := fun c u x => rexp (-c * x) * x ^ (c * (u - 1))
e : IsConjugateExponent (1 / a) (1 / b)
⊢ b = 1 - a
[PROOFSTEP]
linarith
[GOAL]
s t a b : ℝ
hs : 0 < s
ht : 0 < t
ha : 0 < a
hb : 0 < b
hab : a + b = 1
f : ℝ → ℝ → ℝ → ℝ := fun c u x => rexp (-c * x) * x ^ (c * (u - 1))
e : IsConjugateExponent (1 / a) (1 / b)
hab' : b = 1 - a
⊢ Gamma (a * s + b * t) ≤ Gamma s ^ a * Gamma t ^ b
[PROOFSTEP]
have hst : 0 < a * s + b * t :=
  add_pos (mul_pos ha hs)
    (mul_pos hb ht)
      -- some properties of f:
[GOAL]
s t a b : ℝ
hs : 0 < s
ht : 0 < t
ha : 0 < a
hb : 0 < b
hab : a + b = 1
f : ℝ → ℝ → ℝ → ℝ := fun c u x => rexp (-c * x) * x ^ (c * (u - 1))
e : IsConjugateExponent (1 / a) (1 / b)
hab' : b = 1 - a
hst : 0 < a * s + b * t
⊢ Gamma (a * s + b * t) ≤ Gamma s ^ a * Gamma t ^ b
[PROOFSTEP]
have posf : ∀ c u x : ℝ, x ∈ Ioi (0 : ℝ) → 0 ≤ f c u x := fun c u x hx =>
  mul_nonneg (exp_pos _).le (rpow_pos_of_pos hx _).le
[GOAL]
s t a b : ℝ
hs : 0 < s
ht : 0 < t
ha : 0 < a
hb : 0 < b
hab : a + b = 1
f : ℝ → ℝ → ℝ → ℝ := fun c u x => rexp (-c * x) * x ^ (c * (u - 1))
e : IsConjugateExponent (1 / a) (1 / b)
hab' : b = 1 - a
hst : 0 < a * s + b * t
posf : ∀ (c u x : ℝ), x ∈ Ioi 0 → 0 ≤ f c u x
⊢ Gamma (a * s + b * t) ≤ Gamma s ^ a * Gamma t ^ b
[PROOFSTEP]
have posf' : ∀ c u : ℝ, ∀ᵐ x : ℝ ∂volume.restrict (Ioi 0), 0 ≤ f c u x := fun c u =>
  (ae_restrict_iff' measurableSet_Ioi).mpr (ae_of_all _ (posf c u))
[GOAL]
s t a b : ℝ
hs : 0 < s
ht : 0 < t
ha : 0 < a
hb : 0 < b
hab : a + b = 1
f : ℝ → ℝ → ℝ → ℝ := fun c u x => rexp (-c * x) * x ^ (c * (u - 1))
e : IsConjugateExponent (1 / a) (1 / b)
hab' : b = 1 - a
hst : 0 < a * s + b * t
posf : ∀ (c u x : ℝ), x ∈ Ioi 0 → 0 ≤ f c u x
posf' : ∀ (c u : ℝ), ∀ᵐ (x : ℝ) ∂Measure.restrict volume (Ioi 0), 0 ≤ f c u x
⊢ Gamma (a * s + b * t) ≤ Gamma s ^ a * Gamma t ^ b
[PROOFSTEP]
have fpow : ∀ {c x : ℝ} (_ : 0 < c) (u : ℝ) (_ : 0 < x), exp (-x) * x ^ (u - 1) = f c u x ^ (1 / c) :=
  by
  intro c x hc u hx
  dsimp only
  rw [mul_rpow (exp_pos _).le ((rpow_nonneg_of_nonneg hx.le) _), ← exp_mul, ← rpow_mul hx.le]
  congr 2 <;>
    · field_simp [hc.ne'];
      ring
        -- show `f c u` is in `ℒp` for `p = 1/c`:
[GOAL]
s t a b : ℝ
hs : 0 < s
ht : 0 < t
ha : 0 < a
hb : 0 < b
hab : a + b = 1
f : ℝ → ℝ → ℝ → ℝ := fun c u x => rexp (-c * x) * x ^ (c * (u - 1))
e : IsConjugateExponent (1 / a) (1 / b)
hab' : b = 1 - a
hst : 0 < a * s + b * t
posf : ∀ (c u x : ℝ), x ∈ Ioi 0 → 0 ≤ f c u x
posf' : ∀ (c u : ℝ), ∀ᵐ (x : ℝ) ∂Measure.restrict volume (Ioi 0), 0 ≤ f c u x
⊢ ∀ {c x : ℝ}, 0 < c → ∀ (u : ℝ), 0 < x → rexp (-x) * x ^ (u - 1) = f c u x ^ (1 / c)
[PROOFSTEP]
intro c x hc u hx
[GOAL]
s t a b : ℝ
hs : 0 < s
ht : 0 < t
ha : 0 < a
hb : 0 < b
hab : a + b = 1
f : ℝ → ℝ → ℝ → ℝ := fun c u x => rexp (-c * x) * x ^ (c * (u - 1))
e : IsConjugateExponent (1 / a) (1 / b)
hab' : b = 1 - a
hst : 0 < a * s + b * t
posf : ∀ (c u x : ℝ), x ∈ Ioi 0 → 0 ≤ f c u x
posf' : ∀ (c u : ℝ), ∀ᵐ (x : ℝ) ∂Measure.restrict volume (Ioi 0), 0 ≤ f c u x
c x : ℝ
hc : 0 < c
u : ℝ
hx : 0 < x
⊢ rexp (-x) * x ^ (u - 1) = f c u x ^ (1 / c)
[PROOFSTEP]
dsimp only
[GOAL]
s t a b : ℝ
hs : 0 < s
ht : 0 < t
ha : 0 < a
hb : 0 < b
hab : a + b = 1
f : ℝ → ℝ → ℝ → ℝ := fun c u x => rexp (-c * x) * x ^ (c * (u - 1))
e : IsConjugateExponent (1 / a) (1 / b)
hab' : b = 1 - a
hst : 0 < a * s + b * t
posf : ∀ (c u x : ℝ), x ∈ Ioi 0 → 0 ≤ f c u x
posf' : ∀ (c u : ℝ), ∀ᵐ (x : ℝ) ∂Measure.restrict volume (Ioi 0), 0 ≤ f c u x
c x : ℝ
hc : 0 < c
u : ℝ
hx : 0 < x
⊢ rexp (-x) * x ^ (u - 1) = (rexp (-c * x) * x ^ (c * (u - 1))) ^ (1 / c)
[PROOFSTEP]
rw [mul_rpow (exp_pos _).le ((rpow_nonneg_of_nonneg hx.le) _), ← exp_mul, ← rpow_mul hx.le]
[GOAL]
s t a b : ℝ
hs : 0 < s
ht : 0 < t
ha : 0 < a
hb : 0 < b
hab : a + b = 1
f : ℝ → ℝ → ℝ → ℝ := fun c u x => rexp (-c * x) * x ^ (c * (u - 1))
e : IsConjugateExponent (1 / a) (1 / b)
hab' : b = 1 - a
hst : 0 < a * s + b * t
posf : ∀ (c u x : ℝ), x ∈ Ioi 0 → 0 ≤ f c u x
posf' : ∀ (c u : ℝ), ∀ᵐ (x : ℝ) ∂Measure.restrict volume (Ioi 0), 0 ≤ f c u x
c x : ℝ
hc : 0 < c
u : ℝ
hx : 0 < x
⊢ rexp (-x) * x ^ (u - 1) = rexp (-c * x * (1 / c)) * x ^ (c * (u - 1) * (1 / c))
[PROOFSTEP]
congr 2
[GOAL]
case e_a.e_x
s t a b : ℝ
hs : 0 < s
ht : 0 < t
ha : 0 < a
hb : 0 < b
hab : a + b = 1
f : ℝ → ℝ → ℝ → ℝ := fun c u x => rexp (-c * x) * x ^ (c * (u - 1))
e : IsConjugateExponent (1 / a) (1 / b)
hab' : b = 1 - a
hst : 0 < a * s + b * t
posf : ∀ (c u x : ℝ), x ∈ Ioi 0 → 0 ≤ f c u x
posf' : ∀ (c u : ℝ), ∀ᵐ (x : ℝ) ∂Measure.restrict volume (Ioi 0), 0 ≤ f c u x
c x : ℝ
hc : 0 < c
u : ℝ
hx : 0 < x
⊢ -x = -c * x * (1 / c)
[PROOFSTEP]
field_simp [hc.ne']
[GOAL]
case e_a.e_x
s t a b : ℝ
hs : 0 < s
ht : 0 < t
ha : 0 < a
hb : 0 < b
hab : a + b = 1
f : ℝ → ℝ → ℝ → ℝ := fun c u x => rexp (-c * x) * x ^ (c * (u - 1))
e : IsConjugateExponent (1 / a) (1 / b)
hab' : b = 1 - a
hst : 0 < a * s + b * t
posf : ∀ (c u x : ℝ), x ∈ Ioi 0 → 0 ≤ f c u x
posf' : ∀ (c u : ℝ), ∀ᵐ (x : ℝ) ∂Measure.restrict volume (Ioi 0), 0 ≤ f c u x
c x : ℝ
hc : 0 < c
u : ℝ
hx : 0 < x
⊢ x * c = c * x
[PROOFSTEP]
ring
  -- show `f c u` is in `ℒp` for `p = 1/c`:
[GOAL]
case e_a.e_a
s t a b : ℝ
hs : 0 < s
ht : 0 < t
ha : 0 < a
hb : 0 < b
hab : a + b = 1
f : ℝ → ℝ → ℝ → ℝ := fun c u x => rexp (-c * x) * x ^ (c * (u - 1))
e : IsConjugateExponent (1 / a) (1 / b)
hab' : b = 1 - a
hst : 0 < a * s + b * t
posf : ∀ (c u x : ℝ), x ∈ Ioi 0 → 0 ≤ f c u x
posf' : ∀ (c u : ℝ), ∀ᵐ (x : ℝ) ∂Measure.restrict volume (Ioi 0), 0 ≤ f c u x
c x : ℝ
hc : 0 < c
u : ℝ
hx : 0 < x
⊢ u - 1 = c * (u - 1) * (1 / c)
[PROOFSTEP]
field_simp [hc.ne']
[GOAL]
case e_a.e_a
s t a b : ℝ
hs : 0 < s
ht : 0 < t
ha : 0 < a
hb : 0 < b
hab : a + b = 1
f : ℝ → ℝ → ℝ → ℝ := fun c u x => rexp (-c * x) * x ^ (c * (u - 1))
e : IsConjugateExponent (1 / a) (1 / b)
hab' : b = 1 - a
hst : 0 < a * s + b * t
posf : ∀ (c u x : ℝ), x ∈ Ioi 0 → 0 ≤ f c u x
posf' : ∀ (c u : ℝ), ∀ᵐ (x : ℝ) ∂Measure.restrict volume (Ioi 0), 0 ≤ f c u x
c x : ℝ
hc : 0 < c
u : ℝ
hx : 0 < x
⊢ (u - 1) * c = c * (u - 1)
[PROOFSTEP]
ring
  -- show `f c u` is in `ℒp` for `p = 1/c`:
[GOAL]
s t a b : ℝ
hs : 0 < s
ht : 0 < t
ha : 0 < a
hb : 0 < b
hab : a + b = 1
f : ℝ → ℝ → ℝ → ℝ := fun c u x => rexp (-c * x) * x ^ (c * (u - 1))
e : IsConjugateExponent (1 / a) (1 / b)
hab' : b = 1 - a
hst : 0 < a * s + b * t
posf : ∀ (c u x : ℝ), x ∈ Ioi 0 → 0 ≤ f c u x
posf' : ∀ (c u : ℝ), ∀ᵐ (x : ℝ) ∂Measure.restrict volume (Ioi 0), 0 ≤ f c u x
fpow : ∀ {c x : ℝ}, 0 < c → ∀ (u : ℝ), 0 < x → rexp (-x) * x ^ (u - 1) = f c u x ^ (1 / c)
⊢ Gamma (a * s + b * t) ≤ Gamma s ^ a * Gamma t ^ b
[PROOFSTEP]
have f_mem_Lp :
  ∀ {c u : ℝ} (hc : 0 < c) (hu : 0 < u), Memℒp (f c u) (ENNReal.ofReal (1 / c)) (volume.restrict (Ioi 0)) :=
  by
  intro c u hc hu
  have A : ENNReal.ofReal (1 / c) ≠ 0 := by rwa [Ne.def, ENNReal.ofReal_eq_zero, not_le, one_div_pos]
  have B : ENNReal.ofReal (1 / c) ≠ ∞ := ENNReal.ofReal_ne_top
  rw [← memℒp_norm_rpow_iff _ A B, ENNReal.toReal_ofReal (one_div_nonneg.mpr hc.le), ENNReal.div_self A B,
    memℒp_one_iff_integrable]
  · apply Integrable.congr (GammaIntegral_convergent hu)
    refine' eventuallyEq_of_mem (self_mem_ae_restrict measurableSet_Ioi) fun x hx => _
    dsimp only
    rw [fpow hc u hx]
    congr 1
    exact (norm_of_nonneg (posf _ _ x hx)).symm
  · refine' ContinuousOn.aestronglyMeasurable _ measurableSet_Ioi
    refine' (Continuous.continuousOn _).mul (ContinuousAt.continuousOn fun x hx => _)
    · exact continuous_exp.comp (continuous_const.mul continuous_id')
    ·
      exact
        continuousAt_rpow_const _ _
          (Or.inl (mem_Ioi.mp hx).ne')
            -- now apply Hölder:
[GOAL]
s t a b : ℝ
hs : 0 < s
ht : 0 < t
ha : 0 < a
hb : 0 < b
hab : a + b = 1
f : ℝ → ℝ → ℝ → ℝ := fun c u x => rexp (-c * x) * x ^ (c * (u - 1))
e : IsConjugateExponent (1 / a) (1 / b)
hab' : b = 1 - a
hst : 0 < a * s + b * t
posf : ∀ (c u x : ℝ), x ∈ Ioi 0 → 0 ≤ f c u x
posf' : ∀ (c u : ℝ), ∀ᵐ (x : ℝ) ∂Measure.restrict volume (Ioi 0), 0 ≤ f c u x
fpow : ∀ {c x : ℝ}, 0 < c → ∀ (u : ℝ), 0 < x → rexp (-x) * x ^ (u - 1) = f c u x ^ (1 / c)
⊢ ∀ {c u : ℝ}, 0 < c → 0 < u → Memℒp (f c u) (ENNReal.ofReal (1 / c))
[PROOFSTEP]
intro c u hc hu
[GOAL]
s t a b : ℝ
hs : 0 < s
ht : 0 < t
ha : 0 < a
hb : 0 < b
hab : a + b = 1
f : ℝ → ℝ → ℝ → ℝ := fun c u x => rexp (-c * x) * x ^ (c * (u - 1))
e : IsConjugateExponent (1 / a) (1 / b)
hab' : b = 1 - a
hst : 0 < a * s + b * t
posf : ∀ (c u x : ℝ), x ∈ Ioi 0 → 0 ≤ f c u x
posf' : ∀ (c u : ℝ), ∀ᵐ (x : ℝ) ∂Measure.restrict volume (Ioi 0), 0 ≤ f c u x
fpow : ∀ {c x : ℝ}, 0 < c → ∀ (u : ℝ), 0 < x → rexp (-x) * x ^ (u - 1) = f c u x ^ (1 / c)
c u : ℝ
hc : 0 < c
hu : 0 < u
⊢ Memℒp (f c u) (ENNReal.ofReal (1 / c))
[PROOFSTEP]
have A : ENNReal.ofReal (1 / c) ≠ 0 := by rwa [Ne.def, ENNReal.ofReal_eq_zero, not_le, one_div_pos]
[GOAL]
s t a b : ℝ
hs : 0 < s
ht : 0 < t
ha : 0 < a
hb : 0 < b
hab : a + b = 1
f : ℝ → ℝ → ℝ → ℝ := fun c u x => rexp (-c * x) * x ^ (c * (u - 1))
e : IsConjugateExponent (1 / a) (1 / b)
hab' : b = 1 - a
hst : 0 < a * s + b * t
posf : ∀ (c u x : ℝ), x ∈ Ioi 0 → 0 ≤ f c u x
posf' : ∀ (c u : ℝ), ∀ᵐ (x : ℝ) ∂Measure.restrict volume (Ioi 0), 0 ≤ f c u x
fpow : ∀ {c x : ℝ}, 0 < c → ∀ (u : ℝ), 0 < x → rexp (-x) * x ^ (u - 1) = f c u x ^ (1 / c)
c u : ℝ
hc : 0 < c
hu : 0 < u
⊢ ENNReal.ofReal (1 / c) ≠ 0
[PROOFSTEP]
rwa [Ne.def, ENNReal.ofReal_eq_zero, not_le, one_div_pos]
[GOAL]
s t a b : ℝ
hs : 0 < s
ht : 0 < t
ha : 0 < a
hb : 0 < b
hab : a + b = 1
f : ℝ → ℝ → ℝ → ℝ := fun c u x => rexp (-c * x) * x ^ (c * (u - 1))
e : IsConjugateExponent (1 / a) (1 / b)
hab' : b = 1 - a
hst : 0 < a * s + b * t
posf : ∀ (c u x : ℝ), x ∈ Ioi 0 → 0 ≤ f c u x
posf' : ∀ (c u : ℝ), ∀ᵐ (x : ℝ) ∂Measure.restrict volume (Ioi 0), 0 ≤ f c u x
fpow : ∀ {c x : ℝ}, 0 < c → ∀ (u : ℝ), 0 < x → rexp (-x) * x ^ (u - 1) = f c u x ^ (1 / c)
c u : ℝ
hc : 0 < c
hu : 0 < u
A : ENNReal.ofReal (1 / c) ≠ 0
⊢ Memℒp (f c u) (ENNReal.ofReal (1 / c))
[PROOFSTEP]
have B : ENNReal.ofReal (1 / c) ≠ ∞ := ENNReal.ofReal_ne_top
[GOAL]
s t a b : ℝ
hs : 0 < s
ht : 0 < t
ha : 0 < a
hb : 0 < b
hab : a + b = 1
f : ℝ → ℝ → ℝ → ℝ := fun c u x => rexp (-c * x) * x ^ (c * (u - 1))
e : IsConjugateExponent (1 / a) (1 / b)
hab' : b = 1 - a
hst : 0 < a * s + b * t
posf : ∀ (c u x : ℝ), x ∈ Ioi 0 → 0 ≤ f c u x
posf' : ∀ (c u : ℝ), ∀ᵐ (x : ℝ) ∂Measure.restrict volume (Ioi 0), 0 ≤ f c u x
fpow : ∀ {c x : ℝ}, 0 < c → ∀ (u : ℝ), 0 < x → rexp (-x) * x ^ (u - 1) = f c u x ^ (1 / c)
c u : ℝ
hc : 0 < c
hu : 0 < u
A : ENNReal.ofReal (1 / c) ≠ 0
B : ENNReal.ofReal (1 / c) ≠ ⊤
⊢ Memℒp (f c u) (ENNReal.ofReal (1 / c))
[PROOFSTEP]
rw [← memℒp_norm_rpow_iff _ A B, ENNReal.toReal_ofReal (one_div_nonneg.mpr hc.le), ENNReal.div_self A B,
  memℒp_one_iff_integrable]
[GOAL]
s t a b : ℝ
hs : 0 < s
ht : 0 < t
ha : 0 < a
hb : 0 < b
hab : a + b = 1
f : ℝ → ℝ → ℝ → ℝ := fun c u x => rexp (-c * x) * x ^ (c * (u - 1))
e : IsConjugateExponent (1 / a) (1 / b)
hab' : b = 1 - a
hst : 0 < a * s + b * t
posf : ∀ (c u x : ℝ), x ∈ Ioi 0 → 0 ≤ f c u x
posf' : ∀ (c u : ℝ), ∀ᵐ (x : ℝ) ∂Measure.restrict volume (Ioi 0), 0 ≤ f c u x
fpow : ∀ {c x : ℝ}, 0 < c → ∀ (u : ℝ), 0 < x → rexp (-x) * x ^ (u - 1) = f c u x ^ (1 / c)
c u : ℝ
hc : 0 < c
hu : 0 < u
A : ENNReal.ofReal (1 / c) ≠ 0
B : ENNReal.ofReal (1 / c) ≠ ⊤
⊢ Integrable fun x => ‖f c u x‖ ^ (1 / c)
[PROOFSTEP]
apply Integrable.congr (GammaIntegral_convergent hu)
[GOAL]
s t a b : ℝ
hs : 0 < s
ht : 0 < t
ha : 0 < a
hb : 0 < b
hab : a + b = 1
f : ℝ → ℝ → ℝ → ℝ := fun c u x => rexp (-c * x) * x ^ (c * (u - 1))
e : IsConjugateExponent (1 / a) (1 / b)
hab' : b = 1 - a
hst : 0 < a * s + b * t
posf : ∀ (c u x : ℝ), x ∈ Ioi 0 → 0 ≤ f c u x
posf' : ∀ (c u : ℝ), ∀ᵐ (x : ℝ) ∂Measure.restrict volume (Ioi 0), 0 ≤ f c u x
fpow : ∀ {c x : ℝ}, 0 < c → ∀ (u : ℝ), 0 < x → rexp (-x) * x ^ (u - 1) = f c u x ^ (1 / c)
c u : ℝ
hc : 0 < c
hu : 0 < u
A : ENNReal.ofReal (1 / c) ≠ 0
B : ENNReal.ofReal (1 / c) ≠ ⊤
⊢ (fun x => rexp (-x) * x ^ (u - 1)) =ᵐ[Measure.restrict volume (Ioi 0)] fun x => ‖f c u x‖ ^ (1 / c)
[PROOFSTEP]
refine' eventuallyEq_of_mem (self_mem_ae_restrict measurableSet_Ioi) fun x hx => _
[GOAL]
s t a b : ℝ
hs : 0 < s
ht : 0 < t
ha : 0 < a
hb : 0 < b
hab : a + b = 1
f : ℝ → ℝ → ℝ → ℝ := fun c u x => rexp (-c * x) * x ^ (c * (u - 1))
e : IsConjugateExponent (1 / a) (1 / b)
hab' : b = 1 - a
hst : 0 < a * s + b * t
posf : ∀ (c u x : ℝ), x ∈ Ioi 0 → 0 ≤ f c u x
posf' : ∀ (c u : ℝ), ∀ᵐ (x : ℝ) ∂Measure.restrict volume (Ioi 0), 0 ≤ f c u x
fpow : ∀ {c x : ℝ}, 0 < c → ∀ (u : ℝ), 0 < x → rexp (-x) * x ^ (u - 1) = f c u x ^ (1 / c)
c u : ℝ
hc : 0 < c
hu : 0 < u
A : ENNReal.ofReal (1 / c) ≠ 0
B : ENNReal.ofReal (1 / c) ≠ ⊤
x : ℝ
hx : x ∈ Ioi 0
⊢ rexp (-x) * x ^ (u - 1) = ‖f c u x‖ ^ (1 / c)
[PROOFSTEP]
dsimp only
[GOAL]
s t a b : ℝ
hs : 0 < s
ht : 0 < t
ha : 0 < a
hb : 0 < b
hab : a + b = 1
f : ℝ → ℝ → ℝ → ℝ := fun c u x => rexp (-c * x) * x ^ (c * (u - 1))
e : IsConjugateExponent (1 / a) (1 / b)
hab' : b = 1 - a
hst : 0 < a * s + b * t
posf : ∀ (c u x : ℝ), x ∈ Ioi 0 → 0 ≤ f c u x
posf' : ∀ (c u : ℝ), ∀ᵐ (x : ℝ) ∂Measure.restrict volume (Ioi 0), 0 ≤ f c u x
fpow : ∀ {c x : ℝ}, 0 < c → ∀ (u : ℝ), 0 < x → rexp (-x) * x ^ (u - 1) = f c u x ^ (1 / c)
c u : ℝ
hc : 0 < c
hu : 0 < u
A : ENNReal.ofReal (1 / c) ≠ 0
B : ENNReal.ofReal (1 / c) ≠ ⊤
x : ℝ
hx : x ∈ Ioi 0
⊢ rexp (-x) * x ^ (u - 1) = ‖rexp (-c * x) * x ^ (c * (u - 1))‖ ^ (1 / c)
[PROOFSTEP]
rw [fpow hc u hx]
[GOAL]
s t a b : ℝ
hs : 0 < s
ht : 0 < t
ha : 0 < a
hb : 0 < b
hab : a + b = 1
f : ℝ → ℝ → ℝ → ℝ := fun c u x => rexp (-c * x) * x ^ (c * (u - 1))
e : IsConjugateExponent (1 / a) (1 / b)
hab' : b = 1 - a
hst : 0 < a * s + b * t
posf : ∀ (c u x : ℝ), x ∈ Ioi 0 → 0 ≤ f c u x
posf' : ∀ (c u : ℝ), ∀ᵐ (x : ℝ) ∂Measure.restrict volume (Ioi 0), 0 ≤ f c u x
fpow : ∀ {c x : ℝ}, 0 < c → ∀ (u : ℝ), 0 < x → rexp (-x) * x ^ (u - 1) = f c u x ^ (1 / c)
c u : ℝ
hc : 0 < c
hu : 0 < u
A : ENNReal.ofReal (1 / c) ≠ 0
B : ENNReal.ofReal (1 / c) ≠ ⊤
x : ℝ
hx : x ∈ Ioi 0
⊢ f c u x ^ (1 / c) = ‖rexp (-c * x) * x ^ (c * (u - 1))‖ ^ (1 / c)
[PROOFSTEP]
congr 1
[GOAL]
case e_a
s t a b : ℝ
hs : 0 < s
ht : 0 < t
ha : 0 < a
hb : 0 < b
hab : a + b = 1
f : ℝ → ℝ → ℝ → ℝ := fun c u x => rexp (-c * x) * x ^ (c * (u - 1))
e : IsConjugateExponent (1 / a) (1 / b)
hab' : b = 1 - a
hst : 0 < a * s + b * t
posf : ∀ (c u x : ℝ), x ∈ Ioi 0 → 0 ≤ f c u x
posf' : ∀ (c u : ℝ), ∀ᵐ (x : ℝ) ∂Measure.restrict volume (Ioi 0), 0 ≤ f c u x
fpow : ∀ {c x : ℝ}, 0 < c → ∀ (u : ℝ), 0 < x → rexp (-x) * x ^ (u - 1) = f c u x ^ (1 / c)
c u : ℝ
hc : 0 < c
hu : 0 < u
A : ENNReal.ofReal (1 / c) ≠ 0
B : ENNReal.ofReal (1 / c) ≠ ⊤
x : ℝ
hx : x ∈ Ioi 0
⊢ f c u x = ‖rexp (-c * x) * x ^ (c * (u - 1))‖
[PROOFSTEP]
exact (norm_of_nonneg (posf _ _ x hx)).symm
[GOAL]
s t a b : ℝ
hs : 0 < s
ht : 0 < t
ha : 0 < a
hb : 0 < b
hab : a + b = 1
f : ℝ → ℝ → ℝ → ℝ := fun c u x => rexp (-c * x) * x ^ (c * (u - 1))
e : IsConjugateExponent (1 / a) (1 / b)
hab' : b = 1 - a
hst : 0 < a * s + b * t
posf : ∀ (c u x : ℝ), x ∈ Ioi 0 → 0 ≤ f c u x
posf' : ∀ (c u : ℝ), ∀ᵐ (x : ℝ) ∂Measure.restrict volume (Ioi 0), 0 ≤ f c u x
fpow : ∀ {c x : ℝ}, 0 < c → ∀ (u : ℝ), 0 < x → rexp (-x) * x ^ (u - 1) = f c u x ^ (1 / c)
c u : ℝ
hc : 0 < c
hu : 0 < u
A : ENNReal.ofReal (1 / c) ≠ 0
B : ENNReal.ofReal (1 / c) ≠ ⊤
⊢ AEStronglyMeasurable (f c u) (Measure.restrict volume (Ioi 0))
[PROOFSTEP]
refine' ContinuousOn.aestronglyMeasurable _ measurableSet_Ioi
[GOAL]
s t a b : ℝ
hs : 0 < s
ht : 0 < t
ha : 0 < a
hb : 0 < b
hab : a + b = 1
f : ℝ → ℝ → ℝ → ℝ := fun c u x => rexp (-c * x) * x ^ (c * (u - 1))
e : IsConjugateExponent (1 / a) (1 / b)
hab' : b = 1 - a
hst : 0 < a * s + b * t
posf : ∀ (c u x : ℝ), x ∈ Ioi 0 → 0 ≤ f c u x
posf' : ∀ (c u : ℝ), ∀ᵐ (x : ℝ) ∂Measure.restrict volume (Ioi 0), 0 ≤ f c u x
fpow : ∀ {c x : ℝ}, 0 < c → ∀ (u : ℝ), 0 < x → rexp (-x) * x ^ (u - 1) = f c u x ^ (1 / c)
c u : ℝ
hc : 0 < c
hu : 0 < u
A : ENNReal.ofReal (1 / c) ≠ 0
B : ENNReal.ofReal (1 / c) ≠ ⊤
⊢ ContinuousOn (f c u) (Ioi 0)
[PROOFSTEP]
refine' (Continuous.continuousOn _).mul (ContinuousAt.continuousOn fun x hx => _)
[GOAL]
case refine'_1
s t a b : ℝ
hs : 0 < s
ht : 0 < t
ha : 0 < a
hb : 0 < b
hab : a + b = 1
f : ℝ → ℝ → ℝ → ℝ := fun c u x => rexp (-c * x) * x ^ (c * (u - 1))
e : IsConjugateExponent (1 / a) (1 / b)
hab' : b = 1 - a
hst : 0 < a * s + b * t
posf : ∀ (c u x : ℝ), x ∈ Ioi 0 → 0 ≤ f c u x
posf' : ∀ (c u : ℝ), ∀ᵐ (x : ℝ) ∂Measure.restrict volume (Ioi 0), 0 ≤ f c u x
fpow : ∀ {c x : ℝ}, 0 < c → ∀ (u : ℝ), 0 < x → rexp (-x) * x ^ (u - 1) = f c u x ^ (1 / c)
c u : ℝ
hc : 0 < c
hu : 0 < u
A : ENNReal.ofReal (1 / c) ≠ 0
B : ENNReal.ofReal (1 / c) ≠ ⊤
⊢ Continuous fun x => rexp (-c * x)
[PROOFSTEP]
exact continuous_exp.comp (continuous_const.mul continuous_id')
[GOAL]
case refine'_2
s t a b : ℝ
hs : 0 < s
ht : 0 < t
ha : 0 < a
hb : 0 < b
hab : a + b = 1
f : ℝ → ℝ → ℝ → ℝ := fun c u x => rexp (-c * x) * x ^ (c * (u - 1))
e : IsConjugateExponent (1 / a) (1 / b)
hab' : b = 1 - a
hst : 0 < a * s + b * t
posf : ∀ (c u x : ℝ), x ∈ Ioi 0 → 0 ≤ f c u x
posf' : ∀ (c u : ℝ), ∀ᵐ (x : ℝ) ∂Measure.restrict volume (Ioi 0), 0 ≤ f c u x
fpow : ∀ {c x : ℝ}, 0 < c → ∀ (u : ℝ), 0 < x → rexp (-x) * x ^ (u - 1) = f c u x ^ (1 / c)
c u : ℝ
hc : 0 < c
hu : 0 < u
A : ENNReal.ofReal (1 / c) ≠ 0
B : ENNReal.ofReal (1 / c) ≠ ⊤
x : ℝ
hx : x ∈ Ioi 0
⊢ ContinuousAt (fun x => x ^ (c * (u - 1))) x
[PROOFSTEP]
exact
  continuousAt_rpow_const _ _
    (Or.inl (mem_Ioi.mp hx).ne')
      -- now apply Hölder:
[GOAL]
s t a b : ℝ
hs : 0 < s
ht : 0 < t
ha : 0 < a
hb : 0 < b
hab : a + b = 1
f : ℝ → ℝ → ℝ → ℝ := fun c u x => rexp (-c * x) * x ^ (c * (u - 1))
e : IsConjugateExponent (1 / a) (1 / b)
hab' : b = 1 - a
hst : 0 < a * s + b * t
posf : ∀ (c u x : ℝ), x ∈ Ioi 0 → 0 ≤ f c u x
posf' : ∀ (c u : ℝ), ∀ᵐ (x : ℝ) ∂Measure.restrict volume (Ioi 0), 0 ≤ f c u x
fpow : ∀ {c x : ℝ}, 0 < c → ∀ (u : ℝ), 0 < x → rexp (-x) * x ^ (u - 1) = f c u x ^ (1 / c)
f_mem_Lp : ∀ {c u : ℝ}, 0 < c → 0 < u → Memℒp (f c u) (ENNReal.ofReal (1 / c))
⊢ Gamma (a * s + b * t) ≤ Gamma s ^ a * Gamma t ^ b
[PROOFSTEP]
rw [Gamma_eq_integral hs, Gamma_eq_integral ht, Gamma_eq_integral hst]
[GOAL]
s t a b : ℝ
hs : 0 < s
ht : 0 < t
ha : 0 < a
hb : 0 < b
hab : a + b = 1
f : ℝ → ℝ → ℝ → ℝ := fun c u x => rexp (-c * x) * x ^ (c * (u - 1))
e : IsConjugateExponent (1 / a) (1 / b)
hab' : b = 1 - a
hst : 0 < a * s + b * t
posf : ∀ (c u x : ℝ), x ∈ Ioi 0 → 0 ≤ f c u x
posf' : ∀ (c u : ℝ), ∀ᵐ (x : ℝ) ∂Measure.restrict volume (Ioi 0), 0 ≤ f c u x
fpow : ∀ {c x : ℝ}, 0 < c → ∀ (u : ℝ), 0 < x → rexp (-x) * x ^ (u - 1) = f c u x ^ (1 / c)
f_mem_Lp : ∀ {c u : ℝ}, 0 < c → 0 < u → Memℒp (f c u) (ENNReal.ofReal (1 / c))
⊢ ∫ (x : ℝ) in Ioi 0, rexp (-x) * x ^ (a * s + b * t - 1) ≤
    (∫ (x : ℝ) in Ioi 0, rexp (-x) * x ^ (s - 1)) ^ a * (∫ (x : ℝ) in Ioi 0, rexp (-x) * x ^ (t - 1)) ^ b
[PROOFSTEP]
convert
  MeasureTheory.integral_mul_le_Lp_mul_Lq_of_nonneg e (posf' a s) (posf' b t) (f_mem_Lp ha hs) (f_mem_Lp hb ht) using 1
[GOAL]
case h.e'_3
s t a b : ℝ
hs : 0 < s
ht : 0 < t
ha : 0 < a
hb : 0 < b
hab : a + b = 1
f : ℝ → ℝ → ℝ → ℝ := fun c u x => rexp (-c * x) * x ^ (c * (u - 1))
e : IsConjugateExponent (1 / a) (1 / b)
hab' : b = 1 - a
hst : 0 < a * s + b * t
posf : ∀ (c u x : ℝ), x ∈ Ioi 0 → 0 ≤ f c u x
posf' : ∀ (c u : ℝ), ∀ᵐ (x : ℝ) ∂Measure.restrict volume (Ioi 0), 0 ≤ f c u x
fpow : ∀ {c x : ℝ}, 0 < c → ∀ (u : ℝ), 0 < x → rexp (-x) * x ^ (u - 1) = f c u x ^ (1 / c)
f_mem_Lp : ∀ {c u : ℝ}, 0 < c → 0 < u → Memℒp (f c u) (ENNReal.ofReal (1 / c))
⊢ ∫ (x : ℝ) in Ioi 0, rexp (-x) * x ^ (a * s + b * t - 1) = ∫ (a_1 : ℝ) in Ioi 0, f a s a_1 * f b t a_1
[PROOFSTEP]
refine' set_integral_congr measurableSet_Ioi fun x hx => _
[GOAL]
case h.e'_3
s t a b : ℝ
hs : 0 < s
ht : 0 < t
ha : 0 < a
hb : 0 < b
hab : a + b = 1
f : ℝ → ℝ → ℝ → ℝ := fun c u x => rexp (-c * x) * x ^ (c * (u - 1))
e : IsConjugateExponent (1 / a) (1 / b)
hab' : b = 1 - a
hst : 0 < a * s + b * t
posf : ∀ (c u x : ℝ), x ∈ Ioi 0 → 0 ≤ f c u x
posf' : ∀ (c u : ℝ), ∀ᵐ (x : ℝ) ∂Measure.restrict volume (Ioi 0), 0 ≤ f c u x
fpow : ∀ {c x : ℝ}, 0 < c → ∀ (u : ℝ), 0 < x → rexp (-x) * x ^ (u - 1) = f c u x ^ (1 / c)
f_mem_Lp : ∀ {c u : ℝ}, 0 < c → 0 < u → Memℒp (f c u) (ENNReal.ofReal (1 / c))
x : ℝ
hx : x ∈ Ioi 0
⊢ rexp (-x) * x ^ (a * s + b * t - 1) = f a s x * f b t x
[PROOFSTEP]
dsimp only
[GOAL]
case h.e'_3
s t a b : ℝ
hs : 0 < s
ht : 0 < t
ha : 0 < a
hb : 0 < b
hab : a + b = 1
f : ℝ → ℝ → ℝ → ℝ := fun c u x => rexp (-c * x) * x ^ (c * (u - 1))
e : IsConjugateExponent (1 / a) (1 / b)
hab' : b = 1 - a
hst : 0 < a * s + b * t
posf : ∀ (c u x : ℝ), x ∈ Ioi 0 → 0 ≤ f c u x
posf' : ∀ (c u : ℝ), ∀ᵐ (x : ℝ) ∂Measure.restrict volume (Ioi 0), 0 ≤ f c u x
fpow : ∀ {c x : ℝ}, 0 < c → ∀ (u : ℝ), 0 < x → rexp (-x) * x ^ (u - 1) = f c u x ^ (1 / c)
f_mem_Lp : ∀ {c u : ℝ}, 0 < c → 0 < u → Memℒp (f c u) (ENNReal.ofReal (1 / c))
x : ℝ
hx : x ∈ Ioi 0
⊢ rexp (-x) * x ^ (a * s + b * t - 1) = rexp (-a * x) * x ^ (a * (s - 1)) * (rexp (-b * x) * x ^ (b * (t - 1)))
[PROOFSTEP]
have A : exp (-x) = exp (-a * x) * exp (-b * x) := by rw [← exp_add, ← add_mul, ← neg_add, hab, neg_one_mul]
[GOAL]
s t a b : ℝ
hs : 0 < s
ht : 0 < t
ha : 0 < a
hb : 0 < b
hab : a + b = 1
f : ℝ → ℝ → ℝ → ℝ := fun c u x => rexp (-c * x) * x ^ (c * (u - 1))
e : IsConjugateExponent (1 / a) (1 / b)
hab' : b = 1 - a
hst : 0 < a * s + b * t
posf : ∀ (c u x : ℝ), x ∈ Ioi 0 → 0 ≤ f c u x
posf' : ∀ (c u : ℝ), ∀ᵐ (x : ℝ) ∂Measure.restrict volume (Ioi 0), 0 ≤ f c u x
fpow : ∀ {c x : ℝ}, 0 < c → ∀ (u : ℝ), 0 < x → rexp (-x) * x ^ (u - 1) = f c u x ^ (1 / c)
f_mem_Lp : ∀ {c u : ℝ}, 0 < c → 0 < u → Memℒp (f c u) (ENNReal.ofReal (1 / c))
x : ℝ
hx : x ∈ Ioi 0
⊢ rexp (-x) = rexp (-a * x) * rexp (-b * x)
[PROOFSTEP]
rw [← exp_add, ← add_mul, ← neg_add, hab, neg_one_mul]
[GOAL]
case h.e'_3
s t a b : ℝ
hs : 0 < s
ht : 0 < t
ha : 0 < a
hb : 0 < b
hab : a + b = 1
f : ℝ → ℝ → ℝ → ℝ := fun c u x => rexp (-c * x) * x ^ (c * (u - 1))
e : IsConjugateExponent (1 / a) (1 / b)
hab' : b = 1 - a
hst : 0 < a * s + b * t
posf : ∀ (c u x : ℝ), x ∈ Ioi 0 → 0 ≤ f c u x
posf' : ∀ (c u : ℝ), ∀ᵐ (x : ℝ) ∂Measure.restrict volume (Ioi 0), 0 ≤ f c u x
fpow : ∀ {c x : ℝ}, 0 < c → ∀ (u : ℝ), 0 < x → rexp (-x) * x ^ (u - 1) = f c u x ^ (1 / c)
f_mem_Lp : ∀ {c u : ℝ}, 0 < c → 0 < u → Memℒp (f c u) (ENNReal.ofReal (1 / c))
x : ℝ
hx : x ∈ Ioi 0
A : rexp (-x) = rexp (-a * x) * rexp (-b * x)
⊢ rexp (-x) * x ^ (a * s + b * t - 1) = rexp (-a * x) * x ^ (a * (s - 1)) * (rexp (-b * x) * x ^ (b * (t - 1)))
[PROOFSTEP]
have B : x ^ (a * s + b * t - 1) = x ^ (a * (s - 1)) * x ^ (b * (t - 1)) := by rw [← rpow_add hx, hab']; congr 1; ring
[GOAL]
s t a b : ℝ
hs : 0 < s
ht : 0 < t
ha : 0 < a
hb : 0 < b
hab : a + b = 1
f : ℝ → ℝ → ℝ → ℝ := fun c u x => rexp (-c * x) * x ^ (c * (u - 1))
e : IsConjugateExponent (1 / a) (1 / b)
hab' : b = 1 - a
hst : 0 < a * s + b * t
posf : ∀ (c u x : ℝ), x ∈ Ioi 0 → 0 ≤ f c u x
posf' : ∀ (c u : ℝ), ∀ᵐ (x : ℝ) ∂Measure.restrict volume (Ioi 0), 0 ≤ f c u x
fpow : ∀ {c x : ℝ}, 0 < c → ∀ (u : ℝ), 0 < x → rexp (-x) * x ^ (u - 1) = f c u x ^ (1 / c)
f_mem_Lp : ∀ {c u : ℝ}, 0 < c → 0 < u → Memℒp (f c u) (ENNReal.ofReal (1 / c))
x : ℝ
hx : x ∈ Ioi 0
A : rexp (-x) = rexp (-a * x) * rexp (-b * x)
⊢ x ^ (a * s + b * t - 1) = x ^ (a * (s - 1)) * x ^ (b * (t - 1))
[PROOFSTEP]
rw [← rpow_add hx, hab']
[GOAL]
s t a b : ℝ
hs : 0 < s
ht : 0 < t
ha : 0 < a
hb : 0 < b
hab : a + b = 1
f : ℝ → ℝ → ℝ → ℝ := fun c u x => rexp (-c * x) * x ^ (c * (u - 1))
e : IsConjugateExponent (1 / a) (1 / b)
hab' : b = 1 - a
hst : 0 < a * s + b * t
posf : ∀ (c u x : ℝ), x ∈ Ioi 0 → 0 ≤ f c u x
posf' : ∀ (c u : ℝ), ∀ᵐ (x : ℝ) ∂Measure.restrict volume (Ioi 0), 0 ≤ f c u x
fpow : ∀ {c x : ℝ}, 0 < c → ∀ (u : ℝ), 0 < x → rexp (-x) * x ^ (u - 1) = f c u x ^ (1 / c)
f_mem_Lp : ∀ {c u : ℝ}, 0 < c → 0 < u → Memℒp (f c u) (ENNReal.ofReal (1 / c))
x : ℝ
hx : x ∈ Ioi 0
A : rexp (-x) = rexp (-a * x) * rexp (-b * x)
⊢ x ^ (a * s + (1 - a) * t - 1) = x ^ (a * (s - 1) + (1 - a) * (t - 1))
[PROOFSTEP]
congr 1
[GOAL]
case e_a
s t a b : ℝ
hs : 0 < s
ht : 0 < t
ha : 0 < a
hb : 0 < b
hab : a + b = 1
f : ℝ → ℝ → ℝ → ℝ := fun c u x => rexp (-c * x) * x ^ (c * (u - 1))
e : IsConjugateExponent (1 / a) (1 / b)
hab' : b = 1 - a
hst : 0 < a * s + b * t
posf : ∀ (c u x : ℝ), x ∈ Ioi 0 → 0 ≤ f c u x
posf' : ∀ (c u : ℝ), ∀ᵐ (x : ℝ) ∂Measure.restrict volume (Ioi 0), 0 ≤ f c u x
fpow : ∀ {c x : ℝ}, 0 < c → ∀ (u : ℝ), 0 < x → rexp (-x) * x ^ (u - 1) = f c u x ^ (1 / c)
f_mem_Lp : ∀ {c u : ℝ}, 0 < c → 0 < u → Memℒp (f c u) (ENNReal.ofReal (1 / c))
x : ℝ
hx : x ∈ Ioi 0
A : rexp (-x) = rexp (-a * x) * rexp (-b * x)
⊢ a * s + (1 - a) * t - 1 = a * (s - 1) + (1 - a) * (t - 1)
[PROOFSTEP]
ring
[GOAL]
case h.e'_3
s t a b : ℝ
hs : 0 < s
ht : 0 < t
ha : 0 < a
hb : 0 < b
hab : a + b = 1
f : ℝ → ℝ → ℝ → ℝ := fun c u x => rexp (-c * x) * x ^ (c * (u - 1))
e : IsConjugateExponent (1 / a) (1 / b)
hab' : b = 1 - a
hst : 0 < a * s + b * t
posf : ∀ (c u x : ℝ), x ∈ Ioi 0 → 0 ≤ f c u x
posf' : ∀ (c u : ℝ), ∀ᵐ (x : ℝ) ∂Measure.restrict volume (Ioi 0), 0 ≤ f c u x
fpow : ∀ {c x : ℝ}, 0 < c → ∀ (u : ℝ), 0 < x → rexp (-x) * x ^ (u - 1) = f c u x ^ (1 / c)
f_mem_Lp : ∀ {c u : ℝ}, 0 < c → 0 < u → Memℒp (f c u) (ENNReal.ofReal (1 / c))
x : ℝ
hx : x ∈ Ioi 0
A : rexp (-x) = rexp (-a * x) * rexp (-b * x)
B : x ^ (a * s + b * t - 1) = x ^ (a * (s - 1)) * x ^ (b * (t - 1))
⊢ rexp (-x) * x ^ (a * s + b * t - 1) = rexp (-a * x) * x ^ (a * (s - 1)) * (rexp (-b * x) * x ^ (b * (t - 1)))
[PROOFSTEP]
rw [A, B]
[GOAL]
case h.e'_3
s t a b : ℝ
hs : 0 < s
ht : 0 < t
ha : 0 < a
hb : 0 < b
hab : a + b = 1
f : ℝ → ℝ → ℝ → ℝ := fun c u x => rexp (-c * x) * x ^ (c * (u - 1))
e : IsConjugateExponent (1 / a) (1 / b)
hab' : b = 1 - a
hst : 0 < a * s + b * t
posf : ∀ (c u x : ℝ), x ∈ Ioi 0 → 0 ≤ f c u x
posf' : ∀ (c u : ℝ), ∀ᵐ (x : ℝ) ∂Measure.restrict volume (Ioi 0), 0 ≤ f c u x
fpow : ∀ {c x : ℝ}, 0 < c → ∀ (u : ℝ), 0 < x → rexp (-x) * x ^ (u - 1) = f c u x ^ (1 / c)
f_mem_Lp : ∀ {c u : ℝ}, 0 < c → 0 < u → Memℒp (f c u) (ENNReal.ofReal (1 / c))
x : ℝ
hx : x ∈ Ioi 0
A : rexp (-x) = rexp (-a * x) * rexp (-b * x)
B : x ^ (a * s + b * t - 1) = x ^ (a * (s - 1)) * x ^ (b * (t - 1))
⊢ rexp (-a * x) * rexp (-b * x) * (x ^ (a * (s - 1)) * x ^ (b * (t - 1))) =
    rexp (-a * x) * x ^ (a * (s - 1)) * (rexp (-b * x) * x ^ (b * (t - 1)))
[PROOFSTEP]
ring
[GOAL]
case h.e'_4
s t a b : ℝ
hs : 0 < s
ht : 0 < t
ha : 0 < a
hb : 0 < b
hab : a + b = 1
f : ℝ → ℝ → ℝ → ℝ := fun c u x => rexp (-c * x) * x ^ (c * (u - 1))
e : IsConjugateExponent (1 / a) (1 / b)
hab' : b = 1 - a
hst : 0 < a * s + b * t
posf : ∀ (c u x : ℝ), x ∈ Ioi 0 → 0 ≤ f c u x
posf' : ∀ (c u : ℝ), ∀ᵐ (x : ℝ) ∂Measure.restrict volume (Ioi 0), 0 ≤ f c u x
fpow : ∀ {c x : ℝ}, 0 < c → ∀ (u : ℝ), 0 < x → rexp (-x) * x ^ (u - 1) = f c u x ^ (1 / c)
f_mem_Lp : ∀ {c u : ℝ}, 0 < c → 0 < u → Memℒp (f c u) (ENNReal.ofReal (1 / c))
⊢ (∫ (x : ℝ) in Ioi 0, rexp (-x) * x ^ (s - 1)) ^ a * (∫ (x : ℝ) in Ioi 0, rexp (-x) * x ^ (t - 1)) ^ b =
    (∫ (a_1 : ℝ) in Ioi 0, f a s a_1 ^ (1 / a)) ^ (1 / (1 / a)) *
      (∫ (a : ℝ) in Ioi 0, f b t a ^ (1 / b)) ^ (1 / (1 / b))
[PROOFSTEP]
rw [one_div_one_div, one_div_one_div]
[GOAL]
case h.e'_4
s t a b : ℝ
hs : 0 < s
ht : 0 < t
ha : 0 < a
hb : 0 < b
hab : a + b = 1
f : ℝ → ℝ → ℝ → ℝ := fun c u x => rexp (-c * x) * x ^ (c * (u - 1))
e : IsConjugateExponent (1 / a) (1 / b)
hab' : b = 1 - a
hst : 0 < a * s + b * t
posf : ∀ (c u x : ℝ), x ∈ Ioi 0 → 0 ≤ f c u x
posf' : ∀ (c u : ℝ), ∀ᵐ (x : ℝ) ∂Measure.restrict volume (Ioi 0), 0 ≤ f c u x
fpow : ∀ {c x : ℝ}, 0 < c → ∀ (u : ℝ), 0 < x → rexp (-x) * x ^ (u - 1) = f c u x ^ (1 / c)
f_mem_Lp : ∀ {c u : ℝ}, 0 < c → 0 < u → Memℒp (f c u) (ENNReal.ofReal (1 / c))
⊢ (∫ (x : ℝ) in Ioi 0, rexp (-x) * x ^ (s - 1)) ^ a * (∫ (x : ℝ) in Ioi 0, rexp (-x) * x ^ (t - 1)) ^ b =
    (∫ (a_1 : ℝ) in Ioi 0, f a s a_1 ^ (1 / a)) ^ a * (∫ (a : ℝ) in Ioi 0, f b t a ^ (1 / b)) ^ b
[PROOFSTEP]
congr 2
[GOAL]
case h.e'_4.e_a.e_a
s t a b : ℝ
hs : 0 < s
ht : 0 < t
ha : 0 < a
hb : 0 < b
hab : a + b = 1
f : ℝ → ℝ → ℝ → ℝ := fun c u x => rexp (-c * x) * x ^ (c * (u - 1))
e : IsConjugateExponent (1 / a) (1 / b)
hab' : b = 1 - a
hst : 0 < a * s + b * t
posf : ∀ (c u x : ℝ), x ∈ Ioi 0 → 0 ≤ f c u x
posf' : ∀ (c u : ℝ), ∀ᵐ (x : ℝ) ∂Measure.restrict volume (Ioi 0), 0 ≤ f c u x
fpow : ∀ {c x : ℝ}, 0 < c → ∀ (u : ℝ), 0 < x → rexp (-x) * x ^ (u - 1) = f c u x ^ (1 / c)
f_mem_Lp : ∀ {c u : ℝ}, 0 < c → 0 < u → Memℒp (f c u) (ENNReal.ofReal (1 / c))
⊢ ∫ (x : ℝ) in Ioi 0, rexp (-x) * x ^ (s - 1) = ∫ (a_1 : ℝ) in Ioi 0, f a s a_1 ^ (1 / a)
[PROOFSTEP]
exact set_integral_congr measurableSet_Ioi fun x hx => fpow (by assumption) _ hx
[GOAL]
s t a b : ℝ
hs : 0 < s
ht : 0 < t
ha : 0 < a
hb : 0 < b
hab : a + b = 1
f : ℝ → ℝ → ℝ → ℝ := fun c u x => rexp (-c * x) * x ^ (c * (u - 1))
e : IsConjugateExponent (1 / a) (1 / b)
hab' : b = 1 - a
hst : 0 < a * s + b * t
posf : ∀ (c u x : ℝ), x ∈ Ioi 0 → 0 ≤ f c u x
posf' : ∀ (c u : ℝ), ∀ᵐ (x : ℝ) ∂Measure.restrict volume (Ioi 0), 0 ≤ f c u x
fpow : ∀ {c x : ℝ}, 0 < c → ∀ (u : ℝ), 0 < x → rexp (-x) * x ^ (u - 1) = f c u x ^ (1 / c)
f_mem_Lp : ∀ {c u : ℝ}, 0 < c → 0 < u → Memℒp (f c u) (ENNReal.ofReal (1 / c))
x : ℝ
hx : x ∈ Ioi 0
⊢ 0 < a
[PROOFSTEP]
assumption
[GOAL]
case h.e'_4.e_a.e_a
s t a b : ℝ
hs : 0 < s
ht : 0 < t
ha : 0 < a
hb : 0 < b
hab : a + b = 1
f : ℝ → ℝ → ℝ → ℝ := fun c u x => rexp (-c * x) * x ^ (c * (u - 1))
e : IsConjugateExponent (1 / a) (1 / b)
hab' : b = 1 - a
hst : 0 < a * s + b * t
posf : ∀ (c u x : ℝ), x ∈ Ioi 0 → 0 ≤ f c u x
posf' : ∀ (c u : ℝ), ∀ᵐ (x : ℝ) ∂Measure.restrict volume (Ioi 0), 0 ≤ f c u x
fpow : ∀ {c x : ℝ}, 0 < c → ∀ (u : ℝ), 0 < x → rexp (-x) * x ^ (u - 1) = f c u x ^ (1 / c)
f_mem_Lp : ∀ {c u : ℝ}, 0 < c → 0 < u → Memℒp (f c u) (ENNReal.ofReal (1 / c))
⊢ ∫ (x : ℝ) in Ioi 0, rexp (-x) * x ^ (t - 1) = ∫ (a : ℝ) in Ioi 0, f b t a ^ (1 / b)
[PROOFSTEP]
exact set_integral_congr measurableSet_Ioi fun x hx => fpow (by assumption) _ hx
[GOAL]
s t a b : ℝ
hs : 0 < s
ht : 0 < t
ha : 0 < a
hb : 0 < b
hab : a + b = 1
f : ℝ → ℝ → ℝ → ℝ := fun c u x => rexp (-c * x) * x ^ (c * (u - 1))
e : IsConjugateExponent (1 / a) (1 / b)
hab' : b = 1 - a
hst : 0 < a * s + b * t
posf : ∀ (c u x : ℝ), x ∈ Ioi 0 → 0 ≤ f c u x
posf' : ∀ (c u : ℝ), ∀ᵐ (x : ℝ) ∂Measure.restrict volume (Ioi 0), 0 ≤ f c u x
fpow : ∀ {c x : ℝ}, 0 < c → ∀ (u : ℝ), 0 < x → rexp (-x) * x ^ (u - 1) = f c u x ^ (1 / c)
f_mem_Lp : ∀ {c u : ℝ}, 0 < c → 0 < u → Memℒp (f c u) (ENNReal.ofReal (1 / c))
x : ℝ
hx : x ∈ Ioi 0
⊢ 0 < b
[PROOFSTEP]
assumption
[GOAL]
⊢ ConvexOn ℝ (Ioi 0) (log ∘ Gamma)
[PROOFSTEP]
refine' convexOn_iff_forall_pos.mpr ⟨convex_Ioi _, fun x hx y hy a b ha hb hab => _⟩
[GOAL]
x : ℝ
hx : x ∈ Ioi 0
y : ℝ
hy : y ∈ Ioi 0
a b : ℝ
ha : 0 < a
hb : 0 < b
hab : a + b = 1
⊢ (log ∘ Gamma) (a • x + b • y) ≤ a • (log ∘ Gamma) x + b • (log ∘ Gamma) y
[PROOFSTEP]
have : b = 1 - a := by linarith
[GOAL]
x : ℝ
hx : x ∈ Ioi 0
y : ℝ
hy : y ∈ Ioi 0
a b : ℝ
ha : 0 < a
hb : 0 < b
hab : a + b = 1
⊢ b = 1 - a
[PROOFSTEP]
linarith
[GOAL]
x : ℝ
hx : x ∈ Ioi 0
y : ℝ
hy : y ∈ Ioi 0
a b : ℝ
ha : 0 < a
hb : 0 < b
hab : a + b = 1
this : b = 1 - a
⊢ (log ∘ Gamma) (a • x + b • y) ≤ a • (log ∘ Gamma) x + b • (log ∘ Gamma) y
[PROOFSTEP]
subst this
[GOAL]
x : ℝ
hx : x ∈ Ioi 0
y : ℝ
hy : y ∈ Ioi 0
a : ℝ
ha : 0 < a
hb : 0 < 1 - a
hab : a + (1 - a) = 1
⊢ (log ∘ Gamma) (a • x + (1 - a) • y) ≤ a • (log ∘ Gamma) x + (1 - a) • (log ∘ Gamma) y
[PROOFSTEP]
simp_rw [Function.comp_apply, smul_eq_mul]
[GOAL]
x : ℝ
hx : x ∈ Ioi 0
y : ℝ
hy : y ∈ Ioi 0
a : ℝ
ha : 0 < a
hb : 0 < 1 - a
hab : a + (1 - a) = 1
⊢ log (Gamma (a * x + (1 - a) * y)) ≤ a * log (Gamma x) + (1 - a) * log (Gamma y)
[PROOFSTEP]
rw [← log_rpow (Gamma_pos_of_pos hy), ← log_rpow (Gamma_pos_of_pos hx), ←
  log_mul (rpow_pos_of_pos (Gamma_pos_of_pos hx) _).ne' (rpow_pos_of_pos (Gamma_pos_of_pos hy) _).ne',
  log_le_log (Gamma_pos_of_pos (add_pos (mul_pos ha hx) (mul_pos hb hy)))
    (mul_pos (rpow_pos_of_pos (Gamma_pos_of_pos hx) _) (rpow_pos_of_pos (Gamma_pos_of_pos hy) _))]
[GOAL]
x : ℝ
hx : x ∈ Ioi 0
y : ℝ
hy : y ∈ Ioi 0
a : ℝ
ha : 0 < a
hb : 0 < 1 - a
hab : a + (1 - a) = 1
⊢ Gamma (a * x + (1 - a) * y) ≤ Gamma x ^ a * Gamma y ^ (1 - a)
[PROOFSTEP]
exact Gamma_mul_add_mul_le_rpow_Gamma_mul_rpow_Gamma hx hy ha hb hab
[GOAL]
⊢ ConvexOn ℝ (Ioi 0) Gamma
[PROOFSTEP]
refine'
  ((convexOn_exp.subset (subset_univ _) _).comp convexOn_log_Gamma (exp_monotone.monotoneOn _)).congr fun x hx =>
    exp_log (Gamma_pos_of_pos hx)
[GOAL]
⊢ Convex ℝ (log ∘ Gamma '' Ioi 0)
[PROOFSTEP]
rw [convex_iff_isPreconnected]
[GOAL]
⊢ IsPreconnected (log ∘ Gamma '' Ioi 0)
[PROOFSTEP]
refine' isPreconnected_Ioi.image _ fun x hx => ContinuousAt.continuousWithinAt _
[GOAL]
x : ℝ
hx : x ∈ Ioi 0
⊢ ContinuousAt (log ∘ Gamma) x
[PROOFSTEP]
refine' (differentiableAt_Gamma fun m => _).continuousAt.log (Gamma_pos_of_pos hx).ne'
[GOAL]
x : ℝ
hx : x ∈ Ioi 0
m : ℕ
⊢ x ≠ -↑m
[PROOFSTEP]
exact (neg_lt_iff_pos_add.mpr (add_pos_of_pos_of_nonneg (mem_Ioi.mp hx) (Nat.cast_nonneg m))).ne'
[GOAL]
f : ℝ → ℝ
x : ℝ
n : ℕ
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hn : n ≠ 0
⊢ f ↑n = f 1 + log ↑(n - 1)!
[PROOFSTEP]
refine' Nat.le_induction (by simp) (fun m hm IH => _) n (Nat.one_le_iff_ne_zero.2 hn)
[GOAL]
f : ℝ → ℝ
x : ℝ
n : ℕ
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hn : n ≠ 0
⊢ f ↑1 = f 1 + log ↑(1 - 1)!
[PROOFSTEP]
simp
[GOAL]
f : ℝ → ℝ
x : ℝ
n : ℕ
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hn : n ≠ 0
m : ℕ
hm : 1 ≤ m
IH : f ↑m = f 1 + log ↑(m - 1)!
⊢ f ↑(m + 1) = f 1 + log ↑(m + 1 - 1)!
[PROOFSTEP]
have A : 0 < (m : ℝ) := Nat.cast_pos.2 hm
[GOAL]
f : ℝ → ℝ
x : ℝ
n : ℕ
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hn : n ≠ 0
m : ℕ
hm : 1 ≤ m
IH : f ↑m = f 1 + log ↑(m - 1)!
A : 0 < ↑m
⊢ f ↑(m + 1) = f 1 + log ↑(m + 1 - 1)!
[PROOFSTEP]
simp only [hf_feq A, Nat.cast_add, Nat.cast_one, Nat.add_succ_sub_one, add_zero]
[GOAL]
f : ℝ → ℝ
x : ℝ
n : ℕ
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hn : n ≠ 0
m : ℕ
hm : 1 ≤ m
IH : f ↑m = f 1 + log ↑(m - 1)!
A : 0 < ↑m
⊢ f ↑m + log ↑m = f 1 + log ↑m !
[PROOFSTEP]
rw [IH, add_assoc, ← log_mul (Nat.cast_ne_zero.mpr (Nat.factorial_ne_zero _)) A.ne', ← Nat.cast_mul]
[GOAL]
f : ℝ → ℝ
x : ℝ
n : ℕ
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hn : n ≠ 0
m : ℕ
hm : 1 ≤ m
IH : f ↑m = f 1 + log ↑(m - 1)!
A : 0 < ↑m
⊢ f 1 + log ↑((m - 1)! * m) = f 1 + log ↑m !
[PROOFSTEP]
conv_rhs => rw [← Nat.succ_pred_eq_of_pos hm, Nat.factorial_succ, mul_comm]
[GOAL]
f : ℝ → ℝ
x : ℝ
n : ℕ
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hn : n ≠ 0
m : ℕ
hm : 1 ≤ m
IH : f ↑m = f 1 + log ↑(m - 1)!
A : 0 < ↑m
| f 1 + log ↑m !
[PROOFSTEP]
rw [← Nat.succ_pred_eq_of_pos hm, Nat.factorial_succ, mul_comm]
[GOAL]
f : ℝ → ℝ
x : ℝ
n : ℕ
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hn : n ≠ 0
m : ℕ
hm : 1 ≤ m
IH : f ↑m = f 1 + log ↑(m - 1)!
A : 0 < ↑m
| f 1 + log ↑m !
[PROOFSTEP]
rw [← Nat.succ_pred_eq_of_pos hm, Nat.factorial_succ, mul_comm]
[GOAL]
f : ℝ → ℝ
x : ℝ
n : ℕ
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hn : n ≠ 0
m : ℕ
hm : 1 ≤ m
IH : f ↑m = f 1 + log ↑(m - 1)!
A : 0 < ↑m
| f 1 + log ↑m !
[PROOFSTEP]
rw [← Nat.succ_pred_eq_of_pos hm, Nat.factorial_succ, mul_comm]
[GOAL]
f : ℝ → ℝ
x : ℝ
n : ℕ
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hn : n ≠ 0
m : ℕ
hm : 1 ≤ m
IH : f ↑m = f 1 + log ↑(m - 1)!
A : 0 < ↑m
⊢ f 1 + log ↑((m - 1)! * m) = f 1 + log ↑((Nat.pred m)! * (Nat.pred m + 1))
[PROOFSTEP]
congr
[GOAL]
case e_a.e_x.e_a.e_a
f : ℝ → ℝ
x : ℝ
n : ℕ
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hn : n ≠ 0
m : ℕ
hm : 1 ≤ m
IH : f ↑m = f 1 + log ↑(m - 1)!
A : 0 < ↑m
⊢ m = Nat.pred m + 1
[PROOFSTEP]
exact (Nat.succ_pred_eq_of_pos hm).symm
[GOAL]
f : ℝ → ℝ
x : ℝ
n✝ : ℕ
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx : 0 < x
n : ℕ
⊢ f (x + ↑n) = f x + ∑ m in Finset.range n, log (x + ↑m)
[PROOFSTEP]
induction' n with n hn
[GOAL]
case zero
f : ℝ → ℝ
x : ℝ
n : ℕ
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx : 0 < x
⊢ f (x + ↑Nat.zero) = f x + ∑ m in Finset.range Nat.zero, log (x + ↑m)
[PROOFSTEP]
simp
[GOAL]
case succ
f : ℝ → ℝ
x : ℝ
n✝ : ℕ
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx : 0 < x
n : ℕ
hn : f (x + ↑n) = f x + ∑ m in Finset.range n, log (x + ↑m)
⊢ f (x + ↑(Nat.succ n)) = f x + ∑ m in Finset.range (Nat.succ n), log (x + ↑m)
[PROOFSTEP]
have : x + n.succ = x + n + 1 := by push_cast ; ring
[GOAL]
f : ℝ → ℝ
x : ℝ
n✝ : ℕ
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx : 0 < x
n : ℕ
hn : f (x + ↑n) = f x + ∑ m in Finset.range n, log (x + ↑m)
⊢ x + ↑(Nat.succ n) = x + ↑n + 1
[PROOFSTEP]
push_cast
[GOAL]
f : ℝ → ℝ
x : ℝ
n✝ : ℕ
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx : 0 < x
n : ℕ
hn : f (x + ↑n) = f x + ∑ m in Finset.range n, log (x + ↑m)
⊢ x + (↑n + 1) = x + ↑n + 1
[PROOFSTEP]
ring
[GOAL]
case succ
f : ℝ → ℝ
x : ℝ
n✝ : ℕ
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx : 0 < x
n : ℕ
hn : f (x + ↑n) = f x + ∑ m in Finset.range n, log (x + ↑m)
this : x + ↑(Nat.succ n) = x + ↑n + 1
⊢ f (x + ↑(Nat.succ n)) = f x + ∑ m in Finset.range (Nat.succ n), log (x + ↑m)
[PROOFSTEP]
rw [this, hf_feq, hn]
[GOAL]
case succ
f : ℝ → ℝ
x : ℝ
n✝ : ℕ
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx : 0 < x
n : ℕ
hn : f (x + ↑n) = f x + ∑ m in Finset.range n, log (x + ↑m)
this : x + ↑(Nat.succ n) = x + ↑n + 1
⊢ f x + ∑ m in Finset.range n, log (x + ↑m) + log (x + ↑n) = f x + ∑ m in Finset.range (Nat.succ n), log (x + ↑m)
case succ
f : ℝ → ℝ
x : ℝ
n✝ : ℕ
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx : 0 < x
n : ℕ
hn : f (x + ↑n) = f x + ∑ m in Finset.range n, log (x + ↑m)
this : x + ↑(Nat.succ n) = x + ↑n + 1
⊢ 0 < x + ↑n
[PROOFSTEP]
rw [Finset.range_succ, Finset.sum_insert Finset.not_mem_range_self]
[GOAL]
case succ
f : ℝ → ℝ
x : ℝ
n✝ : ℕ
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx : 0 < x
n : ℕ
hn : f (x + ↑n) = f x + ∑ m in Finset.range n, log (x + ↑m)
this : x + ↑(Nat.succ n) = x + ↑n + 1
⊢ f x + ∑ m in Finset.range n, log (x + ↑m) + log (x + ↑n) =
    f x + (log (x + ↑n) + ∑ x_1 in Finset.range n, log (x + ↑x_1))
case succ
f : ℝ → ℝ
x : ℝ
n✝ : ℕ
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx : 0 < x
n : ℕ
hn : f (x + ↑n) = f x + ∑ m in Finset.range n, log (x + ↑m)
this : x + ↑(Nat.succ n) = x + ↑n + 1
⊢ 0 < x + ↑n
[PROOFSTEP]
abel
[GOAL]
case succ
f : ℝ → ℝ
x : ℝ
n✝ : ℕ
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx : 0 < x
n : ℕ
hn : f (x + ↑n) = f x + ∑ m in Finset.range n, log (x + ↑m)
this : x + ↑(Nat.succ n) = x + ↑n + 1
⊢ f x + ∑ m in Finset.range n, log (x + ↑m) + log (x + ↑n) =
    f x + (log (x + ↑n) + ∑ x_1 in Finset.range n, log (x + ↑x_1))
case succ
f : ℝ → ℝ
x : ℝ
n✝ : ℕ
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx : 0 < x
n : ℕ
hn : f (x + ↑n) = f x + ∑ m in Finset.range n, log (x + ↑m)
this : x + ↑(Nat.succ n) = x + ↑n + 1
⊢ 0 < x + ↑n
[PROOFSTEP]
abel
[GOAL]
case succ
f : ℝ → ℝ
x : ℝ
n✝ : ℕ
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx : 0 < x
n : ℕ
hn : f (x + ↑n) = f x + ∑ m in Finset.range n, log (x + ↑m)
this : x + ↑(Nat.succ n) = x + ↑n + 1
⊢ 0 < x + ↑n
[PROOFSTEP]
linarith [(Nat.cast_nonneg n : 0 ≤ (n : ℝ))]
[GOAL]
f : ℝ → ℝ
x : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hn : n ≠ 0
hx : 0 < x
hx' : x ≤ 1
⊢ f (↑n + x) ≤ f ↑n + x * log ↑n
[PROOFSTEP]
have hn' : 0 < (n : ℝ) := Nat.cast_pos.mpr (Nat.pos_of_ne_zero hn)
[GOAL]
f : ℝ → ℝ
x : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hn : n ≠ 0
hx : 0 < x
hx' : x ≤ 1
hn' : 0 < ↑n
⊢ f (↑n + x) ≤ f ↑n + x * log ↑n
[PROOFSTEP]
have : f n + x * log n = (1 - x) * f n + x * f (n + 1) := by rw [hf_feq hn']; ring
[GOAL]
f : ℝ → ℝ
x : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hn : n ≠ 0
hx : 0 < x
hx' : x ≤ 1
hn' : 0 < ↑n
⊢ f ↑n + x * log ↑n = (1 - x) * f ↑n + x * f (↑n + 1)
[PROOFSTEP]
rw [hf_feq hn']
[GOAL]
f : ℝ → ℝ
x : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hn : n ≠ 0
hx : 0 < x
hx' : x ≤ 1
hn' : 0 < ↑n
⊢ f ↑n + x * log ↑n = (1 - x) * f ↑n + x * (f ↑n + log ↑n)
[PROOFSTEP]
ring
[GOAL]
f : ℝ → ℝ
x : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hn : n ≠ 0
hx : 0 < x
hx' : x ≤ 1
hn' : 0 < ↑n
this : f ↑n + x * log ↑n = (1 - x) * f ↑n + x * f (↑n + 1)
⊢ f (↑n + x) ≤ f ↑n + x * log ↑n
[PROOFSTEP]
rw [this, (by ring : (n : ℝ) + x = (1 - x) * n + x * (n + 1))]
[GOAL]
f : ℝ → ℝ
x : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hn : n ≠ 0
hx : 0 < x
hx' : x ≤ 1
hn' : 0 < ↑n
this : f ↑n + x * log ↑n = (1 - x) * f ↑n + x * f (↑n + 1)
⊢ ↑n + x = (1 - x) * ↑n + x * (↑n + 1)
[PROOFSTEP]
ring
[GOAL]
f : ℝ → ℝ
x : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hn : n ≠ 0
hx : 0 < x
hx' : x ≤ 1
hn' : 0 < ↑n
this : f ↑n + x * log ↑n = (1 - x) * f ↑n + x * f (↑n + 1)
⊢ f ((1 - x) * ↑n + x * (↑n + 1)) ≤ (1 - x) * f ↑n + x * f (↑n + 1)
[PROOFSTEP]
simpa only [smul_eq_mul] using
  hf_conv.2 hn' (by linarith : 0 < (n + 1 : ℝ)) (by linarith : 0 ≤ 1 - x) hx.le (by linarith)
[GOAL]
f : ℝ → ℝ
x : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hn : n ≠ 0
hx : 0 < x
hx' : x ≤ 1
hn' : 0 < ↑n
this : f ↑n + x * log ↑n = (1 - x) * f ↑n + x * f (↑n + 1)
⊢ 0 < ↑n + 1
[PROOFSTEP]
linarith
[GOAL]
f : ℝ → ℝ
x : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hn : n ≠ 0
hx : 0 < x
hx' : x ≤ 1
hn' : 0 < ↑n
this : f ↑n + x * log ↑n = (1 - x) * f ↑n + x * f (↑n + 1)
⊢ 0 ≤ 1 - x
[PROOFSTEP]
linarith
[GOAL]
f : ℝ → ℝ
x : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hn : n ≠ 0
hx : 0 < x
hx' : x ≤ 1
hn' : 0 < ↑n
this : f ↑n + x * log ↑n = (1 - x) * f ↑n + x * f (↑n + 1)
⊢ 1 - x + x = 1
[PROOFSTEP]
linarith
[GOAL]
f : ℝ → ℝ
x : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hn : 2 ≤ n
hx : 0 < x
⊢ f ↑n + x * log (↑n - 1) ≤ f (↑n + x)
[PROOFSTEP]
have npos : 0 < (n : ℝ) - 1 := by rw [← Nat.cast_one, sub_pos, Nat.cast_lt]; linarith
[GOAL]
f : ℝ → ℝ
x : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hn : 2 ≤ n
hx : 0 < x
⊢ 0 < ↑n - 1
[PROOFSTEP]
rw [← Nat.cast_one, sub_pos, Nat.cast_lt]
[GOAL]
f : ℝ → ℝ
x : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hn : 2 ≤ n
hx : 0 < x
⊢ 1 < n
[PROOFSTEP]
linarith
[GOAL]
f : ℝ → ℝ
x : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hn : 2 ≤ n
hx : 0 < x
npos : 0 < ↑n - 1
⊢ f ↑n + x * log (↑n - 1) ≤ f (↑n + x)
[PROOFSTEP]
have c :=
  (convexOn_iff_slope_mono_adjacent.mp <| hf_conv).2 npos (by linarith : 0 < (n : ℝ) + x)
    (by linarith : (n : ℝ) - 1 < (n : ℝ)) (by linarith)
[GOAL]
f : ℝ → ℝ
x : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hn : 2 ≤ n
hx : 0 < x
npos : 0 < ↑n - 1
⊢ 0 < ↑n + x
[PROOFSTEP]
linarith
[GOAL]
f : ℝ → ℝ
x : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hn : 2 ≤ n
hx : 0 < x
npos : 0 < ↑n - 1
⊢ ↑n - 1 < ↑n
[PROOFSTEP]
linarith
[GOAL]
f : ℝ → ℝ
x : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hn : 2 ≤ n
hx : 0 < x
npos : 0 < ↑n - 1
⊢ ↑n < ↑n + x
[PROOFSTEP]
linarith
[GOAL]
f : ℝ → ℝ
x : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hn : 2 ≤ n
hx : 0 < x
npos : 0 < ↑n - 1
c : (f ↑n - f (↑n - 1)) / (↑n - (↑n - 1)) ≤ (f (↑n + x) - f ↑n) / (↑n + x - ↑n)
⊢ f ↑n + x * log (↑n - 1) ≤ f (↑n + x)
[PROOFSTEP]
rw [add_sub_cancel', sub_sub_cancel, div_one] at c 
[GOAL]
f : ℝ → ℝ
x : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hn : 2 ≤ n
hx : 0 < x
npos : 0 < ↑n - 1
c : f ↑n - f (↑n - 1) ≤ (f (↑n + x) - f ↑n) / x
⊢ f ↑n + x * log (↑n - 1) ≤ f (↑n + x)
[PROOFSTEP]
have : f (↑n - 1) = f n - log (↑n - 1) := by
  -- Porting note: was
      -- nth_rw_rhs 1 [(by ring : (n : ℝ) = ↑n - 1 + 1)]
      -- rw [hf_feq npos, add_sub_cancel]rw [eq_sub_iff_add_eq, ← hf_feq npos, sub_add_cancel]
[GOAL]
f : ℝ → ℝ
x : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hn : 2 ≤ n
hx : 0 < x
npos : 0 < ↑n - 1
c : f ↑n - f (↑n - 1) ≤ (f (↑n + x) - f ↑n) / x
⊢ f (↑n - 1) = f ↑n - log (↑n - 1)
[PROOFSTEP]
rw [eq_sub_iff_add_eq, ← hf_feq npos, sub_add_cancel]
[GOAL]
f : ℝ → ℝ
x : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hn : 2 ≤ n
hx : 0 < x
npos : 0 < ↑n - 1
c : f ↑n - f (↑n - 1) ≤ (f (↑n + x) - f ↑n) / x
this : f (↑n - 1) = f ↑n - log (↑n - 1)
⊢ f ↑n + x * log (↑n - 1) ≤ f (↑n + x)
[PROOFSTEP]
rwa [this, le_div_iff hx, sub_sub_cancel, le_sub_iff_add_le, mul_comm _ x, add_comm] at c 
[GOAL]
f : ℝ → ℝ
x✝ : ℝ
n✝ : ℕ
x : ℝ
n : ℕ
⊢ logGammaSeq (x + 1) n = logGammaSeq x (n + 1) + log x - (x + 1) * (log (↑n + 1) - log ↑n)
[PROOFSTEP]
dsimp only [Nat.factorial_succ, logGammaSeq]
[GOAL]
f : ℝ → ℝ
x✝ : ℝ
n✝ : ℕ
x : ℝ
n : ℕ
⊢ (x + 1) * log ↑n + log ↑n ! - ∑ m in Finset.range (n + 1), log (x + 1 + ↑m) =
    x * log ↑(n + 1) + log ↑((n + 1) * n !) - ∑ m in Finset.range (n + 1 + 1), log (x + ↑m) + log x -
      (x + 1) * (log (↑n + 1) - log ↑n)
[PROOFSTEP]
conv_rhs => rw [Finset.sum_range_succ', Nat.cast_zero, add_zero]
[GOAL]
f : ℝ → ℝ
x✝ : ℝ
n✝ : ℕ
x : ℝ
n : ℕ
| x * log ↑(n + 1) + log ↑((n + 1) * n !) - ∑ m in Finset.range (n + 1 + 1), log (x + ↑m) + log x -
    (x + 1) * (log (↑n + 1) - log ↑n)
[PROOFSTEP]
rw [Finset.sum_range_succ', Nat.cast_zero, add_zero]
[GOAL]
f : ℝ → ℝ
x✝ : ℝ
n✝ : ℕ
x : ℝ
n : ℕ
| x * log ↑(n + 1) + log ↑((n + 1) * n !) - ∑ m in Finset.range (n + 1 + 1), log (x + ↑m) + log x -
    (x + 1) * (log (↑n + 1) - log ↑n)
[PROOFSTEP]
rw [Finset.sum_range_succ', Nat.cast_zero, add_zero]
[GOAL]
f : ℝ → ℝ
x✝ : ℝ
n✝ : ℕ
x : ℝ
n : ℕ
| x * log ↑(n + 1) + log ↑((n + 1) * n !) - ∑ m in Finset.range (n + 1 + 1), log (x + ↑m) + log x -
    (x + 1) * (log (↑n + 1) - log ↑n)
[PROOFSTEP]
rw [Finset.sum_range_succ', Nat.cast_zero, add_zero]
[GOAL]
f : ℝ → ℝ
x✝ : ℝ
n✝ : ℕ
x : ℝ
n : ℕ
⊢ (x + 1) * log ↑n + log ↑n ! - ∑ m in Finset.range (n + 1), log (x + 1 + ↑m) =
    x * log ↑(n + 1) + log ↑((n + 1) * n !) - (∑ k in Finset.range (n + 1), log (x + ↑(k + 1)) + log x) + log x -
      (x + 1) * (log (↑n + 1) - log ↑n)
[PROOFSTEP]
rw [Nat.cast_mul, log_mul]
[GOAL]
f : ℝ → ℝ
x✝ : ℝ
n✝ : ℕ
x : ℝ
n : ℕ
⊢ (x + 1) * log ↑n + log ↑n ! - ∑ m in Finset.range (n + 1), log (x + 1 + ↑m) =
    x * log ↑(n + 1) + (log ↑(n + 1) + log ↑n !) - (∑ k in Finset.range (n + 1), log (x + ↑(k + 1)) + log x) + log x -
      (x + 1) * (log (↑n + 1) - log ↑n)
case hx
f : ℝ → ℝ
x✝ : ℝ
n✝ : ℕ
x : ℝ
n : ℕ
⊢ ↑(n + 1) ≠ 0
case hy f : ℝ → ℝ x✝ : ℝ n✝ : ℕ x : ℝ n : ℕ ⊢ ↑n ! ≠ 0
[PROOFSTEP]
rotate_left
[GOAL]
case hx
f : ℝ → ℝ
x✝ : ℝ
n✝ : ℕ
x : ℝ
n : ℕ
⊢ ↑(n + 1) ≠ 0
[PROOFSTEP]
rw [Nat.cast_ne_zero]
[GOAL]
case hx
f : ℝ → ℝ
x✝ : ℝ
n✝ : ℕ
x : ℝ
n : ℕ
⊢ n + 1 ≠ 0
[PROOFSTEP]
exact Nat.succ_ne_zero n
[GOAL]
case hy
f : ℝ → ℝ
x✝ : ℝ
n✝ : ℕ
x : ℝ
n : ℕ
⊢ ↑n ! ≠ 0
[PROOFSTEP]
rw [Nat.cast_ne_zero]
[GOAL]
case hy
f : ℝ → ℝ
x✝ : ℝ
n✝ : ℕ
x : ℝ
n : ℕ
⊢ n ! ≠ 0
[PROOFSTEP]
exact Nat.factorial_ne_zero n
[GOAL]
f : ℝ → ℝ
x✝ : ℝ
n✝ : ℕ
x : ℝ
n : ℕ
⊢ (x + 1) * log ↑n + log ↑n ! - ∑ m in Finset.range (n + 1), log (x + 1 + ↑m) =
    x * log ↑(n + 1) + (log ↑(n + 1) + log ↑n !) - (∑ k in Finset.range (n + 1), log (x + ↑(k + 1)) + log x) + log x -
      (x + 1) * (log (↑n + 1) - log ↑n)
[PROOFSTEP]
have : ∑ m : ℕ in Finset.range (n + 1), log (x + 1 + ↑m) = ∑ k : ℕ in Finset.range (n + 1), log (x + ↑(k + 1)) :=
  by
  refine' Finset.sum_congr (by rfl) fun m _ => _
  congr 1
  push_cast
  abel
[GOAL]
f : ℝ → ℝ
x✝ : ℝ
n✝ : ℕ
x : ℝ
n : ℕ
⊢ ∑ m in Finset.range (n + 1), log (x + 1 + ↑m) = ∑ k in Finset.range (n + 1), log (x + ↑(k + 1))
[PROOFSTEP]
refine' Finset.sum_congr (by rfl) fun m _ => _
[GOAL]
f : ℝ → ℝ
x✝ : ℝ
n✝ : ℕ
x : ℝ
n : ℕ
⊢ Finset.range (n + 1) = Finset.range (n + 1)
[PROOFSTEP]
rfl
[GOAL]
f : ℝ → ℝ
x✝¹ : ℝ
n✝ : ℕ
x : ℝ
n m : ℕ
x✝ : m ∈ Finset.range (n + 1)
⊢ log (x + 1 + ↑m) = log (x + ↑(m + 1))
[PROOFSTEP]
congr 1
[GOAL]
case e_x
f : ℝ → ℝ
x✝¹ : ℝ
n✝ : ℕ
x : ℝ
n m : ℕ
x✝ : m ∈ Finset.range (n + 1)
⊢ x + 1 + ↑m = x + ↑(m + 1)
[PROOFSTEP]
push_cast
[GOAL]
case e_x
f : ℝ → ℝ
x✝¹ : ℝ
n✝ : ℕ
x : ℝ
n m : ℕ
x✝ : m ∈ Finset.range (n + 1)
⊢ x + 1 + ↑m = x + (↑m + 1)
[PROOFSTEP]
abel
[GOAL]
case e_x
f : ℝ → ℝ
x✝¹ : ℝ
n✝ : ℕ
x : ℝ
n m : ℕ
x✝ : m ∈ Finset.range (n + 1)
⊢ x + 1 + ↑m = x + (↑m + 1)
[PROOFSTEP]
abel
[GOAL]
f : ℝ → ℝ
x✝ : ℝ
n✝ : ℕ
x : ℝ
n : ℕ
this : ∑ m in Finset.range (n + 1), log (x + 1 + ↑m) = ∑ k in Finset.range (n + 1), log (x + ↑(k + 1))
⊢ (x + 1) * log ↑n + log ↑n ! - ∑ m in Finset.range (n + 1), log (x + 1 + ↑m) =
    x * log ↑(n + 1) + (log ↑(n + 1) + log ↑n !) - (∑ k in Finset.range (n + 1), log (x + ↑(k + 1)) + log x) + log x -
      (x + 1) * (log (↑n + 1) - log ↑n)
[PROOFSTEP]
rw [← this, Nat.cast_add_one n]
[GOAL]
f : ℝ → ℝ
x✝ : ℝ
n✝ : ℕ
x : ℝ
n : ℕ
this : ∑ m in Finset.range (n + 1), log (x + 1 + ↑m) = ∑ k in Finset.range (n + 1), log (x + ↑(k + 1))
⊢ (x + 1) * log ↑n + log ↑n ! - ∑ m in Finset.range (n + 1), log (x + 1 + ↑m) =
    x * log (↑n + 1) + (log (↑n + 1) + log ↑n !) - (∑ m in Finset.range (n + 1), log (x + 1 + ↑m) + log x) + log x -
      (x + 1) * (log (↑n + 1) - log ↑n)
[PROOFSTEP]
ring
[GOAL]
f : ℝ → ℝ
x : ℝ
n✝ : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx : 0 < x
hx' : x ≤ 1
n : ℕ
⊢ f x ≤ f 1 + x * log (↑n + 1) - x * log ↑n + logGammaSeq x n
[PROOFSTEP]
rw [logGammaSeq, ← add_sub_assoc, le_sub_iff_add_le, ← f_add_nat_eq (@hf_feq) hx, add_comm x]
[GOAL]
f : ℝ → ℝ
x : ℝ
n✝ : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx : 0 < x
hx' : x ≤ 1
n : ℕ
⊢ f (↑(n + 1) + x) ≤ f 1 + x * log (↑n + 1) - x * log ↑n + (x * log ↑n + log ↑n !)
[PROOFSTEP]
refine' (f_add_nat_le hf_conv (@hf_feq) (Nat.add_one_ne_zero n) hx hx').trans (le_of_eq _)
[GOAL]
f : ℝ → ℝ
x : ℝ
n✝ : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx : 0 < x
hx' : x ≤ 1
n : ℕ
⊢ f ↑(n + 1) + x * log ↑(n + 1) = f 1 + x * log (↑n + 1) - x * log ↑n + (x * log ↑n + log ↑n !)
[PROOFSTEP]
rw [f_nat_eq @hf_feq (by linarith : n + 1 ≠ 0), Nat.add_sub_cancel, Nat.cast_add_one]
[GOAL]
f : ℝ → ℝ
x : ℝ
n✝ : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx : 0 < x
hx' : x ≤ 1
n : ℕ
⊢ n + 1 ≠ 0
[PROOFSTEP]
linarith
[GOAL]
f : ℝ → ℝ
x : ℝ
n✝ : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx : 0 < x
hx' : x ≤ 1
n : ℕ
⊢ f 1 + log ↑n ! + x * log (↑n + 1) = f 1 + x * log (↑n + 1) - x * log ↑n + (x * log ↑n + log ↑n !)
[PROOFSTEP]
ring
[GOAL]
f : ℝ → ℝ
x : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx : 0 < x
hn : n ≠ 0
⊢ f 1 + logGammaSeq x n ≤ f x
[PROOFSTEP]
dsimp [logGammaSeq]
[GOAL]
f : ℝ → ℝ
x : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx : 0 < x
hn : n ≠ 0
⊢ f 1 + (x * log ↑n + log ↑n ! - ∑ m in Finset.range (n + 1), log (x + ↑m)) ≤ f x
[PROOFSTEP]
rw [← add_sub_assoc, sub_le_iff_le_add, ← f_add_nat_eq (@hf_feq) hx, add_comm x _]
[GOAL]
f : ℝ → ℝ
x : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx : 0 < x
hn : n ≠ 0
⊢ f 1 + (x * log ↑n + log ↑n !) ≤ f (↑(n + 1) + x)
[PROOFSTEP]
refine' le_trans (le_of_eq _) (f_add_nat_ge hf_conv @hf_feq _ hx)
[GOAL]
case refine'_1
f : ℝ → ℝ
x : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx : 0 < x
hn : n ≠ 0
⊢ f 1 + (x * log ↑n + log ↑n !) = f ↑(n + 1) + x * log (↑(n + 1) - 1)
[PROOFSTEP]
rw [f_nat_eq @hf_feq, Nat.add_sub_cancel, Nat.cast_add_one, add_sub_cancel]
[GOAL]
case refine'_1
f : ℝ → ℝ
x : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx : 0 < x
hn : n ≠ 0
⊢ f 1 + (x * log ↑n + log ↑n !) = f 1 + log ↑n ! + x * log ↑n
[PROOFSTEP]
ring
[GOAL]
case refine'_1
f : ℝ → ℝ
x : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx : 0 < x
hn : n ≠ 0
⊢ n + 1 ≠ 0
[PROOFSTEP]
exact Nat.succ_ne_zero _
[GOAL]
case refine'_2
f : ℝ → ℝ
x : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx : 0 < x
hn : n ≠ 0
⊢ 2 ≤ n + 1
[PROOFSTEP]
apply Nat.succ_le_succ
[GOAL]
case refine'_2.a
f : ℝ → ℝ
x : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx : 0 < x
hn : n ≠ 0
⊢ 1 ≤ n
[PROOFSTEP]
linarith [Nat.pos_of_ne_zero hn]
[GOAL]
f : ℝ → ℝ
x : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx : 0 < x
hx' : x ≤ 1
⊢ Tendsto (logGammaSeq x) atTop (𝓝 (f x - f 1))
[PROOFSTEP]
refine'
  tendsto_of_tendsto_of_tendsto_of_le_of_le' _ tendsto_const_nhds _
    _
      -- Porting note: `show` no longer reorders goals
[GOAL]
case refine'_1
f : ℝ → ℝ
x : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx : 0 < x
hx' : x ≤ 1
⊢ ℕ → ℝ
case refine'_2
f : ℝ → ℝ
x : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx : 0 < x
hx' : x ≤ 1
⊢ Tendsto ?refine'_1 atTop (𝓝 (f x - f 1))
case refine'_3
f : ℝ → ℝ
x : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx : 0 < x
hx' : x ≤ 1
⊢ ∀ᶠ (b : ℕ) in atTop, ?refine'_1 b ≤ logGammaSeq x b
case refine'_4
f : ℝ → ℝ
x : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx : 0 < x
hx' : x ≤ 1
⊢ ∀ᶠ (b : ℕ) in atTop, logGammaSeq x b ≤ f x - f 1
[PROOFSTEP]
pick_goal 4
[GOAL]
case refine'_4
f : ℝ → ℝ
x : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx : 0 < x
hx' : x ≤ 1
⊢ ∀ᶠ (b : ℕ) in atTop, logGammaSeq x b ≤ f x - f 1
case refine'_1
f : ℝ → ℝ
x : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx : 0 < x
hx' : x ≤ 1
⊢ ℕ → ℝ
case refine'_2
f : ℝ → ℝ
x : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx : 0 < x
hx' : x ≤ 1
⊢ Tendsto ?refine'_1 atTop (𝓝 (f x - f 1))
case refine'_3
f : ℝ → ℝ
x : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx : 0 < x
hx' : x ≤ 1
⊢ ∀ᶠ (b : ℕ) in atTop, ?refine'_1 b ≤ logGammaSeq x b
[PROOFSTEP]
show ∀ᶠ n : ℕ in atTop, logGammaSeq x n ≤ f x - f 1
[GOAL]
case refine'_4
f : ℝ → ℝ
x : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx : 0 < x
hx' : x ≤ 1
⊢ ∀ᶠ (n : ℕ) in atTop, logGammaSeq x n ≤ f x - f 1
[PROOFSTEP]
refine' Eventually.mp (eventually_ne_atTop 0) (eventually_of_forall fun n hn => _)
[GOAL]
case refine'_4
f : ℝ → ℝ
x : ℝ
n✝ : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx : 0 < x
hx' : x ≤ 1
n : ℕ
hn : n ≠ 0
⊢ logGammaSeq x n ≤ f x - f 1
[PROOFSTEP]
exact
  le_sub_iff_add_le'.mpr
    (ge_logGammaSeq hf_conv (@hf_feq) hx hn)
      -- Porting note: `show` no longer reorders goals
[GOAL]
case refine'_1
f : ℝ → ℝ
x : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx : 0 < x
hx' : x ≤ 1
⊢ ℕ → ℝ
case refine'_2
f : ℝ → ℝ
x : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx : 0 < x
hx' : x ≤ 1
⊢ Tendsto ?refine'_1 atTop (𝓝 (f x - f 1))
case refine'_3
f : ℝ → ℝ
x : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx : 0 < x
hx' : x ≤ 1
⊢ ∀ᶠ (b : ℕ) in atTop, ?refine'_1 b ≤ logGammaSeq x b
[PROOFSTEP]
pick_goal 3
[GOAL]
case refine'_3
f : ℝ → ℝ
x : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx : 0 < x
hx' : x ≤ 1
⊢ ∀ᶠ (b : ℕ) in atTop, ?refine'_1 b ≤ logGammaSeq x b
case refine'_1
f : ℝ → ℝ
x : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx : 0 < x
hx' : x ≤ 1
⊢ ℕ → ℝ
case refine'_2
f : ℝ → ℝ
x : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx : 0 < x
hx' : x ≤ 1
⊢ Tendsto ?refine'_1 atTop (𝓝 (f x - f 1))
[PROOFSTEP]
show ∀ᶠ n : ℕ in atTop, f x - f 1 - x * (log (n + 1) - log n) ≤ logGammaSeq x n
[GOAL]
case refine'_3
f : ℝ → ℝ
x : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx : 0 < x
hx' : x ≤ 1
⊢ ∀ᶠ (n : ℕ) in atTop, f x - f 1 - x * (log (↑n + 1) - log ↑n) ≤ logGammaSeq x n
[PROOFSTEP]
refine' eventually_of_forall fun n => _
[GOAL]
case refine'_3
f : ℝ → ℝ
x : ℝ
n✝ : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx : 0 < x
hx' : x ≤ 1
n : ℕ
⊢ f x - f 1 - x * (log (↑n + 1) - log ↑n) ≤ logGammaSeq x n
[PROOFSTEP]
rw [sub_le_iff_le_add', sub_le_iff_le_add']
[GOAL]
case refine'_3
f : ℝ → ℝ
x : ℝ
n✝ : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx : 0 < x
hx' : x ≤ 1
n : ℕ
⊢ f x ≤ f 1 + (x * (log (↑n + 1) - log ↑n) + logGammaSeq x n)
[PROOFSTEP]
convert le_logGammaSeq hf_conv (@hf_feq) hx hx' n using 1
[GOAL]
case h.e'_4
f : ℝ → ℝ
x : ℝ
n✝ : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx : 0 < x
hx' : x ≤ 1
n : ℕ
⊢ f 1 + (x * (log (↑n + 1) - log ↑n) + logGammaSeq x n) = f 1 + x * log (↑n + 1) - x * log ↑n + logGammaSeq x n
[PROOFSTEP]
ring
[GOAL]
case refine'_2
f : ℝ → ℝ
x : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx : 0 < x
hx' : x ≤ 1
⊢ Tendsto (fun b => f x - f 1 - x * (log (↑b + 1) - log ↑b)) atTop (𝓝 (f x - f 1))
[PROOFSTEP]
have : f x - f 1 = f x - f 1 - x * 0 := by ring
[GOAL]
f : ℝ → ℝ
x : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx : 0 < x
hx' : x ≤ 1
⊢ f x - f 1 = f x - f 1 - x * 0
[PROOFSTEP]
ring
[GOAL]
case refine'_2
f : ℝ → ℝ
x : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx : 0 < x
hx' : x ≤ 1
this : f x - f 1 = f x - f 1 - x * 0
⊢ Tendsto (fun b => f x - f 1 - x * (log (↑b + 1) - log ↑b)) atTop (𝓝 (f x - f 1))
[PROOFSTEP]
nth_rw 2 [this]
[GOAL]
case refine'_2
f : ℝ → ℝ
x : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx : 0 < x
hx' : x ≤ 1
this : f x - f 1 = f x - f 1 - x * 0
⊢ Tendsto (fun b => f x - f 1 - x * (log (↑b + 1) - log ↑b)) atTop (𝓝 (f x - f 1 - x * 0))
[PROOFSTEP]
exact Tendsto.sub tendsto_const_nhds (tendsto_log_nat_add_one_sub_log.const_mul _)
[GOAL]
f : ℝ → ℝ
x : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx : 0 < x
⊢ Tendsto (logGammaSeq x) atTop (𝓝 (f x - f 1))
[PROOFSTEP]
suffices ∀ m : ℕ, ↑m < x → x ≤ m + 1 → Tendsto (logGammaSeq x) atTop (𝓝 <| f x - f 1)
  by
  refine' this ⌈x - 1⌉₊ _ _
  · rcases lt_or_le x 1 with ⟨⟩
    · rwa [Nat.ceil_eq_zero.mpr (by linarith : x - 1 ≤ 0), Nat.cast_zero]
    · convert Nat.ceil_lt_add_one (by linarith : 0 ≤ x - 1)
      abel
  · rw [← sub_le_iff_le_add]; exact Nat.le_ceil _
[GOAL]
f : ℝ → ℝ
x : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx : 0 < x
this : ∀ (m : ℕ), ↑m < x → x ≤ ↑m + 1 → Tendsto (logGammaSeq x) atTop (𝓝 (f x - f 1))
⊢ Tendsto (logGammaSeq x) atTop (𝓝 (f x - f 1))
[PROOFSTEP]
refine' this ⌈x - 1⌉₊ _ _
[GOAL]
case refine'_1
f : ℝ → ℝ
x : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx : 0 < x
this : ∀ (m : ℕ), ↑m < x → x ≤ ↑m + 1 → Tendsto (logGammaSeq x) atTop (𝓝 (f x - f 1))
⊢ ↑⌈x - 1⌉₊ < x
[PROOFSTEP]
rcases lt_or_le x 1 with ⟨⟩
[GOAL]
case refine'_1.inl
f : ℝ → ℝ
x : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx : 0 < x
this : ∀ (m : ℕ), ↑m < x → x ≤ ↑m + 1 → Tendsto (logGammaSeq x) atTop (𝓝 (f x - f 1))
h✝ : x < 1
⊢ ↑⌈x - 1⌉₊ < x
[PROOFSTEP]
rwa [Nat.ceil_eq_zero.mpr (by linarith : x - 1 ≤ 0), Nat.cast_zero]
[GOAL]
f : ℝ → ℝ
x : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx : 0 < x
this : ∀ (m : ℕ), ↑m < x → x ≤ ↑m + 1 → Tendsto (logGammaSeq x) atTop (𝓝 (f x - f 1))
h✝ : x < 1
⊢ x - 1 ≤ 0
[PROOFSTEP]
linarith
[GOAL]
case refine'_1.inr
f : ℝ → ℝ
x : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx : 0 < x
this : ∀ (m : ℕ), ↑m < x → x ≤ ↑m + 1 → Tendsto (logGammaSeq x) atTop (𝓝 (f x - f 1))
h✝ : 1 ≤ x
⊢ ↑⌈x - 1⌉₊ < x
[PROOFSTEP]
convert Nat.ceil_lt_add_one (by linarith : 0 ≤ x - 1)
[GOAL]
f : ℝ → ℝ
x : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx : 0 < x
this : ∀ (m : ℕ), ↑m < x → x ≤ ↑m + 1 → Tendsto (logGammaSeq x) atTop (𝓝 (f x - f 1))
h✝ : 1 ≤ x
⊢ 0 ≤ x - 1
[PROOFSTEP]
linarith
[GOAL]
case h.e'_4
f : ℝ → ℝ
x : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx : 0 < x
this : ∀ (m : ℕ), ↑m < x → x ≤ ↑m + 1 → Tendsto (logGammaSeq x) atTop (𝓝 (f x - f 1))
h✝ : 1 ≤ x
⊢ x = x - 1 + 1
[PROOFSTEP]
abel
[GOAL]
case h.e'_4
f : ℝ → ℝ
x : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx : 0 < x
this : ∀ (m : ℕ), ↑m < x → x ≤ ↑m + 1 → Tendsto (logGammaSeq x) atTop (𝓝 (f x - f 1))
h✝ : 1 ≤ x
⊢ x = x - 1 + 1
[PROOFSTEP]
abel
[GOAL]
case refine'_2
f : ℝ → ℝ
x : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx : 0 < x
this : ∀ (m : ℕ), ↑m < x → x ≤ ↑m + 1 → Tendsto (logGammaSeq x) atTop (𝓝 (f x - f 1))
⊢ x ≤ ↑⌈x - 1⌉₊ + 1
[PROOFSTEP]
rw [← sub_le_iff_le_add]
[GOAL]
case refine'_2
f : ℝ → ℝ
x : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx : 0 < x
this : ∀ (m : ℕ), ↑m < x → x ≤ ↑m + 1 → Tendsto (logGammaSeq x) atTop (𝓝 (f x - f 1))
⊢ x - 1 ≤ ↑⌈x - 1⌉₊
[PROOFSTEP]
exact Nat.le_ceil _
[GOAL]
f : ℝ → ℝ
x : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx : 0 < x
⊢ ∀ (m : ℕ), ↑m < x → x ≤ ↑m + 1 → Tendsto (logGammaSeq x) atTop (𝓝 (f x - f 1))
[PROOFSTEP]
intro m
[GOAL]
f : ℝ → ℝ
x : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx : 0 < x
m : ℕ
⊢ ↑m < x → x ≤ ↑m + 1 → Tendsto (logGammaSeq x) atTop (𝓝 (f x - f 1))
[PROOFSTEP]
induction' m with m hm generalizing x
[GOAL]
case zero
f : ℝ → ℝ
x✝ : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx✝ : 0 < x✝
x : ℝ
hx : 0 < x
⊢ ↑Nat.zero < x → x ≤ ↑Nat.zero + 1 → Tendsto (logGammaSeq x) atTop (𝓝 (f x - f 1))
[PROOFSTEP]
rw [Nat.cast_zero, zero_add]
[GOAL]
case zero
f : ℝ → ℝ
x✝ : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx✝ : 0 < x✝
x : ℝ
hx : 0 < x
⊢ 0 < x → x ≤ 1 → Tendsto (logGammaSeq x) atTop (𝓝 (f x - f 1))
[PROOFSTEP]
exact fun _ hx' => tendsto_logGammaSeq_of_le_one hf_conv (@hf_feq) hx hx'
[GOAL]
case succ
f : ℝ → ℝ
x✝ : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx✝ : 0 < x✝
m : ℕ
hm : ∀ {x : ℝ}, 0 < x → ↑m < x → x ≤ ↑m + 1 → Tendsto (logGammaSeq x) atTop (𝓝 (f x - f 1))
x : ℝ
hx : 0 < x
⊢ ↑(Nat.succ m) < x → x ≤ ↑(Nat.succ m) + 1 → Tendsto (logGammaSeq x) atTop (𝓝 (f x - f 1))
[PROOFSTEP]
intro hy hy'
[GOAL]
case succ
f : ℝ → ℝ
x✝ : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx✝ : 0 < x✝
m : ℕ
hm : ∀ {x : ℝ}, 0 < x → ↑m < x → x ≤ ↑m + 1 → Tendsto (logGammaSeq x) atTop (𝓝 (f x - f 1))
x : ℝ
hx : 0 < x
hy : ↑(Nat.succ m) < x
hy' : x ≤ ↑(Nat.succ m) + 1
⊢ Tendsto (logGammaSeq x) atTop (𝓝 (f x - f 1))
[PROOFSTEP]
rw [Nat.cast_succ, ← sub_le_iff_le_add] at hy' 
[GOAL]
case succ
f : ℝ → ℝ
x✝ : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx✝ : 0 < x✝
m : ℕ
hm : ∀ {x : ℝ}, 0 < x → ↑m < x → x ≤ ↑m + 1 → Tendsto (logGammaSeq x) atTop (𝓝 (f x - f 1))
x : ℝ
hx : 0 < x
hy : ↑(Nat.succ m) < x
hy' : x - 1 ≤ ↑m + 1
⊢ Tendsto (logGammaSeq x) atTop (𝓝 (f x - f 1))
[PROOFSTEP]
rw [Nat.cast_succ, ← lt_sub_iff_add_lt] at hy 
[GOAL]
case succ
f : ℝ → ℝ
x✝ : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx✝ : 0 < x✝
m : ℕ
hm : ∀ {x : ℝ}, 0 < x → ↑m < x → x ≤ ↑m + 1 → Tendsto (logGammaSeq x) atTop (𝓝 (f x - f 1))
x : ℝ
hx : 0 < x
hy : ↑m < x - 1
hy' : x - 1 ≤ ↑m + 1
⊢ Tendsto (logGammaSeq x) atTop (𝓝 (f x - f 1))
[PROOFSTEP]
specialize hm ((Nat.cast_nonneg _).trans_lt hy) hy hy'
[GOAL]
case succ
f : ℝ → ℝ
x✝ : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx✝ : 0 < x✝
m : ℕ
x : ℝ
hx : 0 < x
hy : ↑m < x - 1
hy' : x - 1 ≤ ↑m + 1
hm : Tendsto (logGammaSeq (x - 1)) atTop (𝓝 (f (x - 1) - f 1))
⊢ Tendsto (logGammaSeq x) atTop (𝓝 (f x - f 1))
[PROOFSTEP]
have :
  ∀ᶠ n : ℕ in atTop,
    logGammaSeq (x - 1) n = logGammaSeq x (n - 1) + x * (log (↑(n - 1) + 1) - log ↑(n - 1)) - log (x - 1) :=
  by
  refine' Eventually.mp (eventually_ge_atTop 1) (eventually_of_forall fun n hn => _)
  have := logGammaSeq_add_one (x - 1) (n - 1)
  rw [sub_add_cancel, Nat.sub_add_cancel hn] at this 
  rw [this]
  ring
[GOAL]
f : ℝ → ℝ
x✝ : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx✝ : 0 < x✝
m : ℕ
x : ℝ
hx : 0 < x
hy : ↑m < x - 1
hy' : x - 1 ≤ ↑m + 1
hm : Tendsto (logGammaSeq (x - 1)) atTop (𝓝 (f (x - 1) - f 1))
⊢ ∀ᶠ (n : ℕ) in atTop,
    logGammaSeq (x - 1) n = logGammaSeq x (n - 1) + x * (log (↑(n - 1) + 1) - log ↑(n - 1)) - log (x - 1)
[PROOFSTEP]
refine' Eventually.mp (eventually_ge_atTop 1) (eventually_of_forall fun n hn => _)
[GOAL]
f : ℝ → ℝ
x✝ : ℝ
n✝ : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx✝ : 0 < x✝
m : ℕ
x : ℝ
hx : 0 < x
hy : ↑m < x - 1
hy' : x - 1 ≤ ↑m + 1
hm : Tendsto (logGammaSeq (x - 1)) atTop (𝓝 (f (x - 1) - f 1))
n : ℕ
hn : 1 ≤ n
⊢ logGammaSeq (x - 1) n = logGammaSeq x (n - 1) + x * (log (↑(n - 1) + 1) - log ↑(n - 1)) - log (x - 1)
[PROOFSTEP]
have := logGammaSeq_add_one (x - 1) (n - 1)
[GOAL]
f : ℝ → ℝ
x✝ : ℝ
n✝ : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx✝ : 0 < x✝
m : ℕ
x : ℝ
hx : 0 < x
hy : ↑m < x - 1
hy' : x - 1 ≤ ↑m + 1
hm : Tendsto (logGammaSeq (x - 1)) atTop (𝓝 (f (x - 1) - f 1))
n : ℕ
hn : 1 ≤ n
this :
  logGammaSeq (x - 1 + 1) (n - 1) =
    logGammaSeq (x - 1) (n - 1 + 1) + log (x - 1) - (x - 1 + 1) * (log (↑(n - 1) + 1) - log ↑(n - 1))
⊢ logGammaSeq (x - 1) n = logGammaSeq x (n - 1) + x * (log (↑(n - 1) + 1) - log ↑(n - 1)) - log (x - 1)
[PROOFSTEP]
rw [sub_add_cancel, Nat.sub_add_cancel hn] at this 
[GOAL]
f : ℝ → ℝ
x✝ : ℝ
n✝ : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx✝ : 0 < x✝
m : ℕ
x : ℝ
hx : 0 < x
hy : ↑m < x - 1
hy' : x - 1 ≤ ↑m + 1
hm : Tendsto (logGammaSeq (x - 1)) atTop (𝓝 (f (x - 1) - f 1))
n : ℕ
hn : 1 ≤ n
this : logGammaSeq x (n - 1) = logGammaSeq (x - 1) n + log (x - 1) - x * (log (↑(n - 1) + 1) - log ↑(n - 1))
⊢ logGammaSeq (x - 1) n = logGammaSeq x (n - 1) + x * (log (↑(n - 1) + 1) - log ↑(n - 1)) - log (x - 1)
[PROOFSTEP]
rw [this]
[GOAL]
f : ℝ → ℝ
x✝ : ℝ
n✝ : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx✝ : 0 < x✝
m : ℕ
x : ℝ
hx : 0 < x
hy : ↑m < x - 1
hy' : x - 1 ≤ ↑m + 1
hm : Tendsto (logGammaSeq (x - 1)) atTop (𝓝 (f (x - 1) - f 1))
n : ℕ
hn : 1 ≤ n
this : logGammaSeq x (n - 1) = logGammaSeq (x - 1) n + log (x - 1) - x * (log (↑(n - 1) + 1) - log ↑(n - 1))
⊢ logGammaSeq (x - 1) n =
    logGammaSeq (x - 1) n + log (x - 1) - x * (log (↑(n - 1) + 1) - log ↑(n - 1)) +
        x * (log (↑(n - 1) + 1) - log ↑(n - 1)) -
      log (x - 1)
[PROOFSTEP]
ring
[GOAL]
case succ
f : ℝ → ℝ
x✝ : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx✝ : 0 < x✝
m : ℕ
x : ℝ
hx : 0 < x
hy : ↑m < x - 1
hy' : x - 1 ≤ ↑m + 1
hm : Tendsto (logGammaSeq (x - 1)) atTop (𝓝 (f (x - 1) - f 1))
this :
  ∀ᶠ (n : ℕ) in atTop,
    logGammaSeq (x - 1) n = logGammaSeq x (n - 1) + x * (log (↑(n - 1) + 1) - log ↑(n - 1)) - log (x - 1)
⊢ Tendsto (logGammaSeq x) atTop (𝓝 (f x - f 1))
[PROOFSTEP]
replace hm :=
  ((Tendsto.congr' this hm).add (tendsto_const_nhds : Tendsto (fun _ => log (x - 1)) _ _)).comp
    (tendsto_add_atTop_nat 1)
[GOAL]
case succ
f : ℝ → ℝ
x✝ : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx✝ : 0 < x✝
m : ℕ
x : ℝ
hx : 0 < x
hy : ↑m < x - 1
hy' : x - 1 ≤ ↑m + 1
this :
  ∀ᶠ (n : ℕ) in atTop,
    logGammaSeq (x - 1) n = logGammaSeq x (n - 1) + x * (log (↑(n - 1) + 1) - log ↑(n - 1)) - log (x - 1)
hm :
  Tendsto
    ((fun x_1 => logGammaSeq x (x_1 - 1) + x * (log (↑(x_1 - 1) + 1) - log ↑(x_1 - 1)) - log (x - 1) + log (x - 1)) ∘
      fun a => a + 1)
    atTop (𝓝 (f (x - 1) - f 1 + log (x - 1)))
⊢ Tendsto (logGammaSeq x) atTop (𝓝 (f x - f 1))
[PROOFSTEP]
have :
  ((fun x_1 : ℕ =>
        (fun n : ℕ => logGammaSeq x (n - 1) + x * (log (↑(n - 1) + 1) - log ↑(n - 1)) - log (x - 1)) x_1 +
          (fun b : ℕ => log (x - 1)) x_1) ∘
      fun a : ℕ => a + 1) =
    fun n => logGammaSeq x n + x * (log (↑n + 1) - log ↑n) :=
  by
  ext1 n
  dsimp only [Function.comp_apply]
  rw [sub_add_cancel, Nat.add_sub_cancel]
[GOAL]
f : ℝ → ℝ
x✝ : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx✝ : 0 < x✝
m : ℕ
x : ℝ
hx : 0 < x
hy : ↑m < x - 1
hy' : x - 1 ≤ ↑m + 1
this :
  ∀ᶠ (n : ℕ) in atTop,
    logGammaSeq (x - 1) n = logGammaSeq x (n - 1) + x * (log (↑(n - 1) + 1) - log ↑(n - 1)) - log (x - 1)
hm :
  Tendsto
    ((fun x_1 => logGammaSeq x (x_1 - 1) + x * (log (↑(x_1 - 1) + 1) - log ↑(x_1 - 1)) - log (x - 1) + log (x - 1)) ∘
      fun a => a + 1)
    atTop (𝓝 (f (x - 1) - f 1 + log (x - 1)))
⊢ ((fun x_1 =>
        (fun n => logGammaSeq x (n - 1) + x * (log (↑(n - 1) + 1) - log ↑(n - 1)) - log (x - 1)) x_1 +
          (fun b => log (x - 1)) x_1) ∘
      fun a => a + 1) =
    fun n => logGammaSeq x n + x * (log (↑n + 1) - log ↑n)
[PROOFSTEP]
ext1 n
[GOAL]
case h
f : ℝ → ℝ
x✝ : ℝ
n✝ : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx✝ : 0 < x✝
m : ℕ
x : ℝ
hx : 0 < x
hy : ↑m < x - 1
hy' : x - 1 ≤ ↑m + 1
this :
  ∀ᶠ (n : ℕ) in atTop,
    logGammaSeq (x - 1) n = logGammaSeq x (n - 1) + x * (log (↑(n - 1) + 1) - log ↑(n - 1)) - log (x - 1)
hm :
  Tendsto
    ((fun x_1 => logGammaSeq x (x_1 - 1) + x * (log (↑(x_1 - 1) + 1) - log ↑(x_1 - 1)) - log (x - 1) + log (x - 1)) ∘
      fun a => a + 1)
    atTop (𝓝 (f (x - 1) - f 1 + log (x - 1)))
n : ℕ
⊢ ((fun x_1 =>
          (fun n => logGammaSeq x (n - 1) + x * (log (↑(n - 1) + 1) - log ↑(n - 1)) - log (x - 1)) x_1 +
            (fun b => log (x - 1)) x_1) ∘
        fun a => a + 1)
      n =
    logGammaSeq x n + x * (log (↑n + 1) - log ↑n)
[PROOFSTEP]
dsimp only [Function.comp_apply]
[GOAL]
case h
f : ℝ → ℝ
x✝ : ℝ
n✝ : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx✝ : 0 < x✝
m : ℕ
x : ℝ
hx : 0 < x
hy : ↑m < x - 1
hy' : x - 1 ≤ ↑m + 1
this :
  ∀ᶠ (n : ℕ) in atTop,
    logGammaSeq (x - 1) n = logGammaSeq x (n - 1) + x * (log (↑(n - 1) + 1) - log ↑(n - 1)) - log (x - 1)
hm :
  Tendsto
    ((fun x_1 => logGammaSeq x (x_1 - 1) + x * (log (↑(x_1 - 1) + 1) - log ↑(x_1 - 1)) - log (x - 1) + log (x - 1)) ∘
      fun a => a + 1)
    atTop (𝓝 (f (x - 1) - f 1 + log (x - 1)))
n : ℕ
⊢ logGammaSeq x (n + 1 - 1) + x * (log (↑(n + 1 - 1) + 1) - log ↑(n + 1 - 1)) - log (x - 1) + log (x - 1) =
    logGammaSeq x n + x * (log (↑n + 1) - log ↑n)
[PROOFSTEP]
rw [sub_add_cancel, Nat.add_sub_cancel]
[GOAL]
case succ
f : ℝ → ℝ
x✝ : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx✝ : 0 < x✝
m : ℕ
x : ℝ
hx : 0 < x
hy : ↑m < x - 1
hy' : x - 1 ≤ ↑m + 1
this✝ :
  ∀ᶠ (n : ℕ) in atTop,
    logGammaSeq (x - 1) n = logGammaSeq x (n - 1) + x * (log (↑(n - 1) + 1) - log ↑(n - 1)) - log (x - 1)
hm :
  Tendsto
    ((fun x_1 => logGammaSeq x (x_1 - 1) + x * (log (↑(x_1 - 1) + 1) - log ↑(x_1 - 1)) - log (x - 1) + log (x - 1)) ∘
      fun a => a + 1)
    atTop (𝓝 (f (x - 1) - f 1 + log (x - 1)))
this :
  ((fun x_1 =>
        (fun n => logGammaSeq x (n - 1) + x * (log (↑(n - 1) + 1) - log ↑(n - 1)) - log (x - 1)) x_1 +
          (fun b => log (x - 1)) x_1) ∘
      fun a => a + 1) =
    fun n => logGammaSeq x n + x * (log (↑n + 1) - log ↑n)
⊢ Tendsto (logGammaSeq x) atTop (𝓝 (f x - f 1))
[PROOFSTEP]
rw [this] at hm 
[GOAL]
case succ
f : ℝ → ℝ
x✝ : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx✝ : 0 < x✝
m : ℕ
x : ℝ
hx : 0 < x
hy : ↑m < x - 1
hy' : x - 1 ≤ ↑m + 1
this✝ :
  ∀ᶠ (n : ℕ) in atTop,
    logGammaSeq (x - 1) n = logGammaSeq x (n - 1) + x * (log (↑(n - 1) + 1) - log ↑(n - 1)) - log (x - 1)
hm : Tendsto (fun n => logGammaSeq x n + x * (log (↑n + 1) - log ↑n)) atTop (𝓝 (f (x - 1) - f 1 + log (x - 1)))
this :
  ((fun x_1 =>
        (fun n => logGammaSeq x (n - 1) + x * (log (↑(n - 1) + 1) - log ↑(n - 1)) - log (x - 1)) x_1 +
          (fun b => log (x - 1)) x_1) ∘
      fun a => a + 1) =
    fun n => logGammaSeq x n + x * (log (↑n + 1) - log ↑n)
⊢ Tendsto (logGammaSeq x) atTop (𝓝 (f x - f 1))
[PROOFSTEP]
convert hm.sub (tendsto_log_nat_add_one_sub_log.const_mul x) using 2
[GOAL]
case h.e'_3.h
f : ℝ → ℝ
x✝¹ : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx✝ : 0 < x✝¹
m : ℕ
x : ℝ
hx : 0 < x
hy : ↑m < x - 1
hy' : x - 1 ≤ ↑m + 1
this✝ :
  ∀ᶠ (n : ℕ) in atTop,
    logGammaSeq (x - 1) n = logGammaSeq x (n - 1) + x * (log (↑(n - 1) + 1) - log ↑(n - 1)) - log (x - 1)
hm : Tendsto (fun n => logGammaSeq x n + x * (log (↑n + 1) - log ↑n)) atTop (𝓝 (f (x - 1) - f 1 + log (x - 1)))
this :
  ((fun x_1 =>
        (fun n => logGammaSeq x (n - 1) + x * (log (↑(n - 1) + 1) - log ↑(n - 1)) - log (x - 1)) x_1 +
          (fun b => log (x - 1)) x_1) ∘
      fun a => a + 1) =
    fun n => logGammaSeq x n + x * (log (↑n + 1) - log ↑n)
x✝ : ℕ
⊢ logGammaSeq x x✝ = logGammaSeq x x✝ + x * (log (↑x✝ + 1) - log ↑x✝) - x * (log (↑x✝ + 1) - log ↑x✝)
[PROOFSTEP]
ring
[GOAL]
case h.e'_5.h.e'_3
f : ℝ → ℝ
x✝ : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx✝ : 0 < x✝
m : ℕ
x : ℝ
hx : 0 < x
hy : ↑m < x - 1
hy' : x - 1 ≤ ↑m + 1
this✝ :
  ∀ᶠ (n : ℕ) in atTop,
    logGammaSeq (x - 1) n = logGammaSeq x (n - 1) + x * (log (↑(n - 1) + 1) - log ↑(n - 1)) - log (x - 1)
hm : Tendsto (fun n => logGammaSeq x n + x * (log (↑n + 1) - log ↑n)) atTop (𝓝 (f (x - 1) - f 1 + log (x - 1)))
this :
  ((fun x_1 =>
        (fun n => logGammaSeq x (n - 1) + x * (log (↑(n - 1) + 1) - log ↑(n - 1)) - log (x - 1)) x_1 +
          (fun b => log (x - 1)) x_1) ∘
      fun a => a + 1) =
    fun n => logGammaSeq x n + x * (log (↑n + 1) - log ↑n)
⊢ f x - f 1 = f (x - 1) - f 1 + log (x - 1) - x * 0
[PROOFSTEP]
have := hf_feq ((Nat.cast_nonneg m).trans_lt hy)
[GOAL]
case h.e'_5.h.e'_3
f : ℝ → ℝ
x✝ : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx✝ : 0 < x✝
m : ℕ
x : ℝ
hx : 0 < x
hy : ↑m < x - 1
hy' : x - 1 ≤ ↑m + 1
this✝¹ :
  ∀ᶠ (n : ℕ) in atTop,
    logGammaSeq (x - 1) n = logGammaSeq x (n - 1) + x * (log (↑(n - 1) + 1) - log ↑(n - 1)) - log (x - 1)
hm : Tendsto (fun n => logGammaSeq x n + x * (log (↑n + 1) - log ↑n)) atTop (𝓝 (f (x - 1) - f 1 + log (x - 1)))
this✝ :
  ((fun x_1 =>
        (fun n => logGammaSeq x (n - 1) + x * (log (↑(n - 1) + 1) - log ↑(n - 1)) - log (x - 1)) x_1 +
          (fun b => log (x - 1)) x_1) ∘
      fun a => a + 1) =
    fun n => logGammaSeq x n + x * (log (↑n + 1) - log ↑n)
this : f (x - 1 + 1) = f (x - 1) + log (x - 1)
⊢ f x - f 1 = f (x - 1) - f 1 + log (x - 1) - x * 0
[PROOFSTEP]
rw [sub_add_cancel] at this 
[GOAL]
case h.e'_5.h.e'_3
f : ℝ → ℝ
x✝ : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx✝ : 0 < x✝
m : ℕ
x : ℝ
hx : 0 < x
hy : ↑m < x - 1
hy' : x - 1 ≤ ↑m + 1
this✝¹ :
  ∀ᶠ (n : ℕ) in atTop,
    logGammaSeq (x - 1) n = logGammaSeq x (n - 1) + x * (log (↑(n - 1) + 1) - log ↑(n - 1)) - log (x - 1)
hm : Tendsto (fun n => logGammaSeq x n + x * (log (↑n + 1) - log ↑n)) atTop (𝓝 (f (x - 1) - f 1 + log (x - 1)))
this✝ :
  ((fun x_1 =>
        (fun n => logGammaSeq x (n - 1) + x * (log (↑(n - 1) + 1) - log ↑(n - 1)) - log (x - 1)) x_1 +
          (fun b => log (x - 1)) x_1) ∘
      fun a => a + 1) =
    fun n => logGammaSeq x n + x * (log (↑n + 1) - log ↑n)
this : f x = f (x - 1) + log (x - 1)
⊢ f x - f 1 = f (x - 1) - f 1 + log (x - 1) - x * 0
[PROOFSTEP]
rw [this]
[GOAL]
case h.e'_5.h.e'_3
f : ℝ → ℝ
x✝ : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx✝ : 0 < x✝
m : ℕ
x : ℝ
hx : 0 < x
hy : ↑m < x - 1
hy' : x - 1 ≤ ↑m + 1
this✝¹ :
  ∀ᶠ (n : ℕ) in atTop,
    logGammaSeq (x - 1) n = logGammaSeq x (n - 1) + x * (log (↑(n - 1) + 1) - log ↑(n - 1)) - log (x - 1)
hm : Tendsto (fun n => logGammaSeq x n + x * (log (↑n + 1) - log ↑n)) atTop (𝓝 (f (x - 1) - f 1 + log (x - 1)))
this✝ :
  ((fun x_1 =>
        (fun n => logGammaSeq x (n - 1) + x * (log (↑(n - 1) + 1) - log ↑(n - 1)) - log (x - 1)) x_1 +
          (fun b => log (x - 1)) x_1) ∘
      fun a => a + 1) =
    fun n => logGammaSeq x n + x * (log (↑n + 1) - log ↑n)
this : f x = f (x - 1) + log (x - 1)
⊢ f (x - 1) + log (x - 1) - f 1 = f (x - 1) - f 1 + log (x - 1) - x * 0
[PROOFSTEP]
ring
[GOAL]
f : ℝ → ℝ
x✝ : ℝ
n : ℕ
x : ℝ
hx : 0 < x
⊢ Tendsto (logGammaSeq x) atTop (𝓝 (log (Gamma x)))
[PROOFSTEP]
have : log (Gamma x) = (log ∘ Gamma) x - (log ∘ Gamma) 1 := by
  simp_rw [Function.comp_apply, Gamma_one, log_one, sub_zero]
[GOAL]
f : ℝ → ℝ
x✝ : ℝ
n : ℕ
x : ℝ
hx : 0 < x
⊢ log (Gamma x) = (log ∘ Gamma) x - (log ∘ Gamma) 1
[PROOFSTEP]
simp_rw [Function.comp_apply, Gamma_one, log_one, sub_zero]
[GOAL]
f : ℝ → ℝ
x✝ : ℝ
n : ℕ
x : ℝ
hx : 0 < x
this : log (Gamma x) = (log ∘ Gamma) x - (log ∘ Gamma) 1
⊢ Tendsto (logGammaSeq x) atTop (𝓝 (log (Gamma x)))
[PROOFSTEP]
rw [this]
[GOAL]
f : ℝ → ℝ
x✝ : ℝ
n : ℕ
x : ℝ
hx : 0 < x
this : log (Gamma x) = (log ∘ Gamma) x - (log ∘ Gamma) 1
⊢ Tendsto (logGammaSeq x) atTop (𝓝 ((log ∘ Gamma) x - (log ∘ Gamma) 1))
[PROOFSTEP]
refine' BohrMollerup.tendsto_logGammaSeq convexOn_log_Gamma (fun {y} hy => _) hx
[GOAL]
f : ℝ → ℝ
x✝ : ℝ
n : ℕ
x : ℝ
hx : 0 < x
this : log (Gamma x) = (log ∘ Gamma) x - (log ∘ Gamma) 1
y : ℝ
hy : 0 < y
⊢ (log ∘ Gamma) (y + 1) = (log ∘ Gamma) y + log y
[PROOFSTEP]
rw [Function.comp_apply, Gamma_add_one hy.ne', log_mul hy.ne' (Gamma_pos_of_pos hy).ne', add_comm, Function.comp_apply]
[GOAL]
f : ℝ → ℝ
hf_conv : ConvexOn ℝ (Ioi 0) (log ∘ f)
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = y * f y
hf_pos : ∀ {y : ℝ}, 0 < y → 0 < f y
hf_one : f 1 = 1
⊢ EqOn f Gamma (Ioi 0)
[PROOFSTEP]
suffices : EqOn (log ∘ f) (log ∘ Gamma) (Ioi (0 : ℝ))
[GOAL]
f : ℝ → ℝ
hf_conv : ConvexOn ℝ (Ioi 0) (log ∘ f)
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = y * f y
hf_pos : ∀ {y : ℝ}, 0 < y → 0 < f y
hf_one : f 1 = 1
this : EqOn (log ∘ f) (log ∘ Gamma) (Ioi 0)
⊢ EqOn f Gamma (Ioi 0)
case this
f : ℝ → ℝ
hf_conv : ConvexOn ℝ (Ioi 0) (log ∘ f)
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = y * f y
hf_pos : ∀ {y : ℝ}, 0 < y → 0 < f y
hf_one : f 1 = 1
⊢ EqOn (log ∘ f) (log ∘ Gamma) (Ioi 0)
[PROOFSTEP]
exact fun x hx => log_injOn_pos (hf_pos hx) (Gamma_pos_of_pos hx) (this hx)
[GOAL]
case this
f : ℝ → ℝ
hf_conv : ConvexOn ℝ (Ioi 0) (log ∘ f)
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = y * f y
hf_pos : ∀ {y : ℝ}, 0 < y → 0 < f y
hf_one : f 1 = 1
⊢ EqOn (log ∘ f) (log ∘ Gamma) (Ioi 0)
[PROOFSTEP]
intro x hx
[GOAL]
case this
f : ℝ → ℝ
hf_conv : ConvexOn ℝ (Ioi 0) (log ∘ f)
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = y * f y
hf_pos : ∀ {y : ℝ}, 0 < y → 0 < f y
hf_one : f 1 = 1
x : ℝ
hx : x ∈ Ioi 0
⊢ (log ∘ f) x = (log ∘ Gamma) x
[PROOFSTEP]
have e1 := BohrMollerup.tendsto_logGammaSeq hf_conv ?_ hx
[GOAL]
case this.refine_2
f : ℝ → ℝ
hf_conv : ConvexOn ℝ (Ioi 0) (log ∘ f)
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = y * f y
hf_pos : ∀ {y : ℝ}, 0 < y → 0 < f y
hf_one : f 1 = 1
x : ℝ
hx : x ∈ Ioi 0
e1 : Tendsto (BohrMollerup.logGammaSeq x) atTop (𝓝 ((log ∘ f) x - (log ∘ f) 1))
⊢ (log ∘ f) x = (log ∘ Gamma) x
[PROOFSTEP]
rw [Function.comp_apply (f := log) (g := f) (x := 1), hf_one, log_one, sub_zero] at e1 
[GOAL]
case this.refine_2
f : ℝ → ℝ
hf_conv : ConvexOn ℝ (Ioi 0) (log ∘ f)
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = y * f y
hf_pos : ∀ {y : ℝ}, 0 < y → 0 < f y
hf_one : f 1 = 1
x : ℝ
hx : x ∈ Ioi 0
e1 : Tendsto (BohrMollerup.logGammaSeq x) atTop (𝓝 ((log ∘ f) x))
⊢ (log ∘ f) x = (log ∘ Gamma) x
[PROOFSTEP]
exact tendsto_nhds_unique e1 (BohrMollerup.tendsto_log_gamma hx)
[GOAL]
case this.refine_1
f : ℝ → ℝ
hf_conv : ConvexOn ℝ (Ioi 0) (log ∘ f)
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = y * f y
hf_pos : ∀ {y : ℝ}, 0 < y → 0 < f y
hf_one : f 1 = 1
x : ℝ
hx : x ∈ Ioi 0
⊢ ∀ {y : ℝ}, 0 < y → (log ∘ f) (y + 1) = (log ∘ f) y + log y
[PROOFSTEP]
intro y hy
[GOAL]
case this.refine_1
f : ℝ → ℝ
hf_conv : ConvexOn ℝ (Ioi 0) (log ∘ f)
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = y * f y
hf_pos : ∀ {y : ℝ}, 0 < y → 0 < f y
hf_one : f 1 = 1
x : ℝ
hx : x ∈ Ioi 0
y : ℝ
hy : 0 < y
⊢ (log ∘ f) (y + 1) = (log ∘ f) y + log y
[PROOFSTEP]
rw [Function.comp_apply, Function.comp_apply, hf_feq hy, log_mul hy.ne' (hf_pos hy).ne']
[GOAL]
case this.refine_1
f : ℝ → ℝ
hf_conv : ConvexOn ℝ (Ioi 0) (log ∘ f)
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = y * f y
hf_pos : ∀ {y : ℝ}, 0 < y → 0 < f y
hf_one : f 1 = 1
x : ℝ
hx : x ∈ Ioi 0
y : ℝ
hy : 0 < y
⊢ log y + log (f y) = log (f y) + log y
[PROOFSTEP]
ring
[GOAL]
⊢ Gamma 2 = 1
[PROOFSTEP]
simpa [one_add_one_eq_two] using Gamma_nat_eq_factorial 1
[GOAL]
⊢ Gamma (3 / 2) < 1
[PROOFSTEP]
have A : (0 : ℝ) < 3 / 2 := by norm_num
[GOAL]
⊢ 0 < 3 / 2
[PROOFSTEP]
norm_num
[GOAL]
A : 0 < 3 / 2
⊢ Gamma (3 / 2) < 1
[PROOFSTEP]
have :=
  BohrMollerup.f_add_nat_le convexOn_log_Gamma (fun {y} hy => ?_) two_ne_zero one_half_pos
    (by norm_num : 1 / 2 ≤ (1 : ℝ))
[GOAL]
A : 0 < 3 / 2
⊢ 1 / 2 ≤ 1
[PROOFSTEP]
norm_num
[GOAL]
case refine_2
A : 0 < 3 / 2
this : (log ∘ Gamma) (↑2 + 1 / 2) ≤ (log ∘ Gamma) ↑2 + 1 / 2 * log ↑2
⊢ Gamma (3 / 2) < 1
case refine_1 A : 0 < 3 / 2 y : ℝ hy : 0 < y ⊢ (log ∘ Gamma) (y + 1) = (log ∘ Gamma) y + log y
[PROOFSTEP]
swap
[GOAL]
case refine_1
A : 0 < 3 / 2
y : ℝ
hy : 0 < y
⊢ (log ∘ Gamma) (y + 1) = (log ∘ Gamma) y + log y
[PROOFSTEP]
rw [Function.comp_apply, Gamma_add_one hy.ne', log_mul hy.ne' (Gamma_pos_of_pos hy).ne', add_comm, Function.comp_apply]
[GOAL]
case refine_2
A : 0 < 3 / 2
this : (log ∘ Gamma) (↑2 + 1 / 2) ≤ (log ∘ Gamma) ↑2 + 1 / 2 * log ↑2
⊢ Gamma (3 / 2) < 1
[PROOFSTEP]
rw [Function.comp_apply, Function.comp_apply, Nat.cast_two, Gamma_two, log_one, zero_add,
  (by norm_num : (2 : ℝ) + 1 / 2 = 3 / 2 + 1), Gamma_add_one A.ne', log_mul A.ne' (Gamma_pos_of_pos A).ne', ←
  le_sub_iff_add_le', log_le_iff_le_exp (Gamma_pos_of_pos A)] at this 
[GOAL]
A : 0 < 3 / 2
this : log (Gamma (2 + 1 / 2)) ≤ 1 / 2 * log 2
⊢ 2 + 1 / 2 = 3 / 2 + 1
[PROOFSTEP]
norm_num
[GOAL]
case refine_2
A : 0 < 3 / 2
this : Gamma (3 / 2) ≤ rexp (1 / 2 * log 2 - log (3 / 2))
⊢ Gamma (3 / 2) < 1
[PROOFSTEP]
refine' this.trans_lt (exp_lt_one_iff.mpr _)
[GOAL]
case refine_2
A : 0 < 3 / 2
this : Gamma (3 / 2) ≤ rexp (1 / 2 * log 2 - log (3 / 2))
⊢ 1 / 2 * log 2 - log (3 / 2) < 0
[PROOFSTEP]
rw [mul_comm, ← mul_div_assoc, div_sub' _ _ (2 : ℝ) two_ne_zero]
[GOAL]
case refine_2
A : 0 < 3 / 2
this : Gamma (3 / 2) ≤ rexp (1 / 2 * log 2 - log (3 / 2))
⊢ (log 2 * 1 - 2 * log (3 / 2)) / 2 < 0
[PROOFSTEP]
refine' div_neg_of_neg_of_pos _ two_pos
[GOAL]
case refine_2
A : 0 < 3 / 2
this : Gamma (3 / 2) ≤ rexp (1 / 2 * log 2 - log (3 / 2))
⊢ log 2 * 1 - 2 * log (3 / 2) < 0
[PROOFSTEP]
rw [sub_neg, mul_one, ← Nat.cast_two, ← log_pow, ← exp_lt_exp, Nat.cast_two, exp_log two_pos, exp_log]
[GOAL]
case refine_2
A : 0 < 3 / 2
this : Gamma (3 / 2) ≤ rexp (1 / 2 * log 2 - log (3 / 2))
⊢ 2 < (3 / 2) ^ 2
[PROOFSTEP]
norm_num
[GOAL]
case refine_2
A : 0 < 3 / 2
this : Gamma (3 / 2) ≤ rexp (1 / 2 * log 2 - log (3 / 2))
⊢ 0 < (3 / 2) ^ 2
[PROOFSTEP]
norm_num
[GOAL]
⊢ StrictMonoOn Gamma (Ici 2)
[PROOFSTEP]
convert
  convexOn_Gamma.strict_mono_of_lt (by norm_num : (0 : ℝ) < 3 / 2) (by norm_num : (3 / 2 : ℝ) < 2)
    (Gamma_two.symm ▸ Gamma_three_div_two_lt_one)
[GOAL]
⊢ 0 < 3 / 2
[PROOFSTEP]
norm_num
[GOAL]
⊢ 3 / 2 < 2
[PROOFSTEP]
norm_num
[GOAL]
case h.e'_6
⊢ Ici 2 = Ioi 0 ∩ Ici 2
[PROOFSTEP]
symm
[GOAL]
case h.e'_6
⊢ Ioi 0 ∩ Ici 2 = Ici 2
[PROOFSTEP]
rw [inter_eq_right_iff_subset]
[GOAL]
case h.e'_6
⊢ Ici 2 ⊆ Ioi 0
[PROOFSTEP]
exact fun x hx => two_pos.trans_le <| mem_Ici.mp hx
[GOAL]
s : ℝ
hs : s ≠ 0
⊢ doublingGamma (s + 1) = s * doublingGamma s
[PROOFSTEP]
rw [doublingGamma, doublingGamma, (by abel : s + 1 - 1 = s - 1 + 1), add_div, add_assoc, add_halves (1 : ℝ),
  Gamma_add_one (div_ne_zero hs two_ne_zero), rpow_add two_pos, rpow_one]
[GOAL]
s : ℝ
hs : s ≠ 0
⊢ s + 1 - 1 = s - 1 + 1
[PROOFSTEP]
abel
[GOAL]
s : ℝ
hs : s ≠ 0
⊢ s + 1 - 1 = s - 1 + 1
[PROOFSTEP]
abel
[GOAL]
s : ℝ
hs : s ≠ 0
⊢ Gamma (s / 2 + 1 / 2) * (s / 2 * Gamma (s / 2)) * (2 ^ (s - 1) * 2) / sqrt π =
    s * (Gamma (s / 2) * Gamma (s / 2 + 1 / 2) * 2 ^ (s - 1) / sqrt π)
[PROOFSTEP]
ring
[GOAL]
⊢ doublingGamma 1 = 1
[PROOFSTEP]
simp_rw [doublingGamma, Gamma_one_half_eq, add_halves (1 : ℝ), sub_self, Gamma_one, mul_one, rpow_zero, mul_one,
  div_self (sqrt_ne_zero'.mpr pi_pos)]
[GOAL]
⊢ EqOn (log ∘ doublingGamma) (fun s => log (Gamma (s / 2)) + log (Gamma (s / 2 + 1 / 2)) + s * log 2 - log (2 * sqrt π))
    (Ioi 0)
[PROOFSTEP]
intro s hs
[GOAL]
s : ℝ
hs : s ∈ Ioi 0
⊢ (log ∘ doublingGamma) s =
    (fun s => log (Gamma (s / 2)) + log (Gamma (s / 2 + 1 / 2)) + s * log 2 - log (2 * sqrt π)) s
[PROOFSTEP]
have h1 : sqrt π ≠ 0 := sqrt_ne_zero'.mpr pi_pos
[GOAL]
s : ℝ
hs : s ∈ Ioi 0
h1 : sqrt π ≠ 0
⊢ (log ∘ doublingGamma) s =
    (fun s => log (Gamma (s / 2)) + log (Gamma (s / 2 + 1 / 2)) + s * log 2 - log (2 * sqrt π)) s
[PROOFSTEP]
have h2 : Gamma (s / 2) ≠ 0 := (Gamma_pos_of_pos <| div_pos hs two_pos).ne'
[GOAL]
s : ℝ
hs : s ∈ Ioi 0
h1 : sqrt π ≠ 0
h2 : Gamma (s / 2) ≠ 0
⊢ (log ∘ doublingGamma) s =
    (fun s => log (Gamma (s / 2)) + log (Gamma (s / 2 + 1 / 2)) + s * log 2 - log (2 * sqrt π)) s
[PROOFSTEP]
have h3 : Gamma (s / 2 + 1 / 2) ≠ 0 := (Gamma_pos_of_pos <| add_pos (div_pos hs two_pos) one_half_pos).ne'
[GOAL]
s : ℝ
hs : s ∈ Ioi 0
h1 : sqrt π ≠ 0
h2 : Gamma (s / 2) ≠ 0
h3 : Gamma (s / 2 + 1 / 2) ≠ 0
⊢ (log ∘ doublingGamma) s =
    (fun s => log (Gamma (s / 2)) + log (Gamma (s / 2 + 1 / 2)) + s * log 2 - log (2 * sqrt π)) s
[PROOFSTEP]
have h4 : (2 : ℝ) ^ (s - 1) ≠ 0 := (rpow_pos_of_pos two_pos _).ne'
[GOAL]
s : ℝ
hs : s ∈ Ioi 0
h1 : sqrt π ≠ 0
h2 : Gamma (s / 2) ≠ 0
h3 : Gamma (s / 2 + 1 / 2) ≠ 0
h4 : 2 ^ (s - 1) ≠ 0
⊢ (log ∘ doublingGamma) s =
    (fun s => log (Gamma (s / 2)) + log (Gamma (s / 2 + 1 / 2)) + s * log 2 - log (2 * sqrt π)) s
[PROOFSTEP]
rw [Function.comp_apply, doublingGamma, log_div (mul_ne_zero (mul_ne_zero h2 h3) h4) h1, log_mul (mul_ne_zero h2 h3) h4,
  log_mul h2 h3, log_rpow two_pos, log_mul two_ne_zero h1]
[GOAL]
s : ℝ
hs : s ∈ Ioi 0
h1 : sqrt π ≠ 0
h2 : Gamma (s / 2) ≠ 0
h3 : Gamma (s / 2 + 1 / 2) ≠ 0
h4 : 2 ^ (s - 1) ≠ 0
⊢ log (Gamma (s / 2)) + log (Gamma (s / 2 + 1 / 2)) + (s - 1) * log 2 - log (sqrt π) =
    (fun s => log (Gamma (s / 2)) + log (Gamma (s / 2 + 1 / 2)) + s * log 2 - (log 2 + log (sqrt π))) s
[PROOFSTEP]
ring_nf
[GOAL]
⊢ ConvexOn ℝ (Ioi 0) (log ∘ doublingGamma)
[PROOFSTEP]
refine' (((ConvexOn.add _ _).add _).add_const _).congr log_doublingGamma_eq.symm
[GOAL]
case refine'_1
⊢ ConvexOn ℝ (Ioi 0) fun s => log (Gamma (s / 2))
[PROOFSTEP]
convert convexOn_log_Gamma.comp_affineMap (DistribMulAction.toLinearMap ℝ ℝ (1 / 2 : ℝ)).toAffineMap using 1
[GOAL]
case h.e'_9
⊢ Ioi 0 = ↑(LinearMap.toAffineMap (DistribMulAction.toLinearMap ℝ ℝ (1 / 2))) ⁻¹' Ioi 0
[PROOFSTEP]
simpa only [zero_div] using (preimage_const_mul_Ioi (0 : ℝ) one_half_pos).symm
[GOAL]
case h.e'_10
⊢ (fun s => log (Gamma (s / 2))) = (log ∘ Gamma) ∘ ↑(LinearMap.toAffineMap (DistribMulAction.toLinearMap ℝ ℝ (1 / 2)))
[PROOFSTEP]
ext1 x
[GOAL]
case h.e'_10.h
x : ℝ
⊢ log (Gamma (x / 2)) = ((log ∘ Gamma) ∘ ↑(LinearMap.toAffineMap (DistribMulAction.toLinearMap ℝ ℝ (1 / 2)))) x
[PROOFSTEP]
simp only [LinearMap.coe_toAffineMap, Function.comp_apply, DistribMulAction.toLinearMap_apply]
[GOAL]
case h.e'_10.h
x : ℝ
⊢ log (Gamma (x / 2)) = log (Gamma ((1 / 2) • x))
[PROOFSTEP]
rw [smul_eq_mul, mul_comm, mul_one_div]
[GOAL]
case refine'_2
⊢ ConvexOn ℝ (Ioi 0) fun s => log (Gamma (s / 2 + 1 / 2))
[PROOFSTEP]
refine' ConvexOn.subset _ (Ioi_subset_Ioi <| neg_one_lt_zero.le) (convex_Ioi _)
[GOAL]
case refine'_2
⊢ ConvexOn ℝ (Ioi (-1)) fun s => log (Gamma (s / 2 + 1 / 2))
[PROOFSTEP]
convert
  convexOn_log_Gamma.comp_affineMap
    ((DistribMulAction.toLinearMap ℝ ℝ (1 / 2 : ℝ)).toAffineMap + AffineMap.const ℝ ℝ (1 / 2 : ℝ)) using
  1
[GOAL]
case h.e'_9
⊢ Ioi (-1) = ↑(LinearMap.toAffineMap (DistribMulAction.toLinearMap ℝ ℝ (1 / 2)) + AffineMap.const ℝ ℝ (1 / 2)) ⁻¹' Ioi 0
[PROOFSTEP]
change Ioi (-1 : ℝ) = ((fun x : ℝ => x + 1 / 2) ∘ fun x : ℝ => (1 / 2 : ℝ) * x) ⁻¹' Ioi 0
[GOAL]
case h.e'_9
⊢ Ioi (-1) = ((fun x => x + 1 / 2) ∘ fun x => 1 / 2 * x) ⁻¹' Ioi 0
[PROOFSTEP]
rw [preimage_comp, preimage_add_const_Ioi, zero_sub, preimage_const_mul_Ioi (_ : ℝ) one_half_pos, neg_div,
  div_self (@one_half_pos ℝ _).ne']
[GOAL]
case h.e'_10
⊢ (fun s => log (Gamma (s / 2 + 1 / 2))) =
    (log ∘ Gamma) ∘ ↑(LinearMap.toAffineMap (DistribMulAction.toLinearMap ℝ ℝ (1 / 2)) + AffineMap.const ℝ ℝ (1 / 2))
[PROOFSTEP]
ext1 x
[GOAL]
case h.e'_10.h
x : ℝ
⊢ log (Gamma (x / 2 + 1 / 2)) =
    ((log ∘ Gamma) ∘ ↑(LinearMap.toAffineMap (DistribMulAction.toLinearMap ℝ ℝ (1 / 2)) + AffineMap.const ℝ ℝ (1 / 2)))
      x
[PROOFSTEP]
change log (Gamma (x / 2 + 1 / 2)) = log (Gamma ((1 / 2 : ℝ) • x + 1 / 2))
[GOAL]
case h.e'_10.h
x : ℝ
⊢ log (Gamma (x / 2 + 1 / 2)) = log (Gamma ((1 / 2) • x + 1 / 2))
[PROOFSTEP]
rw [smul_eq_mul, mul_comm, mul_one_div]
[GOAL]
case refine'_3
⊢ ConvexOn ℝ (Ioi 0) fun s => s * log 2
[PROOFSTEP]
simpa only [mul_comm _ (log _)] using (convexOn_id (convex_Ioi (0 : ℝ))).smul (log_pos one_lt_two).le
[GOAL]
s : ℝ
hs : 0 < s
⊢ doublingGamma s = Gamma s
[PROOFSTEP]
refine'
  eq_Gamma_of_log_convex doublingGamma_log_convex_Ioi (fun {y} hy => doublingGamma_add_one y hy.ne') (fun {y} hy => _)
    doublingGamma_one hs
[GOAL]
s : ℝ
hs : 0 < s
y : ℝ
hy : 0 < y
⊢ 0 < doublingGamma y
[PROOFSTEP]
apply_rules [mul_pos, Gamma_pos_of_pos, add_pos, inv_pos_of_pos, rpow_pos_of_pos, two_pos, one_pos,
  sqrt_pos_of_pos pi_pos]
[GOAL]
s : ℝ
hs : 0 < s
⊢ Gamma s * Gamma (s + 1 / 2) = Gamma (2 * s) * 2 ^ (1 - 2 * s) * sqrt π
[PROOFSTEP]
rw [← doublingGamma_eq_Gamma (mul_pos two_pos hs), doublingGamma, mul_div_cancel_left _ (two_ne_zero' ℝ),
  (by abel : 1 - 2 * s = -(2 * s - 1)), rpow_neg zero_le_two]
[GOAL]
s : ℝ
hs : 0 < s
⊢ 1 - 2 * s = -(2 * s - 1)
[PROOFSTEP]
abel
[GOAL]
s : ℝ
hs : 0 < s
⊢ 1 - 2 * s = -(2 * s - 1)
[PROOFSTEP]
abel
[GOAL]
s : ℝ
hs : 0 < s
⊢ Gamma s * Gamma (s + 1 / 2) = Gamma s * Gamma (s + 1 / 2) * 2 ^ (2 * s - 1) / sqrt π * (2 ^ (2 * s - 1))⁻¹ * sqrt π
[PROOFSTEP]
field_simp [(sqrt_pos_of_pos pi_pos).ne', (rpow_pos_of_pos two_pos (2 * s - 1)).ne']
[GOAL]
s : ℝ
hs : 0 < s
⊢ Gamma s * Gamma ((s * 2 + 1) / 2) * (sqrt π * 2 ^ (2 * s - 1)) =
    Gamma s * Gamma ((s * 2 + 1) / 2) * 2 ^ (2 * s - 1) * sqrt π
[PROOFSTEP]
ring
