-
Notifications
You must be signed in to change notification settings - Fork 344
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add some simp and fun_prop attributes (#18874)
* Also add a test file that uses the `simp` lemmas. * Add/move the `fun_prop` lemmas to the compositional lemmas. [Zulip](https://leanprover.zulipchat.com/#narrow/channel/287929-mathlib4/topic/Derivative.20cannot.20simp)
- Loading branch information
1 parent
7b79131
commit d4a83c9
Showing
4 changed files
with
66 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import Mathlib | ||
|
||
/-! Test that `simp` can prove some lemmas about derivatives. -/ | ||
|
||
open Real | ||
|
||
example (x : ℝ) : deriv (fun x => cos x + 2 * sin x) x = -sin x + 2 * cos x := by | ||
simp | ||
|
||
example (x : ℝ) : | ||
deriv (fun x ↦ cos (sin x) * exp x) x = (cos (sin x) - sin (sin x) * cos x) * exp x := by | ||
simp; ring | ||
|
||
/- for more complicated examples (with more nested functions) you need to increase the | ||
`maxDischargeDepth`. -/ | ||
|
||
example (x : ℝ) : | ||
deriv (fun x ↦ sin (sin (sin x)) + sin x) x = | ||
cos (sin (sin x)) * (cos (sin x) * cos x) + cos x := by | ||
simp (maxDischargeDepth := 3) | ||
|
||
example (x : ℝ) : | ||
deriv (fun x ↦ sin (sin (sin x)) ^ 10 + sin x) x = | ||
10 * sin (sin (sin x)) ^ 9 * (cos (sin (sin x)) * (cos (sin x) * cos x)) + cos x := by | ||
simp (maxDischargeDepth := 4) |