Skip to content

Conversation

@CoolRmal
Copy link
Collaborator

@CoolRmal CoolRmal commented Jan 5, 2026

This PR intends to define the type of common functions used to estimate growth rate so that for example we can formalize a better statement in #1476 and potentially other Erdos problems.
I only include constants, identity function, log, exp, gamma (factorial), addition, multiplication, and composition because

  1. a^x = exp x * (log a)
  2. x^a = exp a * (log x)
  3. x^x = exp x * (log x)
  4. We certainly don't want other kinds of elementary functions (e.g. trigonometric functions) because they oscillate.
  5. Subtraction is multiplying by -1.
  6. f/g = exp (log f - log g)

This should include most of functions we are interested in.

I also only defined evaluation map for ℝ → ℝ and ℕ → ℝ instead of functions with more general domain/codomain because I think these are enough for Erdos problems.

@YaelDillies
Copy link
Member

gamma (factorial)

By Stirling's formula, this is unnecessary

Copy link
Member

@YaelDillies YaelDillies left a comment

Choose a reason for hiding this comment

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

Could you write an elaborator for such functions? Something that would eg make elem(exp (x * x) * log x) elaborate as .mul (.comp .exp (.mul .id .id)) .log.

Comment on lines 27 to 36
/-- The type of common functions used to estimate growth rate. -/
inductive CommonFn : Type
| const : ℝ → CommonFn
| id : CommonFn
| log : CommonFn
| exp : CommonFn
| Gamma : CommonFn
| add : CommonFn → CommonFn → CommonFn
| mul : CommonFn → CommonFn → CommonFn
| comp : CommonFn → CommonFn → CommonFn
Copy link
Member

@YaelDillies YaelDillies Jan 5, 2026

Choose a reason for hiding this comment

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

I am rather sure you will need to allow functions tending to zero or infinity, so that we can state things like ~ x ^(1 + o(1)) or >> x log x beta(x) where beta -> infty (one Erdos problem has partial progress of this form where beta is reverse Ackermann)

@YaelDillies YaelDillies added the awaiting-author The author should answer a question or perform changes. Reply when done. label Jan 5, 2026
@YaelDillies YaelDillies changed the title feat: Add the type of common functions used to estimate growth rate feat: functions of elementary growth Jan 5, 2026
@CoolRmal
Copy link
Collaborator Author

CoolRmal commented Jan 5, 2026

@YaelDillies I think I get the idea but I am not sure how to realize this in Lean. What is the type of this elaborator? Do I need some knowledge in metaprogramming in order to define this?

@YaelDillies
Copy link
Member

YaelDillies commented Jan 5, 2026

Indeed, this would be metaprogramming. What you need to do is basically to follow this section of MetIL and possibly this one too.

YaelDillies pushed a commit that referenced this pull request Jan 6, 2026
Closes #389

Some remarks:

1. In the paper [ESS94] On Sum Sets of Sidon Sets, the authors formulate
this conjecture by using limit, which will be equivalent to the
formulation on the website. The limit formulation is easier to formalize
and this is why I defined the function `f`. This definition of `f` also
makes it easier to talk about the growth rate.
2. For the conjecture related to infinite Sidon sets, one needs the
results in the PR #1481, so I left it as a TODO.
<img width="1052" height="413" alt="Screenshot 2026-01-06 at 1 40 26 AM"
src="https://github.com/user-attachments/assets/28b211a9-0c66-4089-972e-a722939ffc45"
/>

---------

Co-authored-by: Moritz Firsching <[email protected]>
jdhruv555 pushed a commit to jdhruv555/formal-conjectures that referenced this pull request Jan 7, 2026
Closes google-deepmind#389

Some remarks:

1. In the paper [ESS94] On Sum Sets of Sidon Sets, the authors formulate
this conjecture by using limit, which will be equivalent to the
formulation on the website. The limit formulation is easier to formalize
and this is why I defined the function `f`. This definition of `f` also
makes it easier to talk about the growth rate.
2. For the conjecture related to infinite Sidon sets, one needs the
results in the PR google-deepmind#1481, so I left it as a TODO.
<img width="1052" height="413" alt="Screenshot 2026-01-06 at 1 40 26 AM"
src="https://github.com/user-attachments/assets/28b211a9-0c66-4089-972e-a722939ffc45"
/>

---------

Co-authored-by: Moritz Firsching <[email protected]>
@BoltonBailey
Copy link
Contributor

I guess by the same token that Gamma is definable in terms of the other growth rates via Stirling's formula, addition is definable in terms of exp, mul, and log. Perhaps that's a change worth making?

Copy link
Member

@Paul-Lez Paul-Lez left a comment

Choose a reason for hiding this comment

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

Thanks for the PR!


notation f " ≫ " g => Asymptotics.IsBigO Filter.atTop g f
notation g " ≪ " f => Asymptotics.IsBigO Filter.atTop g f

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 it might be better to include this code in a file ../Asymptotics/ElementaryGrowth.lean since I suspect more content will be added to it after! It would also be useful to add a module docstring to the file documenting what you've added, and the intended use (perhaps with some examples!).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-author The author should answer a question or perform changes. Reply when done.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants