intro t ht
havehL : IsCompact (s ∩Icc0 t) := isCompact_Icc.inter_left hs
havehR : IsCompact (s ∩Icc t 1) := isCompact_Icc.inter_left hs
obtain ⟨l,hl,hmax⟩ := hL.exists_isMaxOn ⟨0,h0,le_rfl,ht.1⟩ continuous_id.continuousOn
obtain ⟨u,hu,hmin⟩ := hR.exists_isMinOn ⟨1,h1,ht.2,le_rfl⟩ continuous_id.continuousOn
have hmid := hm l hl.1 u hu.1havehlu : l ≤ u := hl.2.2.trans hu.2.1haveheq : l = u :=byby_cases hmt : (l+u)/2≤ t
· have hh := hmax ⟨hmid,by linarith [hl.2.1,hu.2.1],hmt⟩
change (l+u)/2≤ l at hh
linarith
· have hh := hmin ⟨hmid,by linarith,by linarith [hl.2.2,hu.2.2]⟩
change u ≤ (l+u)/2 at hh
linarith
havehlt : l = t :=by linarith [hl.2.2,hu.2.1]
exact hlt ▸ hl.1
apply convex_iff_add_mem.mpr
intro x hx y hy a b ha hb hab
let f (t : ℝ) := (1-t) • x+t • y
havehf : Continuous f :=by fun_prop
haveh0 : (0:ℝ) ∈ f ⁻¹' s :=by simpa only [mem_preimage,f,sub_zero,one_smul,zero_smul,add_zero] using hx
haveh1 : (1:ℝ) ∈ f ⁻¹' s :=by simpa only [mem_preimage,f,sub_self,zero_smul,one_smul,zero_add] using hy
havehmid : ∀ t ∈ f ⁻¹' s, ∀ u ∈ f ⁻¹' s, (t+u)/2∈ f ⁻¹' s :=by
intro t ht u hu
change f ((t+u)/2) ∈ s
havehe : f ((t+u)/2) = (1/2:ℝ) • (f t+f u) :=by
dsimp only [f]
module
rw [he]
exact hm _ ht _ hu
have hh := closed_midpoints_fill_interval (hs.preimage hf) h0 h1 hmid
(show b ∈Icc (0:ℝ) 1from ⟨hb,by linarith⟩)
change (1-b) • x+b • y ∈ s at hh
rwa [show1-b=a by linarith] at hh