Skip to content

Commit ef1e003

Browse files
committed
feat: integral of log ∘ sin (#26172)
Compute special values of the integral of `log ∘ sin`. Given that the indefinite integral involves the dilogarithm, this can be seen as computing special values of `Li₂`. This material is used in [Project VD](https://github.com/kebekus/ProjectVD), which aims to formalize Value Distribution Theory for meromorphic functions on the complex plane.
1 parent ea01174 commit ef1e003

File tree

2 files changed

+79
-0
lines changed

2 files changed

+79
-0
lines changed

Mathlib.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1803,6 +1803,7 @@ import Mathlib.Analysis.SpecialFunctions.ImproperIntegrals
18031803
import Mathlib.Analysis.SpecialFunctions.Integrability.Basic
18041804
import Mathlib.Analysis.SpecialFunctions.Integrability.LogMeromorphic
18051805
import Mathlib.Analysis.SpecialFunctions.Integrals.Basic
1806+
import Mathlib.Analysis.SpecialFunctions.Integrals.LogTrigonometric
18061807
import Mathlib.Analysis.SpecialFunctions.JapaneseBracket
18071808
import Mathlib.Analysis.SpecialFunctions.Log.Base
18081809
import Mathlib.Analysis.SpecialFunctions.Log.Basic
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
/-
2+
Copyright (c) 2025 Stefan Kebekus. All rights reserved.
3+
Released under Apache 2.0 license as described in the file LICENSE.
4+
Authors: Stefan Kebekus
5+
-/
6+
import Mathlib.Analysis.SpecialFunctions.Integrability.LogMeromorphic
7+
8+
/-!
9+
# Integral of `log ∘ sin`
10+
11+
This file computes special values of the integral of `log ∘ sin`. Given that the indefinite integral
12+
involves the dilogarithm, this can be seen as computing special values of `Li₂`.
13+
-/
14+
15+
open Filter Interval Real
16+
17+
/-
18+
Helper lemma for `integral_log_sin_zero_pi_div_two`: The integral of `log ∘ sin` on `0 … π` is
19+
double the integral on `0 … π/2`.
20+
-/
21+
private lemma integral_log_sin_zero_pi_eq_two_mul_integral_log_sin_zero_pi_div_two :
22+
∫ x in (0)..π, log (sin x) = 2 * ∫ x in (0)..(π / 2), log (sin x) := by
23+
rw [← intervalIntegral.integral_add_adjacent_intervals (a := 0) (b := π / 2) (c := π)
24+
(by apply intervalIntegrable_log_sin) (by apply intervalIntegrable_log_sin)]
25+
conv =>
26+
left; right; arg 1
27+
intro x
28+
rw [← sin_pi_sub]
29+
rw [intervalIntegral.integral_comp_sub_left (fun x ↦ log (sin x)), sub_self,
30+
(by linarith : π - π / 2 = π / 2)]
31+
ring!
32+
33+
/--
34+
The integral of `log ∘ sin` on `0 … π/2` equals `-log 2 * π / 2`.
35+
-/
36+
theorem integral_log_sin_zero_pi_div_two : ∫ x in (0)..(π / 2), log (sin x) = -log 2 * π / 2 := by
37+
calc ∫ x in (0)..(π / 2), log (sin x)
38+
_ = ∫ x in (0)..(π / 2), (log (sin (2 * x)) - log 2 - log (cos x)) := by
39+
apply intervalIntegral.integral_congr_codiscreteWithin
40+
apply Filter.codiscreteWithin.mono (by tauto : Ι 0 (π / 2) ⊆ Set.univ)
41+
have t₀ : sin ⁻¹' {0}ᶜ ∈ Filter.codiscrete ℝ := by
42+
apply analyticOnNhd_sin.preimage_zero_mem_codiscrete (x := π / 2)
43+
simp
44+
have t₁ : cos ⁻¹' {0}ᶜ ∈ Filter.codiscrete ℝ := by
45+
apply analyticOnNhd_cos.preimage_zero_mem_codiscrete (x := 0)
46+
simp
47+
filter_upwards [t₀, t₁] with y h₁y h₂y
48+
simp_all only [Set.preimage_compl, Set.mem_compl_iff, Set.mem_preimage, Set.mem_singleton_iff,
49+
sin_two_mul, ne_eq, mul_eq_zero, OfNat.ofNat_ne_zero, or_self, not_false_eq_true, log_mul]
50+
ring
51+
_ = (∫ x in (0)..(π / 2), log (sin (2 * x))) - π / 2 * log 2
52+
- ∫ x in (0)..(π / 2), log (cos x) := by
53+
rw [intervalIntegral.integral_sub _ _,
54+
intervalIntegral.integral_sub _ intervalIntegrable_const,
55+
intervalIntegral.integral_const]
56+
· simp
57+
· simpa using (intervalIntegrable_log_sin (a := 0) (b := π)).comp_mul_left 2
58+
· apply IntervalIntegrable.sub _ intervalIntegrable_const
59+
simpa using (intervalIntegrable_log_sin (a := 0) (b := π)).comp_mul_left 2
60+
· exact intervalIntegrable_log_cos
61+
_ = (∫ x in (0)..(π / 2), log (sin (2 * x)))
62+
- π / 2 * log 2 - ∫ x in (0)..(π / 2), log (sin x) := by
63+
simp [← sin_pi_div_two_sub,
64+
intervalIntegral.integral_comp_sub_left (fun x ↦ log (sin x)) (π / 2)]
65+
_ = -log 2 * π / 2 := by
66+
simp only [intervalIntegral.integral_comp_mul_left (f := fun x ↦ log (sin x)) two_ne_zero,
67+
mul_zero, (by linarith : 2 * (π / 2) = π),
68+
integral_log_sin_zero_pi_eq_two_mul_integral_log_sin_zero_pi_div_two, smul_eq_mul, ne_eq,
69+
OfNat.ofNat_ne_zero, not_false_eq_true, inv_mul_cancel_left₀, sub_sub_cancel_left, neg_mul]
70+
linarith
71+
72+
/--
73+
The integral of `log ∘ sin` on `0 … π` equals `-log 2 * π`.
74+
-/
75+
theorem integral_log_sin_zero_pi : ∫ x in (0)..π, log (sin x) = -log 2 * π := by
76+
rw [integral_log_sin_zero_pi_eq_two_mul_integral_log_sin_zero_pi_div_two,
77+
integral_log_sin_zero_pi_div_two]
78+
ring

0 commit comments

Comments
 (0)