Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

the outputs of ∂ ... rewrite_by fun_trans and ∂! are different #52

Open
Seasawher opened this issue Dec 22, 2024 · 1 comment
Open

Comments

@Seasawher
Copy link
Contributor

Seasawher commented Dec 22, 2024

Thank you for creating a nice library!

Scientific Computing in Lean says that

Writing rewrite_by fun_trans every time we want to diferentiate an expression gets a bit tedious. We can add an exclamation mark after ∂ to indicate that we want to run fun_trans tactic to compute the derivative.

However, in the following example ∂ ... rewrite_by fun_trans and ∂! have different outputs.

import SciLean.Analysis.Calculus.Notation.Deriv
import SciLean.Analysis.Scalar.Notation

open SciLean Scalar

set_default_scalar ℝ

variable {x y : ℝ}

#check
  let g : ℝ → ℝ → ℝ := fun x y => x^2 + y^2
  ∂ x, ((∂ x, (g x y)) x) rewrite_by fun_trans

#check
  let g : ℝ → ℝ → ℝ := fun x y => x^2 + y^2
  ∂! x, ((∂! x, (g x y)) x)

This is because ∂! 's bug?

@ammkrn
Copy link

ammkrn commented Apr 6, 2025

It's not clear what the outputs you got were since they're not included in your issue, but as of 53f112 these produce definitionally equal terms (though the file defining the notation hasn't changed since August). It's possible something upstream was fixed, or there was just a difference in the pretty-printed output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants