Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/Lean/Mathlib/Mathlib/Analysis/Calculus/FDeriv/     Datei vom 15.10.2026 mit Größe 14 kB image not shown  

Quelle  Const.lean   Sprache: Lean

 

/-
Copyright (c) 2019 Jeremy Avigad. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Jeremy Avigad, Sébastien Gouëzel, Yury Kudryashov
-/

module

public import Mathlib.Analysis.Calculus.FDeriv.Congr
public import Mathlib.Topology.Algebra.Module.ContinuousLinearMap.Invertible

/-!
# Fréchet derivative of constant functions

This file contains the usual formulas (and existence assertions) for the derivative of constant
functions, including various special cases such as the functions `0`, `1`, `Nat.cast n`,
`Int.cast z`, and other numerals.

## Tags

derivative, differentiable, Fréchet, calculus
-/


public section

open Asymptotics Function Filter Set
open scoped Topology NNReal ENNReal

variable {�� : Type*} [NontriviallyNormedField ��]
variable {E : Type*} [AddCommGroup E] [Module �� E] [TopologicalSpace E]
variable {F : Type*} [AddCommGroup F] [Module �� F] [TopologicalSpace F]

variable {f : E → F} {x : E} {s : Set E}

section Const

theorem hasFDerivAtFilter_const (c : F) (L : Filter (E × E)) :
    HasFDerivAtFilter (fun _ => c) (0 : E →L[��] F) L :=
  .of_isLittleOTVS <| (IsLittleOTVS.zero _ _).congr_left fun _ => by simp

theorem hasFDerivAtFilter_zero (L : Filter (E × E)) :
    HasFDerivAtFilter (0 : E → F) (0 : E →L[��] F) L := hasFDerivAtFilter_const _ _

theorem hasFDerivAtFilter_one [One F] (L : Filter (E × E)) :
    HasFDerivAtFilter (1 : E → F) (0 : E →L[��] F) L := hasFDerivAtFilter_const _ _

theorem hasFDerivAtFilter_natCast [NatCast F] (n : ℕ) (L : Filter (E × E)) :
    HasFDerivAtFilter (n : E → F) (0 : E →L[��] F) L :=
  hasFDerivAtFilter_const _ _

theorem hasFDerivAtFilter_intCast [IntCast F] (z : ℤ) (L : Filter (E × E)) :
    HasFDerivAtFilter (z : E → F) (0 : E →L[��] F) L :=
  hasFDerivAtFilter_const _ _

theorem hasFDerivAtFilter_ofNat (n : ℕ) [OfNat F n] (L : Filter (E × E)) :
    HasFDerivAtFilter (ofNat(n) : E → F) (0 : E →L[��] F) L :=
  hasFDerivAtFilter_const _ _

@[fun_prop]
theorem hasStrictFDerivAt_const (c : F) (x : E) :
    HasStrictFDerivAt (fun _ => c) (0 : E →L[��] F) x :=
  hasFDerivAtFilter_const _ _

@[fun_prop]
theorem hasStrictFDerivAt_zero (x : E) :
    HasStrictFDerivAt (0 : E → F) (0 : E →L[��] F) x := hasStrictFDerivAt_const _ _

@[fun_prop]
theorem hasStrictFDerivAt_one [One F] (x : E) :
    HasStrictFDerivAt (1 : E → F) (0 : E →L[��] F) x := hasStrictFDerivAt_const _ _

@[fun_prop]
theorem hasStrictFDerivAt_natCast [NatCast F] (n : ℕ) (x : E) :
    HasStrictFDerivAt (n : E → F) (0 : E →L[��] F) x := hasStrictFDerivAt_const _ _

@[fun_prop]
theorem hasStrictFDerivAt_intCast [IntCast F] (z : ℤ) (x : E) :
    HasStrictFDerivAt (z : E → F) (0 : E →L[��] F) x := hasStrictFDerivAt_const _ _

