Skip to content

[Merged by Bors] - feat: ring_exp tactic, subtraction in ring#519

Closed
digama0 wants to merge 6 commits intomasterfrom
ring_exp
Closed

[Merged by Bors] - feat: ring_exp tactic, subtraction in ring#519
digama0 wants to merge 6 commits intomasterfrom
ring_exp

Conversation

@digama0
Copy link
Copy Markdown
Member

@digama0 digama0 commented Oct 29, 2022

Another complete rewrite. This implements one ring to rule them all: it incorporates both ring_exp and ring behaviors, now under the name ring. (ring_exp had some small (1.4x) performance issues that prevented it from being used by default; I'm hoping that those issues are fixed now, and we can revisit later if it becomes an issue.)

Co-authored-by: Scott Morrison <scott@tqft.net>
@kim-em
Copy link
Copy Markdown
Contributor

kim-em commented Nov 1, 2022

What about goals like

example {α} [CommSemiring α] (x y : α) : (x + y)^2 = x^2 + 2 • x * y + y^2 := by ring

which should also count as "in the language of commutative rings"?

Presumably it is easier to first simp away all the s, and then proceed as is, rather than adding an evalSmul branch, etc.

@kim-em
Copy link
Copy Markdown
Contributor

kim-em commented Nov 1, 2022

bors d+

@bors
Copy link
Copy Markdown

bors bot commented Nov 1, 2022

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

@digama0
Copy link
Copy Markdown
Member Author

digama0 commented Nov 1, 2022

bors merge

bors bot pushed a commit that referenced this pull request Nov 1, 2022
Another complete rewrite. This implements one `ring` to rule them all: it incorporates both `ring_exp` and `ring` behaviors, now under the name `ring`. (`ring_exp` had some small (1.4x) performance issues that prevented it from being used by default; I'm hoping that those issues are fixed now, and we can revisit later if it becomes an issue.)

Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
@bors
Copy link
Copy Markdown

bors bot commented Nov 1, 2022

Pull request successfully merged into master.

Build succeeded:

@bors bors bot changed the title feat: ring_exp tactic, subtraction in ring [Merged by Bors] - feat: ring_exp tactic, subtraction in ring Nov 1, 2022
@bors bors bot closed this Nov 1, 2022
@bors bors bot deleted the ring_exp branch November 1, 2022 23:34
bors bot pushed a commit that referenced this pull request Nov 28, 2022
TODO:
* Before merge
- [x] fix a bug in linarith in mathlib3 I just found ...
- [x] depends on: #519 
- [x] style lint
- [x] docs
- [X] move theory stubs to a separate PR, for easier tracking: #733 
- [x] failing to parse the `LinarithConfig` option

* Before or after merge?
- [ ] Implement the `removeNe` preprocessor.
- [ ] Add support for restricting to a single type. How to store a `Type` in `LinarithConfig`?

* After merge
- [ ] Teach `norm_num` to solve `example [LinearOrderedRing α] : (0 : α) < 37 := by norm_num`.
- [ ] Port `zify_proof` (plumbing for `zify`), and add the `natToInt` preprocessor.
  Mostly done now, but see #741 before all the tests will work.
- [ ] Port `cancel_denoms` tactic, and add the `cancelDenoms` preprocessor.
- [ ] Add the `nlinarith` preprocessor and front-end syntax.


Co-authored-by: Mario Carneiro <di.gama@gmail.com>
Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
bors bot pushed a commit that referenced this pull request Nov 28, 2022
TODO:
* Before merge
- [x] fix a bug in linarith in mathlib3 I just found ...
- [x] depends on: #519 
- [x] style lint
- [x] docs
- [X] move theory stubs to a separate PR, for easier tracking: #733 
- [x] failing to parse the `LinarithConfig` option

* Before or after merge?
- [ ] Implement the `removeNe` preprocessor.
- [ ] Add support for restricting to a single type. How to store a `Type` in `LinarithConfig`?

* After merge
- [ ] Teach `norm_num` to solve `example [LinearOrderedRing α] : (0 : α) < 37 := by norm_num`.
- [ ] Port `zify_proof` (plumbing for `zify`), and add the `natToInt` preprocessor.
  Mostly done now, but see #741 before all the tests will work.
- [ ] Port `cancel_denoms` tactic, and add the `cancelDenoms` preprocessor.
- [ ] Add the `nlinarith` preprocessor and front-end syntax.


Co-authored-by: Mario Carneiro <di.gama@gmail.com>
Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
bors bot pushed a commit that referenced this pull request Nov 28, 2022
TODO:
* Before merge
- [x] fix a bug in linarith in mathlib3 I just found ...
- [x] depends on: #519 
- [x] style lint
- [x] docs
- [X] move theory stubs to a separate PR, for easier tracking: #733 
- [x] failing to parse the `LinarithConfig` option

* Before or after merge?
- [ ] Implement the `removeNe` preprocessor.
- [ ] Add support for restricting to a single type. How to store a `Type` in `LinarithConfig`?

* After merge
- [ ] Teach `norm_num` to solve `example [LinearOrderedRing α] : (0 : α) < 37 := by norm_num`.
- [ ] Port `zify_proof` (plumbing for `zify`), and add the `natToInt` preprocessor.
  Mostly done now, but see #741 before all the tests will work.
- [ ] Port `cancel_denoms` tactic, and add the `cancelDenoms` preprocessor.
- [ ] Add the `nlinarith` preprocessor and front-end syntax.


Co-authored-by: Mario Carneiro <di.gama@gmail.com>
Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
mathlib-bors bot pushed a commit that referenced this pull request Nov 6, 2024
Remove the `MonadLift Option MetaM` instance which previously appeared in the middle of the `norm_num` implementation.  This has been there since the port (#519) and my guess is that leaving it there was an oversight -- that @digama0 had intended either to move it earlier or to delete it entirely.

Anyway, this PR takes the easiest path to removing it: de-instance the definition, and invoke it as a local instance in the places where it had been used in Mathlib.

[Zulip](https://leanprover.zulipchat.com/#narrow/channel/239415-metaprogramming-.2F-tactics/topic/Lift.20from.20Option.20to.20MetaM)
TobiasLeichtfried pushed a commit that referenced this pull request Nov 21, 2024
Remove the `MonadLift Option MetaM` instance which previously appeared in the middle of the `norm_num` implementation.  This has been there since the port (#519) and my guess is that leaving it there was an oversight -- that @digama0 had intended either to move it earlier or to delete it entirely.

Anyway, this PR takes the easiest path to removing it: de-instance the definition, and invoke it as a local instance in the places where it had been used in Mathlib.

[Zulip](https://leanprover.zulipchat.com/#narrow/channel/239415-metaprogramming-.2F-tactics/topic/Lift.20from.20Option.20to.20MetaM)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants