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: add exponentiation option back to linear_combination #7789

Closed
wants to merge 4 commits into from

Conversation

robertylewis
Copy link
Member

mathlib3#15428 added an exponent option to linear_combination. The idea is that linear_combination (exp := 2) ... will take a linear combination of hypotheses adding up to the square of the goal. This is only mildly useful on its own, but it's a very useful certificate syntax for mathlib3#15425.


This was merged in mathlib3 but didn't make the port.

I noticed when implementing this that the config object in linear_combination is completely unused, so I deleted it, and followed the new syntax for (norm := ...). The current implementation is sensitive to the order of (norm := ...) (exp := ...). I think it will be very uncommon to use these two features together, so it's not a big deal, but the fix would be to return to using a config object.

cc @digama0

Open in Gitpod

@digama0
Copy link
Member

digama0 commented Oct 20, 2023

bors r+

@github-actions github-actions bot added ready-to-merge This PR has been sent to bors. and removed awaiting-review labels Oct 20, 2023
bors bot pushed a commit that referenced this pull request Oct 20, 2023
[mathlib3#15428](leanprover-community/mathlib3#15428) added an exponent option to `linear_combination`. The idea is that `linear_combination (exp := 2) ...` will take a linear combination of hypotheses adding up to the *square* of the goal. This is only mildly useful on its own, but it's a very useful certificate syntax for [mathlib3#15425](leanprover-community/mathlib3#15425).



Co-authored-by: Rob Lewis <rob.y.lewis@gmail.com>
@bors
Copy link

bors bot commented Oct 20, 2023

Pull request successfully merged into master.

Build succeeded!

The publicly hosted instance of bors-ng is deprecated and will go away soon.

If you want to self-host your own instance, instructions are here.
For more help, visit the forum.

If you want to switch to GitHub's built-in merge queue, visit their help page.

@bors bors bot changed the title feat: add exponentiation option back to linear_combination [Merged by Bors] - feat: add exponentiation option back to linear_combination Oct 20, 2023
@bors bors bot closed this Oct 20, 2023
@bors bors bot deleted the lc-exponent2 branch October 20, 2023 07:48
mathlib-bors bot pushed a commit that referenced this pull request Nov 7, 2023
)

In @hrmacbeth 's tutorial on `polyrith`, there were examples of problems that it could almost solve, but failed. The goal was not expressible as a linear combination of the hypotheses but a power of the goal was. 

```lean
example (x y z : ℚ) (h : x = y) (h2 : x * y = 0) : x + y*z = 0 :=
sorry
```

Mathematically, `x+y*z` is in the radical of the ideal generated by `x-y, x*y`. There's a "standard trick" for testing membership in the radical without a search for the proper exponent: see e.g. section 2.2 of [arxiv.org/pdf/1007.3615.pdf](https://arxiv.org/pdf/1007.3615.pdf) or 4.2 Prop 8 of Cox, Little, O'Shea.

This PR implements the trick in the Sage call made by `polyrith`. When the power returned is `n > 1`, we use `linear_combination (exp := n)` to check the certificate (#7789 ).

The `polyrith` test infrastructure still needs to be ported from mathlib3. All tests in the test file succeed when they are uncommented. A future PR will restore the old test suite.


Co-authored-by: Rob Lewis <rob.y.lewis@gmail.com>
Co-authored-by: Mario Carneiro <di.gama@gmail.com>
grunweg pushed a commit that referenced this pull request Dec 15, 2023
)

In @hrmacbeth 's tutorial on `polyrith`, there were examples of problems that it could almost solve, but failed. The goal was not expressible as a linear combination of the hypotheses but a power of the goal was. 

```lean
example (x y z : ℚ) (h : x = y) (h2 : x * y = 0) : x + y*z = 0 :=
sorry
```

Mathematically, `x+y*z` is in the radical of the ideal generated by `x-y, x*y`. There's a "standard trick" for testing membership in the radical without a search for the proper exponent: see e.g. section 2.2 of [arxiv.org/pdf/1007.3615.pdf](https://arxiv.org/pdf/1007.3615.pdf) or 4.2 Prop 8 of Cox, Little, O'Shea.

This PR implements the trick in the Sage call made by `polyrith`. When the power returned is `n > 1`, we use `linear_combination (exp := n)` to check the certificate (#7789 ).

The `polyrith` test infrastructure still needs to be ported from mathlib3. All tests in the test file succeed when they are uncommented. A future PR will restore the old test suite.


Co-authored-by: Rob Lewis <rob.y.lewis@gmail.com>
Co-authored-by: Mario Carneiro <di.gama@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-meta Tactics, attributes or user commands
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants