Skip to content

Commit

Permalink
eric's request
Browse files Browse the repository at this point in the history
  • Loading branch information
hrmacbeth committed May 17, 2023
1 parent b75356a commit 2698a4d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/analysis/convex/slope.lean
Expand Up @@ -219,12 +219,12 @@ lemma strict_concave_on_iff_slope_strict_anti_adjacent :

lemma convex_on.secant_mono_aux1 (hf : convex_on 𝕜 s f)
{x y z : 𝕜} (hx : x ∈ s) (hz : z ∈ s) (hxy : x < y) (hyz : y < z) :
f y * (z - x) ≤ (z - y) * f x + (y - x) * f z :=
(z - x) * f y ≤ (z - y) * f x + (y - x) * f z :=
begin
have hxy' : 0 < y - x := by linarith,
have hyz' : 0 < z - y := by linarith,
have hxz' : 0 < z - x := by linarith,
rw ← le_div_iff hxz',
rw ← le_div_iff' hxz',
have ha : 0 ≤ (z - y) / (z - x) := by positivity,
have hb : 0 ≤ (y - x) / (z - x) := by positivity,
calc f y = f ((z - y) / (z - x) * x + (y - x) / (z - x) * z) : _
Expand Down Expand Up @@ -276,12 +276,12 @@ end

lemma strict_convex_on.secant_strict_mono_aux1 (hf : strict_convex_on 𝕜 s f)
{x y z : 𝕜} (hx : x ∈ s) (hz : z ∈ s) (hxy : x < y) (hyz : y < z) :
f y * (z - x) < (z - y) * f x + (y - x) * f z :=
(z - x) * f y < (z - y) * f x + (y - x) * f z :=
begin
have hxy' : 0 < y - x := by linarith,
have hyz' : 0 < z - y := by linarith,
have hxz' : 0 < z - x := by linarith,
rw ← lt_div_iff hxz',
rw ← lt_div_iff' hxz',
have ha : 0 < (z - y) / (z - x) := by positivity,
have hb : 0 < (y - x) / (z - x) := by positivity,
calc f y = f ((z - y) / (z - x) * x + (y - x) / (z - x) * z) : _
Expand Down

1 comment on commit 2698a4d

@eric-wieser
Copy link
Member

Choose a reason for hiding this comment

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

Nice, I'm glad this didn't need a ring after all!

Please sign in to comment.