/-Copyright (c) 2026 Carles MarΓn. All rights reserved.Released under Apache 2.0 license as described in the file LICENSE.Authors: Carles MarΓn-/module public import Mathlib.Analysis.Analytic.OfScalarspublic import Mathlib.Analysis.Calculus.FDeriv.Analyticpublic import Mathlib.Analysis.SpecialFunctions.Exponentialpublic import Mathlib.Analysis.SpecificLimits.Basicpublic import Mathlib.Analysis.SpecialFunctions.Trigonometric.Basicpublic import Mathlib.Analysis.SpecialFunctions.Trigonometric.Derivpublic import Mathlib.Analysis.Calculus.MeanValuepublic import Mathlib.Analysis.Calculus.Deriv.MeanValuepublic import Mathlib.Analysis.Convex.Derivpublic import Mathlib.Analysis.SpecialFunctions.ImproperIntegrals /-!# The real Airy functions The power series `F = Ξ£ aβ xβΏ` with `a_{k+3} = a_k / ((k + 2)(k + 3))`, `aβ = c0`, `aβ = c1`,`aβ = 0`, as a real function `airyFun c0 c1 : β β β`. It is entire, solves `F'' = x F` as afunctional identity, has zeros unbounded below, and does not decay at `+β` when positive withnon-negative slope at some `xβ > 0`. A decaying (recessive) solution is built by reduction of order,`Ai_rec = f β«β^β fβ»Β²`, without the asymptotic expansions of DLMF Β§9.7, and is extended to anentire Airy function. Applied to the quantum bouncer `Ο'' = Ξ±Β²(Ξ±x β Ξ²)Ο` on `[0, β)` with`Ο(0) = 0`: there are infinitely many energy levels. ## Main results * `Airy.airyFun_entire`: `airyFun c0 c1` is analytic on all of `β` (radius of convergence `β`).* `Airy.airyFun_ode`: `deriv (deriv (airyFun c0 c1)) x = x * airyFun c0 c1 x`.* `Airy.sturm_unbounded_zeros`, `Airy.airyFun_unbounded_zeros`: every solution has zeros unbounded below (Sturm comparison with `sin (βc (x β a))`, from Rolle and the intermediate value theorem).* `Airy.airyFun_not_decaying`: a solution positive with non-negative slope at `xβ > 0` does not tend to `0`.* `Airy.exists_recessive_solution`: a non-trivial solution on `(0, β)` tending to `0` at `+β`.* `Airy.exists_entire_recessive`: an entire `airyFun c0 c1`, not identically zero, tending to `0` at `+β` (through the basis Wronskian `W(f, g) = 1`).* `Airy.bouncer_ode`, `Airy.bouncer_bc`, `Airy.bouncer_levels_infinite`: the quantum bouncer has infinitely many energy levels, the negatives of the zeros of an Airy function. ## Implementation notes Mathlib has no SturmβLiouville or Sturm comparison theory; the oscillation argument is built herefrom Rolle's theorem, the mean value theorem and the intermediate value theorem. ## References * NIST Digital Library of Mathematical Functions, Chapter 9 (Airy and Related Functions), https://dlmf.nist.gov/9.* O. VallΓ©e, M. Soares, *Airy Functions and Applications to Physics*, Imperial College Press (2010).* E. A. Coddington, N. Levinson, *Theory of Ordinary Differential Equations*, McGrawβHill (1955), Ch. 8.* R. L. Gibbs, *The quantum bouncer*, Am. J. Phys. 43 (1975) 25β28.* V. V. Nesvizhevsky et al., *Quantum states of neutrons in the Earth's gravitational field*, Nature 415 (2002) 297β299.* C. MarΓn, *How a Falling Particle Counts Its Floors: the Airy function as a verified entire solution of y''=xy, its oscillation, and the quantum-bouncer spectrum, machine-checked in Lean 4* (2026), doi:10.5281/zenodo.20787671. Ported from `AiryReal.lean` of [karlesmarin/airy-bouncer-lean](https://github.com/karlesmarin/airy-bouncer-lean) (Lean v4.30.0-rc2).-/ @[expose] public section open FormalMultilinearSeries Filter ContinuousLinearMap Real Set MeasureTheoryopen scoped Nat Real Topology namespace Airy /-- Real Airy coefficients: solution of y''=xy with y(0)=c0, y'(0)=c1. -/noncomputable def coeffR (c0 c1 : β) : β β β | 0 => c0 | 1 => c1 | 2 => 0 | (k + 3) => coeffR c0 c1 k / (((k : β) + 2) * ((k : β) + 3)) theorem coeffR_succ3 (c0 c1 : β) (k : β) : coeffR c0 c1 (k + 3) = coeffR c0 c1 k / (((k : β) + 2) * ((k : β) + 3)) := rfl /-- Recurrence cleared of its denominator: `(k+2)(k+3)Β·a(k+3) = a(k)`. This is the identity`(k+2)(k+1)c_{k+2}=c_{k-1}` reindexed; it drives the F''=xΒ·F coefficient match. -/theorem coeffR_mul_succ3 (c0 c1 : β) (k : β) : (((k : β) + 2) * ((k : β) + 3)) * coeffR c0 c1 (k + 3) = coeffR c0 c1 k := by rw [coeffR_succ3]; field_simp /-- **Coefficient bound.** `|aβ| β€ M / βn/3β!` with `M = max |c0| |c1|`.Each 3-step divides by `(k+2)(k+3) β₯ βk/3β+1`, so the factorial grows one step per 3 indices. -/theorem coeffR_abs_le (c0 c1 : β) (n : β) : |coeffR c0 c1 n| β€ max |c0| |c1| / (n / 3).factorial := by induction n using Nat.strong_induction_on with | _ n ih => have hM : (0:β) β€ max |c0| |c1| := le_trans (abs_nonneg c0) (le_max_left _ _) rcases n with _ | _ | _ | k Β· simp [coeffR] Β· simp [coeffR] Β· simp [coeffR] Β· have hd : (0:β) < ((k : β) + 2) * ((k : β) + 3) := by positivity have hk := ih k (by omega) have hFpos : (0:β) < ((k / 3).factorial : β) := by exact_mod_cast (k / 3).factorial_pos have hk' : |coeffR c0 c1 k| * ((k / 3).factorial : β) β€ max |c0| |c1| := (le_div_iffβ hFpos).mp hk have hfac : ((k + 3) / 3).factorial = (k / 3 + 1) * (k / 3).factorial := by rw [show (k + 3) / 3 = k / 3 + 1 from by omega, Nat.factorial_succ] have hb : ((k / 3 : β) : β) + 1 β€ ((k : β) + 2) * ((k : β) + 3) := by have hle : ((k / 3 : β) : β) β€ (k : β) := by exact_mod_cast Nat.div_le_self k 3 nlinarith [hle, Nat.cast_nonneg (Ξ± := β) k] rw [coeffR_succ3, abs_div, abs_of_pos hd, div_le_div_iffβ hd (by exact_mod_cast ((k + 3) / 3).factorial_pos), hfac] push_cast nlinarith [hk', hM, hFpos, hb, abs_nonneg (coeffR c0 c1 k), mul_nonneg (abs_nonneg (coeffR c0 c1 k)) hFpos.le] /-- **Summability.** For every radius `r`, `β |aβ|Β·rβΏ` converges. Comparison with theregrouped series `β rβΏ/βn/3β! = (1+r+rΒ²)Β·β(rΒ³)α΅/m! = (1+r+rΒ²)Β·e^{rΒ³}`. -/theorem summable_coeffR_norm (c0 c1 : β) (r : NNReal) : Summable (fun n => βcoeffR c0 c1 nβ * (r : β) ^ n) := by have hMnonneg : (0:β) β€ max |c0| |c1| := le_trans (abs_nonneg c0) (le_max_left _ _) -- the dominating (exp rΒ³)-type series, reindexed by (m,i) β¦ 3m+i have hg' : Summable (fun p : β Γ Fin 3 => (r : β) ^ (p.1 * 3 + (p.2 : β)) / (p.1).factorial) := by rw [summable_prod_of_nonneg (fun p => by positivity)] refine β¨fun m => Summable.of_finite, ?_β© have hsum : β m : β, (β' i : Fin 3, (r : β) ^ (m * 3 + (i : β)) / (m).factorial) = (1 + (r : β) + (r : β) ^ 2) * (((r : β) ^ 3) ^ m / m.factorial) := by intro m rw [tsum_fintype, Fin.sum_univ_three] simp only [show ((0 : Fin 3) : β) = 0 from rfl, show ((1 : Fin 3) : β) = 1 from rfl, show ((2 : Fin 3) : β) = 2 from rfl] ring simp_rw [hsum] exact (Real.summable_pow_div_factorial ((r : β) ^ 3)).mul_left _ -- β rβΏ/βn/3β! converges (reindex n β¦ (n/3, n%3)) have key : Summable (fun n : β => (r : β) ^ n / (n / 3).factorial) := by rw [β (Nat.divModEquiv 3).symm.summable_iff] refine hg'.congr fun p => ?_ have hlt := p.2.isLt simp only [Function.comp_apply, Nat.divModEquiv_symm_apply] rw [show (p.1 * 3 + (p.2 : β)) / 3 = p.1 from by omega] -- comparison: |aβ|Β·rβΏ β€ MΒ·(rβΏ/βn/3β!) refine Summable.of_nonneg_of_le (fun n => by positivity) (fun n => ?_) (key.mul_left (max |c0| |c1|)) rw [Real.norm_eq_abs] calc |coeffR c0 c1 n| * (r : β) ^ n β€ (max |c0| |c1| / (n / 3).factorial) * (r : β) ^ n := mul_le_mul_of_nonneg_right (coeffR_abs_le c0 c1 n) (by positivity) _ = max |c0| |c1| * ((r : β) ^ n / (n / 3).factorial) := by ring /-- A scalar formal multilinear series is determined by its coefficients. -/theorem scalar_fms_ext (p q : FormalMultilinearSeries β β β) (h : β n, p.coeff n = q.coeff n) : p = q := by ext n rw [β mkPiRing_coeff_eq p n, β mkPiRing_coeff_eq q n, h n] /-- **Term-by-term differentiation.** If `f` is the sum of `β aβ xβΏ` on a ball, then `deriv f`is the sum of `β (n+1) a_{n+1} xβΏ`. Built from `HasFPowerSeriesOnBall.fderiv` (the derivative'spower series is `derivSeries`) + evaluation at `1` + `derivSeries_coeff_one`. -/theorem deriv_ofScalarsSum {a : β β β} {f : β β β} (hf : HasFPowerSeriesOnBall f (ofScalars β a) 0 β€) : HasFPowerSeriesOnBall (deriv f) (ofScalars β (fun n => ((n : β) + 1) * a (n + 1))) 0 β€ := by have hcomp := (ContinuousLinearMap.apply β β (1 : β)).comp_hasFPowerSeriesOnBall hf.fderiv have hfun : (fun x => (ContinuousLinearMap.apply β β (1 : β)) (fderiv β f x)) = deriv f := by funext x; rw [ContinuousLinearMap.apply_apply]; rfl have hser : (ContinuousLinearMap.apply β β (1 : β)).compFormalMultilinearSeries ((ofScalars β a).derivSeries) = ofScalars β (fun n => ((n : β) + 1) * a (n + 1)) := by apply scalar_fms_ext intro n rw [coeff_ofScalars] have hL : ((ContinuousLinearMap.apply β β (1 : β)).compFormalMultilinearSeries (ofScalars β a).derivSeries).coeff n = ((ofScalars β a).derivSeries.coeff n) 1 := by rw [FormalMultilinearSeries.coeff, compFormalMultilinearSeries_apply', ContinuousLinearMap.apply_apply, FormalMultilinearSeries.coeff] rw [hL, derivSeries_coeff_one, coeff_ofScalars] ring rw [β hfun, β hser] exact hcomp /-- The Airy power series over β as a `FormalMultilinearSeries`. -/noncomputable def airySeries (c0 c1 : β) : FormalMultilinearSeries β β β := ofScalars β (coeffR c0 c1) /-- The real Airy solution `F : β β β` with `F(0)=c0`, `F'(0)=c1`. -/noncomputable def airyFun (c0 c1 : β) : β β β := (airySeries c0 c1).sum /-- **Radius of convergence = β.** The Airy series is entire. -/theorem airySeries_radius (c0 c1 : β) : (airySeries c0 c1).radius = β€ := by rw [radius_eq_top_iff_summable_norm] intro r simpa [airySeries] using summable_coeffR_norm c0 c1 r theorem airyFun_hasFPowerSeries (c0 c1 : β) : HasFPowerSeriesOnBall (airyFun c0 c1) (airySeries c0 c1) 0 β€ := by have h := (airySeries c0 c1).hasFPowerSeriesOnBall (by rw [airySeries_radius]; exact ENNReal.zero_lt_top) rwa [airySeries_radius] at h /-- **`F` is a real entire function** (analytic on all of β). -/theorem airyFun_entire (c0 c1 : β) : AnalyticOnNhd β (airyFun c0 c1) Set.univ := by have h := (airyFun_hasFPowerSeries c0 c1).analyticOnNhd simpa using h /-- Coefficients of `F''`: `(n+1)(n+2)Β·a(n+2)` (= apply `deriv_ofScalarsSum` twice). -/noncomputable def coeffR2 (c0 c1 : β) (n : β) : β := ((n : β) + 1) * ((n : β) + 2) * coeffR c0 c1 (n + 2) theorem coeffR2_zero (c0 c1 : β) : coeffR2 c0 c1 0 = 0 := by simp [coeffR2, coeffR] /-- The key shift: `F''` coefficient at `n+1` equals `F` coefficient at `n` β this IS the recurrence`(n+2)(n+3)a(n+3)=a(n)`, i.e. the Airy ODE `y''=xy` read off coefficient-by-coefficient. -/theorem coeffR2_succ (c0 c1 : β) (n : β) : coeffR2 c0 c1 (n + 1) = coeffR c0 c1 n := by have h := coeffR_mul_succ3 c0 c1 n simp only [coeffR2]; push_cast; linear_combination h /-- **The Airy ODE `y'' = xΒ·y`, as a real functional identity**. Every entire solution `F`of the recurrence satisfies `deriv (deriv F) x = x Β· F x` at every real `x`. Proof:term-by-term differentiation gives `F''` as the power series `β (n+1)(n+2)a(n+2) xβΏ`; the recurrence`coeffR2_succ` reindexes it to `β aβ xβΏβΊΒΉ = xΒ·F`. -/theorem airyFun_ode (c0 c1 : β) (x : β) : deriv (deriv (airyFun c0 c1)) x = x * airyFun c0 c1 x := by have hF := airyFun_hasFPowerSeries c0 c1 have hF1 := deriv_ofScalarsSum hF have hF2 : HasFPowerSeriesOnBall (deriv (deriv (airyFun c0 c1))) (ofScalars β (coeffR2 c0 c1)) 0 β€ := by convert deriv_ofScalarsSum hF1 using 3 with n simp only [coeffR2]; push_cast; ring have hx : x β Metric.eball (0 : β) β€ := (edist_ne_top x 0).lt_top have hsumF := hF.hasSum hx have hsum2 := hF2.hasSum hx rw [zero_add] at hsumF hsum2 simp only [airySeries, ofScalars_apply_eq, smul_eq_mul] at hsumF hsum2 -- xΒ·F as the shifted sum have hyF : HasSum (fun n => coeffR c0 c1 n * x ^ (n + 1)) (x * airyFun c0 c1 x) := by have h := hsumF.mul_left x convert h using 2 with n ring -- F'' sum = xΒ·F (drop the zero head term, reindex by succ) have hshift : HasSum (fun n => coeffR2 c0 c1 n * x ^ n) (x * airyFun c0 c1 x) := by refine (Nat.succ_injective.hasSum_iff ?_).mp ?_ Β· intro m hm rcases m with _ | k Β· simp [coeffR2_zero] Β· exact absurd β¨k, rflβ© hm Β· convert hyF using 2 with n simp only [Function.comp_apply, Nat.succ_eq_add_one, coeffR2_succ] exact hsum2.unique hshift /- ββ Oscillation (Sturm comparison with `sin`, built from Rolle/MVT + IVT) βββββββββββββββββββ -/ /-- Sturm comparison core: a positive solution of y''=xy on an interval of length Ο/βc lying in(ββ,βc] is impossible. Wronskian `W=f'zβfz'` vs `z=sin(βc(xβa))`: `W'=(x+c)Β·fΒ·z β€ 0` but theendpoints force `W(a)<0<W(a+Ο/βc)`. -/theorem sturm_pos_false (f f' : β β β) (a c : β) (hc : 0 < c) (hf : β x, HasDerivAt f (f' x) x) (hf' : β x, HasDerivAt f' (x * f x) x) (hx : a + Ο / Real.sqrt c β€ -c) (hpos : β x β Icc a (a + Ο / Real.sqrt c), 0 < f x) : False := by set s := Real.sqrt c with hsdef have hs_pos : 0 < s := Real.sqrt_pos.mpr hc have hss : s * s = c := Real.mul_self_sqrt hc.le set d := a + Ο / s with hddef have hpis : 0 β€ Ο / s := by positivity have had : a β€ d := by rw [hddef]; linarith have hda : d - a = Ο / s := by rw [hddef]; ring have haff : β x, HasDerivAt (fun y => s * (y - a)) s x := by intro x; simpa using ((hasDerivAt_id x).sub_const a).const_mul s set z : β β β := fun x => Real.sin (s * (x - a)) with hzdef set z' : β β β := fun x => s * Real.cos (s * (x - a)) with hz'def have hz_d : β x, HasDerivAt z (z' x) x := by intro x have h : HasDerivAt (fun y => Real.sin (s * (y - a))) (Real.cos (s * (x - a)) * s) x := by simpa [Function.comp_def] using (Real.hasDerivAt_sin (s * (x - a))).comp x (haff x) simpa [hzdef, hz'def, mul_comm] using h have hz'_d : β x, HasDerivAt z' (-c * z x) x := by intro x have h : HasDerivAt (fun y => Real.cos (s * (y - a))) (-Real.sin (s * (x - a)) * s) x := by simpa [Function.comp_def] using (Real.hasDerivAt_cos (s * (x - a))).comp x (haff x) have h2 := h.const_mul s convert h2 using 1 simp only [hzdef]; rw [β hss]; ring set W : β β β := fun x => f' x * z x - f x * z' x with hWdef have hW_d : β x, HasDerivAt W ((x + c) * f x * z x) x := by intro x have h := ((hf' x).mul (hz_d x)).sub ((hf x).mul (hz'_d x)) convert h using 1 ring have hWderiv : β x, deriv W x = (x + c) * f x * z x := fun x => (hW_d x).deriv have hcont : ContinuousOn W (Icc a d) := fun x _ => (hW_d x).continuousAt.continuousWithinAt have hdiff : DifferentiableOn β W (interior (Icc a d)) := fun x _ => (hW_d x).differentiableAt.differentiableWithinAt have hnonpos : β x β interior (Icc a d), deriv W x β€ 0 := by intro x hx_int rw [interior_Icc] at hx_int obtain β¨hxa, hxdβ© := hx_int rw [hWderiv] have hxc : x + c β€ 0 := by have : x β€ -c := le_trans hxd.le hx; linarith have hfx : 0 < f x := hpos x β¨hxa.le, hxd.leβ© have hzx : 0 β€ z x := by simp only [hzdef] apply Real.sin_nonneg_of_nonneg_of_le_pi Β· have : 0 β€ x - a := by linarith positivity Β· have hle : x - a β€ Ο / s := by rw [β hda]; linarith calc s * (x - a) β€ s * (Ο / s) := by apply mul_le_mul_of_nonneg_left hle hs_pos.le _ = Ο := by field_simp rw [mul_assoc] nlinarith [mul_nonneg (neg_nonneg.2 hxc) (mul_nonneg hfx.le hzx)] have hanti : AntitoneOn W (Icc a d) := antitoneOn_of_deriv_nonpos (convex_Icc a d) hcont hdiff hnonpos have hWda : W d β€ W a := hanti (left_mem_Icc.mpr had) (right_mem_Icc.mpr had) had have hza : z a = 0 := by simp [hzdef] have hz'a : z' a = s := by simp [hz'def] have hWa : W a < 0 := by have hfa := hpos a β¨le_refl a, hadβ© rw [hWdef]; simp only [hza, hz'a, mul_zero, zero_sub, neg_lt_zero] exact mul_pos hfa hs_pos have hzd : z d = 0 := by simp only [hzdef]; rw [show s * (d - a) = Ο by rw [hda]; field_simp]; exact Real.sin_pi have hz'd : z' d = -s := by simp only [hz'def]; rw [show s * (d - a) = Ο by rw [hda]; field_simp, Real.cos_pi]; ring have hWd : 0 < W d := by have hfd := hpos d β¨had, le_refl dβ© rw [hWdef]; simp only [hzd, hz'd, mul_zero, zero_sub, mul_neg, neg_neg] exact mul_pos hfd hs_pos linarith /-- A continuous function with no zero on `[a,d]` has constant sign there (IVT). -/theorem const_sign_of_no_zero {g : β β β} {a d : β} (hg : ContinuousOn g (Icc a d)) (hnz : β x β Icc a d, g x β 0) (hax : a β€ d) : (β x β Icc a d, 0 < g x) β¨ (β x β Icc a d, g x < 0) := by have key : β u v, u β Icc a d β v β Icc a d β g u < 0 β 0 < g v β False := by intro u v hu hv hgu hgv rcases le_total u v with huv | hvu Β· have hsub : Icc u v β Icc a d := Icc_subset_Icc hu.1 hv.2 obtain β¨y, hy, hgyβ© := intermediate_value_Icc huv (hg.mono hsub) β¨hgu.le, hgv.leβ© exact hnz y (hsub hy) hgy Β· have hsub : Icc v u β Icc a d := Icc_subset_Icc hv.1 hu.2 obtain β¨y, hy, hgyβ© := intermediate_value_Icc' hvu (hg.mono hsub) β¨hgu.le, hgv.leβ© exact hnz y (hsub hy) hgy rcases lt_or_gt_of_ne (hnz a β¨le_refl a, haxβ©) with hga | hga Β· right; intro x hx rcases lt_or_gt_of_ne (hnz x hx) with h | h Β· exact h Β· exact (key a x β¨le_refl a, haxβ© hx hga h).elim Β· left; intro x hx rcases lt_or_gt_of_ne (hnz x hx) with h | h Β· exact (key x a hx β¨le_refl a, haxβ© h hga).elim Β· exact h /-- **Sturm zero existence**: any solution of y''=xy has a zero in `[a, a+Ο/βc]` when that intervallies in `(ββ,βc]` (apply the positive-case contradiction to `f` or `βf`). -/theorem sturm_has_zero (f f' : β β β) (a c : β) (hc : 0 < c) (hf : β x, HasDerivAt f (f' x) x) (hf' : β x, HasDerivAt f' (x * f x) x) (hx : a + Ο / Real.sqrt c β€ -c) : β x β Icc a (a + Ο / Real.sqrt c), f x = 0 := by by_contra hcon push Not at hcon have hsc : 0 < Real.sqrt c := Real.sqrt_pos.mpr hc have hpis : (0:β) β€ Ο / Real.sqrt c := by positivity have had : a β€ a + Ο / Real.sqrt c := by linarith have hcont : ContinuousOn f (Icc a (a + Ο / Real.sqrt c)) := fun x _ => (hf x).continuousAt.continuousWithinAt rcases const_sign_of_no_zero hcont hcon had with hpos | hneg Β· exact sturm_pos_false f f' a c hc hf hf' hx hpos Β· exact sturm_pos_false (fun x => -f x) (fun x => -f' x) a c hc (fun x => (hf x).neg) (fun x => by have h := (hf' x).neg; convert h using 1; ring) hx (fun x hx2 => by have := hneg x hx2; linarith) /-- **Oscillation (generic)**: any solution of y''=xy has zeros unbounded below β for every `M`there is a zero `< M`. Intervals of length Ο/βc pushed into (ββ,βc] as cββ. -/theorem sturm_unbounded_zeros (f f' : β β β) (hf : β x, HasDerivAt f (f' x) x) (hf' : β x, HasDerivAt f' (x * f x) x) (M : β) : β x, x < M β§ f x = 0 := by set c := |M| + 1 with hcdef have hc : 0 < c := by rw [hcdef]; positivity have hsc : 0 < Real.sqrt c := Real.sqrt_pos.mpr hc set a := -c - Ο / Real.sqrt c with hadef have hax : a + Ο / Real.sqrt c β€ -c := by rw [hadef]; linarith obtain β¨x, hxmem, hxzeroβ© := sturm_has_zero f f' a c hc hf hf' hax refine β¨x, ?_, hxzeroβ© have hxle : x β€ a + Ο / Real.sqrt c := hxmem.2 have heq : a + Ο / Real.sqrt c = -c := by rw [hadef]; ring rw [heq] at hxle have hcM : -c < M := by rw [hcdef]; have := neg_abs_le M; linarith linarith /-- **The Airy function oscillates**: `airyFun c0 c1` has zeros unbounded below (infinitely manyzeros heading to ββ). For the quantum bouncer these are the gravitational energy levels. -/theorem airyFun_unbounded_zeros (c0 c1 : β) (M : β) : β x, x < M β§ airyFun c0 c1 x = 0 := by refine sturm_unbounded_zeros (airyFun c0 c1) (deriv (airyFun c0 c1)) (fun x => ?_) (fun x => ?_) M Β· exact ((airyFun_entire c0 c1) x (mem_univ x)).differentiableAt.hasDerivAt Β· have hd := ((airyFun_entire c0 c1).deriv x (mem_univ x)).differentiableAt.hasDerivAt rwa [airyFun_ode c0 c1 x] at hd /- ββ Behaviour on (0,β) β dominant (non-decaying) solutions ββββββββββββββββββββββββββββββββ -/ /-- If `f'' = g β₯ 0` on `[a,b]` and `f'(a) β₯ 0`, then `f` is non-decreasing on `[a,b]`(`f'` non-decreasing βΉ `f' β₯ f'(a) β₯ 0` βΉ `f` non-decreasing). -/theorem nondecr_of_deriv2_nonneg (f f' g : β β β) (a b : β) (hab : a β€ b) (hf : β x, HasDerivAt f (f' x) x) (hf' : β x, HasDerivAt f' (g x) x) (hg : β x β Icc a b, 0 β€ g x) (hfa' : 0 β€ f' a) : MonotoneOn f (Icc a b) := by have hf'mono : MonotoneOn f' (Icc a b) := monotoneOn_of_deriv_nonneg (convex_Icc a b) (fun x _ => (hf' x).continuousAt.continuousWithinAt) (fun x _ => (hf' x).differentiableAt.differentiableWithinAt) (fun x hx => by rw [(hf' x).deriv]; exact hg x (interior_subset hx)) apply monotoneOn_of_deriv_nonneg (convex_Icc a b) (fun x _ => (hf x).continuousAt.continuousWithinAt) (fun x _ => (hf x).differentiableAt.differentiableWithinAt) intro x hx rw [(hf x).deriv] have hxmem : x β Icc a b := interior_subset hx have hmono := hf'mono (left_mem_Icc.mpr hab) hxmem hxmem.1 linarith /-- **On (0,β), a solution of y''=xy positive with non-negative slope stays positive.** It is convexwhere positive, so once non-decreasing it cannot return to 0 (first-zero argument). -/theorem ode_pos_Ici (f f' : β β β) {x0 : β} (hx0 : 0 β€ x0) (hf : β x, HasDerivAt f (f' x) x) (hf' : β x, HasDerivAt f' (x * f x) x) (hfx0 : 0 < f x0) (hfx0' : 0 β€ f' x0) : β x β Ici x0, 0 < f x := by have hdiff : Differentiable β f := fun x => (hf x).differentiableAt have hcontf : Continuous f := hdiff.continuous intro X hX by_contra hfX push Not at hfX have hx0X : x0 β€ X := hX set S := Icc x0 X β© {x | f x = 0} with hSdef have hScompact : IsCompact S := isCompact_Icc.inter_right (isClosed_eq hcontf continuous_const) have hSne : S.Nonempty := by obtain β¨y, hy, hfyβ© := intermediate_value_Icc' hx0X hcontf.continuousOn β¨hfX, hfx0.leβ© exact β¨y, hy, hfyβ© obtain β¨c, β¨hcIcc, hfcβ©, hclbβ© := hScompact.exists_isLeast hSne have hx0c : x0 < c := lt_of_le_of_ne hcIcc.1 (by rintro rfl; rw [hfc] at hfx0; exact lt_irrefl 0 hfx0) have hfpos : β y β Icc x0 c, 0 β€ f y := by intro y hy rcases eq_or_lt_of_le hy.2 with hyc | hyc Β· rw [hyc]; exact le_of_eq hfc.symm Β· have hynz : β z β Icc x0 y, f z β 0 := by intro z hz hfz have hzS : z β S := β¨β¨hz.1, le_trans hz.2 (le_trans hyc.le hcIcc.2)β©, hfzβ© have := hclb hzS linarith [hz.2, hyc] rcases const_sign_of_no_zero hcontf.continuousOn hynz hy.1 with hp | hn Β· exact (hp y (right_mem_Icc.mpr hy.1)).le Β· exact absurd (hn x0 (left_mem_Icc.mpr hy.1)) (by linarith [hfx0]) have hmono : MonotoneOn f (Icc x0 c) := nondecr_of_deriv2_nonneg f f' (fun x => x * f x) x0 c hcIcc.1 hf hf' (fun x hx => mul_nonneg (by linarith [hx.1] : (0:β) β€ x) (hfpos x hx)) hfx0' have hle := hmono (left_mem_Icc.mpr hx0c.le) (right_mem_Icc.mpr hx0c.le) hx0c.le rw [hfc] at hle linarith /-- Such a solution is non-decreasing on `[x0,β)`. -/theorem ode_nondecreasing_Ici (f f' : β β β) {x0 : β} (hx0 : 0 < x0) (hf : β x, HasDerivAt f (f' x) x) (hf' : β x, HasDerivAt f' (x * f x) x) (hfx0 : 0 < f x0) (hfx0' : 0 β€ f' x0) : MonotoneOn f (Ici x0) := by have hpos := ode_pos_Ici f f' hx0.le hf hf' hfx0 hfx0' intro u hu v hv huv have hmono : MonotoneOn f (Icc x0 v) := nondecr_of_deriv2_nonneg f f' (fun x => x * f x) x0 v hv hf hf' (fun x hx => mul_nonneg (by linarith [hx.1] : (0:β) β€ x) (hpos x hx.1).le) hfx0' exact hmono β¨hu, huvβ© β¨hv, le_refl vβ© huv /-- **A dominant solution does not decay**: positive with non-negative slope at some `x0>0` βΉ itstays `β₯ f x0 > 0`, so it cannot tend to `0` at `+β`. -/theorem ode_not_tendsto_zero (f f' : β β β) {x0 : β} (hx0 : 0 < x0) (hf : β x, HasDerivAt f (f' x) x) (hf' : β x, HasDerivAt f' (x * f x) x) (hfx0 : 0 < f x0) (hfx0' : 0 β€ f' x0) : Β¬ Tendsto f atTop (π 0) := by intro hT have hmono := ode_nondecreasing_Ici f f' hx0 hf hf' hfx0 hfx0' have h1 : βαΆ x in atTop, f x < f x0 := hT.eventually (Iio_mem_nhds hfx0) have h2 : βαΆ x in atTop, f x0 β€ f x := (eventually_ge_atTop x0).mono (fun x hx => hmono (mem_Ici.mpr le_rfl) (mem_Ici.mpr hx) hx) obtain β¨x, hx1, hx2β© := (h1.and h2).exists linarith /-- `airyFun` and its derivative as `HasDerivAt` facts (from entire + the ODE). -/theorem airyFun_hasDerivAt (c0 c1 : β) (x : β) : HasDerivAt (airyFun c0 c1) (deriv (airyFun c0 c1) x) x := ((airyFun_entire c0 c1) x (mem_univ x)).differentiableAt.hasDerivAt theorem airyFun_deriv_hasDerivAt (c0 c1 : β) (x : β) : HasDerivAt (deriv (airyFun c0 c1)) (x * airyFun c0 c1 x) x := by have hd := ((airyFun_entire c0 c1).deriv x (mem_univ x)).differentiableAt.hasDerivAt rwa [airyFun_ode c0 c1 x] at hd /-- **Dominant Airy solutions.** If `F = airyFun c0 c1` is positive with non-negative slope atsome `x0>0`, then on `[x0,β)` it is positive and non-decreasing, and it does NOT decay to 0 at `+β`.(The recessive solution, which does decay, is constructed below by reduction of order:`exists_recessive_solution`, `exists_entire_recessive`.) -/theorem airyFun_not_decaying (c0 c1 : β) {x0 : β} (hx0 : 0 < x0) (hpos : 0 < airyFun c0 c1 x0) (hslope : 0 β€ deriv (airyFun c0 c1) x0) : (β x β Ici x0, 0 < airyFun c0 c1 x) β§ MonotoneOn (airyFun c0 c1) (Ici x0) β§ Β¬ Tendsto (airyFun c0 c1) atTop (π 0) := β¨ode_pos_Ici _ _ hx0.le (airyFun_hasDerivAt c0 c1) (airyFun_deriv_hasDerivAt c0 c1) hpos hslope, ode_nondecreasing_Ici _ _ hx0 (airyFun_hasDerivAt c0 c1) (airyFun_deriv_hasDerivAt c0 c1) hpos hslope, ode_not_tendsto_zero _ _ hx0 (airyFun_hasDerivAt c0 c1) (airyFun_deriv_hasDerivAt c0 c1) hpos hslopeβ© /- ββ The quantum bouncer ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ H = β(βΒ²/2m)βΒ² + mgx on [0,β), Ο(0)=0. Rescaling ΞΎ = Ξ±(x β E/(mg)) with Ξ±=(2mΒ²g/βΒ²)^{1/3} turns HΟ=EΟ into the Airy equation; the eigenfunction is `Ο(x) = F(Ξ±x β Ξ²)` with Ξ² β E, and the Dirichlet wall Ο(0)=0 becomes `Ai(βΞ²)=0`. So the gravitational levels are (β) the zeros of Ai. -/ /-- **Bridge**: `Ο(x) = F(Ξ±x β Ξ²)` (F any Airy solution) solves the rescaled Airy/bouncer equation`Ο'' = Ξ±Β²(Ξ±x β Ξ²)Β·Ο`. Pure chain rule on `airyFun_ode`. -/theorem bouncer_ode (c0 c1 Ξ± Ξ² : β) (x : β) : deriv (deriv (fun y => airyFun c0 c1 (Ξ± * y - Ξ²))) x = Ξ± ^ 2 * (Ξ± * x - Ξ²) * airyFun c0 c1 (Ξ± * x - Ξ²) := by have hg : β y, HasDerivAt (fun y => Ξ± * y - Ξ²) Ξ± y := fun y => by simpa using ((hasDerivAt_id y).const_mul Ξ±).sub_const Ξ² have hΟ' : β y, HasDerivAt (fun y => airyFun c0 c1 (Ξ± * y - Ξ²)) (deriv (airyFun c0 c1) (Ξ± * y - Ξ²) * Ξ±) y := fun y => by simpa [Function.comp_def] using (airyFun_hasDerivAt c0 c1 (Ξ± * y - Ξ²)).comp y (hg y) have hderivΟ : deriv (fun y => airyFun c0 c1 (Ξ± * y - Ξ²)) = fun y => deriv (airyFun c0 c1) (Ξ± * y - Ξ²) * Ξ± := funext fun y => (hΟ' y).deriv rw [hderivΟ] have hΟ'' : HasDerivAt (fun y => deriv (airyFun c0 c1) (Ξ± * y - Ξ²) * Ξ±) ((Ξ± * x - Ξ²) * airyFun c0 c1 (Ξ± * x - Ξ²) * Ξ± * Ξ±) x := by have h1 : HasDerivAt (fun y => deriv (airyFun c0 c1) (Ξ± * y - Ξ²)) ((Ξ± * x - Ξ²) * airyFun c0 c1 (Ξ± * x - Ξ²) * Ξ±) x := by simpa [Function.comp_def] using (airyFun_deriv_hasDerivAt c0 c1 (Ξ± * x - Ξ²)).comp x (hg x) simpa using h1.mul_const Ξ± rw [hΟ''.deriv]; ring /-- **Boundary wall**: the Dirichlet condition `Ο(0)=0` is exactly `Ai(βΞ²)=0`. -/theorem bouncer_bc (c0 c1 Ξ± Ξ² : β) : (fun y => airyFun c0 c1 (Ξ± * y - Ξ²)) 0 = airyFun c0 c1 (-Ξ²) := by simp /-- **Infinitely many bound-state energies.** For every bound `B` there is a (rescaled) energy`Ξ² > B` with `Ai(βΞ²)=0`, i.e. the quantum bouncer has infinitely many gravitational levels, given bythe (negatives of the) Airy zeros. This is a consequence of the oscillation theorem. -/theorem bouncer_levels_infinite (c0 c1 : β) (B : β) : β Ξ², B < Ξ² β§ airyFun c0 c1 (-Ξ²) = 0 := by obtain β¨z, hz, hfzβ© := airyFun_unbounded_zeros c0 c1 (-B) exact β¨-z, by linarith, by simpa using hfzβ© /- ββ Existence of the decaying (recessive) Airy solution ββββββββββββββββββββββββ Reduction of order from the dominant solution f = airyFun 1 0 (which does not decay): Ai_rec(x) = f(x)Β·β«_x^β dt/f(t)Β² is a positive solution decaying to 0. Validated numerically (Ai_rec/Ai β‘ const, Ai_rec β€ 1/f', Ai_rec'' = xΒ·Ai_rec). -/ /-- `airyFun c0 c1` at 0 is `c0` (the constant term of the series). -/theorem airyFun_zero (c0 c1 : β) : airyFun c0 c1 0 = c0 := by have h : airyFun c0 c1 0 = ofScalarsSum (coeffR c0 c1) 0 := rfl rw [h, ofScalarsSum_zero]; simp [coeffR] /-- `(airyFun c0 c1)'(0) = c1` (the linear coefficient). -/theorem deriv_airyFun_zero (c0 c1 : β) : deriv (airyFun c0 c1) 0 = c1 := by have h : HasDerivAt (airyFun c0 c1) ((airySeries c0 c1) 1 (fun _ => 1)) 0 := (airyFun_hasFPowerSeries c0 c1).hasFPowerSeriesAt.hasDerivAt rw [h.deriv] simp [airySeries, coeffR] /-- The dominant solution `f = airyFun 1 0` is strictly positive on `[0,β)`(it has `f(0)=1>0`, `f'(0)=0`, and `f''=xfβ₯0`, so the first-zero argument applies from `x0=0`). -/theorem airyFun10_pos : β x β Ici (0:β), 0 < airyFun 1 0 x := ode_pos_Ici (airyFun 1 0) (deriv (airyFun 1 0)) (le_refl 0) (airyFun_hasDerivAt 1 0) (airyFun_deriv_hasDerivAt 1 0) (by rw [airyFun_zero]; exact one_pos) (le_of_eq (deriv_airyFun_zero 1 0).symm) /- ββ Recessive solution, prerequisites: f = airyFun 1 0 is dominant on [0,β) ββββββββββββββββββββββββ -/ theorem airyFun10_diff : Differentiable β (airyFun 1 0) := fun x => (airyFun_hasDerivAt 1 0 x).differentiableAt theorem airyFun10_deriv_diff : Differentiable β (deriv (airyFun 1 0)) := fun x => (airyFun_deriv_hasDerivAt 1 0 x).differentiableAt /-- `f'` is non-negative on `[0,β)` (it is non-decreasing, with `f'(0)=0`). -/theorem airyFun10_deriv_nonneg : β x β Ici (0:β), 0 β€ deriv (airyFun 1 0) x := by have hmono : MonotoneOn (deriv (airyFun 1 0)) (Ici 0) := by apply monotoneOn_of_deriv_nonneg (convex_Ici 0) airyFun10_deriv_diff.continuous.continuousOn airyFun10_deriv_diff.differentiableOn intro x hx rw [interior_Ici] at hx rw [(airyFun_deriv_hasDerivAt 1 0 x).deriv] exact mul_nonneg hx.le (airyFun10_pos x (mem_Ici.mpr hx.le)).le intro x hx have h := hmono self_mem_Ici hx (mem_Ici.mp hx) rwa [deriv_airyFun_zero] at h /-- `f β₯ 1` on `[0,β)` (non-decreasing, with `f(0)=1`). -/theorem airyFun10_ge_one : β x β Ici (0:β), 1 β€ airyFun 1 0 x := by have hmono : MonotoneOn (airyFun 1 0) (Ici 0) := by apply monotoneOn_of_deriv_nonneg (convex_Ici 0) airyFun10_diff.continuous.continuousOn airyFun10_diff.differentiableOn intro x hx rw [interior_Ici] at hx exact airyFun10_deriv_nonneg x (mem_Ici.mpr hx.le) intro x hx have h := hmono self_mem_Ici hx (mem_Ici.mp hx) rwa [airyFun_zero] at h /-- `f` is convex on `[0,β)` (since `f'' = xΒ·f β₯ 0`). -/theorem airyFun10_convex : ConvexOn β (Ici (0:β)) (airyFun 1 0) := by apply convexOn_of_deriv2_nonneg (convex_Ici 0) airyFun10_diff.continuous.continuousOn airyFun10_diff.differentiableOn airyFun10_deriv_diff.differentiableOn intro x hx rw [interior_Ici] at hx have he : deriv^[2] (airyFun 1 0) x = x * airyFun 1 0 x := by have : deriv^[2] (airyFun 1 0) = deriv (deriv (airyFun 1 0)) := by funext y; rw [Function.iterate_succ, Function.iterate_one, Function.comp_apply] rw [this, (airyFun_deriv_hasDerivAt 1 0 x).deriv] rw [he]; exact mul_nonneg hx.le (airyFun10_pos x (mem_Ici.mpr hx.le)).le /-- `f'(x) β₯ xΒ²/2` on `[0,β)` (so `f' β β`). From `h=f'βxΒ²/2`, `h(0)=0`, `h'=x(fβ1)β₯0`. -/theorem airyFun10_deriv_ge_sq : β x β Ici (0:β), x ^ 2 / 2 β€ deriv (airyFun 1 0) x := by have hd : β x, HasDerivAt (fun y => deriv (airyFun 1 0) y - y ^ 2 / 2) (x * airyFun 1 0 x - x) x := by intro x have h2 : HasDerivAt (fun y : β => y ^ 2 / 2) x x := by simpa using (hasDerivAt_pow 2 x).div_const 2 simpa using (airyFun_deriv_hasDerivAt 1 0 x).fun_sub h2 have hmono : MonotoneOn (fun y => deriv (airyFun 1 0) y - y ^ 2 / 2) (Ici 0) := by apply monotoneOn_of_deriv_nonneg (convex_Ici 0) (fun x _ => (hd x).continuousAt.continuousWithinAt) (fun x _ => (hd x).differentiableAt.differentiableWithinAt) intro x hx rw [interior_Ici] at hx rw [(hd x).deriv] nlinarith [airyFun10_ge_one x (mem_Ici.mpr (mem_Ioi.mp hx).le), (mem_Ioi.mp hx).le] intro x hx have h := hmono self_mem_Ici hx (mem_Ici.mp hx) simp only [deriv_airyFun_zero] at h linarith [h] /- ββ Recessive solution: integrability of 1/fΒ² on (x,β) ββββββββββββββββββββββββββββββββββββββββββββ -/ /-- `(zβ»ΒΉ)Β²` as a real power, for `z>0`. -/theorem inv_sq_eq_rpow {z : β} (_hz : 0 < z) : (zβ»ΒΉ) ^ 2 = z ^ (-2:β) := by rw [show (-2:β) = ((-2:β€):β) by norm_num, Real.rpow_intCast, zpow_neg, zpow_two, mul_inv]; ring /-- The affine tangent bound `(c+m(tβx))β»Β²` is integrable on `(x,β)` for `c,m>0`. -/theorem integrableOn_affine_inv_sq (x c m : β) (hc : 0 < c) (hm : 0 < m) : IntegrableOn (fun t => ((c + m * (t - x))β»ΒΉ) ^ 2) (Ioi x) := by have hcm : 0 < c / m := div_pos hc hm have hrpow : IntegrableOn (fun t : β => (t + (c / m - x)) ^ (-2:β)) (Ioi x) := integrableOn_add_rpow_Ioi_of_lt (by norm_num) (by linarith) have hg : IntegrableOn (fun t : β => m ^ (-2:β) * (t + (c / m - x)) ^ (-2:β)) (Ioi x) := hrpow.const_mul _ refine hg.congr_fun ?_ measurableSet_Ioi intro t ht have hxt : x < t := ht have hb : 0 < t + (c / m - x) := by have := hcm; linarith show m ^ (-2:β) * (t + (c / m - x)) ^ (-2:β) = ((c + m * (t - x))β»ΒΉ) ^ 2 rw [show c + m * (t - x) = m * (t + (c / m - x)) by field_simp; ring, mul_inv, mul_pow, inv_sq_eq_rpow hm, inv_sq_eq_rpow hb] /-- **`1/fΒ²` is integrable on `(x,β)` for `x>0`** (f = airyFun 1 0): dominated by the convexitytangent bound `f(t) β₯ f(x)+f'(x)(tβx)`, which is integrable. -/theorem integrableOn_airyFun10_inv_sq {x : β} (hx : 0 < x) : IntegrableOn (fun t => (airyFun 1 0 t)β»ΒΉ ^ 2) (Ioi x) := by have hfx : 0 < airyFun 1 0 x := airyFun10_pos x (mem_Ici.mpr hx.le) have hfx' : 0 < deriv (airyFun 1 0) x := lt_of_lt_of_le (by positivity) (airyFun10_deriv_ge_sq x (mem_Ici.mpr hx.le)) have hdom := integrableOn_affine_inv_sq x (airyFun 1 0 x) (deriv (airyFun 1 0) x) hfx hfx' have hcont : ContinuousOn (fun t => (airyFun 1 0 t)β»ΒΉ ^ 2) (Ioi x) := ((airyFun10_diff.continuous.continuousOn.invβ (fun t ht => (airyFun10_pos t (mem_Ici.mpr (le_of_lt (lt_trans hx ht)))).ne')).pow 2) refine hdom.mono' (hcont.aestronglyMeasurable measurableSet_Ioi) ?_ filter_upwards [ae_restrict_mem measurableSet_Ioi] with t ht have hxt : x < t := ht have htx : 0 < t - x := by linarith have hft : 0 < airyFun 1 0 t := airyFun10_pos t (mem_Ici.mpr (le_of_lt (lt_trans hx ht))) have hAt : 0 < airyFun 1 0 x + deriv (airyFun 1 0) x * (t - x) := by have := mul_pos hfx' htx; linarith have hAle : airyFun 1 0 x + deriv (airyFun 1 0) x * (t - x) β€ airyFun 1 0 t := by have hsl := airyFun10_convex.le_slope_of_hasDerivAt (mem_Ici.mpr hx.le) (mem_Ici.mpr (le_of_lt (lt_trans hx ht))) hxt (airyFun_hasDerivAt 1 0 x) rw [slope_def_field, le_div_iffβ htx] at hsl linarith rw [Real.norm_eq_abs, abs_of_nonneg (by positivity)] have hinv : (airyFun 1 0 t)β»ΒΉ β€ (airyFun 1 0 x + deriv (airyFun 1 0) x * (t - x))β»ΒΉ := by rw [β one_div, β one_div]; exact one_div_le_one_div_of_le hAt hAle exact pow_le_pow_leftβ (by positivity) hinv 2 /- ββ Recessive solution: the construction Ai_rec = fΒ·β«_x^β 1/fΒ² ββββββββββββββββββββββββββββββββββββ -/ /-- FTC on a half-line (reference `b`): `d/dx β«_x^β h = -h(a)` for `a > b`, `h` continuous on`[b,β)` and integrable on `(b,β)`. -/theorem hasDerivAt_integral_Ioi {h : β β β} {b a : β} (hba : b < a) (hcont : ContinuousOn h (Ici b)) (hint : IntegrableOn h (Ioi b)) : HasDerivAt (fun x => β« t in Ioi x, h t) (-(h a)) a := by have key : β x β Ioi b, (β« t in Ioi x, h t) = (β« t in Ioi b, h t) - β« t in b..x, h t := by intro x hx have hbx : b β€ x := le_of_lt hx have hu : Ioc b x βͺ Ioi x = Ioi b := Ioc_union_Ioi_eq_Ioi hbx have hIoc : IntegrableOn h (Ioc b x) := hint.mono_set (hu βΈ subset_union_left) have hIoix : IntegrableOn h (Ioi x) := hint.mono_set (hu βΈ subset_union_right) have hsplit := setIntegral_union (Ioc_disjoint_Ioi le_rfl) measurableSet_Ioi hIoc hIoix rw [hu] at hsplit rw [intervalIntegral.integral_of_le hbx]; linarith have hInt : IntervalIntegrable h volume b a := (hcont.mono (by rw [Set.uIcc_of_le hba.le]; exact Set.Icc_subset_Ici_self)).intervalIntegrable have hMeas : StronglyMeasurableAtFilter h (π a) volume := β¨Ici b, Ici_mem_nhds hba, hcont.aestronglyMeasurable measurableSet_Iciβ© have hftc : HasDerivAt (fun x => β« t in b..x, h t) (h a) a := intervalIntegral.integral_hasDerivAt_right hInt hMeas (hcont.continuousAt (Ici_mem_nhds hba)) have hcomb : HasDerivAt (fun x => (β« t in Ioi b, h t) - β« t in b..x, h t) (-(h a)) a := by simpa using (hasDerivAt_const a (β« t in Ioi b, h t)).fun_sub hftc exact hcomb.congr_of_eventuallyEq (by filter_upwards [Ioi_mem_nhds hba] with x hx using key x hx) /-- The reduction-of-order integral `β«_x^β dt/f(t)Β²`. -/noncomputable def airyRecInt (x : β) : β := β« t in Ioi x, (airyFun 1 0 t)β»ΒΉ ^ 2 /-- The recessive Airy solution on `(0,β)`: `Ai_rec(x) = f(x)Β·β«_x^β dt/f(t)Β²`. -/noncomputable def airyRec (x : β) : β := airyFun 1 0 x * airyRecInt x /-- `1/fΒ²` is continuous on `[b,β)` for `b>0`. -/theorem continuousOn_airyFun10_inv_sq {b : β} (hb : 0 < b) : ContinuousOn (fun t => (airyFun 1 0 t)β»ΒΉ ^ 2) (Ici b) := (airyFun10_diff.continuous.continuousOn.invβ (fun t ht => (airyFun10_pos t (mem_Ici.mpr (le_trans hb.le ht))).ne')).pow 2 /-- `d/dx airyRecInt = -1/f(x)Β²` for `x>0`. -/theorem airyRecInt_hasDerivAt {a : β} (ha : 0 < a) : HasDerivAt airyRecInt (-(airyFun 1 0 a)β»ΒΉ ^ 2) a := hasDerivAt_integral_Ioi (by linarith : a / 2 < a) (continuousOn_airyFun10_inv_sq (by linarith : (0:β) < a / 2)) (integrableOn_airyFun10_inv_sq (by linarith : (0:β) < a / 2)) /-- First derivative of `Ai_rec`: `Ai_rec' = f'Β·g β 1/f` (product rule; `fΒ·(1/fΒ²) = 1/f`). -/theorem airyRec_hasDerivAt {x : β} (hx : 0 < x) : HasDerivAt airyRec (deriv (airyFun 1 0) x * airyRecInt x - (airyFun 1 0 x)β»ΒΉ) x := by have hfx : airyFun 1 0 x β 0 := (airyFun10_pos x (mem_Ici.mpr hx.le)).ne' have h := (airyFun_hasDerivAt 1 0 x).mul (airyRecInt_hasDerivAt hx) convert h using 1 Β· ext y; simp only [airyRec, Pi.mul_apply] Β· field_simp; ring /-- **Reduction of order**: `Ai_rec'' = xΒ·Ai_rec` β the `1/fΒ²` terms cancel, leaving `f''Β·g = xfΒ·g`.So `Ai_rec` solves `y''=xy` on `(0,β)`. -/theorem airyRec_deriv_hasDerivAt {x : β} (hx : 0 < x) : HasDerivAt (fun y => deriv (airyFun 1 0) y * airyRecInt y - (airyFun 1 0 y)β»ΒΉ) (x * airyRec x) x := by have hfx : airyFun 1 0 x β 0 := (airyFun10_pos x (mem_Ici.mpr hx.le)).ne' have h := ((airyFun_deriv_hasDerivAt 1 0 x).mul (airyRecInt_hasDerivAt hx)).sub ((airyFun_hasDerivAt 1 0 x).inv hfx) convert h using 1 simp only [airyRec] field_simp ring /-- The convexity integral bound: `β«_x^β 1/fΒ² β€ 1/(f'(x)Β·f(x))` for `x>0`. The tangent bounddominates by the affine `(c+m(tβx))β»Β²`, whose exact tail integral is `1/(mc)`. -/theorem airyRecInt_le {x : β} (hx : 0 < x) : airyRecInt x β€ (deriv (airyFun 1 0) x * airyFun 1 0 x)β»ΒΉ := by set c := airyFun 1 0 x with hc set m := deriv (airyFun 1 0) x with hm have hcp : 0 < c := airyFun10_pos x (mem_Ici.mpr hx.le) have hmp : 0 < m := lt_of_lt_of_le (by positivity) (airyFun10_deriv_ge_sq x (mem_Ici.mpr hx.le)) -- exact tail integral of the affine bound have hAval : (β« t in Ioi x, ((c + m * (t - x))β»ΒΉ) ^ 2) = (m * c)β»ΒΉ := by have hderiv : β t β Ici x, HasDerivAt (fun s => -mβ»ΒΉ * (c + m * (s - x))β»ΒΉ) (((c + m * (t - x))β»ΒΉ) ^ 2) t := by intro t ht have hAt : (0:β) < c + m * (t - x) := by have : x β€ t := ht; nlinarith have hA : HasDerivAt (fun s : β => c + m * (s - x)) m t := by simpa using (((hasDerivAt_id t).sub_const x).const_mul m).const_add c have hAinv := hA.inv hAt.ne' have hres := hAinv.const_mul (-mβ»ΒΉ) convert hres using 1 field_simp [hmp.ne', hAt.ne'] have hAtop : Tendsto (fun t : β => c + m * (t - x)) atTop atTop := by apply tendsto_atTop_add_const_left atTop c simpa [sub_eq_add_neg] using Filter.Tendsto.const_mul_atTop hmp (tendsto_atTop_add_const_right atTop (-x) tendsto_id) have htend : Tendsto (fun t : β => -mβ»ΒΉ * (c + m * (t - x))β»ΒΉ) atTop (π 0) := by have := ((tendsto_inv_atTop_zero.comp hAtop).const_mul mβ»ΒΉ).neg simpa using this have key := integral_Ioi_of_hasDerivAt_of_tendsto' hderiv (integrableOn_affine_inv_sq x c m hcp hmp) htend rw [key]; simp [mul_comm] -- comparison 1/fΒ² β€ 1/AΒ² and conclude rw [airyRecInt, β hAval] refine setIntegral_mono_on (integrableOn_airyFun10_inv_sq hx) (integrableOn_affine_inv_sq x c m hcp hmp) measurableSet_Ioi (fun t ht => ?_) have hxt : x < t := ht have htx : 0 < t - x := by linarith have hft : 0 < airyFun 1 0 t := airyFun10_pos t (mem_Ici.mpr (le_of_lt (lt_trans hx ht))) have hAt : 0 < c + m * (t - x) := by have := mul_pos hmp htx; linarith have hAle : c + m * (t - x) β€ airyFun 1 0 t := by have hsl := airyFun10_convex.le_slope_of_hasDerivAt (mem_Ici.mpr hx.le) (mem_Ici.mpr (le_of_lt (lt_trans hx ht))) hxt (airyFun_hasDerivAt 1 0 x) rw [slope_def_field, le_div_iffβ htx] at hsl linarith have hinv : (airyFun 1 0 t)β»ΒΉ β€ (c + m * (t - x))β»ΒΉ := by rw [β one_div, β one_div]; exact one_div_le_one_div_of_le hAt hAle exact pow_le_pow_leftβ (by positivity) hinv 2 /-- `Ai_rec(x) β€ 1/f'(x)` for `x>0` (from the integral bound: `fΒ·1/(f'f) = 1/f'`). -/theorem airyRec_le_inv_deriv {x : β} (hx : 0 < x) : airyRec x β€ (deriv (airyFun 1 0) x)β»ΒΉ := by have hfx : 0 < airyFun 1 0 x := airyFun10_pos x (mem_Ici.mpr hx.le) have hmp : 0 < deriv (airyFun 1 0) x := lt_of_lt_of_le (by positivity) (airyFun10_deriv_ge_sq x (mem_Ici.mpr hx.le)) rw [airyRec] calc airyFun 1 0 x * airyRecInt x β€ airyFun 1 0 x * (deriv (airyFun 1 0) x * airyFun 1 0 x)β»ΒΉ := mul_le_mul_of_nonneg_left (airyRecInt_le hx) hfx.le _ = (deriv (airyFun 1 0) x)β»ΒΉ := by field_simp /-- `Ai_rec β₯ 0` on `(0,β)`. -/theorem airyRec_nonneg {x : β} (hx : 0 < x) : 0 β€ airyRec x := by rw [airyRec] refine mul_nonneg (airyFun10_pos x (mem_Ici.mpr hx.le)).le ?_ rw [airyRecInt] exact setIntegral_nonneg measurableSet_Ioi (fun t _ => by positivity) /-- **The recessive solution decays**: `Ai_rec(x) β 0` as `x β +β`(`0 β€ Ai_rec β€ 1/f' β€ 2/xΒ² β 0`). -/theorem airyRec_tendsto_zero : Tendsto airyRec atTop (π 0) := by have hg : Tendsto (fun x : β => 2 / x ^ 2) atTop (π 0) := tendsto_const_nhds.div_atTop (tendsto_pow_atTop (by norm_num)) refine squeeze_zero' ?_ ?_ hg Β· filter_upwards [eventually_gt_atTop (0:β)] with x hx using airyRec_nonneg hx Β· filter_upwards [eventually_gt_atTop (0:β)] with x hx have hsq : (0:β) < x ^ 2 / 2 := by positivity have hbd : (deriv (airyFun 1 0) x)β»ΒΉ β€ 2 / x ^ 2 := by have h1 : (deriv (airyFun 1 0) x)β»ΒΉ β€ (x ^ 2 / 2)β»ΒΉ := by rw [β one_div, β one_div] exact one_div_le_one_div_of_le hsq (airyFun10_deriv_ge_sq x (mem_Ici.mpr hx.le)) rwa [show (x ^ 2 / 2)β»ΒΉ = 2 / x ^ 2 by rw [inv_div]] at h1 exact le_trans (airyRec_le_inv_deriv hx) hbd /-- **The Wronskian `W(f, Ai_rec) = fΒ·Ai_rec' β f'Β·Ai_rec = β1`** (constant; the synthesis identity).The `fΒ·g` terms cancel, leaving `βfΒ·(1/f) = β1`. -/theorem airyRec_wronskian {x : β} (hx : 0 < x) : airyFun 1 0 x * (deriv (airyFun 1 0) x * airyRecInt x - (airyFun 1 0 x)β»ΒΉ) - deriv (airyFun 1 0) x * airyRec x = -1 := by have hfx : airyFun 1 0 x β 0 := (airyFun10_pos x (mem_Ici.mpr hx.le)).ne' rw [airyRec]; field_simp; ring /-- **Existence of the recessive solution.** There is a non-trivial real solution `y` of `y''=xy`on `(0,β)` that decays to `0` at `+β`. (`y = Ai_rec`; non-triviality from `W(1)=β1β 0`.) This is thedecaying solution whose existence the DLMF Β§9.7 asymptotics classically guarantee β here built andverified by reduction of order, with no asymptotics. -/theorem exists_recessive_solution : β y y' : β β β, (y 1 β 0 β¨ y' 1 β 0) β§ Tendsto y atTop (π 0) β§ (β x, 0 < x β HasDerivAt y (y' x) x) β§ (β x, 0 < x β HasDerivAt y' (x * y x) x) := by refine β¨airyRec, fun x => deriv (airyFun 1 0) x * airyRecInt x - (airyFun 1 0 x)β»ΒΉ, ?_, airyRec_tendsto_zero, fun x hx => airyRec_hasDerivAt hx, fun x hx => airyRec_deriv_hasDerivAt hxβ© by_contra h push Not at h obtain β¨h1, h2'β© := h have h2 : deriv (airyFun 1 0) 1 * airyRecInt 1 - (airyFun 1 0 1)β»ΒΉ = 0 := h2' have hW := airyRec_wronskian one_pos rw [h1, h2] at hW norm_num at hW /-! ### Entire extension of the recessive solution (linearity + Wronskian + quotient identity) -/ /-- **Linearity of the Airy coefficient recurrence.** `coeffR` is linear in the initial data,because the recurrence `a_{k+3}=a_k/((k+2)(k+3))` is linear. -/theorem coeffR_linear (c0 c1 : β) (n : β) : coeffR c0 c1 n = c0 * coeffR 1 0 n + c1 * coeffR 0 1 n := by induction n using Nat.strong_induction_on with | _ n ih => rcases n with _ | _ | _ | k Β· simp [coeffR] Β· simp [coeffR] Β· simp [coeffR] Β· rw [coeffR_succ3, coeffR_succ3, coeffR_succ3, ih k (by omega)]; ring /-- The Airy power-series terms are summable at every point (entire). -/theorem summable_coeffR_term (c0 c1 x : β) : Summable (fun n => coeffR c0 c1 n * x ^ n) := by apply Summable.of_norm have h := summable_coeffR_norm c0 c1 (Real.toNNReal |x|) refine h.congr (fun n => ?_) simp [norm_mul, norm_pow, Real.norm_eq_abs] /-- **Linearity of `airyFun`** in the initial data: `airyFun c0 c1 = c0Β·f + c1Β·g` with`f = airyFun 1 0`, `g = airyFun 0 1`. -/theorem airyFun_linear (c0 c1 x : β) : airyFun c0 c1 x = c0 * airyFun 1 0 x + c1 * airyFun 0 1 x := by show ofScalarsSum (coeffR c0 c1) x = c0 * ofScalarsSum (coeffR 1 0) x + c1 * ofScalarsSum (coeffR 0 1) x rw [ofScalars_sum_eq, ofScalars_sum_eq, ofScalars_sum_eq] simp only [smul_eq_mul] rw [β tsum_mul_left, β tsum_mul_left, β Summable.tsum_add ((summable_coeffR_term 1 0 x).mul_left c0) ((summable_coeffR_term 0 1 x).mul_left c1)] apply tsum_congr; intro n rw [coeffR_linear c0 c1 n]; ring /-- **The basis Wronskian `W(f,g) = fΒ·g' β f'Β·g β‘ 1`** (Abel's identity): constant because bothsolve `y''=xΒ·y`, and `=1` at `0` from `f(0)=1, f'(0)=0, g(0)=0, g'(0)=1`. -/theorem wronskian_fg (x : β) : airyFun 1 0 x * deriv (airyFun 0 1) x - deriv (airyFun 1 0) x * airyFun 0 1 x = 1 := by set W : β β β := fun y => airyFun 1 0 y * deriv (airyFun 0 1) y - deriv (airyFun 1 0) y * airyFun 0 1 y with hWdef have hderiv : β y, HasDerivAt W 0 y := by intro y have h := ((airyFun_hasDerivAt 1 0 y).mul (airyFun_deriv_hasDerivAt 0 1 y)).sub ((airyFun_deriv_hasDerivAt 1 0 y).mul (airyFun_hasDerivAt 0 1 y)) convert h using 1 ring have hconst : W x = W 0 := is_const_of_deriv_eq_zero (fun y => (hderiv y).differentiableAt) (fun y => (hderiv y).deriv) x 0 rw [show airyFun 1 0 x * deriv (airyFun 0 1) x - deriv (airyFun 1 0) x * airyFun 0 1 x = W x from rfl, hconst] show airyFun 1 0 0 * deriv (airyFun 0 1) 0 - deriv (airyFun 1 0) 0 * airyFun 0 1 0 = 1 rw [airyFun_zero 1 0, airyFun_zero 0 1, deriv_airyFun_zero 0 1, deriv_airyFun_zero 1 0] norm_num /-- Derivative form of `airyFun` linearity. -/theorem deriv_airyFun_linear (c0 c1 x : β) : deriv (airyFun c0 c1) x = c0 * deriv (airyFun 1 0) x + c1 * deriv (airyFun 0 1) x := by have hh : HasDerivAt (fun y => c0 * airyFun 1 0 y + c1 * airyFun 0 1 y) (c0 * deriv (airyFun 1 0) x + c1 * deriv (airyFun 0 1) x) x := ((airyFun_hasDerivAt 1 0 x).const_mul c0).add ((airyFun_hasDerivAt 0 1 x).const_mul c1) rw [show airyFun c0 c1 = fun y => c0 * airyFun 1 0 y + c1 * airyFun 0 1 y from funext (airyFun_linear c0 c1)] exact hh.deriv /-- **The entire recessive solution exists.** There is a non-trivial *entire* `airyFun c0 c1`(with `c1 = β1`, `c0 = (Ai_rec(1)+g(1))/f(1)` the synthesis constant) that decays to `0` at `+β` βthe recessive Airy solution, now an honest entire power series rather than an imported asymptoticobject. Proof: choosing `c1=β1` forces `W(f, airyFun c0 (β1)) = c1Β·W(f,g) = β1 = W(f, Ai_rec)`, so thedifference has Wronskian `0` with `f`; hence `(airyFun c0 (β1) β Ai_rec)/f` has derivative `0` on`(0,β)`, is constant, and vanishes at `1` (by the choice of `c0`). Thus `airyFun c0 (β1) = Ai_rec` on`(0,β)` and inherits its decay. -/theorem exists_entire_recessive : β c0 c1 : β, (c0 β 0 β¨ c1 β 0) β§ Tendsto (airyFun c0 c1) atTop (π 0) := by have hf1 : airyFun 1 0 1 β 0 := (airyFun10_pos 1 (by norm_num)).ne' set c0 : β := (airyRec 1 + airyFun 0 1 1) / airyFun 1 0 1 with hc0 refine β¨c0, -1, Or.inr (by norm_num), ?_β© -- u := airyFun c0 (-1) equals airyRec on (0,β) have hmatch : airyFun c0 (-1) 1 = airyRec 1 := by rw [airyFun_linear c0 (-1) 1, hc0]; field_simp; ring -- Ο = (u - Ai_rec)/f has derivative 0 on (0,β) have hΟ : β y β Ioi (0:β), HasDerivAt (fun z => (airyFun c0 (-1) z - airyRec z) / airyFun 1 0 z) 0 y := by intro y hy have hyp : (0:β) < y := hy have hfy : airyFun 1 0 y β 0 := (airyFun10_pos y (mem_Ici.mpr hyp.le)).ne' have hd := ((airyFun_hasDerivAt c0 (-1) y).sub (airyRec_hasDerivAt hyp)).div (airyFun_hasDerivAt 1 0 y) hfy have hWu : airyFun 1 0 y * deriv (airyFun c0 (-1)) y - deriv (airyFun 1 0) y * airyFun c0 (-1) y = -1 := by rw [airyFun_linear c0 (-1) y, deriv_airyFun_linear c0 (-1) y] linear_combination -(wronskian_fg y) have hWr := airyRec_wronskian hyp convert hd using 1 rw [eq_comm, div_eq_zero_iff]; left simp only [Pi.sub_apply] linear_combination hWu - hWr -- Ο constant on (0,β), value 0 at 1 have hconst : (airyFun c0 (-1) 1 - airyRec 1) / airyFun 1 0 1 = 0 := by rw [hmatch]; simp have hEq : Set.EqOn (airyFun c0 (-1)) airyRec (Ioi 0) := by intro x hx have hxp : (0:β) < x := hx have hfx : airyFun 1 0 x β 0 := (airyFun10_pos x (mem_Ici.mpr hxp.le)).ne' have hcx : (airyFun c0 (-1) x - airyRec x) / airyFun 1 0 x = (airyFun c0 (-1) 1 - airyRec 1) / airyFun 1 0 1 := IsOpen.is_const_of_deriv_eq_zero isOpen_Ioi isPreconnected_Ioi (fun z hz => (hΟ z hz).differentiableAt.differentiableWithinAt) (fun z hz => (hΟ z hz).deriv) hx (by norm_num : (1:β) β Ioi 0) rw [hconst, div_eq_zero_iff] at hcx rcases hcx with h | h Β· linarith [sub_eq_zero.mp h] Β· exact absurd h hfx -- transfer decay refine airyRec_tendsto_zero.congr' ?_ filter_upwards [eventually_gt_atTop (0:β)] with x hx using (hEq hx).symm end Airy