@[fun_prop]
theorem hasStrictFDerivAt_ofNat (n : ℕ) [OfNat F n] (x : E) :
    HasStrictFDerivAt (ofNat(n) : E → F) (0 : E →L[��] F) x := hasStrictFDerivAt_const _ _

@[fun_prop]
theorem hasFDerivWithinAt_const (c : F) (x : E) (s : Set E) :
    HasFDerivWithinAt (fun _ => c) (0 : E →L[��] F) s x :=
  hasFDerivAtFilter_const _ _

@[fun_prop]
theorem hasFDerivWithinAt_zero (x : E) (s : Set E) :
    HasFDerivWithinAt (0 : E → F) (0 : E →L[��] F) s x := hasFDerivWithinAt_const _ _ _

@[fun_prop]
theorem hasFDerivWithinAt_one [One F] (x : E) (s : Set E) :
    HasFDerivWithinAt (1 : E → F) (0 : E →L[��] F) s x := hasFDerivWithinAt_const _ _ _

@[fun_prop]
theorem hasFDerivWithinAt_natCast [NatCast F] (n : ℕ) (x : E) (s : Set E) :
    HasFDerivWithinAt (n : E → F) (0 : E →L[��] F) s x :=
  hasFDerivWithinAt_const _ _ _

@[fun_prop]
theorem hasFDerivWithinAt_intCast [IntCast F] (z : ℤ) (x : E) (s : Set E) :
    HasFDerivWithinAt (z : E → F) (0 : E →L[��] F) s x :=
  hasFDerivWithinAt_const _ _ _

@[fun_prop]
theorem hasFDerivWithinAt_ofNat (n : ℕ) [OfNat F n] (x : E) (s : Set E) :
    HasFDerivWithinAt (ofNat(n) : E → F) (0 : E →L[��] F) s x :=
  hasFDerivWithinAt_const _ _ _

@[fun_prop]
theorem hasFDerivAt_const (c : F) (x : E) : HasFDerivAt (fun _ => c) (0 : E →L[��] F) x :=
  hasFDerivAtFilter_const _ _

@[fun_prop]
theorem hasFDerivAt_zero (x : E) :
    HasFDerivAt (0 : E → F) (0 : E →L[��] F) x := hasFDerivAt_const _ _

@[fun_prop]
theorem hasFDerivAt_one [One F] (x : E) :
    HasFDerivAt (1 : E → F) (0 : E →L[��] F) x := hasFDerivAt_const _ _

@[fun_prop]
theorem hasFDerivAt_natCast [NatCast F] (n : ℕ) (x : E) :
    HasFDerivAt (n : E → F) (0 : E →L[��] F) x := hasFDerivAt_const _ _

@[fun_prop]
theorem hasFDerivAt_intCast [IntCast F] (z : ℤ) (x : E) :
    HasFDerivAt (z : E → F) (0 : E →L[��] F) x := hasFDerivAt_const _ _

@[fun_prop]
theorem hasFDerivAt_ofNat (n : ℕ) [OfNat F n] (x : E) :
    HasFDerivAt (ofNat(n) : E → F) (0 : E →L[��] F) x := hasFDerivAt_const _ _

@[simp, fun_prop]
theorem differentiableAt_const (c : F) : DifferentiableAt �� (fun _ => c) x :=
  ⟨0, hasFDerivAt_const c x⟩

@[simp, fun_prop]
theorem differentiableAt_zero (x : E) :
    DifferentiableAt �� (0 : E → F) x := differentiableAt_const _

@[simp, fun_prop]
theorem differentiableAt_one [One F] (x : E) :
    DifferentiableAt �� (1 : E → F) x := differentiableAt_const _

@[simp, fun_prop]
theorem differentiableAt_natCast [NatCast F] (n : ℕ) (x : E) :
    DifferentiableAt �� (n : E → F) x := differentiableAt_const _

@[simp, fun_prop]
theorem differentiableAt_intCast [IntCast F] (z : ℤ) (x : E) :
    DifferentiableAt �� (z : E → F) x := differentiableAt_const _

@[simp low, fun_prop]
theorem differentiableAt_ofNat (n : ℕ) [OfNat F n] (x : E) :
    DifferentiableAt �� (ofNat(n) : E → F) x := differentiableAt_const _

@[fun_prop]
theorem differentiableWithinAt_const (c : F) : DifferentiableWithinAt �� (fun _ => c) s x :=
  DifferentiableAt.differentiableWithinAt (differentiableAt_const _)

@[fun_prop]
theorem differentiableWithinAt_zero :
    DifferentiableWithinAt �� (0 : E → F) s x := differentiableWithinAt_const _

@[fun_prop]
theorem differentiableWithinAt_one [One F] :
    DifferentiableWithinAt �� (1 : E → F) s x := differentiableWithinAt_const _

@[fun_prop]
theorem differentiableWithinAt_natCast [NatCast F] (n : ℕ) :
    DifferentiableWithinAt �� (n : E → F) s x := differentiableWithinAt_const _

@[fun_prop]
theorem differentiableWithinAt_intCast [IntCast F] (z : ℤ) :
    DifferentiableWithinAt �� (z : E → F) s x := differentiableWithinAt_const _

@[fun_prop]
theorem differentiableWithinAt_ofNat (n : ℕ) [OfNat F n] :
    DifferentiableWithinAt �� (ofNat(n) : E → F) s x := differentiableWithinAt_const _

theorem fderivWithin_const_apply (c : F) : fderivWithin �� (fun _ => c) s x = 0 := by
  rw [fderivWithin_def, ite_eq_left]
  apply hasFDerivWithinAt_const

@[simp]
theorem fderivWithin_fun_const (c : F) : fderivWithin �� (fun _ ↦ c) s = 0 := by
  ext
  rw [fderivWithin_const_apply, Pi.zero_apply]

@[simp]
theorem fderivWithin_const (c : F) : fderivWithin �� (Function.const E c) s = 0 :=
  fderivWithin_fun_const c

@[simp]
theorem fderivWithin_zero : fderivWithin �� (0 : E → F) s = 0 := fderivWithin_const _

@[simp]
theorem fderivWithin_one [One F] : fderivWithin �� (1 : E → F) s = 0 := fderivWithin_const _

@[simp]
theorem fderivWithin_natCast [NatCast F] (n : ℕ) : fderivWithin �� (n : E → F) s = 0 :=
  fderivWithin_const _

@[simp]
theorem fderivWithin_intCast [IntCast F] (z : ℤ) : fderivWithin �� (z : E → F) s = 0 :=
  fderivWithin_const _

@[simp low]
theorem fderivWithin_ofNat (n : ℕ) [OfNat F n] : fderivWithin �� (ofNat(n) : E → F) s = 0 :=
  fderivWithin_const _

theorem fderiv_const_apply (c : F) : fderiv �� (fun _ => c) x = 0 := by
  rw [← fderivWithin_univ, fderivWithin_const_apply]

@[simp]
theorem fderiv_fun_const (c : F) : fderiv �� (fun _ : E => c) = 0 := by
  rw [← fderivWithin_univ, fderivWithin_fun_const]

@[simp]
theorem fderiv_const (c : F) : fderiv �� (Function.const E c) = 0 :=
  fderiv_fun_const c

@[simp]
theorem fderiv_zero : fderiv �� (0 : E → F) = 0 := fderiv_const _

@[simp]
theorem fderiv_one [One F] : fderiv �� (1 : E → F) = 0 := fderiv_const _

@[simp]
theorem fderiv_natCast [NatCast F] (n : ℕ) : fderiv �� (n : E → F) = 0 := fderiv_const _

@[simp]
theorem fderiv_intCast [IntCast F] (z : ℤ) : fderiv �� (z : E → F) = 0 := fderiv_const _

@[simp low]
theorem fderiv_ofNat (n : ℕ) [OfNat F n] : fderiv �� (ofNat(n) : E → F) = 0 := fderiv_const _

@[simp, fun_prop]
theorem differentiable_const (c : F) : Differentiable �� fun _ : E => c := fun _ =>
  differentiableAt_const _

@[simp, fun_prop]
theorem differentiable_zero :
    Differentiable �� (0 : E → F) := differentiable_const _

@[simp, fun_prop]
theorem differentiable_one [One F] :
    Differentiable �� (1 : E → F) := differentiable_const _

@[simp, fun_prop]
theorem differentiable_natCast [NatCast F] (n : ℕ) :
    Differentiable �� (n : E → F) := differentiable_const _

@[simp, fun_prop]
theorem differentiable_intCast [IntCast F] (z : ℤ) :
    Differentiable �� (z : E → F) := differentiable_const _

@[simp low, fun_prop]
theorem differentiable_ofNat (n : ℕ) [OfNat F n] :
    Differentiable �� (ofNat(n) : E → F) := differentiable_const _

@[simp, fun_prop]
theorem differentiableOn_const (c : F) : DifferentiableOn �� (fun _ => c) s :=
  (differentiable_const _).differentiableOn

@[simp, fun_prop]
theorem differentiableOn_zero :
    DifferentiableOn �� (0 : E → F) s := differentiableOn_const _

@[simp, fun_prop]
theorem differentiableOn_one [One F] :
    DifferentiableOn �� (1 : E → F) s := differentiableOn_const _

@[simp, fun_prop]
theorem differentiableOn_natCast [NatCast F] (n : ℕ) :
    DifferentiableOn �� (n : E → F) s := differentiableOn_const _

@[simp, fun_prop]
theorem differentiableOn_intCast [IntCast F] (z : ℤ) :
    DifferentiableOn �� (z : E → F) s := differentiableOn_const _

@[simp low, fun_prop]
theorem differentiableOn_ofNat (n : ℕ) [OfNat F n] :
    DifferentiableOn �� (ofNat(n) : E → F) s := differentiableOn_const _

@[fun_prop]
theorem hasFDerivWithinAt_singleton (f : E → F) (x : E) :
    HasFDerivWithinAt f (0 : E →L[��] F) {x} x := by
  refine .of_not_accPt ?_
  rw [accPt_iff_clusterPt, inf_principal]
  simp [ClusterPt]

@[fun_prop, nontriviality]
theorem hasFDerivWithinAt_of_subsingleton [h : Subsingleton E] (f : E → F) (s : Set E) (x : E) :
    HasFDerivWithinAt f (0 : E →L[��] F) s x := by
  obtain rfl | ⟨a, rfl⟩ := s.eq_empty_or_singleton_of_subsingleton
  · simp
  · exact HasFDerivWithinAt.singleton

@[fun_prop, nontriviality]
theorem hasFDerivAt_of_subsingleton [h : Subsingleton E] (f : E → F) (x : E) :
    HasFDerivAt f (0 : E →L[��] F) x := by
  rw [← hasFDerivWithinAt_univ, subsingleton_univ.eq_singleton_of_mem (mem_univ x)]
  exact hasFDerivWithinAt_singleton f x

@[nontriviality]
theorem differentiable_of_subsingleton [Subsingleton E] {f : E → F} : Differentiable �� f :=
  fun x ↦ (hasFDerivAt_of_subsingleton f x (�� := ��)).differentiableAt

@[nontriviality]
theorem differentiableWithinAt_of_subsingleton [Subsingleton E] :
    DifferentiableWithinAt �� f s x :=
  (differentiable_of_subsingleton x).differentiableWithinAt

@[fun_prop]
theorem differentiableOn_singleton : DifferentiableOn �� f {x} :=
  forall_eq.2 (hasFDerivWithinAt_singleton f x).differentiableWithinAt

@[fun_prop]
theorem Set.Subsingleton.differentiableOn (hs : s.Subsingleton) : DifferentiableOn �� f s :=
  hs.induction_on differentiableOn_empty fun _ => differentiableOn_singleton

theorem hasFDerivAt_zero_of_eventually_const (c : F) (hf : f =ᶠ[�� x] fun _ => c) :
    HasFDerivAt f (0 : E →L[��] F) x :=
  (hasFDerivAt_const _ _).congr_of_eventuallyEq hf

end Const

/-- If `f : E → F` has injective differential within `s` at `x`,
it is differentiable within `s` at `x`. -/

lemma differentiableWithinAt_of_fderivWithin_injective (hf : Injective (fderivWithin �� f s x)) :
    DifferentiableWithinAt �� f s x := by
  nontriviality E
  contrapose hf
  rw [fderivWithin_zero_of_not_differentiableWithinAt hf]
  exact not_injective_const

/-- If `f : E → F` has injective differential at `x`, it is differentiable at `x`. -/
lemma differentiableAt_of_fderiv_injective (hf : Injective (fderiv �� f x)) :
    DifferentiableAt �� f x := by
  simp only [← differentiableWithinAt_univ, ← fderivWithin_univ] at hf ⊢
  exact differentiableWithinAt_of_fderivWithin_injective hf

theorem differentiableWithinAt_of_isInvertible_fderivWithin
    (hf : (fderivWithin �� f s x).IsInvertible) : DifferentiableWithinAt �� f s x :=
  differentiableWithinAt_of_fderivWithin_injective hf.injective

theorem differentiableAt_of_isInvertible_fderiv
    (hf : (fderiv �� f x).IsInvertible) : DifferentiableAt �� f x :=
  differentiableAt_of_fderiv_injective hf.injective

/-! ### Support of derivatives -/

section Support
variable (��)

theorem HasStrictFDerivAt.of_notMem_tsupport (h : x ∉ tsupport f) :
    HasStrictFDerivAt f (0 : E →L[��] F) x := by
  rw [notMem_tsupport_iff_eventuallyEq] at h
  exact (hasStrictFDerivAt_const (0 : F) x).congr_of_eventuallyEq h.symm

theorem HasFDerivAt.of_notMem_tsupport (h : x ∉ tsupport f) :
    HasFDerivAt f (0 : E →L[��] F) x :=
  (HasStrictFDerivAt.of_notMem_tsupport �� h).hasFDerivAt

theorem HasFDerivWithinAt.of_notMem_tsupport {s : Set E} {x : E} (h : x ∉ tsupport f) :
    HasFDerivWithinAt f (0 : E →L[��] F) s x :=
  (HasFDerivAt.of_notMem_tsupport �� h).hasFDerivWithinAt

theorem fderiv_of_notMem_tsupport (h : x ∉ tsupport f) : fderiv �� f x = 0 := by
  rw [notMem_tsupport_iff_eventuallyEq] at h
  simp [h.fderiv_eq]

theorem support_fderiv_subset : support (fderiv �� f) ⊆ tsupport f := fun x ↦ by
  rw [← not_imp_not, notMem_support]
  exact fderiv_of_notMem_tsupport _

theorem tsupport_fderiv_subset : tsupport (fderiv �� f) ⊆ tsupport f :=
  closure_minimal (support_fderiv_subset ��) isClosed_closure

theorem tsupport_fderiv_apply_subset (v : E) : tsupport (fderiv �� f · v) ⊆ tsupport f :=
  (tsupport_comp_subset (g := fun L : E →L[��] F ↦ L v) rfl _).trans (tsupport_fderiv_subset ��)

protected theorem HasCompactSupport.fderiv (hf : HasCompactSupport f) :
    HasCompactSupport (fderiv �� f) :=
  hf.mono' <| support_fderiv_subset ��

protected theorem HasCompactSupport.fderiv_apply (hf : HasCompactSupport f) (v : E) :
    HasCompactSupport (fderiv �� f · v) :=
  hf.of_isClosed_subset (isClosed_tsupport _) (tsupport_fderiv_apply_subset �� v)

end Support

Messung
CHZG
9210010097

¤ Dauer der Verarbeitung: 0.9 Sekunden  ¤

*© Formatika GbR, Deutschland