Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Model of the one-dimensional infinite potential well

Definition
SchrodingerEquation_infinite_well_model

by LG · Sep 21, 2026 · Mathlib 0df444a (Lean v4.33.1)

differential-equationsmathematical-physicsquantum-mechanics

This file fixes the model for a particle of mass mmm in a one-dimensional infinite potential well of width L>0L > 0L>0, with reduced Planck constant ℏ\hbarℏ.

Stationary states. For real parameters ℏ,m,L,E\hbar, m, L, Eℏ,m,L,E and a function ψ:R→C\psi : \mathbb{R} \to \mathbb{C}ψ:R→C, the predicate IsStationaryState holds when all of the following are true:

  • ψ\psiψ is continuous on the closed interval [0,L][0, L][0,L];
  • ψ\psiψ is differentiable at every point of the open interval (0,L)(0, L)(0,L), and its derivative ψ′\psi'ψ′ is again differentiable at every point of (0,L)(0, L)(0,L);
  • the time-independent Schrödinger equation with vanishing potential holds inside the box,
−ℏ22m ψ′′(x)=E ψ(x)(0<x<L),-\frac{\hbar^{2}}{2m}\,\psi''(x) = E\,\psi(x) \qquad (0 < x < L),−2mℏ2​ψ′′(x)=Eψ(x)(0<x<L),

where the real coefficient is coerced into C\mathbb{C}C;

  • the wave function vanishes at the two walls: ψ(0)=0\psi(0) = 0ψ(0)=0 and ψ(L)=0\psi(L) = 0ψ(L)=0.

Nothing is required of ψ\psiψ outside [0,L][0, L][0,L]: the infinite walls make the wave function vanish there, and no statement in this mission refers to those values.

Energy levels. energyLevel is the real number

En=n2π2ℏ22mL2,n∈N,E_n = \frac{n^{2}\pi^{2}\hbar^{2}}{2 m L^{2}}, \qquad n \in \mathbb{N},En​=2mL2n2π2ℏ2​,n∈N,

defined for all natural nnn (including n=0n = 0n=0, where it equals 000).

Eigenfunctions. eigenfunction is the unnormalized standing wave

ψn(x)=sin⁡ ⁣(nπxL),\psi_n(x) = \sin\!\left(\frac{n \pi x}{L}\right),ψn​(x)=sin(Lnπx​),

regarded as a complex-valued function of the real variable xxx.

Definition code
import Mathlib

namespace SchrodingerEquation

/-- `IsStationaryState hbar m L E psi` says that the complex-valued function `psi` is a
stationary state of energy `E` for a particle of mass `m` in the one-dimensional infinite
potential well of width `L`: inside the box the potential vanishes, so `psi` solves the
time-independent Schrödinger equation `-(hbar^2 / (2 * m)) * psi'' = E * psi` on the open
interval `(0, L)`; `psi` is continuous up to the walls and vanishes at both walls. -/
def IsStationaryState (hbar m L E : ℝ) (psi : ℝ → ℂ) : Prop :=
  ContinuousOn psi (Set.Icc 0 L) ∧
    (∀ x ∈ Set.Ioo 0 L, DifferentiableAt ℝ psi x) ∧
    (∀ x ∈ Set.Ioo 0 L, DifferentiableAt ℝ (deriv psi) x) ∧
    (∀ x ∈ Set.Ioo 0 L,
      ((-(hbar ^ 2 / (2 * m)) : ℝ) : ℂ) * deriv (deriv psi) x = (E : ℂ) * psi x) ∧
    psi 0 = 0 ∧ psi L = 0

/-- The `n`-th energy level of the one-dimensional infinite potential well of width `L`:
`energyLevel hbar m L n = n ^ 2 * π ^ 2 * hbar ^ 2 / (2 * m * L ^ 2)`. -/
noncomputable def energyLevel (hbar m L : ℝ) (n : ℕ) : ℝ :=
  (n : ℝ) ^ 2 * Real.pi ^ 2 * hbar ^ 2 / (2 * m * L ^ 2)

/-- The unnormalized `n`-th eigenfunction of the one-dimensional infinite potential well of
width `L`: `x ↦ sin (n * π * x / L)`, regarded as a complex-valued function of a real
variable. -/
noncomputable def eigenfunction (L : ℝ) (n : ℕ) : ℝ → ℂ :=
  fun x => (Real.sin ((n : ℝ) * Real.pi * x / L) : ℂ)

