state
stringlengths
0
159k
srcUpToTactic
stringlengths
387
167k
nextTactic
stringlengths
3
9k
declUpToTactic
stringlengths
22
11.5k
declId
stringlengths
38
95
decl
stringlengths
16
1.89k
file_tag
stringlengths
17
73
case tail.head.head n : β„• h : 2 ≀ n ⊒ Adj (pathGraph n) ({ toFun := fun v => { val := ↑v, isLt := (_ : ↑v < n) }, inj' := (_ : βˆ€ ⦃v w : Fin 2⦄, (fun v => { val := ↑v, isLt := (_ : ↑v < n) }) v = (fun v => { val := ↑v, isLt := (_ : ↑v < n) }) w β†’ v = w) } { val := 1, isLt := (_ : (fun a => a < 2) 1) }) ({ toFun := fun v => { val := ↑v, isLt := (_ : ↑v < n) }, inj' := (_ : βˆ€ ⦃v w : Fin 2⦄, (fun v => { val := ↑v, isLt := (_ : ↑v < n) }) v = (fun v => { val := ↑v, isLt := (_ : ↑v < n) }) w β†’ v = w) } { val := 0, isLt := (_ : 0 < 2) }) ↔ Adj (pathGraph 2) { val := 1, isLt := (_ : (fun a => a < 2) 1) } { val := 0, isLt := (_ : 0 < 2) }
/- Copyright (c) 2023 IvΓ‘n Renison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: IvΓ‘n Renison -/ import Mathlib.Combinatorics.SimpleGraph.Coloring import Mathlib.Combinatorics.SimpleGraph.Hasse import Mathlib.Data.Nat.Parity import Mathlib.Data.ZMod.Basic /-! # Concrete colorings of common graphs This file defines colorings for some common graphs ## Main declarations * `SimpleGraph.pathGraph.bicoloring`: Bicoloring of a path graph. -/ namespace SimpleGraph /-- Bicoloring of a path graph -/ def pathGraph.bicoloring (n : β„•) : Coloring (pathGraph n) Bool := Coloring.mk (fun u ↦ u.val % 2 = 0) <| by intro u v rw [pathGraph_adj] rintro (h | h) <;> simp [← h, not_iff, Nat.succ_mod_two_eq_zero_iff] /-- Embedding of `pathGraph 2` into the first two elements of `pathGraph n` for `2 ≀ n` -/ def pathGraph_two_embedding (n : β„•) (h : 2 ≀ n) : pathGraph 2 β†ͺg pathGraph n where toFun v := ⟨v, trans v.2 h⟩ inj' := by rintro v w rw [Fin.mk.injEq] exact Fin.ext map_rel_iff' := by intro v w fin_cases v <;> fin_cases w <;>
simp [pathGraph, ← Fin.coe_covby_iff]
/-- Embedding of `pathGraph 2` into the first two elements of `pathGraph n` for `2 ≀ n` -/ def pathGraph_two_embedding (n : β„•) (h : 2 ≀ n) : pathGraph 2 β†ͺg pathGraph n where toFun v := ⟨v, trans v.2 h⟩ inj' := by rintro v w rw [Fin.mk.injEq] exact Fin.ext map_rel_iff' := by intro v w fin_cases v <;> fin_cases w <;>
Mathlib.Combinatorics.SimpleGraph.ConcreteColorings.32_0.jXeFS7nTQciTQGN
/-- Embedding of `pathGraph 2` into the first two elements of `pathGraph n` for `2 ≀ n` -/ def pathGraph_two_embedding (n : β„•) (h : 2 ≀ n) : pathGraph 2 β†ͺg pathGraph n where toFun v
Mathlib_Combinatorics_SimpleGraph_ConcreteColorings
case tail.head.tail.head n : β„• h : 2 ≀ n ⊒ Adj (pathGraph n) ({ toFun := fun v => { val := ↑v, isLt := (_ : ↑v < n) }, inj' := (_ : βˆ€ ⦃v w : Fin 2⦄, (fun v => { val := ↑v, isLt := (_ : ↑v < n) }) v = (fun v => { val := ↑v, isLt := (_ : ↑v < n) }) w β†’ v = w) } { val := 1, isLt := (_ : (fun a => a < 2) 1) }) ({ toFun := fun v => { val := ↑v, isLt := (_ : ↑v < n) }, inj' := (_ : βˆ€ ⦃v w : Fin 2⦄, (fun v => { val := ↑v, isLt := (_ : ↑v < n) }) v = (fun v => { val := ↑v, isLt := (_ : ↑v < n) }) w β†’ v = w) } { val := 1, isLt := (_ : (fun a => a < 2) 1) }) ↔ Adj (pathGraph 2) { val := 1, isLt := (_ : (fun a => a < 2) 1) } { val := 1, isLt := (_ : (fun a => a < 2) 1) }
/- Copyright (c) 2023 IvΓ‘n Renison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: IvΓ‘n Renison -/ import Mathlib.Combinatorics.SimpleGraph.Coloring import Mathlib.Combinatorics.SimpleGraph.Hasse import Mathlib.Data.Nat.Parity import Mathlib.Data.ZMod.Basic /-! # Concrete colorings of common graphs This file defines colorings for some common graphs ## Main declarations * `SimpleGraph.pathGraph.bicoloring`: Bicoloring of a path graph. -/ namespace SimpleGraph /-- Bicoloring of a path graph -/ def pathGraph.bicoloring (n : β„•) : Coloring (pathGraph n) Bool := Coloring.mk (fun u ↦ u.val % 2 = 0) <| by intro u v rw [pathGraph_adj] rintro (h | h) <;> simp [← h, not_iff, Nat.succ_mod_two_eq_zero_iff] /-- Embedding of `pathGraph 2` into the first two elements of `pathGraph n` for `2 ≀ n` -/ def pathGraph_two_embedding (n : β„•) (h : 2 ≀ n) : pathGraph 2 β†ͺg pathGraph n where toFun v := ⟨v, trans v.2 h⟩ inj' := by rintro v w rw [Fin.mk.injEq] exact Fin.ext map_rel_iff' := by intro v w fin_cases v <;> fin_cases w <;>
simp [pathGraph, ← Fin.coe_covby_iff]
/-- Embedding of `pathGraph 2` into the first two elements of `pathGraph n` for `2 ≀ n` -/ def pathGraph_two_embedding (n : β„•) (h : 2 ≀ n) : pathGraph 2 β†ͺg pathGraph n where toFun v := ⟨v, trans v.2 h⟩ inj' := by rintro v w rw [Fin.mk.injEq] exact Fin.ext map_rel_iff' := by intro v w fin_cases v <;> fin_cases w <;>
Mathlib.Combinatorics.SimpleGraph.ConcreteColorings.32_0.jXeFS7nTQciTQGN
/-- Embedding of `pathGraph 2` into the first two elements of `pathGraph n` for `2 ≀ n` -/ def pathGraph_two_embedding (n : β„•) (h : 2 ≀ n) : pathGraph 2 β†ͺg pathGraph n where toFun v
Mathlib_Combinatorics_SimpleGraph_ConcreteColorings
n : β„• h : 2 ≀ n ⊒ chromaticNumber (pathGraph n) = 2
/- Copyright (c) 2023 IvΓ‘n Renison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: IvΓ‘n Renison -/ import Mathlib.Combinatorics.SimpleGraph.Coloring import Mathlib.Combinatorics.SimpleGraph.Hasse import Mathlib.Data.Nat.Parity import Mathlib.Data.ZMod.Basic /-! # Concrete colorings of common graphs This file defines colorings for some common graphs ## Main declarations * `SimpleGraph.pathGraph.bicoloring`: Bicoloring of a path graph. -/ namespace SimpleGraph /-- Bicoloring of a path graph -/ def pathGraph.bicoloring (n : β„•) : Coloring (pathGraph n) Bool := Coloring.mk (fun u ↦ u.val % 2 = 0) <| by intro u v rw [pathGraph_adj] rintro (h | h) <;> simp [← h, not_iff, Nat.succ_mod_two_eq_zero_iff] /-- Embedding of `pathGraph 2` into the first two elements of `pathGraph n` for `2 ≀ n` -/ def pathGraph_two_embedding (n : β„•) (h : 2 ≀ n) : pathGraph 2 β†ͺg pathGraph n where toFun v := ⟨v, trans v.2 h⟩ inj' := by rintro v w rw [Fin.mk.injEq] exact Fin.ext map_rel_iff' := by intro v w fin_cases v <;> fin_cases w <;> simp [pathGraph, ← Fin.coe_covby_iff] theorem chromaticNumber_pathGraph (n : β„•) (h : 2 ≀ n) : (pathGraph n).chromaticNumber = 2 := by
have hc := (pathGraph.bicoloring n).to_colorable
theorem chromaticNumber_pathGraph (n : β„•) (h : 2 ≀ n) : (pathGraph n).chromaticNumber = 2 := by
Mathlib.Combinatorics.SimpleGraph.ConcreteColorings.43_0.jXeFS7nTQciTQGN
theorem chromaticNumber_pathGraph (n : β„•) (h : 2 ≀ n) : (pathGraph n).chromaticNumber = 2
Mathlib_Combinatorics_SimpleGraph_ConcreteColorings
n : β„• h : 2 ≀ n hc : Colorable (pathGraph n) (Fintype.card Bool) ⊒ chromaticNumber (pathGraph n) = 2
/- Copyright (c) 2023 IvΓ‘n Renison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: IvΓ‘n Renison -/ import Mathlib.Combinatorics.SimpleGraph.Coloring import Mathlib.Combinatorics.SimpleGraph.Hasse import Mathlib.Data.Nat.Parity import Mathlib.Data.ZMod.Basic /-! # Concrete colorings of common graphs This file defines colorings for some common graphs ## Main declarations * `SimpleGraph.pathGraph.bicoloring`: Bicoloring of a path graph. -/ namespace SimpleGraph /-- Bicoloring of a path graph -/ def pathGraph.bicoloring (n : β„•) : Coloring (pathGraph n) Bool := Coloring.mk (fun u ↦ u.val % 2 = 0) <| by intro u v rw [pathGraph_adj] rintro (h | h) <;> simp [← h, not_iff, Nat.succ_mod_two_eq_zero_iff] /-- Embedding of `pathGraph 2` into the first two elements of `pathGraph n` for `2 ≀ n` -/ def pathGraph_two_embedding (n : β„•) (h : 2 ≀ n) : pathGraph 2 β†ͺg pathGraph n where toFun v := ⟨v, trans v.2 h⟩ inj' := by rintro v w rw [Fin.mk.injEq] exact Fin.ext map_rel_iff' := by intro v w fin_cases v <;> fin_cases w <;> simp [pathGraph, ← Fin.coe_covby_iff] theorem chromaticNumber_pathGraph (n : β„•) (h : 2 ≀ n) : (pathGraph n).chromaticNumber = 2 := by have hc := (pathGraph.bicoloring n).to_colorable
apply le_antisymm
theorem chromaticNumber_pathGraph (n : β„•) (h : 2 ≀ n) : (pathGraph n).chromaticNumber = 2 := by have hc := (pathGraph.bicoloring n).to_colorable
Mathlib.Combinatorics.SimpleGraph.ConcreteColorings.43_0.jXeFS7nTQciTQGN
theorem chromaticNumber_pathGraph (n : β„•) (h : 2 ≀ n) : (pathGraph n).chromaticNumber = 2
Mathlib_Combinatorics_SimpleGraph_ConcreteColorings
case a n : β„• h : 2 ≀ n hc : Colorable (pathGraph n) (Fintype.card Bool) ⊒ chromaticNumber (pathGraph n) ≀ 2
/- Copyright (c) 2023 IvΓ‘n Renison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: IvΓ‘n Renison -/ import Mathlib.Combinatorics.SimpleGraph.Coloring import Mathlib.Combinatorics.SimpleGraph.Hasse import Mathlib.Data.Nat.Parity import Mathlib.Data.ZMod.Basic /-! # Concrete colorings of common graphs This file defines colorings for some common graphs ## Main declarations * `SimpleGraph.pathGraph.bicoloring`: Bicoloring of a path graph. -/ namespace SimpleGraph /-- Bicoloring of a path graph -/ def pathGraph.bicoloring (n : β„•) : Coloring (pathGraph n) Bool := Coloring.mk (fun u ↦ u.val % 2 = 0) <| by intro u v rw [pathGraph_adj] rintro (h | h) <;> simp [← h, not_iff, Nat.succ_mod_two_eq_zero_iff] /-- Embedding of `pathGraph 2` into the first two elements of `pathGraph n` for `2 ≀ n` -/ def pathGraph_two_embedding (n : β„•) (h : 2 ≀ n) : pathGraph 2 β†ͺg pathGraph n where toFun v := ⟨v, trans v.2 h⟩ inj' := by rintro v w rw [Fin.mk.injEq] exact Fin.ext map_rel_iff' := by intro v w fin_cases v <;> fin_cases w <;> simp [pathGraph, ← Fin.coe_covby_iff] theorem chromaticNumber_pathGraph (n : β„•) (h : 2 ≀ n) : (pathGraph n).chromaticNumber = 2 := by have hc := (pathGraph.bicoloring n).to_colorable apply le_antisymm Β·
exact chromaticNumber_le_of_colorable hc
theorem chromaticNumber_pathGraph (n : β„•) (h : 2 ≀ n) : (pathGraph n).chromaticNumber = 2 := by have hc := (pathGraph.bicoloring n).to_colorable apply le_antisymm Β·
Mathlib.Combinatorics.SimpleGraph.ConcreteColorings.43_0.jXeFS7nTQciTQGN
theorem chromaticNumber_pathGraph (n : β„•) (h : 2 ≀ n) : (pathGraph n).chromaticNumber = 2
Mathlib_Combinatorics_SimpleGraph_ConcreteColorings
case a n : β„• h : 2 ≀ n hc : Colorable (pathGraph n) (Fintype.card Bool) ⊒ 2 ≀ chromaticNumber (pathGraph n)
/- Copyright (c) 2023 IvΓ‘n Renison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: IvΓ‘n Renison -/ import Mathlib.Combinatorics.SimpleGraph.Coloring import Mathlib.Combinatorics.SimpleGraph.Hasse import Mathlib.Data.Nat.Parity import Mathlib.Data.ZMod.Basic /-! # Concrete colorings of common graphs This file defines colorings for some common graphs ## Main declarations * `SimpleGraph.pathGraph.bicoloring`: Bicoloring of a path graph. -/ namespace SimpleGraph /-- Bicoloring of a path graph -/ def pathGraph.bicoloring (n : β„•) : Coloring (pathGraph n) Bool := Coloring.mk (fun u ↦ u.val % 2 = 0) <| by intro u v rw [pathGraph_adj] rintro (h | h) <;> simp [← h, not_iff, Nat.succ_mod_two_eq_zero_iff] /-- Embedding of `pathGraph 2` into the first two elements of `pathGraph n` for `2 ≀ n` -/ def pathGraph_two_embedding (n : β„•) (h : 2 ≀ n) : pathGraph 2 β†ͺg pathGraph n where toFun v := ⟨v, trans v.2 h⟩ inj' := by rintro v w rw [Fin.mk.injEq] exact Fin.ext map_rel_iff' := by intro v w fin_cases v <;> fin_cases w <;> simp [pathGraph, ← Fin.coe_covby_iff] theorem chromaticNumber_pathGraph (n : β„•) (h : 2 ≀ n) : (pathGraph n).chromaticNumber = 2 := by have hc := (pathGraph.bicoloring n).to_colorable apply le_antisymm Β· exact chromaticNumber_le_of_colorable hc Β·
simpa only [pathGraph_two_eq_top, chromaticNumber_top] using hc.chromaticNumber_mono_of_embedding (pathGraph_two_embedding n h)
theorem chromaticNumber_pathGraph (n : β„•) (h : 2 ≀ n) : (pathGraph n).chromaticNumber = 2 := by have hc := (pathGraph.bicoloring n).to_colorable apply le_antisymm Β· exact chromaticNumber_le_of_colorable hc Β·
Mathlib.Combinatorics.SimpleGraph.ConcreteColorings.43_0.jXeFS7nTQciTQGN
theorem chromaticNumber_pathGraph (n : β„•) (h : 2 ≀ n) : (pathGraph n).chromaticNumber = 2
Mathlib_Combinatorics_SimpleGraph_ConcreteColorings
k : Type u inst✝² : Field k K : Type v inst✝¹ : Field K inst✝ : IsSepClosed K f : k β†’+* K p : k[X] h : Separable p ⊒ Splits f p
/- Copyright (c) 2023 Jz Pan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jz Pan -/ import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure /-! # Separably Closed Field In this file we define the typeclass for separably closed fields and separable closures, and prove some of their properties. ## Main Definitions - `IsSepClosed k` is the typeclass saying `k` is a separably closed field, i.e. every separable polynomial in `k` splits. - `IsSepClosure k K` is the typeclass saying `K` is a separable closure of `k`, where `k` is a field. This means that `K` is separably closed and separable over `k`. - `IsSepClosed.lift` is a map from a separable extension `L` of `K`, into any separably closed extension `M` of `K`. - `IsSepClosure.equiv` is a proof that any two separable closures of the same field are isomorphic. ## Tags separable closure, separably closed ## TODO - Maximal separable subextension of `K/k`, consisting of all elements of `K` which are separable over `k`. - If `K` is a separably closed field containing `k`, then the maximal separable subextension of `K/k` is a separable closure of `k`. - In particular, a separable closure exists. - If `k` is a perfect field, then its separable closure coincides with its algebraic closure. - An algebraic extension of a separably closed field is purely inseparable. -/ universe u v w open scoped Classical BigOperators Polynomial open Polynomial variable (k : Type u) [Field k] (K : Type v) [Field K] /-- Typeclass for separably closed fields. To show `Polynomial.Splits p f` for an arbitrary ring homomorphism `f`, see `IsSepClosed.splits_codomain` and `IsSepClosed.splits_domain`. -/ class IsSepClosed : Prop where splits_of_separable : βˆ€ p : k[X], p.Separable β†’ (p.Splits <| RingHom.id k) /-- An algebraically closed field is also separably closed. -/ instance IsSepClosed.of_isAlgClosed [IsAlgClosed k] : IsSepClosed k := ⟨fun p _ ↦ IsAlgClosed.splits p⟩ variable {k} {K} /-- Every separable polynomial splits in the field extension `f : k β†’+* K` if `K` is separably closed. See also `IsSepClosed.splits_domain` for the case where `k` is separably closed. -/ theorem IsSepClosed.splits_codomain [IsSepClosed K] {f : k β†’+* K} (p : k[X]) (h : p.Separable) : p.Splits f := by
convert IsSepClosed.splits_of_separable (p.map f) (Separable.map h)
/-- Every separable polynomial splits in the field extension `f : k β†’+* K` if `K` is separably closed. See also `IsSepClosed.splits_domain` for the case where `k` is separably closed. -/ theorem IsSepClosed.splits_codomain [IsSepClosed K] {f : k β†’+* K} (p : k[X]) (h : p.Separable) : p.Splits f := by
Mathlib.FieldTheory.IsSepClosed.70_0.3ZRqn1f8ZTqE2nc
/-- Every separable polynomial splits in the field extension `f : k β†’+* K` if `K` is separably closed. See also `IsSepClosed.splits_domain` for the case where `k` is separably closed. -/ theorem IsSepClosed.splits_codomain [IsSepClosed K] {f : k β†’+* K} (p : k[X]) (h : p.Separable) : p.Splits f
Mathlib_FieldTheory_IsSepClosed
case a k : Type u inst✝² : Field k K : Type v inst✝¹ : Field K inst✝ : IsSepClosed K f : k β†’+* K p : k[X] h : Separable p ⊒ Splits f p ↔ Splits (RingHom.id K) (map f p)
/- Copyright (c) 2023 Jz Pan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jz Pan -/ import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure /-! # Separably Closed Field In this file we define the typeclass for separably closed fields and separable closures, and prove some of their properties. ## Main Definitions - `IsSepClosed k` is the typeclass saying `k` is a separably closed field, i.e. every separable polynomial in `k` splits. - `IsSepClosure k K` is the typeclass saying `K` is a separable closure of `k`, where `k` is a field. This means that `K` is separably closed and separable over `k`. - `IsSepClosed.lift` is a map from a separable extension `L` of `K`, into any separably closed extension `M` of `K`. - `IsSepClosure.equiv` is a proof that any two separable closures of the same field are isomorphic. ## Tags separable closure, separably closed ## TODO - Maximal separable subextension of `K/k`, consisting of all elements of `K` which are separable over `k`. - If `K` is a separably closed field containing `k`, then the maximal separable subextension of `K/k` is a separable closure of `k`. - In particular, a separable closure exists. - If `k` is a perfect field, then its separable closure coincides with its algebraic closure. - An algebraic extension of a separably closed field is purely inseparable. -/ universe u v w open scoped Classical BigOperators Polynomial open Polynomial variable (k : Type u) [Field k] (K : Type v) [Field K] /-- Typeclass for separably closed fields. To show `Polynomial.Splits p f` for an arbitrary ring homomorphism `f`, see `IsSepClosed.splits_codomain` and `IsSepClosed.splits_domain`. -/ class IsSepClosed : Prop where splits_of_separable : βˆ€ p : k[X], p.Separable β†’ (p.Splits <| RingHom.id k) /-- An algebraically closed field is also separably closed. -/ instance IsSepClosed.of_isAlgClosed [IsAlgClosed k] : IsSepClosed k := ⟨fun p _ ↦ IsAlgClosed.splits p⟩ variable {k} {K} /-- Every separable polynomial splits in the field extension `f : k β†’+* K` if `K` is separably closed. See also `IsSepClosed.splits_domain` for the case where `k` is separably closed. -/ theorem IsSepClosed.splits_codomain [IsSepClosed K] {f : k β†’+* K} (p : k[X]) (h : p.Separable) : p.Splits f := by convert IsSepClosed.splits_of_separable (p.map f) (Separable.map h);
simp [splits_map_iff]
/-- Every separable polynomial splits in the field extension `f : k β†’+* K` if `K` is separably closed. See also `IsSepClosed.splits_domain` for the case where `k` is separably closed. -/ theorem IsSepClosed.splits_codomain [IsSepClosed K] {f : k β†’+* K} (p : k[X]) (h : p.Separable) : p.Splits f := by convert IsSepClosed.splits_of_separable (p.map f) (Separable.map h);
Mathlib.FieldTheory.IsSepClosed.70_0.3ZRqn1f8ZTqE2nc
/-- Every separable polynomial splits in the field extension `f : k β†’+* K` if `K` is separably closed. See also `IsSepClosed.splits_domain` for the case where `k` is separably closed. -/ theorem IsSepClosed.splits_codomain [IsSepClosed K] {f : k β†’+* K} (p : k[X]) (h : p.Separable) : p.Splits f
Mathlib_FieldTheory_IsSepClosed
k : Type u inst✝² : Field k K : Type v inst✝¹ : Field K inst✝ : IsSepClosed k x : k n : β„• hn : NeZero ↑n ⊒ βˆƒ z, z ^ n = x
/- Copyright (c) 2023 Jz Pan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jz Pan -/ import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure /-! # Separably Closed Field In this file we define the typeclass for separably closed fields and separable closures, and prove some of their properties. ## Main Definitions - `IsSepClosed k` is the typeclass saying `k` is a separably closed field, i.e. every separable polynomial in `k` splits. - `IsSepClosure k K` is the typeclass saying `K` is a separable closure of `k`, where `k` is a field. This means that `K` is separably closed and separable over `k`. - `IsSepClosed.lift` is a map from a separable extension `L` of `K`, into any separably closed extension `M` of `K`. - `IsSepClosure.equiv` is a proof that any two separable closures of the same field are isomorphic. ## Tags separable closure, separably closed ## TODO - Maximal separable subextension of `K/k`, consisting of all elements of `K` which are separable over `k`. - If `K` is a separably closed field containing `k`, then the maximal separable subextension of `K/k` is a separable closure of `k`. - In particular, a separable closure exists. - If `k` is a perfect field, then its separable closure coincides with its algebraic closure. - An algebraic extension of a separably closed field is purely inseparable. -/ universe u v w open scoped Classical BigOperators Polynomial open Polynomial variable (k : Type u) [Field k] (K : Type v) [Field K] /-- Typeclass for separably closed fields. To show `Polynomial.Splits p f` for an arbitrary ring homomorphism `f`, see `IsSepClosed.splits_codomain` and `IsSepClosed.splits_domain`. -/ class IsSepClosed : Prop where splits_of_separable : βˆ€ p : k[X], p.Separable β†’ (p.Splits <| RingHom.id k) /-- An algebraically closed field is also separably closed. -/ instance IsSepClosed.of_isAlgClosed [IsAlgClosed k] : IsSepClosed k := ⟨fun p _ ↦ IsAlgClosed.splits p⟩ variable {k} {K} /-- Every separable polynomial splits in the field extension `f : k β†’+* K` if `K` is separably closed. See also `IsSepClosed.splits_domain` for the case where `k` is separably closed. -/ theorem IsSepClosed.splits_codomain [IsSepClosed K] {f : k β†’+* K} (p : k[X]) (h : p.Separable) : p.Splits f := by convert IsSepClosed.splits_of_separable (p.map f) (Separable.map h); simp [splits_map_iff] /-- Every separable polynomial splits in the field extension `f : k β†’+* K` if `k` is separably closed. See also `IsSepClosed.splits_codomain` for the case where `k` is separably closed. -/ theorem IsSepClosed.splits_domain [IsSepClosed k] {f : k β†’+* K} (p : k[X]) (h : p.Separable) : p.Splits f := Polynomial.splits_of_splits_id _ <| IsSepClosed.splits_of_separable _ h namespace IsSepClosed theorem exists_root [IsSepClosed k] (p : k[X]) (hp : p.degree β‰  0) (hsep : p.Separable) : βˆƒ x, IsRoot p x := exists_root_of_splits _ (IsSepClosed.splits_of_separable p hsep) hp theorem exists_pow_nat_eq [IsSepClosed k] (x : k) (n : β„•) [hn : NeZero (n : k)] : βˆƒ z, z ^ n = x := by
have hn' : 0 < n := Nat.pos_of_ne_zero <| fun h => by rw [h, Nat.cast_zero] at hn exact hn.out rfl
theorem exists_pow_nat_eq [IsSepClosed k] (x : k) (n : β„•) [hn : NeZero (n : k)] : βˆƒ z, z ^ n = x := by
Mathlib.FieldTheory.IsSepClosed.94_0.3ZRqn1f8ZTqE2nc
theorem exists_pow_nat_eq [IsSepClosed k] (x : k) (n : β„•) [hn : NeZero (n : k)] : βˆƒ z, z ^ n = x
Mathlib_FieldTheory_IsSepClosed
k : Type u inst✝² : Field k K : Type v inst✝¹ : Field K inst✝ : IsSepClosed k x : k n : β„• hn : NeZero ↑n h : n = 0 ⊒ False
/- Copyright (c) 2023 Jz Pan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jz Pan -/ import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure /-! # Separably Closed Field In this file we define the typeclass for separably closed fields and separable closures, and prove some of their properties. ## Main Definitions - `IsSepClosed k` is the typeclass saying `k` is a separably closed field, i.e. every separable polynomial in `k` splits. - `IsSepClosure k K` is the typeclass saying `K` is a separable closure of `k`, where `k` is a field. This means that `K` is separably closed and separable over `k`. - `IsSepClosed.lift` is a map from a separable extension `L` of `K`, into any separably closed extension `M` of `K`. - `IsSepClosure.equiv` is a proof that any two separable closures of the same field are isomorphic. ## Tags separable closure, separably closed ## TODO - Maximal separable subextension of `K/k`, consisting of all elements of `K` which are separable over `k`. - If `K` is a separably closed field containing `k`, then the maximal separable subextension of `K/k` is a separable closure of `k`. - In particular, a separable closure exists. - If `k` is a perfect field, then its separable closure coincides with its algebraic closure. - An algebraic extension of a separably closed field is purely inseparable. -/ universe u v w open scoped Classical BigOperators Polynomial open Polynomial variable (k : Type u) [Field k] (K : Type v) [Field K] /-- Typeclass for separably closed fields. To show `Polynomial.Splits p f` for an arbitrary ring homomorphism `f`, see `IsSepClosed.splits_codomain` and `IsSepClosed.splits_domain`. -/ class IsSepClosed : Prop where splits_of_separable : βˆ€ p : k[X], p.Separable β†’ (p.Splits <| RingHom.id k) /-- An algebraically closed field is also separably closed. -/ instance IsSepClosed.of_isAlgClosed [IsAlgClosed k] : IsSepClosed k := ⟨fun p _ ↦ IsAlgClosed.splits p⟩ variable {k} {K} /-- Every separable polynomial splits in the field extension `f : k β†’+* K` if `K` is separably closed. See also `IsSepClosed.splits_domain` for the case where `k` is separably closed. -/ theorem IsSepClosed.splits_codomain [IsSepClosed K] {f : k β†’+* K} (p : k[X]) (h : p.Separable) : p.Splits f := by convert IsSepClosed.splits_of_separable (p.map f) (Separable.map h); simp [splits_map_iff] /-- Every separable polynomial splits in the field extension `f : k β†’+* K` if `k` is separably closed. See also `IsSepClosed.splits_codomain` for the case where `k` is separably closed. -/ theorem IsSepClosed.splits_domain [IsSepClosed k] {f : k β†’+* K} (p : k[X]) (h : p.Separable) : p.Splits f := Polynomial.splits_of_splits_id _ <| IsSepClosed.splits_of_separable _ h namespace IsSepClosed theorem exists_root [IsSepClosed k] (p : k[X]) (hp : p.degree β‰  0) (hsep : p.Separable) : βˆƒ x, IsRoot p x := exists_root_of_splits _ (IsSepClosed.splits_of_separable p hsep) hp theorem exists_pow_nat_eq [IsSepClosed k] (x : k) (n : β„•) [hn : NeZero (n : k)] : βˆƒ z, z ^ n = x := by have hn' : 0 < n := Nat.pos_of_ne_zero <| fun h => by
rw [h, Nat.cast_zero] at hn
theorem exists_pow_nat_eq [IsSepClosed k] (x : k) (n : β„•) [hn : NeZero (n : k)] : βˆƒ z, z ^ n = x := by have hn' : 0 < n := Nat.pos_of_ne_zero <| fun h => by
Mathlib.FieldTheory.IsSepClosed.94_0.3ZRqn1f8ZTqE2nc
theorem exists_pow_nat_eq [IsSepClosed k] (x : k) (n : β„•) [hn : NeZero (n : k)] : βˆƒ z, z ^ n = x
Mathlib_FieldTheory_IsSepClosed
k : Type u inst✝² : Field k K : Type v inst✝¹ : Field K inst✝ : IsSepClosed k x : k n : β„• hn : NeZero 0 h : n = 0 ⊒ False
/- Copyright (c) 2023 Jz Pan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jz Pan -/ import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure /-! # Separably Closed Field In this file we define the typeclass for separably closed fields and separable closures, and prove some of their properties. ## Main Definitions - `IsSepClosed k` is the typeclass saying `k` is a separably closed field, i.e. every separable polynomial in `k` splits. - `IsSepClosure k K` is the typeclass saying `K` is a separable closure of `k`, where `k` is a field. This means that `K` is separably closed and separable over `k`. - `IsSepClosed.lift` is a map from a separable extension `L` of `K`, into any separably closed extension `M` of `K`. - `IsSepClosure.equiv` is a proof that any two separable closures of the same field are isomorphic. ## Tags separable closure, separably closed ## TODO - Maximal separable subextension of `K/k`, consisting of all elements of `K` which are separable over `k`. - If `K` is a separably closed field containing `k`, then the maximal separable subextension of `K/k` is a separable closure of `k`. - In particular, a separable closure exists. - If `k` is a perfect field, then its separable closure coincides with its algebraic closure. - An algebraic extension of a separably closed field is purely inseparable. -/ universe u v w open scoped Classical BigOperators Polynomial open Polynomial variable (k : Type u) [Field k] (K : Type v) [Field K] /-- Typeclass for separably closed fields. To show `Polynomial.Splits p f` for an arbitrary ring homomorphism `f`, see `IsSepClosed.splits_codomain` and `IsSepClosed.splits_domain`. -/ class IsSepClosed : Prop where splits_of_separable : βˆ€ p : k[X], p.Separable β†’ (p.Splits <| RingHom.id k) /-- An algebraically closed field is also separably closed. -/ instance IsSepClosed.of_isAlgClosed [IsAlgClosed k] : IsSepClosed k := ⟨fun p _ ↦ IsAlgClosed.splits p⟩ variable {k} {K} /-- Every separable polynomial splits in the field extension `f : k β†’+* K` if `K` is separably closed. See also `IsSepClosed.splits_domain` for the case where `k` is separably closed. -/ theorem IsSepClosed.splits_codomain [IsSepClosed K] {f : k β†’+* K} (p : k[X]) (h : p.Separable) : p.Splits f := by convert IsSepClosed.splits_of_separable (p.map f) (Separable.map h); simp [splits_map_iff] /-- Every separable polynomial splits in the field extension `f : k β†’+* K` if `k` is separably closed. See also `IsSepClosed.splits_codomain` for the case where `k` is separably closed. -/ theorem IsSepClosed.splits_domain [IsSepClosed k] {f : k β†’+* K} (p : k[X]) (h : p.Separable) : p.Splits f := Polynomial.splits_of_splits_id _ <| IsSepClosed.splits_of_separable _ h namespace IsSepClosed theorem exists_root [IsSepClosed k] (p : k[X]) (hp : p.degree β‰  0) (hsep : p.Separable) : βˆƒ x, IsRoot p x := exists_root_of_splits _ (IsSepClosed.splits_of_separable p hsep) hp theorem exists_pow_nat_eq [IsSepClosed k] (x : k) (n : β„•) [hn : NeZero (n : k)] : βˆƒ z, z ^ n = x := by have hn' : 0 < n := Nat.pos_of_ne_zero <| fun h => by rw [h, Nat.cast_zero] at hn
exact hn.out rfl
theorem exists_pow_nat_eq [IsSepClosed k] (x : k) (n : β„•) [hn : NeZero (n : k)] : βˆƒ z, z ^ n = x := by have hn' : 0 < n := Nat.pos_of_ne_zero <| fun h => by rw [h, Nat.cast_zero] at hn
Mathlib.FieldTheory.IsSepClosed.94_0.3ZRqn1f8ZTqE2nc
theorem exists_pow_nat_eq [IsSepClosed k] (x : k) (n : β„•) [hn : NeZero (n : k)] : βˆƒ z, z ^ n = x
Mathlib_FieldTheory_IsSepClosed
k : Type u inst✝² : Field k K : Type v inst✝¹ : Field K inst✝ : IsSepClosed k x : k n : β„• hn : NeZero ↑n hn' : 0 < n ⊒ βˆƒ z, z ^ n = x
/- Copyright (c) 2023 Jz Pan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jz Pan -/ import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure /-! # Separably Closed Field In this file we define the typeclass for separably closed fields and separable closures, and prove some of their properties. ## Main Definitions - `IsSepClosed k` is the typeclass saying `k` is a separably closed field, i.e. every separable polynomial in `k` splits. - `IsSepClosure k K` is the typeclass saying `K` is a separable closure of `k`, where `k` is a field. This means that `K` is separably closed and separable over `k`. - `IsSepClosed.lift` is a map from a separable extension `L` of `K`, into any separably closed extension `M` of `K`. - `IsSepClosure.equiv` is a proof that any two separable closures of the same field are isomorphic. ## Tags separable closure, separably closed ## TODO - Maximal separable subextension of `K/k`, consisting of all elements of `K` which are separable over `k`. - If `K` is a separably closed field containing `k`, then the maximal separable subextension of `K/k` is a separable closure of `k`. - In particular, a separable closure exists. - If `k` is a perfect field, then its separable closure coincides with its algebraic closure. - An algebraic extension of a separably closed field is purely inseparable. -/ universe u v w open scoped Classical BigOperators Polynomial open Polynomial variable (k : Type u) [Field k] (K : Type v) [Field K] /-- Typeclass for separably closed fields. To show `Polynomial.Splits p f` for an arbitrary ring homomorphism `f`, see `IsSepClosed.splits_codomain` and `IsSepClosed.splits_domain`. -/ class IsSepClosed : Prop where splits_of_separable : βˆ€ p : k[X], p.Separable β†’ (p.Splits <| RingHom.id k) /-- An algebraically closed field is also separably closed. -/ instance IsSepClosed.of_isAlgClosed [IsAlgClosed k] : IsSepClosed k := ⟨fun p _ ↦ IsAlgClosed.splits p⟩ variable {k} {K} /-- Every separable polynomial splits in the field extension `f : k β†’+* K` if `K` is separably closed. See also `IsSepClosed.splits_domain` for the case where `k` is separably closed. -/ theorem IsSepClosed.splits_codomain [IsSepClosed K] {f : k β†’+* K} (p : k[X]) (h : p.Separable) : p.Splits f := by convert IsSepClosed.splits_of_separable (p.map f) (Separable.map h); simp [splits_map_iff] /-- Every separable polynomial splits in the field extension `f : k β†’+* K` if `k` is separably closed. See also `IsSepClosed.splits_codomain` for the case where `k` is separably closed. -/ theorem IsSepClosed.splits_domain [IsSepClosed k] {f : k β†’+* K} (p : k[X]) (h : p.Separable) : p.Splits f := Polynomial.splits_of_splits_id _ <| IsSepClosed.splits_of_separable _ h namespace IsSepClosed theorem exists_root [IsSepClosed k] (p : k[X]) (hp : p.degree β‰  0) (hsep : p.Separable) : βˆƒ x, IsRoot p x := exists_root_of_splits _ (IsSepClosed.splits_of_separable p hsep) hp theorem exists_pow_nat_eq [IsSepClosed k] (x : k) (n : β„•) [hn : NeZero (n : k)] : βˆƒ z, z ^ n = x := by have hn' : 0 < n := Nat.pos_of_ne_zero <| fun h => by rw [h, Nat.cast_zero] at hn exact hn.out rfl
have : degree (X ^ n - C x) β‰  0 := by rw [degree_X_pow_sub_C hn' x] exact (WithBot.coe_lt_coe.2 hn').ne'
theorem exists_pow_nat_eq [IsSepClosed k] (x : k) (n : β„•) [hn : NeZero (n : k)] : βˆƒ z, z ^ n = x := by have hn' : 0 < n := Nat.pos_of_ne_zero <| fun h => by rw [h, Nat.cast_zero] at hn exact hn.out rfl
Mathlib.FieldTheory.IsSepClosed.94_0.3ZRqn1f8ZTqE2nc
theorem exists_pow_nat_eq [IsSepClosed k] (x : k) (n : β„•) [hn : NeZero (n : k)] : βˆƒ z, z ^ n = x
Mathlib_FieldTheory_IsSepClosed
k : Type u inst✝² : Field k K : Type v inst✝¹ : Field K inst✝ : IsSepClosed k x : k n : β„• hn : NeZero ↑n hn' : 0 < n ⊒ degree (X ^ n - C x) β‰  0
/- Copyright (c) 2023 Jz Pan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jz Pan -/ import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure /-! # Separably Closed Field In this file we define the typeclass for separably closed fields and separable closures, and prove some of their properties. ## Main Definitions - `IsSepClosed k` is the typeclass saying `k` is a separably closed field, i.e. every separable polynomial in `k` splits. - `IsSepClosure k K` is the typeclass saying `K` is a separable closure of `k`, where `k` is a field. This means that `K` is separably closed and separable over `k`. - `IsSepClosed.lift` is a map from a separable extension `L` of `K`, into any separably closed extension `M` of `K`. - `IsSepClosure.equiv` is a proof that any two separable closures of the same field are isomorphic. ## Tags separable closure, separably closed ## TODO - Maximal separable subextension of `K/k`, consisting of all elements of `K` which are separable over `k`. - If `K` is a separably closed field containing `k`, then the maximal separable subextension of `K/k` is a separable closure of `k`. - In particular, a separable closure exists. - If `k` is a perfect field, then its separable closure coincides with its algebraic closure. - An algebraic extension of a separably closed field is purely inseparable. -/ universe u v w open scoped Classical BigOperators Polynomial open Polynomial variable (k : Type u) [Field k] (K : Type v) [Field K] /-- Typeclass for separably closed fields. To show `Polynomial.Splits p f` for an arbitrary ring homomorphism `f`, see `IsSepClosed.splits_codomain` and `IsSepClosed.splits_domain`. -/ class IsSepClosed : Prop where splits_of_separable : βˆ€ p : k[X], p.Separable β†’ (p.Splits <| RingHom.id k) /-- An algebraically closed field is also separably closed. -/ instance IsSepClosed.of_isAlgClosed [IsAlgClosed k] : IsSepClosed k := ⟨fun p _ ↦ IsAlgClosed.splits p⟩ variable {k} {K} /-- Every separable polynomial splits in the field extension `f : k β†’+* K` if `K` is separably closed. See also `IsSepClosed.splits_domain` for the case where `k` is separably closed. -/ theorem IsSepClosed.splits_codomain [IsSepClosed K] {f : k β†’+* K} (p : k[X]) (h : p.Separable) : p.Splits f := by convert IsSepClosed.splits_of_separable (p.map f) (Separable.map h); simp [splits_map_iff] /-- Every separable polynomial splits in the field extension `f : k β†’+* K` if `k` is separably closed. See also `IsSepClosed.splits_codomain` for the case where `k` is separably closed. -/ theorem IsSepClosed.splits_domain [IsSepClosed k] {f : k β†’+* K} (p : k[X]) (h : p.Separable) : p.Splits f := Polynomial.splits_of_splits_id _ <| IsSepClosed.splits_of_separable _ h namespace IsSepClosed theorem exists_root [IsSepClosed k] (p : k[X]) (hp : p.degree β‰  0) (hsep : p.Separable) : βˆƒ x, IsRoot p x := exists_root_of_splits _ (IsSepClosed.splits_of_separable p hsep) hp theorem exists_pow_nat_eq [IsSepClosed k] (x : k) (n : β„•) [hn : NeZero (n : k)] : βˆƒ z, z ^ n = x := by have hn' : 0 < n := Nat.pos_of_ne_zero <| fun h => by rw [h, Nat.cast_zero] at hn exact hn.out rfl have : degree (X ^ n - C x) β‰  0 := by
rw [degree_X_pow_sub_C hn' x]
theorem exists_pow_nat_eq [IsSepClosed k] (x : k) (n : β„•) [hn : NeZero (n : k)] : βˆƒ z, z ^ n = x := by have hn' : 0 < n := Nat.pos_of_ne_zero <| fun h => by rw [h, Nat.cast_zero] at hn exact hn.out rfl have : degree (X ^ n - C x) β‰  0 := by
Mathlib.FieldTheory.IsSepClosed.94_0.3ZRqn1f8ZTqE2nc
theorem exists_pow_nat_eq [IsSepClosed k] (x : k) (n : β„•) [hn : NeZero (n : k)] : βˆƒ z, z ^ n = x
Mathlib_FieldTheory_IsSepClosed
k : Type u inst✝² : Field k K : Type v inst✝¹ : Field K inst✝ : IsSepClosed k x : k n : β„• hn : NeZero ↑n hn' : 0 < n ⊒ ↑n β‰  0
/- Copyright (c) 2023 Jz Pan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jz Pan -/ import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure /-! # Separably Closed Field In this file we define the typeclass for separably closed fields and separable closures, and prove some of their properties. ## Main Definitions - `IsSepClosed k` is the typeclass saying `k` is a separably closed field, i.e. every separable polynomial in `k` splits. - `IsSepClosure k K` is the typeclass saying `K` is a separable closure of `k`, where `k` is a field. This means that `K` is separably closed and separable over `k`. - `IsSepClosed.lift` is a map from a separable extension `L` of `K`, into any separably closed extension `M` of `K`. - `IsSepClosure.equiv` is a proof that any two separable closures of the same field are isomorphic. ## Tags separable closure, separably closed ## TODO - Maximal separable subextension of `K/k`, consisting of all elements of `K` which are separable over `k`. - If `K` is a separably closed field containing `k`, then the maximal separable subextension of `K/k` is a separable closure of `k`. - In particular, a separable closure exists. - If `k` is a perfect field, then its separable closure coincides with its algebraic closure. - An algebraic extension of a separably closed field is purely inseparable. -/ universe u v w open scoped Classical BigOperators Polynomial open Polynomial variable (k : Type u) [Field k] (K : Type v) [Field K] /-- Typeclass for separably closed fields. To show `Polynomial.Splits p f` for an arbitrary ring homomorphism `f`, see `IsSepClosed.splits_codomain` and `IsSepClosed.splits_domain`. -/ class IsSepClosed : Prop where splits_of_separable : βˆ€ p : k[X], p.Separable β†’ (p.Splits <| RingHom.id k) /-- An algebraically closed field is also separably closed. -/ instance IsSepClosed.of_isAlgClosed [IsAlgClosed k] : IsSepClosed k := ⟨fun p _ ↦ IsAlgClosed.splits p⟩ variable {k} {K} /-- Every separable polynomial splits in the field extension `f : k β†’+* K` if `K` is separably closed. See also `IsSepClosed.splits_domain` for the case where `k` is separably closed. -/ theorem IsSepClosed.splits_codomain [IsSepClosed K] {f : k β†’+* K} (p : k[X]) (h : p.Separable) : p.Splits f := by convert IsSepClosed.splits_of_separable (p.map f) (Separable.map h); simp [splits_map_iff] /-- Every separable polynomial splits in the field extension `f : k β†’+* K` if `k` is separably closed. See also `IsSepClosed.splits_codomain` for the case where `k` is separably closed. -/ theorem IsSepClosed.splits_domain [IsSepClosed k] {f : k β†’+* K} (p : k[X]) (h : p.Separable) : p.Splits f := Polynomial.splits_of_splits_id _ <| IsSepClosed.splits_of_separable _ h namespace IsSepClosed theorem exists_root [IsSepClosed k] (p : k[X]) (hp : p.degree β‰  0) (hsep : p.Separable) : βˆƒ x, IsRoot p x := exists_root_of_splits _ (IsSepClosed.splits_of_separable p hsep) hp theorem exists_pow_nat_eq [IsSepClosed k] (x : k) (n : β„•) [hn : NeZero (n : k)] : βˆƒ z, z ^ n = x := by have hn' : 0 < n := Nat.pos_of_ne_zero <| fun h => by rw [h, Nat.cast_zero] at hn exact hn.out rfl have : degree (X ^ n - C x) β‰  0 := by rw [degree_X_pow_sub_C hn' x]
exact (WithBot.coe_lt_coe.2 hn').ne'
theorem exists_pow_nat_eq [IsSepClosed k] (x : k) (n : β„•) [hn : NeZero (n : k)] : βˆƒ z, z ^ n = x := by have hn' : 0 < n := Nat.pos_of_ne_zero <| fun h => by rw [h, Nat.cast_zero] at hn exact hn.out rfl have : degree (X ^ n - C x) β‰  0 := by rw [degree_X_pow_sub_C hn' x]
Mathlib.FieldTheory.IsSepClosed.94_0.3ZRqn1f8ZTqE2nc
theorem exists_pow_nat_eq [IsSepClosed k] (x : k) (n : β„•) [hn : NeZero (n : k)] : βˆƒ z, z ^ n = x
Mathlib_FieldTheory_IsSepClosed
k : Type u inst✝² : Field k K : Type v inst✝¹ : Field K inst✝ : IsSepClosed k x : k n : β„• hn : NeZero ↑n hn' : 0 < n this : degree (X ^ n - C x) β‰  0 ⊒ βˆƒ z, z ^ n = x
/- Copyright (c) 2023 Jz Pan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jz Pan -/ import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure /-! # Separably Closed Field In this file we define the typeclass for separably closed fields and separable closures, and prove some of their properties. ## Main Definitions - `IsSepClosed k` is the typeclass saying `k` is a separably closed field, i.e. every separable polynomial in `k` splits. - `IsSepClosure k K` is the typeclass saying `K` is a separable closure of `k`, where `k` is a field. This means that `K` is separably closed and separable over `k`. - `IsSepClosed.lift` is a map from a separable extension `L` of `K`, into any separably closed extension `M` of `K`. - `IsSepClosure.equiv` is a proof that any two separable closures of the same field are isomorphic. ## Tags separable closure, separably closed ## TODO - Maximal separable subextension of `K/k`, consisting of all elements of `K` which are separable over `k`. - If `K` is a separably closed field containing `k`, then the maximal separable subextension of `K/k` is a separable closure of `k`. - In particular, a separable closure exists. - If `k` is a perfect field, then its separable closure coincides with its algebraic closure. - An algebraic extension of a separably closed field is purely inseparable. -/ universe u v w open scoped Classical BigOperators Polynomial open Polynomial variable (k : Type u) [Field k] (K : Type v) [Field K] /-- Typeclass for separably closed fields. To show `Polynomial.Splits p f` for an arbitrary ring homomorphism `f`, see `IsSepClosed.splits_codomain` and `IsSepClosed.splits_domain`. -/ class IsSepClosed : Prop where splits_of_separable : βˆ€ p : k[X], p.Separable β†’ (p.Splits <| RingHom.id k) /-- An algebraically closed field is also separably closed. -/ instance IsSepClosed.of_isAlgClosed [IsAlgClosed k] : IsSepClosed k := ⟨fun p _ ↦ IsAlgClosed.splits p⟩ variable {k} {K} /-- Every separable polynomial splits in the field extension `f : k β†’+* K` if `K` is separably closed. See also `IsSepClosed.splits_domain` for the case where `k` is separably closed. -/ theorem IsSepClosed.splits_codomain [IsSepClosed K] {f : k β†’+* K} (p : k[X]) (h : p.Separable) : p.Splits f := by convert IsSepClosed.splits_of_separable (p.map f) (Separable.map h); simp [splits_map_iff] /-- Every separable polynomial splits in the field extension `f : k β†’+* K` if `k` is separably closed. See also `IsSepClosed.splits_codomain` for the case where `k` is separably closed. -/ theorem IsSepClosed.splits_domain [IsSepClosed k] {f : k β†’+* K} (p : k[X]) (h : p.Separable) : p.Splits f := Polynomial.splits_of_splits_id _ <| IsSepClosed.splits_of_separable _ h namespace IsSepClosed theorem exists_root [IsSepClosed k] (p : k[X]) (hp : p.degree β‰  0) (hsep : p.Separable) : βˆƒ x, IsRoot p x := exists_root_of_splits _ (IsSepClosed.splits_of_separable p hsep) hp theorem exists_pow_nat_eq [IsSepClosed k] (x : k) (n : β„•) [hn : NeZero (n : k)] : βˆƒ z, z ^ n = x := by have hn' : 0 < n := Nat.pos_of_ne_zero <| fun h => by rw [h, Nat.cast_zero] at hn exact hn.out rfl have : degree (X ^ n - C x) β‰  0 := by rw [degree_X_pow_sub_C hn' x] exact (WithBot.coe_lt_coe.2 hn').ne'
by_cases hx : x = 0
theorem exists_pow_nat_eq [IsSepClosed k] (x : k) (n : β„•) [hn : NeZero (n : k)] : βˆƒ z, z ^ n = x := by have hn' : 0 < n := Nat.pos_of_ne_zero <| fun h => by rw [h, Nat.cast_zero] at hn exact hn.out rfl have : degree (X ^ n - C x) β‰  0 := by rw [degree_X_pow_sub_C hn' x] exact (WithBot.coe_lt_coe.2 hn').ne'
Mathlib.FieldTheory.IsSepClosed.94_0.3ZRqn1f8ZTqE2nc
theorem exists_pow_nat_eq [IsSepClosed k] (x : k) (n : β„•) [hn : NeZero (n : k)] : βˆƒ z, z ^ n = x
Mathlib_FieldTheory_IsSepClosed
case pos k : Type u inst✝² : Field k K : Type v inst✝¹ : Field K inst✝ : IsSepClosed k x : k n : β„• hn : NeZero ↑n hn' : 0 < n this : degree (X ^ n - C x) β‰  0 hx : x = 0 ⊒ βˆƒ z, z ^ n = x
/- Copyright (c) 2023 Jz Pan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jz Pan -/ import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure /-! # Separably Closed Field In this file we define the typeclass for separably closed fields and separable closures, and prove some of their properties. ## Main Definitions - `IsSepClosed k` is the typeclass saying `k` is a separably closed field, i.e. every separable polynomial in `k` splits. - `IsSepClosure k K` is the typeclass saying `K` is a separable closure of `k`, where `k` is a field. This means that `K` is separably closed and separable over `k`. - `IsSepClosed.lift` is a map from a separable extension `L` of `K`, into any separably closed extension `M` of `K`. - `IsSepClosure.equiv` is a proof that any two separable closures of the same field are isomorphic. ## Tags separable closure, separably closed ## TODO - Maximal separable subextension of `K/k`, consisting of all elements of `K` which are separable over `k`. - If `K` is a separably closed field containing `k`, then the maximal separable subextension of `K/k` is a separable closure of `k`. - In particular, a separable closure exists. - If `k` is a perfect field, then its separable closure coincides with its algebraic closure. - An algebraic extension of a separably closed field is purely inseparable. -/ universe u v w open scoped Classical BigOperators Polynomial open Polynomial variable (k : Type u) [Field k] (K : Type v) [Field K] /-- Typeclass for separably closed fields. To show `Polynomial.Splits p f` for an arbitrary ring homomorphism `f`, see `IsSepClosed.splits_codomain` and `IsSepClosed.splits_domain`. -/ class IsSepClosed : Prop where splits_of_separable : βˆ€ p : k[X], p.Separable β†’ (p.Splits <| RingHom.id k) /-- An algebraically closed field is also separably closed. -/ instance IsSepClosed.of_isAlgClosed [IsAlgClosed k] : IsSepClosed k := ⟨fun p _ ↦ IsAlgClosed.splits p⟩ variable {k} {K} /-- Every separable polynomial splits in the field extension `f : k β†’+* K` if `K` is separably closed. See also `IsSepClosed.splits_domain` for the case where `k` is separably closed. -/ theorem IsSepClosed.splits_codomain [IsSepClosed K] {f : k β†’+* K} (p : k[X]) (h : p.Separable) : p.Splits f := by convert IsSepClosed.splits_of_separable (p.map f) (Separable.map h); simp [splits_map_iff] /-- Every separable polynomial splits in the field extension `f : k β†’+* K` if `k` is separably closed. See also `IsSepClosed.splits_codomain` for the case where `k` is separably closed. -/ theorem IsSepClosed.splits_domain [IsSepClosed k] {f : k β†’+* K} (p : k[X]) (h : p.Separable) : p.Splits f := Polynomial.splits_of_splits_id _ <| IsSepClosed.splits_of_separable _ h namespace IsSepClosed theorem exists_root [IsSepClosed k] (p : k[X]) (hp : p.degree β‰  0) (hsep : p.Separable) : βˆƒ x, IsRoot p x := exists_root_of_splits _ (IsSepClosed.splits_of_separable p hsep) hp theorem exists_pow_nat_eq [IsSepClosed k] (x : k) (n : β„•) [hn : NeZero (n : k)] : βˆƒ z, z ^ n = x := by have hn' : 0 < n := Nat.pos_of_ne_zero <| fun h => by rw [h, Nat.cast_zero] at hn exact hn.out rfl have : degree (X ^ n - C x) β‰  0 := by rw [degree_X_pow_sub_C hn' x] exact (WithBot.coe_lt_coe.2 hn').ne' by_cases hx : x = 0 Β·
exact ⟨0, by rw [hx, pow_eq_zero_iff hn']⟩
theorem exists_pow_nat_eq [IsSepClosed k] (x : k) (n : β„•) [hn : NeZero (n : k)] : βˆƒ z, z ^ n = x := by have hn' : 0 < n := Nat.pos_of_ne_zero <| fun h => by rw [h, Nat.cast_zero] at hn exact hn.out rfl have : degree (X ^ n - C x) β‰  0 := by rw [degree_X_pow_sub_C hn' x] exact (WithBot.coe_lt_coe.2 hn').ne' by_cases hx : x = 0 Β·
Mathlib.FieldTheory.IsSepClosed.94_0.3ZRqn1f8ZTqE2nc
theorem exists_pow_nat_eq [IsSepClosed k] (x : k) (n : β„•) [hn : NeZero (n : k)] : βˆƒ z, z ^ n = x
Mathlib_FieldTheory_IsSepClosed
k : Type u inst✝² : Field k K : Type v inst✝¹ : Field K inst✝ : IsSepClosed k x : k n : β„• hn : NeZero ↑n hn' : 0 < n this : degree (X ^ n - C x) β‰  0 hx : x = 0 ⊒ 0 ^ n = x
/- Copyright (c) 2023 Jz Pan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jz Pan -/ import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure /-! # Separably Closed Field In this file we define the typeclass for separably closed fields and separable closures, and prove some of their properties. ## Main Definitions - `IsSepClosed k` is the typeclass saying `k` is a separably closed field, i.e. every separable polynomial in `k` splits. - `IsSepClosure k K` is the typeclass saying `K` is a separable closure of `k`, where `k` is a field. This means that `K` is separably closed and separable over `k`. - `IsSepClosed.lift` is a map from a separable extension `L` of `K`, into any separably closed extension `M` of `K`. - `IsSepClosure.equiv` is a proof that any two separable closures of the same field are isomorphic. ## Tags separable closure, separably closed ## TODO - Maximal separable subextension of `K/k`, consisting of all elements of `K` which are separable over `k`. - If `K` is a separably closed field containing `k`, then the maximal separable subextension of `K/k` is a separable closure of `k`. - In particular, a separable closure exists. - If `k` is a perfect field, then its separable closure coincides with its algebraic closure. - An algebraic extension of a separably closed field is purely inseparable. -/ universe u v w open scoped Classical BigOperators Polynomial open Polynomial variable (k : Type u) [Field k] (K : Type v) [Field K] /-- Typeclass for separably closed fields. To show `Polynomial.Splits p f` for an arbitrary ring homomorphism `f`, see `IsSepClosed.splits_codomain` and `IsSepClosed.splits_domain`. -/ class IsSepClosed : Prop where splits_of_separable : βˆ€ p : k[X], p.Separable β†’ (p.Splits <| RingHom.id k) /-- An algebraically closed field is also separably closed. -/ instance IsSepClosed.of_isAlgClosed [IsAlgClosed k] : IsSepClosed k := ⟨fun p _ ↦ IsAlgClosed.splits p⟩ variable {k} {K} /-- Every separable polynomial splits in the field extension `f : k β†’+* K` if `K` is separably closed. See also `IsSepClosed.splits_domain` for the case where `k` is separably closed. -/ theorem IsSepClosed.splits_codomain [IsSepClosed K] {f : k β†’+* K} (p : k[X]) (h : p.Separable) : p.Splits f := by convert IsSepClosed.splits_of_separable (p.map f) (Separable.map h); simp [splits_map_iff] /-- Every separable polynomial splits in the field extension `f : k β†’+* K` if `k` is separably closed. See also `IsSepClosed.splits_codomain` for the case where `k` is separably closed. -/ theorem IsSepClosed.splits_domain [IsSepClosed k] {f : k β†’+* K} (p : k[X]) (h : p.Separable) : p.Splits f := Polynomial.splits_of_splits_id _ <| IsSepClosed.splits_of_separable _ h namespace IsSepClosed theorem exists_root [IsSepClosed k] (p : k[X]) (hp : p.degree β‰  0) (hsep : p.Separable) : βˆƒ x, IsRoot p x := exists_root_of_splits _ (IsSepClosed.splits_of_separable p hsep) hp theorem exists_pow_nat_eq [IsSepClosed k] (x : k) (n : β„•) [hn : NeZero (n : k)] : βˆƒ z, z ^ n = x := by have hn' : 0 < n := Nat.pos_of_ne_zero <| fun h => by rw [h, Nat.cast_zero] at hn exact hn.out rfl have : degree (X ^ n - C x) β‰  0 := by rw [degree_X_pow_sub_C hn' x] exact (WithBot.coe_lt_coe.2 hn').ne' by_cases hx : x = 0 Β· exact ⟨0, by
rw [hx, pow_eq_zero_iff hn']
theorem exists_pow_nat_eq [IsSepClosed k] (x : k) (n : β„•) [hn : NeZero (n : k)] : βˆƒ z, z ^ n = x := by have hn' : 0 < n := Nat.pos_of_ne_zero <| fun h => by rw [h, Nat.cast_zero] at hn exact hn.out rfl have : degree (X ^ n - C x) β‰  0 := by rw [degree_X_pow_sub_C hn' x] exact (WithBot.coe_lt_coe.2 hn').ne' by_cases hx : x = 0 Β· exact ⟨0, by
Mathlib.FieldTheory.IsSepClosed.94_0.3ZRqn1f8ZTqE2nc
theorem exists_pow_nat_eq [IsSepClosed k] (x : k) (n : β„•) [hn : NeZero (n : k)] : βˆƒ z, z ^ n = x
Mathlib_FieldTheory_IsSepClosed
case neg k : Type u inst✝² : Field k K : Type v inst✝¹ : Field K inst✝ : IsSepClosed k x : k n : β„• hn : NeZero ↑n hn' : 0 < n this : degree (X ^ n - C x) β‰  0 hx : Β¬x = 0 ⊒ βˆƒ z, z ^ n = x
/- Copyright (c) 2023 Jz Pan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jz Pan -/ import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure /-! # Separably Closed Field In this file we define the typeclass for separably closed fields and separable closures, and prove some of their properties. ## Main Definitions - `IsSepClosed k` is the typeclass saying `k` is a separably closed field, i.e. every separable polynomial in `k` splits. - `IsSepClosure k K` is the typeclass saying `K` is a separable closure of `k`, where `k` is a field. This means that `K` is separably closed and separable over `k`. - `IsSepClosed.lift` is a map from a separable extension `L` of `K`, into any separably closed extension `M` of `K`. - `IsSepClosure.equiv` is a proof that any two separable closures of the same field are isomorphic. ## Tags separable closure, separably closed ## TODO - Maximal separable subextension of `K/k`, consisting of all elements of `K` which are separable over `k`. - If `K` is a separably closed field containing `k`, then the maximal separable subextension of `K/k` is a separable closure of `k`. - In particular, a separable closure exists. - If `k` is a perfect field, then its separable closure coincides with its algebraic closure. - An algebraic extension of a separably closed field is purely inseparable. -/ universe u v w open scoped Classical BigOperators Polynomial open Polynomial variable (k : Type u) [Field k] (K : Type v) [Field K] /-- Typeclass for separably closed fields. To show `Polynomial.Splits p f` for an arbitrary ring homomorphism `f`, see `IsSepClosed.splits_codomain` and `IsSepClosed.splits_domain`. -/ class IsSepClosed : Prop where splits_of_separable : βˆ€ p : k[X], p.Separable β†’ (p.Splits <| RingHom.id k) /-- An algebraically closed field is also separably closed. -/ instance IsSepClosed.of_isAlgClosed [IsAlgClosed k] : IsSepClosed k := ⟨fun p _ ↦ IsAlgClosed.splits p⟩ variable {k} {K} /-- Every separable polynomial splits in the field extension `f : k β†’+* K` if `K` is separably closed. See also `IsSepClosed.splits_domain` for the case where `k` is separably closed. -/ theorem IsSepClosed.splits_codomain [IsSepClosed K] {f : k β†’+* K} (p : k[X]) (h : p.Separable) : p.Splits f := by convert IsSepClosed.splits_of_separable (p.map f) (Separable.map h); simp [splits_map_iff] /-- Every separable polynomial splits in the field extension `f : k β†’+* K` if `k` is separably closed. See also `IsSepClosed.splits_codomain` for the case where `k` is separably closed. -/ theorem IsSepClosed.splits_domain [IsSepClosed k] {f : k β†’+* K} (p : k[X]) (h : p.Separable) : p.Splits f := Polynomial.splits_of_splits_id _ <| IsSepClosed.splits_of_separable _ h namespace IsSepClosed theorem exists_root [IsSepClosed k] (p : k[X]) (hp : p.degree β‰  0) (hsep : p.Separable) : βˆƒ x, IsRoot p x := exists_root_of_splits _ (IsSepClosed.splits_of_separable p hsep) hp theorem exists_pow_nat_eq [IsSepClosed k] (x : k) (n : β„•) [hn : NeZero (n : k)] : βˆƒ z, z ^ n = x := by have hn' : 0 < n := Nat.pos_of_ne_zero <| fun h => by rw [h, Nat.cast_zero] at hn exact hn.out rfl have : degree (X ^ n - C x) β‰  0 := by rw [degree_X_pow_sub_C hn' x] exact (WithBot.coe_lt_coe.2 hn').ne' by_cases hx : x = 0 Β· exact ⟨0, by rw [hx, pow_eq_zero_iff hn']⟩ Β·
obtain ⟨z, hz⟩ := exists_root _ this <| separable_X_pow_sub_C x hn.out hx
theorem exists_pow_nat_eq [IsSepClosed k] (x : k) (n : β„•) [hn : NeZero (n : k)] : βˆƒ z, z ^ n = x := by have hn' : 0 < n := Nat.pos_of_ne_zero <| fun h => by rw [h, Nat.cast_zero] at hn exact hn.out rfl have : degree (X ^ n - C x) β‰  0 := by rw [degree_X_pow_sub_C hn' x] exact (WithBot.coe_lt_coe.2 hn').ne' by_cases hx : x = 0 Β· exact ⟨0, by rw [hx, pow_eq_zero_iff hn']⟩ Β·
Mathlib.FieldTheory.IsSepClosed.94_0.3ZRqn1f8ZTqE2nc
theorem exists_pow_nat_eq [IsSepClosed k] (x : k) (n : β„•) [hn : NeZero (n : k)] : βˆƒ z, z ^ n = x
Mathlib_FieldTheory_IsSepClosed
case neg.intro k : Type u inst✝² : Field k K : Type v inst✝¹ : Field K inst✝ : IsSepClosed k x : k n : β„• hn : NeZero ↑n hn' : 0 < n this : degree (X ^ n - C x) β‰  0 hx : Β¬x = 0 z : k hz : IsRoot (X ^ n - C x) z ⊒ βˆƒ z, z ^ n = x
/- Copyright (c) 2023 Jz Pan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jz Pan -/ import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure /-! # Separably Closed Field In this file we define the typeclass for separably closed fields and separable closures, and prove some of their properties. ## Main Definitions - `IsSepClosed k` is the typeclass saying `k` is a separably closed field, i.e. every separable polynomial in `k` splits. - `IsSepClosure k K` is the typeclass saying `K` is a separable closure of `k`, where `k` is a field. This means that `K` is separably closed and separable over `k`. - `IsSepClosed.lift` is a map from a separable extension `L` of `K`, into any separably closed extension `M` of `K`. - `IsSepClosure.equiv` is a proof that any two separable closures of the same field are isomorphic. ## Tags separable closure, separably closed ## TODO - Maximal separable subextension of `K/k`, consisting of all elements of `K` which are separable over `k`. - If `K` is a separably closed field containing `k`, then the maximal separable subextension of `K/k` is a separable closure of `k`. - In particular, a separable closure exists. - If `k` is a perfect field, then its separable closure coincides with its algebraic closure. - An algebraic extension of a separably closed field is purely inseparable. -/ universe u v w open scoped Classical BigOperators Polynomial open Polynomial variable (k : Type u) [Field k] (K : Type v) [Field K] /-- Typeclass for separably closed fields. To show `Polynomial.Splits p f` for an arbitrary ring homomorphism `f`, see `IsSepClosed.splits_codomain` and `IsSepClosed.splits_domain`. -/ class IsSepClosed : Prop where splits_of_separable : βˆ€ p : k[X], p.Separable β†’ (p.Splits <| RingHom.id k) /-- An algebraically closed field is also separably closed. -/ instance IsSepClosed.of_isAlgClosed [IsAlgClosed k] : IsSepClosed k := ⟨fun p _ ↦ IsAlgClosed.splits p⟩ variable {k} {K} /-- Every separable polynomial splits in the field extension `f : k β†’+* K` if `K` is separably closed. See also `IsSepClosed.splits_domain` for the case where `k` is separably closed. -/ theorem IsSepClosed.splits_codomain [IsSepClosed K] {f : k β†’+* K} (p : k[X]) (h : p.Separable) : p.Splits f := by convert IsSepClosed.splits_of_separable (p.map f) (Separable.map h); simp [splits_map_iff] /-- Every separable polynomial splits in the field extension `f : k β†’+* K` if `k` is separably closed. See also `IsSepClosed.splits_codomain` for the case where `k` is separably closed. -/ theorem IsSepClosed.splits_domain [IsSepClosed k] {f : k β†’+* K} (p : k[X]) (h : p.Separable) : p.Splits f := Polynomial.splits_of_splits_id _ <| IsSepClosed.splits_of_separable _ h namespace IsSepClosed theorem exists_root [IsSepClosed k] (p : k[X]) (hp : p.degree β‰  0) (hsep : p.Separable) : βˆƒ x, IsRoot p x := exists_root_of_splits _ (IsSepClosed.splits_of_separable p hsep) hp theorem exists_pow_nat_eq [IsSepClosed k] (x : k) (n : β„•) [hn : NeZero (n : k)] : βˆƒ z, z ^ n = x := by have hn' : 0 < n := Nat.pos_of_ne_zero <| fun h => by rw [h, Nat.cast_zero] at hn exact hn.out rfl have : degree (X ^ n - C x) β‰  0 := by rw [degree_X_pow_sub_C hn' x] exact (WithBot.coe_lt_coe.2 hn').ne' by_cases hx : x = 0 Β· exact ⟨0, by rw [hx, pow_eq_zero_iff hn']⟩ Β· obtain ⟨z, hz⟩ := exists_root _ this <| separable_X_pow_sub_C x hn.out hx
use z
theorem exists_pow_nat_eq [IsSepClosed k] (x : k) (n : β„•) [hn : NeZero (n : k)] : βˆƒ z, z ^ n = x := by have hn' : 0 < n := Nat.pos_of_ne_zero <| fun h => by rw [h, Nat.cast_zero] at hn exact hn.out rfl have : degree (X ^ n - C x) β‰  0 := by rw [degree_X_pow_sub_C hn' x] exact (WithBot.coe_lt_coe.2 hn').ne' by_cases hx : x = 0 Β· exact ⟨0, by rw [hx, pow_eq_zero_iff hn']⟩ Β· obtain ⟨z, hz⟩ := exists_root _ this <| separable_X_pow_sub_C x hn.out hx
Mathlib.FieldTheory.IsSepClosed.94_0.3ZRqn1f8ZTqE2nc
theorem exists_pow_nat_eq [IsSepClosed k] (x : k) (n : β„•) [hn : NeZero (n : k)] : βˆƒ z, z ^ n = x
Mathlib_FieldTheory_IsSepClosed
case h k : Type u inst✝² : Field k K : Type v inst✝¹ : Field K inst✝ : IsSepClosed k x : k n : β„• hn : NeZero ↑n hn' : 0 < n this : degree (X ^ n - C x) β‰  0 hx : Β¬x = 0 z : k hz : IsRoot (X ^ n - C x) z ⊒ z ^ n = x
/- Copyright (c) 2023 Jz Pan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jz Pan -/ import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure /-! # Separably Closed Field In this file we define the typeclass for separably closed fields and separable closures, and prove some of their properties. ## Main Definitions - `IsSepClosed k` is the typeclass saying `k` is a separably closed field, i.e. every separable polynomial in `k` splits. - `IsSepClosure k K` is the typeclass saying `K` is a separable closure of `k`, where `k` is a field. This means that `K` is separably closed and separable over `k`. - `IsSepClosed.lift` is a map from a separable extension `L` of `K`, into any separably closed extension `M` of `K`. - `IsSepClosure.equiv` is a proof that any two separable closures of the same field are isomorphic. ## Tags separable closure, separably closed ## TODO - Maximal separable subextension of `K/k`, consisting of all elements of `K` which are separable over `k`. - If `K` is a separably closed field containing `k`, then the maximal separable subextension of `K/k` is a separable closure of `k`. - In particular, a separable closure exists. - If `k` is a perfect field, then its separable closure coincides with its algebraic closure. - An algebraic extension of a separably closed field is purely inseparable. -/ universe u v w open scoped Classical BigOperators Polynomial open Polynomial variable (k : Type u) [Field k] (K : Type v) [Field K] /-- Typeclass for separably closed fields. To show `Polynomial.Splits p f` for an arbitrary ring homomorphism `f`, see `IsSepClosed.splits_codomain` and `IsSepClosed.splits_domain`. -/ class IsSepClosed : Prop where splits_of_separable : βˆ€ p : k[X], p.Separable β†’ (p.Splits <| RingHom.id k) /-- An algebraically closed field is also separably closed. -/ instance IsSepClosed.of_isAlgClosed [IsAlgClosed k] : IsSepClosed k := ⟨fun p _ ↦ IsAlgClosed.splits p⟩ variable {k} {K} /-- Every separable polynomial splits in the field extension `f : k β†’+* K` if `K` is separably closed. See also `IsSepClosed.splits_domain` for the case where `k` is separably closed. -/ theorem IsSepClosed.splits_codomain [IsSepClosed K] {f : k β†’+* K} (p : k[X]) (h : p.Separable) : p.Splits f := by convert IsSepClosed.splits_of_separable (p.map f) (Separable.map h); simp [splits_map_iff] /-- Every separable polynomial splits in the field extension `f : k β†’+* K` if `k` is separably closed. See also `IsSepClosed.splits_codomain` for the case where `k` is separably closed. -/ theorem IsSepClosed.splits_domain [IsSepClosed k] {f : k β†’+* K} (p : k[X]) (h : p.Separable) : p.Splits f := Polynomial.splits_of_splits_id _ <| IsSepClosed.splits_of_separable _ h namespace IsSepClosed theorem exists_root [IsSepClosed k] (p : k[X]) (hp : p.degree β‰  0) (hsep : p.Separable) : βˆƒ x, IsRoot p x := exists_root_of_splits _ (IsSepClosed.splits_of_separable p hsep) hp theorem exists_pow_nat_eq [IsSepClosed k] (x : k) (n : β„•) [hn : NeZero (n : k)] : βˆƒ z, z ^ n = x := by have hn' : 0 < n := Nat.pos_of_ne_zero <| fun h => by rw [h, Nat.cast_zero] at hn exact hn.out rfl have : degree (X ^ n - C x) β‰  0 := by rw [degree_X_pow_sub_C hn' x] exact (WithBot.coe_lt_coe.2 hn').ne' by_cases hx : x = 0 Β· exact ⟨0, by rw [hx, pow_eq_zero_iff hn']⟩ Β· obtain ⟨z, hz⟩ := exists_root _ this <| separable_X_pow_sub_C x hn.out hx use z
simpa [eval_C, eval_X, eval_pow, eval_sub, IsRoot.def, sub_eq_zero] using hz
theorem exists_pow_nat_eq [IsSepClosed k] (x : k) (n : β„•) [hn : NeZero (n : k)] : βˆƒ z, z ^ n = x := by have hn' : 0 < n := Nat.pos_of_ne_zero <| fun h => by rw [h, Nat.cast_zero] at hn exact hn.out rfl have : degree (X ^ n - C x) β‰  0 := by rw [degree_X_pow_sub_C hn' x] exact (WithBot.coe_lt_coe.2 hn').ne' by_cases hx : x = 0 Β· exact ⟨0, by rw [hx, pow_eq_zero_iff hn']⟩ Β· obtain ⟨z, hz⟩ := exists_root _ this <| separable_X_pow_sub_C x hn.out hx use z
Mathlib.FieldTheory.IsSepClosed.94_0.3ZRqn1f8ZTqE2nc
theorem exists_pow_nat_eq [IsSepClosed k] (x : k) (n : β„•) [hn : NeZero (n : k)] : βˆƒ z, z ^ n = x
Mathlib_FieldTheory_IsSepClosed
k : Type u inst✝² : Field k K : Type v inst✝¹ : Field K inst✝ : IsSepClosed k x : k h2 : NeZero 2 ⊒ βˆƒ z, x = z * z
/- Copyright (c) 2023 Jz Pan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jz Pan -/ import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure /-! # Separably Closed Field In this file we define the typeclass for separably closed fields and separable closures, and prove some of their properties. ## Main Definitions - `IsSepClosed k` is the typeclass saying `k` is a separably closed field, i.e. every separable polynomial in `k` splits. - `IsSepClosure k K` is the typeclass saying `K` is a separable closure of `k`, where `k` is a field. This means that `K` is separably closed and separable over `k`. - `IsSepClosed.lift` is a map from a separable extension `L` of `K`, into any separably closed extension `M` of `K`. - `IsSepClosure.equiv` is a proof that any two separable closures of the same field are isomorphic. ## Tags separable closure, separably closed ## TODO - Maximal separable subextension of `K/k`, consisting of all elements of `K` which are separable over `k`. - If `K` is a separably closed field containing `k`, then the maximal separable subextension of `K/k` is a separable closure of `k`. - In particular, a separable closure exists. - If `k` is a perfect field, then its separable closure coincides with its algebraic closure. - An algebraic extension of a separably closed field is purely inseparable. -/ universe u v w open scoped Classical BigOperators Polynomial open Polynomial variable (k : Type u) [Field k] (K : Type v) [Field K] /-- Typeclass for separably closed fields. To show `Polynomial.Splits p f` for an arbitrary ring homomorphism `f`, see `IsSepClosed.splits_codomain` and `IsSepClosed.splits_domain`. -/ class IsSepClosed : Prop where splits_of_separable : βˆ€ p : k[X], p.Separable β†’ (p.Splits <| RingHom.id k) /-- An algebraically closed field is also separably closed. -/ instance IsSepClosed.of_isAlgClosed [IsAlgClosed k] : IsSepClosed k := ⟨fun p _ ↦ IsAlgClosed.splits p⟩ variable {k} {K} /-- Every separable polynomial splits in the field extension `f : k β†’+* K` if `K` is separably closed. See also `IsSepClosed.splits_domain` for the case where `k` is separably closed. -/ theorem IsSepClosed.splits_codomain [IsSepClosed K] {f : k β†’+* K} (p : k[X]) (h : p.Separable) : p.Splits f := by convert IsSepClosed.splits_of_separable (p.map f) (Separable.map h); simp [splits_map_iff] /-- Every separable polynomial splits in the field extension `f : k β†’+* K` if `k` is separably closed. See also `IsSepClosed.splits_codomain` for the case where `k` is separably closed. -/ theorem IsSepClosed.splits_domain [IsSepClosed k] {f : k β†’+* K} (p : k[X]) (h : p.Separable) : p.Splits f := Polynomial.splits_of_splits_id _ <| IsSepClosed.splits_of_separable _ h namespace IsSepClosed theorem exists_root [IsSepClosed k] (p : k[X]) (hp : p.degree β‰  0) (hsep : p.Separable) : βˆƒ x, IsRoot p x := exists_root_of_splits _ (IsSepClosed.splits_of_separable p hsep) hp theorem exists_pow_nat_eq [IsSepClosed k] (x : k) (n : β„•) [hn : NeZero (n : k)] : βˆƒ z, z ^ n = x := by have hn' : 0 < n := Nat.pos_of_ne_zero <| fun h => by rw [h, Nat.cast_zero] at hn exact hn.out rfl have : degree (X ^ n - C x) β‰  0 := by rw [degree_X_pow_sub_C hn' x] exact (WithBot.coe_lt_coe.2 hn').ne' by_cases hx : x = 0 Β· exact ⟨0, by rw [hx, pow_eq_zero_iff hn']⟩ Β· obtain ⟨z, hz⟩ := exists_root _ this <| separable_X_pow_sub_C x hn.out hx use z simpa [eval_C, eval_X, eval_pow, eval_sub, IsRoot.def, sub_eq_zero] using hz theorem exists_eq_mul_self [IsSepClosed k] (x : k) [h2 : NeZero (2 : k)] : βˆƒ z, x = z * z := by
rcases exists_pow_nat_eq x 2 with ⟨z, rfl⟩
theorem exists_eq_mul_self [IsSepClosed k] (x : k) [h2 : NeZero (2 : k)] : βˆƒ z, x = z * z := by
Mathlib.FieldTheory.IsSepClosed.108_0.3ZRqn1f8ZTqE2nc
theorem exists_eq_mul_self [IsSepClosed k] (x : k) [h2 : NeZero (2 : k)] : βˆƒ z, x = z * z
Mathlib_FieldTheory_IsSepClosed
case intro k : Type u inst✝² : Field k K : Type v inst✝¹ : Field K inst✝ : IsSepClosed k h2 : NeZero 2 z : k ⊒ βˆƒ z_1, z ^ 2 = z_1 * z_1
/- Copyright (c) 2023 Jz Pan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jz Pan -/ import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure /-! # Separably Closed Field In this file we define the typeclass for separably closed fields and separable closures, and prove some of their properties. ## Main Definitions - `IsSepClosed k` is the typeclass saying `k` is a separably closed field, i.e. every separable polynomial in `k` splits. - `IsSepClosure k K` is the typeclass saying `K` is a separable closure of `k`, where `k` is a field. This means that `K` is separably closed and separable over `k`. - `IsSepClosed.lift` is a map from a separable extension `L` of `K`, into any separably closed extension `M` of `K`. - `IsSepClosure.equiv` is a proof that any two separable closures of the same field are isomorphic. ## Tags separable closure, separably closed ## TODO - Maximal separable subextension of `K/k`, consisting of all elements of `K` which are separable over `k`. - If `K` is a separably closed field containing `k`, then the maximal separable subextension of `K/k` is a separable closure of `k`. - In particular, a separable closure exists. - If `k` is a perfect field, then its separable closure coincides with its algebraic closure. - An algebraic extension of a separably closed field is purely inseparable. -/ universe u v w open scoped Classical BigOperators Polynomial open Polynomial variable (k : Type u) [Field k] (K : Type v) [Field K] /-- Typeclass for separably closed fields. To show `Polynomial.Splits p f` for an arbitrary ring homomorphism `f`, see `IsSepClosed.splits_codomain` and `IsSepClosed.splits_domain`. -/ class IsSepClosed : Prop where splits_of_separable : βˆ€ p : k[X], p.Separable β†’ (p.Splits <| RingHom.id k) /-- An algebraically closed field is also separably closed. -/ instance IsSepClosed.of_isAlgClosed [IsAlgClosed k] : IsSepClosed k := ⟨fun p _ ↦ IsAlgClosed.splits p⟩ variable {k} {K} /-- Every separable polynomial splits in the field extension `f : k β†’+* K` if `K` is separably closed. See also `IsSepClosed.splits_domain` for the case where `k` is separably closed. -/ theorem IsSepClosed.splits_codomain [IsSepClosed K] {f : k β†’+* K} (p : k[X]) (h : p.Separable) : p.Splits f := by convert IsSepClosed.splits_of_separable (p.map f) (Separable.map h); simp [splits_map_iff] /-- Every separable polynomial splits in the field extension `f : k β†’+* K` if `k` is separably closed. See also `IsSepClosed.splits_codomain` for the case where `k` is separably closed. -/ theorem IsSepClosed.splits_domain [IsSepClosed k] {f : k β†’+* K} (p : k[X]) (h : p.Separable) : p.Splits f := Polynomial.splits_of_splits_id _ <| IsSepClosed.splits_of_separable _ h namespace IsSepClosed theorem exists_root [IsSepClosed k] (p : k[X]) (hp : p.degree β‰  0) (hsep : p.Separable) : βˆƒ x, IsRoot p x := exists_root_of_splits _ (IsSepClosed.splits_of_separable p hsep) hp theorem exists_pow_nat_eq [IsSepClosed k] (x : k) (n : β„•) [hn : NeZero (n : k)] : βˆƒ z, z ^ n = x := by have hn' : 0 < n := Nat.pos_of_ne_zero <| fun h => by rw [h, Nat.cast_zero] at hn exact hn.out rfl have : degree (X ^ n - C x) β‰  0 := by rw [degree_X_pow_sub_C hn' x] exact (WithBot.coe_lt_coe.2 hn').ne' by_cases hx : x = 0 Β· exact ⟨0, by rw [hx, pow_eq_zero_iff hn']⟩ Β· obtain ⟨z, hz⟩ := exists_root _ this <| separable_X_pow_sub_C x hn.out hx use z simpa [eval_C, eval_X, eval_pow, eval_sub, IsRoot.def, sub_eq_zero] using hz theorem exists_eq_mul_self [IsSepClosed k] (x : k) [h2 : NeZero (2 : k)] : βˆƒ z, x = z * z := by rcases exists_pow_nat_eq x 2 with ⟨z, rfl⟩
exact ⟨z, sq z⟩
theorem exists_eq_mul_self [IsSepClosed k] (x : k) [h2 : NeZero (2 : k)] : βˆƒ z, x = z * z := by rcases exists_pow_nat_eq x 2 with ⟨z, rfl⟩
Mathlib.FieldTheory.IsSepClosed.108_0.3ZRqn1f8ZTqE2nc
theorem exists_eq_mul_self [IsSepClosed k] (x : k) [h2 : NeZero (2 : k)] : βˆƒ z, x = z * z
Mathlib_FieldTheory_IsSepClosed
k : Type u inst✝² : Field k K : Type v inst✝¹ : Field K inst✝ : IsSepClosed k p : k[X] hsep : Separable p ⊒ roots p = 0 ↔ p = C (coeff p 0)
/- Copyright (c) 2023 Jz Pan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jz Pan -/ import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure /-! # Separably Closed Field In this file we define the typeclass for separably closed fields and separable closures, and prove some of their properties. ## Main Definitions - `IsSepClosed k` is the typeclass saying `k` is a separably closed field, i.e. every separable polynomial in `k` splits. - `IsSepClosure k K` is the typeclass saying `K` is a separable closure of `k`, where `k` is a field. This means that `K` is separably closed and separable over `k`. - `IsSepClosed.lift` is a map from a separable extension `L` of `K`, into any separably closed extension `M` of `K`. - `IsSepClosure.equiv` is a proof that any two separable closures of the same field are isomorphic. ## Tags separable closure, separably closed ## TODO - Maximal separable subextension of `K/k`, consisting of all elements of `K` which are separable over `k`. - If `K` is a separably closed field containing `k`, then the maximal separable subextension of `K/k` is a separable closure of `k`. - In particular, a separable closure exists. - If `k` is a perfect field, then its separable closure coincides with its algebraic closure. - An algebraic extension of a separably closed field is purely inseparable. -/ universe u v w open scoped Classical BigOperators Polynomial open Polynomial variable (k : Type u) [Field k] (K : Type v) [Field K] /-- Typeclass for separably closed fields. To show `Polynomial.Splits p f` for an arbitrary ring homomorphism `f`, see `IsSepClosed.splits_codomain` and `IsSepClosed.splits_domain`. -/ class IsSepClosed : Prop where splits_of_separable : βˆ€ p : k[X], p.Separable β†’ (p.Splits <| RingHom.id k) /-- An algebraically closed field is also separably closed. -/ instance IsSepClosed.of_isAlgClosed [IsAlgClosed k] : IsSepClosed k := ⟨fun p _ ↦ IsAlgClosed.splits p⟩ variable {k} {K} /-- Every separable polynomial splits in the field extension `f : k β†’+* K` if `K` is separably closed. See also `IsSepClosed.splits_domain` for the case where `k` is separably closed. -/ theorem IsSepClosed.splits_codomain [IsSepClosed K] {f : k β†’+* K} (p : k[X]) (h : p.Separable) : p.Splits f := by convert IsSepClosed.splits_of_separable (p.map f) (Separable.map h); simp [splits_map_iff] /-- Every separable polynomial splits in the field extension `f : k β†’+* K` if `k` is separably closed. See also `IsSepClosed.splits_codomain` for the case where `k` is separably closed. -/ theorem IsSepClosed.splits_domain [IsSepClosed k] {f : k β†’+* K} (p : k[X]) (h : p.Separable) : p.Splits f := Polynomial.splits_of_splits_id _ <| IsSepClosed.splits_of_separable _ h namespace IsSepClosed theorem exists_root [IsSepClosed k] (p : k[X]) (hp : p.degree β‰  0) (hsep : p.Separable) : βˆƒ x, IsRoot p x := exists_root_of_splits _ (IsSepClosed.splits_of_separable p hsep) hp theorem exists_pow_nat_eq [IsSepClosed k] (x : k) (n : β„•) [hn : NeZero (n : k)] : βˆƒ z, z ^ n = x := by have hn' : 0 < n := Nat.pos_of_ne_zero <| fun h => by rw [h, Nat.cast_zero] at hn exact hn.out rfl have : degree (X ^ n - C x) β‰  0 := by rw [degree_X_pow_sub_C hn' x] exact (WithBot.coe_lt_coe.2 hn').ne' by_cases hx : x = 0 Β· exact ⟨0, by rw [hx, pow_eq_zero_iff hn']⟩ Β· obtain ⟨z, hz⟩ := exists_root _ this <| separable_X_pow_sub_C x hn.out hx use z simpa [eval_C, eval_X, eval_pow, eval_sub, IsRoot.def, sub_eq_zero] using hz theorem exists_eq_mul_self [IsSepClosed k] (x : k) [h2 : NeZero (2 : k)] : βˆƒ z, x = z * z := by rcases exists_pow_nat_eq x 2 with ⟨z, rfl⟩ exact ⟨z, sq z⟩ theorem roots_eq_zero_iff [IsSepClosed k] {p : k[X]} (hsep : p.Separable) : p.roots = 0 ↔ p = Polynomial.C (p.coeff 0) := by
refine' ⟨fun h => _, fun hp => by rw [hp, roots_C]⟩
theorem roots_eq_zero_iff [IsSepClosed k] {p : k[X]} (hsep : p.Separable) : p.roots = 0 ↔ p = Polynomial.C (p.coeff 0) := by
Mathlib.FieldTheory.IsSepClosed.112_0.3ZRqn1f8ZTqE2nc
theorem roots_eq_zero_iff [IsSepClosed k] {p : k[X]} (hsep : p.Separable) : p.roots = 0 ↔ p = Polynomial.C (p.coeff 0)
Mathlib_FieldTheory_IsSepClosed
k : Type u inst✝² : Field k K : Type v inst✝¹ : Field K inst✝ : IsSepClosed k p : k[X] hsep : Separable p hp : p = C (coeff p 0) ⊒ roots p = 0
/- Copyright (c) 2023 Jz Pan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jz Pan -/ import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure /-! # Separably Closed Field In this file we define the typeclass for separably closed fields and separable closures, and prove some of their properties. ## Main Definitions - `IsSepClosed k` is the typeclass saying `k` is a separably closed field, i.e. every separable polynomial in `k` splits. - `IsSepClosure k K` is the typeclass saying `K` is a separable closure of `k`, where `k` is a field. This means that `K` is separably closed and separable over `k`. - `IsSepClosed.lift` is a map from a separable extension `L` of `K`, into any separably closed extension `M` of `K`. - `IsSepClosure.equiv` is a proof that any two separable closures of the same field are isomorphic. ## Tags separable closure, separably closed ## TODO - Maximal separable subextension of `K/k`, consisting of all elements of `K` which are separable over `k`. - If `K` is a separably closed field containing `k`, then the maximal separable subextension of `K/k` is a separable closure of `k`. - In particular, a separable closure exists. - If `k` is a perfect field, then its separable closure coincides with its algebraic closure. - An algebraic extension of a separably closed field is purely inseparable. -/ universe u v w open scoped Classical BigOperators Polynomial open Polynomial variable (k : Type u) [Field k] (K : Type v) [Field K] /-- Typeclass for separably closed fields. To show `Polynomial.Splits p f` for an arbitrary ring homomorphism `f`, see `IsSepClosed.splits_codomain` and `IsSepClosed.splits_domain`. -/ class IsSepClosed : Prop where splits_of_separable : βˆ€ p : k[X], p.Separable β†’ (p.Splits <| RingHom.id k) /-- An algebraically closed field is also separably closed. -/ instance IsSepClosed.of_isAlgClosed [IsAlgClosed k] : IsSepClosed k := ⟨fun p _ ↦ IsAlgClosed.splits p⟩ variable {k} {K} /-- Every separable polynomial splits in the field extension `f : k β†’+* K` if `K` is separably closed. See also `IsSepClosed.splits_domain` for the case where `k` is separably closed. -/ theorem IsSepClosed.splits_codomain [IsSepClosed K] {f : k β†’+* K} (p : k[X]) (h : p.Separable) : p.Splits f := by convert IsSepClosed.splits_of_separable (p.map f) (Separable.map h); simp [splits_map_iff] /-- Every separable polynomial splits in the field extension `f : k β†’+* K` if `k` is separably closed. See also `IsSepClosed.splits_codomain` for the case where `k` is separably closed. -/ theorem IsSepClosed.splits_domain [IsSepClosed k] {f : k β†’+* K} (p : k[X]) (h : p.Separable) : p.Splits f := Polynomial.splits_of_splits_id _ <| IsSepClosed.splits_of_separable _ h namespace IsSepClosed theorem exists_root [IsSepClosed k] (p : k[X]) (hp : p.degree β‰  0) (hsep : p.Separable) : βˆƒ x, IsRoot p x := exists_root_of_splits _ (IsSepClosed.splits_of_separable p hsep) hp theorem exists_pow_nat_eq [IsSepClosed k] (x : k) (n : β„•) [hn : NeZero (n : k)] : βˆƒ z, z ^ n = x := by have hn' : 0 < n := Nat.pos_of_ne_zero <| fun h => by rw [h, Nat.cast_zero] at hn exact hn.out rfl have : degree (X ^ n - C x) β‰  0 := by rw [degree_X_pow_sub_C hn' x] exact (WithBot.coe_lt_coe.2 hn').ne' by_cases hx : x = 0 Β· exact ⟨0, by rw [hx, pow_eq_zero_iff hn']⟩ Β· obtain ⟨z, hz⟩ := exists_root _ this <| separable_X_pow_sub_C x hn.out hx use z simpa [eval_C, eval_X, eval_pow, eval_sub, IsRoot.def, sub_eq_zero] using hz theorem exists_eq_mul_self [IsSepClosed k] (x : k) [h2 : NeZero (2 : k)] : βˆƒ z, x = z * z := by rcases exists_pow_nat_eq x 2 with ⟨z, rfl⟩ exact ⟨z, sq z⟩ theorem roots_eq_zero_iff [IsSepClosed k] {p : k[X]} (hsep : p.Separable) : p.roots = 0 ↔ p = Polynomial.C (p.coeff 0) := by refine' ⟨fun h => _, fun hp => by
rw [hp, roots_C]
theorem roots_eq_zero_iff [IsSepClosed k] {p : k[X]} (hsep : p.Separable) : p.roots = 0 ↔ p = Polynomial.C (p.coeff 0) := by refine' ⟨fun h => _, fun hp => by
Mathlib.FieldTheory.IsSepClosed.112_0.3ZRqn1f8ZTqE2nc
theorem roots_eq_zero_iff [IsSepClosed k] {p : k[X]} (hsep : p.Separable) : p.roots = 0 ↔ p = Polynomial.C (p.coeff 0)
Mathlib_FieldTheory_IsSepClosed
k : Type u inst✝² : Field k K : Type v inst✝¹ : Field K inst✝ : IsSepClosed k p : k[X] hsep : Separable p h : roots p = 0 ⊒ p = C (coeff p 0)
/- Copyright (c) 2023 Jz Pan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jz Pan -/ import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure /-! # Separably Closed Field In this file we define the typeclass for separably closed fields and separable closures, and prove some of their properties. ## Main Definitions - `IsSepClosed k` is the typeclass saying `k` is a separably closed field, i.e. every separable polynomial in `k` splits. - `IsSepClosure k K` is the typeclass saying `K` is a separable closure of `k`, where `k` is a field. This means that `K` is separably closed and separable over `k`. - `IsSepClosed.lift` is a map from a separable extension `L` of `K`, into any separably closed extension `M` of `K`. - `IsSepClosure.equiv` is a proof that any two separable closures of the same field are isomorphic. ## Tags separable closure, separably closed ## TODO - Maximal separable subextension of `K/k`, consisting of all elements of `K` which are separable over `k`. - If `K` is a separably closed field containing `k`, then the maximal separable subextension of `K/k` is a separable closure of `k`. - In particular, a separable closure exists. - If `k` is a perfect field, then its separable closure coincides with its algebraic closure. - An algebraic extension of a separably closed field is purely inseparable. -/ universe u v w open scoped Classical BigOperators Polynomial open Polynomial variable (k : Type u) [Field k] (K : Type v) [Field K] /-- Typeclass for separably closed fields. To show `Polynomial.Splits p f` for an arbitrary ring homomorphism `f`, see `IsSepClosed.splits_codomain` and `IsSepClosed.splits_domain`. -/ class IsSepClosed : Prop where splits_of_separable : βˆ€ p : k[X], p.Separable β†’ (p.Splits <| RingHom.id k) /-- An algebraically closed field is also separably closed. -/ instance IsSepClosed.of_isAlgClosed [IsAlgClosed k] : IsSepClosed k := ⟨fun p _ ↦ IsAlgClosed.splits p⟩ variable {k} {K} /-- Every separable polynomial splits in the field extension `f : k β†’+* K` if `K` is separably closed. See also `IsSepClosed.splits_domain` for the case where `k` is separably closed. -/ theorem IsSepClosed.splits_codomain [IsSepClosed K] {f : k β†’+* K} (p : k[X]) (h : p.Separable) : p.Splits f := by convert IsSepClosed.splits_of_separable (p.map f) (Separable.map h); simp [splits_map_iff] /-- Every separable polynomial splits in the field extension `f : k β†’+* K` if `k` is separably closed. See also `IsSepClosed.splits_codomain` for the case where `k` is separably closed. -/ theorem IsSepClosed.splits_domain [IsSepClosed k] {f : k β†’+* K} (p : k[X]) (h : p.Separable) : p.Splits f := Polynomial.splits_of_splits_id _ <| IsSepClosed.splits_of_separable _ h namespace IsSepClosed theorem exists_root [IsSepClosed k] (p : k[X]) (hp : p.degree β‰  0) (hsep : p.Separable) : βˆƒ x, IsRoot p x := exists_root_of_splits _ (IsSepClosed.splits_of_separable p hsep) hp theorem exists_pow_nat_eq [IsSepClosed k] (x : k) (n : β„•) [hn : NeZero (n : k)] : βˆƒ z, z ^ n = x := by have hn' : 0 < n := Nat.pos_of_ne_zero <| fun h => by rw [h, Nat.cast_zero] at hn exact hn.out rfl have : degree (X ^ n - C x) β‰  0 := by rw [degree_X_pow_sub_C hn' x] exact (WithBot.coe_lt_coe.2 hn').ne' by_cases hx : x = 0 Β· exact ⟨0, by rw [hx, pow_eq_zero_iff hn']⟩ Β· obtain ⟨z, hz⟩ := exists_root _ this <| separable_X_pow_sub_C x hn.out hx use z simpa [eval_C, eval_X, eval_pow, eval_sub, IsRoot.def, sub_eq_zero] using hz theorem exists_eq_mul_self [IsSepClosed k] (x : k) [h2 : NeZero (2 : k)] : βˆƒ z, x = z * z := by rcases exists_pow_nat_eq x 2 with ⟨z, rfl⟩ exact ⟨z, sq z⟩ theorem roots_eq_zero_iff [IsSepClosed k] {p : k[X]} (hsep : p.Separable) : p.roots = 0 ↔ p = Polynomial.C (p.coeff 0) := by refine' ⟨fun h => _, fun hp => by rw [hp, roots_C]⟩
rcases le_or_lt (degree p) 0 with hd | hd
theorem roots_eq_zero_iff [IsSepClosed k] {p : k[X]} (hsep : p.Separable) : p.roots = 0 ↔ p = Polynomial.C (p.coeff 0) := by refine' ⟨fun h => _, fun hp => by rw [hp, roots_C]⟩
Mathlib.FieldTheory.IsSepClosed.112_0.3ZRqn1f8ZTqE2nc
theorem roots_eq_zero_iff [IsSepClosed k] {p : k[X]} (hsep : p.Separable) : p.roots = 0 ↔ p = Polynomial.C (p.coeff 0)
Mathlib_FieldTheory_IsSepClosed
case inl k : Type u inst✝² : Field k K : Type v inst✝¹ : Field K inst✝ : IsSepClosed k p : k[X] hsep : Separable p h : roots p = 0 hd : degree p ≀ 0 ⊒ p = C (coeff p 0)
/- Copyright (c) 2023 Jz Pan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jz Pan -/ import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure /-! # Separably Closed Field In this file we define the typeclass for separably closed fields and separable closures, and prove some of their properties. ## Main Definitions - `IsSepClosed k` is the typeclass saying `k` is a separably closed field, i.e. every separable polynomial in `k` splits. - `IsSepClosure k K` is the typeclass saying `K` is a separable closure of `k`, where `k` is a field. This means that `K` is separably closed and separable over `k`. - `IsSepClosed.lift` is a map from a separable extension `L` of `K`, into any separably closed extension `M` of `K`. - `IsSepClosure.equiv` is a proof that any two separable closures of the same field are isomorphic. ## Tags separable closure, separably closed ## TODO - Maximal separable subextension of `K/k`, consisting of all elements of `K` which are separable over `k`. - If `K` is a separably closed field containing `k`, then the maximal separable subextension of `K/k` is a separable closure of `k`. - In particular, a separable closure exists. - If `k` is a perfect field, then its separable closure coincides with its algebraic closure. - An algebraic extension of a separably closed field is purely inseparable. -/ universe u v w open scoped Classical BigOperators Polynomial open Polynomial variable (k : Type u) [Field k] (K : Type v) [Field K] /-- Typeclass for separably closed fields. To show `Polynomial.Splits p f` for an arbitrary ring homomorphism `f`, see `IsSepClosed.splits_codomain` and `IsSepClosed.splits_domain`. -/ class IsSepClosed : Prop where splits_of_separable : βˆ€ p : k[X], p.Separable β†’ (p.Splits <| RingHom.id k) /-- An algebraically closed field is also separably closed. -/ instance IsSepClosed.of_isAlgClosed [IsAlgClosed k] : IsSepClosed k := ⟨fun p _ ↦ IsAlgClosed.splits p⟩ variable {k} {K} /-- Every separable polynomial splits in the field extension `f : k β†’+* K` if `K` is separably closed. See also `IsSepClosed.splits_domain` for the case where `k` is separably closed. -/ theorem IsSepClosed.splits_codomain [IsSepClosed K] {f : k β†’+* K} (p : k[X]) (h : p.Separable) : p.Splits f := by convert IsSepClosed.splits_of_separable (p.map f) (Separable.map h); simp [splits_map_iff] /-- Every separable polynomial splits in the field extension `f : k β†’+* K` if `k` is separably closed. See also `IsSepClosed.splits_codomain` for the case where `k` is separably closed. -/ theorem IsSepClosed.splits_domain [IsSepClosed k] {f : k β†’+* K} (p : k[X]) (h : p.Separable) : p.Splits f := Polynomial.splits_of_splits_id _ <| IsSepClosed.splits_of_separable _ h namespace IsSepClosed theorem exists_root [IsSepClosed k] (p : k[X]) (hp : p.degree β‰  0) (hsep : p.Separable) : βˆƒ x, IsRoot p x := exists_root_of_splits _ (IsSepClosed.splits_of_separable p hsep) hp theorem exists_pow_nat_eq [IsSepClosed k] (x : k) (n : β„•) [hn : NeZero (n : k)] : βˆƒ z, z ^ n = x := by have hn' : 0 < n := Nat.pos_of_ne_zero <| fun h => by rw [h, Nat.cast_zero] at hn exact hn.out rfl have : degree (X ^ n - C x) β‰  0 := by rw [degree_X_pow_sub_C hn' x] exact (WithBot.coe_lt_coe.2 hn').ne' by_cases hx : x = 0 Β· exact ⟨0, by rw [hx, pow_eq_zero_iff hn']⟩ Β· obtain ⟨z, hz⟩ := exists_root _ this <| separable_X_pow_sub_C x hn.out hx use z simpa [eval_C, eval_X, eval_pow, eval_sub, IsRoot.def, sub_eq_zero] using hz theorem exists_eq_mul_self [IsSepClosed k] (x : k) [h2 : NeZero (2 : k)] : βˆƒ z, x = z * z := by rcases exists_pow_nat_eq x 2 with ⟨z, rfl⟩ exact ⟨z, sq z⟩ theorem roots_eq_zero_iff [IsSepClosed k] {p : k[X]} (hsep : p.Separable) : p.roots = 0 ↔ p = Polynomial.C (p.coeff 0) := by refine' ⟨fun h => _, fun hp => by rw [hp, roots_C]⟩ rcases le_or_lt (degree p) 0 with hd | hd Β·
exact eq_C_of_degree_le_zero hd
theorem roots_eq_zero_iff [IsSepClosed k] {p : k[X]} (hsep : p.Separable) : p.roots = 0 ↔ p = Polynomial.C (p.coeff 0) := by refine' ⟨fun h => _, fun hp => by rw [hp, roots_C]⟩ rcases le_or_lt (degree p) 0 with hd | hd Β·
Mathlib.FieldTheory.IsSepClosed.112_0.3ZRqn1f8ZTqE2nc
theorem roots_eq_zero_iff [IsSepClosed k] {p : k[X]} (hsep : p.Separable) : p.roots = 0 ↔ p = Polynomial.C (p.coeff 0)
Mathlib_FieldTheory_IsSepClosed
case inr k : Type u inst✝² : Field k K : Type v inst✝¹ : Field K inst✝ : IsSepClosed k p : k[X] hsep : Separable p h : roots p = 0 hd : 0 < degree p ⊒ p = C (coeff p 0)
/- Copyright (c) 2023 Jz Pan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jz Pan -/ import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure /-! # Separably Closed Field In this file we define the typeclass for separably closed fields and separable closures, and prove some of their properties. ## Main Definitions - `IsSepClosed k` is the typeclass saying `k` is a separably closed field, i.e. every separable polynomial in `k` splits. - `IsSepClosure k K` is the typeclass saying `K` is a separable closure of `k`, where `k` is a field. This means that `K` is separably closed and separable over `k`. - `IsSepClosed.lift` is a map from a separable extension `L` of `K`, into any separably closed extension `M` of `K`. - `IsSepClosure.equiv` is a proof that any two separable closures of the same field are isomorphic. ## Tags separable closure, separably closed ## TODO - Maximal separable subextension of `K/k`, consisting of all elements of `K` which are separable over `k`. - If `K` is a separably closed field containing `k`, then the maximal separable subextension of `K/k` is a separable closure of `k`. - In particular, a separable closure exists. - If `k` is a perfect field, then its separable closure coincides with its algebraic closure. - An algebraic extension of a separably closed field is purely inseparable. -/ universe u v w open scoped Classical BigOperators Polynomial open Polynomial variable (k : Type u) [Field k] (K : Type v) [Field K] /-- Typeclass for separably closed fields. To show `Polynomial.Splits p f` for an arbitrary ring homomorphism `f`, see `IsSepClosed.splits_codomain` and `IsSepClosed.splits_domain`. -/ class IsSepClosed : Prop where splits_of_separable : βˆ€ p : k[X], p.Separable β†’ (p.Splits <| RingHom.id k) /-- An algebraically closed field is also separably closed. -/ instance IsSepClosed.of_isAlgClosed [IsAlgClosed k] : IsSepClosed k := ⟨fun p _ ↦ IsAlgClosed.splits p⟩ variable {k} {K} /-- Every separable polynomial splits in the field extension `f : k β†’+* K` if `K` is separably closed. See also `IsSepClosed.splits_domain` for the case where `k` is separably closed. -/ theorem IsSepClosed.splits_codomain [IsSepClosed K] {f : k β†’+* K} (p : k[X]) (h : p.Separable) : p.Splits f := by convert IsSepClosed.splits_of_separable (p.map f) (Separable.map h); simp [splits_map_iff] /-- Every separable polynomial splits in the field extension `f : k β†’+* K` if `k` is separably closed. See also `IsSepClosed.splits_codomain` for the case where `k` is separably closed. -/ theorem IsSepClosed.splits_domain [IsSepClosed k] {f : k β†’+* K} (p : k[X]) (h : p.Separable) : p.Splits f := Polynomial.splits_of_splits_id _ <| IsSepClosed.splits_of_separable _ h namespace IsSepClosed theorem exists_root [IsSepClosed k] (p : k[X]) (hp : p.degree β‰  0) (hsep : p.Separable) : βˆƒ x, IsRoot p x := exists_root_of_splits _ (IsSepClosed.splits_of_separable p hsep) hp theorem exists_pow_nat_eq [IsSepClosed k] (x : k) (n : β„•) [hn : NeZero (n : k)] : βˆƒ z, z ^ n = x := by have hn' : 0 < n := Nat.pos_of_ne_zero <| fun h => by rw [h, Nat.cast_zero] at hn exact hn.out rfl have : degree (X ^ n - C x) β‰  0 := by rw [degree_X_pow_sub_C hn' x] exact (WithBot.coe_lt_coe.2 hn').ne' by_cases hx : x = 0 Β· exact ⟨0, by rw [hx, pow_eq_zero_iff hn']⟩ Β· obtain ⟨z, hz⟩ := exists_root _ this <| separable_X_pow_sub_C x hn.out hx use z simpa [eval_C, eval_X, eval_pow, eval_sub, IsRoot.def, sub_eq_zero] using hz theorem exists_eq_mul_self [IsSepClosed k] (x : k) [h2 : NeZero (2 : k)] : βˆƒ z, x = z * z := by rcases exists_pow_nat_eq x 2 with ⟨z, rfl⟩ exact ⟨z, sq z⟩ theorem roots_eq_zero_iff [IsSepClosed k] {p : k[X]} (hsep : p.Separable) : p.roots = 0 ↔ p = Polynomial.C (p.coeff 0) := by refine' ⟨fun h => _, fun hp => by rw [hp, roots_C]⟩ rcases le_or_lt (degree p) 0 with hd | hd Β· exact eq_C_of_degree_le_zero hd Β·
obtain ⟨z, hz⟩ := IsSepClosed.exists_root p hd.ne' hsep
theorem roots_eq_zero_iff [IsSepClosed k] {p : k[X]} (hsep : p.Separable) : p.roots = 0 ↔ p = Polynomial.C (p.coeff 0) := by refine' ⟨fun h => _, fun hp => by rw [hp, roots_C]⟩ rcases le_or_lt (degree p) 0 with hd | hd Β· exact eq_C_of_degree_le_zero hd Β·
Mathlib.FieldTheory.IsSepClosed.112_0.3ZRqn1f8ZTqE2nc
theorem roots_eq_zero_iff [IsSepClosed k] {p : k[X]} (hsep : p.Separable) : p.roots = 0 ↔ p = Polynomial.C (p.coeff 0)
Mathlib_FieldTheory_IsSepClosed
case inr.intro k : Type u inst✝² : Field k K : Type v inst✝¹ : Field K inst✝ : IsSepClosed k p : k[X] hsep : Separable p h : roots p = 0 hd : 0 < degree p z : k hz : IsRoot p z ⊒ p = C (coeff p 0)
/- Copyright (c) 2023 Jz Pan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jz Pan -/ import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure /-! # Separably Closed Field In this file we define the typeclass for separably closed fields and separable closures, and prove some of their properties. ## Main Definitions - `IsSepClosed k` is the typeclass saying `k` is a separably closed field, i.e. every separable polynomial in `k` splits. - `IsSepClosure k K` is the typeclass saying `K` is a separable closure of `k`, where `k` is a field. This means that `K` is separably closed and separable over `k`. - `IsSepClosed.lift` is a map from a separable extension `L` of `K`, into any separably closed extension `M` of `K`. - `IsSepClosure.equiv` is a proof that any two separable closures of the same field are isomorphic. ## Tags separable closure, separably closed ## TODO - Maximal separable subextension of `K/k`, consisting of all elements of `K` which are separable over `k`. - If `K` is a separably closed field containing `k`, then the maximal separable subextension of `K/k` is a separable closure of `k`. - In particular, a separable closure exists. - If `k` is a perfect field, then its separable closure coincides with its algebraic closure. - An algebraic extension of a separably closed field is purely inseparable. -/ universe u v w open scoped Classical BigOperators Polynomial open Polynomial variable (k : Type u) [Field k] (K : Type v) [Field K] /-- Typeclass for separably closed fields. To show `Polynomial.Splits p f` for an arbitrary ring homomorphism `f`, see `IsSepClosed.splits_codomain` and `IsSepClosed.splits_domain`. -/ class IsSepClosed : Prop where splits_of_separable : βˆ€ p : k[X], p.Separable β†’ (p.Splits <| RingHom.id k) /-- An algebraically closed field is also separably closed. -/ instance IsSepClosed.of_isAlgClosed [IsAlgClosed k] : IsSepClosed k := ⟨fun p _ ↦ IsAlgClosed.splits p⟩ variable {k} {K} /-- Every separable polynomial splits in the field extension `f : k β†’+* K` if `K` is separably closed. See also `IsSepClosed.splits_domain` for the case where `k` is separably closed. -/ theorem IsSepClosed.splits_codomain [IsSepClosed K] {f : k β†’+* K} (p : k[X]) (h : p.Separable) : p.Splits f := by convert IsSepClosed.splits_of_separable (p.map f) (Separable.map h); simp [splits_map_iff] /-- Every separable polynomial splits in the field extension `f : k β†’+* K` if `k` is separably closed. See also `IsSepClosed.splits_codomain` for the case where `k` is separably closed. -/ theorem IsSepClosed.splits_domain [IsSepClosed k] {f : k β†’+* K} (p : k[X]) (h : p.Separable) : p.Splits f := Polynomial.splits_of_splits_id _ <| IsSepClosed.splits_of_separable _ h namespace IsSepClosed theorem exists_root [IsSepClosed k] (p : k[X]) (hp : p.degree β‰  0) (hsep : p.Separable) : βˆƒ x, IsRoot p x := exists_root_of_splits _ (IsSepClosed.splits_of_separable p hsep) hp theorem exists_pow_nat_eq [IsSepClosed k] (x : k) (n : β„•) [hn : NeZero (n : k)] : βˆƒ z, z ^ n = x := by have hn' : 0 < n := Nat.pos_of_ne_zero <| fun h => by rw [h, Nat.cast_zero] at hn exact hn.out rfl have : degree (X ^ n - C x) β‰  0 := by rw [degree_X_pow_sub_C hn' x] exact (WithBot.coe_lt_coe.2 hn').ne' by_cases hx : x = 0 Β· exact ⟨0, by rw [hx, pow_eq_zero_iff hn']⟩ Β· obtain ⟨z, hz⟩ := exists_root _ this <| separable_X_pow_sub_C x hn.out hx use z simpa [eval_C, eval_X, eval_pow, eval_sub, IsRoot.def, sub_eq_zero] using hz theorem exists_eq_mul_self [IsSepClosed k] (x : k) [h2 : NeZero (2 : k)] : βˆƒ z, x = z * z := by rcases exists_pow_nat_eq x 2 with ⟨z, rfl⟩ exact ⟨z, sq z⟩ theorem roots_eq_zero_iff [IsSepClosed k] {p : k[X]} (hsep : p.Separable) : p.roots = 0 ↔ p = Polynomial.C (p.coeff 0) := by refine' ⟨fun h => _, fun hp => by rw [hp, roots_C]⟩ rcases le_or_lt (degree p) 0 with hd | hd Β· exact eq_C_of_degree_le_zero hd Β· obtain ⟨z, hz⟩ := IsSepClosed.exists_root p hd.ne' hsep
rw [← mem_roots (ne_zero_of_degree_gt hd), h] at hz
theorem roots_eq_zero_iff [IsSepClosed k] {p : k[X]} (hsep : p.Separable) : p.roots = 0 ↔ p = Polynomial.C (p.coeff 0) := by refine' ⟨fun h => _, fun hp => by rw [hp, roots_C]⟩ rcases le_or_lt (degree p) 0 with hd | hd Β· exact eq_C_of_degree_le_zero hd Β· obtain ⟨z, hz⟩ := IsSepClosed.exists_root p hd.ne' hsep
Mathlib.FieldTheory.IsSepClosed.112_0.3ZRqn1f8ZTqE2nc
theorem roots_eq_zero_iff [IsSepClosed k] {p : k[X]} (hsep : p.Separable) : p.roots = 0 ↔ p = Polynomial.C (p.coeff 0)
Mathlib_FieldTheory_IsSepClosed
case inr.intro k : Type u inst✝² : Field k K : Type v inst✝¹ : Field K inst✝ : IsSepClosed k p : k[X] hsep : Separable p h : roots p = 0 hd : 0 < degree p z : k hz : z ∈ 0 ⊒ p = C (coeff p 0)
/- Copyright (c) 2023 Jz Pan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jz Pan -/ import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure /-! # Separably Closed Field In this file we define the typeclass for separably closed fields and separable closures, and prove some of their properties. ## Main Definitions - `IsSepClosed k` is the typeclass saying `k` is a separably closed field, i.e. every separable polynomial in `k` splits. - `IsSepClosure k K` is the typeclass saying `K` is a separable closure of `k`, where `k` is a field. This means that `K` is separably closed and separable over `k`. - `IsSepClosed.lift` is a map from a separable extension `L` of `K`, into any separably closed extension `M` of `K`. - `IsSepClosure.equiv` is a proof that any two separable closures of the same field are isomorphic. ## Tags separable closure, separably closed ## TODO - Maximal separable subextension of `K/k`, consisting of all elements of `K` which are separable over `k`. - If `K` is a separably closed field containing `k`, then the maximal separable subextension of `K/k` is a separable closure of `k`. - In particular, a separable closure exists. - If `k` is a perfect field, then its separable closure coincides with its algebraic closure. - An algebraic extension of a separably closed field is purely inseparable. -/ universe u v w open scoped Classical BigOperators Polynomial open Polynomial variable (k : Type u) [Field k] (K : Type v) [Field K] /-- Typeclass for separably closed fields. To show `Polynomial.Splits p f` for an arbitrary ring homomorphism `f`, see `IsSepClosed.splits_codomain` and `IsSepClosed.splits_domain`. -/ class IsSepClosed : Prop where splits_of_separable : βˆ€ p : k[X], p.Separable β†’ (p.Splits <| RingHom.id k) /-- An algebraically closed field is also separably closed. -/ instance IsSepClosed.of_isAlgClosed [IsAlgClosed k] : IsSepClosed k := ⟨fun p _ ↦ IsAlgClosed.splits p⟩ variable {k} {K} /-- Every separable polynomial splits in the field extension `f : k β†’+* K` if `K` is separably closed. See also `IsSepClosed.splits_domain` for the case where `k` is separably closed. -/ theorem IsSepClosed.splits_codomain [IsSepClosed K] {f : k β†’+* K} (p : k[X]) (h : p.Separable) : p.Splits f := by convert IsSepClosed.splits_of_separable (p.map f) (Separable.map h); simp [splits_map_iff] /-- Every separable polynomial splits in the field extension `f : k β†’+* K` if `k` is separably closed. See also `IsSepClosed.splits_codomain` for the case where `k` is separably closed. -/ theorem IsSepClosed.splits_domain [IsSepClosed k] {f : k β†’+* K} (p : k[X]) (h : p.Separable) : p.Splits f := Polynomial.splits_of_splits_id _ <| IsSepClosed.splits_of_separable _ h namespace IsSepClosed theorem exists_root [IsSepClosed k] (p : k[X]) (hp : p.degree β‰  0) (hsep : p.Separable) : βˆƒ x, IsRoot p x := exists_root_of_splits _ (IsSepClosed.splits_of_separable p hsep) hp theorem exists_pow_nat_eq [IsSepClosed k] (x : k) (n : β„•) [hn : NeZero (n : k)] : βˆƒ z, z ^ n = x := by have hn' : 0 < n := Nat.pos_of_ne_zero <| fun h => by rw [h, Nat.cast_zero] at hn exact hn.out rfl have : degree (X ^ n - C x) β‰  0 := by rw [degree_X_pow_sub_C hn' x] exact (WithBot.coe_lt_coe.2 hn').ne' by_cases hx : x = 0 Β· exact ⟨0, by rw [hx, pow_eq_zero_iff hn']⟩ Β· obtain ⟨z, hz⟩ := exists_root _ this <| separable_X_pow_sub_C x hn.out hx use z simpa [eval_C, eval_X, eval_pow, eval_sub, IsRoot.def, sub_eq_zero] using hz theorem exists_eq_mul_self [IsSepClosed k] (x : k) [h2 : NeZero (2 : k)] : βˆƒ z, x = z * z := by rcases exists_pow_nat_eq x 2 with ⟨z, rfl⟩ exact ⟨z, sq z⟩ theorem roots_eq_zero_iff [IsSepClosed k] {p : k[X]} (hsep : p.Separable) : p.roots = 0 ↔ p = Polynomial.C (p.coeff 0) := by refine' ⟨fun h => _, fun hp => by rw [hp, roots_C]⟩ rcases le_or_lt (degree p) 0 with hd | hd Β· exact eq_C_of_degree_le_zero hd Β· obtain ⟨z, hz⟩ := IsSepClosed.exists_root p hd.ne' hsep rw [← mem_roots (ne_zero_of_degree_gt hd), h] at hz
simp at hz
theorem roots_eq_zero_iff [IsSepClosed k] {p : k[X]} (hsep : p.Separable) : p.roots = 0 ↔ p = Polynomial.C (p.coeff 0) := by refine' ⟨fun h => _, fun hp => by rw [hp, roots_C]⟩ rcases le_or_lt (degree p) 0 with hd | hd Β· exact eq_C_of_degree_le_zero hd Β· obtain ⟨z, hz⟩ := IsSepClosed.exists_root p hd.ne' hsep rw [← mem_roots (ne_zero_of_degree_gt hd), h] at hz
Mathlib.FieldTheory.IsSepClosed.112_0.3ZRqn1f8ZTqE2nc
theorem roots_eq_zero_iff [IsSepClosed k] {p : k[X]} (hsep : p.Separable) : p.roots = 0 ↔ p = Polynomial.C (p.coeff 0)
Mathlib_FieldTheory_IsSepClosed
k : Type u inst✝² : Field k K : Type v inst✝¹ : Field K inst✝ : IsSepClosed K f : k β†’+* K p : k[X] hp : degree p β‰  0 hsep : Separable p ⊒ degree (map f p) β‰  0
/- Copyright (c) 2023 Jz Pan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jz Pan -/ import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure /-! # Separably Closed Field In this file we define the typeclass for separably closed fields and separable closures, and prove some of their properties. ## Main Definitions - `IsSepClosed k` is the typeclass saying `k` is a separably closed field, i.e. every separable polynomial in `k` splits. - `IsSepClosure k K` is the typeclass saying `K` is a separable closure of `k`, where `k` is a field. This means that `K` is separably closed and separable over `k`. - `IsSepClosed.lift` is a map from a separable extension `L` of `K`, into any separably closed extension `M` of `K`. - `IsSepClosure.equiv` is a proof that any two separable closures of the same field are isomorphic. ## Tags separable closure, separably closed ## TODO - Maximal separable subextension of `K/k`, consisting of all elements of `K` which are separable over `k`. - If `K` is a separably closed field containing `k`, then the maximal separable subextension of `K/k` is a separable closure of `k`. - In particular, a separable closure exists. - If `k` is a perfect field, then its separable closure coincides with its algebraic closure. - An algebraic extension of a separably closed field is purely inseparable. -/ universe u v w open scoped Classical BigOperators Polynomial open Polynomial variable (k : Type u) [Field k] (K : Type v) [Field K] /-- Typeclass for separably closed fields. To show `Polynomial.Splits p f` for an arbitrary ring homomorphism `f`, see `IsSepClosed.splits_codomain` and `IsSepClosed.splits_domain`. -/ class IsSepClosed : Prop where splits_of_separable : βˆ€ p : k[X], p.Separable β†’ (p.Splits <| RingHom.id k) /-- An algebraically closed field is also separably closed. -/ instance IsSepClosed.of_isAlgClosed [IsAlgClosed k] : IsSepClosed k := ⟨fun p _ ↦ IsAlgClosed.splits p⟩ variable {k} {K} /-- Every separable polynomial splits in the field extension `f : k β†’+* K` if `K` is separably closed. See also `IsSepClosed.splits_domain` for the case where `k` is separably closed. -/ theorem IsSepClosed.splits_codomain [IsSepClosed K] {f : k β†’+* K} (p : k[X]) (h : p.Separable) : p.Splits f := by convert IsSepClosed.splits_of_separable (p.map f) (Separable.map h); simp [splits_map_iff] /-- Every separable polynomial splits in the field extension `f : k β†’+* K` if `k` is separably closed. See also `IsSepClosed.splits_codomain` for the case where `k` is separably closed. -/ theorem IsSepClosed.splits_domain [IsSepClosed k] {f : k β†’+* K} (p : k[X]) (h : p.Separable) : p.Splits f := Polynomial.splits_of_splits_id _ <| IsSepClosed.splits_of_separable _ h namespace IsSepClosed theorem exists_root [IsSepClosed k] (p : k[X]) (hp : p.degree β‰  0) (hsep : p.Separable) : βˆƒ x, IsRoot p x := exists_root_of_splits _ (IsSepClosed.splits_of_separable p hsep) hp theorem exists_pow_nat_eq [IsSepClosed k] (x : k) (n : β„•) [hn : NeZero (n : k)] : βˆƒ z, z ^ n = x := by have hn' : 0 < n := Nat.pos_of_ne_zero <| fun h => by rw [h, Nat.cast_zero] at hn exact hn.out rfl have : degree (X ^ n - C x) β‰  0 := by rw [degree_X_pow_sub_C hn' x] exact (WithBot.coe_lt_coe.2 hn').ne' by_cases hx : x = 0 Β· exact ⟨0, by rw [hx, pow_eq_zero_iff hn']⟩ Β· obtain ⟨z, hz⟩ := exists_root _ this <| separable_X_pow_sub_C x hn.out hx use z simpa [eval_C, eval_X, eval_pow, eval_sub, IsRoot.def, sub_eq_zero] using hz theorem exists_eq_mul_self [IsSepClosed k] (x : k) [h2 : NeZero (2 : k)] : βˆƒ z, x = z * z := by rcases exists_pow_nat_eq x 2 with ⟨z, rfl⟩ exact ⟨z, sq z⟩ theorem roots_eq_zero_iff [IsSepClosed k] {p : k[X]} (hsep : p.Separable) : p.roots = 0 ↔ p = Polynomial.C (p.coeff 0) := by refine' ⟨fun h => _, fun hp => by rw [hp, roots_C]⟩ rcases le_or_lt (degree p) 0 with hd | hd Β· exact eq_C_of_degree_le_zero hd Β· obtain ⟨z, hz⟩ := IsSepClosed.exists_root p hd.ne' hsep rw [← mem_roots (ne_zero_of_degree_gt hd), h] at hz simp at hz theorem exists_evalβ‚‚_eq_zero [IsSepClosed K] (f : k β†’+* K) (p : k[X]) (hp : p.degree β‰  0) (hsep : p.Separable) : βˆƒ x, p.evalβ‚‚ f x = 0 := let ⟨x, hx⟩ := exists_root (p.map f) (by
rwa [degree_map_eq_of_injective f.injective]
theorem exists_evalβ‚‚_eq_zero [IsSepClosed K] (f : k β†’+* K) (p : k[X]) (hp : p.degree β‰  0) (hsep : p.Separable) : βˆƒ x, p.evalβ‚‚ f x = 0 := let ⟨x, hx⟩ := exists_root (p.map f) (by
Mathlib.FieldTheory.IsSepClosed.121_0.3ZRqn1f8ZTqE2nc
theorem exists_evalβ‚‚_eq_zero [IsSepClosed K] (f : k β†’+* K) (p : k[X]) (hp : p.degree β‰  0) (hsep : p.Separable) : βˆƒ x, p.evalβ‚‚ f x = 0
Mathlib_FieldTheory_IsSepClosed
k : Type u inst✝² : Field k K : Type v inst✝¹ : Field K inst✝ : IsSepClosed K f : k β†’+* K p : k[X] hp : degree p β‰  0 hsep : Separable p x : K hx : IsRoot (map f p) x ⊒ evalβ‚‚ f x p = 0
/- Copyright (c) 2023 Jz Pan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jz Pan -/ import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure /-! # Separably Closed Field In this file we define the typeclass for separably closed fields and separable closures, and prove some of their properties. ## Main Definitions - `IsSepClosed k` is the typeclass saying `k` is a separably closed field, i.e. every separable polynomial in `k` splits. - `IsSepClosure k K` is the typeclass saying `K` is a separable closure of `k`, where `k` is a field. This means that `K` is separably closed and separable over `k`. - `IsSepClosed.lift` is a map from a separable extension `L` of `K`, into any separably closed extension `M` of `K`. - `IsSepClosure.equiv` is a proof that any two separable closures of the same field are isomorphic. ## Tags separable closure, separably closed ## TODO - Maximal separable subextension of `K/k`, consisting of all elements of `K` which are separable over `k`. - If `K` is a separably closed field containing `k`, then the maximal separable subextension of `K/k` is a separable closure of `k`. - In particular, a separable closure exists. - If `k` is a perfect field, then its separable closure coincides with its algebraic closure. - An algebraic extension of a separably closed field is purely inseparable. -/ universe u v w open scoped Classical BigOperators Polynomial open Polynomial variable (k : Type u) [Field k] (K : Type v) [Field K] /-- Typeclass for separably closed fields. To show `Polynomial.Splits p f` for an arbitrary ring homomorphism `f`, see `IsSepClosed.splits_codomain` and `IsSepClosed.splits_domain`. -/ class IsSepClosed : Prop where splits_of_separable : βˆ€ p : k[X], p.Separable β†’ (p.Splits <| RingHom.id k) /-- An algebraically closed field is also separably closed. -/ instance IsSepClosed.of_isAlgClosed [IsAlgClosed k] : IsSepClosed k := ⟨fun p _ ↦ IsAlgClosed.splits p⟩ variable {k} {K} /-- Every separable polynomial splits in the field extension `f : k β†’+* K` if `K` is separably closed. See also `IsSepClosed.splits_domain` for the case where `k` is separably closed. -/ theorem IsSepClosed.splits_codomain [IsSepClosed K] {f : k β†’+* K} (p : k[X]) (h : p.Separable) : p.Splits f := by convert IsSepClosed.splits_of_separable (p.map f) (Separable.map h); simp [splits_map_iff] /-- Every separable polynomial splits in the field extension `f : k β†’+* K` if `k` is separably closed. See also `IsSepClosed.splits_codomain` for the case where `k` is separably closed. -/ theorem IsSepClosed.splits_domain [IsSepClosed k] {f : k β†’+* K} (p : k[X]) (h : p.Separable) : p.Splits f := Polynomial.splits_of_splits_id _ <| IsSepClosed.splits_of_separable _ h namespace IsSepClosed theorem exists_root [IsSepClosed k] (p : k[X]) (hp : p.degree β‰  0) (hsep : p.Separable) : βˆƒ x, IsRoot p x := exists_root_of_splits _ (IsSepClosed.splits_of_separable p hsep) hp theorem exists_pow_nat_eq [IsSepClosed k] (x : k) (n : β„•) [hn : NeZero (n : k)] : βˆƒ z, z ^ n = x := by have hn' : 0 < n := Nat.pos_of_ne_zero <| fun h => by rw [h, Nat.cast_zero] at hn exact hn.out rfl have : degree (X ^ n - C x) β‰  0 := by rw [degree_X_pow_sub_C hn' x] exact (WithBot.coe_lt_coe.2 hn').ne' by_cases hx : x = 0 Β· exact ⟨0, by rw [hx, pow_eq_zero_iff hn']⟩ Β· obtain ⟨z, hz⟩ := exists_root _ this <| separable_X_pow_sub_C x hn.out hx use z simpa [eval_C, eval_X, eval_pow, eval_sub, IsRoot.def, sub_eq_zero] using hz theorem exists_eq_mul_self [IsSepClosed k] (x : k) [h2 : NeZero (2 : k)] : βˆƒ z, x = z * z := by rcases exists_pow_nat_eq x 2 with ⟨z, rfl⟩ exact ⟨z, sq z⟩ theorem roots_eq_zero_iff [IsSepClosed k] {p : k[X]} (hsep : p.Separable) : p.roots = 0 ↔ p = Polynomial.C (p.coeff 0) := by refine' ⟨fun h => _, fun hp => by rw [hp, roots_C]⟩ rcases le_or_lt (degree p) 0 with hd | hd Β· exact eq_C_of_degree_le_zero hd Β· obtain ⟨z, hz⟩ := IsSepClosed.exists_root p hd.ne' hsep rw [← mem_roots (ne_zero_of_degree_gt hd), h] at hz simp at hz theorem exists_evalβ‚‚_eq_zero [IsSepClosed K] (f : k β†’+* K) (p : k[X]) (hp : p.degree β‰  0) (hsep : p.Separable) : βˆƒ x, p.evalβ‚‚ f x = 0 := let ⟨x, hx⟩ := exists_root (p.map f) (by rwa [degree_map_eq_of_injective f.injective]) (Separable.map hsep) ⟨x, by
rwa [evalβ‚‚_eq_eval_map, ← IsRoot]
theorem exists_evalβ‚‚_eq_zero [IsSepClosed K] (f : k β†’+* K) (p : k[X]) (hp : p.degree β‰  0) (hsep : p.Separable) : βˆƒ x, p.evalβ‚‚ f x = 0 := let ⟨x, hx⟩ := exists_root (p.map f) (by rwa [degree_map_eq_of_injective f.injective]) (Separable.map hsep) ⟨x, by
Mathlib.FieldTheory.IsSepClosed.121_0.3ZRqn1f8ZTqE2nc
theorem exists_evalβ‚‚_eq_zero [IsSepClosed K] (f : k β†’+* K) (p : k[X]) (hp : p.degree β‰  0) (hsep : p.Separable) : βˆƒ x, p.evalβ‚‚ f x = 0
Mathlib_FieldTheory_IsSepClosed
k : Type u inst✝¹ : Field k K : Type v inst✝ : Field K H : βˆ€ (p : k[X]), Monic p β†’ Irreducible p β†’ Separable p β†’ βˆƒ x, eval x p = 0 ⊒ IsSepClosed k
/- Copyright (c) 2023 Jz Pan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jz Pan -/ import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure /-! # Separably Closed Field In this file we define the typeclass for separably closed fields and separable closures, and prove some of their properties. ## Main Definitions - `IsSepClosed k` is the typeclass saying `k` is a separably closed field, i.e. every separable polynomial in `k` splits. - `IsSepClosure k K` is the typeclass saying `K` is a separable closure of `k`, where `k` is a field. This means that `K` is separably closed and separable over `k`. - `IsSepClosed.lift` is a map from a separable extension `L` of `K`, into any separably closed extension `M` of `K`. - `IsSepClosure.equiv` is a proof that any two separable closures of the same field are isomorphic. ## Tags separable closure, separably closed ## TODO - Maximal separable subextension of `K/k`, consisting of all elements of `K` which are separable over `k`. - If `K` is a separably closed field containing `k`, then the maximal separable subextension of `K/k` is a separable closure of `k`. - In particular, a separable closure exists. - If `k` is a perfect field, then its separable closure coincides with its algebraic closure. - An algebraic extension of a separably closed field is purely inseparable. -/ universe u v w open scoped Classical BigOperators Polynomial open Polynomial variable (k : Type u) [Field k] (K : Type v) [Field K] /-- Typeclass for separably closed fields. To show `Polynomial.Splits p f` for an arbitrary ring homomorphism `f`, see `IsSepClosed.splits_codomain` and `IsSepClosed.splits_domain`. -/ class IsSepClosed : Prop where splits_of_separable : βˆ€ p : k[X], p.Separable β†’ (p.Splits <| RingHom.id k) /-- An algebraically closed field is also separably closed. -/ instance IsSepClosed.of_isAlgClosed [IsAlgClosed k] : IsSepClosed k := ⟨fun p _ ↦ IsAlgClosed.splits p⟩ variable {k} {K} /-- Every separable polynomial splits in the field extension `f : k β†’+* K` if `K` is separably closed. See also `IsSepClosed.splits_domain` for the case where `k` is separably closed. -/ theorem IsSepClosed.splits_codomain [IsSepClosed K] {f : k β†’+* K} (p : k[X]) (h : p.Separable) : p.Splits f := by convert IsSepClosed.splits_of_separable (p.map f) (Separable.map h); simp [splits_map_iff] /-- Every separable polynomial splits in the field extension `f : k β†’+* K` if `k` is separably closed. See also `IsSepClosed.splits_codomain` for the case where `k` is separably closed. -/ theorem IsSepClosed.splits_domain [IsSepClosed k] {f : k β†’+* K} (p : k[X]) (h : p.Separable) : p.Splits f := Polynomial.splits_of_splits_id _ <| IsSepClosed.splits_of_separable _ h namespace IsSepClosed theorem exists_root [IsSepClosed k] (p : k[X]) (hp : p.degree β‰  0) (hsep : p.Separable) : βˆƒ x, IsRoot p x := exists_root_of_splits _ (IsSepClosed.splits_of_separable p hsep) hp theorem exists_pow_nat_eq [IsSepClosed k] (x : k) (n : β„•) [hn : NeZero (n : k)] : βˆƒ z, z ^ n = x := by have hn' : 0 < n := Nat.pos_of_ne_zero <| fun h => by rw [h, Nat.cast_zero] at hn exact hn.out rfl have : degree (X ^ n - C x) β‰  0 := by rw [degree_X_pow_sub_C hn' x] exact (WithBot.coe_lt_coe.2 hn').ne' by_cases hx : x = 0 Β· exact ⟨0, by rw [hx, pow_eq_zero_iff hn']⟩ Β· obtain ⟨z, hz⟩ := exists_root _ this <| separable_X_pow_sub_C x hn.out hx use z simpa [eval_C, eval_X, eval_pow, eval_sub, IsRoot.def, sub_eq_zero] using hz theorem exists_eq_mul_self [IsSepClosed k] (x : k) [h2 : NeZero (2 : k)] : βˆƒ z, x = z * z := by rcases exists_pow_nat_eq x 2 with ⟨z, rfl⟩ exact ⟨z, sq z⟩ theorem roots_eq_zero_iff [IsSepClosed k] {p : k[X]} (hsep : p.Separable) : p.roots = 0 ↔ p = Polynomial.C (p.coeff 0) := by refine' ⟨fun h => _, fun hp => by rw [hp, roots_C]⟩ rcases le_or_lt (degree p) 0 with hd | hd Β· exact eq_C_of_degree_le_zero hd Β· obtain ⟨z, hz⟩ := IsSepClosed.exists_root p hd.ne' hsep rw [← mem_roots (ne_zero_of_degree_gt hd), h] at hz simp at hz theorem exists_evalβ‚‚_eq_zero [IsSepClosed K] (f : k β†’+* K) (p : k[X]) (hp : p.degree β‰  0) (hsep : p.Separable) : βˆƒ x, p.evalβ‚‚ f x = 0 := let ⟨x, hx⟩ := exists_root (p.map f) (by rwa [degree_map_eq_of_injective f.injective]) (Separable.map hsep) ⟨x, by rwa [evalβ‚‚_eq_eval_map, ← IsRoot]⟩ variable (K) theorem exists_aeval_eq_zero [IsSepClosed K] [Algebra k K] (p : k[X]) (hp : p.degree β‰  0) (hsep : p.Separable) : βˆƒ x : K, aeval x p = 0 := exists_evalβ‚‚_eq_zero (algebraMap k K) p hp hsep variable (k) {K} theorem of_exists_root (H : βˆ€ p : k[X], p.Monic β†’ Irreducible p β†’ Separable p β†’ βˆƒ x, p.eval x = 0) : IsSepClosed k := by
refine ⟨fun p hsep ↦ Or.inr ?_⟩
theorem of_exists_root (H : βˆ€ p : k[X], p.Monic β†’ Irreducible p β†’ Separable p β†’ βˆƒ x, p.eval x = 0) : IsSepClosed k := by
Mathlib.FieldTheory.IsSepClosed.136_0.3ZRqn1f8ZTqE2nc
theorem of_exists_root (H : βˆ€ p : k[X], p.Monic β†’ Irreducible p β†’ Separable p β†’ βˆƒ x, p.eval x = 0) : IsSepClosed k
Mathlib_FieldTheory_IsSepClosed
k : Type u inst✝¹ : Field k K : Type v inst✝ : Field K H : βˆ€ (p : k[X]), Monic p β†’ Irreducible p β†’ Separable p β†’ βˆƒ x, eval x p = 0 p : k[X] hsep : Separable p ⊒ βˆ€ {g : k[X]}, Irreducible g β†’ g ∣ map (RingHom.id k) p β†’ degree g = 1
/- Copyright (c) 2023 Jz Pan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jz Pan -/ import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure /-! # Separably Closed Field In this file we define the typeclass for separably closed fields and separable closures, and prove some of their properties. ## Main Definitions - `IsSepClosed k` is the typeclass saying `k` is a separably closed field, i.e. every separable polynomial in `k` splits. - `IsSepClosure k K` is the typeclass saying `K` is a separable closure of `k`, where `k` is a field. This means that `K` is separably closed and separable over `k`. - `IsSepClosed.lift` is a map from a separable extension `L` of `K`, into any separably closed extension `M` of `K`. - `IsSepClosure.equiv` is a proof that any two separable closures of the same field are isomorphic. ## Tags separable closure, separably closed ## TODO - Maximal separable subextension of `K/k`, consisting of all elements of `K` which are separable over `k`. - If `K` is a separably closed field containing `k`, then the maximal separable subextension of `K/k` is a separable closure of `k`. - In particular, a separable closure exists. - If `k` is a perfect field, then its separable closure coincides with its algebraic closure. - An algebraic extension of a separably closed field is purely inseparable. -/ universe u v w open scoped Classical BigOperators Polynomial open Polynomial variable (k : Type u) [Field k] (K : Type v) [Field K] /-- Typeclass for separably closed fields. To show `Polynomial.Splits p f` for an arbitrary ring homomorphism `f`, see `IsSepClosed.splits_codomain` and `IsSepClosed.splits_domain`. -/ class IsSepClosed : Prop where splits_of_separable : βˆ€ p : k[X], p.Separable β†’ (p.Splits <| RingHom.id k) /-- An algebraically closed field is also separably closed. -/ instance IsSepClosed.of_isAlgClosed [IsAlgClosed k] : IsSepClosed k := ⟨fun p _ ↦ IsAlgClosed.splits p⟩ variable {k} {K} /-- Every separable polynomial splits in the field extension `f : k β†’+* K` if `K` is separably closed. See also `IsSepClosed.splits_domain` for the case where `k` is separably closed. -/ theorem IsSepClosed.splits_codomain [IsSepClosed K] {f : k β†’+* K} (p : k[X]) (h : p.Separable) : p.Splits f := by convert IsSepClosed.splits_of_separable (p.map f) (Separable.map h); simp [splits_map_iff] /-- Every separable polynomial splits in the field extension `f : k β†’+* K` if `k` is separably closed. See also `IsSepClosed.splits_codomain` for the case where `k` is separably closed. -/ theorem IsSepClosed.splits_domain [IsSepClosed k] {f : k β†’+* K} (p : k[X]) (h : p.Separable) : p.Splits f := Polynomial.splits_of_splits_id _ <| IsSepClosed.splits_of_separable _ h namespace IsSepClosed theorem exists_root [IsSepClosed k] (p : k[X]) (hp : p.degree β‰  0) (hsep : p.Separable) : βˆƒ x, IsRoot p x := exists_root_of_splits _ (IsSepClosed.splits_of_separable p hsep) hp theorem exists_pow_nat_eq [IsSepClosed k] (x : k) (n : β„•) [hn : NeZero (n : k)] : βˆƒ z, z ^ n = x := by have hn' : 0 < n := Nat.pos_of_ne_zero <| fun h => by rw [h, Nat.cast_zero] at hn exact hn.out rfl have : degree (X ^ n - C x) β‰  0 := by rw [degree_X_pow_sub_C hn' x] exact (WithBot.coe_lt_coe.2 hn').ne' by_cases hx : x = 0 Β· exact ⟨0, by rw [hx, pow_eq_zero_iff hn']⟩ Β· obtain ⟨z, hz⟩ := exists_root _ this <| separable_X_pow_sub_C x hn.out hx use z simpa [eval_C, eval_X, eval_pow, eval_sub, IsRoot.def, sub_eq_zero] using hz theorem exists_eq_mul_self [IsSepClosed k] (x : k) [h2 : NeZero (2 : k)] : βˆƒ z, x = z * z := by rcases exists_pow_nat_eq x 2 with ⟨z, rfl⟩ exact ⟨z, sq z⟩ theorem roots_eq_zero_iff [IsSepClosed k] {p : k[X]} (hsep : p.Separable) : p.roots = 0 ↔ p = Polynomial.C (p.coeff 0) := by refine' ⟨fun h => _, fun hp => by rw [hp, roots_C]⟩ rcases le_or_lt (degree p) 0 with hd | hd Β· exact eq_C_of_degree_le_zero hd Β· obtain ⟨z, hz⟩ := IsSepClosed.exists_root p hd.ne' hsep rw [← mem_roots (ne_zero_of_degree_gt hd), h] at hz simp at hz theorem exists_evalβ‚‚_eq_zero [IsSepClosed K] (f : k β†’+* K) (p : k[X]) (hp : p.degree β‰  0) (hsep : p.Separable) : βˆƒ x, p.evalβ‚‚ f x = 0 := let ⟨x, hx⟩ := exists_root (p.map f) (by rwa [degree_map_eq_of_injective f.injective]) (Separable.map hsep) ⟨x, by rwa [evalβ‚‚_eq_eval_map, ← IsRoot]⟩ variable (K) theorem exists_aeval_eq_zero [IsSepClosed K] [Algebra k K] (p : k[X]) (hp : p.degree β‰  0) (hsep : p.Separable) : βˆƒ x : K, aeval x p = 0 := exists_evalβ‚‚_eq_zero (algebraMap k K) p hp hsep variable (k) {K} theorem of_exists_root (H : βˆ€ p : k[X], p.Monic β†’ Irreducible p β†’ Separable p β†’ βˆƒ x, p.eval x = 0) : IsSepClosed k := by refine ⟨fun p hsep ↦ Or.inr ?_⟩
intro q hq hdvd
theorem of_exists_root (H : βˆ€ p : k[X], p.Monic β†’ Irreducible p β†’ Separable p β†’ βˆƒ x, p.eval x = 0) : IsSepClosed k := by refine ⟨fun p hsep ↦ Or.inr ?_⟩
Mathlib.FieldTheory.IsSepClosed.136_0.3ZRqn1f8ZTqE2nc
theorem of_exists_root (H : βˆ€ p : k[X], p.Monic β†’ Irreducible p β†’ Separable p β†’ βˆƒ x, p.eval x = 0) : IsSepClosed k
Mathlib_FieldTheory_IsSepClosed
k : Type u inst✝¹ : Field k K : Type v inst✝ : Field K H : βˆ€ (p : k[X]), Monic p β†’ Irreducible p β†’ Separable p β†’ βˆƒ x, eval x p = 0 p : k[X] hsep : Separable p q : k[X] hq : Irreducible q hdvd : q ∣ map (RingHom.id k) p ⊒ degree q = 1
/- Copyright (c) 2023 Jz Pan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jz Pan -/ import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure /-! # Separably Closed Field In this file we define the typeclass for separably closed fields and separable closures, and prove some of their properties. ## Main Definitions - `IsSepClosed k` is the typeclass saying `k` is a separably closed field, i.e. every separable polynomial in `k` splits. - `IsSepClosure k K` is the typeclass saying `K` is a separable closure of `k`, where `k` is a field. This means that `K` is separably closed and separable over `k`. - `IsSepClosed.lift` is a map from a separable extension `L` of `K`, into any separably closed extension `M` of `K`. - `IsSepClosure.equiv` is a proof that any two separable closures of the same field are isomorphic. ## Tags separable closure, separably closed ## TODO - Maximal separable subextension of `K/k`, consisting of all elements of `K` which are separable over `k`. - If `K` is a separably closed field containing `k`, then the maximal separable subextension of `K/k` is a separable closure of `k`. - In particular, a separable closure exists. - If `k` is a perfect field, then its separable closure coincides with its algebraic closure. - An algebraic extension of a separably closed field is purely inseparable. -/ universe u v w open scoped Classical BigOperators Polynomial open Polynomial variable (k : Type u) [Field k] (K : Type v) [Field K] /-- Typeclass for separably closed fields. To show `Polynomial.Splits p f` for an arbitrary ring homomorphism `f`, see `IsSepClosed.splits_codomain` and `IsSepClosed.splits_domain`. -/ class IsSepClosed : Prop where splits_of_separable : βˆ€ p : k[X], p.Separable β†’ (p.Splits <| RingHom.id k) /-- An algebraically closed field is also separably closed. -/ instance IsSepClosed.of_isAlgClosed [IsAlgClosed k] : IsSepClosed k := ⟨fun p _ ↦ IsAlgClosed.splits p⟩ variable {k} {K} /-- Every separable polynomial splits in the field extension `f : k β†’+* K` if `K` is separably closed. See also `IsSepClosed.splits_domain` for the case where `k` is separably closed. -/ theorem IsSepClosed.splits_codomain [IsSepClosed K] {f : k β†’+* K} (p : k[X]) (h : p.Separable) : p.Splits f := by convert IsSepClosed.splits_of_separable (p.map f) (Separable.map h); simp [splits_map_iff] /-- Every separable polynomial splits in the field extension `f : k β†’+* K` if `k` is separably closed. See also `IsSepClosed.splits_codomain` for the case where `k` is separably closed. -/ theorem IsSepClosed.splits_domain [IsSepClosed k] {f : k β†’+* K} (p : k[X]) (h : p.Separable) : p.Splits f := Polynomial.splits_of_splits_id _ <| IsSepClosed.splits_of_separable _ h namespace IsSepClosed theorem exists_root [IsSepClosed k] (p : k[X]) (hp : p.degree β‰  0) (hsep : p.Separable) : βˆƒ x, IsRoot p x := exists_root_of_splits _ (IsSepClosed.splits_of_separable p hsep) hp theorem exists_pow_nat_eq [IsSepClosed k] (x : k) (n : β„•) [hn : NeZero (n : k)] : βˆƒ z, z ^ n = x := by have hn' : 0 < n := Nat.pos_of_ne_zero <| fun h => by rw [h, Nat.cast_zero] at hn exact hn.out rfl have : degree (X ^ n - C x) β‰  0 := by rw [degree_X_pow_sub_C hn' x] exact (WithBot.coe_lt_coe.2 hn').ne' by_cases hx : x = 0 Β· exact ⟨0, by rw [hx, pow_eq_zero_iff hn']⟩ Β· obtain ⟨z, hz⟩ := exists_root _ this <| separable_X_pow_sub_C x hn.out hx use z simpa [eval_C, eval_X, eval_pow, eval_sub, IsRoot.def, sub_eq_zero] using hz theorem exists_eq_mul_self [IsSepClosed k] (x : k) [h2 : NeZero (2 : k)] : βˆƒ z, x = z * z := by rcases exists_pow_nat_eq x 2 with ⟨z, rfl⟩ exact ⟨z, sq z⟩ theorem roots_eq_zero_iff [IsSepClosed k] {p : k[X]} (hsep : p.Separable) : p.roots = 0 ↔ p = Polynomial.C (p.coeff 0) := by refine' ⟨fun h => _, fun hp => by rw [hp, roots_C]⟩ rcases le_or_lt (degree p) 0 with hd | hd Β· exact eq_C_of_degree_le_zero hd Β· obtain ⟨z, hz⟩ := IsSepClosed.exists_root p hd.ne' hsep rw [← mem_roots (ne_zero_of_degree_gt hd), h] at hz simp at hz theorem exists_evalβ‚‚_eq_zero [IsSepClosed K] (f : k β†’+* K) (p : k[X]) (hp : p.degree β‰  0) (hsep : p.Separable) : βˆƒ x, p.evalβ‚‚ f x = 0 := let ⟨x, hx⟩ := exists_root (p.map f) (by rwa [degree_map_eq_of_injective f.injective]) (Separable.map hsep) ⟨x, by rwa [evalβ‚‚_eq_eval_map, ← IsRoot]⟩ variable (K) theorem exists_aeval_eq_zero [IsSepClosed K] [Algebra k K] (p : k[X]) (hp : p.degree β‰  0) (hsep : p.Separable) : βˆƒ x : K, aeval x p = 0 := exists_evalβ‚‚_eq_zero (algebraMap k K) p hp hsep variable (k) {K} theorem of_exists_root (H : βˆ€ p : k[X], p.Monic β†’ Irreducible p β†’ Separable p β†’ βˆƒ x, p.eval x = 0) : IsSepClosed k := by refine ⟨fun p hsep ↦ Or.inr ?_⟩ intro q hq hdvd
simp only [map_id] at hdvd
theorem of_exists_root (H : βˆ€ p : k[X], p.Monic β†’ Irreducible p β†’ Separable p β†’ βˆƒ x, p.eval x = 0) : IsSepClosed k := by refine ⟨fun p hsep ↦ Or.inr ?_⟩ intro q hq hdvd
Mathlib.FieldTheory.IsSepClosed.136_0.3ZRqn1f8ZTqE2nc
theorem of_exists_root (H : βˆ€ p : k[X], p.Monic β†’ Irreducible p β†’ Separable p β†’ βˆƒ x, p.eval x = 0) : IsSepClosed k
Mathlib_FieldTheory_IsSepClosed
k : Type u inst✝¹ : Field k K : Type v inst✝ : Field K H : βˆ€ (p : k[X]), Monic p β†’ Irreducible p β†’ Separable p β†’ βˆƒ x, eval x p = 0 p : k[X] hsep : Separable p q : k[X] hq : Irreducible q hdvd : q ∣ p ⊒ degree q = 1
/- Copyright (c) 2023 Jz Pan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jz Pan -/ import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure /-! # Separably Closed Field In this file we define the typeclass for separably closed fields and separable closures, and prove some of their properties. ## Main Definitions - `IsSepClosed k` is the typeclass saying `k` is a separably closed field, i.e. every separable polynomial in `k` splits. - `IsSepClosure k K` is the typeclass saying `K` is a separable closure of `k`, where `k` is a field. This means that `K` is separably closed and separable over `k`. - `IsSepClosed.lift` is a map from a separable extension `L` of `K`, into any separably closed extension `M` of `K`. - `IsSepClosure.equiv` is a proof that any two separable closures of the same field are isomorphic. ## Tags separable closure, separably closed ## TODO - Maximal separable subextension of `K/k`, consisting of all elements of `K` which are separable over `k`. - If `K` is a separably closed field containing `k`, then the maximal separable subextension of `K/k` is a separable closure of `k`. - In particular, a separable closure exists. - If `k` is a perfect field, then its separable closure coincides with its algebraic closure. - An algebraic extension of a separably closed field is purely inseparable. -/ universe u v w open scoped Classical BigOperators Polynomial open Polynomial variable (k : Type u) [Field k] (K : Type v) [Field K] /-- Typeclass for separably closed fields. To show `Polynomial.Splits p f` for an arbitrary ring homomorphism `f`, see `IsSepClosed.splits_codomain` and `IsSepClosed.splits_domain`. -/ class IsSepClosed : Prop where splits_of_separable : βˆ€ p : k[X], p.Separable β†’ (p.Splits <| RingHom.id k) /-- An algebraically closed field is also separably closed. -/ instance IsSepClosed.of_isAlgClosed [IsAlgClosed k] : IsSepClosed k := ⟨fun p _ ↦ IsAlgClosed.splits p⟩ variable {k} {K} /-- Every separable polynomial splits in the field extension `f : k β†’+* K` if `K` is separably closed. See also `IsSepClosed.splits_domain` for the case where `k` is separably closed. -/ theorem IsSepClosed.splits_codomain [IsSepClosed K] {f : k β†’+* K} (p : k[X]) (h : p.Separable) : p.Splits f := by convert IsSepClosed.splits_of_separable (p.map f) (Separable.map h); simp [splits_map_iff] /-- Every separable polynomial splits in the field extension `f : k β†’+* K` if `k` is separably closed. See also `IsSepClosed.splits_codomain` for the case where `k` is separably closed. -/ theorem IsSepClosed.splits_domain [IsSepClosed k] {f : k β†’+* K} (p : k[X]) (h : p.Separable) : p.Splits f := Polynomial.splits_of_splits_id _ <| IsSepClosed.splits_of_separable _ h namespace IsSepClosed theorem exists_root [IsSepClosed k] (p : k[X]) (hp : p.degree β‰  0) (hsep : p.Separable) : βˆƒ x, IsRoot p x := exists_root_of_splits _ (IsSepClosed.splits_of_separable p hsep) hp theorem exists_pow_nat_eq [IsSepClosed k] (x : k) (n : β„•) [hn : NeZero (n : k)] : βˆƒ z, z ^ n = x := by have hn' : 0 < n := Nat.pos_of_ne_zero <| fun h => by rw [h, Nat.cast_zero] at hn exact hn.out rfl have : degree (X ^ n - C x) β‰  0 := by rw [degree_X_pow_sub_C hn' x] exact (WithBot.coe_lt_coe.2 hn').ne' by_cases hx : x = 0 Β· exact ⟨0, by rw [hx, pow_eq_zero_iff hn']⟩ Β· obtain ⟨z, hz⟩ := exists_root _ this <| separable_X_pow_sub_C x hn.out hx use z simpa [eval_C, eval_X, eval_pow, eval_sub, IsRoot.def, sub_eq_zero] using hz theorem exists_eq_mul_self [IsSepClosed k] (x : k) [h2 : NeZero (2 : k)] : βˆƒ z, x = z * z := by rcases exists_pow_nat_eq x 2 with ⟨z, rfl⟩ exact ⟨z, sq z⟩ theorem roots_eq_zero_iff [IsSepClosed k] {p : k[X]} (hsep : p.Separable) : p.roots = 0 ↔ p = Polynomial.C (p.coeff 0) := by refine' ⟨fun h => _, fun hp => by rw [hp, roots_C]⟩ rcases le_or_lt (degree p) 0 with hd | hd Β· exact eq_C_of_degree_le_zero hd Β· obtain ⟨z, hz⟩ := IsSepClosed.exists_root p hd.ne' hsep rw [← mem_roots (ne_zero_of_degree_gt hd), h] at hz simp at hz theorem exists_evalβ‚‚_eq_zero [IsSepClosed K] (f : k β†’+* K) (p : k[X]) (hp : p.degree β‰  0) (hsep : p.Separable) : βˆƒ x, p.evalβ‚‚ f x = 0 := let ⟨x, hx⟩ := exists_root (p.map f) (by rwa [degree_map_eq_of_injective f.injective]) (Separable.map hsep) ⟨x, by rwa [evalβ‚‚_eq_eval_map, ← IsRoot]⟩ variable (K) theorem exists_aeval_eq_zero [IsSepClosed K] [Algebra k K] (p : k[X]) (hp : p.degree β‰  0) (hsep : p.Separable) : βˆƒ x : K, aeval x p = 0 := exists_evalβ‚‚_eq_zero (algebraMap k K) p hp hsep variable (k) {K} theorem of_exists_root (H : βˆ€ p : k[X], p.Monic β†’ Irreducible p β†’ Separable p β†’ βˆƒ x, p.eval x = 0) : IsSepClosed k := by refine ⟨fun p hsep ↦ Or.inr ?_⟩ intro q hq hdvd simp only [map_id] at hdvd
have hlc : IsUnit (leadingCoeff q)⁻¹ := IsUnit.inv <| Ne.isUnit <| leadingCoeff_ne_zero.2 <| Irreducible.ne_zero hq
theorem of_exists_root (H : βˆ€ p : k[X], p.Monic β†’ Irreducible p β†’ Separable p β†’ βˆƒ x, p.eval x = 0) : IsSepClosed k := by refine ⟨fun p hsep ↦ Or.inr ?_⟩ intro q hq hdvd simp only [map_id] at hdvd
Mathlib.FieldTheory.IsSepClosed.136_0.3ZRqn1f8ZTqE2nc
theorem of_exists_root (H : βˆ€ p : k[X], p.Monic β†’ Irreducible p β†’ Separable p β†’ βˆƒ x, p.eval x = 0) : IsSepClosed k
Mathlib_FieldTheory_IsSepClosed
k : Type u inst✝¹ : Field k K : Type v inst✝ : Field K H : βˆ€ (p : k[X]), Monic p β†’ Irreducible p β†’ Separable p β†’ βˆƒ x, eval x p = 0 p : k[X] hsep : Separable p q : k[X] hq : Irreducible q hdvd : q ∣ p hlc : IsUnit (leadingCoeff q)⁻¹ ⊒ degree q = 1
/- Copyright (c) 2023 Jz Pan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jz Pan -/ import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure /-! # Separably Closed Field In this file we define the typeclass for separably closed fields and separable closures, and prove some of their properties. ## Main Definitions - `IsSepClosed k` is the typeclass saying `k` is a separably closed field, i.e. every separable polynomial in `k` splits. - `IsSepClosure k K` is the typeclass saying `K` is a separable closure of `k`, where `k` is a field. This means that `K` is separably closed and separable over `k`. - `IsSepClosed.lift` is a map from a separable extension `L` of `K`, into any separably closed extension `M` of `K`. - `IsSepClosure.equiv` is a proof that any two separable closures of the same field are isomorphic. ## Tags separable closure, separably closed ## TODO - Maximal separable subextension of `K/k`, consisting of all elements of `K` which are separable over `k`. - If `K` is a separably closed field containing `k`, then the maximal separable subextension of `K/k` is a separable closure of `k`. - In particular, a separable closure exists. - If `k` is a perfect field, then its separable closure coincides with its algebraic closure. - An algebraic extension of a separably closed field is purely inseparable. -/ universe u v w open scoped Classical BigOperators Polynomial open Polynomial variable (k : Type u) [Field k] (K : Type v) [Field K] /-- Typeclass for separably closed fields. To show `Polynomial.Splits p f` for an arbitrary ring homomorphism `f`, see `IsSepClosed.splits_codomain` and `IsSepClosed.splits_domain`. -/ class IsSepClosed : Prop where splits_of_separable : βˆ€ p : k[X], p.Separable β†’ (p.Splits <| RingHom.id k) /-- An algebraically closed field is also separably closed. -/ instance IsSepClosed.of_isAlgClosed [IsAlgClosed k] : IsSepClosed k := ⟨fun p _ ↦ IsAlgClosed.splits p⟩ variable {k} {K} /-- Every separable polynomial splits in the field extension `f : k β†’+* K` if `K` is separably closed. See also `IsSepClosed.splits_domain` for the case where `k` is separably closed. -/ theorem IsSepClosed.splits_codomain [IsSepClosed K] {f : k β†’+* K} (p : k[X]) (h : p.Separable) : p.Splits f := by convert IsSepClosed.splits_of_separable (p.map f) (Separable.map h); simp [splits_map_iff] /-- Every separable polynomial splits in the field extension `f : k β†’+* K` if `k` is separably closed. See also `IsSepClosed.splits_codomain` for the case where `k` is separably closed. -/ theorem IsSepClosed.splits_domain [IsSepClosed k] {f : k β†’+* K} (p : k[X]) (h : p.Separable) : p.Splits f := Polynomial.splits_of_splits_id _ <| IsSepClosed.splits_of_separable _ h namespace IsSepClosed theorem exists_root [IsSepClosed k] (p : k[X]) (hp : p.degree β‰  0) (hsep : p.Separable) : βˆƒ x, IsRoot p x := exists_root_of_splits _ (IsSepClosed.splits_of_separable p hsep) hp theorem exists_pow_nat_eq [IsSepClosed k] (x : k) (n : β„•) [hn : NeZero (n : k)] : βˆƒ z, z ^ n = x := by have hn' : 0 < n := Nat.pos_of_ne_zero <| fun h => by rw [h, Nat.cast_zero] at hn exact hn.out rfl have : degree (X ^ n - C x) β‰  0 := by rw [degree_X_pow_sub_C hn' x] exact (WithBot.coe_lt_coe.2 hn').ne' by_cases hx : x = 0 Β· exact ⟨0, by rw [hx, pow_eq_zero_iff hn']⟩ Β· obtain ⟨z, hz⟩ := exists_root _ this <| separable_X_pow_sub_C x hn.out hx use z simpa [eval_C, eval_X, eval_pow, eval_sub, IsRoot.def, sub_eq_zero] using hz theorem exists_eq_mul_self [IsSepClosed k] (x : k) [h2 : NeZero (2 : k)] : βˆƒ z, x = z * z := by rcases exists_pow_nat_eq x 2 with ⟨z, rfl⟩ exact ⟨z, sq z⟩ theorem roots_eq_zero_iff [IsSepClosed k] {p : k[X]} (hsep : p.Separable) : p.roots = 0 ↔ p = Polynomial.C (p.coeff 0) := by refine' ⟨fun h => _, fun hp => by rw [hp, roots_C]⟩ rcases le_or_lt (degree p) 0 with hd | hd Β· exact eq_C_of_degree_le_zero hd Β· obtain ⟨z, hz⟩ := IsSepClosed.exists_root p hd.ne' hsep rw [← mem_roots (ne_zero_of_degree_gt hd), h] at hz simp at hz theorem exists_evalβ‚‚_eq_zero [IsSepClosed K] (f : k β†’+* K) (p : k[X]) (hp : p.degree β‰  0) (hsep : p.Separable) : βˆƒ x, p.evalβ‚‚ f x = 0 := let ⟨x, hx⟩ := exists_root (p.map f) (by rwa [degree_map_eq_of_injective f.injective]) (Separable.map hsep) ⟨x, by rwa [evalβ‚‚_eq_eval_map, ← IsRoot]⟩ variable (K) theorem exists_aeval_eq_zero [IsSepClosed K] [Algebra k K] (p : k[X]) (hp : p.degree β‰  0) (hsep : p.Separable) : βˆƒ x : K, aeval x p = 0 := exists_evalβ‚‚_eq_zero (algebraMap k K) p hp hsep variable (k) {K} theorem of_exists_root (H : βˆ€ p : k[X], p.Monic β†’ Irreducible p β†’ Separable p β†’ βˆƒ x, p.eval x = 0) : IsSepClosed k := by refine ⟨fun p hsep ↦ Or.inr ?_⟩ intro q hq hdvd simp only [map_id] at hdvd have hlc : IsUnit (leadingCoeff q)⁻¹ := IsUnit.inv <| Ne.isUnit <| leadingCoeff_ne_zero.2 <| Irreducible.ne_zero hq
have hsep' : Separable (q * C (leadingCoeff q)⁻¹) := Separable.mul (Separable.of_dvd hsep hdvd) ((separable_C _).2 hlc) (by simpa only [← isCoprime_mul_unit_right_right (isUnit_C.2 hlc) q 1, one_mul] using isCoprime_one_right (x := q))
theorem of_exists_root (H : βˆ€ p : k[X], p.Monic β†’ Irreducible p β†’ Separable p β†’ βˆƒ x, p.eval x = 0) : IsSepClosed k := by refine ⟨fun p hsep ↦ Or.inr ?_⟩ intro q hq hdvd simp only [map_id] at hdvd have hlc : IsUnit (leadingCoeff q)⁻¹ := IsUnit.inv <| Ne.isUnit <| leadingCoeff_ne_zero.2 <| Irreducible.ne_zero hq
Mathlib.FieldTheory.IsSepClosed.136_0.3ZRqn1f8ZTqE2nc
theorem of_exists_root (H : βˆ€ p : k[X], p.Monic β†’ Irreducible p β†’ Separable p β†’ βˆƒ x, p.eval x = 0) : IsSepClosed k
Mathlib_FieldTheory_IsSepClosed
k : Type u inst✝¹ : Field k K : Type v inst✝ : Field K H : βˆ€ (p : k[X]), Monic p β†’ Irreducible p β†’ Separable p β†’ βˆƒ x, eval x p = 0 p : k[X] hsep : Separable p q : k[X] hq : Irreducible q hdvd : q ∣ p hlc : IsUnit (leadingCoeff q)⁻¹ ⊒ IsCoprime q (C (leadingCoeff q)⁻¹)
/- Copyright (c) 2023 Jz Pan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jz Pan -/ import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure /-! # Separably Closed Field In this file we define the typeclass for separably closed fields and separable closures, and prove some of their properties. ## Main Definitions - `IsSepClosed k` is the typeclass saying `k` is a separably closed field, i.e. every separable polynomial in `k` splits. - `IsSepClosure k K` is the typeclass saying `K` is a separable closure of `k`, where `k` is a field. This means that `K` is separably closed and separable over `k`. - `IsSepClosed.lift` is a map from a separable extension `L` of `K`, into any separably closed extension `M` of `K`. - `IsSepClosure.equiv` is a proof that any two separable closures of the same field are isomorphic. ## Tags separable closure, separably closed ## TODO - Maximal separable subextension of `K/k`, consisting of all elements of `K` which are separable over `k`. - If `K` is a separably closed field containing `k`, then the maximal separable subextension of `K/k` is a separable closure of `k`. - In particular, a separable closure exists. - If `k` is a perfect field, then its separable closure coincides with its algebraic closure. - An algebraic extension of a separably closed field is purely inseparable. -/ universe u v w open scoped Classical BigOperators Polynomial open Polynomial variable (k : Type u) [Field k] (K : Type v) [Field K] /-- Typeclass for separably closed fields. To show `Polynomial.Splits p f` for an arbitrary ring homomorphism `f`, see `IsSepClosed.splits_codomain` and `IsSepClosed.splits_domain`. -/ class IsSepClosed : Prop where splits_of_separable : βˆ€ p : k[X], p.Separable β†’ (p.Splits <| RingHom.id k) /-- An algebraically closed field is also separably closed. -/ instance IsSepClosed.of_isAlgClosed [IsAlgClosed k] : IsSepClosed k := ⟨fun p _ ↦ IsAlgClosed.splits p⟩ variable {k} {K} /-- Every separable polynomial splits in the field extension `f : k β†’+* K` if `K` is separably closed. See also `IsSepClosed.splits_domain` for the case where `k` is separably closed. -/ theorem IsSepClosed.splits_codomain [IsSepClosed K] {f : k β†’+* K} (p : k[X]) (h : p.Separable) : p.Splits f := by convert IsSepClosed.splits_of_separable (p.map f) (Separable.map h); simp [splits_map_iff] /-- Every separable polynomial splits in the field extension `f : k β†’+* K` if `k` is separably closed. See also `IsSepClosed.splits_codomain` for the case where `k` is separably closed. -/ theorem IsSepClosed.splits_domain [IsSepClosed k] {f : k β†’+* K} (p : k[X]) (h : p.Separable) : p.Splits f := Polynomial.splits_of_splits_id _ <| IsSepClosed.splits_of_separable _ h namespace IsSepClosed theorem exists_root [IsSepClosed k] (p : k[X]) (hp : p.degree β‰  0) (hsep : p.Separable) : βˆƒ x, IsRoot p x := exists_root_of_splits _ (IsSepClosed.splits_of_separable p hsep) hp theorem exists_pow_nat_eq [IsSepClosed k] (x : k) (n : β„•) [hn : NeZero (n : k)] : βˆƒ z, z ^ n = x := by have hn' : 0 < n := Nat.pos_of_ne_zero <| fun h => by rw [h, Nat.cast_zero] at hn exact hn.out rfl have : degree (X ^ n - C x) β‰  0 := by rw [degree_X_pow_sub_C hn' x] exact (WithBot.coe_lt_coe.2 hn').ne' by_cases hx : x = 0 Β· exact ⟨0, by rw [hx, pow_eq_zero_iff hn']⟩ Β· obtain ⟨z, hz⟩ := exists_root _ this <| separable_X_pow_sub_C x hn.out hx use z simpa [eval_C, eval_X, eval_pow, eval_sub, IsRoot.def, sub_eq_zero] using hz theorem exists_eq_mul_self [IsSepClosed k] (x : k) [h2 : NeZero (2 : k)] : βˆƒ z, x = z * z := by rcases exists_pow_nat_eq x 2 with ⟨z, rfl⟩ exact ⟨z, sq z⟩ theorem roots_eq_zero_iff [IsSepClosed k] {p : k[X]} (hsep : p.Separable) : p.roots = 0 ↔ p = Polynomial.C (p.coeff 0) := by refine' ⟨fun h => _, fun hp => by rw [hp, roots_C]⟩ rcases le_or_lt (degree p) 0 with hd | hd Β· exact eq_C_of_degree_le_zero hd Β· obtain ⟨z, hz⟩ := IsSepClosed.exists_root p hd.ne' hsep rw [← mem_roots (ne_zero_of_degree_gt hd), h] at hz simp at hz theorem exists_evalβ‚‚_eq_zero [IsSepClosed K] (f : k β†’+* K) (p : k[X]) (hp : p.degree β‰  0) (hsep : p.Separable) : βˆƒ x, p.evalβ‚‚ f x = 0 := let ⟨x, hx⟩ := exists_root (p.map f) (by rwa [degree_map_eq_of_injective f.injective]) (Separable.map hsep) ⟨x, by rwa [evalβ‚‚_eq_eval_map, ← IsRoot]⟩ variable (K) theorem exists_aeval_eq_zero [IsSepClosed K] [Algebra k K] (p : k[X]) (hp : p.degree β‰  0) (hsep : p.Separable) : βˆƒ x : K, aeval x p = 0 := exists_evalβ‚‚_eq_zero (algebraMap k K) p hp hsep variable (k) {K} theorem of_exists_root (H : βˆ€ p : k[X], p.Monic β†’ Irreducible p β†’ Separable p β†’ βˆƒ x, p.eval x = 0) : IsSepClosed k := by refine ⟨fun p hsep ↦ Or.inr ?_⟩ intro q hq hdvd simp only [map_id] at hdvd have hlc : IsUnit (leadingCoeff q)⁻¹ := IsUnit.inv <| Ne.isUnit <| leadingCoeff_ne_zero.2 <| Irreducible.ne_zero hq have hsep' : Separable (q * C (leadingCoeff q)⁻¹) := Separable.mul (Separable.of_dvd hsep hdvd) ((separable_C _).2 hlc) (by
simpa only [← isCoprime_mul_unit_right_right (isUnit_C.2 hlc) q 1, one_mul] using isCoprime_one_right (x := q)
theorem of_exists_root (H : βˆ€ p : k[X], p.Monic β†’ Irreducible p β†’ Separable p β†’ βˆƒ x, p.eval x = 0) : IsSepClosed k := by refine ⟨fun p hsep ↦ Or.inr ?_⟩ intro q hq hdvd simp only [map_id] at hdvd have hlc : IsUnit (leadingCoeff q)⁻¹ := IsUnit.inv <| Ne.isUnit <| leadingCoeff_ne_zero.2 <| Irreducible.ne_zero hq have hsep' : Separable (q * C (leadingCoeff q)⁻¹) := Separable.mul (Separable.of_dvd hsep hdvd) ((separable_C _).2 hlc) (by
Mathlib.FieldTheory.IsSepClosed.136_0.3ZRqn1f8ZTqE2nc
theorem of_exists_root (H : βˆ€ p : k[X], p.Monic β†’ Irreducible p β†’ Separable p β†’ βˆƒ x, p.eval x = 0) : IsSepClosed k
Mathlib_FieldTheory_IsSepClosed
k : Type u inst✝¹ : Field k K : Type v inst✝ : Field K H : βˆ€ (p : k[X]), Monic p β†’ Irreducible p β†’ Separable p β†’ βˆƒ x, eval x p = 0 p : k[X] hsep : Separable p q : k[X] hq : Irreducible q hdvd : q ∣ p hlc : IsUnit (leadingCoeff q)⁻¹ hsep' : Separable (q * C (leadingCoeff q)⁻¹) ⊒ degree q = 1
/- Copyright (c) 2023 Jz Pan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jz Pan -/ import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure /-! # Separably Closed Field In this file we define the typeclass for separably closed fields and separable closures, and prove some of their properties. ## Main Definitions - `IsSepClosed k` is the typeclass saying `k` is a separably closed field, i.e. every separable polynomial in `k` splits. - `IsSepClosure k K` is the typeclass saying `K` is a separable closure of `k`, where `k` is a field. This means that `K` is separably closed and separable over `k`. - `IsSepClosed.lift` is a map from a separable extension `L` of `K`, into any separably closed extension `M` of `K`. - `IsSepClosure.equiv` is a proof that any two separable closures of the same field are isomorphic. ## Tags separable closure, separably closed ## TODO - Maximal separable subextension of `K/k`, consisting of all elements of `K` which are separable over `k`. - If `K` is a separably closed field containing `k`, then the maximal separable subextension of `K/k` is a separable closure of `k`. - In particular, a separable closure exists. - If `k` is a perfect field, then its separable closure coincides with its algebraic closure. - An algebraic extension of a separably closed field is purely inseparable. -/ universe u v w open scoped Classical BigOperators Polynomial open Polynomial variable (k : Type u) [Field k] (K : Type v) [Field K] /-- Typeclass for separably closed fields. To show `Polynomial.Splits p f` for an arbitrary ring homomorphism `f`, see `IsSepClosed.splits_codomain` and `IsSepClosed.splits_domain`. -/ class IsSepClosed : Prop where splits_of_separable : βˆ€ p : k[X], p.Separable β†’ (p.Splits <| RingHom.id k) /-- An algebraically closed field is also separably closed. -/ instance IsSepClosed.of_isAlgClosed [IsAlgClosed k] : IsSepClosed k := ⟨fun p _ ↦ IsAlgClosed.splits p⟩ variable {k} {K} /-- Every separable polynomial splits in the field extension `f : k β†’+* K` if `K` is separably closed. See also `IsSepClosed.splits_domain` for the case where `k` is separably closed. -/ theorem IsSepClosed.splits_codomain [IsSepClosed K] {f : k β†’+* K} (p : k[X]) (h : p.Separable) : p.Splits f := by convert IsSepClosed.splits_of_separable (p.map f) (Separable.map h); simp [splits_map_iff] /-- Every separable polynomial splits in the field extension `f : k β†’+* K` if `k` is separably closed. See also `IsSepClosed.splits_codomain` for the case where `k` is separably closed. -/ theorem IsSepClosed.splits_domain [IsSepClosed k] {f : k β†’+* K} (p : k[X]) (h : p.Separable) : p.Splits f := Polynomial.splits_of_splits_id _ <| IsSepClosed.splits_of_separable _ h namespace IsSepClosed theorem exists_root [IsSepClosed k] (p : k[X]) (hp : p.degree β‰  0) (hsep : p.Separable) : βˆƒ x, IsRoot p x := exists_root_of_splits _ (IsSepClosed.splits_of_separable p hsep) hp theorem exists_pow_nat_eq [IsSepClosed k] (x : k) (n : β„•) [hn : NeZero (n : k)] : βˆƒ z, z ^ n = x := by have hn' : 0 < n := Nat.pos_of_ne_zero <| fun h => by rw [h, Nat.cast_zero] at hn exact hn.out rfl have : degree (X ^ n - C x) β‰  0 := by rw [degree_X_pow_sub_C hn' x] exact (WithBot.coe_lt_coe.2 hn').ne' by_cases hx : x = 0 Β· exact ⟨0, by rw [hx, pow_eq_zero_iff hn']⟩ Β· obtain ⟨z, hz⟩ := exists_root _ this <| separable_X_pow_sub_C x hn.out hx use z simpa [eval_C, eval_X, eval_pow, eval_sub, IsRoot.def, sub_eq_zero] using hz theorem exists_eq_mul_self [IsSepClosed k] (x : k) [h2 : NeZero (2 : k)] : βˆƒ z, x = z * z := by rcases exists_pow_nat_eq x 2 with ⟨z, rfl⟩ exact ⟨z, sq z⟩ theorem roots_eq_zero_iff [IsSepClosed k] {p : k[X]} (hsep : p.Separable) : p.roots = 0 ↔ p = Polynomial.C (p.coeff 0) := by refine' ⟨fun h => _, fun hp => by rw [hp, roots_C]⟩ rcases le_or_lt (degree p) 0 with hd | hd Β· exact eq_C_of_degree_le_zero hd Β· obtain ⟨z, hz⟩ := IsSepClosed.exists_root p hd.ne' hsep rw [← mem_roots (ne_zero_of_degree_gt hd), h] at hz simp at hz theorem exists_evalβ‚‚_eq_zero [IsSepClosed K] (f : k β†’+* K) (p : k[X]) (hp : p.degree β‰  0) (hsep : p.Separable) : βˆƒ x, p.evalβ‚‚ f x = 0 := let ⟨x, hx⟩ := exists_root (p.map f) (by rwa [degree_map_eq_of_injective f.injective]) (Separable.map hsep) ⟨x, by rwa [evalβ‚‚_eq_eval_map, ← IsRoot]⟩ variable (K) theorem exists_aeval_eq_zero [IsSepClosed K] [Algebra k K] (p : k[X]) (hp : p.degree β‰  0) (hsep : p.Separable) : βˆƒ x : K, aeval x p = 0 := exists_evalβ‚‚_eq_zero (algebraMap k K) p hp hsep variable (k) {K} theorem of_exists_root (H : βˆ€ p : k[X], p.Monic β†’ Irreducible p β†’ Separable p β†’ βˆƒ x, p.eval x = 0) : IsSepClosed k := by refine ⟨fun p hsep ↦ Or.inr ?_⟩ intro q hq hdvd simp only [map_id] at hdvd have hlc : IsUnit (leadingCoeff q)⁻¹ := IsUnit.inv <| Ne.isUnit <| leadingCoeff_ne_zero.2 <| Irreducible.ne_zero hq have hsep' : Separable (q * C (leadingCoeff q)⁻¹) := Separable.mul (Separable.of_dvd hsep hdvd) ((separable_C _).2 hlc) (by simpa only [← isCoprime_mul_unit_right_right (isUnit_C.2 hlc) q 1, one_mul] using isCoprime_one_right (x := q))
have hirr' := hq
theorem of_exists_root (H : βˆ€ p : k[X], p.Monic β†’ Irreducible p β†’ Separable p β†’ βˆƒ x, p.eval x = 0) : IsSepClosed k := by refine ⟨fun p hsep ↦ Or.inr ?_⟩ intro q hq hdvd simp only [map_id] at hdvd have hlc : IsUnit (leadingCoeff q)⁻¹ := IsUnit.inv <| Ne.isUnit <| leadingCoeff_ne_zero.2 <| Irreducible.ne_zero hq have hsep' : Separable (q * C (leadingCoeff q)⁻¹) := Separable.mul (Separable.of_dvd hsep hdvd) ((separable_C _).2 hlc) (by simpa only [← isCoprime_mul_unit_right_right (isUnit_C.2 hlc) q 1, one_mul] using isCoprime_one_right (x := q))
Mathlib.FieldTheory.IsSepClosed.136_0.3ZRqn1f8ZTqE2nc
theorem of_exists_root (H : βˆ€ p : k[X], p.Monic β†’ Irreducible p β†’ Separable p β†’ βˆƒ x, p.eval x = 0) : IsSepClosed k
Mathlib_FieldTheory_IsSepClosed
k : Type u inst✝¹ : Field k K : Type v inst✝ : Field K H : βˆ€ (p : k[X]), Monic p β†’ Irreducible p β†’ Separable p β†’ βˆƒ x, eval x p = 0 p : k[X] hsep : Separable p q : k[X] hq : Irreducible q hdvd : q ∣ p hlc : IsUnit (leadingCoeff q)⁻¹ hsep' : Separable (q * C (leadingCoeff q)⁻¹) hirr' : Irreducible q ⊒ degree q = 1
/- Copyright (c) 2023 Jz Pan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jz Pan -/ import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure /-! # Separably Closed Field In this file we define the typeclass for separably closed fields and separable closures, and prove some of their properties. ## Main Definitions - `IsSepClosed k` is the typeclass saying `k` is a separably closed field, i.e. every separable polynomial in `k` splits. - `IsSepClosure k K` is the typeclass saying `K` is a separable closure of `k`, where `k` is a field. This means that `K` is separably closed and separable over `k`. - `IsSepClosed.lift` is a map from a separable extension `L` of `K`, into any separably closed extension `M` of `K`. - `IsSepClosure.equiv` is a proof that any two separable closures of the same field are isomorphic. ## Tags separable closure, separably closed ## TODO - Maximal separable subextension of `K/k`, consisting of all elements of `K` which are separable over `k`. - If `K` is a separably closed field containing `k`, then the maximal separable subextension of `K/k` is a separable closure of `k`. - In particular, a separable closure exists. - If `k` is a perfect field, then its separable closure coincides with its algebraic closure. - An algebraic extension of a separably closed field is purely inseparable. -/ universe u v w open scoped Classical BigOperators Polynomial open Polynomial variable (k : Type u) [Field k] (K : Type v) [Field K] /-- Typeclass for separably closed fields. To show `Polynomial.Splits p f` for an arbitrary ring homomorphism `f`, see `IsSepClosed.splits_codomain` and `IsSepClosed.splits_domain`. -/ class IsSepClosed : Prop where splits_of_separable : βˆ€ p : k[X], p.Separable β†’ (p.Splits <| RingHom.id k) /-- An algebraically closed field is also separably closed. -/ instance IsSepClosed.of_isAlgClosed [IsAlgClosed k] : IsSepClosed k := ⟨fun p _ ↦ IsAlgClosed.splits p⟩ variable {k} {K} /-- Every separable polynomial splits in the field extension `f : k β†’+* K` if `K` is separably closed. See also `IsSepClosed.splits_domain` for the case where `k` is separably closed. -/ theorem IsSepClosed.splits_codomain [IsSepClosed K] {f : k β†’+* K} (p : k[X]) (h : p.Separable) : p.Splits f := by convert IsSepClosed.splits_of_separable (p.map f) (Separable.map h); simp [splits_map_iff] /-- Every separable polynomial splits in the field extension `f : k β†’+* K` if `k` is separably closed. See also `IsSepClosed.splits_codomain` for the case where `k` is separably closed. -/ theorem IsSepClosed.splits_domain [IsSepClosed k] {f : k β†’+* K} (p : k[X]) (h : p.Separable) : p.Splits f := Polynomial.splits_of_splits_id _ <| IsSepClosed.splits_of_separable _ h namespace IsSepClosed theorem exists_root [IsSepClosed k] (p : k[X]) (hp : p.degree β‰  0) (hsep : p.Separable) : βˆƒ x, IsRoot p x := exists_root_of_splits _ (IsSepClosed.splits_of_separable p hsep) hp theorem exists_pow_nat_eq [IsSepClosed k] (x : k) (n : β„•) [hn : NeZero (n : k)] : βˆƒ z, z ^ n = x := by have hn' : 0 < n := Nat.pos_of_ne_zero <| fun h => by rw [h, Nat.cast_zero] at hn exact hn.out rfl have : degree (X ^ n - C x) β‰  0 := by rw [degree_X_pow_sub_C hn' x] exact (WithBot.coe_lt_coe.2 hn').ne' by_cases hx : x = 0 Β· exact ⟨0, by rw [hx, pow_eq_zero_iff hn']⟩ Β· obtain ⟨z, hz⟩ := exists_root _ this <| separable_X_pow_sub_C x hn.out hx use z simpa [eval_C, eval_X, eval_pow, eval_sub, IsRoot.def, sub_eq_zero] using hz theorem exists_eq_mul_self [IsSepClosed k] (x : k) [h2 : NeZero (2 : k)] : βˆƒ z, x = z * z := by rcases exists_pow_nat_eq x 2 with ⟨z, rfl⟩ exact ⟨z, sq z⟩ theorem roots_eq_zero_iff [IsSepClosed k] {p : k[X]} (hsep : p.Separable) : p.roots = 0 ↔ p = Polynomial.C (p.coeff 0) := by refine' ⟨fun h => _, fun hp => by rw [hp, roots_C]⟩ rcases le_or_lt (degree p) 0 with hd | hd Β· exact eq_C_of_degree_le_zero hd Β· obtain ⟨z, hz⟩ := IsSepClosed.exists_root p hd.ne' hsep rw [← mem_roots (ne_zero_of_degree_gt hd), h] at hz simp at hz theorem exists_evalβ‚‚_eq_zero [IsSepClosed K] (f : k β†’+* K) (p : k[X]) (hp : p.degree β‰  0) (hsep : p.Separable) : βˆƒ x, p.evalβ‚‚ f x = 0 := let ⟨x, hx⟩ := exists_root (p.map f) (by rwa [degree_map_eq_of_injective f.injective]) (Separable.map hsep) ⟨x, by rwa [evalβ‚‚_eq_eval_map, ← IsRoot]⟩ variable (K) theorem exists_aeval_eq_zero [IsSepClosed K] [Algebra k K] (p : k[X]) (hp : p.degree β‰  0) (hsep : p.Separable) : βˆƒ x : K, aeval x p = 0 := exists_evalβ‚‚_eq_zero (algebraMap k K) p hp hsep variable (k) {K} theorem of_exists_root (H : βˆ€ p : k[X], p.Monic β†’ Irreducible p β†’ Separable p β†’ βˆƒ x, p.eval x = 0) : IsSepClosed k := by refine ⟨fun p hsep ↦ Or.inr ?_⟩ intro q hq hdvd simp only [map_id] at hdvd have hlc : IsUnit (leadingCoeff q)⁻¹ := IsUnit.inv <| Ne.isUnit <| leadingCoeff_ne_zero.2 <| Irreducible.ne_zero hq have hsep' : Separable (q * C (leadingCoeff q)⁻¹) := Separable.mul (Separable.of_dvd hsep hdvd) ((separable_C _).2 hlc) (by simpa only [← isCoprime_mul_unit_right_right (isUnit_C.2 hlc) q 1, one_mul] using isCoprime_one_right (x := q)) have hirr' := hq
rw [← irreducible_mul_isUnit (isUnit_C.2 hlc)] at hirr'
theorem of_exists_root (H : βˆ€ p : k[X], p.Monic β†’ Irreducible p β†’ Separable p β†’ βˆƒ x, p.eval x = 0) : IsSepClosed k := by refine ⟨fun p hsep ↦ Or.inr ?_⟩ intro q hq hdvd simp only [map_id] at hdvd have hlc : IsUnit (leadingCoeff q)⁻¹ := IsUnit.inv <| Ne.isUnit <| leadingCoeff_ne_zero.2 <| Irreducible.ne_zero hq have hsep' : Separable (q * C (leadingCoeff q)⁻¹) := Separable.mul (Separable.of_dvd hsep hdvd) ((separable_C _).2 hlc) (by simpa only [← isCoprime_mul_unit_right_right (isUnit_C.2 hlc) q 1, one_mul] using isCoprime_one_right (x := q)) have hirr' := hq
Mathlib.FieldTheory.IsSepClosed.136_0.3ZRqn1f8ZTqE2nc
theorem of_exists_root (H : βˆ€ p : k[X], p.Monic β†’ Irreducible p β†’ Separable p β†’ βˆƒ x, p.eval x = 0) : IsSepClosed k
Mathlib_FieldTheory_IsSepClosed
k : Type u inst✝¹ : Field k K : Type v inst✝ : Field K H : βˆ€ (p : k[X]), Monic p β†’ Irreducible p β†’ Separable p β†’ βˆƒ x, eval x p = 0 p : k[X] hsep : Separable p q : k[X] hq : Irreducible q hdvd : q ∣ p hlc : IsUnit (leadingCoeff q)⁻¹ hsep' : Separable (q * C (leadingCoeff q)⁻¹) hirr' : Irreducible (q * C (leadingCoeff q)⁻¹) ⊒ degree q = 1
/- Copyright (c) 2023 Jz Pan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jz Pan -/ import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure /-! # Separably Closed Field In this file we define the typeclass for separably closed fields and separable closures, and prove some of their properties. ## Main Definitions - `IsSepClosed k` is the typeclass saying `k` is a separably closed field, i.e. every separable polynomial in `k` splits. - `IsSepClosure k K` is the typeclass saying `K` is a separable closure of `k`, where `k` is a field. This means that `K` is separably closed and separable over `k`. - `IsSepClosed.lift` is a map from a separable extension `L` of `K`, into any separably closed extension `M` of `K`. - `IsSepClosure.equiv` is a proof that any two separable closures of the same field are isomorphic. ## Tags separable closure, separably closed ## TODO - Maximal separable subextension of `K/k`, consisting of all elements of `K` which are separable over `k`. - If `K` is a separably closed field containing `k`, then the maximal separable subextension of `K/k` is a separable closure of `k`. - In particular, a separable closure exists. - If `k` is a perfect field, then its separable closure coincides with its algebraic closure. - An algebraic extension of a separably closed field is purely inseparable. -/ universe u v w open scoped Classical BigOperators Polynomial open Polynomial variable (k : Type u) [Field k] (K : Type v) [Field K] /-- Typeclass for separably closed fields. To show `Polynomial.Splits p f` for an arbitrary ring homomorphism `f`, see `IsSepClosed.splits_codomain` and `IsSepClosed.splits_domain`. -/ class IsSepClosed : Prop where splits_of_separable : βˆ€ p : k[X], p.Separable β†’ (p.Splits <| RingHom.id k) /-- An algebraically closed field is also separably closed. -/ instance IsSepClosed.of_isAlgClosed [IsAlgClosed k] : IsSepClosed k := ⟨fun p _ ↦ IsAlgClosed.splits p⟩ variable {k} {K} /-- Every separable polynomial splits in the field extension `f : k β†’+* K` if `K` is separably closed. See also `IsSepClosed.splits_domain` for the case where `k` is separably closed. -/ theorem IsSepClosed.splits_codomain [IsSepClosed K] {f : k β†’+* K} (p : k[X]) (h : p.Separable) : p.Splits f := by convert IsSepClosed.splits_of_separable (p.map f) (Separable.map h); simp [splits_map_iff] /-- Every separable polynomial splits in the field extension `f : k β†’+* K` if `k` is separably closed. See also `IsSepClosed.splits_codomain` for the case where `k` is separably closed. -/ theorem IsSepClosed.splits_domain [IsSepClosed k] {f : k β†’+* K} (p : k[X]) (h : p.Separable) : p.Splits f := Polynomial.splits_of_splits_id _ <| IsSepClosed.splits_of_separable _ h namespace IsSepClosed theorem exists_root [IsSepClosed k] (p : k[X]) (hp : p.degree β‰  0) (hsep : p.Separable) : βˆƒ x, IsRoot p x := exists_root_of_splits _ (IsSepClosed.splits_of_separable p hsep) hp theorem exists_pow_nat_eq [IsSepClosed k] (x : k) (n : β„•) [hn : NeZero (n : k)] : βˆƒ z, z ^ n = x := by have hn' : 0 < n := Nat.pos_of_ne_zero <| fun h => by rw [h, Nat.cast_zero] at hn exact hn.out rfl have : degree (X ^ n - C x) β‰  0 := by rw [degree_X_pow_sub_C hn' x] exact (WithBot.coe_lt_coe.2 hn').ne' by_cases hx : x = 0 Β· exact ⟨0, by rw [hx, pow_eq_zero_iff hn']⟩ Β· obtain ⟨z, hz⟩ := exists_root _ this <| separable_X_pow_sub_C x hn.out hx use z simpa [eval_C, eval_X, eval_pow, eval_sub, IsRoot.def, sub_eq_zero] using hz theorem exists_eq_mul_self [IsSepClosed k] (x : k) [h2 : NeZero (2 : k)] : βˆƒ z, x = z * z := by rcases exists_pow_nat_eq x 2 with ⟨z, rfl⟩ exact ⟨z, sq z⟩ theorem roots_eq_zero_iff [IsSepClosed k] {p : k[X]} (hsep : p.Separable) : p.roots = 0 ↔ p = Polynomial.C (p.coeff 0) := by refine' ⟨fun h => _, fun hp => by rw [hp, roots_C]⟩ rcases le_or_lt (degree p) 0 with hd | hd Β· exact eq_C_of_degree_le_zero hd Β· obtain ⟨z, hz⟩ := IsSepClosed.exists_root p hd.ne' hsep rw [← mem_roots (ne_zero_of_degree_gt hd), h] at hz simp at hz theorem exists_evalβ‚‚_eq_zero [IsSepClosed K] (f : k β†’+* K) (p : k[X]) (hp : p.degree β‰  0) (hsep : p.Separable) : βˆƒ x, p.evalβ‚‚ f x = 0 := let ⟨x, hx⟩ := exists_root (p.map f) (by rwa [degree_map_eq_of_injective f.injective]) (Separable.map hsep) ⟨x, by rwa [evalβ‚‚_eq_eval_map, ← IsRoot]⟩ variable (K) theorem exists_aeval_eq_zero [IsSepClosed K] [Algebra k K] (p : k[X]) (hp : p.degree β‰  0) (hsep : p.Separable) : βˆƒ x : K, aeval x p = 0 := exists_evalβ‚‚_eq_zero (algebraMap k K) p hp hsep variable (k) {K} theorem of_exists_root (H : βˆ€ p : k[X], p.Monic β†’ Irreducible p β†’ Separable p β†’ βˆƒ x, p.eval x = 0) : IsSepClosed k := by refine ⟨fun p hsep ↦ Or.inr ?_⟩ intro q hq hdvd simp only [map_id] at hdvd have hlc : IsUnit (leadingCoeff q)⁻¹ := IsUnit.inv <| Ne.isUnit <| leadingCoeff_ne_zero.2 <| Irreducible.ne_zero hq have hsep' : Separable (q * C (leadingCoeff q)⁻¹) := Separable.mul (Separable.of_dvd hsep hdvd) ((separable_C _).2 hlc) (by simpa only [← isCoprime_mul_unit_right_right (isUnit_C.2 hlc) q 1, one_mul] using isCoprime_one_right (x := q)) have hirr' := hq rw [← irreducible_mul_isUnit (isUnit_C.2 hlc)] at hirr'
obtain ⟨x, hx⟩ := H (q * C (leadingCoeff q)⁻¹) (monic_mul_leadingCoeff_inv hq.ne_zero) hirr' hsep'
theorem of_exists_root (H : βˆ€ p : k[X], p.Monic β†’ Irreducible p β†’ Separable p β†’ βˆƒ x, p.eval x = 0) : IsSepClosed k := by refine ⟨fun p hsep ↦ Or.inr ?_⟩ intro q hq hdvd simp only [map_id] at hdvd have hlc : IsUnit (leadingCoeff q)⁻¹ := IsUnit.inv <| Ne.isUnit <| leadingCoeff_ne_zero.2 <| Irreducible.ne_zero hq have hsep' : Separable (q * C (leadingCoeff q)⁻¹) := Separable.mul (Separable.of_dvd hsep hdvd) ((separable_C _).2 hlc) (by simpa only [← isCoprime_mul_unit_right_right (isUnit_C.2 hlc) q 1, one_mul] using isCoprime_one_right (x := q)) have hirr' := hq rw [← irreducible_mul_isUnit (isUnit_C.2 hlc)] at hirr'
Mathlib.FieldTheory.IsSepClosed.136_0.3ZRqn1f8ZTqE2nc
theorem of_exists_root (H : βˆ€ p : k[X], p.Monic β†’ Irreducible p β†’ Separable p β†’ βˆƒ x, p.eval x = 0) : IsSepClosed k
Mathlib_FieldTheory_IsSepClosed
case intro k : Type u inst✝¹ : Field k K : Type v inst✝ : Field K H : βˆ€ (p : k[X]), Monic p β†’ Irreducible p β†’ Separable p β†’ βˆƒ x, eval x p = 0 p : k[X] hsep : Separable p q : k[X] hq : Irreducible q hdvd : q ∣ p hlc : IsUnit (leadingCoeff q)⁻¹ hsep' : Separable (q * C (leadingCoeff q)⁻¹) hirr' : Irreducible (q * C (leadingCoeff q)⁻¹) x : k hx : eval x (q * C (leadingCoeff q)⁻¹) = 0 ⊒ degree q = 1
/- Copyright (c) 2023 Jz Pan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jz Pan -/ import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure /-! # Separably Closed Field In this file we define the typeclass for separably closed fields and separable closures, and prove some of their properties. ## Main Definitions - `IsSepClosed k` is the typeclass saying `k` is a separably closed field, i.e. every separable polynomial in `k` splits. - `IsSepClosure k K` is the typeclass saying `K` is a separable closure of `k`, where `k` is a field. This means that `K` is separably closed and separable over `k`. - `IsSepClosed.lift` is a map from a separable extension `L` of `K`, into any separably closed extension `M` of `K`. - `IsSepClosure.equiv` is a proof that any two separable closures of the same field are isomorphic. ## Tags separable closure, separably closed ## TODO - Maximal separable subextension of `K/k`, consisting of all elements of `K` which are separable over `k`. - If `K` is a separably closed field containing `k`, then the maximal separable subextension of `K/k` is a separable closure of `k`. - In particular, a separable closure exists. - If `k` is a perfect field, then its separable closure coincides with its algebraic closure. - An algebraic extension of a separably closed field is purely inseparable. -/ universe u v w open scoped Classical BigOperators Polynomial open Polynomial variable (k : Type u) [Field k] (K : Type v) [Field K] /-- Typeclass for separably closed fields. To show `Polynomial.Splits p f` for an arbitrary ring homomorphism `f`, see `IsSepClosed.splits_codomain` and `IsSepClosed.splits_domain`. -/ class IsSepClosed : Prop where splits_of_separable : βˆ€ p : k[X], p.Separable β†’ (p.Splits <| RingHom.id k) /-- An algebraically closed field is also separably closed. -/ instance IsSepClosed.of_isAlgClosed [IsAlgClosed k] : IsSepClosed k := ⟨fun p _ ↦ IsAlgClosed.splits p⟩ variable {k} {K} /-- Every separable polynomial splits in the field extension `f : k β†’+* K` if `K` is separably closed. See also `IsSepClosed.splits_domain` for the case where `k` is separably closed. -/ theorem IsSepClosed.splits_codomain [IsSepClosed K] {f : k β†’+* K} (p : k[X]) (h : p.Separable) : p.Splits f := by convert IsSepClosed.splits_of_separable (p.map f) (Separable.map h); simp [splits_map_iff] /-- Every separable polynomial splits in the field extension `f : k β†’+* K` if `k` is separably closed. See also `IsSepClosed.splits_codomain` for the case where `k` is separably closed. -/ theorem IsSepClosed.splits_domain [IsSepClosed k] {f : k β†’+* K} (p : k[X]) (h : p.Separable) : p.Splits f := Polynomial.splits_of_splits_id _ <| IsSepClosed.splits_of_separable _ h namespace IsSepClosed theorem exists_root [IsSepClosed k] (p : k[X]) (hp : p.degree β‰  0) (hsep : p.Separable) : βˆƒ x, IsRoot p x := exists_root_of_splits _ (IsSepClosed.splits_of_separable p hsep) hp theorem exists_pow_nat_eq [IsSepClosed k] (x : k) (n : β„•) [hn : NeZero (n : k)] : βˆƒ z, z ^ n = x := by have hn' : 0 < n := Nat.pos_of_ne_zero <| fun h => by rw [h, Nat.cast_zero] at hn exact hn.out rfl have : degree (X ^ n - C x) β‰  0 := by rw [degree_X_pow_sub_C hn' x] exact (WithBot.coe_lt_coe.2 hn').ne' by_cases hx : x = 0 Β· exact ⟨0, by rw [hx, pow_eq_zero_iff hn']⟩ Β· obtain ⟨z, hz⟩ := exists_root _ this <| separable_X_pow_sub_C x hn.out hx use z simpa [eval_C, eval_X, eval_pow, eval_sub, IsRoot.def, sub_eq_zero] using hz theorem exists_eq_mul_self [IsSepClosed k] (x : k) [h2 : NeZero (2 : k)] : βˆƒ z, x = z * z := by rcases exists_pow_nat_eq x 2 with ⟨z, rfl⟩ exact ⟨z, sq z⟩ theorem roots_eq_zero_iff [IsSepClosed k] {p : k[X]} (hsep : p.Separable) : p.roots = 0 ↔ p = Polynomial.C (p.coeff 0) := by refine' ⟨fun h => _, fun hp => by rw [hp, roots_C]⟩ rcases le_or_lt (degree p) 0 with hd | hd Β· exact eq_C_of_degree_le_zero hd Β· obtain ⟨z, hz⟩ := IsSepClosed.exists_root p hd.ne' hsep rw [← mem_roots (ne_zero_of_degree_gt hd), h] at hz simp at hz theorem exists_evalβ‚‚_eq_zero [IsSepClosed K] (f : k β†’+* K) (p : k[X]) (hp : p.degree β‰  0) (hsep : p.Separable) : βˆƒ x, p.evalβ‚‚ f x = 0 := let ⟨x, hx⟩ := exists_root (p.map f) (by rwa [degree_map_eq_of_injective f.injective]) (Separable.map hsep) ⟨x, by rwa [evalβ‚‚_eq_eval_map, ← IsRoot]⟩ variable (K) theorem exists_aeval_eq_zero [IsSepClosed K] [Algebra k K] (p : k[X]) (hp : p.degree β‰  0) (hsep : p.Separable) : βˆƒ x : K, aeval x p = 0 := exists_evalβ‚‚_eq_zero (algebraMap k K) p hp hsep variable (k) {K} theorem of_exists_root (H : βˆ€ p : k[X], p.Monic β†’ Irreducible p β†’ Separable p β†’ βˆƒ x, p.eval x = 0) : IsSepClosed k := by refine ⟨fun p hsep ↦ Or.inr ?_⟩ intro q hq hdvd simp only [map_id] at hdvd have hlc : IsUnit (leadingCoeff q)⁻¹ := IsUnit.inv <| Ne.isUnit <| leadingCoeff_ne_zero.2 <| Irreducible.ne_zero hq have hsep' : Separable (q * C (leadingCoeff q)⁻¹) := Separable.mul (Separable.of_dvd hsep hdvd) ((separable_C _).2 hlc) (by simpa only [← isCoprime_mul_unit_right_right (isUnit_C.2 hlc) q 1, one_mul] using isCoprime_one_right (x := q)) have hirr' := hq rw [← irreducible_mul_isUnit (isUnit_C.2 hlc)] at hirr' obtain ⟨x, hx⟩ := H (q * C (leadingCoeff q)⁻¹) (monic_mul_leadingCoeff_inv hq.ne_zero) hirr' hsep'
exact degree_mul_leadingCoeff_inv q hq.ne_zero β–Έ degree_eq_one_of_irreducible_of_root hirr' hx
theorem of_exists_root (H : βˆ€ p : k[X], p.Monic β†’ Irreducible p β†’ Separable p β†’ βˆƒ x, p.eval x = 0) : IsSepClosed k := by refine ⟨fun p hsep ↦ Or.inr ?_⟩ intro q hq hdvd simp only [map_id] at hdvd have hlc : IsUnit (leadingCoeff q)⁻¹ := IsUnit.inv <| Ne.isUnit <| leadingCoeff_ne_zero.2 <| Irreducible.ne_zero hq have hsep' : Separable (q * C (leadingCoeff q)⁻¹) := Separable.mul (Separable.of_dvd hsep hdvd) ((separable_C _).2 hlc) (by simpa only [← isCoprime_mul_unit_right_right (isUnit_C.2 hlc) q 1, one_mul] using isCoprime_one_right (x := q)) have hirr' := hq rw [← irreducible_mul_isUnit (isUnit_C.2 hlc)] at hirr' obtain ⟨x, hx⟩ := H (q * C (leadingCoeff q)⁻¹) (monic_mul_leadingCoeff_inv hq.ne_zero) hirr' hsep'
Mathlib.FieldTheory.IsSepClosed.136_0.3ZRqn1f8ZTqE2nc
theorem of_exists_root (H : βˆ€ p : k[X], p.Monic β†’ Irreducible p β†’ Separable p β†’ βˆƒ x, p.eval x = 0) : IsSepClosed k
Mathlib_FieldTheory_IsSepClosed
k : Type u inst✝⁴ : Field k K : Type v inst✝³ : Field K inst✝² : IsSepClosed k inst✝¹ : Algebra k K inst✝ : IsSeparable k K ⊒ Function.Surjective ⇑(algebraMap k K)
/- Copyright (c) 2023 Jz Pan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jz Pan -/ import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure /-! # Separably Closed Field In this file we define the typeclass for separably closed fields and separable closures, and prove some of their properties. ## Main Definitions - `IsSepClosed k` is the typeclass saying `k` is a separably closed field, i.e. every separable polynomial in `k` splits. - `IsSepClosure k K` is the typeclass saying `K` is a separable closure of `k`, where `k` is a field. This means that `K` is separably closed and separable over `k`. - `IsSepClosed.lift` is a map from a separable extension `L` of `K`, into any separably closed extension `M` of `K`. - `IsSepClosure.equiv` is a proof that any two separable closures of the same field are isomorphic. ## Tags separable closure, separably closed ## TODO - Maximal separable subextension of `K/k`, consisting of all elements of `K` which are separable over `k`. - If `K` is a separably closed field containing `k`, then the maximal separable subextension of `K/k` is a separable closure of `k`. - In particular, a separable closure exists. - If `k` is a perfect field, then its separable closure coincides with its algebraic closure. - An algebraic extension of a separably closed field is purely inseparable. -/ universe u v w open scoped Classical BigOperators Polynomial open Polynomial variable (k : Type u) [Field k] (K : Type v) [Field K] /-- Typeclass for separably closed fields. To show `Polynomial.Splits p f` for an arbitrary ring homomorphism `f`, see `IsSepClosed.splits_codomain` and `IsSepClosed.splits_domain`. -/ class IsSepClosed : Prop where splits_of_separable : βˆ€ p : k[X], p.Separable β†’ (p.Splits <| RingHom.id k) /-- An algebraically closed field is also separably closed. -/ instance IsSepClosed.of_isAlgClosed [IsAlgClosed k] : IsSepClosed k := ⟨fun p _ ↦ IsAlgClosed.splits p⟩ variable {k} {K} /-- Every separable polynomial splits in the field extension `f : k β†’+* K` if `K` is separably closed. See also `IsSepClosed.splits_domain` for the case where `k` is separably closed. -/ theorem IsSepClosed.splits_codomain [IsSepClosed K] {f : k β†’+* K} (p : k[X]) (h : p.Separable) : p.Splits f := by convert IsSepClosed.splits_of_separable (p.map f) (Separable.map h); simp [splits_map_iff] /-- Every separable polynomial splits in the field extension `f : k β†’+* K` if `k` is separably closed. See also `IsSepClosed.splits_codomain` for the case where `k` is separably closed. -/ theorem IsSepClosed.splits_domain [IsSepClosed k] {f : k β†’+* K} (p : k[X]) (h : p.Separable) : p.Splits f := Polynomial.splits_of_splits_id _ <| IsSepClosed.splits_of_separable _ h namespace IsSepClosed theorem exists_root [IsSepClosed k] (p : k[X]) (hp : p.degree β‰  0) (hsep : p.Separable) : βˆƒ x, IsRoot p x := exists_root_of_splits _ (IsSepClosed.splits_of_separable p hsep) hp theorem exists_pow_nat_eq [IsSepClosed k] (x : k) (n : β„•) [hn : NeZero (n : k)] : βˆƒ z, z ^ n = x := by have hn' : 0 < n := Nat.pos_of_ne_zero <| fun h => by rw [h, Nat.cast_zero] at hn exact hn.out rfl have : degree (X ^ n - C x) β‰  0 := by rw [degree_X_pow_sub_C hn' x] exact (WithBot.coe_lt_coe.2 hn').ne' by_cases hx : x = 0 Β· exact ⟨0, by rw [hx, pow_eq_zero_iff hn']⟩ Β· obtain ⟨z, hz⟩ := exists_root _ this <| separable_X_pow_sub_C x hn.out hx use z simpa [eval_C, eval_X, eval_pow, eval_sub, IsRoot.def, sub_eq_zero] using hz theorem exists_eq_mul_self [IsSepClosed k] (x : k) [h2 : NeZero (2 : k)] : βˆƒ z, x = z * z := by rcases exists_pow_nat_eq x 2 with ⟨z, rfl⟩ exact ⟨z, sq z⟩ theorem roots_eq_zero_iff [IsSepClosed k] {p : k[X]} (hsep : p.Separable) : p.roots = 0 ↔ p = Polynomial.C (p.coeff 0) := by refine' ⟨fun h => _, fun hp => by rw [hp, roots_C]⟩ rcases le_or_lt (degree p) 0 with hd | hd Β· exact eq_C_of_degree_le_zero hd Β· obtain ⟨z, hz⟩ := IsSepClosed.exists_root p hd.ne' hsep rw [← mem_roots (ne_zero_of_degree_gt hd), h] at hz simp at hz theorem exists_evalβ‚‚_eq_zero [IsSepClosed K] (f : k β†’+* K) (p : k[X]) (hp : p.degree β‰  0) (hsep : p.Separable) : βˆƒ x, p.evalβ‚‚ f x = 0 := let ⟨x, hx⟩ := exists_root (p.map f) (by rwa [degree_map_eq_of_injective f.injective]) (Separable.map hsep) ⟨x, by rwa [evalβ‚‚_eq_eval_map, ← IsRoot]⟩ variable (K) theorem exists_aeval_eq_zero [IsSepClosed K] [Algebra k K] (p : k[X]) (hp : p.degree β‰  0) (hsep : p.Separable) : βˆƒ x : K, aeval x p = 0 := exists_evalβ‚‚_eq_zero (algebraMap k K) p hp hsep variable (k) {K} theorem of_exists_root (H : βˆ€ p : k[X], p.Monic β†’ Irreducible p β†’ Separable p β†’ βˆƒ x, p.eval x = 0) : IsSepClosed k := by refine ⟨fun p hsep ↦ Or.inr ?_⟩ intro q hq hdvd simp only [map_id] at hdvd have hlc : IsUnit (leadingCoeff q)⁻¹ := IsUnit.inv <| Ne.isUnit <| leadingCoeff_ne_zero.2 <| Irreducible.ne_zero hq have hsep' : Separable (q * C (leadingCoeff q)⁻¹) := Separable.mul (Separable.of_dvd hsep hdvd) ((separable_C _).2 hlc) (by simpa only [← isCoprime_mul_unit_right_right (isUnit_C.2 hlc) q 1, one_mul] using isCoprime_one_right (x := q)) have hirr' := hq rw [← irreducible_mul_isUnit (isUnit_C.2 hlc)] at hirr' obtain ⟨x, hx⟩ := H (q * C (leadingCoeff q)⁻¹) (monic_mul_leadingCoeff_inv hq.ne_zero) hirr' hsep' exact degree_mul_leadingCoeff_inv q hq.ne_zero β–Έ degree_eq_one_of_irreducible_of_root hirr' hx theorem degree_eq_one_of_irreducible [IsSepClosed k] {p : k[X]} (hp : Irreducible p) (hsep : p.Separable) : p.degree = 1 := degree_eq_one_of_irreducible_of_splits hp (IsSepClosed.splits_codomain p hsep) variable {k} theorem algebraMap_surjective [IsSepClosed k] [Algebra k K] [IsSeparable k K] : Function.Surjective (algebraMap k K) := by
refine fun x => ⟨-(minpoly k x).coeff 0, ?_⟩
theorem algebraMap_surjective [IsSepClosed k] [Algebra k K] [IsSeparable k K] : Function.Surjective (algebraMap k K) := by
Mathlib.FieldTheory.IsSepClosed.158_0.3ZRqn1f8ZTqE2nc
theorem algebraMap_surjective [IsSepClosed k] [Algebra k K] [IsSeparable k K] : Function.Surjective (algebraMap k K)
Mathlib_FieldTheory_IsSepClosed
k : Type u inst✝⁴ : Field k K : Type v inst✝³ : Field K inst✝² : IsSepClosed k inst✝¹ : Algebra k K inst✝ : IsSeparable k K x : K ⊒ (algebraMap k K) (-coeff (minpoly k x) 0) = x
/- Copyright (c) 2023 Jz Pan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jz Pan -/ import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure /-! # Separably Closed Field In this file we define the typeclass for separably closed fields and separable closures, and prove some of their properties. ## Main Definitions - `IsSepClosed k` is the typeclass saying `k` is a separably closed field, i.e. every separable polynomial in `k` splits. - `IsSepClosure k K` is the typeclass saying `K` is a separable closure of `k`, where `k` is a field. This means that `K` is separably closed and separable over `k`. - `IsSepClosed.lift` is a map from a separable extension `L` of `K`, into any separably closed extension `M` of `K`. - `IsSepClosure.equiv` is a proof that any two separable closures of the same field are isomorphic. ## Tags separable closure, separably closed ## TODO - Maximal separable subextension of `K/k`, consisting of all elements of `K` which are separable over `k`. - If `K` is a separably closed field containing `k`, then the maximal separable subextension of `K/k` is a separable closure of `k`. - In particular, a separable closure exists. - If `k` is a perfect field, then its separable closure coincides with its algebraic closure. - An algebraic extension of a separably closed field is purely inseparable. -/ universe u v w open scoped Classical BigOperators Polynomial open Polynomial variable (k : Type u) [Field k] (K : Type v) [Field K] /-- Typeclass for separably closed fields. To show `Polynomial.Splits p f` for an arbitrary ring homomorphism `f`, see `IsSepClosed.splits_codomain` and `IsSepClosed.splits_domain`. -/ class IsSepClosed : Prop where splits_of_separable : βˆ€ p : k[X], p.Separable β†’ (p.Splits <| RingHom.id k) /-- An algebraically closed field is also separably closed. -/ instance IsSepClosed.of_isAlgClosed [IsAlgClosed k] : IsSepClosed k := ⟨fun p _ ↦ IsAlgClosed.splits p⟩ variable {k} {K} /-- Every separable polynomial splits in the field extension `f : k β†’+* K` if `K` is separably closed. See also `IsSepClosed.splits_domain` for the case where `k` is separably closed. -/ theorem IsSepClosed.splits_codomain [IsSepClosed K] {f : k β†’+* K} (p : k[X]) (h : p.Separable) : p.Splits f := by convert IsSepClosed.splits_of_separable (p.map f) (Separable.map h); simp [splits_map_iff] /-- Every separable polynomial splits in the field extension `f : k β†’+* K` if `k` is separably closed. See also `IsSepClosed.splits_codomain` for the case where `k` is separably closed. -/ theorem IsSepClosed.splits_domain [IsSepClosed k] {f : k β†’+* K} (p : k[X]) (h : p.Separable) : p.Splits f := Polynomial.splits_of_splits_id _ <| IsSepClosed.splits_of_separable _ h namespace IsSepClosed theorem exists_root [IsSepClosed k] (p : k[X]) (hp : p.degree β‰  0) (hsep : p.Separable) : βˆƒ x, IsRoot p x := exists_root_of_splits _ (IsSepClosed.splits_of_separable p hsep) hp theorem exists_pow_nat_eq [IsSepClosed k] (x : k) (n : β„•) [hn : NeZero (n : k)] : βˆƒ z, z ^ n = x := by have hn' : 0 < n := Nat.pos_of_ne_zero <| fun h => by rw [h, Nat.cast_zero] at hn exact hn.out rfl have : degree (X ^ n - C x) β‰  0 := by rw [degree_X_pow_sub_C hn' x] exact (WithBot.coe_lt_coe.2 hn').ne' by_cases hx : x = 0 Β· exact ⟨0, by rw [hx, pow_eq_zero_iff hn']⟩ Β· obtain ⟨z, hz⟩ := exists_root _ this <| separable_X_pow_sub_C x hn.out hx use z simpa [eval_C, eval_X, eval_pow, eval_sub, IsRoot.def, sub_eq_zero] using hz theorem exists_eq_mul_self [IsSepClosed k] (x : k) [h2 : NeZero (2 : k)] : βˆƒ z, x = z * z := by rcases exists_pow_nat_eq x 2 with ⟨z, rfl⟩ exact ⟨z, sq z⟩ theorem roots_eq_zero_iff [IsSepClosed k] {p : k[X]} (hsep : p.Separable) : p.roots = 0 ↔ p = Polynomial.C (p.coeff 0) := by refine' ⟨fun h => _, fun hp => by rw [hp, roots_C]⟩ rcases le_or_lt (degree p) 0 with hd | hd Β· exact eq_C_of_degree_le_zero hd Β· obtain ⟨z, hz⟩ := IsSepClosed.exists_root p hd.ne' hsep rw [← mem_roots (ne_zero_of_degree_gt hd), h] at hz simp at hz theorem exists_evalβ‚‚_eq_zero [IsSepClosed K] (f : k β†’+* K) (p : k[X]) (hp : p.degree β‰  0) (hsep : p.Separable) : βˆƒ x, p.evalβ‚‚ f x = 0 := let ⟨x, hx⟩ := exists_root (p.map f) (by rwa [degree_map_eq_of_injective f.injective]) (Separable.map hsep) ⟨x, by rwa [evalβ‚‚_eq_eval_map, ← IsRoot]⟩ variable (K) theorem exists_aeval_eq_zero [IsSepClosed K] [Algebra k K] (p : k[X]) (hp : p.degree β‰  0) (hsep : p.Separable) : βˆƒ x : K, aeval x p = 0 := exists_evalβ‚‚_eq_zero (algebraMap k K) p hp hsep variable (k) {K} theorem of_exists_root (H : βˆ€ p : k[X], p.Monic β†’ Irreducible p β†’ Separable p β†’ βˆƒ x, p.eval x = 0) : IsSepClosed k := by refine ⟨fun p hsep ↦ Or.inr ?_⟩ intro q hq hdvd simp only [map_id] at hdvd have hlc : IsUnit (leadingCoeff q)⁻¹ := IsUnit.inv <| Ne.isUnit <| leadingCoeff_ne_zero.2 <| Irreducible.ne_zero hq have hsep' : Separable (q * C (leadingCoeff q)⁻¹) := Separable.mul (Separable.of_dvd hsep hdvd) ((separable_C _).2 hlc) (by simpa only [← isCoprime_mul_unit_right_right (isUnit_C.2 hlc) q 1, one_mul] using isCoprime_one_right (x := q)) have hirr' := hq rw [← irreducible_mul_isUnit (isUnit_C.2 hlc)] at hirr' obtain ⟨x, hx⟩ := H (q * C (leadingCoeff q)⁻¹) (monic_mul_leadingCoeff_inv hq.ne_zero) hirr' hsep' exact degree_mul_leadingCoeff_inv q hq.ne_zero β–Έ degree_eq_one_of_irreducible_of_root hirr' hx theorem degree_eq_one_of_irreducible [IsSepClosed k] {p : k[X]} (hp : Irreducible p) (hsep : p.Separable) : p.degree = 1 := degree_eq_one_of_irreducible_of_splits hp (IsSepClosed.splits_codomain p hsep) variable {k} theorem algebraMap_surjective [IsSepClosed k] [Algebra k K] [IsSeparable k K] : Function.Surjective (algebraMap k K) := by refine fun x => ⟨-(minpoly k x).coeff 0, ?_⟩
have hq : (minpoly k x).leadingCoeff = 1 := minpoly.monic (IsSeparable.isIntegral k x)
theorem algebraMap_surjective [IsSepClosed k] [Algebra k K] [IsSeparable k K] : Function.Surjective (algebraMap k K) := by refine fun x => ⟨-(minpoly k x).coeff 0, ?_⟩
Mathlib.FieldTheory.IsSepClosed.158_0.3ZRqn1f8ZTqE2nc
theorem algebraMap_surjective [IsSepClosed k] [Algebra k K] [IsSeparable k K] : Function.Surjective (algebraMap k K)
Mathlib_FieldTheory_IsSepClosed
k : Type u inst✝⁴ : Field k K : Type v inst✝³ : Field K inst✝² : IsSepClosed k inst✝¹ : Algebra k K inst✝ : IsSeparable k K x : K hq : leadingCoeff (minpoly k x) = 1 ⊒ (algebraMap k K) (-coeff (minpoly k x) 0) = x
/- Copyright (c) 2023 Jz Pan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jz Pan -/ import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure /-! # Separably Closed Field In this file we define the typeclass for separably closed fields and separable closures, and prove some of their properties. ## Main Definitions - `IsSepClosed k` is the typeclass saying `k` is a separably closed field, i.e. every separable polynomial in `k` splits. - `IsSepClosure k K` is the typeclass saying `K` is a separable closure of `k`, where `k` is a field. This means that `K` is separably closed and separable over `k`. - `IsSepClosed.lift` is a map from a separable extension `L` of `K`, into any separably closed extension `M` of `K`. - `IsSepClosure.equiv` is a proof that any two separable closures of the same field are isomorphic. ## Tags separable closure, separably closed ## TODO - Maximal separable subextension of `K/k`, consisting of all elements of `K` which are separable over `k`. - If `K` is a separably closed field containing `k`, then the maximal separable subextension of `K/k` is a separable closure of `k`. - In particular, a separable closure exists. - If `k` is a perfect field, then its separable closure coincides with its algebraic closure. - An algebraic extension of a separably closed field is purely inseparable. -/ universe u v w open scoped Classical BigOperators Polynomial open Polynomial variable (k : Type u) [Field k] (K : Type v) [Field K] /-- Typeclass for separably closed fields. To show `Polynomial.Splits p f` for an arbitrary ring homomorphism `f`, see `IsSepClosed.splits_codomain` and `IsSepClosed.splits_domain`. -/ class IsSepClosed : Prop where splits_of_separable : βˆ€ p : k[X], p.Separable β†’ (p.Splits <| RingHom.id k) /-- An algebraically closed field is also separably closed. -/ instance IsSepClosed.of_isAlgClosed [IsAlgClosed k] : IsSepClosed k := ⟨fun p _ ↦ IsAlgClosed.splits p⟩ variable {k} {K} /-- Every separable polynomial splits in the field extension `f : k β†’+* K` if `K` is separably closed. See also `IsSepClosed.splits_domain` for the case where `k` is separably closed. -/ theorem IsSepClosed.splits_codomain [IsSepClosed K] {f : k β†’+* K} (p : k[X]) (h : p.Separable) : p.Splits f := by convert IsSepClosed.splits_of_separable (p.map f) (Separable.map h); simp [splits_map_iff] /-- Every separable polynomial splits in the field extension `f : k β†’+* K` if `k` is separably closed. See also `IsSepClosed.splits_codomain` for the case where `k` is separably closed. -/ theorem IsSepClosed.splits_domain [IsSepClosed k] {f : k β†’+* K} (p : k[X]) (h : p.Separable) : p.Splits f := Polynomial.splits_of_splits_id _ <| IsSepClosed.splits_of_separable _ h namespace IsSepClosed theorem exists_root [IsSepClosed k] (p : k[X]) (hp : p.degree β‰  0) (hsep : p.Separable) : βˆƒ x, IsRoot p x := exists_root_of_splits _ (IsSepClosed.splits_of_separable p hsep) hp theorem exists_pow_nat_eq [IsSepClosed k] (x : k) (n : β„•) [hn : NeZero (n : k)] : βˆƒ z, z ^ n = x := by have hn' : 0 < n := Nat.pos_of_ne_zero <| fun h => by rw [h, Nat.cast_zero] at hn exact hn.out rfl have : degree (X ^ n - C x) β‰  0 := by rw [degree_X_pow_sub_C hn' x] exact (WithBot.coe_lt_coe.2 hn').ne' by_cases hx : x = 0 Β· exact ⟨0, by rw [hx, pow_eq_zero_iff hn']⟩ Β· obtain ⟨z, hz⟩ := exists_root _ this <| separable_X_pow_sub_C x hn.out hx use z simpa [eval_C, eval_X, eval_pow, eval_sub, IsRoot.def, sub_eq_zero] using hz theorem exists_eq_mul_self [IsSepClosed k] (x : k) [h2 : NeZero (2 : k)] : βˆƒ z, x = z * z := by rcases exists_pow_nat_eq x 2 with ⟨z, rfl⟩ exact ⟨z, sq z⟩ theorem roots_eq_zero_iff [IsSepClosed k] {p : k[X]} (hsep : p.Separable) : p.roots = 0 ↔ p = Polynomial.C (p.coeff 0) := by refine' ⟨fun h => _, fun hp => by rw [hp, roots_C]⟩ rcases le_or_lt (degree p) 0 with hd | hd Β· exact eq_C_of_degree_le_zero hd Β· obtain ⟨z, hz⟩ := IsSepClosed.exists_root p hd.ne' hsep rw [← mem_roots (ne_zero_of_degree_gt hd), h] at hz simp at hz theorem exists_evalβ‚‚_eq_zero [IsSepClosed K] (f : k β†’+* K) (p : k[X]) (hp : p.degree β‰  0) (hsep : p.Separable) : βˆƒ x, p.evalβ‚‚ f x = 0 := let ⟨x, hx⟩ := exists_root (p.map f) (by rwa [degree_map_eq_of_injective f.injective]) (Separable.map hsep) ⟨x, by rwa [evalβ‚‚_eq_eval_map, ← IsRoot]⟩ variable (K) theorem exists_aeval_eq_zero [IsSepClosed K] [Algebra k K] (p : k[X]) (hp : p.degree β‰  0) (hsep : p.Separable) : βˆƒ x : K, aeval x p = 0 := exists_evalβ‚‚_eq_zero (algebraMap k K) p hp hsep variable (k) {K} theorem of_exists_root (H : βˆ€ p : k[X], p.Monic β†’ Irreducible p β†’ Separable p β†’ βˆƒ x, p.eval x = 0) : IsSepClosed k := by refine ⟨fun p hsep ↦ Or.inr ?_⟩ intro q hq hdvd simp only [map_id] at hdvd have hlc : IsUnit (leadingCoeff q)⁻¹ := IsUnit.inv <| Ne.isUnit <| leadingCoeff_ne_zero.2 <| Irreducible.ne_zero hq have hsep' : Separable (q * C (leadingCoeff q)⁻¹) := Separable.mul (Separable.of_dvd hsep hdvd) ((separable_C _).2 hlc) (by simpa only [← isCoprime_mul_unit_right_right (isUnit_C.2 hlc) q 1, one_mul] using isCoprime_one_right (x := q)) have hirr' := hq rw [← irreducible_mul_isUnit (isUnit_C.2 hlc)] at hirr' obtain ⟨x, hx⟩ := H (q * C (leadingCoeff q)⁻¹) (monic_mul_leadingCoeff_inv hq.ne_zero) hirr' hsep' exact degree_mul_leadingCoeff_inv q hq.ne_zero β–Έ degree_eq_one_of_irreducible_of_root hirr' hx theorem degree_eq_one_of_irreducible [IsSepClosed k] {p : k[X]} (hp : Irreducible p) (hsep : p.Separable) : p.degree = 1 := degree_eq_one_of_irreducible_of_splits hp (IsSepClosed.splits_codomain p hsep) variable {k} theorem algebraMap_surjective [IsSepClosed k] [Algebra k K] [IsSeparable k K] : Function.Surjective (algebraMap k K) := by refine fun x => ⟨-(minpoly k x).coeff 0, ?_⟩ have hq : (minpoly k x).leadingCoeff = 1 := minpoly.monic (IsSeparable.isIntegral k x)
have hsep : (minpoly k x).Separable := IsSeparable.separable k x
theorem algebraMap_surjective [IsSepClosed k] [Algebra k K] [IsSeparable k K] : Function.Surjective (algebraMap k K) := by refine fun x => ⟨-(minpoly k x).coeff 0, ?_⟩ have hq : (minpoly k x).leadingCoeff = 1 := minpoly.monic (IsSeparable.isIntegral k x)
Mathlib.FieldTheory.IsSepClosed.158_0.3ZRqn1f8ZTqE2nc
theorem algebraMap_surjective [IsSepClosed k] [Algebra k K] [IsSeparable k K] : Function.Surjective (algebraMap k K)
Mathlib_FieldTheory_IsSepClosed
k : Type u inst✝⁴ : Field k K : Type v inst✝³ : Field K inst✝² : IsSepClosed k inst✝¹ : Algebra k K inst✝ : IsSeparable k K x : K hq : leadingCoeff (minpoly k x) = 1 hsep : Separable (minpoly k x) ⊒ (algebraMap k K) (-coeff (minpoly k x) 0) = x
/- Copyright (c) 2023 Jz Pan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jz Pan -/ import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure /-! # Separably Closed Field In this file we define the typeclass for separably closed fields and separable closures, and prove some of their properties. ## Main Definitions - `IsSepClosed k` is the typeclass saying `k` is a separably closed field, i.e. every separable polynomial in `k` splits. - `IsSepClosure k K` is the typeclass saying `K` is a separable closure of `k`, where `k` is a field. This means that `K` is separably closed and separable over `k`. - `IsSepClosed.lift` is a map from a separable extension `L` of `K`, into any separably closed extension `M` of `K`. - `IsSepClosure.equiv` is a proof that any two separable closures of the same field are isomorphic. ## Tags separable closure, separably closed ## TODO - Maximal separable subextension of `K/k`, consisting of all elements of `K` which are separable over `k`. - If `K` is a separably closed field containing `k`, then the maximal separable subextension of `K/k` is a separable closure of `k`. - In particular, a separable closure exists. - If `k` is a perfect field, then its separable closure coincides with its algebraic closure. - An algebraic extension of a separably closed field is purely inseparable. -/ universe u v w open scoped Classical BigOperators Polynomial open Polynomial variable (k : Type u) [Field k] (K : Type v) [Field K] /-- Typeclass for separably closed fields. To show `Polynomial.Splits p f` for an arbitrary ring homomorphism `f`, see `IsSepClosed.splits_codomain` and `IsSepClosed.splits_domain`. -/ class IsSepClosed : Prop where splits_of_separable : βˆ€ p : k[X], p.Separable β†’ (p.Splits <| RingHom.id k) /-- An algebraically closed field is also separably closed. -/ instance IsSepClosed.of_isAlgClosed [IsAlgClosed k] : IsSepClosed k := ⟨fun p _ ↦ IsAlgClosed.splits p⟩ variable {k} {K} /-- Every separable polynomial splits in the field extension `f : k β†’+* K` if `K` is separably closed. See also `IsSepClosed.splits_domain` for the case where `k` is separably closed. -/ theorem IsSepClosed.splits_codomain [IsSepClosed K] {f : k β†’+* K} (p : k[X]) (h : p.Separable) : p.Splits f := by convert IsSepClosed.splits_of_separable (p.map f) (Separable.map h); simp [splits_map_iff] /-- Every separable polynomial splits in the field extension `f : k β†’+* K` if `k` is separably closed. See also `IsSepClosed.splits_codomain` for the case where `k` is separably closed. -/ theorem IsSepClosed.splits_domain [IsSepClosed k] {f : k β†’+* K} (p : k[X]) (h : p.Separable) : p.Splits f := Polynomial.splits_of_splits_id _ <| IsSepClosed.splits_of_separable _ h namespace IsSepClosed theorem exists_root [IsSepClosed k] (p : k[X]) (hp : p.degree β‰  0) (hsep : p.Separable) : βˆƒ x, IsRoot p x := exists_root_of_splits _ (IsSepClosed.splits_of_separable p hsep) hp theorem exists_pow_nat_eq [IsSepClosed k] (x : k) (n : β„•) [hn : NeZero (n : k)] : βˆƒ z, z ^ n = x := by have hn' : 0 < n := Nat.pos_of_ne_zero <| fun h => by rw [h, Nat.cast_zero] at hn exact hn.out rfl have : degree (X ^ n - C x) β‰  0 := by rw [degree_X_pow_sub_C hn' x] exact (WithBot.coe_lt_coe.2 hn').ne' by_cases hx : x = 0 Β· exact ⟨0, by rw [hx, pow_eq_zero_iff hn']⟩ Β· obtain ⟨z, hz⟩ := exists_root _ this <| separable_X_pow_sub_C x hn.out hx use z simpa [eval_C, eval_X, eval_pow, eval_sub, IsRoot.def, sub_eq_zero] using hz theorem exists_eq_mul_self [IsSepClosed k] (x : k) [h2 : NeZero (2 : k)] : βˆƒ z, x = z * z := by rcases exists_pow_nat_eq x 2 with ⟨z, rfl⟩ exact ⟨z, sq z⟩ theorem roots_eq_zero_iff [IsSepClosed k] {p : k[X]} (hsep : p.Separable) : p.roots = 0 ↔ p = Polynomial.C (p.coeff 0) := by refine' ⟨fun h => _, fun hp => by rw [hp, roots_C]⟩ rcases le_or_lt (degree p) 0 with hd | hd Β· exact eq_C_of_degree_le_zero hd Β· obtain ⟨z, hz⟩ := IsSepClosed.exists_root p hd.ne' hsep rw [← mem_roots (ne_zero_of_degree_gt hd), h] at hz simp at hz theorem exists_evalβ‚‚_eq_zero [IsSepClosed K] (f : k β†’+* K) (p : k[X]) (hp : p.degree β‰  0) (hsep : p.Separable) : βˆƒ x, p.evalβ‚‚ f x = 0 := let ⟨x, hx⟩ := exists_root (p.map f) (by rwa [degree_map_eq_of_injective f.injective]) (Separable.map hsep) ⟨x, by rwa [evalβ‚‚_eq_eval_map, ← IsRoot]⟩ variable (K) theorem exists_aeval_eq_zero [IsSepClosed K] [Algebra k K] (p : k[X]) (hp : p.degree β‰  0) (hsep : p.Separable) : βˆƒ x : K, aeval x p = 0 := exists_evalβ‚‚_eq_zero (algebraMap k K) p hp hsep variable (k) {K} theorem of_exists_root (H : βˆ€ p : k[X], p.Monic β†’ Irreducible p β†’ Separable p β†’ βˆƒ x, p.eval x = 0) : IsSepClosed k := by refine ⟨fun p hsep ↦ Or.inr ?_⟩ intro q hq hdvd simp only [map_id] at hdvd have hlc : IsUnit (leadingCoeff q)⁻¹ := IsUnit.inv <| Ne.isUnit <| leadingCoeff_ne_zero.2 <| Irreducible.ne_zero hq have hsep' : Separable (q * C (leadingCoeff q)⁻¹) := Separable.mul (Separable.of_dvd hsep hdvd) ((separable_C _).2 hlc) (by simpa only [← isCoprime_mul_unit_right_right (isUnit_C.2 hlc) q 1, one_mul] using isCoprime_one_right (x := q)) have hirr' := hq rw [← irreducible_mul_isUnit (isUnit_C.2 hlc)] at hirr' obtain ⟨x, hx⟩ := H (q * C (leadingCoeff q)⁻¹) (monic_mul_leadingCoeff_inv hq.ne_zero) hirr' hsep' exact degree_mul_leadingCoeff_inv q hq.ne_zero β–Έ degree_eq_one_of_irreducible_of_root hirr' hx theorem degree_eq_one_of_irreducible [IsSepClosed k] {p : k[X]} (hp : Irreducible p) (hsep : p.Separable) : p.degree = 1 := degree_eq_one_of_irreducible_of_splits hp (IsSepClosed.splits_codomain p hsep) variable {k} theorem algebraMap_surjective [IsSepClosed k] [Algebra k K] [IsSeparable k K] : Function.Surjective (algebraMap k K) := by refine fun x => ⟨-(minpoly k x).coeff 0, ?_⟩ have hq : (minpoly k x).leadingCoeff = 1 := minpoly.monic (IsSeparable.isIntegral k x) have hsep : (minpoly k x).Separable := IsSeparable.separable k x
have h : (minpoly k x).degree = 1 := degree_eq_one_of_irreducible k (minpoly.irreducible (IsSeparable.isIntegral k x)) hsep
theorem algebraMap_surjective [IsSepClosed k] [Algebra k K] [IsSeparable k K] : Function.Surjective (algebraMap k K) := by refine fun x => ⟨-(minpoly k x).coeff 0, ?_⟩ have hq : (minpoly k x).leadingCoeff = 1 := minpoly.monic (IsSeparable.isIntegral k x) have hsep : (minpoly k x).Separable := IsSeparable.separable k x
Mathlib.FieldTheory.IsSepClosed.158_0.3ZRqn1f8ZTqE2nc
theorem algebraMap_surjective [IsSepClosed k] [Algebra k K] [IsSeparable k K] : Function.Surjective (algebraMap k K)
Mathlib_FieldTheory_IsSepClosed
k : Type u inst✝⁴ : Field k K : Type v inst✝³ : Field K inst✝² : IsSepClosed k inst✝¹ : Algebra k K inst✝ : IsSeparable k K x : K hq : leadingCoeff (minpoly k x) = 1 hsep : Separable (minpoly k x) h : degree (minpoly k x) = 1 ⊒ (algebraMap k K) (-coeff (minpoly k x) 0) = x
/- Copyright (c) 2023 Jz Pan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jz Pan -/ import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure /-! # Separably Closed Field In this file we define the typeclass for separably closed fields and separable closures, and prove some of their properties. ## Main Definitions - `IsSepClosed k` is the typeclass saying `k` is a separably closed field, i.e. every separable polynomial in `k` splits. - `IsSepClosure k K` is the typeclass saying `K` is a separable closure of `k`, where `k` is a field. This means that `K` is separably closed and separable over `k`. - `IsSepClosed.lift` is a map from a separable extension `L` of `K`, into any separably closed extension `M` of `K`. - `IsSepClosure.equiv` is a proof that any two separable closures of the same field are isomorphic. ## Tags separable closure, separably closed ## TODO - Maximal separable subextension of `K/k`, consisting of all elements of `K` which are separable over `k`. - If `K` is a separably closed field containing `k`, then the maximal separable subextension of `K/k` is a separable closure of `k`. - In particular, a separable closure exists. - If `k` is a perfect field, then its separable closure coincides with its algebraic closure. - An algebraic extension of a separably closed field is purely inseparable. -/ universe u v w open scoped Classical BigOperators Polynomial open Polynomial variable (k : Type u) [Field k] (K : Type v) [Field K] /-- Typeclass for separably closed fields. To show `Polynomial.Splits p f` for an arbitrary ring homomorphism `f`, see `IsSepClosed.splits_codomain` and `IsSepClosed.splits_domain`. -/ class IsSepClosed : Prop where splits_of_separable : βˆ€ p : k[X], p.Separable β†’ (p.Splits <| RingHom.id k) /-- An algebraically closed field is also separably closed. -/ instance IsSepClosed.of_isAlgClosed [IsAlgClosed k] : IsSepClosed k := ⟨fun p _ ↦ IsAlgClosed.splits p⟩ variable {k} {K} /-- Every separable polynomial splits in the field extension `f : k β†’+* K` if `K` is separably closed. See also `IsSepClosed.splits_domain` for the case where `k` is separably closed. -/ theorem IsSepClosed.splits_codomain [IsSepClosed K] {f : k β†’+* K} (p : k[X]) (h : p.Separable) : p.Splits f := by convert IsSepClosed.splits_of_separable (p.map f) (Separable.map h); simp [splits_map_iff] /-- Every separable polynomial splits in the field extension `f : k β†’+* K` if `k` is separably closed. See also `IsSepClosed.splits_codomain` for the case where `k` is separably closed. -/ theorem IsSepClosed.splits_domain [IsSepClosed k] {f : k β†’+* K} (p : k[X]) (h : p.Separable) : p.Splits f := Polynomial.splits_of_splits_id _ <| IsSepClosed.splits_of_separable _ h namespace IsSepClosed theorem exists_root [IsSepClosed k] (p : k[X]) (hp : p.degree β‰  0) (hsep : p.Separable) : βˆƒ x, IsRoot p x := exists_root_of_splits _ (IsSepClosed.splits_of_separable p hsep) hp theorem exists_pow_nat_eq [IsSepClosed k] (x : k) (n : β„•) [hn : NeZero (n : k)] : βˆƒ z, z ^ n = x := by have hn' : 0 < n := Nat.pos_of_ne_zero <| fun h => by rw [h, Nat.cast_zero] at hn exact hn.out rfl have : degree (X ^ n - C x) β‰  0 := by rw [degree_X_pow_sub_C hn' x] exact (WithBot.coe_lt_coe.2 hn').ne' by_cases hx : x = 0 Β· exact ⟨0, by rw [hx, pow_eq_zero_iff hn']⟩ Β· obtain ⟨z, hz⟩ := exists_root _ this <| separable_X_pow_sub_C x hn.out hx use z simpa [eval_C, eval_X, eval_pow, eval_sub, IsRoot.def, sub_eq_zero] using hz theorem exists_eq_mul_self [IsSepClosed k] (x : k) [h2 : NeZero (2 : k)] : βˆƒ z, x = z * z := by rcases exists_pow_nat_eq x 2 with ⟨z, rfl⟩ exact ⟨z, sq z⟩ theorem roots_eq_zero_iff [IsSepClosed k] {p : k[X]} (hsep : p.Separable) : p.roots = 0 ↔ p = Polynomial.C (p.coeff 0) := by refine' ⟨fun h => _, fun hp => by rw [hp, roots_C]⟩ rcases le_or_lt (degree p) 0 with hd | hd Β· exact eq_C_of_degree_le_zero hd Β· obtain ⟨z, hz⟩ := IsSepClosed.exists_root p hd.ne' hsep rw [← mem_roots (ne_zero_of_degree_gt hd), h] at hz simp at hz theorem exists_evalβ‚‚_eq_zero [IsSepClosed K] (f : k β†’+* K) (p : k[X]) (hp : p.degree β‰  0) (hsep : p.Separable) : βˆƒ x, p.evalβ‚‚ f x = 0 := let ⟨x, hx⟩ := exists_root (p.map f) (by rwa [degree_map_eq_of_injective f.injective]) (Separable.map hsep) ⟨x, by rwa [evalβ‚‚_eq_eval_map, ← IsRoot]⟩ variable (K) theorem exists_aeval_eq_zero [IsSepClosed K] [Algebra k K] (p : k[X]) (hp : p.degree β‰  0) (hsep : p.Separable) : βˆƒ x : K, aeval x p = 0 := exists_evalβ‚‚_eq_zero (algebraMap k K) p hp hsep variable (k) {K} theorem of_exists_root (H : βˆ€ p : k[X], p.Monic β†’ Irreducible p β†’ Separable p β†’ βˆƒ x, p.eval x = 0) : IsSepClosed k := by refine ⟨fun p hsep ↦ Or.inr ?_⟩ intro q hq hdvd simp only [map_id] at hdvd have hlc : IsUnit (leadingCoeff q)⁻¹ := IsUnit.inv <| Ne.isUnit <| leadingCoeff_ne_zero.2 <| Irreducible.ne_zero hq have hsep' : Separable (q * C (leadingCoeff q)⁻¹) := Separable.mul (Separable.of_dvd hsep hdvd) ((separable_C _).2 hlc) (by simpa only [← isCoprime_mul_unit_right_right (isUnit_C.2 hlc) q 1, one_mul] using isCoprime_one_right (x := q)) have hirr' := hq rw [← irreducible_mul_isUnit (isUnit_C.2 hlc)] at hirr' obtain ⟨x, hx⟩ := H (q * C (leadingCoeff q)⁻¹) (monic_mul_leadingCoeff_inv hq.ne_zero) hirr' hsep' exact degree_mul_leadingCoeff_inv q hq.ne_zero β–Έ degree_eq_one_of_irreducible_of_root hirr' hx theorem degree_eq_one_of_irreducible [IsSepClosed k] {p : k[X]} (hp : Irreducible p) (hsep : p.Separable) : p.degree = 1 := degree_eq_one_of_irreducible_of_splits hp (IsSepClosed.splits_codomain p hsep) variable {k} theorem algebraMap_surjective [IsSepClosed k] [Algebra k K] [IsSeparable k K] : Function.Surjective (algebraMap k K) := by refine fun x => ⟨-(minpoly k x).coeff 0, ?_⟩ have hq : (minpoly k x).leadingCoeff = 1 := minpoly.monic (IsSeparable.isIntegral k x) have hsep : (minpoly k x).Separable := IsSeparable.separable k x have h : (minpoly k x).degree = 1 := degree_eq_one_of_irreducible k (minpoly.irreducible (IsSeparable.isIntegral k x)) hsep
have : aeval x (minpoly k x) = 0 := minpoly.aeval k x
theorem algebraMap_surjective [IsSepClosed k] [Algebra k K] [IsSeparable k K] : Function.Surjective (algebraMap k K) := by refine fun x => ⟨-(minpoly k x).coeff 0, ?_⟩ have hq : (minpoly k x).leadingCoeff = 1 := minpoly.monic (IsSeparable.isIntegral k x) have hsep : (minpoly k x).Separable := IsSeparable.separable k x have h : (minpoly k x).degree = 1 := degree_eq_one_of_irreducible k (minpoly.irreducible (IsSeparable.isIntegral k x)) hsep
Mathlib.FieldTheory.IsSepClosed.158_0.3ZRqn1f8ZTqE2nc
theorem algebraMap_surjective [IsSepClosed k] [Algebra k K] [IsSeparable k K] : Function.Surjective (algebraMap k K)
Mathlib_FieldTheory_IsSepClosed
k : Type u inst✝⁴ : Field k K : Type v inst✝³ : Field K inst✝² : IsSepClosed k inst✝¹ : Algebra k K inst✝ : IsSeparable k K x : K hq : leadingCoeff (minpoly k x) = 1 hsep : Separable (minpoly k x) h : degree (minpoly k x) = 1 this : (aeval x) (minpoly k x) = 0 ⊒ (algebraMap k K) (-coeff (minpoly k x) 0) = x
/- Copyright (c) 2023 Jz Pan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jz Pan -/ import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure /-! # Separably Closed Field In this file we define the typeclass for separably closed fields and separable closures, and prove some of their properties. ## Main Definitions - `IsSepClosed k` is the typeclass saying `k` is a separably closed field, i.e. every separable polynomial in `k` splits. - `IsSepClosure k K` is the typeclass saying `K` is a separable closure of `k`, where `k` is a field. This means that `K` is separably closed and separable over `k`. - `IsSepClosed.lift` is a map from a separable extension `L` of `K`, into any separably closed extension `M` of `K`. - `IsSepClosure.equiv` is a proof that any two separable closures of the same field are isomorphic. ## Tags separable closure, separably closed ## TODO - Maximal separable subextension of `K/k`, consisting of all elements of `K` which are separable over `k`. - If `K` is a separably closed field containing `k`, then the maximal separable subextension of `K/k` is a separable closure of `k`. - In particular, a separable closure exists. - If `k` is a perfect field, then its separable closure coincides with its algebraic closure. - An algebraic extension of a separably closed field is purely inseparable. -/ universe u v w open scoped Classical BigOperators Polynomial open Polynomial variable (k : Type u) [Field k] (K : Type v) [Field K] /-- Typeclass for separably closed fields. To show `Polynomial.Splits p f` for an arbitrary ring homomorphism `f`, see `IsSepClosed.splits_codomain` and `IsSepClosed.splits_domain`. -/ class IsSepClosed : Prop where splits_of_separable : βˆ€ p : k[X], p.Separable β†’ (p.Splits <| RingHom.id k) /-- An algebraically closed field is also separably closed. -/ instance IsSepClosed.of_isAlgClosed [IsAlgClosed k] : IsSepClosed k := ⟨fun p _ ↦ IsAlgClosed.splits p⟩ variable {k} {K} /-- Every separable polynomial splits in the field extension `f : k β†’+* K` if `K` is separably closed. See also `IsSepClosed.splits_domain` for the case where `k` is separably closed. -/ theorem IsSepClosed.splits_codomain [IsSepClosed K] {f : k β†’+* K} (p : k[X]) (h : p.Separable) : p.Splits f := by convert IsSepClosed.splits_of_separable (p.map f) (Separable.map h); simp [splits_map_iff] /-- Every separable polynomial splits in the field extension `f : k β†’+* K` if `k` is separably closed. See also `IsSepClosed.splits_codomain` for the case where `k` is separably closed. -/ theorem IsSepClosed.splits_domain [IsSepClosed k] {f : k β†’+* K} (p : k[X]) (h : p.Separable) : p.Splits f := Polynomial.splits_of_splits_id _ <| IsSepClosed.splits_of_separable _ h namespace IsSepClosed theorem exists_root [IsSepClosed k] (p : k[X]) (hp : p.degree β‰  0) (hsep : p.Separable) : βˆƒ x, IsRoot p x := exists_root_of_splits _ (IsSepClosed.splits_of_separable p hsep) hp theorem exists_pow_nat_eq [IsSepClosed k] (x : k) (n : β„•) [hn : NeZero (n : k)] : βˆƒ z, z ^ n = x := by have hn' : 0 < n := Nat.pos_of_ne_zero <| fun h => by rw [h, Nat.cast_zero] at hn exact hn.out rfl have : degree (X ^ n - C x) β‰  0 := by rw [degree_X_pow_sub_C hn' x] exact (WithBot.coe_lt_coe.2 hn').ne' by_cases hx : x = 0 Β· exact ⟨0, by rw [hx, pow_eq_zero_iff hn']⟩ Β· obtain ⟨z, hz⟩ := exists_root _ this <| separable_X_pow_sub_C x hn.out hx use z simpa [eval_C, eval_X, eval_pow, eval_sub, IsRoot.def, sub_eq_zero] using hz theorem exists_eq_mul_self [IsSepClosed k] (x : k) [h2 : NeZero (2 : k)] : βˆƒ z, x = z * z := by rcases exists_pow_nat_eq x 2 with ⟨z, rfl⟩ exact ⟨z, sq z⟩ theorem roots_eq_zero_iff [IsSepClosed k] {p : k[X]} (hsep : p.Separable) : p.roots = 0 ↔ p = Polynomial.C (p.coeff 0) := by refine' ⟨fun h => _, fun hp => by rw [hp, roots_C]⟩ rcases le_or_lt (degree p) 0 with hd | hd Β· exact eq_C_of_degree_le_zero hd Β· obtain ⟨z, hz⟩ := IsSepClosed.exists_root p hd.ne' hsep rw [← mem_roots (ne_zero_of_degree_gt hd), h] at hz simp at hz theorem exists_evalβ‚‚_eq_zero [IsSepClosed K] (f : k β†’+* K) (p : k[X]) (hp : p.degree β‰  0) (hsep : p.Separable) : βˆƒ x, p.evalβ‚‚ f x = 0 := let ⟨x, hx⟩ := exists_root (p.map f) (by rwa [degree_map_eq_of_injective f.injective]) (Separable.map hsep) ⟨x, by rwa [evalβ‚‚_eq_eval_map, ← IsRoot]⟩ variable (K) theorem exists_aeval_eq_zero [IsSepClosed K] [Algebra k K] (p : k[X]) (hp : p.degree β‰  0) (hsep : p.Separable) : βˆƒ x : K, aeval x p = 0 := exists_evalβ‚‚_eq_zero (algebraMap k K) p hp hsep variable (k) {K} theorem of_exists_root (H : βˆ€ p : k[X], p.Monic β†’ Irreducible p β†’ Separable p β†’ βˆƒ x, p.eval x = 0) : IsSepClosed k := by refine ⟨fun p hsep ↦ Or.inr ?_⟩ intro q hq hdvd simp only [map_id] at hdvd have hlc : IsUnit (leadingCoeff q)⁻¹ := IsUnit.inv <| Ne.isUnit <| leadingCoeff_ne_zero.2 <| Irreducible.ne_zero hq have hsep' : Separable (q * C (leadingCoeff q)⁻¹) := Separable.mul (Separable.of_dvd hsep hdvd) ((separable_C _).2 hlc) (by simpa only [← isCoprime_mul_unit_right_right (isUnit_C.2 hlc) q 1, one_mul] using isCoprime_one_right (x := q)) have hirr' := hq rw [← irreducible_mul_isUnit (isUnit_C.2 hlc)] at hirr' obtain ⟨x, hx⟩ := H (q * C (leadingCoeff q)⁻¹) (monic_mul_leadingCoeff_inv hq.ne_zero) hirr' hsep' exact degree_mul_leadingCoeff_inv q hq.ne_zero β–Έ degree_eq_one_of_irreducible_of_root hirr' hx theorem degree_eq_one_of_irreducible [IsSepClosed k] {p : k[X]} (hp : Irreducible p) (hsep : p.Separable) : p.degree = 1 := degree_eq_one_of_irreducible_of_splits hp (IsSepClosed.splits_codomain p hsep) variable {k} theorem algebraMap_surjective [IsSepClosed k] [Algebra k K] [IsSeparable k K] : Function.Surjective (algebraMap k K) := by refine fun x => ⟨-(minpoly k x).coeff 0, ?_⟩ have hq : (minpoly k x).leadingCoeff = 1 := minpoly.monic (IsSeparable.isIntegral k x) have hsep : (minpoly k x).Separable := IsSeparable.separable k x have h : (minpoly k x).degree = 1 := degree_eq_one_of_irreducible k (minpoly.irreducible (IsSeparable.isIntegral k x)) hsep have : aeval x (minpoly k x) = 0 := minpoly.aeval k x
rw [eq_X_add_C_of_degree_eq_one h, hq, C_1, one_mul, aeval_add, aeval_X, aeval_C, add_eq_zero_iff_eq_neg] at this
theorem algebraMap_surjective [IsSepClosed k] [Algebra k K] [IsSeparable k K] : Function.Surjective (algebraMap k K) := by refine fun x => ⟨-(minpoly k x).coeff 0, ?_⟩ have hq : (minpoly k x).leadingCoeff = 1 := minpoly.monic (IsSeparable.isIntegral k x) have hsep : (minpoly k x).Separable := IsSeparable.separable k x have h : (minpoly k x).degree = 1 := degree_eq_one_of_irreducible k (minpoly.irreducible (IsSeparable.isIntegral k x)) hsep have : aeval x (minpoly k x) = 0 := minpoly.aeval k x
Mathlib.FieldTheory.IsSepClosed.158_0.3ZRqn1f8ZTqE2nc
theorem algebraMap_surjective [IsSepClosed k] [Algebra k K] [IsSeparable k K] : Function.Surjective (algebraMap k K)
Mathlib_FieldTheory_IsSepClosed
k : Type u inst✝⁴ : Field k K : Type v inst✝³ : Field K inst✝² : IsSepClosed k inst✝¹ : Algebra k K inst✝ : IsSeparable k K x : K hq : leadingCoeff (minpoly k x) = 1 hsep : Separable (minpoly k x) h : degree (minpoly k x) = 1 this : x = -(algebraMap k K) (coeff (minpoly k x) 0) ⊒ (algebraMap k K) (-coeff (minpoly k x) 0) = x
/- Copyright (c) 2023 Jz Pan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jz Pan -/ import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure /-! # Separably Closed Field In this file we define the typeclass for separably closed fields and separable closures, and prove some of their properties. ## Main Definitions - `IsSepClosed k` is the typeclass saying `k` is a separably closed field, i.e. every separable polynomial in `k` splits. - `IsSepClosure k K` is the typeclass saying `K` is a separable closure of `k`, where `k` is a field. This means that `K` is separably closed and separable over `k`. - `IsSepClosed.lift` is a map from a separable extension `L` of `K`, into any separably closed extension `M` of `K`. - `IsSepClosure.equiv` is a proof that any two separable closures of the same field are isomorphic. ## Tags separable closure, separably closed ## TODO - Maximal separable subextension of `K/k`, consisting of all elements of `K` which are separable over `k`. - If `K` is a separably closed field containing `k`, then the maximal separable subextension of `K/k` is a separable closure of `k`. - In particular, a separable closure exists. - If `k` is a perfect field, then its separable closure coincides with its algebraic closure. - An algebraic extension of a separably closed field is purely inseparable. -/ universe u v w open scoped Classical BigOperators Polynomial open Polynomial variable (k : Type u) [Field k] (K : Type v) [Field K] /-- Typeclass for separably closed fields. To show `Polynomial.Splits p f` for an arbitrary ring homomorphism `f`, see `IsSepClosed.splits_codomain` and `IsSepClosed.splits_domain`. -/ class IsSepClosed : Prop where splits_of_separable : βˆ€ p : k[X], p.Separable β†’ (p.Splits <| RingHom.id k) /-- An algebraically closed field is also separably closed. -/ instance IsSepClosed.of_isAlgClosed [IsAlgClosed k] : IsSepClosed k := ⟨fun p _ ↦ IsAlgClosed.splits p⟩ variable {k} {K} /-- Every separable polynomial splits in the field extension `f : k β†’+* K` if `K` is separably closed. See also `IsSepClosed.splits_domain` for the case where `k` is separably closed. -/ theorem IsSepClosed.splits_codomain [IsSepClosed K] {f : k β†’+* K} (p : k[X]) (h : p.Separable) : p.Splits f := by convert IsSepClosed.splits_of_separable (p.map f) (Separable.map h); simp [splits_map_iff] /-- Every separable polynomial splits in the field extension `f : k β†’+* K` if `k` is separably closed. See also `IsSepClosed.splits_codomain` for the case where `k` is separably closed. -/ theorem IsSepClosed.splits_domain [IsSepClosed k] {f : k β†’+* K} (p : k[X]) (h : p.Separable) : p.Splits f := Polynomial.splits_of_splits_id _ <| IsSepClosed.splits_of_separable _ h namespace IsSepClosed theorem exists_root [IsSepClosed k] (p : k[X]) (hp : p.degree β‰  0) (hsep : p.Separable) : βˆƒ x, IsRoot p x := exists_root_of_splits _ (IsSepClosed.splits_of_separable p hsep) hp theorem exists_pow_nat_eq [IsSepClosed k] (x : k) (n : β„•) [hn : NeZero (n : k)] : βˆƒ z, z ^ n = x := by have hn' : 0 < n := Nat.pos_of_ne_zero <| fun h => by rw [h, Nat.cast_zero] at hn exact hn.out rfl have : degree (X ^ n - C x) β‰  0 := by rw [degree_X_pow_sub_C hn' x] exact (WithBot.coe_lt_coe.2 hn').ne' by_cases hx : x = 0 Β· exact ⟨0, by rw [hx, pow_eq_zero_iff hn']⟩ Β· obtain ⟨z, hz⟩ := exists_root _ this <| separable_X_pow_sub_C x hn.out hx use z simpa [eval_C, eval_X, eval_pow, eval_sub, IsRoot.def, sub_eq_zero] using hz theorem exists_eq_mul_self [IsSepClosed k] (x : k) [h2 : NeZero (2 : k)] : βˆƒ z, x = z * z := by rcases exists_pow_nat_eq x 2 with ⟨z, rfl⟩ exact ⟨z, sq z⟩ theorem roots_eq_zero_iff [IsSepClosed k] {p : k[X]} (hsep : p.Separable) : p.roots = 0 ↔ p = Polynomial.C (p.coeff 0) := by refine' ⟨fun h => _, fun hp => by rw [hp, roots_C]⟩ rcases le_or_lt (degree p) 0 with hd | hd Β· exact eq_C_of_degree_le_zero hd Β· obtain ⟨z, hz⟩ := IsSepClosed.exists_root p hd.ne' hsep rw [← mem_roots (ne_zero_of_degree_gt hd), h] at hz simp at hz theorem exists_evalβ‚‚_eq_zero [IsSepClosed K] (f : k β†’+* K) (p : k[X]) (hp : p.degree β‰  0) (hsep : p.Separable) : βˆƒ x, p.evalβ‚‚ f x = 0 := let ⟨x, hx⟩ := exists_root (p.map f) (by rwa [degree_map_eq_of_injective f.injective]) (Separable.map hsep) ⟨x, by rwa [evalβ‚‚_eq_eval_map, ← IsRoot]⟩ variable (K) theorem exists_aeval_eq_zero [IsSepClosed K] [Algebra k K] (p : k[X]) (hp : p.degree β‰  0) (hsep : p.Separable) : βˆƒ x : K, aeval x p = 0 := exists_evalβ‚‚_eq_zero (algebraMap k K) p hp hsep variable (k) {K} theorem of_exists_root (H : βˆ€ p : k[X], p.Monic β†’ Irreducible p β†’ Separable p β†’ βˆƒ x, p.eval x = 0) : IsSepClosed k := by refine ⟨fun p hsep ↦ Or.inr ?_⟩ intro q hq hdvd simp only [map_id] at hdvd have hlc : IsUnit (leadingCoeff q)⁻¹ := IsUnit.inv <| Ne.isUnit <| leadingCoeff_ne_zero.2 <| Irreducible.ne_zero hq have hsep' : Separable (q * C (leadingCoeff q)⁻¹) := Separable.mul (Separable.of_dvd hsep hdvd) ((separable_C _).2 hlc) (by simpa only [← isCoprime_mul_unit_right_right (isUnit_C.2 hlc) q 1, one_mul] using isCoprime_one_right (x := q)) have hirr' := hq rw [← irreducible_mul_isUnit (isUnit_C.2 hlc)] at hirr' obtain ⟨x, hx⟩ := H (q * C (leadingCoeff q)⁻¹) (monic_mul_leadingCoeff_inv hq.ne_zero) hirr' hsep' exact degree_mul_leadingCoeff_inv q hq.ne_zero β–Έ degree_eq_one_of_irreducible_of_root hirr' hx theorem degree_eq_one_of_irreducible [IsSepClosed k] {p : k[X]} (hp : Irreducible p) (hsep : p.Separable) : p.degree = 1 := degree_eq_one_of_irreducible_of_splits hp (IsSepClosed.splits_codomain p hsep) variable {k} theorem algebraMap_surjective [IsSepClosed k] [Algebra k K] [IsSeparable k K] : Function.Surjective (algebraMap k K) := by refine fun x => ⟨-(minpoly k x).coeff 0, ?_⟩ have hq : (minpoly k x).leadingCoeff = 1 := minpoly.monic (IsSeparable.isIntegral k x) have hsep : (minpoly k x).Separable := IsSeparable.separable k x have h : (minpoly k x).degree = 1 := degree_eq_one_of_irreducible k (minpoly.irreducible (IsSeparable.isIntegral k x)) hsep have : aeval x (minpoly k x) = 0 := minpoly.aeval k x rw [eq_X_add_C_of_degree_eq_one h, hq, C_1, one_mul, aeval_add, aeval_X, aeval_C, add_eq_zero_iff_eq_neg] at this
exact (RingHom.map_neg (algebraMap k K) ((minpoly k x).coeff 0)).symm β–Έ this.symm
theorem algebraMap_surjective [IsSepClosed k] [Algebra k K] [IsSeparable k K] : Function.Surjective (algebraMap k K) := by refine fun x => ⟨-(minpoly k x).coeff 0, ?_⟩ have hq : (minpoly k x).leadingCoeff = 1 := minpoly.monic (IsSeparable.isIntegral k x) have hsep : (minpoly k x).Separable := IsSeparable.separable k x have h : (minpoly k x).degree = 1 := degree_eq_one_of_irreducible k (minpoly.irreducible (IsSeparable.isIntegral k x)) hsep have : aeval x (minpoly k x) = 0 := minpoly.aeval k x rw [eq_X_add_C_of_degree_eq_one h, hq, C_1, one_mul, aeval_add, aeval_X, aeval_C, add_eq_zero_iff_eq_neg] at this
Mathlib.FieldTheory.IsSepClosed.158_0.3ZRqn1f8ZTqE2nc
theorem algebraMap_surjective [IsSepClosed k] [Algebra k K] [IsSeparable k K] : Function.Surjective (algebraMap k K)
Mathlib_FieldTheory_IsSepClosed
k : Type u inst✝² : Field k K : Type v inst✝¹ : Field K inst✝ : IsSepClosed k ⊒ IsSepClosed k
/- Copyright (c) 2023 Jz Pan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jz Pan -/ import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure /-! # Separably Closed Field In this file we define the typeclass for separably closed fields and separable closures, and prove some of their properties. ## Main Definitions - `IsSepClosed k` is the typeclass saying `k` is a separably closed field, i.e. every separable polynomial in `k` splits. - `IsSepClosure k K` is the typeclass saying `K` is a separable closure of `k`, where `k` is a field. This means that `K` is separably closed and separable over `k`. - `IsSepClosed.lift` is a map from a separable extension `L` of `K`, into any separably closed extension `M` of `K`. - `IsSepClosure.equiv` is a proof that any two separable closures of the same field are isomorphic. ## Tags separable closure, separably closed ## TODO - Maximal separable subextension of `K/k`, consisting of all elements of `K` which are separable over `k`. - If `K` is a separably closed field containing `k`, then the maximal separable subextension of `K/k` is a separable closure of `k`. - In particular, a separable closure exists. - If `k` is a perfect field, then its separable closure coincides with its algebraic closure. - An algebraic extension of a separably closed field is purely inseparable. -/ universe u v w open scoped Classical BigOperators Polynomial open Polynomial variable (k : Type u) [Field k] (K : Type v) [Field K] /-- Typeclass for separably closed fields. To show `Polynomial.Splits p f` for an arbitrary ring homomorphism `f`, see `IsSepClosed.splits_codomain` and `IsSepClosed.splits_domain`. -/ class IsSepClosed : Prop where splits_of_separable : βˆ€ p : k[X], p.Separable β†’ (p.Splits <| RingHom.id k) /-- An algebraically closed field is also separably closed. -/ instance IsSepClosed.of_isAlgClosed [IsAlgClosed k] : IsSepClosed k := ⟨fun p _ ↦ IsAlgClosed.splits p⟩ variable {k} {K} /-- Every separable polynomial splits in the field extension `f : k β†’+* K` if `K` is separably closed. See also `IsSepClosed.splits_domain` for the case where `k` is separably closed. -/ theorem IsSepClosed.splits_codomain [IsSepClosed K] {f : k β†’+* K} (p : k[X]) (h : p.Separable) : p.Splits f := by convert IsSepClosed.splits_of_separable (p.map f) (Separable.map h); simp [splits_map_iff] /-- Every separable polynomial splits in the field extension `f : k β†’+* K` if `k` is separably closed. See also `IsSepClosed.splits_codomain` for the case where `k` is separably closed. -/ theorem IsSepClosed.splits_domain [IsSepClosed k] {f : k β†’+* K} (p : k[X]) (h : p.Separable) : p.Splits f := Polynomial.splits_of_splits_id _ <| IsSepClosed.splits_of_separable _ h namespace IsSepClosed theorem exists_root [IsSepClosed k] (p : k[X]) (hp : p.degree β‰  0) (hsep : p.Separable) : βˆƒ x, IsRoot p x := exists_root_of_splits _ (IsSepClosed.splits_of_separable p hsep) hp theorem exists_pow_nat_eq [IsSepClosed k] (x : k) (n : β„•) [hn : NeZero (n : k)] : βˆƒ z, z ^ n = x := by have hn' : 0 < n := Nat.pos_of_ne_zero <| fun h => by rw [h, Nat.cast_zero] at hn exact hn.out rfl have : degree (X ^ n - C x) β‰  0 := by rw [degree_X_pow_sub_C hn' x] exact (WithBot.coe_lt_coe.2 hn').ne' by_cases hx : x = 0 Β· exact ⟨0, by rw [hx, pow_eq_zero_iff hn']⟩ Β· obtain ⟨z, hz⟩ := exists_root _ this <| separable_X_pow_sub_C x hn.out hx use z simpa [eval_C, eval_X, eval_pow, eval_sub, IsRoot.def, sub_eq_zero] using hz theorem exists_eq_mul_self [IsSepClosed k] (x : k) [h2 : NeZero (2 : k)] : βˆƒ z, x = z * z := by rcases exists_pow_nat_eq x 2 with ⟨z, rfl⟩ exact ⟨z, sq z⟩ theorem roots_eq_zero_iff [IsSepClosed k] {p : k[X]} (hsep : p.Separable) : p.roots = 0 ↔ p = Polynomial.C (p.coeff 0) := by refine' ⟨fun h => _, fun hp => by rw [hp, roots_C]⟩ rcases le_or_lt (degree p) 0 with hd | hd Β· exact eq_C_of_degree_le_zero hd Β· obtain ⟨z, hz⟩ := IsSepClosed.exists_root p hd.ne' hsep rw [← mem_roots (ne_zero_of_degree_gt hd), h] at hz simp at hz theorem exists_evalβ‚‚_eq_zero [IsSepClosed K] (f : k β†’+* K) (p : k[X]) (hp : p.degree β‰  0) (hsep : p.Separable) : βˆƒ x, p.evalβ‚‚ f x = 0 := let ⟨x, hx⟩ := exists_root (p.map f) (by rwa [degree_map_eq_of_injective f.injective]) (Separable.map hsep) ⟨x, by rwa [evalβ‚‚_eq_eval_map, ← IsRoot]⟩ variable (K) theorem exists_aeval_eq_zero [IsSepClosed K] [Algebra k K] (p : k[X]) (hp : p.degree β‰  0) (hsep : p.Separable) : βˆƒ x : K, aeval x p = 0 := exists_evalβ‚‚_eq_zero (algebraMap k K) p hp hsep variable (k) {K} theorem of_exists_root (H : βˆ€ p : k[X], p.Monic β†’ Irreducible p β†’ Separable p β†’ βˆƒ x, p.eval x = 0) : IsSepClosed k := by refine ⟨fun p hsep ↦ Or.inr ?_⟩ intro q hq hdvd simp only [map_id] at hdvd have hlc : IsUnit (leadingCoeff q)⁻¹ := IsUnit.inv <| Ne.isUnit <| leadingCoeff_ne_zero.2 <| Irreducible.ne_zero hq have hsep' : Separable (q * C (leadingCoeff q)⁻¹) := Separable.mul (Separable.of_dvd hsep hdvd) ((separable_C _).2 hlc) (by simpa only [← isCoprime_mul_unit_right_right (isUnit_C.2 hlc) q 1, one_mul] using isCoprime_one_right (x := q)) have hirr' := hq rw [← irreducible_mul_isUnit (isUnit_C.2 hlc)] at hirr' obtain ⟨x, hx⟩ := H (q * C (leadingCoeff q)⁻¹) (monic_mul_leadingCoeff_inv hq.ne_zero) hirr' hsep' exact degree_mul_leadingCoeff_inv q hq.ne_zero β–Έ degree_eq_one_of_irreducible_of_root hirr' hx theorem degree_eq_one_of_irreducible [IsSepClosed k] {p : k[X]} (hp : Irreducible p) (hsep : p.Separable) : p.degree = 1 := degree_eq_one_of_irreducible_of_splits hp (IsSepClosed.splits_codomain p hsep) variable {k} theorem algebraMap_surjective [IsSepClosed k] [Algebra k K] [IsSeparable k K] : Function.Surjective (algebraMap k K) := by refine fun x => ⟨-(minpoly k x).coeff 0, ?_⟩ have hq : (minpoly k x).leadingCoeff = 1 := minpoly.monic (IsSeparable.isIntegral k x) have hsep : (minpoly k x).Separable := IsSeparable.separable k x have h : (minpoly k x).degree = 1 := degree_eq_one_of_irreducible k (minpoly.irreducible (IsSeparable.isIntegral k x)) hsep have : aeval x (minpoly k x) = 0 := minpoly.aeval k x rw [eq_X_add_C_of_degree_eq_one h, hq, C_1, one_mul, aeval_add, aeval_X, aeval_C, add_eq_zero_iff_eq_neg] at this exact (RingHom.map_neg (algebraMap k K) ((minpoly k x).coeff 0)).symm β–Έ this.symm end IsSepClosed variable (k) (K) /-- Typeclass for an extension being a separable closure. -/ class IsSepClosure [Algebra k K] : Prop where sep_closed : IsSepClosed K separable : IsSeparable k K /-- A separably closed field is its separable closure. -/ instance IsSepClosure.self_of_isSepClosed [IsSepClosed k] : IsSepClosure k k := ⟨by
assumption
/-- A separably closed field is its separable closure. -/ instance IsSepClosure.self_of_isSepClosed [IsSepClosed k] : IsSepClosure k k := ⟨by
Mathlib.FieldTheory.IsSepClosed.180_0.3ZRqn1f8ZTqE2nc
/-- A separably closed field is its separable closure. -/ instance IsSepClosure.self_of_isSepClosed [IsSepClosed k] : IsSepClosure k k
Mathlib_FieldTheory_IsSepClosed
π•œ : Type u_1 A : Type u_2 inst✝⁴ : NontriviallyNormedField π•œ inst✝³ : NormedRing A inst✝² : NormedAlgebra π•œ A inst✝¹ : CompleteSpace A inst✝ : ProperSpace π•œ ⊒ CompactSpace ↑(characterSpace π•œ A)
/- Copyright (c) 2022 FrΓ©dΓ©ric Dupuis. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: FrΓ©dΓ©ric Dupuis -/ import Mathlib.Topology.Algebra.Module.CharacterSpace import Mathlib.Analysis.NormedSpace.WeakDual import Mathlib.Analysis.NormedSpace.Spectrum #align_import analysis.normed_space.algebra from "leanprover-community/mathlib"@"17ef379e997badd73e5eabb4d38f11919ab3c4b3" /-! # Normed algebras This file contains basic facts about normed algebras. ## Main results * We show that the character space of a normed algebra is compact using the Banach-Alaoglu theorem. ## TODO * Show compactness for topological vector spaces; this requires the TVS version of Banach-Alaoglu. ## Tags normed algebra, character space, continuous functional calculus -/ variable {π•œ : Type*} {A : Type*} namespace WeakDual namespace CharacterSpace variable [NontriviallyNormedField π•œ] [NormedRing A] [NormedAlgebra π•œ A] [CompleteSpace A] theorem norm_le_norm_one (Ο† : characterSpace π•œ A) : β€–toNormedDual (Ο† : WeakDual π•œ A)β€– ≀ β€–(1 : A)β€– := ContinuousLinearMap.op_norm_le_bound _ (norm_nonneg (1 : A)) fun a => mul_comm β€–aβ€– β€–(1 : A)β€– β–Έ spectrum.norm_le_norm_mul_of_mem (apply_mem_spectrum Ο† a) #align weak_dual.character_space.norm_le_norm_one WeakDual.CharacterSpace.norm_le_norm_one instance [ProperSpace π•œ] : CompactSpace (characterSpace π•œ A) := by
rw [← isCompact_iff_compactSpace]
instance [ProperSpace π•œ] : CompactSpace (characterSpace π•œ A) := by
Mathlib.Analysis.NormedSpace.Algebra.45_0.qrhY2kMk1fwIMuY
instance [ProperSpace π•œ] : CompactSpace (characterSpace π•œ A)
Mathlib_Analysis_NormedSpace_Algebra
π•œ : Type u_1 A : Type u_2 inst✝⁴ : NontriviallyNormedField π•œ inst✝³ : NormedRing A inst✝² : NormedAlgebra π•œ A inst✝¹ : CompleteSpace A inst✝ : ProperSpace π•œ ⊒ IsCompact (characterSpace π•œ A)
/- Copyright (c) 2022 FrΓ©dΓ©ric Dupuis. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: FrΓ©dΓ©ric Dupuis -/ import Mathlib.Topology.Algebra.Module.CharacterSpace import Mathlib.Analysis.NormedSpace.WeakDual import Mathlib.Analysis.NormedSpace.Spectrum #align_import analysis.normed_space.algebra from "leanprover-community/mathlib"@"17ef379e997badd73e5eabb4d38f11919ab3c4b3" /-! # Normed algebras This file contains basic facts about normed algebras. ## Main results * We show that the character space of a normed algebra is compact using the Banach-Alaoglu theorem. ## TODO * Show compactness for topological vector spaces; this requires the TVS version of Banach-Alaoglu. ## Tags normed algebra, character space, continuous functional calculus -/ variable {π•œ : Type*} {A : Type*} namespace WeakDual namespace CharacterSpace variable [NontriviallyNormedField π•œ] [NormedRing A] [NormedAlgebra π•œ A] [CompleteSpace A] theorem norm_le_norm_one (Ο† : characterSpace π•œ A) : β€–toNormedDual (Ο† : WeakDual π•œ A)β€– ≀ β€–(1 : A)β€– := ContinuousLinearMap.op_norm_le_bound _ (norm_nonneg (1 : A)) fun a => mul_comm β€–aβ€– β€–(1 : A)β€– β–Έ spectrum.norm_le_norm_mul_of_mem (apply_mem_spectrum Ο† a) #align weak_dual.character_space.norm_le_norm_one WeakDual.CharacterSpace.norm_le_norm_one instance [ProperSpace π•œ] : CompactSpace (characterSpace π•œ A) := by rw [← isCompact_iff_compactSpace]
have h : characterSpace π•œ A βŠ† toNormedDual ⁻¹' Metric.closedBall 0 β€–(1 : A)β€– := by intro Ο† hΟ† rw [Set.mem_preimage, mem_closedBall_zero_iff] exact (norm_le_norm_one βŸ¨Ο†, ⟨hΟ†.1, hΟ†.2⟩⟩ : _)
instance [ProperSpace π•œ] : CompactSpace (characterSpace π•œ A) := by rw [← isCompact_iff_compactSpace]
Mathlib.Analysis.NormedSpace.Algebra.45_0.qrhY2kMk1fwIMuY
instance [ProperSpace π•œ] : CompactSpace (characterSpace π•œ A)
Mathlib_Analysis_NormedSpace_Algebra
π•œ : Type u_1 A : Type u_2 inst✝⁴ : NontriviallyNormedField π•œ inst✝³ : NormedRing A inst✝² : NormedAlgebra π•œ A inst✝¹ : CompleteSpace A inst✝ : ProperSpace π•œ ⊒ characterSpace π•œ A βŠ† ⇑toNormedDual ⁻¹' Metric.closedBall 0 β€–1β€–
/- Copyright (c) 2022 FrΓ©dΓ©ric Dupuis. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: FrΓ©dΓ©ric Dupuis -/ import Mathlib.Topology.Algebra.Module.CharacterSpace import Mathlib.Analysis.NormedSpace.WeakDual import Mathlib.Analysis.NormedSpace.Spectrum #align_import analysis.normed_space.algebra from "leanprover-community/mathlib"@"17ef379e997badd73e5eabb4d38f11919ab3c4b3" /-! # Normed algebras This file contains basic facts about normed algebras. ## Main results * We show that the character space of a normed algebra is compact using the Banach-Alaoglu theorem. ## TODO * Show compactness for topological vector spaces; this requires the TVS version of Banach-Alaoglu. ## Tags normed algebra, character space, continuous functional calculus -/ variable {π•œ : Type*} {A : Type*} namespace WeakDual namespace CharacterSpace variable [NontriviallyNormedField π•œ] [NormedRing A] [NormedAlgebra π•œ A] [CompleteSpace A] theorem norm_le_norm_one (Ο† : characterSpace π•œ A) : β€–toNormedDual (Ο† : WeakDual π•œ A)β€– ≀ β€–(1 : A)β€– := ContinuousLinearMap.op_norm_le_bound _ (norm_nonneg (1 : A)) fun a => mul_comm β€–aβ€– β€–(1 : A)β€– β–Έ spectrum.norm_le_norm_mul_of_mem (apply_mem_spectrum Ο† a) #align weak_dual.character_space.norm_le_norm_one WeakDual.CharacterSpace.norm_le_norm_one instance [ProperSpace π•œ] : CompactSpace (characterSpace π•œ A) := by rw [← isCompact_iff_compactSpace] have h : characterSpace π•œ A βŠ† toNormedDual ⁻¹' Metric.closedBall 0 β€–(1 : A)β€– := by
intro φ hφ
instance [ProperSpace π•œ] : CompactSpace (characterSpace π•œ A) := by rw [← isCompact_iff_compactSpace] have h : characterSpace π•œ A βŠ† toNormedDual ⁻¹' Metric.closedBall 0 β€–(1 : A)β€– := by
Mathlib.Analysis.NormedSpace.Algebra.45_0.qrhY2kMk1fwIMuY
instance [ProperSpace π•œ] : CompactSpace (characterSpace π•œ A)
Mathlib_Analysis_NormedSpace_Algebra
π•œ : Type u_1 A : Type u_2 inst✝⁴ : NontriviallyNormedField π•œ inst✝³ : NormedRing A inst✝² : NormedAlgebra π•œ A inst✝¹ : CompleteSpace A inst✝ : ProperSpace π•œ Ο† : WeakDual π•œ A hΟ† : Ο† ∈ characterSpace π•œ A ⊒ Ο† ∈ ⇑toNormedDual ⁻¹' Metric.closedBall 0 β€–1β€–
/- Copyright (c) 2022 FrΓ©dΓ©ric Dupuis. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: FrΓ©dΓ©ric Dupuis -/ import Mathlib.Topology.Algebra.Module.CharacterSpace import Mathlib.Analysis.NormedSpace.WeakDual import Mathlib.Analysis.NormedSpace.Spectrum #align_import analysis.normed_space.algebra from "leanprover-community/mathlib"@"17ef379e997badd73e5eabb4d38f11919ab3c4b3" /-! # Normed algebras This file contains basic facts about normed algebras. ## Main results * We show that the character space of a normed algebra is compact using the Banach-Alaoglu theorem. ## TODO * Show compactness for topological vector spaces; this requires the TVS version of Banach-Alaoglu. ## Tags normed algebra, character space, continuous functional calculus -/ variable {π•œ : Type*} {A : Type*} namespace WeakDual namespace CharacterSpace variable [NontriviallyNormedField π•œ] [NormedRing A] [NormedAlgebra π•œ A] [CompleteSpace A] theorem norm_le_norm_one (Ο† : characterSpace π•œ A) : β€–toNormedDual (Ο† : WeakDual π•œ A)β€– ≀ β€–(1 : A)β€– := ContinuousLinearMap.op_norm_le_bound _ (norm_nonneg (1 : A)) fun a => mul_comm β€–aβ€– β€–(1 : A)β€– β–Έ spectrum.norm_le_norm_mul_of_mem (apply_mem_spectrum Ο† a) #align weak_dual.character_space.norm_le_norm_one WeakDual.CharacterSpace.norm_le_norm_one instance [ProperSpace π•œ] : CompactSpace (characterSpace π•œ A) := by rw [← isCompact_iff_compactSpace] have h : characterSpace π•œ A βŠ† toNormedDual ⁻¹' Metric.closedBall 0 β€–(1 : A)β€– := by intro Ο† hΟ†
rw [Set.mem_preimage, mem_closedBall_zero_iff]
instance [ProperSpace π•œ] : CompactSpace (characterSpace π•œ A) := by rw [← isCompact_iff_compactSpace] have h : characterSpace π•œ A βŠ† toNormedDual ⁻¹' Metric.closedBall 0 β€–(1 : A)β€– := by intro Ο† hΟ†
Mathlib.Analysis.NormedSpace.Algebra.45_0.qrhY2kMk1fwIMuY
instance [ProperSpace π•œ] : CompactSpace (characterSpace π•œ A)
Mathlib_Analysis_NormedSpace_Algebra
π•œ : Type u_1 A : Type u_2 inst✝⁴ : NontriviallyNormedField π•œ inst✝³ : NormedRing A inst✝² : NormedAlgebra π•œ A inst✝¹ : CompleteSpace A inst✝ : ProperSpace π•œ Ο† : WeakDual π•œ A hΟ† : Ο† ∈ characterSpace π•œ A ⊒ β€–toNormedDual Ο†β€– ≀ β€–1β€–
/- Copyright (c) 2022 FrΓ©dΓ©ric Dupuis. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: FrΓ©dΓ©ric Dupuis -/ import Mathlib.Topology.Algebra.Module.CharacterSpace import Mathlib.Analysis.NormedSpace.WeakDual import Mathlib.Analysis.NormedSpace.Spectrum #align_import analysis.normed_space.algebra from "leanprover-community/mathlib"@"17ef379e997badd73e5eabb4d38f11919ab3c4b3" /-! # Normed algebras This file contains basic facts about normed algebras. ## Main results * We show that the character space of a normed algebra is compact using the Banach-Alaoglu theorem. ## TODO * Show compactness for topological vector spaces; this requires the TVS version of Banach-Alaoglu. ## Tags normed algebra, character space, continuous functional calculus -/ variable {π•œ : Type*} {A : Type*} namespace WeakDual namespace CharacterSpace variable [NontriviallyNormedField π•œ] [NormedRing A] [NormedAlgebra π•œ A] [CompleteSpace A] theorem norm_le_norm_one (Ο† : characterSpace π•œ A) : β€–toNormedDual (Ο† : WeakDual π•œ A)β€– ≀ β€–(1 : A)β€– := ContinuousLinearMap.op_norm_le_bound _ (norm_nonneg (1 : A)) fun a => mul_comm β€–aβ€– β€–(1 : A)β€– β–Έ spectrum.norm_le_norm_mul_of_mem (apply_mem_spectrum Ο† a) #align weak_dual.character_space.norm_le_norm_one WeakDual.CharacterSpace.norm_le_norm_one instance [ProperSpace π•œ] : CompactSpace (characterSpace π•œ A) := by rw [← isCompact_iff_compactSpace] have h : characterSpace π•œ A βŠ† toNormedDual ⁻¹' Metric.closedBall 0 β€–(1 : A)β€– := by intro Ο† hΟ† rw [Set.mem_preimage, mem_closedBall_zero_iff]
exact (norm_le_norm_one βŸ¨Ο†, ⟨hΟ†.1, hΟ†.2⟩⟩ : _)
instance [ProperSpace π•œ] : CompactSpace (characterSpace π•œ A) := by rw [← isCompact_iff_compactSpace] have h : characterSpace π•œ A βŠ† toNormedDual ⁻¹' Metric.closedBall 0 β€–(1 : A)β€– := by intro Ο† hΟ† rw [Set.mem_preimage, mem_closedBall_zero_iff]
Mathlib.Analysis.NormedSpace.Algebra.45_0.qrhY2kMk1fwIMuY
instance [ProperSpace π•œ] : CompactSpace (characterSpace π•œ A)
Mathlib_Analysis_NormedSpace_Algebra
π•œ : Type u_1 A : Type u_2 inst✝⁴ : NontriviallyNormedField π•œ inst✝³ : NormedRing A inst✝² : NormedAlgebra π•œ A inst✝¹ : CompleteSpace A inst✝ : ProperSpace π•œ h : characterSpace π•œ A βŠ† ⇑toNormedDual ⁻¹' Metric.closedBall 0 β€–1β€– ⊒ IsCompact (characterSpace π•œ A)
/- Copyright (c) 2022 FrΓ©dΓ©ric Dupuis. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: FrΓ©dΓ©ric Dupuis -/ import Mathlib.Topology.Algebra.Module.CharacterSpace import Mathlib.Analysis.NormedSpace.WeakDual import Mathlib.Analysis.NormedSpace.Spectrum #align_import analysis.normed_space.algebra from "leanprover-community/mathlib"@"17ef379e997badd73e5eabb4d38f11919ab3c4b3" /-! # Normed algebras This file contains basic facts about normed algebras. ## Main results * We show that the character space of a normed algebra is compact using the Banach-Alaoglu theorem. ## TODO * Show compactness for topological vector spaces; this requires the TVS version of Banach-Alaoglu. ## Tags normed algebra, character space, continuous functional calculus -/ variable {π•œ : Type*} {A : Type*} namespace WeakDual namespace CharacterSpace variable [NontriviallyNormedField π•œ] [NormedRing A] [NormedAlgebra π•œ A] [CompleteSpace A] theorem norm_le_norm_one (Ο† : characterSpace π•œ A) : β€–toNormedDual (Ο† : WeakDual π•œ A)β€– ≀ β€–(1 : A)β€– := ContinuousLinearMap.op_norm_le_bound _ (norm_nonneg (1 : A)) fun a => mul_comm β€–aβ€– β€–(1 : A)β€– β–Έ spectrum.norm_le_norm_mul_of_mem (apply_mem_spectrum Ο† a) #align weak_dual.character_space.norm_le_norm_one WeakDual.CharacterSpace.norm_le_norm_one instance [ProperSpace π•œ] : CompactSpace (characterSpace π•œ A) := by rw [← isCompact_iff_compactSpace] have h : characterSpace π•œ A βŠ† toNormedDual ⁻¹' Metric.closedBall 0 β€–(1 : A)β€– := by intro Ο† hΟ† rw [Set.mem_preimage, mem_closedBall_zero_iff] exact (norm_le_norm_one βŸ¨Ο†, ⟨hΟ†.1, hΟ†.2⟩⟩ : _)
exact (isCompact_closedBall π•œ 0 _).of_isClosed_subset CharacterSpace.isClosed h
instance [ProperSpace π•œ] : CompactSpace (characterSpace π•œ A) := by rw [← isCompact_iff_compactSpace] have h : characterSpace π•œ A βŠ† toNormedDual ⁻¹' Metric.closedBall 0 β€–(1 : A)β€– := by intro Ο† hΟ† rw [Set.mem_preimage, mem_closedBall_zero_iff] exact (norm_le_norm_one βŸ¨Ο†, ⟨hΟ†.1, hΟ†.2⟩⟩ : _)
Mathlib.Analysis.NormedSpace.Algebra.45_0.qrhY2kMk1fwIMuY
instance [ProperSpace π•œ] : CompactSpace (characterSpace π•œ A)
Mathlib_Analysis_NormedSpace_Algebra
π•œ : Type u_1 E : Type u_2 F : Type u_3 inst✝⁷ : IsROrC π•œ inst✝⁢ : NormedAddCommGroup E inst✝⁡ : InnerProductSpace π•œ E inst✝⁴ : NormedAddCommGroup F inst✝³ : InnerProductSpace ℝ F inst✝² : NormedSpace ℝ E G : Type u_4 inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace ℝ G f✝ g✝ : G β†’ E f'✝ g'✝ : G β†’L[ℝ] E s✝ : Set G x✝ : G n : β„•βˆž f g : ℝ β†’ E f' g' : E s : Set ℝ x : ℝ hf : HasDerivWithinAt f f' s x hg : HasDerivWithinAt g g' s x ⊒ HasDerivWithinAt (fun t => Inner.inner (f t) (g t)) (Inner.inner (f x) g' + Inner.inner f' (g x)) s x
/- Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ import Mathlib.Analysis.InnerProductSpace.PiL2 import Mathlib.Analysis.SpecialFunctions.Sqrt import Mathlib.Analysis.NormedSpace.HomeomorphBall #align_import analysis.inner_product_space.calculus from "leanprover-community/mathlib"@"f9dd3204df14a0749cd456fac1e6849dfe7d2b88" /-! # Calculus in inner product spaces In this file we prove that the inner product and square of the norm in an inner space are infinitely `ℝ`-smooth. In order to state these results, we need a `NormedSpace ℝ E` instance. Though we can deduce this structure from `InnerProductSpace π•œ E`, this instance may be not definitionally equal to some other β€œnatural” instance. So, we assume `[NormedSpace ℝ E]`. We also prove that functions to a `EuclideanSpace` are (higher) differentiable if and only if their components are. This follows from the corresponding fact for finite product of normed spaces, and from the equivalence of norms in finite dimensions. ## TODO The last part of the file should be generalized to `PiLp`. -/ noncomputable section open IsROrC Real Filter open scoped BigOperators Classical Topology section DerivInner variable {π•œ E F : Type*} [IsROrC π•œ] variable [NormedAddCommGroup E] [InnerProductSpace π•œ E] variable [NormedAddCommGroup F] [InnerProductSpace ℝ F] local notation "βŸͺ" x ", " y "⟫" => @inner π•œ _ _ x y variable (π•œ) [NormedSpace ℝ E] /-- Derivative of the inner product. -/ def fderivInnerClm (p : E Γ— E) : E Γ— E β†’L[ℝ] π•œ := isBoundedBilinearMap_inner.deriv p #align fderiv_inner_clm fderivInnerClm @[simp] theorem fderivInnerClm_apply (p x : E Γ— E) : fderivInnerClm π•œ p x = βŸͺp.1, x.2⟫ + βŸͺx.1, p.2⟫ := rfl #align fderiv_inner_clm_apply fderivInnerClm_apply variable {π•œ} -- porting note: Lean 3 magically switches back to `{π•œ}` here theorem contDiff_inner {n} : ContDiff ℝ n fun p : E Γ— E => βŸͺp.1, p.2⟫ := isBoundedBilinearMap_inner.contDiff #align cont_diff_inner contDiff_inner theorem contDiffAt_inner {p : E Γ— E} {n} : ContDiffAt ℝ n (fun p : E Γ— E => βŸͺp.1, p.2⟫) p := ContDiff.contDiffAt contDiff_inner #align cont_diff_at_inner contDiffAt_inner theorem differentiable_inner : Differentiable ℝ fun p : E Γ— E => βŸͺp.1, p.2⟫ := isBoundedBilinearMap_inner.differentiableAt #align differentiable_inner differentiable_inner variable (π•œ) variable {G : Type*} [NormedAddCommGroup G] [NormedSpace ℝ G] {f g : G β†’ E} {f' g' : G β†’L[ℝ] E} {s : Set G} {x : G} {n : β„•βˆž} theorem ContDiffWithinAt.inner (hf : ContDiffWithinAt ℝ n f s x) (hg : ContDiffWithinAt ℝ n g s x) : ContDiffWithinAt ℝ n (fun x => βŸͺf x, g x⟫) s x := contDiffAt_inner.comp_contDiffWithinAt x (hf.prod hg) #align cont_diff_within_at.inner ContDiffWithinAt.inner nonrec theorem ContDiffAt.inner (hf : ContDiffAt ℝ n f x) (hg : ContDiffAt ℝ n g x) : ContDiffAt ℝ n (fun x => βŸͺf x, g x⟫) x := hf.inner π•œ hg #align cont_diff_at.inner ContDiffAt.inner theorem ContDiffOn.inner (hf : ContDiffOn ℝ n f s) (hg : ContDiffOn ℝ n g s) : ContDiffOn ℝ n (fun x => βŸͺf x, g x⟫) s := fun x hx => (hf x hx).inner π•œ (hg x hx) #align cont_diff_on.inner ContDiffOn.inner theorem ContDiff.inner (hf : ContDiff ℝ n f) (hg : ContDiff ℝ n g) : ContDiff ℝ n fun x => βŸͺf x, g x⟫ := contDiff_inner.comp (hf.prod hg) #align cont_diff.inner ContDiff.inner theorem HasFDerivWithinAt.inner (hf : HasFDerivWithinAt f f' s x) (hg : HasFDerivWithinAt g g' s x) : HasFDerivWithinAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') s x := (isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp_hasFDerivWithinAt x (hf.prod hg) #align has_fderiv_within_at.inner HasFDerivWithinAt.inner theorem HasStrictFDerivAt.inner (hf : HasStrictFDerivAt f f' x) (hg : HasStrictFDerivAt g g' x) : HasStrictFDerivAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') x := (isBoundedBilinearMap_inner.hasStrictFDerivAt (f x, g x)).comp x (hf.prod hg) #align has_strict_fderiv_at.inner HasStrictFDerivAt.inner theorem HasFDerivAt.inner (hf : HasFDerivAt f f' x) (hg : HasFDerivAt g g' x) : HasFDerivAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') x := (isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp x (hf.prod hg) #align has_fderiv_at.inner HasFDerivAt.inner theorem HasDerivWithinAt.inner {f g : ℝ β†’ E} {f' g' : E} {s : Set ℝ} {x : ℝ} (hf : HasDerivWithinAt f f' s x) (hg : HasDerivWithinAt g g' s x) : HasDerivWithinAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) s x := by
simpa using (hf.hasFDerivWithinAt.inner π•œ hg.hasFDerivWithinAt).hasDerivWithinAt
theorem HasDerivWithinAt.inner {f g : ℝ β†’ E} {f' g' : E} {s : Set ℝ} {x : ℝ} (hf : HasDerivWithinAt f f' s x) (hg : HasDerivWithinAt g g' s x) : HasDerivWithinAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) s x := by
Mathlib.Analysis.InnerProductSpace.Calculus.111_0.6FECEGgqdb67QLM
theorem HasDerivWithinAt.inner {f g : ℝ β†’ E} {f' g' : E} {s : Set ℝ} {x : ℝ} (hf : HasDerivWithinAt f f' s x) (hg : HasDerivWithinAt g g' s x) : HasDerivWithinAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) s x
Mathlib_Analysis_InnerProductSpace_Calculus
π•œ : Type u_1 E : Type u_2 F : Type u_3 inst✝⁷ : IsROrC π•œ inst✝⁢ : NormedAddCommGroup E inst✝⁡ : InnerProductSpace π•œ E inst✝⁴ : NormedAddCommGroup F inst✝³ : InnerProductSpace ℝ F inst✝² : NormedSpace ℝ E G : Type u_4 inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace ℝ G f✝ g✝ : G β†’ E f'✝ g'✝ : G β†’L[ℝ] E s : Set G x✝ : G n : β„•βˆž f g : ℝ β†’ E f' g' : E x : ℝ ⊒ HasDerivAt f f' x β†’ HasDerivAt g g' x β†’ HasDerivAt (fun t => Inner.inner (f t) (g t)) (Inner.inner (f x) g' + Inner.inner f' (g x)) x
/- Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ import Mathlib.Analysis.InnerProductSpace.PiL2 import Mathlib.Analysis.SpecialFunctions.Sqrt import Mathlib.Analysis.NormedSpace.HomeomorphBall #align_import analysis.inner_product_space.calculus from "leanprover-community/mathlib"@"f9dd3204df14a0749cd456fac1e6849dfe7d2b88" /-! # Calculus in inner product spaces In this file we prove that the inner product and square of the norm in an inner space are infinitely `ℝ`-smooth. In order to state these results, we need a `NormedSpace ℝ E` instance. Though we can deduce this structure from `InnerProductSpace π•œ E`, this instance may be not definitionally equal to some other β€œnatural” instance. So, we assume `[NormedSpace ℝ E]`. We also prove that functions to a `EuclideanSpace` are (higher) differentiable if and only if their components are. This follows from the corresponding fact for finite product of normed spaces, and from the equivalence of norms in finite dimensions. ## TODO The last part of the file should be generalized to `PiLp`. -/ noncomputable section open IsROrC Real Filter open scoped BigOperators Classical Topology section DerivInner variable {π•œ E F : Type*} [IsROrC π•œ] variable [NormedAddCommGroup E] [InnerProductSpace π•œ E] variable [NormedAddCommGroup F] [InnerProductSpace ℝ F] local notation "βŸͺ" x ", " y "⟫" => @inner π•œ _ _ x y variable (π•œ) [NormedSpace ℝ E] /-- Derivative of the inner product. -/ def fderivInnerClm (p : E Γ— E) : E Γ— E β†’L[ℝ] π•œ := isBoundedBilinearMap_inner.deriv p #align fderiv_inner_clm fderivInnerClm @[simp] theorem fderivInnerClm_apply (p x : E Γ— E) : fderivInnerClm π•œ p x = βŸͺp.1, x.2⟫ + βŸͺx.1, p.2⟫ := rfl #align fderiv_inner_clm_apply fderivInnerClm_apply variable {π•œ} -- porting note: Lean 3 magically switches back to `{π•œ}` here theorem contDiff_inner {n} : ContDiff ℝ n fun p : E Γ— E => βŸͺp.1, p.2⟫ := isBoundedBilinearMap_inner.contDiff #align cont_diff_inner contDiff_inner theorem contDiffAt_inner {p : E Γ— E} {n} : ContDiffAt ℝ n (fun p : E Γ— E => βŸͺp.1, p.2⟫) p := ContDiff.contDiffAt contDiff_inner #align cont_diff_at_inner contDiffAt_inner theorem differentiable_inner : Differentiable ℝ fun p : E Γ— E => βŸͺp.1, p.2⟫ := isBoundedBilinearMap_inner.differentiableAt #align differentiable_inner differentiable_inner variable (π•œ) variable {G : Type*} [NormedAddCommGroup G] [NormedSpace ℝ G] {f g : G β†’ E} {f' g' : G β†’L[ℝ] E} {s : Set G} {x : G} {n : β„•βˆž} theorem ContDiffWithinAt.inner (hf : ContDiffWithinAt ℝ n f s x) (hg : ContDiffWithinAt ℝ n g s x) : ContDiffWithinAt ℝ n (fun x => βŸͺf x, g x⟫) s x := contDiffAt_inner.comp_contDiffWithinAt x (hf.prod hg) #align cont_diff_within_at.inner ContDiffWithinAt.inner nonrec theorem ContDiffAt.inner (hf : ContDiffAt ℝ n f x) (hg : ContDiffAt ℝ n g x) : ContDiffAt ℝ n (fun x => βŸͺf x, g x⟫) x := hf.inner π•œ hg #align cont_diff_at.inner ContDiffAt.inner theorem ContDiffOn.inner (hf : ContDiffOn ℝ n f s) (hg : ContDiffOn ℝ n g s) : ContDiffOn ℝ n (fun x => βŸͺf x, g x⟫) s := fun x hx => (hf x hx).inner π•œ (hg x hx) #align cont_diff_on.inner ContDiffOn.inner theorem ContDiff.inner (hf : ContDiff ℝ n f) (hg : ContDiff ℝ n g) : ContDiff ℝ n fun x => βŸͺf x, g x⟫ := contDiff_inner.comp (hf.prod hg) #align cont_diff.inner ContDiff.inner theorem HasFDerivWithinAt.inner (hf : HasFDerivWithinAt f f' s x) (hg : HasFDerivWithinAt g g' s x) : HasFDerivWithinAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') s x := (isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp_hasFDerivWithinAt x (hf.prod hg) #align has_fderiv_within_at.inner HasFDerivWithinAt.inner theorem HasStrictFDerivAt.inner (hf : HasStrictFDerivAt f f' x) (hg : HasStrictFDerivAt g g' x) : HasStrictFDerivAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') x := (isBoundedBilinearMap_inner.hasStrictFDerivAt (f x, g x)).comp x (hf.prod hg) #align has_strict_fderiv_at.inner HasStrictFDerivAt.inner theorem HasFDerivAt.inner (hf : HasFDerivAt f f' x) (hg : HasFDerivAt g g' x) : HasFDerivAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') x := (isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp x (hf.prod hg) #align has_fderiv_at.inner HasFDerivAt.inner theorem HasDerivWithinAt.inner {f g : ℝ β†’ E} {f' g' : E} {s : Set ℝ} {x : ℝ} (hf : HasDerivWithinAt f f' s x) (hg : HasDerivWithinAt g g' s x) : HasDerivWithinAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) s x := by simpa using (hf.hasFDerivWithinAt.inner π•œ hg.hasFDerivWithinAt).hasDerivWithinAt #align has_deriv_within_at.inner HasDerivWithinAt.inner theorem HasDerivAt.inner {f g : ℝ β†’ E} {f' g' : E} {x : ℝ} : HasDerivAt f f' x β†’ HasDerivAt g g' x β†’ HasDerivAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) x := by
simpa only [← hasDerivWithinAt_univ] using HasDerivWithinAt.inner π•œ
theorem HasDerivAt.inner {f g : ℝ β†’ E} {f' g' : E} {x : ℝ} : HasDerivAt f f' x β†’ HasDerivAt g g' x β†’ HasDerivAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) x := by
Mathlib.Analysis.InnerProductSpace.Calculus.117_0.6FECEGgqdb67QLM
theorem HasDerivAt.inner {f g : ℝ β†’ E} {f' g' : E} {x : ℝ} : HasDerivAt f f' x β†’ HasDerivAt g g' x β†’ HasDerivAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) x
Mathlib_Analysis_InnerProductSpace_Calculus
π•œ : Type u_1 E : Type u_2 F : Type u_3 inst✝⁷ : IsROrC π•œ inst✝⁢ : NormedAddCommGroup E inst✝⁡ : InnerProductSpace π•œ E inst✝⁴ : NormedAddCommGroup F inst✝³ : InnerProductSpace ℝ F inst✝² : NormedSpace ℝ E G : Type u_4 inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace ℝ G f g : G β†’ E f' g' : G β†’L[ℝ] E s : Set G x : G n : β„•βˆž hf : DifferentiableAt ℝ f x hg : DifferentiableAt ℝ g x y : G ⊒ (fderiv ℝ (fun t => inner (f t) (g t)) x) y = inner (f x) ((fderiv ℝ g x) y) + inner ((fderiv ℝ f x) y) (g x)
/- Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ import Mathlib.Analysis.InnerProductSpace.PiL2 import Mathlib.Analysis.SpecialFunctions.Sqrt import Mathlib.Analysis.NormedSpace.HomeomorphBall #align_import analysis.inner_product_space.calculus from "leanprover-community/mathlib"@"f9dd3204df14a0749cd456fac1e6849dfe7d2b88" /-! # Calculus in inner product spaces In this file we prove that the inner product and square of the norm in an inner space are infinitely `ℝ`-smooth. In order to state these results, we need a `NormedSpace ℝ E` instance. Though we can deduce this structure from `InnerProductSpace π•œ E`, this instance may be not definitionally equal to some other β€œnatural” instance. So, we assume `[NormedSpace ℝ E]`. We also prove that functions to a `EuclideanSpace` are (higher) differentiable if and only if their components are. This follows from the corresponding fact for finite product of normed spaces, and from the equivalence of norms in finite dimensions. ## TODO The last part of the file should be generalized to `PiLp`. -/ noncomputable section open IsROrC Real Filter open scoped BigOperators Classical Topology section DerivInner variable {π•œ E F : Type*} [IsROrC π•œ] variable [NormedAddCommGroup E] [InnerProductSpace π•œ E] variable [NormedAddCommGroup F] [InnerProductSpace ℝ F] local notation "βŸͺ" x ", " y "⟫" => @inner π•œ _ _ x y variable (π•œ) [NormedSpace ℝ E] /-- Derivative of the inner product. -/ def fderivInnerClm (p : E Γ— E) : E Γ— E β†’L[ℝ] π•œ := isBoundedBilinearMap_inner.deriv p #align fderiv_inner_clm fderivInnerClm @[simp] theorem fderivInnerClm_apply (p x : E Γ— E) : fderivInnerClm π•œ p x = βŸͺp.1, x.2⟫ + βŸͺx.1, p.2⟫ := rfl #align fderiv_inner_clm_apply fderivInnerClm_apply variable {π•œ} -- porting note: Lean 3 magically switches back to `{π•œ}` here theorem contDiff_inner {n} : ContDiff ℝ n fun p : E Γ— E => βŸͺp.1, p.2⟫ := isBoundedBilinearMap_inner.contDiff #align cont_diff_inner contDiff_inner theorem contDiffAt_inner {p : E Γ— E} {n} : ContDiffAt ℝ n (fun p : E Γ— E => βŸͺp.1, p.2⟫) p := ContDiff.contDiffAt contDiff_inner #align cont_diff_at_inner contDiffAt_inner theorem differentiable_inner : Differentiable ℝ fun p : E Γ— E => βŸͺp.1, p.2⟫ := isBoundedBilinearMap_inner.differentiableAt #align differentiable_inner differentiable_inner variable (π•œ) variable {G : Type*} [NormedAddCommGroup G] [NormedSpace ℝ G] {f g : G β†’ E} {f' g' : G β†’L[ℝ] E} {s : Set G} {x : G} {n : β„•βˆž} theorem ContDiffWithinAt.inner (hf : ContDiffWithinAt ℝ n f s x) (hg : ContDiffWithinAt ℝ n g s x) : ContDiffWithinAt ℝ n (fun x => βŸͺf x, g x⟫) s x := contDiffAt_inner.comp_contDiffWithinAt x (hf.prod hg) #align cont_diff_within_at.inner ContDiffWithinAt.inner nonrec theorem ContDiffAt.inner (hf : ContDiffAt ℝ n f x) (hg : ContDiffAt ℝ n g x) : ContDiffAt ℝ n (fun x => βŸͺf x, g x⟫) x := hf.inner π•œ hg #align cont_diff_at.inner ContDiffAt.inner theorem ContDiffOn.inner (hf : ContDiffOn ℝ n f s) (hg : ContDiffOn ℝ n g s) : ContDiffOn ℝ n (fun x => βŸͺf x, g x⟫) s := fun x hx => (hf x hx).inner π•œ (hg x hx) #align cont_diff_on.inner ContDiffOn.inner theorem ContDiff.inner (hf : ContDiff ℝ n f) (hg : ContDiff ℝ n g) : ContDiff ℝ n fun x => βŸͺf x, g x⟫ := contDiff_inner.comp (hf.prod hg) #align cont_diff.inner ContDiff.inner theorem HasFDerivWithinAt.inner (hf : HasFDerivWithinAt f f' s x) (hg : HasFDerivWithinAt g g' s x) : HasFDerivWithinAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') s x := (isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp_hasFDerivWithinAt x (hf.prod hg) #align has_fderiv_within_at.inner HasFDerivWithinAt.inner theorem HasStrictFDerivAt.inner (hf : HasStrictFDerivAt f f' x) (hg : HasStrictFDerivAt g g' x) : HasStrictFDerivAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') x := (isBoundedBilinearMap_inner.hasStrictFDerivAt (f x, g x)).comp x (hf.prod hg) #align has_strict_fderiv_at.inner HasStrictFDerivAt.inner theorem HasFDerivAt.inner (hf : HasFDerivAt f f' x) (hg : HasFDerivAt g g' x) : HasFDerivAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') x := (isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp x (hf.prod hg) #align has_fderiv_at.inner HasFDerivAt.inner theorem HasDerivWithinAt.inner {f g : ℝ β†’ E} {f' g' : E} {s : Set ℝ} {x : ℝ} (hf : HasDerivWithinAt f f' s x) (hg : HasDerivWithinAt g g' s x) : HasDerivWithinAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) s x := by simpa using (hf.hasFDerivWithinAt.inner π•œ hg.hasFDerivWithinAt).hasDerivWithinAt #align has_deriv_within_at.inner HasDerivWithinAt.inner theorem HasDerivAt.inner {f g : ℝ β†’ E} {f' g' : E} {x : ℝ} : HasDerivAt f f' x β†’ HasDerivAt g g' x β†’ HasDerivAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) x := by simpa only [← hasDerivWithinAt_univ] using HasDerivWithinAt.inner π•œ #align has_deriv_at.inner HasDerivAt.inner theorem DifferentiableWithinAt.inner (hf : DifferentiableWithinAt ℝ f s x) (hg : DifferentiableWithinAt ℝ g s x) : DifferentiableWithinAt ℝ (fun x => βŸͺf x, g x⟫) s x := ((differentiable_inner _).hasFDerivAt.comp_hasFDerivWithinAt x (hf.prod hg).hasFDerivWithinAt).differentiableWithinAt #align differentiable_within_at.inner DifferentiableWithinAt.inner theorem DifferentiableAt.inner (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) : DifferentiableAt ℝ (fun x => βŸͺf x, g x⟫) x := (differentiable_inner _).comp x (hf.prod hg) #align differentiable_at.inner DifferentiableAt.inner theorem DifferentiableOn.inner (hf : DifferentiableOn ℝ f s) (hg : DifferentiableOn ℝ g s) : DifferentiableOn ℝ (fun x => βŸͺf x, g x⟫) s := fun x hx => (hf x hx).inner π•œ (hg x hx) #align differentiable_on.inner DifferentiableOn.inner theorem Differentiable.inner (hf : Differentiable ℝ f) (hg : Differentiable ℝ g) : Differentiable ℝ fun x => βŸͺf x, g x⟫ := fun x => (hf x).inner π•œ (hg x) #align differentiable.inner Differentiable.inner theorem fderiv_inner_apply (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) (y : G) : fderiv ℝ (fun t => βŸͺf t, g t⟫) x y = βŸͺf x, fderiv ℝ g x y⟫ + βŸͺfderiv ℝ f x y, g x⟫ := by
rw [(hf.hasFDerivAt.inner π•œ hg.hasFDerivAt).fderiv]
theorem fderiv_inner_apply (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) (y : G) : fderiv ℝ (fun t => βŸͺf t, g t⟫) x y = βŸͺf x, fderiv ℝ g x y⟫ + βŸͺfderiv ℝ f x y, g x⟫ := by
Mathlib.Analysis.InnerProductSpace.Calculus.142_0.6FECEGgqdb67QLM
theorem fderiv_inner_apply (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) (y : G) : fderiv ℝ (fun t => βŸͺf t, g t⟫) x y = βŸͺf x, fderiv ℝ g x y⟫ + βŸͺfderiv ℝ f x y, g x⟫
Mathlib_Analysis_InnerProductSpace_Calculus
π•œ : Type u_1 E : Type u_2 F : Type u_3 inst✝⁷ : IsROrC π•œ inst✝⁢ : NormedAddCommGroup E inst✝⁡ : InnerProductSpace π•œ E inst✝⁴ : NormedAddCommGroup F inst✝³ : InnerProductSpace ℝ F inst✝² : NormedSpace ℝ E G : Type u_4 inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace ℝ G f g : G β†’ E f' g' : G β†’L[ℝ] E s : Set G x : G n : β„•βˆž hf : DifferentiableAt ℝ f x hg : DifferentiableAt ℝ g x y : G ⊒ (ContinuousLinearMap.comp (fderivInnerClm π•œ (f x, g x)) (ContinuousLinearMap.prod (fderiv ℝ f x) (fderiv ℝ g x))) y = inner (f x) ((fderiv ℝ g x) y) + inner ((fderiv ℝ f x) y) (g x)
/- Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ import Mathlib.Analysis.InnerProductSpace.PiL2 import Mathlib.Analysis.SpecialFunctions.Sqrt import Mathlib.Analysis.NormedSpace.HomeomorphBall #align_import analysis.inner_product_space.calculus from "leanprover-community/mathlib"@"f9dd3204df14a0749cd456fac1e6849dfe7d2b88" /-! # Calculus in inner product spaces In this file we prove that the inner product and square of the norm in an inner space are infinitely `ℝ`-smooth. In order to state these results, we need a `NormedSpace ℝ E` instance. Though we can deduce this structure from `InnerProductSpace π•œ E`, this instance may be not definitionally equal to some other β€œnatural” instance. So, we assume `[NormedSpace ℝ E]`. We also prove that functions to a `EuclideanSpace` are (higher) differentiable if and only if their components are. This follows from the corresponding fact for finite product of normed spaces, and from the equivalence of norms in finite dimensions. ## TODO The last part of the file should be generalized to `PiLp`. -/ noncomputable section open IsROrC Real Filter open scoped BigOperators Classical Topology section DerivInner variable {π•œ E F : Type*} [IsROrC π•œ] variable [NormedAddCommGroup E] [InnerProductSpace π•œ E] variable [NormedAddCommGroup F] [InnerProductSpace ℝ F] local notation "βŸͺ" x ", " y "⟫" => @inner π•œ _ _ x y variable (π•œ) [NormedSpace ℝ E] /-- Derivative of the inner product. -/ def fderivInnerClm (p : E Γ— E) : E Γ— E β†’L[ℝ] π•œ := isBoundedBilinearMap_inner.deriv p #align fderiv_inner_clm fderivInnerClm @[simp] theorem fderivInnerClm_apply (p x : E Γ— E) : fderivInnerClm π•œ p x = βŸͺp.1, x.2⟫ + βŸͺx.1, p.2⟫ := rfl #align fderiv_inner_clm_apply fderivInnerClm_apply variable {π•œ} -- porting note: Lean 3 magically switches back to `{π•œ}` here theorem contDiff_inner {n} : ContDiff ℝ n fun p : E Γ— E => βŸͺp.1, p.2⟫ := isBoundedBilinearMap_inner.contDiff #align cont_diff_inner contDiff_inner theorem contDiffAt_inner {p : E Γ— E} {n} : ContDiffAt ℝ n (fun p : E Γ— E => βŸͺp.1, p.2⟫) p := ContDiff.contDiffAt contDiff_inner #align cont_diff_at_inner contDiffAt_inner theorem differentiable_inner : Differentiable ℝ fun p : E Γ— E => βŸͺp.1, p.2⟫ := isBoundedBilinearMap_inner.differentiableAt #align differentiable_inner differentiable_inner variable (π•œ) variable {G : Type*} [NormedAddCommGroup G] [NormedSpace ℝ G] {f g : G β†’ E} {f' g' : G β†’L[ℝ] E} {s : Set G} {x : G} {n : β„•βˆž} theorem ContDiffWithinAt.inner (hf : ContDiffWithinAt ℝ n f s x) (hg : ContDiffWithinAt ℝ n g s x) : ContDiffWithinAt ℝ n (fun x => βŸͺf x, g x⟫) s x := contDiffAt_inner.comp_contDiffWithinAt x (hf.prod hg) #align cont_diff_within_at.inner ContDiffWithinAt.inner nonrec theorem ContDiffAt.inner (hf : ContDiffAt ℝ n f x) (hg : ContDiffAt ℝ n g x) : ContDiffAt ℝ n (fun x => βŸͺf x, g x⟫) x := hf.inner π•œ hg #align cont_diff_at.inner ContDiffAt.inner theorem ContDiffOn.inner (hf : ContDiffOn ℝ n f s) (hg : ContDiffOn ℝ n g s) : ContDiffOn ℝ n (fun x => βŸͺf x, g x⟫) s := fun x hx => (hf x hx).inner π•œ (hg x hx) #align cont_diff_on.inner ContDiffOn.inner theorem ContDiff.inner (hf : ContDiff ℝ n f) (hg : ContDiff ℝ n g) : ContDiff ℝ n fun x => βŸͺf x, g x⟫ := contDiff_inner.comp (hf.prod hg) #align cont_diff.inner ContDiff.inner theorem HasFDerivWithinAt.inner (hf : HasFDerivWithinAt f f' s x) (hg : HasFDerivWithinAt g g' s x) : HasFDerivWithinAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') s x := (isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp_hasFDerivWithinAt x (hf.prod hg) #align has_fderiv_within_at.inner HasFDerivWithinAt.inner theorem HasStrictFDerivAt.inner (hf : HasStrictFDerivAt f f' x) (hg : HasStrictFDerivAt g g' x) : HasStrictFDerivAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') x := (isBoundedBilinearMap_inner.hasStrictFDerivAt (f x, g x)).comp x (hf.prod hg) #align has_strict_fderiv_at.inner HasStrictFDerivAt.inner theorem HasFDerivAt.inner (hf : HasFDerivAt f f' x) (hg : HasFDerivAt g g' x) : HasFDerivAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') x := (isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp x (hf.prod hg) #align has_fderiv_at.inner HasFDerivAt.inner theorem HasDerivWithinAt.inner {f g : ℝ β†’ E} {f' g' : E} {s : Set ℝ} {x : ℝ} (hf : HasDerivWithinAt f f' s x) (hg : HasDerivWithinAt g g' s x) : HasDerivWithinAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) s x := by simpa using (hf.hasFDerivWithinAt.inner π•œ hg.hasFDerivWithinAt).hasDerivWithinAt #align has_deriv_within_at.inner HasDerivWithinAt.inner theorem HasDerivAt.inner {f g : ℝ β†’ E} {f' g' : E} {x : ℝ} : HasDerivAt f f' x β†’ HasDerivAt g g' x β†’ HasDerivAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) x := by simpa only [← hasDerivWithinAt_univ] using HasDerivWithinAt.inner π•œ #align has_deriv_at.inner HasDerivAt.inner theorem DifferentiableWithinAt.inner (hf : DifferentiableWithinAt ℝ f s x) (hg : DifferentiableWithinAt ℝ g s x) : DifferentiableWithinAt ℝ (fun x => βŸͺf x, g x⟫) s x := ((differentiable_inner _).hasFDerivAt.comp_hasFDerivWithinAt x (hf.prod hg).hasFDerivWithinAt).differentiableWithinAt #align differentiable_within_at.inner DifferentiableWithinAt.inner theorem DifferentiableAt.inner (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) : DifferentiableAt ℝ (fun x => βŸͺf x, g x⟫) x := (differentiable_inner _).comp x (hf.prod hg) #align differentiable_at.inner DifferentiableAt.inner theorem DifferentiableOn.inner (hf : DifferentiableOn ℝ f s) (hg : DifferentiableOn ℝ g s) : DifferentiableOn ℝ (fun x => βŸͺf x, g x⟫) s := fun x hx => (hf x hx).inner π•œ (hg x hx) #align differentiable_on.inner DifferentiableOn.inner theorem Differentiable.inner (hf : Differentiable ℝ f) (hg : Differentiable ℝ g) : Differentiable ℝ fun x => βŸͺf x, g x⟫ := fun x => (hf x).inner π•œ (hg x) #align differentiable.inner Differentiable.inner theorem fderiv_inner_apply (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) (y : G) : fderiv ℝ (fun t => βŸͺf t, g t⟫) x y = βŸͺf x, fderiv ℝ g x y⟫ + βŸͺfderiv ℝ f x y, g x⟫ := by rw [(hf.hasFDerivAt.inner π•œ hg.hasFDerivAt).fderiv];
rfl
theorem fderiv_inner_apply (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) (y : G) : fderiv ℝ (fun t => βŸͺf t, g t⟫) x y = βŸͺf x, fderiv ℝ g x y⟫ + βŸͺfderiv ℝ f x y, g x⟫ := by rw [(hf.hasFDerivAt.inner π•œ hg.hasFDerivAt).fderiv];
Mathlib.Analysis.InnerProductSpace.Calculus.142_0.6FECEGgqdb67QLM
theorem fderiv_inner_apply (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) (y : G) : fderiv ℝ (fun t => βŸͺf t, g t⟫) x y = βŸͺf x, fderiv ℝ g x y⟫ + βŸͺfderiv ℝ f x y, g x⟫
Mathlib_Analysis_InnerProductSpace_Calculus
π•œ : Type u_1 E : Type u_2 F : Type u_3 inst✝⁷ : IsROrC π•œ inst✝⁢ : NormedAddCommGroup E inst✝⁡ : InnerProductSpace π•œ E inst✝⁴ : NormedAddCommGroup F inst✝³ : InnerProductSpace ℝ F inst✝² : NormedSpace ℝ E G : Type u_4 inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace ℝ G f g : G β†’ E f' g' : G β†’L[ℝ] E s : Set G x : G n : β„•βˆž ⊒ ContDiff ℝ n fun x => β€–xβ€– ^ 2
/- Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ import Mathlib.Analysis.InnerProductSpace.PiL2 import Mathlib.Analysis.SpecialFunctions.Sqrt import Mathlib.Analysis.NormedSpace.HomeomorphBall #align_import analysis.inner_product_space.calculus from "leanprover-community/mathlib"@"f9dd3204df14a0749cd456fac1e6849dfe7d2b88" /-! # Calculus in inner product spaces In this file we prove that the inner product and square of the norm in an inner space are infinitely `ℝ`-smooth. In order to state these results, we need a `NormedSpace ℝ E` instance. Though we can deduce this structure from `InnerProductSpace π•œ E`, this instance may be not definitionally equal to some other β€œnatural” instance. So, we assume `[NormedSpace ℝ E]`. We also prove that functions to a `EuclideanSpace` are (higher) differentiable if and only if their components are. This follows from the corresponding fact for finite product of normed spaces, and from the equivalence of norms in finite dimensions. ## TODO The last part of the file should be generalized to `PiLp`. -/ noncomputable section open IsROrC Real Filter open scoped BigOperators Classical Topology section DerivInner variable {π•œ E F : Type*} [IsROrC π•œ] variable [NormedAddCommGroup E] [InnerProductSpace π•œ E] variable [NormedAddCommGroup F] [InnerProductSpace ℝ F] local notation "βŸͺ" x ", " y "⟫" => @inner π•œ _ _ x y variable (π•œ) [NormedSpace ℝ E] /-- Derivative of the inner product. -/ def fderivInnerClm (p : E Γ— E) : E Γ— E β†’L[ℝ] π•œ := isBoundedBilinearMap_inner.deriv p #align fderiv_inner_clm fderivInnerClm @[simp] theorem fderivInnerClm_apply (p x : E Γ— E) : fderivInnerClm π•œ p x = βŸͺp.1, x.2⟫ + βŸͺx.1, p.2⟫ := rfl #align fderiv_inner_clm_apply fderivInnerClm_apply variable {π•œ} -- porting note: Lean 3 magically switches back to `{π•œ}` here theorem contDiff_inner {n} : ContDiff ℝ n fun p : E Γ— E => βŸͺp.1, p.2⟫ := isBoundedBilinearMap_inner.contDiff #align cont_diff_inner contDiff_inner theorem contDiffAt_inner {p : E Γ— E} {n} : ContDiffAt ℝ n (fun p : E Γ— E => βŸͺp.1, p.2⟫) p := ContDiff.contDiffAt contDiff_inner #align cont_diff_at_inner contDiffAt_inner theorem differentiable_inner : Differentiable ℝ fun p : E Γ— E => βŸͺp.1, p.2⟫ := isBoundedBilinearMap_inner.differentiableAt #align differentiable_inner differentiable_inner variable (π•œ) variable {G : Type*} [NormedAddCommGroup G] [NormedSpace ℝ G] {f g : G β†’ E} {f' g' : G β†’L[ℝ] E} {s : Set G} {x : G} {n : β„•βˆž} theorem ContDiffWithinAt.inner (hf : ContDiffWithinAt ℝ n f s x) (hg : ContDiffWithinAt ℝ n g s x) : ContDiffWithinAt ℝ n (fun x => βŸͺf x, g x⟫) s x := contDiffAt_inner.comp_contDiffWithinAt x (hf.prod hg) #align cont_diff_within_at.inner ContDiffWithinAt.inner nonrec theorem ContDiffAt.inner (hf : ContDiffAt ℝ n f x) (hg : ContDiffAt ℝ n g x) : ContDiffAt ℝ n (fun x => βŸͺf x, g x⟫) x := hf.inner π•œ hg #align cont_diff_at.inner ContDiffAt.inner theorem ContDiffOn.inner (hf : ContDiffOn ℝ n f s) (hg : ContDiffOn ℝ n g s) : ContDiffOn ℝ n (fun x => βŸͺf x, g x⟫) s := fun x hx => (hf x hx).inner π•œ (hg x hx) #align cont_diff_on.inner ContDiffOn.inner theorem ContDiff.inner (hf : ContDiff ℝ n f) (hg : ContDiff ℝ n g) : ContDiff ℝ n fun x => βŸͺf x, g x⟫ := contDiff_inner.comp (hf.prod hg) #align cont_diff.inner ContDiff.inner theorem HasFDerivWithinAt.inner (hf : HasFDerivWithinAt f f' s x) (hg : HasFDerivWithinAt g g' s x) : HasFDerivWithinAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') s x := (isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp_hasFDerivWithinAt x (hf.prod hg) #align has_fderiv_within_at.inner HasFDerivWithinAt.inner theorem HasStrictFDerivAt.inner (hf : HasStrictFDerivAt f f' x) (hg : HasStrictFDerivAt g g' x) : HasStrictFDerivAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') x := (isBoundedBilinearMap_inner.hasStrictFDerivAt (f x, g x)).comp x (hf.prod hg) #align has_strict_fderiv_at.inner HasStrictFDerivAt.inner theorem HasFDerivAt.inner (hf : HasFDerivAt f f' x) (hg : HasFDerivAt g g' x) : HasFDerivAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') x := (isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp x (hf.prod hg) #align has_fderiv_at.inner HasFDerivAt.inner theorem HasDerivWithinAt.inner {f g : ℝ β†’ E} {f' g' : E} {s : Set ℝ} {x : ℝ} (hf : HasDerivWithinAt f f' s x) (hg : HasDerivWithinAt g g' s x) : HasDerivWithinAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) s x := by simpa using (hf.hasFDerivWithinAt.inner π•œ hg.hasFDerivWithinAt).hasDerivWithinAt #align has_deriv_within_at.inner HasDerivWithinAt.inner theorem HasDerivAt.inner {f g : ℝ β†’ E} {f' g' : E} {x : ℝ} : HasDerivAt f f' x β†’ HasDerivAt g g' x β†’ HasDerivAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) x := by simpa only [← hasDerivWithinAt_univ] using HasDerivWithinAt.inner π•œ #align has_deriv_at.inner HasDerivAt.inner theorem DifferentiableWithinAt.inner (hf : DifferentiableWithinAt ℝ f s x) (hg : DifferentiableWithinAt ℝ g s x) : DifferentiableWithinAt ℝ (fun x => βŸͺf x, g x⟫) s x := ((differentiable_inner _).hasFDerivAt.comp_hasFDerivWithinAt x (hf.prod hg).hasFDerivWithinAt).differentiableWithinAt #align differentiable_within_at.inner DifferentiableWithinAt.inner theorem DifferentiableAt.inner (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) : DifferentiableAt ℝ (fun x => βŸͺf x, g x⟫) x := (differentiable_inner _).comp x (hf.prod hg) #align differentiable_at.inner DifferentiableAt.inner theorem DifferentiableOn.inner (hf : DifferentiableOn ℝ f s) (hg : DifferentiableOn ℝ g s) : DifferentiableOn ℝ (fun x => βŸͺf x, g x⟫) s := fun x hx => (hf x hx).inner π•œ (hg x hx) #align differentiable_on.inner DifferentiableOn.inner theorem Differentiable.inner (hf : Differentiable ℝ f) (hg : Differentiable ℝ g) : Differentiable ℝ fun x => βŸͺf x, g x⟫ := fun x => (hf x).inner π•œ (hg x) #align differentiable.inner Differentiable.inner theorem fderiv_inner_apply (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) (y : G) : fderiv ℝ (fun t => βŸͺf t, g t⟫) x y = βŸͺf x, fderiv ℝ g x y⟫ + βŸͺfderiv ℝ f x y, g x⟫ := by rw [(hf.hasFDerivAt.inner π•œ hg.hasFDerivAt).fderiv]; rfl #align fderiv_inner_apply fderiv_inner_apply theorem deriv_inner_apply {f g : ℝ β†’ E} {x : ℝ} (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) : deriv (fun t => βŸͺf t, g t⟫) x = βŸͺf x, deriv g x⟫ + βŸͺderiv f x, g x⟫ := (hf.hasDerivAt.inner π•œ hg.hasDerivAt).deriv #align deriv_inner_apply deriv_inner_apply theorem contDiff_norm_sq : ContDiff ℝ n fun x : E => β€–xβ€– ^ 2 := by
convert (reClm : π•œ β†’L[ℝ] ℝ).contDiff.comp ((contDiff_id (E := E)).inner π•œ (contDiff_id (E := E)))
theorem contDiff_norm_sq : ContDiff ℝ n fun x : E => β€–xβ€– ^ 2 := by
Mathlib.Analysis.InnerProductSpace.Calculus.153_0.6FECEGgqdb67QLM
theorem contDiff_norm_sq : ContDiff ℝ n fun x : E => β€–xβ€– ^ 2
Mathlib_Analysis_InnerProductSpace_Calculus
case h.e'_10.h π•œ : Type u_1 E : Type u_2 F : Type u_3 inst✝⁷ : IsROrC π•œ inst✝⁢ : NormedAddCommGroup E inst✝⁡ : InnerProductSpace π•œ E inst✝⁴ : NormedAddCommGroup F inst✝³ : InnerProductSpace ℝ F inst✝² : NormedSpace ℝ E G : Type u_4 inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace ℝ G f g : G β†’ E f' g' : G β†’L[ℝ] E s : Set G x : G n : β„•βˆž x✝ : E ⊒ β€–xβœβ€– ^ 2 = (⇑reClm ∘ fun x => inner (id x) (id x)) x✝
/- Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ import Mathlib.Analysis.InnerProductSpace.PiL2 import Mathlib.Analysis.SpecialFunctions.Sqrt import Mathlib.Analysis.NormedSpace.HomeomorphBall #align_import analysis.inner_product_space.calculus from "leanprover-community/mathlib"@"f9dd3204df14a0749cd456fac1e6849dfe7d2b88" /-! # Calculus in inner product spaces In this file we prove that the inner product and square of the norm in an inner space are infinitely `ℝ`-smooth. In order to state these results, we need a `NormedSpace ℝ E` instance. Though we can deduce this structure from `InnerProductSpace π•œ E`, this instance may be not definitionally equal to some other β€œnatural” instance. So, we assume `[NormedSpace ℝ E]`. We also prove that functions to a `EuclideanSpace` are (higher) differentiable if and only if their components are. This follows from the corresponding fact for finite product of normed spaces, and from the equivalence of norms in finite dimensions. ## TODO The last part of the file should be generalized to `PiLp`. -/ noncomputable section open IsROrC Real Filter open scoped BigOperators Classical Topology section DerivInner variable {π•œ E F : Type*} [IsROrC π•œ] variable [NormedAddCommGroup E] [InnerProductSpace π•œ E] variable [NormedAddCommGroup F] [InnerProductSpace ℝ F] local notation "βŸͺ" x ", " y "⟫" => @inner π•œ _ _ x y variable (π•œ) [NormedSpace ℝ E] /-- Derivative of the inner product. -/ def fderivInnerClm (p : E Γ— E) : E Γ— E β†’L[ℝ] π•œ := isBoundedBilinearMap_inner.deriv p #align fderiv_inner_clm fderivInnerClm @[simp] theorem fderivInnerClm_apply (p x : E Γ— E) : fderivInnerClm π•œ p x = βŸͺp.1, x.2⟫ + βŸͺx.1, p.2⟫ := rfl #align fderiv_inner_clm_apply fderivInnerClm_apply variable {π•œ} -- porting note: Lean 3 magically switches back to `{π•œ}` here theorem contDiff_inner {n} : ContDiff ℝ n fun p : E Γ— E => βŸͺp.1, p.2⟫ := isBoundedBilinearMap_inner.contDiff #align cont_diff_inner contDiff_inner theorem contDiffAt_inner {p : E Γ— E} {n} : ContDiffAt ℝ n (fun p : E Γ— E => βŸͺp.1, p.2⟫) p := ContDiff.contDiffAt contDiff_inner #align cont_diff_at_inner contDiffAt_inner theorem differentiable_inner : Differentiable ℝ fun p : E Γ— E => βŸͺp.1, p.2⟫ := isBoundedBilinearMap_inner.differentiableAt #align differentiable_inner differentiable_inner variable (π•œ) variable {G : Type*} [NormedAddCommGroup G] [NormedSpace ℝ G] {f g : G β†’ E} {f' g' : G β†’L[ℝ] E} {s : Set G} {x : G} {n : β„•βˆž} theorem ContDiffWithinAt.inner (hf : ContDiffWithinAt ℝ n f s x) (hg : ContDiffWithinAt ℝ n g s x) : ContDiffWithinAt ℝ n (fun x => βŸͺf x, g x⟫) s x := contDiffAt_inner.comp_contDiffWithinAt x (hf.prod hg) #align cont_diff_within_at.inner ContDiffWithinAt.inner nonrec theorem ContDiffAt.inner (hf : ContDiffAt ℝ n f x) (hg : ContDiffAt ℝ n g x) : ContDiffAt ℝ n (fun x => βŸͺf x, g x⟫) x := hf.inner π•œ hg #align cont_diff_at.inner ContDiffAt.inner theorem ContDiffOn.inner (hf : ContDiffOn ℝ n f s) (hg : ContDiffOn ℝ n g s) : ContDiffOn ℝ n (fun x => βŸͺf x, g x⟫) s := fun x hx => (hf x hx).inner π•œ (hg x hx) #align cont_diff_on.inner ContDiffOn.inner theorem ContDiff.inner (hf : ContDiff ℝ n f) (hg : ContDiff ℝ n g) : ContDiff ℝ n fun x => βŸͺf x, g x⟫ := contDiff_inner.comp (hf.prod hg) #align cont_diff.inner ContDiff.inner theorem HasFDerivWithinAt.inner (hf : HasFDerivWithinAt f f' s x) (hg : HasFDerivWithinAt g g' s x) : HasFDerivWithinAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') s x := (isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp_hasFDerivWithinAt x (hf.prod hg) #align has_fderiv_within_at.inner HasFDerivWithinAt.inner theorem HasStrictFDerivAt.inner (hf : HasStrictFDerivAt f f' x) (hg : HasStrictFDerivAt g g' x) : HasStrictFDerivAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') x := (isBoundedBilinearMap_inner.hasStrictFDerivAt (f x, g x)).comp x (hf.prod hg) #align has_strict_fderiv_at.inner HasStrictFDerivAt.inner theorem HasFDerivAt.inner (hf : HasFDerivAt f f' x) (hg : HasFDerivAt g g' x) : HasFDerivAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') x := (isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp x (hf.prod hg) #align has_fderiv_at.inner HasFDerivAt.inner theorem HasDerivWithinAt.inner {f g : ℝ β†’ E} {f' g' : E} {s : Set ℝ} {x : ℝ} (hf : HasDerivWithinAt f f' s x) (hg : HasDerivWithinAt g g' s x) : HasDerivWithinAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) s x := by simpa using (hf.hasFDerivWithinAt.inner π•œ hg.hasFDerivWithinAt).hasDerivWithinAt #align has_deriv_within_at.inner HasDerivWithinAt.inner theorem HasDerivAt.inner {f g : ℝ β†’ E} {f' g' : E} {x : ℝ} : HasDerivAt f f' x β†’ HasDerivAt g g' x β†’ HasDerivAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) x := by simpa only [← hasDerivWithinAt_univ] using HasDerivWithinAt.inner π•œ #align has_deriv_at.inner HasDerivAt.inner theorem DifferentiableWithinAt.inner (hf : DifferentiableWithinAt ℝ f s x) (hg : DifferentiableWithinAt ℝ g s x) : DifferentiableWithinAt ℝ (fun x => βŸͺf x, g x⟫) s x := ((differentiable_inner _).hasFDerivAt.comp_hasFDerivWithinAt x (hf.prod hg).hasFDerivWithinAt).differentiableWithinAt #align differentiable_within_at.inner DifferentiableWithinAt.inner theorem DifferentiableAt.inner (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) : DifferentiableAt ℝ (fun x => βŸͺf x, g x⟫) x := (differentiable_inner _).comp x (hf.prod hg) #align differentiable_at.inner DifferentiableAt.inner theorem DifferentiableOn.inner (hf : DifferentiableOn ℝ f s) (hg : DifferentiableOn ℝ g s) : DifferentiableOn ℝ (fun x => βŸͺf x, g x⟫) s := fun x hx => (hf x hx).inner π•œ (hg x hx) #align differentiable_on.inner DifferentiableOn.inner theorem Differentiable.inner (hf : Differentiable ℝ f) (hg : Differentiable ℝ g) : Differentiable ℝ fun x => βŸͺf x, g x⟫ := fun x => (hf x).inner π•œ (hg x) #align differentiable.inner Differentiable.inner theorem fderiv_inner_apply (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) (y : G) : fderiv ℝ (fun t => βŸͺf t, g t⟫) x y = βŸͺf x, fderiv ℝ g x y⟫ + βŸͺfderiv ℝ f x y, g x⟫ := by rw [(hf.hasFDerivAt.inner π•œ hg.hasFDerivAt).fderiv]; rfl #align fderiv_inner_apply fderiv_inner_apply theorem deriv_inner_apply {f g : ℝ β†’ E} {x : ℝ} (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) : deriv (fun t => βŸͺf t, g t⟫) x = βŸͺf x, deriv g x⟫ + βŸͺderiv f x, g x⟫ := (hf.hasDerivAt.inner π•œ hg.hasDerivAt).deriv #align deriv_inner_apply deriv_inner_apply theorem contDiff_norm_sq : ContDiff ℝ n fun x : E => β€–xβ€– ^ 2 := by convert (reClm : π•œ β†’L[ℝ] ℝ).contDiff.comp ((contDiff_id (E := E)).inner π•œ (contDiff_id (E := E)))
exact (inner_self_eq_norm_sq _).symm
theorem contDiff_norm_sq : ContDiff ℝ n fun x : E => β€–xβ€– ^ 2 := by convert (reClm : π•œ β†’L[ℝ] ℝ).contDiff.comp ((contDiff_id (E := E)).inner π•œ (contDiff_id (E := E)))
Mathlib.Analysis.InnerProductSpace.Calculus.153_0.6FECEGgqdb67QLM
theorem contDiff_norm_sq : ContDiff ℝ n fun x : E => β€–xβ€– ^ 2
Mathlib_Analysis_InnerProductSpace_Calculus
π•œ : Type u_1 E : Type u_2 F : Type u_3 inst✝⁷ : IsROrC π•œ inst✝⁢ : NormedAddCommGroup E inst✝⁡ : InnerProductSpace π•œ E inst✝⁴ : NormedAddCommGroup F inst✝³ : InnerProductSpace ℝ F inst✝² : NormedSpace ℝ E G : Type u_4 inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace ℝ G f g : G β†’ E f' g' : G β†’L[ℝ] E s : Set G x✝ : G n : β„•βˆž x : E hx : x β‰  0 ⊒ ContDiffAt ℝ n Norm.norm x
/- Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ import Mathlib.Analysis.InnerProductSpace.PiL2 import Mathlib.Analysis.SpecialFunctions.Sqrt import Mathlib.Analysis.NormedSpace.HomeomorphBall #align_import analysis.inner_product_space.calculus from "leanprover-community/mathlib"@"f9dd3204df14a0749cd456fac1e6849dfe7d2b88" /-! # Calculus in inner product spaces In this file we prove that the inner product and square of the norm in an inner space are infinitely `ℝ`-smooth. In order to state these results, we need a `NormedSpace ℝ E` instance. Though we can deduce this structure from `InnerProductSpace π•œ E`, this instance may be not definitionally equal to some other β€œnatural” instance. So, we assume `[NormedSpace ℝ E]`. We also prove that functions to a `EuclideanSpace` are (higher) differentiable if and only if their components are. This follows from the corresponding fact for finite product of normed spaces, and from the equivalence of norms in finite dimensions. ## TODO The last part of the file should be generalized to `PiLp`. -/ noncomputable section open IsROrC Real Filter open scoped BigOperators Classical Topology section DerivInner variable {π•œ E F : Type*} [IsROrC π•œ] variable [NormedAddCommGroup E] [InnerProductSpace π•œ E] variable [NormedAddCommGroup F] [InnerProductSpace ℝ F] local notation "βŸͺ" x ", " y "⟫" => @inner π•œ _ _ x y variable (π•œ) [NormedSpace ℝ E] /-- Derivative of the inner product. -/ def fderivInnerClm (p : E Γ— E) : E Γ— E β†’L[ℝ] π•œ := isBoundedBilinearMap_inner.deriv p #align fderiv_inner_clm fderivInnerClm @[simp] theorem fderivInnerClm_apply (p x : E Γ— E) : fderivInnerClm π•œ p x = βŸͺp.1, x.2⟫ + βŸͺx.1, p.2⟫ := rfl #align fderiv_inner_clm_apply fderivInnerClm_apply variable {π•œ} -- porting note: Lean 3 magically switches back to `{π•œ}` here theorem contDiff_inner {n} : ContDiff ℝ n fun p : E Γ— E => βŸͺp.1, p.2⟫ := isBoundedBilinearMap_inner.contDiff #align cont_diff_inner contDiff_inner theorem contDiffAt_inner {p : E Γ— E} {n} : ContDiffAt ℝ n (fun p : E Γ— E => βŸͺp.1, p.2⟫) p := ContDiff.contDiffAt contDiff_inner #align cont_diff_at_inner contDiffAt_inner theorem differentiable_inner : Differentiable ℝ fun p : E Γ— E => βŸͺp.1, p.2⟫ := isBoundedBilinearMap_inner.differentiableAt #align differentiable_inner differentiable_inner variable (π•œ) variable {G : Type*} [NormedAddCommGroup G] [NormedSpace ℝ G] {f g : G β†’ E} {f' g' : G β†’L[ℝ] E} {s : Set G} {x : G} {n : β„•βˆž} theorem ContDiffWithinAt.inner (hf : ContDiffWithinAt ℝ n f s x) (hg : ContDiffWithinAt ℝ n g s x) : ContDiffWithinAt ℝ n (fun x => βŸͺf x, g x⟫) s x := contDiffAt_inner.comp_contDiffWithinAt x (hf.prod hg) #align cont_diff_within_at.inner ContDiffWithinAt.inner nonrec theorem ContDiffAt.inner (hf : ContDiffAt ℝ n f x) (hg : ContDiffAt ℝ n g x) : ContDiffAt ℝ n (fun x => βŸͺf x, g x⟫) x := hf.inner π•œ hg #align cont_diff_at.inner ContDiffAt.inner theorem ContDiffOn.inner (hf : ContDiffOn ℝ n f s) (hg : ContDiffOn ℝ n g s) : ContDiffOn ℝ n (fun x => βŸͺf x, g x⟫) s := fun x hx => (hf x hx).inner π•œ (hg x hx) #align cont_diff_on.inner ContDiffOn.inner theorem ContDiff.inner (hf : ContDiff ℝ n f) (hg : ContDiff ℝ n g) : ContDiff ℝ n fun x => βŸͺf x, g x⟫ := contDiff_inner.comp (hf.prod hg) #align cont_diff.inner ContDiff.inner theorem HasFDerivWithinAt.inner (hf : HasFDerivWithinAt f f' s x) (hg : HasFDerivWithinAt g g' s x) : HasFDerivWithinAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') s x := (isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp_hasFDerivWithinAt x (hf.prod hg) #align has_fderiv_within_at.inner HasFDerivWithinAt.inner theorem HasStrictFDerivAt.inner (hf : HasStrictFDerivAt f f' x) (hg : HasStrictFDerivAt g g' x) : HasStrictFDerivAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') x := (isBoundedBilinearMap_inner.hasStrictFDerivAt (f x, g x)).comp x (hf.prod hg) #align has_strict_fderiv_at.inner HasStrictFDerivAt.inner theorem HasFDerivAt.inner (hf : HasFDerivAt f f' x) (hg : HasFDerivAt g g' x) : HasFDerivAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') x := (isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp x (hf.prod hg) #align has_fderiv_at.inner HasFDerivAt.inner theorem HasDerivWithinAt.inner {f g : ℝ β†’ E} {f' g' : E} {s : Set ℝ} {x : ℝ} (hf : HasDerivWithinAt f f' s x) (hg : HasDerivWithinAt g g' s x) : HasDerivWithinAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) s x := by simpa using (hf.hasFDerivWithinAt.inner π•œ hg.hasFDerivWithinAt).hasDerivWithinAt #align has_deriv_within_at.inner HasDerivWithinAt.inner theorem HasDerivAt.inner {f g : ℝ β†’ E} {f' g' : E} {x : ℝ} : HasDerivAt f f' x β†’ HasDerivAt g g' x β†’ HasDerivAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) x := by simpa only [← hasDerivWithinAt_univ] using HasDerivWithinAt.inner π•œ #align has_deriv_at.inner HasDerivAt.inner theorem DifferentiableWithinAt.inner (hf : DifferentiableWithinAt ℝ f s x) (hg : DifferentiableWithinAt ℝ g s x) : DifferentiableWithinAt ℝ (fun x => βŸͺf x, g x⟫) s x := ((differentiable_inner _).hasFDerivAt.comp_hasFDerivWithinAt x (hf.prod hg).hasFDerivWithinAt).differentiableWithinAt #align differentiable_within_at.inner DifferentiableWithinAt.inner theorem DifferentiableAt.inner (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) : DifferentiableAt ℝ (fun x => βŸͺf x, g x⟫) x := (differentiable_inner _).comp x (hf.prod hg) #align differentiable_at.inner DifferentiableAt.inner theorem DifferentiableOn.inner (hf : DifferentiableOn ℝ f s) (hg : DifferentiableOn ℝ g s) : DifferentiableOn ℝ (fun x => βŸͺf x, g x⟫) s := fun x hx => (hf x hx).inner π•œ (hg x hx) #align differentiable_on.inner DifferentiableOn.inner theorem Differentiable.inner (hf : Differentiable ℝ f) (hg : Differentiable ℝ g) : Differentiable ℝ fun x => βŸͺf x, g x⟫ := fun x => (hf x).inner π•œ (hg x) #align differentiable.inner Differentiable.inner theorem fderiv_inner_apply (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) (y : G) : fderiv ℝ (fun t => βŸͺf t, g t⟫) x y = βŸͺf x, fderiv ℝ g x y⟫ + βŸͺfderiv ℝ f x y, g x⟫ := by rw [(hf.hasFDerivAt.inner π•œ hg.hasFDerivAt).fderiv]; rfl #align fderiv_inner_apply fderiv_inner_apply theorem deriv_inner_apply {f g : ℝ β†’ E} {x : ℝ} (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) : deriv (fun t => βŸͺf t, g t⟫) x = βŸͺf x, deriv g x⟫ + βŸͺderiv f x, g x⟫ := (hf.hasDerivAt.inner π•œ hg.hasDerivAt).deriv #align deriv_inner_apply deriv_inner_apply theorem contDiff_norm_sq : ContDiff ℝ n fun x : E => β€–xβ€– ^ 2 := by convert (reClm : π•œ β†’L[ℝ] ℝ).contDiff.comp ((contDiff_id (E := E)).inner π•œ (contDiff_id (E := E))) exact (inner_self_eq_norm_sq _).symm #align cont_diff_norm_sq contDiff_norm_sq theorem ContDiff.norm_sq (hf : ContDiff ℝ n f) : ContDiff ℝ n fun x => β€–f xβ€– ^ 2 := (contDiff_norm_sq π•œ).comp hf #align cont_diff.norm_sq ContDiff.norm_sq theorem ContDiffWithinAt.norm_sq (hf : ContDiffWithinAt ℝ n f s x) : ContDiffWithinAt ℝ n (fun y => β€–f yβ€– ^ 2) s x := (contDiff_norm_sq π•œ).contDiffAt.comp_contDiffWithinAt x hf #align cont_diff_within_at.norm_sq ContDiffWithinAt.norm_sq nonrec theorem ContDiffAt.norm_sq (hf : ContDiffAt ℝ n f x) : ContDiffAt ℝ n (β€–f Β·β€– ^ 2) x := hf.norm_sq π•œ #align cont_diff_at.norm_sq ContDiffAt.norm_sq theorem contDiffAt_norm {x : E} (hx : x β‰  0) : ContDiffAt ℝ n norm x := by
have : β€–id xβ€– ^ 2 β‰  0 := pow_ne_zero 2 (norm_pos_iff.2 hx).ne'
theorem contDiffAt_norm {x : E} (hx : x β‰  0) : ContDiffAt ℝ n norm x := by
Mathlib.Analysis.InnerProductSpace.Calculus.171_0.6FECEGgqdb67QLM
theorem contDiffAt_norm {x : E} (hx : x β‰  0) : ContDiffAt ℝ n norm x
Mathlib_Analysis_InnerProductSpace_Calculus
π•œ : Type u_1 E : Type u_2 F : Type u_3 inst✝⁷ : IsROrC π•œ inst✝⁢ : NormedAddCommGroup E inst✝⁡ : InnerProductSpace π•œ E inst✝⁴ : NormedAddCommGroup F inst✝³ : InnerProductSpace ℝ F inst✝² : NormedSpace ℝ E G : Type u_4 inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace ℝ G f g : G β†’ E f' g' : G β†’L[ℝ] E s : Set G x✝ : G n : β„•βˆž x : E hx : x β‰  0 this : β€–id xβ€– ^ 2 β‰  0 ⊒ ContDiffAt ℝ n Norm.norm x
/- Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ import Mathlib.Analysis.InnerProductSpace.PiL2 import Mathlib.Analysis.SpecialFunctions.Sqrt import Mathlib.Analysis.NormedSpace.HomeomorphBall #align_import analysis.inner_product_space.calculus from "leanprover-community/mathlib"@"f9dd3204df14a0749cd456fac1e6849dfe7d2b88" /-! # Calculus in inner product spaces In this file we prove that the inner product and square of the norm in an inner space are infinitely `ℝ`-smooth. In order to state these results, we need a `NormedSpace ℝ E` instance. Though we can deduce this structure from `InnerProductSpace π•œ E`, this instance may be not definitionally equal to some other β€œnatural” instance. So, we assume `[NormedSpace ℝ E]`. We also prove that functions to a `EuclideanSpace` are (higher) differentiable if and only if their components are. This follows from the corresponding fact for finite product of normed spaces, and from the equivalence of norms in finite dimensions. ## TODO The last part of the file should be generalized to `PiLp`. -/ noncomputable section open IsROrC Real Filter open scoped BigOperators Classical Topology section DerivInner variable {π•œ E F : Type*} [IsROrC π•œ] variable [NormedAddCommGroup E] [InnerProductSpace π•œ E] variable [NormedAddCommGroup F] [InnerProductSpace ℝ F] local notation "βŸͺ" x ", " y "⟫" => @inner π•œ _ _ x y variable (π•œ) [NormedSpace ℝ E] /-- Derivative of the inner product. -/ def fderivInnerClm (p : E Γ— E) : E Γ— E β†’L[ℝ] π•œ := isBoundedBilinearMap_inner.deriv p #align fderiv_inner_clm fderivInnerClm @[simp] theorem fderivInnerClm_apply (p x : E Γ— E) : fderivInnerClm π•œ p x = βŸͺp.1, x.2⟫ + βŸͺx.1, p.2⟫ := rfl #align fderiv_inner_clm_apply fderivInnerClm_apply variable {π•œ} -- porting note: Lean 3 magically switches back to `{π•œ}` here theorem contDiff_inner {n} : ContDiff ℝ n fun p : E Γ— E => βŸͺp.1, p.2⟫ := isBoundedBilinearMap_inner.contDiff #align cont_diff_inner contDiff_inner theorem contDiffAt_inner {p : E Γ— E} {n} : ContDiffAt ℝ n (fun p : E Γ— E => βŸͺp.1, p.2⟫) p := ContDiff.contDiffAt contDiff_inner #align cont_diff_at_inner contDiffAt_inner theorem differentiable_inner : Differentiable ℝ fun p : E Γ— E => βŸͺp.1, p.2⟫ := isBoundedBilinearMap_inner.differentiableAt #align differentiable_inner differentiable_inner variable (π•œ) variable {G : Type*} [NormedAddCommGroup G] [NormedSpace ℝ G] {f g : G β†’ E} {f' g' : G β†’L[ℝ] E} {s : Set G} {x : G} {n : β„•βˆž} theorem ContDiffWithinAt.inner (hf : ContDiffWithinAt ℝ n f s x) (hg : ContDiffWithinAt ℝ n g s x) : ContDiffWithinAt ℝ n (fun x => βŸͺf x, g x⟫) s x := contDiffAt_inner.comp_contDiffWithinAt x (hf.prod hg) #align cont_diff_within_at.inner ContDiffWithinAt.inner nonrec theorem ContDiffAt.inner (hf : ContDiffAt ℝ n f x) (hg : ContDiffAt ℝ n g x) : ContDiffAt ℝ n (fun x => βŸͺf x, g x⟫) x := hf.inner π•œ hg #align cont_diff_at.inner ContDiffAt.inner theorem ContDiffOn.inner (hf : ContDiffOn ℝ n f s) (hg : ContDiffOn ℝ n g s) : ContDiffOn ℝ n (fun x => βŸͺf x, g x⟫) s := fun x hx => (hf x hx).inner π•œ (hg x hx) #align cont_diff_on.inner ContDiffOn.inner theorem ContDiff.inner (hf : ContDiff ℝ n f) (hg : ContDiff ℝ n g) : ContDiff ℝ n fun x => βŸͺf x, g x⟫ := contDiff_inner.comp (hf.prod hg) #align cont_diff.inner ContDiff.inner theorem HasFDerivWithinAt.inner (hf : HasFDerivWithinAt f f' s x) (hg : HasFDerivWithinAt g g' s x) : HasFDerivWithinAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') s x := (isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp_hasFDerivWithinAt x (hf.prod hg) #align has_fderiv_within_at.inner HasFDerivWithinAt.inner theorem HasStrictFDerivAt.inner (hf : HasStrictFDerivAt f f' x) (hg : HasStrictFDerivAt g g' x) : HasStrictFDerivAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') x := (isBoundedBilinearMap_inner.hasStrictFDerivAt (f x, g x)).comp x (hf.prod hg) #align has_strict_fderiv_at.inner HasStrictFDerivAt.inner theorem HasFDerivAt.inner (hf : HasFDerivAt f f' x) (hg : HasFDerivAt g g' x) : HasFDerivAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') x := (isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp x (hf.prod hg) #align has_fderiv_at.inner HasFDerivAt.inner theorem HasDerivWithinAt.inner {f g : ℝ β†’ E} {f' g' : E} {s : Set ℝ} {x : ℝ} (hf : HasDerivWithinAt f f' s x) (hg : HasDerivWithinAt g g' s x) : HasDerivWithinAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) s x := by simpa using (hf.hasFDerivWithinAt.inner π•œ hg.hasFDerivWithinAt).hasDerivWithinAt #align has_deriv_within_at.inner HasDerivWithinAt.inner theorem HasDerivAt.inner {f g : ℝ β†’ E} {f' g' : E} {x : ℝ} : HasDerivAt f f' x β†’ HasDerivAt g g' x β†’ HasDerivAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) x := by simpa only [← hasDerivWithinAt_univ] using HasDerivWithinAt.inner π•œ #align has_deriv_at.inner HasDerivAt.inner theorem DifferentiableWithinAt.inner (hf : DifferentiableWithinAt ℝ f s x) (hg : DifferentiableWithinAt ℝ g s x) : DifferentiableWithinAt ℝ (fun x => βŸͺf x, g x⟫) s x := ((differentiable_inner _).hasFDerivAt.comp_hasFDerivWithinAt x (hf.prod hg).hasFDerivWithinAt).differentiableWithinAt #align differentiable_within_at.inner DifferentiableWithinAt.inner theorem DifferentiableAt.inner (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) : DifferentiableAt ℝ (fun x => βŸͺf x, g x⟫) x := (differentiable_inner _).comp x (hf.prod hg) #align differentiable_at.inner DifferentiableAt.inner theorem DifferentiableOn.inner (hf : DifferentiableOn ℝ f s) (hg : DifferentiableOn ℝ g s) : DifferentiableOn ℝ (fun x => βŸͺf x, g x⟫) s := fun x hx => (hf x hx).inner π•œ (hg x hx) #align differentiable_on.inner DifferentiableOn.inner theorem Differentiable.inner (hf : Differentiable ℝ f) (hg : Differentiable ℝ g) : Differentiable ℝ fun x => βŸͺf x, g x⟫ := fun x => (hf x).inner π•œ (hg x) #align differentiable.inner Differentiable.inner theorem fderiv_inner_apply (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) (y : G) : fderiv ℝ (fun t => βŸͺf t, g t⟫) x y = βŸͺf x, fderiv ℝ g x y⟫ + βŸͺfderiv ℝ f x y, g x⟫ := by rw [(hf.hasFDerivAt.inner π•œ hg.hasFDerivAt).fderiv]; rfl #align fderiv_inner_apply fderiv_inner_apply theorem deriv_inner_apply {f g : ℝ β†’ E} {x : ℝ} (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) : deriv (fun t => βŸͺf t, g t⟫) x = βŸͺf x, deriv g x⟫ + βŸͺderiv f x, g x⟫ := (hf.hasDerivAt.inner π•œ hg.hasDerivAt).deriv #align deriv_inner_apply deriv_inner_apply theorem contDiff_norm_sq : ContDiff ℝ n fun x : E => β€–xβ€– ^ 2 := by convert (reClm : π•œ β†’L[ℝ] ℝ).contDiff.comp ((contDiff_id (E := E)).inner π•œ (contDiff_id (E := E))) exact (inner_self_eq_norm_sq _).symm #align cont_diff_norm_sq contDiff_norm_sq theorem ContDiff.norm_sq (hf : ContDiff ℝ n f) : ContDiff ℝ n fun x => β€–f xβ€– ^ 2 := (contDiff_norm_sq π•œ).comp hf #align cont_diff.norm_sq ContDiff.norm_sq theorem ContDiffWithinAt.norm_sq (hf : ContDiffWithinAt ℝ n f s x) : ContDiffWithinAt ℝ n (fun y => β€–f yβ€– ^ 2) s x := (contDiff_norm_sq π•œ).contDiffAt.comp_contDiffWithinAt x hf #align cont_diff_within_at.norm_sq ContDiffWithinAt.norm_sq nonrec theorem ContDiffAt.norm_sq (hf : ContDiffAt ℝ n f x) : ContDiffAt ℝ n (β€–f Β·β€– ^ 2) x := hf.norm_sq π•œ #align cont_diff_at.norm_sq ContDiffAt.norm_sq theorem contDiffAt_norm {x : E} (hx : x β‰  0) : ContDiffAt ℝ n norm x := by have : β€–id xβ€– ^ 2 β‰  0 := pow_ne_zero 2 (norm_pos_iff.2 hx).ne'
simpa only [id, sqrt_sq, norm_nonneg] using (contDiffAt_id.norm_sq π•œ).sqrt this
theorem contDiffAt_norm {x : E} (hx : x β‰  0) : ContDiffAt ℝ n norm x := by have : β€–id xβ€– ^ 2 β‰  0 := pow_ne_zero 2 (norm_pos_iff.2 hx).ne'
Mathlib.Analysis.InnerProductSpace.Calculus.171_0.6FECEGgqdb67QLM
theorem contDiffAt_norm {x : E} (hx : x β‰  0) : ContDiffAt ℝ n norm x
Mathlib_Analysis_InnerProductSpace_Calculus
π•œ : Type u_1 E : Type u_2 F : Type u_3 inst✝⁷ : IsROrC π•œ inst✝⁢ : NormedAddCommGroup E inst✝⁡ : InnerProductSpace π•œ E inst✝⁴ : NormedAddCommGroup F inst✝³ : InnerProductSpace ℝ F inst✝² : NormedSpace ℝ E G : Type u_4 inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace ℝ G f g : G β†’ E f' g' : G β†’L[ℝ] E s : Set G x : G n : β„•βˆž hf : ContDiffAt ℝ n f x hg : ContDiffAt ℝ n g x hne : f x β‰  g x ⊒ ContDiffAt ℝ n (fun y => Dist.dist (f y) (g y)) x
/- Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ import Mathlib.Analysis.InnerProductSpace.PiL2 import Mathlib.Analysis.SpecialFunctions.Sqrt import Mathlib.Analysis.NormedSpace.HomeomorphBall #align_import analysis.inner_product_space.calculus from "leanprover-community/mathlib"@"f9dd3204df14a0749cd456fac1e6849dfe7d2b88" /-! # Calculus in inner product spaces In this file we prove that the inner product and square of the norm in an inner space are infinitely `ℝ`-smooth. In order to state these results, we need a `NormedSpace ℝ E` instance. Though we can deduce this structure from `InnerProductSpace π•œ E`, this instance may be not definitionally equal to some other β€œnatural” instance. So, we assume `[NormedSpace ℝ E]`. We also prove that functions to a `EuclideanSpace` are (higher) differentiable if and only if their components are. This follows from the corresponding fact for finite product of normed spaces, and from the equivalence of norms in finite dimensions. ## TODO The last part of the file should be generalized to `PiLp`. -/ noncomputable section open IsROrC Real Filter open scoped BigOperators Classical Topology section DerivInner variable {π•œ E F : Type*} [IsROrC π•œ] variable [NormedAddCommGroup E] [InnerProductSpace π•œ E] variable [NormedAddCommGroup F] [InnerProductSpace ℝ F] local notation "βŸͺ" x ", " y "⟫" => @inner π•œ _ _ x y variable (π•œ) [NormedSpace ℝ E] /-- Derivative of the inner product. -/ def fderivInnerClm (p : E Γ— E) : E Γ— E β†’L[ℝ] π•œ := isBoundedBilinearMap_inner.deriv p #align fderiv_inner_clm fderivInnerClm @[simp] theorem fderivInnerClm_apply (p x : E Γ— E) : fderivInnerClm π•œ p x = βŸͺp.1, x.2⟫ + βŸͺx.1, p.2⟫ := rfl #align fderiv_inner_clm_apply fderivInnerClm_apply variable {π•œ} -- porting note: Lean 3 magically switches back to `{π•œ}` here theorem contDiff_inner {n} : ContDiff ℝ n fun p : E Γ— E => βŸͺp.1, p.2⟫ := isBoundedBilinearMap_inner.contDiff #align cont_diff_inner contDiff_inner theorem contDiffAt_inner {p : E Γ— E} {n} : ContDiffAt ℝ n (fun p : E Γ— E => βŸͺp.1, p.2⟫) p := ContDiff.contDiffAt contDiff_inner #align cont_diff_at_inner contDiffAt_inner theorem differentiable_inner : Differentiable ℝ fun p : E Γ— E => βŸͺp.1, p.2⟫ := isBoundedBilinearMap_inner.differentiableAt #align differentiable_inner differentiable_inner variable (π•œ) variable {G : Type*} [NormedAddCommGroup G] [NormedSpace ℝ G] {f g : G β†’ E} {f' g' : G β†’L[ℝ] E} {s : Set G} {x : G} {n : β„•βˆž} theorem ContDiffWithinAt.inner (hf : ContDiffWithinAt ℝ n f s x) (hg : ContDiffWithinAt ℝ n g s x) : ContDiffWithinAt ℝ n (fun x => βŸͺf x, g x⟫) s x := contDiffAt_inner.comp_contDiffWithinAt x (hf.prod hg) #align cont_diff_within_at.inner ContDiffWithinAt.inner nonrec theorem ContDiffAt.inner (hf : ContDiffAt ℝ n f x) (hg : ContDiffAt ℝ n g x) : ContDiffAt ℝ n (fun x => βŸͺf x, g x⟫) x := hf.inner π•œ hg #align cont_diff_at.inner ContDiffAt.inner theorem ContDiffOn.inner (hf : ContDiffOn ℝ n f s) (hg : ContDiffOn ℝ n g s) : ContDiffOn ℝ n (fun x => βŸͺf x, g x⟫) s := fun x hx => (hf x hx).inner π•œ (hg x hx) #align cont_diff_on.inner ContDiffOn.inner theorem ContDiff.inner (hf : ContDiff ℝ n f) (hg : ContDiff ℝ n g) : ContDiff ℝ n fun x => βŸͺf x, g x⟫ := contDiff_inner.comp (hf.prod hg) #align cont_diff.inner ContDiff.inner theorem HasFDerivWithinAt.inner (hf : HasFDerivWithinAt f f' s x) (hg : HasFDerivWithinAt g g' s x) : HasFDerivWithinAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') s x := (isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp_hasFDerivWithinAt x (hf.prod hg) #align has_fderiv_within_at.inner HasFDerivWithinAt.inner theorem HasStrictFDerivAt.inner (hf : HasStrictFDerivAt f f' x) (hg : HasStrictFDerivAt g g' x) : HasStrictFDerivAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') x := (isBoundedBilinearMap_inner.hasStrictFDerivAt (f x, g x)).comp x (hf.prod hg) #align has_strict_fderiv_at.inner HasStrictFDerivAt.inner theorem HasFDerivAt.inner (hf : HasFDerivAt f f' x) (hg : HasFDerivAt g g' x) : HasFDerivAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') x := (isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp x (hf.prod hg) #align has_fderiv_at.inner HasFDerivAt.inner theorem HasDerivWithinAt.inner {f g : ℝ β†’ E} {f' g' : E} {s : Set ℝ} {x : ℝ} (hf : HasDerivWithinAt f f' s x) (hg : HasDerivWithinAt g g' s x) : HasDerivWithinAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) s x := by simpa using (hf.hasFDerivWithinAt.inner π•œ hg.hasFDerivWithinAt).hasDerivWithinAt #align has_deriv_within_at.inner HasDerivWithinAt.inner theorem HasDerivAt.inner {f g : ℝ β†’ E} {f' g' : E} {x : ℝ} : HasDerivAt f f' x β†’ HasDerivAt g g' x β†’ HasDerivAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) x := by simpa only [← hasDerivWithinAt_univ] using HasDerivWithinAt.inner π•œ #align has_deriv_at.inner HasDerivAt.inner theorem DifferentiableWithinAt.inner (hf : DifferentiableWithinAt ℝ f s x) (hg : DifferentiableWithinAt ℝ g s x) : DifferentiableWithinAt ℝ (fun x => βŸͺf x, g x⟫) s x := ((differentiable_inner _).hasFDerivAt.comp_hasFDerivWithinAt x (hf.prod hg).hasFDerivWithinAt).differentiableWithinAt #align differentiable_within_at.inner DifferentiableWithinAt.inner theorem DifferentiableAt.inner (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) : DifferentiableAt ℝ (fun x => βŸͺf x, g x⟫) x := (differentiable_inner _).comp x (hf.prod hg) #align differentiable_at.inner DifferentiableAt.inner theorem DifferentiableOn.inner (hf : DifferentiableOn ℝ f s) (hg : DifferentiableOn ℝ g s) : DifferentiableOn ℝ (fun x => βŸͺf x, g x⟫) s := fun x hx => (hf x hx).inner π•œ (hg x hx) #align differentiable_on.inner DifferentiableOn.inner theorem Differentiable.inner (hf : Differentiable ℝ f) (hg : Differentiable ℝ g) : Differentiable ℝ fun x => βŸͺf x, g x⟫ := fun x => (hf x).inner π•œ (hg x) #align differentiable.inner Differentiable.inner theorem fderiv_inner_apply (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) (y : G) : fderiv ℝ (fun t => βŸͺf t, g t⟫) x y = βŸͺf x, fderiv ℝ g x y⟫ + βŸͺfderiv ℝ f x y, g x⟫ := by rw [(hf.hasFDerivAt.inner π•œ hg.hasFDerivAt).fderiv]; rfl #align fderiv_inner_apply fderiv_inner_apply theorem deriv_inner_apply {f g : ℝ β†’ E} {x : ℝ} (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) : deriv (fun t => βŸͺf t, g t⟫) x = βŸͺf x, deriv g x⟫ + βŸͺderiv f x, g x⟫ := (hf.hasDerivAt.inner π•œ hg.hasDerivAt).deriv #align deriv_inner_apply deriv_inner_apply theorem contDiff_norm_sq : ContDiff ℝ n fun x : E => β€–xβ€– ^ 2 := by convert (reClm : π•œ β†’L[ℝ] ℝ).contDiff.comp ((contDiff_id (E := E)).inner π•œ (contDiff_id (E := E))) exact (inner_self_eq_norm_sq _).symm #align cont_diff_norm_sq contDiff_norm_sq theorem ContDiff.norm_sq (hf : ContDiff ℝ n f) : ContDiff ℝ n fun x => β€–f xβ€– ^ 2 := (contDiff_norm_sq π•œ).comp hf #align cont_diff.norm_sq ContDiff.norm_sq theorem ContDiffWithinAt.norm_sq (hf : ContDiffWithinAt ℝ n f s x) : ContDiffWithinAt ℝ n (fun y => β€–f yβ€– ^ 2) s x := (contDiff_norm_sq π•œ).contDiffAt.comp_contDiffWithinAt x hf #align cont_diff_within_at.norm_sq ContDiffWithinAt.norm_sq nonrec theorem ContDiffAt.norm_sq (hf : ContDiffAt ℝ n f x) : ContDiffAt ℝ n (β€–f Β·β€– ^ 2) x := hf.norm_sq π•œ #align cont_diff_at.norm_sq ContDiffAt.norm_sq theorem contDiffAt_norm {x : E} (hx : x β‰  0) : ContDiffAt ℝ n norm x := by have : β€–id xβ€– ^ 2 β‰  0 := pow_ne_zero 2 (norm_pos_iff.2 hx).ne' simpa only [id, sqrt_sq, norm_nonneg] using (contDiffAt_id.norm_sq π•œ).sqrt this #align cont_diff_at_norm contDiffAt_norm theorem ContDiffAt.norm (hf : ContDiffAt ℝ n f x) (h0 : f x β‰  0) : ContDiffAt ℝ n (fun y => β€–f yβ€–) x := (contDiffAt_norm π•œ h0).comp x hf #align cont_diff_at.norm ContDiffAt.norm theorem ContDiffAt.dist (hf : ContDiffAt ℝ n f x) (hg : ContDiffAt ℝ n g x) (hne : f x β‰  g x) : ContDiffAt ℝ n (fun y => dist (f y) (g y)) x := by
simp only [dist_eq_norm]
theorem ContDiffAt.dist (hf : ContDiffAt ℝ n f x) (hg : ContDiffAt ℝ n g x) (hne : f x β‰  g x) : ContDiffAt ℝ n (fun y => dist (f y) (g y)) x := by
Mathlib.Analysis.InnerProductSpace.Calculus.181_0.6FECEGgqdb67QLM
theorem ContDiffAt.dist (hf : ContDiffAt ℝ n f x) (hg : ContDiffAt ℝ n g x) (hne : f x β‰  g x) : ContDiffAt ℝ n (fun y => dist (f y) (g y)) x
Mathlib_Analysis_InnerProductSpace_Calculus
π•œ : Type u_1 E : Type u_2 F : Type u_3 inst✝⁷ : IsROrC π•œ inst✝⁢ : NormedAddCommGroup E inst✝⁡ : InnerProductSpace π•œ E inst✝⁴ : NormedAddCommGroup F inst✝³ : InnerProductSpace ℝ F inst✝² : NormedSpace ℝ E G : Type u_4 inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace ℝ G f g : G β†’ E f' g' : G β†’L[ℝ] E s : Set G x : G n : β„•βˆž hf : ContDiffAt ℝ n f x hg : ContDiffAt ℝ n g x hne : f x β‰  g x ⊒ ContDiffAt ℝ n (fun y => β€–f y - g yβ€–) x
/- Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ import Mathlib.Analysis.InnerProductSpace.PiL2 import Mathlib.Analysis.SpecialFunctions.Sqrt import Mathlib.Analysis.NormedSpace.HomeomorphBall #align_import analysis.inner_product_space.calculus from "leanprover-community/mathlib"@"f9dd3204df14a0749cd456fac1e6849dfe7d2b88" /-! # Calculus in inner product spaces In this file we prove that the inner product and square of the norm in an inner space are infinitely `ℝ`-smooth. In order to state these results, we need a `NormedSpace ℝ E` instance. Though we can deduce this structure from `InnerProductSpace π•œ E`, this instance may be not definitionally equal to some other β€œnatural” instance. So, we assume `[NormedSpace ℝ E]`. We also prove that functions to a `EuclideanSpace` are (higher) differentiable if and only if their components are. This follows from the corresponding fact for finite product of normed spaces, and from the equivalence of norms in finite dimensions. ## TODO The last part of the file should be generalized to `PiLp`. -/ noncomputable section open IsROrC Real Filter open scoped BigOperators Classical Topology section DerivInner variable {π•œ E F : Type*} [IsROrC π•œ] variable [NormedAddCommGroup E] [InnerProductSpace π•œ E] variable [NormedAddCommGroup F] [InnerProductSpace ℝ F] local notation "βŸͺ" x ", " y "⟫" => @inner π•œ _ _ x y variable (π•œ) [NormedSpace ℝ E] /-- Derivative of the inner product. -/ def fderivInnerClm (p : E Γ— E) : E Γ— E β†’L[ℝ] π•œ := isBoundedBilinearMap_inner.deriv p #align fderiv_inner_clm fderivInnerClm @[simp] theorem fderivInnerClm_apply (p x : E Γ— E) : fderivInnerClm π•œ p x = βŸͺp.1, x.2⟫ + βŸͺx.1, p.2⟫ := rfl #align fderiv_inner_clm_apply fderivInnerClm_apply variable {π•œ} -- porting note: Lean 3 magically switches back to `{π•œ}` here theorem contDiff_inner {n} : ContDiff ℝ n fun p : E Γ— E => βŸͺp.1, p.2⟫ := isBoundedBilinearMap_inner.contDiff #align cont_diff_inner contDiff_inner theorem contDiffAt_inner {p : E Γ— E} {n} : ContDiffAt ℝ n (fun p : E Γ— E => βŸͺp.1, p.2⟫) p := ContDiff.contDiffAt contDiff_inner #align cont_diff_at_inner contDiffAt_inner theorem differentiable_inner : Differentiable ℝ fun p : E Γ— E => βŸͺp.1, p.2⟫ := isBoundedBilinearMap_inner.differentiableAt #align differentiable_inner differentiable_inner variable (π•œ) variable {G : Type*} [NormedAddCommGroup G] [NormedSpace ℝ G] {f g : G β†’ E} {f' g' : G β†’L[ℝ] E} {s : Set G} {x : G} {n : β„•βˆž} theorem ContDiffWithinAt.inner (hf : ContDiffWithinAt ℝ n f s x) (hg : ContDiffWithinAt ℝ n g s x) : ContDiffWithinAt ℝ n (fun x => βŸͺf x, g x⟫) s x := contDiffAt_inner.comp_contDiffWithinAt x (hf.prod hg) #align cont_diff_within_at.inner ContDiffWithinAt.inner nonrec theorem ContDiffAt.inner (hf : ContDiffAt ℝ n f x) (hg : ContDiffAt ℝ n g x) : ContDiffAt ℝ n (fun x => βŸͺf x, g x⟫) x := hf.inner π•œ hg #align cont_diff_at.inner ContDiffAt.inner theorem ContDiffOn.inner (hf : ContDiffOn ℝ n f s) (hg : ContDiffOn ℝ n g s) : ContDiffOn ℝ n (fun x => βŸͺf x, g x⟫) s := fun x hx => (hf x hx).inner π•œ (hg x hx) #align cont_diff_on.inner ContDiffOn.inner theorem ContDiff.inner (hf : ContDiff ℝ n f) (hg : ContDiff ℝ n g) : ContDiff ℝ n fun x => βŸͺf x, g x⟫ := contDiff_inner.comp (hf.prod hg) #align cont_diff.inner ContDiff.inner theorem HasFDerivWithinAt.inner (hf : HasFDerivWithinAt f f' s x) (hg : HasFDerivWithinAt g g' s x) : HasFDerivWithinAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') s x := (isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp_hasFDerivWithinAt x (hf.prod hg) #align has_fderiv_within_at.inner HasFDerivWithinAt.inner theorem HasStrictFDerivAt.inner (hf : HasStrictFDerivAt f f' x) (hg : HasStrictFDerivAt g g' x) : HasStrictFDerivAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') x := (isBoundedBilinearMap_inner.hasStrictFDerivAt (f x, g x)).comp x (hf.prod hg) #align has_strict_fderiv_at.inner HasStrictFDerivAt.inner theorem HasFDerivAt.inner (hf : HasFDerivAt f f' x) (hg : HasFDerivAt g g' x) : HasFDerivAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') x := (isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp x (hf.prod hg) #align has_fderiv_at.inner HasFDerivAt.inner theorem HasDerivWithinAt.inner {f g : ℝ β†’ E} {f' g' : E} {s : Set ℝ} {x : ℝ} (hf : HasDerivWithinAt f f' s x) (hg : HasDerivWithinAt g g' s x) : HasDerivWithinAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) s x := by simpa using (hf.hasFDerivWithinAt.inner π•œ hg.hasFDerivWithinAt).hasDerivWithinAt #align has_deriv_within_at.inner HasDerivWithinAt.inner theorem HasDerivAt.inner {f g : ℝ β†’ E} {f' g' : E} {x : ℝ} : HasDerivAt f f' x β†’ HasDerivAt g g' x β†’ HasDerivAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) x := by simpa only [← hasDerivWithinAt_univ] using HasDerivWithinAt.inner π•œ #align has_deriv_at.inner HasDerivAt.inner theorem DifferentiableWithinAt.inner (hf : DifferentiableWithinAt ℝ f s x) (hg : DifferentiableWithinAt ℝ g s x) : DifferentiableWithinAt ℝ (fun x => βŸͺf x, g x⟫) s x := ((differentiable_inner _).hasFDerivAt.comp_hasFDerivWithinAt x (hf.prod hg).hasFDerivWithinAt).differentiableWithinAt #align differentiable_within_at.inner DifferentiableWithinAt.inner theorem DifferentiableAt.inner (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) : DifferentiableAt ℝ (fun x => βŸͺf x, g x⟫) x := (differentiable_inner _).comp x (hf.prod hg) #align differentiable_at.inner DifferentiableAt.inner theorem DifferentiableOn.inner (hf : DifferentiableOn ℝ f s) (hg : DifferentiableOn ℝ g s) : DifferentiableOn ℝ (fun x => βŸͺf x, g x⟫) s := fun x hx => (hf x hx).inner π•œ (hg x hx) #align differentiable_on.inner DifferentiableOn.inner theorem Differentiable.inner (hf : Differentiable ℝ f) (hg : Differentiable ℝ g) : Differentiable ℝ fun x => βŸͺf x, g x⟫ := fun x => (hf x).inner π•œ (hg x) #align differentiable.inner Differentiable.inner theorem fderiv_inner_apply (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) (y : G) : fderiv ℝ (fun t => βŸͺf t, g t⟫) x y = βŸͺf x, fderiv ℝ g x y⟫ + βŸͺfderiv ℝ f x y, g x⟫ := by rw [(hf.hasFDerivAt.inner π•œ hg.hasFDerivAt).fderiv]; rfl #align fderiv_inner_apply fderiv_inner_apply theorem deriv_inner_apply {f g : ℝ β†’ E} {x : ℝ} (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) : deriv (fun t => βŸͺf t, g t⟫) x = βŸͺf x, deriv g x⟫ + βŸͺderiv f x, g x⟫ := (hf.hasDerivAt.inner π•œ hg.hasDerivAt).deriv #align deriv_inner_apply deriv_inner_apply theorem contDiff_norm_sq : ContDiff ℝ n fun x : E => β€–xβ€– ^ 2 := by convert (reClm : π•œ β†’L[ℝ] ℝ).contDiff.comp ((contDiff_id (E := E)).inner π•œ (contDiff_id (E := E))) exact (inner_self_eq_norm_sq _).symm #align cont_diff_norm_sq contDiff_norm_sq theorem ContDiff.norm_sq (hf : ContDiff ℝ n f) : ContDiff ℝ n fun x => β€–f xβ€– ^ 2 := (contDiff_norm_sq π•œ).comp hf #align cont_diff.norm_sq ContDiff.norm_sq theorem ContDiffWithinAt.norm_sq (hf : ContDiffWithinAt ℝ n f s x) : ContDiffWithinAt ℝ n (fun y => β€–f yβ€– ^ 2) s x := (contDiff_norm_sq π•œ).contDiffAt.comp_contDiffWithinAt x hf #align cont_diff_within_at.norm_sq ContDiffWithinAt.norm_sq nonrec theorem ContDiffAt.norm_sq (hf : ContDiffAt ℝ n f x) : ContDiffAt ℝ n (β€–f Β·β€– ^ 2) x := hf.norm_sq π•œ #align cont_diff_at.norm_sq ContDiffAt.norm_sq theorem contDiffAt_norm {x : E} (hx : x β‰  0) : ContDiffAt ℝ n norm x := by have : β€–id xβ€– ^ 2 β‰  0 := pow_ne_zero 2 (norm_pos_iff.2 hx).ne' simpa only [id, sqrt_sq, norm_nonneg] using (contDiffAt_id.norm_sq π•œ).sqrt this #align cont_diff_at_norm contDiffAt_norm theorem ContDiffAt.norm (hf : ContDiffAt ℝ n f x) (h0 : f x β‰  0) : ContDiffAt ℝ n (fun y => β€–f yβ€–) x := (contDiffAt_norm π•œ h0).comp x hf #align cont_diff_at.norm ContDiffAt.norm theorem ContDiffAt.dist (hf : ContDiffAt ℝ n f x) (hg : ContDiffAt ℝ n g x) (hne : f x β‰  g x) : ContDiffAt ℝ n (fun y => dist (f y) (g y)) x := by simp only [dist_eq_norm]
exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne)
theorem ContDiffAt.dist (hf : ContDiffAt ℝ n f x) (hg : ContDiffAt ℝ n g x) (hne : f x β‰  g x) : ContDiffAt ℝ n (fun y => dist (f y) (g y)) x := by simp only [dist_eq_norm]
Mathlib.Analysis.InnerProductSpace.Calculus.181_0.6FECEGgqdb67QLM
theorem ContDiffAt.dist (hf : ContDiffAt ℝ n f x) (hg : ContDiffAt ℝ n g x) (hne : f x β‰  g x) : ContDiffAt ℝ n (fun y => dist (f y) (g y)) x
Mathlib_Analysis_InnerProductSpace_Calculus
π•œ : Type u_1 E : Type u_2 F : Type u_3 inst✝⁷ : IsROrC π•œ inst✝⁢ : NormedAddCommGroup E inst✝⁡ : InnerProductSpace π•œ E inst✝⁴ : NormedAddCommGroup F inst✝³ : InnerProductSpace ℝ F inst✝² : NormedSpace ℝ E G : Type u_4 inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace ℝ G f g : G β†’ E f' g' : G β†’L[ℝ] E s : Set G x : G n : β„•βˆž hf : ContDiffWithinAt ℝ n f s x hg : ContDiffWithinAt ℝ n g s x hne : f x β‰  g x ⊒ ContDiffWithinAt ℝ n (fun y => Dist.dist (f y) (g y)) s x
/- Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ import Mathlib.Analysis.InnerProductSpace.PiL2 import Mathlib.Analysis.SpecialFunctions.Sqrt import Mathlib.Analysis.NormedSpace.HomeomorphBall #align_import analysis.inner_product_space.calculus from "leanprover-community/mathlib"@"f9dd3204df14a0749cd456fac1e6849dfe7d2b88" /-! # Calculus in inner product spaces In this file we prove that the inner product and square of the norm in an inner space are infinitely `ℝ`-smooth. In order to state these results, we need a `NormedSpace ℝ E` instance. Though we can deduce this structure from `InnerProductSpace π•œ E`, this instance may be not definitionally equal to some other β€œnatural” instance. So, we assume `[NormedSpace ℝ E]`. We also prove that functions to a `EuclideanSpace` are (higher) differentiable if and only if their components are. This follows from the corresponding fact for finite product of normed spaces, and from the equivalence of norms in finite dimensions. ## TODO The last part of the file should be generalized to `PiLp`. -/ noncomputable section open IsROrC Real Filter open scoped BigOperators Classical Topology section DerivInner variable {π•œ E F : Type*} [IsROrC π•œ] variable [NormedAddCommGroup E] [InnerProductSpace π•œ E] variable [NormedAddCommGroup F] [InnerProductSpace ℝ F] local notation "βŸͺ" x ", " y "⟫" => @inner π•œ _ _ x y variable (π•œ) [NormedSpace ℝ E] /-- Derivative of the inner product. -/ def fderivInnerClm (p : E Γ— E) : E Γ— E β†’L[ℝ] π•œ := isBoundedBilinearMap_inner.deriv p #align fderiv_inner_clm fderivInnerClm @[simp] theorem fderivInnerClm_apply (p x : E Γ— E) : fderivInnerClm π•œ p x = βŸͺp.1, x.2⟫ + βŸͺx.1, p.2⟫ := rfl #align fderiv_inner_clm_apply fderivInnerClm_apply variable {π•œ} -- porting note: Lean 3 magically switches back to `{π•œ}` here theorem contDiff_inner {n} : ContDiff ℝ n fun p : E Γ— E => βŸͺp.1, p.2⟫ := isBoundedBilinearMap_inner.contDiff #align cont_diff_inner contDiff_inner theorem contDiffAt_inner {p : E Γ— E} {n} : ContDiffAt ℝ n (fun p : E Γ— E => βŸͺp.1, p.2⟫) p := ContDiff.contDiffAt contDiff_inner #align cont_diff_at_inner contDiffAt_inner theorem differentiable_inner : Differentiable ℝ fun p : E Γ— E => βŸͺp.1, p.2⟫ := isBoundedBilinearMap_inner.differentiableAt #align differentiable_inner differentiable_inner variable (π•œ) variable {G : Type*} [NormedAddCommGroup G] [NormedSpace ℝ G] {f g : G β†’ E} {f' g' : G β†’L[ℝ] E} {s : Set G} {x : G} {n : β„•βˆž} theorem ContDiffWithinAt.inner (hf : ContDiffWithinAt ℝ n f s x) (hg : ContDiffWithinAt ℝ n g s x) : ContDiffWithinAt ℝ n (fun x => βŸͺf x, g x⟫) s x := contDiffAt_inner.comp_contDiffWithinAt x (hf.prod hg) #align cont_diff_within_at.inner ContDiffWithinAt.inner nonrec theorem ContDiffAt.inner (hf : ContDiffAt ℝ n f x) (hg : ContDiffAt ℝ n g x) : ContDiffAt ℝ n (fun x => βŸͺf x, g x⟫) x := hf.inner π•œ hg #align cont_diff_at.inner ContDiffAt.inner theorem ContDiffOn.inner (hf : ContDiffOn ℝ n f s) (hg : ContDiffOn ℝ n g s) : ContDiffOn ℝ n (fun x => βŸͺf x, g x⟫) s := fun x hx => (hf x hx).inner π•œ (hg x hx) #align cont_diff_on.inner ContDiffOn.inner theorem ContDiff.inner (hf : ContDiff ℝ n f) (hg : ContDiff ℝ n g) : ContDiff ℝ n fun x => βŸͺf x, g x⟫ := contDiff_inner.comp (hf.prod hg) #align cont_diff.inner ContDiff.inner theorem HasFDerivWithinAt.inner (hf : HasFDerivWithinAt f f' s x) (hg : HasFDerivWithinAt g g' s x) : HasFDerivWithinAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') s x := (isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp_hasFDerivWithinAt x (hf.prod hg) #align has_fderiv_within_at.inner HasFDerivWithinAt.inner theorem HasStrictFDerivAt.inner (hf : HasStrictFDerivAt f f' x) (hg : HasStrictFDerivAt g g' x) : HasStrictFDerivAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') x := (isBoundedBilinearMap_inner.hasStrictFDerivAt (f x, g x)).comp x (hf.prod hg) #align has_strict_fderiv_at.inner HasStrictFDerivAt.inner theorem HasFDerivAt.inner (hf : HasFDerivAt f f' x) (hg : HasFDerivAt g g' x) : HasFDerivAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') x := (isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp x (hf.prod hg) #align has_fderiv_at.inner HasFDerivAt.inner theorem HasDerivWithinAt.inner {f g : ℝ β†’ E} {f' g' : E} {s : Set ℝ} {x : ℝ} (hf : HasDerivWithinAt f f' s x) (hg : HasDerivWithinAt g g' s x) : HasDerivWithinAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) s x := by simpa using (hf.hasFDerivWithinAt.inner π•œ hg.hasFDerivWithinAt).hasDerivWithinAt #align has_deriv_within_at.inner HasDerivWithinAt.inner theorem HasDerivAt.inner {f g : ℝ β†’ E} {f' g' : E} {x : ℝ} : HasDerivAt f f' x β†’ HasDerivAt g g' x β†’ HasDerivAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) x := by simpa only [← hasDerivWithinAt_univ] using HasDerivWithinAt.inner π•œ #align has_deriv_at.inner HasDerivAt.inner theorem DifferentiableWithinAt.inner (hf : DifferentiableWithinAt ℝ f s x) (hg : DifferentiableWithinAt ℝ g s x) : DifferentiableWithinAt ℝ (fun x => βŸͺf x, g x⟫) s x := ((differentiable_inner _).hasFDerivAt.comp_hasFDerivWithinAt x (hf.prod hg).hasFDerivWithinAt).differentiableWithinAt #align differentiable_within_at.inner DifferentiableWithinAt.inner theorem DifferentiableAt.inner (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) : DifferentiableAt ℝ (fun x => βŸͺf x, g x⟫) x := (differentiable_inner _).comp x (hf.prod hg) #align differentiable_at.inner DifferentiableAt.inner theorem DifferentiableOn.inner (hf : DifferentiableOn ℝ f s) (hg : DifferentiableOn ℝ g s) : DifferentiableOn ℝ (fun x => βŸͺf x, g x⟫) s := fun x hx => (hf x hx).inner π•œ (hg x hx) #align differentiable_on.inner DifferentiableOn.inner theorem Differentiable.inner (hf : Differentiable ℝ f) (hg : Differentiable ℝ g) : Differentiable ℝ fun x => βŸͺf x, g x⟫ := fun x => (hf x).inner π•œ (hg x) #align differentiable.inner Differentiable.inner theorem fderiv_inner_apply (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) (y : G) : fderiv ℝ (fun t => βŸͺf t, g t⟫) x y = βŸͺf x, fderiv ℝ g x y⟫ + βŸͺfderiv ℝ f x y, g x⟫ := by rw [(hf.hasFDerivAt.inner π•œ hg.hasFDerivAt).fderiv]; rfl #align fderiv_inner_apply fderiv_inner_apply theorem deriv_inner_apply {f g : ℝ β†’ E} {x : ℝ} (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) : deriv (fun t => βŸͺf t, g t⟫) x = βŸͺf x, deriv g x⟫ + βŸͺderiv f x, g x⟫ := (hf.hasDerivAt.inner π•œ hg.hasDerivAt).deriv #align deriv_inner_apply deriv_inner_apply theorem contDiff_norm_sq : ContDiff ℝ n fun x : E => β€–xβ€– ^ 2 := by convert (reClm : π•œ β†’L[ℝ] ℝ).contDiff.comp ((contDiff_id (E := E)).inner π•œ (contDiff_id (E := E))) exact (inner_self_eq_norm_sq _).symm #align cont_diff_norm_sq contDiff_norm_sq theorem ContDiff.norm_sq (hf : ContDiff ℝ n f) : ContDiff ℝ n fun x => β€–f xβ€– ^ 2 := (contDiff_norm_sq π•œ).comp hf #align cont_diff.norm_sq ContDiff.norm_sq theorem ContDiffWithinAt.norm_sq (hf : ContDiffWithinAt ℝ n f s x) : ContDiffWithinAt ℝ n (fun y => β€–f yβ€– ^ 2) s x := (contDiff_norm_sq π•œ).contDiffAt.comp_contDiffWithinAt x hf #align cont_diff_within_at.norm_sq ContDiffWithinAt.norm_sq nonrec theorem ContDiffAt.norm_sq (hf : ContDiffAt ℝ n f x) : ContDiffAt ℝ n (β€–f Β·β€– ^ 2) x := hf.norm_sq π•œ #align cont_diff_at.norm_sq ContDiffAt.norm_sq theorem contDiffAt_norm {x : E} (hx : x β‰  0) : ContDiffAt ℝ n norm x := by have : β€–id xβ€– ^ 2 β‰  0 := pow_ne_zero 2 (norm_pos_iff.2 hx).ne' simpa only [id, sqrt_sq, norm_nonneg] using (contDiffAt_id.norm_sq π•œ).sqrt this #align cont_diff_at_norm contDiffAt_norm theorem ContDiffAt.norm (hf : ContDiffAt ℝ n f x) (h0 : f x β‰  0) : ContDiffAt ℝ n (fun y => β€–f yβ€–) x := (contDiffAt_norm π•œ h0).comp x hf #align cont_diff_at.norm ContDiffAt.norm theorem ContDiffAt.dist (hf : ContDiffAt ℝ n f x) (hg : ContDiffAt ℝ n g x) (hne : f x β‰  g x) : ContDiffAt ℝ n (fun y => dist (f y) (g y)) x := by simp only [dist_eq_norm] exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align cont_diff_at.dist ContDiffAt.dist theorem ContDiffWithinAt.norm (hf : ContDiffWithinAt ℝ n f s x) (h0 : f x β‰  0) : ContDiffWithinAt ℝ n (fun y => β€–f yβ€–) s x := (contDiffAt_norm π•œ h0).comp_contDiffWithinAt x hf #align cont_diff_within_at.norm ContDiffWithinAt.norm theorem ContDiffWithinAt.dist (hf : ContDiffWithinAt ℝ n f s x) (hg : ContDiffWithinAt ℝ n g s x) (hne : f x β‰  g x) : ContDiffWithinAt ℝ n (fun y => dist (f y) (g y)) s x := by
simp only [dist_eq_norm]
theorem ContDiffWithinAt.dist (hf : ContDiffWithinAt ℝ n f s x) (hg : ContDiffWithinAt ℝ n g s x) (hne : f x β‰  g x) : ContDiffWithinAt ℝ n (fun y => dist (f y) (g y)) s x := by
Mathlib.Analysis.InnerProductSpace.Calculus.192_0.6FECEGgqdb67QLM
theorem ContDiffWithinAt.dist (hf : ContDiffWithinAt ℝ n f s x) (hg : ContDiffWithinAt ℝ n g s x) (hne : f x β‰  g x) : ContDiffWithinAt ℝ n (fun y => dist (f y) (g y)) s x
Mathlib_Analysis_InnerProductSpace_Calculus
π•œ : Type u_1 E : Type u_2 F : Type u_3 inst✝⁷ : IsROrC π•œ inst✝⁢ : NormedAddCommGroup E inst✝⁡ : InnerProductSpace π•œ E inst✝⁴ : NormedAddCommGroup F inst✝³ : InnerProductSpace ℝ F inst✝² : NormedSpace ℝ E G : Type u_4 inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace ℝ G f g : G β†’ E f' g' : G β†’L[ℝ] E s : Set G x : G n : β„•βˆž hf : ContDiffWithinAt ℝ n f s x hg : ContDiffWithinAt ℝ n g s x hne : f x β‰  g x ⊒ ContDiffWithinAt ℝ n (fun y => β€–f y - g yβ€–) s x
/- Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ import Mathlib.Analysis.InnerProductSpace.PiL2 import Mathlib.Analysis.SpecialFunctions.Sqrt import Mathlib.Analysis.NormedSpace.HomeomorphBall #align_import analysis.inner_product_space.calculus from "leanprover-community/mathlib"@"f9dd3204df14a0749cd456fac1e6849dfe7d2b88" /-! # Calculus in inner product spaces In this file we prove that the inner product and square of the norm in an inner space are infinitely `ℝ`-smooth. In order to state these results, we need a `NormedSpace ℝ E` instance. Though we can deduce this structure from `InnerProductSpace π•œ E`, this instance may be not definitionally equal to some other β€œnatural” instance. So, we assume `[NormedSpace ℝ E]`. We also prove that functions to a `EuclideanSpace` are (higher) differentiable if and only if their components are. This follows from the corresponding fact for finite product of normed spaces, and from the equivalence of norms in finite dimensions. ## TODO The last part of the file should be generalized to `PiLp`. -/ noncomputable section open IsROrC Real Filter open scoped BigOperators Classical Topology section DerivInner variable {π•œ E F : Type*} [IsROrC π•œ] variable [NormedAddCommGroup E] [InnerProductSpace π•œ E] variable [NormedAddCommGroup F] [InnerProductSpace ℝ F] local notation "βŸͺ" x ", " y "⟫" => @inner π•œ _ _ x y variable (π•œ) [NormedSpace ℝ E] /-- Derivative of the inner product. -/ def fderivInnerClm (p : E Γ— E) : E Γ— E β†’L[ℝ] π•œ := isBoundedBilinearMap_inner.deriv p #align fderiv_inner_clm fderivInnerClm @[simp] theorem fderivInnerClm_apply (p x : E Γ— E) : fderivInnerClm π•œ p x = βŸͺp.1, x.2⟫ + βŸͺx.1, p.2⟫ := rfl #align fderiv_inner_clm_apply fderivInnerClm_apply variable {π•œ} -- porting note: Lean 3 magically switches back to `{π•œ}` here theorem contDiff_inner {n} : ContDiff ℝ n fun p : E Γ— E => βŸͺp.1, p.2⟫ := isBoundedBilinearMap_inner.contDiff #align cont_diff_inner contDiff_inner theorem contDiffAt_inner {p : E Γ— E} {n} : ContDiffAt ℝ n (fun p : E Γ— E => βŸͺp.1, p.2⟫) p := ContDiff.contDiffAt contDiff_inner #align cont_diff_at_inner contDiffAt_inner theorem differentiable_inner : Differentiable ℝ fun p : E Γ— E => βŸͺp.1, p.2⟫ := isBoundedBilinearMap_inner.differentiableAt #align differentiable_inner differentiable_inner variable (π•œ) variable {G : Type*} [NormedAddCommGroup G] [NormedSpace ℝ G] {f g : G β†’ E} {f' g' : G β†’L[ℝ] E} {s : Set G} {x : G} {n : β„•βˆž} theorem ContDiffWithinAt.inner (hf : ContDiffWithinAt ℝ n f s x) (hg : ContDiffWithinAt ℝ n g s x) : ContDiffWithinAt ℝ n (fun x => βŸͺf x, g x⟫) s x := contDiffAt_inner.comp_contDiffWithinAt x (hf.prod hg) #align cont_diff_within_at.inner ContDiffWithinAt.inner nonrec theorem ContDiffAt.inner (hf : ContDiffAt ℝ n f x) (hg : ContDiffAt ℝ n g x) : ContDiffAt ℝ n (fun x => βŸͺf x, g x⟫) x := hf.inner π•œ hg #align cont_diff_at.inner ContDiffAt.inner theorem ContDiffOn.inner (hf : ContDiffOn ℝ n f s) (hg : ContDiffOn ℝ n g s) : ContDiffOn ℝ n (fun x => βŸͺf x, g x⟫) s := fun x hx => (hf x hx).inner π•œ (hg x hx) #align cont_diff_on.inner ContDiffOn.inner theorem ContDiff.inner (hf : ContDiff ℝ n f) (hg : ContDiff ℝ n g) : ContDiff ℝ n fun x => βŸͺf x, g x⟫ := contDiff_inner.comp (hf.prod hg) #align cont_diff.inner ContDiff.inner theorem HasFDerivWithinAt.inner (hf : HasFDerivWithinAt f f' s x) (hg : HasFDerivWithinAt g g' s x) : HasFDerivWithinAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') s x := (isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp_hasFDerivWithinAt x (hf.prod hg) #align has_fderiv_within_at.inner HasFDerivWithinAt.inner theorem HasStrictFDerivAt.inner (hf : HasStrictFDerivAt f f' x) (hg : HasStrictFDerivAt g g' x) : HasStrictFDerivAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') x := (isBoundedBilinearMap_inner.hasStrictFDerivAt (f x, g x)).comp x (hf.prod hg) #align has_strict_fderiv_at.inner HasStrictFDerivAt.inner theorem HasFDerivAt.inner (hf : HasFDerivAt f f' x) (hg : HasFDerivAt g g' x) : HasFDerivAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') x := (isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp x (hf.prod hg) #align has_fderiv_at.inner HasFDerivAt.inner theorem HasDerivWithinAt.inner {f g : ℝ β†’ E} {f' g' : E} {s : Set ℝ} {x : ℝ} (hf : HasDerivWithinAt f f' s x) (hg : HasDerivWithinAt g g' s x) : HasDerivWithinAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) s x := by simpa using (hf.hasFDerivWithinAt.inner π•œ hg.hasFDerivWithinAt).hasDerivWithinAt #align has_deriv_within_at.inner HasDerivWithinAt.inner theorem HasDerivAt.inner {f g : ℝ β†’ E} {f' g' : E} {x : ℝ} : HasDerivAt f f' x β†’ HasDerivAt g g' x β†’ HasDerivAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) x := by simpa only [← hasDerivWithinAt_univ] using HasDerivWithinAt.inner π•œ #align has_deriv_at.inner HasDerivAt.inner theorem DifferentiableWithinAt.inner (hf : DifferentiableWithinAt ℝ f s x) (hg : DifferentiableWithinAt ℝ g s x) : DifferentiableWithinAt ℝ (fun x => βŸͺf x, g x⟫) s x := ((differentiable_inner _).hasFDerivAt.comp_hasFDerivWithinAt x (hf.prod hg).hasFDerivWithinAt).differentiableWithinAt #align differentiable_within_at.inner DifferentiableWithinAt.inner theorem DifferentiableAt.inner (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) : DifferentiableAt ℝ (fun x => βŸͺf x, g x⟫) x := (differentiable_inner _).comp x (hf.prod hg) #align differentiable_at.inner DifferentiableAt.inner theorem DifferentiableOn.inner (hf : DifferentiableOn ℝ f s) (hg : DifferentiableOn ℝ g s) : DifferentiableOn ℝ (fun x => βŸͺf x, g x⟫) s := fun x hx => (hf x hx).inner π•œ (hg x hx) #align differentiable_on.inner DifferentiableOn.inner theorem Differentiable.inner (hf : Differentiable ℝ f) (hg : Differentiable ℝ g) : Differentiable ℝ fun x => βŸͺf x, g x⟫ := fun x => (hf x).inner π•œ (hg x) #align differentiable.inner Differentiable.inner theorem fderiv_inner_apply (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) (y : G) : fderiv ℝ (fun t => βŸͺf t, g t⟫) x y = βŸͺf x, fderiv ℝ g x y⟫ + βŸͺfderiv ℝ f x y, g x⟫ := by rw [(hf.hasFDerivAt.inner π•œ hg.hasFDerivAt).fderiv]; rfl #align fderiv_inner_apply fderiv_inner_apply theorem deriv_inner_apply {f g : ℝ β†’ E} {x : ℝ} (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) : deriv (fun t => βŸͺf t, g t⟫) x = βŸͺf x, deriv g x⟫ + βŸͺderiv f x, g x⟫ := (hf.hasDerivAt.inner π•œ hg.hasDerivAt).deriv #align deriv_inner_apply deriv_inner_apply theorem contDiff_norm_sq : ContDiff ℝ n fun x : E => β€–xβ€– ^ 2 := by convert (reClm : π•œ β†’L[ℝ] ℝ).contDiff.comp ((contDiff_id (E := E)).inner π•œ (contDiff_id (E := E))) exact (inner_self_eq_norm_sq _).symm #align cont_diff_norm_sq contDiff_norm_sq theorem ContDiff.norm_sq (hf : ContDiff ℝ n f) : ContDiff ℝ n fun x => β€–f xβ€– ^ 2 := (contDiff_norm_sq π•œ).comp hf #align cont_diff.norm_sq ContDiff.norm_sq theorem ContDiffWithinAt.norm_sq (hf : ContDiffWithinAt ℝ n f s x) : ContDiffWithinAt ℝ n (fun y => β€–f yβ€– ^ 2) s x := (contDiff_norm_sq π•œ).contDiffAt.comp_contDiffWithinAt x hf #align cont_diff_within_at.norm_sq ContDiffWithinAt.norm_sq nonrec theorem ContDiffAt.norm_sq (hf : ContDiffAt ℝ n f x) : ContDiffAt ℝ n (β€–f Β·β€– ^ 2) x := hf.norm_sq π•œ #align cont_diff_at.norm_sq ContDiffAt.norm_sq theorem contDiffAt_norm {x : E} (hx : x β‰  0) : ContDiffAt ℝ n norm x := by have : β€–id xβ€– ^ 2 β‰  0 := pow_ne_zero 2 (norm_pos_iff.2 hx).ne' simpa only [id, sqrt_sq, norm_nonneg] using (contDiffAt_id.norm_sq π•œ).sqrt this #align cont_diff_at_norm contDiffAt_norm theorem ContDiffAt.norm (hf : ContDiffAt ℝ n f x) (h0 : f x β‰  0) : ContDiffAt ℝ n (fun y => β€–f yβ€–) x := (contDiffAt_norm π•œ h0).comp x hf #align cont_diff_at.norm ContDiffAt.norm theorem ContDiffAt.dist (hf : ContDiffAt ℝ n f x) (hg : ContDiffAt ℝ n g x) (hne : f x β‰  g x) : ContDiffAt ℝ n (fun y => dist (f y) (g y)) x := by simp only [dist_eq_norm] exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align cont_diff_at.dist ContDiffAt.dist theorem ContDiffWithinAt.norm (hf : ContDiffWithinAt ℝ n f s x) (h0 : f x β‰  0) : ContDiffWithinAt ℝ n (fun y => β€–f yβ€–) s x := (contDiffAt_norm π•œ h0).comp_contDiffWithinAt x hf #align cont_diff_within_at.norm ContDiffWithinAt.norm theorem ContDiffWithinAt.dist (hf : ContDiffWithinAt ℝ n f s x) (hg : ContDiffWithinAt ℝ n g s x) (hne : f x β‰  g x) : ContDiffWithinAt ℝ n (fun y => dist (f y) (g y)) s x := by simp only [dist_eq_norm];
exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne)
theorem ContDiffWithinAt.dist (hf : ContDiffWithinAt ℝ n f s x) (hg : ContDiffWithinAt ℝ n g s x) (hne : f x β‰  g x) : ContDiffWithinAt ℝ n (fun y => dist (f y) (g y)) s x := by simp only [dist_eq_norm];
Mathlib.Analysis.InnerProductSpace.Calculus.192_0.6FECEGgqdb67QLM
theorem ContDiffWithinAt.dist (hf : ContDiffWithinAt ℝ n f s x) (hg : ContDiffWithinAt ℝ n g s x) (hne : f x β‰  g x) : ContDiffWithinAt ℝ n (fun y => dist (f y) (g y)) s x
Mathlib_Analysis_InnerProductSpace_Calculus
π•œ : Type u_1 E : Type u_2 F : Type u_3 inst✝⁷ : IsROrC π•œ inst✝⁢ : NormedAddCommGroup E inst✝⁡ : InnerProductSpace π•œ E inst✝⁴ : NormedAddCommGroup F inst✝³ : InnerProductSpace ℝ F inst✝² : NormedSpace ℝ E G : Type u_4 inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace ℝ G f g : G β†’ E f' g' : G β†’L[ℝ] E s : Set G x✝ : G n : β„•βˆž x : F ⊒ HasStrictFDerivAt (fun x => β€–xβ€– ^ 2) (2 β€’ (innerSL ℝ) x) x
/- Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ import Mathlib.Analysis.InnerProductSpace.PiL2 import Mathlib.Analysis.SpecialFunctions.Sqrt import Mathlib.Analysis.NormedSpace.HomeomorphBall #align_import analysis.inner_product_space.calculus from "leanprover-community/mathlib"@"f9dd3204df14a0749cd456fac1e6849dfe7d2b88" /-! # Calculus in inner product spaces In this file we prove that the inner product and square of the norm in an inner space are infinitely `ℝ`-smooth. In order to state these results, we need a `NormedSpace ℝ E` instance. Though we can deduce this structure from `InnerProductSpace π•œ E`, this instance may be not definitionally equal to some other β€œnatural” instance. So, we assume `[NormedSpace ℝ E]`. We also prove that functions to a `EuclideanSpace` are (higher) differentiable if and only if their components are. This follows from the corresponding fact for finite product of normed spaces, and from the equivalence of norms in finite dimensions. ## TODO The last part of the file should be generalized to `PiLp`. -/ noncomputable section open IsROrC Real Filter open scoped BigOperators Classical Topology section DerivInner variable {π•œ E F : Type*} [IsROrC π•œ] variable [NormedAddCommGroup E] [InnerProductSpace π•œ E] variable [NormedAddCommGroup F] [InnerProductSpace ℝ F] local notation "βŸͺ" x ", " y "⟫" => @inner π•œ _ _ x y variable (π•œ) [NormedSpace ℝ E] /-- Derivative of the inner product. -/ def fderivInnerClm (p : E Γ— E) : E Γ— E β†’L[ℝ] π•œ := isBoundedBilinearMap_inner.deriv p #align fderiv_inner_clm fderivInnerClm @[simp] theorem fderivInnerClm_apply (p x : E Γ— E) : fderivInnerClm π•œ p x = βŸͺp.1, x.2⟫ + βŸͺx.1, p.2⟫ := rfl #align fderiv_inner_clm_apply fderivInnerClm_apply variable {π•œ} -- porting note: Lean 3 magically switches back to `{π•œ}` here theorem contDiff_inner {n} : ContDiff ℝ n fun p : E Γ— E => βŸͺp.1, p.2⟫ := isBoundedBilinearMap_inner.contDiff #align cont_diff_inner contDiff_inner theorem contDiffAt_inner {p : E Γ— E} {n} : ContDiffAt ℝ n (fun p : E Γ— E => βŸͺp.1, p.2⟫) p := ContDiff.contDiffAt contDiff_inner #align cont_diff_at_inner contDiffAt_inner theorem differentiable_inner : Differentiable ℝ fun p : E Γ— E => βŸͺp.1, p.2⟫ := isBoundedBilinearMap_inner.differentiableAt #align differentiable_inner differentiable_inner variable (π•œ) variable {G : Type*} [NormedAddCommGroup G] [NormedSpace ℝ G] {f g : G β†’ E} {f' g' : G β†’L[ℝ] E} {s : Set G} {x : G} {n : β„•βˆž} theorem ContDiffWithinAt.inner (hf : ContDiffWithinAt ℝ n f s x) (hg : ContDiffWithinAt ℝ n g s x) : ContDiffWithinAt ℝ n (fun x => βŸͺf x, g x⟫) s x := contDiffAt_inner.comp_contDiffWithinAt x (hf.prod hg) #align cont_diff_within_at.inner ContDiffWithinAt.inner nonrec theorem ContDiffAt.inner (hf : ContDiffAt ℝ n f x) (hg : ContDiffAt ℝ n g x) : ContDiffAt ℝ n (fun x => βŸͺf x, g x⟫) x := hf.inner π•œ hg #align cont_diff_at.inner ContDiffAt.inner theorem ContDiffOn.inner (hf : ContDiffOn ℝ n f s) (hg : ContDiffOn ℝ n g s) : ContDiffOn ℝ n (fun x => βŸͺf x, g x⟫) s := fun x hx => (hf x hx).inner π•œ (hg x hx) #align cont_diff_on.inner ContDiffOn.inner theorem ContDiff.inner (hf : ContDiff ℝ n f) (hg : ContDiff ℝ n g) : ContDiff ℝ n fun x => βŸͺf x, g x⟫ := contDiff_inner.comp (hf.prod hg) #align cont_diff.inner ContDiff.inner theorem HasFDerivWithinAt.inner (hf : HasFDerivWithinAt f f' s x) (hg : HasFDerivWithinAt g g' s x) : HasFDerivWithinAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') s x := (isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp_hasFDerivWithinAt x (hf.prod hg) #align has_fderiv_within_at.inner HasFDerivWithinAt.inner theorem HasStrictFDerivAt.inner (hf : HasStrictFDerivAt f f' x) (hg : HasStrictFDerivAt g g' x) : HasStrictFDerivAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') x := (isBoundedBilinearMap_inner.hasStrictFDerivAt (f x, g x)).comp x (hf.prod hg) #align has_strict_fderiv_at.inner HasStrictFDerivAt.inner theorem HasFDerivAt.inner (hf : HasFDerivAt f f' x) (hg : HasFDerivAt g g' x) : HasFDerivAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') x := (isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp x (hf.prod hg) #align has_fderiv_at.inner HasFDerivAt.inner theorem HasDerivWithinAt.inner {f g : ℝ β†’ E} {f' g' : E} {s : Set ℝ} {x : ℝ} (hf : HasDerivWithinAt f f' s x) (hg : HasDerivWithinAt g g' s x) : HasDerivWithinAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) s x := by simpa using (hf.hasFDerivWithinAt.inner π•œ hg.hasFDerivWithinAt).hasDerivWithinAt #align has_deriv_within_at.inner HasDerivWithinAt.inner theorem HasDerivAt.inner {f g : ℝ β†’ E} {f' g' : E} {x : ℝ} : HasDerivAt f f' x β†’ HasDerivAt g g' x β†’ HasDerivAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) x := by simpa only [← hasDerivWithinAt_univ] using HasDerivWithinAt.inner π•œ #align has_deriv_at.inner HasDerivAt.inner theorem DifferentiableWithinAt.inner (hf : DifferentiableWithinAt ℝ f s x) (hg : DifferentiableWithinAt ℝ g s x) : DifferentiableWithinAt ℝ (fun x => βŸͺf x, g x⟫) s x := ((differentiable_inner _).hasFDerivAt.comp_hasFDerivWithinAt x (hf.prod hg).hasFDerivWithinAt).differentiableWithinAt #align differentiable_within_at.inner DifferentiableWithinAt.inner theorem DifferentiableAt.inner (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) : DifferentiableAt ℝ (fun x => βŸͺf x, g x⟫) x := (differentiable_inner _).comp x (hf.prod hg) #align differentiable_at.inner DifferentiableAt.inner theorem DifferentiableOn.inner (hf : DifferentiableOn ℝ f s) (hg : DifferentiableOn ℝ g s) : DifferentiableOn ℝ (fun x => βŸͺf x, g x⟫) s := fun x hx => (hf x hx).inner π•œ (hg x hx) #align differentiable_on.inner DifferentiableOn.inner theorem Differentiable.inner (hf : Differentiable ℝ f) (hg : Differentiable ℝ g) : Differentiable ℝ fun x => βŸͺf x, g x⟫ := fun x => (hf x).inner π•œ (hg x) #align differentiable.inner Differentiable.inner theorem fderiv_inner_apply (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) (y : G) : fderiv ℝ (fun t => βŸͺf t, g t⟫) x y = βŸͺf x, fderiv ℝ g x y⟫ + βŸͺfderiv ℝ f x y, g x⟫ := by rw [(hf.hasFDerivAt.inner π•œ hg.hasFDerivAt).fderiv]; rfl #align fderiv_inner_apply fderiv_inner_apply theorem deriv_inner_apply {f g : ℝ β†’ E} {x : ℝ} (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) : deriv (fun t => βŸͺf t, g t⟫) x = βŸͺf x, deriv g x⟫ + βŸͺderiv f x, g x⟫ := (hf.hasDerivAt.inner π•œ hg.hasDerivAt).deriv #align deriv_inner_apply deriv_inner_apply theorem contDiff_norm_sq : ContDiff ℝ n fun x : E => β€–xβ€– ^ 2 := by convert (reClm : π•œ β†’L[ℝ] ℝ).contDiff.comp ((contDiff_id (E := E)).inner π•œ (contDiff_id (E := E))) exact (inner_self_eq_norm_sq _).symm #align cont_diff_norm_sq contDiff_norm_sq theorem ContDiff.norm_sq (hf : ContDiff ℝ n f) : ContDiff ℝ n fun x => β€–f xβ€– ^ 2 := (contDiff_norm_sq π•œ).comp hf #align cont_diff.norm_sq ContDiff.norm_sq theorem ContDiffWithinAt.norm_sq (hf : ContDiffWithinAt ℝ n f s x) : ContDiffWithinAt ℝ n (fun y => β€–f yβ€– ^ 2) s x := (contDiff_norm_sq π•œ).contDiffAt.comp_contDiffWithinAt x hf #align cont_diff_within_at.norm_sq ContDiffWithinAt.norm_sq nonrec theorem ContDiffAt.norm_sq (hf : ContDiffAt ℝ n f x) : ContDiffAt ℝ n (β€–f Β·β€– ^ 2) x := hf.norm_sq π•œ #align cont_diff_at.norm_sq ContDiffAt.norm_sq theorem contDiffAt_norm {x : E} (hx : x β‰  0) : ContDiffAt ℝ n norm x := by have : β€–id xβ€– ^ 2 β‰  0 := pow_ne_zero 2 (norm_pos_iff.2 hx).ne' simpa only [id, sqrt_sq, norm_nonneg] using (contDiffAt_id.norm_sq π•œ).sqrt this #align cont_diff_at_norm contDiffAt_norm theorem ContDiffAt.norm (hf : ContDiffAt ℝ n f x) (h0 : f x β‰  0) : ContDiffAt ℝ n (fun y => β€–f yβ€–) x := (contDiffAt_norm π•œ h0).comp x hf #align cont_diff_at.norm ContDiffAt.norm theorem ContDiffAt.dist (hf : ContDiffAt ℝ n f x) (hg : ContDiffAt ℝ n g x) (hne : f x β‰  g x) : ContDiffAt ℝ n (fun y => dist (f y) (g y)) x := by simp only [dist_eq_norm] exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align cont_diff_at.dist ContDiffAt.dist theorem ContDiffWithinAt.norm (hf : ContDiffWithinAt ℝ n f s x) (h0 : f x β‰  0) : ContDiffWithinAt ℝ n (fun y => β€–f yβ€–) s x := (contDiffAt_norm π•œ h0).comp_contDiffWithinAt x hf #align cont_diff_within_at.norm ContDiffWithinAt.norm theorem ContDiffWithinAt.dist (hf : ContDiffWithinAt ℝ n f s x) (hg : ContDiffWithinAt ℝ n g s x) (hne : f x β‰  g x) : ContDiffWithinAt ℝ n (fun y => dist (f y) (g y)) s x := by simp only [dist_eq_norm]; exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align cont_diff_within_at.dist ContDiffWithinAt.dist theorem ContDiffOn.norm_sq (hf : ContDiffOn ℝ n f s) : ContDiffOn ℝ n (fun y => β€–f yβ€– ^ 2) s := fun x hx => (hf x hx).norm_sq π•œ #align cont_diff_on.norm_sq ContDiffOn.norm_sq theorem ContDiffOn.norm (hf : ContDiffOn ℝ n f s) (h0 : βˆ€ x ∈ s, f x β‰  0) : ContDiffOn ℝ n (fun y => β€–f yβ€–) s := fun x hx => (hf x hx).norm π•œ (h0 x hx) #align cont_diff_on.norm ContDiffOn.norm theorem ContDiffOn.dist (hf : ContDiffOn ℝ n f s) (hg : ContDiffOn ℝ n g s) (hne : βˆ€ x ∈ s, f x β‰  g x) : ContDiffOn ℝ n (fun y => dist (f y) (g y)) s := fun x hx => (hf x hx).dist π•œ (hg x hx) (hne x hx) #align cont_diff_on.dist ContDiffOn.dist theorem ContDiff.norm (hf : ContDiff ℝ n f) (h0 : βˆ€ x, f x β‰  0) : ContDiff ℝ n fun y => β€–f yβ€– := contDiff_iff_contDiffAt.2 fun x => hf.contDiffAt.norm π•œ (h0 x) #align cont_diff.norm ContDiff.norm theorem ContDiff.dist (hf : ContDiff ℝ n f) (hg : ContDiff ℝ n g) (hne : βˆ€ x, f x β‰  g x) : ContDiff ℝ n fun y => dist (f y) (g y) := contDiff_iff_contDiffAt.2 fun x => hf.contDiffAt.dist π•œ hg.contDiffAt (hne x) #align cont_diff.dist ContDiff.dist -- porting note: use `2 β€’` instead of `bit0` theorem hasStrictFDerivAt_norm_sq (x : F) : HasStrictFDerivAt (fun x => β€–xβ€– ^ 2) (2 β€’ (innerSL ℝ x)) x := by
simp only [sq, ← @inner_self_eq_norm_mul_norm ℝ]
theorem hasStrictFDerivAt_norm_sq (x : F) : HasStrictFDerivAt (fun x => β€–xβ€– ^ 2) (2 β€’ (innerSL ℝ x)) x := by
Mathlib.Analysis.InnerProductSpace.Calculus.220_0.6FECEGgqdb67QLM
theorem hasStrictFDerivAt_norm_sq (x : F) : HasStrictFDerivAt (fun x => β€–xβ€– ^ 2) (2 β€’ (innerSL ℝ x)) x
Mathlib_Analysis_InnerProductSpace_Calculus
π•œ : Type u_1 E : Type u_2 F : Type u_3 inst✝⁷ : IsROrC π•œ inst✝⁢ : NormedAddCommGroup E inst✝⁡ : InnerProductSpace π•œ E inst✝⁴ : NormedAddCommGroup F inst✝³ : InnerProductSpace ℝ F inst✝² : NormedSpace ℝ E G : Type u_4 inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace ℝ G f g : G β†’ E f' g' : G β†’L[ℝ] E s : Set G x✝ : G n : β„•βˆž x : F ⊒ HasStrictFDerivAt (fun x => re (inner x x)) (2 β€’ (innerSL ℝ) x) x
/- Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ import Mathlib.Analysis.InnerProductSpace.PiL2 import Mathlib.Analysis.SpecialFunctions.Sqrt import Mathlib.Analysis.NormedSpace.HomeomorphBall #align_import analysis.inner_product_space.calculus from "leanprover-community/mathlib"@"f9dd3204df14a0749cd456fac1e6849dfe7d2b88" /-! # Calculus in inner product spaces In this file we prove that the inner product and square of the norm in an inner space are infinitely `ℝ`-smooth. In order to state these results, we need a `NormedSpace ℝ E` instance. Though we can deduce this structure from `InnerProductSpace π•œ E`, this instance may be not definitionally equal to some other β€œnatural” instance. So, we assume `[NormedSpace ℝ E]`. We also prove that functions to a `EuclideanSpace` are (higher) differentiable if and only if their components are. This follows from the corresponding fact for finite product of normed spaces, and from the equivalence of norms in finite dimensions. ## TODO The last part of the file should be generalized to `PiLp`. -/ noncomputable section open IsROrC Real Filter open scoped BigOperators Classical Topology section DerivInner variable {π•œ E F : Type*} [IsROrC π•œ] variable [NormedAddCommGroup E] [InnerProductSpace π•œ E] variable [NormedAddCommGroup F] [InnerProductSpace ℝ F] local notation "βŸͺ" x ", " y "⟫" => @inner π•œ _ _ x y variable (π•œ) [NormedSpace ℝ E] /-- Derivative of the inner product. -/ def fderivInnerClm (p : E Γ— E) : E Γ— E β†’L[ℝ] π•œ := isBoundedBilinearMap_inner.deriv p #align fderiv_inner_clm fderivInnerClm @[simp] theorem fderivInnerClm_apply (p x : E Γ— E) : fderivInnerClm π•œ p x = βŸͺp.1, x.2⟫ + βŸͺx.1, p.2⟫ := rfl #align fderiv_inner_clm_apply fderivInnerClm_apply variable {π•œ} -- porting note: Lean 3 magically switches back to `{π•œ}` here theorem contDiff_inner {n} : ContDiff ℝ n fun p : E Γ— E => βŸͺp.1, p.2⟫ := isBoundedBilinearMap_inner.contDiff #align cont_diff_inner contDiff_inner theorem contDiffAt_inner {p : E Γ— E} {n} : ContDiffAt ℝ n (fun p : E Γ— E => βŸͺp.1, p.2⟫) p := ContDiff.contDiffAt contDiff_inner #align cont_diff_at_inner contDiffAt_inner theorem differentiable_inner : Differentiable ℝ fun p : E Γ— E => βŸͺp.1, p.2⟫ := isBoundedBilinearMap_inner.differentiableAt #align differentiable_inner differentiable_inner variable (π•œ) variable {G : Type*} [NormedAddCommGroup G] [NormedSpace ℝ G] {f g : G β†’ E} {f' g' : G β†’L[ℝ] E} {s : Set G} {x : G} {n : β„•βˆž} theorem ContDiffWithinAt.inner (hf : ContDiffWithinAt ℝ n f s x) (hg : ContDiffWithinAt ℝ n g s x) : ContDiffWithinAt ℝ n (fun x => βŸͺf x, g x⟫) s x := contDiffAt_inner.comp_contDiffWithinAt x (hf.prod hg) #align cont_diff_within_at.inner ContDiffWithinAt.inner nonrec theorem ContDiffAt.inner (hf : ContDiffAt ℝ n f x) (hg : ContDiffAt ℝ n g x) : ContDiffAt ℝ n (fun x => βŸͺf x, g x⟫) x := hf.inner π•œ hg #align cont_diff_at.inner ContDiffAt.inner theorem ContDiffOn.inner (hf : ContDiffOn ℝ n f s) (hg : ContDiffOn ℝ n g s) : ContDiffOn ℝ n (fun x => βŸͺf x, g x⟫) s := fun x hx => (hf x hx).inner π•œ (hg x hx) #align cont_diff_on.inner ContDiffOn.inner theorem ContDiff.inner (hf : ContDiff ℝ n f) (hg : ContDiff ℝ n g) : ContDiff ℝ n fun x => βŸͺf x, g x⟫ := contDiff_inner.comp (hf.prod hg) #align cont_diff.inner ContDiff.inner theorem HasFDerivWithinAt.inner (hf : HasFDerivWithinAt f f' s x) (hg : HasFDerivWithinAt g g' s x) : HasFDerivWithinAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') s x := (isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp_hasFDerivWithinAt x (hf.prod hg) #align has_fderiv_within_at.inner HasFDerivWithinAt.inner theorem HasStrictFDerivAt.inner (hf : HasStrictFDerivAt f f' x) (hg : HasStrictFDerivAt g g' x) : HasStrictFDerivAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') x := (isBoundedBilinearMap_inner.hasStrictFDerivAt (f x, g x)).comp x (hf.prod hg) #align has_strict_fderiv_at.inner HasStrictFDerivAt.inner theorem HasFDerivAt.inner (hf : HasFDerivAt f f' x) (hg : HasFDerivAt g g' x) : HasFDerivAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') x := (isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp x (hf.prod hg) #align has_fderiv_at.inner HasFDerivAt.inner theorem HasDerivWithinAt.inner {f g : ℝ β†’ E} {f' g' : E} {s : Set ℝ} {x : ℝ} (hf : HasDerivWithinAt f f' s x) (hg : HasDerivWithinAt g g' s x) : HasDerivWithinAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) s x := by simpa using (hf.hasFDerivWithinAt.inner π•œ hg.hasFDerivWithinAt).hasDerivWithinAt #align has_deriv_within_at.inner HasDerivWithinAt.inner theorem HasDerivAt.inner {f g : ℝ β†’ E} {f' g' : E} {x : ℝ} : HasDerivAt f f' x β†’ HasDerivAt g g' x β†’ HasDerivAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) x := by simpa only [← hasDerivWithinAt_univ] using HasDerivWithinAt.inner π•œ #align has_deriv_at.inner HasDerivAt.inner theorem DifferentiableWithinAt.inner (hf : DifferentiableWithinAt ℝ f s x) (hg : DifferentiableWithinAt ℝ g s x) : DifferentiableWithinAt ℝ (fun x => βŸͺf x, g x⟫) s x := ((differentiable_inner _).hasFDerivAt.comp_hasFDerivWithinAt x (hf.prod hg).hasFDerivWithinAt).differentiableWithinAt #align differentiable_within_at.inner DifferentiableWithinAt.inner theorem DifferentiableAt.inner (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) : DifferentiableAt ℝ (fun x => βŸͺf x, g x⟫) x := (differentiable_inner _).comp x (hf.prod hg) #align differentiable_at.inner DifferentiableAt.inner theorem DifferentiableOn.inner (hf : DifferentiableOn ℝ f s) (hg : DifferentiableOn ℝ g s) : DifferentiableOn ℝ (fun x => βŸͺf x, g x⟫) s := fun x hx => (hf x hx).inner π•œ (hg x hx) #align differentiable_on.inner DifferentiableOn.inner theorem Differentiable.inner (hf : Differentiable ℝ f) (hg : Differentiable ℝ g) : Differentiable ℝ fun x => βŸͺf x, g x⟫ := fun x => (hf x).inner π•œ (hg x) #align differentiable.inner Differentiable.inner theorem fderiv_inner_apply (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) (y : G) : fderiv ℝ (fun t => βŸͺf t, g t⟫) x y = βŸͺf x, fderiv ℝ g x y⟫ + βŸͺfderiv ℝ f x y, g x⟫ := by rw [(hf.hasFDerivAt.inner π•œ hg.hasFDerivAt).fderiv]; rfl #align fderiv_inner_apply fderiv_inner_apply theorem deriv_inner_apply {f g : ℝ β†’ E} {x : ℝ} (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) : deriv (fun t => βŸͺf t, g t⟫) x = βŸͺf x, deriv g x⟫ + βŸͺderiv f x, g x⟫ := (hf.hasDerivAt.inner π•œ hg.hasDerivAt).deriv #align deriv_inner_apply deriv_inner_apply theorem contDiff_norm_sq : ContDiff ℝ n fun x : E => β€–xβ€– ^ 2 := by convert (reClm : π•œ β†’L[ℝ] ℝ).contDiff.comp ((contDiff_id (E := E)).inner π•œ (contDiff_id (E := E))) exact (inner_self_eq_norm_sq _).symm #align cont_diff_norm_sq contDiff_norm_sq theorem ContDiff.norm_sq (hf : ContDiff ℝ n f) : ContDiff ℝ n fun x => β€–f xβ€– ^ 2 := (contDiff_norm_sq π•œ).comp hf #align cont_diff.norm_sq ContDiff.norm_sq theorem ContDiffWithinAt.norm_sq (hf : ContDiffWithinAt ℝ n f s x) : ContDiffWithinAt ℝ n (fun y => β€–f yβ€– ^ 2) s x := (contDiff_norm_sq π•œ).contDiffAt.comp_contDiffWithinAt x hf #align cont_diff_within_at.norm_sq ContDiffWithinAt.norm_sq nonrec theorem ContDiffAt.norm_sq (hf : ContDiffAt ℝ n f x) : ContDiffAt ℝ n (β€–f Β·β€– ^ 2) x := hf.norm_sq π•œ #align cont_diff_at.norm_sq ContDiffAt.norm_sq theorem contDiffAt_norm {x : E} (hx : x β‰  0) : ContDiffAt ℝ n norm x := by have : β€–id xβ€– ^ 2 β‰  0 := pow_ne_zero 2 (norm_pos_iff.2 hx).ne' simpa only [id, sqrt_sq, norm_nonneg] using (contDiffAt_id.norm_sq π•œ).sqrt this #align cont_diff_at_norm contDiffAt_norm theorem ContDiffAt.norm (hf : ContDiffAt ℝ n f x) (h0 : f x β‰  0) : ContDiffAt ℝ n (fun y => β€–f yβ€–) x := (contDiffAt_norm π•œ h0).comp x hf #align cont_diff_at.norm ContDiffAt.norm theorem ContDiffAt.dist (hf : ContDiffAt ℝ n f x) (hg : ContDiffAt ℝ n g x) (hne : f x β‰  g x) : ContDiffAt ℝ n (fun y => dist (f y) (g y)) x := by simp only [dist_eq_norm] exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align cont_diff_at.dist ContDiffAt.dist theorem ContDiffWithinAt.norm (hf : ContDiffWithinAt ℝ n f s x) (h0 : f x β‰  0) : ContDiffWithinAt ℝ n (fun y => β€–f yβ€–) s x := (contDiffAt_norm π•œ h0).comp_contDiffWithinAt x hf #align cont_diff_within_at.norm ContDiffWithinAt.norm theorem ContDiffWithinAt.dist (hf : ContDiffWithinAt ℝ n f s x) (hg : ContDiffWithinAt ℝ n g s x) (hne : f x β‰  g x) : ContDiffWithinAt ℝ n (fun y => dist (f y) (g y)) s x := by simp only [dist_eq_norm]; exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align cont_diff_within_at.dist ContDiffWithinAt.dist theorem ContDiffOn.norm_sq (hf : ContDiffOn ℝ n f s) : ContDiffOn ℝ n (fun y => β€–f yβ€– ^ 2) s := fun x hx => (hf x hx).norm_sq π•œ #align cont_diff_on.norm_sq ContDiffOn.norm_sq theorem ContDiffOn.norm (hf : ContDiffOn ℝ n f s) (h0 : βˆ€ x ∈ s, f x β‰  0) : ContDiffOn ℝ n (fun y => β€–f yβ€–) s := fun x hx => (hf x hx).norm π•œ (h0 x hx) #align cont_diff_on.norm ContDiffOn.norm theorem ContDiffOn.dist (hf : ContDiffOn ℝ n f s) (hg : ContDiffOn ℝ n g s) (hne : βˆ€ x ∈ s, f x β‰  g x) : ContDiffOn ℝ n (fun y => dist (f y) (g y)) s := fun x hx => (hf x hx).dist π•œ (hg x hx) (hne x hx) #align cont_diff_on.dist ContDiffOn.dist theorem ContDiff.norm (hf : ContDiff ℝ n f) (h0 : βˆ€ x, f x β‰  0) : ContDiff ℝ n fun y => β€–f yβ€– := contDiff_iff_contDiffAt.2 fun x => hf.contDiffAt.norm π•œ (h0 x) #align cont_diff.norm ContDiff.norm theorem ContDiff.dist (hf : ContDiff ℝ n f) (hg : ContDiff ℝ n g) (hne : βˆ€ x, f x β‰  g x) : ContDiff ℝ n fun y => dist (f y) (g y) := contDiff_iff_contDiffAt.2 fun x => hf.contDiffAt.dist π•œ hg.contDiffAt (hne x) #align cont_diff.dist ContDiff.dist -- porting note: use `2 β€’` instead of `bit0` theorem hasStrictFDerivAt_norm_sq (x : F) : HasStrictFDerivAt (fun x => β€–xβ€– ^ 2) (2 β€’ (innerSL ℝ x)) x := by simp only [sq, ← @inner_self_eq_norm_mul_norm ℝ]
convert (hasStrictFDerivAt_id x).inner ℝ (hasStrictFDerivAt_id x)
theorem hasStrictFDerivAt_norm_sq (x : F) : HasStrictFDerivAt (fun x => β€–xβ€– ^ 2) (2 β€’ (innerSL ℝ x)) x := by simp only [sq, ← @inner_self_eq_norm_mul_norm ℝ]
Mathlib.Analysis.InnerProductSpace.Calculus.220_0.6FECEGgqdb67QLM
theorem hasStrictFDerivAt_norm_sq (x : F) : HasStrictFDerivAt (fun x => β€–xβ€– ^ 2) (2 β€’ (innerSL ℝ x)) x
Mathlib_Analysis_InnerProductSpace_Calculus
case h.e'_10.h.h π•œ : Type u_1 E : Type u_2 F : Type u_3 inst✝⁷ : IsROrC π•œ inst✝⁢ : NormedAddCommGroup E inst✝⁡ : InnerProductSpace π•œ E inst✝⁴ : NormedAddCommGroup F inst✝³ : InnerProductSpace ℝ F inst✝² : NormedSpace ℝ E G : Type u_4 inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace ℝ G f g : G β†’ E f' g' : G β†’L[ℝ] E s : Set G x✝ : G n : β„•βˆž x : F e_7✝ : normedAddCommGroup = NonUnitalNormedRing.toNormedAddCommGroup he✝ : InnerProductSpace.toNormedSpace = NormedAlgebra.toNormedSpace' ⊒ 2 β€’ (innerSL ℝ) x = ContinuousLinearMap.comp (fderivInnerClm ℝ (id x, id x)) (ContinuousLinearMap.prod (ContinuousLinearMap.id ℝ F) (ContinuousLinearMap.id ℝ F))
/- Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ import Mathlib.Analysis.InnerProductSpace.PiL2 import Mathlib.Analysis.SpecialFunctions.Sqrt import Mathlib.Analysis.NormedSpace.HomeomorphBall #align_import analysis.inner_product_space.calculus from "leanprover-community/mathlib"@"f9dd3204df14a0749cd456fac1e6849dfe7d2b88" /-! # Calculus in inner product spaces In this file we prove that the inner product and square of the norm in an inner space are infinitely `ℝ`-smooth. In order to state these results, we need a `NormedSpace ℝ E` instance. Though we can deduce this structure from `InnerProductSpace π•œ E`, this instance may be not definitionally equal to some other β€œnatural” instance. So, we assume `[NormedSpace ℝ E]`. We also prove that functions to a `EuclideanSpace` are (higher) differentiable if and only if their components are. This follows from the corresponding fact for finite product of normed spaces, and from the equivalence of norms in finite dimensions. ## TODO The last part of the file should be generalized to `PiLp`. -/ noncomputable section open IsROrC Real Filter open scoped BigOperators Classical Topology section DerivInner variable {π•œ E F : Type*} [IsROrC π•œ] variable [NormedAddCommGroup E] [InnerProductSpace π•œ E] variable [NormedAddCommGroup F] [InnerProductSpace ℝ F] local notation "βŸͺ" x ", " y "⟫" => @inner π•œ _ _ x y variable (π•œ) [NormedSpace ℝ E] /-- Derivative of the inner product. -/ def fderivInnerClm (p : E Γ— E) : E Γ— E β†’L[ℝ] π•œ := isBoundedBilinearMap_inner.deriv p #align fderiv_inner_clm fderivInnerClm @[simp] theorem fderivInnerClm_apply (p x : E Γ— E) : fderivInnerClm π•œ p x = βŸͺp.1, x.2⟫ + βŸͺx.1, p.2⟫ := rfl #align fderiv_inner_clm_apply fderivInnerClm_apply variable {π•œ} -- porting note: Lean 3 magically switches back to `{π•œ}` here theorem contDiff_inner {n} : ContDiff ℝ n fun p : E Γ— E => βŸͺp.1, p.2⟫ := isBoundedBilinearMap_inner.contDiff #align cont_diff_inner contDiff_inner theorem contDiffAt_inner {p : E Γ— E} {n} : ContDiffAt ℝ n (fun p : E Γ— E => βŸͺp.1, p.2⟫) p := ContDiff.contDiffAt contDiff_inner #align cont_diff_at_inner contDiffAt_inner theorem differentiable_inner : Differentiable ℝ fun p : E Γ— E => βŸͺp.1, p.2⟫ := isBoundedBilinearMap_inner.differentiableAt #align differentiable_inner differentiable_inner variable (π•œ) variable {G : Type*} [NormedAddCommGroup G] [NormedSpace ℝ G] {f g : G β†’ E} {f' g' : G β†’L[ℝ] E} {s : Set G} {x : G} {n : β„•βˆž} theorem ContDiffWithinAt.inner (hf : ContDiffWithinAt ℝ n f s x) (hg : ContDiffWithinAt ℝ n g s x) : ContDiffWithinAt ℝ n (fun x => βŸͺf x, g x⟫) s x := contDiffAt_inner.comp_contDiffWithinAt x (hf.prod hg) #align cont_diff_within_at.inner ContDiffWithinAt.inner nonrec theorem ContDiffAt.inner (hf : ContDiffAt ℝ n f x) (hg : ContDiffAt ℝ n g x) : ContDiffAt ℝ n (fun x => βŸͺf x, g x⟫) x := hf.inner π•œ hg #align cont_diff_at.inner ContDiffAt.inner theorem ContDiffOn.inner (hf : ContDiffOn ℝ n f s) (hg : ContDiffOn ℝ n g s) : ContDiffOn ℝ n (fun x => βŸͺf x, g x⟫) s := fun x hx => (hf x hx).inner π•œ (hg x hx) #align cont_diff_on.inner ContDiffOn.inner theorem ContDiff.inner (hf : ContDiff ℝ n f) (hg : ContDiff ℝ n g) : ContDiff ℝ n fun x => βŸͺf x, g x⟫ := contDiff_inner.comp (hf.prod hg) #align cont_diff.inner ContDiff.inner theorem HasFDerivWithinAt.inner (hf : HasFDerivWithinAt f f' s x) (hg : HasFDerivWithinAt g g' s x) : HasFDerivWithinAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') s x := (isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp_hasFDerivWithinAt x (hf.prod hg) #align has_fderiv_within_at.inner HasFDerivWithinAt.inner theorem HasStrictFDerivAt.inner (hf : HasStrictFDerivAt f f' x) (hg : HasStrictFDerivAt g g' x) : HasStrictFDerivAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') x := (isBoundedBilinearMap_inner.hasStrictFDerivAt (f x, g x)).comp x (hf.prod hg) #align has_strict_fderiv_at.inner HasStrictFDerivAt.inner theorem HasFDerivAt.inner (hf : HasFDerivAt f f' x) (hg : HasFDerivAt g g' x) : HasFDerivAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') x := (isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp x (hf.prod hg) #align has_fderiv_at.inner HasFDerivAt.inner theorem HasDerivWithinAt.inner {f g : ℝ β†’ E} {f' g' : E} {s : Set ℝ} {x : ℝ} (hf : HasDerivWithinAt f f' s x) (hg : HasDerivWithinAt g g' s x) : HasDerivWithinAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) s x := by simpa using (hf.hasFDerivWithinAt.inner π•œ hg.hasFDerivWithinAt).hasDerivWithinAt #align has_deriv_within_at.inner HasDerivWithinAt.inner theorem HasDerivAt.inner {f g : ℝ β†’ E} {f' g' : E} {x : ℝ} : HasDerivAt f f' x β†’ HasDerivAt g g' x β†’ HasDerivAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) x := by simpa only [← hasDerivWithinAt_univ] using HasDerivWithinAt.inner π•œ #align has_deriv_at.inner HasDerivAt.inner theorem DifferentiableWithinAt.inner (hf : DifferentiableWithinAt ℝ f s x) (hg : DifferentiableWithinAt ℝ g s x) : DifferentiableWithinAt ℝ (fun x => βŸͺf x, g x⟫) s x := ((differentiable_inner _).hasFDerivAt.comp_hasFDerivWithinAt x (hf.prod hg).hasFDerivWithinAt).differentiableWithinAt #align differentiable_within_at.inner DifferentiableWithinAt.inner theorem DifferentiableAt.inner (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) : DifferentiableAt ℝ (fun x => βŸͺf x, g x⟫) x := (differentiable_inner _).comp x (hf.prod hg) #align differentiable_at.inner DifferentiableAt.inner theorem DifferentiableOn.inner (hf : DifferentiableOn ℝ f s) (hg : DifferentiableOn ℝ g s) : DifferentiableOn ℝ (fun x => βŸͺf x, g x⟫) s := fun x hx => (hf x hx).inner π•œ (hg x hx) #align differentiable_on.inner DifferentiableOn.inner theorem Differentiable.inner (hf : Differentiable ℝ f) (hg : Differentiable ℝ g) : Differentiable ℝ fun x => βŸͺf x, g x⟫ := fun x => (hf x).inner π•œ (hg x) #align differentiable.inner Differentiable.inner theorem fderiv_inner_apply (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) (y : G) : fderiv ℝ (fun t => βŸͺf t, g t⟫) x y = βŸͺf x, fderiv ℝ g x y⟫ + βŸͺfderiv ℝ f x y, g x⟫ := by rw [(hf.hasFDerivAt.inner π•œ hg.hasFDerivAt).fderiv]; rfl #align fderiv_inner_apply fderiv_inner_apply theorem deriv_inner_apply {f g : ℝ β†’ E} {x : ℝ} (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) : deriv (fun t => βŸͺf t, g t⟫) x = βŸͺf x, deriv g x⟫ + βŸͺderiv f x, g x⟫ := (hf.hasDerivAt.inner π•œ hg.hasDerivAt).deriv #align deriv_inner_apply deriv_inner_apply theorem contDiff_norm_sq : ContDiff ℝ n fun x : E => β€–xβ€– ^ 2 := by convert (reClm : π•œ β†’L[ℝ] ℝ).contDiff.comp ((contDiff_id (E := E)).inner π•œ (contDiff_id (E := E))) exact (inner_self_eq_norm_sq _).symm #align cont_diff_norm_sq contDiff_norm_sq theorem ContDiff.norm_sq (hf : ContDiff ℝ n f) : ContDiff ℝ n fun x => β€–f xβ€– ^ 2 := (contDiff_norm_sq π•œ).comp hf #align cont_diff.norm_sq ContDiff.norm_sq theorem ContDiffWithinAt.norm_sq (hf : ContDiffWithinAt ℝ n f s x) : ContDiffWithinAt ℝ n (fun y => β€–f yβ€– ^ 2) s x := (contDiff_norm_sq π•œ).contDiffAt.comp_contDiffWithinAt x hf #align cont_diff_within_at.norm_sq ContDiffWithinAt.norm_sq nonrec theorem ContDiffAt.norm_sq (hf : ContDiffAt ℝ n f x) : ContDiffAt ℝ n (β€–f Β·β€– ^ 2) x := hf.norm_sq π•œ #align cont_diff_at.norm_sq ContDiffAt.norm_sq theorem contDiffAt_norm {x : E} (hx : x β‰  0) : ContDiffAt ℝ n norm x := by have : β€–id xβ€– ^ 2 β‰  0 := pow_ne_zero 2 (norm_pos_iff.2 hx).ne' simpa only [id, sqrt_sq, norm_nonneg] using (contDiffAt_id.norm_sq π•œ).sqrt this #align cont_diff_at_norm contDiffAt_norm theorem ContDiffAt.norm (hf : ContDiffAt ℝ n f x) (h0 : f x β‰  0) : ContDiffAt ℝ n (fun y => β€–f yβ€–) x := (contDiffAt_norm π•œ h0).comp x hf #align cont_diff_at.norm ContDiffAt.norm theorem ContDiffAt.dist (hf : ContDiffAt ℝ n f x) (hg : ContDiffAt ℝ n g x) (hne : f x β‰  g x) : ContDiffAt ℝ n (fun y => dist (f y) (g y)) x := by simp only [dist_eq_norm] exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align cont_diff_at.dist ContDiffAt.dist theorem ContDiffWithinAt.norm (hf : ContDiffWithinAt ℝ n f s x) (h0 : f x β‰  0) : ContDiffWithinAt ℝ n (fun y => β€–f yβ€–) s x := (contDiffAt_norm π•œ h0).comp_contDiffWithinAt x hf #align cont_diff_within_at.norm ContDiffWithinAt.norm theorem ContDiffWithinAt.dist (hf : ContDiffWithinAt ℝ n f s x) (hg : ContDiffWithinAt ℝ n g s x) (hne : f x β‰  g x) : ContDiffWithinAt ℝ n (fun y => dist (f y) (g y)) s x := by simp only [dist_eq_norm]; exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align cont_diff_within_at.dist ContDiffWithinAt.dist theorem ContDiffOn.norm_sq (hf : ContDiffOn ℝ n f s) : ContDiffOn ℝ n (fun y => β€–f yβ€– ^ 2) s := fun x hx => (hf x hx).norm_sq π•œ #align cont_diff_on.norm_sq ContDiffOn.norm_sq theorem ContDiffOn.norm (hf : ContDiffOn ℝ n f s) (h0 : βˆ€ x ∈ s, f x β‰  0) : ContDiffOn ℝ n (fun y => β€–f yβ€–) s := fun x hx => (hf x hx).norm π•œ (h0 x hx) #align cont_diff_on.norm ContDiffOn.norm theorem ContDiffOn.dist (hf : ContDiffOn ℝ n f s) (hg : ContDiffOn ℝ n g s) (hne : βˆ€ x ∈ s, f x β‰  g x) : ContDiffOn ℝ n (fun y => dist (f y) (g y)) s := fun x hx => (hf x hx).dist π•œ (hg x hx) (hne x hx) #align cont_diff_on.dist ContDiffOn.dist theorem ContDiff.norm (hf : ContDiff ℝ n f) (h0 : βˆ€ x, f x β‰  0) : ContDiff ℝ n fun y => β€–f yβ€– := contDiff_iff_contDiffAt.2 fun x => hf.contDiffAt.norm π•œ (h0 x) #align cont_diff.norm ContDiff.norm theorem ContDiff.dist (hf : ContDiff ℝ n f) (hg : ContDiff ℝ n g) (hne : βˆ€ x, f x β‰  g x) : ContDiff ℝ n fun y => dist (f y) (g y) := contDiff_iff_contDiffAt.2 fun x => hf.contDiffAt.dist π•œ hg.contDiffAt (hne x) #align cont_diff.dist ContDiff.dist -- porting note: use `2 β€’` instead of `bit0` theorem hasStrictFDerivAt_norm_sq (x : F) : HasStrictFDerivAt (fun x => β€–xβ€– ^ 2) (2 β€’ (innerSL ℝ x)) x := by simp only [sq, ← @inner_self_eq_norm_mul_norm ℝ] convert (hasStrictFDerivAt_id x).inner ℝ (hasStrictFDerivAt_id x)
ext y
theorem hasStrictFDerivAt_norm_sq (x : F) : HasStrictFDerivAt (fun x => β€–xβ€– ^ 2) (2 β€’ (innerSL ℝ x)) x := by simp only [sq, ← @inner_self_eq_norm_mul_norm ℝ] convert (hasStrictFDerivAt_id x).inner ℝ (hasStrictFDerivAt_id x)
Mathlib.Analysis.InnerProductSpace.Calculus.220_0.6FECEGgqdb67QLM
theorem hasStrictFDerivAt_norm_sq (x : F) : HasStrictFDerivAt (fun x => β€–xβ€– ^ 2) (2 β€’ (innerSL ℝ x)) x
Mathlib_Analysis_InnerProductSpace_Calculus
case h.e'_10.h.h.h π•œ : Type u_1 E : Type u_2 F : Type u_3 inst✝⁷ : IsROrC π•œ inst✝⁢ : NormedAddCommGroup E inst✝⁡ : InnerProductSpace π•œ E inst✝⁴ : NormedAddCommGroup F inst✝³ : InnerProductSpace ℝ F inst✝² : NormedSpace ℝ E G : Type u_4 inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace ℝ G f g : G β†’ E f' g' : G β†’L[ℝ] E s : Set G x✝ : G n : β„•βˆž x : F e_7✝ : normedAddCommGroup = NonUnitalNormedRing.toNormedAddCommGroup he✝ : InnerProductSpace.toNormedSpace = NormedAlgebra.toNormedSpace' y : F ⊒ (2 β€’ (innerSL ℝ) x) y = (ContinuousLinearMap.comp (fderivInnerClm ℝ (id x, id x)) (ContinuousLinearMap.prod (ContinuousLinearMap.id ℝ F) (ContinuousLinearMap.id ℝ F))) y
/- Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ import Mathlib.Analysis.InnerProductSpace.PiL2 import Mathlib.Analysis.SpecialFunctions.Sqrt import Mathlib.Analysis.NormedSpace.HomeomorphBall #align_import analysis.inner_product_space.calculus from "leanprover-community/mathlib"@"f9dd3204df14a0749cd456fac1e6849dfe7d2b88" /-! # Calculus in inner product spaces In this file we prove that the inner product and square of the norm in an inner space are infinitely `ℝ`-smooth. In order to state these results, we need a `NormedSpace ℝ E` instance. Though we can deduce this structure from `InnerProductSpace π•œ E`, this instance may be not definitionally equal to some other β€œnatural” instance. So, we assume `[NormedSpace ℝ E]`. We also prove that functions to a `EuclideanSpace` are (higher) differentiable if and only if their components are. This follows from the corresponding fact for finite product of normed spaces, and from the equivalence of norms in finite dimensions. ## TODO The last part of the file should be generalized to `PiLp`. -/ noncomputable section open IsROrC Real Filter open scoped BigOperators Classical Topology section DerivInner variable {π•œ E F : Type*} [IsROrC π•œ] variable [NormedAddCommGroup E] [InnerProductSpace π•œ E] variable [NormedAddCommGroup F] [InnerProductSpace ℝ F] local notation "βŸͺ" x ", " y "⟫" => @inner π•œ _ _ x y variable (π•œ) [NormedSpace ℝ E] /-- Derivative of the inner product. -/ def fderivInnerClm (p : E Γ— E) : E Γ— E β†’L[ℝ] π•œ := isBoundedBilinearMap_inner.deriv p #align fderiv_inner_clm fderivInnerClm @[simp] theorem fderivInnerClm_apply (p x : E Γ— E) : fderivInnerClm π•œ p x = βŸͺp.1, x.2⟫ + βŸͺx.1, p.2⟫ := rfl #align fderiv_inner_clm_apply fderivInnerClm_apply variable {π•œ} -- porting note: Lean 3 magically switches back to `{π•œ}` here theorem contDiff_inner {n} : ContDiff ℝ n fun p : E Γ— E => βŸͺp.1, p.2⟫ := isBoundedBilinearMap_inner.contDiff #align cont_diff_inner contDiff_inner theorem contDiffAt_inner {p : E Γ— E} {n} : ContDiffAt ℝ n (fun p : E Γ— E => βŸͺp.1, p.2⟫) p := ContDiff.contDiffAt contDiff_inner #align cont_diff_at_inner contDiffAt_inner theorem differentiable_inner : Differentiable ℝ fun p : E Γ— E => βŸͺp.1, p.2⟫ := isBoundedBilinearMap_inner.differentiableAt #align differentiable_inner differentiable_inner variable (π•œ) variable {G : Type*} [NormedAddCommGroup G] [NormedSpace ℝ G] {f g : G β†’ E} {f' g' : G β†’L[ℝ] E} {s : Set G} {x : G} {n : β„•βˆž} theorem ContDiffWithinAt.inner (hf : ContDiffWithinAt ℝ n f s x) (hg : ContDiffWithinAt ℝ n g s x) : ContDiffWithinAt ℝ n (fun x => βŸͺf x, g x⟫) s x := contDiffAt_inner.comp_contDiffWithinAt x (hf.prod hg) #align cont_diff_within_at.inner ContDiffWithinAt.inner nonrec theorem ContDiffAt.inner (hf : ContDiffAt ℝ n f x) (hg : ContDiffAt ℝ n g x) : ContDiffAt ℝ n (fun x => βŸͺf x, g x⟫) x := hf.inner π•œ hg #align cont_diff_at.inner ContDiffAt.inner theorem ContDiffOn.inner (hf : ContDiffOn ℝ n f s) (hg : ContDiffOn ℝ n g s) : ContDiffOn ℝ n (fun x => βŸͺf x, g x⟫) s := fun x hx => (hf x hx).inner π•œ (hg x hx) #align cont_diff_on.inner ContDiffOn.inner theorem ContDiff.inner (hf : ContDiff ℝ n f) (hg : ContDiff ℝ n g) : ContDiff ℝ n fun x => βŸͺf x, g x⟫ := contDiff_inner.comp (hf.prod hg) #align cont_diff.inner ContDiff.inner theorem HasFDerivWithinAt.inner (hf : HasFDerivWithinAt f f' s x) (hg : HasFDerivWithinAt g g' s x) : HasFDerivWithinAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') s x := (isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp_hasFDerivWithinAt x (hf.prod hg) #align has_fderiv_within_at.inner HasFDerivWithinAt.inner theorem HasStrictFDerivAt.inner (hf : HasStrictFDerivAt f f' x) (hg : HasStrictFDerivAt g g' x) : HasStrictFDerivAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') x := (isBoundedBilinearMap_inner.hasStrictFDerivAt (f x, g x)).comp x (hf.prod hg) #align has_strict_fderiv_at.inner HasStrictFDerivAt.inner theorem HasFDerivAt.inner (hf : HasFDerivAt f f' x) (hg : HasFDerivAt g g' x) : HasFDerivAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') x := (isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp x (hf.prod hg) #align has_fderiv_at.inner HasFDerivAt.inner theorem HasDerivWithinAt.inner {f g : ℝ β†’ E} {f' g' : E} {s : Set ℝ} {x : ℝ} (hf : HasDerivWithinAt f f' s x) (hg : HasDerivWithinAt g g' s x) : HasDerivWithinAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) s x := by simpa using (hf.hasFDerivWithinAt.inner π•œ hg.hasFDerivWithinAt).hasDerivWithinAt #align has_deriv_within_at.inner HasDerivWithinAt.inner theorem HasDerivAt.inner {f g : ℝ β†’ E} {f' g' : E} {x : ℝ} : HasDerivAt f f' x β†’ HasDerivAt g g' x β†’ HasDerivAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) x := by simpa only [← hasDerivWithinAt_univ] using HasDerivWithinAt.inner π•œ #align has_deriv_at.inner HasDerivAt.inner theorem DifferentiableWithinAt.inner (hf : DifferentiableWithinAt ℝ f s x) (hg : DifferentiableWithinAt ℝ g s x) : DifferentiableWithinAt ℝ (fun x => βŸͺf x, g x⟫) s x := ((differentiable_inner _).hasFDerivAt.comp_hasFDerivWithinAt x (hf.prod hg).hasFDerivWithinAt).differentiableWithinAt #align differentiable_within_at.inner DifferentiableWithinAt.inner theorem DifferentiableAt.inner (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) : DifferentiableAt ℝ (fun x => βŸͺf x, g x⟫) x := (differentiable_inner _).comp x (hf.prod hg) #align differentiable_at.inner DifferentiableAt.inner theorem DifferentiableOn.inner (hf : DifferentiableOn ℝ f s) (hg : DifferentiableOn ℝ g s) : DifferentiableOn ℝ (fun x => βŸͺf x, g x⟫) s := fun x hx => (hf x hx).inner π•œ (hg x hx) #align differentiable_on.inner DifferentiableOn.inner theorem Differentiable.inner (hf : Differentiable ℝ f) (hg : Differentiable ℝ g) : Differentiable ℝ fun x => βŸͺf x, g x⟫ := fun x => (hf x).inner π•œ (hg x) #align differentiable.inner Differentiable.inner theorem fderiv_inner_apply (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) (y : G) : fderiv ℝ (fun t => βŸͺf t, g t⟫) x y = βŸͺf x, fderiv ℝ g x y⟫ + βŸͺfderiv ℝ f x y, g x⟫ := by rw [(hf.hasFDerivAt.inner π•œ hg.hasFDerivAt).fderiv]; rfl #align fderiv_inner_apply fderiv_inner_apply theorem deriv_inner_apply {f g : ℝ β†’ E} {x : ℝ} (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) : deriv (fun t => βŸͺf t, g t⟫) x = βŸͺf x, deriv g x⟫ + βŸͺderiv f x, g x⟫ := (hf.hasDerivAt.inner π•œ hg.hasDerivAt).deriv #align deriv_inner_apply deriv_inner_apply theorem contDiff_norm_sq : ContDiff ℝ n fun x : E => β€–xβ€– ^ 2 := by convert (reClm : π•œ β†’L[ℝ] ℝ).contDiff.comp ((contDiff_id (E := E)).inner π•œ (contDiff_id (E := E))) exact (inner_self_eq_norm_sq _).symm #align cont_diff_norm_sq contDiff_norm_sq theorem ContDiff.norm_sq (hf : ContDiff ℝ n f) : ContDiff ℝ n fun x => β€–f xβ€– ^ 2 := (contDiff_norm_sq π•œ).comp hf #align cont_diff.norm_sq ContDiff.norm_sq theorem ContDiffWithinAt.norm_sq (hf : ContDiffWithinAt ℝ n f s x) : ContDiffWithinAt ℝ n (fun y => β€–f yβ€– ^ 2) s x := (contDiff_norm_sq π•œ).contDiffAt.comp_contDiffWithinAt x hf #align cont_diff_within_at.norm_sq ContDiffWithinAt.norm_sq nonrec theorem ContDiffAt.norm_sq (hf : ContDiffAt ℝ n f x) : ContDiffAt ℝ n (β€–f Β·β€– ^ 2) x := hf.norm_sq π•œ #align cont_diff_at.norm_sq ContDiffAt.norm_sq theorem contDiffAt_norm {x : E} (hx : x β‰  0) : ContDiffAt ℝ n norm x := by have : β€–id xβ€– ^ 2 β‰  0 := pow_ne_zero 2 (norm_pos_iff.2 hx).ne' simpa only [id, sqrt_sq, norm_nonneg] using (contDiffAt_id.norm_sq π•œ).sqrt this #align cont_diff_at_norm contDiffAt_norm theorem ContDiffAt.norm (hf : ContDiffAt ℝ n f x) (h0 : f x β‰  0) : ContDiffAt ℝ n (fun y => β€–f yβ€–) x := (contDiffAt_norm π•œ h0).comp x hf #align cont_diff_at.norm ContDiffAt.norm theorem ContDiffAt.dist (hf : ContDiffAt ℝ n f x) (hg : ContDiffAt ℝ n g x) (hne : f x β‰  g x) : ContDiffAt ℝ n (fun y => dist (f y) (g y)) x := by simp only [dist_eq_norm] exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align cont_diff_at.dist ContDiffAt.dist theorem ContDiffWithinAt.norm (hf : ContDiffWithinAt ℝ n f s x) (h0 : f x β‰  0) : ContDiffWithinAt ℝ n (fun y => β€–f yβ€–) s x := (contDiffAt_norm π•œ h0).comp_contDiffWithinAt x hf #align cont_diff_within_at.norm ContDiffWithinAt.norm theorem ContDiffWithinAt.dist (hf : ContDiffWithinAt ℝ n f s x) (hg : ContDiffWithinAt ℝ n g s x) (hne : f x β‰  g x) : ContDiffWithinAt ℝ n (fun y => dist (f y) (g y)) s x := by simp only [dist_eq_norm]; exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align cont_diff_within_at.dist ContDiffWithinAt.dist theorem ContDiffOn.norm_sq (hf : ContDiffOn ℝ n f s) : ContDiffOn ℝ n (fun y => β€–f yβ€– ^ 2) s := fun x hx => (hf x hx).norm_sq π•œ #align cont_diff_on.norm_sq ContDiffOn.norm_sq theorem ContDiffOn.norm (hf : ContDiffOn ℝ n f s) (h0 : βˆ€ x ∈ s, f x β‰  0) : ContDiffOn ℝ n (fun y => β€–f yβ€–) s := fun x hx => (hf x hx).norm π•œ (h0 x hx) #align cont_diff_on.norm ContDiffOn.norm theorem ContDiffOn.dist (hf : ContDiffOn ℝ n f s) (hg : ContDiffOn ℝ n g s) (hne : βˆ€ x ∈ s, f x β‰  g x) : ContDiffOn ℝ n (fun y => dist (f y) (g y)) s := fun x hx => (hf x hx).dist π•œ (hg x hx) (hne x hx) #align cont_diff_on.dist ContDiffOn.dist theorem ContDiff.norm (hf : ContDiff ℝ n f) (h0 : βˆ€ x, f x β‰  0) : ContDiff ℝ n fun y => β€–f yβ€– := contDiff_iff_contDiffAt.2 fun x => hf.contDiffAt.norm π•œ (h0 x) #align cont_diff.norm ContDiff.norm theorem ContDiff.dist (hf : ContDiff ℝ n f) (hg : ContDiff ℝ n g) (hne : βˆ€ x, f x β‰  g x) : ContDiff ℝ n fun y => dist (f y) (g y) := contDiff_iff_contDiffAt.2 fun x => hf.contDiffAt.dist π•œ hg.contDiffAt (hne x) #align cont_diff.dist ContDiff.dist -- porting note: use `2 β€’` instead of `bit0` theorem hasStrictFDerivAt_norm_sq (x : F) : HasStrictFDerivAt (fun x => β€–xβ€– ^ 2) (2 β€’ (innerSL ℝ x)) x := by simp only [sq, ← @inner_self_eq_norm_mul_norm ℝ] convert (hasStrictFDerivAt_id x).inner ℝ (hasStrictFDerivAt_id x) ext y
simp [two_smul, real_inner_comm]
theorem hasStrictFDerivAt_norm_sq (x : F) : HasStrictFDerivAt (fun x => β€–xβ€– ^ 2) (2 β€’ (innerSL ℝ x)) x := by simp only [sq, ← @inner_self_eq_norm_mul_norm ℝ] convert (hasStrictFDerivAt_id x).inner ℝ (hasStrictFDerivAt_id x) ext y
Mathlib.Analysis.InnerProductSpace.Calculus.220_0.6FECEGgqdb67QLM
theorem hasStrictFDerivAt_norm_sq (x : F) : HasStrictFDerivAt (fun x => β€–xβ€– ^ 2) (2 β€’ (innerSL ℝ x)) x
Mathlib_Analysis_InnerProductSpace_Calculus
π•œ : Type u_1 E : Type u_2 F : Type u_3 inst✝⁷ : IsROrC π•œ inst✝⁢ : NormedAddCommGroup E inst✝⁡ : InnerProductSpace π•œ E inst✝⁴ : NormedAddCommGroup F inst✝³ : InnerProductSpace ℝ F inst✝² : NormedSpace ℝ E G : Type u_4 inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace ℝ G f✝ g : G β†’ E f'✝ g' : G β†’L[ℝ] E s : Set G x✝ : G n : β„•βˆž f : ℝ β†’ F f' : F x : ℝ hf : HasDerivAt f f' x ⊒ HasDerivAt (fun x => β€–f xβ€– ^ 2) (2 * Inner.inner (f x) f') x
/- Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ import Mathlib.Analysis.InnerProductSpace.PiL2 import Mathlib.Analysis.SpecialFunctions.Sqrt import Mathlib.Analysis.NormedSpace.HomeomorphBall #align_import analysis.inner_product_space.calculus from "leanprover-community/mathlib"@"f9dd3204df14a0749cd456fac1e6849dfe7d2b88" /-! # Calculus in inner product spaces In this file we prove that the inner product and square of the norm in an inner space are infinitely `ℝ`-smooth. In order to state these results, we need a `NormedSpace ℝ E` instance. Though we can deduce this structure from `InnerProductSpace π•œ E`, this instance may be not definitionally equal to some other β€œnatural” instance. So, we assume `[NormedSpace ℝ E]`. We also prove that functions to a `EuclideanSpace` are (higher) differentiable if and only if their components are. This follows from the corresponding fact for finite product of normed spaces, and from the equivalence of norms in finite dimensions. ## TODO The last part of the file should be generalized to `PiLp`. -/ noncomputable section open IsROrC Real Filter open scoped BigOperators Classical Topology section DerivInner variable {π•œ E F : Type*} [IsROrC π•œ] variable [NormedAddCommGroup E] [InnerProductSpace π•œ E] variable [NormedAddCommGroup F] [InnerProductSpace ℝ F] local notation "βŸͺ" x ", " y "⟫" => @inner π•œ _ _ x y variable (π•œ) [NormedSpace ℝ E] /-- Derivative of the inner product. -/ def fderivInnerClm (p : E Γ— E) : E Γ— E β†’L[ℝ] π•œ := isBoundedBilinearMap_inner.deriv p #align fderiv_inner_clm fderivInnerClm @[simp] theorem fderivInnerClm_apply (p x : E Γ— E) : fderivInnerClm π•œ p x = βŸͺp.1, x.2⟫ + βŸͺx.1, p.2⟫ := rfl #align fderiv_inner_clm_apply fderivInnerClm_apply variable {π•œ} -- porting note: Lean 3 magically switches back to `{π•œ}` here theorem contDiff_inner {n} : ContDiff ℝ n fun p : E Γ— E => βŸͺp.1, p.2⟫ := isBoundedBilinearMap_inner.contDiff #align cont_diff_inner contDiff_inner theorem contDiffAt_inner {p : E Γ— E} {n} : ContDiffAt ℝ n (fun p : E Γ— E => βŸͺp.1, p.2⟫) p := ContDiff.contDiffAt contDiff_inner #align cont_diff_at_inner contDiffAt_inner theorem differentiable_inner : Differentiable ℝ fun p : E Γ— E => βŸͺp.1, p.2⟫ := isBoundedBilinearMap_inner.differentiableAt #align differentiable_inner differentiable_inner variable (π•œ) variable {G : Type*} [NormedAddCommGroup G] [NormedSpace ℝ G] {f g : G β†’ E} {f' g' : G β†’L[ℝ] E} {s : Set G} {x : G} {n : β„•βˆž} theorem ContDiffWithinAt.inner (hf : ContDiffWithinAt ℝ n f s x) (hg : ContDiffWithinAt ℝ n g s x) : ContDiffWithinAt ℝ n (fun x => βŸͺf x, g x⟫) s x := contDiffAt_inner.comp_contDiffWithinAt x (hf.prod hg) #align cont_diff_within_at.inner ContDiffWithinAt.inner nonrec theorem ContDiffAt.inner (hf : ContDiffAt ℝ n f x) (hg : ContDiffAt ℝ n g x) : ContDiffAt ℝ n (fun x => βŸͺf x, g x⟫) x := hf.inner π•œ hg #align cont_diff_at.inner ContDiffAt.inner theorem ContDiffOn.inner (hf : ContDiffOn ℝ n f s) (hg : ContDiffOn ℝ n g s) : ContDiffOn ℝ n (fun x => βŸͺf x, g x⟫) s := fun x hx => (hf x hx).inner π•œ (hg x hx) #align cont_diff_on.inner ContDiffOn.inner theorem ContDiff.inner (hf : ContDiff ℝ n f) (hg : ContDiff ℝ n g) : ContDiff ℝ n fun x => βŸͺf x, g x⟫ := contDiff_inner.comp (hf.prod hg) #align cont_diff.inner ContDiff.inner theorem HasFDerivWithinAt.inner (hf : HasFDerivWithinAt f f' s x) (hg : HasFDerivWithinAt g g' s x) : HasFDerivWithinAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') s x := (isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp_hasFDerivWithinAt x (hf.prod hg) #align has_fderiv_within_at.inner HasFDerivWithinAt.inner theorem HasStrictFDerivAt.inner (hf : HasStrictFDerivAt f f' x) (hg : HasStrictFDerivAt g g' x) : HasStrictFDerivAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') x := (isBoundedBilinearMap_inner.hasStrictFDerivAt (f x, g x)).comp x (hf.prod hg) #align has_strict_fderiv_at.inner HasStrictFDerivAt.inner theorem HasFDerivAt.inner (hf : HasFDerivAt f f' x) (hg : HasFDerivAt g g' x) : HasFDerivAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') x := (isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp x (hf.prod hg) #align has_fderiv_at.inner HasFDerivAt.inner theorem HasDerivWithinAt.inner {f g : ℝ β†’ E} {f' g' : E} {s : Set ℝ} {x : ℝ} (hf : HasDerivWithinAt f f' s x) (hg : HasDerivWithinAt g g' s x) : HasDerivWithinAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) s x := by simpa using (hf.hasFDerivWithinAt.inner π•œ hg.hasFDerivWithinAt).hasDerivWithinAt #align has_deriv_within_at.inner HasDerivWithinAt.inner theorem HasDerivAt.inner {f g : ℝ β†’ E} {f' g' : E} {x : ℝ} : HasDerivAt f f' x β†’ HasDerivAt g g' x β†’ HasDerivAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) x := by simpa only [← hasDerivWithinAt_univ] using HasDerivWithinAt.inner π•œ #align has_deriv_at.inner HasDerivAt.inner theorem DifferentiableWithinAt.inner (hf : DifferentiableWithinAt ℝ f s x) (hg : DifferentiableWithinAt ℝ g s x) : DifferentiableWithinAt ℝ (fun x => βŸͺf x, g x⟫) s x := ((differentiable_inner _).hasFDerivAt.comp_hasFDerivWithinAt x (hf.prod hg).hasFDerivWithinAt).differentiableWithinAt #align differentiable_within_at.inner DifferentiableWithinAt.inner theorem DifferentiableAt.inner (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) : DifferentiableAt ℝ (fun x => βŸͺf x, g x⟫) x := (differentiable_inner _).comp x (hf.prod hg) #align differentiable_at.inner DifferentiableAt.inner theorem DifferentiableOn.inner (hf : DifferentiableOn ℝ f s) (hg : DifferentiableOn ℝ g s) : DifferentiableOn ℝ (fun x => βŸͺf x, g x⟫) s := fun x hx => (hf x hx).inner π•œ (hg x hx) #align differentiable_on.inner DifferentiableOn.inner theorem Differentiable.inner (hf : Differentiable ℝ f) (hg : Differentiable ℝ g) : Differentiable ℝ fun x => βŸͺf x, g x⟫ := fun x => (hf x).inner π•œ (hg x) #align differentiable.inner Differentiable.inner theorem fderiv_inner_apply (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) (y : G) : fderiv ℝ (fun t => βŸͺf t, g t⟫) x y = βŸͺf x, fderiv ℝ g x y⟫ + βŸͺfderiv ℝ f x y, g x⟫ := by rw [(hf.hasFDerivAt.inner π•œ hg.hasFDerivAt).fderiv]; rfl #align fderiv_inner_apply fderiv_inner_apply theorem deriv_inner_apply {f g : ℝ β†’ E} {x : ℝ} (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) : deriv (fun t => βŸͺf t, g t⟫) x = βŸͺf x, deriv g x⟫ + βŸͺderiv f x, g x⟫ := (hf.hasDerivAt.inner π•œ hg.hasDerivAt).deriv #align deriv_inner_apply deriv_inner_apply theorem contDiff_norm_sq : ContDiff ℝ n fun x : E => β€–xβ€– ^ 2 := by convert (reClm : π•œ β†’L[ℝ] ℝ).contDiff.comp ((contDiff_id (E := E)).inner π•œ (contDiff_id (E := E))) exact (inner_self_eq_norm_sq _).symm #align cont_diff_norm_sq contDiff_norm_sq theorem ContDiff.norm_sq (hf : ContDiff ℝ n f) : ContDiff ℝ n fun x => β€–f xβ€– ^ 2 := (contDiff_norm_sq π•œ).comp hf #align cont_diff.norm_sq ContDiff.norm_sq theorem ContDiffWithinAt.norm_sq (hf : ContDiffWithinAt ℝ n f s x) : ContDiffWithinAt ℝ n (fun y => β€–f yβ€– ^ 2) s x := (contDiff_norm_sq π•œ).contDiffAt.comp_contDiffWithinAt x hf #align cont_diff_within_at.norm_sq ContDiffWithinAt.norm_sq nonrec theorem ContDiffAt.norm_sq (hf : ContDiffAt ℝ n f x) : ContDiffAt ℝ n (β€–f Β·β€– ^ 2) x := hf.norm_sq π•œ #align cont_diff_at.norm_sq ContDiffAt.norm_sq theorem contDiffAt_norm {x : E} (hx : x β‰  0) : ContDiffAt ℝ n norm x := by have : β€–id xβ€– ^ 2 β‰  0 := pow_ne_zero 2 (norm_pos_iff.2 hx).ne' simpa only [id, sqrt_sq, norm_nonneg] using (contDiffAt_id.norm_sq π•œ).sqrt this #align cont_diff_at_norm contDiffAt_norm theorem ContDiffAt.norm (hf : ContDiffAt ℝ n f x) (h0 : f x β‰  0) : ContDiffAt ℝ n (fun y => β€–f yβ€–) x := (contDiffAt_norm π•œ h0).comp x hf #align cont_diff_at.norm ContDiffAt.norm theorem ContDiffAt.dist (hf : ContDiffAt ℝ n f x) (hg : ContDiffAt ℝ n g x) (hne : f x β‰  g x) : ContDiffAt ℝ n (fun y => dist (f y) (g y)) x := by simp only [dist_eq_norm] exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align cont_diff_at.dist ContDiffAt.dist theorem ContDiffWithinAt.norm (hf : ContDiffWithinAt ℝ n f s x) (h0 : f x β‰  0) : ContDiffWithinAt ℝ n (fun y => β€–f yβ€–) s x := (contDiffAt_norm π•œ h0).comp_contDiffWithinAt x hf #align cont_diff_within_at.norm ContDiffWithinAt.norm theorem ContDiffWithinAt.dist (hf : ContDiffWithinAt ℝ n f s x) (hg : ContDiffWithinAt ℝ n g s x) (hne : f x β‰  g x) : ContDiffWithinAt ℝ n (fun y => dist (f y) (g y)) s x := by simp only [dist_eq_norm]; exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align cont_diff_within_at.dist ContDiffWithinAt.dist theorem ContDiffOn.norm_sq (hf : ContDiffOn ℝ n f s) : ContDiffOn ℝ n (fun y => β€–f yβ€– ^ 2) s := fun x hx => (hf x hx).norm_sq π•œ #align cont_diff_on.norm_sq ContDiffOn.norm_sq theorem ContDiffOn.norm (hf : ContDiffOn ℝ n f s) (h0 : βˆ€ x ∈ s, f x β‰  0) : ContDiffOn ℝ n (fun y => β€–f yβ€–) s := fun x hx => (hf x hx).norm π•œ (h0 x hx) #align cont_diff_on.norm ContDiffOn.norm theorem ContDiffOn.dist (hf : ContDiffOn ℝ n f s) (hg : ContDiffOn ℝ n g s) (hne : βˆ€ x ∈ s, f x β‰  g x) : ContDiffOn ℝ n (fun y => dist (f y) (g y)) s := fun x hx => (hf x hx).dist π•œ (hg x hx) (hne x hx) #align cont_diff_on.dist ContDiffOn.dist theorem ContDiff.norm (hf : ContDiff ℝ n f) (h0 : βˆ€ x, f x β‰  0) : ContDiff ℝ n fun y => β€–f yβ€– := contDiff_iff_contDiffAt.2 fun x => hf.contDiffAt.norm π•œ (h0 x) #align cont_diff.norm ContDiff.norm theorem ContDiff.dist (hf : ContDiff ℝ n f) (hg : ContDiff ℝ n g) (hne : βˆ€ x, f x β‰  g x) : ContDiff ℝ n fun y => dist (f y) (g y) := contDiff_iff_contDiffAt.2 fun x => hf.contDiffAt.dist π•œ hg.contDiffAt (hne x) #align cont_diff.dist ContDiff.dist -- porting note: use `2 β€’` instead of `bit0` theorem hasStrictFDerivAt_norm_sq (x : F) : HasStrictFDerivAt (fun x => β€–xβ€– ^ 2) (2 β€’ (innerSL ℝ x)) x := by simp only [sq, ← @inner_self_eq_norm_mul_norm ℝ] convert (hasStrictFDerivAt_id x).inner ℝ (hasStrictFDerivAt_id x) ext y simp [two_smul, real_inner_comm] #align has_strict_fderiv_at_norm_sq hasStrictFDerivAt_norm_sqβ‚“ theorem HasFDerivAt.norm_sq {f : G β†’ F} {f' : G β†’L[ℝ] F} (hf : HasFDerivAt f f' x) : HasFDerivAt (β€–f Β·β€– ^ 2) (2 β€’ (innerSL ℝ (f x)).comp f') x := (hasStrictFDerivAt_norm_sq _).hasFDerivAt.comp x hf theorem HasDerivAt.norm_sq {f : ℝ β†’ F} {f' : F} {x : ℝ} (hf : HasDerivAt f f' x) : HasDerivAt (β€–f Β·β€– ^ 2) (2 * Inner.inner (f x) f') x := by
simpa using hf.hasFDerivAt.norm_sq.hasDerivAt
theorem HasDerivAt.norm_sq {f : ℝ β†’ F} {f' : F} {x : ℝ} (hf : HasDerivAt f f' x) : HasDerivAt (β€–f Β·β€– ^ 2) (2 * Inner.inner (f x) f') x := by
Mathlib.Analysis.InnerProductSpace.Calculus.232_0.6FECEGgqdb67QLM
theorem HasDerivAt.norm_sq {f : ℝ β†’ F} {f' : F} {x : ℝ} (hf : HasDerivAt f f' x) : HasDerivAt (β€–f Β·β€– ^ 2) (2 * Inner.inner (f x) f') x
Mathlib_Analysis_InnerProductSpace_Calculus
π•œ : Type u_1 E : Type u_2 F : Type u_3 inst✝⁷ : IsROrC π•œ inst✝⁢ : NormedAddCommGroup E inst✝⁡ : InnerProductSpace π•œ E inst✝⁴ : NormedAddCommGroup F inst✝³ : InnerProductSpace ℝ F inst✝² : NormedSpace ℝ E G : Type u_4 inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace ℝ G f✝ g : G β†’ E f'✝ g' : G β†’L[ℝ] E s✝ : Set G x✝ : G n : β„•βˆž f : ℝ β†’ F f' : F s : Set ℝ x : ℝ hf : HasDerivWithinAt f f' s x ⊒ HasDerivWithinAt (fun x => β€–f xβ€– ^ 2) (2 * Inner.inner (f x) f') s x
/- Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ import Mathlib.Analysis.InnerProductSpace.PiL2 import Mathlib.Analysis.SpecialFunctions.Sqrt import Mathlib.Analysis.NormedSpace.HomeomorphBall #align_import analysis.inner_product_space.calculus from "leanprover-community/mathlib"@"f9dd3204df14a0749cd456fac1e6849dfe7d2b88" /-! # Calculus in inner product spaces In this file we prove that the inner product and square of the norm in an inner space are infinitely `ℝ`-smooth. In order to state these results, we need a `NormedSpace ℝ E` instance. Though we can deduce this structure from `InnerProductSpace π•œ E`, this instance may be not definitionally equal to some other β€œnatural” instance. So, we assume `[NormedSpace ℝ E]`. We also prove that functions to a `EuclideanSpace` are (higher) differentiable if and only if their components are. This follows from the corresponding fact for finite product of normed spaces, and from the equivalence of norms in finite dimensions. ## TODO The last part of the file should be generalized to `PiLp`. -/ noncomputable section open IsROrC Real Filter open scoped BigOperators Classical Topology section DerivInner variable {π•œ E F : Type*} [IsROrC π•œ] variable [NormedAddCommGroup E] [InnerProductSpace π•œ E] variable [NormedAddCommGroup F] [InnerProductSpace ℝ F] local notation "βŸͺ" x ", " y "⟫" => @inner π•œ _ _ x y variable (π•œ) [NormedSpace ℝ E] /-- Derivative of the inner product. -/ def fderivInnerClm (p : E Γ— E) : E Γ— E β†’L[ℝ] π•œ := isBoundedBilinearMap_inner.deriv p #align fderiv_inner_clm fderivInnerClm @[simp] theorem fderivInnerClm_apply (p x : E Γ— E) : fderivInnerClm π•œ p x = βŸͺp.1, x.2⟫ + βŸͺx.1, p.2⟫ := rfl #align fderiv_inner_clm_apply fderivInnerClm_apply variable {π•œ} -- porting note: Lean 3 magically switches back to `{π•œ}` here theorem contDiff_inner {n} : ContDiff ℝ n fun p : E Γ— E => βŸͺp.1, p.2⟫ := isBoundedBilinearMap_inner.contDiff #align cont_diff_inner contDiff_inner theorem contDiffAt_inner {p : E Γ— E} {n} : ContDiffAt ℝ n (fun p : E Γ— E => βŸͺp.1, p.2⟫) p := ContDiff.contDiffAt contDiff_inner #align cont_diff_at_inner contDiffAt_inner theorem differentiable_inner : Differentiable ℝ fun p : E Γ— E => βŸͺp.1, p.2⟫ := isBoundedBilinearMap_inner.differentiableAt #align differentiable_inner differentiable_inner variable (π•œ) variable {G : Type*} [NormedAddCommGroup G] [NormedSpace ℝ G] {f g : G β†’ E} {f' g' : G β†’L[ℝ] E} {s : Set G} {x : G} {n : β„•βˆž} theorem ContDiffWithinAt.inner (hf : ContDiffWithinAt ℝ n f s x) (hg : ContDiffWithinAt ℝ n g s x) : ContDiffWithinAt ℝ n (fun x => βŸͺf x, g x⟫) s x := contDiffAt_inner.comp_contDiffWithinAt x (hf.prod hg) #align cont_diff_within_at.inner ContDiffWithinAt.inner nonrec theorem ContDiffAt.inner (hf : ContDiffAt ℝ n f x) (hg : ContDiffAt ℝ n g x) : ContDiffAt ℝ n (fun x => βŸͺf x, g x⟫) x := hf.inner π•œ hg #align cont_diff_at.inner ContDiffAt.inner theorem ContDiffOn.inner (hf : ContDiffOn ℝ n f s) (hg : ContDiffOn ℝ n g s) : ContDiffOn ℝ n (fun x => βŸͺf x, g x⟫) s := fun x hx => (hf x hx).inner π•œ (hg x hx) #align cont_diff_on.inner ContDiffOn.inner theorem ContDiff.inner (hf : ContDiff ℝ n f) (hg : ContDiff ℝ n g) : ContDiff ℝ n fun x => βŸͺf x, g x⟫ := contDiff_inner.comp (hf.prod hg) #align cont_diff.inner ContDiff.inner theorem HasFDerivWithinAt.inner (hf : HasFDerivWithinAt f f' s x) (hg : HasFDerivWithinAt g g' s x) : HasFDerivWithinAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') s x := (isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp_hasFDerivWithinAt x (hf.prod hg) #align has_fderiv_within_at.inner HasFDerivWithinAt.inner theorem HasStrictFDerivAt.inner (hf : HasStrictFDerivAt f f' x) (hg : HasStrictFDerivAt g g' x) : HasStrictFDerivAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') x := (isBoundedBilinearMap_inner.hasStrictFDerivAt (f x, g x)).comp x (hf.prod hg) #align has_strict_fderiv_at.inner HasStrictFDerivAt.inner theorem HasFDerivAt.inner (hf : HasFDerivAt f f' x) (hg : HasFDerivAt g g' x) : HasFDerivAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') x := (isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp x (hf.prod hg) #align has_fderiv_at.inner HasFDerivAt.inner theorem HasDerivWithinAt.inner {f g : ℝ β†’ E} {f' g' : E} {s : Set ℝ} {x : ℝ} (hf : HasDerivWithinAt f f' s x) (hg : HasDerivWithinAt g g' s x) : HasDerivWithinAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) s x := by simpa using (hf.hasFDerivWithinAt.inner π•œ hg.hasFDerivWithinAt).hasDerivWithinAt #align has_deriv_within_at.inner HasDerivWithinAt.inner theorem HasDerivAt.inner {f g : ℝ β†’ E} {f' g' : E} {x : ℝ} : HasDerivAt f f' x β†’ HasDerivAt g g' x β†’ HasDerivAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) x := by simpa only [← hasDerivWithinAt_univ] using HasDerivWithinAt.inner π•œ #align has_deriv_at.inner HasDerivAt.inner theorem DifferentiableWithinAt.inner (hf : DifferentiableWithinAt ℝ f s x) (hg : DifferentiableWithinAt ℝ g s x) : DifferentiableWithinAt ℝ (fun x => βŸͺf x, g x⟫) s x := ((differentiable_inner _).hasFDerivAt.comp_hasFDerivWithinAt x (hf.prod hg).hasFDerivWithinAt).differentiableWithinAt #align differentiable_within_at.inner DifferentiableWithinAt.inner theorem DifferentiableAt.inner (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) : DifferentiableAt ℝ (fun x => βŸͺf x, g x⟫) x := (differentiable_inner _).comp x (hf.prod hg) #align differentiable_at.inner DifferentiableAt.inner theorem DifferentiableOn.inner (hf : DifferentiableOn ℝ f s) (hg : DifferentiableOn ℝ g s) : DifferentiableOn ℝ (fun x => βŸͺf x, g x⟫) s := fun x hx => (hf x hx).inner π•œ (hg x hx) #align differentiable_on.inner DifferentiableOn.inner theorem Differentiable.inner (hf : Differentiable ℝ f) (hg : Differentiable ℝ g) : Differentiable ℝ fun x => βŸͺf x, g x⟫ := fun x => (hf x).inner π•œ (hg x) #align differentiable.inner Differentiable.inner theorem fderiv_inner_apply (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) (y : G) : fderiv ℝ (fun t => βŸͺf t, g t⟫) x y = βŸͺf x, fderiv ℝ g x y⟫ + βŸͺfderiv ℝ f x y, g x⟫ := by rw [(hf.hasFDerivAt.inner π•œ hg.hasFDerivAt).fderiv]; rfl #align fderiv_inner_apply fderiv_inner_apply theorem deriv_inner_apply {f g : ℝ β†’ E} {x : ℝ} (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) : deriv (fun t => βŸͺf t, g t⟫) x = βŸͺf x, deriv g x⟫ + βŸͺderiv f x, g x⟫ := (hf.hasDerivAt.inner π•œ hg.hasDerivAt).deriv #align deriv_inner_apply deriv_inner_apply theorem contDiff_norm_sq : ContDiff ℝ n fun x : E => β€–xβ€– ^ 2 := by convert (reClm : π•œ β†’L[ℝ] ℝ).contDiff.comp ((contDiff_id (E := E)).inner π•œ (contDiff_id (E := E))) exact (inner_self_eq_norm_sq _).symm #align cont_diff_norm_sq contDiff_norm_sq theorem ContDiff.norm_sq (hf : ContDiff ℝ n f) : ContDiff ℝ n fun x => β€–f xβ€– ^ 2 := (contDiff_norm_sq π•œ).comp hf #align cont_diff.norm_sq ContDiff.norm_sq theorem ContDiffWithinAt.norm_sq (hf : ContDiffWithinAt ℝ n f s x) : ContDiffWithinAt ℝ n (fun y => β€–f yβ€– ^ 2) s x := (contDiff_norm_sq π•œ).contDiffAt.comp_contDiffWithinAt x hf #align cont_diff_within_at.norm_sq ContDiffWithinAt.norm_sq nonrec theorem ContDiffAt.norm_sq (hf : ContDiffAt ℝ n f x) : ContDiffAt ℝ n (β€–f Β·β€– ^ 2) x := hf.norm_sq π•œ #align cont_diff_at.norm_sq ContDiffAt.norm_sq theorem contDiffAt_norm {x : E} (hx : x β‰  0) : ContDiffAt ℝ n norm x := by have : β€–id xβ€– ^ 2 β‰  0 := pow_ne_zero 2 (norm_pos_iff.2 hx).ne' simpa only [id, sqrt_sq, norm_nonneg] using (contDiffAt_id.norm_sq π•œ).sqrt this #align cont_diff_at_norm contDiffAt_norm theorem ContDiffAt.norm (hf : ContDiffAt ℝ n f x) (h0 : f x β‰  0) : ContDiffAt ℝ n (fun y => β€–f yβ€–) x := (contDiffAt_norm π•œ h0).comp x hf #align cont_diff_at.norm ContDiffAt.norm theorem ContDiffAt.dist (hf : ContDiffAt ℝ n f x) (hg : ContDiffAt ℝ n g x) (hne : f x β‰  g x) : ContDiffAt ℝ n (fun y => dist (f y) (g y)) x := by simp only [dist_eq_norm] exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align cont_diff_at.dist ContDiffAt.dist theorem ContDiffWithinAt.norm (hf : ContDiffWithinAt ℝ n f s x) (h0 : f x β‰  0) : ContDiffWithinAt ℝ n (fun y => β€–f yβ€–) s x := (contDiffAt_norm π•œ h0).comp_contDiffWithinAt x hf #align cont_diff_within_at.norm ContDiffWithinAt.norm theorem ContDiffWithinAt.dist (hf : ContDiffWithinAt ℝ n f s x) (hg : ContDiffWithinAt ℝ n g s x) (hne : f x β‰  g x) : ContDiffWithinAt ℝ n (fun y => dist (f y) (g y)) s x := by simp only [dist_eq_norm]; exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align cont_diff_within_at.dist ContDiffWithinAt.dist theorem ContDiffOn.norm_sq (hf : ContDiffOn ℝ n f s) : ContDiffOn ℝ n (fun y => β€–f yβ€– ^ 2) s := fun x hx => (hf x hx).norm_sq π•œ #align cont_diff_on.norm_sq ContDiffOn.norm_sq theorem ContDiffOn.norm (hf : ContDiffOn ℝ n f s) (h0 : βˆ€ x ∈ s, f x β‰  0) : ContDiffOn ℝ n (fun y => β€–f yβ€–) s := fun x hx => (hf x hx).norm π•œ (h0 x hx) #align cont_diff_on.norm ContDiffOn.norm theorem ContDiffOn.dist (hf : ContDiffOn ℝ n f s) (hg : ContDiffOn ℝ n g s) (hne : βˆ€ x ∈ s, f x β‰  g x) : ContDiffOn ℝ n (fun y => dist (f y) (g y)) s := fun x hx => (hf x hx).dist π•œ (hg x hx) (hne x hx) #align cont_diff_on.dist ContDiffOn.dist theorem ContDiff.norm (hf : ContDiff ℝ n f) (h0 : βˆ€ x, f x β‰  0) : ContDiff ℝ n fun y => β€–f yβ€– := contDiff_iff_contDiffAt.2 fun x => hf.contDiffAt.norm π•œ (h0 x) #align cont_diff.norm ContDiff.norm theorem ContDiff.dist (hf : ContDiff ℝ n f) (hg : ContDiff ℝ n g) (hne : βˆ€ x, f x β‰  g x) : ContDiff ℝ n fun y => dist (f y) (g y) := contDiff_iff_contDiffAt.2 fun x => hf.contDiffAt.dist π•œ hg.contDiffAt (hne x) #align cont_diff.dist ContDiff.dist -- porting note: use `2 β€’` instead of `bit0` theorem hasStrictFDerivAt_norm_sq (x : F) : HasStrictFDerivAt (fun x => β€–xβ€– ^ 2) (2 β€’ (innerSL ℝ x)) x := by simp only [sq, ← @inner_self_eq_norm_mul_norm ℝ] convert (hasStrictFDerivAt_id x).inner ℝ (hasStrictFDerivAt_id x) ext y simp [two_smul, real_inner_comm] #align has_strict_fderiv_at_norm_sq hasStrictFDerivAt_norm_sqβ‚“ theorem HasFDerivAt.norm_sq {f : G β†’ F} {f' : G β†’L[ℝ] F} (hf : HasFDerivAt f f' x) : HasFDerivAt (β€–f Β·β€– ^ 2) (2 β€’ (innerSL ℝ (f x)).comp f') x := (hasStrictFDerivAt_norm_sq _).hasFDerivAt.comp x hf theorem HasDerivAt.norm_sq {f : ℝ β†’ F} {f' : F} {x : ℝ} (hf : HasDerivAt f f' x) : HasDerivAt (β€–f Β·β€– ^ 2) (2 * Inner.inner (f x) f') x := by simpa using hf.hasFDerivAt.norm_sq.hasDerivAt theorem HasFDerivWithinAt.norm_sq {f : G β†’ F} {f' : G β†’L[ℝ] F} (hf : HasFDerivWithinAt f f' s x) : HasFDerivWithinAt (β€–f Β·β€– ^ 2) (2 β€’ (innerSL ℝ (f x)).comp f') s x := (hasStrictFDerivAt_norm_sq _).hasFDerivAt.comp_hasFDerivWithinAt x hf theorem HasDerivWithinAt.norm_sq {f : ℝ β†’ F} {f' : F} {s : Set ℝ} {x : ℝ} (hf : HasDerivWithinAt f f' s x) : HasDerivWithinAt (β€–f Β·β€– ^ 2) (2 * Inner.inner (f x) f') s x := by
simpa using hf.hasFDerivWithinAt.norm_sq.hasDerivWithinAt
theorem HasDerivWithinAt.norm_sq {f : ℝ β†’ F} {f' : F} {s : Set ℝ} {x : ℝ} (hf : HasDerivWithinAt f f' s x) : HasDerivWithinAt (β€–f Β·β€– ^ 2) (2 * Inner.inner (f x) f') s x := by
Mathlib.Analysis.InnerProductSpace.Calculus.240_0.6FECEGgqdb67QLM
theorem HasDerivWithinAt.norm_sq {f : ℝ β†’ F} {f' : F} {s : Set ℝ} {x : ℝ} (hf : HasDerivWithinAt f f' s x) : HasDerivWithinAt (β€–f Β·β€– ^ 2) (2 * Inner.inner (f x) f') s x
Mathlib_Analysis_InnerProductSpace_Calculus
π•œ : Type u_1 E : Type u_2 F : Type u_3 inst✝⁷ : IsROrC π•œ inst✝⁢ : NormedAddCommGroup E inst✝⁡ : InnerProductSpace π•œ E inst✝⁴ : NormedAddCommGroup F inst✝³ : InnerProductSpace ℝ F inst✝² : NormedSpace ℝ E G : Type u_4 inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace ℝ G f g : G β†’ E f' g' : G β†’L[ℝ] E s : Set G x : G n : β„•βˆž hf : DifferentiableAt ℝ f x hg : DifferentiableAt ℝ g x hne : f x β‰  g x ⊒ DifferentiableAt ℝ (fun y => Dist.dist (f y) (g y)) x
/- Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ import Mathlib.Analysis.InnerProductSpace.PiL2 import Mathlib.Analysis.SpecialFunctions.Sqrt import Mathlib.Analysis.NormedSpace.HomeomorphBall #align_import analysis.inner_product_space.calculus from "leanprover-community/mathlib"@"f9dd3204df14a0749cd456fac1e6849dfe7d2b88" /-! # Calculus in inner product spaces In this file we prove that the inner product and square of the norm in an inner space are infinitely `ℝ`-smooth. In order to state these results, we need a `NormedSpace ℝ E` instance. Though we can deduce this structure from `InnerProductSpace π•œ E`, this instance may be not definitionally equal to some other β€œnatural” instance. So, we assume `[NormedSpace ℝ E]`. We also prove that functions to a `EuclideanSpace` are (higher) differentiable if and only if their components are. This follows from the corresponding fact for finite product of normed spaces, and from the equivalence of norms in finite dimensions. ## TODO The last part of the file should be generalized to `PiLp`. -/ noncomputable section open IsROrC Real Filter open scoped BigOperators Classical Topology section DerivInner variable {π•œ E F : Type*} [IsROrC π•œ] variable [NormedAddCommGroup E] [InnerProductSpace π•œ E] variable [NormedAddCommGroup F] [InnerProductSpace ℝ F] local notation "βŸͺ" x ", " y "⟫" => @inner π•œ _ _ x y variable (π•œ) [NormedSpace ℝ E] /-- Derivative of the inner product. -/ def fderivInnerClm (p : E Γ— E) : E Γ— E β†’L[ℝ] π•œ := isBoundedBilinearMap_inner.deriv p #align fderiv_inner_clm fderivInnerClm @[simp] theorem fderivInnerClm_apply (p x : E Γ— E) : fderivInnerClm π•œ p x = βŸͺp.1, x.2⟫ + βŸͺx.1, p.2⟫ := rfl #align fderiv_inner_clm_apply fderivInnerClm_apply variable {π•œ} -- porting note: Lean 3 magically switches back to `{π•œ}` here theorem contDiff_inner {n} : ContDiff ℝ n fun p : E Γ— E => βŸͺp.1, p.2⟫ := isBoundedBilinearMap_inner.contDiff #align cont_diff_inner contDiff_inner theorem contDiffAt_inner {p : E Γ— E} {n} : ContDiffAt ℝ n (fun p : E Γ— E => βŸͺp.1, p.2⟫) p := ContDiff.contDiffAt contDiff_inner #align cont_diff_at_inner contDiffAt_inner theorem differentiable_inner : Differentiable ℝ fun p : E Γ— E => βŸͺp.1, p.2⟫ := isBoundedBilinearMap_inner.differentiableAt #align differentiable_inner differentiable_inner variable (π•œ) variable {G : Type*} [NormedAddCommGroup G] [NormedSpace ℝ G] {f g : G β†’ E} {f' g' : G β†’L[ℝ] E} {s : Set G} {x : G} {n : β„•βˆž} theorem ContDiffWithinAt.inner (hf : ContDiffWithinAt ℝ n f s x) (hg : ContDiffWithinAt ℝ n g s x) : ContDiffWithinAt ℝ n (fun x => βŸͺf x, g x⟫) s x := contDiffAt_inner.comp_contDiffWithinAt x (hf.prod hg) #align cont_diff_within_at.inner ContDiffWithinAt.inner nonrec theorem ContDiffAt.inner (hf : ContDiffAt ℝ n f x) (hg : ContDiffAt ℝ n g x) : ContDiffAt ℝ n (fun x => βŸͺf x, g x⟫) x := hf.inner π•œ hg #align cont_diff_at.inner ContDiffAt.inner theorem ContDiffOn.inner (hf : ContDiffOn ℝ n f s) (hg : ContDiffOn ℝ n g s) : ContDiffOn ℝ n (fun x => βŸͺf x, g x⟫) s := fun x hx => (hf x hx).inner π•œ (hg x hx) #align cont_diff_on.inner ContDiffOn.inner theorem ContDiff.inner (hf : ContDiff ℝ n f) (hg : ContDiff ℝ n g) : ContDiff ℝ n fun x => βŸͺf x, g x⟫ := contDiff_inner.comp (hf.prod hg) #align cont_diff.inner ContDiff.inner theorem HasFDerivWithinAt.inner (hf : HasFDerivWithinAt f f' s x) (hg : HasFDerivWithinAt g g' s x) : HasFDerivWithinAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') s x := (isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp_hasFDerivWithinAt x (hf.prod hg) #align has_fderiv_within_at.inner HasFDerivWithinAt.inner theorem HasStrictFDerivAt.inner (hf : HasStrictFDerivAt f f' x) (hg : HasStrictFDerivAt g g' x) : HasStrictFDerivAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') x := (isBoundedBilinearMap_inner.hasStrictFDerivAt (f x, g x)).comp x (hf.prod hg) #align has_strict_fderiv_at.inner HasStrictFDerivAt.inner theorem HasFDerivAt.inner (hf : HasFDerivAt f f' x) (hg : HasFDerivAt g g' x) : HasFDerivAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') x := (isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp x (hf.prod hg) #align has_fderiv_at.inner HasFDerivAt.inner theorem HasDerivWithinAt.inner {f g : ℝ β†’ E} {f' g' : E} {s : Set ℝ} {x : ℝ} (hf : HasDerivWithinAt f f' s x) (hg : HasDerivWithinAt g g' s x) : HasDerivWithinAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) s x := by simpa using (hf.hasFDerivWithinAt.inner π•œ hg.hasFDerivWithinAt).hasDerivWithinAt #align has_deriv_within_at.inner HasDerivWithinAt.inner theorem HasDerivAt.inner {f g : ℝ β†’ E} {f' g' : E} {x : ℝ} : HasDerivAt f f' x β†’ HasDerivAt g g' x β†’ HasDerivAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) x := by simpa only [← hasDerivWithinAt_univ] using HasDerivWithinAt.inner π•œ #align has_deriv_at.inner HasDerivAt.inner theorem DifferentiableWithinAt.inner (hf : DifferentiableWithinAt ℝ f s x) (hg : DifferentiableWithinAt ℝ g s x) : DifferentiableWithinAt ℝ (fun x => βŸͺf x, g x⟫) s x := ((differentiable_inner _).hasFDerivAt.comp_hasFDerivWithinAt x (hf.prod hg).hasFDerivWithinAt).differentiableWithinAt #align differentiable_within_at.inner DifferentiableWithinAt.inner theorem DifferentiableAt.inner (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) : DifferentiableAt ℝ (fun x => βŸͺf x, g x⟫) x := (differentiable_inner _).comp x (hf.prod hg) #align differentiable_at.inner DifferentiableAt.inner theorem DifferentiableOn.inner (hf : DifferentiableOn ℝ f s) (hg : DifferentiableOn ℝ g s) : DifferentiableOn ℝ (fun x => βŸͺf x, g x⟫) s := fun x hx => (hf x hx).inner π•œ (hg x hx) #align differentiable_on.inner DifferentiableOn.inner theorem Differentiable.inner (hf : Differentiable ℝ f) (hg : Differentiable ℝ g) : Differentiable ℝ fun x => βŸͺf x, g x⟫ := fun x => (hf x).inner π•œ (hg x) #align differentiable.inner Differentiable.inner theorem fderiv_inner_apply (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) (y : G) : fderiv ℝ (fun t => βŸͺf t, g t⟫) x y = βŸͺf x, fderiv ℝ g x y⟫ + βŸͺfderiv ℝ f x y, g x⟫ := by rw [(hf.hasFDerivAt.inner π•œ hg.hasFDerivAt).fderiv]; rfl #align fderiv_inner_apply fderiv_inner_apply theorem deriv_inner_apply {f g : ℝ β†’ E} {x : ℝ} (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) : deriv (fun t => βŸͺf t, g t⟫) x = βŸͺf x, deriv g x⟫ + βŸͺderiv f x, g x⟫ := (hf.hasDerivAt.inner π•œ hg.hasDerivAt).deriv #align deriv_inner_apply deriv_inner_apply theorem contDiff_norm_sq : ContDiff ℝ n fun x : E => β€–xβ€– ^ 2 := by convert (reClm : π•œ β†’L[ℝ] ℝ).contDiff.comp ((contDiff_id (E := E)).inner π•œ (contDiff_id (E := E))) exact (inner_self_eq_norm_sq _).symm #align cont_diff_norm_sq contDiff_norm_sq theorem ContDiff.norm_sq (hf : ContDiff ℝ n f) : ContDiff ℝ n fun x => β€–f xβ€– ^ 2 := (contDiff_norm_sq π•œ).comp hf #align cont_diff.norm_sq ContDiff.norm_sq theorem ContDiffWithinAt.norm_sq (hf : ContDiffWithinAt ℝ n f s x) : ContDiffWithinAt ℝ n (fun y => β€–f yβ€– ^ 2) s x := (contDiff_norm_sq π•œ).contDiffAt.comp_contDiffWithinAt x hf #align cont_diff_within_at.norm_sq ContDiffWithinAt.norm_sq nonrec theorem ContDiffAt.norm_sq (hf : ContDiffAt ℝ n f x) : ContDiffAt ℝ n (β€–f Β·β€– ^ 2) x := hf.norm_sq π•œ #align cont_diff_at.norm_sq ContDiffAt.norm_sq theorem contDiffAt_norm {x : E} (hx : x β‰  0) : ContDiffAt ℝ n norm x := by have : β€–id xβ€– ^ 2 β‰  0 := pow_ne_zero 2 (norm_pos_iff.2 hx).ne' simpa only [id, sqrt_sq, norm_nonneg] using (contDiffAt_id.norm_sq π•œ).sqrt this #align cont_diff_at_norm contDiffAt_norm theorem ContDiffAt.norm (hf : ContDiffAt ℝ n f x) (h0 : f x β‰  0) : ContDiffAt ℝ n (fun y => β€–f yβ€–) x := (contDiffAt_norm π•œ h0).comp x hf #align cont_diff_at.norm ContDiffAt.norm theorem ContDiffAt.dist (hf : ContDiffAt ℝ n f x) (hg : ContDiffAt ℝ n g x) (hne : f x β‰  g x) : ContDiffAt ℝ n (fun y => dist (f y) (g y)) x := by simp only [dist_eq_norm] exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align cont_diff_at.dist ContDiffAt.dist theorem ContDiffWithinAt.norm (hf : ContDiffWithinAt ℝ n f s x) (h0 : f x β‰  0) : ContDiffWithinAt ℝ n (fun y => β€–f yβ€–) s x := (contDiffAt_norm π•œ h0).comp_contDiffWithinAt x hf #align cont_diff_within_at.norm ContDiffWithinAt.norm theorem ContDiffWithinAt.dist (hf : ContDiffWithinAt ℝ n f s x) (hg : ContDiffWithinAt ℝ n g s x) (hne : f x β‰  g x) : ContDiffWithinAt ℝ n (fun y => dist (f y) (g y)) s x := by simp only [dist_eq_norm]; exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align cont_diff_within_at.dist ContDiffWithinAt.dist theorem ContDiffOn.norm_sq (hf : ContDiffOn ℝ n f s) : ContDiffOn ℝ n (fun y => β€–f yβ€– ^ 2) s := fun x hx => (hf x hx).norm_sq π•œ #align cont_diff_on.norm_sq ContDiffOn.norm_sq theorem ContDiffOn.norm (hf : ContDiffOn ℝ n f s) (h0 : βˆ€ x ∈ s, f x β‰  0) : ContDiffOn ℝ n (fun y => β€–f yβ€–) s := fun x hx => (hf x hx).norm π•œ (h0 x hx) #align cont_diff_on.norm ContDiffOn.norm theorem ContDiffOn.dist (hf : ContDiffOn ℝ n f s) (hg : ContDiffOn ℝ n g s) (hne : βˆ€ x ∈ s, f x β‰  g x) : ContDiffOn ℝ n (fun y => dist (f y) (g y)) s := fun x hx => (hf x hx).dist π•œ (hg x hx) (hne x hx) #align cont_diff_on.dist ContDiffOn.dist theorem ContDiff.norm (hf : ContDiff ℝ n f) (h0 : βˆ€ x, f x β‰  0) : ContDiff ℝ n fun y => β€–f yβ€– := contDiff_iff_contDiffAt.2 fun x => hf.contDiffAt.norm π•œ (h0 x) #align cont_diff.norm ContDiff.norm theorem ContDiff.dist (hf : ContDiff ℝ n f) (hg : ContDiff ℝ n g) (hne : βˆ€ x, f x β‰  g x) : ContDiff ℝ n fun y => dist (f y) (g y) := contDiff_iff_contDiffAt.2 fun x => hf.contDiffAt.dist π•œ hg.contDiffAt (hne x) #align cont_diff.dist ContDiff.dist -- porting note: use `2 β€’` instead of `bit0` theorem hasStrictFDerivAt_norm_sq (x : F) : HasStrictFDerivAt (fun x => β€–xβ€– ^ 2) (2 β€’ (innerSL ℝ x)) x := by simp only [sq, ← @inner_self_eq_norm_mul_norm ℝ] convert (hasStrictFDerivAt_id x).inner ℝ (hasStrictFDerivAt_id x) ext y simp [two_smul, real_inner_comm] #align has_strict_fderiv_at_norm_sq hasStrictFDerivAt_norm_sqβ‚“ theorem HasFDerivAt.norm_sq {f : G β†’ F} {f' : G β†’L[ℝ] F} (hf : HasFDerivAt f f' x) : HasFDerivAt (β€–f Β·β€– ^ 2) (2 β€’ (innerSL ℝ (f x)).comp f') x := (hasStrictFDerivAt_norm_sq _).hasFDerivAt.comp x hf theorem HasDerivAt.norm_sq {f : ℝ β†’ F} {f' : F} {x : ℝ} (hf : HasDerivAt f f' x) : HasDerivAt (β€–f Β·β€– ^ 2) (2 * Inner.inner (f x) f') x := by simpa using hf.hasFDerivAt.norm_sq.hasDerivAt theorem HasFDerivWithinAt.norm_sq {f : G β†’ F} {f' : G β†’L[ℝ] F} (hf : HasFDerivWithinAt f f' s x) : HasFDerivWithinAt (β€–f Β·β€– ^ 2) (2 β€’ (innerSL ℝ (f x)).comp f') s x := (hasStrictFDerivAt_norm_sq _).hasFDerivAt.comp_hasFDerivWithinAt x hf theorem HasDerivWithinAt.norm_sq {f : ℝ β†’ F} {f' : F} {s : Set ℝ} {x : ℝ} (hf : HasDerivWithinAt f f' s x) : HasDerivWithinAt (β€–f Β·β€– ^ 2) (2 * Inner.inner (f x) f') s x := by simpa using hf.hasFDerivWithinAt.norm_sq.hasDerivWithinAt theorem DifferentiableAt.norm_sq (hf : DifferentiableAt ℝ f x) : DifferentiableAt ℝ (fun y => β€–f yβ€– ^ 2) x := ((contDiffAt_id.norm_sq π•œ).differentiableAt le_rfl).comp x hf #align differentiable_at.norm_sq DifferentiableAt.norm_sq theorem DifferentiableAt.norm (hf : DifferentiableAt ℝ f x) (h0 : f x β‰  0) : DifferentiableAt ℝ (fun y => β€–f yβ€–) x := ((contDiffAt_norm π•œ h0).differentiableAt le_rfl).comp x hf #align differentiable_at.norm DifferentiableAt.norm theorem DifferentiableAt.dist (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) (hne : f x β‰  g x) : DifferentiableAt ℝ (fun y => dist (f y) (g y)) x := by
simp only [dist_eq_norm]
theorem DifferentiableAt.dist (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) (hne : f x β‰  g x) : DifferentiableAt ℝ (fun y => dist (f y) (g y)) x := by
Mathlib.Analysis.InnerProductSpace.Calculus.255_0.6FECEGgqdb67QLM
theorem DifferentiableAt.dist (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) (hne : f x β‰  g x) : DifferentiableAt ℝ (fun y => dist (f y) (g y)) x
Mathlib_Analysis_InnerProductSpace_Calculus
π•œ : Type u_1 E : Type u_2 F : Type u_3 inst✝⁷ : IsROrC π•œ inst✝⁢ : NormedAddCommGroup E inst✝⁡ : InnerProductSpace π•œ E inst✝⁴ : NormedAddCommGroup F inst✝³ : InnerProductSpace ℝ F inst✝² : NormedSpace ℝ E G : Type u_4 inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace ℝ G f g : G β†’ E f' g' : G β†’L[ℝ] E s : Set G x : G n : β„•βˆž hf : DifferentiableAt ℝ f x hg : DifferentiableAt ℝ g x hne : f x β‰  g x ⊒ DifferentiableAt ℝ (fun y => β€–f y - g yβ€–) x
/- Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ import Mathlib.Analysis.InnerProductSpace.PiL2 import Mathlib.Analysis.SpecialFunctions.Sqrt import Mathlib.Analysis.NormedSpace.HomeomorphBall #align_import analysis.inner_product_space.calculus from "leanprover-community/mathlib"@"f9dd3204df14a0749cd456fac1e6849dfe7d2b88" /-! # Calculus in inner product spaces In this file we prove that the inner product and square of the norm in an inner space are infinitely `ℝ`-smooth. In order to state these results, we need a `NormedSpace ℝ E` instance. Though we can deduce this structure from `InnerProductSpace π•œ E`, this instance may be not definitionally equal to some other β€œnatural” instance. So, we assume `[NormedSpace ℝ E]`. We also prove that functions to a `EuclideanSpace` are (higher) differentiable if and only if their components are. This follows from the corresponding fact for finite product of normed spaces, and from the equivalence of norms in finite dimensions. ## TODO The last part of the file should be generalized to `PiLp`. -/ noncomputable section open IsROrC Real Filter open scoped BigOperators Classical Topology section DerivInner variable {π•œ E F : Type*} [IsROrC π•œ] variable [NormedAddCommGroup E] [InnerProductSpace π•œ E] variable [NormedAddCommGroup F] [InnerProductSpace ℝ F] local notation "βŸͺ" x ", " y "⟫" => @inner π•œ _ _ x y variable (π•œ) [NormedSpace ℝ E] /-- Derivative of the inner product. -/ def fderivInnerClm (p : E Γ— E) : E Γ— E β†’L[ℝ] π•œ := isBoundedBilinearMap_inner.deriv p #align fderiv_inner_clm fderivInnerClm @[simp] theorem fderivInnerClm_apply (p x : E Γ— E) : fderivInnerClm π•œ p x = βŸͺp.1, x.2⟫ + βŸͺx.1, p.2⟫ := rfl #align fderiv_inner_clm_apply fderivInnerClm_apply variable {π•œ} -- porting note: Lean 3 magically switches back to `{π•œ}` here theorem contDiff_inner {n} : ContDiff ℝ n fun p : E Γ— E => βŸͺp.1, p.2⟫ := isBoundedBilinearMap_inner.contDiff #align cont_diff_inner contDiff_inner theorem contDiffAt_inner {p : E Γ— E} {n} : ContDiffAt ℝ n (fun p : E Γ— E => βŸͺp.1, p.2⟫) p := ContDiff.contDiffAt contDiff_inner #align cont_diff_at_inner contDiffAt_inner theorem differentiable_inner : Differentiable ℝ fun p : E Γ— E => βŸͺp.1, p.2⟫ := isBoundedBilinearMap_inner.differentiableAt #align differentiable_inner differentiable_inner variable (π•œ) variable {G : Type*} [NormedAddCommGroup G] [NormedSpace ℝ G] {f g : G β†’ E} {f' g' : G β†’L[ℝ] E} {s : Set G} {x : G} {n : β„•βˆž} theorem ContDiffWithinAt.inner (hf : ContDiffWithinAt ℝ n f s x) (hg : ContDiffWithinAt ℝ n g s x) : ContDiffWithinAt ℝ n (fun x => βŸͺf x, g x⟫) s x := contDiffAt_inner.comp_contDiffWithinAt x (hf.prod hg) #align cont_diff_within_at.inner ContDiffWithinAt.inner nonrec theorem ContDiffAt.inner (hf : ContDiffAt ℝ n f x) (hg : ContDiffAt ℝ n g x) : ContDiffAt ℝ n (fun x => βŸͺf x, g x⟫) x := hf.inner π•œ hg #align cont_diff_at.inner ContDiffAt.inner theorem ContDiffOn.inner (hf : ContDiffOn ℝ n f s) (hg : ContDiffOn ℝ n g s) : ContDiffOn ℝ n (fun x => βŸͺf x, g x⟫) s := fun x hx => (hf x hx).inner π•œ (hg x hx) #align cont_diff_on.inner ContDiffOn.inner theorem ContDiff.inner (hf : ContDiff ℝ n f) (hg : ContDiff ℝ n g) : ContDiff ℝ n fun x => βŸͺf x, g x⟫ := contDiff_inner.comp (hf.prod hg) #align cont_diff.inner ContDiff.inner theorem HasFDerivWithinAt.inner (hf : HasFDerivWithinAt f f' s x) (hg : HasFDerivWithinAt g g' s x) : HasFDerivWithinAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') s x := (isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp_hasFDerivWithinAt x (hf.prod hg) #align has_fderiv_within_at.inner HasFDerivWithinAt.inner theorem HasStrictFDerivAt.inner (hf : HasStrictFDerivAt f f' x) (hg : HasStrictFDerivAt g g' x) : HasStrictFDerivAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') x := (isBoundedBilinearMap_inner.hasStrictFDerivAt (f x, g x)).comp x (hf.prod hg) #align has_strict_fderiv_at.inner HasStrictFDerivAt.inner theorem HasFDerivAt.inner (hf : HasFDerivAt f f' x) (hg : HasFDerivAt g g' x) : HasFDerivAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') x := (isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp x (hf.prod hg) #align has_fderiv_at.inner HasFDerivAt.inner theorem HasDerivWithinAt.inner {f g : ℝ β†’ E} {f' g' : E} {s : Set ℝ} {x : ℝ} (hf : HasDerivWithinAt f f' s x) (hg : HasDerivWithinAt g g' s x) : HasDerivWithinAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) s x := by simpa using (hf.hasFDerivWithinAt.inner π•œ hg.hasFDerivWithinAt).hasDerivWithinAt #align has_deriv_within_at.inner HasDerivWithinAt.inner theorem HasDerivAt.inner {f g : ℝ β†’ E} {f' g' : E} {x : ℝ} : HasDerivAt f f' x β†’ HasDerivAt g g' x β†’ HasDerivAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) x := by simpa only [← hasDerivWithinAt_univ] using HasDerivWithinAt.inner π•œ #align has_deriv_at.inner HasDerivAt.inner theorem DifferentiableWithinAt.inner (hf : DifferentiableWithinAt ℝ f s x) (hg : DifferentiableWithinAt ℝ g s x) : DifferentiableWithinAt ℝ (fun x => βŸͺf x, g x⟫) s x := ((differentiable_inner _).hasFDerivAt.comp_hasFDerivWithinAt x (hf.prod hg).hasFDerivWithinAt).differentiableWithinAt #align differentiable_within_at.inner DifferentiableWithinAt.inner theorem DifferentiableAt.inner (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) : DifferentiableAt ℝ (fun x => βŸͺf x, g x⟫) x := (differentiable_inner _).comp x (hf.prod hg) #align differentiable_at.inner DifferentiableAt.inner theorem DifferentiableOn.inner (hf : DifferentiableOn ℝ f s) (hg : DifferentiableOn ℝ g s) : DifferentiableOn ℝ (fun x => βŸͺf x, g x⟫) s := fun x hx => (hf x hx).inner π•œ (hg x hx) #align differentiable_on.inner DifferentiableOn.inner theorem Differentiable.inner (hf : Differentiable ℝ f) (hg : Differentiable ℝ g) : Differentiable ℝ fun x => βŸͺf x, g x⟫ := fun x => (hf x).inner π•œ (hg x) #align differentiable.inner Differentiable.inner theorem fderiv_inner_apply (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) (y : G) : fderiv ℝ (fun t => βŸͺf t, g t⟫) x y = βŸͺf x, fderiv ℝ g x y⟫ + βŸͺfderiv ℝ f x y, g x⟫ := by rw [(hf.hasFDerivAt.inner π•œ hg.hasFDerivAt).fderiv]; rfl #align fderiv_inner_apply fderiv_inner_apply theorem deriv_inner_apply {f g : ℝ β†’ E} {x : ℝ} (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) : deriv (fun t => βŸͺf t, g t⟫) x = βŸͺf x, deriv g x⟫ + βŸͺderiv f x, g x⟫ := (hf.hasDerivAt.inner π•œ hg.hasDerivAt).deriv #align deriv_inner_apply deriv_inner_apply theorem contDiff_norm_sq : ContDiff ℝ n fun x : E => β€–xβ€– ^ 2 := by convert (reClm : π•œ β†’L[ℝ] ℝ).contDiff.comp ((contDiff_id (E := E)).inner π•œ (contDiff_id (E := E))) exact (inner_self_eq_norm_sq _).symm #align cont_diff_norm_sq contDiff_norm_sq theorem ContDiff.norm_sq (hf : ContDiff ℝ n f) : ContDiff ℝ n fun x => β€–f xβ€– ^ 2 := (contDiff_norm_sq π•œ).comp hf #align cont_diff.norm_sq ContDiff.norm_sq theorem ContDiffWithinAt.norm_sq (hf : ContDiffWithinAt ℝ n f s x) : ContDiffWithinAt ℝ n (fun y => β€–f yβ€– ^ 2) s x := (contDiff_norm_sq π•œ).contDiffAt.comp_contDiffWithinAt x hf #align cont_diff_within_at.norm_sq ContDiffWithinAt.norm_sq nonrec theorem ContDiffAt.norm_sq (hf : ContDiffAt ℝ n f x) : ContDiffAt ℝ n (β€–f Β·β€– ^ 2) x := hf.norm_sq π•œ #align cont_diff_at.norm_sq ContDiffAt.norm_sq theorem contDiffAt_norm {x : E} (hx : x β‰  0) : ContDiffAt ℝ n norm x := by have : β€–id xβ€– ^ 2 β‰  0 := pow_ne_zero 2 (norm_pos_iff.2 hx).ne' simpa only [id, sqrt_sq, norm_nonneg] using (contDiffAt_id.norm_sq π•œ).sqrt this #align cont_diff_at_norm contDiffAt_norm theorem ContDiffAt.norm (hf : ContDiffAt ℝ n f x) (h0 : f x β‰  0) : ContDiffAt ℝ n (fun y => β€–f yβ€–) x := (contDiffAt_norm π•œ h0).comp x hf #align cont_diff_at.norm ContDiffAt.norm theorem ContDiffAt.dist (hf : ContDiffAt ℝ n f x) (hg : ContDiffAt ℝ n g x) (hne : f x β‰  g x) : ContDiffAt ℝ n (fun y => dist (f y) (g y)) x := by simp only [dist_eq_norm] exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align cont_diff_at.dist ContDiffAt.dist theorem ContDiffWithinAt.norm (hf : ContDiffWithinAt ℝ n f s x) (h0 : f x β‰  0) : ContDiffWithinAt ℝ n (fun y => β€–f yβ€–) s x := (contDiffAt_norm π•œ h0).comp_contDiffWithinAt x hf #align cont_diff_within_at.norm ContDiffWithinAt.norm theorem ContDiffWithinAt.dist (hf : ContDiffWithinAt ℝ n f s x) (hg : ContDiffWithinAt ℝ n g s x) (hne : f x β‰  g x) : ContDiffWithinAt ℝ n (fun y => dist (f y) (g y)) s x := by simp only [dist_eq_norm]; exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align cont_diff_within_at.dist ContDiffWithinAt.dist theorem ContDiffOn.norm_sq (hf : ContDiffOn ℝ n f s) : ContDiffOn ℝ n (fun y => β€–f yβ€– ^ 2) s := fun x hx => (hf x hx).norm_sq π•œ #align cont_diff_on.norm_sq ContDiffOn.norm_sq theorem ContDiffOn.norm (hf : ContDiffOn ℝ n f s) (h0 : βˆ€ x ∈ s, f x β‰  0) : ContDiffOn ℝ n (fun y => β€–f yβ€–) s := fun x hx => (hf x hx).norm π•œ (h0 x hx) #align cont_diff_on.norm ContDiffOn.norm theorem ContDiffOn.dist (hf : ContDiffOn ℝ n f s) (hg : ContDiffOn ℝ n g s) (hne : βˆ€ x ∈ s, f x β‰  g x) : ContDiffOn ℝ n (fun y => dist (f y) (g y)) s := fun x hx => (hf x hx).dist π•œ (hg x hx) (hne x hx) #align cont_diff_on.dist ContDiffOn.dist theorem ContDiff.norm (hf : ContDiff ℝ n f) (h0 : βˆ€ x, f x β‰  0) : ContDiff ℝ n fun y => β€–f yβ€– := contDiff_iff_contDiffAt.2 fun x => hf.contDiffAt.norm π•œ (h0 x) #align cont_diff.norm ContDiff.norm theorem ContDiff.dist (hf : ContDiff ℝ n f) (hg : ContDiff ℝ n g) (hne : βˆ€ x, f x β‰  g x) : ContDiff ℝ n fun y => dist (f y) (g y) := contDiff_iff_contDiffAt.2 fun x => hf.contDiffAt.dist π•œ hg.contDiffAt (hne x) #align cont_diff.dist ContDiff.dist -- porting note: use `2 β€’` instead of `bit0` theorem hasStrictFDerivAt_norm_sq (x : F) : HasStrictFDerivAt (fun x => β€–xβ€– ^ 2) (2 β€’ (innerSL ℝ x)) x := by simp only [sq, ← @inner_self_eq_norm_mul_norm ℝ] convert (hasStrictFDerivAt_id x).inner ℝ (hasStrictFDerivAt_id x) ext y simp [two_smul, real_inner_comm] #align has_strict_fderiv_at_norm_sq hasStrictFDerivAt_norm_sqβ‚“ theorem HasFDerivAt.norm_sq {f : G β†’ F} {f' : G β†’L[ℝ] F} (hf : HasFDerivAt f f' x) : HasFDerivAt (β€–f Β·β€– ^ 2) (2 β€’ (innerSL ℝ (f x)).comp f') x := (hasStrictFDerivAt_norm_sq _).hasFDerivAt.comp x hf theorem HasDerivAt.norm_sq {f : ℝ β†’ F} {f' : F} {x : ℝ} (hf : HasDerivAt f f' x) : HasDerivAt (β€–f Β·β€– ^ 2) (2 * Inner.inner (f x) f') x := by simpa using hf.hasFDerivAt.norm_sq.hasDerivAt theorem HasFDerivWithinAt.norm_sq {f : G β†’ F} {f' : G β†’L[ℝ] F} (hf : HasFDerivWithinAt f f' s x) : HasFDerivWithinAt (β€–f Β·β€– ^ 2) (2 β€’ (innerSL ℝ (f x)).comp f') s x := (hasStrictFDerivAt_norm_sq _).hasFDerivAt.comp_hasFDerivWithinAt x hf theorem HasDerivWithinAt.norm_sq {f : ℝ β†’ F} {f' : F} {s : Set ℝ} {x : ℝ} (hf : HasDerivWithinAt f f' s x) : HasDerivWithinAt (β€–f Β·β€– ^ 2) (2 * Inner.inner (f x) f') s x := by simpa using hf.hasFDerivWithinAt.norm_sq.hasDerivWithinAt theorem DifferentiableAt.norm_sq (hf : DifferentiableAt ℝ f x) : DifferentiableAt ℝ (fun y => β€–f yβ€– ^ 2) x := ((contDiffAt_id.norm_sq π•œ).differentiableAt le_rfl).comp x hf #align differentiable_at.norm_sq DifferentiableAt.norm_sq theorem DifferentiableAt.norm (hf : DifferentiableAt ℝ f x) (h0 : f x β‰  0) : DifferentiableAt ℝ (fun y => β€–f yβ€–) x := ((contDiffAt_norm π•œ h0).differentiableAt le_rfl).comp x hf #align differentiable_at.norm DifferentiableAt.norm theorem DifferentiableAt.dist (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) (hne : f x β‰  g x) : DifferentiableAt ℝ (fun y => dist (f y) (g y)) x := by simp only [dist_eq_norm];
exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne)
theorem DifferentiableAt.dist (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) (hne : f x β‰  g x) : DifferentiableAt ℝ (fun y => dist (f y) (g y)) x := by simp only [dist_eq_norm];
Mathlib.Analysis.InnerProductSpace.Calculus.255_0.6FECEGgqdb67QLM
theorem DifferentiableAt.dist (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) (hne : f x β‰  g x) : DifferentiableAt ℝ (fun y => dist (f y) (g y)) x
Mathlib_Analysis_InnerProductSpace_Calculus
π•œ : Type u_1 E : Type u_2 F : Type u_3 inst✝⁷ : IsROrC π•œ inst✝⁢ : NormedAddCommGroup E inst✝⁡ : InnerProductSpace π•œ E inst✝⁴ : NormedAddCommGroup F inst✝³ : InnerProductSpace ℝ F inst✝² : NormedSpace ℝ E G : Type u_4 inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace ℝ G f g : G β†’ E f' g' : G β†’L[ℝ] E s : Set G x : G n : β„•βˆž hf : DifferentiableWithinAt ℝ f s x hg : DifferentiableWithinAt ℝ g s x hne : f x β‰  g x ⊒ DifferentiableWithinAt ℝ (fun y => Dist.dist (f y) (g y)) s x
/- Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ import Mathlib.Analysis.InnerProductSpace.PiL2 import Mathlib.Analysis.SpecialFunctions.Sqrt import Mathlib.Analysis.NormedSpace.HomeomorphBall #align_import analysis.inner_product_space.calculus from "leanprover-community/mathlib"@"f9dd3204df14a0749cd456fac1e6849dfe7d2b88" /-! # Calculus in inner product spaces In this file we prove that the inner product and square of the norm in an inner space are infinitely `ℝ`-smooth. In order to state these results, we need a `NormedSpace ℝ E` instance. Though we can deduce this structure from `InnerProductSpace π•œ E`, this instance may be not definitionally equal to some other β€œnatural” instance. So, we assume `[NormedSpace ℝ E]`. We also prove that functions to a `EuclideanSpace` are (higher) differentiable if and only if their components are. This follows from the corresponding fact for finite product of normed spaces, and from the equivalence of norms in finite dimensions. ## TODO The last part of the file should be generalized to `PiLp`. -/ noncomputable section open IsROrC Real Filter open scoped BigOperators Classical Topology section DerivInner variable {π•œ E F : Type*} [IsROrC π•œ] variable [NormedAddCommGroup E] [InnerProductSpace π•œ E] variable [NormedAddCommGroup F] [InnerProductSpace ℝ F] local notation "βŸͺ" x ", " y "⟫" => @inner π•œ _ _ x y variable (π•œ) [NormedSpace ℝ E] /-- Derivative of the inner product. -/ def fderivInnerClm (p : E Γ— E) : E Γ— E β†’L[ℝ] π•œ := isBoundedBilinearMap_inner.deriv p #align fderiv_inner_clm fderivInnerClm @[simp] theorem fderivInnerClm_apply (p x : E Γ— E) : fderivInnerClm π•œ p x = βŸͺp.1, x.2⟫ + βŸͺx.1, p.2⟫ := rfl #align fderiv_inner_clm_apply fderivInnerClm_apply variable {π•œ} -- porting note: Lean 3 magically switches back to `{π•œ}` here theorem contDiff_inner {n} : ContDiff ℝ n fun p : E Γ— E => βŸͺp.1, p.2⟫ := isBoundedBilinearMap_inner.contDiff #align cont_diff_inner contDiff_inner theorem contDiffAt_inner {p : E Γ— E} {n} : ContDiffAt ℝ n (fun p : E Γ— E => βŸͺp.1, p.2⟫) p := ContDiff.contDiffAt contDiff_inner #align cont_diff_at_inner contDiffAt_inner theorem differentiable_inner : Differentiable ℝ fun p : E Γ— E => βŸͺp.1, p.2⟫ := isBoundedBilinearMap_inner.differentiableAt #align differentiable_inner differentiable_inner variable (π•œ) variable {G : Type*} [NormedAddCommGroup G] [NormedSpace ℝ G] {f g : G β†’ E} {f' g' : G β†’L[ℝ] E} {s : Set G} {x : G} {n : β„•βˆž} theorem ContDiffWithinAt.inner (hf : ContDiffWithinAt ℝ n f s x) (hg : ContDiffWithinAt ℝ n g s x) : ContDiffWithinAt ℝ n (fun x => βŸͺf x, g x⟫) s x := contDiffAt_inner.comp_contDiffWithinAt x (hf.prod hg) #align cont_diff_within_at.inner ContDiffWithinAt.inner nonrec theorem ContDiffAt.inner (hf : ContDiffAt ℝ n f x) (hg : ContDiffAt ℝ n g x) : ContDiffAt ℝ n (fun x => βŸͺf x, g x⟫) x := hf.inner π•œ hg #align cont_diff_at.inner ContDiffAt.inner theorem ContDiffOn.inner (hf : ContDiffOn ℝ n f s) (hg : ContDiffOn ℝ n g s) : ContDiffOn ℝ n (fun x => βŸͺf x, g x⟫) s := fun x hx => (hf x hx).inner π•œ (hg x hx) #align cont_diff_on.inner ContDiffOn.inner theorem ContDiff.inner (hf : ContDiff ℝ n f) (hg : ContDiff ℝ n g) : ContDiff ℝ n fun x => βŸͺf x, g x⟫ := contDiff_inner.comp (hf.prod hg) #align cont_diff.inner ContDiff.inner theorem HasFDerivWithinAt.inner (hf : HasFDerivWithinAt f f' s x) (hg : HasFDerivWithinAt g g' s x) : HasFDerivWithinAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') s x := (isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp_hasFDerivWithinAt x (hf.prod hg) #align has_fderiv_within_at.inner HasFDerivWithinAt.inner theorem HasStrictFDerivAt.inner (hf : HasStrictFDerivAt f f' x) (hg : HasStrictFDerivAt g g' x) : HasStrictFDerivAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') x := (isBoundedBilinearMap_inner.hasStrictFDerivAt (f x, g x)).comp x (hf.prod hg) #align has_strict_fderiv_at.inner HasStrictFDerivAt.inner theorem HasFDerivAt.inner (hf : HasFDerivAt f f' x) (hg : HasFDerivAt g g' x) : HasFDerivAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') x := (isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp x (hf.prod hg) #align has_fderiv_at.inner HasFDerivAt.inner theorem HasDerivWithinAt.inner {f g : ℝ β†’ E} {f' g' : E} {s : Set ℝ} {x : ℝ} (hf : HasDerivWithinAt f f' s x) (hg : HasDerivWithinAt g g' s x) : HasDerivWithinAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) s x := by simpa using (hf.hasFDerivWithinAt.inner π•œ hg.hasFDerivWithinAt).hasDerivWithinAt #align has_deriv_within_at.inner HasDerivWithinAt.inner theorem HasDerivAt.inner {f g : ℝ β†’ E} {f' g' : E} {x : ℝ} : HasDerivAt f f' x β†’ HasDerivAt g g' x β†’ HasDerivAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) x := by simpa only [← hasDerivWithinAt_univ] using HasDerivWithinAt.inner π•œ #align has_deriv_at.inner HasDerivAt.inner theorem DifferentiableWithinAt.inner (hf : DifferentiableWithinAt ℝ f s x) (hg : DifferentiableWithinAt ℝ g s x) : DifferentiableWithinAt ℝ (fun x => βŸͺf x, g x⟫) s x := ((differentiable_inner _).hasFDerivAt.comp_hasFDerivWithinAt x (hf.prod hg).hasFDerivWithinAt).differentiableWithinAt #align differentiable_within_at.inner DifferentiableWithinAt.inner theorem DifferentiableAt.inner (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) : DifferentiableAt ℝ (fun x => βŸͺf x, g x⟫) x := (differentiable_inner _).comp x (hf.prod hg) #align differentiable_at.inner DifferentiableAt.inner theorem DifferentiableOn.inner (hf : DifferentiableOn ℝ f s) (hg : DifferentiableOn ℝ g s) : DifferentiableOn ℝ (fun x => βŸͺf x, g x⟫) s := fun x hx => (hf x hx).inner π•œ (hg x hx) #align differentiable_on.inner DifferentiableOn.inner theorem Differentiable.inner (hf : Differentiable ℝ f) (hg : Differentiable ℝ g) : Differentiable ℝ fun x => βŸͺf x, g x⟫ := fun x => (hf x).inner π•œ (hg x) #align differentiable.inner Differentiable.inner theorem fderiv_inner_apply (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) (y : G) : fderiv ℝ (fun t => βŸͺf t, g t⟫) x y = βŸͺf x, fderiv ℝ g x y⟫ + βŸͺfderiv ℝ f x y, g x⟫ := by rw [(hf.hasFDerivAt.inner π•œ hg.hasFDerivAt).fderiv]; rfl #align fderiv_inner_apply fderiv_inner_apply theorem deriv_inner_apply {f g : ℝ β†’ E} {x : ℝ} (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) : deriv (fun t => βŸͺf t, g t⟫) x = βŸͺf x, deriv g x⟫ + βŸͺderiv f x, g x⟫ := (hf.hasDerivAt.inner π•œ hg.hasDerivAt).deriv #align deriv_inner_apply deriv_inner_apply theorem contDiff_norm_sq : ContDiff ℝ n fun x : E => β€–xβ€– ^ 2 := by convert (reClm : π•œ β†’L[ℝ] ℝ).contDiff.comp ((contDiff_id (E := E)).inner π•œ (contDiff_id (E := E))) exact (inner_self_eq_norm_sq _).symm #align cont_diff_norm_sq contDiff_norm_sq theorem ContDiff.norm_sq (hf : ContDiff ℝ n f) : ContDiff ℝ n fun x => β€–f xβ€– ^ 2 := (contDiff_norm_sq π•œ).comp hf #align cont_diff.norm_sq ContDiff.norm_sq theorem ContDiffWithinAt.norm_sq (hf : ContDiffWithinAt ℝ n f s x) : ContDiffWithinAt ℝ n (fun y => β€–f yβ€– ^ 2) s x := (contDiff_norm_sq π•œ).contDiffAt.comp_contDiffWithinAt x hf #align cont_diff_within_at.norm_sq ContDiffWithinAt.norm_sq nonrec theorem ContDiffAt.norm_sq (hf : ContDiffAt ℝ n f x) : ContDiffAt ℝ n (β€–f Β·β€– ^ 2) x := hf.norm_sq π•œ #align cont_diff_at.norm_sq ContDiffAt.norm_sq theorem contDiffAt_norm {x : E} (hx : x β‰  0) : ContDiffAt ℝ n norm x := by have : β€–id xβ€– ^ 2 β‰  0 := pow_ne_zero 2 (norm_pos_iff.2 hx).ne' simpa only [id, sqrt_sq, norm_nonneg] using (contDiffAt_id.norm_sq π•œ).sqrt this #align cont_diff_at_norm contDiffAt_norm theorem ContDiffAt.norm (hf : ContDiffAt ℝ n f x) (h0 : f x β‰  0) : ContDiffAt ℝ n (fun y => β€–f yβ€–) x := (contDiffAt_norm π•œ h0).comp x hf #align cont_diff_at.norm ContDiffAt.norm theorem ContDiffAt.dist (hf : ContDiffAt ℝ n f x) (hg : ContDiffAt ℝ n g x) (hne : f x β‰  g x) : ContDiffAt ℝ n (fun y => dist (f y) (g y)) x := by simp only [dist_eq_norm] exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align cont_diff_at.dist ContDiffAt.dist theorem ContDiffWithinAt.norm (hf : ContDiffWithinAt ℝ n f s x) (h0 : f x β‰  0) : ContDiffWithinAt ℝ n (fun y => β€–f yβ€–) s x := (contDiffAt_norm π•œ h0).comp_contDiffWithinAt x hf #align cont_diff_within_at.norm ContDiffWithinAt.norm theorem ContDiffWithinAt.dist (hf : ContDiffWithinAt ℝ n f s x) (hg : ContDiffWithinAt ℝ n g s x) (hne : f x β‰  g x) : ContDiffWithinAt ℝ n (fun y => dist (f y) (g y)) s x := by simp only [dist_eq_norm]; exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align cont_diff_within_at.dist ContDiffWithinAt.dist theorem ContDiffOn.norm_sq (hf : ContDiffOn ℝ n f s) : ContDiffOn ℝ n (fun y => β€–f yβ€– ^ 2) s := fun x hx => (hf x hx).norm_sq π•œ #align cont_diff_on.norm_sq ContDiffOn.norm_sq theorem ContDiffOn.norm (hf : ContDiffOn ℝ n f s) (h0 : βˆ€ x ∈ s, f x β‰  0) : ContDiffOn ℝ n (fun y => β€–f yβ€–) s := fun x hx => (hf x hx).norm π•œ (h0 x hx) #align cont_diff_on.norm ContDiffOn.norm theorem ContDiffOn.dist (hf : ContDiffOn ℝ n f s) (hg : ContDiffOn ℝ n g s) (hne : βˆ€ x ∈ s, f x β‰  g x) : ContDiffOn ℝ n (fun y => dist (f y) (g y)) s := fun x hx => (hf x hx).dist π•œ (hg x hx) (hne x hx) #align cont_diff_on.dist ContDiffOn.dist theorem ContDiff.norm (hf : ContDiff ℝ n f) (h0 : βˆ€ x, f x β‰  0) : ContDiff ℝ n fun y => β€–f yβ€– := contDiff_iff_contDiffAt.2 fun x => hf.contDiffAt.norm π•œ (h0 x) #align cont_diff.norm ContDiff.norm theorem ContDiff.dist (hf : ContDiff ℝ n f) (hg : ContDiff ℝ n g) (hne : βˆ€ x, f x β‰  g x) : ContDiff ℝ n fun y => dist (f y) (g y) := contDiff_iff_contDiffAt.2 fun x => hf.contDiffAt.dist π•œ hg.contDiffAt (hne x) #align cont_diff.dist ContDiff.dist -- porting note: use `2 β€’` instead of `bit0` theorem hasStrictFDerivAt_norm_sq (x : F) : HasStrictFDerivAt (fun x => β€–xβ€– ^ 2) (2 β€’ (innerSL ℝ x)) x := by simp only [sq, ← @inner_self_eq_norm_mul_norm ℝ] convert (hasStrictFDerivAt_id x).inner ℝ (hasStrictFDerivAt_id x) ext y simp [two_smul, real_inner_comm] #align has_strict_fderiv_at_norm_sq hasStrictFDerivAt_norm_sqβ‚“ theorem HasFDerivAt.norm_sq {f : G β†’ F} {f' : G β†’L[ℝ] F} (hf : HasFDerivAt f f' x) : HasFDerivAt (β€–f Β·β€– ^ 2) (2 β€’ (innerSL ℝ (f x)).comp f') x := (hasStrictFDerivAt_norm_sq _).hasFDerivAt.comp x hf theorem HasDerivAt.norm_sq {f : ℝ β†’ F} {f' : F} {x : ℝ} (hf : HasDerivAt f f' x) : HasDerivAt (β€–f Β·β€– ^ 2) (2 * Inner.inner (f x) f') x := by simpa using hf.hasFDerivAt.norm_sq.hasDerivAt theorem HasFDerivWithinAt.norm_sq {f : G β†’ F} {f' : G β†’L[ℝ] F} (hf : HasFDerivWithinAt f f' s x) : HasFDerivWithinAt (β€–f Β·β€– ^ 2) (2 β€’ (innerSL ℝ (f x)).comp f') s x := (hasStrictFDerivAt_norm_sq _).hasFDerivAt.comp_hasFDerivWithinAt x hf theorem HasDerivWithinAt.norm_sq {f : ℝ β†’ F} {f' : F} {s : Set ℝ} {x : ℝ} (hf : HasDerivWithinAt f f' s x) : HasDerivWithinAt (β€–f Β·β€– ^ 2) (2 * Inner.inner (f x) f') s x := by simpa using hf.hasFDerivWithinAt.norm_sq.hasDerivWithinAt theorem DifferentiableAt.norm_sq (hf : DifferentiableAt ℝ f x) : DifferentiableAt ℝ (fun y => β€–f yβ€– ^ 2) x := ((contDiffAt_id.norm_sq π•œ).differentiableAt le_rfl).comp x hf #align differentiable_at.norm_sq DifferentiableAt.norm_sq theorem DifferentiableAt.norm (hf : DifferentiableAt ℝ f x) (h0 : f x β‰  0) : DifferentiableAt ℝ (fun y => β€–f yβ€–) x := ((contDiffAt_norm π•œ h0).differentiableAt le_rfl).comp x hf #align differentiable_at.norm DifferentiableAt.norm theorem DifferentiableAt.dist (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) (hne : f x β‰  g x) : DifferentiableAt ℝ (fun y => dist (f y) (g y)) x := by simp only [dist_eq_norm]; exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align differentiable_at.dist DifferentiableAt.dist theorem Differentiable.norm_sq (hf : Differentiable ℝ f) : Differentiable ℝ fun y => β€–f yβ€– ^ 2 := fun x => (hf x).norm_sq π•œ #align differentiable.norm_sq Differentiable.norm_sq theorem Differentiable.norm (hf : Differentiable ℝ f) (h0 : βˆ€ x, f x β‰  0) : Differentiable ℝ fun y => β€–f yβ€– := fun x => (hf x).norm π•œ (h0 x) #align differentiable.norm Differentiable.norm theorem Differentiable.dist (hf : Differentiable ℝ f) (hg : Differentiable ℝ g) (hne : βˆ€ x, f x β‰  g x) : Differentiable ℝ fun y => dist (f y) (g y) := fun x => (hf x).dist π•œ (hg x) (hne x) #align differentiable.dist Differentiable.dist theorem DifferentiableWithinAt.norm_sq (hf : DifferentiableWithinAt ℝ f s x) : DifferentiableWithinAt ℝ (fun y => β€–f yβ€– ^ 2) s x := ((contDiffAt_id.norm_sq π•œ).differentiableAt le_rfl).comp_differentiableWithinAt x hf #align differentiable_within_at.norm_sq DifferentiableWithinAt.norm_sq theorem DifferentiableWithinAt.norm (hf : DifferentiableWithinAt ℝ f s x) (h0 : f x β‰  0) : DifferentiableWithinAt ℝ (fun y => β€–f yβ€–) s x := ((contDiffAt_id.norm π•œ h0).differentiableAt le_rfl).comp_differentiableWithinAt x hf #align differentiable_within_at.norm DifferentiableWithinAt.norm theorem DifferentiableWithinAt.dist (hf : DifferentiableWithinAt ℝ f s x) (hg : DifferentiableWithinAt ℝ g s x) (hne : f x β‰  g x) : DifferentiableWithinAt ℝ (fun y => dist (f y) (g y)) s x := by
simp only [dist_eq_norm]
theorem DifferentiableWithinAt.dist (hf : DifferentiableWithinAt ℝ f s x) (hg : DifferentiableWithinAt ℝ g s x) (hne : f x β‰  g x) : DifferentiableWithinAt ℝ (fun y => dist (f y) (g y)) s x := by
Mathlib.Analysis.InnerProductSpace.Calculus.283_0.6FECEGgqdb67QLM
theorem DifferentiableWithinAt.dist (hf : DifferentiableWithinAt ℝ f s x) (hg : DifferentiableWithinAt ℝ g s x) (hne : f x β‰  g x) : DifferentiableWithinAt ℝ (fun y => dist (f y) (g y)) s x
Mathlib_Analysis_InnerProductSpace_Calculus
π•œ : Type u_1 E : Type u_2 F : Type u_3 inst✝⁷ : IsROrC π•œ inst✝⁢ : NormedAddCommGroup E inst✝⁡ : InnerProductSpace π•œ E inst✝⁴ : NormedAddCommGroup F inst✝³ : InnerProductSpace ℝ F inst✝² : NormedSpace ℝ E G : Type u_4 inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace ℝ G f g : G β†’ E f' g' : G β†’L[ℝ] E s : Set G x : G n : β„•βˆž hf : DifferentiableWithinAt ℝ f s x hg : DifferentiableWithinAt ℝ g s x hne : f x β‰  g x ⊒ DifferentiableWithinAt ℝ (fun y => β€–f y - g yβ€–) s x
/- Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ import Mathlib.Analysis.InnerProductSpace.PiL2 import Mathlib.Analysis.SpecialFunctions.Sqrt import Mathlib.Analysis.NormedSpace.HomeomorphBall #align_import analysis.inner_product_space.calculus from "leanprover-community/mathlib"@"f9dd3204df14a0749cd456fac1e6849dfe7d2b88" /-! # Calculus in inner product spaces In this file we prove that the inner product and square of the norm in an inner space are infinitely `ℝ`-smooth. In order to state these results, we need a `NormedSpace ℝ E` instance. Though we can deduce this structure from `InnerProductSpace π•œ E`, this instance may be not definitionally equal to some other β€œnatural” instance. So, we assume `[NormedSpace ℝ E]`. We also prove that functions to a `EuclideanSpace` are (higher) differentiable if and only if their components are. This follows from the corresponding fact for finite product of normed spaces, and from the equivalence of norms in finite dimensions. ## TODO The last part of the file should be generalized to `PiLp`. -/ noncomputable section open IsROrC Real Filter open scoped BigOperators Classical Topology section DerivInner variable {π•œ E F : Type*} [IsROrC π•œ] variable [NormedAddCommGroup E] [InnerProductSpace π•œ E] variable [NormedAddCommGroup F] [InnerProductSpace ℝ F] local notation "βŸͺ" x ", " y "⟫" => @inner π•œ _ _ x y variable (π•œ) [NormedSpace ℝ E] /-- Derivative of the inner product. -/ def fderivInnerClm (p : E Γ— E) : E Γ— E β†’L[ℝ] π•œ := isBoundedBilinearMap_inner.deriv p #align fderiv_inner_clm fderivInnerClm @[simp] theorem fderivInnerClm_apply (p x : E Γ— E) : fderivInnerClm π•œ p x = βŸͺp.1, x.2⟫ + βŸͺx.1, p.2⟫ := rfl #align fderiv_inner_clm_apply fderivInnerClm_apply variable {π•œ} -- porting note: Lean 3 magically switches back to `{π•œ}` here theorem contDiff_inner {n} : ContDiff ℝ n fun p : E Γ— E => βŸͺp.1, p.2⟫ := isBoundedBilinearMap_inner.contDiff #align cont_diff_inner contDiff_inner theorem contDiffAt_inner {p : E Γ— E} {n} : ContDiffAt ℝ n (fun p : E Γ— E => βŸͺp.1, p.2⟫) p := ContDiff.contDiffAt contDiff_inner #align cont_diff_at_inner contDiffAt_inner theorem differentiable_inner : Differentiable ℝ fun p : E Γ— E => βŸͺp.1, p.2⟫ := isBoundedBilinearMap_inner.differentiableAt #align differentiable_inner differentiable_inner variable (π•œ) variable {G : Type*} [NormedAddCommGroup G] [NormedSpace ℝ G] {f g : G β†’ E} {f' g' : G β†’L[ℝ] E} {s : Set G} {x : G} {n : β„•βˆž} theorem ContDiffWithinAt.inner (hf : ContDiffWithinAt ℝ n f s x) (hg : ContDiffWithinAt ℝ n g s x) : ContDiffWithinAt ℝ n (fun x => βŸͺf x, g x⟫) s x := contDiffAt_inner.comp_contDiffWithinAt x (hf.prod hg) #align cont_diff_within_at.inner ContDiffWithinAt.inner nonrec theorem ContDiffAt.inner (hf : ContDiffAt ℝ n f x) (hg : ContDiffAt ℝ n g x) : ContDiffAt ℝ n (fun x => βŸͺf x, g x⟫) x := hf.inner π•œ hg #align cont_diff_at.inner ContDiffAt.inner theorem ContDiffOn.inner (hf : ContDiffOn ℝ n f s) (hg : ContDiffOn ℝ n g s) : ContDiffOn ℝ n (fun x => βŸͺf x, g x⟫) s := fun x hx => (hf x hx).inner π•œ (hg x hx) #align cont_diff_on.inner ContDiffOn.inner theorem ContDiff.inner (hf : ContDiff ℝ n f) (hg : ContDiff ℝ n g) : ContDiff ℝ n fun x => βŸͺf x, g x⟫ := contDiff_inner.comp (hf.prod hg) #align cont_diff.inner ContDiff.inner theorem HasFDerivWithinAt.inner (hf : HasFDerivWithinAt f f' s x) (hg : HasFDerivWithinAt g g' s x) : HasFDerivWithinAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') s x := (isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp_hasFDerivWithinAt x (hf.prod hg) #align has_fderiv_within_at.inner HasFDerivWithinAt.inner theorem HasStrictFDerivAt.inner (hf : HasStrictFDerivAt f f' x) (hg : HasStrictFDerivAt g g' x) : HasStrictFDerivAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') x := (isBoundedBilinearMap_inner.hasStrictFDerivAt (f x, g x)).comp x (hf.prod hg) #align has_strict_fderiv_at.inner HasStrictFDerivAt.inner theorem HasFDerivAt.inner (hf : HasFDerivAt f f' x) (hg : HasFDerivAt g g' x) : HasFDerivAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') x := (isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp x (hf.prod hg) #align has_fderiv_at.inner HasFDerivAt.inner theorem HasDerivWithinAt.inner {f g : ℝ β†’ E} {f' g' : E} {s : Set ℝ} {x : ℝ} (hf : HasDerivWithinAt f f' s x) (hg : HasDerivWithinAt g g' s x) : HasDerivWithinAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) s x := by simpa using (hf.hasFDerivWithinAt.inner π•œ hg.hasFDerivWithinAt).hasDerivWithinAt #align has_deriv_within_at.inner HasDerivWithinAt.inner theorem HasDerivAt.inner {f g : ℝ β†’ E} {f' g' : E} {x : ℝ} : HasDerivAt f f' x β†’ HasDerivAt g g' x β†’ HasDerivAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) x := by simpa only [← hasDerivWithinAt_univ] using HasDerivWithinAt.inner π•œ #align has_deriv_at.inner HasDerivAt.inner theorem DifferentiableWithinAt.inner (hf : DifferentiableWithinAt ℝ f s x) (hg : DifferentiableWithinAt ℝ g s x) : DifferentiableWithinAt ℝ (fun x => βŸͺf x, g x⟫) s x := ((differentiable_inner _).hasFDerivAt.comp_hasFDerivWithinAt x (hf.prod hg).hasFDerivWithinAt).differentiableWithinAt #align differentiable_within_at.inner DifferentiableWithinAt.inner theorem DifferentiableAt.inner (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) : DifferentiableAt ℝ (fun x => βŸͺf x, g x⟫) x := (differentiable_inner _).comp x (hf.prod hg) #align differentiable_at.inner DifferentiableAt.inner theorem DifferentiableOn.inner (hf : DifferentiableOn ℝ f s) (hg : DifferentiableOn ℝ g s) : DifferentiableOn ℝ (fun x => βŸͺf x, g x⟫) s := fun x hx => (hf x hx).inner π•œ (hg x hx) #align differentiable_on.inner DifferentiableOn.inner theorem Differentiable.inner (hf : Differentiable ℝ f) (hg : Differentiable ℝ g) : Differentiable ℝ fun x => βŸͺf x, g x⟫ := fun x => (hf x).inner π•œ (hg x) #align differentiable.inner Differentiable.inner theorem fderiv_inner_apply (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) (y : G) : fderiv ℝ (fun t => βŸͺf t, g t⟫) x y = βŸͺf x, fderiv ℝ g x y⟫ + βŸͺfderiv ℝ f x y, g x⟫ := by rw [(hf.hasFDerivAt.inner π•œ hg.hasFDerivAt).fderiv]; rfl #align fderiv_inner_apply fderiv_inner_apply theorem deriv_inner_apply {f g : ℝ β†’ E} {x : ℝ} (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) : deriv (fun t => βŸͺf t, g t⟫) x = βŸͺf x, deriv g x⟫ + βŸͺderiv f x, g x⟫ := (hf.hasDerivAt.inner π•œ hg.hasDerivAt).deriv #align deriv_inner_apply deriv_inner_apply theorem contDiff_norm_sq : ContDiff ℝ n fun x : E => β€–xβ€– ^ 2 := by convert (reClm : π•œ β†’L[ℝ] ℝ).contDiff.comp ((contDiff_id (E := E)).inner π•œ (contDiff_id (E := E))) exact (inner_self_eq_norm_sq _).symm #align cont_diff_norm_sq contDiff_norm_sq theorem ContDiff.norm_sq (hf : ContDiff ℝ n f) : ContDiff ℝ n fun x => β€–f xβ€– ^ 2 := (contDiff_norm_sq π•œ).comp hf #align cont_diff.norm_sq ContDiff.norm_sq theorem ContDiffWithinAt.norm_sq (hf : ContDiffWithinAt ℝ n f s x) : ContDiffWithinAt ℝ n (fun y => β€–f yβ€– ^ 2) s x := (contDiff_norm_sq π•œ).contDiffAt.comp_contDiffWithinAt x hf #align cont_diff_within_at.norm_sq ContDiffWithinAt.norm_sq nonrec theorem ContDiffAt.norm_sq (hf : ContDiffAt ℝ n f x) : ContDiffAt ℝ n (β€–f Β·β€– ^ 2) x := hf.norm_sq π•œ #align cont_diff_at.norm_sq ContDiffAt.norm_sq theorem contDiffAt_norm {x : E} (hx : x β‰  0) : ContDiffAt ℝ n norm x := by have : β€–id xβ€– ^ 2 β‰  0 := pow_ne_zero 2 (norm_pos_iff.2 hx).ne' simpa only [id, sqrt_sq, norm_nonneg] using (contDiffAt_id.norm_sq π•œ).sqrt this #align cont_diff_at_norm contDiffAt_norm theorem ContDiffAt.norm (hf : ContDiffAt ℝ n f x) (h0 : f x β‰  0) : ContDiffAt ℝ n (fun y => β€–f yβ€–) x := (contDiffAt_norm π•œ h0).comp x hf #align cont_diff_at.norm ContDiffAt.norm theorem ContDiffAt.dist (hf : ContDiffAt ℝ n f x) (hg : ContDiffAt ℝ n g x) (hne : f x β‰  g x) : ContDiffAt ℝ n (fun y => dist (f y) (g y)) x := by simp only [dist_eq_norm] exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align cont_diff_at.dist ContDiffAt.dist theorem ContDiffWithinAt.norm (hf : ContDiffWithinAt ℝ n f s x) (h0 : f x β‰  0) : ContDiffWithinAt ℝ n (fun y => β€–f yβ€–) s x := (contDiffAt_norm π•œ h0).comp_contDiffWithinAt x hf #align cont_diff_within_at.norm ContDiffWithinAt.norm theorem ContDiffWithinAt.dist (hf : ContDiffWithinAt ℝ n f s x) (hg : ContDiffWithinAt ℝ n g s x) (hne : f x β‰  g x) : ContDiffWithinAt ℝ n (fun y => dist (f y) (g y)) s x := by simp only [dist_eq_norm]; exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align cont_diff_within_at.dist ContDiffWithinAt.dist theorem ContDiffOn.norm_sq (hf : ContDiffOn ℝ n f s) : ContDiffOn ℝ n (fun y => β€–f yβ€– ^ 2) s := fun x hx => (hf x hx).norm_sq π•œ #align cont_diff_on.norm_sq ContDiffOn.norm_sq theorem ContDiffOn.norm (hf : ContDiffOn ℝ n f s) (h0 : βˆ€ x ∈ s, f x β‰  0) : ContDiffOn ℝ n (fun y => β€–f yβ€–) s := fun x hx => (hf x hx).norm π•œ (h0 x hx) #align cont_diff_on.norm ContDiffOn.norm theorem ContDiffOn.dist (hf : ContDiffOn ℝ n f s) (hg : ContDiffOn ℝ n g s) (hne : βˆ€ x ∈ s, f x β‰  g x) : ContDiffOn ℝ n (fun y => dist (f y) (g y)) s := fun x hx => (hf x hx).dist π•œ (hg x hx) (hne x hx) #align cont_diff_on.dist ContDiffOn.dist theorem ContDiff.norm (hf : ContDiff ℝ n f) (h0 : βˆ€ x, f x β‰  0) : ContDiff ℝ n fun y => β€–f yβ€– := contDiff_iff_contDiffAt.2 fun x => hf.contDiffAt.norm π•œ (h0 x) #align cont_diff.norm ContDiff.norm theorem ContDiff.dist (hf : ContDiff ℝ n f) (hg : ContDiff ℝ n g) (hne : βˆ€ x, f x β‰  g x) : ContDiff ℝ n fun y => dist (f y) (g y) := contDiff_iff_contDiffAt.2 fun x => hf.contDiffAt.dist π•œ hg.contDiffAt (hne x) #align cont_diff.dist ContDiff.dist -- porting note: use `2 β€’` instead of `bit0` theorem hasStrictFDerivAt_norm_sq (x : F) : HasStrictFDerivAt (fun x => β€–xβ€– ^ 2) (2 β€’ (innerSL ℝ x)) x := by simp only [sq, ← @inner_self_eq_norm_mul_norm ℝ] convert (hasStrictFDerivAt_id x).inner ℝ (hasStrictFDerivAt_id x) ext y simp [two_smul, real_inner_comm] #align has_strict_fderiv_at_norm_sq hasStrictFDerivAt_norm_sqβ‚“ theorem HasFDerivAt.norm_sq {f : G β†’ F} {f' : G β†’L[ℝ] F} (hf : HasFDerivAt f f' x) : HasFDerivAt (β€–f Β·β€– ^ 2) (2 β€’ (innerSL ℝ (f x)).comp f') x := (hasStrictFDerivAt_norm_sq _).hasFDerivAt.comp x hf theorem HasDerivAt.norm_sq {f : ℝ β†’ F} {f' : F} {x : ℝ} (hf : HasDerivAt f f' x) : HasDerivAt (β€–f Β·β€– ^ 2) (2 * Inner.inner (f x) f') x := by simpa using hf.hasFDerivAt.norm_sq.hasDerivAt theorem HasFDerivWithinAt.norm_sq {f : G β†’ F} {f' : G β†’L[ℝ] F} (hf : HasFDerivWithinAt f f' s x) : HasFDerivWithinAt (β€–f Β·β€– ^ 2) (2 β€’ (innerSL ℝ (f x)).comp f') s x := (hasStrictFDerivAt_norm_sq _).hasFDerivAt.comp_hasFDerivWithinAt x hf theorem HasDerivWithinAt.norm_sq {f : ℝ β†’ F} {f' : F} {s : Set ℝ} {x : ℝ} (hf : HasDerivWithinAt f f' s x) : HasDerivWithinAt (β€–f Β·β€– ^ 2) (2 * Inner.inner (f x) f') s x := by simpa using hf.hasFDerivWithinAt.norm_sq.hasDerivWithinAt theorem DifferentiableAt.norm_sq (hf : DifferentiableAt ℝ f x) : DifferentiableAt ℝ (fun y => β€–f yβ€– ^ 2) x := ((contDiffAt_id.norm_sq π•œ).differentiableAt le_rfl).comp x hf #align differentiable_at.norm_sq DifferentiableAt.norm_sq theorem DifferentiableAt.norm (hf : DifferentiableAt ℝ f x) (h0 : f x β‰  0) : DifferentiableAt ℝ (fun y => β€–f yβ€–) x := ((contDiffAt_norm π•œ h0).differentiableAt le_rfl).comp x hf #align differentiable_at.norm DifferentiableAt.norm theorem DifferentiableAt.dist (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) (hne : f x β‰  g x) : DifferentiableAt ℝ (fun y => dist (f y) (g y)) x := by simp only [dist_eq_norm]; exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align differentiable_at.dist DifferentiableAt.dist theorem Differentiable.norm_sq (hf : Differentiable ℝ f) : Differentiable ℝ fun y => β€–f yβ€– ^ 2 := fun x => (hf x).norm_sq π•œ #align differentiable.norm_sq Differentiable.norm_sq theorem Differentiable.norm (hf : Differentiable ℝ f) (h0 : βˆ€ x, f x β‰  0) : Differentiable ℝ fun y => β€–f yβ€– := fun x => (hf x).norm π•œ (h0 x) #align differentiable.norm Differentiable.norm theorem Differentiable.dist (hf : Differentiable ℝ f) (hg : Differentiable ℝ g) (hne : βˆ€ x, f x β‰  g x) : Differentiable ℝ fun y => dist (f y) (g y) := fun x => (hf x).dist π•œ (hg x) (hne x) #align differentiable.dist Differentiable.dist theorem DifferentiableWithinAt.norm_sq (hf : DifferentiableWithinAt ℝ f s x) : DifferentiableWithinAt ℝ (fun y => β€–f yβ€– ^ 2) s x := ((contDiffAt_id.norm_sq π•œ).differentiableAt le_rfl).comp_differentiableWithinAt x hf #align differentiable_within_at.norm_sq DifferentiableWithinAt.norm_sq theorem DifferentiableWithinAt.norm (hf : DifferentiableWithinAt ℝ f s x) (h0 : f x β‰  0) : DifferentiableWithinAt ℝ (fun y => β€–f yβ€–) s x := ((contDiffAt_id.norm π•œ h0).differentiableAt le_rfl).comp_differentiableWithinAt x hf #align differentiable_within_at.norm DifferentiableWithinAt.norm theorem DifferentiableWithinAt.dist (hf : DifferentiableWithinAt ℝ f s x) (hg : DifferentiableWithinAt ℝ g s x) (hne : f x β‰  g x) : DifferentiableWithinAt ℝ (fun y => dist (f y) (g y)) s x := by simp only [dist_eq_norm]
exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne)
theorem DifferentiableWithinAt.dist (hf : DifferentiableWithinAt ℝ f s x) (hg : DifferentiableWithinAt ℝ g s x) (hne : f x β‰  g x) : DifferentiableWithinAt ℝ (fun y => dist (f y) (g y)) s x := by simp only [dist_eq_norm]
Mathlib.Analysis.InnerProductSpace.Calculus.283_0.6FECEGgqdb67QLM
theorem DifferentiableWithinAt.dist (hf : DifferentiableWithinAt ℝ f s x) (hg : DifferentiableWithinAt ℝ g s x) (hne : f x β‰  g x) : DifferentiableWithinAt ℝ (fun y => dist (f y) (g y)) s x
Mathlib_Analysis_InnerProductSpace_Calculus
π•œ : Type u_1 ΞΉ : Type u_2 H : Type u_3 inst✝³ : IsROrC π•œ inst✝² : NormedAddCommGroup H inst✝¹ : NormedSpace π•œ H inst✝ : Fintype ΞΉ f : H β†’ EuclideanSpace π•œ ΞΉ f' : H β†’L[π•œ] EuclideanSpace π•œ ΞΉ t : Set H y : H ⊒ DifferentiableWithinAt π•œ f t y ↔ βˆ€ (i : ΞΉ), DifferentiableWithinAt π•œ (fun x => f x i) t y
/- Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ import Mathlib.Analysis.InnerProductSpace.PiL2 import Mathlib.Analysis.SpecialFunctions.Sqrt import Mathlib.Analysis.NormedSpace.HomeomorphBall #align_import analysis.inner_product_space.calculus from "leanprover-community/mathlib"@"f9dd3204df14a0749cd456fac1e6849dfe7d2b88" /-! # Calculus in inner product spaces In this file we prove that the inner product and square of the norm in an inner space are infinitely `ℝ`-smooth. In order to state these results, we need a `NormedSpace ℝ E` instance. Though we can deduce this structure from `InnerProductSpace π•œ E`, this instance may be not definitionally equal to some other β€œnatural” instance. So, we assume `[NormedSpace ℝ E]`. We also prove that functions to a `EuclideanSpace` are (higher) differentiable if and only if their components are. This follows from the corresponding fact for finite product of normed spaces, and from the equivalence of norms in finite dimensions. ## TODO The last part of the file should be generalized to `PiLp`. -/ noncomputable section open IsROrC Real Filter open scoped BigOperators Classical Topology section DerivInner variable {π•œ E F : Type*} [IsROrC π•œ] variable [NormedAddCommGroup E] [InnerProductSpace π•œ E] variable [NormedAddCommGroup F] [InnerProductSpace ℝ F] local notation "βŸͺ" x ", " y "⟫" => @inner π•œ _ _ x y variable (π•œ) [NormedSpace ℝ E] /-- Derivative of the inner product. -/ def fderivInnerClm (p : E Γ— E) : E Γ— E β†’L[ℝ] π•œ := isBoundedBilinearMap_inner.deriv p #align fderiv_inner_clm fderivInnerClm @[simp] theorem fderivInnerClm_apply (p x : E Γ— E) : fderivInnerClm π•œ p x = βŸͺp.1, x.2⟫ + βŸͺx.1, p.2⟫ := rfl #align fderiv_inner_clm_apply fderivInnerClm_apply variable {π•œ} -- porting note: Lean 3 magically switches back to `{π•œ}` here theorem contDiff_inner {n} : ContDiff ℝ n fun p : E Γ— E => βŸͺp.1, p.2⟫ := isBoundedBilinearMap_inner.contDiff #align cont_diff_inner contDiff_inner theorem contDiffAt_inner {p : E Γ— E} {n} : ContDiffAt ℝ n (fun p : E Γ— E => βŸͺp.1, p.2⟫) p := ContDiff.contDiffAt contDiff_inner #align cont_diff_at_inner contDiffAt_inner theorem differentiable_inner : Differentiable ℝ fun p : E Γ— E => βŸͺp.1, p.2⟫ := isBoundedBilinearMap_inner.differentiableAt #align differentiable_inner differentiable_inner variable (π•œ) variable {G : Type*} [NormedAddCommGroup G] [NormedSpace ℝ G] {f g : G β†’ E} {f' g' : G β†’L[ℝ] E} {s : Set G} {x : G} {n : β„•βˆž} theorem ContDiffWithinAt.inner (hf : ContDiffWithinAt ℝ n f s x) (hg : ContDiffWithinAt ℝ n g s x) : ContDiffWithinAt ℝ n (fun x => βŸͺf x, g x⟫) s x := contDiffAt_inner.comp_contDiffWithinAt x (hf.prod hg) #align cont_diff_within_at.inner ContDiffWithinAt.inner nonrec theorem ContDiffAt.inner (hf : ContDiffAt ℝ n f x) (hg : ContDiffAt ℝ n g x) : ContDiffAt ℝ n (fun x => βŸͺf x, g x⟫) x := hf.inner π•œ hg #align cont_diff_at.inner ContDiffAt.inner theorem ContDiffOn.inner (hf : ContDiffOn ℝ n f s) (hg : ContDiffOn ℝ n g s) : ContDiffOn ℝ n (fun x => βŸͺf x, g x⟫) s := fun x hx => (hf x hx).inner π•œ (hg x hx) #align cont_diff_on.inner ContDiffOn.inner theorem ContDiff.inner (hf : ContDiff ℝ n f) (hg : ContDiff ℝ n g) : ContDiff ℝ n fun x => βŸͺf x, g x⟫ := contDiff_inner.comp (hf.prod hg) #align cont_diff.inner ContDiff.inner theorem HasFDerivWithinAt.inner (hf : HasFDerivWithinAt f f' s x) (hg : HasFDerivWithinAt g g' s x) : HasFDerivWithinAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') s x := (isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp_hasFDerivWithinAt x (hf.prod hg) #align has_fderiv_within_at.inner HasFDerivWithinAt.inner theorem HasStrictFDerivAt.inner (hf : HasStrictFDerivAt f f' x) (hg : HasStrictFDerivAt g g' x) : HasStrictFDerivAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') x := (isBoundedBilinearMap_inner.hasStrictFDerivAt (f x, g x)).comp x (hf.prod hg) #align has_strict_fderiv_at.inner HasStrictFDerivAt.inner theorem HasFDerivAt.inner (hf : HasFDerivAt f f' x) (hg : HasFDerivAt g g' x) : HasFDerivAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') x := (isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp x (hf.prod hg) #align has_fderiv_at.inner HasFDerivAt.inner theorem HasDerivWithinAt.inner {f g : ℝ β†’ E} {f' g' : E} {s : Set ℝ} {x : ℝ} (hf : HasDerivWithinAt f f' s x) (hg : HasDerivWithinAt g g' s x) : HasDerivWithinAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) s x := by simpa using (hf.hasFDerivWithinAt.inner π•œ hg.hasFDerivWithinAt).hasDerivWithinAt #align has_deriv_within_at.inner HasDerivWithinAt.inner theorem HasDerivAt.inner {f g : ℝ β†’ E} {f' g' : E} {x : ℝ} : HasDerivAt f f' x β†’ HasDerivAt g g' x β†’ HasDerivAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) x := by simpa only [← hasDerivWithinAt_univ] using HasDerivWithinAt.inner π•œ #align has_deriv_at.inner HasDerivAt.inner theorem DifferentiableWithinAt.inner (hf : DifferentiableWithinAt ℝ f s x) (hg : DifferentiableWithinAt ℝ g s x) : DifferentiableWithinAt ℝ (fun x => βŸͺf x, g x⟫) s x := ((differentiable_inner _).hasFDerivAt.comp_hasFDerivWithinAt x (hf.prod hg).hasFDerivWithinAt).differentiableWithinAt #align differentiable_within_at.inner DifferentiableWithinAt.inner theorem DifferentiableAt.inner (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) : DifferentiableAt ℝ (fun x => βŸͺf x, g x⟫) x := (differentiable_inner _).comp x (hf.prod hg) #align differentiable_at.inner DifferentiableAt.inner theorem DifferentiableOn.inner (hf : DifferentiableOn ℝ f s) (hg : DifferentiableOn ℝ g s) : DifferentiableOn ℝ (fun x => βŸͺf x, g x⟫) s := fun x hx => (hf x hx).inner π•œ (hg x hx) #align differentiable_on.inner DifferentiableOn.inner theorem Differentiable.inner (hf : Differentiable ℝ f) (hg : Differentiable ℝ g) : Differentiable ℝ fun x => βŸͺf x, g x⟫ := fun x => (hf x).inner π•œ (hg x) #align differentiable.inner Differentiable.inner theorem fderiv_inner_apply (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) (y : G) : fderiv ℝ (fun t => βŸͺf t, g t⟫) x y = βŸͺf x, fderiv ℝ g x y⟫ + βŸͺfderiv ℝ f x y, g x⟫ := by rw [(hf.hasFDerivAt.inner π•œ hg.hasFDerivAt).fderiv]; rfl #align fderiv_inner_apply fderiv_inner_apply theorem deriv_inner_apply {f g : ℝ β†’ E} {x : ℝ} (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) : deriv (fun t => βŸͺf t, g t⟫) x = βŸͺf x, deriv g x⟫ + βŸͺderiv f x, g x⟫ := (hf.hasDerivAt.inner π•œ hg.hasDerivAt).deriv #align deriv_inner_apply deriv_inner_apply theorem contDiff_norm_sq : ContDiff ℝ n fun x : E => β€–xβ€– ^ 2 := by convert (reClm : π•œ β†’L[ℝ] ℝ).contDiff.comp ((contDiff_id (E := E)).inner π•œ (contDiff_id (E := E))) exact (inner_self_eq_norm_sq _).symm #align cont_diff_norm_sq contDiff_norm_sq theorem ContDiff.norm_sq (hf : ContDiff ℝ n f) : ContDiff ℝ n fun x => β€–f xβ€– ^ 2 := (contDiff_norm_sq π•œ).comp hf #align cont_diff.norm_sq ContDiff.norm_sq theorem ContDiffWithinAt.norm_sq (hf : ContDiffWithinAt ℝ n f s x) : ContDiffWithinAt ℝ n (fun y => β€–f yβ€– ^ 2) s x := (contDiff_norm_sq π•œ).contDiffAt.comp_contDiffWithinAt x hf #align cont_diff_within_at.norm_sq ContDiffWithinAt.norm_sq nonrec theorem ContDiffAt.norm_sq (hf : ContDiffAt ℝ n f x) : ContDiffAt ℝ n (β€–f Β·β€– ^ 2) x := hf.norm_sq π•œ #align cont_diff_at.norm_sq ContDiffAt.norm_sq theorem contDiffAt_norm {x : E} (hx : x β‰  0) : ContDiffAt ℝ n norm x := by have : β€–id xβ€– ^ 2 β‰  0 := pow_ne_zero 2 (norm_pos_iff.2 hx).ne' simpa only [id, sqrt_sq, norm_nonneg] using (contDiffAt_id.norm_sq π•œ).sqrt this #align cont_diff_at_norm contDiffAt_norm theorem ContDiffAt.norm (hf : ContDiffAt ℝ n f x) (h0 : f x β‰  0) : ContDiffAt ℝ n (fun y => β€–f yβ€–) x := (contDiffAt_norm π•œ h0).comp x hf #align cont_diff_at.norm ContDiffAt.norm theorem ContDiffAt.dist (hf : ContDiffAt ℝ n f x) (hg : ContDiffAt ℝ n g x) (hne : f x β‰  g x) : ContDiffAt ℝ n (fun y => dist (f y) (g y)) x := by simp only [dist_eq_norm] exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align cont_diff_at.dist ContDiffAt.dist theorem ContDiffWithinAt.norm (hf : ContDiffWithinAt ℝ n f s x) (h0 : f x β‰  0) : ContDiffWithinAt ℝ n (fun y => β€–f yβ€–) s x := (contDiffAt_norm π•œ h0).comp_contDiffWithinAt x hf #align cont_diff_within_at.norm ContDiffWithinAt.norm theorem ContDiffWithinAt.dist (hf : ContDiffWithinAt ℝ n f s x) (hg : ContDiffWithinAt ℝ n g s x) (hne : f x β‰  g x) : ContDiffWithinAt ℝ n (fun y => dist (f y) (g y)) s x := by simp only [dist_eq_norm]; exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align cont_diff_within_at.dist ContDiffWithinAt.dist theorem ContDiffOn.norm_sq (hf : ContDiffOn ℝ n f s) : ContDiffOn ℝ n (fun y => β€–f yβ€– ^ 2) s := fun x hx => (hf x hx).norm_sq π•œ #align cont_diff_on.norm_sq ContDiffOn.norm_sq theorem ContDiffOn.norm (hf : ContDiffOn ℝ n f s) (h0 : βˆ€ x ∈ s, f x β‰  0) : ContDiffOn ℝ n (fun y => β€–f yβ€–) s := fun x hx => (hf x hx).norm π•œ (h0 x hx) #align cont_diff_on.norm ContDiffOn.norm theorem ContDiffOn.dist (hf : ContDiffOn ℝ n f s) (hg : ContDiffOn ℝ n g s) (hne : βˆ€ x ∈ s, f x β‰  g x) : ContDiffOn ℝ n (fun y => dist (f y) (g y)) s := fun x hx => (hf x hx).dist π•œ (hg x hx) (hne x hx) #align cont_diff_on.dist ContDiffOn.dist theorem ContDiff.norm (hf : ContDiff ℝ n f) (h0 : βˆ€ x, f x β‰  0) : ContDiff ℝ n fun y => β€–f yβ€– := contDiff_iff_contDiffAt.2 fun x => hf.contDiffAt.norm π•œ (h0 x) #align cont_diff.norm ContDiff.norm theorem ContDiff.dist (hf : ContDiff ℝ n f) (hg : ContDiff ℝ n g) (hne : βˆ€ x, f x β‰  g x) : ContDiff ℝ n fun y => dist (f y) (g y) := contDiff_iff_contDiffAt.2 fun x => hf.contDiffAt.dist π•œ hg.contDiffAt (hne x) #align cont_diff.dist ContDiff.dist -- porting note: use `2 β€’` instead of `bit0` theorem hasStrictFDerivAt_norm_sq (x : F) : HasStrictFDerivAt (fun x => β€–xβ€– ^ 2) (2 β€’ (innerSL ℝ x)) x := by simp only [sq, ← @inner_self_eq_norm_mul_norm ℝ] convert (hasStrictFDerivAt_id x).inner ℝ (hasStrictFDerivAt_id x) ext y simp [two_smul, real_inner_comm] #align has_strict_fderiv_at_norm_sq hasStrictFDerivAt_norm_sqβ‚“ theorem HasFDerivAt.norm_sq {f : G β†’ F} {f' : G β†’L[ℝ] F} (hf : HasFDerivAt f f' x) : HasFDerivAt (β€–f Β·β€– ^ 2) (2 β€’ (innerSL ℝ (f x)).comp f') x := (hasStrictFDerivAt_norm_sq _).hasFDerivAt.comp x hf theorem HasDerivAt.norm_sq {f : ℝ β†’ F} {f' : F} {x : ℝ} (hf : HasDerivAt f f' x) : HasDerivAt (β€–f Β·β€– ^ 2) (2 * Inner.inner (f x) f') x := by simpa using hf.hasFDerivAt.norm_sq.hasDerivAt theorem HasFDerivWithinAt.norm_sq {f : G β†’ F} {f' : G β†’L[ℝ] F} (hf : HasFDerivWithinAt f f' s x) : HasFDerivWithinAt (β€–f Β·β€– ^ 2) (2 β€’ (innerSL ℝ (f x)).comp f') s x := (hasStrictFDerivAt_norm_sq _).hasFDerivAt.comp_hasFDerivWithinAt x hf theorem HasDerivWithinAt.norm_sq {f : ℝ β†’ F} {f' : F} {s : Set ℝ} {x : ℝ} (hf : HasDerivWithinAt f f' s x) : HasDerivWithinAt (β€–f Β·β€– ^ 2) (2 * Inner.inner (f x) f') s x := by simpa using hf.hasFDerivWithinAt.norm_sq.hasDerivWithinAt theorem DifferentiableAt.norm_sq (hf : DifferentiableAt ℝ f x) : DifferentiableAt ℝ (fun y => β€–f yβ€– ^ 2) x := ((contDiffAt_id.norm_sq π•œ).differentiableAt le_rfl).comp x hf #align differentiable_at.norm_sq DifferentiableAt.norm_sq theorem DifferentiableAt.norm (hf : DifferentiableAt ℝ f x) (h0 : f x β‰  0) : DifferentiableAt ℝ (fun y => β€–f yβ€–) x := ((contDiffAt_norm π•œ h0).differentiableAt le_rfl).comp x hf #align differentiable_at.norm DifferentiableAt.norm theorem DifferentiableAt.dist (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) (hne : f x β‰  g x) : DifferentiableAt ℝ (fun y => dist (f y) (g y)) x := by simp only [dist_eq_norm]; exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align differentiable_at.dist DifferentiableAt.dist theorem Differentiable.norm_sq (hf : Differentiable ℝ f) : Differentiable ℝ fun y => β€–f yβ€– ^ 2 := fun x => (hf x).norm_sq π•œ #align differentiable.norm_sq Differentiable.norm_sq theorem Differentiable.norm (hf : Differentiable ℝ f) (h0 : βˆ€ x, f x β‰  0) : Differentiable ℝ fun y => β€–f yβ€– := fun x => (hf x).norm π•œ (h0 x) #align differentiable.norm Differentiable.norm theorem Differentiable.dist (hf : Differentiable ℝ f) (hg : Differentiable ℝ g) (hne : βˆ€ x, f x β‰  g x) : Differentiable ℝ fun y => dist (f y) (g y) := fun x => (hf x).dist π•œ (hg x) (hne x) #align differentiable.dist Differentiable.dist theorem DifferentiableWithinAt.norm_sq (hf : DifferentiableWithinAt ℝ f s x) : DifferentiableWithinAt ℝ (fun y => β€–f yβ€– ^ 2) s x := ((contDiffAt_id.norm_sq π•œ).differentiableAt le_rfl).comp_differentiableWithinAt x hf #align differentiable_within_at.norm_sq DifferentiableWithinAt.norm_sq theorem DifferentiableWithinAt.norm (hf : DifferentiableWithinAt ℝ f s x) (h0 : f x β‰  0) : DifferentiableWithinAt ℝ (fun y => β€–f yβ€–) s x := ((contDiffAt_id.norm π•œ h0).differentiableAt le_rfl).comp_differentiableWithinAt x hf #align differentiable_within_at.norm DifferentiableWithinAt.norm theorem DifferentiableWithinAt.dist (hf : DifferentiableWithinAt ℝ f s x) (hg : DifferentiableWithinAt ℝ g s x) (hne : f x β‰  g x) : DifferentiableWithinAt ℝ (fun y => dist (f y) (g y)) s x := by simp only [dist_eq_norm] exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align differentiable_within_at.dist DifferentiableWithinAt.dist theorem DifferentiableOn.norm_sq (hf : DifferentiableOn ℝ f s) : DifferentiableOn ℝ (fun y => β€–f yβ€– ^ 2) s := fun x hx => (hf x hx).norm_sq π•œ #align differentiable_on.norm_sq DifferentiableOn.norm_sq theorem DifferentiableOn.norm (hf : DifferentiableOn ℝ f s) (h0 : βˆ€ x ∈ s, f x β‰  0) : DifferentiableOn ℝ (fun y => β€–f yβ€–) s := fun x hx => (hf x hx).norm π•œ (h0 x hx) #align differentiable_on.norm DifferentiableOn.norm theorem DifferentiableOn.dist (hf : DifferentiableOn ℝ f s) (hg : DifferentiableOn ℝ g s) (hne : βˆ€ x ∈ s, f x β‰  g x) : DifferentiableOn ℝ (fun y => dist (f y) (g y)) s := fun x hx => (hf x hx).dist π•œ (hg x hx) (hne x hx) #align differentiable_on.dist DifferentiableOn.dist end DerivInner section PiLike open ContinuousLinearMap variable {π•œ ΞΉ H : Type*} [IsROrC π•œ] [NormedAddCommGroup H] [NormedSpace π•œ H] [Fintype ΞΉ] {f : H β†’ EuclideanSpace π•œ ΞΉ} {f' : H β†’L[π•œ] EuclideanSpace π•œ ΞΉ} {t : Set H} {y : H} theorem differentiableWithinAt_euclidean : DifferentiableWithinAt π•œ f t y ↔ βˆ€ i, DifferentiableWithinAt π•œ (fun x => f x i) t y := by
rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_differentiableWithinAt_iff, differentiableWithinAt_pi]
theorem differentiableWithinAt_euclidean : DifferentiableWithinAt π•œ f t y ↔ βˆ€ i, DifferentiableWithinAt π•œ (fun x => f x i) t y := by
Mathlib.Analysis.InnerProductSpace.Calculus.312_0.6FECEGgqdb67QLM
theorem differentiableWithinAt_euclidean : DifferentiableWithinAt π•œ f t y ↔ βˆ€ i, DifferentiableWithinAt π•œ (fun x => f x i) t y
Mathlib_Analysis_InnerProductSpace_Calculus
π•œ : Type u_1 ΞΉ : Type u_2 H : Type u_3 inst✝³ : IsROrC π•œ inst✝² : NormedAddCommGroup H inst✝¹ : NormedSpace π•œ H inst✝ : Fintype ΞΉ f : H β†’ EuclideanSpace π•œ ΞΉ f' : H β†’L[π•œ] EuclideanSpace π•œ ΞΉ t : Set H y : H ⊒ (βˆ€ (i : ΞΉ), DifferentiableWithinAt π•œ (fun x => (⇑(EuclideanSpace.equiv ΞΉ π•œ) ∘ f) x i) t y) ↔ βˆ€ (i : ΞΉ), DifferentiableWithinAt π•œ (fun x => f x i) t y
/- Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ import Mathlib.Analysis.InnerProductSpace.PiL2 import Mathlib.Analysis.SpecialFunctions.Sqrt import Mathlib.Analysis.NormedSpace.HomeomorphBall #align_import analysis.inner_product_space.calculus from "leanprover-community/mathlib"@"f9dd3204df14a0749cd456fac1e6849dfe7d2b88" /-! # Calculus in inner product spaces In this file we prove that the inner product and square of the norm in an inner space are infinitely `ℝ`-smooth. In order to state these results, we need a `NormedSpace ℝ E` instance. Though we can deduce this structure from `InnerProductSpace π•œ E`, this instance may be not definitionally equal to some other β€œnatural” instance. So, we assume `[NormedSpace ℝ E]`. We also prove that functions to a `EuclideanSpace` are (higher) differentiable if and only if their components are. This follows from the corresponding fact for finite product of normed spaces, and from the equivalence of norms in finite dimensions. ## TODO The last part of the file should be generalized to `PiLp`. -/ noncomputable section open IsROrC Real Filter open scoped BigOperators Classical Topology section DerivInner variable {π•œ E F : Type*} [IsROrC π•œ] variable [NormedAddCommGroup E] [InnerProductSpace π•œ E] variable [NormedAddCommGroup F] [InnerProductSpace ℝ F] local notation "βŸͺ" x ", " y "⟫" => @inner π•œ _ _ x y variable (π•œ) [NormedSpace ℝ E] /-- Derivative of the inner product. -/ def fderivInnerClm (p : E Γ— E) : E Γ— E β†’L[ℝ] π•œ := isBoundedBilinearMap_inner.deriv p #align fderiv_inner_clm fderivInnerClm @[simp] theorem fderivInnerClm_apply (p x : E Γ— E) : fderivInnerClm π•œ p x = βŸͺp.1, x.2⟫ + βŸͺx.1, p.2⟫ := rfl #align fderiv_inner_clm_apply fderivInnerClm_apply variable {π•œ} -- porting note: Lean 3 magically switches back to `{π•œ}` here theorem contDiff_inner {n} : ContDiff ℝ n fun p : E Γ— E => βŸͺp.1, p.2⟫ := isBoundedBilinearMap_inner.contDiff #align cont_diff_inner contDiff_inner theorem contDiffAt_inner {p : E Γ— E} {n} : ContDiffAt ℝ n (fun p : E Γ— E => βŸͺp.1, p.2⟫) p := ContDiff.contDiffAt contDiff_inner #align cont_diff_at_inner contDiffAt_inner theorem differentiable_inner : Differentiable ℝ fun p : E Γ— E => βŸͺp.1, p.2⟫ := isBoundedBilinearMap_inner.differentiableAt #align differentiable_inner differentiable_inner variable (π•œ) variable {G : Type*} [NormedAddCommGroup G] [NormedSpace ℝ G] {f g : G β†’ E} {f' g' : G β†’L[ℝ] E} {s : Set G} {x : G} {n : β„•βˆž} theorem ContDiffWithinAt.inner (hf : ContDiffWithinAt ℝ n f s x) (hg : ContDiffWithinAt ℝ n g s x) : ContDiffWithinAt ℝ n (fun x => βŸͺf x, g x⟫) s x := contDiffAt_inner.comp_contDiffWithinAt x (hf.prod hg) #align cont_diff_within_at.inner ContDiffWithinAt.inner nonrec theorem ContDiffAt.inner (hf : ContDiffAt ℝ n f x) (hg : ContDiffAt ℝ n g x) : ContDiffAt ℝ n (fun x => βŸͺf x, g x⟫) x := hf.inner π•œ hg #align cont_diff_at.inner ContDiffAt.inner theorem ContDiffOn.inner (hf : ContDiffOn ℝ n f s) (hg : ContDiffOn ℝ n g s) : ContDiffOn ℝ n (fun x => βŸͺf x, g x⟫) s := fun x hx => (hf x hx).inner π•œ (hg x hx) #align cont_diff_on.inner ContDiffOn.inner theorem ContDiff.inner (hf : ContDiff ℝ n f) (hg : ContDiff ℝ n g) : ContDiff ℝ n fun x => βŸͺf x, g x⟫ := contDiff_inner.comp (hf.prod hg) #align cont_diff.inner ContDiff.inner theorem HasFDerivWithinAt.inner (hf : HasFDerivWithinAt f f' s x) (hg : HasFDerivWithinAt g g' s x) : HasFDerivWithinAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') s x := (isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp_hasFDerivWithinAt x (hf.prod hg) #align has_fderiv_within_at.inner HasFDerivWithinAt.inner theorem HasStrictFDerivAt.inner (hf : HasStrictFDerivAt f f' x) (hg : HasStrictFDerivAt g g' x) : HasStrictFDerivAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') x := (isBoundedBilinearMap_inner.hasStrictFDerivAt (f x, g x)).comp x (hf.prod hg) #align has_strict_fderiv_at.inner HasStrictFDerivAt.inner theorem HasFDerivAt.inner (hf : HasFDerivAt f f' x) (hg : HasFDerivAt g g' x) : HasFDerivAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') x := (isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp x (hf.prod hg) #align has_fderiv_at.inner HasFDerivAt.inner theorem HasDerivWithinAt.inner {f g : ℝ β†’ E} {f' g' : E} {s : Set ℝ} {x : ℝ} (hf : HasDerivWithinAt f f' s x) (hg : HasDerivWithinAt g g' s x) : HasDerivWithinAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) s x := by simpa using (hf.hasFDerivWithinAt.inner π•œ hg.hasFDerivWithinAt).hasDerivWithinAt #align has_deriv_within_at.inner HasDerivWithinAt.inner theorem HasDerivAt.inner {f g : ℝ β†’ E} {f' g' : E} {x : ℝ} : HasDerivAt f f' x β†’ HasDerivAt g g' x β†’ HasDerivAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) x := by simpa only [← hasDerivWithinAt_univ] using HasDerivWithinAt.inner π•œ #align has_deriv_at.inner HasDerivAt.inner theorem DifferentiableWithinAt.inner (hf : DifferentiableWithinAt ℝ f s x) (hg : DifferentiableWithinAt ℝ g s x) : DifferentiableWithinAt ℝ (fun x => βŸͺf x, g x⟫) s x := ((differentiable_inner _).hasFDerivAt.comp_hasFDerivWithinAt x (hf.prod hg).hasFDerivWithinAt).differentiableWithinAt #align differentiable_within_at.inner DifferentiableWithinAt.inner theorem DifferentiableAt.inner (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) : DifferentiableAt ℝ (fun x => βŸͺf x, g x⟫) x := (differentiable_inner _).comp x (hf.prod hg) #align differentiable_at.inner DifferentiableAt.inner theorem DifferentiableOn.inner (hf : DifferentiableOn ℝ f s) (hg : DifferentiableOn ℝ g s) : DifferentiableOn ℝ (fun x => βŸͺf x, g x⟫) s := fun x hx => (hf x hx).inner π•œ (hg x hx) #align differentiable_on.inner DifferentiableOn.inner theorem Differentiable.inner (hf : Differentiable ℝ f) (hg : Differentiable ℝ g) : Differentiable ℝ fun x => βŸͺf x, g x⟫ := fun x => (hf x).inner π•œ (hg x) #align differentiable.inner Differentiable.inner theorem fderiv_inner_apply (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) (y : G) : fderiv ℝ (fun t => βŸͺf t, g t⟫) x y = βŸͺf x, fderiv ℝ g x y⟫ + βŸͺfderiv ℝ f x y, g x⟫ := by rw [(hf.hasFDerivAt.inner π•œ hg.hasFDerivAt).fderiv]; rfl #align fderiv_inner_apply fderiv_inner_apply theorem deriv_inner_apply {f g : ℝ β†’ E} {x : ℝ} (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) : deriv (fun t => βŸͺf t, g t⟫) x = βŸͺf x, deriv g x⟫ + βŸͺderiv f x, g x⟫ := (hf.hasDerivAt.inner π•œ hg.hasDerivAt).deriv #align deriv_inner_apply deriv_inner_apply theorem contDiff_norm_sq : ContDiff ℝ n fun x : E => β€–xβ€– ^ 2 := by convert (reClm : π•œ β†’L[ℝ] ℝ).contDiff.comp ((contDiff_id (E := E)).inner π•œ (contDiff_id (E := E))) exact (inner_self_eq_norm_sq _).symm #align cont_diff_norm_sq contDiff_norm_sq theorem ContDiff.norm_sq (hf : ContDiff ℝ n f) : ContDiff ℝ n fun x => β€–f xβ€– ^ 2 := (contDiff_norm_sq π•œ).comp hf #align cont_diff.norm_sq ContDiff.norm_sq theorem ContDiffWithinAt.norm_sq (hf : ContDiffWithinAt ℝ n f s x) : ContDiffWithinAt ℝ n (fun y => β€–f yβ€– ^ 2) s x := (contDiff_norm_sq π•œ).contDiffAt.comp_contDiffWithinAt x hf #align cont_diff_within_at.norm_sq ContDiffWithinAt.norm_sq nonrec theorem ContDiffAt.norm_sq (hf : ContDiffAt ℝ n f x) : ContDiffAt ℝ n (β€–f Β·β€– ^ 2) x := hf.norm_sq π•œ #align cont_diff_at.norm_sq ContDiffAt.norm_sq theorem contDiffAt_norm {x : E} (hx : x β‰  0) : ContDiffAt ℝ n norm x := by have : β€–id xβ€– ^ 2 β‰  0 := pow_ne_zero 2 (norm_pos_iff.2 hx).ne' simpa only [id, sqrt_sq, norm_nonneg] using (contDiffAt_id.norm_sq π•œ).sqrt this #align cont_diff_at_norm contDiffAt_norm theorem ContDiffAt.norm (hf : ContDiffAt ℝ n f x) (h0 : f x β‰  0) : ContDiffAt ℝ n (fun y => β€–f yβ€–) x := (contDiffAt_norm π•œ h0).comp x hf #align cont_diff_at.norm ContDiffAt.norm theorem ContDiffAt.dist (hf : ContDiffAt ℝ n f x) (hg : ContDiffAt ℝ n g x) (hne : f x β‰  g x) : ContDiffAt ℝ n (fun y => dist (f y) (g y)) x := by simp only [dist_eq_norm] exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align cont_diff_at.dist ContDiffAt.dist theorem ContDiffWithinAt.norm (hf : ContDiffWithinAt ℝ n f s x) (h0 : f x β‰  0) : ContDiffWithinAt ℝ n (fun y => β€–f yβ€–) s x := (contDiffAt_norm π•œ h0).comp_contDiffWithinAt x hf #align cont_diff_within_at.norm ContDiffWithinAt.norm theorem ContDiffWithinAt.dist (hf : ContDiffWithinAt ℝ n f s x) (hg : ContDiffWithinAt ℝ n g s x) (hne : f x β‰  g x) : ContDiffWithinAt ℝ n (fun y => dist (f y) (g y)) s x := by simp only [dist_eq_norm]; exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align cont_diff_within_at.dist ContDiffWithinAt.dist theorem ContDiffOn.norm_sq (hf : ContDiffOn ℝ n f s) : ContDiffOn ℝ n (fun y => β€–f yβ€– ^ 2) s := fun x hx => (hf x hx).norm_sq π•œ #align cont_diff_on.norm_sq ContDiffOn.norm_sq theorem ContDiffOn.norm (hf : ContDiffOn ℝ n f s) (h0 : βˆ€ x ∈ s, f x β‰  0) : ContDiffOn ℝ n (fun y => β€–f yβ€–) s := fun x hx => (hf x hx).norm π•œ (h0 x hx) #align cont_diff_on.norm ContDiffOn.norm theorem ContDiffOn.dist (hf : ContDiffOn ℝ n f s) (hg : ContDiffOn ℝ n g s) (hne : βˆ€ x ∈ s, f x β‰  g x) : ContDiffOn ℝ n (fun y => dist (f y) (g y)) s := fun x hx => (hf x hx).dist π•œ (hg x hx) (hne x hx) #align cont_diff_on.dist ContDiffOn.dist theorem ContDiff.norm (hf : ContDiff ℝ n f) (h0 : βˆ€ x, f x β‰  0) : ContDiff ℝ n fun y => β€–f yβ€– := contDiff_iff_contDiffAt.2 fun x => hf.contDiffAt.norm π•œ (h0 x) #align cont_diff.norm ContDiff.norm theorem ContDiff.dist (hf : ContDiff ℝ n f) (hg : ContDiff ℝ n g) (hne : βˆ€ x, f x β‰  g x) : ContDiff ℝ n fun y => dist (f y) (g y) := contDiff_iff_contDiffAt.2 fun x => hf.contDiffAt.dist π•œ hg.contDiffAt (hne x) #align cont_diff.dist ContDiff.dist -- porting note: use `2 β€’` instead of `bit0` theorem hasStrictFDerivAt_norm_sq (x : F) : HasStrictFDerivAt (fun x => β€–xβ€– ^ 2) (2 β€’ (innerSL ℝ x)) x := by simp only [sq, ← @inner_self_eq_norm_mul_norm ℝ] convert (hasStrictFDerivAt_id x).inner ℝ (hasStrictFDerivAt_id x) ext y simp [two_smul, real_inner_comm] #align has_strict_fderiv_at_norm_sq hasStrictFDerivAt_norm_sqβ‚“ theorem HasFDerivAt.norm_sq {f : G β†’ F} {f' : G β†’L[ℝ] F} (hf : HasFDerivAt f f' x) : HasFDerivAt (β€–f Β·β€– ^ 2) (2 β€’ (innerSL ℝ (f x)).comp f') x := (hasStrictFDerivAt_norm_sq _).hasFDerivAt.comp x hf theorem HasDerivAt.norm_sq {f : ℝ β†’ F} {f' : F} {x : ℝ} (hf : HasDerivAt f f' x) : HasDerivAt (β€–f Β·β€– ^ 2) (2 * Inner.inner (f x) f') x := by simpa using hf.hasFDerivAt.norm_sq.hasDerivAt theorem HasFDerivWithinAt.norm_sq {f : G β†’ F} {f' : G β†’L[ℝ] F} (hf : HasFDerivWithinAt f f' s x) : HasFDerivWithinAt (β€–f Β·β€– ^ 2) (2 β€’ (innerSL ℝ (f x)).comp f') s x := (hasStrictFDerivAt_norm_sq _).hasFDerivAt.comp_hasFDerivWithinAt x hf theorem HasDerivWithinAt.norm_sq {f : ℝ β†’ F} {f' : F} {s : Set ℝ} {x : ℝ} (hf : HasDerivWithinAt f f' s x) : HasDerivWithinAt (β€–f Β·β€– ^ 2) (2 * Inner.inner (f x) f') s x := by simpa using hf.hasFDerivWithinAt.norm_sq.hasDerivWithinAt theorem DifferentiableAt.norm_sq (hf : DifferentiableAt ℝ f x) : DifferentiableAt ℝ (fun y => β€–f yβ€– ^ 2) x := ((contDiffAt_id.norm_sq π•œ).differentiableAt le_rfl).comp x hf #align differentiable_at.norm_sq DifferentiableAt.norm_sq theorem DifferentiableAt.norm (hf : DifferentiableAt ℝ f x) (h0 : f x β‰  0) : DifferentiableAt ℝ (fun y => β€–f yβ€–) x := ((contDiffAt_norm π•œ h0).differentiableAt le_rfl).comp x hf #align differentiable_at.norm DifferentiableAt.norm theorem DifferentiableAt.dist (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) (hne : f x β‰  g x) : DifferentiableAt ℝ (fun y => dist (f y) (g y)) x := by simp only [dist_eq_norm]; exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align differentiable_at.dist DifferentiableAt.dist theorem Differentiable.norm_sq (hf : Differentiable ℝ f) : Differentiable ℝ fun y => β€–f yβ€– ^ 2 := fun x => (hf x).norm_sq π•œ #align differentiable.norm_sq Differentiable.norm_sq theorem Differentiable.norm (hf : Differentiable ℝ f) (h0 : βˆ€ x, f x β‰  0) : Differentiable ℝ fun y => β€–f yβ€– := fun x => (hf x).norm π•œ (h0 x) #align differentiable.norm Differentiable.norm theorem Differentiable.dist (hf : Differentiable ℝ f) (hg : Differentiable ℝ g) (hne : βˆ€ x, f x β‰  g x) : Differentiable ℝ fun y => dist (f y) (g y) := fun x => (hf x).dist π•œ (hg x) (hne x) #align differentiable.dist Differentiable.dist theorem DifferentiableWithinAt.norm_sq (hf : DifferentiableWithinAt ℝ f s x) : DifferentiableWithinAt ℝ (fun y => β€–f yβ€– ^ 2) s x := ((contDiffAt_id.norm_sq π•œ).differentiableAt le_rfl).comp_differentiableWithinAt x hf #align differentiable_within_at.norm_sq DifferentiableWithinAt.norm_sq theorem DifferentiableWithinAt.norm (hf : DifferentiableWithinAt ℝ f s x) (h0 : f x β‰  0) : DifferentiableWithinAt ℝ (fun y => β€–f yβ€–) s x := ((contDiffAt_id.norm π•œ h0).differentiableAt le_rfl).comp_differentiableWithinAt x hf #align differentiable_within_at.norm DifferentiableWithinAt.norm theorem DifferentiableWithinAt.dist (hf : DifferentiableWithinAt ℝ f s x) (hg : DifferentiableWithinAt ℝ g s x) (hne : f x β‰  g x) : DifferentiableWithinAt ℝ (fun y => dist (f y) (g y)) s x := by simp only [dist_eq_norm] exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align differentiable_within_at.dist DifferentiableWithinAt.dist theorem DifferentiableOn.norm_sq (hf : DifferentiableOn ℝ f s) : DifferentiableOn ℝ (fun y => β€–f yβ€– ^ 2) s := fun x hx => (hf x hx).norm_sq π•œ #align differentiable_on.norm_sq DifferentiableOn.norm_sq theorem DifferentiableOn.norm (hf : DifferentiableOn ℝ f s) (h0 : βˆ€ x ∈ s, f x β‰  0) : DifferentiableOn ℝ (fun y => β€–f yβ€–) s := fun x hx => (hf x hx).norm π•œ (h0 x hx) #align differentiable_on.norm DifferentiableOn.norm theorem DifferentiableOn.dist (hf : DifferentiableOn ℝ f s) (hg : DifferentiableOn ℝ g s) (hne : βˆ€ x ∈ s, f x β‰  g x) : DifferentiableOn ℝ (fun y => dist (f y) (g y)) s := fun x hx => (hf x hx).dist π•œ (hg x hx) (hne x hx) #align differentiable_on.dist DifferentiableOn.dist end DerivInner section PiLike open ContinuousLinearMap variable {π•œ ΞΉ H : Type*} [IsROrC π•œ] [NormedAddCommGroup H] [NormedSpace π•œ H] [Fintype ΞΉ] {f : H β†’ EuclideanSpace π•œ ΞΉ} {f' : H β†’L[π•œ] EuclideanSpace π•œ ΞΉ} {t : Set H} {y : H} theorem differentiableWithinAt_euclidean : DifferentiableWithinAt π•œ f t y ↔ βˆ€ i, DifferentiableWithinAt π•œ (fun x => f x i) t y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_differentiableWithinAt_iff, differentiableWithinAt_pi]
rfl
theorem differentiableWithinAt_euclidean : DifferentiableWithinAt π•œ f t y ↔ βˆ€ i, DifferentiableWithinAt π•œ (fun x => f x i) t y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_differentiableWithinAt_iff, differentiableWithinAt_pi]
Mathlib.Analysis.InnerProductSpace.Calculus.312_0.6FECEGgqdb67QLM
theorem differentiableWithinAt_euclidean : DifferentiableWithinAt π•œ f t y ↔ βˆ€ i, DifferentiableWithinAt π•œ (fun x => f x i) t y
Mathlib_Analysis_InnerProductSpace_Calculus
π•œ : Type u_1 ΞΉ : Type u_2 H : Type u_3 inst✝³ : IsROrC π•œ inst✝² : NormedAddCommGroup H inst✝¹ : NormedSpace π•œ H inst✝ : Fintype ΞΉ f : H β†’ EuclideanSpace π•œ ΞΉ f' : H β†’L[π•œ] EuclideanSpace π•œ ΞΉ t : Set H y : H ⊒ DifferentiableAt π•œ f y ↔ βˆ€ (i : ΞΉ), DifferentiableAt π•œ (fun x => f x i) y
/- Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ import Mathlib.Analysis.InnerProductSpace.PiL2 import Mathlib.Analysis.SpecialFunctions.Sqrt import Mathlib.Analysis.NormedSpace.HomeomorphBall #align_import analysis.inner_product_space.calculus from "leanprover-community/mathlib"@"f9dd3204df14a0749cd456fac1e6849dfe7d2b88" /-! # Calculus in inner product spaces In this file we prove that the inner product and square of the norm in an inner space are infinitely `ℝ`-smooth. In order to state these results, we need a `NormedSpace ℝ E` instance. Though we can deduce this structure from `InnerProductSpace π•œ E`, this instance may be not definitionally equal to some other β€œnatural” instance. So, we assume `[NormedSpace ℝ E]`. We also prove that functions to a `EuclideanSpace` are (higher) differentiable if and only if their components are. This follows from the corresponding fact for finite product of normed spaces, and from the equivalence of norms in finite dimensions. ## TODO The last part of the file should be generalized to `PiLp`. -/ noncomputable section open IsROrC Real Filter open scoped BigOperators Classical Topology section DerivInner variable {π•œ E F : Type*} [IsROrC π•œ] variable [NormedAddCommGroup E] [InnerProductSpace π•œ E] variable [NormedAddCommGroup F] [InnerProductSpace ℝ F] local notation "βŸͺ" x ", " y "⟫" => @inner π•œ _ _ x y variable (π•œ) [NormedSpace ℝ E] /-- Derivative of the inner product. -/ def fderivInnerClm (p : E Γ— E) : E Γ— E β†’L[ℝ] π•œ := isBoundedBilinearMap_inner.deriv p #align fderiv_inner_clm fderivInnerClm @[simp] theorem fderivInnerClm_apply (p x : E Γ— E) : fderivInnerClm π•œ p x = βŸͺp.1, x.2⟫ + βŸͺx.1, p.2⟫ := rfl #align fderiv_inner_clm_apply fderivInnerClm_apply variable {π•œ} -- porting note: Lean 3 magically switches back to `{π•œ}` here theorem contDiff_inner {n} : ContDiff ℝ n fun p : E Γ— E => βŸͺp.1, p.2⟫ := isBoundedBilinearMap_inner.contDiff #align cont_diff_inner contDiff_inner theorem contDiffAt_inner {p : E Γ— E} {n} : ContDiffAt ℝ n (fun p : E Γ— E => βŸͺp.1, p.2⟫) p := ContDiff.contDiffAt contDiff_inner #align cont_diff_at_inner contDiffAt_inner theorem differentiable_inner : Differentiable ℝ fun p : E Γ— E => βŸͺp.1, p.2⟫ := isBoundedBilinearMap_inner.differentiableAt #align differentiable_inner differentiable_inner variable (π•œ) variable {G : Type*} [NormedAddCommGroup G] [NormedSpace ℝ G] {f g : G β†’ E} {f' g' : G β†’L[ℝ] E} {s : Set G} {x : G} {n : β„•βˆž} theorem ContDiffWithinAt.inner (hf : ContDiffWithinAt ℝ n f s x) (hg : ContDiffWithinAt ℝ n g s x) : ContDiffWithinAt ℝ n (fun x => βŸͺf x, g x⟫) s x := contDiffAt_inner.comp_contDiffWithinAt x (hf.prod hg) #align cont_diff_within_at.inner ContDiffWithinAt.inner nonrec theorem ContDiffAt.inner (hf : ContDiffAt ℝ n f x) (hg : ContDiffAt ℝ n g x) : ContDiffAt ℝ n (fun x => βŸͺf x, g x⟫) x := hf.inner π•œ hg #align cont_diff_at.inner ContDiffAt.inner theorem ContDiffOn.inner (hf : ContDiffOn ℝ n f s) (hg : ContDiffOn ℝ n g s) : ContDiffOn ℝ n (fun x => βŸͺf x, g x⟫) s := fun x hx => (hf x hx).inner π•œ (hg x hx) #align cont_diff_on.inner ContDiffOn.inner theorem ContDiff.inner (hf : ContDiff ℝ n f) (hg : ContDiff ℝ n g) : ContDiff ℝ n fun x => βŸͺf x, g x⟫ := contDiff_inner.comp (hf.prod hg) #align cont_diff.inner ContDiff.inner theorem HasFDerivWithinAt.inner (hf : HasFDerivWithinAt f f' s x) (hg : HasFDerivWithinAt g g' s x) : HasFDerivWithinAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') s x := (isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp_hasFDerivWithinAt x (hf.prod hg) #align has_fderiv_within_at.inner HasFDerivWithinAt.inner theorem HasStrictFDerivAt.inner (hf : HasStrictFDerivAt f f' x) (hg : HasStrictFDerivAt g g' x) : HasStrictFDerivAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') x := (isBoundedBilinearMap_inner.hasStrictFDerivAt (f x, g x)).comp x (hf.prod hg) #align has_strict_fderiv_at.inner HasStrictFDerivAt.inner theorem HasFDerivAt.inner (hf : HasFDerivAt f f' x) (hg : HasFDerivAt g g' x) : HasFDerivAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') x := (isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp x (hf.prod hg) #align has_fderiv_at.inner HasFDerivAt.inner theorem HasDerivWithinAt.inner {f g : ℝ β†’ E} {f' g' : E} {s : Set ℝ} {x : ℝ} (hf : HasDerivWithinAt f f' s x) (hg : HasDerivWithinAt g g' s x) : HasDerivWithinAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) s x := by simpa using (hf.hasFDerivWithinAt.inner π•œ hg.hasFDerivWithinAt).hasDerivWithinAt #align has_deriv_within_at.inner HasDerivWithinAt.inner theorem HasDerivAt.inner {f g : ℝ β†’ E} {f' g' : E} {x : ℝ} : HasDerivAt f f' x β†’ HasDerivAt g g' x β†’ HasDerivAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) x := by simpa only [← hasDerivWithinAt_univ] using HasDerivWithinAt.inner π•œ #align has_deriv_at.inner HasDerivAt.inner theorem DifferentiableWithinAt.inner (hf : DifferentiableWithinAt ℝ f s x) (hg : DifferentiableWithinAt ℝ g s x) : DifferentiableWithinAt ℝ (fun x => βŸͺf x, g x⟫) s x := ((differentiable_inner _).hasFDerivAt.comp_hasFDerivWithinAt x (hf.prod hg).hasFDerivWithinAt).differentiableWithinAt #align differentiable_within_at.inner DifferentiableWithinAt.inner theorem DifferentiableAt.inner (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) : DifferentiableAt ℝ (fun x => βŸͺf x, g x⟫) x := (differentiable_inner _).comp x (hf.prod hg) #align differentiable_at.inner DifferentiableAt.inner theorem DifferentiableOn.inner (hf : DifferentiableOn ℝ f s) (hg : DifferentiableOn ℝ g s) : DifferentiableOn ℝ (fun x => βŸͺf x, g x⟫) s := fun x hx => (hf x hx).inner π•œ (hg x hx) #align differentiable_on.inner DifferentiableOn.inner theorem Differentiable.inner (hf : Differentiable ℝ f) (hg : Differentiable ℝ g) : Differentiable ℝ fun x => βŸͺf x, g x⟫ := fun x => (hf x).inner π•œ (hg x) #align differentiable.inner Differentiable.inner theorem fderiv_inner_apply (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) (y : G) : fderiv ℝ (fun t => βŸͺf t, g t⟫) x y = βŸͺf x, fderiv ℝ g x y⟫ + βŸͺfderiv ℝ f x y, g x⟫ := by rw [(hf.hasFDerivAt.inner π•œ hg.hasFDerivAt).fderiv]; rfl #align fderiv_inner_apply fderiv_inner_apply theorem deriv_inner_apply {f g : ℝ β†’ E} {x : ℝ} (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) : deriv (fun t => βŸͺf t, g t⟫) x = βŸͺf x, deriv g x⟫ + βŸͺderiv f x, g x⟫ := (hf.hasDerivAt.inner π•œ hg.hasDerivAt).deriv #align deriv_inner_apply deriv_inner_apply theorem contDiff_norm_sq : ContDiff ℝ n fun x : E => β€–xβ€– ^ 2 := by convert (reClm : π•œ β†’L[ℝ] ℝ).contDiff.comp ((contDiff_id (E := E)).inner π•œ (contDiff_id (E := E))) exact (inner_self_eq_norm_sq _).symm #align cont_diff_norm_sq contDiff_norm_sq theorem ContDiff.norm_sq (hf : ContDiff ℝ n f) : ContDiff ℝ n fun x => β€–f xβ€– ^ 2 := (contDiff_norm_sq π•œ).comp hf #align cont_diff.norm_sq ContDiff.norm_sq theorem ContDiffWithinAt.norm_sq (hf : ContDiffWithinAt ℝ n f s x) : ContDiffWithinAt ℝ n (fun y => β€–f yβ€– ^ 2) s x := (contDiff_norm_sq π•œ).contDiffAt.comp_contDiffWithinAt x hf #align cont_diff_within_at.norm_sq ContDiffWithinAt.norm_sq nonrec theorem ContDiffAt.norm_sq (hf : ContDiffAt ℝ n f x) : ContDiffAt ℝ n (β€–f Β·β€– ^ 2) x := hf.norm_sq π•œ #align cont_diff_at.norm_sq ContDiffAt.norm_sq theorem contDiffAt_norm {x : E} (hx : x β‰  0) : ContDiffAt ℝ n norm x := by have : β€–id xβ€– ^ 2 β‰  0 := pow_ne_zero 2 (norm_pos_iff.2 hx).ne' simpa only [id, sqrt_sq, norm_nonneg] using (contDiffAt_id.norm_sq π•œ).sqrt this #align cont_diff_at_norm contDiffAt_norm theorem ContDiffAt.norm (hf : ContDiffAt ℝ n f x) (h0 : f x β‰  0) : ContDiffAt ℝ n (fun y => β€–f yβ€–) x := (contDiffAt_norm π•œ h0).comp x hf #align cont_diff_at.norm ContDiffAt.norm theorem ContDiffAt.dist (hf : ContDiffAt ℝ n f x) (hg : ContDiffAt ℝ n g x) (hne : f x β‰  g x) : ContDiffAt ℝ n (fun y => dist (f y) (g y)) x := by simp only [dist_eq_norm] exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align cont_diff_at.dist ContDiffAt.dist theorem ContDiffWithinAt.norm (hf : ContDiffWithinAt ℝ n f s x) (h0 : f x β‰  0) : ContDiffWithinAt ℝ n (fun y => β€–f yβ€–) s x := (contDiffAt_norm π•œ h0).comp_contDiffWithinAt x hf #align cont_diff_within_at.norm ContDiffWithinAt.norm theorem ContDiffWithinAt.dist (hf : ContDiffWithinAt ℝ n f s x) (hg : ContDiffWithinAt ℝ n g s x) (hne : f x β‰  g x) : ContDiffWithinAt ℝ n (fun y => dist (f y) (g y)) s x := by simp only [dist_eq_norm]; exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align cont_diff_within_at.dist ContDiffWithinAt.dist theorem ContDiffOn.norm_sq (hf : ContDiffOn ℝ n f s) : ContDiffOn ℝ n (fun y => β€–f yβ€– ^ 2) s := fun x hx => (hf x hx).norm_sq π•œ #align cont_diff_on.norm_sq ContDiffOn.norm_sq theorem ContDiffOn.norm (hf : ContDiffOn ℝ n f s) (h0 : βˆ€ x ∈ s, f x β‰  0) : ContDiffOn ℝ n (fun y => β€–f yβ€–) s := fun x hx => (hf x hx).norm π•œ (h0 x hx) #align cont_diff_on.norm ContDiffOn.norm theorem ContDiffOn.dist (hf : ContDiffOn ℝ n f s) (hg : ContDiffOn ℝ n g s) (hne : βˆ€ x ∈ s, f x β‰  g x) : ContDiffOn ℝ n (fun y => dist (f y) (g y)) s := fun x hx => (hf x hx).dist π•œ (hg x hx) (hne x hx) #align cont_diff_on.dist ContDiffOn.dist theorem ContDiff.norm (hf : ContDiff ℝ n f) (h0 : βˆ€ x, f x β‰  0) : ContDiff ℝ n fun y => β€–f yβ€– := contDiff_iff_contDiffAt.2 fun x => hf.contDiffAt.norm π•œ (h0 x) #align cont_diff.norm ContDiff.norm theorem ContDiff.dist (hf : ContDiff ℝ n f) (hg : ContDiff ℝ n g) (hne : βˆ€ x, f x β‰  g x) : ContDiff ℝ n fun y => dist (f y) (g y) := contDiff_iff_contDiffAt.2 fun x => hf.contDiffAt.dist π•œ hg.contDiffAt (hne x) #align cont_diff.dist ContDiff.dist -- porting note: use `2 β€’` instead of `bit0` theorem hasStrictFDerivAt_norm_sq (x : F) : HasStrictFDerivAt (fun x => β€–xβ€– ^ 2) (2 β€’ (innerSL ℝ x)) x := by simp only [sq, ← @inner_self_eq_norm_mul_norm ℝ] convert (hasStrictFDerivAt_id x).inner ℝ (hasStrictFDerivAt_id x) ext y simp [two_smul, real_inner_comm] #align has_strict_fderiv_at_norm_sq hasStrictFDerivAt_norm_sqβ‚“ theorem HasFDerivAt.norm_sq {f : G β†’ F} {f' : G β†’L[ℝ] F} (hf : HasFDerivAt f f' x) : HasFDerivAt (β€–f Β·β€– ^ 2) (2 β€’ (innerSL ℝ (f x)).comp f') x := (hasStrictFDerivAt_norm_sq _).hasFDerivAt.comp x hf theorem HasDerivAt.norm_sq {f : ℝ β†’ F} {f' : F} {x : ℝ} (hf : HasDerivAt f f' x) : HasDerivAt (β€–f Β·β€– ^ 2) (2 * Inner.inner (f x) f') x := by simpa using hf.hasFDerivAt.norm_sq.hasDerivAt theorem HasFDerivWithinAt.norm_sq {f : G β†’ F} {f' : G β†’L[ℝ] F} (hf : HasFDerivWithinAt f f' s x) : HasFDerivWithinAt (β€–f Β·β€– ^ 2) (2 β€’ (innerSL ℝ (f x)).comp f') s x := (hasStrictFDerivAt_norm_sq _).hasFDerivAt.comp_hasFDerivWithinAt x hf theorem HasDerivWithinAt.norm_sq {f : ℝ β†’ F} {f' : F} {s : Set ℝ} {x : ℝ} (hf : HasDerivWithinAt f f' s x) : HasDerivWithinAt (β€–f Β·β€– ^ 2) (2 * Inner.inner (f x) f') s x := by simpa using hf.hasFDerivWithinAt.norm_sq.hasDerivWithinAt theorem DifferentiableAt.norm_sq (hf : DifferentiableAt ℝ f x) : DifferentiableAt ℝ (fun y => β€–f yβ€– ^ 2) x := ((contDiffAt_id.norm_sq π•œ).differentiableAt le_rfl).comp x hf #align differentiable_at.norm_sq DifferentiableAt.norm_sq theorem DifferentiableAt.norm (hf : DifferentiableAt ℝ f x) (h0 : f x β‰  0) : DifferentiableAt ℝ (fun y => β€–f yβ€–) x := ((contDiffAt_norm π•œ h0).differentiableAt le_rfl).comp x hf #align differentiable_at.norm DifferentiableAt.norm theorem DifferentiableAt.dist (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) (hne : f x β‰  g x) : DifferentiableAt ℝ (fun y => dist (f y) (g y)) x := by simp only [dist_eq_norm]; exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align differentiable_at.dist DifferentiableAt.dist theorem Differentiable.norm_sq (hf : Differentiable ℝ f) : Differentiable ℝ fun y => β€–f yβ€– ^ 2 := fun x => (hf x).norm_sq π•œ #align differentiable.norm_sq Differentiable.norm_sq theorem Differentiable.norm (hf : Differentiable ℝ f) (h0 : βˆ€ x, f x β‰  0) : Differentiable ℝ fun y => β€–f yβ€– := fun x => (hf x).norm π•œ (h0 x) #align differentiable.norm Differentiable.norm theorem Differentiable.dist (hf : Differentiable ℝ f) (hg : Differentiable ℝ g) (hne : βˆ€ x, f x β‰  g x) : Differentiable ℝ fun y => dist (f y) (g y) := fun x => (hf x).dist π•œ (hg x) (hne x) #align differentiable.dist Differentiable.dist theorem DifferentiableWithinAt.norm_sq (hf : DifferentiableWithinAt ℝ f s x) : DifferentiableWithinAt ℝ (fun y => β€–f yβ€– ^ 2) s x := ((contDiffAt_id.norm_sq π•œ).differentiableAt le_rfl).comp_differentiableWithinAt x hf #align differentiable_within_at.norm_sq DifferentiableWithinAt.norm_sq theorem DifferentiableWithinAt.norm (hf : DifferentiableWithinAt ℝ f s x) (h0 : f x β‰  0) : DifferentiableWithinAt ℝ (fun y => β€–f yβ€–) s x := ((contDiffAt_id.norm π•œ h0).differentiableAt le_rfl).comp_differentiableWithinAt x hf #align differentiable_within_at.norm DifferentiableWithinAt.norm theorem DifferentiableWithinAt.dist (hf : DifferentiableWithinAt ℝ f s x) (hg : DifferentiableWithinAt ℝ g s x) (hne : f x β‰  g x) : DifferentiableWithinAt ℝ (fun y => dist (f y) (g y)) s x := by simp only [dist_eq_norm] exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align differentiable_within_at.dist DifferentiableWithinAt.dist theorem DifferentiableOn.norm_sq (hf : DifferentiableOn ℝ f s) : DifferentiableOn ℝ (fun y => β€–f yβ€– ^ 2) s := fun x hx => (hf x hx).norm_sq π•œ #align differentiable_on.norm_sq DifferentiableOn.norm_sq theorem DifferentiableOn.norm (hf : DifferentiableOn ℝ f s) (h0 : βˆ€ x ∈ s, f x β‰  0) : DifferentiableOn ℝ (fun y => β€–f yβ€–) s := fun x hx => (hf x hx).norm π•œ (h0 x hx) #align differentiable_on.norm DifferentiableOn.norm theorem DifferentiableOn.dist (hf : DifferentiableOn ℝ f s) (hg : DifferentiableOn ℝ g s) (hne : βˆ€ x ∈ s, f x β‰  g x) : DifferentiableOn ℝ (fun y => dist (f y) (g y)) s := fun x hx => (hf x hx).dist π•œ (hg x hx) (hne x hx) #align differentiable_on.dist DifferentiableOn.dist end DerivInner section PiLike open ContinuousLinearMap variable {π•œ ΞΉ H : Type*} [IsROrC π•œ] [NormedAddCommGroup H] [NormedSpace π•œ H] [Fintype ΞΉ] {f : H β†’ EuclideanSpace π•œ ΞΉ} {f' : H β†’L[π•œ] EuclideanSpace π•œ ΞΉ} {t : Set H} {y : H} theorem differentiableWithinAt_euclidean : DifferentiableWithinAt π•œ f t y ↔ βˆ€ i, DifferentiableWithinAt π•œ (fun x => f x i) t y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_differentiableWithinAt_iff, differentiableWithinAt_pi] rfl #align differentiable_within_at_euclidean differentiableWithinAt_euclidean theorem differentiableAt_euclidean : DifferentiableAt π•œ f y ↔ βˆ€ i, DifferentiableAt π•œ (fun x => f x i) y := by
rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_differentiableAt_iff, differentiableAt_pi]
theorem differentiableAt_euclidean : DifferentiableAt π•œ f y ↔ βˆ€ i, DifferentiableAt π•œ (fun x => f x i) y := by
Mathlib.Analysis.InnerProductSpace.Calculus.318_0.6FECEGgqdb67QLM
theorem differentiableAt_euclidean : DifferentiableAt π•œ f y ↔ βˆ€ i, DifferentiableAt π•œ (fun x => f x i) y
Mathlib_Analysis_InnerProductSpace_Calculus
π•œ : Type u_1 ΞΉ : Type u_2 H : Type u_3 inst✝³ : IsROrC π•œ inst✝² : NormedAddCommGroup H inst✝¹ : NormedSpace π•œ H inst✝ : Fintype ΞΉ f : H β†’ EuclideanSpace π•œ ΞΉ f' : H β†’L[π•œ] EuclideanSpace π•œ ΞΉ t : Set H y : H ⊒ (βˆ€ (i : ΞΉ), DifferentiableAt π•œ (fun x => (⇑(EuclideanSpace.equiv ΞΉ π•œ) ∘ f) x i) y) ↔ βˆ€ (i : ΞΉ), DifferentiableAt π•œ (fun x => f x i) y
/- Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ import Mathlib.Analysis.InnerProductSpace.PiL2 import Mathlib.Analysis.SpecialFunctions.Sqrt import Mathlib.Analysis.NormedSpace.HomeomorphBall #align_import analysis.inner_product_space.calculus from "leanprover-community/mathlib"@"f9dd3204df14a0749cd456fac1e6849dfe7d2b88" /-! # Calculus in inner product spaces In this file we prove that the inner product and square of the norm in an inner space are infinitely `ℝ`-smooth. In order to state these results, we need a `NormedSpace ℝ E` instance. Though we can deduce this structure from `InnerProductSpace π•œ E`, this instance may be not definitionally equal to some other β€œnatural” instance. So, we assume `[NormedSpace ℝ E]`. We also prove that functions to a `EuclideanSpace` are (higher) differentiable if and only if their components are. This follows from the corresponding fact for finite product of normed spaces, and from the equivalence of norms in finite dimensions. ## TODO The last part of the file should be generalized to `PiLp`. -/ noncomputable section open IsROrC Real Filter open scoped BigOperators Classical Topology section DerivInner variable {π•œ E F : Type*} [IsROrC π•œ] variable [NormedAddCommGroup E] [InnerProductSpace π•œ E] variable [NormedAddCommGroup F] [InnerProductSpace ℝ F] local notation "βŸͺ" x ", " y "⟫" => @inner π•œ _ _ x y variable (π•œ) [NormedSpace ℝ E] /-- Derivative of the inner product. -/ def fderivInnerClm (p : E Γ— E) : E Γ— E β†’L[ℝ] π•œ := isBoundedBilinearMap_inner.deriv p #align fderiv_inner_clm fderivInnerClm @[simp] theorem fderivInnerClm_apply (p x : E Γ— E) : fderivInnerClm π•œ p x = βŸͺp.1, x.2⟫ + βŸͺx.1, p.2⟫ := rfl #align fderiv_inner_clm_apply fderivInnerClm_apply variable {π•œ} -- porting note: Lean 3 magically switches back to `{π•œ}` here theorem contDiff_inner {n} : ContDiff ℝ n fun p : E Γ— E => βŸͺp.1, p.2⟫ := isBoundedBilinearMap_inner.contDiff #align cont_diff_inner contDiff_inner theorem contDiffAt_inner {p : E Γ— E} {n} : ContDiffAt ℝ n (fun p : E Γ— E => βŸͺp.1, p.2⟫) p := ContDiff.contDiffAt contDiff_inner #align cont_diff_at_inner contDiffAt_inner theorem differentiable_inner : Differentiable ℝ fun p : E Γ— E => βŸͺp.1, p.2⟫ := isBoundedBilinearMap_inner.differentiableAt #align differentiable_inner differentiable_inner variable (π•œ) variable {G : Type*} [NormedAddCommGroup G] [NormedSpace ℝ G] {f g : G β†’ E} {f' g' : G β†’L[ℝ] E} {s : Set G} {x : G} {n : β„•βˆž} theorem ContDiffWithinAt.inner (hf : ContDiffWithinAt ℝ n f s x) (hg : ContDiffWithinAt ℝ n g s x) : ContDiffWithinAt ℝ n (fun x => βŸͺf x, g x⟫) s x := contDiffAt_inner.comp_contDiffWithinAt x (hf.prod hg) #align cont_diff_within_at.inner ContDiffWithinAt.inner nonrec theorem ContDiffAt.inner (hf : ContDiffAt ℝ n f x) (hg : ContDiffAt ℝ n g x) : ContDiffAt ℝ n (fun x => βŸͺf x, g x⟫) x := hf.inner π•œ hg #align cont_diff_at.inner ContDiffAt.inner theorem ContDiffOn.inner (hf : ContDiffOn ℝ n f s) (hg : ContDiffOn ℝ n g s) : ContDiffOn ℝ n (fun x => βŸͺf x, g x⟫) s := fun x hx => (hf x hx).inner π•œ (hg x hx) #align cont_diff_on.inner ContDiffOn.inner theorem ContDiff.inner (hf : ContDiff ℝ n f) (hg : ContDiff ℝ n g) : ContDiff ℝ n fun x => βŸͺf x, g x⟫ := contDiff_inner.comp (hf.prod hg) #align cont_diff.inner ContDiff.inner theorem HasFDerivWithinAt.inner (hf : HasFDerivWithinAt f f' s x) (hg : HasFDerivWithinAt g g' s x) : HasFDerivWithinAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') s x := (isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp_hasFDerivWithinAt x (hf.prod hg) #align has_fderiv_within_at.inner HasFDerivWithinAt.inner theorem HasStrictFDerivAt.inner (hf : HasStrictFDerivAt f f' x) (hg : HasStrictFDerivAt g g' x) : HasStrictFDerivAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') x := (isBoundedBilinearMap_inner.hasStrictFDerivAt (f x, g x)).comp x (hf.prod hg) #align has_strict_fderiv_at.inner HasStrictFDerivAt.inner theorem HasFDerivAt.inner (hf : HasFDerivAt f f' x) (hg : HasFDerivAt g g' x) : HasFDerivAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') x := (isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp x (hf.prod hg) #align has_fderiv_at.inner HasFDerivAt.inner theorem HasDerivWithinAt.inner {f g : ℝ β†’ E} {f' g' : E} {s : Set ℝ} {x : ℝ} (hf : HasDerivWithinAt f f' s x) (hg : HasDerivWithinAt g g' s x) : HasDerivWithinAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) s x := by simpa using (hf.hasFDerivWithinAt.inner π•œ hg.hasFDerivWithinAt).hasDerivWithinAt #align has_deriv_within_at.inner HasDerivWithinAt.inner theorem HasDerivAt.inner {f g : ℝ β†’ E} {f' g' : E} {x : ℝ} : HasDerivAt f f' x β†’ HasDerivAt g g' x β†’ HasDerivAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) x := by simpa only [← hasDerivWithinAt_univ] using HasDerivWithinAt.inner π•œ #align has_deriv_at.inner HasDerivAt.inner theorem DifferentiableWithinAt.inner (hf : DifferentiableWithinAt ℝ f s x) (hg : DifferentiableWithinAt ℝ g s x) : DifferentiableWithinAt ℝ (fun x => βŸͺf x, g x⟫) s x := ((differentiable_inner _).hasFDerivAt.comp_hasFDerivWithinAt x (hf.prod hg).hasFDerivWithinAt).differentiableWithinAt #align differentiable_within_at.inner DifferentiableWithinAt.inner theorem DifferentiableAt.inner (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) : DifferentiableAt ℝ (fun x => βŸͺf x, g x⟫) x := (differentiable_inner _).comp x (hf.prod hg) #align differentiable_at.inner DifferentiableAt.inner theorem DifferentiableOn.inner (hf : DifferentiableOn ℝ f s) (hg : DifferentiableOn ℝ g s) : DifferentiableOn ℝ (fun x => βŸͺf x, g x⟫) s := fun x hx => (hf x hx).inner π•œ (hg x hx) #align differentiable_on.inner DifferentiableOn.inner theorem Differentiable.inner (hf : Differentiable ℝ f) (hg : Differentiable ℝ g) : Differentiable ℝ fun x => βŸͺf x, g x⟫ := fun x => (hf x).inner π•œ (hg x) #align differentiable.inner Differentiable.inner theorem fderiv_inner_apply (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) (y : G) : fderiv ℝ (fun t => βŸͺf t, g t⟫) x y = βŸͺf x, fderiv ℝ g x y⟫ + βŸͺfderiv ℝ f x y, g x⟫ := by rw [(hf.hasFDerivAt.inner π•œ hg.hasFDerivAt).fderiv]; rfl #align fderiv_inner_apply fderiv_inner_apply theorem deriv_inner_apply {f g : ℝ β†’ E} {x : ℝ} (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) : deriv (fun t => βŸͺf t, g t⟫) x = βŸͺf x, deriv g x⟫ + βŸͺderiv f x, g x⟫ := (hf.hasDerivAt.inner π•œ hg.hasDerivAt).deriv #align deriv_inner_apply deriv_inner_apply theorem contDiff_norm_sq : ContDiff ℝ n fun x : E => β€–xβ€– ^ 2 := by convert (reClm : π•œ β†’L[ℝ] ℝ).contDiff.comp ((contDiff_id (E := E)).inner π•œ (contDiff_id (E := E))) exact (inner_self_eq_norm_sq _).symm #align cont_diff_norm_sq contDiff_norm_sq theorem ContDiff.norm_sq (hf : ContDiff ℝ n f) : ContDiff ℝ n fun x => β€–f xβ€– ^ 2 := (contDiff_norm_sq π•œ).comp hf #align cont_diff.norm_sq ContDiff.norm_sq theorem ContDiffWithinAt.norm_sq (hf : ContDiffWithinAt ℝ n f s x) : ContDiffWithinAt ℝ n (fun y => β€–f yβ€– ^ 2) s x := (contDiff_norm_sq π•œ).contDiffAt.comp_contDiffWithinAt x hf #align cont_diff_within_at.norm_sq ContDiffWithinAt.norm_sq nonrec theorem ContDiffAt.norm_sq (hf : ContDiffAt ℝ n f x) : ContDiffAt ℝ n (β€–f Β·β€– ^ 2) x := hf.norm_sq π•œ #align cont_diff_at.norm_sq ContDiffAt.norm_sq theorem contDiffAt_norm {x : E} (hx : x β‰  0) : ContDiffAt ℝ n norm x := by have : β€–id xβ€– ^ 2 β‰  0 := pow_ne_zero 2 (norm_pos_iff.2 hx).ne' simpa only [id, sqrt_sq, norm_nonneg] using (contDiffAt_id.norm_sq π•œ).sqrt this #align cont_diff_at_norm contDiffAt_norm theorem ContDiffAt.norm (hf : ContDiffAt ℝ n f x) (h0 : f x β‰  0) : ContDiffAt ℝ n (fun y => β€–f yβ€–) x := (contDiffAt_norm π•œ h0).comp x hf #align cont_diff_at.norm ContDiffAt.norm theorem ContDiffAt.dist (hf : ContDiffAt ℝ n f x) (hg : ContDiffAt ℝ n g x) (hne : f x β‰  g x) : ContDiffAt ℝ n (fun y => dist (f y) (g y)) x := by simp only [dist_eq_norm] exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align cont_diff_at.dist ContDiffAt.dist theorem ContDiffWithinAt.norm (hf : ContDiffWithinAt ℝ n f s x) (h0 : f x β‰  0) : ContDiffWithinAt ℝ n (fun y => β€–f yβ€–) s x := (contDiffAt_norm π•œ h0).comp_contDiffWithinAt x hf #align cont_diff_within_at.norm ContDiffWithinAt.norm theorem ContDiffWithinAt.dist (hf : ContDiffWithinAt ℝ n f s x) (hg : ContDiffWithinAt ℝ n g s x) (hne : f x β‰  g x) : ContDiffWithinAt ℝ n (fun y => dist (f y) (g y)) s x := by simp only [dist_eq_norm]; exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align cont_diff_within_at.dist ContDiffWithinAt.dist theorem ContDiffOn.norm_sq (hf : ContDiffOn ℝ n f s) : ContDiffOn ℝ n (fun y => β€–f yβ€– ^ 2) s := fun x hx => (hf x hx).norm_sq π•œ #align cont_diff_on.norm_sq ContDiffOn.norm_sq theorem ContDiffOn.norm (hf : ContDiffOn ℝ n f s) (h0 : βˆ€ x ∈ s, f x β‰  0) : ContDiffOn ℝ n (fun y => β€–f yβ€–) s := fun x hx => (hf x hx).norm π•œ (h0 x hx) #align cont_diff_on.norm ContDiffOn.norm theorem ContDiffOn.dist (hf : ContDiffOn ℝ n f s) (hg : ContDiffOn ℝ n g s) (hne : βˆ€ x ∈ s, f x β‰  g x) : ContDiffOn ℝ n (fun y => dist (f y) (g y)) s := fun x hx => (hf x hx).dist π•œ (hg x hx) (hne x hx) #align cont_diff_on.dist ContDiffOn.dist theorem ContDiff.norm (hf : ContDiff ℝ n f) (h0 : βˆ€ x, f x β‰  0) : ContDiff ℝ n fun y => β€–f yβ€– := contDiff_iff_contDiffAt.2 fun x => hf.contDiffAt.norm π•œ (h0 x) #align cont_diff.norm ContDiff.norm theorem ContDiff.dist (hf : ContDiff ℝ n f) (hg : ContDiff ℝ n g) (hne : βˆ€ x, f x β‰  g x) : ContDiff ℝ n fun y => dist (f y) (g y) := contDiff_iff_contDiffAt.2 fun x => hf.contDiffAt.dist π•œ hg.contDiffAt (hne x) #align cont_diff.dist ContDiff.dist -- porting note: use `2 β€’` instead of `bit0` theorem hasStrictFDerivAt_norm_sq (x : F) : HasStrictFDerivAt (fun x => β€–xβ€– ^ 2) (2 β€’ (innerSL ℝ x)) x := by simp only [sq, ← @inner_self_eq_norm_mul_norm ℝ] convert (hasStrictFDerivAt_id x).inner ℝ (hasStrictFDerivAt_id x) ext y simp [two_smul, real_inner_comm] #align has_strict_fderiv_at_norm_sq hasStrictFDerivAt_norm_sqβ‚“ theorem HasFDerivAt.norm_sq {f : G β†’ F} {f' : G β†’L[ℝ] F} (hf : HasFDerivAt f f' x) : HasFDerivAt (β€–f Β·β€– ^ 2) (2 β€’ (innerSL ℝ (f x)).comp f') x := (hasStrictFDerivAt_norm_sq _).hasFDerivAt.comp x hf theorem HasDerivAt.norm_sq {f : ℝ β†’ F} {f' : F} {x : ℝ} (hf : HasDerivAt f f' x) : HasDerivAt (β€–f Β·β€– ^ 2) (2 * Inner.inner (f x) f') x := by simpa using hf.hasFDerivAt.norm_sq.hasDerivAt theorem HasFDerivWithinAt.norm_sq {f : G β†’ F} {f' : G β†’L[ℝ] F} (hf : HasFDerivWithinAt f f' s x) : HasFDerivWithinAt (β€–f Β·β€– ^ 2) (2 β€’ (innerSL ℝ (f x)).comp f') s x := (hasStrictFDerivAt_norm_sq _).hasFDerivAt.comp_hasFDerivWithinAt x hf theorem HasDerivWithinAt.norm_sq {f : ℝ β†’ F} {f' : F} {s : Set ℝ} {x : ℝ} (hf : HasDerivWithinAt f f' s x) : HasDerivWithinAt (β€–f Β·β€– ^ 2) (2 * Inner.inner (f x) f') s x := by simpa using hf.hasFDerivWithinAt.norm_sq.hasDerivWithinAt theorem DifferentiableAt.norm_sq (hf : DifferentiableAt ℝ f x) : DifferentiableAt ℝ (fun y => β€–f yβ€– ^ 2) x := ((contDiffAt_id.norm_sq π•œ).differentiableAt le_rfl).comp x hf #align differentiable_at.norm_sq DifferentiableAt.norm_sq theorem DifferentiableAt.norm (hf : DifferentiableAt ℝ f x) (h0 : f x β‰  0) : DifferentiableAt ℝ (fun y => β€–f yβ€–) x := ((contDiffAt_norm π•œ h0).differentiableAt le_rfl).comp x hf #align differentiable_at.norm DifferentiableAt.norm theorem DifferentiableAt.dist (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) (hne : f x β‰  g x) : DifferentiableAt ℝ (fun y => dist (f y) (g y)) x := by simp only [dist_eq_norm]; exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align differentiable_at.dist DifferentiableAt.dist theorem Differentiable.norm_sq (hf : Differentiable ℝ f) : Differentiable ℝ fun y => β€–f yβ€– ^ 2 := fun x => (hf x).norm_sq π•œ #align differentiable.norm_sq Differentiable.norm_sq theorem Differentiable.norm (hf : Differentiable ℝ f) (h0 : βˆ€ x, f x β‰  0) : Differentiable ℝ fun y => β€–f yβ€– := fun x => (hf x).norm π•œ (h0 x) #align differentiable.norm Differentiable.norm theorem Differentiable.dist (hf : Differentiable ℝ f) (hg : Differentiable ℝ g) (hne : βˆ€ x, f x β‰  g x) : Differentiable ℝ fun y => dist (f y) (g y) := fun x => (hf x).dist π•œ (hg x) (hne x) #align differentiable.dist Differentiable.dist theorem DifferentiableWithinAt.norm_sq (hf : DifferentiableWithinAt ℝ f s x) : DifferentiableWithinAt ℝ (fun y => β€–f yβ€– ^ 2) s x := ((contDiffAt_id.norm_sq π•œ).differentiableAt le_rfl).comp_differentiableWithinAt x hf #align differentiable_within_at.norm_sq DifferentiableWithinAt.norm_sq theorem DifferentiableWithinAt.norm (hf : DifferentiableWithinAt ℝ f s x) (h0 : f x β‰  0) : DifferentiableWithinAt ℝ (fun y => β€–f yβ€–) s x := ((contDiffAt_id.norm π•œ h0).differentiableAt le_rfl).comp_differentiableWithinAt x hf #align differentiable_within_at.norm DifferentiableWithinAt.norm theorem DifferentiableWithinAt.dist (hf : DifferentiableWithinAt ℝ f s x) (hg : DifferentiableWithinAt ℝ g s x) (hne : f x β‰  g x) : DifferentiableWithinAt ℝ (fun y => dist (f y) (g y)) s x := by simp only [dist_eq_norm] exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align differentiable_within_at.dist DifferentiableWithinAt.dist theorem DifferentiableOn.norm_sq (hf : DifferentiableOn ℝ f s) : DifferentiableOn ℝ (fun y => β€–f yβ€– ^ 2) s := fun x hx => (hf x hx).norm_sq π•œ #align differentiable_on.norm_sq DifferentiableOn.norm_sq theorem DifferentiableOn.norm (hf : DifferentiableOn ℝ f s) (h0 : βˆ€ x ∈ s, f x β‰  0) : DifferentiableOn ℝ (fun y => β€–f yβ€–) s := fun x hx => (hf x hx).norm π•œ (h0 x hx) #align differentiable_on.norm DifferentiableOn.norm theorem DifferentiableOn.dist (hf : DifferentiableOn ℝ f s) (hg : DifferentiableOn ℝ g s) (hne : βˆ€ x ∈ s, f x β‰  g x) : DifferentiableOn ℝ (fun y => dist (f y) (g y)) s := fun x hx => (hf x hx).dist π•œ (hg x hx) (hne x hx) #align differentiable_on.dist DifferentiableOn.dist end DerivInner section PiLike open ContinuousLinearMap variable {π•œ ΞΉ H : Type*} [IsROrC π•œ] [NormedAddCommGroup H] [NormedSpace π•œ H] [Fintype ΞΉ] {f : H β†’ EuclideanSpace π•œ ΞΉ} {f' : H β†’L[π•œ] EuclideanSpace π•œ ΞΉ} {t : Set H} {y : H} theorem differentiableWithinAt_euclidean : DifferentiableWithinAt π•œ f t y ↔ βˆ€ i, DifferentiableWithinAt π•œ (fun x => f x i) t y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_differentiableWithinAt_iff, differentiableWithinAt_pi] rfl #align differentiable_within_at_euclidean differentiableWithinAt_euclidean theorem differentiableAt_euclidean : DifferentiableAt π•œ f y ↔ βˆ€ i, DifferentiableAt π•œ (fun x => f x i) y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_differentiableAt_iff, differentiableAt_pi]
rfl
theorem differentiableAt_euclidean : DifferentiableAt π•œ f y ↔ βˆ€ i, DifferentiableAt π•œ (fun x => f x i) y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_differentiableAt_iff, differentiableAt_pi]
Mathlib.Analysis.InnerProductSpace.Calculus.318_0.6FECEGgqdb67QLM
theorem differentiableAt_euclidean : DifferentiableAt π•œ f y ↔ βˆ€ i, DifferentiableAt π•œ (fun x => f x i) y
Mathlib_Analysis_InnerProductSpace_Calculus
π•œ : Type u_1 ΞΉ : Type u_2 H : Type u_3 inst✝³ : IsROrC π•œ inst✝² : NormedAddCommGroup H inst✝¹ : NormedSpace π•œ H inst✝ : Fintype ΞΉ f : H β†’ EuclideanSpace π•œ ΞΉ f' : H β†’L[π•œ] EuclideanSpace π•œ ΞΉ t : Set H y : H ⊒ DifferentiableOn π•œ f t ↔ βˆ€ (i : ΞΉ), DifferentiableOn π•œ (fun x => f x i) t
/- Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ import Mathlib.Analysis.InnerProductSpace.PiL2 import Mathlib.Analysis.SpecialFunctions.Sqrt import Mathlib.Analysis.NormedSpace.HomeomorphBall #align_import analysis.inner_product_space.calculus from "leanprover-community/mathlib"@"f9dd3204df14a0749cd456fac1e6849dfe7d2b88" /-! # Calculus in inner product spaces In this file we prove that the inner product and square of the norm in an inner space are infinitely `ℝ`-smooth. In order to state these results, we need a `NormedSpace ℝ E` instance. Though we can deduce this structure from `InnerProductSpace π•œ E`, this instance may be not definitionally equal to some other β€œnatural” instance. So, we assume `[NormedSpace ℝ E]`. We also prove that functions to a `EuclideanSpace` are (higher) differentiable if and only if their components are. This follows from the corresponding fact for finite product of normed spaces, and from the equivalence of norms in finite dimensions. ## TODO The last part of the file should be generalized to `PiLp`. -/ noncomputable section open IsROrC Real Filter open scoped BigOperators Classical Topology section DerivInner variable {π•œ E F : Type*} [IsROrC π•œ] variable [NormedAddCommGroup E] [InnerProductSpace π•œ E] variable [NormedAddCommGroup F] [InnerProductSpace ℝ F] local notation "βŸͺ" x ", " y "⟫" => @inner π•œ _ _ x y variable (π•œ) [NormedSpace ℝ E] /-- Derivative of the inner product. -/ def fderivInnerClm (p : E Γ— E) : E Γ— E β†’L[ℝ] π•œ := isBoundedBilinearMap_inner.deriv p #align fderiv_inner_clm fderivInnerClm @[simp] theorem fderivInnerClm_apply (p x : E Γ— E) : fderivInnerClm π•œ p x = βŸͺp.1, x.2⟫ + βŸͺx.1, p.2⟫ := rfl #align fderiv_inner_clm_apply fderivInnerClm_apply variable {π•œ} -- porting note: Lean 3 magically switches back to `{π•œ}` here theorem contDiff_inner {n} : ContDiff ℝ n fun p : E Γ— E => βŸͺp.1, p.2⟫ := isBoundedBilinearMap_inner.contDiff #align cont_diff_inner contDiff_inner theorem contDiffAt_inner {p : E Γ— E} {n} : ContDiffAt ℝ n (fun p : E Γ— E => βŸͺp.1, p.2⟫) p := ContDiff.contDiffAt contDiff_inner #align cont_diff_at_inner contDiffAt_inner theorem differentiable_inner : Differentiable ℝ fun p : E Γ— E => βŸͺp.1, p.2⟫ := isBoundedBilinearMap_inner.differentiableAt #align differentiable_inner differentiable_inner variable (π•œ) variable {G : Type*} [NormedAddCommGroup G] [NormedSpace ℝ G] {f g : G β†’ E} {f' g' : G β†’L[ℝ] E} {s : Set G} {x : G} {n : β„•βˆž} theorem ContDiffWithinAt.inner (hf : ContDiffWithinAt ℝ n f s x) (hg : ContDiffWithinAt ℝ n g s x) : ContDiffWithinAt ℝ n (fun x => βŸͺf x, g x⟫) s x := contDiffAt_inner.comp_contDiffWithinAt x (hf.prod hg) #align cont_diff_within_at.inner ContDiffWithinAt.inner nonrec theorem ContDiffAt.inner (hf : ContDiffAt ℝ n f x) (hg : ContDiffAt ℝ n g x) : ContDiffAt ℝ n (fun x => βŸͺf x, g x⟫) x := hf.inner π•œ hg #align cont_diff_at.inner ContDiffAt.inner theorem ContDiffOn.inner (hf : ContDiffOn ℝ n f s) (hg : ContDiffOn ℝ n g s) : ContDiffOn ℝ n (fun x => βŸͺf x, g x⟫) s := fun x hx => (hf x hx).inner π•œ (hg x hx) #align cont_diff_on.inner ContDiffOn.inner theorem ContDiff.inner (hf : ContDiff ℝ n f) (hg : ContDiff ℝ n g) : ContDiff ℝ n fun x => βŸͺf x, g x⟫ := contDiff_inner.comp (hf.prod hg) #align cont_diff.inner ContDiff.inner theorem HasFDerivWithinAt.inner (hf : HasFDerivWithinAt f f' s x) (hg : HasFDerivWithinAt g g' s x) : HasFDerivWithinAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') s x := (isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp_hasFDerivWithinAt x (hf.prod hg) #align has_fderiv_within_at.inner HasFDerivWithinAt.inner theorem HasStrictFDerivAt.inner (hf : HasStrictFDerivAt f f' x) (hg : HasStrictFDerivAt g g' x) : HasStrictFDerivAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') x := (isBoundedBilinearMap_inner.hasStrictFDerivAt (f x, g x)).comp x (hf.prod hg) #align has_strict_fderiv_at.inner HasStrictFDerivAt.inner theorem HasFDerivAt.inner (hf : HasFDerivAt f f' x) (hg : HasFDerivAt g g' x) : HasFDerivAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') x := (isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp x (hf.prod hg) #align has_fderiv_at.inner HasFDerivAt.inner theorem HasDerivWithinAt.inner {f g : ℝ β†’ E} {f' g' : E} {s : Set ℝ} {x : ℝ} (hf : HasDerivWithinAt f f' s x) (hg : HasDerivWithinAt g g' s x) : HasDerivWithinAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) s x := by simpa using (hf.hasFDerivWithinAt.inner π•œ hg.hasFDerivWithinAt).hasDerivWithinAt #align has_deriv_within_at.inner HasDerivWithinAt.inner theorem HasDerivAt.inner {f g : ℝ β†’ E} {f' g' : E} {x : ℝ} : HasDerivAt f f' x β†’ HasDerivAt g g' x β†’ HasDerivAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) x := by simpa only [← hasDerivWithinAt_univ] using HasDerivWithinAt.inner π•œ #align has_deriv_at.inner HasDerivAt.inner theorem DifferentiableWithinAt.inner (hf : DifferentiableWithinAt ℝ f s x) (hg : DifferentiableWithinAt ℝ g s x) : DifferentiableWithinAt ℝ (fun x => βŸͺf x, g x⟫) s x := ((differentiable_inner _).hasFDerivAt.comp_hasFDerivWithinAt x (hf.prod hg).hasFDerivWithinAt).differentiableWithinAt #align differentiable_within_at.inner DifferentiableWithinAt.inner theorem DifferentiableAt.inner (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) : DifferentiableAt ℝ (fun x => βŸͺf x, g x⟫) x := (differentiable_inner _).comp x (hf.prod hg) #align differentiable_at.inner DifferentiableAt.inner theorem DifferentiableOn.inner (hf : DifferentiableOn ℝ f s) (hg : DifferentiableOn ℝ g s) : DifferentiableOn ℝ (fun x => βŸͺf x, g x⟫) s := fun x hx => (hf x hx).inner π•œ (hg x hx) #align differentiable_on.inner DifferentiableOn.inner theorem Differentiable.inner (hf : Differentiable ℝ f) (hg : Differentiable ℝ g) : Differentiable ℝ fun x => βŸͺf x, g x⟫ := fun x => (hf x).inner π•œ (hg x) #align differentiable.inner Differentiable.inner theorem fderiv_inner_apply (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) (y : G) : fderiv ℝ (fun t => βŸͺf t, g t⟫) x y = βŸͺf x, fderiv ℝ g x y⟫ + βŸͺfderiv ℝ f x y, g x⟫ := by rw [(hf.hasFDerivAt.inner π•œ hg.hasFDerivAt).fderiv]; rfl #align fderiv_inner_apply fderiv_inner_apply theorem deriv_inner_apply {f g : ℝ β†’ E} {x : ℝ} (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) : deriv (fun t => βŸͺf t, g t⟫) x = βŸͺf x, deriv g x⟫ + βŸͺderiv f x, g x⟫ := (hf.hasDerivAt.inner π•œ hg.hasDerivAt).deriv #align deriv_inner_apply deriv_inner_apply theorem contDiff_norm_sq : ContDiff ℝ n fun x : E => β€–xβ€– ^ 2 := by convert (reClm : π•œ β†’L[ℝ] ℝ).contDiff.comp ((contDiff_id (E := E)).inner π•œ (contDiff_id (E := E))) exact (inner_self_eq_norm_sq _).symm #align cont_diff_norm_sq contDiff_norm_sq theorem ContDiff.norm_sq (hf : ContDiff ℝ n f) : ContDiff ℝ n fun x => β€–f xβ€– ^ 2 := (contDiff_norm_sq π•œ).comp hf #align cont_diff.norm_sq ContDiff.norm_sq theorem ContDiffWithinAt.norm_sq (hf : ContDiffWithinAt ℝ n f s x) : ContDiffWithinAt ℝ n (fun y => β€–f yβ€– ^ 2) s x := (contDiff_norm_sq π•œ).contDiffAt.comp_contDiffWithinAt x hf #align cont_diff_within_at.norm_sq ContDiffWithinAt.norm_sq nonrec theorem ContDiffAt.norm_sq (hf : ContDiffAt ℝ n f x) : ContDiffAt ℝ n (β€–f Β·β€– ^ 2) x := hf.norm_sq π•œ #align cont_diff_at.norm_sq ContDiffAt.norm_sq theorem contDiffAt_norm {x : E} (hx : x β‰  0) : ContDiffAt ℝ n norm x := by have : β€–id xβ€– ^ 2 β‰  0 := pow_ne_zero 2 (norm_pos_iff.2 hx).ne' simpa only [id, sqrt_sq, norm_nonneg] using (contDiffAt_id.norm_sq π•œ).sqrt this #align cont_diff_at_norm contDiffAt_norm theorem ContDiffAt.norm (hf : ContDiffAt ℝ n f x) (h0 : f x β‰  0) : ContDiffAt ℝ n (fun y => β€–f yβ€–) x := (contDiffAt_norm π•œ h0).comp x hf #align cont_diff_at.norm ContDiffAt.norm theorem ContDiffAt.dist (hf : ContDiffAt ℝ n f x) (hg : ContDiffAt ℝ n g x) (hne : f x β‰  g x) : ContDiffAt ℝ n (fun y => dist (f y) (g y)) x := by simp only [dist_eq_norm] exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align cont_diff_at.dist ContDiffAt.dist theorem ContDiffWithinAt.norm (hf : ContDiffWithinAt ℝ n f s x) (h0 : f x β‰  0) : ContDiffWithinAt ℝ n (fun y => β€–f yβ€–) s x := (contDiffAt_norm π•œ h0).comp_contDiffWithinAt x hf #align cont_diff_within_at.norm ContDiffWithinAt.norm theorem ContDiffWithinAt.dist (hf : ContDiffWithinAt ℝ n f s x) (hg : ContDiffWithinAt ℝ n g s x) (hne : f x β‰  g x) : ContDiffWithinAt ℝ n (fun y => dist (f y) (g y)) s x := by simp only [dist_eq_norm]; exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align cont_diff_within_at.dist ContDiffWithinAt.dist theorem ContDiffOn.norm_sq (hf : ContDiffOn ℝ n f s) : ContDiffOn ℝ n (fun y => β€–f yβ€– ^ 2) s := fun x hx => (hf x hx).norm_sq π•œ #align cont_diff_on.norm_sq ContDiffOn.norm_sq theorem ContDiffOn.norm (hf : ContDiffOn ℝ n f s) (h0 : βˆ€ x ∈ s, f x β‰  0) : ContDiffOn ℝ n (fun y => β€–f yβ€–) s := fun x hx => (hf x hx).norm π•œ (h0 x hx) #align cont_diff_on.norm ContDiffOn.norm theorem ContDiffOn.dist (hf : ContDiffOn ℝ n f s) (hg : ContDiffOn ℝ n g s) (hne : βˆ€ x ∈ s, f x β‰  g x) : ContDiffOn ℝ n (fun y => dist (f y) (g y)) s := fun x hx => (hf x hx).dist π•œ (hg x hx) (hne x hx) #align cont_diff_on.dist ContDiffOn.dist theorem ContDiff.norm (hf : ContDiff ℝ n f) (h0 : βˆ€ x, f x β‰  0) : ContDiff ℝ n fun y => β€–f yβ€– := contDiff_iff_contDiffAt.2 fun x => hf.contDiffAt.norm π•œ (h0 x) #align cont_diff.norm ContDiff.norm theorem ContDiff.dist (hf : ContDiff ℝ n f) (hg : ContDiff ℝ n g) (hne : βˆ€ x, f x β‰  g x) : ContDiff ℝ n fun y => dist (f y) (g y) := contDiff_iff_contDiffAt.2 fun x => hf.contDiffAt.dist π•œ hg.contDiffAt (hne x) #align cont_diff.dist ContDiff.dist -- porting note: use `2 β€’` instead of `bit0` theorem hasStrictFDerivAt_norm_sq (x : F) : HasStrictFDerivAt (fun x => β€–xβ€– ^ 2) (2 β€’ (innerSL ℝ x)) x := by simp only [sq, ← @inner_self_eq_norm_mul_norm ℝ] convert (hasStrictFDerivAt_id x).inner ℝ (hasStrictFDerivAt_id x) ext y simp [two_smul, real_inner_comm] #align has_strict_fderiv_at_norm_sq hasStrictFDerivAt_norm_sqβ‚“ theorem HasFDerivAt.norm_sq {f : G β†’ F} {f' : G β†’L[ℝ] F} (hf : HasFDerivAt f f' x) : HasFDerivAt (β€–f Β·β€– ^ 2) (2 β€’ (innerSL ℝ (f x)).comp f') x := (hasStrictFDerivAt_norm_sq _).hasFDerivAt.comp x hf theorem HasDerivAt.norm_sq {f : ℝ β†’ F} {f' : F} {x : ℝ} (hf : HasDerivAt f f' x) : HasDerivAt (β€–f Β·β€– ^ 2) (2 * Inner.inner (f x) f') x := by simpa using hf.hasFDerivAt.norm_sq.hasDerivAt theorem HasFDerivWithinAt.norm_sq {f : G β†’ F} {f' : G β†’L[ℝ] F} (hf : HasFDerivWithinAt f f' s x) : HasFDerivWithinAt (β€–f Β·β€– ^ 2) (2 β€’ (innerSL ℝ (f x)).comp f') s x := (hasStrictFDerivAt_norm_sq _).hasFDerivAt.comp_hasFDerivWithinAt x hf theorem HasDerivWithinAt.norm_sq {f : ℝ β†’ F} {f' : F} {s : Set ℝ} {x : ℝ} (hf : HasDerivWithinAt f f' s x) : HasDerivWithinAt (β€–f Β·β€– ^ 2) (2 * Inner.inner (f x) f') s x := by simpa using hf.hasFDerivWithinAt.norm_sq.hasDerivWithinAt theorem DifferentiableAt.norm_sq (hf : DifferentiableAt ℝ f x) : DifferentiableAt ℝ (fun y => β€–f yβ€– ^ 2) x := ((contDiffAt_id.norm_sq π•œ).differentiableAt le_rfl).comp x hf #align differentiable_at.norm_sq DifferentiableAt.norm_sq theorem DifferentiableAt.norm (hf : DifferentiableAt ℝ f x) (h0 : f x β‰  0) : DifferentiableAt ℝ (fun y => β€–f yβ€–) x := ((contDiffAt_norm π•œ h0).differentiableAt le_rfl).comp x hf #align differentiable_at.norm DifferentiableAt.norm theorem DifferentiableAt.dist (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) (hne : f x β‰  g x) : DifferentiableAt ℝ (fun y => dist (f y) (g y)) x := by simp only [dist_eq_norm]; exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align differentiable_at.dist DifferentiableAt.dist theorem Differentiable.norm_sq (hf : Differentiable ℝ f) : Differentiable ℝ fun y => β€–f yβ€– ^ 2 := fun x => (hf x).norm_sq π•œ #align differentiable.norm_sq Differentiable.norm_sq theorem Differentiable.norm (hf : Differentiable ℝ f) (h0 : βˆ€ x, f x β‰  0) : Differentiable ℝ fun y => β€–f yβ€– := fun x => (hf x).norm π•œ (h0 x) #align differentiable.norm Differentiable.norm theorem Differentiable.dist (hf : Differentiable ℝ f) (hg : Differentiable ℝ g) (hne : βˆ€ x, f x β‰  g x) : Differentiable ℝ fun y => dist (f y) (g y) := fun x => (hf x).dist π•œ (hg x) (hne x) #align differentiable.dist Differentiable.dist theorem DifferentiableWithinAt.norm_sq (hf : DifferentiableWithinAt ℝ f s x) : DifferentiableWithinAt ℝ (fun y => β€–f yβ€– ^ 2) s x := ((contDiffAt_id.norm_sq π•œ).differentiableAt le_rfl).comp_differentiableWithinAt x hf #align differentiable_within_at.norm_sq DifferentiableWithinAt.norm_sq theorem DifferentiableWithinAt.norm (hf : DifferentiableWithinAt ℝ f s x) (h0 : f x β‰  0) : DifferentiableWithinAt ℝ (fun y => β€–f yβ€–) s x := ((contDiffAt_id.norm π•œ h0).differentiableAt le_rfl).comp_differentiableWithinAt x hf #align differentiable_within_at.norm DifferentiableWithinAt.norm theorem DifferentiableWithinAt.dist (hf : DifferentiableWithinAt ℝ f s x) (hg : DifferentiableWithinAt ℝ g s x) (hne : f x β‰  g x) : DifferentiableWithinAt ℝ (fun y => dist (f y) (g y)) s x := by simp only [dist_eq_norm] exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align differentiable_within_at.dist DifferentiableWithinAt.dist theorem DifferentiableOn.norm_sq (hf : DifferentiableOn ℝ f s) : DifferentiableOn ℝ (fun y => β€–f yβ€– ^ 2) s := fun x hx => (hf x hx).norm_sq π•œ #align differentiable_on.norm_sq DifferentiableOn.norm_sq theorem DifferentiableOn.norm (hf : DifferentiableOn ℝ f s) (h0 : βˆ€ x ∈ s, f x β‰  0) : DifferentiableOn ℝ (fun y => β€–f yβ€–) s := fun x hx => (hf x hx).norm π•œ (h0 x hx) #align differentiable_on.norm DifferentiableOn.norm theorem DifferentiableOn.dist (hf : DifferentiableOn ℝ f s) (hg : DifferentiableOn ℝ g s) (hne : βˆ€ x ∈ s, f x β‰  g x) : DifferentiableOn ℝ (fun y => dist (f y) (g y)) s := fun x hx => (hf x hx).dist π•œ (hg x hx) (hne x hx) #align differentiable_on.dist DifferentiableOn.dist end DerivInner section PiLike open ContinuousLinearMap variable {π•œ ΞΉ H : Type*} [IsROrC π•œ] [NormedAddCommGroup H] [NormedSpace π•œ H] [Fintype ΞΉ] {f : H β†’ EuclideanSpace π•œ ΞΉ} {f' : H β†’L[π•œ] EuclideanSpace π•œ ΞΉ} {t : Set H} {y : H} theorem differentiableWithinAt_euclidean : DifferentiableWithinAt π•œ f t y ↔ βˆ€ i, DifferentiableWithinAt π•œ (fun x => f x i) t y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_differentiableWithinAt_iff, differentiableWithinAt_pi] rfl #align differentiable_within_at_euclidean differentiableWithinAt_euclidean theorem differentiableAt_euclidean : DifferentiableAt π•œ f y ↔ βˆ€ i, DifferentiableAt π•œ (fun x => f x i) y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_differentiableAt_iff, differentiableAt_pi] rfl #align differentiable_at_euclidean differentiableAt_euclidean theorem differentiableOn_euclidean : DifferentiableOn π•œ f t ↔ βˆ€ i, DifferentiableOn π•œ (fun x => f x i) t := by
rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_differentiableOn_iff, differentiableOn_pi]
theorem differentiableOn_euclidean : DifferentiableOn π•œ f t ↔ βˆ€ i, DifferentiableOn π•œ (fun x => f x i) t := by
Mathlib.Analysis.InnerProductSpace.Calculus.324_0.6FECEGgqdb67QLM
theorem differentiableOn_euclidean : DifferentiableOn π•œ f t ↔ βˆ€ i, DifferentiableOn π•œ (fun x => f x i) t
Mathlib_Analysis_InnerProductSpace_Calculus
π•œ : Type u_1 ΞΉ : Type u_2 H : Type u_3 inst✝³ : IsROrC π•œ inst✝² : NormedAddCommGroup H inst✝¹ : NormedSpace π•œ H inst✝ : Fintype ΞΉ f : H β†’ EuclideanSpace π•œ ΞΉ f' : H β†’L[π•œ] EuclideanSpace π•œ ΞΉ t : Set H y : H ⊒ (βˆ€ (i : ΞΉ), DifferentiableOn π•œ (fun x => (⇑(EuclideanSpace.equiv ΞΉ π•œ) ∘ f) x i) t) ↔ βˆ€ (i : ΞΉ), DifferentiableOn π•œ (fun x => f x i) t
/- Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ import Mathlib.Analysis.InnerProductSpace.PiL2 import Mathlib.Analysis.SpecialFunctions.Sqrt import Mathlib.Analysis.NormedSpace.HomeomorphBall #align_import analysis.inner_product_space.calculus from "leanprover-community/mathlib"@"f9dd3204df14a0749cd456fac1e6849dfe7d2b88" /-! # Calculus in inner product spaces In this file we prove that the inner product and square of the norm in an inner space are infinitely `ℝ`-smooth. In order to state these results, we need a `NormedSpace ℝ E` instance. Though we can deduce this structure from `InnerProductSpace π•œ E`, this instance may be not definitionally equal to some other β€œnatural” instance. So, we assume `[NormedSpace ℝ E]`. We also prove that functions to a `EuclideanSpace` are (higher) differentiable if and only if their components are. This follows from the corresponding fact for finite product of normed spaces, and from the equivalence of norms in finite dimensions. ## TODO The last part of the file should be generalized to `PiLp`. -/ noncomputable section open IsROrC Real Filter open scoped BigOperators Classical Topology section DerivInner variable {π•œ E F : Type*} [IsROrC π•œ] variable [NormedAddCommGroup E] [InnerProductSpace π•œ E] variable [NormedAddCommGroup F] [InnerProductSpace ℝ F] local notation "βŸͺ" x ", " y "⟫" => @inner π•œ _ _ x y variable (π•œ) [NormedSpace ℝ E] /-- Derivative of the inner product. -/ def fderivInnerClm (p : E Γ— E) : E Γ— E β†’L[ℝ] π•œ := isBoundedBilinearMap_inner.deriv p #align fderiv_inner_clm fderivInnerClm @[simp] theorem fderivInnerClm_apply (p x : E Γ— E) : fderivInnerClm π•œ p x = βŸͺp.1, x.2⟫ + βŸͺx.1, p.2⟫ := rfl #align fderiv_inner_clm_apply fderivInnerClm_apply variable {π•œ} -- porting note: Lean 3 magically switches back to `{π•œ}` here theorem contDiff_inner {n} : ContDiff ℝ n fun p : E Γ— E => βŸͺp.1, p.2⟫ := isBoundedBilinearMap_inner.contDiff #align cont_diff_inner contDiff_inner theorem contDiffAt_inner {p : E Γ— E} {n} : ContDiffAt ℝ n (fun p : E Γ— E => βŸͺp.1, p.2⟫) p := ContDiff.contDiffAt contDiff_inner #align cont_diff_at_inner contDiffAt_inner theorem differentiable_inner : Differentiable ℝ fun p : E Γ— E => βŸͺp.1, p.2⟫ := isBoundedBilinearMap_inner.differentiableAt #align differentiable_inner differentiable_inner variable (π•œ) variable {G : Type*} [NormedAddCommGroup G] [NormedSpace ℝ G] {f g : G β†’ E} {f' g' : G β†’L[ℝ] E} {s : Set G} {x : G} {n : β„•βˆž} theorem ContDiffWithinAt.inner (hf : ContDiffWithinAt ℝ n f s x) (hg : ContDiffWithinAt ℝ n g s x) : ContDiffWithinAt ℝ n (fun x => βŸͺf x, g x⟫) s x := contDiffAt_inner.comp_contDiffWithinAt x (hf.prod hg) #align cont_diff_within_at.inner ContDiffWithinAt.inner nonrec theorem ContDiffAt.inner (hf : ContDiffAt ℝ n f x) (hg : ContDiffAt ℝ n g x) : ContDiffAt ℝ n (fun x => βŸͺf x, g x⟫) x := hf.inner π•œ hg #align cont_diff_at.inner ContDiffAt.inner theorem ContDiffOn.inner (hf : ContDiffOn ℝ n f s) (hg : ContDiffOn ℝ n g s) : ContDiffOn ℝ n (fun x => βŸͺf x, g x⟫) s := fun x hx => (hf x hx).inner π•œ (hg x hx) #align cont_diff_on.inner ContDiffOn.inner theorem ContDiff.inner (hf : ContDiff ℝ n f) (hg : ContDiff ℝ n g) : ContDiff ℝ n fun x => βŸͺf x, g x⟫ := contDiff_inner.comp (hf.prod hg) #align cont_diff.inner ContDiff.inner theorem HasFDerivWithinAt.inner (hf : HasFDerivWithinAt f f' s x) (hg : HasFDerivWithinAt g g' s x) : HasFDerivWithinAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') s x := (isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp_hasFDerivWithinAt x (hf.prod hg) #align has_fderiv_within_at.inner HasFDerivWithinAt.inner theorem HasStrictFDerivAt.inner (hf : HasStrictFDerivAt f f' x) (hg : HasStrictFDerivAt g g' x) : HasStrictFDerivAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') x := (isBoundedBilinearMap_inner.hasStrictFDerivAt (f x, g x)).comp x (hf.prod hg) #align has_strict_fderiv_at.inner HasStrictFDerivAt.inner theorem HasFDerivAt.inner (hf : HasFDerivAt f f' x) (hg : HasFDerivAt g g' x) : HasFDerivAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') x := (isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp x (hf.prod hg) #align has_fderiv_at.inner HasFDerivAt.inner theorem HasDerivWithinAt.inner {f g : ℝ β†’ E} {f' g' : E} {s : Set ℝ} {x : ℝ} (hf : HasDerivWithinAt f f' s x) (hg : HasDerivWithinAt g g' s x) : HasDerivWithinAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) s x := by simpa using (hf.hasFDerivWithinAt.inner π•œ hg.hasFDerivWithinAt).hasDerivWithinAt #align has_deriv_within_at.inner HasDerivWithinAt.inner theorem HasDerivAt.inner {f g : ℝ β†’ E} {f' g' : E} {x : ℝ} : HasDerivAt f f' x β†’ HasDerivAt g g' x β†’ HasDerivAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) x := by simpa only [← hasDerivWithinAt_univ] using HasDerivWithinAt.inner π•œ #align has_deriv_at.inner HasDerivAt.inner theorem DifferentiableWithinAt.inner (hf : DifferentiableWithinAt ℝ f s x) (hg : DifferentiableWithinAt ℝ g s x) : DifferentiableWithinAt ℝ (fun x => βŸͺf x, g x⟫) s x := ((differentiable_inner _).hasFDerivAt.comp_hasFDerivWithinAt x (hf.prod hg).hasFDerivWithinAt).differentiableWithinAt #align differentiable_within_at.inner DifferentiableWithinAt.inner theorem DifferentiableAt.inner (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) : DifferentiableAt ℝ (fun x => βŸͺf x, g x⟫) x := (differentiable_inner _).comp x (hf.prod hg) #align differentiable_at.inner DifferentiableAt.inner theorem DifferentiableOn.inner (hf : DifferentiableOn ℝ f s) (hg : DifferentiableOn ℝ g s) : DifferentiableOn ℝ (fun x => βŸͺf x, g x⟫) s := fun x hx => (hf x hx).inner π•œ (hg x hx) #align differentiable_on.inner DifferentiableOn.inner theorem Differentiable.inner (hf : Differentiable ℝ f) (hg : Differentiable ℝ g) : Differentiable ℝ fun x => βŸͺf x, g x⟫ := fun x => (hf x).inner π•œ (hg x) #align differentiable.inner Differentiable.inner theorem fderiv_inner_apply (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) (y : G) : fderiv ℝ (fun t => βŸͺf t, g t⟫) x y = βŸͺf x, fderiv ℝ g x y⟫ + βŸͺfderiv ℝ f x y, g x⟫ := by rw [(hf.hasFDerivAt.inner π•œ hg.hasFDerivAt).fderiv]; rfl #align fderiv_inner_apply fderiv_inner_apply theorem deriv_inner_apply {f g : ℝ β†’ E} {x : ℝ} (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) : deriv (fun t => βŸͺf t, g t⟫) x = βŸͺf x, deriv g x⟫ + βŸͺderiv f x, g x⟫ := (hf.hasDerivAt.inner π•œ hg.hasDerivAt).deriv #align deriv_inner_apply deriv_inner_apply theorem contDiff_norm_sq : ContDiff ℝ n fun x : E => β€–xβ€– ^ 2 := by convert (reClm : π•œ β†’L[ℝ] ℝ).contDiff.comp ((contDiff_id (E := E)).inner π•œ (contDiff_id (E := E))) exact (inner_self_eq_norm_sq _).symm #align cont_diff_norm_sq contDiff_norm_sq theorem ContDiff.norm_sq (hf : ContDiff ℝ n f) : ContDiff ℝ n fun x => β€–f xβ€– ^ 2 := (contDiff_norm_sq π•œ).comp hf #align cont_diff.norm_sq ContDiff.norm_sq theorem ContDiffWithinAt.norm_sq (hf : ContDiffWithinAt ℝ n f s x) : ContDiffWithinAt ℝ n (fun y => β€–f yβ€– ^ 2) s x := (contDiff_norm_sq π•œ).contDiffAt.comp_contDiffWithinAt x hf #align cont_diff_within_at.norm_sq ContDiffWithinAt.norm_sq nonrec theorem ContDiffAt.norm_sq (hf : ContDiffAt ℝ n f x) : ContDiffAt ℝ n (β€–f Β·β€– ^ 2) x := hf.norm_sq π•œ #align cont_diff_at.norm_sq ContDiffAt.norm_sq theorem contDiffAt_norm {x : E} (hx : x β‰  0) : ContDiffAt ℝ n norm x := by have : β€–id xβ€– ^ 2 β‰  0 := pow_ne_zero 2 (norm_pos_iff.2 hx).ne' simpa only [id, sqrt_sq, norm_nonneg] using (contDiffAt_id.norm_sq π•œ).sqrt this #align cont_diff_at_norm contDiffAt_norm theorem ContDiffAt.norm (hf : ContDiffAt ℝ n f x) (h0 : f x β‰  0) : ContDiffAt ℝ n (fun y => β€–f yβ€–) x := (contDiffAt_norm π•œ h0).comp x hf #align cont_diff_at.norm ContDiffAt.norm theorem ContDiffAt.dist (hf : ContDiffAt ℝ n f x) (hg : ContDiffAt ℝ n g x) (hne : f x β‰  g x) : ContDiffAt ℝ n (fun y => dist (f y) (g y)) x := by simp only [dist_eq_norm] exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align cont_diff_at.dist ContDiffAt.dist theorem ContDiffWithinAt.norm (hf : ContDiffWithinAt ℝ n f s x) (h0 : f x β‰  0) : ContDiffWithinAt ℝ n (fun y => β€–f yβ€–) s x := (contDiffAt_norm π•œ h0).comp_contDiffWithinAt x hf #align cont_diff_within_at.norm ContDiffWithinAt.norm theorem ContDiffWithinAt.dist (hf : ContDiffWithinAt ℝ n f s x) (hg : ContDiffWithinAt ℝ n g s x) (hne : f x β‰  g x) : ContDiffWithinAt ℝ n (fun y => dist (f y) (g y)) s x := by simp only [dist_eq_norm]; exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align cont_diff_within_at.dist ContDiffWithinAt.dist theorem ContDiffOn.norm_sq (hf : ContDiffOn ℝ n f s) : ContDiffOn ℝ n (fun y => β€–f yβ€– ^ 2) s := fun x hx => (hf x hx).norm_sq π•œ #align cont_diff_on.norm_sq ContDiffOn.norm_sq theorem ContDiffOn.norm (hf : ContDiffOn ℝ n f s) (h0 : βˆ€ x ∈ s, f x β‰  0) : ContDiffOn ℝ n (fun y => β€–f yβ€–) s := fun x hx => (hf x hx).norm π•œ (h0 x hx) #align cont_diff_on.norm ContDiffOn.norm theorem ContDiffOn.dist (hf : ContDiffOn ℝ n f s) (hg : ContDiffOn ℝ n g s) (hne : βˆ€ x ∈ s, f x β‰  g x) : ContDiffOn ℝ n (fun y => dist (f y) (g y)) s := fun x hx => (hf x hx).dist π•œ (hg x hx) (hne x hx) #align cont_diff_on.dist ContDiffOn.dist theorem ContDiff.norm (hf : ContDiff ℝ n f) (h0 : βˆ€ x, f x β‰  0) : ContDiff ℝ n fun y => β€–f yβ€– := contDiff_iff_contDiffAt.2 fun x => hf.contDiffAt.norm π•œ (h0 x) #align cont_diff.norm ContDiff.norm theorem ContDiff.dist (hf : ContDiff ℝ n f) (hg : ContDiff ℝ n g) (hne : βˆ€ x, f x β‰  g x) : ContDiff ℝ n fun y => dist (f y) (g y) := contDiff_iff_contDiffAt.2 fun x => hf.contDiffAt.dist π•œ hg.contDiffAt (hne x) #align cont_diff.dist ContDiff.dist -- porting note: use `2 β€’` instead of `bit0` theorem hasStrictFDerivAt_norm_sq (x : F) : HasStrictFDerivAt (fun x => β€–xβ€– ^ 2) (2 β€’ (innerSL ℝ x)) x := by simp only [sq, ← @inner_self_eq_norm_mul_norm ℝ] convert (hasStrictFDerivAt_id x).inner ℝ (hasStrictFDerivAt_id x) ext y simp [two_smul, real_inner_comm] #align has_strict_fderiv_at_norm_sq hasStrictFDerivAt_norm_sqβ‚“ theorem HasFDerivAt.norm_sq {f : G β†’ F} {f' : G β†’L[ℝ] F} (hf : HasFDerivAt f f' x) : HasFDerivAt (β€–f Β·β€– ^ 2) (2 β€’ (innerSL ℝ (f x)).comp f') x := (hasStrictFDerivAt_norm_sq _).hasFDerivAt.comp x hf theorem HasDerivAt.norm_sq {f : ℝ β†’ F} {f' : F} {x : ℝ} (hf : HasDerivAt f f' x) : HasDerivAt (β€–f Β·β€– ^ 2) (2 * Inner.inner (f x) f') x := by simpa using hf.hasFDerivAt.norm_sq.hasDerivAt theorem HasFDerivWithinAt.norm_sq {f : G β†’ F} {f' : G β†’L[ℝ] F} (hf : HasFDerivWithinAt f f' s x) : HasFDerivWithinAt (β€–f Β·β€– ^ 2) (2 β€’ (innerSL ℝ (f x)).comp f') s x := (hasStrictFDerivAt_norm_sq _).hasFDerivAt.comp_hasFDerivWithinAt x hf theorem HasDerivWithinAt.norm_sq {f : ℝ β†’ F} {f' : F} {s : Set ℝ} {x : ℝ} (hf : HasDerivWithinAt f f' s x) : HasDerivWithinAt (β€–f Β·β€– ^ 2) (2 * Inner.inner (f x) f') s x := by simpa using hf.hasFDerivWithinAt.norm_sq.hasDerivWithinAt theorem DifferentiableAt.norm_sq (hf : DifferentiableAt ℝ f x) : DifferentiableAt ℝ (fun y => β€–f yβ€– ^ 2) x := ((contDiffAt_id.norm_sq π•œ).differentiableAt le_rfl).comp x hf #align differentiable_at.norm_sq DifferentiableAt.norm_sq theorem DifferentiableAt.norm (hf : DifferentiableAt ℝ f x) (h0 : f x β‰  0) : DifferentiableAt ℝ (fun y => β€–f yβ€–) x := ((contDiffAt_norm π•œ h0).differentiableAt le_rfl).comp x hf #align differentiable_at.norm DifferentiableAt.norm theorem DifferentiableAt.dist (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) (hne : f x β‰  g x) : DifferentiableAt ℝ (fun y => dist (f y) (g y)) x := by simp only [dist_eq_norm]; exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align differentiable_at.dist DifferentiableAt.dist theorem Differentiable.norm_sq (hf : Differentiable ℝ f) : Differentiable ℝ fun y => β€–f yβ€– ^ 2 := fun x => (hf x).norm_sq π•œ #align differentiable.norm_sq Differentiable.norm_sq theorem Differentiable.norm (hf : Differentiable ℝ f) (h0 : βˆ€ x, f x β‰  0) : Differentiable ℝ fun y => β€–f yβ€– := fun x => (hf x).norm π•œ (h0 x) #align differentiable.norm Differentiable.norm theorem Differentiable.dist (hf : Differentiable ℝ f) (hg : Differentiable ℝ g) (hne : βˆ€ x, f x β‰  g x) : Differentiable ℝ fun y => dist (f y) (g y) := fun x => (hf x).dist π•œ (hg x) (hne x) #align differentiable.dist Differentiable.dist theorem DifferentiableWithinAt.norm_sq (hf : DifferentiableWithinAt ℝ f s x) : DifferentiableWithinAt ℝ (fun y => β€–f yβ€– ^ 2) s x := ((contDiffAt_id.norm_sq π•œ).differentiableAt le_rfl).comp_differentiableWithinAt x hf #align differentiable_within_at.norm_sq DifferentiableWithinAt.norm_sq theorem DifferentiableWithinAt.norm (hf : DifferentiableWithinAt ℝ f s x) (h0 : f x β‰  0) : DifferentiableWithinAt ℝ (fun y => β€–f yβ€–) s x := ((contDiffAt_id.norm π•œ h0).differentiableAt le_rfl).comp_differentiableWithinAt x hf #align differentiable_within_at.norm DifferentiableWithinAt.norm theorem DifferentiableWithinAt.dist (hf : DifferentiableWithinAt ℝ f s x) (hg : DifferentiableWithinAt ℝ g s x) (hne : f x β‰  g x) : DifferentiableWithinAt ℝ (fun y => dist (f y) (g y)) s x := by simp only [dist_eq_norm] exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align differentiable_within_at.dist DifferentiableWithinAt.dist theorem DifferentiableOn.norm_sq (hf : DifferentiableOn ℝ f s) : DifferentiableOn ℝ (fun y => β€–f yβ€– ^ 2) s := fun x hx => (hf x hx).norm_sq π•œ #align differentiable_on.norm_sq DifferentiableOn.norm_sq theorem DifferentiableOn.norm (hf : DifferentiableOn ℝ f s) (h0 : βˆ€ x ∈ s, f x β‰  0) : DifferentiableOn ℝ (fun y => β€–f yβ€–) s := fun x hx => (hf x hx).norm π•œ (h0 x hx) #align differentiable_on.norm DifferentiableOn.norm theorem DifferentiableOn.dist (hf : DifferentiableOn ℝ f s) (hg : DifferentiableOn ℝ g s) (hne : βˆ€ x ∈ s, f x β‰  g x) : DifferentiableOn ℝ (fun y => dist (f y) (g y)) s := fun x hx => (hf x hx).dist π•œ (hg x hx) (hne x hx) #align differentiable_on.dist DifferentiableOn.dist end DerivInner section PiLike open ContinuousLinearMap variable {π•œ ΞΉ H : Type*} [IsROrC π•œ] [NormedAddCommGroup H] [NormedSpace π•œ H] [Fintype ΞΉ] {f : H β†’ EuclideanSpace π•œ ΞΉ} {f' : H β†’L[π•œ] EuclideanSpace π•œ ΞΉ} {t : Set H} {y : H} theorem differentiableWithinAt_euclidean : DifferentiableWithinAt π•œ f t y ↔ βˆ€ i, DifferentiableWithinAt π•œ (fun x => f x i) t y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_differentiableWithinAt_iff, differentiableWithinAt_pi] rfl #align differentiable_within_at_euclidean differentiableWithinAt_euclidean theorem differentiableAt_euclidean : DifferentiableAt π•œ f y ↔ βˆ€ i, DifferentiableAt π•œ (fun x => f x i) y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_differentiableAt_iff, differentiableAt_pi] rfl #align differentiable_at_euclidean differentiableAt_euclidean theorem differentiableOn_euclidean : DifferentiableOn π•œ f t ↔ βˆ€ i, DifferentiableOn π•œ (fun x => f x i) t := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_differentiableOn_iff, differentiableOn_pi]
rfl
theorem differentiableOn_euclidean : DifferentiableOn π•œ f t ↔ βˆ€ i, DifferentiableOn π•œ (fun x => f x i) t := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_differentiableOn_iff, differentiableOn_pi]
Mathlib.Analysis.InnerProductSpace.Calculus.324_0.6FECEGgqdb67QLM
theorem differentiableOn_euclidean : DifferentiableOn π•œ f t ↔ βˆ€ i, DifferentiableOn π•œ (fun x => f x i) t
Mathlib_Analysis_InnerProductSpace_Calculus
π•œ : Type u_1 ΞΉ : Type u_2 H : Type u_3 inst✝³ : IsROrC π•œ inst✝² : NormedAddCommGroup H inst✝¹ : NormedSpace π•œ H inst✝ : Fintype ΞΉ f : H β†’ EuclideanSpace π•œ ΞΉ f' : H β†’L[π•œ] EuclideanSpace π•œ ΞΉ t : Set H y : H ⊒ Differentiable π•œ f ↔ βˆ€ (i : ΞΉ), Differentiable π•œ fun x => f x i
/- Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ import Mathlib.Analysis.InnerProductSpace.PiL2 import Mathlib.Analysis.SpecialFunctions.Sqrt import Mathlib.Analysis.NormedSpace.HomeomorphBall #align_import analysis.inner_product_space.calculus from "leanprover-community/mathlib"@"f9dd3204df14a0749cd456fac1e6849dfe7d2b88" /-! # Calculus in inner product spaces In this file we prove that the inner product and square of the norm in an inner space are infinitely `ℝ`-smooth. In order to state these results, we need a `NormedSpace ℝ E` instance. Though we can deduce this structure from `InnerProductSpace π•œ E`, this instance may be not definitionally equal to some other β€œnatural” instance. So, we assume `[NormedSpace ℝ E]`. We also prove that functions to a `EuclideanSpace` are (higher) differentiable if and only if their components are. This follows from the corresponding fact for finite product of normed spaces, and from the equivalence of norms in finite dimensions. ## TODO The last part of the file should be generalized to `PiLp`. -/ noncomputable section open IsROrC Real Filter open scoped BigOperators Classical Topology section DerivInner variable {π•œ E F : Type*} [IsROrC π•œ] variable [NormedAddCommGroup E] [InnerProductSpace π•œ E] variable [NormedAddCommGroup F] [InnerProductSpace ℝ F] local notation "βŸͺ" x ", " y "⟫" => @inner π•œ _ _ x y variable (π•œ) [NormedSpace ℝ E] /-- Derivative of the inner product. -/ def fderivInnerClm (p : E Γ— E) : E Γ— E β†’L[ℝ] π•œ := isBoundedBilinearMap_inner.deriv p #align fderiv_inner_clm fderivInnerClm @[simp] theorem fderivInnerClm_apply (p x : E Γ— E) : fderivInnerClm π•œ p x = βŸͺp.1, x.2⟫ + βŸͺx.1, p.2⟫ := rfl #align fderiv_inner_clm_apply fderivInnerClm_apply variable {π•œ} -- porting note: Lean 3 magically switches back to `{π•œ}` here theorem contDiff_inner {n} : ContDiff ℝ n fun p : E Γ— E => βŸͺp.1, p.2⟫ := isBoundedBilinearMap_inner.contDiff #align cont_diff_inner contDiff_inner theorem contDiffAt_inner {p : E Γ— E} {n} : ContDiffAt ℝ n (fun p : E Γ— E => βŸͺp.1, p.2⟫) p := ContDiff.contDiffAt contDiff_inner #align cont_diff_at_inner contDiffAt_inner theorem differentiable_inner : Differentiable ℝ fun p : E Γ— E => βŸͺp.1, p.2⟫ := isBoundedBilinearMap_inner.differentiableAt #align differentiable_inner differentiable_inner variable (π•œ) variable {G : Type*} [NormedAddCommGroup G] [NormedSpace ℝ G] {f g : G β†’ E} {f' g' : G β†’L[ℝ] E} {s : Set G} {x : G} {n : β„•βˆž} theorem ContDiffWithinAt.inner (hf : ContDiffWithinAt ℝ n f s x) (hg : ContDiffWithinAt ℝ n g s x) : ContDiffWithinAt ℝ n (fun x => βŸͺf x, g x⟫) s x := contDiffAt_inner.comp_contDiffWithinAt x (hf.prod hg) #align cont_diff_within_at.inner ContDiffWithinAt.inner nonrec theorem ContDiffAt.inner (hf : ContDiffAt ℝ n f x) (hg : ContDiffAt ℝ n g x) : ContDiffAt ℝ n (fun x => βŸͺf x, g x⟫) x := hf.inner π•œ hg #align cont_diff_at.inner ContDiffAt.inner theorem ContDiffOn.inner (hf : ContDiffOn ℝ n f s) (hg : ContDiffOn ℝ n g s) : ContDiffOn ℝ n (fun x => βŸͺf x, g x⟫) s := fun x hx => (hf x hx).inner π•œ (hg x hx) #align cont_diff_on.inner ContDiffOn.inner theorem ContDiff.inner (hf : ContDiff ℝ n f) (hg : ContDiff ℝ n g) : ContDiff ℝ n fun x => βŸͺf x, g x⟫ := contDiff_inner.comp (hf.prod hg) #align cont_diff.inner ContDiff.inner theorem HasFDerivWithinAt.inner (hf : HasFDerivWithinAt f f' s x) (hg : HasFDerivWithinAt g g' s x) : HasFDerivWithinAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') s x := (isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp_hasFDerivWithinAt x (hf.prod hg) #align has_fderiv_within_at.inner HasFDerivWithinAt.inner theorem HasStrictFDerivAt.inner (hf : HasStrictFDerivAt f f' x) (hg : HasStrictFDerivAt g g' x) : HasStrictFDerivAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') x := (isBoundedBilinearMap_inner.hasStrictFDerivAt (f x, g x)).comp x (hf.prod hg) #align has_strict_fderiv_at.inner HasStrictFDerivAt.inner theorem HasFDerivAt.inner (hf : HasFDerivAt f f' x) (hg : HasFDerivAt g g' x) : HasFDerivAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') x := (isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp x (hf.prod hg) #align has_fderiv_at.inner HasFDerivAt.inner theorem HasDerivWithinAt.inner {f g : ℝ β†’ E} {f' g' : E} {s : Set ℝ} {x : ℝ} (hf : HasDerivWithinAt f f' s x) (hg : HasDerivWithinAt g g' s x) : HasDerivWithinAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) s x := by simpa using (hf.hasFDerivWithinAt.inner π•œ hg.hasFDerivWithinAt).hasDerivWithinAt #align has_deriv_within_at.inner HasDerivWithinAt.inner theorem HasDerivAt.inner {f g : ℝ β†’ E} {f' g' : E} {x : ℝ} : HasDerivAt f f' x β†’ HasDerivAt g g' x β†’ HasDerivAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) x := by simpa only [← hasDerivWithinAt_univ] using HasDerivWithinAt.inner π•œ #align has_deriv_at.inner HasDerivAt.inner theorem DifferentiableWithinAt.inner (hf : DifferentiableWithinAt ℝ f s x) (hg : DifferentiableWithinAt ℝ g s x) : DifferentiableWithinAt ℝ (fun x => βŸͺf x, g x⟫) s x := ((differentiable_inner _).hasFDerivAt.comp_hasFDerivWithinAt x (hf.prod hg).hasFDerivWithinAt).differentiableWithinAt #align differentiable_within_at.inner DifferentiableWithinAt.inner theorem DifferentiableAt.inner (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) : DifferentiableAt ℝ (fun x => βŸͺf x, g x⟫) x := (differentiable_inner _).comp x (hf.prod hg) #align differentiable_at.inner DifferentiableAt.inner theorem DifferentiableOn.inner (hf : DifferentiableOn ℝ f s) (hg : DifferentiableOn ℝ g s) : DifferentiableOn ℝ (fun x => βŸͺf x, g x⟫) s := fun x hx => (hf x hx).inner π•œ (hg x hx) #align differentiable_on.inner DifferentiableOn.inner theorem Differentiable.inner (hf : Differentiable ℝ f) (hg : Differentiable ℝ g) : Differentiable ℝ fun x => βŸͺf x, g x⟫ := fun x => (hf x).inner π•œ (hg x) #align differentiable.inner Differentiable.inner theorem fderiv_inner_apply (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) (y : G) : fderiv ℝ (fun t => βŸͺf t, g t⟫) x y = βŸͺf x, fderiv ℝ g x y⟫ + βŸͺfderiv ℝ f x y, g x⟫ := by rw [(hf.hasFDerivAt.inner π•œ hg.hasFDerivAt).fderiv]; rfl #align fderiv_inner_apply fderiv_inner_apply theorem deriv_inner_apply {f g : ℝ β†’ E} {x : ℝ} (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) : deriv (fun t => βŸͺf t, g t⟫) x = βŸͺf x, deriv g x⟫ + βŸͺderiv f x, g x⟫ := (hf.hasDerivAt.inner π•œ hg.hasDerivAt).deriv #align deriv_inner_apply deriv_inner_apply theorem contDiff_norm_sq : ContDiff ℝ n fun x : E => β€–xβ€– ^ 2 := by convert (reClm : π•œ β†’L[ℝ] ℝ).contDiff.comp ((contDiff_id (E := E)).inner π•œ (contDiff_id (E := E))) exact (inner_self_eq_norm_sq _).symm #align cont_diff_norm_sq contDiff_norm_sq theorem ContDiff.norm_sq (hf : ContDiff ℝ n f) : ContDiff ℝ n fun x => β€–f xβ€– ^ 2 := (contDiff_norm_sq π•œ).comp hf #align cont_diff.norm_sq ContDiff.norm_sq theorem ContDiffWithinAt.norm_sq (hf : ContDiffWithinAt ℝ n f s x) : ContDiffWithinAt ℝ n (fun y => β€–f yβ€– ^ 2) s x := (contDiff_norm_sq π•œ).contDiffAt.comp_contDiffWithinAt x hf #align cont_diff_within_at.norm_sq ContDiffWithinAt.norm_sq nonrec theorem ContDiffAt.norm_sq (hf : ContDiffAt ℝ n f x) : ContDiffAt ℝ n (β€–f Β·β€– ^ 2) x := hf.norm_sq π•œ #align cont_diff_at.norm_sq ContDiffAt.norm_sq theorem contDiffAt_norm {x : E} (hx : x β‰  0) : ContDiffAt ℝ n norm x := by have : β€–id xβ€– ^ 2 β‰  0 := pow_ne_zero 2 (norm_pos_iff.2 hx).ne' simpa only [id, sqrt_sq, norm_nonneg] using (contDiffAt_id.norm_sq π•œ).sqrt this #align cont_diff_at_norm contDiffAt_norm theorem ContDiffAt.norm (hf : ContDiffAt ℝ n f x) (h0 : f x β‰  0) : ContDiffAt ℝ n (fun y => β€–f yβ€–) x := (contDiffAt_norm π•œ h0).comp x hf #align cont_diff_at.norm ContDiffAt.norm theorem ContDiffAt.dist (hf : ContDiffAt ℝ n f x) (hg : ContDiffAt ℝ n g x) (hne : f x β‰  g x) : ContDiffAt ℝ n (fun y => dist (f y) (g y)) x := by simp only [dist_eq_norm] exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align cont_diff_at.dist ContDiffAt.dist theorem ContDiffWithinAt.norm (hf : ContDiffWithinAt ℝ n f s x) (h0 : f x β‰  0) : ContDiffWithinAt ℝ n (fun y => β€–f yβ€–) s x := (contDiffAt_norm π•œ h0).comp_contDiffWithinAt x hf #align cont_diff_within_at.norm ContDiffWithinAt.norm theorem ContDiffWithinAt.dist (hf : ContDiffWithinAt ℝ n f s x) (hg : ContDiffWithinAt ℝ n g s x) (hne : f x β‰  g x) : ContDiffWithinAt ℝ n (fun y => dist (f y) (g y)) s x := by simp only [dist_eq_norm]; exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align cont_diff_within_at.dist ContDiffWithinAt.dist theorem ContDiffOn.norm_sq (hf : ContDiffOn ℝ n f s) : ContDiffOn ℝ n (fun y => β€–f yβ€– ^ 2) s := fun x hx => (hf x hx).norm_sq π•œ #align cont_diff_on.norm_sq ContDiffOn.norm_sq theorem ContDiffOn.norm (hf : ContDiffOn ℝ n f s) (h0 : βˆ€ x ∈ s, f x β‰  0) : ContDiffOn ℝ n (fun y => β€–f yβ€–) s := fun x hx => (hf x hx).norm π•œ (h0 x hx) #align cont_diff_on.norm ContDiffOn.norm theorem ContDiffOn.dist (hf : ContDiffOn ℝ n f s) (hg : ContDiffOn ℝ n g s) (hne : βˆ€ x ∈ s, f x β‰  g x) : ContDiffOn ℝ n (fun y => dist (f y) (g y)) s := fun x hx => (hf x hx).dist π•œ (hg x hx) (hne x hx) #align cont_diff_on.dist ContDiffOn.dist theorem ContDiff.norm (hf : ContDiff ℝ n f) (h0 : βˆ€ x, f x β‰  0) : ContDiff ℝ n fun y => β€–f yβ€– := contDiff_iff_contDiffAt.2 fun x => hf.contDiffAt.norm π•œ (h0 x) #align cont_diff.norm ContDiff.norm theorem ContDiff.dist (hf : ContDiff ℝ n f) (hg : ContDiff ℝ n g) (hne : βˆ€ x, f x β‰  g x) : ContDiff ℝ n fun y => dist (f y) (g y) := contDiff_iff_contDiffAt.2 fun x => hf.contDiffAt.dist π•œ hg.contDiffAt (hne x) #align cont_diff.dist ContDiff.dist -- porting note: use `2 β€’` instead of `bit0` theorem hasStrictFDerivAt_norm_sq (x : F) : HasStrictFDerivAt (fun x => β€–xβ€– ^ 2) (2 β€’ (innerSL ℝ x)) x := by simp only [sq, ← @inner_self_eq_norm_mul_norm ℝ] convert (hasStrictFDerivAt_id x).inner ℝ (hasStrictFDerivAt_id x) ext y simp [two_smul, real_inner_comm] #align has_strict_fderiv_at_norm_sq hasStrictFDerivAt_norm_sqβ‚“ theorem HasFDerivAt.norm_sq {f : G β†’ F} {f' : G β†’L[ℝ] F} (hf : HasFDerivAt f f' x) : HasFDerivAt (β€–f Β·β€– ^ 2) (2 β€’ (innerSL ℝ (f x)).comp f') x := (hasStrictFDerivAt_norm_sq _).hasFDerivAt.comp x hf theorem HasDerivAt.norm_sq {f : ℝ β†’ F} {f' : F} {x : ℝ} (hf : HasDerivAt f f' x) : HasDerivAt (β€–f Β·β€– ^ 2) (2 * Inner.inner (f x) f') x := by simpa using hf.hasFDerivAt.norm_sq.hasDerivAt theorem HasFDerivWithinAt.norm_sq {f : G β†’ F} {f' : G β†’L[ℝ] F} (hf : HasFDerivWithinAt f f' s x) : HasFDerivWithinAt (β€–f Β·β€– ^ 2) (2 β€’ (innerSL ℝ (f x)).comp f') s x := (hasStrictFDerivAt_norm_sq _).hasFDerivAt.comp_hasFDerivWithinAt x hf theorem HasDerivWithinAt.norm_sq {f : ℝ β†’ F} {f' : F} {s : Set ℝ} {x : ℝ} (hf : HasDerivWithinAt f f' s x) : HasDerivWithinAt (β€–f Β·β€– ^ 2) (2 * Inner.inner (f x) f') s x := by simpa using hf.hasFDerivWithinAt.norm_sq.hasDerivWithinAt theorem DifferentiableAt.norm_sq (hf : DifferentiableAt ℝ f x) : DifferentiableAt ℝ (fun y => β€–f yβ€– ^ 2) x := ((contDiffAt_id.norm_sq π•œ).differentiableAt le_rfl).comp x hf #align differentiable_at.norm_sq DifferentiableAt.norm_sq theorem DifferentiableAt.norm (hf : DifferentiableAt ℝ f x) (h0 : f x β‰  0) : DifferentiableAt ℝ (fun y => β€–f yβ€–) x := ((contDiffAt_norm π•œ h0).differentiableAt le_rfl).comp x hf #align differentiable_at.norm DifferentiableAt.norm theorem DifferentiableAt.dist (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) (hne : f x β‰  g x) : DifferentiableAt ℝ (fun y => dist (f y) (g y)) x := by simp only [dist_eq_norm]; exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align differentiable_at.dist DifferentiableAt.dist theorem Differentiable.norm_sq (hf : Differentiable ℝ f) : Differentiable ℝ fun y => β€–f yβ€– ^ 2 := fun x => (hf x).norm_sq π•œ #align differentiable.norm_sq Differentiable.norm_sq theorem Differentiable.norm (hf : Differentiable ℝ f) (h0 : βˆ€ x, f x β‰  0) : Differentiable ℝ fun y => β€–f yβ€– := fun x => (hf x).norm π•œ (h0 x) #align differentiable.norm Differentiable.norm theorem Differentiable.dist (hf : Differentiable ℝ f) (hg : Differentiable ℝ g) (hne : βˆ€ x, f x β‰  g x) : Differentiable ℝ fun y => dist (f y) (g y) := fun x => (hf x).dist π•œ (hg x) (hne x) #align differentiable.dist Differentiable.dist theorem DifferentiableWithinAt.norm_sq (hf : DifferentiableWithinAt ℝ f s x) : DifferentiableWithinAt ℝ (fun y => β€–f yβ€– ^ 2) s x := ((contDiffAt_id.norm_sq π•œ).differentiableAt le_rfl).comp_differentiableWithinAt x hf #align differentiable_within_at.norm_sq DifferentiableWithinAt.norm_sq theorem DifferentiableWithinAt.norm (hf : DifferentiableWithinAt ℝ f s x) (h0 : f x β‰  0) : DifferentiableWithinAt ℝ (fun y => β€–f yβ€–) s x := ((contDiffAt_id.norm π•œ h0).differentiableAt le_rfl).comp_differentiableWithinAt x hf #align differentiable_within_at.norm DifferentiableWithinAt.norm theorem DifferentiableWithinAt.dist (hf : DifferentiableWithinAt ℝ f s x) (hg : DifferentiableWithinAt ℝ g s x) (hne : f x β‰  g x) : DifferentiableWithinAt ℝ (fun y => dist (f y) (g y)) s x := by simp only [dist_eq_norm] exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align differentiable_within_at.dist DifferentiableWithinAt.dist theorem DifferentiableOn.norm_sq (hf : DifferentiableOn ℝ f s) : DifferentiableOn ℝ (fun y => β€–f yβ€– ^ 2) s := fun x hx => (hf x hx).norm_sq π•œ #align differentiable_on.norm_sq DifferentiableOn.norm_sq theorem DifferentiableOn.norm (hf : DifferentiableOn ℝ f s) (h0 : βˆ€ x ∈ s, f x β‰  0) : DifferentiableOn ℝ (fun y => β€–f yβ€–) s := fun x hx => (hf x hx).norm π•œ (h0 x hx) #align differentiable_on.norm DifferentiableOn.norm theorem DifferentiableOn.dist (hf : DifferentiableOn ℝ f s) (hg : DifferentiableOn ℝ g s) (hne : βˆ€ x ∈ s, f x β‰  g x) : DifferentiableOn ℝ (fun y => dist (f y) (g y)) s := fun x hx => (hf x hx).dist π•œ (hg x hx) (hne x hx) #align differentiable_on.dist DifferentiableOn.dist end DerivInner section PiLike open ContinuousLinearMap variable {π•œ ΞΉ H : Type*} [IsROrC π•œ] [NormedAddCommGroup H] [NormedSpace π•œ H] [Fintype ΞΉ] {f : H β†’ EuclideanSpace π•œ ΞΉ} {f' : H β†’L[π•œ] EuclideanSpace π•œ ΞΉ} {t : Set H} {y : H} theorem differentiableWithinAt_euclidean : DifferentiableWithinAt π•œ f t y ↔ βˆ€ i, DifferentiableWithinAt π•œ (fun x => f x i) t y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_differentiableWithinAt_iff, differentiableWithinAt_pi] rfl #align differentiable_within_at_euclidean differentiableWithinAt_euclidean theorem differentiableAt_euclidean : DifferentiableAt π•œ f y ↔ βˆ€ i, DifferentiableAt π•œ (fun x => f x i) y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_differentiableAt_iff, differentiableAt_pi] rfl #align differentiable_at_euclidean differentiableAt_euclidean theorem differentiableOn_euclidean : DifferentiableOn π•œ f t ↔ βˆ€ i, DifferentiableOn π•œ (fun x => f x i) t := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_differentiableOn_iff, differentiableOn_pi] rfl #align differentiable_on_euclidean differentiableOn_euclidean theorem differentiable_euclidean : Differentiable π•œ f ↔ βˆ€ i, Differentiable π•œ fun x => f x i := by
rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_differentiable_iff, differentiable_pi]
theorem differentiable_euclidean : Differentiable π•œ f ↔ βˆ€ i, Differentiable π•œ fun x => f x i := by
Mathlib.Analysis.InnerProductSpace.Calculus.330_0.6FECEGgqdb67QLM
theorem differentiable_euclidean : Differentiable π•œ f ↔ βˆ€ i, Differentiable π•œ fun x => f x i
Mathlib_Analysis_InnerProductSpace_Calculus
π•œ : Type u_1 ΞΉ : Type u_2 H : Type u_3 inst✝³ : IsROrC π•œ inst✝² : NormedAddCommGroup H inst✝¹ : NormedSpace π•œ H inst✝ : Fintype ΞΉ f : H β†’ EuclideanSpace π•œ ΞΉ f' : H β†’L[π•œ] EuclideanSpace π•œ ΞΉ t : Set H y : H ⊒ (βˆ€ (i : ΞΉ), Differentiable π•œ fun x => (⇑(EuclideanSpace.equiv ΞΉ π•œ) ∘ f) x i) ↔ βˆ€ (i : ΞΉ), Differentiable π•œ fun x => f x i
/- Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ import Mathlib.Analysis.InnerProductSpace.PiL2 import Mathlib.Analysis.SpecialFunctions.Sqrt import Mathlib.Analysis.NormedSpace.HomeomorphBall #align_import analysis.inner_product_space.calculus from "leanprover-community/mathlib"@"f9dd3204df14a0749cd456fac1e6849dfe7d2b88" /-! # Calculus in inner product spaces In this file we prove that the inner product and square of the norm in an inner space are infinitely `ℝ`-smooth. In order to state these results, we need a `NormedSpace ℝ E` instance. Though we can deduce this structure from `InnerProductSpace π•œ E`, this instance may be not definitionally equal to some other β€œnatural” instance. So, we assume `[NormedSpace ℝ E]`. We also prove that functions to a `EuclideanSpace` are (higher) differentiable if and only if their components are. This follows from the corresponding fact for finite product of normed spaces, and from the equivalence of norms in finite dimensions. ## TODO The last part of the file should be generalized to `PiLp`. -/ noncomputable section open IsROrC Real Filter open scoped BigOperators Classical Topology section DerivInner variable {π•œ E F : Type*} [IsROrC π•œ] variable [NormedAddCommGroup E] [InnerProductSpace π•œ E] variable [NormedAddCommGroup F] [InnerProductSpace ℝ F] local notation "βŸͺ" x ", " y "⟫" => @inner π•œ _ _ x y variable (π•œ) [NormedSpace ℝ E] /-- Derivative of the inner product. -/ def fderivInnerClm (p : E Γ— E) : E Γ— E β†’L[ℝ] π•œ := isBoundedBilinearMap_inner.deriv p #align fderiv_inner_clm fderivInnerClm @[simp] theorem fderivInnerClm_apply (p x : E Γ— E) : fderivInnerClm π•œ p x = βŸͺp.1, x.2⟫ + βŸͺx.1, p.2⟫ := rfl #align fderiv_inner_clm_apply fderivInnerClm_apply variable {π•œ} -- porting note: Lean 3 magically switches back to `{π•œ}` here theorem contDiff_inner {n} : ContDiff ℝ n fun p : E Γ— E => βŸͺp.1, p.2⟫ := isBoundedBilinearMap_inner.contDiff #align cont_diff_inner contDiff_inner theorem contDiffAt_inner {p : E Γ— E} {n} : ContDiffAt ℝ n (fun p : E Γ— E => βŸͺp.1, p.2⟫) p := ContDiff.contDiffAt contDiff_inner #align cont_diff_at_inner contDiffAt_inner theorem differentiable_inner : Differentiable ℝ fun p : E Γ— E => βŸͺp.1, p.2⟫ := isBoundedBilinearMap_inner.differentiableAt #align differentiable_inner differentiable_inner variable (π•œ) variable {G : Type*} [NormedAddCommGroup G] [NormedSpace ℝ G] {f g : G β†’ E} {f' g' : G β†’L[ℝ] E} {s : Set G} {x : G} {n : β„•βˆž} theorem ContDiffWithinAt.inner (hf : ContDiffWithinAt ℝ n f s x) (hg : ContDiffWithinAt ℝ n g s x) : ContDiffWithinAt ℝ n (fun x => βŸͺf x, g x⟫) s x := contDiffAt_inner.comp_contDiffWithinAt x (hf.prod hg) #align cont_diff_within_at.inner ContDiffWithinAt.inner nonrec theorem ContDiffAt.inner (hf : ContDiffAt ℝ n f x) (hg : ContDiffAt ℝ n g x) : ContDiffAt ℝ n (fun x => βŸͺf x, g x⟫) x := hf.inner π•œ hg #align cont_diff_at.inner ContDiffAt.inner theorem ContDiffOn.inner (hf : ContDiffOn ℝ n f s) (hg : ContDiffOn ℝ n g s) : ContDiffOn ℝ n (fun x => βŸͺf x, g x⟫) s := fun x hx => (hf x hx).inner π•œ (hg x hx) #align cont_diff_on.inner ContDiffOn.inner theorem ContDiff.inner (hf : ContDiff ℝ n f) (hg : ContDiff ℝ n g) : ContDiff ℝ n fun x => βŸͺf x, g x⟫ := contDiff_inner.comp (hf.prod hg) #align cont_diff.inner ContDiff.inner theorem HasFDerivWithinAt.inner (hf : HasFDerivWithinAt f f' s x) (hg : HasFDerivWithinAt g g' s x) : HasFDerivWithinAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') s x := (isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp_hasFDerivWithinAt x (hf.prod hg) #align has_fderiv_within_at.inner HasFDerivWithinAt.inner theorem HasStrictFDerivAt.inner (hf : HasStrictFDerivAt f f' x) (hg : HasStrictFDerivAt g g' x) : HasStrictFDerivAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') x := (isBoundedBilinearMap_inner.hasStrictFDerivAt (f x, g x)).comp x (hf.prod hg) #align has_strict_fderiv_at.inner HasStrictFDerivAt.inner theorem HasFDerivAt.inner (hf : HasFDerivAt f f' x) (hg : HasFDerivAt g g' x) : HasFDerivAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') x := (isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp x (hf.prod hg) #align has_fderiv_at.inner HasFDerivAt.inner theorem HasDerivWithinAt.inner {f g : ℝ β†’ E} {f' g' : E} {s : Set ℝ} {x : ℝ} (hf : HasDerivWithinAt f f' s x) (hg : HasDerivWithinAt g g' s x) : HasDerivWithinAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) s x := by simpa using (hf.hasFDerivWithinAt.inner π•œ hg.hasFDerivWithinAt).hasDerivWithinAt #align has_deriv_within_at.inner HasDerivWithinAt.inner theorem HasDerivAt.inner {f g : ℝ β†’ E} {f' g' : E} {x : ℝ} : HasDerivAt f f' x β†’ HasDerivAt g g' x β†’ HasDerivAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) x := by simpa only [← hasDerivWithinAt_univ] using HasDerivWithinAt.inner π•œ #align has_deriv_at.inner HasDerivAt.inner theorem DifferentiableWithinAt.inner (hf : DifferentiableWithinAt ℝ f s x) (hg : DifferentiableWithinAt ℝ g s x) : DifferentiableWithinAt ℝ (fun x => βŸͺf x, g x⟫) s x := ((differentiable_inner _).hasFDerivAt.comp_hasFDerivWithinAt x (hf.prod hg).hasFDerivWithinAt).differentiableWithinAt #align differentiable_within_at.inner DifferentiableWithinAt.inner theorem DifferentiableAt.inner (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) : DifferentiableAt ℝ (fun x => βŸͺf x, g x⟫) x := (differentiable_inner _).comp x (hf.prod hg) #align differentiable_at.inner DifferentiableAt.inner theorem DifferentiableOn.inner (hf : DifferentiableOn ℝ f s) (hg : DifferentiableOn ℝ g s) : DifferentiableOn ℝ (fun x => βŸͺf x, g x⟫) s := fun x hx => (hf x hx).inner π•œ (hg x hx) #align differentiable_on.inner DifferentiableOn.inner theorem Differentiable.inner (hf : Differentiable ℝ f) (hg : Differentiable ℝ g) : Differentiable ℝ fun x => βŸͺf x, g x⟫ := fun x => (hf x).inner π•œ (hg x) #align differentiable.inner Differentiable.inner theorem fderiv_inner_apply (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) (y : G) : fderiv ℝ (fun t => βŸͺf t, g t⟫) x y = βŸͺf x, fderiv ℝ g x y⟫ + βŸͺfderiv ℝ f x y, g x⟫ := by rw [(hf.hasFDerivAt.inner π•œ hg.hasFDerivAt).fderiv]; rfl #align fderiv_inner_apply fderiv_inner_apply theorem deriv_inner_apply {f g : ℝ β†’ E} {x : ℝ} (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) : deriv (fun t => βŸͺf t, g t⟫) x = βŸͺf x, deriv g x⟫ + βŸͺderiv f x, g x⟫ := (hf.hasDerivAt.inner π•œ hg.hasDerivAt).deriv #align deriv_inner_apply deriv_inner_apply theorem contDiff_norm_sq : ContDiff ℝ n fun x : E => β€–xβ€– ^ 2 := by convert (reClm : π•œ β†’L[ℝ] ℝ).contDiff.comp ((contDiff_id (E := E)).inner π•œ (contDiff_id (E := E))) exact (inner_self_eq_norm_sq _).symm #align cont_diff_norm_sq contDiff_norm_sq theorem ContDiff.norm_sq (hf : ContDiff ℝ n f) : ContDiff ℝ n fun x => β€–f xβ€– ^ 2 := (contDiff_norm_sq π•œ).comp hf #align cont_diff.norm_sq ContDiff.norm_sq theorem ContDiffWithinAt.norm_sq (hf : ContDiffWithinAt ℝ n f s x) : ContDiffWithinAt ℝ n (fun y => β€–f yβ€– ^ 2) s x := (contDiff_norm_sq π•œ).contDiffAt.comp_contDiffWithinAt x hf #align cont_diff_within_at.norm_sq ContDiffWithinAt.norm_sq nonrec theorem ContDiffAt.norm_sq (hf : ContDiffAt ℝ n f x) : ContDiffAt ℝ n (β€–f Β·β€– ^ 2) x := hf.norm_sq π•œ #align cont_diff_at.norm_sq ContDiffAt.norm_sq theorem contDiffAt_norm {x : E} (hx : x β‰  0) : ContDiffAt ℝ n norm x := by have : β€–id xβ€– ^ 2 β‰  0 := pow_ne_zero 2 (norm_pos_iff.2 hx).ne' simpa only [id, sqrt_sq, norm_nonneg] using (contDiffAt_id.norm_sq π•œ).sqrt this #align cont_diff_at_norm contDiffAt_norm theorem ContDiffAt.norm (hf : ContDiffAt ℝ n f x) (h0 : f x β‰  0) : ContDiffAt ℝ n (fun y => β€–f yβ€–) x := (contDiffAt_norm π•œ h0).comp x hf #align cont_diff_at.norm ContDiffAt.norm theorem ContDiffAt.dist (hf : ContDiffAt ℝ n f x) (hg : ContDiffAt ℝ n g x) (hne : f x β‰  g x) : ContDiffAt ℝ n (fun y => dist (f y) (g y)) x := by simp only [dist_eq_norm] exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align cont_diff_at.dist ContDiffAt.dist theorem ContDiffWithinAt.norm (hf : ContDiffWithinAt ℝ n f s x) (h0 : f x β‰  0) : ContDiffWithinAt ℝ n (fun y => β€–f yβ€–) s x := (contDiffAt_norm π•œ h0).comp_contDiffWithinAt x hf #align cont_diff_within_at.norm ContDiffWithinAt.norm theorem ContDiffWithinAt.dist (hf : ContDiffWithinAt ℝ n f s x) (hg : ContDiffWithinAt ℝ n g s x) (hne : f x β‰  g x) : ContDiffWithinAt ℝ n (fun y => dist (f y) (g y)) s x := by simp only [dist_eq_norm]; exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align cont_diff_within_at.dist ContDiffWithinAt.dist theorem ContDiffOn.norm_sq (hf : ContDiffOn ℝ n f s) : ContDiffOn ℝ n (fun y => β€–f yβ€– ^ 2) s := fun x hx => (hf x hx).norm_sq π•œ #align cont_diff_on.norm_sq ContDiffOn.norm_sq theorem ContDiffOn.norm (hf : ContDiffOn ℝ n f s) (h0 : βˆ€ x ∈ s, f x β‰  0) : ContDiffOn ℝ n (fun y => β€–f yβ€–) s := fun x hx => (hf x hx).norm π•œ (h0 x hx) #align cont_diff_on.norm ContDiffOn.norm theorem ContDiffOn.dist (hf : ContDiffOn ℝ n f s) (hg : ContDiffOn ℝ n g s) (hne : βˆ€ x ∈ s, f x β‰  g x) : ContDiffOn ℝ n (fun y => dist (f y) (g y)) s := fun x hx => (hf x hx).dist π•œ (hg x hx) (hne x hx) #align cont_diff_on.dist ContDiffOn.dist theorem ContDiff.norm (hf : ContDiff ℝ n f) (h0 : βˆ€ x, f x β‰  0) : ContDiff ℝ n fun y => β€–f yβ€– := contDiff_iff_contDiffAt.2 fun x => hf.contDiffAt.norm π•œ (h0 x) #align cont_diff.norm ContDiff.norm theorem ContDiff.dist (hf : ContDiff ℝ n f) (hg : ContDiff ℝ n g) (hne : βˆ€ x, f x β‰  g x) : ContDiff ℝ n fun y => dist (f y) (g y) := contDiff_iff_contDiffAt.2 fun x => hf.contDiffAt.dist π•œ hg.contDiffAt (hne x) #align cont_diff.dist ContDiff.dist -- porting note: use `2 β€’` instead of `bit0` theorem hasStrictFDerivAt_norm_sq (x : F) : HasStrictFDerivAt (fun x => β€–xβ€– ^ 2) (2 β€’ (innerSL ℝ x)) x := by simp only [sq, ← @inner_self_eq_norm_mul_norm ℝ] convert (hasStrictFDerivAt_id x).inner ℝ (hasStrictFDerivAt_id x) ext y simp [two_smul, real_inner_comm] #align has_strict_fderiv_at_norm_sq hasStrictFDerivAt_norm_sqβ‚“ theorem HasFDerivAt.norm_sq {f : G β†’ F} {f' : G β†’L[ℝ] F} (hf : HasFDerivAt f f' x) : HasFDerivAt (β€–f Β·β€– ^ 2) (2 β€’ (innerSL ℝ (f x)).comp f') x := (hasStrictFDerivAt_norm_sq _).hasFDerivAt.comp x hf theorem HasDerivAt.norm_sq {f : ℝ β†’ F} {f' : F} {x : ℝ} (hf : HasDerivAt f f' x) : HasDerivAt (β€–f Β·β€– ^ 2) (2 * Inner.inner (f x) f') x := by simpa using hf.hasFDerivAt.norm_sq.hasDerivAt theorem HasFDerivWithinAt.norm_sq {f : G β†’ F} {f' : G β†’L[ℝ] F} (hf : HasFDerivWithinAt f f' s x) : HasFDerivWithinAt (β€–f Β·β€– ^ 2) (2 β€’ (innerSL ℝ (f x)).comp f') s x := (hasStrictFDerivAt_norm_sq _).hasFDerivAt.comp_hasFDerivWithinAt x hf theorem HasDerivWithinAt.norm_sq {f : ℝ β†’ F} {f' : F} {s : Set ℝ} {x : ℝ} (hf : HasDerivWithinAt f f' s x) : HasDerivWithinAt (β€–f Β·β€– ^ 2) (2 * Inner.inner (f x) f') s x := by simpa using hf.hasFDerivWithinAt.norm_sq.hasDerivWithinAt theorem DifferentiableAt.norm_sq (hf : DifferentiableAt ℝ f x) : DifferentiableAt ℝ (fun y => β€–f yβ€– ^ 2) x := ((contDiffAt_id.norm_sq π•œ).differentiableAt le_rfl).comp x hf #align differentiable_at.norm_sq DifferentiableAt.norm_sq theorem DifferentiableAt.norm (hf : DifferentiableAt ℝ f x) (h0 : f x β‰  0) : DifferentiableAt ℝ (fun y => β€–f yβ€–) x := ((contDiffAt_norm π•œ h0).differentiableAt le_rfl).comp x hf #align differentiable_at.norm DifferentiableAt.norm theorem DifferentiableAt.dist (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) (hne : f x β‰  g x) : DifferentiableAt ℝ (fun y => dist (f y) (g y)) x := by simp only [dist_eq_norm]; exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align differentiable_at.dist DifferentiableAt.dist theorem Differentiable.norm_sq (hf : Differentiable ℝ f) : Differentiable ℝ fun y => β€–f yβ€– ^ 2 := fun x => (hf x).norm_sq π•œ #align differentiable.norm_sq Differentiable.norm_sq theorem Differentiable.norm (hf : Differentiable ℝ f) (h0 : βˆ€ x, f x β‰  0) : Differentiable ℝ fun y => β€–f yβ€– := fun x => (hf x).norm π•œ (h0 x) #align differentiable.norm Differentiable.norm theorem Differentiable.dist (hf : Differentiable ℝ f) (hg : Differentiable ℝ g) (hne : βˆ€ x, f x β‰  g x) : Differentiable ℝ fun y => dist (f y) (g y) := fun x => (hf x).dist π•œ (hg x) (hne x) #align differentiable.dist Differentiable.dist theorem DifferentiableWithinAt.norm_sq (hf : DifferentiableWithinAt ℝ f s x) : DifferentiableWithinAt ℝ (fun y => β€–f yβ€– ^ 2) s x := ((contDiffAt_id.norm_sq π•œ).differentiableAt le_rfl).comp_differentiableWithinAt x hf #align differentiable_within_at.norm_sq DifferentiableWithinAt.norm_sq theorem DifferentiableWithinAt.norm (hf : DifferentiableWithinAt ℝ f s x) (h0 : f x β‰  0) : DifferentiableWithinAt ℝ (fun y => β€–f yβ€–) s x := ((contDiffAt_id.norm π•œ h0).differentiableAt le_rfl).comp_differentiableWithinAt x hf #align differentiable_within_at.norm DifferentiableWithinAt.norm theorem DifferentiableWithinAt.dist (hf : DifferentiableWithinAt ℝ f s x) (hg : DifferentiableWithinAt ℝ g s x) (hne : f x β‰  g x) : DifferentiableWithinAt ℝ (fun y => dist (f y) (g y)) s x := by simp only [dist_eq_norm] exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align differentiable_within_at.dist DifferentiableWithinAt.dist theorem DifferentiableOn.norm_sq (hf : DifferentiableOn ℝ f s) : DifferentiableOn ℝ (fun y => β€–f yβ€– ^ 2) s := fun x hx => (hf x hx).norm_sq π•œ #align differentiable_on.norm_sq DifferentiableOn.norm_sq theorem DifferentiableOn.norm (hf : DifferentiableOn ℝ f s) (h0 : βˆ€ x ∈ s, f x β‰  0) : DifferentiableOn ℝ (fun y => β€–f yβ€–) s := fun x hx => (hf x hx).norm π•œ (h0 x hx) #align differentiable_on.norm DifferentiableOn.norm theorem DifferentiableOn.dist (hf : DifferentiableOn ℝ f s) (hg : DifferentiableOn ℝ g s) (hne : βˆ€ x ∈ s, f x β‰  g x) : DifferentiableOn ℝ (fun y => dist (f y) (g y)) s := fun x hx => (hf x hx).dist π•œ (hg x hx) (hne x hx) #align differentiable_on.dist DifferentiableOn.dist end DerivInner section PiLike open ContinuousLinearMap variable {π•œ ΞΉ H : Type*} [IsROrC π•œ] [NormedAddCommGroup H] [NormedSpace π•œ H] [Fintype ΞΉ] {f : H β†’ EuclideanSpace π•œ ΞΉ} {f' : H β†’L[π•œ] EuclideanSpace π•œ ΞΉ} {t : Set H} {y : H} theorem differentiableWithinAt_euclidean : DifferentiableWithinAt π•œ f t y ↔ βˆ€ i, DifferentiableWithinAt π•œ (fun x => f x i) t y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_differentiableWithinAt_iff, differentiableWithinAt_pi] rfl #align differentiable_within_at_euclidean differentiableWithinAt_euclidean theorem differentiableAt_euclidean : DifferentiableAt π•œ f y ↔ βˆ€ i, DifferentiableAt π•œ (fun x => f x i) y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_differentiableAt_iff, differentiableAt_pi] rfl #align differentiable_at_euclidean differentiableAt_euclidean theorem differentiableOn_euclidean : DifferentiableOn π•œ f t ↔ βˆ€ i, DifferentiableOn π•œ (fun x => f x i) t := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_differentiableOn_iff, differentiableOn_pi] rfl #align differentiable_on_euclidean differentiableOn_euclidean theorem differentiable_euclidean : Differentiable π•œ f ↔ βˆ€ i, Differentiable π•œ fun x => f x i := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_differentiable_iff, differentiable_pi]
rfl
theorem differentiable_euclidean : Differentiable π•œ f ↔ βˆ€ i, Differentiable π•œ fun x => f x i := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_differentiable_iff, differentiable_pi]
Mathlib.Analysis.InnerProductSpace.Calculus.330_0.6FECEGgqdb67QLM
theorem differentiable_euclidean : Differentiable π•œ f ↔ βˆ€ i, Differentiable π•œ fun x => f x i
Mathlib_Analysis_InnerProductSpace_Calculus
π•œ : Type u_1 ΞΉ : Type u_2 H : Type u_3 inst✝³ : IsROrC π•œ inst✝² : NormedAddCommGroup H inst✝¹ : NormedSpace π•œ H inst✝ : Fintype ΞΉ f : H β†’ EuclideanSpace π•œ ΞΉ f' : H β†’L[π•œ] EuclideanSpace π•œ ΞΉ t : Set H y : H ⊒ HasStrictFDerivAt f f' y ↔ βˆ€ (i : ΞΉ), HasStrictFDerivAt (fun x => f x i) (comp (EuclideanSpace.proj i) f') y
/- Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ import Mathlib.Analysis.InnerProductSpace.PiL2 import Mathlib.Analysis.SpecialFunctions.Sqrt import Mathlib.Analysis.NormedSpace.HomeomorphBall #align_import analysis.inner_product_space.calculus from "leanprover-community/mathlib"@"f9dd3204df14a0749cd456fac1e6849dfe7d2b88" /-! # Calculus in inner product spaces In this file we prove that the inner product and square of the norm in an inner space are infinitely `ℝ`-smooth. In order to state these results, we need a `NormedSpace ℝ E` instance. Though we can deduce this structure from `InnerProductSpace π•œ E`, this instance may be not definitionally equal to some other β€œnatural” instance. So, we assume `[NormedSpace ℝ E]`. We also prove that functions to a `EuclideanSpace` are (higher) differentiable if and only if their components are. This follows from the corresponding fact for finite product of normed spaces, and from the equivalence of norms in finite dimensions. ## TODO The last part of the file should be generalized to `PiLp`. -/ noncomputable section open IsROrC Real Filter open scoped BigOperators Classical Topology section DerivInner variable {π•œ E F : Type*} [IsROrC π•œ] variable [NormedAddCommGroup E] [InnerProductSpace π•œ E] variable [NormedAddCommGroup F] [InnerProductSpace ℝ F] local notation "βŸͺ" x ", " y "⟫" => @inner π•œ _ _ x y variable (π•œ) [NormedSpace ℝ E] /-- Derivative of the inner product. -/ def fderivInnerClm (p : E Γ— E) : E Γ— E β†’L[ℝ] π•œ := isBoundedBilinearMap_inner.deriv p #align fderiv_inner_clm fderivInnerClm @[simp] theorem fderivInnerClm_apply (p x : E Γ— E) : fderivInnerClm π•œ p x = βŸͺp.1, x.2⟫ + βŸͺx.1, p.2⟫ := rfl #align fderiv_inner_clm_apply fderivInnerClm_apply variable {π•œ} -- porting note: Lean 3 magically switches back to `{π•œ}` here theorem contDiff_inner {n} : ContDiff ℝ n fun p : E Γ— E => βŸͺp.1, p.2⟫ := isBoundedBilinearMap_inner.contDiff #align cont_diff_inner contDiff_inner theorem contDiffAt_inner {p : E Γ— E} {n} : ContDiffAt ℝ n (fun p : E Γ— E => βŸͺp.1, p.2⟫) p := ContDiff.contDiffAt contDiff_inner #align cont_diff_at_inner contDiffAt_inner theorem differentiable_inner : Differentiable ℝ fun p : E Γ— E => βŸͺp.1, p.2⟫ := isBoundedBilinearMap_inner.differentiableAt #align differentiable_inner differentiable_inner variable (π•œ) variable {G : Type*} [NormedAddCommGroup G] [NormedSpace ℝ G] {f g : G β†’ E} {f' g' : G β†’L[ℝ] E} {s : Set G} {x : G} {n : β„•βˆž} theorem ContDiffWithinAt.inner (hf : ContDiffWithinAt ℝ n f s x) (hg : ContDiffWithinAt ℝ n g s x) : ContDiffWithinAt ℝ n (fun x => βŸͺf x, g x⟫) s x := contDiffAt_inner.comp_contDiffWithinAt x (hf.prod hg) #align cont_diff_within_at.inner ContDiffWithinAt.inner nonrec theorem ContDiffAt.inner (hf : ContDiffAt ℝ n f x) (hg : ContDiffAt ℝ n g x) : ContDiffAt ℝ n (fun x => βŸͺf x, g x⟫) x := hf.inner π•œ hg #align cont_diff_at.inner ContDiffAt.inner theorem ContDiffOn.inner (hf : ContDiffOn ℝ n f s) (hg : ContDiffOn ℝ n g s) : ContDiffOn ℝ n (fun x => βŸͺf x, g x⟫) s := fun x hx => (hf x hx).inner π•œ (hg x hx) #align cont_diff_on.inner ContDiffOn.inner theorem ContDiff.inner (hf : ContDiff ℝ n f) (hg : ContDiff ℝ n g) : ContDiff ℝ n fun x => βŸͺf x, g x⟫ := contDiff_inner.comp (hf.prod hg) #align cont_diff.inner ContDiff.inner theorem HasFDerivWithinAt.inner (hf : HasFDerivWithinAt f f' s x) (hg : HasFDerivWithinAt g g' s x) : HasFDerivWithinAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') s x := (isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp_hasFDerivWithinAt x (hf.prod hg) #align has_fderiv_within_at.inner HasFDerivWithinAt.inner theorem HasStrictFDerivAt.inner (hf : HasStrictFDerivAt f f' x) (hg : HasStrictFDerivAt g g' x) : HasStrictFDerivAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') x := (isBoundedBilinearMap_inner.hasStrictFDerivAt (f x, g x)).comp x (hf.prod hg) #align has_strict_fderiv_at.inner HasStrictFDerivAt.inner theorem HasFDerivAt.inner (hf : HasFDerivAt f f' x) (hg : HasFDerivAt g g' x) : HasFDerivAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') x := (isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp x (hf.prod hg) #align has_fderiv_at.inner HasFDerivAt.inner theorem HasDerivWithinAt.inner {f g : ℝ β†’ E} {f' g' : E} {s : Set ℝ} {x : ℝ} (hf : HasDerivWithinAt f f' s x) (hg : HasDerivWithinAt g g' s x) : HasDerivWithinAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) s x := by simpa using (hf.hasFDerivWithinAt.inner π•œ hg.hasFDerivWithinAt).hasDerivWithinAt #align has_deriv_within_at.inner HasDerivWithinAt.inner theorem HasDerivAt.inner {f g : ℝ β†’ E} {f' g' : E} {x : ℝ} : HasDerivAt f f' x β†’ HasDerivAt g g' x β†’ HasDerivAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) x := by simpa only [← hasDerivWithinAt_univ] using HasDerivWithinAt.inner π•œ #align has_deriv_at.inner HasDerivAt.inner theorem DifferentiableWithinAt.inner (hf : DifferentiableWithinAt ℝ f s x) (hg : DifferentiableWithinAt ℝ g s x) : DifferentiableWithinAt ℝ (fun x => βŸͺf x, g x⟫) s x := ((differentiable_inner _).hasFDerivAt.comp_hasFDerivWithinAt x (hf.prod hg).hasFDerivWithinAt).differentiableWithinAt #align differentiable_within_at.inner DifferentiableWithinAt.inner theorem DifferentiableAt.inner (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) : DifferentiableAt ℝ (fun x => βŸͺf x, g x⟫) x := (differentiable_inner _).comp x (hf.prod hg) #align differentiable_at.inner DifferentiableAt.inner theorem DifferentiableOn.inner (hf : DifferentiableOn ℝ f s) (hg : DifferentiableOn ℝ g s) : DifferentiableOn ℝ (fun x => βŸͺf x, g x⟫) s := fun x hx => (hf x hx).inner π•œ (hg x hx) #align differentiable_on.inner DifferentiableOn.inner theorem Differentiable.inner (hf : Differentiable ℝ f) (hg : Differentiable ℝ g) : Differentiable ℝ fun x => βŸͺf x, g x⟫ := fun x => (hf x).inner π•œ (hg x) #align differentiable.inner Differentiable.inner theorem fderiv_inner_apply (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) (y : G) : fderiv ℝ (fun t => βŸͺf t, g t⟫) x y = βŸͺf x, fderiv ℝ g x y⟫ + βŸͺfderiv ℝ f x y, g x⟫ := by rw [(hf.hasFDerivAt.inner π•œ hg.hasFDerivAt).fderiv]; rfl #align fderiv_inner_apply fderiv_inner_apply theorem deriv_inner_apply {f g : ℝ β†’ E} {x : ℝ} (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) : deriv (fun t => βŸͺf t, g t⟫) x = βŸͺf x, deriv g x⟫ + βŸͺderiv f x, g x⟫ := (hf.hasDerivAt.inner π•œ hg.hasDerivAt).deriv #align deriv_inner_apply deriv_inner_apply theorem contDiff_norm_sq : ContDiff ℝ n fun x : E => β€–xβ€– ^ 2 := by convert (reClm : π•œ β†’L[ℝ] ℝ).contDiff.comp ((contDiff_id (E := E)).inner π•œ (contDiff_id (E := E))) exact (inner_self_eq_norm_sq _).symm #align cont_diff_norm_sq contDiff_norm_sq theorem ContDiff.norm_sq (hf : ContDiff ℝ n f) : ContDiff ℝ n fun x => β€–f xβ€– ^ 2 := (contDiff_norm_sq π•œ).comp hf #align cont_diff.norm_sq ContDiff.norm_sq theorem ContDiffWithinAt.norm_sq (hf : ContDiffWithinAt ℝ n f s x) : ContDiffWithinAt ℝ n (fun y => β€–f yβ€– ^ 2) s x := (contDiff_norm_sq π•œ).contDiffAt.comp_contDiffWithinAt x hf #align cont_diff_within_at.norm_sq ContDiffWithinAt.norm_sq nonrec theorem ContDiffAt.norm_sq (hf : ContDiffAt ℝ n f x) : ContDiffAt ℝ n (β€–f Β·β€– ^ 2) x := hf.norm_sq π•œ #align cont_diff_at.norm_sq ContDiffAt.norm_sq theorem contDiffAt_norm {x : E} (hx : x β‰  0) : ContDiffAt ℝ n norm x := by have : β€–id xβ€– ^ 2 β‰  0 := pow_ne_zero 2 (norm_pos_iff.2 hx).ne' simpa only [id, sqrt_sq, norm_nonneg] using (contDiffAt_id.norm_sq π•œ).sqrt this #align cont_diff_at_norm contDiffAt_norm theorem ContDiffAt.norm (hf : ContDiffAt ℝ n f x) (h0 : f x β‰  0) : ContDiffAt ℝ n (fun y => β€–f yβ€–) x := (contDiffAt_norm π•œ h0).comp x hf #align cont_diff_at.norm ContDiffAt.norm theorem ContDiffAt.dist (hf : ContDiffAt ℝ n f x) (hg : ContDiffAt ℝ n g x) (hne : f x β‰  g x) : ContDiffAt ℝ n (fun y => dist (f y) (g y)) x := by simp only [dist_eq_norm] exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align cont_diff_at.dist ContDiffAt.dist theorem ContDiffWithinAt.norm (hf : ContDiffWithinAt ℝ n f s x) (h0 : f x β‰  0) : ContDiffWithinAt ℝ n (fun y => β€–f yβ€–) s x := (contDiffAt_norm π•œ h0).comp_contDiffWithinAt x hf #align cont_diff_within_at.norm ContDiffWithinAt.norm theorem ContDiffWithinAt.dist (hf : ContDiffWithinAt ℝ n f s x) (hg : ContDiffWithinAt ℝ n g s x) (hne : f x β‰  g x) : ContDiffWithinAt ℝ n (fun y => dist (f y) (g y)) s x := by simp only [dist_eq_norm]; exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align cont_diff_within_at.dist ContDiffWithinAt.dist theorem ContDiffOn.norm_sq (hf : ContDiffOn ℝ n f s) : ContDiffOn ℝ n (fun y => β€–f yβ€– ^ 2) s := fun x hx => (hf x hx).norm_sq π•œ #align cont_diff_on.norm_sq ContDiffOn.norm_sq theorem ContDiffOn.norm (hf : ContDiffOn ℝ n f s) (h0 : βˆ€ x ∈ s, f x β‰  0) : ContDiffOn ℝ n (fun y => β€–f yβ€–) s := fun x hx => (hf x hx).norm π•œ (h0 x hx) #align cont_diff_on.norm ContDiffOn.norm theorem ContDiffOn.dist (hf : ContDiffOn ℝ n f s) (hg : ContDiffOn ℝ n g s) (hne : βˆ€ x ∈ s, f x β‰  g x) : ContDiffOn ℝ n (fun y => dist (f y) (g y)) s := fun x hx => (hf x hx).dist π•œ (hg x hx) (hne x hx) #align cont_diff_on.dist ContDiffOn.dist theorem ContDiff.norm (hf : ContDiff ℝ n f) (h0 : βˆ€ x, f x β‰  0) : ContDiff ℝ n fun y => β€–f yβ€– := contDiff_iff_contDiffAt.2 fun x => hf.contDiffAt.norm π•œ (h0 x) #align cont_diff.norm ContDiff.norm theorem ContDiff.dist (hf : ContDiff ℝ n f) (hg : ContDiff ℝ n g) (hne : βˆ€ x, f x β‰  g x) : ContDiff ℝ n fun y => dist (f y) (g y) := contDiff_iff_contDiffAt.2 fun x => hf.contDiffAt.dist π•œ hg.contDiffAt (hne x) #align cont_diff.dist ContDiff.dist -- porting note: use `2 β€’` instead of `bit0` theorem hasStrictFDerivAt_norm_sq (x : F) : HasStrictFDerivAt (fun x => β€–xβ€– ^ 2) (2 β€’ (innerSL ℝ x)) x := by simp only [sq, ← @inner_self_eq_norm_mul_norm ℝ] convert (hasStrictFDerivAt_id x).inner ℝ (hasStrictFDerivAt_id x) ext y simp [two_smul, real_inner_comm] #align has_strict_fderiv_at_norm_sq hasStrictFDerivAt_norm_sqβ‚“ theorem HasFDerivAt.norm_sq {f : G β†’ F} {f' : G β†’L[ℝ] F} (hf : HasFDerivAt f f' x) : HasFDerivAt (β€–f Β·β€– ^ 2) (2 β€’ (innerSL ℝ (f x)).comp f') x := (hasStrictFDerivAt_norm_sq _).hasFDerivAt.comp x hf theorem HasDerivAt.norm_sq {f : ℝ β†’ F} {f' : F} {x : ℝ} (hf : HasDerivAt f f' x) : HasDerivAt (β€–f Β·β€– ^ 2) (2 * Inner.inner (f x) f') x := by simpa using hf.hasFDerivAt.norm_sq.hasDerivAt theorem HasFDerivWithinAt.norm_sq {f : G β†’ F} {f' : G β†’L[ℝ] F} (hf : HasFDerivWithinAt f f' s x) : HasFDerivWithinAt (β€–f Β·β€– ^ 2) (2 β€’ (innerSL ℝ (f x)).comp f') s x := (hasStrictFDerivAt_norm_sq _).hasFDerivAt.comp_hasFDerivWithinAt x hf theorem HasDerivWithinAt.norm_sq {f : ℝ β†’ F} {f' : F} {s : Set ℝ} {x : ℝ} (hf : HasDerivWithinAt f f' s x) : HasDerivWithinAt (β€–f Β·β€– ^ 2) (2 * Inner.inner (f x) f') s x := by simpa using hf.hasFDerivWithinAt.norm_sq.hasDerivWithinAt theorem DifferentiableAt.norm_sq (hf : DifferentiableAt ℝ f x) : DifferentiableAt ℝ (fun y => β€–f yβ€– ^ 2) x := ((contDiffAt_id.norm_sq π•œ).differentiableAt le_rfl).comp x hf #align differentiable_at.norm_sq DifferentiableAt.norm_sq theorem DifferentiableAt.norm (hf : DifferentiableAt ℝ f x) (h0 : f x β‰  0) : DifferentiableAt ℝ (fun y => β€–f yβ€–) x := ((contDiffAt_norm π•œ h0).differentiableAt le_rfl).comp x hf #align differentiable_at.norm DifferentiableAt.norm theorem DifferentiableAt.dist (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) (hne : f x β‰  g x) : DifferentiableAt ℝ (fun y => dist (f y) (g y)) x := by simp only [dist_eq_norm]; exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align differentiable_at.dist DifferentiableAt.dist theorem Differentiable.norm_sq (hf : Differentiable ℝ f) : Differentiable ℝ fun y => β€–f yβ€– ^ 2 := fun x => (hf x).norm_sq π•œ #align differentiable.norm_sq Differentiable.norm_sq theorem Differentiable.norm (hf : Differentiable ℝ f) (h0 : βˆ€ x, f x β‰  0) : Differentiable ℝ fun y => β€–f yβ€– := fun x => (hf x).norm π•œ (h0 x) #align differentiable.norm Differentiable.norm theorem Differentiable.dist (hf : Differentiable ℝ f) (hg : Differentiable ℝ g) (hne : βˆ€ x, f x β‰  g x) : Differentiable ℝ fun y => dist (f y) (g y) := fun x => (hf x).dist π•œ (hg x) (hne x) #align differentiable.dist Differentiable.dist theorem DifferentiableWithinAt.norm_sq (hf : DifferentiableWithinAt ℝ f s x) : DifferentiableWithinAt ℝ (fun y => β€–f yβ€– ^ 2) s x := ((contDiffAt_id.norm_sq π•œ).differentiableAt le_rfl).comp_differentiableWithinAt x hf #align differentiable_within_at.norm_sq DifferentiableWithinAt.norm_sq theorem DifferentiableWithinAt.norm (hf : DifferentiableWithinAt ℝ f s x) (h0 : f x β‰  0) : DifferentiableWithinAt ℝ (fun y => β€–f yβ€–) s x := ((contDiffAt_id.norm π•œ h0).differentiableAt le_rfl).comp_differentiableWithinAt x hf #align differentiable_within_at.norm DifferentiableWithinAt.norm theorem DifferentiableWithinAt.dist (hf : DifferentiableWithinAt ℝ f s x) (hg : DifferentiableWithinAt ℝ g s x) (hne : f x β‰  g x) : DifferentiableWithinAt ℝ (fun y => dist (f y) (g y)) s x := by simp only [dist_eq_norm] exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align differentiable_within_at.dist DifferentiableWithinAt.dist theorem DifferentiableOn.norm_sq (hf : DifferentiableOn ℝ f s) : DifferentiableOn ℝ (fun y => β€–f yβ€– ^ 2) s := fun x hx => (hf x hx).norm_sq π•œ #align differentiable_on.norm_sq DifferentiableOn.norm_sq theorem DifferentiableOn.norm (hf : DifferentiableOn ℝ f s) (h0 : βˆ€ x ∈ s, f x β‰  0) : DifferentiableOn ℝ (fun y => β€–f yβ€–) s := fun x hx => (hf x hx).norm π•œ (h0 x hx) #align differentiable_on.norm DifferentiableOn.norm theorem DifferentiableOn.dist (hf : DifferentiableOn ℝ f s) (hg : DifferentiableOn ℝ g s) (hne : βˆ€ x ∈ s, f x β‰  g x) : DifferentiableOn ℝ (fun y => dist (f y) (g y)) s := fun x hx => (hf x hx).dist π•œ (hg x hx) (hne x hx) #align differentiable_on.dist DifferentiableOn.dist end DerivInner section PiLike open ContinuousLinearMap variable {π•œ ΞΉ H : Type*} [IsROrC π•œ] [NormedAddCommGroup H] [NormedSpace π•œ H] [Fintype ΞΉ] {f : H β†’ EuclideanSpace π•œ ΞΉ} {f' : H β†’L[π•œ] EuclideanSpace π•œ ΞΉ} {t : Set H} {y : H} theorem differentiableWithinAt_euclidean : DifferentiableWithinAt π•œ f t y ↔ βˆ€ i, DifferentiableWithinAt π•œ (fun x => f x i) t y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_differentiableWithinAt_iff, differentiableWithinAt_pi] rfl #align differentiable_within_at_euclidean differentiableWithinAt_euclidean theorem differentiableAt_euclidean : DifferentiableAt π•œ f y ↔ βˆ€ i, DifferentiableAt π•œ (fun x => f x i) y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_differentiableAt_iff, differentiableAt_pi] rfl #align differentiable_at_euclidean differentiableAt_euclidean theorem differentiableOn_euclidean : DifferentiableOn π•œ f t ↔ βˆ€ i, DifferentiableOn π•œ (fun x => f x i) t := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_differentiableOn_iff, differentiableOn_pi] rfl #align differentiable_on_euclidean differentiableOn_euclidean theorem differentiable_euclidean : Differentiable π•œ f ↔ βˆ€ i, Differentiable π•œ fun x => f x i := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_differentiable_iff, differentiable_pi] rfl #align differentiable_euclidean differentiable_euclidean theorem hasStrictFDerivAt_euclidean : HasStrictFDerivAt f f' y ↔ βˆ€ i, HasStrictFDerivAt (fun x => f x i) (EuclideanSpace.proj i ∘L f') y := by
rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_hasStrictFDerivAt_iff, hasStrictFDerivAt_pi']
theorem hasStrictFDerivAt_euclidean : HasStrictFDerivAt f f' y ↔ βˆ€ i, HasStrictFDerivAt (fun x => f x i) (EuclideanSpace.proj i ∘L f') y := by
Mathlib.Analysis.InnerProductSpace.Calculus.335_0.6FECEGgqdb67QLM
theorem hasStrictFDerivAt_euclidean : HasStrictFDerivAt f f' y ↔ βˆ€ i, HasStrictFDerivAt (fun x => f x i) (EuclideanSpace.proj i ∘L f') y
Mathlib_Analysis_InnerProductSpace_Calculus
π•œ : Type u_1 ΞΉ : Type u_2 H : Type u_3 inst✝³ : IsROrC π•œ inst✝² : NormedAddCommGroup H inst✝¹ : NormedSpace π•œ H inst✝ : Fintype ΞΉ f : H β†’ EuclideanSpace π•œ ΞΉ f' : H β†’L[π•œ] EuclideanSpace π•œ ΞΉ t : Set H y : H ⊒ (βˆ€ (i : ΞΉ), HasStrictFDerivAt (fun x => (⇑(EuclideanSpace.equiv ΞΉ π•œ) ∘ f) x i) (comp (proj i) (comp (↑(EuclideanSpace.equiv ΞΉ π•œ)) f')) y) ↔ βˆ€ (i : ΞΉ), HasStrictFDerivAt (fun x => f x i) (comp (EuclideanSpace.proj i) f') y
/- Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ import Mathlib.Analysis.InnerProductSpace.PiL2 import Mathlib.Analysis.SpecialFunctions.Sqrt import Mathlib.Analysis.NormedSpace.HomeomorphBall #align_import analysis.inner_product_space.calculus from "leanprover-community/mathlib"@"f9dd3204df14a0749cd456fac1e6849dfe7d2b88" /-! # Calculus in inner product spaces In this file we prove that the inner product and square of the norm in an inner space are infinitely `ℝ`-smooth. In order to state these results, we need a `NormedSpace ℝ E` instance. Though we can deduce this structure from `InnerProductSpace π•œ E`, this instance may be not definitionally equal to some other β€œnatural” instance. So, we assume `[NormedSpace ℝ E]`. We also prove that functions to a `EuclideanSpace` are (higher) differentiable if and only if their components are. This follows from the corresponding fact for finite product of normed spaces, and from the equivalence of norms in finite dimensions. ## TODO The last part of the file should be generalized to `PiLp`. -/ noncomputable section open IsROrC Real Filter open scoped BigOperators Classical Topology section DerivInner variable {π•œ E F : Type*} [IsROrC π•œ] variable [NormedAddCommGroup E] [InnerProductSpace π•œ E] variable [NormedAddCommGroup F] [InnerProductSpace ℝ F] local notation "βŸͺ" x ", " y "⟫" => @inner π•œ _ _ x y variable (π•œ) [NormedSpace ℝ E] /-- Derivative of the inner product. -/ def fderivInnerClm (p : E Γ— E) : E Γ— E β†’L[ℝ] π•œ := isBoundedBilinearMap_inner.deriv p #align fderiv_inner_clm fderivInnerClm @[simp] theorem fderivInnerClm_apply (p x : E Γ— E) : fderivInnerClm π•œ p x = βŸͺp.1, x.2⟫ + βŸͺx.1, p.2⟫ := rfl #align fderiv_inner_clm_apply fderivInnerClm_apply variable {π•œ} -- porting note: Lean 3 magically switches back to `{π•œ}` here theorem contDiff_inner {n} : ContDiff ℝ n fun p : E Γ— E => βŸͺp.1, p.2⟫ := isBoundedBilinearMap_inner.contDiff #align cont_diff_inner contDiff_inner theorem contDiffAt_inner {p : E Γ— E} {n} : ContDiffAt ℝ n (fun p : E Γ— E => βŸͺp.1, p.2⟫) p := ContDiff.contDiffAt contDiff_inner #align cont_diff_at_inner contDiffAt_inner theorem differentiable_inner : Differentiable ℝ fun p : E Γ— E => βŸͺp.1, p.2⟫ := isBoundedBilinearMap_inner.differentiableAt #align differentiable_inner differentiable_inner variable (π•œ) variable {G : Type*} [NormedAddCommGroup G] [NormedSpace ℝ G] {f g : G β†’ E} {f' g' : G β†’L[ℝ] E} {s : Set G} {x : G} {n : β„•βˆž} theorem ContDiffWithinAt.inner (hf : ContDiffWithinAt ℝ n f s x) (hg : ContDiffWithinAt ℝ n g s x) : ContDiffWithinAt ℝ n (fun x => βŸͺf x, g x⟫) s x := contDiffAt_inner.comp_contDiffWithinAt x (hf.prod hg) #align cont_diff_within_at.inner ContDiffWithinAt.inner nonrec theorem ContDiffAt.inner (hf : ContDiffAt ℝ n f x) (hg : ContDiffAt ℝ n g x) : ContDiffAt ℝ n (fun x => βŸͺf x, g x⟫) x := hf.inner π•œ hg #align cont_diff_at.inner ContDiffAt.inner theorem ContDiffOn.inner (hf : ContDiffOn ℝ n f s) (hg : ContDiffOn ℝ n g s) : ContDiffOn ℝ n (fun x => βŸͺf x, g x⟫) s := fun x hx => (hf x hx).inner π•œ (hg x hx) #align cont_diff_on.inner ContDiffOn.inner theorem ContDiff.inner (hf : ContDiff ℝ n f) (hg : ContDiff ℝ n g) : ContDiff ℝ n fun x => βŸͺf x, g x⟫ := contDiff_inner.comp (hf.prod hg) #align cont_diff.inner ContDiff.inner theorem HasFDerivWithinAt.inner (hf : HasFDerivWithinAt f f' s x) (hg : HasFDerivWithinAt g g' s x) : HasFDerivWithinAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') s x := (isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp_hasFDerivWithinAt x (hf.prod hg) #align has_fderiv_within_at.inner HasFDerivWithinAt.inner theorem HasStrictFDerivAt.inner (hf : HasStrictFDerivAt f f' x) (hg : HasStrictFDerivAt g g' x) : HasStrictFDerivAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') x := (isBoundedBilinearMap_inner.hasStrictFDerivAt (f x, g x)).comp x (hf.prod hg) #align has_strict_fderiv_at.inner HasStrictFDerivAt.inner theorem HasFDerivAt.inner (hf : HasFDerivAt f f' x) (hg : HasFDerivAt g g' x) : HasFDerivAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') x := (isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp x (hf.prod hg) #align has_fderiv_at.inner HasFDerivAt.inner theorem HasDerivWithinAt.inner {f g : ℝ β†’ E} {f' g' : E} {s : Set ℝ} {x : ℝ} (hf : HasDerivWithinAt f f' s x) (hg : HasDerivWithinAt g g' s x) : HasDerivWithinAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) s x := by simpa using (hf.hasFDerivWithinAt.inner π•œ hg.hasFDerivWithinAt).hasDerivWithinAt #align has_deriv_within_at.inner HasDerivWithinAt.inner theorem HasDerivAt.inner {f g : ℝ β†’ E} {f' g' : E} {x : ℝ} : HasDerivAt f f' x β†’ HasDerivAt g g' x β†’ HasDerivAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) x := by simpa only [← hasDerivWithinAt_univ] using HasDerivWithinAt.inner π•œ #align has_deriv_at.inner HasDerivAt.inner theorem DifferentiableWithinAt.inner (hf : DifferentiableWithinAt ℝ f s x) (hg : DifferentiableWithinAt ℝ g s x) : DifferentiableWithinAt ℝ (fun x => βŸͺf x, g x⟫) s x := ((differentiable_inner _).hasFDerivAt.comp_hasFDerivWithinAt x (hf.prod hg).hasFDerivWithinAt).differentiableWithinAt #align differentiable_within_at.inner DifferentiableWithinAt.inner theorem DifferentiableAt.inner (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) : DifferentiableAt ℝ (fun x => βŸͺf x, g x⟫) x := (differentiable_inner _).comp x (hf.prod hg) #align differentiable_at.inner DifferentiableAt.inner theorem DifferentiableOn.inner (hf : DifferentiableOn ℝ f s) (hg : DifferentiableOn ℝ g s) : DifferentiableOn ℝ (fun x => βŸͺf x, g x⟫) s := fun x hx => (hf x hx).inner π•œ (hg x hx) #align differentiable_on.inner DifferentiableOn.inner theorem Differentiable.inner (hf : Differentiable ℝ f) (hg : Differentiable ℝ g) : Differentiable ℝ fun x => βŸͺf x, g x⟫ := fun x => (hf x).inner π•œ (hg x) #align differentiable.inner Differentiable.inner theorem fderiv_inner_apply (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) (y : G) : fderiv ℝ (fun t => βŸͺf t, g t⟫) x y = βŸͺf x, fderiv ℝ g x y⟫ + βŸͺfderiv ℝ f x y, g x⟫ := by rw [(hf.hasFDerivAt.inner π•œ hg.hasFDerivAt).fderiv]; rfl #align fderiv_inner_apply fderiv_inner_apply theorem deriv_inner_apply {f g : ℝ β†’ E} {x : ℝ} (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) : deriv (fun t => βŸͺf t, g t⟫) x = βŸͺf x, deriv g x⟫ + βŸͺderiv f x, g x⟫ := (hf.hasDerivAt.inner π•œ hg.hasDerivAt).deriv #align deriv_inner_apply deriv_inner_apply theorem contDiff_norm_sq : ContDiff ℝ n fun x : E => β€–xβ€– ^ 2 := by convert (reClm : π•œ β†’L[ℝ] ℝ).contDiff.comp ((contDiff_id (E := E)).inner π•œ (contDiff_id (E := E))) exact (inner_self_eq_norm_sq _).symm #align cont_diff_norm_sq contDiff_norm_sq theorem ContDiff.norm_sq (hf : ContDiff ℝ n f) : ContDiff ℝ n fun x => β€–f xβ€– ^ 2 := (contDiff_norm_sq π•œ).comp hf #align cont_diff.norm_sq ContDiff.norm_sq theorem ContDiffWithinAt.norm_sq (hf : ContDiffWithinAt ℝ n f s x) : ContDiffWithinAt ℝ n (fun y => β€–f yβ€– ^ 2) s x := (contDiff_norm_sq π•œ).contDiffAt.comp_contDiffWithinAt x hf #align cont_diff_within_at.norm_sq ContDiffWithinAt.norm_sq nonrec theorem ContDiffAt.norm_sq (hf : ContDiffAt ℝ n f x) : ContDiffAt ℝ n (β€–f Β·β€– ^ 2) x := hf.norm_sq π•œ #align cont_diff_at.norm_sq ContDiffAt.norm_sq theorem contDiffAt_norm {x : E} (hx : x β‰  0) : ContDiffAt ℝ n norm x := by have : β€–id xβ€– ^ 2 β‰  0 := pow_ne_zero 2 (norm_pos_iff.2 hx).ne' simpa only [id, sqrt_sq, norm_nonneg] using (contDiffAt_id.norm_sq π•œ).sqrt this #align cont_diff_at_norm contDiffAt_norm theorem ContDiffAt.norm (hf : ContDiffAt ℝ n f x) (h0 : f x β‰  0) : ContDiffAt ℝ n (fun y => β€–f yβ€–) x := (contDiffAt_norm π•œ h0).comp x hf #align cont_diff_at.norm ContDiffAt.norm theorem ContDiffAt.dist (hf : ContDiffAt ℝ n f x) (hg : ContDiffAt ℝ n g x) (hne : f x β‰  g x) : ContDiffAt ℝ n (fun y => dist (f y) (g y)) x := by simp only [dist_eq_norm] exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align cont_diff_at.dist ContDiffAt.dist theorem ContDiffWithinAt.norm (hf : ContDiffWithinAt ℝ n f s x) (h0 : f x β‰  0) : ContDiffWithinAt ℝ n (fun y => β€–f yβ€–) s x := (contDiffAt_norm π•œ h0).comp_contDiffWithinAt x hf #align cont_diff_within_at.norm ContDiffWithinAt.norm theorem ContDiffWithinAt.dist (hf : ContDiffWithinAt ℝ n f s x) (hg : ContDiffWithinAt ℝ n g s x) (hne : f x β‰  g x) : ContDiffWithinAt ℝ n (fun y => dist (f y) (g y)) s x := by simp only [dist_eq_norm]; exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align cont_diff_within_at.dist ContDiffWithinAt.dist theorem ContDiffOn.norm_sq (hf : ContDiffOn ℝ n f s) : ContDiffOn ℝ n (fun y => β€–f yβ€– ^ 2) s := fun x hx => (hf x hx).norm_sq π•œ #align cont_diff_on.norm_sq ContDiffOn.norm_sq theorem ContDiffOn.norm (hf : ContDiffOn ℝ n f s) (h0 : βˆ€ x ∈ s, f x β‰  0) : ContDiffOn ℝ n (fun y => β€–f yβ€–) s := fun x hx => (hf x hx).norm π•œ (h0 x hx) #align cont_diff_on.norm ContDiffOn.norm theorem ContDiffOn.dist (hf : ContDiffOn ℝ n f s) (hg : ContDiffOn ℝ n g s) (hne : βˆ€ x ∈ s, f x β‰  g x) : ContDiffOn ℝ n (fun y => dist (f y) (g y)) s := fun x hx => (hf x hx).dist π•œ (hg x hx) (hne x hx) #align cont_diff_on.dist ContDiffOn.dist theorem ContDiff.norm (hf : ContDiff ℝ n f) (h0 : βˆ€ x, f x β‰  0) : ContDiff ℝ n fun y => β€–f yβ€– := contDiff_iff_contDiffAt.2 fun x => hf.contDiffAt.norm π•œ (h0 x) #align cont_diff.norm ContDiff.norm theorem ContDiff.dist (hf : ContDiff ℝ n f) (hg : ContDiff ℝ n g) (hne : βˆ€ x, f x β‰  g x) : ContDiff ℝ n fun y => dist (f y) (g y) := contDiff_iff_contDiffAt.2 fun x => hf.contDiffAt.dist π•œ hg.contDiffAt (hne x) #align cont_diff.dist ContDiff.dist -- porting note: use `2 β€’` instead of `bit0` theorem hasStrictFDerivAt_norm_sq (x : F) : HasStrictFDerivAt (fun x => β€–xβ€– ^ 2) (2 β€’ (innerSL ℝ x)) x := by simp only [sq, ← @inner_self_eq_norm_mul_norm ℝ] convert (hasStrictFDerivAt_id x).inner ℝ (hasStrictFDerivAt_id x) ext y simp [two_smul, real_inner_comm] #align has_strict_fderiv_at_norm_sq hasStrictFDerivAt_norm_sqβ‚“ theorem HasFDerivAt.norm_sq {f : G β†’ F} {f' : G β†’L[ℝ] F} (hf : HasFDerivAt f f' x) : HasFDerivAt (β€–f Β·β€– ^ 2) (2 β€’ (innerSL ℝ (f x)).comp f') x := (hasStrictFDerivAt_norm_sq _).hasFDerivAt.comp x hf theorem HasDerivAt.norm_sq {f : ℝ β†’ F} {f' : F} {x : ℝ} (hf : HasDerivAt f f' x) : HasDerivAt (β€–f Β·β€– ^ 2) (2 * Inner.inner (f x) f') x := by simpa using hf.hasFDerivAt.norm_sq.hasDerivAt theorem HasFDerivWithinAt.norm_sq {f : G β†’ F} {f' : G β†’L[ℝ] F} (hf : HasFDerivWithinAt f f' s x) : HasFDerivWithinAt (β€–f Β·β€– ^ 2) (2 β€’ (innerSL ℝ (f x)).comp f') s x := (hasStrictFDerivAt_norm_sq _).hasFDerivAt.comp_hasFDerivWithinAt x hf theorem HasDerivWithinAt.norm_sq {f : ℝ β†’ F} {f' : F} {s : Set ℝ} {x : ℝ} (hf : HasDerivWithinAt f f' s x) : HasDerivWithinAt (β€–f Β·β€– ^ 2) (2 * Inner.inner (f x) f') s x := by simpa using hf.hasFDerivWithinAt.norm_sq.hasDerivWithinAt theorem DifferentiableAt.norm_sq (hf : DifferentiableAt ℝ f x) : DifferentiableAt ℝ (fun y => β€–f yβ€– ^ 2) x := ((contDiffAt_id.norm_sq π•œ).differentiableAt le_rfl).comp x hf #align differentiable_at.norm_sq DifferentiableAt.norm_sq theorem DifferentiableAt.norm (hf : DifferentiableAt ℝ f x) (h0 : f x β‰  0) : DifferentiableAt ℝ (fun y => β€–f yβ€–) x := ((contDiffAt_norm π•œ h0).differentiableAt le_rfl).comp x hf #align differentiable_at.norm DifferentiableAt.norm theorem DifferentiableAt.dist (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) (hne : f x β‰  g x) : DifferentiableAt ℝ (fun y => dist (f y) (g y)) x := by simp only [dist_eq_norm]; exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align differentiable_at.dist DifferentiableAt.dist theorem Differentiable.norm_sq (hf : Differentiable ℝ f) : Differentiable ℝ fun y => β€–f yβ€– ^ 2 := fun x => (hf x).norm_sq π•œ #align differentiable.norm_sq Differentiable.norm_sq theorem Differentiable.norm (hf : Differentiable ℝ f) (h0 : βˆ€ x, f x β‰  0) : Differentiable ℝ fun y => β€–f yβ€– := fun x => (hf x).norm π•œ (h0 x) #align differentiable.norm Differentiable.norm theorem Differentiable.dist (hf : Differentiable ℝ f) (hg : Differentiable ℝ g) (hne : βˆ€ x, f x β‰  g x) : Differentiable ℝ fun y => dist (f y) (g y) := fun x => (hf x).dist π•œ (hg x) (hne x) #align differentiable.dist Differentiable.dist theorem DifferentiableWithinAt.norm_sq (hf : DifferentiableWithinAt ℝ f s x) : DifferentiableWithinAt ℝ (fun y => β€–f yβ€– ^ 2) s x := ((contDiffAt_id.norm_sq π•œ).differentiableAt le_rfl).comp_differentiableWithinAt x hf #align differentiable_within_at.norm_sq DifferentiableWithinAt.norm_sq theorem DifferentiableWithinAt.norm (hf : DifferentiableWithinAt ℝ f s x) (h0 : f x β‰  0) : DifferentiableWithinAt ℝ (fun y => β€–f yβ€–) s x := ((contDiffAt_id.norm π•œ h0).differentiableAt le_rfl).comp_differentiableWithinAt x hf #align differentiable_within_at.norm DifferentiableWithinAt.norm theorem DifferentiableWithinAt.dist (hf : DifferentiableWithinAt ℝ f s x) (hg : DifferentiableWithinAt ℝ g s x) (hne : f x β‰  g x) : DifferentiableWithinAt ℝ (fun y => dist (f y) (g y)) s x := by simp only [dist_eq_norm] exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align differentiable_within_at.dist DifferentiableWithinAt.dist theorem DifferentiableOn.norm_sq (hf : DifferentiableOn ℝ f s) : DifferentiableOn ℝ (fun y => β€–f yβ€– ^ 2) s := fun x hx => (hf x hx).norm_sq π•œ #align differentiable_on.norm_sq DifferentiableOn.norm_sq theorem DifferentiableOn.norm (hf : DifferentiableOn ℝ f s) (h0 : βˆ€ x ∈ s, f x β‰  0) : DifferentiableOn ℝ (fun y => β€–f yβ€–) s := fun x hx => (hf x hx).norm π•œ (h0 x hx) #align differentiable_on.norm DifferentiableOn.norm theorem DifferentiableOn.dist (hf : DifferentiableOn ℝ f s) (hg : DifferentiableOn ℝ g s) (hne : βˆ€ x ∈ s, f x β‰  g x) : DifferentiableOn ℝ (fun y => dist (f y) (g y)) s := fun x hx => (hf x hx).dist π•œ (hg x hx) (hne x hx) #align differentiable_on.dist DifferentiableOn.dist end DerivInner section PiLike open ContinuousLinearMap variable {π•œ ΞΉ H : Type*} [IsROrC π•œ] [NormedAddCommGroup H] [NormedSpace π•œ H] [Fintype ΞΉ] {f : H β†’ EuclideanSpace π•œ ΞΉ} {f' : H β†’L[π•œ] EuclideanSpace π•œ ΞΉ} {t : Set H} {y : H} theorem differentiableWithinAt_euclidean : DifferentiableWithinAt π•œ f t y ↔ βˆ€ i, DifferentiableWithinAt π•œ (fun x => f x i) t y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_differentiableWithinAt_iff, differentiableWithinAt_pi] rfl #align differentiable_within_at_euclidean differentiableWithinAt_euclidean theorem differentiableAt_euclidean : DifferentiableAt π•œ f y ↔ βˆ€ i, DifferentiableAt π•œ (fun x => f x i) y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_differentiableAt_iff, differentiableAt_pi] rfl #align differentiable_at_euclidean differentiableAt_euclidean theorem differentiableOn_euclidean : DifferentiableOn π•œ f t ↔ βˆ€ i, DifferentiableOn π•œ (fun x => f x i) t := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_differentiableOn_iff, differentiableOn_pi] rfl #align differentiable_on_euclidean differentiableOn_euclidean theorem differentiable_euclidean : Differentiable π•œ f ↔ βˆ€ i, Differentiable π•œ fun x => f x i := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_differentiable_iff, differentiable_pi] rfl #align differentiable_euclidean differentiable_euclidean theorem hasStrictFDerivAt_euclidean : HasStrictFDerivAt f f' y ↔ βˆ€ i, HasStrictFDerivAt (fun x => f x i) (EuclideanSpace.proj i ∘L f') y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_hasStrictFDerivAt_iff, hasStrictFDerivAt_pi']
rfl
theorem hasStrictFDerivAt_euclidean : HasStrictFDerivAt f f' y ↔ βˆ€ i, HasStrictFDerivAt (fun x => f x i) (EuclideanSpace.proj i ∘L f') y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_hasStrictFDerivAt_iff, hasStrictFDerivAt_pi']
Mathlib.Analysis.InnerProductSpace.Calculus.335_0.6FECEGgqdb67QLM
theorem hasStrictFDerivAt_euclidean : HasStrictFDerivAt f f' y ↔ βˆ€ i, HasStrictFDerivAt (fun x => f x i) (EuclideanSpace.proj i ∘L f') y
Mathlib_Analysis_InnerProductSpace_Calculus
π•œ : Type u_1 ΞΉ : Type u_2 H : Type u_3 inst✝³ : IsROrC π•œ inst✝² : NormedAddCommGroup H inst✝¹ : NormedSpace π•œ H inst✝ : Fintype ΞΉ f : H β†’ EuclideanSpace π•œ ΞΉ f' : H β†’L[π•œ] EuclideanSpace π•œ ΞΉ t : Set H y : H ⊒ HasFDerivWithinAt f f' t y ↔ βˆ€ (i : ΞΉ), HasFDerivWithinAt (fun x => f x i) (comp (EuclideanSpace.proj i) f') t y
/- Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ import Mathlib.Analysis.InnerProductSpace.PiL2 import Mathlib.Analysis.SpecialFunctions.Sqrt import Mathlib.Analysis.NormedSpace.HomeomorphBall #align_import analysis.inner_product_space.calculus from "leanprover-community/mathlib"@"f9dd3204df14a0749cd456fac1e6849dfe7d2b88" /-! # Calculus in inner product spaces In this file we prove that the inner product and square of the norm in an inner space are infinitely `ℝ`-smooth. In order to state these results, we need a `NormedSpace ℝ E` instance. Though we can deduce this structure from `InnerProductSpace π•œ E`, this instance may be not definitionally equal to some other β€œnatural” instance. So, we assume `[NormedSpace ℝ E]`. We also prove that functions to a `EuclideanSpace` are (higher) differentiable if and only if their components are. This follows from the corresponding fact for finite product of normed spaces, and from the equivalence of norms in finite dimensions. ## TODO The last part of the file should be generalized to `PiLp`. -/ noncomputable section open IsROrC Real Filter open scoped BigOperators Classical Topology section DerivInner variable {π•œ E F : Type*} [IsROrC π•œ] variable [NormedAddCommGroup E] [InnerProductSpace π•œ E] variable [NormedAddCommGroup F] [InnerProductSpace ℝ F] local notation "βŸͺ" x ", " y "⟫" => @inner π•œ _ _ x y variable (π•œ) [NormedSpace ℝ E] /-- Derivative of the inner product. -/ def fderivInnerClm (p : E Γ— E) : E Γ— E β†’L[ℝ] π•œ := isBoundedBilinearMap_inner.deriv p #align fderiv_inner_clm fderivInnerClm @[simp] theorem fderivInnerClm_apply (p x : E Γ— E) : fderivInnerClm π•œ p x = βŸͺp.1, x.2⟫ + βŸͺx.1, p.2⟫ := rfl #align fderiv_inner_clm_apply fderivInnerClm_apply variable {π•œ} -- porting note: Lean 3 magically switches back to `{π•œ}` here theorem contDiff_inner {n} : ContDiff ℝ n fun p : E Γ— E => βŸͺp.1, p.2⟫ := isBoundedBilinearMap_inner.contDiff #align cont_diff_inner contDiff_inner theorem contDiffAt_inner {p : E Γ— E} {n} : ContDiffAt ℝ n (fun p : E Γ— E => βŸͺp.1, p.2⟫) p := ContDiff.contDiffAt contDiff_inner #align cont_diff_at_inner contDiffAt_inner theorem differentiable_inner : Differentiable ℝ fun p : E Γ— E => βŸͺp.1, p.2⟫ := isBoundedBilinearMap_inner.differentiableAt #align differentiable_inner differentiable_inner variable (π•œ) variable {G : Type*} [NormedAddCommGroup G] [NormedSpace ℝ G] {f g : G β†’ E} {f' g' : G β†’L[ℝ] E} {s : Set G} {x : G} {n : β„•βˆž} theorem ContDiffWithinAt.inner (hf : ContDiffWithinAt ℝ n f s x) (hg : ContDiffWithinAt ℝ n g s x) : ContDiffWithinAt ℝ n (fun x => βŸͺf x, g x⟫) s x := contDiffAt_inner.comp_contDiffWithinAt x (hf.prod hg) #align cont_diff_within_at.inner ContDiffWithinAt.inner nonrec theorem ContDiffAt.inner (hf : ContDiffAt ℝ n f x) (hg : ContDiffAt ℝ n g x) : ContDiffAt ℝ n (fun x => βŸͺf x, g x⟫) x := hf.inner π•œ hg #align cont_diff_at.inner ContDiffAt.inner theorem ContDiffOn.inner (hf : ContDiffOn ℝ n f s) (hg : ContDiffOn ℝ n g s) : ContDiffOn ℝ n (fun x => βŸͺf x, g x⟫) s := fun x hx => (hf x hx).inner π•œ (hg x hx) #align cont_diff_on.inner ContDiffOn.inner theorem ContDiff.inner (hf : ContDiff ℝ n f) (hg : ContDiff ℝ n g) : ContDiff ℝ n fun x => βŸͺf x, g x⟫ := contDiff_inner.comp (hf.prod hg) #align cont_diff.inner ContDiff.inner theorem HasFDerivWithinAt.inner (hf : HasFDerivWithinAt f f' s x) (hg : HasFDerivWithinAt g g' s x) : HasFDerivWithinAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') s x := (isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp_hasFDerivWithinAt x (hf.prod hg) #align has_fderiv_within_at.inner HasFDerivWithinAt.inner theorem HasStrictFDerivAt.inner (hf : HasStrictFDerivAt f f' x) (hg : HasStrictFDerivAt g g' x) : HasStrictFDerivAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') x := (isBoundedBilinearMap_inner.hasStrictFDerivAt (f x, g x)).comp x (hf.prod hg) #align has_strict_fderiv_at.inner HasStrictFDerivAt.inner theorem HasFDerivAt.inner (hf : HasFDerivAt f f' x) (hg : HasFDerivAt g g' x) : HasFDerivAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') x := (isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp x (hf.prod hg) #align has_fderiv_at.inner HasFDerivAt.inner theorem HasDerivWithinAt.inner {f g : ℝ β†’ E} {f' g' : E} {s : Set ℝ} {x : ℝ} (hf : HasDerivWithinAt f f' s x) (hg : HasDerivWithinAt g g' s x) : HasDerivWithinAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) s x := by simpa using (hf.hasFDerivWithinAt.inner π•œ hg.hasFDerivWithinAt).hasDerivWithinAt #align has_deriv_within_at.inner HasDerivWithinAt.inner theorem HasDerivAt.inner {f g : ℝ β†’ E} {f' g' : E} {x : ℝ} : HasDerivAt f f' x β†’ HasDerivAt g g' x β†’ HasDerivAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) x := by simpa only [← hasDerivWithinAt_univ] using HasDerivWithinAt.inner π•œ #align has_deriv_at.inner HasDerivAt.inner theorem DifferentiableWithinAt.inner (hf : DifferentiableWithinAt ℝ f s x) (hg : DifferentiableWithinAt ℝ g s x) : DifferentiableWithinAt ℝ (fun x => βŸͺf x, g x⟫) s x := ((differentiable_inner _).hasFDerivAt.comp_hasFDerivWithinAt x (hf.prod hg).hasFDerivWithinAt).differentiableWithinAt #align differentiable_within_at.inner DifferentiableWithinAt.inner theorem DifferentiableAt.inner (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) : DifferentiableAt ℝ (fun x => βŸͺf x, g x⟫) x := (differentiable_inner _).comp x (hf.prod hg) #align differentiable_at.inner DifferentiableAt.inner theorem DifferentiableOn.inner (hf : DifferentiableOn ℝ f s) (hg : DifferentiableOn ℝ g s) : DifferentiableOn ℝ (fun x => βŸͺf x, g x⟫) s := fun x hx => (hf x hx).inner π•œ (hg x hx) #align differentiable_on.inner DifferentiableOn.inner theorem Differentiable.inner (hf : Differentiable ℝ f) (hg : Differentiable ℝ g) : Differentiable ℝ fun x => βŸͺf x, g x⟫ := fun x => (hf x).inner π•œ (hg x) #align differentiable.inner Differentiable.inner theorem fderiv_inner_apply (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) (y : G) : fderiv ℝ (fun t => βŸͺf t, g t⟫) x y = βŸͺf x, fderiv ℝ g x y⟫ + βŸͺfderiv ℝ f x y, g x⟫ := by rw [(hf.hasFDerivAt.inner π•œ hg.hasFDerivAt).fderiv]; rfl #align fderiv_inner_apply fderiv_inner_apply theorem deriv_inner_apply {f g : ℝ β†’ E} {x : ℝ} (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) : deriv (fun t => βŸͺf t, g t⟫) x = βŸͺf x, deriv g x⟫ + βŸͺderiv f x, g x⟫ := (hf.hasDerivAt.inner π•œ hg.hasDerivAt).deriv #align deriv_inner_apply deriv_inner_apply theorem contDiff_norm_sq : ContDiff ℝ n fun x : E => β€–xβ€– ^ 2 := by convert (reClm : π•œ β†’L[ℝ] ℝ).contDiff.comp ((contDiff_id (E := E)).inner π•œ (contDiff_id (E := E))) exact (inner_self_eq_norm_sq _).symm #align cont_diff_norm_sq contDiff_norm_sq theorem ContDiff.norm_sq (hf : ContDiff ℝ n f) : ContDiff ℝ n fun x => β€–f xβ€– ^ 2 := (contDiff_norm_sq π•œ).comp hf #align cont_diff.norm_sq ContDiff.norm_sq theorem ContDiffWithinAt.norm_sq (hf : ContDiffWithinAt ℝ n f s x) : ContDiffWithinAt ℝ n (fun y => β€–f yβ€– ^ 2) s x := (contDiff_norm_sq π•œ).contDiffAt.comp_contDiffWithinAt x hf #align cont_diff_within_at.norm_sq ContDiffWithinAt.norm_sq nonrec theorem ContDiffAt.norm_sq (hf : ContDiffAt ℝ n f x) : ContDiffAt ℝ n (β€–f Β·β€– ^ 2) x := hf.norm_sq π•œ #align cont_diff_at.norm_sq ContDiffAt.norm_sq theorem contDiffAt_norm {x : E} (hx : x β‰  0) : ContDiffAt ℝ n norm x := by have : β€–id xβ€– ^ 2 β‰  0 := pow_ne_zero 2 (norm_pos_iff.2 hx).ne' simpa only [id, sqrt_sq, norm_nonneg] using (contDiffAt_id.norm_sq π•œ).sqrt this #align cont_diff_at_norm contDiffAt_norm theorem ContDiffAt.norm (hf : ContDiffAt ℝ n f x) (h0 : f x β‰  0) : ContDiffAt ℝ n (fun y => β€–f yβ€–) x := (contDiffAt_norm π•œ h0).comp x hf #align cont_diff_at.norm ContDiffAt.norm theorem ContDiffAt.dist (hf : ContDiffAt ℝ n f x) (hg : ContDiffAt ℝ n g x) (hne : f x β‰  g x) : ContDiffAt ℝ n (fun y => dist (f y) (g y)) x := by simp only [dist_eq_norm] exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align cont_diff_at.dist ContDiffAt.dist theorem ContDiffWithinAt.norm (hf : ContDiffWithinAt ℝ n f s x) (h0 : f x β‰  0) : ContDiffWithinAt ℝ n (fun y => β€–f yβ€–) s x := (contDiffAt_norm π•œ h0).comp_contDiffWithinAt x hf #align cont_diff_within_at.norm ContDiffWithinAt.norm theorem ContDiffWithinAt.dist (hf : ContDiffWithinAt ℝ n f s x) (hg : ContDiffWithinAt ℝ n g s x) (hne : f x β‰  g x) : ContDiffWithinAt ℝ n (fun y => dist (f y) (g y)) s x := by simp only [dist_eq_norm]; exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align cont_diff_within_at.dist ContDiffWithinAt.dist theorem ContDiffOn.norm_sq (hf : ContDiffOn ℝ n f s) : ContDiffOn ℝ n (fun y => β€–f yβ€– ^ 2) s := fun x hx => (hf x hx).norm_sq π•œ #align cont_diff_on.norm_sq ContDiffOn.norm_sq theorem ContDiffOn.norm (hf : ContDiffOn ℝ n f s) (h0 : βˆ€ x ∈ s, f x β‰  0) : ContDiffOn ℝ n (fun y => β€–f yβ€–) s := fun x hx => (hf x hx).norm π•œ (h0 x hx) #align cont_diff_on.norm ContDiffOn.norm theorem ContDiffOn.dist (hf : ContDiffOn ℝ n f s) (hg : ContDiffOn ℝ n g s) (hne : βˆ€ x ∈ s, f x β‰  g x) : ContDiffOn ℝ n (fun y => dist (f y) (g y)) s := fun x hx => (hf x hx).dist π•œ (hg x hx) (hne x hx) #align cont_diff_on.dist ContDiffOn.dist theorem ContDiff.norm (hf : ContDiff ℝ n f) (h0 : βˆ€ x, f x β‰  0) : ContDiff ℝ n fun y => β€–f yβ€– := contDiff_iff_contDiffAt.2 fun x => hf.contDiffAt.norm π•œ (h0 x) #align cont_diff.norm ContDiff.norm theorem ContDiff.dist (hf : ContDiff ℝ n f) (hg : ContDiff ℝ n g) (hne : βˆ€ x, f x β‰  g x) : ContDiff ℝ n fun y => dist (f y) (g y) := contDiff_iff_contDiffAt.2 fun x => hf.contDiffAt.dist π•œ hg.contDiffAt (hne x) #align cont_diff.dist ContDiff.dist -- porting note: use `2 β€’` instead of `bit0` theorem hasStrictFDerivAt_norm_sq (x : F) : HasStrictFDerivAt (fun x => β€–xβ€– ^ 2) (2 β€’ (innerSL ℝ x)) x := by simp only [sq, ← @inner_self_eq_norm_mul_norm ℝ] convert (hasStrictFDerivAt_id x).inner ℝ (hasStrictFDerivAt_id x) ext y simp [two_smul, real_inner_comm] #align has_strict_fderiv_at_norm_sq hasStrictFDerivAt_norm_sqβ‚“ theorem HasFDerivAt.norm_sq {f : G β†’ F} {f' : G β†’L[ℝ] F} (hf : HasFDerivAt f f' x) : HasFDerivAt (β€–f Β·β€– ^ 2) (2 β€’ (innerSL ℝ (f x)).comp f') x := (hasStrictFDerivAt_norm_sq _).hasFDerivAt.comp x hf theorem HasDerivAt.norm_sq {f : ℝ β†’ F} {f' : F} {x : ℝ} (hf : HasDerivAt f f' x) : HasDerivAt (β€–f Β·β€– ^ 2) (2 * Inner.inner (f x) f') x := by simpa using hf.hasFDerivAt.norm_sq.hasDerivAt theorem HasFDerivWithinAt.norm_sq {f : G β†’ F} {f' : G β†’L[ℝ] F} (hf : HasFDerivWithinAt f f' s x) : HasFDerivWithinAt (β€–f Β·β€– ^ 2) (2 β€’ (innerSL ℝ (f x)).comp f') s x := (hasStrictFDerivAt_norm_sq _).hasFDerivAt.comp_hasFDerivWithinAt x hf theorem HasDerivWithinAt.norm_sq {f : ℝ β†’ F} {f' : F} {s : Set ℝ} {x : ℝ} (hf : HasDerivWithinAt f f' s x) : HasDerivWithinAt (β€–f Β·β€– ^ 2) (2 * Inner.inner (f x) f') s x := by simpa using hf.hasFDerivWithinAt.norm_sq.hasDerivWithinAt theorem DifferentiableAt.norm_sq (hf : DifferentiableAt ℝ f x) : DifferentiableAt ℝ (fun y => β€–f yβ€– ^ 2) x := ((contDiffAt_id.norm_sq π•œ).differentiableAt le_rfl).comp x hf #align differentiable_at.norm_sq DifferentiableAt.norm_sq theorem DifferentiableAt.norm (hf : DifferentiableAt ℝ f x) (h0 : f x β‰  0) : DifferentiableAt ℝ (fun y => β€–f yβ€–) x := ((contDiffAt_norm π•œ h0).differentiableAt le_rfl).comp x hf #align differentiable_at.norm DifferentiableAt.norm theorem DifferentiableAt.dist (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) (hne : f x β‰  g x) : DifferentiableAt ℝ (fun y => dist (f y) (g y)) x := by simp only [dist_eq_norm]; exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align differentiable_at.dist DifferentiableAt.dist theorem Differentiable.norm_sq (hf : Differentiable ℝ f) : Differentiable ℝ fun y => β€–f yβ€– ^ 2 := fun x => (hf x).norm_sq π•œ #align differentiable.norm_sq Differentiable.norm_sq theorem Differentiable.norm (hf : Differentiable ℝ f) (h0 : βˆ€ x, f x β‰  0) : Differentiable ℝ fun y => β€–f yβ€– := fun x => (hf x).norm π•œ (h0 x) #align differentiable.norm Differentiable.norm theorem Differentiable.dist (hf : Differentiable ℝ f) (hg : Differentiable ℝ g) (hne : βˆ€ x, f x β‰  g x) : Differentiable ℝ fun y => dist (f y) (g y) := fun x => (hf x).dist π•œ (hg x) (hne x) #align differentiable.dist Differentiable.dist theorem DifferentiableWithinAt.norm_sq (hf : DifferentiableWithinAt ℝ f s x) : DifferentiableWithinAt ℝ (fun y => β€–f yβ€– ^ 2) s x := ((contDiffAt_id.norm_sq π•œ).differentiableAt le_rfl).comp_differentiableWithinAt x hf #align differentiable_within_at.norm_sq DifferentiableWithinAt.norm_sq theorem DifferentiableWithinAt.norm (hf : DifferentiableWithinAt ℝ f s x) (h0 : f x β‰  0) : DifferentiableWithinAt ℝ (fun y => β€–f yβ€–) s x := ((contDiffAt_id.norm π•œ h0).differentiableAt le_rfl).comp_differentiableWithinAt x hf #align differentiable_within_at.norm DifferentiableWithinAt.norm theorem DifferentiableWithinAt.dist (hf : DifferentiableWithinAt ℝ f s x) (hg : DifferentiableWithinAt ℝ g s x) (hne : f x β‰  g x) : DifferentiableWithinAt ℝ (fun y => dist (f y) (g y)) s x := by simp only [dist_eq_norm] exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align differentiable_within_at.dist DifferentiableWithinAt.dist theorem DifferentiableOn.norm_sq (hf : DifferentiableOn ℝ f s) : DifferentiableOn ℝ (fun y => β€–f yβ€– ^ 2) s := fun x hx => (hf x hx).norm_sq π•œ #align differentiable_on.norm_sq DifferentiableOn.norm_sq theorem DifferentiableOn.norm (hf : DifferentiableOn ℝ f s) (h0 : βˆ€ x ∈ s, f x β‰  0) : DifferentiableOn ℝ (fun y => β€–f yβ€–) s := fun x hx => (hf x hx).norm π•œ (h0 x hx) #align differentiable_on.norm DifferentiableOn.norm theorem DifferentiableOn.dist (hf : DifferentiableOn ℝ f s) (hg : DifferentiableOn ℝ g s) (hne : βˆ€ x ∈ s, f x β‰  g x) : DifferentiableOn ℝ (fun y => dist (f y) (g y)) s := fun x hx => (hf x hx).dist π•œ (hg x hx) (hne x hx) #align differentiable_on.dist DifferentiableOn.dist end DerivInner section PiLike open ContinuousLinearMap variable {π•œ ΞΉ H : Type*} [IsROrC π•œ] [NormedAddCommGroup H] [NormedSpace π•œ H] [Fintype ΞΉ] {f : H β†’ EuclideanSpace π•œ ΞΉ} {f' : H β†’L[π•œ] EuclideanSpace π•œ ΞΉ} {t : Set H} {y : H} theorem differentiableWithinAt_euclidean : DifferentiableWithinAt π•œ f t y ↔ βˆ€ i, DifferentiableWithinAt π•œ (fun x => f x i) t y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_differentiableWithinAt_iff, differentiableWithinAt_pi] rfl #align differentiable_within_at_euclidean differentiableWithinAt_euclidean theorem differentiableAt_euclidean : DifferentiableAt π•œ f y ↔ βˆ€ i, DifferentiableAt π•œ (fun x => f x i) y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_differentiableAt_iff, differentiableAt_pi] rfl #align differentiable_at_euclidean differentiableAt_euclidean theorem differentiableOn_euclidean : DifferentiableOn π•œ f t ↔ βˆ€ i, DifferentiableOn π•œ (fun x => f x i) t := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_differentiableOn_iff, differentiableOn_pi] rfl #align differentiable_on_euclidean differentiableOn_euclidean theorem differentiable_euclidean : Differentiable π•œ f ↔ βˆ€ i, Differentiable π•œ fun x => f x i := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_differentiable_iff, differentiable_pi] rfl #align differentiable_euclidean differentiable_euclidean theorem hasStrictFDerivAt_euclidean : HasStrictFDerivAt f f' y ↔ βˆ€ i, HasStrictFDerivAt (fun x => f x i) (EuclideanSpace.proj i ∘L f') y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_hasStrictFDerivAt_iff, hasStrictFDerivAt_pi'] rfl #align has_strict_fderiv_at_euclidean hasStrictFDerivAt_euclidean theorem hasFDerivWithinAt_euclidean : HasFDerivWithinAt f f' t y ↔ βˆ€ i, HasFDerivWithinAt (fun x => f x i) (EuclideanSpace.proj i ∘L f') t y := by
rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_hasFDerivWithinAt_iff, hasFDerivWithinAt_pi']
theorem hasFDerivWithinAt_euclidean : HasFDerivWithinAt f f' t y ↔ βˆ€ i, HasFDerivWithinAt (fun x => f x i) (EuclideanSpace.proj i ∘L f') t y := by
Mathlib.Analysis.InnerProductSpace.Calculus.342_0.6FECEGgqdb67QLM
theorem hasFDerivWithinAt_euclidean : HasFDerivWithinAt f f' t y ↔ βˆ€ i, HasFDerivWithinAt (fun x => f x i) (EuclideanSpace.proj i ∘L f') t y
Mathlib_Analysis_InnerProductSpace_Calculus
π•œ : Type u_1 ΞΉ : Type u_2 H : Type u_3 inst✝³ : IsROrC π•œ inst✝² : NormedAddCommGroup H inst✝¹ : NormedSpace π•œ H inst✝ : Fintype ΞΉ f : H β†’ EuclideanSpace π•œ ΞΉ f' : H β†’L[π•œ] EuclideanSpace π•œ ΞΉ t : Set H y : H ⊒ (βˆ€ (i : ΞΉ), HasFDerivWithinAt (fun x => (⇑(EuclideanSpace.equiv ΞΉ π•œ) ∘ f) x i) (comp (proj i) (comp (↑(EuclideanSpace.equiv ΞΉ π•œ)) f')) t y) ↔ βˆ€ (i : ΞΉ), HasFDerivWithinAt (fun x => f x i) (comp (EuclideanSpace.proj i) f') t y
/- Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ import Mathlib.Analysis.InnerProductSpace.PiL2 import Mathlib.Analysis.SpecialFunctions.Sqrt import Mathlib.Analysis.NormedSpace.HomeomorphBall #align_import analysis.inner_product_space.calculus from "leanprover-community/mathlib"@"f9dd3204df14a0749cd456fac1e6849dfe7d2b88" /-! # Calculus in inner product spaces In this file we prove that the inner product and square of the norm in an inner space are infinitely `ℝ`-smooth. In order to state these results, we need a `NormedSpace ℝ E` instance. Though we can deduce this structure from `InnerProductSpace π•œ E`, this instance may be not definitionally equal to some other β€œnatural” instance. So, we assume `[NormedSpace ℝ E]`. We also prove that functions to a `EuclideanSpace` are (higher) differentiable if and only if their components are. This follows from the corresponding fact for finite product of normed spaces, and from the equivalence of norms in finite dimensions. ## TODO The last part of the file should be generalized to `PiLp`. -/ noncomputable section open IsROrC Real Filter open scoped BigOperators Classical Topology section DerivInner variable {π•œ E F : Type*} [IsROrC π•œ] variable [NormedAddCommGroup E] [InnerProductSpace π•œ E] variable [NormedAddCommGroup F] [InnerProductSpace ℝ F] local notation "βŸͺ" x ", " y "⟫" => @inner π•œ _ _ x y variable (π•œ) [NormedSpace ℝ E] /-- Derivative of the inner product. -/ def fderivInnerClm (p : E Γ— E) : E Γ— E β†’L[ℝ] π•œ := isBoundedBilinearMap_inner.deriv p #align fderiv_inner_clm fderivInnerClm @[simp] theorem fderivInnerClm_apply (p x : E Γ— E) : fderivInnerClm π•œ p x = βŸͺp.1, x.2⟫ + βŸͺx.1, p.2⟫ := rfl #align fderiv_inner_clm_apply fderivInnerClm_apply variable {π•œ} -- porting note: Lean 3 magically switches back to `{π•œ}` here theorem contDiff_inner {n} : ContDiff ℝ n fun p : E Γ— E => βŸͺp.1, p.2⟫ := isBoundedBilinearMap_inner.contDiff #align cont_diff_inner contDiff_inner theorem contDiffAt_inner {p : E Γ— E} {n} : ContDiffAt ℝ n (fun p : E Γ— E => βŸͺp.1, p.2⟫) p := ContDiff.contDiffAt contDiff_inner #align cont_diff_at_inner contDiffAt_inner theorem differentiable_inner : Differentiable ℝ fun p : E Γ— E => βŸͺp.1, p.2⟫ := isBoundedBilinearMap_inner.differentiableAt #align differentiable_inner differentiable_inner variable (π•œ) variable {G : Type*} [NormedAddCommGroup G] [NormedSpace ℝ G] {f g : G β†’ E} {f' g' : G β†’L[ℝ] E} {s : Set G} {x : G} {n : β„•βˆž} theorem ContDiffWithinAt.inner (hf : ContDiffWithinAt ℝ n f s x) (hg : ContDiffWithinAt ℝ n g s x) : ContDiffWithinAt ℝ n (fun x => βŸͺf x, g x⟫) s x := contDiffAt_inner.comp_contDiffWithinAt x (hf.prod hg) #align cont_diff_within_at.inner ContDiffWithinAt.inner nonrec theorem ContDiffAt.inner (hf : ContDiffAt ℝ n f x) (hg : ContDiffAt ℝ n g x) : ContDiffAt ℝ n (fun x => βŸͺf x, g x⟫) x := hf.inner π•œ hg #align cont_diff_at.inner ContDiffAt.inner theorem ContDiffOn.inner (hf : ContDiffOn ℝ n f s) (hg : ContDiffOn ℝ n g s) : ContDiffOn ℝ n (fun x => βŸͺf x, g x⟫) s := fun x hx => (hf x hx).inner π•œ (hg x hx) #align cont_diff_on.inner ContDiffOn.inner theorem ContDiff.inner (hf : ContDiff ℝ n f) (hg : ContDiff ℝ n g) : ContDiff ℝ n fun x => βŸͺf x, g x⟫ := contDiff_inner.comp (hf.prod hg) #align cont_diff.inner ContDiff.inner theorem HasFDerivWithinAt.inner (hf : HasFDerivWithinAt f f' s x) (hg : HasFDerivWithinAt g g' s x) : HasFDerivWithinAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') s x := (isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp_hasFDerivWithinAt x (hf.prod hg) #align has_fderiv_within_at.inner HasFDerivWithinAt.inner theorem HasStrictFDerivAt.inner (hf : HasStrictFDerivAt f f' x) (hg : HasStrictFDerivAt g g' x) : HasStrictFDerivAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') x := (isBoundedBilinearMap_inner.hasStrictFDerivAt (f x, g x)).comp x (hf.prod hg) #align has_strict_fderiv_at.inner HasStrictFDerivAt.inner theorem HasFDerivAt.inner (hf : HasFDerivAt f f' x) (hg : HasFDerivAt g g' x) : HasFDerivAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') x := (isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp x (hf.prod hg) #align has_fderiv_at.inner HasFDerivAt.inner theorem HasDerivWithinAt.inner {f g : ℝ β†’ E} {f' g' : E} {s : Set ℝ} {x : ℝ} (hf : HasDerivWithinAt f f' s x) (hg : HasDerivWithinAt g g' s x) : HasDerivWithinAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) s x := by simpa using (hf.hasFDerivWithinAt.inner π•œ hg.hasFDerivWithinAt).hasDerivWithinAt #align has_deriv_within_at.inner HasDerivWithinAt.inner theorem HasDerivAt.inner {f g : ℝ β†’ E} {f' g' : E} {x : ℝ} : HasDerivAt f f' x β†’ HasDerivAt g g' x β†’ HasDerivAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) x := by simpa only [← hasDerivWithinAt_univ] using HasDerivWithinAt.inner π•œ #align has_deriv_at.inner HasDerivAt.inner theorem DifferentiableWithinAt.inner (hf : DifferentiableWithinAt ℝ f s x) (hg : DifferentiableWithinAt ℝ g s x) : DifferentiableWithinAt ℝ (fun x => βŸͺf x, g x⟫) s x := ((differentiable_inner _).hasFDerivAt.comp_hasFDerivWithinAt x (hf.prod hg).hasFDerivWithinAt).differentiableWithinAt #align differentiable_within_at.inner DifferentiableWithinAt.inner theorem DifferentiableAt.inner (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) : DifferentiableAt ℝ (fun x => βŸͺf x, g x⟫) x := (differentiable_inner _).comp x (hf.prod hg) #align differentiable_at.inner DifferentiableAt.inner theorem DifferentiableOn.inner (hf : DifferentiableOn ℝ f s) (hg : DifferentiableOn ℝ g s) : DifferentiableOn ℝ (fun x => βŸͺf x, g x⟫) s := fun x hx => (hf x hx).inner π•œ (hg x hx) #align differentiable_on.inner DifferentiableOn.inner theorem Differentiable.inner (hf : Differentiable ℝ f) (hg : Differentiable ℝ g) : Differentiable ℝ fun x => βŸͺf x, g x⟫ := fun x => (hf x).inner π•œ (hg x) #align differentiable.inner Differentiable.inner theorem fderiv_inner_apply (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) (y : G) : fderiv ℝ (fun t => βŸͺf t, g t⟫) x y = βŸͺf x, fderiv ℝ g x y⟫ + βŸͺfderiv ℝ f x y, g x⟫ := by rw [(hf.hasFDerivAt.inner π•œ hg.hasFDerivAt).fderiv]; rfl #align fderiv_inner_apply fderiv_inner_apply theorem deriv_inner_apply {f g : ℝ β†’ E} {x : ℝ} (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) : deriv (fun t => βŸͺf t, g t⟫) x = βŸͺf x, deriv g x⟫ + βŸͺderiv f x, g x⟫ := (hf.hasDerivAt.inner π•œ hg.hasDerivAt).deriv #align deriv_inner_apply deriv_inner_apply theorem contDiff_norm_sq : ContDiff ℝ n fun x : E => β€–xβ€– ^ 2 := by convert (reClm : π•œ β†’L[ℝ] ℝ).contDiff.comp ((contDiff_id (E := E)).inner π•œ (contDiff_id (E := E))) exact (inner_self_eq_norm_sq _).symm #align cont_diff_norm_sq contDiff_norm_sq theorem ContDiff.norm_sq (hf : ContDiff ℝ n f) : ContDiff ℝ n fun x => β€–f xβ€– ^ 2 := (contDiff_norm_sq π•œ).comp hf #align cont_diff.norm_sq ContDiff.norm_sq theorem ContDiffWithinAt.norm_sq (hf : ContDiffWithinAt ℝ n f s x) : ContDiffWithinAt ℝ n (fun y => β€–f yβ€– ^ 2) s x := (contDiff_norm_sq π•œ).contDiffAt.comp_contDiffWithinAt x hf #align cont_diff_within_at.norm_sq ContDiffWithinAt.norm_sq nonrec theorem ContDiffAt.norm_sq (hf : ContDiffAt ℝ n f x) : ContDiffAt ℝ n (β€–f Β·β€– ^ 2) x := hf.norm_sq π•œ #align cont_diff_at.norm_sq ContDiffAt.norm_sq theorem contDiffAt_norm {x : E} (hx : x β‰  0) : ContDiffAt ℝ n norm x := by have : β€–id xβ€– ^ 2 β‰  0 := pow_ne_zero 2 (norm_pos_iff.2 hx).ne' simpa only [id, sqrt_sq, norm_nonneg] using (contDiffAt_id.norm_sq π•œ).sqrt this #align cont_diff_at_norm contDiffAt_norm theorem ContDiffAt.norm (hf : ContDiffAt ℝ n f x) (h0 : f x β‰  0) : ContDiffAt ℝ n (fun y => β€–f yβ€–) x := (contDiffAt_norm π•œ h0).comp x hf #align cont_diff_at.norm ContDiffAt.norm theorem ContDiffAt.dist (hf : ContDiffAt ℝ n f x) (hg : ContDiffAt ℝ n g x) (hne : f x β‰  g x) : ContDiffAt ℝ n (fun y => dist (f y) (g y)) x := by simp only [dist_eq_norm] exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align cont_diff_at.dist ContDiffAt.dist theorem ContDiffWithinAt.norm (hf : ContDiffWithinAt ℝ n f s x) (h0 : f x β‰  0) : ContDiffWithinAt ℝ n (fun y => β€–f yβ€–) s x := (contDiffAt_norm π•œ h0).comp_contDiffWithinAt x hf #align cont_diff_within_at.norm ContDiffWithinAt.norm theorem ContDiffWithinAt.dist (hf : ContDiffWithinAt ℝ n f s x) (hg : ContDiffWithinAt ℝ n g s x) (hne : f x β‰  g x) : ContDiffWithinAt ℝ n (fun y => dist (f y) (g y)) s x := by simp only [dist_eq_norm]; exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align cont_diff_within_at.dist ContDiffWithinAt.dist theorem ContDiffOn.norm_sq (hf : ContDiffOn ℝ n f s) : ContDiffOn ℝ n (fun y => β€–f yβ€– ^ 2) s := fun x hx => (hf x hx).norm_sq π•œ #align cont_diff_on.norm_sq ContDiffOn.norm_sq theorem ContDiffOn.norm (hf : ContDiffOn ℝ n f s) (h0 : βˆ€ x ∈ s, f x β‰  0) : ContDiffOn ℝ n (fun y => β€–f yβ€–) s := fun x hx => (hf x hx).norm π•œ (h0 x hx) #align cont_diff_on.norm ContDiffOn.norm theorem ContDiffOn.dist (hf : ContDiffOn ℝ n f s) (hg : ContDiffOn ℝ n g s) (hne : βˆ€ x ∈ s, f x β‰  g x) : ContDiffOn ℝ n (fun y => dist (f y) (g y)) s := fun x hx => (hf x hx).dist π•œ (hg x hx) (hne x hx) #align cont_diff_on.dist ContDiffOn.dist theorem ContDiff.norm (hf : ContDiff ℝ n f) (h0 : βˆ€ x, f x β‰  0) : ContDiff ℝ n fun y => β€–f yβ€– := contDiff_iff_contDiffAt.2 fun x => hf.contDiffAt.norm π•œ (h0 x) #align cont_diff.norm ContDiff.norm theorem ContDiff.dist (hf : ContDiff ℝ n f) (hg : ContDiff ℝ n g) (hne : βˆ€ x, f x β‰  g x) : ContDiff ℝ n fun y => dist (f y) (g y) := contDiff_iff_contDiffAt.2 fun x => hf.contDiffAt.dist π•œ hg.contDiffAt (hne x) #align cont_diff.dist ContDiff.dist -- porting note: use `2 β€’` instead of `bit0` theorem hasStrictFDerivAt_norm_sq (x : F) : HasStrictFDerivAt (fun x => β€–xβ€– ^ 2) (2 β€’ (innerSL ℝ x)) x := by simp only [sq, ← @inner_self_eq_norm_mul_norm ℝ] convert (hasStrictFDerivAt_id x).inner ℝ (hasStrictFDerivAt_id x) ext y simp [two_smul, real_inner_comm] #align has_strict_fderiv_at_norm_sq hasStrictFDerivAt_norm_sqβ‚“ theorem HasFDerivAt.norm_sq {f : G β†’ F} {f' : G β†’L[ℝ] F} (hf : HasFDerivAt f f' x) : HasFDerivAt (β€–f Β·β€– ^ 2) (2 β€’ (innerSL ℝ (f x)).comp f') x := (hasStrictFDerivAt_norm_sq _).hasFDerivAt.comp x hf theorem HasDerivAt.norm_sq {f : ℝ β†’ F} {f' : F} {x : ℝ} (hf : HasDerivAt f f' x) : HasDerivAt (β€–f Β·β€– ^ 2) (2 * Inner.inner (f x) f') x := by simpa using hf.hasFDerivAt.norm_sq.hasDerivAt theorem HasFDerivWithinAt.norm_sq {f : G β†’ F} {f' : G β†’L[ℝ] F} (hf : HasFDerivWithinAt f f' s x) : HasFDerivWithinAt (β€–f Β·β€– ^ 2) (2 β€’ (innerSL ℝ (f x)).comp f') s x := (hasStrictFDerivAt_norm_sq _).hasFDerivAt.comp_hasFDerivWithinAt x hf theorem HasDerivWithinAt.norm_sq {f : ℝ β†’ F} {f' : F} {s : Set ℝ} {x : ℝ} (hf : HasDerivWithinAt f f' s x) : HasDerivWithinAt (β€–f Β·β€– ^ 2) (2 * Inner.inner (f x) f') s x := by simpa using hf.hasFDerivWithinAt.norm_sq.hasDerivWithinAt theorem DifferentiableAt.norm_sq (hf : DifferentiableAt ℝ f x) : DifferentiableAt ℝ (fun y => β€–f yβ€– ^ 2) x := ((contDiffAt_id.norm_sq π•œ).differentiableAt le_rfl).comp x hf #align differentiable_at.norm_sq DifferentiableAt.norm_sq theorem DifferentiableAt.norm (hf : DifferentiableAt ℝ f x) (h0 : f x β‰  0) : DifferentiableAt ℝ (fun y => β€–f yβ€–) x := ((contDiffAt_norm π•œ h0).differentiableAt le_rfl).comp x hf #align differentiable_at.norm DifferentiableAt.norm theorem DifferentiableAt.dist (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) (hne : f x β‰  g x) : DifferentiableAt ℝ (fun y => dist (f y) (g y)) x := by simp only [dist_eq_norm]; exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align differentiable_at.dist DifferentiableAt.dist theorem Differentiable.norm_sq (hf : Differentiable ℝ f) : Differentiable ℝ fun y => β€–f yβ€– ^ 2 := fun x => (hf x).norm_sq π•œ #align differentiable.norm_sq Differentiable.norm_sq theorem Differentiable.norm (hf : Differentiable ℝ f) (h0 : βˆ€ x, f x β‰  0) : Differentiable ℝ fun y => β€–f yβ€– := fun x => (hf x).norm π•œ (h0 x) #align differentiable.norm Differentiable.norm theorem Differentiable.dist (hf : Differentiable ℝ f) (hg : Differentiable ℝ g) (hne : βˆ€ x, f x β‰  g x) : Differentiable ℝ fun y => dist (f y) (g y) := fun x => (hf x).dist π•œ (hg x) (hne x) #align differentiable.dist Differentiable.dist theorem DifferentiableWithinAt.norm_sq (hf : DifferentiableWithinAt ℝ f s x) : DifferentiableWithinAt ℝ (fun y => β€–f yβ€– ^ 2) s x := ((contDiffAt_id.norm_sq π•œ).differentiableAt le_rfl).comp_differentiableWithinAt x hf #align differentiable_within_at.norm_sq DifferentiableWithinAt.norm_sq theorem DifferentiableWithinAt.norm (hf : DifferentiableWithinAt ℝ f s x) (h0 : f x β‰  0) : DifferentiableWithinAt ℝ (fun y => β€–f yβ€–) s x := ((contDiffAt_id.norm π•œ h0).differentiableAt le_rfl).comp_differentiableWithinAt x hf #align differentiable_within_at.norm DifferentiableWithinAt.norm theorem DifferentiableWithinAt.dist (hf : DifferentiableWithinAt ℝ f s x) (hg : DifferentiableWithinAt ℝ g s x) (hne : f x β‰  g x) : DifferentiableWithinAt ℝ (fun y => dist (f y) (g y)) s x := by simp only [dist_eq_norm] exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align differentiable_within_at.dist DifferentiableWithinAt.dist theorem DifferentiableOn.norm_sq (hf : DifferentiableOn ℝ f s) : DifferentiableOn ℝ (fun y => β€–f yβ€– ^ 2) s := fun x hx => (hf x hx).norm_sq π•œ #align differentiable_on.norm_sq DifferentiableOn.norm_sq theorem DifferentiableOn.norm (hf : DifferentiableOn ℝ f s) (h0 : βˆ€ x ∈ s, f x β‰  0) : DifferentiableOn ℝ (fun y => β€–f yβ€–) s := fun x hx => (hf x hx).norm π•œ (h0 x hx) #align differentiable_on.norm DifferentiableOn.norm theorem DifferentiableOn.dist (hf : DifferentiableOn ℝ f s) (hg : DifferentiableOn ℝ g s) (hne : βˆ€ x ∈ s, f x β‰  g x) : DifferentiableOn ℝ (fun y => dist (f y) (g y)) s := fun x hx => (hf x hx).dist π•œ (hg x hx) (hne x hx) #align differentiable_on.dist DifferentiableOn.dist end DerivInner section PiLike open ContinuousLinearMap variable {π•œ ΞΉ H : Type*} [IsROrC π•œ] [NormedAddCommGroup H] [NormedSpace π•œ H] [Fintype ΞΉ] {f : H β†’ EuclideanSpace π•œ ΞΉ} {f' : H β†’L[π•œ] EuclideanSpace π•œ ΞΉ} {t : Set H} {y : H} theorem differentiableWithinAt_euclidean : DifferentiableWithinAt π•œ f t y ↔ βˆ€ i, DifferentiableWithinAt π•œ (fun x => f x i) t y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_differentiableWithinAt_iff, differentiableWithinAt_pi] rfl #align differentiable_within_at_euclidean differentiableWithinAt_euclidean theorem differentiableAt_euclidean : DifferentiableAt π•œ f y ↔ βˆ€ i, DifferentiableAt π•œ (fun x => f x i) y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_differentiableAt_iff, differentiableAt_pi] rfl #align differentiable_at_euclidean differentiableAt_euclidean theorem differentiableOn_euclidean : DifferentiableOn π•œ f t ↔ βˆ€ i, DifferentiableOn π•œ (fun x => f x i) t := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_differentiableOn_iff, differentiableOn_pi] rfl #align differentiable_on_euclidean differentiableOn_euclidean theorem differentiable_euclidean : Differentiable π•œ f ↔ βˆ€ i, Differentiable π•œ fun x => f x i := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_differentiable_iff, differentiable_pi] rfl #align differentiable_euclidean differentiable_euclidean theorem hasStrictFDerivAt_euclidean : HasStrictFDerivAt f f' y ↔ βˆ€ i, HasStrictFDerivAt (fun x => f x i) (EuclideanSpace.proj i ∘L f') y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_hasStrictFDerivAt_iff, hasStrictFDerivAt_pi'] rfl #align has_strict_fderiv_at_euclidean hasStrictFDerivAt_euclidean theorem hasFDerivWithinAt_euclidean : HasFDerivWithinAt f f' t y ↔ βˆ€ i, HasFDerivWithinAt (fun x => f x i) (EuclideanSpace.proj i ∘L f') t y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_hasFDerivWithinAt_iff, hasFDerivWithinAt_pi']
rfl
theorem hasFDerivWithinAt_euclidean : HasFDerivWithinAt f f' t y ↔ βˆ€ i, HasFDerivWithinAt (fun x => f x i) (EuclideanSpace.proj i ∘L f') t y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_hasFDerivWithinAt_iff, hasFDerivWithinAt_pi']
Mathlib.Analysis.InnerProductSpace.Calculus.342_0.6FECEGgqdb67QLM
theorem hasFDerivWithinAt_euclidean : HasFDerivWithinAt f f' t y ↔ βˆ€ i, HasFDerivWithinAt (fun x => f x i) (EuclideanSpace.proj i ∘L f') t y
Mathlib_Analysis_InnerProductSpace_Calculus
π•œ : Type u_1 ΞΉ : Type u_2 H : Type u_3 inst✝³ : IsROrC π•œ inst✝² : NormedAddCommGroup H inst✝¹ : NormedSpace π•œ H inst✝ : Fintype ΞΉ f : H β†’ EuclideanSpace π•œ ΞΉ f' : H β†’L[π•œ] EuclideanSpace π•œ ΞΉ t : Set H y : H n : β„•βˆž ⊒ ContDiffWithinAt π•œ n f t y ↔ βˆ€ (i : ΞΉ), ContDiffWithinAt π•œ n (fun x => f x i) t y
/- Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ import Mathlib.Analysis.InnerProductSpace.PiL2 import Mathlib.Analysis.SpecialFunctions.Sqrt import Mathlib.Analysis.NormedSpace.HomeomorphBall #align_import analysis.inner_product_space.calculus from "leanprover-community/mathlib"@"f9dd3204df14a0749cd456fac1e6849dfe7d2b88" /-! # Calculus in inner product spaces In this file we prove that the inner product and square of the norm in an inner space are infinitely `ℝ`-smooth. In order to state these results, we need a `NormedSpace ℝ E` instance. Though we can deduce this structure from `InnerProductSpace π•œ E`, this instance may be not definitionally equal to some other β€œnatural” instance. So, we assume `[NormedSpace ℝ E]`. We also prove that functions to a `EuclideanSpace` are (higher) differentiable if and only if their components are. This follows from the corresponding fact for finite product of normed spaces, and from the equivalence of norms in finite dimensions. ## TODO The last part of the file should be generalized to `PiLp`. -/ noncomputable section open IsROrC Real Filter open scoped BigOperators Classical Topology section DerivInner variable {π•œ E F : Type*} [IsROrC π•œ] variable [NormedAddCommGroup E] [InnerProductSpace π•œ E] variable [NormedAddCommGroup F] [InnerProductSpace ℝ F] local notation "βŸͺ" x ", " y "⟫" => @inner π•œ _ _ x y variable (π•œ) [NormedSpace ℝ E] /-- Derivative of the inner product. -/ def fderivInnerClm (p : E Γ— E) : E Γ— E β†’L[ℝ] π•œ := isBoundedBilinearMap_inner.deriv p #align fderiv_inner_clm fderivInnerClm @[simp] theorem fderivInnerClm_apply (p x : E Γ— E) : fderivInnerClm π•œ p x = βŸͺp.1, x.2⟫ + βŸͺx.1, p.2⟫ := rfl #align fderiv_inner_clm_apply fderivInnerClm_apply variable {π•œ} -- porting note: Lean 3 magically switches back to `{π•œ}` here theorem contDiff_inner {n} : ContDiff ℝ n fun p : E Γ— E => βŸͺp.1, p.2⟫ := isBoundedBilinearMap_inner.contDiff #align cont_diff_inner contDiff_inner theorem contDiffAt_inner {p : E Γ— E} {n} : ContDiffAt ℝ n (fun p : E Γ— E => βŸͺp.1, p.2⟫) p := ContDiff.contDiffAt contDiff_inner #align cont_diff_at_inner contDiffAt_inner theorem differentiable_inner : Differentiable ℝ fun p : E Γ— E => βŸͺp.1, p.2⟫ := isBoundedBilinearMap_inner.differentiableAt #align differentiable_inner differentiable_inner variable (π•œ) variable {G : Type*} [NormedAddCommGroup G] [NormedSpace ℝ G] {f g : G β†’ E} {f' g' : G β†’L[ℝ] E} {s : Set G} {x : G} {n : β„•βˆž} theorem ContDiffWithinAt.inner (hf : ContDiffWithinAt ℝ n f s x) (hg : ContDiffWithinAt ℝ n g s x) : ContDiffWithinAt ℝ n (fun x => βŸͺf x, g x⟫) s x := contDiffAt_inner.comp_contDiffWithinAt x (hf.prod hg) #align cont_diff_within_at.inner ContDiffWithinAt.inner nonrec theorem ContDiffAt.inner (hf : ContDiffAt ℝ n f x) (hg : ContDiffAt ℝ n g x) : ContDiffAt ℝ n (fun x => βŸͺf x, g x⟫) x := hf.inner π•œ hg #align cont_diff_at.inner ContDiffAt.inner theorem ContDiffOn.inner (hf : ContDiffOn ℝ n f s) (hg : ContDiffOn ℝ n g s) : ContDiffOn ℝ n (fun x => βŸͺf x, g x⟫) s := fun x hx => (hf x hx).inner π•œ (hg x hx) #align cont_diff_on.inner ContDiffOn.inner theorem ContDiff.inner (hf : ContDiff ℝ n f) (hg : ContDiff ℝ n g) : ContDiff ℝ n fun x => βŸͺf x, g x⟫ := contDiff_inner.comp (hf.prod hg) #align cont_diff.inner ContDiff.inner theorem HasFDerivWithinAt.inner (hf : HasFDerivWithinAt f f' s x) (hg : HasFDerivWithinAt g g' s x) : HasFDerivWithinAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') s x := (isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp_hasFDerivWithinAt x (hf.prod hg) #align has_fderiv_within_at.inner HasFDerivWithinAt.inner theorem HasStrictFDerivAt.inner (hf : HasStrictFDerivAt f f' x) (hg : HasStrictFDerivAt g g' x) : HasStrictFDerivAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') x := (isBoundedBilinearMap_inner.hasStrictFDerivAt (f x, g x)).comp x (hf.prod hg) #align has_strict_fderiv_at.inner HasStrictFDerivAt.inner theorem HasFDerivAt.inner (hf : HasFDerivAt f f' x) (hg : HasFDerivAt g g' x) : HasFDerivAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') x := (isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp x (hf.prod hg) #align has_fderiv_at.inner HasFDerivAt.inner theorem HasDerivWithinAt.inner {f g : ℝ β†’ E} {f' g' : E} {s : Set ℝ} {x : ℝ} (hf : HasDerivWithinAt f f' s x) (hg : HasDerivWithinAt g g' s x) : HasDerivWithinAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) s x := by simpa using (hf.hasFDerivWithinAt.inner π•œ hg.hasFDerivWithinAt).hasDerivWithinAt #align has_deriv_within_at.inner HasDerivWithinAt.inner theorem HasDerivAt.inner {f g : ℝ β†’ E} {f' g' : E} {x : ℝ} : HasDerivAt f f' x β†’ HasDerivAt g g' x β†’ HasDerivAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) x := by simpa only [← hasDerivWithinAt_univ] using HasDerivWithinAt.inner π•œ #align has_deriv_at.inner HasDerivAt.inner theorem DifferentiableWithinAt.inner (hf : DifferentiableWithinAt ℝ f s x) (hg : DifferentiableWithinAt ℝ g s x) : DifferentiableWithinAt ℝ (fun x => βŸͺf x, g x⟫) s x := ((differentiable_inner _).hasFDerivAt.comp_hasFDerivWithinAt x (hf.prod hg).hasFDerivWithinAt).differentiableWithinAt #align differentiable_within_at.inner DifferentiableWithinAt.inner theorem DifferentiableAt.inner (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) : DifferentiableAt ℝ (fun x => βŸͺf x, g x⟫) x := (differentiable_inner _).comp x (hf.prod hg) #align differentiable_at.inner DifferentiableAt.inner theorem DifferentiableOn.inner (hf : DifferentiableOn ℝ f s) (hg : DifferentiableOn ℝ g s) : DifferentiableOn ℝ (fun x => βŸͺf x, g x⟫) s := fun x hx => (hf x hx).inner π•œ (hg x hx) #align differentiable_on.inner DifferentiableOn.inner theorem Differentiable.inner (hf : Differentiable ℝ f) (hg : Differentiable ℝ g) : Differentiable ℝ fun x => βŸͺf x, g x⟫ := fun x => (hf x).inner π•œ (hg x) #align differentiable.inner Differentiable.inner theorem fderiv_inner_apply (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) (y : G) : fderiv ℝ (fun t => βŸͺf t, g t⟫) x y = βŸͺf x, fderiv ℝ g x y⟫ + βŸͺfderiv ℝ f x y, g x⟫ := by rw [(hf.hasFDerivAt.inner π•œ hg.hasFDerivAt).fderiv]; rfl #align fderiv_inner_apply fderiv_inner_apply theorem deriv_inner_apply {f g : ℝ β†’ E} {x : ℝ} (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) : deriv (fun t => βŸͺf t, g t⟫) x = βŸͺf x, deriv g x⟫ + βŸͺderiv f x, g x⟫ := (hf.hasDerivAt.inner π•œ hg.hasDerivAt).deriv #align deriv_inner_apply deriv_inner_apply theorem contDiff_norm_sq : ContDiff ℝ n fun x : E => β€–xβ€– ^ 2 := by convert (reClm : π•œ β†’L[ℝ] ℝ).contDiff.comp ((contDiff_id (E := E)).inner π•œ (contDiff_id (E := E))) exact (inner_self_eq_norm_sq _).symm #align cont_diff_norm_sq contDiff_norm_sq theorem ContDiff.norm_sq (hf : ContDiff ℝ n f) : ContDiff ℝ n fun x => β€–f xβ€– ^ 2 := (contDiff_norm_sq π•œ).comp hf #align cont_diff.norm_sq ContDiff.norm_sq theorem ContDiffWithinAt.norm_sq (hf : ContDiffWithinAt ℝ n f s x) : ContDiffWithinAt ℝ n (fun y => β€–f yβ€– ^ 2) s x := (contDiff_norm_sq π•œ).contDiffAt.comp_contDiffWithinAt x hf #align cont_diff_within_at.norm_sq ContDiffWithinAt.norm_sq nonrec theorem ContDiffAt.norm_sq (hf : ContDiffAt ℝ n f x) : ContDiffAt ℝ n (β€–f Β·β€– ^ 2) x := hf.norm_sq π•œ #align cont_diff_at.norm_sq ContDiffAt.norm_sq theorem contDiffAt_norm {x : E} (hx : x β‰  0) : ContDiffAt ℝ n norm x := by have : β€–id xβ€– ^ 2 β‰  0 := pow_ne_zero 2 (norm_pos_iff.2 hx).ne' simpa only [id, sqrt_sq, norm_nonneg] using (contDiffAt_id.norm_sq π•œ).sqrt this #align cont_diff_at_norm contDiffAt_norm theorem ContDiffAt.norm (hf : ContDiffAt ℝ n f x) (h0 : f x β‰  0) : ContDiffAt ℝ n (fun y => β€–f yβ€–) x := (contDiffAt_norm π•œ h0).comp x hf #align cont_diff_at.norm ContDiffAt.norm theorem ContDiffAt.dist (hf : ContDiffAt ℝ n f x) (hg : ContDiffAt ℝ n g x) (hne : f x β‰  g x) : ContDiffAt ℝ n (fun y => dist (f y) (g y)) x := by simp only [dist_eq_norm] exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align cont_diff_at.dist ContDiffAt.dist theorem ContDiffWithinAt.norm (hf : ContDiffWithinAt ℝ n f s x) (h0 : f x β‰  0) : ContDiffWithinAt ℝ n (fun y => β€–f yβ€–) s x := (contDiffAt_norm π•œ h0).comp_contDiffWithinAt x hf #align cont_diff_within_at.norm ContDiffWithinAt.norm theorem ContDiffWithinAt.dist (hf : ContDiffWithinAt ℝ n f s x) (hg : ContDiffWithinAt ℝ n g s x) (hne : f x β‰  g x) : ContDiffWithinAt ℝ n (fun y => dist (f y) (g y)) s x := by simp only [dist_eq_norm]; exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align cont_diff_within_at.dist ContDiffWithinAt.dist theorem ContDiffOn.norm_sq (hf : ContDiffOn ℝ n f s) : ContDiffOn ℝ n (fun y => β€–f yβ€– ^ 2) s := fun x hx => (hf x hx).norm_sq π•œ #align cont_diff_on.norm_sq ContDiffOn.norm_sq theorem ContDiffOn.norm (hf : ContDiffOn ℝ n f s) (h0 : βˆ€ x ∈ s, f x β‰  0) : ContDiffOn ℝ n (fun y => β€–f yβ€–) s := fun x hx => (hf x hx).norm π•œ (h0 x hx) #align cont_diff_on.norm ContDiffOn.norm theorem ContDiffOn.dist (hf : ContDiffOn ℝ n f s) (hg : ContDiffOn ℝ n g s) (hne : βˆ€ x ∈ s, f x β‰  g x) : ContDiffOn ℝ n (fun y => dist (f y) (g y)) s := fun x hx => (hf x hx).dist π•œ (hg x hx) (hne x hx) #align cont_diff_on.dist ContDiffOn.dist theorem ContDiff.norm (hf : ContDiff ℝ n f) (h0 : βˆ€ x, f x β‰  0) : ContDiff ℝ n fun y => β€–f yβ€– := contDiff_iff_contDiffAt.2 fun x => hf.contDiffAt.norm π•œ (h0 x) #align cont_diff.norm ContDiff.norm theorem ContDiff.dist (hf : ContDiff ℝ n f) (hg : ContDiff ℝ n g) (hne : βˆ€ x, f x β‰  g x) : ContDiff ℝ n fun y => dist (f y) (g y) := contDiff_iff_contDiffAt.2 fun x => hf.contDiffAt.dist π•œ hg.contDiffAt (hne x) #align cont_diff.dist ContDiff.dist -- porting note: use `2 β€’` instead of `bit0` theorem hasStrictFDerivAt_norm_sq (x : F) : HasStrictFDerivAt (fun x => β€–xβ€– ^ 2) (2 β€’ (innerSL ℝ x)) x := by simp only [sq, ← @inner_self_eq_norm_mul_norm ℝ] convert (hasStrictFDerivAt_id x).inner ℝ (hasStrictFDerivAt_id x) ext y simp [two_smul, real_inner_comm] #align has_strict_fderiv_at_norm_sq hasStrictFDerivAt_norm_sqβ‚“ theorem HasFDerivAt.norm_sq {f : G β†’ F} {f' : G β†’L[ℝ] F} (hf : HasFDerivAt f f' x) : HasFDerivAt (β€–f Β·β€– ^ 2) (2 β€’ (innerSL ℝ (f x)).comp f') x := (hasStrictFDerivAt_norm_sq _).hasFDerivAt.comp x hf theorem HasDerivAt.norm_sq {f : ℝ β†’ F} {f' : F} {x : ℝ} (hf : HasDerivAt f f' x) : HasDerivAt (β€–f Β·β€– ^ 2) (2 * Inner.inner (f x) f') x := by simpa using hf.hasFDerivAt.norm_sq.hasDerivAt theorem HasFDerivWithinAt.norm_sq {f : G β†’ F} {f' : G β†’L[ℝ] F} (hf : HasFDerivWithinAt f f' s x) : HasFDerivWithinAt (β€–f Β·β€– ^ 2) (2 β€’ (innerSL ℝ (f x)).comp f') s x := (hasStrictFDerivAt_norm_sq _).hasFDerivAt.comp_hasFDerivWithinAt x hf theorem HasDerivWithinAt.norm_sq {f : ℝ β†’ F} {f' : F} {s : Set ℝ} {x : ℝ} (hf : HasDerivWithinAt f f' s x) : HasDerivWithinAt (β€–f Β·β€– ^ 2) (2 * Inner.inner (f x) f') s x := by simpa using hf.hasFDerivWithinAt.norm_sq.hasDerivWithinAt theorem DifferentiableAt.norm_sq (hf : DifferentiableAt ℝ f x) : DifferentiableAt ℝ (fun y => β€–f yβ€– ^ 2) x := ((contDiffAt_id.norm_sq π•œ).differentiableAt le_rfl).comp x hf #align differentiable_at.norm_sq DifferentiableAt.norm_sq theorem DifferentiableAt.norm (hf : DifferentiableAt ℝ f x) (h0 : f x β‰  0) : DifferentiableAt ℝ (fun y => β€–f yβ€–) x := ((contDiffAt_norm π•œ h0).differentiableAt le_rfl).comp x hf #align differentiable_at.norm DifferentiableAt.norm theorem DifferentiableAt.dist (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) (hne : f x β‰  g x) : DifferentiableAt ℝ (fun y => dist (f y) (g y)) x := by simp only [dist_eq_norm]; exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align differentiable_at.dist DifferentiableAt.dist theorem Differentiable.norm_sq (hf : Differentiable ℝ f) : Differentiable ℝ fun y => β€–f yβ€– ^ 2 := fun x => (hf x).norm_sq π•œ #align differentiable.norm_sq Differentiable.norm_sq theorem Differentiable.norm (hf : Differentiable ℝ f) (h0 : βˆ€ x, f x β‰  0) : Differentiable ℝ fun y => β€–f yβ€– := fun x => (hf x).norm π•œ (h0 x) #align differentiable.norm Differentiable.norm theorem Differentiable.dist (hf : Differentiable ℝ f) (hg : Differentiable ℝ g) (hne : βˆ€ x, f x β‰  g x) : Differentiable ℝ fun y => dist (f y) (g y) := fun x => (hf x).dist π•œ (hg x) (hne x) #align differentiable.dist Differentiable.dist theorem DifferentiableWithinAt.norm_sq (hf : DifferentiableWithinAt ℝ f s x) : DifferentiableWithinAt ℝ (fun y => β€–f yβ€– ^ 2) s x := ((contDiffAt_id.norm_sq π•œ).differentiableAt le_rfl).comp_differentiableWithinAt x hf #align differentiable_within_at.norm_sq DifferentiableWithinAt.norm_sq theorem DifferentiableWithinAt.norm (hf : DifferentiableWithinAt ℝ f s x) (h0 : f x β‰  0) : DifferentiableWithinAt ℝ (fun y => β€–f yβ€–) s x := ((contDiffAt_id.norm π•œ h0).differentiableAt le_rfl).comp_differentiableWithinAt x hf #align differentiable_within_at.norm DifferentiableWithinAt.norm theorem DifferentiableWithinAt.dist (hf : DifferentiableWithinAt ℝ f s x) (hg : DifferentiableWithinAt ℝ g s x) (hne : f x β‰  g x) : DifferentiableWithinAt ℝ (fun y => dist (f y) (g y)) s x := by simp only [dist_eq_norm] exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align differentiable_within_at.dist DifferentiableWithinAt.dist theorem DifferentiableOn.norm_sq (hf : DifferentiableOn ℝ f s) : DifferentiableOn ℝ (fun y => β€–f yβ€– ^ 2) s := fun x hx => (hf x hx).norm_sq π•œ #align differentiable_on.norm_sq DifferentiableOn.norm_sq theorem DifferentiableOn.norm (hf : DifferentiableOn ℝ f s) (h0 : βˆ€ x ∈ s, f x β‰  0) : DifferentiableOn ℝ (fun y => β€–f yβ€–) s := fun x hx => (hf x hx).norm π•œ (h0 x hx) #align differentiable_on.norm DifferentiableOn.norm theorem DifferentiableOn.dist (hf : DifferentiableOn ℝ f s) (hg : DifferentiableOn ℝ g s) (hne : βˆ€ x ∈ s, f x β‰  g x) : DifferentiableOn ℝ (fun y => dist (f y) (g y)) s := fun x hx => (hf x hx).dist π•œ (hg x hx) (hne x hx) #align differentiable_on.dist DifferentiableOn.dist end DerivInner section PiLike open ContinuousLinearMap variable {π•œ ΞΉ H : Type*} [IsROrC π•œ] [NormedAddCommGroup H] [NormedSpace π•œ H] [Fintype ΞΉ] {f : H β†’ EuclideanSpace π•œ ΞΉ} {f' : H β†’L[π•œ] EuclideanSpace π•œ ΞΉ} {t : Set H} {y : H} theorem differentiableWithinAt_euclidean : DifferentiableWithinAt π•œ f t y ↔ βˆ€ i, DifferentiableWithinAt π•œ (fun x => f x i) t y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_differentiableWithinAt_iff, differentiableWithinAt_pi] rfl #align differentiable_within_at_euclidean differentiableWithinAt_euclidean theorem differentiableAt_euclidean : DifferentiableAt π•œ f y ↔ βˆ€ i, DifferentiableAt π•œ (fun x => f x i) y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_differentiableAt_iff, differentiableAt_pi] rfl #align differentiable_at_euclidean differentiableAt_euclidean theorem differentiableOn_euclidean : DifferentiableOn π•œ f t ↔ βˆ€ i, DifferentiableOn π•œ (fun x => f x i) t := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_differentiableOn_iff, differentiableOn_pi] rfl #align differentiable_on_euclidean differentiableOn_euclidean theorem differentiable_euclidean : Differentiable π•œ f ↔ βˆ€ i, Differentiable π•œ fun x => f x i := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_differentiable_iff, differentiable_pi] rfl #align differentiable_euclidean differentiable_euclidean theorem hasStrictFDerivAt_euclidean : HasStrictFDerivAt f f' y ↔ βˆ€ i, HasStrictFDerivAt (fun x => f x i) (EuclideanSpace.proj i ∘L f') y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_hasStrictFDerivAt_iff, hasStrictFDerivAt_pi'] rfl #align has_strict_fderiv_at_euclidean hasStrictFDerivAt_euclidean theorem hasFDerivWithinAt_euclidean : HasFDerivWithinAt f f' t y ↔ βˆ€ i, HasFDerivWithinAt (fun x => f x i) (EuclideanSpace.proj i ∘L f') t y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_hasFDerivWithinAt_iff, hasFDerivWithinAt_pi'] rfl #align has_fderiv_within_at_euclidean hasFDerivWithinAt_euclidean theorem contDiffWithinAt_euclidean {n : β„•βˆž} : ContDiffWithinAt π•œ n f t y ↔ βˆ€ i, ContDiffWithinAt π•œ n (fun x => f x i) t y := by
rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_contDiffWithinAt_iff, contDiffWithinAt_pi]
theorem contDiffWithinAt_euclidean {n : β„•βˆž} : ContDiffWithinAt π•œ n f t y ↔ βˆ€ i, ContDiffWithinAt π•œ n (fun x => f x i) t y := by
Mathlib.Analysis.InnerProductSpace.Calculus.349_0.6FECEGgqdb67QLM
theorem contDiffWithinAt_euclidean {n : β„•βˆž} : ContDiffWithinAt π•œ n f t y ↔ βˆ€ i, ContDiffWithinAt π•œ n (fun x => f x i) t y
Mathlib_Analysis_InnerProductSpace_Calculus
π•œ : Type u_1 ΞΉ : Type u_2 H : Type u_3 inst✝³ : IsROrC π•œ inst✝² : NormedAddCommGroup H inst✝¹ : NormedSpace π•œ H inst✝ : Fintype ΞΉ f : H β†’ EuclideanSpace π•œ ΞΉ f' : H β†’L[π•œ] EuclideanSpace π•œ ΞΉ t : Set H y : H n : β„•βˆž ⊒ (βˆ€ (i : ΞΉ), ContDiffWithinAt π•œ n (fun x => (⇑(EuclideanSpace.equiv ΞΉ π•œ) ∘ f) x i) t y) ↔ βˆ€ (i : ΞΉ), ContDiffWithinAt π•œ n (fun x => f x i) t y
/- Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ import Mathlib.Analysis.InnerProductSpace.PiL2 import Mathlib.Analysis.SpecialFunctions.Sqrt import Mathlib.Analysis.NormedSpace.HomeomorphBall #align_import analysis.inner_product_space.calculus from "leanprover-community/mathlib"@"f9dd3204df14a0749cd456fac1e6849dfe7d2b88" /-! # Calculus in inner product spaces In this file we prove that the inner product and square of the norm in an inner space are infinitely `ℝ`-smooth. In order to state these results, we need a `NormedSpace ℝ E` instance. Though we can deduce this structure from `InnerProductSpace π•œ E`, this instance may be not definitionally equal to some other β€œnatural” instance. So, we assume `[NormedSpace ℝ E]`. We also prove that functions to a `EuclideanSpace` are (higher) differentiable if and only if their components are. This follows from the corresponding fact for finite product of normed spaces, and from the equivalence of norms in finite dimensions. ## TODO The last part of the file should be generalized to `PiLp`. -/ noncomputable section open IsROrC Real Filter open scoped BigOperators Classical Topology section DerivInner variable {π•œ E F : Type*} [IsROrC π•œ] variable [NormedAddCommGroup E] [InnerProductSpace π•œ E] variable [NormedAddCommGroup F] [InnerProductSpace ℝ F] local notation "βŸͺ" x ", " y "⟫" => @inner π•œ _ _ x y variable (π•œ) [NormedSpace ℝ E] /-- Derivative of the inner product. -/ def fderivInnerClm (p : E Γ— E) : E Γ— E β†’L[ℝ] π•œ := isBoundedBilinearMap_inner.deriv p #align fderiv_inner_clm fderivInnerClm @[simp] theorem fderivInnerClm_apply (p x : E Γ— E) : fderivInnerClm π•œ p x = βŸͺp.1, x.2⟫ + βŸͺx.1, p.2⟫ := rfl #align fderiv_inner_clm_apply fderivInnerClm_apply variable {π•œ} -- porting note: Lean 3 magically switches back to `{π•œ}` here theorem contDiff_inner {n} : ContDiff ℝ n fun p : E Γ— E => βŸͺp.1, p.2⟫ := isBoundedBilinearMap_inner.contDiff #align cont_diff_inner contDiff_inner theorem contDiffAt_inner {p : E Γ— E} {n} : ContDiffAt ℝ n (fun p : E Γ— E => βŸͺp.1, p.2⟫) p := ContDiff.contDiffAt contDiff_inner #align cont_diff_at_inner contDiffAt_inner theorem differentiable_inner : Differentiable ℝ fun p : E Γ— E => βŸͺp.1, p.2⟫ := isBoundedBilinearMap_inner.differentiableAt #align differentiable_inner differentiable_inner variable (π•œ) variable {G : Type*} [NormedAddCommGroup G] [NormedSpace ℝ G] {f g : G β†’ E} {f' g' : G β†’L[ℝ] E} {s : Set G} {x : G} {n : β„•βˆž} theorem ContDiffWithinAt.inner (hf : ContDiffWithinAt ℝ n f s x) (hg : ContDiffWithinAt ℝ n g s x) : ContDiffWithinAt ℝ n (fun x => βŸͺf x, g x⟫) s x := contDiffAt_inner.comp_contDiffWithinAt x (hf.prod hg) #align cont_diff_within_at.inner ContDiffWithinAt.inner nonrec theorem ContDiffAt.inner (hf : ContDiffAt ℝ n f x) (hg : ContDiffAt ℝ n g x) : ContDiffAt ℝ n (fun x => βŸͺf x, g x⟫) x := hf.inner π•œ hg #align cont_diff_at.inner ContDiffAt.inner theorem ContDiffOn.inner (hf : ContDiffOn ℝ n f s) (hg : ContDiffOn ℝ n g s) : ContDiffOn ℝ n (fun x => βŸͺf x, g x⟫) s := fun x hx => (hf x hx).inner π•œ (hg x hx) #align cont_diff_on.inner ContDiffOn.inner theorem ContDiff.inner (hf : ContDiff ℝ n f) (hg : ContDiff ℝ n g) : ContDiff ℝ n fun x => βŸͺf x, g x⟫ := contDiff_inner.comp (hf.prod hg) #align cont_diff.inner ContDiff.inner theorem HasFDerivWithinAt.inner (hf : HasFDerivWithinAt f f' s x) (hg : HasFDerivWithinAt g g' s x) : HasFDerivWithinAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') s x := (isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp_hasFDerivWithinAt x (hf.prod hg) #align has_fderiv_within_at.inner HasFDerivWithinAt.inner theorem HasStrictFDerivAt.inner (hf : HasStrictFDerivAt f f' x) (hg : HasStrictFDerivAt g g' x) : HasStrictFDerivAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') x := (isBoundedBilinearMap_inner.hasStrictFDerivAt (f x, g x)).comp x (hf.prod hg) #align has_strict_fderiv_at.inner HasStrictFDerivAt.inner theorem HasFDerivAt.inner (hf : HasFDerivAt f f' x) (hg : HasFDerivAt g g' x) : HasFDerivAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') x := (isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp x (hf.prod hg) #align has_fderiv_at.inner HasFDerivAt.inner theorem HasDerivWithinAt.inner {f g : ℝ β†’ E} {f' g' : E} {s : Set ℝ} {x : ℝ} (hf : HasDerivWithinAt f f' s x) (hg : HasDerivWithinAt g g' s x) : HasDerivWithinAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) s x := by simpa using (hf.hasFDerivWithinAt.inner π•œ hg.hasFDerivWithinAt).hasDerivWithinAt #align has_deriv_within_at.inner HasDerivWithinAt.inner theorem HasDerivAt.inner {f g : ℝ β†’ E} {f' g' : E} {x : ℝ} : HasDerivAt f f' x β†’ HasDerivAt g g' x β†’ HasDerivAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) x := by simpa only [← hasDerivWithinAt_univ] using HasDerivWithinAt.inner π•œ #align has_deriv_at.inner HasDerivAt.inner theorem DifferentiableWithinAt.inner (hf : DifferentiableWithinAt ℝ f s x) (hg : DifferentiableWithinAt ℝ g s x) : DifferentiableWithinAt ℝ (fun x => βŸͺf x, g x⟫) s x := ((differentiable_inner _).hasFDerivAt.comp_hasFDerivWithinAt x (hf.prod hg).hasFDerivWithinAt).differentiableWithinAt #align differentiable_within_at.inner DifferentiableWithinAt.inner theorem DifferentiableAt.inner (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) : DifferentiableAt ℝ (fun x => βŸͺf x, g x⟫) x := (differentiable_inner _).comp x (hf.prod hg) #align differentiable_at.inner DifferentiableAt.inner theorem DifferentiableOn.inner (hf : DifferentiableOn ℝ f s) (hg : DifferentiableOn ℝ g s) : DifferentiableOn ℝ (fun x => βŸͺf x, g x⟫) s := fun x hx => (hf x hx).inner π•œ (hg x hx) #align differentiable_on.inner DifferentiableOn.inner theorem Differentiable.inner (hf : Differentiable ℝ f) (hg : Differentiable ℝ g) : Differentiable ℝ fun x => βŸͺf x, g x⟫ := fun x => (hf x).inner π•œ (hg x) #align differentiable.inner Differentiable.inner theorem fderiv_inner_apply (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) (y : G) : fderiv ℝ (fun t => βŸͺf t, g t⟫) x y = βŸͺf x, fderiv ℝ g x y⟫ + βŸͺfderiv ℝ f x y, g x⟫ := by rw [(hf.hasFDerivAt.inner π•œ hg.hasFDerivAt).fderiv]; rfl #align fderiv_inner_apply fderiv_inner_apply theorem deriv_inner_apply {f g : ℝ β†’ E} {x : ℝ} (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) : deriv (fun t => βŸͺf t, g t⟫) x = βŸͺf x, deriv g x⟫ + βŸͺderiv f x, g x⟫ := (hf.hasDerivAt.inner π•œ hg.hasDerivAt).deriv #align deriv_inner_apply deriv_inner_apply theorem contDiff_norm_sq : ContDiff ℝ n fun x : E => β€–xβ€– ^ 2 := by convert (reClm : π•œ β†’L[ℝ] ℝ).contDiff.comp ((contDiff_id (E := E)).inner π•œ (contDiff_id (E := E))) exact (inner_self_eq_norm_sq _).symm #align cont_diff_norm_sq contDiff_norm_sq theorem ContDiff.norm_sq (hf : ContDiff ℝ n f) : ContDiff ℝ n fun x => β€–f xβ€– ^ 2 := (contDiff_norm_sq π•œ).comp hf #align cont_diff.norm_sq ContDiff.norm_sq theorem ContDiffWithinAt.norm_sq (hf : ContDiffWithinAt ℝ n f s x) : ContDiffWithinAt ℝ n (fun y => β€–f yβ€– ^ 2) s x := (contDiff_norm_sq π•œ).contDiffAt.comp_contDiffWithinAt x hf #align cont_diff_within_at.norm_sq ContDiffWithinAt.norm_sq nonrec theorem ContDiffAt.norm_sq (hf : ContDiffAt ℝ n f x) : ContDiffAt ℝ n (β€–f Β·β€– ^ 2) x := hf.norm_sq π•œ #align cont_diff_at.norm_sq ContDiffAt.norm_sq theorem contDiffAt_norm {x : E} (hx : x β‰  0) : ContDiffAt ℝ n norm x := by have : β€–id xβ€– ^ 2 β‰  0 := pow_ne_zero 2 (norm_pos_iff.2 hx).ne' simpa only [id, sqrt_sq, norm_nonneg] using (contDiffAt_id.norm_sq π•œ).sqrt this #align cont_diff_at_norm contDiffAt_norm theorem ContDiffAt.norm (hf : ContDiffAt ℝ n f x) (h0 : f x β‰  0) : ContDiffAt ℝ n (fun y => β€–f yβ€–) x := (contDiffAt_norm π•œ h0).comp x hf #align cont_diff_at.norm ContDiffAt.norm theorem ContDiffAt.dist (hf : ContDiffAt ℝ n f x) (hg : ContDiffAt ℝ n g x) (hne : f x β‰  g x) : ContDiffAt ℝ n (fun y => dist (f y) (g y)) x := by simp only [dist_eq_norm] exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align cont_diff_at.dist ContDiffAt.dist theorem ContDiffWithinAt.norm (hf : ContDiffWithinAt ℝ n f s x) (h0 : f x β‰  0) : ContDiffWithinAt ℝ n (fun y => β€–f yβ€–) s x := (contDiffAt_norm π•œ h0).comp_contDiffWithinAt x hf #align cont_diff_within_at.norm ContDiffWithinAt.norm theorem ContDiffWithinAt.dist (hf : ContDiffWithinAt ℝ n f s x) (hg : ContDiffWithinAt ℝ n g s x) (hne : f x β‰  g x) : ContDiffWithinAt ℝ n (fun y => dist (f y) (g y)) s x := by simp only [dist_eq_norm]; exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align cont_diff_within_at.dist ContDiffWithinAt.dist theorem ContDiffOn.norm_sq (hf : ContDiffOn ℝ n f s) : ContDiffOn ℝ n (fun y => β€–f yβ€– ^ 2) s := fun x hx => (hf x hx).norm_sq π•œ #align cont_diff_on.norm_sq ContDiffOn.norm_sq theorem ContDiffOn.norm (hf : ContDiffOn ℝ n f s) (h0 : βˆ€ x ∈ s, f x β‰  0) : ContDiffOn ℝ n (fun y => β€–f yβ€–) s := fun x hx => (hf x hx).norm π•œ (h0 x hx) #align cont_diff_on.norm ContDiffOn.norm theorem ContDiffOn.dist (hf : ContDiffOn ℝ n f s) (hg : ContDiffOn ℝ n g s) (hne : βˆ€ x ∈ s, f x β‰  g x) : ContDiffOn ℝ n (fun y => dist (f y) (g y)) s := fun x hx => (hf x hx).dist π•œ (hg x hx) (hne x hx) #align cont_diff_on.dist ContDiffOn.dist theorem ContDiff.norm (hf : ContDiff ℝ n f) (h0 : βˆ€ x, f x β‰  0) : ContDiff ℝ n fun y => β€–f yβ€– := contDiff_iff_contDiffAt.2 fun x => hf.contDiffAt.norm π•œ (h0 x) #align cont_diff.norm ContDiff.norm theorem ContDiff.dist (hf : ContDiff ℝ n f) (hg : ContDiff ℝ n g) (hne : βˆ€ x, f x β‰  g x) : ContDiff ℝ n fun y => dist (f y) (g y) := contDiff_iff_contDiffAt.2 fun x => hf.contDiffAt.dist π•œ hg.contDiffAt (hne x) #align cont_diff.dist ContDiff.dist -- porting note: use `2 β€’` instead of `bit0` theorem hasStrictFDerivAt_norm_sq (x : F) : HasStrictFDerivAt (fun x => β€–xβ€– ^ 2) (2 β€’ (innerSL ℝ x)) x := by simp only [sq, ← @inner_self_eq_norm_mul_norm ℝ] convert (hasStrictFDerivAt_id x).inner ℝ (hasStrictFDerivAt_id x) ext y simp [two_smul, real_inner_comm] #align has_strict_fderiv_at_norm_sq hasStrictFDerivAt_norm_sqβ‚“ theorem HasFDerivAt.norm_sq {f : G β†’ F} {f' : G β†’L[ℝ] F} (hf : HasFDerivAt f f' x) : HasFDerivAt (β€–f Β·β€– ^ 2) (2 β€’ (innerSL ℝ (f x)).comp f') x := (hasStrictFDerivAt_norm_sq _).hasFDerivAt.comp x hf theorem HasDerivAt.norm_sq {f : ℝ β†’ F} {f' : F} {x : ℝ} (hf : HasDerivAt f f' x) : HasDerivAt (β€–f Β·β€– ^ 2) (2 * Inner.inner (f x) f') x := by simpa using hf.hasFDerivAt.norm_sq.hasDerivAt theorem HasFDerivWithinAt.norm_sq {f : G β†’ F} {f' : G β†’L[ℝ] F} (hf : HasFDerivWithinAt f f' s x) : HasFDerivWithinAt (β€–f Β·β€– ^ 2) (2 β€’ (innerSL ℝ (f x)).comp f') s x := (hasStrictFDerivAt_norm_sq _).hasFDerivAt.comp_hasFDerivWithinAt x hf theorem HasDerivWithinAt.norm_sq {f : ℝ β†’ F} {f' : F} {s : Set ℝ} {x : ℝ} (hf : HasDerivWithinAt f f' s x) : HasDerivWithinAt (β€–f Β·β€– ^ 2) (2 * Inner.inner (f x) f') s x := by simpa using hf.hasFDerivWithinAt.norm_sq.hasDerivWithinAt theorem DifferentiableAt.norm_sq (hf : DifferentiableAt ℝ f x) : DifferentiableAt ℝ (fun y => β€–f yβ€– ^ 2) x := ((contDiffAt_id.norm_sq π•œ).differentiableAt le_rfl).comp x hf #align differentiable_at.norm_sq DifferentiableAt.norm_sq theorem DifferentiableAt.norm (hf : DifferentiableAt ℝ f x) (h0 : f x β‰  0) : DifferentiableAt ℝ (fun y => β€–f yβ€–) x := ((contDiffAt_norm π•œ h0).differentiableAt le_rfl).comp x hf #align differentiable_at.norm DifferentiableAt.norm theorem DifferentiableAt.dist (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) (hne : f x β‰  g x) : DifferentiableAt ℝ (fun y => dist (f y) (g y)) x := by simp only [dist_eq_norm]; exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align differentiable_at.dist DifferentiableAt.dist theorem Differentiable.norm_sq (hf : Differentiable ℝ f) : Differentiable ℝ fun y => β€–f yβ€– ^ 2 := fun x => (hf x).norm_sq π•œ #align differentiable.norm_sq Differentiable.norm_sq theorem Differentiable.norm (hf : Differentiable ℝ f) (h0 : βˆ€ x, f x β‰  0) : Differentiable ℝ fun y => β€–f yβ€– := fun x => (hf x).norm π•œ (h0 x) #align differentiable.norm Differentiable.norm theorem Differentiable.dist (hf : Differentiable ℝ f) (hg : Differentiable ℝ g) (hne : βˆ€ x, f x β‰  g x) : Differentiable ℝ fun y => dist (f y) (g y) := fun x => (hf x).dist π•œ (hg x) (hne x) #align differentiable.dist Differentiable.dist theorem DifferentiableWithinAt.norm_sq (hf : DifferentiableWithinAt ℝ f s x) : DifferentiableWithinAt ℝ (fun y => β€–f yβ€– ^ 2) s x := ((contDiffAt_id.norm_sq π•œ).differentiableAt le_rfl).comp_differentiableWithinAt x hf #align differentiable_within_at.norm_sq DifferentiableWithinAt.norm_sq theorem DifferentiableWithinAt.norm (hf : DifferentiableWithinAt ℝ f s x) (h0 : f x β‰  0) : DifferentiableWithinAt ℝ (fun y => β€–f yβ€–) s x := ((contDiffAt_id.norm π•œ h0).differentiableAt le_rfl).comp_differentiableWithinAt x hf #align differentiable_within_at.norm DifferentiableWithinAt.norm theorem DifferentiableWithinAt.dist (hf : DifferentiableWithinAt ℝ f s x) (hg : DifferentiableWithinAt ℝ g s x) (hne : f x β‰  g x) : DifferentiableWithinAt ℝ (fun y => dist (f y) (g y)) s x := by simp only [dist_eq_norm] exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align differentiable_within_at.dist DifferentiableWithinAt.dist theorem DifferentiableOn.norm_sq (hf : DifferentiableOn ℝ f s) : DifferentiableOn ℝ (fun y => β€–f yβ€– ^ 2) s := fun x hx => (hf x hx).norm_sq π•œ #align differentiable_on.norm_sq DifferentiableOn.norm_sq theorem DifferentiableOn.norm (hf : DifferentiableOn ℝ f s) (h0 : βˆ€ x ∈ s, f x β‰  0) : DifferentiableOn ℝ (fun y => β€–f yβ€–) s := fun x hx => (hf x hx).norm π•œ (h0 x hx) #align differentiable_on.norm DifferentiableOn.norm theorem DifferentiableOn.dist (hf : DifferentiableOn ℝ f s) (hg : DifferentiableOn ℝ g s) (hne : βˆ€ x ∈ s, f x β‰  g x) : DifferentiableOn ℝ (fun y => dist (f y) (g y)) s := fun x hx => (hf x hx).dist π•œ (hg x hx) (hne x hx) #align differentiable_on.dist DifferentiableOn.dist end DerivInner section PiLike open ContinuousLinearMap variable {π•œ ΞΉ H : Type*} [IsROrC π•œ] [NormedAddCommGroup H] [NormedSpace π•œ H] [Fintype ΞΉ] {f : H β†’ EuclideanSpace π•œ ΞΉ} {f' : H β†’L[π•œ] EuclideanSpace π•œ ΞΉ} {t : Set H} {y : H} theorem differentiableWithinAt_euclidean : DifferentiableWithinAt π•œ f t y ↔ βˆ€ i, DifferentiableWithinAt π•œ (fun x => f x i) t y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_differentiableWithinAt_iff, differentiableWithinAt_pi] rfl #align differentiable_within_at_euclidean differentiableWithinAt_euclidean theorem differentiableAt_euclidean : DifferentiableAt π•œ f y ↔ βˆ€ i, DifferentiableAt π•œ (fun x => f x i) y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_differentiableAt_iff, differentiableAt_pi] rfl #align differentiable_at_euclidean differentiableAt_euclidean theorem differentiableOn_euclidean : DifferentiableOn π•œ f t ↔ βˆ€ i, DifferentiableOn π•œ (fun x => f x i) t := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_differentiableOn_iff, differentiableOn_pi] rfl #align differentiable_on_euclidean differentiableOn_euclidean theorem differentiable_euclidean : Differentiable π•œ f ↔ βˆ€ i, Differentiable π•œ fun x => f x i := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_differentiable_iff, differentiable_pi] rfl #align differentiable_euclidean differentiable_euclidean theorem hasStrictFDerivAt_euclidean : HasStrictFDerivAt f f' y ↔ βˆ€ i, HasStrictFDerivAt (fun x => f x i) (EuclideanSpace.proj i ∘L f') y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_hasStrictFDerivAt_iff, hasStrictFDerivAt_pi'] rfl #align has_strict_fderiv_at_euclidean hasStrictFDerivAt_euclidean theorem hasFDerivWithinAt_euclidean : HasFDerivWithinAt f f' t y ↔ βˆ€ i, HasFDerivWithinAt (fun x => f x i) (EuclideanSpace.proj i ∘L f') t y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_hasFDerivWithinAt_iff, hasFDerivWithinAt_pi'] rfl #align has_fderiv_within_at_euclidean hasFDerivWithinAt_euclidean theorem contDiffWithinAt_euclidean {n : β„•βˆž} : ContDiffWithinAt π•œ n f t y ↔ βˆ€ i, ContDiffWithinAt π•œ n (fun x => f x i) t y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_contDiffWithinAt_iff, contDiffWithinAt_pi]
rfl
theorem contDiffWithinAt_euclidean {n : β„•βˆž} : ContDiffWithinAt π•œ n f t y ↔ βˆ€ i, ContDiffWithinAt π•œ n (fun x => f x i) t y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_contDiffWithinAt_iff, contDiffWithinAt_pi]
Mathlib.Analysis.InnerProductSpace.Calculus.349_0.6FECEGgqdb67QLM
theorem contDiffWithinAt_euclidean {n : β„•βˆž} : ContDiffWithinAt π•œ n f t y ↔ βˆ€ i, ContDiffWithinAt π•œ n (fun x => f x i) t y
Mathlib_Analysis_InnerProductSpace_Calculus
π•œ : Type u_1 ΞΉ : Type u_2 H : Type u_3 inst✝³ : IsROrC π•œ inst✝² : NormedAddCommGroup H inst✝¹ : NormedSpace π•œ H inst✝ : Fintype ΞΉ f : H β†’ EuclideanSpace π•œ ΞΉ f' : H β†’L[π•œ] EuclideanSpace π•œ ΞΉ t : Set H y : H n : β„•βˆž ⊒ ContDiffAt π•œ n f y ↔ βˆ€ (i : ΞΉ), ContDiffAt π•œ n (fun x => f x i) y
/- Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ import Mathlib.Analysis.InnerProductSpace.PiL2 import Mathlib.Analysis.SpecialFunctions.Sqrt import Mathlib.Analysis.NormedSpace.HomeomorphBall #align_import analysis.inner_product_space.calculus from "leanprover-community/mathlib"@"f9dd3204df14a0749cd456fac1e6849dfe7d2b88" /-! # Calculus in inner product spaces In this file we prove that the inner product and square of the norm in an inner space are infinitely `ℝ`-smooth. In order to state these results, we need a `NormedSpace ℝ E` instance. Though we can deduce this structure from `InnerProductSpace π•œ E`, this instance may be not definitionally equal to some other β€œnatural” instance. So, we assume `[NormedSpace ℝ E]`. We also prove that functions to a `EuclideanSpace` are (higher) differentiable if and only if their components are. This follows from the corresponding fact for finite product of normed spaces, and from the equivalence of norms in finite dimensions. ## TODO The last part of the file should be generalized to `PiLp`. -/ noncomputable section open IsROrC Real Filter open scoped BigOperators Classical Topology section DerivInner variable {π•œ E F : Type*} [IsROrC π•œ] variable [NormedAddCommGroup E] [InnerProductSpace π•œ E] variable [NormedAddCommGroup F] [InnerProductSpace ℝ F] local notation "βŸͺ" x ", " y "⟫" => @inner π•œ _ _ x y variable (π•œ) [NormedSpace ℝ E] /-- Derivative of the inner product. -/ def fderivInnerClm (p : E Γ— E) : E Γ— E β†’L[ℝ] π•œ := isBoundedBilinearMap_inner.deriv p #align fderiv_inner_clm fderivInnerClm @[simp] theorem fderivInnerClm_apply (p x : E Γ— E) : fderivInnerClm π•œ p x = βŸͺp.1, x.2⟫ + βŸͺx.1, p.2⟫ := rfl #align fderiv_inner_clm_apply fderivInnerClm_apply variable {π•œ} -- porting note: Lean 3 magically switches back to `{π•œ}` here theorem contDiff_inner {n} : ContDiff ℝ n fun p : E Γ— E => βŸͺp.1, p.2⟫ := isBoundedBilinearMap_inner.contDiff #align cont_diff_inner contDiff_inner theorem contDiffAt_inner {p : E Γ— E} {n} : ContDiffAt ℝ n (fun p : E Γ— E => βŸͺp.1, p.2⟫) p := ContDiff.contDiffAt contDiff_inner #align cont_diff_at_inner contDiffAt_inner theorem differentiable_inner : Differentiable ℝ fun p : E Γ— E => βŸͺp.1, p.2⟫ := isBoundedBilinearMap_inner.differentiableAt #align differentiable_inner differentiable_inner variable (π•œ) variable {G : Type*} [NormedAddCommGroup G] [NormedSpace ℝ G] {f g : G β†’ E} {f' g' : G β†’L[ℝ] E} {s : Set G} {x : G} {n : β„•βˆž} theorem ContDiffWithinAt.inner (hf : ContDiffWithinAt ℝ n f s x) (hg : ContDiffWithinAt ℝ n g s x) : ContDiffWithinAt ℝ n (fun x => βŸͺf x, g x⟫) s x := contDiffAt_inner.comp_contDiffWithinAt x (hf.prod hg) #align cont_diff_within_at.inner ContDiffWithinAt.inner nonrec theorem ContDiffAt.inner (hf : ContDiffAt ℝ n f x) (hg : ContDiffAt ℝ n g x) : ContDiffAt ℝ n (fun x => βŸͺf x, g x⟫) x := hf.inner π•œ hg #align cont_diff_at.inner ContDiffAt.inner theorem ContDiffOn.inner (hf : ContDiffOn ℝ n f s) (hg : ContDiffOn ℝ n g s) : ContDiffOn ℝ n (fun x => βŸͺf x, g x⟫) s := fun x hx => (hf x hx).inner π•œ (hg x hx) #align cont_diff_on.inner ContDiffOn.inner theorem ContDiff.inner (hf : ContDiff ℝ n f) (hg : ContDiff ℝ n g) : ContDiff ℝ n fun x => βŸͺf x, g x⟫ := contDiff_inner.comp (hf.prod hg) #align cont_diff.inner ContDiff.inner theorem HasFDerivWithinAt.inner (hf : HasFDerivWithinAt f f' s x) (hg : HasFDerivWithinAt g g' s x) : HasFDerivWithinAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') s x := (isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp_hasFDerivWithinAt x (hf.prod hg) #align has_fderiv_within_at.inner HasFDerivWithinAt.inner theorem HasStrictFDerivAt.inner (hf : HasStrictFDerivAt f f' x) (hg : HasStrictFDerivAt g g' x) : HasStrictFDerivAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') x := (isBoundedBilinearMap_inner.hasStrictFDerivAt (f x, g x)).comp x (hf.prod hg) #align has_strict_fderiv_at.inner HasStrictFDerivAt.inner theorem HasFDerivAt.inner (hf : HasFDerivAt f f' x) (hg : HasFDerivAt g g' x) : HasFDerivAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') x := (isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp x (hf.prod hg) #align has_fderiv_at.inner HasFDerivAt.inner theorem HasDerivWithinAt.inner {f g : ℝ β†’ E} {f' g' : E} {s : Set ℝ} {x : ℝ} (hf : HasDerivWithinAt f f' s x) (hg : HasDerivWithinAt g g' s x) : HasDerivWithinAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) s x := by simpa using (hf.hasFDerivWithinAt.inner π•œ hg.hasFDerivWithinAt).hasDerivWithinAt #align has_deriv_within_at.inner HasDerivWithinAt.inner theorem HasDerivAt.inner {f g : ℝ β†’ E} {f' g' : E} {x : ℝ} : HasDerivAt f f' x β†’ HasDerivAt g g' x β†’ HasDerivAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) x := by simpa only [← hasDerivWithinAt_univ] using HasDerivWithinAt.inner π•œ #align has_deriv_at.inner HasDerivAt.inner theorem DifferentiableWithinAt.inner (hf : DifferentiableWithinAt ℝ f s x) (hg : DifferentiableWithinAt ℝ g s x) : DifferentiableWithinAt ℝ (fun x => βŸͺf x, g x⟫) s x := ((differentiable_inner _).hasFDerivAt.comp_hasFDerivWithinAt x (hf.prod hg).hasFDerivWithinAt).differentiableWithinAt #align differentiable_within_at.inner DifferentiableWithinAt.inner theorem DifferentiableAt.inner (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) : DifferentiableAt ℝ (fun x => βŸͺf x, g x⟫) x := (differentiable_inner _).comp x (hf.prod hg) #align differentiable_at.inner DifferentiableAt.inner theorem DifferentiableOn.inner (hf : DifferentiableOn ℝ f s) (hg : DifferentiableOn ℝ g s) : DifferentiableOn ℝ (fun x => βŸͺf x, g x⟫) s := fun x hx => (hf x hx).inner π•œ (hg x hx) #align differentiable_on.inner DifferentiableOn.inner theorem Differentiable.inner (hf : Differentiable ℝ f) (hg : Differentiable ℝ g) : Differentiable ℝ fun x => βŸͺf x, g x⟫ := fun x => (hf x).inner π•œ (hg x) #align differentiable.inner Differentiable.inner theorem fderiv_inner_apply (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) (y : G) : fderiv ℝ (fun t => βŸͺf t, g t⟫) x y = βŸͺf x, fderiv ℝ g x y⟫ + βŸͺfderiv ℝ f x y, g x⟫ := by rw [(hf.hasFDerivAt.inner π•œ hg.hasFDerivAt).fderiv]; rfl #align fderiv_inner_apply fderiv_inner_apply theorem deriv_inner_apply {f g : ℝ β†’ E} {x : ℝ} (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) : deriv (fun t => βŸͺf t, g t⟫) x = βŸͺf x, deriv g x⟫ + βŸͺderiv f x, g x⟫ := (hf.hasDerivAt.inner π•œ hg.hasDerivAt).deriv #align deriv_inner_apply deriv_inner_apply theorem contDiff_norm_sq : ContDiff ℝ n fun x : E => β€–xβ€– ^ 2 := by convert (reClm : π•œ β†’L[ℝ] ℝ).contDiff.comp ((contDiff_id (E := E)).inner π•œ (contDiff_id (E := E))) exact (inner_self_eq_norm_sq _).symm #align cont_diff_norm_sq contDiff_norm_sq theorem ContDiff.norm_sq (hf : ContDiff ℝ n f) : ContDiff ℝ n fun x => β€–f xβ€– ^ 2 := (contDiff_norm_sq π•œ).comp hf #align cont_diff.norm_sq ContDiff.norm_sq theorem ContDiffWithinAt.norm_sq (hf : ContDiffWithinAt ℝ n f s x) : ContDiffWithinAt ℝ n (fun y => β€–f yβ€– ^ 2) s x := (contDiff_norm_sq π•œ).contDiffAt.comp_contDiffWithinAt x hf #align cont_diff_within_at.norm_sq ContDiffWithinAt.norm_sq nonrec theorem ContDiffAt.norm_sq (hf : ContDiffAt ℝ n f x) : ContDiffAt ℝ n (β€–f Β·β€– ^ 2) x := hf.norm_sq π•œ #align cont_diff_at.norm_sq ContDiffAt.norm_sq theorem contDiffAt_norm {x : E} (hx : x β‰  0) : ContDiffAt ℝ n norm x := by have : β€–id xβ€– ^ 2 β‰  0 := pow_ne_zero 2 (norm_pos_iff.2 hx).ne' simpa only [id, sqrt_sq, norm_nonneg] using (contDiffAt_id.norm_sq π•œ).sqrt this #align cont_diff_at_norm contDiffAt_norm theorem ContDiffAt.norm (hf : ContDiffAt ℝ n f x) (h0 : f x β‰  0) : ContDiffAt ℝ n (fun y => β€–f yβ€–) x := (contDiffAt_norm π•œ h0).comp x hf #align cont_diff_at.norm ContDiffAt.norm theorem ContDiffAt.dist (hf : ContDiffAt ℝ n f x) (hg : ContDiffAt ℝ n g x) (hne : f x β‰  g x) : ContDiffAt ℝ n (fun y => dist (f y) (g y)) x := by simp only [dist_eq_norm] exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align cont_diff_at.dist ContDiffAt.dist theorem ContDiffWithinAt.norm (hf : ContDiffWithinAt ℝ n f s x) (h0 : f x β‰  0) : ContDiffWithinAt ℝ n (fun y => β€–f yβ€–) s x := (contDiffAt_norm π•œ h0).comp_contDiffWithinAt x hf #align cont_diff_within_at.norm ContDiffWithinAt.norm theorem ContDiffWithinAt.dist (hf : ContDiffWithinAt ℝ n f s x) (hg : ContDiffWithinAt ℝ n g s x) (hne : f x β‰  g x) : ContDiffWithinAt ℝ n (fun y => dist (f y) (g y)) s x := by simp only [dist_eq_norm]; exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align cont_diff_within_at.dist ContDiffWithinAt.dist theorem ContDiffOn.norm_sq (hf : ContDiffOn ℝ n f s) : ContDiffOn ℝ n (fun y => β€–f yβ€– ^ 2) s := fun x hx => (hf x hx).norm_sq π•œ #align cont_diff_on.norm_sq ContDiffOn.norm_sq theorem ContDiffOn.norm (hf : ContDiffOn ℝ n f s) (h0 : βˆ€ x ∈ s, f x β‰  0) : ContDiffOn ℝ n (fun y => β€–f yβ€–) s := fun x hx => (hf x hx).norm π•œ (h0 x hx) #align cont_diff_on.norm ContDiffOn.norm theorem ContDiffOn.dist (hf : ContDiffOn ℝ n f s) (hg : ContDiffOn ℝ n g s) (hne : βˆ€ x ∈ s, f x β‰  g x) : ContDiffOn ℝ n (fun y => dist (f y) (g y)) s := fun x hx => (hf x hx).dist π•œ (hg x hx) (hne x hx) #align cont_diff_on.dist ContDiffOn.dist theorem ContDiff.norm (hf : ContDiff ℝ n f) (h0 : βˆ€ x, f x β‰  0) : ContDiff ℝ n fun y => β€–f yβ€– := contDiff_iff_contDiffAt.2 fun x => hf.contDiffAt.norm π•œ (h0 x) #align cont_diff.norm ContDiff.norm theorem ContDiff.dist (hf : ContDiff ℝ n f) (hg : ContDiff ℝ n g) (hne : βˆ€ x, f x β‰  g x) : ContDiff ℝ n fun y => dist (f y) (g y) := contDiff_iff_contDiffAt.2 fun x => hf.contDiffAt.dist π•œ hg.contDiffAt (hne x) #align cont_diff.dist ContDiff.dist -- porting note: use `2 β€’` instead of `bit0` theorem hasStrictFDerivAt_norm_sq (x : F) : HasStrictFDerivAt (fun x => β€–xβ€– ^ 2) (2 β€’ (innerSL ℝ x)) x := by simp only [sq, ← @inner_self_eq_norm_mul_norm ℝ] convert (hasStrictFDerivAt_id x).inner ℝ (hasStrictFDerivAt_id x) ext y simp [two_smul, real_inner_comm] #align has_strict_fderiv_at_norm_sq hasStrictFDerivAt_norm_sqβ‚“ theorem HasFDerivAt.norm_sq {f : G β†’ F} {f' : G β†’L[ℝ] F} (hf : HasFDerivAt f f' x) : HasFDerivAt (β€–f Β·β€– ^ 2) (2 β€’ (innerSL ℝ (f x)).comp f') x := (hasStrictFDerivAt_norm_sq _).hasFDerivAt.comp x hf theorem HasDerivAt.norm_sq {f : ℝ β†’ F} {f' : F} {x : ℝ} (hf : HasDerivAt f f' x) : HasDerivAt (β€–f Β·β€– ^ 2) (2 * Inner.inner (f x) f') x := by simpa using hf.hasFDerivAt.norm_sq.hasDerivAt theorem HasFDerivWithinAt.norm_sq {f : G β†’ F} {f' : G β†’L[ℝ] F} (hf : HasFDerivWithinAt f f' s x) : HasFDerivWithinAt (β€–f Β·β€– ^ 2) (2 β€’ (innerSL ℝ (f x)).comp f') s x := (hasStrictFDerivAt_norm_sq _).hasFDerivAt.comp_hasFDerivWithinAt x hf theorem HasDerivWithinAt.norm_sq {f : ℝ β†’ F} {f' : F} {s : Set ℝ} {x : ℝ} (hf : HasDerivWithinAt f f' s x) : HasDerivWithinAt (β€–f Β·β€– ^ 2) (2 * Inner.inner (f x) f') s x := by simpa using hf.hasFDerivWithinAt.norm_sq.hasDerivWithinAt theorem DifferentiableAt.norm_sq (hf : DifferentiableAt ℝ f x) : DifferentiableAt ℝ (fun y => β€–f yβ€– ^ 2) x := ((contDiffAt_id.norm_sq π•œ).differentiableAt le_rfl).comp x hf #align differentiable_at.norm_sq DifferentiableAt.norm_sq theorem DifferentiableAt.norm (hf : DifferentiableAt ℝ f x) (h0 : f x β‰  0) : DifferentiableAt ℝ (fun y => β€–f yβ€–) x := ((contDiffAt_norm π•œ h0).differentiableAt le_rfl).comp x hf #align differentiable_at.norm DifferentiableAt.norm theorem DifferentiableAt.dist (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) (hne : f x β‰  g x) : DifferentiableAt ℝ (fun y => dist (f y) (g y)) x := by simp only [dist_eq_norm]; exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align differentiable_at.dist DifferentiableAt.dist theorem Differentiable.norm_sq (hf : Differentiable ℝ f) : Differentiable ℝ fun y => β€–f yβ€– ^ 2 := fun x => (hf x).norm_sq π•œ #align differentiable.norm_sq Differentiable.norm_sq theorem Differentiable.norm (hf : Differentiable ℝ f) (h0 : βˆ€ x, f x β‰  0) : Differentiable ℝ fun y => β€–f yβ€– := fun x => (hf x).norm π•œ (h0 x) #align differentiable.norm Differentiable.norm theorem Differentiable.dist (hf : Differentiable ℝ f) (hg : Differentiable ℝ g) (hne : βˆ€ x, f x β‰  g x) : Differentiable ℝ fun y => dist (f y) (g y) := fun x => (hf x).dist π•œ (hg x) (hne x) #align differentiable.dist Differentiable.dist theorem DifferentiableWithinAt.norm_sq (hf : DifferentiableWithinAt ℝ f s x) : DifferentiableWithinAt ℝ (fun y => β€–f yβ€– ^ 2) s x := ((contDiffAt_id.norm_sq π•œ).differentiableAt le_rfl).comp_differentiableWithinAt x hf #align differentiable_within_at.norm_sq DifferentiableWithinAt.norm_sq theorem DifferentiableWithinAt.norm (hf : DifferentiableWithinAt ℝ f s x) (h0 : f x β‰  0) : DifferentiableWithinAt ℝ (fun y => β€–f yβ€–) s x := ((contDiffAt_id.norm π•œ h0).differentiableAt le_rfl).comp_differentiableWithinAt x hf #align differentiable_within_at.norm DifferentiableWithinAt.norm theorem DifferentiableWithinAt.dist (hf : DifferentiableWithinAt ℝ f s x) (hg : DifferentiableWithinAt ℝ g s x) (hne : f x β‰  g x) : DifferentiableWithinAt ℝ (fun y => dist (f y) (g y)) s x := by simp only [dist_eq_norm] exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align differentiable_within_at.dist DifferentiableWithinAt.dist theorem DifferentiableOn.norm_sq (hf : DifferentiableOn ℝ f s) : DifferentiableOn ℝ (fun y => β€–f yβ€– ^ 2) s := fun x hx => (hf x hx).norm_sq π•œ #align differentiable_on.norm_sq DifferentiableOn.norm_sq theorem DifferentiableOn.norm (hf : DifferentiableOn ℝ f s) (h0 : βˆ€ x ∈ s, f x β‰  0) : DifferentiableOn ℝ (fun y => β€–f yβ€–) s := fun x hx => (hf x hx).norm π•œ (h0 x hx) #align differentiable_on.norm DifferentiableOn.norm theorem DifferentiableOn.dist (hf : DifferentiableOn ℝ f s) (hg : DifferentiableOn ℝ g s) (hne : βˆ€ x ∈ s, f x β‰  g x) : DifferentiableOn ℝ (fun y => dist (f y) (g y)) s := fun x hx => (hf x hx).dist π•œ (hg x hx) (hne x hx) #align differentiable_on.dist DifferentiableOn.dist end DerivInner section PiLike open ContinuousLinearMap variable {π•œ ΞΉ H : Type*} [IsROrC π•œ] [NormedAddCommGroup H] [NormedSpace π•œ H] [Fintype ΞΉ] {f : H β†’ EuclideanSpace π•œ ΞΉ} {f' : H β†’L[π•œ] EuclideanSpace π•œ ΞΉ} {t : Set H} {y : H} theorem differentiableWithinAt_euclidean : DifferentiableWithinAt π•œ f t y ↔ βˆ€ i, DifferentiableWithinAt π•œ (fun x => f x i) t y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_differentiableWithinAt_iff, differentiableWithinAt_pi] rfl #align differentiable_within_at_euclidean differentiableWithinAt_euclidean theorem differentiableAt_euclidean : DifferentiableAt π•œ f y ↔ βˆ€ i, DifferentiableAt π•œ (fun x => f x i) y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_differentiableAt_iff, differentiableAt_pi] rfl #align differentiable_at_euclidean differentiableAt_euclidean theorem differentiableOn_euclidean : DifferentiableOn π•œ f t ↔ βˆ€ i, DifferentiableOn π•œ (fun x => f x i) t := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_differentiableOn_iff, differentiableOn_pi] rfl #align differentiable_on_euclidean differentiableOn_euclidean theorem differentiable_euclidean : Differentiable π•œ f ↔ βˆ€ i, Differentiable π•œ fun x => f x i := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_differentiable_iff, differentiable_pi] rfl #align differentiable_euclidean differentiable_euclidean theorem hasStrictFDerivAt_euclidean : HasStrictFDerivAt f f' y ↔ βˆ€ i, HasStrictFDerivAt (fun x => f x i) (EuclideanSpace.proj i ∘L f') y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_hasStrictFDerivAt_iff, hasStrictFDerivAt_pi'] rfl #align has_strict_fderiv_at_euclidean hasStrictFDerivAt_euclidean theorem hasFDerivWithinAt_euclidean : HasFDerivWithinAt f f' t y ↔ βˆ€ i, HasFDerivWithinAt (fun x => f x i) (EuclideanSpace.proj i ∘L f') t y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_hasFDerivWithinAt_iff, hasFDerivWithinAt_pi'] rfl #align has_fderiv_within_at_euclidean hasFDerivWithinAt_euclidean theorem contDiffWithinAt_euclidean {n : β„•βˆž} : ContDiffWithinAt π•œ n f t y ↔ βˆ€ i, ContDiffWithinAt π•œ n (fun x => f x i) t y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_contDiffWithinAt_iff, contDiffWithinAt_pi] rfl #align cont_diff_within_at_euclidean contDiffWithinAt_euclidean theorem contDiffAt_euclidean {n : β„•βˆž} : ContDiffAt π•œ n f y ↔ βˆ€ i, ContDiffAt π•œ n (fun x => f x i) y := by
rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_contDiffAt_iff, contDiffAt_pi]
theorem contDiffAt_euclidean {n : β„•βˆž} : ContDiffAt π•œ n f y ↔ βˆ€ i, ContDiffAt π•œ n (fun x => f x i) y := by
Mathlib.Analysis.InnerProductSpace.Calculus.355_0.6FECEGgqdb67QLM
theorem contDiffAt_euclidean {n : β„•βˆž} : ContDiffAt π•œ n f y ↔ βˆ€ i, ContDiffAt π•œ n (fun x => f x i) y
Mathlib_Analysis_InnerProductSpace_Calculus
π•œ : Type u_1 ΞΉ : Type u_2 H : Type u_3 inst✝³ : IsROrC π•œ inst✝² : NormedAddCommGroup H inst✝¹ : NormedSpace π•œ H inst✝ : Fintype ΞΉ f : H β†’ EuclideanSpace π•œ ΞΉ f' : H β†’L[π•œ] EuclideanSpace π•œ ΞΉ t : Set H y : H n : β„•βˆž ⊒ (βˆ€ (i : ΞΉ), ContDiffAt π•œ n (fun x => (⇑(EuclideanSpace.equiv ΞΉ π•œ) ∘ f) x i) y) ↔ βˆ€ (i : ΞΉ), ContDiffAt π•œ n (fun x => f x i) y
/- Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ import Mathlib.Analysis.InnerProductSpace.PiL2 import Mathlib.Analysis.SpecialFunctions.Sqrt import Mathlib.Analysis.NormedSpace.HomeomorphBall #align_import analysis.inner_product_space.calculus from "leanprover-community/mathlib"@"f9dd3204df14a0749cd456fac1e6849dfe7d2b88" /-! # Calculus in inner product spaces In this file we prove that the inner product and square of the norm in an inner space are infinitely `ℝ`-smooth. In order to state these results, we need a `NormedSpace ℝ E` instance. Though we can deduce this structure from `InnerProductSpace π•œ E`, this instance may be not definitionally equal to some other β€œnatural” instance. So, we assume `[NormedSpace ℝ E]`. We also prove that functions to a `EuclideanSpace` are (higher) differentiable if and only if their components are. This follows from the corresponding fact for finite product of normed spaces, and from the equivalence of norms in finite dimensions. ## TODO The last part of the file should be generalized to `PiLp`. -/ noncomputable section open IsROrC Real Filter open scoped BigOperators Classical Topology section DerivInner variable {π•œ E F : Type*} [IsROrC π•œ] variable [NormedAddCommGroup E] [InnerProductSpace π•œ E] variable [NormedAddCommGroup F] [InnerProductSpace ℝ F] local notation "βŸͺ" x ", " y "⟫" => @inner π•œ _ _ x y variable (π•œ) [NormedSpace ℝ E] /-- Derivative of the inner product. -/ def fderivInnerClm (p : E Γ— E) : E Γ— E β†’L[ℝ] π•œ := isBoundedBilinearMap_inner.deriv p #align fderiv_inner_clm fderivInnerClm @[simp] theorem fderivInnerClm_apply (p x : E Γ— E) : fderivInnerClm π•œ p x = βŸͺp.1, x.2⟫ + βŸͺx.1, p.2⟫ := rfl #align fderiv_inner_clm_apply fderivInnerClm_apply variable {π•œ} -- porting note: Lean 3 magically switches back to `{π•œ}` here theorem contDiff_inner {n} : ContDiff ℝ n fun p : E Γ— E => βŸͺp.1, p.2⟫ := isBoundedBilinearMap_inner.contDiff #align cont_diff_inner contDiff_inner theorem contDiffAt_inner {p : E Γ— E} {n} : ContDiffAt ℝ n (fun p : E Γ— E => βŸͺp.1, p.2⟫) p := ContDiff.contDiffAt contDiff_inner #align cont_diff_at_inner contDiffAt_inner theorem differentiable_inner : Differentiable ℝ fun p : E Γ— E => βŸͺp.1, p.2⟫ := isBoundedBilinearMap_inner.differentiableAt #align differentiable_inner differentiable_inner variable (π•œ) variable {G : Type*} [NormedAddCommGroup G] [NormedSpace ℝ G] {f g : G β†’ E} {f' g' : G β†’L[ℝ] E} {s : Set G} {x : G} {n : β„•βˆž} theorem ContDiffWithinAt.inner (hf : ContDiffWithinAt ℝ n f s x) (hg : ContDiffWithinAt ℝ n g s x) : ContDiffWithinAt ℝ n (fun x => βŸͺf x, g x⟫) s x := contDiffAt_inner.comp_contDiffWithinAt x (hf.prod hg) #align cont_diff_within_at.inner ContDiffWithinAt.inner nonrec theorem ContDiffAt.inner (hf : ContDiffAt ℝ n f x) (hg : ContDiffAt ℝ n g x) : ContDiffAt ℝ n (fun x => βŸͺf x, g x⟫) x := hf.inner π•œ hg #align cont_diff_at.inner ContDiffAt.inner theorem ContDiffOn.inner (hf : ContDiffOn ℝ n f s) (hg : ContDiffOn ℝ n g s) : ContDiffOn ℝ n (fun x => βŸͺf x, g x⟫) s := fun x hx => (hf x hx).inner π•œ (hg x hx) #align cont_diff_on.inner ContDiffOn.inner theorem ContDiff.inner (hf : ContDiff ℝ n f) (hg : ContDiff ℝ n g) : ContDiff ℝ n fun x => βŸͺf x, g x⟫ := contDiff_inner.comp (hf.prod hg) #align cont_diff.inner ContDiff.inner theorem HasFDerivWithinAt.inner (hf : HasFDerivWithinAt f f' s x) (hg : HasFDerivWithinAt g g' s x) : HasFDerivWithinAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') s x := (isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp_hasFDerivWithinAt x (hf.prod hg) #align has_fderiv_within_at.inner HasFDerivWithinAt.inner theorem HasStrictFDerivAt.inner (hf : HasStrictFDerivAt f f' x) (hg : HasStrictFDerivAt g g' x) : HasStrictFDerivAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') x := (isBoundedBilinearMap_inner.hasStrictFDerivAt (f x, g x)).comp x (hf.prod hg) #align has_strict_fderiv_at.inner HasStrictFDerivAt.inner theorem HasFDerivAt.inner (hf : HasFDerivAt f f' x) (hg : HasFDerivAt g g' x) : HasFDerivAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') x := (isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp x (hf.prod hg) #align has_fderiv_at.inner HasFDerivAt.inner theorem HasDerivWithinAt.inner {f g : ℝ β†’ E} {f' g' : E} {s : Set ℝ} {x : ℝ} (hf : HasDerivWithinAt f f' s x) (hg : HasDerivWithinAt g g' s x) : HasDerivWithinAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) s x := by simpa using (hf.hasFDerivWithinAt.inner π•œ hg.hasFDerivWithinAt).hasDerivWithinAt #align has_deriv_within_at.inner HasDerivWithinAt.inner theorem HasDerivAt.inner {f g : ℝ β†’ E} {f' g' : E} {x : ℝ} : HasDerivAt f f' x β†’ HasDerivAt g g' x β†’ HasDerivAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) x := by simpa only [← hasDerivWithinAt_univ] using HasDerivWithinAt.inner π•œ #align has_deriv_at.inner HasDerivAt.inner theorem DifferentiableWithinAt.inner (hf : DifferentiableWithinAt ℝ f s x) (hg : DifferentiableWithinAt ℝ g s x) : DifferentiableWithinAt ℝ (fun x => βŸͺf x, g x⟫) s x := ((differentiable_inner _).hasFDerivAt.comp_hasFDerivWithinAt x (hf.prod hg).hasFDerivWithinAt).differentiableWithinAt #align differentiable_within_at.inner DifferentiableWithinAt.inner theorem DifferentiableAt.inner (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) : DifferentiableAt ℝ (fun x => βŸͺf x, g x⟫) x := (differentiable_inner _).comp x (hf.prod hg) #align differentiable_at.inner DifferentiableAt.inner theorem DifferentiableOn.inner (hf : DifferentiableOn ℝ f s) (hg : DifferentiableOn ℝ g s) : DifferentiableOn ℝ (fun x => βŸͺf x, g x⟫) s := fun x hx => (hf x hx).inner π•œ (hg x hx) #align differentiable_on.inner DifferentiableOn.inner theorem Differentiable.inner (hf : Differentiable ℝ f) (hg : Differentiable ℝ g) : Differentiable ℝ fun x => βŸͺf x, g x⟫ := fun x => (hf x).inner π•œ (hg x) #align differentiable.inner Differentiable.inner theorem fderiv_inner_apply (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) (y : G) : fderiv ℝ (fun t => βŸͺf t, g t⟫) x y = βŸͺf x, fderiv ℝ g x y⟫ + βŸͺfderiv ℝ f x y, g x⟫ := by rw [(hf.hasFDerivAt.inner π•œ hg.hasFDerivAt).fderiv]; rfl #align fderiv_inner_apply fderiv_inner_apply theorem deriv_inner_apply {f g : ℝ β†’ E} {x : ℝ} (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) : deriv (fun t => βŸͺf t, g t⟫) x = βŸͺf x, deriv g x⟫ + βŸͺderiv f x, g x⟫ := (hf.hasDerivAt.inner π•œ hg.hasDerivAt).deriv #align deriv_inner_apply deriv_inner_apply theorem contDiff_norm_sq : ContDiff ℝ n fun x : E => β€–xβ€– ^ 2 := by convert (reClm : π•œ β†’L[ℝ] ℝ).contDiff.comp ((contDiff_id (E := E)).inner π•œ (contDiff_id (E := E))) exact (inner_self_eq_norm_sq _).symm #align cont_diff_norm_sq contDiff_norm_sq theorem ContDiff.norm_sq (hf : ContDiff ℝ n f) : ContDiff ℝ n fun x => β€–f xβ€– ^ 2 := (contDiff_norm_sq π•œ).comp hf #align cont_diff.norm_sq ContDiff.norm_sq theorem ContDiffWithinAt.norm_sq (hf : ContDiffWithinAt ℝ n f s x) : ContDiffWithinAt ℝ n (fun y => β€–f yβ€– ^ 2) s x := (contDiff_norm_sq π•œ).contDiffAt.comp_contDiffWithinAt x hf #align cont_diff_within_at.norm_sq ContDiffWithinAt.norm_sq nonrec theorem ContDiffAt.norm_sq (hf : ContDiffAt ℝ n f x) : ContDiffAt ℝ n (β€–f Β·β€– ^ 2) x := hf.norm_sq π•œ #align cont_diff_at.norm_sq ContDiffAt.norm_sq theorem contDiffAt_norm {x : E} (hx : x β‰  0) : ContDiffAt ℝ n norm x := by have : β€–id xβ€– ^ 2 β‰  0 := pow_ne_zero 2 (norm_pos_iff.2 hx).ne' simpa only [id, sqrt_sq, norm_nonneg] using (contDiffAt_id.norm_sq π•œ).sqrt this #align cont_diff_at_norm contDiffAt_norm theorem ContDiffAt.norm (hf : ContDiffAt ℝ n f x) (h0 : f x β‰  0) : ContDiffAt ℝ n (fun y => β€–f yβ€–) x := (contDiffAt_norm π•œ h0).comp x hf #align cont_diff_at.norm ContDiffAt.norm theorem ContDiffAt.dist (hf : ContDiffAt ℝ n f x) (hg : ContDiffAt ℝ n g x) (hne : f x β‰  g x) : ContDiffAt ℝ n (fun y => dist (f y) (g y)) x := by simp only [dist_eq_norm] exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align cont_diff_at.dist ContDiffAt.dist theorem ContDiffWithinAt.norm (hf : ContDiffWithinAt ℝ n f s x) (h0 : f x β‰  0) : ContDiffWithinAt ℝ n (fun y => β€–f yβ€–) s x := (contDiffAt_norm π•œ h0).comp_contDiffWithinAt x hf #align cont_diff_within_at.norm ContDiffWithinAt.norm theorem ContDiffWithinAt.dist (hf : ContDiffWithinAt ℝ n f s x) (hg : ContDiffWithinAt ℝ n g s x) (hne : f x β‰  g x) : ContDiffWithinAt ℝ n (fun y => dist (f y) (g y)) s x := by simp only [dist_eq_norm]; exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align cont_diff_within_at.dist ContDiffWithinAt.dist theorem ContDiffOn.norm_sq (hf : ContDiffOn ℝ n f s) : ContDiffOn ℝ n (fun y => β€–f yβ€– ^ 2) s := fun x hx => (hf x hx).norm_sq π•œ #align cont_diff_on.norm_sq ContDiffOn.norm_sq theorem ContDiffOn.norm (hf : ContDiffOn ℝ n f s) (h0 : βˆ€ x ∈ s, f x β‰  0) : ContDiffOn ℝ n (fun y => β€–f yβ€–) s := fun x hx => (hf x hx).norm π•œ (h0 x hx) #align cont_diff_on.norm ContDiffOn.norm theorem ContDiffOn.dist (hf : ContDiffOn ℝ n f s) (hg : ContDiffOn ℝ n g s) (hne : βˆ€ x ∈ s, f x β‰  g x) : ContDiffOn ℝ n (fun y => dist (f y) (g y)) s := fun x hx => (hf x hx).dist π•œ (hg x hx) (hne x hx) #align cont_diff_on.dist ContDiffOn.dist theorem ContDiff.norm (hf : ContDiff ℝ n f) (h0 : βˆ€ x, f x β‰  0) : ContDiff ℝ n fun y => β€–f yβ€– := contDiff_iff_contDiffAt.2 fun x => hf.contDiffAt.norm π•œ (h0 x) #align cont_diff.norm ContDiff.norm theorem ContDiff.dist (hf : ContDiff ℝ n f) (hg : ContDiff ℝ n g) (hne : βˆ€ x, f x β‰  g x) : ContDiff ℝ n fun y => dist (f y) (g y) := contDiff_iff_contDiffAt.2 fun x => hf.contDiffAt.dist π•œ hg.contDiffAt (hne x) #align cont_diff.dist ContDiff.dist -- porting note: use `2 β€’` instead of `bit0` theorem hasStrictFDerivAt_norm_sq (x : F) : HasStrictFDerivAt (fun x => β€–xβ€– ^ 2) (2 β€’ (innerSL ℝ x)) x := by simp only [sq, ← @inner_self_eq_norm_mul_norm ℝ] convert (hasStrictFDerivAt_id x).inner ℝ (hasStrictFDerivAt_id x) ext y simp [two_smul, real_inner_comm] #align has_strict_fderiv_at_norm_sq hasStrictFDerivAt_norm_sqβ‚“ theorem HasFDerivAt.norm_sq {f : G β†’ F} {f' : G β†’L[ℝ] F} (hf : HasFDerivAt f f' x) : HasFDerivAt (β€–f Β·β€– ^ 2) (2 β€’ (innerSL ℝ (f x)).comp f') x := (hasStrictFDerivAt_norm_sq _).hasFDerivAt.comp x hf theorem HasDerivAt.norm_sq {f : ℝ β†’ F} {f' : F} {x : ℝ} (hf : HasDerivAt f f' x) : HasDerivAt (β€–f Β·β€– ^ 2) (2 * Inner.inner (f x) f') x := by simpa using hf.hasFDerivAt.norm_sq.hasDerivAt theorem HasFDerivWithinAt.norm_sq {f : G β†’ F} {f' : G β†’L[ℝ] F} (hf : HasFDerivWithinAt f f' s x) : HasFDerivWithinAt (β€–f Β·β€– ^ 2) (2 β€’ (innerSL ℝ (f x)).comp f') s x := (hasStrictFDerivAt_norm_sq _).hasFDerivAt.comp_hasFDerivWithinAt x hf theorem HasDerivWithinAt.norm_sq {f : ℝ β†’ F} {f' : F} {s : Set ℝ} {x : ℝ} (hf : HasDerivWithinAt f f' s x) : HasDerivWithinAt (β€–f Β·β€– ^ 2) (2 * Inner.inner (f x) f') s x := by simpa using hf.hasFDerivWithinAt.norm_sq.hasDerivWithinAt theorem DifferentiableAt.norm_sq (hf : DifferentiableAt ℝ f x) : DifferentiableAt ℝ (fun y => β€–f yβ€– ^ 2) x := ((contDiffAt_id.norm_sq π•œ).differentiableAt le_rfl).comp x hf #align differentiable_at.norm_sq DifferentiableAt.norm_sq theorem DifferentiableAt.norm (hf : DifferentiableAt ℝ f x) (h0 : f x β‰  0) : DifferentiableAt ℝ (fun y => β€–f yβ€–) x := ((contDiffAt_norm π•œ h0).differentiableAt le_rfl).comp x hf #align differentiable_at.norm DifferentiableAt.norm theorem DifferentiableAt.dist (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) (hne : f x β‰  g x) : DifferentiableAt ℝ (fun y => dist (f y) (g y)) x := by simp only [dist_eq_norm]; exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align differentiable_at.dist DifferentiableAt.dist theorem Differentiable.norm_sq (hf : Differentiable ℝ f) : Differentiable ℝ fun y => β€–f yβ€– ^ 2 := fun x => (hf x).norm_sq π•œ #align differentiable.norm_sq Differentiable.norm_sq theorem Differentiable.norm (hf : Differentiable ℝ f) (h0 : βˆ€ x, f x β‰  0) : Differentiable ℝ fun y => β€–f yβ€– := fun x => (hf x).norm π•œ (h0 x) #align differentiable.norm Differentiable.norm theorem Differentiable.dist (hf : Differentiable ℝ f) (hg : Differentiable ℝ g) (hne : βˆ€ x, f x β‰  g x) : Differentiable ℝ fun y => dist (f y) (g y) := fun x => (hf x).dist π•œ (hg x) (hne x) #align differentiable.dist Differentiable.dist theorem DifferentiableWithinAt.norm_sq (hf : DifferentiableWithinAt ℝ f s x) : DifferentiableWithinAt ℝ (fun y => β€–f yβ€– ^ 2) s x := ((contDiffAt_id.norm_sq π•œ).differentiableAt le_rfl).comp_differentiableWithinAt x hf #align differentiable_within_at.norm_sq DifferentiableWithinAt.norm_sq theorem DifferentiableWithinAt.norm (hf : DifferentiableWithinAt ℝ f s x) (h0 : f x β‰  0) : DifferentiableWithinAt ℝ (fun y => β€–f yβ€–) s x := ((contDiffAt_id.norm π•œ h0).differentiableAt le_rfl).comp_differentiableWithinAt x hf #align differentiable_within_at.norm DifferentiableWithinAt.norm theorem DifferentiableWithinAt.dist (hf : DifferentiableWithinAt ℝ f s x) (hg : DifferentiableWithinAt ℝ g s x) (hne : f x β‰  g x) : DifferentiableWithinAt ℝ (fun y => dist (f y) (g y)) s x := by simp only [dist_eq_norm] exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align differentiable_within_at.dist DifferentiableWithinAt.dist theorem DifferentiableOn.norm_sq (hf : DifferentiableOn ℝ f s) : DifferentiableOn ℝ (fun y => β€–f yβ€– ^ 2) s := fun x hx => (hf x hx).norm_sq π•œ #align differentiable_on.norm_sq DifferentiableOn.norm_sq theorem DifferentiableOn.norm (hf : DifferentiableOn ℝ f s) (h0 : βˆ€ x ∈ s, f x β‰  0) : DifferentiableOn ℝ (fun y => β€–f yβ€–) s := fun x hx => (hf x hx).norm π•œ (h0 x hx) #align differentiable_on.norm DifferentiableOn.norm theorem DifferentiableOn.dist (hf : DifferentiableOn ℝ f s) (hg : DifferentiableOn ℝ g s) (hne : βˆ€ x ∈ s, f x β‰  g x) : DifferentiableOn ℝ (fun y => dist (f y) (g y)) s := fun x hx => (hf x hx).dist π•œ (hg x hx) (hne x hx) #align differentiable_on.dist DifferentiableOn.dist end DerivInner section PiLike open ContinuousLinearMap variable {π•œ ΞΉ H : Type*} [IsROrC π•œ] [NormedAddCommGroup H] [NormedSpace π•œ H] [Fintype ΞΉ] {f : H β†’ EuclideanSpace π•œ ΞΉ} {f' : H β†’L[π•œ] EuclideanSpace π•œ ΞΉ} {t : Set H} {y : H} theorem differentiableWithinAt_euclidean : DifferentiableWithinAt π•œ f t y ↔ βˆ€ i, DifferentiableWithinAt π•œ (fun x => f x i) t y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_differentiableWithinAt_iff, differentiableWithinAt_pi] rfl #align differentiable_within_at_euclidean differentiableWithinAt_euclidean theorem differentiableAt_euclidean : DifferentiableAt π•œ f y ↔ βˆ€ i, DifferentiableAt π•œ (fun x => f x i) y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_differentiableAt_iff, differentiableAt_pi] rfl #align differentiable_at_euclidean differentiableAt_euclidean theorem differentiableOn_euclidean : DifferentiableOn π•œ f t ↔ βˆ€ i, DifferentiableOn π•œ (fun x => f x i) t := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_differentiableOn_iff, differentiableOn_pi] rfl #align differentiable_on_euclidean differentiableOn_euclidean theorem differentiable_euclidean : Differentiable π•œ f ↔ βˆ€ i, Differentiable π•œ fun x => f x i := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_differentiable_iff, differentiable_pi] rfl #align differentiable_euclidean differentiable_euclidean theorem hasStrictFDerivAt_euclidean : HasStrictFDerivAt f f' y ↔ βˆ€ i, HasStrictFDerivAt (fun x => f x i) (EuclideanSpace.proj i ∘L f') y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_hasStrictFDerivAt_iff, hasStrictFDerivAt_pi'] rfl #align has_strict_fderiv_at_euclidean hasStrictFDerivAt_euclidean theorem hasFDerivWithinAt_euclidean : HasFDerivWithinAt f f' t y ↔ βˆ€ i, HasFDerivWithinAt (fun x => f x i) (EuclideanSpace.proj i ∘L f') t y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_hasFDerivWithinAt_iff, hasFDerivWithinAt_pi'] rfl #align has_fderiv_within_at_euclidean hasFDerivWithinAt_euclidean theorem contDiffWithinAt_euclidean {n : β„•βˆž} : ContDiffWithinAt π•œ n f t y ↔ βˆ€ i, ContDiffWithinAt π•œ n (fun x => f x i) t y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_contDiffWithinAt_iff, contDiffWithinAt_pi] rfl #align cont_diff_within_at_euclidean contDiffWithinAt_euclidean theorem contDiffAt_euclidean {n : β„•βˆž} : ContDiffAt π•œ n f y ↔ βˆ€ i, ContDiffAt π•œ n (fun x => f x i) y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_contDiffAt_iff, contDiffAt_pi]
rfl
theorem contDiffAt_euclidean {n : β„•βˆž} : ContDiffAt π•œ n f y ↔ βˆ€ i, ContDiffAt π•œ n (fun x => f x i) y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_contDiffAt_iff, contDiffAt_pi]
Mathlib.Analysis.InnerProductSpace.Calculus.355_0.6FECEGgqdb67QLM
theorem contDiffAt_euclidean {n : β„•βˆž} : ContDiffAt π•œ n f y ↔ βˆ€ i, ContDiffAt π•œ n (fun x => f x i) y
Mathlib_Analysis_InnerProductSpace_Calculus
π•œ : Type u_1 ΞΉ : Type u_2 H : Type u_3 inst✝³ : IsROrC π•œ inst✝² : NormedAddCommGroup H inst✝¹ : NormedSpace π•œ H inst✝ : Fintype ΞΉ f : H β†’ EuclideanSpace π•œ ΞΉ f' : H β†’L[π•œ] EuclideanSpace π•œ ΞΉ t : Set H y : H n : β„•βˆž ⊒ ContDiffOn π•œ n f t ↔ βˆ€ (i : ΞΉ), ContDiffOn π•œ n (fun x => f x i) t
/- Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ import Mathlib.Analysis.InnerProductSpace.PiL2 import Mathlib.Analysis.SpecialFunctions.Sqrt import Mathlib.Analysis.NormedSpace.HomeomorphBall #align_import analysis.inner_product_space.calculus from "leanprover-community/mathlib"@"f9dd3204df14a0749cd456fac1e6849dfe7d2b88" /-! # Calculus in inner product spaces In this file we prove that the inner product and square of the norm in an inner space are infinitely `ℝ`-smooth. In order to state these results, we need a `NormedSpace ℝ E` instance. Though we can deduce this structure from `InnerProductSpace π•œ E`, this instance may be not definitionally equal to some other β€œnatural” instance. So, we assume `[NormedSpace ℝ E]`. We also prove that functions to a `EuclideanSpace` are (higher) differentiable if and only if their components are. This follows from the corresponding fact for finite product of normed spaces, and from the equivalence of norms in finite dimensions. ## TODO The last part of the file should be generalized to `PiLp`. -/ noncomputable section open IsROrC Real Filter open scoped BigOperators Classical Topology section DerivInner variable {π•œ E F : Type*} [IsROrC π•œ] variable [NormedAddCommGroup E] [InnerProductSpace π•œ E] variable [NormedAddCommGroup F] [InnerProductSpace ℝ F] local notation "βŸͺ" x ", " y "⟫" => @inner π•œ _ _ x y variable (π•œ) [NormedSpace ℝ E] /-- Derivative of the inner product. -/ def fderivInnerClm (p : E Γ— E) : E Γ— E β†’L[ℝ] π•œ := isBoundedBilinearMap_inner.deriv p #align fderiv_inner_clm fderivInnerClm @[simp] theorem fderivInnerClm_apply (p x : E Γ— E) : fderivInnerClm π•œ p x = βŸͺp.1, x.2⟫ + βŸͺx.1, p.2⟫ := rfl #align fderiv_inner_clm_apply fderivInnerClm_apply variable {π•œ} -- porting note: Lean 3 magically switches back to `{π•œ}` here theorem contDiff_inner {n} : ContDiff ℝ n fun p : E Γ— E => βŸͺp.1, p.2⟫ := isBoundedBilinearMap_inner.contDiff #align cont_diff_inner contDiff_inner theorem contDiffAt_inner {p : E Γ— E} {n} : ContDiffAt ℝ n (fun p : E Γ— E => βŸͺp.1, p.2⟫) p := ContDiff.contDiffAt contDiff_inner #align cont_diff_at_inner contDiffAt_inner theorem differentiable_inner : Differentiable ℝ fun p : E Γ— E => βŸͺp.1, p.2⟫ := isBoundedBilinearMap_inner.differentiableAt #align differentiable_inner differentiable_inner variable (π•œ) variable {G : Type*} [NormedAddCommGroup G] [NormedSpace ℝ G] {f g : G β†’ E} {f' g' : G β†’L[ℝ] E} {s : Set G} {x : G} {n : β„•βˆž} theorem ContDiffWithinAt.inner (hf : ContDiffWithinAt ℝ n f s x) (hg : ContDiffWithinAt ℝ n g s x) : ContDiffWithinAt ℝ n (fun x => βŸͺf x, g x⟫) s x := contDiffAt_inner.comp_contDiffWithinAt x (hf.prod hg) #align cont_diff_within_at.inner ContDiffWithinAt.inner nonrec theorem ContDiffAt.inner (hf : ContDiffAt ℝ n f x) (hg : ContDiffAt ℝ n g x) : ContDiffAt ℝ n (fun x => βŸͺf x, g x⟫) x := hf.inner π•œ hg #align cont_diff_at.inner ContDiffAt.inner theorem ContDiffOn.inner (hf : ContDiffOn ℝ n f s) (hg : ContDiffOn ℝ n g s) : ContDiffOn ℝ n (fun x => βŸͺf x, g x⟫) s := fun x hx => (hf x hx).inner π•œ (hg x hx) #align cont_diff_on.inner ContDiffOn.inner theorem ContDiff.inner (hf : ContDiff ℝ n f) (hg : ContDiff ℝ n g) : ContDiff ℝ n fun x => βŸͺf x, g x⟫ := contDiff_inner.comp (hf.prod hg) #align cont_diff.inner ContDiff.inner theorem HasFDerivWithinAt.inner (hf : HasFDerivWithinAt f f' s x) (hg : HasFDerivWithinAt g g' s x) : HasFDerivWithinAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') s x := (isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp_hasFDerivWithinAt x (hf.prod hg) #align has_fderiv_within_at.inner HasFDerivWithinAt.inner theorem HasStrictFDerivAt.inner (hf : HasStrictFDerivAt f f' x) (hg : HasStrictFDerivAt g g' x) : HasStrictFDerivAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') x := (isBoundedBilinearMap_inner.hasStrictFDerivAt (f x, g x)).comp x (hf.prod hg) #align has_strict_fderiv_at.inner HasStrictFDerivAt.inner theorem HasFDerivAt.inner (hf : HasFDerivAt f f' x) (hg : HasFDerivAt g g' x) : HasFDerivAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') x := (isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp x (hf.prod hg) #align has_fderiv_at.inner HasFDerivAt.inner theorem HasDerivWithinAt.inner {f g : ℝ β†’ E} {f' g' : E} {s : Set ℝ} {x : ℝ} (hf : HasDerivWithinAt f f' s x) (hg : HasDerivWithinAt g g' s x) : HasDerivWithinAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) s x := by simpa using (hf.hasFDerivWithinAt.inner π•œ hg.hasFDerivWithinAt).hasDerivWithinAt #align has_deriv_within_at.inner HasDerivWithinAt.inner theorem HasDerivAt.inner {f g : ℝ β†’ E} {f' g' : E} {x : ℝ} : HasDerivAt f f' x β†’ HasDerivAt g g' x β†’ HasDerivAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) x := by simpa only [← hasDerivWithinAt_univ] using HasDerivWithinAt.inner π•œ #align has_deriv_at.inner HasDerivAt.inner theorem DifferentiableWithinAt.inner (hf : DifferentiableWithinAt ℝ f s x) (hg : DifferentiableWithinAt ℝ g s x) : DifferentiableWithinAt ℝ (fun x => βŸͺf x, g x⟫) s x := ((differentiable_inner _).hasFDerivAt.comp_hasFDerivWithinAt x (hf.prod hg).hasFDerivWithinAt).differentiableWithinAt #align differentiable_within_at.inner DifferentiableWithinAt.inner theorem DifferentiableAt.inner (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) : DifferentiableAt ℝ (fun x => βŸͺf x, g x⟫) x := (differentiable_inner _).comp x (hf.prod hg) #align differentiable_at.inner DifferentiableAt.inner theorem DifferentiableOn.inner (hf : DifferentiableOn ℝ f s) (hg : DifferentiableOn ℝ g s) : DifferentiableOn ℝ (fun x => βŸͺf x, g x⟫) s := fun x hx => (hf x hx).inner π•œ (hg x hx) #align differentiable_on.inner DifferentiableOn.inner theorem Differentiable.inner (hf : Differentiable ℝ f) (hg : Differentiable ℝ g) : Differentiable ℝ fun x => βŸͺf x, g x⟫ := fun x => (hf x).inner π•œ (hg x) #align differentiable.inner Differentiable.inner theorem fderiv_inner_apply (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) (y : G) : fderiv ℝ (fun t => βŸͺf t, g t⟫) x y = βŸͺf x, fderiv ℝ g x y⟫ + βŸͺfderiv ℝ f x y, g x⟫ := by rw [(hf.hasFDerivAt.inner π•œ hg.hasFDerivAt).fderiv]; rfl #align fderiv_inner_apply fderiv_inner_apply theorem deriv_inner_apply {f g : ℝ β†’ E} {x : ℝ} (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) : deriv (fun t => βŸͺf t, g t⟫) x = βŸͺf x, deriv g x⟫ + βŸͺderiv f x, g x⟫ := (hf.hasDerivAt.inner π•œ hg.hasDerivAt).deriv #align deriv_inner_apply deriv_inner_apply theorem contDiff_norm_sq : ContDiff ℝ n fun x : E => β€–xβ€– ^ 2 := by convert (reClm : π•œ β†’L[ℝ] ℝ).contDiff.comp ((contDiff_id (E := E)).inner π•œ (contDiff_id (E := E))) exact (inner_self_eq_norm_sq _).symm #align cont_diff_norm_sq contDiff_norm_sq theorem ContDiff.norm_sq (hf : ContDiff ℝ n f) : ContDiff ℝ n fun x => β€–f xβ€– ^ 2 := (contDiff_norm_sq π•œ).comp hf #align cont_diff.norm_sq ContDiff.norm_sq theorem ContDiffWithinAt.norm_sq (hf : ContDiffWithinAt ℝ n f s x) : ContDiffWithinAt ℝ n (fun y => β€–f yβ€– ^ 2) s x := (contDiff_norm_sq π•œ).contDiffAt.comp_contDiffWithinAt x hf #align cont_diff_within_at.norm_sq ContDiffWithinAt.norm_sq nonrec theorem ContDiffAt.norm_sq (hf : ContDiffAt ℝ n f x) : ContDiffAt ℝ n (β€–f Β·β€– ^ 2) x := hf.norm_sq π•œ #align cont_diff_at.norm_sq ContDiffAt.norm_sq theorem contDiffAt_norm {x : E} (hx : x β‰  0) : ContDiffAt ℝ n norm x := by have : β€–id xβ€– ^ 2 β‰  0 := pow_ne_zero 2 (norm_pos_iff.2 hx).ne' simpa only [id, sqrt_sq, norm_nonneg] using (contDiffAt_id.norm_sq π•œ).sqrt this #align cont_diff_at_norm contDiffAt_norm theorem ContDiffAt.norm (hf : ContDiffAt ℝ n f x) (h0 : f x β‰  0) : ContDiffAt ℝ n (fun y => β€–f yβ€–) x := (contDiffAt_norm π•œ h0).comp x hf #align cont_diff_at.norm ContDiffAt.norm theorem ContDiffAt.dist (hf : ContDiffAt ℝ n f x) (hg : ContDiffAt ℝ n g x) (hne : f x β‰  g x) : ContDiffAt ℝ n (fun y => dist (f y) (g y)) x := by simp only [dist_eq_norm] exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align cont_diff_at.dist ContDiffAt.dist theorem ContDiffWithinAt.norm (hf : ContDiffWithinAt ℝ n f s x) (h0 : f x β‰  0) : ContDiffWithinAt ℝ n (fun y => β€–f yβ€–) s x := (contDiffAt_norm π•œ h0).comp_contDiffWithinAt x hf #align cont_diff_within_at.norm ContDiffWithinAt.norm theorem ContDiffWithinAt.dist (hf : ContDiffWithinAt ℝ n f s x) (hg : ContDiffWithinAt ℝ n g s x) (hne : f x β‰  g x) : ContDiffWithinAt ℝ n (fun y => dist (f y) (g y)) s x := by simp only [dist_eq_norm]; exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align cont_diff_within_at.dist ContDiffWithinAt.dist theorem ContDiffOn.norm_sq (hf : ContDiffOn ℝ n f s) : ContDiffOn ℝ n (fun y => β€–f yβ€– ^ 2) s := fun x hx => (hf x hx).norm_sq π•œ #align cont_diff_on.norm_sq ContDiffOn.norm_sq theorem ContDiffOn.norm (hf : ContDiffOn ℝ n f s) (h0 : βˆ€ x ∈ s, f x β‰  0) : ContDiffOn ℝ n (fun y => β€–f yβ€–) s := fun x hx => (hf x hx).norm π•œ (h0 x hx) #align cont_diff_on.norm ContDiffOn.norm theorem ContDiffOn.dist (hf : ContDiffOn ℝ n f s) (hg : ContDiffOn ℝ n g s) (hne : βˆ€ x ∈ s, f x β‰  g x) : ContDiffOn ℝ n (fun y => dist (f y) (g y)) s := fun x hx => (hf x hx).dist π•œ (hg x hx) (hne x hx) #align cont_diff_on.dist ContDiffOn.dist theorem ContDiff.norm (hf : ContDiff ℝ n f) (h0 : βˆ€ x, f x β‰  0) : ContDiff ℝ n fun y => β€–f yβ€– := contDiff_iff_contDiffAt.2 fun x => hf.contDiffAt.norm π•œ (h0 x) #align cont_diff.norm ContDiff.norm theorem ContDiff.dist (hf : ContDiff ℝ n f) (hg : ContDiff ℝ n g) (hne : βˆ€ x, f x β‰  g x) : ContDiff ℝ n fun y => dist (f y) (g y) := contDiff_iff_contDiffAt.2 fun x => hf.contDiffAt.dist π•œ hg.contDiffAt (hne x) #align cont_diff.dist ContDiff.dist -- porting note: use `2 β€’` instead of `bit0` theorem hasStrictFDerivAt_norm_sq (x : F) : HasStrictFDerivAt (fun x => β€–xβ€– ^ 2) (2 β€’ (innerSL ℝ x)) x := by simp only [sq, ← @inner_self_eq_norm_mul_norm ℝ] convert (hasStrictFDerivAt_id x).inner ℝ (hasStrictFDerivAt_id x) ext y simp [two_smul, real_inner_comm] #align has_strict_fderiv_at_norm_sq hasStrictFDerivAt_norm_sqβ‚“ theorem HasFDerivAt.norm_sq {f : G β†’ F} {f' : G β†’L[ℝ] F} (hf : HasFDerivAt f f' x) : HasFDerivAt (β€–f Β·β€– ^ 2) (2 β€’ (innerSL ℝ (f x)).comp f') x := (hasStrictFDerivAt_norm_sq _).hasFDerivAt.comp x hf theorem HasDerivAt.norm_sq {f : ℝ β†’ F} {f' : F} {x : ℝ} (hf : HasDerivAt f f' x) : HasDerivAt (β€–f Β·β€– ^ 2) (2 * Inner.inner (f x) f') x := by simpa using hf.hasFDerivAt.norm_sq.hasDerivAt theorem HasFDerivWithinAt.norm_sq {f : G β†’ F} {f' : G β†’L[ℝ] F} (hf : HasFDerivWithinAt f f' s x) : HasFDerivWithinAt (β€–f Β·β€– ^ 2) (2 β€’ (innerSL ℝ (f x)).comp f') s x := (hasStrictFDerivAt_norm_sq _).hasFDerivAt.comp_hasFDerivWithinAt x hf theorem HasDerivWithinAt.norm_sq {f : ℝ β†’ F} {f' : F} {s : Set ℝ} {x : ℝ} (hf : HasDerivWithinAt f f' s x) : HasDerivWithinAt (β€–f Β·β€– ^ 2) (2 * Inner.inner (f x) f') s x := by simpa using hf.hasFDerivWithinAt.norm_sq.hasDerivWithinAt theorem DifferentiableAt.norm_sq (hf : DifferentiableAt ℝ f x) : DifferentiableAt ℝ (fun y => β€–f yβ€– ^ 2) x := ((contDiffAt_id.norm_sq π•œ).differentiableAt le_rfl).comp x hf #align differentiable_at.norm_sq DifferentiableAt.norm_sq theorem DifferentiableAt.norm (hf : DifferentiableAt ℝ f x) (h0 : f x β‰  0) : DifferentiableAt ℝ (fun y => β€–f yβ€–) x := ((contDiffAt_norm π•œ h0).differentiableAt le_rfl).comp x hf #align differentiable_at.norm DifferentiableAt.norm theorem DifferentiableAt.dist (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) (hne : f x β‰  g x) : DifferentiableAt ℝ (fun y => dist (f y) (g y)) x := by simp only [dist_eq_norm]; exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align differentiable_at.dist DifferentiableAt.dist theorem Differentiable.norm_sq (hf : Differentiable ℝ f) : Differentiable ℝ fun y => β€–f yβ€– ^ 2 := fun x => (hf x).norm_sq π•œ #align differentiable.norm_sq Differentiable.norm_sq theorem Differentiable.norm (hf : Differentiable ℝ f) (h0 : βˆ€ x, f x β‰  0) : Differentiable ℝ fun y => β€–f yβ€– := fun x => (hf x).norm π•œ (h0 x) #align differentiable.norm Differentiable.norm theorem Differentiable.dist (hf : Differentiable ℝ f) (hg : Differentiable ℝ g) (hne : βˆ€ x, f x β‰  g x) : Differentiable ℝ fun y => dist (f y) (g y) := fun x => (hf x).dist π•œ (hg x) (hne x) #align differentiable.dist Differentiable.dist theorem DifferentiableWithinAt.norm_sq (hf : DifferentiableWithinAt ℝ f s x) : DifferentiableWithinAt ℝ (fun y => β€–f yβ€– ^ 2) s x := ((contDiffAt_id.norm_sq π•œ).differentiableAt le_rfl).comp_differentiableWithinAt x hf #align differentiable_within_at.norm_sq DifferentiableWithinAt.norm_sq theorem DifferentiableWithinAt.norm (hf : DifferentiableWithinAt ℝ f s x) (h0 : f x β‰  0) : DifferentiableWithinAt ℝ (fun y => β€–f yβ€–) s x := ((contDiffAt_id.norm π•œ h0).differentiableAt le_rfl).comp_differentiableWithinAt x hf #align differentiable_within_at.norm DifferentiableWithinAt.norm theorem DifferentiableWithinAt.dist (hf : DifferentiableWithinAt ℝ f s x) (hg : DifferentiableWithinAt ℝ g s x) (hne : f x β‰  g x) : DifferentiableWithinAt ℝ (fun y => dist (f y) (g y)) s x := by simp only [dist_eq_norm] exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align differentiable_within_at.dist DifferentiableWithinAt.dist theorem DifferentiableOn.norm_sq (hf : DifferentiableOn ℝ f s) : DifferentiableOn ℝ (fun y => β€–f yβ€– ^ 2) s := fun x hx => (hf x hx).norm_sq π•œ #align differentiable_on.norm_sq DifferentiableOn.norm_sq theorem DifferentiableOn.norm (hf : DifferentiableOn ℝ f s) (h0 : βˆ€ x ∈ s, f x β‰  0) : DifferentiableOn ℝ (fun y => β€–f yβ€–) s := fun x hx => (hf x hx).norm π•œ (h0 x hx) #align differentiable_on.norm DifferentiableOn.norm theorem DifferentiableOn.dist (hf : DifferentiableOn ℝ f s) (hg : DifferentiableOn ℝ g s) (hne : βˆ€ x ∈ s, f x β‰  g x) : DifferentiableOn ℝ (fun y => dist (f y) (g y)) s := fun x hx => (hf x hx).dist π•œ (hg x hx) (hne x hx) #align differentiable_on.dist DifferentiableOn.dist end DerivInner section PiLike open ContinuousLinearMap variable {π•œ ΞΉ H : Type*} [IsROrC π•œ] [NormedAddCommGroup H] [NormedSpace π•œ H] [Fintype ΞΉ] {f : H β†’ EuclideanSpace π•œ ΞΉ} {f' : H β†’L[π•œ] EuclideanSpace π•œ ΞΉ} {t : Set H} {y : H} theorem differentiableWithinAt_euclidean : DifferentiableWithinAt π•œ f t y ↔ βˆ€ i, DifferentiableWithinAt π•œ (fun x => f x i) t y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_differentiableWithinAt_iff, differentiableWithinAt_pi] rfl #align differentiable_within_at_euclidean differentiableWithinAt_euclidean theorem differentiableAt_euclidean : DifferentiableAt π•œ f y ↔ βˆ€ i, DifferentiableAt π•œ (fun x => f x i) y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_differentiableAt_iff, differentiableAt_pi] rfl #align differentiable_at_euclidean differentiableAt_euclidean theorem differentiableOn_euclidean : DifferentiableOn π•œ f t ↔ βˆ€ i, DifferentiableOn π•œ (fun x => f x i) t := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_differentiableOn_iff, differentiableOn_pi] rfl #align differentiable_on_euclidean differentiableOn_euclidean theorem differentiable_euclidean : Differentiable π•œ f ↔ βˆ€ i, Differentiable π•œ fun x => f x i := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_differentiable_iff, differentiable_pi] rfl #align differentiable_euclidean differentiable_euclidean theorem hasStrictFDerivAt_euclidean : HasStrictFDerivAt f f' y ↔ βˆ€ i, HasStrictFDerivAt (fun x => f x i) (EuclideanSpace.proj i ∘L f') y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_hasStrictFDerivAt_iff, hasStrictFDerivAt_pi'] rfl #align has_strict_fderiv_at_euclidean hasStrictFDerivAt_euclidean theorem hasFDerivWithinAt_euclidean : HasFDerivWithinAt f f' t y ↔ βˆ€ i, HasFDerivWithinAt (fun x => f x i) (EuclideanSpace.proj i ∘L f') t y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_hasFDerivWithinAt_iff, hasFDerivWithinAt_pi'] rfl #align has_fderiv_within_at_euclidean hasFDerivWithinAt_euclidean theorem contDiffWithinAt_euclidean {n : β„•βˆž} : ContDiffWithinAt π•œ n f t y ↔ βˆ€ i, ContDiffWithinAt π•œ n (fun x => f x i) t y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_contDiffWithinAt_iff, contDiffWithinAt_pi] rfl #align cont_diff_within_at_euclidean contDiffWithinAt_euclidean theorem contDiffAt_euclidean {n : β„•βˆž} : ContDiffAt π•œ n f y ↔ βˆ€ i, ContDiffAt π•œ n (fun x => f x i) y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_contDiffAt_iff, contDiffAt_pi] rfl #align cont_diff_at_euclidean contDiffAt_euclidean theorem contDiffOn_euclidean {n : β„•βˆž} : ContDiffOn π•œ n f t ↔ βˆ€ i, ContDiffOn π•œ n (fun x => f x i) t := by
rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_contDiffOn_iff, contDiffOn_pi]
theorem contDiffOn_euclidean {n : β„•βˆž} : ContDiffOn π•œ n f t ↔ βˆ€ i, ContDiffOn π•œ n (fun x => f x i) t := by
Mathlib.Analysis.InnerProductSpace.Calculus.361_0.6FECEGgqdb67QLM
theorem contDiffOn_euclidean {n : β„•βˆž} : ContDiffOn π•œ n f t ↔ βˆ€ i, ContDiffOn π•œ n (fun x => f x i) t
Mathlib_Analysis_InnerProductSpace_Calculus
π•œ : Type u_1 ΞΉ : Type u_2 H : Type u_3 inst✝³ : IsROrC π•œ inst✝² : NormedAddCommGroup H inst✝¹ : NormedSpace π•œ H inst✝ : Fintype ΞΉ f : H β†’ EuclideanSpace π•œ ΞΉ f' : H β†’L[π•œ] EuclideanSpace π•œ ΞΉ t : Set H y : H n : β„•βˆž ⊒ (βˆ€ (i : ΞΉ), ContDiffOn π•œ n (fun x => (⇑(EuclideanSpace.equiv ΞΉ π•œ) ∘ f) x i) t) ↔ βˆ€ (i : ΞΉ), ContDiffOn π•œ n (fun x => f x i) t
/- Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ import Mathlib.Analysis.InnerProductSpace.PiL2 import Mathlib.Analysis.SpecialFunctions.Sqrt import Mathlib.Analysis.NormedSpace.HomeomorphBall #align_import analysis.inner_product_space.calculus from "leanprover-community/mathlib"@"f9dd3204df14a0749cd456fac1e6849dfe7d2b88" /-! # Calculus in inner product spaces In this file we prove that the inner product and square of the norm in an inner space are infinitely `ℝ`-smooth. In order to state these results, we need a `NormedSpace ℝ E` instance. Though we can deduce this structure from `InnerProductSpace π•œ E`, this instance may be not definitionally equal to some other β€œnatural” instance. So, we assume `[NormedSpace ℝ E]`. We also prove that functions to a `EuclideanSpace` are (higher) differentiable if and only if their components are. This follows from the corresponding fact for finite product of normed spaces, and from the equivalence of norms in finite dimensions. ## TODO The last part of the file should be generalized to `PiLp`. -/ noncomputable section open IsROrC Real Filter open scoped BigOperators Classical Topology section DerivInner variable {π•œ E F : Type*} [IsROrC π•œ] variable [NormedAddCommGroup E] [InnerProductSpace π•œ E] variable [NormedAddCommGroup F] [InnerProductSpace ℝ F] local notation "βŸͺ" x ", " y "⟫" => @inner π•œ _ _ x y variable (π•œ) [NormedSpace ℝ E] /-- Derivative of the inner product. -/ def fderivInnerClm (p : E Γ— E) : E Γ— E β†’L[ℝ] π•œ := isBoundedBilinearMap_inner.deriv p #align fderiv_inner_clm fderivInnerClm @[simp] theorem fderivInnerClm_apply (p x : E Γ— E) : fderivInnerClm π•œ p x = βŸͺp.1, x.2⟫ + βŸͺx.1, p.2⟫ := rfl #align fderiv_inner_clm_apply fderivInnerClm_apply variable {π•œ} -- porting note: Lean 3 magically switches back to `{π•œ}` here theorem contDiff_inner {n} : ContDiff ℝ n fun p : E Γ— E => βŸͺp.1, p.2⟫ := isBoundedBilinearMap_inner.contDiff #align cont_diff_inner contDiff_inner theorem contDiffAt_inner {p : E Γ— E} {n} : ContDiffAt ℝ n (fun p : E Γ— E => βŸͺp.1, p.2⟫) p := ContDiff.contDiffAt contDiff_inner #align cont_diff_at_inner contDiffAt_inner theorem differentiable_inner : Differentiable ℝ fun p : E Γ— E => βŸͺp.1, p.2⟫ := isBoundedBilinearMap_inner.differentiableAt #align differentiable_inner differentiable_inner variable (π•œ) variable {G : Type*} [NormedAddCommGroup G] [NormedSpace ℝ G] {f g : G β†’ E} {f' g' : G β†’L[ℝ] E} {s : Set G} {x : G} {n : β„•βˆž} theorem ContDiffWithinAt.inner (hf : ContDiffWithinAt ℝ n f s x) (hg : ContDiffWithinAt ℝ n g s x) : ContDiffWithinAt ℝ n (fun x => βŸͺf x, g x⟫) s x := contDiffAt_inner.comp_contDiffWithinAt x (hf.prod hg) #align cont_diff_within_at.inner ContDiffWithinAt.inner nonrec theorem ContDiffAt.inner (hf : ContDiffAt ℝ n f x) (hg : ContDiffAt ℝ n g x) : ContDiffAt ℝ n (fun x => βŸͺf x, g x⟫) x := hf.inner π•œ hg #align cont_diff_at.inner ContDiffAt.inner theorem ContDiffOn.inner (hf : ContDiffOn ℝ n f s) (hg : ContDiffOn ℝ n g s) : ContDiffOn ℝ n (fun x => βŸͺf x, g x⟫) s := fun x hx => (hf x hx).inner π•œ (hg x hx) #align cont_diff_on.inner ContDiffOn.inner theorem ContDiff.inner (hf : ContDiff ℝ n f) (hg : ContDiff ℝ n g) : ContDiff ℝ n fun x => βŸͺf x, g x⟫ := contDiff_inner.comp (hf.prod hg) #align cont_diff.inner ContDiff.inner theorem HasFDerivWithinAt.inner (hf : HasFDerivWithinAt f f' s x) (hg : HasFDerivWithinAt g g' s x) : HasFDerivWithinAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') s x := (isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp_hasFDerivWithinAt x (hf.prod hg) #align has_fderiv_within_at.inner HasFDerivWithinAt.inner theorem HasStrictFDerivAt.inner (hf : HasStrictFDerivAt f f' x) (hg : HasStrictFDerivAt g g' x) : HasStrictFDerivAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') x := (isBoundedBilinearMap_inner.hasStrictFDerivAt (f x, g x)).comp x (hf.prod hg) #align has_strict_fderiv_at.inner HasStrictFDerivAt.inner theorem HasFDerivAt.inner (hf : HasFDerivAt f f' x) (hg : HasFDerivAt g g' x) : HasFDerivAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') x := (isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp x (hf.prod hg) #align has_fderiv_at.inner HasFDerivAt.inner theorem HasDerivWithinAt.inner {f g : ℝ β†’ E} {f' g' : E} {s : Set ℝ} {x : ℝ} (hf : HasDerivWithinAt f f' s x) (hg : HasDerivWithinAt g g' s x) : HasDerivWithinAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) s x := by simpa using (hf.hasFDerivWithinAt.inner π•œ hg.hasFDerivWithinAt).hasDerivWithinAt #align has_deriv_within_at.inner HasDerivWithinAt.inner theorem HasDerivAt.inner {f g : ℝ β†’ E} {f' g' : E} {x : ℝ} : HasDerivAt f f' x β†’ HasDerivAt g g' x β†’ HasDerivAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) x := by simpa only [← hasDerivWithinAt_univ] using HasDerivWithinAt.inner π•œ #align has_deriv_at.inner HasDerivAt.inner theorem DifferentiableWithinAt.inner (hf : DifferentiableWithinAt ℝ f s x) (hg : DifferentiableWithinAt ℝ g s x) : DifferentiableWithinAt ℝ (fun x => βŸͺf x, g x⟫) s x := ((differentiable_inner _).hasFDerivAt.comp_hasFDerivWithinAt x (hf.prod hg).hasFDerivWithinAt).differentiableWithinAt #align differentiable_within_at.inner DifferentiableWithinAt.inner theorem DifferentiableAt.inner (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) : DifferentiableAt ℝ (fun x => βŸͺf x, g x⟫) x := (differentiable_inner _).comp x (hf.prod hg) #align differentiable_at.inner DifferentiableAt.inner theorem DifferentiableOn.inner (hf : DifferentiableOn ℝ f s) (hg : DifferentiableOn ℝ g s) : DifferentiableOn ℝ (fun x => βŸͺf x, g x⟫) s := fun x hx => (hf x hx).inner π•œ (hg x hx) #align differentiable_on.inner DifferentiableOn.inner theorem Differentiable.inner (hf : Differentiable ℝ f) (hg : Differentiable ℝ g) : Differentiable ℝ fun x => βŸͺf x, g x⟫ := fun x => (hf x).inner π•œ (hg x) #align differentiable.inner Differentiable.inner theorem fderiv_inner_apply (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) (y : G) : fderiv ℝ (fun t => βŸͺf t, g t⟫) x y = βŸͺf x, fderiv ℝ g x y⟫ + βŸͺfderiv ℝ f x y, g x⟫ := by rw [(hf.hasFDerivAt.inner π•œ hg.hasFDerivAt).fderiv]; rfl #align fderiv_inner_apply fderiv_inner_apply theorem deriv_inner_apply {f g : ℝ β†’ E} {x : ℝ} (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) : deriv (fun t => βŸͺf t, g t⟫) x = βŸͺf x, deriv g x⟫ + βŸͺderiv f x, g x⟫ := (hf.hasDerivAt.inner π•œ hg.hasDerivAt).deriv #align deriv_inner_apply deriv_inner_apply theorem contDiff_norm_sq : ContDiff ℝ n fun x : E => β€–xβ€– ^ 2 := by convert (reClm : π•œ β†’L[ℝ] ℝ).contDiff.comp ((contDiff_id (E := E)).inner π•œ (contDiff_id (E := E))) exact (inner_self_eq_norm_sq _).symm #align cont_diff_norm_sq contDiff_norm_sq theorem ContDiff.norm_sq (hf : ContDiff ℝ n f) : ContDiff ℝ n fun x => β€–f xβ€– ^ 2 := (contDiff_norm_sq π•œ).comp hf #align cont_diff.norm_sq ContDiff.norm_sq theorem ContDiffWithinAt.norm_sq (hf : ContDiffWithinAt ℝ n f s x) : ContDiffWithinAt ℝ n (fun y => β€–f yβ€– ^ 2) s x := (contDiff_norm_sq π•œ).contDiffAt.comp_contDiffWithinAt x hf #align cont_diff_within_at.norm_sq ContDiffWithinAt.norm_sq nonrec theorem ContDiffAt.norm_sq (hf : ContDiffAt ℝ n f x) : ContDiffAt ℝ n (β€–f Β·β€– ^ 2) x := hf.norm_sq π•œ #align cont_diff_at.norm_sq ContDiffAt.norm_sq theorem contDiffAt_norm {x : E} (hx : x β‰  0) : ContDiffAt ℝ n norm x := by have : β€–id xβ€– ^ 2 β‰  0 := pow_ne_zero 2 (norm_pos_iff.2 hx).ne' simpa only [id, sqrt_sq, norm_nonneg] using (contDiffAt_id.norm_sq π•œ).sqrt this #align cont_diff_at_norm contDiffAt_norm theorem ContDiffAt.norm (hf : ContDiffAt ℝ n f x) (h0 : f x β‰  0) : ContDiffAt ℝ n (fun y => β€–f yβ€–) x := (contDiffAt_norm π•œ h0).comp x hf #align cont_diff_at.norm ContDiffAt.norm theorem ContDiffAt.dist (hf : ContDiffAt ℝ n f x) (hg : ContDiffAt ℝ n g x) (hne : f x β‰  g x) : ContDiffAt ℝ n (fun y => dist (f y) (g y)) x := by simp only [dist_eq_norm] exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align cont_diff_at.dist ContDiffAt.dist theorem ContDiffWithinAt.norm (hf : ContDiffWithinAt ℝ n f s x) (h0 : f x β‰  0) : ContDiffWithinAt ℝ n (fun y => β€–f yβ€–) s x := (contDiffAt_norm π•œ h0).comp_contDiffWithinAt x hf #align cont_diff_within_at.norm ContDiffWithinAt.norm theorem ContDiffWithinAt.dist (hf : ContDiffWithinAt ℝ n f s x) (hg : ContDiffWithinAt ℝ n g s x) (hne : f x β‰  g x) : ContDiffWithinAt ℝ n (fun y => dist (f y) (g y)) s x := by simp only [dist_eq_norm]; exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align cont_diff_within_at.dist ContDiffWithinAt.dist theorem ContDiffOn.norm_sq (hf : ContDiffOn ℝ n f s) : ContDiffOn ℝ n (fun y => β€–f yβ€– ^ 2) s := fun x hx => (hf x hx).norm_sq π•œ #align cont_diff_on.norm_sq ContDiffOn.norm_sq theorem ContDiffOn.norm (hf : ContDiffOn ℝ n f s) (h0 : βˆ€ x ∈ s, f x β‰  0) : ContDiffOn ℝ n (fun y => β€–f yβ€–) s := fun x hx => (hf x hx).norm π•œ (h0 x hx) #align cont_diff_on.norm ContDiffOn.norm theorem ContDiffOn.dist (hf : ContDiffOn ℝ n f s) (hg : ContDiffOn ℝ n g s) (hne : βˆ€ x ∈ s, f x β‰  g x) : ContDiffOn ℝ n (fun y => dist (f y) (g y)) s := fun x hx => (hf x hx).dist π•œ (hg x hx) (hne x hx) #align cont_diff_on.dist ContDiffOn.dist theorem ContDiff.norm (hf : ContDiff ℝ n f) (h0 : βˆ€ x, f x β‰  0) : ContDiff ℝ n fun y => β€–f yβ€– := contDiff_iff_contDiffAt.2 fun x => hf.contDiffAt.norm π•œ (h0 x) #align cont_diff.norm ContDiff.norm theorem ContDiff.dist (hf : ContDiff ℝ n f) (hg : ContDiff ℝ n g) (hne : βˆ€ x, f x β‰  g x) : ContDiff ℝ n fun y => dist (f y) (g y) := contDiff_iff_contDiffAt.2 fun x => hf.contDiffAt.dist π•œ hg.contDiffAt (hne x) #align cont_diff.dist ContDiff.dist -- porting note: use `2 β€’` instead of `bit0` theorem hasStrictFDerivAt_norm_sq (x : F) : HasStrictFDerivAt (fun x => β€–xβ€– ^ 2) (2 β€’ (innerSL ℝ x)) x := by simp only [sq, ← @inner_self_eq_norm_mul_norm ℝ] convert (hasStrictFDerivAt_id x).inner ℝ (hasStrictFDerivAt_id x) ext y simp [two_smul, real_inner_comm] #align has_strict_fderiv_at_norm_sq hasStrictFDerivAt_norm_sqβ‚“ theorem HasFDerivAt.norm_sq {f : G β†’ F} {f' : G β†’L[ℝ] F} (hf : HasFDerivAt f f' x) : HasFDerivAt (β€–f Β·β€– ^ 2) (2 β€’ (innerSL ℝ (f x)).comp f') x := (hasStrictFDerivAt_norm_sq _).hasFDerivAt.comp x hf theorem HasDerivAt.norm_sq {f : ℝ β†’ F} {f' : F} {x : ℝ} (hf : HasDerivAt f f' x) : HasDerivAt (β€–f Β·β€– ^ 2) (2 * Inner.inner (f x) f') x := by simpa using hf.hasFDerivAt.norm_sq.hasDerivAt theorem HasFDerivWithinAt.norm_sq {f : G β†’ F} {f' : G β†’L[ℝ] F} (hf : HasFDerivWithinAt f f' s x) : HasFDerivWithinAt (β€–f Β·β€– ^ 2) (2 β€’ (innerSL ℝ (f x)).comp f') s x := (hasStrictFDerivAt_norm_sq _).hasFDerivAt.comp_hasFDerivWithinAt x hf theorem HasDerivWithinAt.norm_sq {f : ℝ β†’ F} {f' : F} {s : Set ℝ} {x : ℝ} (hf : HasDerivWithinAt f f' s x) : HasDerivWithinAt (β€–f Β·β€– ^ 2) (2 * Inner.inner (f x) f') s x := by simpa using hf.hasFDerivWithinAt.norm_sq.hasDerivWithinAt theorem DifferentiableAt.norm_sq (hf : DifferentiableAt ℝ f x) : DifferentiableAt ℝ (fun y => β€–f yβ€– ^ 2) x := ((contDiffAt_id.norm_sq π•œ).differentiableAt le_rfl).comp x hf #align differentiable_at.norm_sq DifferentiableAt.norm_sq theorem DifferentiableAt.norm (hf : DifferentiableAt ℝ f x) (h0 : f x β‰  0) : DifferentiableAt ℝ (fun y => β€–f yβ€–) x := ((contDiffAt_norm π•œ h0).differentiableAt le_rfl).comp x hf #align differentiable_at.norm DifferentiableAt.norm theorem DifferentiableAt.dist (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) (hne : f x β‰  g x) : DifferentiableAt ℝ (fun y => dist (f y) (g y)) x := by simp only [dist_eq_norm]; exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align differentiable_at.dist DifferentiableAt.dist theorem Differentiable.norm_sq (hf : Differentiable ℝ f) : Differentiable ℝ fun y => β€–f yβ€– ^ 2 := fun x => (hf x).norm_sq π•œ #align differentiable.norm_sq Differentiable.norm_sq theorem Differentiable.norm (hf : Differentiable ℝ f) (h0 : βˆ€ x, f x β‰  0) : Differentiable ℝ fun y => β€–f yβ€– := fun x => (hf x).norm π•œ (h0 x) #align differentiable.norm Differentiable.norm theorem Differentiable.dist (hf : Differentiable ℝ f) (hg : Differentiable ℝ g) (hne : βˆ€ x, f x β‰  g x) : Differentiable ℝ fun y => dist (f y) (g y) := fun x => (hf x).dist π•œ (hg x) (hne x) #align differentiable.dist Differentiable.dist theorem DifferentiableWithinAt.norm_sq (hf : DifferentiableWithinAt ℝ f s x) : DifferentiableWithinAt ℝ (fun y => β€–f yβ€– ^ 2) s x := ((contDiffAt_id.norm_sq π•œ).differentiableAt le_rfl).comp_differentiableWithinAt x hf #align differentiable_within_at.norm_sq DifferentiableWithinAt.norm_sq theorem DifferentiableWithinAt.norm (hf : DifferentiableWithinAt ℝ f s x) (h0 : f x β‰  0) : DifferentiableWithinAt ℝ (fun y => β€–f yβ€–) s x := ((contDiffAt_id.norm π•œ h0).differentiableAt le_rfl).comp_differentiableWithinAt x hf #align differentiable_within_at.norm DifferentiableWithinAt.norm theorem DifferentiableWithinAt.dist (hf : DifferentiableWithinAt ℝ f s x) (hg : DifferentiableWithinAt ℝ g s x) (hne : f x β‰  g x) : DifferentiableWithinAt ℝ (fun y => dist (f y) (g y)) s x := by simp only [dist_eq_norm] exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align differentiable_within_at.dist DifferentiableWithinAt.dist theorem DifferentiableOn.norm_sq (hf : DifferentiableOn ℝ f s) : DifferentiableOn ℝ (fun y => β€–f yβ€– ^ 2) s := fun x hx => (hf x hx).norm_sq π•œ #align differentiable_on.norm_sq DifferentiableOn.norm_sq theorem DifferentiableOn.norm (hf : DifferentiableOn ℝ f s) (h0 : βˆ€ x ∈ s, f x β‰  0) : DifferentiableOn ℝ (fun y => β€–f yβ€–) s := fun x hx => (hf x hx).norm π•œ (h0 x hx) #align differentiable_on.norm DifferentiableOn.norm theorem DifferentiableOn.dist (hf : DifferentiableOn ℝ f s) (hg : DifferentiableOn ℝ g s) (hne : βˆ€ x ∈ s, f x β‰  g x) : DifferentiableOn ℝ (fun y => dist (f y) (g y)) s := fun x hx => (hf x hx).dist π•œ (hg x hx) (hne x hx) #align differentiable_on.dist DifferentiableOn.dist end DerivInner section PiLike open ContinuousLinearMap variable {π•œ ΞΉ H : Type*} [IsROrC π•œ] [NormedAddCommGroup H] [NormedSpace π•œ H] [Fintype ΞΉ] {f : H β†’ EuclideanSpace π•œ ΞΉ} {f' : H β†’L[π•œ] EuclideanSpace π•œ ΞΉ} {t : Set H} {y : H} theorem differentiableWithinAt_euclidean : DifferentiableWithinAt π•œ f t y ↔ βˆ€ i, DifferentiableWithinAt π•œ (fun x => f x i) t y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_differentiableWithinAt_iff, differentiableWithinAt_pi] rfl #align differentiable_within_at_euclidean differentiableWithinAt_euclidean theorem differentiableAt_euclidean : DifferentiableAt π•œ f y ↔ βˆ€ i, DifferentiableAt π•œ (fun x => f x i) y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_differentiableAt_iff, differentiableAt_pi] rfl #align differentiable_at_euclidean differentiableAt_euclidean theorem differentiableOn_euclidean : DifferentiableOn π•œ f t ↔ βˆ€ i, DifferentiableOn π•œ (fun x => f x i) t := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_differentiableOn_iff, differentiableOn_pi] rfl #align differentiable_on_euclidean differentiableOn_euclidean theorem differentiable_euclidean : Differentiable π•œ f ↔ βˆ€ i, Differentiable π•œ fun x => f x i := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_differentiable_iff, differentiable_pi] rfl #align differentiable_euclidean differentiable_euclidean theorem hasStrictFDerivAt_euclidean : HasStrictFDerivAt f f' y ↔ βˆ€ i, HasStrictFDerivAt (fun x => f x i) (EuclideanSpace.proj i ∘L f') y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_hasStrictFDerivAt_iff, hasStrictFDerivAt_pi'] rfl #align has_strict_fderiv_at_euclidean hasStrictFDerivAt_euclidean theorem hasFDerivWithinAt_euclidean : HasFDerivWithinAt f f' t y ↔ βˆ€ i, HasFDerivWithinAt (fun x => f x i) (EuclideanSpace.proj i ∘L f') t y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_hasFDerivWithinAt_iff, hasFDerivWithinAt_pi'] rfl #align has_fderiv_within_at_euclidean hasFDerivWithinAt_euclidean theorem contDiffWithinAt_euclidean {n : β„•βˆž} : ContDiffWithinAt π•œ n f t y ↔ βˆ€ i, ContDiffWithinAt π•œ n (fun x => f x i) t y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_contDiffWithinAt_iff, contDiffWithinAt_pi] rfl #align cont_diff_within_at_euclidean contDiffWithinAt_euclidean theorem contDiffAt_euclidean {n : β„•βˆž} : ContDiffAt π•œ n f y ↔ βˆ€ i, ContDiffAt π•œ n (fun x => f x i) y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_contDiffAt_iff, contDiffAt_pi] rfl #align cont_diff_at_euclidean contDiffAt_euclidean theorem contDiffOn_euclidean {n : β„•βˆž} : ContDiffOn π•œ n f t ↔ βˆ€ i, ContDiffOn π•œ n (fun x => f x i) t := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_contDiffOn_iff, contDiffOn_pi]
rfl
theorem contDiffOn_euclidean {n : β„•βˆž} : ContDiffOn π•œ n f t ↔ βˆ€ i, ContDiffOn π•œ n (fun x => f x i) t := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_contDiffOn_iff, contDiffOn_pi]
Mathlib.Analysis.InnerProductSpace.Calculus.361_0.6FECEGgqdb67QLM
theorem contDiffOn_euclidean {n : β„•βˆž} : ContDiffOn π•œ n f t ↔ βˆ€ i, ContDiffOn π•œ n (fun x => f x i) t
Mathlib_Analysis_InnerProductSpace_Calculus
π•œ : Type u_1 ΞΉ : Type u_2 H : Type u_3 inst✝³ : IsROrC π•œ inst✝² : NormedAddCommGroup H inst✝¹ : NormedSpace π•œ H inst✝ : Fintype ΞΉ f : H β†’ EuclideanSpace π•œ ΞΉ f' : H β†’L[π•œ] EuclideanSpace π•œ ΞΉ t : Set H y : H n : β„•βˆž ⊒ ContDiff π•œ n f ↔ βˆ€ (i : ΞΉ), ContDiff π•œ n fun x => f x i
/- Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ import Mathlib.Analysis.InnerProductSpace.PiL2 import Mathlib.Analysis.SpecialFunctions.Sqrt import Mathlib.Analysis.NormedSpace.HomeomorphBall #align_import analysis.inner_product_space.calculus from "leanprover-community/mathlib"@"f9dd3204df14a0749cd456fac1e6849dfe7d2b88" /-! # Calculus in inner product spaces In this file we prove that the inner product and square of the norm in an inner space are infinitely `ℝ`-smooth. In order to state these results, we need a `NormedSpace ℝ E` instance. Though we can deduce this structure from `InnerProductSpace π•œ E`, this instance may be not definitionally equal to some other β€œnatural” instance. So, we assume `[NormedSpace ℝ E]`. We also prove that functions to a `EuclideanSpace` are (higher) differentiable if and only if their components are. This follows from the corresponding fact for finite product of normed spaces, and from the equivalence of norms in finite dimensions. ## TODO The last part of the file should be generalized to `PiLp`. -/ noncomputable section open IsROrC Real Filter open scoped BigOperators Classical Topology section DerivInner variable {π•œ E F : Type*} [IsROrC π•œ] variable [NormedAddCommGroup E] [InnerProductSpace π•œ E] variable [NormedAddCommGroup F] [InnerProductSpace ℝ F] local notation "βŸͺ" x ", " y "⟫" => @inner π•œ _ _ x y variable (π•œ) [NormedSpace ℝ E] /-- Derivative of the inner product. -/ def fderivInnerClm (p : E Γ— E) : E Γ— E β†’L[ℝ] π•œ := isBoundedBilinearMap_inner.deriv p #align fderiv_inner_clm fderivInnerClm @[simp] theorem fderivInnerClm_apply (p x : E Γ— E) : fderivInnerClm π•œ p x = βŸͺp.1, x.2⟫ + βŸͺx.1, p.2⟫ := rfl #align fderiv_inner_clm_apply fderivInnerClm_apply variable {π•œ} -- porting note: Lean 3 magically switches back to `{π•œ}` here theorem contDiff_inner {n} : ContDiff ℝ n fun p : E Γ— E => βŸͺp.1, p.2⟫ := isBoundedBilinearMap_inner.contDiff #align cont_diff_inner contDiff_inner theorem contDiffAt_inner {p : E Γ— E} {n} : ContDiffAt ℝ n (fun p : E Γ— E => βŸͺp.1, p.2⟫) p := ContDiff.contDiffAt contDiff_inner #align cont_diff_at_inner contDiffAt_inner theorem differentiable_inner : Differentiable ℝ fun p : E Γ— E => βŸͺp.1, p.2⟫ := isBoundedBilinearMap_inner.differentiableAt #align differentiable_inner differentiable_inner variable (π•œ) variable {G : Type*} [NormedAddCommGroup G] [NormedSpace ℝ G] {f g : G β†’ E} {f' g' : G β†’L[ℝ] E} {s : Set G} {x : G} {n : β„•βˆž} theorem ContDiffWithinAt.inner (hf : ContDiffWithinAt ℝ n f s x) (hg : ContDiffWithinAt ℝ n g s x) : ContDiffWithinAt ℝ n (fun x => βŸͺf x, g x⟫) s x := contDiffAt_inner.comp_contDiffWithinAt x (hf.prod hg) #align cont_diff_within_at.inner ContDiffWithinAt.inner nonrec theorem ContDiffAt.inner (hf : ContDiffAt ℝ n f x) (hg : ContDiffAt ℝ n g x) : ContDiffAt ℝ n (fun x => βŸͺf x, g x⟫) x := hf.inner π•œ hg #align cont_diff_at.inner ContDiffAt.inner theorem ContDiffOn.inner (hf : ContDiffOn ℝ n f s) (hg : ContDiffOn ℝ n g s) : ContDiffOn ℝ n (fun x => βŸͺf x, g x⟫) s := fun x hx => (hf x hx).inner π•œ (hg x hx) #align cont_diff_on.inner ContDiffOn.inner theorem ContDiff.inner (hf : ContDiff ℝ n f) (hg : ContDiff ℝ n g) : ContDiff ℝ n fun x => βŸͺf x, g x⟫ := contDiff_inner.comp (hf.prod hg) #align cont_diff.inner ContDiff.inner theorem HasFDerivWithinAt.inner (hf : HasFDerivWithinAt f f' s x) (hg : HasFDerivWithinAt g g' s x) : HasFDerivWithinAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') s x := (isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp_hasFDerivWithinAt x (hf.prod hg) #align has_fderiv_within_at.inner HasFDerivWithinAt.inner theorem HasStrictFDerivAt.inner (hf : HasStrictFDerivAt f f' x) (hg : HasStrictFDerivAt g g' x) : HasStrictFDerivAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') x := (isBoundedBilinearMap_inner.hasStrictFDerivAt (f x, g x)).comp x (hf.prod hg) #align has_strict_fderiv_at.inner HasStrictFDerivAt.inner theorem HasFDerivAt.inner (hf : HasFDerivAt f f' x) (hg : HasFDerivAt g g' x) : HasFDerivAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') x := (isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp x (hf.prod hg) #align has_fderiv_at.inner HasFDerivAt.inner theorem HasDerivWithinAt.inner {f g : ℝ β†’ E} {f' g' : E} {s : Set ℝ} {x : ℝ} (hf : HasDerivWithinAt f f' s x) (hg : HasDerivWithinAt g g' s x) : HasDerivWithinAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) s x := by simpa using (hf.hasFDerivWithinAt.inner π•œ hg.hasFDerivWithinAt).hasDerivWithinAt #align has_deriv_within_at.inner HasDerivWithinAt.inner theorem HasDerivAt.inner {f g : ℝ β†’ E} {f' g' : E} {x : ℝ} : HasDerivAt f f' x β†’ HasDerivAt g g' x β†’ HasDerivAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) x := by simpa only [← hasDerivWithinAt_univ] using HasDerivWithinAt.inner π•œ #align has_deriv_at.inner HasDerivAt.inner theorem DifferentiableWithinAt.inner (hf : DifferentiableWithinAt ℝ f s x) (hg : DifferentiableWithinAt ℝ g s x) : DifferentiableWithinAt ℝ (fun x => βŸͺf x, g x⟫) s x := ((differentiable_inner _).hasFDerivAt.comp_hasFDerivWithinAt x (hf.prod hg).hasFDerivWithinAt).differentiableWithinAt #align differentiable_within_at.inner DifferentiableWithinAt.inner theorem DifferentiableAt.inner (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) : DifferentiableAt ℝ (fun x => βŸͺf x, g x⟫) x := (differentiable_inner _).comp x (hf.prod hg) #align differentiable_at.inner DifferentiableAt.inner theorem DifferentiableOn.inner (hf : DifferentiableOn ℝ f s) (hg : DifferentiableOn ℝ g s) : DifferentiableOn ℝ (fun x => βŸͺf x, g x⟫) s := fun x hx => (hf x hx).inner π•œ (hg x hx) #align differentiable_on.inner DifferentiableOn.inner theorem Differentiable.inner (hf : Differentiable ℝ f) (hg : Differentiable ℝ g) : Differentiable ℝ fun x => βŸͺf x, g x⟫ := fun x => (hf x).inner π•œ (hg x) #align differentiable.inner Differentiable.inner theorem fderiv_inner_apply (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) (y : G) : fderiv ℝ (fun t => βŸͺf t, g t⟫) x y = βŸͺf x, fderiv ℝ g x y⟫ + βŸͺfderiv ℝ f x y, g x⟫ := by rw [(hf.hasFDerivAt.inner π•œ hg.hasFDerivAt).fderiv]; rfl #align fderiv_inner_apply fderiv_inner_apply theorem deriv_inner_apply {f g : ℝ β†’ E} {x : ℝ} (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) : deriv (fun t => βŸͺf t, g t⟫) x = βŸͺf x, deriv g x⟫ + βŸͺderiv f x, g x⟫ := (hf.hasDerivAt.inner π•œ hg.hasDerivAt).deriv #align deriv_inner_apply deriv_inner_apply theorem contDiff_norm_sq : ContDiff ℝ n fun x : E => β€–xβ€– ^ 2 := by convert (reClm : π•œ β†’L[ℝ] ℝ).contDiff.comp ((contDiff_id (E := E)).inner π•œ (contDiff_id (E := E))) exact (inner_self_eq_norm_sq _).symm #align cont_diff_norm_sq contDiff_norm_sq theorem ContDiff.norm_sq (hf : ContDiff ℝ n f) : ContDiff ℝ n fun x => β€–f xβ€– ^ 2 := (contDiff_norm_sq π•œ).comp hf #align cont_diff.norm_sq ContDiff.norm_sq theorem ContDiffWithinAt.norm_sq (hf : ContDiffWithinAt ℝ n f s x) : ContDiffWithinAt ℝ n (fun y => β€–f yβ€– ^ 2) s x := (contDiff_norm_sq π•œ).contDiffAt.comp_contDiffWithinAt x hf #align cont_diff_within_at.norm_sq ContDiffWithinAt.norm_sq nonrec theorem ContDiffAt.norm_sq (hf : ContDiffAt ℝ n f x) : ContDiffAt ℝ n (β€–f Β·β€– ^ 2) x := hf.norm_sq π•œ #align cont_diff_at.norm_sq ContDiffAt.norm_sq theorem contDiffAt_norm {x : E} (hx : x β‰  0) : ContDiffAt ℝ n norm x := by have : β€–id xβ€– ^ 2 β‰  0 := pow_ne_zero 2 (norm_pos_iff.2 hx).ne' simpa only [id, sqrt_sq, norm_nonneg] using (contDiffAt_id.norm_sq π•œ).sqrt this #align cont_diff_at_norm contDiffAt_norm theorem ContDiffAt.norm (hf : ContDiffAt ℝ n f x) (h0 : f x β‰  0) : ContDiffAt ℝ n (fun y => β€–f yβ€–) x := (contDiffAt_norm π•œ h0).comp x hf #align cont_diff_at.norm ContDiffAt.norm theorem ContDiffAt.dist (hf : ContDiffAt ℝ n f x) (hg : ContDiffAt ℝ n g x) (hne : f x β‰  g x) : ContDiffAt ℝ n (fun y => dist (f y) (g y)) x := by simp only [dist_eq_norm] exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align cont_diff_at.dist ContDiffAt.dist theorem ContDiffWithinAt.norm (hf : ContDiffWithinAt ℝ n f s x) (h0 : f x β‰  0) : ContDiffWithinAt ℝ n (fun y => β€–f yβ€–) s x := (contDiffAt_norm π•œ h0).comp_contDiffWithinAt x hf #align cont_diff_within_at.norm ContDiffWithinAt.norm theorem ContDiffWithinAt.dist (hf : ContDiffWithinAt ℝ n f s x) (hg : ContDiffWithinAt ℝ n g s x) (hne : f x β‰  g x) : ContDiffWithinAt ℝ n (fun y => dist (f y) (g y)) s x := by simp only [dist_eq_norm]; exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align cont_diff_within_at.dist ContDiffWithinAt.dist theorem ContDiffOn.norm_sq (hf : ContDiffOn ℝ n f s) : ContDiffOn ℝ n (fun y => β€–f yβ€– ^ 2) s := fun x hx => (hf x hx).norm_sq π•œ #align cont_diff_on.norm_sq ContDiffOn.norm_sq theorem ContDiffOn.norm (hf : ContDiffOn ℝ n f s) (h0 : βˆ€ x ∈ s, f x β‰  0) : ContDiffOn ℝ n (fun y => β€–f yβ€–) s := fun x hx => (hf x hx).norm π•œ (h0 x hx) #align cont_diff_on.norm ContDiffOn.norm theorem ContDiffOn.dist (hf : ContDiffOn ℝ n f s) (hg : ContDiffOn ℝ n g s) (hne : βˆ€ x ∈ s, f x β‰  g x) : ContDiffOn ℝ n (fun y => dist (f y) (g y)) s := fun x hx => (hf x hx).dist π•œ (hg x hx) (hne x hx) #align cont_diff_on.dist ContDiffOn.dist theorem ContDiff.norm (hf : ContDiff ℝ n f) (h0 : βˆ€ x, f x β‰  0) : ContDiff ℝ n fun y => β€–f yβ€– := contDiff_iff_contDiffAt.2 fun x => hf.contDiffAt.norm π•œ (h0 x) #align cont_diff.norm ContDiff.norm theorem ContDiff.dist (hf : ContDiff ℝ n f) (hg : ContDiff ℝ n g) (hne : βˆ€ x, f x β‰  g x) : ContDiff ℝ n fun y => dist (f y) (g y) := contDiff_iff_contDiffAt.2 fun x => hf.contDiffAt.dist π•œ hg.contDiffAt (hne x) #align cont_diff.dist ContDiff.dist -- porting note: use `2 β€’` instead of `bit0` theorem hasStrictFDerivAt_norm_sq (x : F) : HasStrictFDerivAt (fun x => β€–xβ€– ^ 2) (2 β€’ (innerSL ℝ x)) x := by simp only [sq, ← @inner_self_eq_norm_mul_norm ℝ] convert (hasStrictFDerivAt_id x).inner ℝ (hasStrictFDerivAt_id x) ext y simp [two_smul, real_inner_comm] #align has_strict_fderiv_at_norm_sq hasStrictFDerivAt_norm_sqβ‚“ theorem HasFDerivAt.norm_sq {f : G β†’ F} {f' : G β†’L[ℝ] F} (hf : HasFDerivAt f f' x) : HasFDerivAt (β€–f Β·β€– ^ 2) (2 β€’ (innerSL ℝ (f x)).comp f') x := (hasStrictFDerivAt_norm_sq _).hasFDerivAt.comp x hf theorem HasDerivAt.norm_sq {f : ℝ β†’ F} {f' : F} {x : ℝ} (hf : HasDerivAt f f' x) : HasDerivAt (β€–f Β·β€– ^ 2) (2 * Inner.inner (f x) f') x := by simpa using hf.hasFDerivAt.norm_sq.hasDerivAt theorem HasFDerivWithinAt.norm_sq {f : G β†’ F} {f' : G β†’L[ℝ] F} (hf : HasFDerivWithinAt f f' s x) : HasFDerivWithinAt (β€–f Β·β€– ^ 2) (2 β€’ (innerSL ℝ (f x)).comp f') s x := (hasStrictFDerivAt_norm_sq _).hasFDerivAt.comp_hasFDerivWithinAt x hf theorem HasDerivWithinAt.norm_sq {f : ℝ β†’ F} {f' : F} {s : Set ℝ} {x : ℝ} (hf : HasDerivWithinAt f f' s x) : HasDerivWithinAt (β€–f Β·β€– ^ 2) (2 * Inner.inner (f x) f') s x := by simpa using hf.hasFDerivWithinAt.norm_sq.hasDerivWithinAt theorem DifferentiableAt.norm_sq (hf : DifferentiableAt ℝ f x) : DifferentiableAt ℝ (fun y => β€–f yβ€– ^ 2) x := ((contDiffAt_id.norm_sq π•œ).differentiableAt le_rfl).comp x hf #align differentiable_at.norm_sq DifferentiableAt.norm_sq theorem DifferentiableAt.norm (hf : DifferentiableAt ℝ f x) (h0 : f x β‰  0) : DifferentiableAt ℝ (fun y => β€–f yβ€–) x := ((contDiffAt_norm π•œ h0).differentiableAt le_rfl).comp x hf #align differentiable_at.norm DifferentiableAt.norm theorem DifferentiableAt.dist (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) (hne : f x β‰  g x) : DifferentiableAt ℝ (fun y => dist (f y) (g y)) x := by simp only [dist_eq_norm]; exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align differentiable_at.dist DifferentiableAt.dist theorem Differentiable.norm_sq (hf : Differentiable ℝ f) : Differentiable ℝ fun y => β€–f yβ€– ^ 2 := fun x => (hf x).norm_sq π•œ #align differentiable.norm_sq Differentiable.norm_sq theorem Differentiable.norm (hf : Differentiable ℝ f) (h0 : βˆ€ x, f x β‰  0) : Differentiable ℝ fun y => β€–f yβ€– := fun x => (hf x).norm π•œ (h0 x) #align differentiable.norm Differentiable.norm theorem Differentiable.dist (hf : Differentiable ℝ f) (hg : Differentiable ℝ g) (hne : βˆ€ x, f x β‰  g x) : Differentiable ℝ fun y => dist (f y) (g y) := fun x => (hf x).dist π•œ (hg x) (hne x) #align differentiable.dist Differentiable.dist theorem DifferentiableWithinAt.norm_sq (hf : DifferentiableWithinAt ℝ f s x) : DifferentiableWithinAt ℝ (fun y => β€–f yβ€– ^ 2) s x := ((contDiffAt_id.norm_sq π•œ).differentiableAt le_rfl).comp_differentiableWithinAt x hf #align differentiable_within_at.norm_sq DifferentiableWithinAt.norm_sq theorem DifferentiableWithinAt.norm (hf : DifferentiableWithinAt ℝ f s x) (h0 : f x β‰  0) : DifferentiableWithinAt ℝ (fun y => β€–f yβ€–) s x := ((contDiffAt_id.norm π•œ h0).differentiableAt le_rfl).comp_differentiableWithinAt x hf #align differentiable_within_at.norm DifferentiableWithinAt.norm theorem DifferentiableWithinAt.dist (hf : DifferentiableWithinAt ℝ f s x) (hg : DifferentiableWithinAt ℝ g s x) (hne : f x β‰  g x) : DifferentiableWithinAt ℝ (fun y => dist (f y) (g y)) s x := by simp only [dist_eq_norm] exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align differentiable_within_at.dist DifferentiableWithinAt.dist theorem DifferentiableOn.norm_sq (hf : DifferentiableOn ℝ f s) : DifferentiableOn ℝ (fun y => β€–f yβ€– ^ 2) s := fun x hx => (hf x hx).norm_sq π•œ #align differentiable_on.norm_sq DifferentiableOn.norm_sq theorem DifferentiableOn.norm (hf : DifferentiableOn ℝ f s) (h0 : βˆ€ x ∈ s, f x β‰  0) : DifferentiableOn ℝ (fun y => β€–f yβ€–) s := fun x hx => (hf x hx).norm π•œ (h0 x hx) #align differentiable_on.norm DifferentiableOn.norm theorem DifferentiableOn.dist (hf : DifferentiableOn ℝ f s) (hg : DifferentiableOn ℝ g s) (hne : βˆ€ x ∈ s, f x β‰  g x) : DifferentiableOn ℝ (fun y => dist (f y) (g y)) s := fun x hx => (hf x hx).dist π•œ (hg x hx) (hne x hx) #align differentiable_on.dist DifferentiableOn.dist end DerivInner section PiLike open ContinuousLinearMap variable {π•œ ΞΉ H : Type*} [IsROrC π•œ] [NormedAddCommGroup H] [NormedSpace π•œ H] [Fintype ΞΉ] {f : H β†’ EuclideanSpace π•œ ΞΉ} {f' : H β†’L[π•œ] EuclideanSpace π•œ ΞΉ} {t : Set H} {y : H} theorem differentiableWithinAt_euclidean : DifferentiableWithinAt π•œ f t y ↔ βˆ€ i, DifferentiableWithinAt π•œ (fun x => f x i) t y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_differentiableWithinAt_iff, differentiableWithinAt_pi] rfl #align differentiable_within_at_euclidean differentiableWithinAt_euclidean theorem differentiableAt_euclidean : DifferentiableAt π•œ f y ↔ βˆ€ i, DifferentiableAt π•œ (fun x => f x i) y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_differentiableAt_iff, differentiableAt_pi] rfl #align differentiable_at_euclidean differentiableAt_euclidean theorem differentiableOn_euclidean : DifferentiableOn π•œ f t ↔ βˆ€ i, DifferentiableOn π•œ (fun x => f x i) t := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_differentiableOn_iff, differentiableOn_pi] rfl #align differentiable_on_euclidean differentiableOn_euclidean theorem differentiable_euclidean : Differentiable π•œ f ↔ βˆ€ i, Differentiable π•œ fun x => f x i := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_differentiable_iff, differentiable_pi] rfl #align differentiable_euclidean differentiable_euclidean theorem hasStrictFDerivAt_euclidean : HasStrictFDerivAt f f' y ↔ βˆ€ i, HasStrictFDerivAt (fun x => f x i) (EuclideanSpace.proj i ∘L f') y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_hasStrictFDerivAt_iff, hasStrictFDerivAt_pi'] rfl #align has_strict_fderiv_at_euclidean hasStrictFDerivAt_euclidean theorem hasFDerivWithinAt_euclidean : HasFDerivWithinAt f f' t y ↔ βˆ€ i, HasFDerivWithinAt (fun x => f x i) (EuclideanSpace.proj i ∘L f') t y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_hasFDerivWithinAt_iff, hasFDerivWithinAt_pi'] rfl #align has_fderiv_within_at_euclidean hasFDerivWithinAt_euclidean theorem contDiffWithinAt_euclidean {n : β„•βˆž} : ContDiffWithinAt π•œ n f t y ↔ βˆ€ i, ContDiffWithinAt π•œ n (fun x => f x i) t y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_contDiffWithinAt_iff, contDiffWithinAt_pi] rfl #align cont_diff_within_at_euclidean contDiffWithinAt_euclidean theorem contDiffAt_euclidean {n : β„•βˆž} : ContDiffAt π•œ n f y ↔ βˆ€ i, ContDiffAt π•œ n (fun x => f x i) y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_contDiffAt_iff, contDiffAt_pi] rfl #align cont_diff_at_euclidean contDiffAt_euclidean theorem contDiffOn_euclidean {n : β„•βˆž} : ContDiffOn π•œ n f t ↔ βˆ€ i, ContDiffOn π•œ n (fun x => f x i) t := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_contDiffOn_iff, contDiffOn_pi] rfl #align cont_diff_on_euclidean contDiffOn_euclidean theorem contDiff_euclidean {n : β„•βˆž} : ContDiff π•œ n f ↔ βˆ€ i, ContDiff π•œ n fun x => f x i := by
rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_contDiff_iff, contDiff_pi]
theorem contDiff_euclidean {n : β„•βˆž} : ContDiff π•œ n f ↔ βˆ€ i, ContDiff π•œ n fun x => f x i := by
Mathlib.Analysis.InnerProductSpace.Calculus.367_0.6FECEGgqdb67QLM
theorem contDiff_euclidean {n : β„•βˆž} : ContDiff π•œ n f ↔ βˆ€ i, ContDiff π•œ n fun x => f x i
Mathlib_Analysis_InnerProductSpace_Calculus
π•œ : Type u_1 ΞΉ : Type u_2 H : Type u_3 inst✝³ : IsROrC π•œ inst✝² : NormedAddCommGroup H inst✝¹ : NormedSpace π•œ H inst✝ : Fintype ΞΉ f : H β†’ EuclideanSpace π•œ ΞΉ f' : H β†’L[π•œ] EuclideanSpace π•œ ΞΉ t : Set H y : H n : β„•βˆž ⊒ (βˆ€ (i : ΞΉ), ContDiff π•œ n fun x => (⇑(EuclideanSpace.equiv ΞΉ π•œ) ∘ f) x i) ↔ βˆ€ (i : ΞΉ), ContDiff π•œ n fun x => f x i
/- Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ import Mathlib.Analysis.InnerProductSpace.PiL2 import Mathlib.Analysis.SpecialFunctions.Sqrt import Mathlib.Analysis.NormedSpace.HomeomorphBall #align_import analysis.inner_product_space.calculus from "leanprover-community/mathlib"@"f9dd3204df14a0749cd456fac1e6849dfe7d2b88" /-! # Calculus in inner product spaces In this file we prove that the inner product and square of the norm in an inner space are infinitely `ℝ`-smooth. In order to state these results, we need a `NormedSpace ℝ E` instance. Though we can deduce this structure from `InnerProductSpace π•œ E`, this instance may be not definitionally equal to some other β€œnatural” instance. So, we assume `[NormedSpace ℝ E]`. We also prove that functions to a `EuclideanSpace` are (higher) differentiable if and only if their components are. This follows from the corresponding fact for finite product of normed spaces, and from the equivalence of norms in finite dimensions. ## TODO The last part of the file should be generalized to `PiLp`. -/ noncomputable section open IsROrC Real Filter open scoped BigOperators Classical Topology section DerivInner variable {π•œ E F : Type*} [IsROrC π•œ] variable [NormedAddCommGroup E] [InnerProductSpace π•œ E] variable [NormedAddCommGroup F] [InnerProductSpace ℝ F] local notation "βŸͺ" x ", " y "⟫" => @inner π•œ _ _ x y variable (π•œ) [NormedSpace ℝ E] /-- Derivative of the inner product. -/ def fderivInnerClm (p : E Γ— E) : E Γ— E β†’L[ℝ] π•œ := isBoundedBilinearMap_inner.deriv p #align fderiv_inner_clm fderivInnerClm @[simp] theorem fderivInnerClm_apply (p x : E Γ— E) : fderivInnerClm π•œ p x = βŸͺp.1, x.2⟫ + βŸͺx.1, p.2⟫ := rfl #align fderiv_inner_clm_apply fderivInnerClm_apply variable {π•œ} -- porting note: Lean 3 magically switches back to `{π•œ}` here theorem contDiff_inner {n} : ContDiff ℝ n fun p : E Γ— E => βŸͺp.1, p.2⟫ := isBoundedBilinearMap_inner.contDiff #align cont_diff_inner contDiff_inner theorem contDiffAt_inner {p : E Γ— E} {n} : ContDiffAt ℝ n (fun p : E Γ— E => βŸͺp.1, p.2⟫) p := ContDiff.contDiffAt contDiff_inner #align cont_diff_at_inner contDiffAt_inner theorem differentiable_inner : Differentiable ℝ fun p : E Γ— E => βŸͺp.1, p.2⟫ := isBoundedBilinearMap_inner.differentiableAt #align differentiable_inner differentiable_inner variable (π•œ) variable {G : Type*} [NormedAddCommGroup G] [NormedSpace ℝ G] {f g : G β†’ E} {f' g' : G β†’L[ℝ] E} {s : Set G} {x : G} {n : β„•βˆž} theorem ContDiffWithinAt.inner (hf : ContDiffWithinAt ℝ n f s x) (hg : ContDiffWithinAt ℝ n g s x) : ContDiffWithinAt ℝ n (fun x => βŸͺf x, g x⟫) s x := contDiffAt_inner.comp_contDiffWithinAt x (hf.prod hg) #align cont_diff_within_at.inner ContDiffWithinAt.inner nonrec theorem ContDiffAt.inner (hf : ContDiffAt ℝ n f x) (hg : ContDiffAt ℝ n g x) : ContDiffAt ℝ n (fun x => βŸͺf x, g x⟫) x := hf.inner π•œ hg #align cont_diff_at.inner ContDiffAt.inner theorem ContDiffOn.inner (hf : ContDiffOn ℝ n f s) (hg : ContDiffOn ℝ n g s) : ContDiffOn ℝ n (fun x => βŸͺf x, g x⟫) s := fun x hx => (hf x hx).inner π•œ (hg x hx) #align cont_diff_on.inner ContDiffOn.inner theorem ContDiff.inner (hf : ContDiff ℝ n f) (hg : ContDiff ℝ n g) : ContDiff ℝ n fun x => βŸͺf x, g x⟫ := contDiff_inner.comp (hf.prod hg) #align cont_diff.inner ContDiff.inner theorem HasFDerivWithinAt.inner (hf : HasFDerivWithinAt f f' s x) (hg : HasFDerivWithinAt g g' s x) : HasFDerivWithinAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') s x := (isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp_hasFDerivWithinAt x (hf.prod hg) #align has_fderiv_within_at.inner HasFDerivWithinAt.inner theorem HasStrictFDerivAt.inner (hf : HasStrictFDerivAt f f' x) (hg : HasStrictFDerivAt g g' x) : HasStrictFDerivAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') x := (isBoundedBilinearMap_inner.hasStrictFDerivAt (f x, g x)).comp x (hf.prod hg) #align has_strict_fderiv_at.inner HasStrictFDerivAt.inner theorem HasFDerivAt.inner (hf : HasFDerivAt f f' x) (hg : HasFDerivAt g g' x) : HasFDerivAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') x := (isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp x (hf.prod hg) #align has_fderiv_at.inner HasFDerivAt.inner theorem HasDerivWithinAt.inner {f g : ℝ β†’ E} {f' g' : E} {s : Set ℝ} {x : ℝ} (hf : HasDerivWithinAt f f' s x) (hg : HasDerivWithinAt g g' s x) : HasDerivWithinAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) s x := by simpa using (hf.hasFDerivWithinAt.inner π•œ hg.hasFDerivWithinAt).hasDerivWithinAt #align has_deriv_within_at.inner HasDerivWithinAt.inner theorem HasDerivAt.inner {f g : ℝ β†’ E} {f' g' : E} {x : ℝ} : HasDerivAt f f' x β†’ HasDerivAt g g' x β†’ HasDerivAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) x := by simpa only [← hasDerivWithinAt_univ] using HasDerivWithinAt.inner π•œ #align has_deriv_at.inner HasDerivAt.inner theorem DifferentiableWithinAt.inner (hf : DifferentiableWithinAt ℝ f s x) (hg : DifferentiableWithinAt ℝ g s x) : DifferentiableWithinAt ℝ (fun x => βŸͺf x, g x⟫) s x := ((differentiable_inner _).hasFDerivAt.comp_hasFDerivWithinAt x (hf.prod hg).hasFDerivWithinAt).differentiableWithinAt #align differentiable_within_at.inner DifferentiableWithinAt.inner theorem DifferentiableAt.inner (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) : DifferentiableAt ℝ (fun x => βŸͺf x, g x⟫) x := (differentiable_inner _).comp x (hf.prod hg) #align differentiable_at.inner DifferentiableAt.inner theorem DifferentiableOn.inner (hf : DifferentiableOn ℝ f s) (hg : DifferentiableOn ℝ g s) : DifferentiableOn ℝ (fun x => βŸͺf x, g x⟫) s := fun x hx => (hf x hx).inner π•œ (hg x hx) #align differentiable_on.inner DifferentiableOn.inner theorem Differentiable.inner (hf : Differentiable ℝ f) (hg : Differentiable ℝ g) : Differentiable ℝ fun x => βŸͺf x, g x⟫ := fun x => (hf x).inner π•œ (hg x) #align differentiable.inner Differentiable.inner theorem fderiv_inner_apply (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) (y : G) : fderiv ℝ (fun t => βŸͺf t, g t⟫) x y = βŸͺf x, fderiv ℝ g x y⟫ + βŸͺfderiv ℝ f x y, g x⟫ := by rw [(hf.hasFDerivAt.inner π•œ hg.hasFDerivAt).fderiv]; rfl #align fderiv_inner_apply fderiv_inner_apply theorem deriv_inner_apply {f g : ℝ β†’ E} {x : ℝ} (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) : deriv (fun t => βŸͺf t, g t⟫) x = βŸͺf x, deriv g x⟫ + βŸͺderiv f x, g x⟫ := (hf.hasDerivAt.inner π•œ hg.hasDerivAt).deriv #align deriv_inner_apply deriv_inner_apply theorem contDiff_norm_sq : ContDiff ℝ n fun x : E => β€–xβ€– ^ 2 := by convert (reClm : π•œ β†’L[ℝ] ℝ).contDiff.comp ((contDiff_id (E := E)).inner π•œ (contDiff_id (E := E))) exact (inner_self_eq_norm_sq _).symm #align cont_diff_norm_sq contDiff_norm_sq theorem ContDiff.norm_sq (hf : ContDiff ℝ n f) : ContDiff ℝ n fun x => β€–f xβ€– ^ 2 := (contDiff_norm_sq π•œ).comp hf #align cont_diff.norm_sq ContDiff.norm_sq theorem ContDiffWithinAt.norm_sq (hf : ContDiffWithinAt ℝ n f s x) : ContDiffWithinAt ℝ n (fun y => β€–f yβ€– ^ 2) s x := (contDiff_norm_sq π•œ).contDiffAt.comp_contDiffWithinAt x hf #align cont_diff_within_at.norm_sq ContDiffWithinAt.norm_sq nonrec theorem ContDiffAt.norm_sq (hf : ContDiffAt ℝ n f x) : ContDiffAt ℝ n (β€–f Β·β€– ^ 2) x := hf.norm_sq π•œ #align cont_diff_at.norm_sq ContDiffAt.norm_sq theorem contDiffAt_norm {x : E} (hx : x β‰  0) : ContDiffAt ℝ n norm x := by have : β€–id xβ€– ^ 2 β‰  0 := pow_ne_zero 2 (norm_pos_iff.2 hx).ne' simpa only [id, sqrt_sq, norm_nonneg] using (contDiffAt_id.norm_sq π•œ).sqrt this #align cont_diff_at_norm contDiffAt_norm theorem ContDiffAt.norm (hf : ContDiffAt ℝ n f x) (h0 : f x β‰  0) : ContDiffAt ℝ n (fun y => β€–f yβ€–) x := (contDiffAt_norm π•œ h0).comp x hf #align cont_diff_at.norm ContDiffAt.norm theorem ContDiffAt.dist (hf : ContDiffAt ℝ n f x) (hg : ContDiffAt ℝ n g x) (hne : f x β‰  g x) : ContDiffAt ℝ n (fun y => dist (f y) (g y)) x := by simp only [dist_eq_norm] exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align cont_diff_at.dist ContDiffAt.dist theorem ContDiffWithinAt.norm (hf : ContDiffWithinAt ℝ n f s x) (h0 : f x β‰  0) : ContDiffWithinAt ℝ n (fun y => β€–f yβ€–) s x := (contDiffAt_norm π•œ h0).comp_contDiffWithinAt x hf #align cont_diff_within_at.norm ContDiffWithinAt.norm theorem ContDiffWithinAt.dist (hf : ContDiffWithinAt ℝ n f s x) (hg : ContDiffWithinAt ℝ n g s x) (hne : f x β‰  g x) : ContDiffWithinAt ℝ n (fun y => dist (f y) (g y)) s x := by simp only [dist_eq_norm]; exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align cont_diff_within_at.dist ContDiffWithinAt.dist theorem ContDiffOn.norm_sq (hf : ContDiffOn ℝ n f s) : ContDiffOn ℝ n (fun y => β€–f yβ€– ^ 2) s := fun x hx => (hf x hx).norm_sq π•œ #align cont_diff_on.norm_sq ContDiffOn.norm_sq theorem ContDiffOn.norm (hf : ContDiffOn ℝ n f s) (h0 : βˆ€ x ∈ s, f x β‰  0) : ContDiffOn ℝ n (fun y => β€–f yβ€–) s := fun x hx => (hf x hx).norm π•œ (h0 x hx) #align cont_diff_on.norm ContDiffOn.norm theorem ContDiffOn.dist (hf : ContDiffOn ℝ n f s) (hg : ContDiffOn ℝ n g s) (hne : βˆ€ x ∈ s, f x β‰  g x) : ContDiffOn ℝ n (fun y => dist (f y) (g y)) s := fun x hx => (hf x hx).dist π•œ (hg x hx) (hne x hx) #align cont_diff_on.dist ContDiffOn.dist theorem ContDiff.norm (hf : ContDiff ℝ n f) (h0 : βˆ€ x, f x β‰  0) : ContDiff ℝ n fun y => β€–f yβ€– := contDiff_iff_contDiffAt.2 fun x => hf.contDiffAt.norm π•œ (h0 x) #align cont_diff.norm ContDiff.norm theorem ContDiff.dist (hf : ContDiff ℝ n f) (hg : ContDiff ℝ n g) (hne : βˆ€ x, f x β‰  g x) : ContDiff ℝ n fun y => dist (f y) (g y) := contDiff_iff_contDiffAt.2 fun x => hf.contDiffAt.dist π•œ hg.contDiffAt (hne x) #align cont_diff.dist ContDiff.dist -- porting note: use `2 β€’` instead of `bit0` theorem hasStrictFDerivAt_norm_sq (x : F) : HasStrictFDerivAt (fun x => β€–xβ€– ^ 2) (2 β€’ (innerSL ℝ x)) x := by simp only [sq, ← @inner_self_eq_norm_mul_norm ℝ] convert (hasStrictFDerivAt_id x).inner ℝ (hasStrictFDerivAt_id x) ext y simp [two_smul, real_inner_comm] #align has_strict_fderiv_at_norm_sq hasStrictFDerivAt_norm_sqβ‚“ theorem HasFDerivAt.norm_sq {f : G β†’ F} {f' : G β†’L[ℝ] F} (hf : HasFDerivAt f f' x) : HasFDerivAt (β€–f Β·β€– ^ 2) (2 β€’ (innerSL ℝ (f x)).comp f') x := (hasStrictFDerivAt_norm_sq _).hasFDerivAt.comp x hf theorem HasDerivAt.norm_sq {f : ℝ β†’ F} {f' : F} {x : ℝ} (hf : HasDerivAt f f' x) : HasDerivAt (β€–f Β·β€– ^ 2) (2 * Inner.inner (f x) f') x := by simpa using hf.hasFDerivAt.norm_sq.hasDerivAt theorem HasFDerivWithinAt.norm_sq {f : G β†’ F} {f' : G β†’L[ℝ] F} (hf : HasFDerivWithinAt f f' s x) : HasFDerivWithinAt (β€–f Β·β€– ^ 2) (2 β€’ (innerSL ℝ (f x)).comp f') s x := (hasStrictFDerivAt_norm_sq _).hasFDerivAt.comp_hasFDerivWithinAt x hf theorem HasDerivWithinAt.norm_sq {f : ℝ β†’ F} {f' : F} {s : Set ℝ} {x : ℝ} (hf : HasDerivWithinAt f f' s x) : HasDerivWithinAt (β€–f Β·β€– ^ 2) (2 * Inner.inner (f x) f') s x := by simpa using hf.hasFDerivWithinAt.norm_sq.hasDerivWithinAt theorem DifferentiableAt.norm_sq (hf : DifferentiableAt ℝ f x) : DifferentiableAt ℝ (fun y => β€–f yβ€– ^ 2) x := ((contDiffAt_id.norm_sq π•œ).differentiableAt le_rfl).comp x hf #align differentiable_at.norm_sq DifferentiableAt.norm_sq theorem DifferentiableAt.norm (hf : DifferentiableAt ℝ f x) (h0 : f x β‰  0) : DifferentiableAt ℝ (fun y => β€–f yβ€–) x := ((contDiffAt_norm π•œ h0).differentiableAt le_rfl).comp x hf #align differentiable_at.norm DifferentiableAt.norm theorem DifferentiableAt.dist (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) (hne : f x β‰  g x) : DifferentiableAt ℝ (fun y => dist (f y) (g y)) x := by simp only [dist_eq_norm]; exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align differentiable_at.dist DifferentiableAt.dist theorem Differentiable.norm_sq (hf : Differentiable ℝ f) : Differentiable ℝ fun y => β€–f yβ€– ^ 2 := fun x => (hf x).norm_sq π•œ #align differentiable.norm_sq Differentiable.norm_sq theorem Differentiable.norm (hf : Differentiable ℝ f) (h0 : βˆ€ x, f x β‰  0) : Differentiable ℝ fun y => β€–f yβ€– := fun x => (hf x).norm π•œ (h0 x) #align differentiable.norm Differentiable.norm theorem Differentiable.dist (hf : Differentiable ℝ f) (hg : Differentiable ℝ g) (hne : βˆ€ x, f x β‰  g x) : Differentiable ℝ fun y => dist (f y) (g y) := fun x => (hf x).dist π•œ (hg x) (hne x) #align differentiable.dist Differentiable.dist theorem DifferentiableWithinAt.norm_sq (hf : DifferentiableWithinAt ℝ f s x) : DifferentiableWithinAt ℝ (fun y => β€–f yβ€– ^ 2) s x := ((contDiffAt_id.norm_sq π•œ).differentiableAt le_rfl).comp_differentiableWithinAt x hf #align differentiable_within_at.norm_sq DifferentiableWithinAt.norm_sq theorem DifferentiableWithinAt.norm (hf : DifferentiableWithinAt ℝ f s x) (h0 : f x β‰  0) : DifferentiableWithinAt ℝ (fun y => β€–f yβ€–) s x := ((contDiffAt_id.norm π•œ h0).differentiableAt le_rfl).comp_differentiableWithinAt x hf #align differentiable_within_at.norm DifferentiableWithinAt.norm theorem DifferentiableWithinAt.dist (hf : DifferentiableWithinAt ℝ f s x) (hg : DifferentiableWithinAt ℝ g s x) (hne : f x β‰  g x) : DifferentiableWithinAt ℝ (fun y => dist (f y) (g y)) s x := by simp only [dist_eq_norm] exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align differentiable_within_at.dist DifferentiableWithinAt.dist theorem DifferentiableOn.norm_sq (hf : DifferentiableOn ℝ f s) : DifferentiableOn ℝ (fun y => β€–f yβ€– ^ 2) s := fun x hx => (hf x hx).norm_sq π•œ #align differentiable_on.norm_sq DifferentiableOn.norm_sq theorem DifferentiableOn.norm (hf : DifferentiableOn ℝ f s) (h0 : βˆ€ x ∈ s, f x β‰  0) : DifferentiableOn ℝ (fun y => β€–f yβ€–) s := fun x hx => (hf x hx).norm π•œ (h0 x hx) #align differentiable_on.norm DifferentiableOn.norm theorem DifferentiableOn.dist (hf : DifferentiableOn ℝ f s) (hg : DifferentiableOn ℝ g s) (hne : βˆ€ x ∈ s, f x β‰  g x) : DifferentiableOn ℝ (fun y => dist (f y) (g y)) s := fun x hx => (hf x hx).dist π•œ (hg x hx) (hne x hx) #align differentiable_on.dist DifferentiableOn.dist end DerivInner section PiLike open ContinuousLinearMap variable {π•œ ΞΉ H : Type*} [IsROrC π•œ] [NormedAddCommGroup H] [NormedSpace π•œ H] [Fintype ΞΉ] {f : H β†’ EuclideanSpace π•œ ΞΉ} {f' : H β†’L[π•œ] EuclideanSpace π•œ ΞΉ} {t : Set H} {y : H} theorem differentiableWithinAt_euclidean : DifferentiableWithinAt π•œ f t y ↔ βˆ€ i, DifferentiableWithinAt π•œ (fun x => f x i) t y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_differentiableWithinAt_iff, differentiableWithinAt_pi] rfl #align differentiable_within_at_euclidean differentiableWithinAt_euclidean theorem differentiableAt_euclidean : DifferentiableAt π•œ f y ↔ βˆ€ i, DifferentiableAt π•œ (fun x => f x i) y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_differentiableAt_iff, differentiableAt_pi] rfl #align differentiable_at_euclidean differentiableAt_euclidean theorem differentiableOn_euclidean : DifferentiableOn π•œ f t ↔ βˆ€ i, DifferentiableOn π•œ (fun x => f x i) t := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_differentiableOn_iff, differentiableOn_pi] rfl #align differentiable_on_euclidean differentiableOn_euclidean theorem differentiable_euclidean : Differentiable π•œ f ↔ βˆ€ i, Differentiable π•œ fun x => f x i := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_differentiable_iff, differentiable_pi] rfl #align differentiable_euclidean differentiable_euclidean theorem hasStrictFDerivAt_euclidean : HasStrictFDerivAt f f' y ↔ βˆ€ i, HasStrictFDerivAt (fun x => f x i) (EuclideanSpace.proj i ∘L f') y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_hasStrictFDerivAt_iff, hasStrictFDerivAt_pi'] rfl #align has_strict_fderiv_at_euclidean hasStrictFDerivAt_euclidean theorem hasFDerivWithinAt_euclidean : HasFDerivWithinAt f f' t y ↔ βˆ€ i, HasFDerivWithinAt (fun x => f x i) (EuclideanSpace.proj i ∘L f') t y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_hasFDerivWithinAt_iff, hasFDerivWithinAt_pi'] rfl #align has_fderiv_within_at_euclidean hasFDerivWithinAt_euclidean theorem contDiffWithinAt_euclidean {n : β„•βˆž} : ContDiffWithinAt π•œ n f t y ↔ βˆ€ i, ContDiffWithinAt π•œ n (fun x => f x i) t y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_contDiffWithinAt_iff, contDiffWithinAt_pi] rfl #align cont_diff_within_at_euclidean contDiffWithinAt_euclidean theorem contDiffAt_euclidean {n : β„•βˆž} : ContDiffAt π•œ n f y ↔ βˆ€ i, ContDiffAt π•œ n (fun x => f x i) y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_contDiffAt_iff, contDiffAt_pi] rfl #align cont_diff_at_euclidean contDiffAt_euclidean theorem contDiffOn_euclidean {n : β„•βˆž} : ContDiffOn π•œ n f t ↔ βˆ€ i, ContDiffOn π•œ n (fun x => f x i) t := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_contDiffOn_iff, contDiffOn_pi] rfl #align cont_diff_on_euclidean contDiffOn_euclidean theorem contDiff_euclidean {n : β„•βˆž} : ContDiff π•œ n f ↔ βˆ€ i, ContDiff π•œ n fun x => f x i := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_contDiff_iff, contDiff_pi]
rfl
theorem contDiff_euclidean {n : β„•βˆž} : ContDiff π•œ n f ↔ βˆ€ i, ContDiff π•œ n fun x => f x i := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_contDiff_iff, contDiff_pi]
Mathlib.Analysis.InnerProductSpace.Calculus.367_0.6FECEGgqdb67QLM
theorem contDiff_euclidean {n : β„•βˆž} : ContDiff π•œ n f ↔ βˆ€ i, ContDiff π•œ n fun x => f x i
Mathlib_Analysis_InnerProductSpace_Calculus
n : β„•βˆž E : Type u_1 inst✝¹ : NormedAddCommGroup E inst✝ : InnerProductSpace ℝ E ⊒ ContDiff ℝ n ↑univUnitBall
/- Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ import Mathlib.Analysis.InnerProductSpace.PiL2 import Mathlib.Analysis.SpecialFunctions.Sqrt import Mathlib.Analysis.NormedSpace.HomeomorphBall #align_import analysis.inner_product_space.calculus from "leanprover-community/mathlib"@"f9dd3204df14a0749cd456fac1e6849dfe7d2b88" /-! # Calculus in inner product spaces In this file we prove that the inner product and square of the norm in an inner space are infinitely `ℝ`-smooth. In order to state these results, we need a `NormedSpace ℝ E` instance. Though we can deduce this structure from `InnerProductSpace π•œ E`, this instance may be not definitionally equal to some other β€œnatural” instance. So, we assume `[NormedSpace ℝ E]`. We also prove that functions to a `EuclideanSpace` are (higher) differentiable if and only if their components are. This follows from the corresponding fact for finite product of normed spaces, and from the equivalence of norms in finite dimensions. ## TODO The last part of the file should be generalized to `PiLp`. -/ noncomputable section open IsROrC Real Filter open scoped BigOperators Classical Topology section DerivInner variable {π•œ E F : Type*} [IsROrC π•œ] variable [NormedAddCommGroup E] [InnerProductSpace π•œ E] variable [NormedAddCommGroup F] [InnerProductSpace ℝ F] local notation "βŸͺ" x ", " y "⟫" => @inner π•œ _ _ x y variable (π•œ) [NormedSpace ℝ E] /-- Derivative of the inner product. -/ def fderivInnerClm (p : E Γ— E) : E Γ— E β†’L[ℝ] π•œ := isBoundedBilinearMap_inner.deriv p #align fderiv_inner_clm fderivInnerClm @[simp] theorem fderivInnerClm_apply (p x : E Γ— E) : fderivInnerClm π•œ p x = βŸͺp.1, x.2⟫ + βŸͺx.1, p.2⟫ := rfl #align fderiv_inner_clm_apply fderivInnerClm_apply variable {π•œ} -- porting note: Lean 3 magically switches back to `{π•œ}` here theorem contDiff_inner {n} : ContDiff ℝ n fun p : E Γ— E => βŸͺp.1, p.2⟫ := isBoundedBilinearMap_inner.contDiff #align cont_diff_inner contDiff_inner theorem contDiffAt_inner {p : E Γ— E} {n} : ContDiffAt ℝ n (fun p : E Γ— E => βŸͺp.1, p.2⟫) p := ContDiff.contDiffAt contDiff_inner #align cont_diff_at_inner contDiffAt_inner theorem differentiable_inner : Differentiable ℝ fun p : E Γ— E => βŸͺp.1, p.2⟫ := isBoundedBilinearMap_inner.differentiableAt #align differentiable_inner differentiable_inner variable (π•œ) variable {G : Type*} [NormedAddCommGroup G] [NormedSpace ℝ G] {f g : G β†’ E} {f' g' : G β†’L[ℝ] E} {s : Set G} {x : G} {n : β„•βˆž} theorem ContDiffWithinAt.inner (hf : ContDiffWithinAt ℝ n f s x) (hg : ContDiffWithinAt ℝ n g s x) : ContDiffWithinAt ℝ n (fun x => βŸͺf x, g x⟫) s x := contDiffAt_inner.comp_contDiffWithinAt x (hf.prod hg) #align cont_diff_within_at.inner ContDiffWithinAt.inner nonrec theorem ContDiffAt.inner (hf : ContDiffAt ℝ n f x) (hg : ContDiffAt ℝ n g x) : ContDiffAt ℝ n (fun x => βŸͺf x, g x⟫) x := hf.inner π•œ hg #align cont_diff_at.inner ContDiffAt.inner theorem ContDiffOn.inner (hf : ContDiffOn ℝ n f s) (hg : ContDiffOn ℝ n g s) : ContDiffOn ℝ n (fun x => βŸͺf x, g x⟫) s := fun x hx => (hf x hx).inner π•œ (hg x hx) #align cont_diff_on.inner ContDiffOn.inner theorem ContDiff.inner (hf : ContDiff ℝ n f) (hg : ContDiff ℝ n g) : ContDiff ℝ n fun x => βŸͺf x, g x⟫ := contDiff_inner.comp (hf.prod hg) #align cont_diff.inner ContDiff.inner theorem HasFDerivWithinAt.inner (hf : HasFDerivWithinAt f f' s x) (hg : HasFDerivWithinAt g g' s x) : HasFDerivWithinAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') s x := (isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp_hasFDerivWithinAt x (hf.prod hg) #align has_fderiv_within_at.inner HasFDerivWithinAt.inner theorem HasStrictFDerivAt.inner (hf : HasStrictFDerivAt f f' x) (hg : HasStrictFDerivAt g g' x) : HasStrictFDerivAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') x := (isBoundedBilinearMap_inner.hasStrictFDerivAt (f x, g x)).comp x (hf.prod hg) #align has_strict_fderiv_at.inner HasStrictFDerivAt.inner theorem HasFDerivAt.inner (hf : HasFDerivAt f f' x) (hg : HasFDerivAt g g' x) : HasFDerivAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') x := (isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp x (hf.prod hg) #align has_fderiv_at.inner HasFDerivAt.inner theorem HasDerivWithinAt.inner {f g : ℝ β†’ E} {f' g' : E} {s : Set ℝ} {x : ℝ} (hf : HasDerivWithinAt f f' s x) (hg : HasDerivWithinAt g g' s x) : HasDerivWithinAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) s x := by simpa using (hf.hasFDerivWithinAt.inner π•œ hg.hasFDerivWithinAt).hasDerivWithinAt #align has_deriv_within_at.inner HasDerivWithinAt.inner theorem HasDerivAt.inner {f g : ℝ β†’ E} {f' g' : E} {x : ℝ} : HasDerivAt f f' x β†’ HasDerivAt g g' x β†’ HasDerivAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) x := by simpa only [← hasDerivWithinAt_univ] using HasDerivWithinAt.inner π•œ #align has_deriv_at.inner HasDerivAt.inner theorem DifferentiableWithinAt.inner (hf : DifferentiableWithinAt ℝ f s x) (hg : DifferentiableWithinAt ℝ g s x) : DifferentiableWithinAt ℝ (fun x => βŸͺf x, g x⟫) s x := ((differentiable_inner _).hasFDerivAt.comp_hasFDerivWithinAt x (hf.prod hg).hasFDerivWithinAt).differentiableWithinAt #align differentiable_within_at.inner DifferentiableWithinAt.inner theorem DifferentiableAt.inner (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) : DifferentiableAt ℝ (fun x => βŸͺf x, g x⟫) x := (differentiable_inner _).comp x (hf.prod hg) #align differentiable_at.inner DifferentiableAt.inner theorem DifferentiableOn.inner (hf : DifferentiableOn ℝ f s) (hg : DifferentiableOn ℝ g s) : DifferentiableOn ℝ (fun x => βŸͺf x, g x⟫) s := fun x hx => (hf x hx).inner π•œ (hg x hx) #align differentiable_on.inner DifferentiableOn.inner theorem Differentiable.inner (hf : Differentiable ℝ f) (hg : Differentiable ℝ g) : Differentiable ℝ fun x => βŸͺf x, g x⟫ := fun x => (hf x).inner π•œ (hg x) #align differentiable.inner Differentiable.inner theorem fderiv_inner_apply (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) (y : G) : fderiv ℝ (fun t => βŸͺf t, g t⟫) x y = βŸͺf x, fderiv ℝ g x y⟫ + βŸͺfderiv ℝ f x y, g x⟫ := by rw [(hf.hasFDerivAt.inner π•œ hg.hasFDerivAt).fderiv]; rfl #align fderiv_inner_apply fderiv_inner_apply theorem deriv_inner_apply {f g : ℝ β†’ E} {x : ℝ} (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) : deriv (fun t => βŸͺf t, g t⟫) x = βŸͺf x, deriv g x⟫ + βŸͺderiv f x, g x⟫ := (hf.hasDerivAt.inner π•œ hg.hasDerivAt).deriv #align deriv_inner_apply deriv_inner_apply theorem contDiff_norm_sq : ContDiff ℝ n fun x : E => β€–xβ€– ^ 2 := by convert (reClm : π•œ β†’L[ℝ] ℝ).contDiff.comp ((contDiff_id (E := E)).inner π•œ (contDiff_id (E := E))) exact (inner_self_eq_norm_sq _).symm #align cont_diff_norm_sq contDiff_norm_sq theorem ContDiff.norm_sq (hf : ContDiff ℝ n f) : ContDiff ℝ n fun x => β€–f xβ€– ^ 2 := (contDiff_norm_sq π•œ).comp hf #align cont_diff.norm_sq ContDiff.norm_sq theorem ContDiffWithinAt.norm_sq (hf : ContDiffWithinAt ℝ n f s x) : ContDiffWithinAt ℝ n (fun y => β€–f yβ€– ^ 2) s x := (contDiff_norm_sq π•œ).contDiffAt.comp_contDiffWithinAt x hf #align cont_diff_within_at.norm_sq ContDiffWithinAt.norm_sq nonrec theorem ContDiffAt.norm_sq (hf : ContDiffAt ℝ n f x) : ContDiffAt ℝ n (β€–f Β·β€– ^ 2) x := hf.norm_sq π•œ #align cont_diff_at.norm_sq ContDiffAt.norm_sq theorem contDiffAt_norm {x : E} (hx : x β‰  0) : ContDiffAt ℝ n norm x := by have : β€–id xβ€– ^ 2 β‰  0 := pow_ne_zero 2 (norm_pos_iff.2 hx).ne' simpa only [id, sqrt_sq, norm_nonneg] using (contDiffAt_id.norm_sq π•œ).sqrt this #align cont_diff_at_norm contDiffAt_norm theorem ContDiffAt.norm (hf : ContDiffAt ℝ n f x) (h0 : f x β‰  0) : ContDiffAt ℝ n (fun y => β€–f yβ€–) x := (contDiffAt_norm π•œ h0).comp x hf #align cont_diff_at.norm ContDiffAt.norm theorem ContDiffAt.dist (hf : ContDiffAt ℝ n f x) (hg : ContDiffAt ℝ n g x) (hne : f x β‰  g x) : ContDiffAt ℝ n (fun y => dist (f y) (g y)) x := by simp only [dist_eq_norm] exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align cont_diff_at.dist ContDiffAt.dist theorem ContDiffWithinAt.norm (hf : ContDiffWithinAt ℝ n f s x) (h0 : f x β‰  0) : ContDiffWithinAt ℝ n (fun y => β€–f yβ€–) s x := (contDiffAt_norm π•œ h0).comp_contDiffWithinAt x hf #align cont_diff_within_at.norm ContDiffWithinAt.norm theorem ContDiffWithinAt.dist (hf : ContDiffWithinAt ℝ n f s x) (hg : ContDiffWithinAt ℝ n g s x) (hne : f x β‰  g x) : ContDiffWithinAt ℝ n (fun y => dist (f y) (g y)) s x := by simp only [dist_eq_norm]; exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align cont_diff_within_at.dist ContDiffWithinAt.dist theorem ContDiffOn.norm_sq (hf : ContDiffOn ℝ n f s) : ContDiffOn ℝ n (fun y => β€–f yβ€– ^ 2) s := fun x hx => (hf x hx).norm_sq π•œ #align cont_diff_on.norm_sq ContDiffOn.norm_sq theorem ContDiffOn.norm (hf : ContDiffOn ℝ n f s) (h0 : βˆ€ x ∈ s, f x β‰  0) : ContDiffOn ℝ n (fun y => β€–f yβ€–) s := fun x hx => (hf x hx).norm π•œ (h0 x hx) #align cont_diff_on.norm ContDiffOn.norm theorem ContDiffOn.dist (hf : ContDiffOn ℝ n f s) (hg : ContDiffOn ℝ n g s) (hne : βˆ€ x ∈ s, f x β‰  g x) : ContDiffOn ℝ n (fun y => dist (f y) (g y)) s := fun x hx => (hf x hx).dist π•œ (hg x hx) (hne x hx) #align cont_diff_on.dist ContDiffOn.dist theorem ContDiff.norm (hf : ContDiff ℝ n f) (h0 : βˆ€ x, f x β‰  0) : ContDiff ℝ n fun y => β€–f yβ€– := contDiff_iff_contDiffAt.2 fun x => hf.contDiffAt.norm π•œ (h0 x) #align cont_diff.norm ContDiff.norm theorem ContDiff.dist (hf : ContDiff ℝ n f) (hg : ContDiff ℝ n g) (hne : βˆ€ x, f x β‰  g x) : ContDiff ℝ n fun y => dist (f y) (g y) := contDiff_iff_contDiffAt.2 fun x => hf.contDiffAt.dist π•œ hg.contDiffAt (hne x) #align cont_diff.dist ContDiff.dist -- porting note: use `2 β€’` instead of `bit0` theorem hasStrictFDerivAt_norm_sq (x : F) : HasStrictFDerivAt (fun x => β€–xβ€– ^ 2) (2 β€’ (innerSL ℝ x)) x := by simp only [sq, ← @inner_self_eq_norm_mul_norm ℝ] convert (hasStrictFDerivAt_id x).inner ℝ (hasStrictFDerivAt_id x) ext y simp [two_smul, real_inner_comm] #align has_strict_fderiv_at_norm_sq hasStrictFDerivAt_norm_sqβ‚“ theorem HasFDerivAt.norm_sq {f : G β†’ F} {f' : G β†’L[ℝ] F} (hf : HasFDerivAt f f' x) : HasFDerivAt (β€–f Β·β€– ^ 2) (2 β€’ (innerSL ℝ (f x)).comp f') x := (hasStrictFDerivAt_norm_sq _).hasFDerivAt.comp x hf theorem HasDerivAt.norm_sq {f : ℝ β†’ F} {f' : F} {x : ℝ} (hf : HasDerivAt f f' x) : HasDerivAt (β€–f Β·β€– ^ 2) (2 * Inner.inner (f x) f') x := by simpa using hf.hasFDerivAt.norm_sq.hasDerivAt theorem HasFDerivWithinAt.norm_sq {f : G β†’ F} {f' : G β†’L[ℝ] F} (hf : HasFDerivWithinAt f f' s x) : HasFDerivWithinAt (β€–f Β·β€– ^ 2) (2 β€’ (innerSL ℝ (f x)).comp f') s x := (hasStrictFDerivAt_norm_sq _).hasFDerivAt.comp_hasFDerivWithinAt x hf theorem HasDerivWithinAt.norm_sq {f : ℝ β†’ F} {f' : F} {s : Set ℝ} {x : ℝ} (hf : HasDerivWithinAt f f' s x) : HasDerivWithinAt (β€–f Β·β€– ^ 2) (2 * Inner.inner (f x) f') s x := by simpa using hf.hasFDerivWithinAt.norm_sq.hasDerivWithinAt theorem DifferentiableAt.norm_sq (hf : DifferentiableAt ℝ f x) : DifferentiableAt ℝ (fun y => β€–f yβ€– ^ 2) x := ((contDiffAt_id.norm_sq π•œ).differentiableAt le_rfl).comp x hf #align differentiable_at.norm_sq DifferentiableAt.norm_sq theorem DifferentiableAt.norm (hf : DifferentiableAt ℝ f x) (h0 : f x β‰  0) : DifferentiableAt ℝ (fun y => β€–f yβ€–) x := ((contDiffAt_norm π•œ h0).differentiableAt le_rfl).comp x hf #align differentiable_at.norm DifferentiableAt.norm theorem DifferentiableAt.dist (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) (hne : f x β‰  g x) : DifferentiableAt ℝ (fun y => dist (f y) (g y)) x := by simp only [dist_eq_norm]; exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align differentiable_at.dist DifferentiableAt.dist theorem Differentiable.norm_sq (hf : Differentiable ℝ f) : Differentiable ℝ fun y => β€–f yβ€– ^ 2 := fun x => (hf x).norm_sq π•œ #align differentiable.norm_sq Differentiable.norm_sq theorem Differentiable.norm (hf : Differentiable ℝ f) (h0 : βˆ€ x, f x β‰  0) : Differentiable ℝ fun y => β€–f yβ€– := fun x => (hf x).norm π•œ (h0 x) #align differentiable.norm Differentiable.norm theorem Differentiable.dist (hf : Differentiable ℝ f) (hg : Differentiable ℝ g) (hne : βˆ€ x, f x β‰  g x) : Differentiable ℝ fun y => dist (f y) (g y) := fun x => (hf x).dist π•œ (hg x) (hne x) #align differentiable.dist Differentiable.dist theorem DifferentiableWithinAt.norm_sq (hf : DifferentiableWithinAt ℝ f s x) : DifferentiableWithinAt ℝ (fun y => β€–f yβ€– ^ 2) s x := ((contDiffAt_id.norm_sq π•œ).differentiableAt le_rfl).comp_differentiableWithinAt x hf #align differentiable_within_at.norm_sq DifferentiableWithinAt.norm_sq theorem DifferentiableWithinAt.norm (hf : DifferentiableWithinAt ℝ f s x) (h0 : f x β‰  0) : DifferentiableWithinAt ℝ (fun y => β€–f yβ€–) s x := ((contDiffAt_id.norm π•œ h0).differentiableAt le_rfl).comp_differentiableWithinAt x hf #align differentiable_within_at.norm DifferentiableWithinAt.norm theorem DifferentiableWithinAt.dist (hf : DifferentiableWithinAt ℝ f s x) (hg : DifferentiableWithinAt ℝ g s x) (hne : f x β‰  g x) : DifferentiableWithinAt ℝ (fun y => dist (f y) (g y)) s x := by simp only [dist_eq_norm] exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align differentiable_within_at.dist DifferentiableWithinAt.dist theorem DifferentiableOn.norm_sq (hf : DifferentiableOn ℝ f s) : DifferentiableOn ℝ (fun y => β€–f yβ€– ^ 2) s := fun x hx => (hf x hx).norm_sq π•œ #align differentiable_on.norm_sq DifferentiableOn.norm_sq theorem DifferentiableOn.norm (hf : DifferentiableOn ℝ f s) (h0 : βˆ€ x ∈ s, f x β‰  0) : DifferentiableOn ℝ (fun y => β€–f yβ€–) s := fun x hx => (hf x hx).norm π•œ (h0 x hx) #align differentiable_on.norm DifferentiableOn.norm theorem DifferentiableOn.dist (hf : DifferentiableOn ℝ f s) (hg : DifferentiableOn ℝ g s) (hne : βˆ€ x ∈ s, f x β‰  g x) : DifferentiableOn ℝ (fun y => dist (f y) (g y)) s := fun x hx => (hf x hx).dist π•œ (hg x hx) (hne x hx) #align differentiable_on.dist DifferentiableOn.dist end DerivInner section PiLike open ContinuousLinearMap variable {π•œ ΞΉ H : Type*} [IsROrC π•œ] [NormedAddCommGroup H] [NormedSpace π•œ H] [Fintype ΞΉ] {f : H β†’ EuclideanSpace π•œ ΞΉ} {f' : H β†’L[π•œ] EuclideanSpace π•œ ΞΉ} {t : Set H} {y : H} theorem differentiableWithinAt_euclidean : DifferentiableWithinAt π•œ f t y ↔ βˆ€ i, DifferentiableWithinAt π•œ (fun x => f x i) t y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_differentiableWithinAt_iff, differentiableWithinAt_pi] rfl #align differentiable_within_at_euclidean differentiableWithinAt_euclidean theorem differentiableAt_euclidean : DifferentiableAt π•œ f y ↔ βˆ€ i, DifferentiableAt π•œ (fun x => f x i) y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_differentiableAt_iff, differentiableAt_pi] rfl #align differentiable_at_euclidean differentiableAt_euclidean theorem differentiableOn_euclidean : DifferentiableOn π•œ f t ↔ βˆ€ i, DifferentiableOn π•œ (fun x => f x i) t := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_differentiableOn_iff, differentiableOn_pi] rfl #align differentiable_on_euclidean differentiableOn_euclidean theorem differentiable_euclidean : Differentiable π•œ f ↔ βˆ€ i, Differentiable π•œ fun x => f x i := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_differentiable_iff, differentiable_pi] rfl #align differentiable_euclidean differentiable_euclidean theorem hasStrictFDerivAt_euclidean : HasStrictFDerivAt f f' y ↔ βˆ€ i, HasStrictFDerivAt (fun x => f x i) (EuclideanSpace.proj i ∘L f') y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_hasStrictFDerivAt_iff, hasStrictFDerivAt_pi'] rfl #align has_strict_fderiv_at_euclidean hasStrictFDerivAt_euclidean theorem hasFDerivWithinAt_euclidean : HasFDerivWithinAt f f' t y ↔ βˆ€ i, HasFDerivWithinAt (fun x => f x i) (EuclideanSpace.proj i ∘L f') t y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_hasFDerivWithinAt_iff, hasFDerivWithinAt_pi'] rfl #align has_fderiv_within_at_euclidean hasFDerivWithinAt_euclidean theorem contDiffWithinAt_euclidean {n : β„•βˆž} : ContDiffWithinAt π•œ n f t y ↔ βˆ€ i, ContDiffWithinAt π•œ n (fun x => f x i) t y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_contDiffWithinAt_iff, contDiffWithinAt_pi] rfl #align cont_diff_within_at_euclidean contDiffWithinAt_euclidean theorem contDiffAt_euclidean {n : β„•βˆž} : ContDiffAt π•œ n f y ↔ βˆ€ i, ContDiffAt π•œ n (fun x => f x i) y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_contDiffAt_iff, contDiffAt_pi] rfl #align cont_diff_at_euclidean contDiffAt_euclidean theorem contDiffOn_euclidean {n : β„•βˆž} : ContDiffOn π•œ n f t ↔ βˆ€ i, ContDiffOn π•œ n (fun x => f x i) t := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_contDiffOn_iff, contDiffOn_pi] rfl #align cont_diff_on_euclidean contDiffOn_euclidean theorem contDiff_euclidean {n : β„•βˆž} : ContDiff π•œ n f ↔ βˆ€ i, ContDiff π•œ n fun x => f x i := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_contDiff_iff, contDiff_pi] rfl #align cont_diff_euclidean contDiff_euclidean end PiLike section DiffeomorphUnitBall open Metric hiding mem_nhds_iff variable {n : β„•βˆž} {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] theorem PartialHomeomorph.contDiff_univUnitBall : ContDiff ℝ n (univUnitBall : E β†’ E) := by
suffices ContDiff ℝ n fun x : E => (1 + β€–xβ€– ^ 2 : ℝ).sqrt⁻¹ from this.smul contDiff_id
theorem PartialHomeomorph.contDiff_univUnitBall : ContDiff ℝ n (univUnitBall : E β†’ E) := by
Mathlib.Analysis.InnerProductSpace.Calculus.380_0.6FECEGgqdb67QLM
theorem PartialHomeomorph.contDiff_univUnitBall : ContDiff ℝ n (univUnitBall : E β†’ E)
Mathlib_Analysis_InnerProductSpace_Calculus
n : β„•βˆž E : Type u_1 inst✝¹ : NormedAddCommGroup E inst✝ : InnerProductSpace ℝ E ⊒ ContDiff ℝ n fun x => (sqrt (1 + β€–xβ€– ^ 2))⁻¹
/- Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ import Mathlib.Analysis.InnerProductSpace.PiL2 import Mathlib.Analysis.SpecialFunctions.Sqrt import Mathlib.Analysis.NormedSpace.HomeomorphBall #align_import analysis.inner_product_space.calculus from "leanprover-community/mathlib"@"f9dd3204df14a0749cd456fac1e6849dfe7d2b88" /-! # Calculus in inner product spaces In this file we prove that the inner product and square of the norm in an inner space are infinitely `ℝ`-smooth. In order to state these results, we need a `NormedSpace ℝ E` instance. Though we can deduce this structure from `InnerProductSpace π•œ E`, this instance may be not definitionally equal to some other β€œnatural” instance. So, we assume `[NormedSpace ℝ E]`. We also prove that functions to a `EuclideanSpace` are (higher) differentiable if and only if their components are. This follows from the corresponding fact for finite product of normed spaces, and from the equivalence of norms in finite dimensions. ## TODO The last part of the file should be generalized to `PiLp`. -/ noncomputable section open IsROrC Real Filter open scoped BigOperators Classical Topology section DerivInner variable {π•œ E F : Type*} [IsROrC π•œ] variable [NormedAddCommGroup E] [InnerProductSpace π•œ E] variable [NormedAddCommGroup F] [InnerProductSpace ℝ F] local notation "βŸͺ" x ", " y "⟫" => @inner π•œ _ _ x y variable (π•œ) [NormedSpace ℝ E] /-- Derivative of the inner product. -/ def fderivInnerClm (p : E Γ— E) : E Γ— E β†’L[ℝ] π•œ := isBoundedBilinearMap_inner.deriv p #align fderiv_inner_clm fderivInnerClm @[simp] theorem fderivInnerClm_apply (p x : E Γ— E) : fderivInnerClm π•œ p x = βŸͺp.1, x.2⟫ + βŸͺx.1, p.2⟫ := rfl #align fderiv_inner_clm_apply fderivInnerClm_apply variable {π•œ} -- porting note: Lean 3 magically switches back to `{π•œ}` here theorem contDiff_inner {n} : ContDiff ℝ n fun p : E Γ— E => βŸͺp.1, p.2⟫ := isBoundedBilinearMap_inner.contDiff #align cont_diff_inner contDiff_inner theorem contDiffAt_inner {p : E Γ— E} {n} : ContDiffAt ℝ n (fun p : E Γ— E => βŸͺp.1, p.2⟫) p := ContDiff.contDiffAt contDiff_inner #align cont_diff_at_inner contDiffAt_inner theorem differentiable_inner : Differentiable ℝ fun p : E Γ— E => βŸͺp.1, p.2⟫ := isBoundedBilinearMap_inner.differentiableAt #align differentiable_inner differentiable_inner variable (π•œ) variable {G : Type*} [NormedAddCommGroup G] [NormedSpace ℝ G] {f g : G β†’ E} {f' g' : G β†’L[ℝ] E} {s : Set G} {x : G} {n : β„•βˆž} theorem ContDiffWithinAt.inner (hf : ContDiffWithinAt ℝ n f s x) (hg : ContDiffWithinAt ℝ n g s x) : ContDiffWithinAt ℝ n (fun x => βŸͺf x, g x⟫) s x := contDiffAt_inner.comp_contDiffWithinAt x (hf.prod hg) #align cont_diff_within_at.inner ContDiffWithinAt.inner nonrec theorem ContDiffAt.inner (hf : ContDiffAt ℝ n f x) (hg : ContDiffAt ℝ n g x) : ContDiffAt ℝ n (fun x => βŸͺf x, g x⟫) x := hf.inner π•œ hg #align cont_diff_at.inner ContDiffAt.inner theorem ContDiffOn.inner (hf : ContDiffOn ℝ n f s) (hg : ContDiffOn ℝ n g s) : ContDiffOn ℝ n (fun x => βŸͺf x, g x⟫) s := fun x hx => (hf x hx).inner π•œ (hg x hx) #align cont_diff_on.inner ContDiffOn.inner theorem ContDiff.inner (hf : ContDiff ℝ n f) (hg : ContDiff ℝ n g) : ContDiff ℝ n fun x => βŸͺf x, g x⟫ := contDiff_inner.comp (hf.prod hg) #align cont_diff.inner ContDiff.inner theorem HasFDerivWithinAt.inner (hf : HasFDerivWithinAt f f' s x) (hg : HasFDerivWithinAt g g' s x) : HasFDerivWithinAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') s x := (isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp_hasFDerivWithinAt x (hf.prod hg) #align has_fderiv_within_at.inner HasFDerivWithinAt.inner theorem HasStrictFDerivAt.inner (hf : HasStrictFDerivAt f f' x) (hg : HasStrictFDerivAt g g' x) : HasStrictFDerivAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') x := (isBoundedBilinearMap_inner.hasStrictFDerivAt (f x, g x)).comp x (hf.prod hg) #align has_strict_fderiv_at.inner HasStrictFDerivAt.inner theorem HasFDerivAt.inner (hf : HasFDerivAt f f' x) (hg : HasFDerivAt g g' x) : HasFDerivAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') x := (isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp x (hf.prod hg) #align has_fderiv_at.inner HasFDerivAt.inner theorem HasDerivWithinAt.inner {f g : ℝ β†’ E} {f' g' : E} {s : Set ℝ} {x : ℝ} (hf : HasDerivWithinAt f f' s x) (hg : HasDerivWithinAt g g' s x) : HasDerivWithinAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) s x := by simpa using (hf.hasFDerivWithinAt.inner π•œ hg.hasFDerivWithinAt).hasDerivWithinAt #align has_deriv_within_at.inner HasDerivWithinAt.inner theorem HasDerivAt.inner {f g : ℝ β†’ E} {f' g' : E} {x : ℝ} : HasDerivAt f f' x β†’ HasDerivAt g g' x β†’ HasDerivAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) x := by simpa only [← hasDerivWithinAt_univ] using HasDerivWithinAt.inner π•œ #align has_deriv_at.inner HasDerivAt.inner theorem DifferentiableWithinAt.inner (hf : DifferentiableWithinAt ℝ f s x) (hg : DifferentiableWithinAt ℝ g s x) : DifferentiableWithinAt ℝ (fun x => βŸͺf x, g x⟫) s x := ((differentiable_inner _).hasFDerivAt.comp_hasFDerivWithinAt x (hf.prod hg).hasFDerivWithinAt).differentiableWithinAt #align differentiable_within_at.inner DifferentiableWithinAt.inner theorem DifferentiableAt.inner (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) : DifferentiableAt ℝ (fun x => βŸͺf x, g x⟫) x := (differentiable_inner _).comp x (hf.prod hg) #align differentiable_at.inner DifferentiableAt.inner theorem DifferentiableOn.inner (hf : DifferentiableOn ℝ f s) (hg : DifferentiableOn ℝ g s) : DifferentiableOn ℝ (fun x => βŸͺf x, g x⟫) s := fun x hx => (hf x hx).inner π•œ (hg x hx) #align differentiable_on.inner DifferentiableOn.inner theorem Differentiable.inner (hf : Differentiable ℝ f) (hg : Differentiable ℝ g) : Differentiable ℝ fun x => βŸͺf x, g x⟫ := fun x => (hf x).inner π•œ (hg x) #align differentiable.inner Differentiable.inner theorem fderiv_inner_apply (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) (y : G) : fderiv ℝ (fun t => βŸͺf t, g t⟫) x y = βŸͺf x, fderiv ℝ g x y⟫ + βŸͺfderiv ℝ f x y, g x⟫ := by rw [(hf.hasFDerivAt.inner π•œ hg.hasFDerivAt).fderiv]; rfl #align fderiv_inner_apply fderiv_inner_apply theorem deriv_inner_apply {f g : ℝ β†’ E} {x : ℝ} (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) : deriv (fun t => βŸͺf t, g t⟫) x = βŸͺf x, deriv g x⟫ + βŸͺderiv f x, g x⟫ := (hf.hasDerivAt.inner π•œ hg.hasDerivAt).deriv #align deriv_inner_apply deriv_inner_apply theorem contDiff_norm_sq : ContDiff ℝ n fun x : E => β€–xβ€– ^ 2 := by convert (reClm : π•œ β†’L[ℝ] ℝ).contDiff.comp ((contDiff_id (E := E)).inner π•œ (contDiff_id (E := E))) exact (inner_self_eq_norm_sq _).symm #align cont_diff_norm_sq contDiff_norm_sq theorem ContDiff.norm_sq (hf : ContDiff ℝ n f) : ContDiff ℝ n fun x => β€–f xβ€– ^ 2 := (contDiff_norm_sq π•œ).comp hf #align cont_diff.norm_sq ContDiff.norm_sq theorem ContDiffWithinAt.norm_sq (hf : ContDiffWithinAt ℝ n f s x) : ContDiffWithinAt ℝ n (fun y => β€–f yβ€– ^ 2) s x := (contDiff_norm_sq π•œ).contDiffAt.comp_contDiffWithinAt x hf #align cont_diff_within_at.norm_sq ContDiffWithinAt.norm_sq nonrec theorem ContDiffAt.norm_sq (hf : ContDiffAt ℝ n f x) : ContDiffAt ℝ n (β€–f Β·β€– ^ 2) x := hf.norm_sq π•œ #align cont_diff_at.norm_sq ContDiffAt.norm_sq theorem contDiffAt_norm {x : E} (hx : x β‰  0) : ContDiffAt ℝ n norm x := by have : β€–id xβ€– ^ 2 β‰  0 := pow_ne_zero 2 (norm_pos_iff.2 hx).ne' simpa only [id, sqrt_sq, norm_nonneg] using (contDiffAt_id.norm_sq π•œ).sqrt this #align cont_diff_at_norm contDiffAt_norm theorem ContDiffAt.norm (hf : ContDiffAt ℝ n f x) (h0 : f x β‰  0) : ContDiffAt ℝ n (fun y => β€–f yβ€–) x := (contDiffAt_norm π•œ h0).comp x hf #align cont_diff_at.norm ContDiffAt.norm theorem ContDiffAt.dist (hf : ContDiffAt ℝ n f x) (hg : ContDiffAt ℝ n g x) (hne : f x β‰  g x) : ContDiffAt ℝ n (fun y => dist (f y) (g y)) x := by simp only [dist_eq_norm] exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align cont_diff_at.dist ContDiffAt.dist theorem ContDiffWithinAt.norm (hf : ContDiffWithinAt ℝ n f s x) (h0 : f x β‰  0) : ContDiffWithinAt ℝ n (fun y => β€–f yβ€–) s x := (contDiffAt_norm π•œ h0).comp_contDiffWithinAt x hf #align cont_diff_within_at.norm ContDiffWithinAt.norm theorem ContDiffWithinAt.dist (hf : ContDiffWithinAt ℝ n f s x) (hg : ContDiffWithinAt ℝ n g s x) (hne : f x β‰  g x) : ContDiffWithinAt ℝ n (fun y => dist (f y) (g y)) s x := by simp only [dist_eq_norm]; exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align cont_diff_within_at.dist ContDiffWithinAt.dist theorem ContDiffOn.norm_sq (hf : ContDiffOn ℝ n f s) : ContDiffOn ℝ n (fun y => β€–f yβ€– ^ 2) s := fun x hx => (hf x hx).norm_sq π•œ #align cont_diff_on.norm_sq ContDiffOn.norm_sq theorem ContDiffOn.norm (hf : ContDiffOn ℝ n f s) (h0 : βˆ€ x ∈ s, f x β‰  0) : ContDiffOn ℝ n (fun y => β€–f yβ€–) s := fun x hx => (hf x hx).norm π•œ (h0 x hx) #align cont_diff_on.norm ContDiffOn.norm theorem ContDiffOn.dist (hf : ContDiffOn ℝ n f s) (hg : ContDiffOn ℝ n g s) (hne : βˆ€ x ∈ s, f x β‰  g x) : ContDiffOn ℝ n (fun y => dist (f y) (g y)) s := fun x hx => (hf x hx).dist π•œ (hg x hx) (hne x hx) #align cont_diff_on.dist ContDiffOn.dist theorem ContDiff.norm (hf : ContDiff ℝ n f) (h0 : βˆ€ x, f x β‰  0) : ContDiff ℝ n fun y => β€–f yβ€– := contDiff_iff_contDiffAt.2 fun x => hf.contDiffAt.norm π•œ (h0 x) #align cont_diff.norm ContDiff.norm theorem ContDiff.dist (hf : ContDiff ℝ n f) (hg : ContDiff ℝ n g) (hne : βˆ€ x, f x β‰  g x) : ContDiff ℝ n fun y => dist (f y) (g y) := contDiff_iff_contDiffAt.2 fun x => hf.contDiffAt.dist π•œ hg.contDiffAt (hne x) #align cont_diff.dist ContDiff.dist -- porting note: use `2 β€’` instead of `bit0` theorem hasStrictFDerivAt_norm_sq (x : F) : HasStrictFDerivAt (fun x => β€–xβ€– ^ 2) (2 β€’ (innerSL ℝ x)) x := by simp only [sq, ← @inner_self_eq_norm_mul_norm ℝ] convert (hasStrictFDerivAt_id x).inner ℝ (hasStrictFDerivAt_id x) ext y simp [two_smul, real_inner_comm] #align has_strict_fderiv_at_norm_sq hasStrictFDerivAt_norm_sqβ‚“ theorem HasFDerivAt.norm_sq {f : G β†’ F} {f' : G β†’L[ℝ] F} (hf : HasFDerivAt f f' x) : HasFDerivAt (β€–f Β·β€– ^ 2) (2 β€’ (innerSL ℝ (f x)).comp f') x := (hasStrictFDerivAt_norm_sq _).hasFDerivAt.comp x hf theorem HasDerivAt.norm_sq {f : ℝ β†’ F} {f' : F} {x : ℝ} (hf : HasDerivAt f f' x) : HasDerivAt (β€–f Β·β€– ^ 2) (2 * Inner.inner (f x) f') x := by simpa using hf.hasFDerivAt.norm_sq.hasDerivAt theorem HasFDerivWithinAt.norm_sq {f : G β†’ F} {f' : G β†’L[ℝ] F} (hf : HasFDerivWithinAt f f' s x) : HasFDerivWithinAt (β€–f Β·β€– ^ 2) (2 β€’ (innerSL ℝ (f x)).comp f') s x := (hasStrictFDerivAt_norm_sq _).hasFDerivAt.comp_hasFDerivWithinAt x hf theorem HasDerivWithinAt.norm_sq {f : ℝ β†’ F} {f' : F} {s : Set ℝ} {x : ℝ} (hf : HasDerivWithinAt f f' s x) : HasDerivWithinAt (β€–f Β·β€– ^ 2) (2 * Inner.inner (f x) f') s x := by simpa using hf.hasFDerivWithinAt.norm_sq.hasDerivWithinAt theorem DifferentiableAt.norm_sq (hf : DifferentiableAt ℝ f x) : DifferentiableAt ℝ (fun y => β€–f yβ€– ^ 2) x := ((contDiffAt_id.norm_sq π•œ).differentiableAt le_rfl).comp x hf #align differentiable_at.norm_sq DifferentiableAt.norm_sq theorem DifferentiableAt.norm (hf : DifferentiableAt ℝ f x) (h0 : f x β‰  0) : DifferentiableAt ℝ (fun y => β€–f yβ€–) x := ((contDiffAt_norm π•œ h0).differentiableAt le_rfl).comp x hf #align differentiable_at.norm DifferentiableAt.norm theorem DifferentiableAt.dist (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) (hne : f x β‰  g x) : DifferentiableAt ℝ (fun y => dist (f y) (g y)) x := by simp only [dist_eq_norm]; exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align differentiable_at.dist DifferentiableAt.dist theorem Differentiable.norm_sq (hf : Differentiable ℝ f) : Differentiable ℝ fun y => β€–f yβ€– ^ 2 := fun x => (hf x).norm_sq π•œ #align differentiable.norm_sq Differentiable.norm_sq theorem Differentiable.norm (hf : Differentiable ℝ f) (h0 : βˆ€ x, f x β‰  0) : Differentiable ℝ fun y => β€–f yβ€– := fun x => (hf x).norm π•œ (h0 x) #align differentiable.norm Differentiable.norm theorem Differentiable.dist (hf : Differentiable ℝ f) (hg : Differentiable ℝ g) (hne : βˆ€ x, f x β‰  g x) : Differentiable ℝ fun y => dist (f y) (g y) := fun x => (hf x).dist π•œ (hg x) (hne x) #align differentiable.dist Differentiable.dist theorem DifferentiableWithinAt.norm_sq (hf : DifferentiableWithinAt ℝ f s x) : DifferentiableWithinAt ℝ (fun y => β€–f yβ€– ^ 2) s x := ((contDiffAt_id.norm_sq π•œ).differentiableAt le_rfl).comp_differentiableWithinAt x hf #align differentiable_within_at.norm_sq DifferentiableWithinAt.norm_sq theorem DifferentiableWithinAt.norm (hf : DifferentiableWithinAt ℝ f s x) (h0 : f x β‰  0) : DifferentiableWithinAt ℝ (fun y => β€–f yβ€–) s x := ((contDiffAt_id.norm π•œ h0).differentiableAt le_rfl).comp_differentiableWithinAt x hf #align differentiable_within_at.norm DifferentiableWithinAt.norm theorem DifferentiableWithinAt.dist (hf : DifferentiableWithinAt ℝ f s x) (hg : DifferentiableWithinAt ℝ g s x) (hne : f x β‰  g x) : DifferentiableWithinAt ℝ (fun y => dist (f y) (g y)) s x := by simp only [dist_eq_norm] exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align differentiable_within_at.dist DifferentiableWithinAt.dist theorem DifferentiableOn.norm_sq (hf : DifferentiableOn ℝ f s) : DifferentiableOn ℝ (fun y => β€–f yβ€– ^ 2) s := fun x hx => (hf x hx).norm_sq π•œ #align differentiable_on.norm_sq DifferentiableOn.norm_sq theorem DifferentiableOn.norm (hf : DifferentiableOn ℝ f s) (h0 : βˆ€ x ∈ s, f x β‰  0) : DifferentiableOn ℝ (fun y => β€–f yβ€–) s := fun x hx => (hf x hx).norm π•œ (h0 x hx) #align differentiable_on.norm DifferentiableOn.norm theorem DifferentiableOn.dist (hf : DifferentiableOn ℝ f s) (hg : DifferentiableOn ℝ g s) (hne : βˆ€ x ∈ s, f x β‰  g x) : DifferentiableOn ℝ (fun y => dist (f y) (g y)) s := fun x hx => (hf x hx).dist π•œ (hg x hx) (hne x hx) #align differentiable_on.dist DifferentiableOn.dist end DerivInner section PiLike open ContinuousLinearMap variable {π•œ ΞΉ H : Type*} [IsROrC π•œ] [NormedAddCommGroup H] [NormedSpace π•œ H] [Fintype ΞΉ] {f : H β†’ EuclideanSpace π•œ ΞΉ} {f' : H β†’L[π•œ] EuclideanSpace π•œ ΞΉ} {t : Set H} {y : H} theorem differentiableWithinAt_euclidean : DifferentiableWithinAt π•œ f t y ↔ βˆ€ i, DifferentiableWithinAt π•œ (fun x => f x i) t y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_differentiableWithinAt_iff, differentiableWithinAt_pi] rfl #align differentiable_within_at_euclidean differentiableWithinAt_euclidean theorem differentiableAt_euclidean : DifferentiableAt π•œ f y ↔ βˆ€ i, DifferentiableAt π•œ (fun x => f x i) y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_differentiableAt_iff, differentiableAt_pi] rfl #align differentiable_at_euclidean differentiableAt_euclidean theorem differentiableOn_euclidean : DifferentiableOn π•œ f t ↔ βˆ€ i, DifferentiableOn π•œ (fun x => f x i) t := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_differentiableOn_iff, differentiableOn_pi] rfl #align differentiable_on_euclidean differentiableOn_euclidean theorem differentiable_euclidean : Differentiable π•œ f ↔ βˆ€ i, Differentiable π•œ fun x => f x i := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_differentiable_iff, differentiable_pi] rfl #align differentiable_euclidean differentiable_euclidean theorem hasStrictFDerivAt_euclidean : HasStrictFDerivAt f f' y ↔ βˆ€ i, HasStrictFDerivAt (fun x => f x i) (EuclideanSpace.proj i ∘L f') y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_hasStrictFDerivAt_iff, hasStrictFDerivAt_pi'] rfl #align has_strict_fderiv_at_euclidean hasStrictFDerivAt_euclidean theorem hasFDerivWithinAt_euclidean : HasFDerivWithinAt f f' t y ↔ βˆ€ i, HasFDerivWithinAt (fun x => f x i) (EuclideanSpace.proj i ∘L f') t y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_hasFDerivWithinAt_iff, hasFDerivWithinAt_pi'] rfl #align has_fderiv_within_at_euclidean hasFDerivWithinAt_euclidean theorem contDiffWithinAt_euclidean {n : β„•βˆž} : ContDiffWithinAt π•œ n f t y ↔ βˆ€ i, ContDiffWithinAt π•œ n (fun x => f x i) t y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_contDiffWithinAt_iff, contDiffWithinAt_pi] rfl #align cont_diff_within_at_euclidean contDiffWithinAt_euclidean theorem contDiffAt_euclidean {n : β„•βˆž} : ContDiffAt π•œ n f y ↔ βˆ€ i, ContDiffAt π•œ n (fun x => f x i) y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_contDiffAt_iff, contDiffAt_pi] rfl #align cont_diff_at_euclidean contDiffAt_euclidean theorem contDiffOn_euclidean {n : β„•βˆž} : ContDiffOn π•œ n f t ↔ βˆ€ i, ContDiffOn π•œ n (fun x => f x i) t := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_contDiffOn_iff, contDiffOn_pi] rfl #align cont_diff_on_euclidean contDiffOn_euclidean theorem contDiff_euclidean {n : β„•βˆž} : ContDiff π•œ n f ↔ βˆ€ i, ContDiff π•œ n fun x => f x i := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_contDiff_iff, contDiff_pi] rfl #align cont_diff_euclidean contDiff_euclidean end PiLike section DiffeomorphUnitBall open Metric hiding mem_nhds_iff variable {n : β„•βˆž} {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] theorem PartialHomeomorph.contDiff_univUnitBall : ContDiff ℝ n (univUnitBall : E β†’ E) := by suffices ContDiff ℝ n fun x : E => (1 + β€–xβ€– ^ 2 : ℝ).sqrt⁻¹ from this.smul contDiff_id
have h : βˆ€ x : E, (0 : ℝ) < (1 : ℝ) + β€–xβ€– ^ 2 := fun x => by positivity
theorem PartialHomeomorph.contDiff_univUnitBall : ContDiff ℝ n (univUnitBall : E β†’ E) := by suffices ContDiff ℝ n fun x : E => (1 + β€–xβ€– ^ 2 : ℝ).sqrt⁻¹ from this.smul contDiff_id
Mathlib.Analysis.InnerProductSpace.Calculus.380_0.6FECEGgqdb67QLM
theorem PartialHomeomorph.contDiff_univUnitBall : ContDiff ℝ n (univUnitBall : E β†’ E)
Mathlib_Analysis_InnerProductSpace_Calculus
n : β„•βˆž E : Type u_1 inst✝¹ : NormedAddCommGroup E inst✝ : InnerProductSpace ℝ E x : E ⊒ 0 < 1 + β€–xβ€– ^ 2
/- Copyright (c) 2020 Yury Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury Kudryashov -/ import Mathlib.Analysis.InnerProductSpace.PiL2 import Mathlib.Analysis.SpecialFunctions.Sqrt import Mathlib.Analysis.NormedSpace.HomeomorphBall #align_import analysis.inner_product_space.calculus from "leanprover-community/mathlib"@"f9dd3204df14a0749cd456fac1e6849dfe7d2b88" /-! # Calculus in inner product spaces In this file we prove that the inner product and square of the norm in an inner space are infinitely `ℝ`-smooth. In order to state these results, we need a `NormedSpace ℝ E` instance. Though we can deduce this structure from `InnerProductSpace π•œ E`, this instance may be not definitionally equal to some other β€œnatural” instance. So, we assume `[NormedSpace ℝ E]`. We also prove that functions to a `EuclideanSpace` are (higher) differentiable if and only if their components are. This follows from the corresponding fact for finite product of normed spaces, and from the equivalence of norms in finite dimensions. ## TODO The last part of the file should be generalized to `PiLp`. -/ noncomputable section open IsROrC Real Filter open scoped BigOperators Classical Topology section DerivInner variable {π•œ E F : Type*} [IsROrC π•œ] variable [NormedAddCommGroup E] [InnerProductSpace π•œ E] variable [NormedAddCommGroup F] [InnerProductSpace ℝ F] local notation "βŸͺ" x ", " y "⟫" => @inner π•œ _ _ x y variable (π•œ) [NormedSpace ℝ E] /-- Derivative of the inner product. -/ def fderivInnerClm (p : E Γ— E) : E Γ— E β†’L[ℝ] π•œ := isBoundedBilinearMap_inner.deriv p #align fderiv_inner_clm fderivInnerClm @[simp] theorem fderivInnerClm_apply (p x : E Γ— E) : fderivInnerClm π•œ p x = βŸͺp.1, x.2⟫ + βŸͺx.1, p.2⟫ := rfl #align fderiv_inner_clm_apply fderivInnerClm_apply variable {π•œ} -- porting note: Lean 3 magically switches back to `{π•œ}` here theorem contDiff_inner {n} : ContDiff ℝ n fun p : E Γ— E => βŸͺp.1, p.2⟫ := isBoundedBilinearMap_inner.contDiff #align cont_diff_inner contDiff_inner theorem contDiffAt_inner {p : E Γ— E} {n} : ContDiffAt ℝ n (fun p : E Γ— E => βŸͺp.1, p.2⟫) p := ContDiff.contDiffAt contDiff_inner #align cont_diff_at_inner contDiffAt_inner theorem differentiable_inner : Differentiable ℝ fun p : E Γ— E => βŸͺp.1, p.2⟫ := isBoundedBilinearMap_inner.differentiableAt #align differentiable_inner differentiable_inner variable (π•œ) variable {G : Type*} [NormedAddCommGroup G] [NormedSpace ℝ G] {f g : G β†’ E} {f' g' : G β†’L[ℝ] E} {s : Set G} {x : G} {n : β„•βˆž} theorem ContDiffWithinAt.inner (hf : ContDiffWithinAt ℝ n f s x) (hg : ContDiffWithinAt ℝ n g s x) : ContDiffWithinAt ℝ n (fun x => βŸͺf x, g x⟫) s x := contDiffAt_inner.comp_contDiffWithinAt x (hf.prod hg) #align cont_diff_within_at.inner ContDiffWithinAt.inner nonrec theorem ContDiffAt.inner (hf : ContDiffAt ℝ n f x) (hg : ContDiffAt ℝ n g x) : ContDiffAt ℝ n (fun x => βŸͺf x, g x⟫) x := hf.inner π•œ hg #align cont_diff_at.inner ContDiffAt.inner theorem ContDiffOn.inner (hf : ContDiffOn ℝ n f s) (hg : ContDiffOn ℝ n g s) : ContDiffOn ℝ n (fun x => βŸͺf x, g x⟫) s := fun x hx => (hf x hx).inner π•œ (hg x hx) #align cont_diff_on.inner ContDiffOn.inner theorem ContDiff.inner (hf : ContDiff ℝ n f) (hg : ContDiff ℝ n g) : ContDiff ℝ n fun x => βŸͺf x, g x⟫ := contDiff_inner.comp (hf.prod hg) #align cont_diff.inner ContDiff.inner theorem HasFDerivWithinAt.inner (hf : HasFDerivWithinAt f f' s x) (hg : HasFDerivWithinAt g g' s x) : HasFDerivWithinAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') s x := (isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp_hasFDerivWithinAt x (hf.prod hg) #align has_fderiv_within_at.inner HasFDerivWithinAt.inner theorem HasStrictFDerivAt.inner (hf : HasStrictFDerivAt f f' x) (hg : HasStrictFDerivAt g g' x) : HasStrictFDerivAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') x := (isBoundedBilinearMap_inner.hasStrictFDerivAt (f x, g x)).comp x (hf.prod hg) #align has_strict_fderiv_at.inner HasStrictFDerivAt.inner theorem HasFDerivAt.inner (hf : HasFDerivAt f f' x) (hg : HasFDerivAt g g' x) : HasFDerivAt (fun t => βŸͺf t, g t⟫) ((fderivInnerClm π•œ (f x, g x)).comp <| f'.prod g') x := (isBoundedBilinearMap_inner.hasFDerivAt (f x, g x)).comp x (hf.prod hg) #align has_fderiv_at.inner HasFDerivAt.inner theorem HasDerivWithinAt.inner {f g : ℝ β†’ E} {f' g' : E} {s : Set ℝ} {x : ℝ} (hf : HasDerivWithinAt f f' s x) (hg : HasDerivWithinAt g g' s x) : HasDerivWithinAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) s x := by simpa using (hf.hasFDerivWithinAt.inner π•œ hg.hasFDerivWithinAt).hasDerivWithinAt #align has_deriv_within_at.inner HasDerivWithinAt.inner theorem HasDerivAt.inner {f g : ℝ β†’ E} {f' g' : E} {x : ℝ} : HasDerivAt f f' x β†’ HasDerivAt g g' x β†’ HasDerivAt (fun t => βŸͺf t, g t⟫) (βŸͺf x, g'⟫ + βŸͺf', g x⟫) x := by simpa only [← hasDerivWithinAt_univ] using HasDerivWithinAt.inner π•œ #align has_deriv_at.inner HasDerivAt.inner theorem DifferentiableWithinAt.inner (hf : DifferentiableWithinAt ℝ f s x) (hg : DifferentiableWithinAt ℝ g s x) : DifferentiableWithinAt ℝ (fun x => βŸͺf x, g x⟫) s x := ((differentiable_inner _).hasFDerivAt.comp_hasFDerivWithinAt x (hf.prod hg).hasFDerivWithinAt).differentiableWithinAt #align differentiable_within_at.inner DifferentiableWithinAt.inner theorem DifferentiableAt.inner (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) : DifferentiableAt ℝ (fun x => βŸͺf x, g x⟫) x := (differentiable_inner _).comp x (hf.prod hg) #align differentiable_at.inner DifferentiableAt.inner theorem DifferentiableOn.inner (hf : DifferentiableOn ℝ f s) (hg : DifferentiableOn ℝ g s) : DifferentiableOn ℝ (fun x => βŸͺf x, g x⟫) s := fun x hx => (hf x hx).inner π•œ (hg x hx) #align differentiable_on.inner DifferentiableOn.inner theorem Differentiable.inner (hf : Differentiable ℝ f) (hg : Differentiable ℝ g) : Differentiable ℝ fun x => βŸͺf x, g x⟫ := fun x => (hf x).inner π•œ (hg x) #align differentiable.inner Differentiable.inner theorem fderiv_inner_apply (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) (y : G) : fderiv ℝ (fun t => βŸͺf t, g t⟫) x y = βŸͺf x, fderiv ℝ g x y⟫ + βŸͺfderiv ℝ f x y, g x⟫ := by rw [(hf.hasFDerivAt.inner π•œ hg.hasFDerivAt).fderiv]; rfl #align fderiv_inner_apply fderiv_inner_apply theorem deriv_inner_apply {f g : ℝ β†’ E} {x : ℝ} (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) : deriv (fun t => βŸͺf t, g t⟫) x = βŸͺf x, deriv g x⟫ + βŸͺderiv f x, g x⟫ := (hf.hasDerivAt.inner π•œ hg.hasDerivAt).deriv #align deriv_inner_apply deriv_inner_apply theorem contDiff_norm_sq : ContDiff ℝ n fun x : E => β€–xβ€– ^ 2 := by convert (reClm : π•œ β†’L[ℝ] ℝ).contDiff.comp ((contDiff_id (E := E)).inner π•œ (contDiff_id (E := E))) exact (inner_self_eq_norm_sq _).symm #align cont_diff_norm_sq contDiff_norm_sq theorem ContDiff.norm_sq (hf : ContDiff ℝ n f) : ContDiff ℝ n fun x => β€–f xβ€– ^ 2 := (contDiff_norm_sq π•œ).comp hf #align cont_diff.norm_sq ContDiff.norm_sq theorem ContDiffWithinAt.norm_sq (hf : ContDiffWithinAt ℝ n f s x) : ContDiffWithinAt ℝ n (fun y => β€–f yβ€– ^ 2) s x := (contDiff_norm_sq π•œ).contDiffAt.comp_contDiffWithinAt x hf #align cont_diff_within_at.norm_sq ContDiffWithinAt.norm_sq nonrec theorem ContDiffAt.norm_sq (hf : ContDiffAt ℝ n f x) : ContDiffAt ℝ n (β€–f Β·β€– ^ 2) x := hf.norm_sq π•œ #align cont_diff_at.norm_sq ContDiffAt.norm_sq theorem contDiffAt_norm {x : E} (hx : x β‰  0) : ContDiffAt ℝ n norm x := by have : β€–id xβ€– ^ 2 β‰  0 := pow_ne_zero 2 (norm_pos_iff.2 hx).ne' simpa only [id, sqrt_sq, norm_nonneg] using (contDiffAt_id.norm_sq π•œ).sqrt this #align cont_diff_at_norm contDiffAt_norm theorem ContDiffAt.norm (hf : ContDiffAt ℝ n f x) (h0 : f x β‰  0) : ContDiffAt ℝ n (fun y => β€–f yβ€–) x := (contDiffAt_norm π•œ h0).comp x hf #align cont_diff_at.norm ContDiffAt.norm theorem ContDiffAt.dist (hf : ContDiffAt ℝ n f x) (hg : ContDiffAt ℝ n g x) (hne : f x β‰  g x) : ContDiffAt ℝ n (fun y => dist (f y) (g y)) x := by simp only [dist_eq_norm] exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align cont_diff_at.dist ContDiffAt.dist theorem ContDiffWithinAt.norm (hf : ContDiffWithinAt ℝ n f s x) (h0 : f x β‰  0) : ContDiffWithinAt ℝ n (fun y => β€–f yβ€–) s x := (contDiffAt_norm π•œ h0).comp_contDiffWithinAt x hf #align cont_diff_within_at.norm ContDiffWithinAt.norm theorem ContDiffWithinAt.dist (hf : ContDiffWithinAt ℝ n f s x) (hg : ContDiffWithinAt ℝ n g s x) (hne : f x β‰  g x) : ContDiffWithinAt ℝ n (fun y => dist (f y) (g y)) s x := by simp only [dist_eq_norm]; exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align cont_diff_within_at.dist ContDiffWithinAt.dist theorem ContDiffOn.norm_sq (hf : ContDiffOn ℝ n f s) : ContDiffOn ℝ n (fun y => β€–f yβ€– ^ 2) s := fun x hx => (hf x hx).norm_sq π•œ #align cont_diff_on.norm_sq ContDiffOn.norm_sq theorem ContDiffOn.norm (hf : ContDiffOn ℝ n f s) (h0 : βˆ€ x ∈ s, f x β‰  0) : ContDiffOn ℝ n (fun y => β€–f yβ€–) s := fun x hx => (hf x hx).norm π•œ (h0 x hx) #align cont_diff_on.norm ContDiffOn.norm theorem ContDiffOn.dist (hf : ContDiffOn ℝ n f s) (hg : ContDiffOn ℝ n g s) (hne : βˆ€ x ∈ s, f x β‰  g x) : ContDiffOn ℝ n (fun y => dist (f y) (g y)) s := fun x hx => (hf x hx).dist π•œ (hg x hx) (hne x hx) #align cont_diff_on.dist ContDiffOn.dist theorem ContDiff.norm (hf : ContDiff ℝ n f) (h0 : βˆ€ x, f x β‰  0) : ContDiff ℝ n fun y => β€–f yβ€– := contDiff_iff_contDiffAt.2 fun x => hf.contDiffAt.norm π•œ (h0 x) #align cont_diff.norm ContDiff.norm theorem ContDiff.dist (hf : ContDiff ℝ n f) (hg : ContDiff ℝ n g) (hne : βˆ€ x, f x β‰  g x) : ContDiff ℝ n fun y => dist (f y) (g y) := contDiff_iff_contDiffAt.2 fun x => hf.contDiffAt.dist π•œ hg.contDiffAt (hne x) #align cont_diff.dist ContDiff.dist -- porting note: use `2 β€’` instead of `bit0` theorem hasStrictFDerivAt_norm_sq (x : F) : HasStrictFDerivAt (fun x => β€–xβ€– ^ 2) (2 β€’ (innerSL ℝ x)) x := by simp only [sq, ← @inner_self_eq_norm_mul_norm ℝ] convert (hasStrictFDerivAt_id x).inner ℝ (hasStrictFDerivAt_id x) ext y simp [two_smul, real_inner_comm] #align has_strict_fderiv_at_norm_sq hasStrictFDerivAt_norm_sqβ‚“ theorem HasFDerivAt.norm_sq {f : G β†’ F} {f' : G β†’L[ℝ] F} (hf : HasFDerivAt f f' x) : HasFDerivAt (β€–f Β·β€– ^ 2) (2 β€’ (innerSL ℝ (f x)).comp f') x := (hasStrictFDerivAt_norm_sq _).hasFDerivAt.comp x hf theorem HasDerivAt.norm_sq {f : ℝ β†’ F} {f' : F} {x : ℝ} (hf : HasDerivAt f f' x) : HasDerivAt (β€–f Β·β€– ^ 2) (2 * Inner.inner (f x) f') x := by simpa using hf.hasFDerivAt.norm_sq.hasDerivAt theorem HasFDerivWithinAt.norm_sq {f : G β†’ F} {f' : G β†’L[ℝ] F} (hf : HasFDerivWithinAt f f' s x) : HasFDerivWithinAt (β€–f Β·β€– ^ 2) (2 β€’ (innerSL ℝ (f x)).comp f') s x := (hasStrictFDerivAt_norm_sq _).hasFDerivAt.comp_hasFDerivWithinAt x hf theorem HasDerivWithinAt.norm_sq {f : ℝ β†’ F} {f' : F} {s : Set ℝ} {x : ℝ} (hf : HasDerivWithinAt f f' s x) : HasDerivWithinAt (β€–f Β·β€– ^ 2) (2 * Inner.inner (f x) f') s x := by simpa using hf.hasFDerivWithinAt.norm_sq.hasDerivWithinAt theorem DifferentiableAt.norm_sq (hf : DifferentiableAt ℝ f x) : DifferentiableAt ℝ (fun y => β€–f yβ€– ^ 2) x := ((contDiffAt_id.norm_sq π•œ).differentiableAt le_rfl).comp x hf #align differentiable_at.norm_sq DifferentiableAt.norm_sq theorem DifferentiableAt.norm (hf : DifferentiableAt ℝ f x) (h0 : f x β‰  0) : DifferentiableAt ℝ (fun y => β€–f yβ€–) x := ((contDiffAt_norm π•œ h0).differentiableAt le_rfl).comp x hf #align differentiable_at.norm DifferentiableAt.norm theorem DifferentiableAt.dist (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) (hne : f x β‰  g x) : DifferentiableAt ℝ (fun y => dist (f y) (g y)) x := by simp only [dist_eq_norm]; exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align differentiable_at.dist DifferentiableAt.dist theorem Differentiable.norm_sq (hf : Differentiable ℝ f) : Differentiable ℝ fun y => β€–f yβ€– ^ 2 := fun x => (hf x).norm_sq π•œ #align differentiable.norm_sq Differentiable.norm_sq theorem Differentiable.norm (hf : Differentiable ℝ f) (h0 : βˆ€ x, f x β‰  0) : Differentiable ℝ fun y => β€–f yβ€– := fun x => (hf x).norm π•œ (h0 x) #align differentiable.norm Differentiable.norm theorem Differentiable.dist (hf : Differentiable ℝ f) (hg : Differentiable ℝ g) (hne : βˆ€ x, f x β‰  g x) : Differentiable ℝ fun y => dist (f y) (g y) := fun x => (hf x).dist π•œ (hg x) (hne x) #align differentiable.dist Differentiable.dist theorem DifferentiableWithinAt.norm_sq (hf : DifferentiableWithinAt ℝ f s x) : DifferentiableWithinAt ℝ (fun y => β€–f yβ€– ^ 2) s x := ((contDiffAt_id.norm_sq π•œ).differentiableAt le_rfl).comp_differentiableWithinAt x hf #align differentiable_within_at.norm_sq DifferentiableWithinAt.norm_sq theorem DifferentiableWithinAt.norm (hf : DifferentiableWithinAt ℝ f s x) (h0 : f x β‰  0) : DifferentiableWithinAt ℝ (fun y => β€–f yβ€–) s x := ((contDiffAt_id.norm π•œ h0).differentiableAt le_rfl).comp_differentiableWithinAt x hf #align differentiable_within_at.norm DifferentiableWithinAt.norm theorem DifferentiableWithinAt.dist (hf : DifferentiableWithinAt ℝ f s x) (hg : DifferentiableWithinAt ℝ g s x) (hne : f x β‰  g x) : DifferentiableWithinAt ℝ (fun y => dist (f y) (g y)) s x := by simp only [dist_eq_norm] exact (hf.sub hg).norm π•œ (sub_ne_zero.2 hne) #align differentiable_within_at.dist DifferentiableWithinAt.dist theorem DifferentiableOn.norm_sq (hf : DifferentiableOn ℝ f s) : DifferentiableOn ℝ (fun y => β€–f yβ€– ^ 2) s := fun x hx => (hf x hx).norm_sq π•œ #align differentiable_on.norm_sq DifferentiableOn.norm_sq theorem DifferentiableOn.norm (hf : DifferentiableOn ℝ f s) (h0 : βˆ€ x ∈ s, f x β‰  0) : DifferentiableOn ℝ (fun y => β€–f yβ€–) s := fun x hx => (hf x hx).norm π•œ (h0 x hx) #align differentiable_on.norm DifferentiableOn.norm theorem DifferentiableOn.dist (hf : DifferentiableOn ℝ f s) (hg : DifferentiableOn ℝ g s) (hne : βˆ€ x ∈ s, f x β‰  g x) : DifferentiableOn ℝ (fun y => dist (f y) (g y)) s := fun x hx => (hf x hx).dist π•œ (hg x hx) (hne x hx) #align differentiable_on.dist DifferentiableOn.dist end DerivInner section PiLike open ContinuousLinearMap variable {π•œ ΞΉ H : Type*} [IsROrC π•œ] [NormedAddCommGroup H] [NormedSpace π•œ H] [Fintype ΞΉ] {f : H β†’ EuclideanSpace π•œ ΞΉ} {f' : H β†’L[π•œ] EuclideanSpace π•œ ΞΉ} {t : Set H} {y : H} theorem differentiableWithinAt_euclidean : DifferentiableWithinAt π•œ f t y ↔ βˆ€ i, DifferentiableWithinAt π•œ (fun x => f x i) t y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_differentiableWithinAt_iff, differentiableWithinAt_pi] rfl #align differentiable_within_at_euclidean differentiableWithinAt_euclidean theorem differentiableAt_euclidean : DifferentiableAt π•œ f y ↔ βˆ€ i, DifferentiableAt π•œ (fun x => f x i) y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_differentiableAt_iff, differentiableAt_pi] rfl #align differentiable_at_euclidean differentiableAt_euclidean theorem differentiableOn_euclidean : DifferentiableOn π•œ f t ↔ βˆ€ i, DifferentiableOn π•œ (fun x => f x i) t := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_differentiableOn_iff, differentiableOn_pi] rfl #align differentiable_on_euclidean differentiableOn_euclidean theorem differentiable_euclidean : Differentiable π•œ f ↔ βˆ€ i, Differentiable π•œ fun x => f x i := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_differentiable_iff, differentiable_pi] rfl #align differentiable_euclidean differentiable_euclidean theorem hasStrictFDerivAt_euclidean : HasStrictFDerivAt f f' y ↔ βˆ€ i, HasStrictFDerivAt (fun x => f x i) (EuclideanSpace.proj i ∘L f') y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_hasStrictFDerivAt_iff, hasStrictFDerivAt_pi'] rfl #align has_strict_fderiv_at_euclidean hasStrictFDerivAt_euclidean theorem hasFDerivWithinAt_euclidean : HasFDerivWithinAt f f' t y ↔ βˆ€ i, HasFDerivWithinAt (fun x => f x i) (EuclideanSpace.proj i ∘L f') t y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_hasFDerivWithinAt_iff, hasFDerivWithinAt_pi'] rfl #align has_fderiv_within_at_euclidean hasFDerivWithinAt_euclidean theorem contDiffWithinAt_euclidean {n : β„•βˆž} : ContDiffWithinAt π•œ n f t y ↔ βˆ€ i, ContDiffWithinAt π•œ n (fun x => f x i) t y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_contDiffWithinAt_iff, contDiffWithinAt_pi] rfl #align cont_diff_within_at_euclidean contDiffWithinAt_euclidean theorem contDiffAt_euclidean {n : β„•βˆž} : ContDiffAt π•œ n f y ↔ βˆ€ i, ContDiffAt π•œ n (fun x => f x i) y := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_contDiffAt_iff, contDiffAt_pi] rfl #align cont_diff_at_euclidean contDiffAt_euclidean theorem contDiffOn_euclidean {n : β„•βˆž} : ContDiffOn π•œ n f t ↔ βˆ€ i, ContDiffOn π•œ n (fun x => f x i) t := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_contDiffOn_iff, contDiffOn_pi] rfl #align cont_diff_on_euclidean contDiffOn_euclidean theorem contDiff_euclidean {n : β„•βˆž} : ContDiff π•œ n f ↔ βˆ€ i, ContDiff π•œ n fun x => f x i := by rw [← (EuclideanSpace.equiv ΞΉ π•œ).comp_contDiff_iff, contDiff_pi] rfl #align cont_diff_euclidean contDiff_euclidean end PiLike section DiffeomorphUnitBall open Metric hiding mem_nhds_iff variable {n : β„•βˆž} {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] theorem PartialHomeomorph.contDiff_univUnitBall : ContDiff ℝ n (univUnitBall : E β†’ E) := by suffices ContDiff ℝ n fun x : E => (1 + β€–xβ€– ^ 2 : ℝ).sqrt⁻¹ from this.smul contDiff_id have h : βˆ€ x : E, (0 : ℝ) < (1 : ℝ) + β€–xβ€– ^ 2 := fun x => by
positivity
theorem PartialHomeomorph.contDiff_univUnitBall : ContDiff ℝ n (univUnitBall : E β†’ E) := by suffices ContDiff ℝ n fun x : E => (1 + β€–xβ€– ^ 2 : ℝ).sqrt⁻¹ from this.smul contDiff_id have h : βˆ€ x : E, (0 : ℝ) < (1 : ℝ) + β€–xβ€– ^ 2 := fun x => by
Mathlib.Analysis.InnerProductSpace.Calculus.380_0.6FECEGgqdb67QLM
theorem PartialHomeomorph.contDiff_univUnitBall : ContDiff ℝ n (univUnitBall : E β†’ E)
Mathlib_Analysis_InnerProductSpace_Calculus