-
Notifications
You must be signed in to change notification settings - Fork 49
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
Convex exp #873
Convex exp #873
Conversation
theories/convex.v
Outdated
Definition derivable_interval {R : numFieldType} (f : R -> R) (a b : R) := | ||
forall x, x \in `[a, b] -> derivable f x 1. |
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.
[NB: review comment by @zstone1 copied verbatim from PR #794]
This definition misbehaves at the endpoints. In particular, it requires f
to be be "differentiable from the left at a
". That makes this definition rely on values of f
outside [a,b]
. One big consequence is characteristic functions like if x \in `[a,b] then 1 else 0
fails this definition, as its not derivable at a
or b
. For what it's worth, I had an analogous issue with realfun.v
, see #752 for how I addressed it there. You'll need something slightly different here, though.
I've seen textbooks take these approaches:
- Demanding "continuity up the endpoints" is one approach
forall x, x \in `]a, b[ -> derivable f x 1.
/\
cvg (at_right a f^`()) /\ cvg (at_right b f^`())
or some variation of this. However, this implies some continuity of the derivative, which is maybe not ideal.
2. We could change the derivative to use a different topology. One way to do that is add an analog to the {within `[a,b], continuous f}
notation of {within `[a,b], derivable f}
. This would take limits only on the subspace topology.
3. Similarly, but specialized to working in R
, it should be fine to define it like
forall x, x \in `]a, b[ -> derivable f x 1
/\
"differentiable from the right at b" /\ "differentiable from the left at a"
For some sensible notion of "left" and "right" derivative.
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.
1. Demanding "continuity up the endpoints" is one approach
forall x, x \in `]a, b[ -> derivable f x 1. /\ cvg (at_right a f^`()) /\ cvg (at_right b f^`())
or some variation of this. However, this implies some continuity of the derivative, which is maybe not ideal.
The last two commits implement this solution.
(Hopefully, we think that you wrote cvg (at_right a f^`())
but actually meant cvg (at_right a f)
.)
Is it in the right direction? @zstone1
Section twice_derivable_convex. | ||
Context {R : realType}. | ||
Variables (f : R -> R^o) (a b : R^o). |
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.
[NB: review comment by @zstone1 copied verbatim from PR #794 ]
Where do we need the assumption that the range of f
is R
? If it's painless, generalizing to a vector space would be quite helpful for me. I'll need some stuff about convexity in both R
and R^n
for my work on space-filling curves, so I'm happy to have these results either way.
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.
Where do we need the assumption that the range of f is R?
We at least need to be able to compare to 0
but I maybe need to spend more time.
[NB: review comment by @zstone1 copied verbatim from PR https://github.com//pull/794 ] Nice results. I've made comments about a couple generalizations, one regarding annoying endpoint issues, the other regarding generalizing to vector space ranges. I care more about the endpoints one mostly because it's much harder to fix later. Happy to work with you on that if that'd be helpful. |
577b4ba
to
a540fbb
Compare
On top of being helpful for the exponential function, definitions about convexity are also necessary for the formalization of Hoelder's inequality and the special case of Cauchy Schwarz's inequality from PR #790. |
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.
Much improved from before.
- It looks like all the endpoint conditions all make sense. It should now work correctly for the indicator function on
[0,1]
- I generalized a few things to
topologicalType
. - Happy to see the generalization to
convex spaces
.
Other than the small generalizations, looks good to me.
Many thanks for the review! |
787c833
to
d40b4ec
Compare
Co-authored-by: Reynald Affeldt <reynald.affeldt@aist.go.jp>
Co-authored-by: Alessandro Bruni <alessandro.bruni@gmail.com> Co-authored-by: Takafumi Saikawa <tscompor@gmail.com>
Co-authored-by: zstone1 <zstonex@gmail.com>
Co-authored-by: zstone1 <zstonex@gmail.com>
Co-authored-by: zstone1 <zstonex@gmail.com>
d40b4ec
to
4ac9f43
Compare
* Introduce convex - introduce convex spaces - proof of second_derivative_convex_pt - using `{i01 R}` - expR convex Co-authored-by: Reynald Affeldt <reynald.affeldt@aist.go.jp> Co-authored-by: Alessandro Bruni <alessandro.bruni@gmail.com> Co-authored-by: Takafumi Saikawa <tscompor@gmail.com> Co-authored-by: zstone1 <zstonex@gmail.com> Co-authored-by: Yoshihiro Imai <y.imai@aist.go.jp>
Lemma convex_expR (t : {i01 R}) (a b : R^o) : a <= b -> | ||
expR (a <| t |> b) <= (expR a : R^o) <| t |> (expR b : R^o). |
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.
@affeldt-aist the multiplications of such lemmas call for a notion of convex function (or convex function on a given domain)
(* derivable_oo_continuous_bnd f x y == f is derivable on `]x, y[ and *) | ||
(* continuous up to the boundary *) |
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.
Unfortunately {in `]x, y[, forall x, derivable f x 1}
does not mean f is derivable on `]x, y[
🤷
Motivation for this change
This is a continuation of PR #794 (I have duplicated the PR because it looks like I cannot push commits to it).
On top of PR #794, it introduces convex spaces and use the type
{i01 R}
from the PR #869.This PR introduce convexs spaces, show that
lmodType
form instances, and use them to show that a function with a non-negative second derivative is convex (like the exponential function @hoheinzollern).closes #794
Things done/to do
CHANGELOG_UNRELEASED.md
(do not edit former entries, only append new ones, be careful:
merge and rebase have a tendency to mess up
CHANGELOG_UNRELEASED.md
)Automatic note to reviewers
Read this Checklist and put a milestone if possible.