-- Mathlib/Analysis/Convex/Extrema.lean
theorem IsMinOn.of_isLocalMinOn_of_convexOn {f : E → β} {a : E} (a_in_s : a ∈ s)
    (h_localmin : IsLocalMinOn f s a) (h_conv : ConvexOn ℝ s f) : IsMinOn f s a

Proof state:
E : Type u_1
β : Type u_2
inst✝⁷ : AddCommGroup E
inst✝⁶ : TopologicalSpace E
inst✝⁵ : Module ℝ E
inst✝⁴ : IsTopologicalAddGroup E
inst✝³ : ContinuousSMul ℝ E
inst✝² : OrderedAddCommGroup β
inst✝¹ : Module ℝ β
inst✝ : OrderedSMul ℝ β
s : Set E
f : E → β
a : E
a_in_s : a ∈ s
h_localmin : IsLocalMinOn f s a
h_conv : ConvexOn ℝ s f
x : E
x_in_s : x ∈ s
g : ℝ →ᵃ[ℝ] E := AffineMap.lineMap a x
⊢ x ∈ {x | (fun x => f a ≤ f x) x}

Tactic:
have hg0 : g 0 = a := AffineMap.lineMap_apply_zero a x

Result:
E : Type u_1
β : Type u_2
inst✝⁷ : AddCommGroup E
inst✝⁶ : TopologicalSpace E
inst✝⁵ : Module ℝ E
inst✝⁴ : IsTopologicalAddGroup E
inst✝³ : ContinuousSMul ℝ E
inst✝² : OrderedAddCommGroup β
inst✝¹ : Module ℝ β
inst✝ : OrderedSMul ℝ β
s : Set E
f : E → β
a : E
a_in_s : a ∈ s
h_localmin : IsLocalMinOn f s a
h_conv : ConvexOn ℝ s f
x : E
x_in_s : x ∈ s
g : ℝ →ᵃ[ℝ] E := AffineMap.lineMap a x
hg0 : g 0 = a
⊢ x ∈ {x | (fun x => f a ≤ f x) x}

Proof state:
E : Type u_1
β : Type u_2
inst✝⁷ : AddCommGroup E
inst✝⁶ : TopologicalSpace E
inst✝⁵ : Module ℝ E
inst✝⁴ : IsTopologicalAddGroup E
inst✝³ : ContinuousSMul ℝ E
inst✝² : OrderedAddCommGroup β
inst✝¹ : Module ℝ β
inst✝ : OrderedSMul ℝ β
s : Set E
f : E → β
a : E
a_in_s : a ∈ s
h_conv : ConvexOn ℝ s f
x : E
x_in_s : x ∈ s
g : ℝ →ᵃ[ℝ] E := AffineMap.lineMap a x
h_localmin : IsLocalMinOn f s (g 0)
hg0 : g 0 = a
hg1 : g 1 = x
hgc : Continuous ⇑g
h_maps : MapsTo (⇑g) (Icc 0 1) s
⊢ IsLocalMinOn (f ∘ ⇑g) (Icc 0 1) 0

Tactic:
exact h_localmin.comp_continuousOn h_maps hgc.continuousOn (left_mem_Icc.2 zero_le_one)

Result:
no goals

Proof state:
E : Type u_1
β : Type u_2
inst✝⁷ : AddCommGroup E
inst✝⁶ : TopologicalSpace E
inst✝⁵ : Module ℝ E
inst✝⁴ : IsTopologicalAddGroup E
inst✝³ : ContinuousSMul ℝ E
inst✝² : OrderedAddCommGroup β
inst✝¹ : Module ℝ β
inst✝ : OrderedSMul ℝ β
s : Set E
f : E → β
a : E
a_in_s : a ∈ s
h_localmin : IsLocalMinOn f s a
h_conv : ConvexOn ℝ s f
x : E
x_in_s : x ∈ s
g : ℝ →ᵃ[ℝ] E := AffineMap.lineMap a x
hg0 : g 0 = a
hg1 : g 1 = x
hgc : Continuous ⇑g
h_maps : MapsTo (⇑g) (Icc 0 1) s
fg_local_min_on : IsLocalMinOn (f ∘ ⇑g) (Icc 0 1) 0
⊢ ConvexOn ℝ (Icc 0 1) (f ∘ ⇑g)

Tactic:
exact (h_conv.comp_affineMap g).subset h_maps (convex_Icc 0 1)

Result:
no goals

