-- Mathlib/Analysis/Convex/Contractible.lean
theorem StarConvex.contractibleSpace (h : StarConvex ℝ x s) (hne : s.Nonempty) :
    ContractibleSpace s

Proof state:
case refine_3
E : Type u_1
inst✝⁴ : AddCommGroup E
inst✝³ : Module ℝ E
inst✝² : TopologicalSpace E
inst✝¹ : ContinuousAdd E
inst✝ : ContinuousSMul ℝ E
s : Set E
x✝ : E
h : StarConvex ℝ x✝ s
hne : s.Nonempty
x : ↑s
⊢ { toFun := fun p => ⟨↑p.1 • x✝ + (1 - ↑p.1) • ↑p.2, ⋯⟩, continuous_toFun := ⋯ }.toFun (0, x) = (ContinuousMap.id ↑s) x

Tactic:
ext1

Result:
case refine_3.a
E : Type u_1
inst✝⁴ : AddCommGroup E
inst✝³ : Module ℝ E
inst✝² : TopologicalSpace E
inst✝¹ : ContinuousAdd E
inst✝ : ContinuousSMul ℝ E
s : Set E
x✝ : E
h : StarConvex ℝ x✝ s
hne : s.Nonempty
x : ↑s
⊢ ↑({ toFun := fun p => ⟨↑p.1 • x✝ + (1 - ↑p.1) • ↑p.2, ⋯⟩, continuous_toFun := ⋯ }.toFun (0, x)) =
    ↑((ContinuousMap.id ↑s) x)

Proof state:
case refine_1
E : Type u_1
inst✝⁴ : AddCommGroup E
inst✝³ : Module ℝ E
inst✝² : TopologicalSpace E
inst✝¹ : ContinuousAdd E
inst✝ : ContinuousSMul ℝ E
s : Set E
x : E
h : StarConvex ℝ x s
hne : s.Nonempty
p : ↑unitInterval × ↑s
⊢ ↑p.1 • x + (1 - ↑p.1) • ↑p.2 ∈ s

Tactic:
exact h p.2.2 p.1.2.1 (sub_nonneg.2 p.1.2.2) (add_sub_cancel _ _)

Result:
no goals

Proof state:
E : Type u_1
inst✝⁴ : AddCommGroup E
inst✝³ : Module ℝ E
inst✝² : TopologicalSpace E
inst✝¹ : ContinuousAdd E
inst✝ : ContinuousSMul ℝ E
s : Set E
x : E
h : StarConvex ℝ x s
hne : s.Nonempty
⊢ ContractibleSpace ↑s

Tactic:
refine
  (contractible_iff_id_nullhomotopic s).2
    ⟨⟨x, h.mem hne⟩,
      ⟨⟨⟨fun p => ⟨p.1.1 • x + (1 - p.1.1) • (p.2 : E), ?_⟩, ?_⟩, fun x => ?_, fun x => ?_⟩⟩⟩

Result:
case refine_1
E : Type u_1
inst✝⁴ : AddCommGroup E
inst✝³ : Module ℝ E
inst✝² : TopologicalSpace E
inst✝¹ : ContinuousAdd E
inst✝ : ContinuousSMul ℝ E
s : Set E
x : E
h : StarConvex ℝ x s
hne : s.Nonempty
p : ↑unitInterval × ↑s
⊢ ↑p.1 • x + (1 - ↑p.1) • ↑p.2 ∈ s

case refine_2
E : Type u_1
inst✝⁴ : AddCommGroup E
inst✝³ : Module ℝ E
inst✝² : TopologicalSpace E
inst✝¹ : ContinuousAdd E
inst✝ : ContinuousSMul ℝ E
s : Set E
x : E
h : StarConvex ℝ x s
hne : s.Nonempty
⊢ Continuous fun p => ⟨↑p.1 • x + (1 - ↑p.1) • ↑p.2, ⋯⟩

case refine_3
E : Type u_1
inst✝⁴ : AddCommGroup E
inst✝³ : Module ℝ E
inst✝² : TopologicalSpace E
inst✝¹ : ContinuousAdd E
inst✝ : ContinuousSMul ℝ E
s : Set E
x✝ : E
h : StarConvex ℝ x✝ s
hne : s.Nonempty
x : ↑s
⊢ { toFun := fun p => ⟨↑p.1 • x✝ + (1 - ↑p.1) • ↑p.2, ⋯⟩, continuous_toFun := ?refine_2 }.toFun (0, x) =
    (ContinuousMap.id ↑s) x

