Skip to content

feat(Tactic/ComputeAsymptotics/Multiseries): predicates for Monomial#37414

Open
vasnesterov wants to merge 8 commits intoleanprover-community:masterfrom
vasnesterov:compute_asymptotics_term_predicates
Open

feat(Tactic/ComputeAsymptotics/Multiseries): predicates for Monomial#37414
vasnesterov wants to merge 8 commits intoleanprover-community:masterfrom
vasnesterov:compute_asymptotics_term_predicates

Conversation

@vasnesterov
Copy link
Copy Markdown
Collaborator

Introduce FirstNonzeroIsPos, FirstNonzeroIsNeg and AllZero predicates on lists of real numbers.

When applied to a list of exponents of a monomial in a well-formed basis, this trichotomy
determines its asymptotic behaviour: FirstNonzeroIsPos means it tends to infinity,
FirstNonzeroIsNeg means it tends to zero and AllZero means it tends to a constant.


This is a part of the compute_asymptotics tactic (#28291).

Open in Gitpod

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 31, 2026

PR summary fdd294c699

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference
Mathlib.Tactic 1
Mathlib.Tactic.ComputeAsymptotics.Multiseries.Monomial.Predicates (new file) 1775

Declarations diff

+ AllZero
+ AllZero.cons_iff
+ AllZero.not_firstNonzeroIsPos
+ AllZero.replicate
+ AllZero_of_nil
+ AllZero_of_tail
+ FirstNonzeroIsNeg
+ FirstNonzeroIsNeg.not_firstNonzeroIsPos
+ FirstNonzeroIsNeg.of_head
+ FirstNonzeroIsNeg.of_tail
+ FirstNonzeroIsPos
+ FirstNonzeroIsPos.of_head
+ FirstNonzeroIsPos.of_tail

You can run this locally as follows
## summary with just the declaration names:
./scripts/pr_summary/declarations_diff.sh <optional_commit>

## more verbose report:
./scripts/pr_summary/declarations_diff.sh long <optional_commit>

The doc-module for scripts/pr_summary/declarations_diff.sh contains some details about this script.


No changes to technical debt.

You can run this locally as

./scripts/reporting/technical-debt-metrics.sh pr_summary
  • The relative value is the weighted sum of the differences with weight given by the inverse of the current value of the statistic.
  • The absolute value is the relative value divided by the total sum of the inverses of the current values (i.e. the weighted average of the differences).

@github-actions github-actions bot added the t-meta Tactics, attributes or user commands label Mar 31, 2026
Copy link
Copy Markdown
Collaborator

@WilliamCoram WilliamCoram left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking good. Other than my comments I am a bit unsure of the naming scheme in theorems used:
e.g. I think AllZero_of_nil should be renamed allZero_of_nil to be in lowerCamelCase. This can then be repeated in the rest of the theorems.

If someone else can confirm or deny this (as much for myself as for the PR), please comment.

theorem AllZero_of_replicate {n : ℕ} : AllZero (List.replicate n 0) := by
cases n <;> simp [AllZero]

theorem not_FirstNonzeroIsPos_of_AllZero {li : List ℝ} (h : AllZero li) :
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you want a similar theorem for not_FirstNonzeroIsNeg_of_AllZero?
Same goes for the theorem below.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It, of course, can be proven, but isn't needed for the tactic.

@vasnesterov
Copy link
Copy Markdown
Collaborator Author

Thank you for taking a look! I've renamed some theorems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

t-meta Tactics, attributes or user commands

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants