Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
feat: Define linear programs #7386
base: master
Are you sure you want to change the base?
feat: Define linear programs #7386
Changes from 34 commits
8352c37
09eb773
0832139
cc01f1a
f23e30e
bfffc93
e927639
8ad85e1
3734234
02ee2bd
04fb906
311abd9
ed5ca5e
85c2a02
f6b53ac
e5944c5
155d63c
c3a4529
af45efb
f7c80bc
fc1e7c5
00da03e
25d9446
247b7d4
7e18396
b3b95a0
d6b731b
5a04ae0
a6bb9fe
432c597
5d2eba8
da8146f
0500287
72a8028
acb1869
8d9feeb
ca6899c
3f08fde
5560272
0f8071d
0b5163b
45bbb4b
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am skeptical about making this a
List
rather than aSet
. One is not actually going to do computation with this type: any meaningful algorithm will require a much more complicated data structure.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I remember Martin expressing some objections to situations with infinitely-many constraints, as those tend not to appear in linear programming. That would rule out
Set
, and prohibiting duplicates or permutations isn't particularly interesting since the constraints can still be redundant.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Happy to hear Martin's take on this, or for someone to click "resolve" as is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If finiteness is really the thing of interest though, you could argue that what we actually want is the type of convex sets built from finitely many half planes; either non-constructively via an existential, or constructively via a Finset and a proof that removing any one element increases the size of the feasible set.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you induct on Finsets?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right. Just one comment (not contradicting to your suggestion); all point on the sphere would be vertices.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this claim necessarily holds merit; finsets are not allowed to hold duplicates, and have a proof obligation to this end; but that doesn't stop you from writing
{1, 1, 2, 2}
. You only have to deal with the proof obligation if you callFinset.mk
directly.Arguably this "Finset of non-redundant affine constraints" object deserves it's own
ConvexPolytope
object.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Though another reasonable approach might be to discard the proof obligation and work with the quotient of the type by equality of feasible spaces
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A redundant LP need not have identical constraints. It just needs to be a linear combination of other constraints. I am not sure I see the value in doing, let's say Gaussian elimination on constraints, to extract independent ones makes sense every time an LP is defined. In computer science and also possibly OR, redundant constraints are a fact of life that have to be dealt with algorithmically, and so one often constructs what Mathlib devs might call API lemmas to deal with these cases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I think about it, having infinitely many conditions is less weird than having infinitely many variables. Given that Mathlib maintainers want the variable space to be general, we should also make the condition space general. Defining conditions as a list (or a multiset, or a finite set) of any type will be bad for LP duality, unless we change the type of
P
along with it.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't particularly like the design, with constraints and objective bundled together. The feasibility of constraints makes no mention of the objective, and the design should allow talking about this without an objective. Please separate these.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you be more happy with the following definitions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not two structures, one extending the other?
Presumably for the "just the constraints" version, you then want definitions
satisfiable_at
andsatisfiable
, with lots of lemmas about how these interact with list operations (e.g. adding/erasing etc constraints).