Theorem: SciLean.fderiv.let_rule_at (SciLean/Core/FunctionTransformations/FDeriv.lean)

State before:
K : Type u_4
inst✝⁹ : RCLike K
X : Type u_2
inst✝⁸ : NormedAddCommGroup X
inst✝⁷ : NormedSpace K X
Y : Type u_3
inst✝⁶ : NormedAddCommGroup Y
inst✝⁵ : NormedSpace K Y
Z : Type u_1
inst✝⁴ : NormedAddCommGroup Z
inst✝³ : NormedSpace K Z
ι : Type ?u.56458
inst✝² : Fintype ι
E : ι → Type ?u.56466
inst✝¹ : (i : ι) → NormedAddCommGroup (E i)
inst✝ : (i : ι) → NormedSpace K (E i)
f : X → Y → Z
g : X → Y
x : X
hf : DifferentiableAt K (fun xy => f xy.1 xy.2) (x, g x)
hg : DifferentiableAt K g x
⊢ fderiv K
      (fun x =>
        let y := g x;
        f x y)
      x =
    let y := g x;
    fun dx =>L[K]
      let dy := (fderiv K g x) dx;
      let dz := (fderiv K (fun xy => f xy.1 xy.2) (x, y)) (dx, dy);
      dz
Tactic:
have h : (fun x => f x (g x)) = (fun xy : X×Y => f xy.1 xy.2) ∘ (fun x => (x, g x)) := by rfl
State after:
K : Type u_4
inst✝⁹ : RCLike K
X : Type u_2
inst✝⁸ : NormedAddCommGroup X
inst✝⁷ : NormedSpace K X
Y : Type u_3
inst✝⁶ : NormedAddCommGroup Y
inst✝⁵ : NormedSpace K Y
Z : Type u_1
inst✝⁴ : NormedAddCommGroup Z
inst✝³ : NormedSpace K Z
ι : Type ?u.56458
inst✝² : Fintype ι
E : ι → Type ?u.56466
inst✝¹ : (i : ι) → NormedAddCommGroup (E i)
inst✝ : (i : ι) → NormedSpace K (E i)
f : X → Y → Z
g : X → Y
x : X
hf : DifferentiableAt K (fun xy => f xy.1 xy.2) (x, g x)
hg : DifferentiableAt K g x
h : (fun x => f x (g x)) = (fun xy => f xy.1 xy.2) ∘ fun x => (x, g x)
⊢ fderiv K
      (fun x =>
        let y := g x;
        f x y)
      x =
    let y := g x;
    fun dx =>L[K]
      let dy := (fderiv K g x) dx;
      let dz := (fderiv K (fun xy => f xy.1 xy.2) (x, y)) (dx, dy);
      dz

State before:
K : Type u_4
inst✝⁹ : RCLike K
X : Type u_2
inst✝⁸ : NormedAddCommGroup X
inst✝⁷ : NormedSpace K X
Y : Type u_3
inst✝⁶ : NormedAddCommGroup Y
inst✝⁵ : NormedSpace K Y
Z : Type u_1
inst✝⁴ : NormedAddCommGroup Z
inst✝³ : NormedSpace K Z
ι : Type ?u.56458
inst✝² : Fintype ι
E : ι → Type ?u.56466
inst✝¹ : (i : ι) → NormedAddCommGroup (E i)
inst✝ : (i : ι) → NormedSpace K (E i)
f : X → Y → Z
g : X → Y
x : X
hf : DifferentiableAt K (fun xy => f xy.1 xy.2) (x, g x)
hg : DifferentiableAt K g x
h : (fun x => f x (g x)) = (fun xy => f xy.1 xy.2) ∘ fun x => (x, g x)
⊢ fderiv K
      (fun x =>
        let y := g x;
        f x y)
      x =
    let y := g x;
    fun dx =>L[K]
      let dy := (fderiv K g x) dx;
      let dz := (fderiv K (fun xy => f xy.1 xy.2) (x, y)) (dx, dy);
      dz
Tactic:
conv =>
  lhs
  rw[h]
  rw[fderiv.comp x hf (DifferentiableAt.prod (by simp) hg)]
  rw[DifferentiableAt.fderiv_prod (by simp) hg]
State after:
K : Type u_4
inst✝⁹ : RCLike K
X : Type u_2
inst✝⁸ : NormedAddCommGroup X
inst✝⁷ : NormedSpace K X
Y : Type u_3
inst✝⁶ : NormedAddCommGroup Y
inst✝⁵ : NormedSpace K Y
Z : Type u_1
inst✝⁴ : NormedAddCommGroup Z
inst✝³ : NormedSpace K Z
ι : Type ?u.56458
inst✝² : Fintype ι
E : ι → Type ?u.56466
inst✝¹ : (i : ι) → NormedAddCommGroup (E i)
inst✝ : (i : ι) → NormedSpace K (E i)
f : X → Y → Z
g : X → Y
x : X
hf : DifferentiableAt K (fun xy => f xy.1 xy.2) (x, g x)
hg : DifferentiableAt K g x
h : (fun x => f x (g x)) = (fun xy => f xy.1 xy.2) ∘ fun x => (x, g x)
⊢ ContinuousLinearMap.comp (fderiv K (fun xy => f xy.1 xy.2) (x, g x))
      (ContinuousLinearMap.prod (fderiv K (fun x => x) x) (fderiv K g x)) =
    let y := g x;
    fun dx =>L[K]
      let dy := (fderiv K g x) dx;
      let dz := (fderiv K (fun xy => f xy.1 xy.2) (x, y)) (dx, dy);
      dz

State before:
K : Type u_4
inst✝⁹ : RCLike K
X : Type u_2
inst✝⁸ : NormedAddCommGroup X
inst✝⁷ : NormedSpace K X
Y : Type u_3
inst✝⁶ : NormedAddCommGroup Y
inst✝⁵ : NormedSpace K Y
Z : Type u_1
inst✝⁴ : NormedAddCommGroup Z
inst✝³ : NormedSpace K Z
ι : Type ?u.56458
inst✝² : Fintype ι
E : ι → Type ?u.56466
inst✝¹ : (i : ι) → NormedAddCommGroup (E i)
inst✝ : (i : ι) → NormedSpace K (E i)
f : X → Y → Z
g : X → Y
x : X
hf : DifferentiableAt K (fun xy => f xy.1 xy.2) (x, g x)
hg : DifferentiableAt K g x
h : (fun x => f x (g x)) = (fun xy => f xy.1 xy.2) ∘ fun x => (x, g x)
⊢ ContinuousLinearMap.comp (fderiv K (fun xy => f xy.1 xy.2) (x, g x))
      (ContinuousLinearMap.prod (fderiv K (fun x => x) x) (fderiv K g x)) =
    let y := g x;
    fun dx =>L[K]
      let dy := (fderiv K g x) dx;
      let dz := (fderiv K (fun xy => f xy.1 xy.2) (x, y)) (dx, dy);
      dz
Tactic:
ext dx
State after:
case h
K : Type u_4
inst✝⁹ : RCLike K
X : Type u_2
inst✝⁸ : NormedAddCommGroup X
inst✝⁷ : NormedSpace K X
Y : Type u_3
inst✝⁶ : NormedAddCommGroup Y
inst✝⁵ : NormedSpace K Y
Z : Type u_1
inst✝⁴ : NormedAddCommGroup Z
inst✝³ : NormedSpace K Z
ι : Type ?u.56458
inst✝² : Fintype ι
E : ι → Type ?u.56466
inst✝¹ : (i : ι) → NormedAddCommGroup (E i)
inst✝ : (i : ι) → NormedSpace K (E i)
f : X → Y → Z
g : X → Y
x : X
hf : DifferentiableAt K (fun xy => f xy.1 xy.2) (x, g x)
hg : DifferentiableAt K g x
h : (fun x => f x (g x)) = (fun xy => f xy.1 xy.2) ∘ fun x => (x, g x)
dx : X
⊢ (ContinuousLinearMap.comp (fderiv K (fun xy => f xy.1 xy.2) (x, g x))
        (ContinuousLinearMap.prod (fderiv K (fun x => x) x) (fderiv K g x)))
      dx =
    (let y := g x;
      fun dx =>L[K]
        let dy := (fderiv K g x) dx;
        let dz := (fderiv K (fun xy => f xy.1 xy.2) (x, y)) (dx, dy);
        dz)
      dx

