lecopivo / SciLean

Scientific computing in Lean 4
https://lecopivo.github.io/scientific-computing-lean/
Apache License 2.0
331 stars 29 forks source link

`ftrans` applies incorrect rule #25

Open lecopivo opened 1 year ago

lecopivo commented 1 year ago

ftrans fails in the following example with the error

failed to synthesize
   SemiInnerProductSpace K (X → X)

which is indication that is has to be applying incorrect rule

example
  (f : Y → Z) (g : X → Y) 
  (hf : HasAdjDiff K f) (hg : HasAdjDiff K g)
  : revDerivUpdate K (fun x : X => f (g x))
    = 
    fun x =>
      let ydg := revDerivUpdate K g x
      let zdf := revDerivUpdate K (fun x' => f (ydg.1 + semiAdjoint K (ydg.2 · 1 0) (x' - x))) x
      zdf := 
by
  have ⟨_,_⟩ := hf
  have ⟨_,_⟩ := hg
  unfold revDerivUpdate
  funext _; 
  ftrans -- error