feat(Tactic): tactic for computing asymptotics of real functions#18486
feat(Tactic): tactic for computing asymptotics of real functions#18486vasnesterov wants to merge 52 commits intomasterfrom
Conversation
There was a problem hiding this comment.
Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit
lint-style (comment with "bot fix style" to have the bot commit all style suggestions)
[lint-style (comment with "bot fix style" to have the bot commit all style suggestions)] reported by reviewdog 🐶
[lint-style (comment with "bot fix style" to have the bot commit all style suggestions)] reported by reviewdog 🐶
[lint-style (comment with "bot fix style" to have the bot commit all style suggestions)] reported by reviewdog 🐶
[lint-style (comment with "bot fix style" to have the bot commit all style suggestions)] reported by reviewdog 🐶
[lint-style (comment with "bot fix style" to have the bot commit all style suggestions)] reported by reviewdog 🐶
[lint-style (comment with "bot fix style" to have the bot commit all style suggestions)] reported by reviewdog 🐶
[lint-style (comment with "bot fix style" to have the bot commit all style suggestions)] reported by reviewdog 🐶
[lint-style (comment with "bot fix style" to have the bot commit all style suggestions)] reported by reviewdog 🐶
[lint-style (comment with "bot fix style" to have the bot commit all style suggestions)] reported by reviewdog 🐶
[lint-style (comment with "bot fix style" to have the bot commit all style suggestions)] reported by reviewdog 🐶
[lint-style (comment with "bot fix style" to have the bot commit all style suggestions)] reported by reviewdog 🐶
[lint-style (comment with "bot fix style" to have the bot commit all style suggestions)] reported by reviewdog 🐶
[lint-style (comment with "bot fix style" to have the bot commit all style suggestions)] reported by reviewdog 🐶
[lint-style (comment with "bot fix style" to have the bot commit all style suggestions)] reported by reviewdog 🐶
[lint-style (comment with "bot fix style" to have the bot commit all style suggestions)] reported by reviewdog 🐶
[lint-style (comment with "bot fix style" to have the bot commit all style suggestions)] reported by reviewdog 🐶
[lint-style (comment with "bot fix style" to have the bot commit all style suggestions)] reported by reviewdog 🐶
[lint-style (comment with "bot fix style" to have the bot commit all style suggestions)] reported by reviewdog 🐶
[lint-style (comment with "bot fix style" to have the bot commit all style suggestions)] reported by reviewdog 🐶
[lint-style (comment with "bot fix style" to have the bot commit all style suggestions)] reported by reviewdog 🐶
[lint-style (comment with "bot fix style" to have the bot commit all style suggestions)] reported by reviewdog 🐶
[lint-style (comment with "bot fix style" to have the bot commit all style suggestions)] reported by reviewdog 🐶
[lint-style (comment with "bot fix style" to have the bot commit all style suggestions)] reported by reviewdog 🐶
[lint-style (comment with "bot fix style" to have the bot commit all style suggestions)] reported by reviewdog 🐶
[lint-style (comment with "bot fix style" to have the bot commit all style suggestions)] reported by reviewdog 🐶
[lint-style (comment with "bot fix style" to have the bot commit all style suggestions)] reported by reviewdog 🐶
[lint-style (comment with "bot fix style" to have the bot commit all style suggestions)] reported by reviewdog 🐶
[lint-style (comment with "bot fix style" to have the bot commit all style suggestions)] reported by reviewdog 🐶
[lint-style (comment with "bot fix style" to have the bot commit all style suggestions)] reported by reviewdog 🐶
[lint-style (comment with "bot fix style" to have the bot commit all style suggestions)] reported by reviewdog 🐶
[lint-style (comment with "bot fix style" to have the bot commit all style suggestions)] reported by reviewdog 🐶
[lint-style (comment with "bot fix style" to have the bot commit all style suggestions)] reported by reviewdog 🐶
| apply Approximates_sub_zero h_tl | ||
| rw [eventuallyEq_iff_sub] | ||
| eta_expand | ||
| simp |
There was a problem hiding this comment.
[lint-style (comment with "bot fix style" to have the bot commit all style suggestions)] reported by reviewdog 🐶
| simp | |
| simp? |
| apply Approximates_sub_zero h_tl | ||
| rw [eventuallyEq_iff_sub] | ||
| eta_expand | ||
| simp |
There was a problem hiding this comment.
[lint-style (comment with "bot fix style" to have the bot commit all style suggestions)] reported by reviewdog 🐶
| simp | |
| simp? |
| have h_XY : HAdd.hAdd (α := PreMS (basis_hd :: basis_tl)) (Seq.cons (X_exp, X_coef) X_tl) | ||
| (Seq.cons (Y_exp, Y_coef) Y_tl) = ?_ := by | ||
| rw [add_unfold, add'] | ||
| simp |
There was a problem hiding this comment.
[lint-style (comment with "bot fix style" to have the bot commit all style suggestions)] reported by reviewdog 🐶
| simp | |
| simp? |
| have h_YZ : HAdd.hAdd (α := PreMS (basis_hd :: basis_tl)) (Seq.cons (Y_exp, Y_coef) Y_tl) | ||
| (Seq.cons (Z_exp, Z_coef) Z_tl) = ?_ := by | ||
| rw [add_unfold, add'] | ||
| simp |
There was a problem hiding this comment.
[lint-style (comment with "bot fix style" to have the bot commit all style suggestions)] reported by reviewdog 🐶
| simp | |
| simp? |
| · exact hY_comp | ||
| simp only [motive] | ||
| use .nil, Y_tl | ||
| simp |
There was a problem hiding this comment.
[lint-style (comment with "bot fix style" to have the bot commit all style suggestions)] reported by reviewdog 🐶
| simp | |
| simp? |
| simp | ||
| exact ⟨hY_tl_wo, hX_coef_wo⟩ | ||
| | cast j => | ||
| simp |
There was a problem hiding this comment.
[lint-style (comment with "bot fix style" to have the bot commit all style suggestions)] reported by reviewdog 🐶
| simp | |
| simp? |
| constructor | ||
| · exact h_left_comp | ||
| · rw [← h_right_eq.2, ← h_right_eq.1.1] -- copypaste | ||
| simp |
There was a problem hiding this comment.
[lint-style (comment with "bot fix style" to have the bot commit all style suggestions)] reported by reviewdog 🐶
| simp | |
| simp? |
| · intro j | ||
| cases j using Fin.lastCases with | ||
| | last => | ||
| simp |
There was a problem hiding this comment.
[lint-style (comment with "bot fix style" to have the bot commit all style suggestions)] reported by reviewdog 🐶
| simp | |
| simp? |
| simp | ||
| exact ⟨hY_tl_wo, hX_coef_wo⟩ | ||
| | cast j => | ||
| simp |
There was a problem hiding this comment.
[lint-style (comment with "bot fix style" to have the bot commit all style suggestions)] reported by reviewdog 🐶
| simp | |
| simp? |
| cases' b with b_exp b_coef b_tl | ||
| · apply Approximates_nil at hb_approx | ||
| left | ||
| simp |
There was a problem hiding this comment.
[lint-style (comment with "bot fix style" to have the bot commit all style suggestions)] reported by reviewdog 🐶
| simp | |
| simp? |
|
This PR has been migrated to a fork-based workflow: #28291 |
It's an auxiliary PR which implements the entire
compute_asymptoticstactic. I will split it into multiple small PRs.In this PR I implement the
compute_asymptoticstactic. Its purpose is to compute asymptotics of functions fromℝtoℝ. So far it is able to compute the limit of any function constructed using arithmetic operations (+,-,*,/, inversion) and powers with constant real exponent.It also supports non-numerical constants:
(for more examples see
compute_asymptotics.leanin tests)Isn't it undecidable?
In general, finding the limit of a given function is undecidable problem, due to undecidability of the problem of comparing real numbers. So far I use
linarithtactic for this under the hood. When it's unable to prove neither ofx < y,y < x,x = y, the tactic fails.TODO
f =o[l] gand similarly for other O-notations.sin,cos,exp, andlogsupport.References
I am basically implementing this article about computing asymptotics in Isabelle by Manuel Eberl.
FormalMultilinearSeries.compContinuousLinearMap#26255HasFPowerSeriesOnBall.compContinuousLinearMap#23790HasFPowerSeriesOnBall.comp_subvariations #23748Seq.lean#20071updateandsetoperations forSeq#26120