File: Mathlib/Analysis/Calculus/LocalExtr/Basic.lean

full_name: posTangentConeAt
code: /-- "Positive" tangent cone to `s` at `x`; the only difference from `tangentConeAt`
is that we require `c n → ∞` instead of `‖c n‖ → ∞`. One can think about `posTangentConeAt`
as `tangentConeAt NNReal` but we have no theory of normed semifields yet. -/
def posTangentConeAt (s : Set E) (x : E) : Set E 
goal: Set E

full_name: posTangentConeAt_mono
code: theorem posTangentConeAt_mono : Monotone fun s => posTangentConeAt s a 
goal: Monotone fun s => posTangentConeAt s a

full_name: mem_posTangentConeAt_of_frequently_mem
code: theorem mem_posTangentConeAt_of_frequently_mem (h : ∃ᶠ t : ℝ in 𝓝[>] 0, x + t • y ∈ s) :
    y ∈ posTangentConeAt s x 
goal: y ∈ posTangentConeAt s x

full_name: mem_posTangentConeAt_of_segment_subset
code: /-- If `[x -[ℝ] x + y] ⊆ s`, then `y` belongs to the positive tangnet cone of `s`.

Before 2024-07-13, this lemma used to be called `mem_posTangentConeAt_of_segment_subset`.
See also `sub_mem_posTangentConeAt_of_segment_subset`
for the lemma that used to be called `mem_posTangentConeAt_of_segment_subset`. -/
theorem mem_posTangentConeAt_of_segment_subset (h : [x -[ℝ] x + y] ⊆ s) :
    y ∈ posTangentConeAt s x 
goal: y ∈ posTangentConeAt s x

full_name: sub_mem_posTangentConeAt_of_segment_subset
code: theorem sub_mem_posTangentConeAt_of_segment_subset (h : segment ℝ x y ⊆ s) :
    y - x ∈ posTangentConeAt s x 
goal: y - x ∈ posTangentConeAt s x

full_name: posTangentConeAt_univ
code: @[simp]
theorem posTangentConeAt_univ : posTangentConeAt univ a = univ 
goal: posTangentConeAt Set.univ a = Set.univ

