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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.