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): define the probabilist's Hermite polynomials #18739

Closed
wants to merge 17 commits into from

Conversation

lukemantle
Copy link
Collaborator

@lukemantle lukemantle commented Apr 4, 2023

Define the Hermite polynomials recursively, and show this is equivalent to the result of iterating the operation x - d/dx on the constant polynomial 1.

Future PRs will include several equivalent characterizations:

  • Recursive and explicit expressions for the coefficients
  • Definition based on the nth derivative of the Gaussian function

Co-authored-by: Jake Levinson levinson.jake@gmail.com


Currently, hermite n is defined as a polynomial over . Would it better to generalize this to a polynomial over comm_ring R?

Open in Gitpod

define the Hermite polynomials
@lukemantle lukemantle added the awaiting-review The author would like community review of the PR label Apr 4, 2023
@eric-wieser
Copy link
Member

Can you add the result that (hermite n).monic?

@jakelev jakelev closed this Apr 5, 2023
@jakelev jakelev reopened this Apr 5, 2023
@jakelev
Copy link
Collaborator

jakelev commented Apr 5, 2023

Whoops - misclicked the "close" button. Sorry about that.

@eric-wieser eric-wieser added awaiting-author A reviewer has asked the author a question or requested changes and removed awaiting-review The author would like community review of the PR labels Apr 6, 2023
@jakelev
Copy link
Collaborator

jakelev commented Apr 6, 2023

@eric-wieser

Can you add the result that (hermite n).monic?

I think this will be easier once @lukemantle has PRed coeff.lean, which includes
https://github.com/lukemantle/hermite/blob/2e857f22b171febadbed9a9822e64c4b11446b04/src/coeff.lean#L39

lemma hermite_coeff_upper' (n k : ℕ) (hnk : n < k) : coeff (hermite n) k = 0

and
https://github.com/lukemantle/hermite/blob/2e857f22b171febadbed9a9822e64c4b11446b04/src/coeff.lean#L45

lemma hermite_coeff_top (n : ℕ) : coeff (hermite n) n = 1

@lukemantle lukemantle added awaiting-review The author would like community review of the PR and removed awaiting-author A reviewer has asked the author a question or requested changes labels Apr 7, 2023
@eric-wieser
Copy link
Member

I left some comments at 7e00f85#comments, they seem not to be showing up here

Copy link
Member

@eric-wieser eric-wieser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recommend you add an entry to https://github.com/leanprover-community/mathlib4/wiki/port-comments/_edit asking people not to port this file yet; I imagine you will want to add to it in a future PR, and having someone port it immediately will just be unhelpful.

Co-authored-by: jakelev <levinson.jake@gmail.com>
@lukemantle
Copy link
Collaborator Author

I recommend you add an entry to https://github.com/leanprover-community/mathlib4/wiki/port-comments/_edit asking people not to port this file yet; I imagine you will want to add to it in a future PR, and having someone port it immediately will just be unhelpful.

Ok, that sounds like a good idea. How can I add an entry to that file?

@sgouezel sgouezel removed the awaiting-review The author would like community review of the PR label Apr 16, 2023
@mcdoll
Copy link
Member

mcdoll commented Apr 18, 2023

Just merge master, that will solve the lint-style issue.

Comment on lines 27 to 48
/-- the nth probabilist's Hermite polynomial -/
noncomputable def hermite : ℕ → polynomial ℤ
| 0 := 1
| (n+1) := X * (hermite n) - (hermite n).derivative

@[simp] lemma hermite_succ {n : ℕ} : hermite (n+1) = X * (hermite n) - (hermite n).derivative :=
by rw hermite