full_name: IsLocalMaxOn.hasFDerivWithinAt_nonpos
code: /-- If `f` has a local max on `s` at `a`, `f'` is the derivative of `f` at `a` within `s`, and
`y` belongs to the positive tangent cone of `s` at `a`, then `f' y ≤ 0`. -/
theorem IsLocalMaxOn.hasFDerivWithinAt_nonpos (h : IsLocalMaxOn f s a)
    (hf : HasFDerivWithinAt f f' s a) (hy : y ∈ posTangentConeAt s a) : f' y ≤ 0 
goal: f' y ≤ 0

full_name: IsLocalMaxOn.fderivWithin_nonpos
code: /-- If `f` has a local max on `s` at `a` and `y` belongs to the positive tangent cone
of `s` at `a`, then `f' y ≤ 0`. -/
theorem IsLocalMaxOn.fderivWithin_nonpos (h : IsLocalMaxOn f s a)
    (hy : y ∈ posTangentConeAt s a) : (fderivWithin ℝ f s a : E → ℝ) y ≤ 0 
goal: (fderivWithin ℝ f s a) y ≤ 0

full_name: IsLocalMaxOn.hasFDerivWithinAt_eq_zero
code: /-- If `f` has a local max on `s` at `a`, `f'` is a derivative of `f` at `a` within `s`, and
both `y` and `-y` belong to the positive tangent cone of `s` at `a`, then `f' y ≤ 0`. -/
theorem IsLocalMaxOn.hasFDerivWithinAt_eq_zero (h : IsLocalMaxOn f s a)
    (hf : HasFDerivWithinAt f f' s a) (hy : y ∈ posTangentConeAt s a)
    (hy' : -y ∈ posTangentConeAt s a) : f' y = 0 
goal: f' y = 0

full_name: IsLocalMaxOn.fderivWithin_eq_zero
code: /-- If `f` has a local max on `s` at `a` and both `y` and `-y` belong to the positive tangent cone
of `s` at `a`, then `f' y = 0`. -/
theorem IsLocalMaxOn.fderivWithin_eq_zero (h : IsLocalMaxOn f s a)
    (hy : y ∈ posTangentConeAt s a) (hy' : -y ∈ posTangentConeAt s a) :
    (fderivWithin ℝ f s a : E → ℝ) y = 0 
goal: (fderivWithin ℝ f s a) y = 0

full_name: IsLocalMinOn.hasFDerivWithinAt_nonneg
code: /-- If `f` has a local min on `s` at `a`, `f'` is the derivative of `f` at `a` within `s`, and
`y` belongs to the positive tangent cone of `s` at `a`, then `0 ≤ f' y`. -/
theorem IsLocalMinOn.hasFDerivWithinAt_nonneg (h : IsLocalMinOn f s a)
    (hf : HasFDerivWithinAt f f' s a) (hy : y ∈ posTangentConeAt s a) : 0 ≤ f' y 
goal: 0 ≤ f' y

full_name: IsLocalMinOn.fderivWithin_nonneg
code: /-- If `f` has a local min on `s` at `a` and `y` belongs to the positive tangent cone
of `s` at `a`, then `0 ≤ f' y`. -/
theorem IsLocalMinOn.fderivWithin_nonneg (h : IsLocalMinOn f s a)
    (hy : y ∈ posTangentConeAt s a) : (0 : ℝ) ≤ (fderivWithin ℝ f s a : E → ℝ) y 
goal: 0 ≤ (fderivWithin ℝ f s a) y

full_name: IsLocalMinOn.hasFDerivWithinAt_eq_zero
code: /-- If `f` has a local max on `s` at `a`, `f'` is a derivative of `f` at `a` within `s`, and
both `y` and `-y` belong to the positive tangent cone of `s` at `a`, then `f' y ≤ 0`. -/
theorem IsLocalMinOn.hasFDerivWithinAt_eq_zero (h : IsLocalMinOn f s a)
    (hf : HasFDerivWithinAt f f' s a) (hy : y ∈ posTangentConeAt s a)
    (hy' : -y ∈ posTangentConeAt s a) : f' y = 0 
goal: f' y = 0

full_name: IsLocalMinOn.fderivWithin_eq_zero
code: /-- If `f` has a local min on `s` at `a` and both `y` and `-y` belong to the positive tangent cone
of `s` at `a`, then `f' y = 0`. -/
theorem IsLocalMinOn.fderivWithin_eq_zero (h : IsLocalMinOn f s a)
    (hy : y ∈ posTangentConeAt s a) (hy' : -y ∈ posTangentConeAt s a) :
    (fderivWithin ℝ f s a : E → ℝ) y = 0 
goal: (fderivWithin ℝ f s a) y = 0

full_name: IsLocalMin.hasFDerivAt_eq_zero
code: /-- **Fermat's Theorem**: the derivative of a function at a local minimum equals zero. -/
theorem IsLocalMin.hasFDerivAt_eq_zero (h : IsLocalMin f a) (hf : HasFDerivAt f f' a) : f' = 0 
goal: f' = 0

full_name: IsLocalMin.fderiv_eq_zero
code: /-- **Fermat's Theorem**: the derivative of a function at a local minimum equals zero. -/
theorem IsLocalMin.fderiv_eq_zero (h : IsLocalMin f a) : fderiv ℝ f a = 0 
goal: fderiv ℝ f a = 0

full_name: IsLocalMax.hasFDerivAt_eq_zero
code: /-- **Fermat's Theorem**: the derivative of a function at a local maximum equals zero. -/
theorem IsLocalMax.hasFDerivAt_eq_zero (h : IsLocalMax f a) (hf : HasFDerivAt f f' a) : f' = 0 
goal: f' = 0

full_name: IsLocalMax.fderiv_eq_zero
code: /-- **Fermat's Theorem**: the derivative of a function at a local maximum equals zero. -/
theorem IsLocalMax.fderiv_eq_zero (h : IsLocalMax f a) : fderiv ℝ f a = 0 
goal: fderiv ℝ f a = 0

full_name: IsLocalExtr.hasFDerivAt_eq_zero
code: /-- **Fermat's Theorem**: the derivative of a function at a local extremum equals zero. -/
theorem IsLocalExtr.hasFDerivAt_eq_zero (h : IsLocalExtr f a) : HasFDerivAt f f' a → f' = 0 
goal: HasFDerivAt f f' a → f' = 0

full_name: IsLocalExtr.fderiv_eq_zero
code: /-- **Fermat's Theorem**: the derivative of a function at a local extremum equals zero. -/
theorem IsLocalExtr.fderiv_eq_zero (h : IsLocalExtr f a) : fderiv ℝ f a = 0 
goal: fderiv ℝ f a = 0

full_name: one_mem_posTangentConeAt_iff_mem_closure
code: lemma one_mem_posTangentConeAt_iff_mem_closure :
    1 ∈ posTangentConeAt s a ↔ a ∈ closure (Ioi a ∩ s) 
goal: 1 ∈ posTangentConeAt s a ↔ a ∈ closure (Set.Ioi a ∩ s)

full_name: one_mem_posTangentConeAt_iff_frequently
code: lemma one_mem_posTangentConeAt_iff_frequently :
    1 ∈ posTangentConeAt s a ↔ ∃ᶠ x in 𝓝[>] a, x ∈ s 
goal: 1 ∈ posTangentConeAt s a ↔ ∃ᶠ (x : ℝ) in 𝓝[>] a, x ∈ s

full_name: IsLocalMin.hasDerivAt_eq_zero
code: /-- **Fermat's Theorem**: the derivative of a function at a local minimum equals zero. -/
theorem IsLocalMin.hasDerivAt_eq_zero (h : IsLocalMin f a) (hf : HasDerivAt f f' a) : f' = 0 
goal: f' = 0

full_name: IsLocalMin.deriv_eq_zero
code: /-- **Fermat's Theorem**: the derivative of a function at a local minimum equals zero. -/
theorem IsLocalMin.deriv_eq_zero (h : IsLocalMin f a) : deriv f a = 0 
goal: deriv f a = 0

full_name: IsLocalMax.hasDerivAt_eq_zero
code: /-- **Fermat's Theorem**: the derivative of a function at a local maximum equals zero. -/
theorem IsLocalMax.hasDerivAt_eq_zero (h : IsLocalMax f a) (hf : HasDerivAt f f' a) : f' = 0 
goal: f' = 0

full_name: IsLocalMax.deriv_eq_zero
code: /-- **Fermat's Theorem**: the derivative of a function at a local maximum equals zero. -/
theorem IsLocalMax.deriv_eq_zero (h : IsLocalMax f a) : deriv f a = 0 
goal: deriv f a = 0

full_name: IsLocalExtr.hasDerivAt_eq_zero
code: /-- **Fermat's Theorem**: the derivative of a function at a local extremum equals zero. -/
theorem IsLocalExtr.hasDerivAt_eq_zero (h : IsLocalExtr f a) : HasDerivAt f f' a → f' = 0 
goal: HasDerivAt f f' a → f' = 0

full_name: IsLocalExtr.deriv_eq_zero
code: /-- **Fermat's Theorem**: the derivative of a function at a local extremum equals zero. -/
theorem IsLocalExtr.deriv_eq_zero (h : IsLocalExtr f a) : deriv f a = 0 
goal: deriv f a = 0