Zulip Chat Archive

Stream: general

Topic: Where to put some integration lemmas


David Loeffler (Nov 14 2022 at 16:11):

I have some lemmas about integration by substitution over infinite intervals: things like making the change u = x^2 in an integral over x in Ioi 0. I'd like to make a PR to add this to the library, but I'm not sure what file this stuff should go in -- can I ask for some suggestions?

(The motivation here is evaluating the Gamma function at 1/2, reducing it to the computation of the Gaussian integral exp(-x^2) that @Sebastien Gouezel has added.)

Scott Morrison (Nov 15 2022 at 08:52):

Could you post the list of imports you need?

Riccardo Brasca (Nov 15 2022 at 09:01):

We have the folowing python script (I think by @Eric Wieser )

import networkx as nx
import requests
import io
import operator
from functools import reduce

with requests.get("https://leanprover-community.github.io/mathlib_docs/import.gexf") as r:
    g = nx.read_gexf(io.StringIO(r.text))

# where you need the lemma, and which files it needs
needed_in = ('mathlib:algebra.gcd_monoid.basic',)
needs = ('mathlib:algebra.gcd_monoid.basic', 'mathlib:ring_theory.coprime.basic')

ok = (reduce(operator.and_, [nx.ancestors(g, n) for n in needs]) &
      reduce(operator.and_, [nx.descendants(g, n) for n in needed_in]))
print(ok)

to find where to place lemmas (of course it doesn't know anything about the mathematics, it just looks at the imports).

David Loeffler (Nov 20 2022 at 18:25):

Hi guys, sorry I missed your reply until now (I should probably set up notifications in zulip or something). I guess I was more asking "where is the morally / aesthetically right place to put X", rather than "where can I get away with putting X without creating circular imports". I ended up putting the lemmas in two batches, first #17540 (now merged) and second #17542 (awaiting review).

rtertr (Sonia) (Mar 04 2023 at 22:12):

Hi @David Loeffler , can I ask where these lemma exists? Are they available in the mathlib library?
Kind regards, Sonia

David Loeffler (Mar 05 2023 at 10:31):

If you look at the PR's on github (linked in my last message) you can see where the lemmas ended up. The one about substituting u=xpu = x^p integrals over (0,)(0, \infty) is now measure_theory.integral_comp_rpow_Ioi.


Last updated: Dec 20 2023 at 11:08 UTC