lemma hermite_eq_iter {n : ℕ} : hermite n = nat.iterate (λp, X*p - p.derivative) n 1 :=
begin
induction n with n ih,
{ refl },
{ rw [function.iterate_succ_apply', ← ih, hermite_succ] }
end

@[simp] lemma hermite_zero : hermite 0 = C 1 := rfl

@[simp] lemma hermite_one : hermite 1 = X :=
begin
rw [hermite_succ, hermite_zero],
simp only [map_one, mul_one, derivative_one, sub_zero]
end
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should all be wrapped in namespace polynomial

| 0 := 1
| (n+1) := X * (hermite n) - (hermite n).derivative

@[simp] lemma hermite_succ {n : ℕ} : hermite (n+1) = X * (hermite n) - (hermite n).derivative :=
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

n should be explicit (() not {}) here and below

@[simp] lemma hermite_succ {n : ℕ} : hermite (n+1) = X * (hermite n) - (hermite n).derivative :=
by rw hermite

lemma hermite_eq_iter {n : ℕ} : hermite n = nat.iterate (λp, X*p - p.derivative) n 1 :=
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lean has notation for nat.iterate, I think it's

Suggested change
lemma hermite_eq_iter {n : ℕ} : hermite n = nat.iterate (λp, X*p - p.derivative) n 1 :=
lemma hermite_eq_iterate {n : ℕ} : hermite n = (λ p, X*p - p.derivative)^[n] 1 :=

I also changed the name; we rarely abbreviate function names unless they're really really long.

@eric-wieser
Copy link
Member

eric-wieser commented Apr 18, 2023

bors d+

Please merge once CI passes! Make sure you've done this first

Ok, that sounds like a good idea. How can I add an entry to that file?

I've done it for you; maybe you don't have permission to edit the page?

@bors
Copy link

bors bot commented Apr 18, 2023

✌️ lukemantle can now approve this pull request. To approve and merge a pull request, simply reply with bors r+. More detailed instructions are available here.

@github-actions github-actions bot added delegated The PR author may merge after reviewing final suggestions. and removed awaiting-review The author would like community review of the PR labels Apr 18, 2023
@eric-wieser eric-wieser added the awaiting-CI The author would like to see what CI has to say before doing more work. label Apr 18, 2023
@lukemantle
Copy link
Collaborator Author

bors d+

Please merge once CI passes! Make sure you've done this first

I recommend you add an entry to https://github.com/leanprover-community/mathlib4/wiki/port-comments/_edit asking people not to port this file yet; I imagine you will want to add to it in a future PR, and having someone port it immediately will just be unhelpful.

Ok, that sounds like a good idea. How can I add an entry to that file?

Just click "edit" and add a line in the style of the existing lines, referring to your file name.

Huh, I don't see the edit icon on the wiki sidebar. Maybe I'm missing some permission? I see you've already added an entry about ring_theory.polynomial.hermite

@github-actions github-actions bot removed the awaiting-CI The author would like to see what CI has to say before doing more work. label Apr 18, 2023
@mcdoll
Copy link
Member

mcdoll commented Apr 19, 2023

You probably need non-master write access to mathlib4.

@eric-wieser
Copy link
Member

bors merge

Thanks!

@github-actions github-actions bot added the ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.) label Apr 19, 2023
bors bot pushed a commit that referenced this pull request Apr 19, 2023
…mials (#18739)

Define the Hermite polynomials recursively, and show this is equivalent to the result of iterating the operation `x - d/dx` on the constant polynomial `1`.

Future PRs will include several equivalent characterizations:

- Recursive and explicit expressions for the coefficients
- Definition based on the nth derivative of the Gaussian function

Co-authored-by: Jake Levinson <levinson.jake@gmail.com>



Co-authored-by: lukemantle <62187700+lukemantle@users.noreply.github.com>
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
@bors
Copy link

bors bot commented Apr 19, 2023

Pull request successfully merged into master.

Build succeeded:

@bors bors bot changed the title feat(ring_theory/polynomial): define the probabilist's Hermite polynomials [Merged by Bors] - feat(ring_theory/polynomial): define the probabilist's Hermite polynomials Apr 19, 2023
@bors bors bot closed this Apr 19, 2023
@bors bors bot deleted the hermite branch April 19, 2023 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
delegated The PR author may merge after reviewing final suggestions. ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants