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: Bernoulli's inequality for 0 < p < 1
#10982
Conversation
!bench |
Here are the benchmark results for commit 5901374. Benchmark Metric Change
========================================================================
+ ~Mathlib.Analysis.Convex.SpecificFunctions.Basic instructions -42.3% |
Not bad: the file now takes about half as long as before, despite having roughly twice as many theorems! Thanks for taking on this job. I'll try to find time to proofread it for style later today, then it should be good to go. |
Umm, I just spotted something I should have realised much earlier. There is a file
So we are just reinventing the wheel here. Perhaps the best way forward is the following. The Bernoulli inequality for p < 1 is a statement of interest in its own right, so I suggest keeping the proof you've written for that. But it might be best to replace your proof of |
The proof of lemma strictConcaveOn_rpow {p : ℝ} (hp₀ : 0 < p) (hp₁ : p < 1) :
StrictConcaveOn ℝ (Set.Ici 0) fun x : ℝ ↦ x ^ p := by
refine ⟨convex_Ici _, fun x hx y hy hxy a b ha hb hab => ?_⟩
let x' : ℝ≥0 := ⟨x, hx⟩
let y' : ℝ≥0 := ⟨y, hy⟩
let a' : ℝ≥0 := ⟨a, by positivity⟩
let b' : ℝ≥0 := ⟨b, by positivity⟩
have hx' : (fun z => z ^ p) x = (fun z => z ^ p) x' := rfl
have hy' : (fun z => z ^ p) y = (fun z => z ^ p) y' := rfl
have hxy' : x' ≠ y' := Subtype.ne_of_val_ne hxy
have hab' : a' + b' = 1 := by ext; simp [a', b', hab]
rw [hx', hy']
exact (NNReal.strictConcaveOn_rpow hp₀ hp₁).2 (Set.mem_univ x') (Set.mem_univ y')
hxy' (mod_cast ha) (mod_cast hb) hab' I think the better approach is to move the currently un-namespaced |
If this already exists in the other file, then there is even less for this PR to do.
The reasons for not doing that are very clearly explained in the existing code. The file |
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.
LGTM. Please update the title of this PR to match the content – when that's done I'll ping the maintainers.
x ^ p
when 0 < p < 1
0 < p < 1
It is done now? |
I added a little more explanation to the header string. Code LGTM. maintainer merge |
🚀 Pull request has been placed on the maintainer queue by loefflerd. |
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.
Thanks 🎉
bors merge
Pull request successfully merged into master. Build succeeded: |
0 < p < 1
0 < p < 1
Also substantially speed up some existing proofs in the
p < 1
case.