case refine_4
E : Type u_1
inst✝⁴ : AddCommGroup E
inst✝³ : Module ℝ E
inst✝² : TopologicalSpace E
inst✝¹ : ContinuousAdd E
inst✝ : ContinuousSMul ℝ E
s : Set E
x✝ : E
h : StarConvex ℝ x✝ s
hne : s.Nonempty
x : ↑s
⊢ { toFun := fun p => ⟨↑p.1 • x✝ + (1 - ↑p.1) • ↑p.2, ⋯⟩, continuous_toFun := ?refine_2 }.toFun (1, x) =
    (ContinuousMap.const ↑s ⟨x✝, ⋯⟩) x

Proof state:
case refine_4.a
E : Type u_1
inst✝⁴ : AddCommGroup E
inst✝³ : Module ℝ E
inst✝² : TopologicalSpace E
inst✝¹ : ContinuousAdd E
inst✝ : ContinuousSMul ℝ E
s : Set E
x✝ : E
h : StarConvex ℝ x✝ s
hne : s.Nonempty
x : ↑s
⊢ ↑({ toFun := fun p => ⟨↑p.1 • x✝ + (1 - ↑p.1) • ↑p.2, ⋯⟩, continuous_toFun := ⋯ }.toFun (1, x)) =
    ↑((ContinuousMap.const ↑s ⟨x✝, ⋯⟩) x)

Tactic:
simp

Result:
no goals

Proof state:
case refine_2
E : Type u_1
inst✝⁴ : AddCommGroup E
inst✝³ : Module ℝ E
inst✝² : TopologicalSpace E
inst✝¹ : ContinuousAdd E
inst✝ : ContinuousSMul ℝ E
s : Set E
x : E
h : StarConvex ℝ x s
hne : s.Nonempty
⊢ Continuous fun p => ⟨↑p.1 • x + (1 - ↑p.1) • ↑p.2, ⋯⟩

Tactic:
exact
  ((continuous_subtype_val.fst'.smul continuous_const).add
        ((continuous_const.sub continuous_subtype_val.fst').smul
          continuous_subtype_val.snd')).subtype_mk
    _

Result:
no goals

Proof state:
case refine_3.a
E : Type u_1
inst✝⁴ : AddCommGroup E
inst✝³ : Module ℝ E
inst✝² : TopologicalSpace E
inst✝¹ : ContinuousAdd E
inst✝ : ContinuousSMul ℝ E
s : Set E
x✝ : E
h : StarConvex ℝ x✝ s
hne : s.Nonempty
x : ↑s
⊢ ↑({ toFun := fun p => ⟨↑p.1 • x✝ + (1 - ↑p.1) • ↑p.2, ⋯⟩, continuous_toFun := ⋯ }.toFun (0, x)) =
    ↑((ContinuousMap.id ↑s) x)

Tactic:
simp

Result:
no goals

Proof state:
case refine_4
E : Type u_1
inst✝⁴ : AddCommGroup E
inst✝³ : Module ℝ E
inst✝² : TopologicalSpace E
inst✝¹ : ContinuousAdd E
inst✝ : ContinuousSMul ℝ E
s : Set E
x✝ : E
h : StarConvex ℝ x✝ s
hne : s.Nonempty
x : ↑s
⊢ { toFun := fun p => ⟨↑p.1 • x✝ + (1 - ↑p.1) • ↑p.2, ⋯⟩, continuous_toFun := ⋯ }.toFun (1, x) =
    (ContinuousMap.const ↑s ⟨x✝, ⋯⟩) x

Tactic:
ext1

Result:
case refine_4.a
E : Type u_1
inst✝⁴ : AddCommGroup E
inst✝³ : Module ℝ E
inst✝² : TopologicalSpace E
inst✝¹ : ContinuousAdd E
inst✝ : ContinuousSMul ℝ E
s : Set E
x✝ : E
h : StarConvex ℝ x✝ s
hne : s.Nonempty
x : ↑s
⊢ ↑({ toFun := fun p => ⟨↑p.1 • x✝ + (1 - ↑p.1) • ↑p.2, ⋯⟩, continuous_toFun := ⋯ }.toFun (1, x)) =
    ↑((ContinuousMap.const ↑s ⟨x✝, ⋯⟩) x)