internlm/Lean-Github huggingface dataset:
Theorem: HAdd.hAdd.arg_a0a1.revDeriv2_rule
Proof state before:
case h.h.h.h.a
K : Type
inst✝⁴ : RCLike K
X : Type
inst✝³ : SemiInnerProductSpace K X
Y : Type
inst✝² : SemiInnerProductSpace K Y
Z : Type
inst✝¹ : SemiInnerProductSpace K Z
W : Type
inst✝ : SemiInnerProductSpace K W
f g : W → X → Y
hf : HasAdjDiff K fun x => f x.1 x.2
hg : HasAdjDiff K fun x => g x.1 x.2
w : W
x : X
dy : Y
dw : W
⊢ (dw +
          ((semiAdjoint K (fun x_1 => cderiv K (fun x => f x.1 x.2) (w, x) x_1) dy).1 +
            (semiAdjoint K (fun x_1 => cderiv K (fun x => g x.1 x.2) (w, x) x_1) dy).1),
        (semiAdjoint K (fun x_1 => cderiv K (fun x => f x.1 x.2) (w, x) x_1) dy).2 +
          (semiAdjoint K (fun x_1 => cderiv K (fun x => g x.1 x.2) (w, x) x_1) dy).2).2 =
    ((dw + (semiAdjoint K (cderiv K (fun x => f x.1 x.2) (w, x)) dy).1,
          (semiAdjoint K (cderiv K (fun x => f x.1 x.2) (w, x)) dy).2) +
        semiAdjoint K (fun x_1 => cderiv K (fun x => g x.1 x.2) (w, x) x_1) dy).2
Tactic:
simp[add_assoc,add_comm]
Proof state after:
no goals
Theorem: HSub.hSub.arg_a0a1.revDeriv2_rule
Proof state before:
K : Type
inst✝⁴ : RCLike K
X : Type
inst✝³ : SemiInnerProductSpace K X
Y : Type
inst✝² : SemiInnerProductSpace K Y
Z : Type
inst✝¹ : SemiInnerProductSpace K Z
W : Type
inst✝ : SemiInnerProductSpace K W
f g : W → X → Y
hf :
  HasAdjDiff K fun x =>
    match x with
    | (w, x) => f w x
hg :
  HasAdjDiff K fun x =>
    match x with
    | (w, x) => g w x
⊢ (revDeriv2 K fun w x => f w x - g w x) = fun w x =>
    let adf := revDeriv2 K f w x;
    let bdg := revDeriv2 K (fun wx x => g wx.1 wx.2) (w, x) ();
    (adf.1 - bdg.1, fun dy dw =>
      let dwx := adf.2 dy dw;
      let dwx := bdg.2 (-dy) dwx;
      dwx.1)
Tactic:
simp at hf hg
Proof state after:
K : Type
inst✝⁴ : RCLike K
X : Type
inst✝³ : SemiInnerProductSpace K X
Y : Type
inst✝² : SemiInnerProductSpace K Y
Z : Type
inst✝¹ : SemiInnerProductSpace K Z
W : Type
inst✝ : SemiInnerProductSpace K W
f g : W → X → Y
hf : HasAdjDiff K fun x => f x.1 x.2
hg : HasAdjDiff K fun x => g x.1 x.2
⊢ (revDeriv2 K fun w x => f w x - g w x) = fun w x =>
    let adf := revDeriv2 K f w x;
    let bdg := revDeriv2 K (fun wx x => g wx.1 wx.2) (w, x) ();
    (adf.1 - bdg.1, fun dy dw =>
      let dwx := adf.2 dy dw;
      let dwx := bdg.2 (-dy) dwx;
      dwx.1)
Theorem: HSub.hSub.arg_a0a1.revDeriv2_rule
Proof state before:
K : Type
inst✝⁴ : RCLike K
X : Type
inst✝³ : SemiInnerProductSpace K X
Y : Type
inst✝² : SemiInnerProductSpace K Y
Z : Type
inst✝¹ : SemiInnerProductSpace K Z
W : Type
inst✝ : SemiInnerProductSpace K W
f g : W → X → Y
hf : HasAdjDiff K fun x => f x.1 x.2
hg : HasAdjDiff K fun x => g x.1 x.2
⊢ (revDeriv2 K fun w x => f w x - g w x) = fun w x =>
    let adf := revDeriv2 K f w x;
    let bdg := revDeriv2 K (fun wx x => g wx.1 wx.2) (w, x) ();
    (adf.1 - bdg.1, fun dy dw =>
      let dwx := adf.2 dy dw;
      let dwx := bdg.2 (-dy) dwx;
      dwx.1)
Tactic:
unfold revDeriv2
Proof state after:
K : Type
inst✝⁴ : RCLike K
X : Type
inst✝³ : SemiInnerProductSpace K X
Y : Type
inst✝² : SemiInnerProductSpace K Y
Z : Type
inst✝¹ : SemiInnerProductSpace K Z
W : Type
inst✝ : SemiInnerProductSpace K W
f g : W → X → Y
hf : HasAdjDiff K fun x => f x.1 x.2
hg : HasAdjDiff K fun x => g x.1 x.2
⊢ (fun w x =>
      ((fun w x => f w x - g w x) w x, fun dy =>
        match (motive := W × X → W → W × X)
          semiAdjoint K
            (cderiv K
              (fun x =>
                match x with
                | (w, x) => (fun w x => f w x - g w x) w x)
              (w, x))
            dy with
        | (dw, dx) => fun dw' => (dw' + dw, dx))) =
    fun w x =>
    let adf :=
      (f w x, fun dy =>
        match (motive := W × X → W → W × X)
          semiAdjoint K
            (cderiv K
              (fun x =>
                match x with
                | (w, x) => f w x)
              (w, x))
            dy with
        | (dw, dx) => fun dw' => (dw' + dw, dx));
    let bdg :=
      ((fun wx x => g wx.1 wx.2) (w, x) (), fun dy =>
        match (motive := (W × X) × Unit → W × X → (W × X) × Unit)
          semiAdjoint K
            (cderiv K
              (fun x =>
                match x with
                | (w, x) => (fun wx x => g wx.1 wx.2) w x)
              ((w, x), ()))
            dy with
        | (dw, dx) => fun dw' => (dw' + dw, dx));
    (adf.1 - bdg.1, fun dy dw =>
      let dwx := adf.2 dy dw;
      let dwx := bdg.2 (-dy) dwx;
      dwx.1)
Theorem: HSub.hSub.arg_a0a1.revDeriv2_rule
Proof state before:
K : Type
inst✝⁴ : RCLike K
X : Type
inst✝³ : SemiInnerProductSpace K X
Y : Type
inst✝² : SemiInnerProductSpace K Y
Z : Type
inst✝¹ : SemiInnerProductSpace K Z
W : Type
inst✝ : SemiInnerProductSpace K W
f g : W → X → Y
hf : HasAdjDiff K fun x => f x.1 x.2
hg : HasAdjDiff K fun x => g x.1 x.2
⊢ (fun w x =>
      ((fun w x => f w x - g w x) w x, fun dy =>
        match (motive := W × X → W → W × X)
          semiAdjoint K
            (cderiv K
              (fun x =>
                match x with
                | (w, x) => (fun w x => f w x - g w x) w x)
              (w, x))
            dy with
        | (dw, dx) => fun dw' => (dw' + dw, dx))) =
    fun w x =>
    let adf :=
      (f w x, fun dy =>
        match (motive := W × X → W → W × X)
          semiAdjoint K
            (cderiv K
              (fun x =>
                match x with
                | (w, x) => f w x)
              (w, x))
            dy with
        | (dw, dx) => fun dw' => (dw' + dw, dx));
    let bdg :=
      ((fun wx x => g wx.1 wx.2) (w, x) (), fun dy =>
        match (motive := (W × X) × Unit → W × X → (W × X) × Unit)
          semiAdjoint K
            (cderiv K
              (fun x =>
                match x with
                | (w, x) => (fun wx x => g wx.1 wx.2) w x)
              ((w, x), ()))
            dy with
        | (dw, dx) => fun dw' => (dw' + dw, dx));
    (adf.1 - bdg.1, fun dy dw =>
      let dwx := adf.2 dy dw;
      let dwx := bdg.2 (-dy) dwx;
      dwx.1)
Tactic:
fun_trans
Proof state after:
K : Type
inst✝⁴ : RCLike K
X : Type
inst✝³ : SemiInnerProductSpace K X
Y : Type
inst✝² : SemiInnerProductSpace K Y
Z : Type
inst✝¹ : SemiInnerProductSpace K Z
W : Type
inst✝ : SemiInnerProductSpace K W
f g : W → X → Y
hf : HasAdjDiff K fun x => f x.1 x.2
hg : HasAdjDiff K fun x => g x.1 x.2
⊢ (fun w x =>
      (f w x - g w x, fun dy dw' =>
        (dw' +
            ((semiAdjoint K (fun x_1 => cderiv K (fun x => f x.1 x.2) (w, x) x_1) dy).1 -
              (semiAdjoint K (fun x_1 => cderiv K (fun x => g x.1 x.2) (w, x) x_1) dy).1),
          (semiAdjoint K (fun x_1 => cderiv K (fun x => f x.1 x.2) (w, x) x_1) dy).2 -
            (semiAdjoint K (fun x_1 => cderiv K (fun x => g x.1 x.2) (w, x) x_1) dy).2))) =
    fun w x =>
    (f w x - g w x, fun dy dw =>
      (dw + (semiAdjoint K (cderiv K (fun x => f x.1 x.2) (w, x)) dy).1,
          (semiAdjoint K (cderiv K (fun x => f x.1 x.2) (w, x)) dy).2) +
        semiAdjoint K (fun dx8 => cderiv K (fun x => g x.1 x.2) (w, x) dx8) (-dy))
Theorem: HSub.hSub.arg_a0a1.revDeriv2_rule
Proof state before:
K : Type
inst✝⁴ : RCLike K
X : Type
inst✝³ : SemiInnerProductSpace K X
Y : Type
inst✝² : SemiInnerProductSpace K Y
Z : Type
inst✝¹ : SemiInnerProductSpace K Z
W : Type
inst✝ : SemiInnerProductSpace K W
f g : W → X → Y
hf : HasAdjDiff K fun x => f x.1 x.2
hg : HasAdjDiff K fun x => g x.1 x.2
⊢ (fun w x =>
      (f w x - g w x, fun dy dw' =>
        (dw' +
            ((semiAdjoint K (fun x_1 => cderiv K (fun x => f x.1 x.2) (w, x) x_1) dy).1 -
              (semiAdjoint K (fun x_1 => cderiv K (fun x => g x.1 x.2) (w, x) x_1) dy).1),
          (semiAdjoint K (fun x_1 => cderiv K (fun x => f x.1 x.2) (w, x) x_1) dy).2 -
            (semiAdjoint K (fun x_1 => cderiv K (fun x => g x.1 x.2) (w, x) x_1) dy).2))) =
    fun w x =>
    (f w x - g w x, fun dy dw =>
      (dw + (semiAdjoint K (cderiv K (fun x => f x.1 x.2) (w, x)) dy).1,
          (semiAdjoint K (cderiv K (fun x => f x.1 x.2) (w, x)) dy).2) +
        semiAdjoint K (fun dx8 => cderiv K (fun x => g x.1 x.2) (w, x) dx8) (-dy))
Tactic:
funext w x
Proof state after:
case h.h
K : Type
inst✝⁴ : RCLike K
X : Type
inst✝³ : SemiInnerProductSpace K X
Y : Type
inst✝² : SemiInnerProductSpace K Y
Z : Type
inst✝¹ : SemiInnerProductSpace K Z
W : Type
inst✝ : SemiInnerProductSpace K W
f g : W → X → Y
hf : HasAdjDiff K fun x => f x.1 x.2
hg : HasAdjDiff K fun x => g x.1 x.2
w : W
x : X
⊢ (f w x - g w x, fun dy dw' =>
      (dw' +
          ((semiAdjoint K (fun x_1 => cderiv K (fun x => f x.1 x.2) (w, x) x_1) dy).1 -
            (semiAdjoint K (fun x_1 => cderiv K (fun x => g x.1 x.2) (w, x) x_1) dy).1),
        (semiAdjoint K (fun x_1 => cderiv K (fun x => f x.1 x.2) (w, x) x_1) dy).2 -
          (semiAdjoint K (fun x_1 => cderiv K (fun x => g x.1 x.2) (w, x) x_1) dy).2)) =
    (f w x - g w x, fun dy dw =>
      (dw + (semiAdjoint K (cderiv K (fun x => f x.1 x.2) (w, x)) dy).1,
          (semiAdjoint K (cderiv K (fun x => f x.1 x.2) (w, x)) dy).2) +
        semiAdjoint K (fun dx8 => cderiv K (fun x => g x.1 x.2) (w, x) dx8) (-dy))
