apply LipschitzOnWith.of_dist_le_mul
intro x hx y hy
exact le_of_tendsto ((hl x hx).dist (hl y hy))
(Eventually.of_forall fun j => (hs j).dist_le_mul x hx y hy)
lemmamcShane_bddBelow {s : SetE} (hs : s.Nonempty) {K : ℝ≥0} {f : E→ℝ}
(hf : LipschitzOnWithK f s) (x : E) :
BddBelow (range fun z : s => f z + K * dist x z) :=by
proof · 8
lines
obtain ⟨z,hz⟩ := hs
refine ⟨f z - K * dist x z, ?_⟩
rintro w ⟨t,rfl⟩
dsimp
rw [_root_.sub_le_iff_le_add, add_assoc, ← mul_add, add_comm (dist x t)]
calc
f z ≤ f t + K * dist z t := hf.le_add_mul hz t.2
_ ≤ f t + K * (dist x z + dist x t) :=by gcongr; apply dist_triangle_left
lemmamcShane_eqOn {s : SetE} (hs : s.Nonempty) {K : ℝ≥0} {f : E→ℝ}
(hf : LipschitzOnWithK f s) : EqOn f (mcShane s K f) s :=by
proof · 5
lines
let : Nonempty s := hs.to_subtype
intro x hx
refine le_antisymm (le_ciInf fun y => hf.le_add_mul hx y.2) ?_
simpa only [mcShane, add_zero, Subtype.coe_mk, mul_zero, dist_self] using
ciInf_le (mcShane_bddBelow hs hf x) ⟨x,hx⟩
lemmamcShane_lipschitz {s : SetE} (hs : s.Nonempty) {K : ℝ≥0} {f : E→ℝ}
(hf : LipschitzOnWithK f s) : LipschitzWithK (mcShane s K f) :=by
proof · 12
lines
let : Nonempty s := hs.to_subtype
apply LipschitzWith.of_le_add_mul
intro x y
rw [← _root_.sub_le_iff_le_add]
refine le_ciInf fun z => ?_
rw [_root_.sub_le_iff_le_add]
calc
mcShane s K f x ≤ f z + K * dist x z := ciInf_le (mcShane_bddBelow hs hf x) _
_ ≤ f z + K * dist y z + K * dist x y :=by
rw [add_assoc, ← mul_add, add_comm (dist y z)]
gcongr
apply dist_triangle
lemmamcShane_dist_le {s : SetE} (hs : s.Nonempty) {K : ℝ≥0} {f g : E→ℝ}
(hf : LipschitzOnWithK f s) (hg : LipschitzOnWithK g s)
{ε : ℝ} (hε : ∀ x ∈ s, dist (f x) (g x) ≤ ε) (x : E) :
dist (mcShane s K f x) (mcShane s K g x) ≤ ε :=by
proof · 13
lines
let : Nonempty s := hs.to_subtype
have aux {f g : E→ℝ} (hf : LipschitzOnWithK f s)
(h : ∀ z ∈ s, f z ≤ g z + ε) :
mcShane s K f x - ε ≤ mcShane s K g x :=by
apply le_ciInf
intro z
haveH:= ciInf_le (mcShane_bddBelow hs hf x) z
change mcShane s K f x ≤ f z + K * dist x z at H
linarith [h z z.2]
rw [Real.dist_eq, abs_le]
haveH₁:= aux (g := g) hf (fun z hz =>byhaveH:= (abs_le.mp (hε z hz)).2; linarith)
haveH₂:= aux (g := f) hg (fun z hz =>byhaveH:= (abs_le.mp (hε z hz)).1; linarith)
constructor <;> linarith