Skip to content

[Merged by Bors] - chore(Tactic/GCongr): move @[gcongr] tags around#9393

Closed
urkud wants to merge 19 commits intomasterfrom
YK-move-gcongr
Closed

[Merged by Bors] - chore(Tactic/GCongr): move @[gcongr] tags around#9393
urkud wants to merge 19 commits intomasterfrom
YK-move-gcongr

Conversation

@urkud
Copy link
Copy Markdown
Member

@urkud urkud commented Jan 1, 2024

  • Add import Mathlib.Tactic.GCongr.Core
    to Algebra/Order/Ring/Lemmas.
  • Move most @[gcongr] tags next to the lemmas.

See Zulip thread


  • Is there a better home for setting up positivity
    as a gcongr discharger?
  • What should we do with Nat division lemmas?

Open in Gitpod

* Add `import Mathlib.Tactic.GCongr.Core`
  to `Algebra/Order/Ring/Lemmas`.
* Move most `@[gcongr]` tags next to the lemmas.
@urkud urkud added awaiting-review t-meta Tactics, attributes or user commands RFC Request for comment t-algebra Algebra (groups, rings, fields, etc) labels Jan 1, 2024
@urkud urkud requested a review from hrmacbeth January 1, 2024 17:47
mathlib-bors bot pushed a commit that referenced this pull request Jan 4, 2024
This was noticed in the discussion around #9393.
@jcommelin jcommelin added awaiting-author A reviewer has asked the author a question or requested changes. and removed awaiting-review labels Jan 6, 2024
@urkud urkud added awaiting-review and removed awaiting-author A reviewer has asked the author a question or requested changes. RFC Request for comment labels Jan 7, 2024
@urkud urkud requested a review from Parcly-Taxel January 7, 2024 22:10
Copy link
Copy Markdown
Collaborator

@Parcly-Taxel Parcly-Taxel left a comment

Choose a reason for hiding this comment

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

Is there a better home for setting up positivity as a gcongr discharger?

I think the current setup is fine enough.

@urkud
Copy link
Copy Markdown
Member Author

urkud commented Jan 8, 2024

Is there a better home for setting up positivity as a gcongr discharger?

I think the current setup is fine enough.

It's a footgun: gcongr kind of works without importing Mathlib.Tactic.GCongr but doesn't use positivity. To reduce damage, we can import this file very early as soon as both Positivity.Core and GCongr.Core are imported. OTOH, we already have a similar footgun with Positivity.Core vs Positivity, so maybe the right way to solve the issue is to add documentation to gcongr and positivity ("if the tactic fails, first make sure that your file imports ...").

@Parcly-Taxel
Copy link
Copy Markdown
Collaborator

so maybe the right way to solve the issue is to add documentation to gcongr and positivity ("if the tactic fails, first make sure that your file imports ...").

Just solve the issue as you see fit, then.

@ghost ghost added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Jan 9, 2024
@ghost ghost added merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) and removed merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) labels Jan 9, 2024
@hrmacbeth
Copy link
Copy Markdown
Member

LGTM, modulo: did this get resolved?

I'm good with importing positivity as early as possible. Should I ask on Zulip for other opinions?

@YaelDillies
Copy link
Copy Markdown
Contributor

YaelDillies commented Feb 2, 2024

Yes, negatively. positivity can't be imported earlier than Field because of the norm_num support at the core of the tactic. So #10140 only moves the extensions that depend on Field anyway. Further, Tactic.Positivity.Basic imports extra cast material that is unimportable in most of the algebraic order hierarchy, so we must restrict to importing only Tactic.Positivity.Core there.

@Parcly-Taxel
Copy link
Copy Markdown
Collaborator

Parcly-Taxel commented Feb 6, 2024

#10140 has been merged. You can adapt this PR to it.

@urkud
Copy link
Copy Markdown
Member Author

urkud commented Feb 6, 2024

Merged master, fixed compile.

(zpow_strictMono hx).lt_iff_lt
#align zpow_lt_iff_lt zpow_lt_iff_lt

@[gcongr] alias ⟨_, zpow_lt_of_lt⟩ := zpow_lt_iff_lt
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
@[gcongr] alias ⟨_, zpow_lt_of_lt⟩ := zpow_lt_iff_lt
@[gcongr] alias ⟨_, GCongr.zpow_lt_of_lt⟩ := zpow_lt_iff_lt

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It doesn't make sense to me to put this in the GCongr namespace for two reasons:

  1. We don't have much else there, especially not many lemmas.
  2. These declarations existed already and were not in that namespace, so we would have to add an alias and a deprecation, but that seems silly.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I like the idea of moving auxiliary lemmas that exist only because gcongr can't handle Monotone/StrictMono/Iff lemmas to the GCongr namespace.

urkud and others added 2 commits February 10, 2024 15:55
Co-authored-by: Yaël Dillies <yael.dillies@gmail.com>
Copy link
Copy Markdown
Contributor

@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.

maintainer merge

@github-actions
Copy link
Copy Markdown

🚀 Pull request has been placed on the maintainer queue by YaelDillies.

Copy link
Copy Markdown
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.

LGTM, thanks!

bors r+

@ghost ghost added ready-to-merge This PR has been sent to bors. and removed awaiting-review labels Feb 12, 2024
mathlib-bors bot pushed a commit that referenced this pull request Feb 12, 2024
* Add `import Mathlib.Tactic.GCongr.Core`
  to `Algebra/Order/Ring/Lemmas`.
* Move most `@[gcongr]` tags next to the lemmas.

See [Zulip thread](https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/Mathlib.2FTactic.2FGCongr)



Co-authored-by: Jeremy Tan Jie Rui <reddeloostw@gmail.com>
@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors bot commented Feb 12, 2024

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title chore(Tactic/GCongr): move @[gcongr] tags around [Merged by Bors] - chore(Tactic/GCongr): move @[gcongr] tags around Feb 12, 2024
@mathlib-bors mathlib-bors bot closed this Feb 12, 2024
@mathlib-bors mathlib-bors bot deleted the YK-move-gcongr branch February 12, 2024 10:30
dagurtomas pushed a commit that referenced this pull request Mar 22, 2024
* Add `import Mathlib.Tactic.GCongr.Core`
  to `Algebra/Order/Ring/Lemmas`.
* Move most `@[gcongr]` tags next to the lemmas.

See [Zulip thread](https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/Mathlib.2FTactic.2FGCongr)



Co-authored-by: Jeremy Tan Jie Rui <reddeloostw@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-merge This PR has been sent to bors. t-algebra Algebra (groups, rings, fields, etc) t-meta Tactics, attributes or user commands

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants