Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - feat(ring_theory/polynomial): show gaussian form of hermite n #18896

Closed
wants to merge 31 commits into from
Closed
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
c18d6fc
feat(ring_theory/polynomial): show gaussian form of `hermite n`
lukemantle Apr 28, 2023
0139513
modify docstring, rename lemmas
lukemantle Apr 28, 2023
3eb686b
remove inv_gaussian, modify docstring
lukemantle Apr 28, 2023
e3c4d85
add docstrings to definitions
lukemantle Apr 28, 2023
44763e4
split oversized line
lukemantle Apr 28, 2023
9d6e6ec
move cont_diff.iterate_deriv to cont_diff.lean, correct proof of inv_…
jakelev Apr 29, 2023
930aead
fix proof using aeval rw lemma
jakelev Apr 29, 2023
1ae19cf
remove separate equality of lambdas
jakelev Apr 29, 2023
22a9add
remove gaussian definition, simplify all proofs
jakelev Apr 30, 2023
9fb7f4c
add finite-level version of cont_diff.iterate_deriv
jakelev Apr 30, 2023
257a8f0
correct docstring
jakelev Apr 30, 2023
ed92185
golf and format
eric-wieser Apr 30, 2023
0248c18
inline proof of recurrence
jakelev Apr 30, 2023
04fafe5
modified proof to use division
jakelev May 2, 2023
ac5025a
correct typo
jakelev May 2, 2023
5ab5fb9
modify docstring
jakelev May 4, 2023
086953e
add polynomial.deriv_aeval
jakelev May 5, 2023
07044aa
move PR to ring_theory/polynomial/hermite/
jakelev May 5, 2023
e198737
modify docstring
jakelev May 5, 2023
c2e742f
added variant lemma statements
jakelev May 5, 2023
3a28d9a
Update src/ring_theory/polynomial/hermite/gaussian.lean
jcommelin May 5, 2023
549d5d2
Update src/ring_theory/polynomial/hermite/gaussian.lean
eric-wieser May 5, 2023
150bf46
fix style, squeeze a slow simp
eric-wieser May 5, 2023
a7b25eb
Update src/analysis/calculus/deriv.lean
eric-wieser May 5, 2023
f3a41d2
avoid side goal
jakelev May 5, 2023
98c4b9a
Merge branch 'hermite_gauss' of https://github.com/leanprover-communi…
jakelev May 5, 2023
bdde511
Apply suggestions from code review
jakelev May 5, 2023
e174f58
Merge branch 'master' into hermite_gauss
eric-wieser May 11, 2023
b6c1adc
Delete duplicate import from bad merge
eric-wieser May 11, 2023
a39abab
use the new lemma in the proof
eric-wieser May 11, 2023
8c65b73
correct failing proof
jakelev May 12, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/analysis/calculus/cont_diff.lean
Original file line number Diff line number Diff line change
Expand Up @@ -2296,6 +2296,11 @@ lemma cont_diff.continuous_deriv (h : cont_diff 𝕜 n f₂) (hn : 1 ≤ n) :
continuous (deriv f₂) :=
(cont_diff_succ_iff_deriv.mp (h.of_le hn)).2.continuous

lemma cont_diff.iterate_deriv :
∀ (n : ℕ) (f₂ : 𝕜 → F) (hf : cont_diff 𝕜 ∞ f₂), cont_diff 𝕜 ∞ (deriv^[n] f₂)
jakelev marked this conversation as resolved.
Show resolved Hide resolved
| 0 f₂ hf := hf
| (n+1) f₂ hf := cont_diff.iterate_deriv n (deriv f₂) (cont_diff_top_iff_deriv.mp hf).2

end deriv

section restrict_scalars
Expand Down
57 changes: 57 additions & 0 deletions src/ring_theory/polynomial/hermite.lean
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ Authors: Luke Mantle

import data.polynomial.derivative
import data.nat.parity
import analysis.special_functions.exp
import analysis.special_functions.exp_deriv
jakelev marked this conversation as resolved.
Show resolved Hide resolved

/-!
# Hermite polynomials
Expand All @@ -16,12 +18,15 @@ This file defines `polynomial.hermite n`, the nth probabilist's Hermite polynomi

* `polynomial.hermite n`: the `n`th probabilist's Hermite polynomial,
defined recursively as a `polynomial ℤ`
* `gaussian`: the real Gaussian function

## Results

* `polynomial.coeff_hermite_of_odd_add`: for `n`,`k` where `n+k` is odd, `(hermite n).coeff k` is
zero.
* `polynomial.monic_hermite`: for all `n`, `hermite n` is monic.
* `polynomial.hermite_eq_deriv_gaussian`: the recursive polynomial definition is equivalent to the
definition as the polynomial factor occurring in the `n`-th derivative of a gaussian.

## References

Expand Down Expand Up @@ -124,5 +129,57 @@ begin
end

end coeff
end polynomial

/-! ### Lemmas about `polynomial.hermite_gauss` -/

section gaussian

/-- The real Gaussian function -/
def gaussian : ℝ → ℝ := λ x, real.exp (-(x^2 / 2))
jakelev marked this conversation as resolved.
Show resolved Hide resolved

lemma inv_gaussian_eq : gaussian⁻¹ = λ x, real.exp (x^2 / 2) :=
by { ext, simp [gaussian, real.exp_neg] }

lemma inv_gaussian_mul_gaussian (x : ℝ) : gaussian⁻¹ x * gaussian x = 1 :=
inv_mul_cancel (real.exp_pos _).ne.symm

lemma deriv_gaussian (x : ℝ) : deriv gaussian x = -x * gaussian x :=
by simp [gaussian, mul_comm]

lemma deriv_inv_gaussian (x : ℝ) : deriv gaussian⁻¹ x = x * gaussian⁻¹ x :=
by simp [inv_gaussian_eq, mul_comm]

lemma cont_diff_gaussian : cont_diff ℝ ⊤ gaussian :=
((cont_diff_id.pow 2).div_const 2).neg.exp

namespace polynomial

lemma hermite_gauss_succ (n : ℕ) :
(λ x, (-1)^(n+1) * (gaussian⁻¹ x) * (deriv^[n+1] gaussian x))
= id * (λ x, (-1)^n * (gaussian⁻¹ x) * (deriv^[n] gaussian x)) -
deriv (λ x, (-1)^n * (gaussian⁻¹ x) * (deriv^[n] gaussian x)) :=
begin
ext,
simp only [function.iterate_succ', function.comp_app,
id.def, pi.mul_apply, pi.sub_apply, pow_succ],
rw [deriv_mul, deriv_const_mul, deriv_inv_gaussian],
ring,
{ simp [inv_gaussian_eq] },
{ simp [inv_gaussian_eq] },
{ apply (cont_diff_top_iff_deriv.mp (cont_diff.iterate_deriv _ _ cont_diff_gaussian)).1 }
end

lemma hermite_eq_deriv_gaussian (n : ℕ) (x : ℝ) :
aeval x (hermite n) = (-1)^n * (gaussian⁻¹ x) * (deriv^[n] gaussian x) :=
begin
apply function.funext_iff.mp _ x,
induction n with n ih,
jakelev marked this conversation as resolved.
Show resolved Hide resolved
{ simp [-pi.inv_apply, inv_gaussian_mul_gaussian] },
{ rw [hermite_gauss_succ, hermite_succ, ← ih],
ext,
simp [aeval_def, eval₂_eq_eval_map] },
end

end polynomial
end gaussian