Niven's theorem
ProvedFamousTheorems.nivenNiven's theorem.
If is a rational multiple of and is rational, then
Rationality in the angle and rationality in the cosine are almost incompatible: only the five values coming from the angles and their translates survive. So , for instance, is irrational, and the familiar exact values and are irrational as the theorem demands.
The proof observes that is an algebraic integer whenever is a rational multiple of — it satisfies a monic integer recurrence coming from — and a rational algebraic integer is an ordinary integer. Since , it lies in .
Niven gave this in his 1956 monograph Irrational Numbers; the companion statements for sine and tangent follow by shifting the angle.
Formalization note. The hypotheses say for some rational and that
equals the cast of some rational. The result is Mathlib's Real.niven.
import Mathlib
namespace FamousTheorems
open Filter Set Topology
theorem niven {θ : ℝ} (hθ : ∃ r : ℚ, θ = r * Real.pi) (hcos : ∃ q : ℚ, Real.cos θ = q) :
Real.cos θ ∈ ({-1, -1 / 2, 0, 1 / 2, 1} : Set ℝ) := by sorry
end FamousTheorems