Proof state:
E : Type u_1
β : Type u_2
inst✝⁷ : AddCommGroup E
inst✝⁶ : TopologicalSpace E
inst✝⁵ : Module ℝ E
inst✝⁴ : IsTopologicalAddGroup E
inst✝³ : ContinuousSMul ℝ E
inst✝² : OrderedAddCommGroup β
inst✝¹ : Module ℝ β
inst✝ : OrderedSMul ℝ β
s : Set E
f : E → β
a : E
a_in_s : a ∈ s
h_localmin : IsLocalMinOn f s a
h_conv : ConvexOn ℝ s f
x : E
x_in_s : x ∈ s
g : ℝ →ᵃ[ℝ] E := AffineMap.lineMap a x
hg0 : g 0 = a
⊢ x ∈ {x | (fun x => f a ≤ f x) x}

Tactic:
have hg1 : g 1 = x := AffineMap.lineMap_apply_one a x

Result:
E : Type u_1
β : Type u_2
inst✝⁷ : AddCommGroup E
inst✝⁶ : TopologicalSpace E
inst✝⁵ : Module ℝ E
inst✝⁴ : IsTopologicalAddGroup E
inst✝³ : ContinuousSMul ℝ E
inst✝² : OrderedAddCommGroup β
inst✝¹ : Module ℝ β
inst✝ : OrderedSMul ℝ β
s : Set E
f : E → β
a : E
a_in_s : a ∈ s
h_localmin : IsLocalMinOn f s a
h_conv : ConvexOn ℝ s f
x : E
x_in_s : x ∈ s
g : ℝ →ᵃ[ℝ] E := AffineMap.lineMap a x
hg0 : g 0 = a
hg1 : g 1 = x
⊢ x ∈ {x | (fun x => f a ≤ f x) x}

Proof state:
E : Type u_1
β : Type u_2
inst✝⁷ : AddCommGroup E
inst✝⁶ : TopologicalSpace E
inst✝⁵ : Module ℝ E
inst✝⁴ : IsTopologicalAddGroup E
inst✝³ : ContinuousSMul ℝ E
inst✝² : OrderedAddCommGroup β
inst✝¹ : Module ℝ β
inst✝ : OrderedSMul ℝ β
s : Set E
f : E → β
a : E
a_in_s : a ∈ s
h_localmin : IsLocalMinOn f s a
h_conv : ConvexOn ℝ s f
x : E
x_in_s : x ∈ s
g : ℝ →ᵃ[ℝ] E := AffineMap.lineMap a x
hg0 : g 0 = a
hg1 : g 1 = x
hgc : Continuous ⇑g
⊢ MapsTo (⇑g) (Icc 0 1) s