end SchrodingerEquation
Source
Schrödinger equation, Wikipedia (revision retrieved 2026-09-21), https://en.wikipedia.org/wiki/Schr%C3%B6dinger_equation — sections "Time-independent equation", "Separation of variables" and "Examples → Particle in a box" (one-dimensional infinite potential well: general solution, boundary conditions at x = 0 and x = L, quantization condition k L = n π, energy levels E_n = n² π² ħ² / (2 m L²)).
Read-back

What the Lean code literally says, in plain math · non-blind self-read-back by the drafting agent (Aristotle, Harmonic)

Disclosure — this read-back is NOT independent testimony. It was written by the same agent that drafted the Lean statement it describes, at the explicit instruction of the proposal's owner, and not blind by a separate auditor with a fresh context. The author already knew what the statement was intended to say, so this text cannot serve the usual purpose of an independent cross-check; reviewers should weight it accordingly and may wish to commission a genuinely blind read-back before approval.

This bundle introduces three declarations, all parameterized by real numbers, with wave functions modelled as functions from the reals to the complex numbers.

1. A predicate IsStationaryState of four real parameters ℏ,m,L,E\hbar, m, L, Eℏ,m,L,E and a function ψ:R→C\psi : \mathbb{R} \to \mathbb{C}ψ:R→C. It is the conjunction of six conditions:

  • ψ\psiψ is continuous on the closed interval [0,L][0, L][0,L] (as a set of real numbers; if L<0L < 0L<0 this set is empty and the condition is vacuous);
  • for every real xxx with 0<x<L0 < x < L0<x<L, ψ\psiψ is differentiable at xxx;
  • for every real xxx with 0<x<L0 < x < L0<x<L, the function ψ′\psi'ψ′ — the pointwise derivative function of ψ\psiψ, which is defined at every real number and takes the junk value 000 wherever ψ\psiψ fails to be differentiable — is differentiable at xxx;
  • for every real xxx with 0<x<L0 < x < L0<x<L,
−ℏ22m⋅ψ′′(x)  =  E⋅ψ(x),-\frac{\hbar^{2}}{2m}\cdot \psi''(x) \;=\; E\cdot\psi(x),−2mℏ2​⋅ψ′′(x)=E⋅ψ(x),

an equation between complex numbers, where the real scalar −ℏ2/(2m)-\hbar^{2}/(2m)−ℏ2/(2m) and the real scalar EEE are embedded into C\mathbb{C}C, and ψ′′\psi''ψ′′ denotes the derivative function of the derivative function of ψ\psiψ. Note that if m=0m = 0m=0 the coefficient −ℏ2/(2m)-\hbar^{2}/(2m)−ℏ2/(2m) is 000 by the convention that division by zero yields zero, and the condition degenerates to E ψ(x)=0E\,\psi(x) = 0Eψ(x)=0;

  • ψ(0)=0\psi(0) = 0ψ(0)=0;
  • ψ(L)=0\psi(L) = 0ψ(L)=0.

No condition constrains ψ\psiψ at real arguments outside [0,L][0, L][0,L], and none of ℏ\hbarℏ, mmm, LLL, EEE is required to be positive, non-zero, or otherwise restricted here. If L≤0L \le 0L≤0 the open interval (0,L)(0, L)(0,L) is empty, so all four interval conditions hold vacuously and the predicate reduces to continuity on a degenerate set together with ψ(0)=ψ(L)=0\psi(0) = \psi(L) = 0ψ(0)=ψ(L)=0.

2. A real-valued quantity energyLevel of three real parameters ℏ,m,L\hbar, m, Lℏ,m,L and a natural number nnn, defined by the formula

n2 π2 ℏ22 m L2,\frac{n^{2}\,\pi^{2}\,\hbar^{2}}{2\,m\,L^{2}},2mL2n2π2ℏ2​,

with nnn cast from a natural number to a real number and π\piπ the usual circle constant. It is defined for every natural nnn, including n=0n = 0n=0, where its value is 000; if m=0m = 0m=0 or L=0L = 0L=0 the denominator vanishes and the value is 000 by the division-by-zero convention.

3. A complex-valued function eigenfunction of a real parameter LLL and a natural number nnn, namely the function sending a real xxx to the complex number whose real part is sin⁡ ⁣(nπx/L)\sin\!\big(n \pi x / L\big)sin(nπx/L) and whose imaginary part is zero. Again nnn may be 000 (giving the constant function 000), and if L=0L = 0L=0 the argument of the sine is 000 for every xxx by the division-by-zero convention, so the function is identically 000.

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me