Skip to content

Commit

Permalink
derivative theorems for Inv.inv
Browse files Browse the repository at this point in the history
  • Loading branch information
lecopivo committed Nov 19, 2024
1 parent 5ea2973 commit b1d16f0
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 2 deletions.
33 changes: 31 additions & 2 deletions SciLean/Analysis/Calculus/FDeriv.lean
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ theorem fderiv.comp_rule_at
dz :=
by
rw[show (fun x => f (g x)) = f ∘ g by rfl]
rw[fderiv.comp x hf hg]
rw[fderiv_comp x hf hg]
ext dx; simp

@[fun_trans]
Expand Down Expand Up @@ -103,7 +103,7 @@ by
conv =>
lhs
rw[h]
rw[fderiv.comp x hf (DifferentiableAt.prod (by simp) hg)]
rw[fderiv_comp x hf (DifferentiableAt.prod (by simp) hg)]
rw[DifferentiableAt.fderiv_prod (by simp) hg]
ext dx; simp[ContinuousLinearMap.comp]

Expand Down Expand Up @@ -317,6 +317,35 @@ theorem HDiv.hDiv.arg_a0a1.fderiv_rule_at
simp


-- Inv.inv -------------------------------------------------------------------
--------------------------------------------------------------------------------
set_option linter.unusedVariables false in
@[fun_prop]
theorem _root_.Inv.inv.arg_a0.DifferentiableAt_rule
{R} [RCLike R]
{W} [NormedAddCommGroup W] [NormedSpace R W]
(w : W) (a0 : W → R)
(ha0 : DifferentiableAt R a0 w) (ha0' : a0 w ≠ 0) :
DifferentiableAt R (fun w => (a0 w)⁻¹) w := sorry_proof

@[fun_trans]
theorem HInv.hInv.arg_a0a1.fderiv_rule_at
(x : X) (f : X → K)
(hf : DifferentiableAt K f x) (hx : f x ≠ 0) :
(fderiv K fun x => (f x)⁻¹) x
=
let y := f x
fun dx =>L[K]
let dy := fderiv K f x dx
(-dy) / y^2 := by
ext dx
rw[fderiv_comp']
rw[fderiv_inv]
simp; ring
apply differentiableAt_inv hx
apply hf


-- HPow.hPow ---------------------------------------------------------------------
--------------------------------------------------------------------------------

Expand Down
16 changes: 16 additions & 0 deletions SciLean/Analysis/Calculus/FwdFDeriv.lean
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,22 @@ theorem HDiv.hDiv.arg_a0a1.fwdFDeriv_rule_at (x : X)
field_simp ; sorry_proof --ring


-- Inv.inv -------------------------------------------------------------------
--------------------------------------------------------------------------------
@[fun_trans]
theorem HInv.hInv.arg_a0a1.fwdFDeriv_rule_at
(x : X) (f : X → K)
(hf : DifferentiableAt K f x) (hx : f x ≠ 0) :
(fwdFDeriv K fun x => (f x)⁻¹) x
=
fun dx =>
let ydy := fwdFDeriv K f x dx
let y := ydy.1
let dy := ydy.2
(y⁻¹, -dy / y^2) := by
unfold fwdFDeriv; fun_trans (disch:=assumption)


-- HPow.hPow -------------------------------------------------------------------
--------------------------------------------------------------------------------

Expand Down
15 changes: 15 additions & 0 deletions SciLean/Analysis/Calculus/RevFDeriv.lean
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,21 @@ theorem HDiv.hDiv.arg_a0a1.revFDeriv_rule
fun_trans (disch:=apply hx)


-- Inv.inv -------------------------------------------------------------------
--------------------------------------------------------------------------------
@[fun_trans]
theorem HInv.hInv.arg_a0a1.revFDeriv_rule_at
(x : X) (f : X → K)
(hf : DifferentiableAt K f x) (hx : f x ≠ 0) :
(revFDeriv K fun x => (f x)⁻¹) x
=
let ydf := revFDeriv K f x
let y := ydf.1
let df := ydf.2
(y⁻¹, fun dy => - (conj y^2)⁻¹ • (df dy)) := by
unfold revFDeriv; fun_trans (disch:=assumption)


-- HPow.hPow ---------------------------------------------------------------------
--------------------------------------------------------------------------------

Expand Down

0 comments on commit b1d16f0

Please sign in to comment.