State before:
case h
K : Type u_4
inst✝⁹ : RCLike K
X : Type u_2
inst✝⁸ : NormedAddCommGroup X
inst✝⁷ : NormedSpace K X
Y : Type u_3
inst✝⁶ : NormedAddCommGroup Y
inst✝⁵ : NormedSpace K Y
Z : Type u_1
inst✝⁴ : NormedAddCommGroup Z
inst✝³ : NormedSpace K Z
ι : Type ?u.56458
inst✝² : Fintype ι
E : ι → Type ?u.56466
inst✝¹ : (i : ι) → NormedAddCommGroup (E i)
inst✝ : (i : ι) → NormedSpace K (E i)
f : X → Y → Z
g : X → Y
x : X
hf : DifferentiableAt K (fun xy => f xy.1 xy.2) (x, g x)
hg : DifferentiableAt K g x
h : (fun x => f x (g x)) = (fun xy => f xy.1 xy.2) ∘ fun x => (x, g x)
dx : X
⊢ (ContinuousLinearMap.comp (fderiv K (fun xy => f xy.1 xy.2) (x, g x))
        (ContinuousLinearMap.prod (fderiv K (fun x => x) x) (fderiv K g x)))
      dx =
    (let y := g x;
      fun dx =>L[K]
        let dy := (fderiv K g x) dx;
        let dz := (fderiv K (fun xy => f xy.1 xy.2) (x, y)) (dx, dy);
        dz)
      dx
Tactic:
simp[ContinuousLinearMap.comp]
State after:
no goals

State before:
K : Type u_4
inst✝⁹ : RCLike K
X : Type u_2
inst✝⁸ : NormedAddCommGroup X
inst✝⁷ : NormedSpace K X
Y : Type u_3
inst✝⁶ : NormedAddCommGroup Y
inst✝⁵ : NormedSpace K Y
Z : Type u_1
inst✝⁴ : NormedAddCommGroup Z
inst✝³ : NormedSpace K Z
ι : Type ?u.56458
inst✝² : Fintype ι
E : ι → Type ?u.56466
inst✝¹ : (i : ι) → NormedAddCommGroup (E i)
inst✝ : (i : ι) → NormedSpace K (E i)
f : X → Y → Z
g : X → Y
x : X
hf : DifferentiableAt K (fun xy => f xy.1 xy.2) (x, g x)
hg : DifferentiableAt K g x
⊢ (fun x => f x (g x)) = (fun xy => f xy.1 xy.2) ∘ fun x => (x, g x)
Tactic:
rfl
State after:
no goals

State before:
K : Type u_4
inst✝⁹ : RCLike K
X : Type u_2
inst✝⁸ : NormedAddCommGroup X
inst✝⁷ : NormedSpace K X
Y : Type u_3
inst✝⁶ : NormedAddCommGroup Y
inst✝⁵ : NormedSpace K Y
Z : Type u_1
inst✝⁴ : NormedAddCommGroup Z
inst✝³ : NormedSpace K Z
ι : Type ?u.56458
inst✝² : Fintype ι
E : ι → Type ?u.56466
inst✝¹ : (i : ι) → NormedAddCommGroup (E i)
inst✝ : (i : ι) → NormedSpace K (E i)
f : X → Y → Z
g : X → Y
x : X
hf : DifferentiableAt K (fun xy => f xy.1 xy.2) (x, g x)
hg : DifferentiableAt K g x
h : (fun x => f x (g x)) = (fun xy => f xy.1 xy.2) ∘ fun x => (x, g x)
⊢ DifferentiableAt K (fun x => x) x
Tactic:
simp
State after:
no goals