Theorem: HSub.hSub.arg_a0a1.revDeriv2_rule
Proof state before:
case h.h
K : Type
inst✝⁴ : RCLike K
X : Type
inst✝³ : SemiInnerProductSpace K X
Y : Type
inst✝² : SemiInnerProductSpace K Y
Z : Type
inst✝¹ : SemiInnerProductSpace K Z
W : Type
inst✝ : SemiInnerProductSpace K W
f g : W → X → Y
hf : HasAdjDiff K fun x => f x.1 x.2
hg : HasAdjDiff K fun x => g x.1 x.2
w : W
x : X
⊢ (f w x - g w x, fun dy dw' =>
      (dw' +
          ((semiAdjoint K (fun x_1 => cderiv K (fun x => f x.1 x.2) (w, x) x_1) dy).1 -
            (semiAdjoint K (fun x_1 => cderiv K (fun x => g x.1 x.2) (w, x) x_1) dy).1),
        (semiAdjoint K (fun x_1 => cderiv K (fun x => f x.1 x.2) (w, x) x_1) dy).2 -
          (semiAdjoint K (fun x_1 => cderiv K (fun x => g x.1 x.2) (w, x) x_1) dy).2)) =
    (f w x - g w x, fun dy dw =>
      (dw + (semiAdjoint K (cderiv K (fun x => f x.1 x.2) (w, x)) dy).1,
          (semiAdjoint K (cderiv K (fun x => f x.1 x.2) (w, x)) dy).2) +
        semiAdjoint K (fun dx8 => cderiv K (fun x => g x.1 x.2) (w, x) dx8) (-dy))
Tactic:
simp
Proof state after:
case h.h
K : Type
inst✝⁴ : RCLike K
X : Type
inst✝³ : SemiInnerProductSpace K X
Y : Type
inst✝² : SemiInnerProductSpace K Y
Z : Type
inst✝¹ : SemiInnerProductSpace K Z
W : Type
inst✝ : SemiInnerProductSpace K W
f g : W → X → Y
hf : HasAdjDiff K fun x => f x.1 x.2
hg : HasAdjDiff K fun x => g x.1 x.2
w : W
x : X
⊢ (fun dy dw' =>
      (dw' +
          ((semiAdjoint K (fun x_1 => cderiv K (fun x => f x.1 x.2) (w, x) x_1) dy).1 -
            (semiAdjoint K (fun x_1 => cderiv K (fun x => g x.1 x.2) (w, x) x_1) dy).1),
        (semiAdjoint K (fun x_1 => cderiv K (fun x => f x.1 x.2) (w, x) x_1) dy).2 -
          (semiAdjoint K (fun x_1 => cderiv K (fun x => g x.1 x.2) (w, x) x_1) dy).2)) =
    fun dy dw =>
    (dw + (semiAdjoint K (cderiv K (fun x => f x.1 x.2) (w, x)) dy).1,
        (semiAdjoint K (cderiv K (fun x => f x.1 x.2) (w, x)) dy).2) +
      semiAdjoint K (fun x_1 => cderiv K (fun x => g x.1 x.2) (w, x) x_1) (-dy)
Theorem: HSub.hSub.arg_a0a1.revDeriv2_rule
Proof state before:
case h.h
K : Type
inst✝⁴ : RCLike K
X : Type
inst✝³ : SemiInnerProductSpace K X
Y : Type
inst✝² : SemiInnerProductSpace K Y
Z : Type
inst✝¹ : SemiInnerProductSpace K Z
W : Type
inst✝ : SemiInnerProductSpace K W
f g : W → X → Y
hf : HasAdjDiff K fun x => f x.1 x.2
hg : HasAdjDiff K fun x => g x.1 x.2
w : W
x : X
⊢ (fun dy dw' =>
      (dw' +
          ((semiAdjoint K (fun x_1 => cderiv K (fun x => f x.1 x.2) (w, x) x_1) dy).1 -
            (semiAdjoint K (fun x_1 => cderiv K (fun x => g x.1 x.2) (w, x) x_1) dy).1),
        (semiAdjoint K (fun x_1 => cderiv K (fun x => f x.1 x.2) (w, x) x_1) dy).2 -
          (semiAdjoint K (fun x_1 => cderiv K (fun x => g x.1 x.2) (w, x) x_1) dy).2)) =
    fun dy dw =>
    (dw + (semiAdjoint K (cderiv K (fun x => f x.1 x.2) (w, x)) dy).1,
        (semiAdjoint K (cderiv K (fun x => f x.1 x.2) (w, x)) dy).2) +
      semiAdjoint K (fun x_1 => cderiv K (fun x => g x.1 x.2) (w, x) x_1) (-dy)
Tactic:
funext dy dw
Proof state after:
case h.h.h.h
K : Type
inst✝⁴ : RCLike K
X : Type
inst✝³ : SemiInnerProductSpace K X
Y : Type
inst✝² : SemiInnerProductSpace K Y
Z : Type
inst✝¹ : SemiInnerProductSpace K Z
W : Type
inst✝ : SemiInnerProductSpace K W
f g : W → X → Y
hf : HasAdjDiff K fun x => f x.1 x.2
hg : HasAdjDiff K fun x => g x.1 x.2
w : W
x : X
dy : Y
dw : W
⊢ (dw +
        ((semiAdjoint K (fun x_1 => cderiv K (fun x => f x.1 x.2) (w, x) x_1) dy).1 -
          (semiAdjoint K (fun x_1 => cderiv K (fun x => g x.1 x.2) (w, x) x_1) dy).1),
      (semiAdjoint K (fun x_1 => cderiv K (fun x => f x.1 x.2) (w, x) x_1) dy).2 -
        (semiAdjoint K (fun x_1 => cderiv K (fun x => g x.1 x.2) (w, x) x_1) dy).2) =
    (dw + (semiAdjoint K (cderiv K (fun x => f x.1 x.2) (w, x)) dy).1,
        (semiAdjoint K (cderiv K (fun x => f x.1 x.2) (w, x)) dy).2) +
      semiAdjoint K (fun x_1 => cderiv K (fun x => g x.1 x.2) (w, x) x_1) (-dy)
Theorem: HSub.hSub.arg_a0a1.revDeriv2_rule
Proof state before:
case h.h.h.h
K : Type
inst✝⁴ : RCLike K
X : Type
inst✝³ : SemiInnerProductSpace K X
Y : Type
inst✝² : SemiInnerProductSpace K Y
Z : Type
inst✝¹ : SemiInnerProductSpace K Z
W : Type
inst✝ : SemiInnerProductSpace K W
f g : W → X → Y
hf : HasAdjDiff K fun x => f x.1 x.2
hg : HasAdjDiff K fun x => g x.1 x.2
w : W
x : X
dy : Y
dw : W
⊢ (dw +
        ((semiAdjoint K (fun x_1 => cderiv K (fun x => f x.1 x.2) (w, x) x_1) dy).1 -
          (semiAdjoint K (fun x_1 => cderiv K (fun x => g x.1 x.2) (w, x) x_1) dy).1),
      (semiAdjoint K (fun x_1 => cderiv K (fun x => f x.1 x.2) (w, x) x_1) dy).2 -
        (semiAdjoint K (fun x_1 => cderiv K (fun x => g x.1 x.2) (w, x) x_1) dy).2) =
    (dw + (semiAdjoint K (cderiv K (fun x => f x.1 x.2) (w, x)) dy).1,
        (semiAdjoint K (cderiv K (fun x => f x.1 x.2) (w, x)) dy).2) +
      semiAdjoint K (fun x_1 => cderiv K (fun x => g x.1 x.2) (w, x) x_1) (-dy)
Tactic:
ext
Proof state after:
case h.h.h.h.a
K : Type
inst✝⁴ : RCLike K
X : Type
inst✝³ : SemiInnerProductSpace K X
Y : Type
inst✝² : SemiInnerProductSpace K Y
Z : Type
inst✝¹ : SemiInnerProductSpace K Z
W : Type
inst✝ : SemiInnerProductSpace K W
f g : W → X → Y
hf : HasAdjDiff K fun x => f x.1 x.2
hg : HasAdjDiff K fun x => g x.1 x.2
w : W
x : X
dy : Y
dw : W
⊢ (dw +
          ((semiAdjoint K (fun x_1 => cderiv K (fun x => f x.1 x.2) (w, x) x_1) dy).1 -
            (semiAdjoint K (fun x_1 => cderiv K (fun x => g x.1 x.2) (w, x) x_1) dy).1),
        (semiAdjoint K (fun x_1 => cderiv K (fun x => f x.1 x.2) (w, x) x_1) dy).2 -
          (semiAdjoint K (fun x_1 => cderiv K (fun x => g x.1 x.2) (w, x) x_1) dy).2).1 =
    ((dw + (semiAdjoint K (cderiv K (fun x => f x.1 x.2) (w, x)) dy).1,
          (semiAdjoint K (cderiv K (fun x => f x.1 x.2) (w, x)) dy).2) +
        semiAdjoint K (fun x_1 => cderiv K (fun x => g x.1 x.2) (w, x) x_1) (-dy)).1

