Physlib.Mathematics.SpecialFunctions.EllipticIntegral
The complete elliptic integral of the first kind
This file may eventually be upstreamed to Mathlib.
i. Overview
Legendre's complete elliptic integral of the first kind is, in the parameter convention,
`K(m) = ∫ φ in 0..π/2, (1 - m sin² φ) ^ (-1/2)`
(Abramowitz & Stegun 17.3.1). The physics literature more often uses the modulus convention and writes `K(k)`, as Landau & Lifshitz do, for what is here `completeEllipticK (k ^ 2)`; the two conventions are related by `m = k²`. Mathlib knows the Weierstrass elliptic function `℘` (`PeriodPair.weierstrassP`) but has no Legendre-form elliptic integrals; this file defines the complete integral of the first kind and develops its basic theory on the domain `m < 1`, where the radicand `1 - m sin² φ` is positive and the integrand continuous.
The integral enters physics wherever a period or a potential is computed exactly rather than in a small-parameter expansion. Physlib's use of it so far is the simple pendulum: released from rest at amplitude `θ₀`, the pendulum has period `4 √(ℓ / g) K(sin² (θ₀ / 2))` (Landau & Lifshitz §11, Problem 1), the consumer being `Physlib.ClassicalMechanics.Pendulum.SimplePendulum.PeriodFormula`. More broadly, the complete integrals of the first and second kind give the magnetic field of a circular current loop and the potential of a uniformly charged ring, and the second kind, `E`, gives the arc length of an ellipse. This file defines `K` so that such results can be stated.
For `m ≥ 1` the definition still elaborates, but its value is not Legendre's. At `m = 1` the integrand is `1 / cos φ`, which is not interval integrable on `[0, π/2]`, so the integral is `0` by `intervalIntegral.integral_undef`, whereas `K(1) = ∞`. For `m > 1` the radicand is negative on `(arcsin (1/√m), π/2]`, where the real power at exponent `-(1/2)` of a negative base vanishes (`Real.rpow_def_of_neg` supplies the factor `cos (-(1 / 2) * π) = 0`), so the Lean value is the finite positive integral over `[0, arcsin (1/√m)]`; by the reciprocal-modulus transformation this is `K(1/m) / √m`, the real part of the complex Legendre integral (DLMF §19.7(ii)) — not proved here. Every lemma of this file about a general parameter therefore carries its domain hypothesis `m < 1` explicitly.
ii. Key results
- `completeEllipticK` : the complete elliptic integral of the first kind, as a function of the parameter `m`. - `completeEllipticK_zero` : `K 0 = π / 2`. - `completeEllipticK_pos` : for `m < 1` the integral is positive. - `completeEllipticK_mono` : for `m₁ ≤ m₂ < 1`, `K m₁ ≤ K m₂`. - `completeEllipticK_strictMono` : for `m₁ < m₂ < 1`, `K m₁ < K m₂`. - `pi_div_two_le_completeEllipticK` : for `0 ≤ m < 1`, `π / 2 ≤ K m`. - `completeEllipticK_le` : for `0 ≤ m < 1`, `K m ≤ π / 2 * (1 - m) ^ (-1/2)`. - `continuousOn_completeEllipticK` : `K` is continuous on `(-∞, 1)`. - `continuousAt_completeEllipticK` : `K` is continuous at every `m < 1`.
iii. Table of contents
- A. Definition and the integrand
- B. Value at zero and positivity
- C. Monotonicity and bounds in the parameter
- D. Continuity on the domain
iv. References
- M. Abramowitz, I. A. Stegun, Handbook of Mathematical Functions, §17.3 (the parameter convention, 17.3.1). - NIST DLMF §19.7(ii) (the reciprocal-modulus transformation). - Landau & Lifshitz, Mechanics, 3rd ed., §11, Problem 1 (the pendulum period as `K(k)`, modulus convention).
A. Definition and the integrand
The integral is defined for every real parameter `m`; on the domain `m < 1` the radicand is positive, so the integrand is continuous and interval integrable.
B. Value at zero and positivity
At `m = 0` the integrand is the constant `1` and the integral is elementary; for `m < 1` the integral is positive, being the integral of a positive continuous function.
C. Monotonicity and bounds in the parameter
For fixed `φ` the radicand `1 - m sin² φ` decreases in `m`, so the integrand, a negative power of the radicand, increases in `m` on the domain; integrating the pointwise inequality over `[0, π/2]` gives monotonicity of `K`, and since the inequality is strict at `φ = π/2` the monotonicity is strict. Together with `K 0 = π / 2` this bounds `K` below on `[0, 1)`; bounding the radicand below by `1 - m` bounds `K` above by `π / 2 * (1 - m) ^ (-1/2)` there.
D. Continuity on the domain
The integrand is jointly continuous in `(m, φ)` on `(-∞, 1) × ℝ`, where the radicand is positive, but not on all of `ℝ × ℝ`. Restricting the parameter to the subtype `Set.Iio 1` makes the joint continuity global, so Mathlib's continuity of a parametric interval integral with fixed endpoints (`intervalIntegral.continuous_parametric_intervalIntegral_of_continuous'`) applies and gives continuity of `K` on the domain. Continuity at each point `m < 1` follows, `(-∞, 1)` being a neighbourhood of `m`.
16 declarations
Complete elliptic integral of the first kind
The complete elliptic integral of the first kind is defined for a real number as the integral: where is the parameter and is the variable of integration. For , this corresponds to the standard Legendre form where the integrand is continuous and positive.
For any real number , the complete elliptic integral of the first kind is given by the integral:
for
For any real number and any real number , the radicand appearing in the definition of the complete elliptic integral of the first kind is strictly positive.
Continuity of the integrand of the complete elliptic integral of the first kind for
For any real number , the function is continuous for all . This function is the integrand used in the definition of Legendre's complete elliptic integral of the first kind .
The integrand of the complete elliptic integral of the first kind is interval integrable for
For any real number , the function is interval integrable on the interval .
The complete elliptic integral of the first kind evaluated at parameter is equal to . At this parameter value, the integrand of the integral reduces to the constant function .
for
For any real number , the complete elliptic integral of the first kind is strictly positive, i.e., .
For any real numbers and such that and , the complete elliptic integral of the first kind , defined as satisfies .
is Monotone on
The complete elliptic integral of the first kind is monotone on the interval . That is, for any , if , then .
Strict monotonicity of for
For any real numbers and such that , the complete elliptic integral of the first kind satisfies . Here, is defined as
is Strictly Increasing on
The complete elliptic integral of the first kind , defined as is strictly increasing on the interval .
for
For any real number such that , the complete elliptic integral of the first kind is bounded below by , that is, .
for
For any real number such that , the complete elliptic integral of the first kind satisfies the inequality
is continuous on
The complete elliptic integral of the first kind , defined for a real parameter as is continuous on the interval .
is continuous for
For any real number such that , the complete elliptic integral of the first kind is continuous at .
is continuous at
The complete elliptic integral of the first kind is continuous at .
