A double-integral formula for the needle crossing indicator
ProvedBuffonsNeedle.buffon_integralbook-chapter-27lean4probabilityproofs-from-the-book
Let be a measure space, let , and let be measurable with uniform distribution on with respect to . Write . For a real parameter l, let equal 1 if
and equal 0 otherwise. The angle is measured from the vertical axis. Then
The integrals on the right use Lebesgue measure. This intermediate identity permits arbitrary real l; positivity and the short-needle restriction are not hypotheses.
Preamble
import Init
import Mathlib.Analysis.SpecialFunctions.Integrals.Basic
import Mathlib.MeasureTheory.Integral.Prod
import Mathlib.Probability.Density
import Mathlib.Probability.Distributions.Uniform
import Mathlib.Probability.Notation
import Mathlib
import Definitions.Def_P2MAssembly_Chapter25
open MeasureTheory (MeasureSpace IsProbabilityMeasure Measure pdf.IsUniform)
open ProbabilityTheory Real
open BuffonsNeedle
variable
/- Probability theory variables. -/
{Ω : Type*} [MeasureSpace Ω]
/- Buffon's needle variables. -/
/-
- `d > 0` is the distance between parallel lines.
- `l > 0` is the length of the needle.
-/
(d l : ℝ)
(hd : 0 < d)
(hl : 0 < l)
/- `B = (X, Θ)` is the joint random variable for the x-position and angle of the needle. -/
(B : Ω → ℝ × ℝ)
(hBₘ : Measurable B)
/- `B` is uniformly distributed on `[-d/2, d/2] × [0, π]`. -/
(hB : pdf.IsUniform B ((Set.Icc (-d / 2) (d / 2)) ×ˢ (Set.Icc 0 π)) ℙ)
include hd hB hBₘ
Formal statement
lemma BuffonsNeedle.buffon_integral :
𝔼[N l B] = (d * π)⁻¹ *
∫ (θ : ℝ) in Set.Icc 0 π,
∫ (_ : ℝ) in Set.Icc (-d / 2) (d / 2) ∩ Set.Icc (-θ.sin * l / 2) (θ.sin * l / 2), 1 := by sorrySource
Mathlib Archive original proof: https://github.com/leanprover-community/mathlib4/blob/c5ea00351c28e24afc9f0f84379aa41082b1188f/Archive/Wiedijk100Theorems/BuffonsNeedle.lean#L193. Archive authors: Enrico Z. Borba; Apache 2.0 license retained. Topic: Aigner and Ziegler, Proofs from THE BOOK, 6th edition, Chapter 27, “Buffon’s needle problem”, pp. 189–192 (https://doi.org/10.1007/978-3-662-57265-8_27).