Real.pi is irrational #
The main result of this file is irrational_pi.
The proof is adapted from https://en.wikipedia.org/wiki/Proof_that_%CF%80_is_irrational#Cartwright's_proof.
The proof idea is as follows.
- Define a sequence of integrals 
I n θ = ∫ x in (-1)..1, (1 - x ^ 2) ^ n * cos (x * θ). - Give a recursion formula for 
I (n + 2) θ * θ ^ 2in terms ofI n θandI (n + 1) θ. Note we do not find it helpful to defineJas in the above proof, and instead work directly withI. - Define polynomials with integer coefficients 
sinPoly nandcosPoly nsuch thatI n θ * θ ^ (2 * n + 1) = n ! * (sinPoly n θ * sin θ + cosPoly n θ * cos θ). Note that in the informal proof, these polynomials are not defined explicitly, but we find it useful to define them by recursion. - Show that both these polynomials have degree bounded by 
n. - Show that 
0 < I n (π / 2) ≤ 2for alln. - Now we can finish: if 
π / 2is rational, write it asa / bwitha, b > 0. Thenb ^ (2 * n + 1) * sinPoly n (a / b)is a positive integer by the degree bound. But it is equal toa ^ (2 * n + 1) / n ! * I n (π / 2) ≤ 2 * a * (2 * n + 1) / n !, which converges to 0 asn → ∞.