Tactic:
simpa only [g, mapsTo', ← segment_eq_image_lineMap] using h_conv.1.segment_subset a_in_s x_in_s

Result:
no goals

Proof state:
E : Type u_1
β : Type u_2
inst✝⁷ : AddCommGroup E
inst✝⁶ : TopologicalSpace E
inst✝⁵ : Module ℝ E
inst✝⁴ : IsTopologicalAddGroup E
inst✝³ : ContinuousSMul ℝ E
inst✝² : OrderedAddCommGroup β
inst✝¹ : Module ℝ β
inst✝ : OrderedSMul ℝ β
s : Set E
f : E → β
a : E
a_in_s : a ∈ s
h_localmin : IsLocalMinOn f s a
h_conv : ConvexOn ℝ s f
x : E
x_in_s : x ∈ s
g : ℝ →ᵃ[ℝ] E := AffineMap.lineMap a x
hg0 : g 0 = a
hg1 : g 1 = x
hgc : Continuous ⇑g
h_maps : MapsTo (⇑g) (Icc 0 1) s
fg_local_min_on : IsLocalMinOn (f ∘ ⇑g) (Icc 0 1) 0
⊢ x ∈ {x | (fun x => f a ≤ f x) x}

Tactic:
have fg_min_on : IsMinOn (f ∘ g) (Icc 0 1 : Set ℝ) 0 := by
  refine IsMinOn.of_isLocalMinOn_of_convexOn_Icc one_pos fg_local_min_on ?_
  exact (h_conv.comp_affineMap g).subset h_maps (convex_Icc 0 1)

Result:
E : Type u_1
β : Type u_2
inst✝⁷ : AddCommGroup E
inst✝⁶ : TopologicalSpace E
inst✝⁵ : Module ℝ E
inst✝⁴ : IsTopologicalAddGroup E
inst✝³ : ContinuousSMul ℝ E
inst✝² : OrderedAddCommGroup β
inst✝¹ : Module ℝ β
inst✝ : OrderedSMul ℝ β
s : Set E
f : E → β
a : E
a_in_s : a ∈ s
h_localmin : IsLocalMinOn f s a
h_conv : ConvexOn ℝ s f
x : E
x_in_s : x ∈ s
g : ℝ →ᵃ[ℝ] E := AffineMap.lineMap a x
hg0 : g 0 = a
hg1 : g 1 = x
hgc : Continuous ⇑g
h_maps : MapsTo (⇑g) (Icc 0 1) s
fg_local_min_on : IsLocalMinOn (f ∘ ⇑g) (Icc 0 1) 0
fg_min_on : IsMinOn (f ∘ ⇑g) (Icc 0 1) 0
⊢ x ∈ {x | (fun x => f a ≤ f x) x}

Proof state:
E : Type u_1
β : Type u_2
inst✝⁷ : AddCommGroup E
inst✝⁶ : TopologicalSpace E
inst✝⁵ : Module ℝ E
inst✝⁴ : IsTopologicalAddGroup E
inst✝³ : ContinuousSMul ℝ E
inst✝² : OrderedAddCommGroup β
inst✝¹ : Module ℝ β
inst✝ : OrderedSMul ℝ β
s : Set E
f : E → β
a : E
a_in_s : a ∈ s
h_localmin : IsLocalMinOn f s a
h_conv : ConvexOn ℝ s f
x : E
x_in_s : x ∈ s
⊢ x ∈ {x | (fun x => f a ≤ f x) x}

Tactic:
let g : ℝ →ᵃ[ℝ] E := AffineMap.lineMap a x

Result:
E : Type u_1
β : Type u_2
inst✝⁷ : AddCommGroup E
inst✝⁶ : TopologicalSpace E
inst✝⁵ : Module ℝ E
inst✝⁴ : IsTopologicalAddGroup E
inst✝³ : ContinuousSMul ℝ E
inst✝² : OrderedAddCommGroup β
inst✝¹ : Module ℝ β
inst✝ : OrderedSMul ℝ β
s : Set E
f : E → β
a : E
a_in_s : a ∈ s
h_localmin : IsLocalMinOn f s a
h_conv : ConvexOn ℝ s f
x : E
x_in_s : x ∈ s
g : ℝ →ᵃ[ℝ] E := AffineMap.lineMap a x
⊢ x ∈ {x | (fun x => f a ≤ f x) x}

Proof state:
E : Type u_1
β : Type u_2
inst✝⁷ : AddCommGroup E
inst✝⁶ : TopologicalSpace E
inst✝⁵ : Module ℝ E
inst✝⁴ : IsTopologicalAddGroup E
inst✝³ : ContinuousSMul ℝ E
inst✝² : OrderedAddCommGroup β
inst✝¹ : Module ℝ β
inst✝ : OrderedSMul ℝ β
s : Set E
f : E → β
a : E
a_in_s : a ∈ s
h_localmin : IsLocalMinOn f s a
h_conv : ConvexOn ℝ s f
x : E
x_in_s : x ∈ s
g : ℝ →ᵃ[ℝ] E := AffineMap.lineMap a x
hg0 : g 0 = a
hg1 : g 1 = x
hgc : Continuous ⇑g
h_maps : MapsTo (⇑g) (Icc 0 1) s
⊢ IsLocalMinOn (f ∘ ⇑g) (Icc 0 1) 0

Tactic:
rw [← hg0] at h_localmin

Result:
E : Type u_1
β : Type u_2
inst✝⁷ : AddCommGroup E
inst✝⁶ : TopologicalSpace E
inst✝⁵ : Module ℝ E
inst✝⁴ : IsTopologicalAddGroup E
inst✝³ : ContinuousSMul ℝ E
inst✝² : OrderedAddCommGroup β
inst✝¹ : Module ℝ β
inst✝ : OrderedSMul ℝ β
s : Set E
f : E → β
a : E
a_in_s : a ∈ s
h_conv : ConvexOn ℝ s f
x : E
x_in_s : x ∈ s
g : ℝ →ᵃ[ℝ] E := AffineMap.lineMap a x
h_localmin : IsLocalMinOn f s (g 0)
hg0 : g 0 = a
hg1 : g 1 = x
hgc : Continuous ⇑g
h_maps : MapsTo (⇑g) (Icc 0 1) s
⊢ IsLocalMinOn (f ∘ ⇑g) (Icc 0 1) 0