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(algebra/module): define ordered semimodules and generalize convexity of functions #3728

Closed
wants to merge 15 commits into from

Conversation

dupuisf
Copy link
Collaborator

@dupuisf dupuisf commented Aug 9, 2020


This defines a new typeclass for ordered semimodules, in which both the semiring and the semimodule are ordered, and where the scalar product respects the order relations. This is then used to generalize the definition of convexity for functions, enabling (in the long term) to define operator convexity.

I also plan to connect this to convex cones, which define an order on the vector space and vice-versa.

@dupuisf dupuisf added the awaiting-review The author would like community review of the PR label Aug 9, 2020
dupuisf and others added 2 commits August 10, 2020 12:53
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
@dupuisf
Copy link
Collaborator Author

dupuisf commented Aug 10, 2020

Hmm, even with the implicit a b c, it still wants the λ _ _ _...

@dupuisf
Copy link
Collaborator Author

dupuisf commented Aug 10, 2020

No problem -- thanks a lot for the suggestions!

Comment on lines +591 to 593
lemma convex_on.le_on_segment {f : E → ℝ} (hf : convex_on s f) {x y z : E}
(hx : x ∈ s) (hy : y ∈ s) (hz : z ∈ [x, y]) :
f z ≤ max (f x) (f y) :=
Copy link
Member

Choose a reason for hiding this comment

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

Can this not be generalized to β because β has no max?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah. The other option would be to generalize it to a β with a linear order (and a semimodule with ℝ as the ring), so basically pretty much just ℝ...

Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe add a doc-string to this effect?

Copy link
Member

Choose a reason for hiding this comment

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

The other option would be to generalize it to a β with a linear order (and a semimodule with ℝ as the ring), so basically pretty much just ℝ...

Hmm, what if I defined a lexicographic ordering on pairs β = (ℝ, ℝ), and gave them the obvious semimodule structure.

This lemma would then hold even though β is not , right, meaning we could generalize as something like the following?

Suggested change
lemma convex_on.le_on_segment {f : E → } (hf : convex_on s f) {x y z : E}
(hx : x ∈ s) (hy : y ∈ s) (hz : z ∈ [x, y]) :
f z ≤ max (f x) (f y) :=
lemma convex_on.le_on_segment [linear_order β] {f : E → β} (hf : convex_on s f) {x y z : E}
(hx : x ∈ s) (hy : y ∈ s) (hz : z ∈ [x, y]) :
f z ≤ max (f x) (f y) :=

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Oops -- sorry @eric-wieser, I think you must have added this comment at the same time as I confirmed the merger. I think it's probably simpler now to keep this in mind for the next PR on the subject: I'll be defining concave_on next, so I'll have to make another pass on these lemmas anyway.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, not a big deal - its not like you actively removed a generalization, you just missed one that could be added :)

@github-actions github-actions bot added the merge-conflict Please `git merge origin/master` then a bot will remove this label. label Aug 15, 2020
@github-actions github-actions bot removed the merge-conflict Please `git merge origin/master` then a bot will remove this label. label Aug 15, 2020
@semorrison
Copy link
Collaborator

Otherwise, LGTM.

@semorrison
Copy link
Collaborator

bors d+

@bors
Copy link

bors bot commented Aug 16, 2020

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

@semorrison semorrison added delegated The PR author may merge after reviewing final suggestions. and removed awaiting-review The author would like community review of the PR labels Aug 16, 2020
@dupuisf
Copy link
Collaborator Author

dupuisf commented Aug 17, 2020

bors r+

bors bot pushed a commit that referenced this pull request Aug 17, 2020
…xity of functions (#3728)

Co-authored-by: Frédéric Dupuis <31101893+dupuisf@users.noreply.github.com>
@bors
Copy link

bors bot commented Aug 17, 2020

Pull request successfully merged into master.

Build succeeded:

@bors bors bot changed the title feat(algebra/module): define ordered semimodules and generalize convexity of functions [Merged by Bors] - feat(algebra/module): define ordered semimodules and generalize convexity of functions Aug 17, 2020
@bors bors bot closed this Aug 17, 2020
@bors bors bot deleted the generalized_convex_on branch August 17, 2020 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
delegated The PR author may merge after reviewing final suggestions.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants