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: arith_mult: an aesop tactic for proving IsMultiplicative statements #9310

Closed
wants to merge 12 commits into from

Conversation

FLDutchmann
Copy link
Collaborator

Add a tactic that proves multiplicativity of arithmetic functions using Aesop by applying structural lemmas, akin to the continuity and measurability tactics.


Open in Gitpod

@FLDutchmann FLDutchmann added awaiting-review t-meta Tactics, attributes or user commands t-number-theory Number theory (also use t-algebra or t-analysis to specialize) awaiting-author A reviewer has asked the author a question or requested changes and removed awaiting-review labels Dec 27, 2023
Mathlib.lean Outdated Show resolved Hide resolved
Mathlib.lean Outdated Show resolved Hide resolved
Mathlib.lean Outdated Show resolved Hide resolved
FLDutchmann and others added 2 commits December 28, 2023 00:34
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@FLDutchmann FLDutchmann added awaiting-review awaiting-CI and removed awaiting-author A reviewer has asked the author a question or requested changes labels Dec 27, 2023
Copy link
Contributor

@Vierkantor Vierkantor left a comment

Choose a reason for hiding this comment

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

I like the way this tactic can be implemented quite easily using aesop! Although I do have a big question: wouldn't it better to use the new fun_prop system: https://leanprover.zulipchat.com/#narrow/stream/113488-general/topic/.60fun_prop.60.20new.20tactic.20for.20Differentiable.2C.20Continuous.2C.20.2E.2E.2E

Comment on lines 25 to 27
`multiplicativity` solves goals of the form `IsMultiplicative f` for `f : ArithmeticFunction R`
by applying lemmas tagged with the user attribute `multiplicativity`. -/
macro (name := multiplicativity) "multiplicativity" c:Aesop.tactic_clause* : tactic =>
Copy link
Contributor

Choose a reason for hiding this comment

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

The name sounds quite general compared to the actual scope: "multiplicative" has lots of uses like "multiplicative actions", and the Multiplicative type synonym. So maybe a more complicated name like arith_multiplicative?

Copy link
Collaborator

Choose a reason for hiding this comment

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

fun_prop is designed for proposition for which you have *_id, *_const, *_comp, *_apply and *_pi theorems(or subset of them). I do not see them for IsMultiplicative so I don't think it is applicable in this case.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry for the late reply - since this was still tagged awaiting-author I was expecting you might have more to say/do here.

I see why fun_prop wouldn't be appropriate for this tactic then. So the design looks good and I just have a question about the name.

Note that the tactic syntax multiplicative is not namespaced:

example : Nat.ArithmeticFunction.IsMultiplicative Nat.ArithmeticFunction.moebius := by multiplicativity

works without opening any namespace. So I really do think that a more specific name should be used.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sorry for the delay on my part. I agree with changing the name. How about arith_mult? multiplicativity is frankly a bit of a mouthful.

And I also think aesop is probably a little suboptimal regarding performance and code extraction, but for a tactic that won't be very widely used, it should be fine. (that is to say I am pretty excited about fun_prop, and I'm a little sad it can't be used here)

There's also a merge conflict at the moment, so I'll merge master and rename.

@Vierkantor Vierkantor added awaiting-author A reviewer has asked the author a question or requested changes and removed awaiting-review labels Feb 6, 2024
@FLDutchmann FLDutchmann changed the title feat: multiplicativity: an aesop tactic for proving IsMultiplicative statements feat: arith_mult: an aesop tactic for proving IsMultiplicative statements Feb 20, 2024
@FLDutchmann FLDutchmann added awaiting-review awaiting-CI and removed awaiting-author A reviewer has asked the author a question or requested changes labels Feb 20, 2024
Copy link
Contributor

@Vierkantor Vierkantor left a comment

Choose a reason for hiding this comment

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

Some minor formatting fixes and it looks good to me.

bors d+

Mathlib/Tactic/ArithMult.lean Outdated Show resolved Hide resolved
test/ArithMult.lean Outdated Show resolved Hide resolved
test/ArithMult.lean Outdated Show resolved Hide resolved
test/ArithMult.lean Outdated Show resolved Hide resolved
@mathlib-bors
Copy link
Contributor

mathlib-bors bot commented Feb 22, 2024

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

FLDutchmann and others added 2 commits February 22, 2024 19:32
Co-authored-by: Anne Baanen <Vierkantor@users.noreply.github.com>
Co-authored-by: Anne Baanen <Vierkantor@users.noreply.github.com>
@FLDutchmann
Copy link
Collaborator Author

bors r+

mathlib-bors bot pushed a commit that referenced this pull request Feb 22, 2024
…statements (#9310)

Add a tactic that proves multiplicativity of arithmetic functions using Aesop by applying structural lemmas, akin to the `continuity` and `measurability` tactics. 



Co-authored-by: Arend Mellendijk <FLDutchmann@users.noreply.github.com>
@mathlib-bors
Copy link
Contributor

mathlib-bors bot commented Feb 22, 2024

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title feat: arith_mult: an aesop tactic for proving IsMultiplicative statements [Merged by Bors] - feat: arith_mult: an aesop tactic for proving IsMultiplicative statements Feb 22, 2024
@mathlib-bors mathlib-bors bot closed this Feb 22, 2024
@mathlib-bors mathlib-bors bot deleted the arend/multiplicativity branch February 22, 2024 20:46
thorimur pushed a commit that referenced this pull request Feb 24, 2024
…statements (#9310)

Add a tactic that proves multiplicativity of arithmetic functions using Aesop by applying structural lemmas, akin to the `continuity` and `measurability` tactics. 



Co-authored-by: Arend Mellendijk <FLDutchmann@users.noreply.github.com>
thorimur pushed a commit that referenced this pull request Feb 26, 2024
…statements (#9310)

Add a tactic that proves multiplicativity of arithmetic functions using Aesop by applying structural lemmas, akin to the `continuity` and `measurability` tactics. 



Co-authored-by: Arend Mellendijk <FLDutchmann@users.noreply.github.com>
riccardobrasca pushed a commit that referenced this pull request Mar 1, 2024
…statements (#9310)

Add a tactic that proves multiplicativity of arithmetic functions using Aesop by applying structural lemmas, akin to the `continuity` and `measurability` tactics. 



Co-authored-by: Arend Mellendijk <FLDutchmann@users.noreply.github.com>
dagurtomas pushed a commit that referenced this pull request Mar 22, 2024
…statements (#9310)

Add a tactic that proves multiplicativity of arithmetic functions using Aesop by applying structural lemmas, akin to the `continuity` and `measurability` tactics. 



Co-authored-by: Arend Mellendijk <FLDutchmann@users.noreply.github.com>
Louddy pushed a commit that referenced this pull request Apr 15, 2024
…statements (#9310)

Add a tactic that proves multiplicativity of arithmetic functions using Aesop by applying structural lemmas, akin to the `continuity` and `measurability` tactics. 



Co-authored-by: Arend Mellendijk <FLDutchmann@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
delegated t-meta Tactics, attributes or user commands t-number-theory Number theory (also use t-algebra or t-analysis to specialize)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants