Theorem: IsMinOn.of_isLocalMinOn_of_convexOn
File: Mathlib/Analysis/Convex/Extrema.lean

tactic: intro x x_in_s
state_before: E : Type u_1
β : Type u_2
inst✝⁷ : AddCommGroup E
inst✝⁶ : TopologicalSpace E
inst✝⁵ : Module ℝ E
inst✝⁴ : TopologicalAddGroup 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
⊢ IsMinOn f s a

tactic: let g : ℝ →ᵃ[ℝ] E := AffineMap.lineMap a x
state_before: E : Type u_1
β : Type u_2
inst✝⁷ : AddCommGroup E
inst✝⁶ : TopologicalSpace E
inst✝⁵ : Module ℝ E
inst✝⁴ : TopologicalAddGroup 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: have hg0 : g 0 = a := AffineMap.lineMap_apply_zero a x
state_before: E : Type u_1
β : Type u_2
inst✝⁷ : AddCommGroup E
inst✝⁶ : TopologicalSpace E
inst✝⁵ : Module ℝ E
inst✝⁴ : TopologicalAddGroup 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 hg1 : g 1 = x := AffineMap.lineMap_apply_one a x
state_before: E : Type u_1
β : Type u_2
inst✝⁷ : AddCommGroup E
inst✝⁶ : TopologicalSpace E
inst✝⁵ : Module ℝ E
inst✝⁴ : TopologicalAddGroup 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 hgc : Continuous g := AffineMap.lineMap_continuous
state_before: E : Type u_1
β : Type u_2
inst✝⁷ : AddCommGroup E
inst✝⁶ : TopologicalSpace E
inst✝⁵ : Module ℝ E
inst✝⁴ : TopologicalAddGroup 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}

tactic: have h_maps : MapsTo g (Icc 0 1) s := by
  simpa only [mapsTo', ← segment_eq_image_lineMap] using h_conv.1.segment_subset a_in_s x_in_s
state_before: E : Type u_1
β : Type u_2
inst✝⁷ : AddCommGroup E
inst✝⁶ : TopologicalSpace E
inst✝⁵ : Module ℝ E
inst✝⁴ : TopologicalAddGroup 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
⊢ x ∈ {x | (fun x => f a ≤ f x) x}

tactic: have fg_local_min_on : IsLocalMinOn (f ∘ g) (Icc 0 1) 0 := by
  rw [← hg0] at h_localmin
  exact h_localmin.comp_continuousOn h_maps hgc.continuousOn (left_mem_Icc.2 zero_le_one)
state_before: E : Type u_1
β : Type u_2
inst✝⁷ : AddCommGroup E
inst✝⁶ : TopologicalSpace E
inst✝⁵ : Module ℝ E
inst✝⁴ : TopologicalAddGroup 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
⊢ 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)
state_before: E : Type u_1
β : Type u_2
inst✝⁷ : AddCommGroup E
inst✝⁶ : TopologicalSpace E
inst✝⁵ : Module ℝ E
inst✝⁴ : TopologicalAddGroup 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: simpa only [hg0, hg1, comp_apply, mem_setOf_eq] using fg_min_on (right_mem_Icc.2 zero_le_one)
state_before: E : Type u_1
β : Type u_2
inst✝⁷ : AddCommGroup E
inst✝⁶ : TopologicalSpace E
inst✝⁵ : Module ℝ E
inst✝⁴ : TopologicalAddGroup 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}

tactic: simpa only [mapsTo', ← segment_eq_image_lineMap] using h_conv.1.segment_subset a_in_s x_in_s
state_before: E : Type u_1
β : Type u_2
inst✝⁷ : AddCommGroup E
inst✝⁶ : TopologicalSpace E
inst✝⁵ : Module ℝ E
inst✝⁴ : TopologicalAddGroup 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: rw [← hg0] at h_localmin
state_before: E : Type u_1
β : Type u_2
inst✝⁷ : AddCommGroup E
inst✝⁶ : TopologicalSpace E
inst✝⁵ : Module ℝ E
inst✝⁴ : TopologicalAddGroup 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: exact h_localmin.comp_continuousOn h_maps hgc.continuousOn (left_mem_Icc.2 zero_le_one)
state_before: E : Type u_1
β : Type u_2
inst✝⁷ : AddCommGroup E
inst✝⁶ : TopologicalSpace E
inst✝⁵ : Module ℝ E
inst✝⁴ : TopologicalAddGroup 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: refine' IsMinOn.of_isLocalMinOn_of_convexOn_Icc one_pos fg_local_min_on _
state_before: E : Type u_1
β : Type u_2
inst✝⁷ : AddCommGroup E
inst✝⁶ : TopologicalSpace E
inst✝⁵ : Module ℝ E
inst✝⁴ : TopologicalAddGroup 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
⊢ IsMinOn (f ∘ ↑g) (Icc 0 1) 0

tactic: exact (h_conv.comp_affineMap g).subset h_maps (convex_Icc 0 1)
state_before: E : Type u_1
β : Type u_2
inst✝⁷ : AddCommGroup E
inst✝⁶ : TopologicalSpace E
inst✝⁵ : Module ℝ E
inst✝⁴ : TopologicalAddGroup 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)