Wronskian

lean4-proofdifferential-equationsvisualization
W(f,g)=fgfg0    {f,g} linearly independentW(f,g) = fg'-f'g \neq 0 \iff \{f,g\}\text{ linearly independent}

Statement

Given two differentiable functions f,gf, g, their Wronskian is

W(f,g)(x)=f(x)g(x)f(x)g(x)=det(fgfg)W(f, g)(x) = f(x)g'(x) - f'(x)g(x) = \det\begin{pmatrix} f & g \\ f' & g' \end{pmatrix}

Linear independence criterion: If ff and gg are solutions to the same second-order linear ODE on an interval, then either W(f,g)(x)0W(f,g)(x) \neq 0 for all xx in the interval (the solutions are linearly independent) or W(f,g)(x)=0W(f,g)(x) = 0 for all xx (the solutions are proportional).

This gives a decisive, computable test: two solutions form a fundamental system (basis for all solutions) iff W0W \neq 0 at any single point.

For polynomials over a ring, Mathlib defines Polynomial.wronskian a b = a * b.derivative - a.derivative * b, and the key identity wronskian_self_eq_zero shows W(a,a)=0W(a,a) = 0.

Visualization

Standard example: f=sinxf = \sin x, g=cosxg = \cos x (both solve y+y=0y'' + y = 0):

W(sin,cos)(x)=sinx(sinx)cosxcosx=sin2xcos2x=1W(\sin, \cos)(x) = \sin x \cdot (-\sin x) - \cos x \cdot \cos x = -\sin^2 x - \cos^2 x = -1

Since W=10W = -1 \neq 0 everywhere, {sin,cos}\{\sin, \cos\} is linearly independent.

xxf=sinxf = \sin xg=cosxg = \cos xf=cosxf' = \cos xg=sinxg' = -\sin xW=fgfgW = fg'-f'g
000011110001=10-1 = -1
π/4\pi/422\tfrac{\sqrt{2}}{2}22\tfrac{\sqrt{2}}{2}22\tfrac{\sqrt{2}}{2}22-\tfrac{\sqrt{2}}{2}1-1
π/2\pi/21100001-110=1-1-0 = -1
π\pi001-11-10001=10-1 = -1

W1W \equiv -1 confirms the functions are independent at every point.

Dependent example: f=exf = e^x, g=2exg = 2e^x.

W(ex,2ex)=ex2exex2ex=0W(e^x, 2e^x) = e^x \cdot 2e^x - e^x \cdot 2e^x = 0

W0W \equiv 0 reflects that g=2fg = 2f — the functions are proportional.

Proof Sketch

  1. Abel's identity. For y+p(x)y+q(x)y=0y'' + p(x)y' + q(x)y = 0, differentiate W=fgfgW = fg' - f'g and use the ODE to show W=p(x)WW' = -p(x)W.
  2. Integrating factor. Thus W(x)=W(x0)exp ⁣(x0xp(s)ds)W(x) = W(x_0)\exp\!\left(-\int_{x_0}^x p(s)\,ds\right).
  3. Dichotomy. Since the exponential is never zero, W(x0)=0W(x_0) = 0 iff W0W \equiv 0 on the interval.
  4. Basis. If W(x0)0W(x_0) \neq 0 at some x0x_0, then for any solution yy, the system c1f(x0)+c2g(x0)=y(x0)c_1 f(x_0) + c_2 g(x_0) = y(x_0), c1f(x0)+c2g(x0)=y(x0)c_1 f'(x_0) + c_2 g'(x_0) = y'(x_0) has a unique solution (Cramer's rule, det = W(x0)W(x_0)), giving y=c1f+c2gy = c_1 f + c_2 g by uniqueness of IVPs.

Connections

The Wronskian determinant is a 2×22 \times 2 special case of Determinant MultiplicativityDeterminant Multiplicativitydet(AB)=det(A)det(B)\det(AB) = \det(A)\,\det(B)The determinant of a product equals the product of determinantsRead more → and Cramer's rule (Cramer's RuleCramer's Rulexi=det(Ai)det(A)x_i = \frac{\det(A_i)}{\det(A)}Explicit determinant formula for the solution of a linear systemRead more →). The ODE uniqueness step appeals to Picard–Lindelöf TheoremPicard–Lindelöf Theoremy=f(t,y),  y(t0)=y0    !solution on [t0ε,t0+ε]y' = f(t,y),\; y(t_0)=y_0 \implies \exists!\,\text{solution on }[t_0-\varepsilon, t_0+\varepsilon]A Lipschitz right-hand side guarantees a unique local solution to any ODE initial value problem.Read more →.

Lean4 Proof

import Mathlib.RingTheory.Polynomial.Wronskian

/-!
  Mathlib defines `Polynomial.wronskian a b = a * b.derivative - a.derivative * b`.
  We verify the key properties:
    1. W(a, a) = 0 for any polynomial (wronskian_self_eq_zero)
    2. W is antisymmetric: -W(a,b) = W(b,a) (wronskian_neg_eq)
-/

open Polynomial in
/-- The Wronskian of any polynomial with itself is zero. -/
example (a : [X]) : wronskian a a = 0 :=
  wronskian_self_eq_zero a

open Polynomial in
/-- Wronskian is anti-symmetric: W(b, a) = -W(a, b). -/
example (a b : [X]) : wronskian b a = -wronskian a b := by
  rw [ wronskian_neg_eq]

/-- Concrete: W(X, X^2) = X^2 in ℤ[X].
    X * (X^2)' - X' * X^2 = X * 2X - 1 * X^2 = 2X^2 - X^2 = X^2. -/
example : Polynomial.wronskian (Polynomial.X : [X]) (Polynomial.X ^ 2) =
    Polynomial.X ^ 2 := by
  simp [Polynomial.wronskian, Polynomial.derivative_pow, Polynomial.derivative_X]
  ring