case h.h.h.h.a
K : Type
inst✝⁴ : RCLike K
X : Type
inst✝³ : SemiInnerProductSpace K X
Y : Type
inst✝² : SemiInnerProductSpace K Y
Z : Type
inst✝¹ : SemiInnerProductSpace K Z
W : Type
inst✝ : SemiInnerProductSpace K W
f g : W → X → Y
hf : HasAdjDiff K fun x => f x.1 x.2
hg : HasAdjDiff K fun x => g x.1 x.2
w : W
x : X
dy : Y
dw : W
⊢ (dw +
          ((semiAdjoint K (fun x_1 => cderiv K (fun x => f x.1 x.2) (w, x) x_1) dy).1 -
            (semiAdjoint K (fun x_1 => cderiv K (fun x => g x.1 x.2) (w, x) x_1) dy).1),
        (semiAdjoint K (fun x_1 => cderiv K (fun x => f x.1 x.2) (w, x) x_1) dy).2 -
          (semiAdjoint K (fun x_1 => cderiv K (fun x => g x.1 x.2) (w, x) x_1) dy).2).2 =
    ((dw + (semiAdjoint K (cderiv K (fun x => f x.1 x.2) (w, x)) dy).1,
          (semiAdjoint K (cderiv K (fun x => f x.1 x.2) (w, x)) dy).2) +
        semiAdjoint K (fun x_1 => cderiv K (fun x => g x.1 x.2) (w, x) x_1) (-dy)).2
Theorem: HSub.hSub.arg_a0a1.revDeriv2_rule
Proof state before:
case h.h.h.h.a
K : Type
inst✝⁴ : RCLike K
X : Type
inst✝³ : SemiInnerProductSpace K X
Y : Type
inst✝² : SemiInnerProductSpace K Y
Z : Type
inst✝¹ : SemiInnerProductSpace K Z
W : Type
inst✝ : SemiInnerProductSpace K W
f g : W → X → Y
hf : HasAdjDiff K fun x => f x.1 x.2
hg : HasAdjDiff K fun x => g x.1 x.2
w : W
x : X
dy : Y
dw : W
⊢ (dw +
          ((semiAdjoint K (fun x_1 => cderiv K (fun x => f x.1 x.2) (w, x) x_1) dy).1 -
            (semiAdjoint K (fun x_1 => cderiv K (fun x => g x.1 x.2) (w, x) x_1) dy).1),
        (semiAdjoint K (fun x_1 => cderiv K (fun x => f x.1 x.2) (w, x) x_1) dy).2 -
          (semiAdjoint K (fun x_1 => cderiv K (fun x => g x.1 x.2) (w, x) x_1) dy).2).1 =
    ((dw + (semiAdjoint K (cderiv K (fun x => f x.1 x.2) (w, x)) dy).1,
          (semiAdjoint K (cderiv K (fun x => f x.1 x.2) (w, x)) dy).2) +
        semiAdjoint K (fun x_1 => cderiv K (fun x => g x.1 x.2) (w, x) x_1) (-dy)).1

case h.h.h.h.a
K : Type
inst✝⁴ : RCLike K
X : Type
inst✝³ : SemiInnerProductSpace K X
Y : Type
inst✝² : SemiInnerProductSpace K Y
Z : Type
inst✝¹ : SemiInnerProductSpace K Z
W : Type
inst✝ : SemiInnerProductSpace K W
f g : W → X → Y
hf : HasAdjDiff K fun x => f x.1 x.2
hg : HasAdjDiff K fun x => g x.1 x.2
w : W
x : X
dy : Y
dw : W
⊢ (dw +
          ((semiAdjoint K (fun x_1 => cderiv K (fun x => f x.1 x.2) (w, x) x_1) dy).1 -
            (semiAdjoint K (fun x_1 => cderiv K (fun x => g x.1 x.2) (w, x) x_1) dy).1),
        (semiAdjoint K (fun x_1 => cderiv K (fun x => f x.1 x.2) (w, x) x_1) dy).2 -
          (semiAdjoint K (fun x_1 => cderiv K (fun x => g x.1 x.2) (w, x) x_1) dy).2).2 =
    ((dw + (semiAdjoint K (cderiv K (fun x => f x.1 x.2) (w, x)) dy).1,
          (semiAdjoint K (cderiv K (fun x => f x.1 x.2) (w, x)) dy).2) +
        semiAdjoint K (fun x_1 => cderiv K (fun x => g x.1 x.2) (w, x) x_1) (-dy)).2
Tactic:
. rw[sub_eq_add_zero_sub]; simp[add_assoc,neg_pull]
Proof state after:
case h.h.h.h.a
K : Type
inst✝⁴ : RCLike K
X : Type
inst✝³ : SemiInnerProductSpace K X
Y : Type
inst✝² : SemiInnerProductSpace K Y
Z : Type
inst✝¹ : SemiInnerProductSpace K Z
W : Type
inst✝ : SemiInnerProductSpace K W
f g : W → X → Y
hf : HasAdjDiff K fun x => f x.1 x.2
hg : HasAdjDiff K fun x => g x.1 x.2
w : W
x : X
dy : Y
dw : W
⊢ (dw +
          ((semiAdjoint K (fun x_1 => cderiv K (fun x => f x.1 x.2) (w, x) x_1) dy).1 -
            (semiAdjoint K (fun x_1 => cderiv K (fun x => g x.1 x.2) (w, x) x_1) dy).1),
        (semiAdjoint K (fun x_1 => cderiv K (fun x => f x.1 x.2) (w, x) x_1) dy).2 -
          (semiAdjoint K (fun x_1 => cderiv K (fun x => g x.1 x.2) (w, x) x_1) dy).2).2 =
    ((dw + (semiAdjoint K (cderiv K (fun x => f x.1 x.2) (w, x)) dy).1,
          (semiAdjoint K (cderiv K (fun x => f x.1 x.2) (w, x)) dy).2) +
        semiAdjoint K (fun x_1 => cderiv K (fun x => g x.1 x.2) (w, x) x_1) (-dy)).2
Theorem: HSub.hSub.arg_a0a1.revDeriv2_rule
Proof state before:
case h.h.h.h.a
K : Type
inst✝⁴ : RCLike K
X : Type
inst✝³ : SemiInnerProductSpace K X
Y : Type
inst✝² : SemiInnerProductSpace K Y
Z : Type
inst✝¹ : SemiInnerProductSpace K Z
W : Type
inst✝ : SemiInnerProductSpace K W
f g : W → X → Y
hf : HasAdjDiff K fun x => f x.1 x.2
hg : HasAdjDiff K fun x => g x.1 x.2
w : W
x : X
dy : Y
dw : W
⊢ (dw +
          ((semiAdjoint K (fun x_1 => cderiv K (fun x => f x.1 x.2) (w, x) x_1) dy).1 -
            (semiAdjoint K (fun x_1 => cderiv K (fun x => g x.1 x.2) (w, x) x_1) dy).1),
        (semiAdjoint K (fun x_1 => cderiv K (fun x => f x.1 x.2) (w, x) x_1) dy).2 -
          (semiAdjoint K (fun x_1 => cderiv K (fun x => g x.1 x.2) (w, x) x_1) dy).2).2 =
    ((dw + (semiAdjoint K (cderiv K (fun x => f x.1 x.2) (w, x)) dy).1,
          (semiAdjoint K (cderiv K (fun x => f x.1 x.2) (w, x)) dy).2) +
        semiAdjoint K (fun x_1 => cderiv K (fun x => g x.1 x.2) (w, x) x_1) (-dy)).2
Tactic:
. simp[add_assoc,neg_pull]; rw[sub_eq_add_zero_sub]; simp
Proof state after:
no goals
Theorem: HSub.hSub.arg_a0a1.revDeriv2_rule
Proof state before:
case h.h.h.h.a
K : Type
inst✝⁴ : RCLike K
X : Type
inst✝³ : SemiInnerProductSpace K X
Y : Type
inst✝² : SemiInnerProductSpace K Y
Z : Type
inst✝¹ : SemiInnerProductSpace K Z
W : Type
inst✝ : SemiInnerProductSpace K W
f g : W → X → Y
hf : HasAdjDiff K fun x => f x.1 x.2
hg : HasAdjDiff K fun x => g x.1 x.2
w : W
x : X
dy : Y
dw : W
⊢ (dw +
          ((semiAdjoint K (fun x_1 => cderiv K (fun x => f x.1 x.2) (w, x) x_1) dy).1 -
            (semiAdjoint K (fun x_1 => cderiv K (fun x => g x.1 x.2) (w, x) x_1) dy).1),
        (semiAdjoint K (fun x_1 => cderiv K (fun x => f x.1 x.2) (w, x) x_1) dy).2 -
          (semiAdjoint K (fun x_1 => cderiv K (fun x => g x.1 x.2) (w, x) x_1) dy).2).1 =
    ((dw + (semiAdjoint K (cderiv K (fun x => f x.1 x.2) (w, x)) dy).1,
          (semiAdjoint K (cderiv K (fun x => f x.1 x.2) (w, x)) dy).2) +
        semiAdjoint K (fun x_1 => cderiv K (fun x => g x.1 x.2) (w, x) x_1) (-dy)).1
Tactic:
rw[sub_eq_add_zero_sub]
Proof state after:
case h.h.h.h.a
K : Type
inst✝⁴ : RCLike K
X : Type
inst✝³ : SemiInnerProductSpace K X
Y : Type
inst✝² : SemiInnerProductSpace K Y
Z : Type
inst✝¹ : SemiInnerProductSpace K Z
W : Type
inst✝ : SemiInnerProductSpace K W
f g : W → X → Y
hf : HasAdjDiff K fun x => f x.1 x.2
hg : HasAdjDiff K fun x => g x.1 x.2
w : W
x : X
dy : Y
dw : W
⊢ (dw +
          ((semiAdjoint K (fun x_1 => cderiv K (fun x => f x.1 x.2) (w, x) x_1) dy).1 +
            (0 - (semiAdjoint K (fun x_1 => cderiv K (fun x => g x.1 x.2) (w, x) x_1) dy).1)),
        (semiAdjoint K (fun x_1 => cderiv K (fun x => f x.1 x.2) (w, x) x_1) dy).2 -
          (semiAdjoint K (fun x_1 => cderiv K (fun x => g x.1 x.2) (w, x) x_1) dy).2).1 =
    ((dw + (semiAdjoint K (cderiv K (fun x => f x.1 x.2) (w, x)) dy).1,
          (semiAdjoint K (cderiv K (fun x => f x.1 x.2) (w, x)) dy).2) +
        semiAdjoint K (fun x_1 => cderiv K (fun x => g x.1 x.2) (w, x) x_1) (-dy)).1
Theorem: HSub.hSub.arg_a0a1.revDeriv2_rule
Proof state before:
case h.h.h.h.a
K : Type
inst✝⁴ : RCLike K
X : Type
inst✝³ : SemiInnerProductSpace K X
Y : Type
inst✝² : SemiInnerProductSpace K Y
Z : Type
inst✝¹ : SemiInnerProductSpace K Z
W : Type
inst✝ : SemiInnerProductSpace K W
f g : W → X → Y
hf : HasAdjDiff K fun x => f x.1 x.2
hg : HasAdjDiff K fun x => g x.1 x.2
w : W
x : X
dy : Y
dw : W
⊢ (dw +
          ((semiAdjoint K (fun x_1 => cderiv K (fun x => f x.1 x.2) (w, x) x_1) dy).1 +
            (0 - (semiAdjoint K (fun x_1 => cderiv K (fun x => g x.1 x.2) (w, x) x_1) dy).1)),
        (semiAdjoint K (fun x_1 => cderiv K (fun x => f x.1 x.2) (w, x) x_1) dy).2 -
          (semiAdjoint K (fun x_1 => cderiv K (fun x => g x.1 x.2) (w, x) x_1) dy).2).1 =
    ((dw + (semiAdjoint K (cderiv K (fun x => f x.1 x.2) (w, x)) dy).1,
          (semiAdjoint K (cderiv K (fun x => f x.1 x.2) (w, x)) dy).2) +
        semiAdjoint K (fun x_1 => cderiv K (fun x => g x.1 x.2) (w, x) x_1) (-dy)).1
Tactic:
simp[add_assoc,neg_pull]
Proof state after:
no goals