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

feat: use omega in default decreasing_trivial #3503

Merged
merged 5 commits into from
Feb 27, 2024

Conversation

nomeata
Copy link
Collaborator

@nomeata nomeata commented Feb 26, 2024

with this, more functions will be proven terminating automatically,
namely those where after simp_wf, lexicographic order handling,
possibly subst_vars the remaining goal can be solved by omega.

Note that simp_wf already does simplification of the goal, so
this adds omega, not (try simp) <;> omega here.

There are certainly cases where (try simp) <;> omega will solve more
goals (e.g. due to the subst_vars in decreasing_with), and
(try simp at *) <;> omega even more. This PR errs on the side of taking
smaller steps.

Just appending <;> omega to the existing
simp (config := { arith := true, failIfUnchanged := false }) call
doesn’t work nicely, as that leaves forms like Nat.sub in the goal that
omega does not seem to recognize.

This does not remove any of the existing ad-hoc decreasing_trivial
rules based on apply and assumption, to not regress over the status
quo (these rules may apply in cases where omega wouldn't “see”
everything, but apply due to defeq works).

Additionally, just extending makes bootstrapping easier; early in Init where
omega does not work yet these other tactics can still be used.

(Using a single omega-based tactic was tried in #3478 but isn’t quite
possible yet, and will be postponed until we have better automation
including forward reasoning.)

with this, more functions will be proven terminating automatically,
namely those where after `simp_wf`, lexicographic order handling,
possibly subst_vars and `simp` all remaining goals can be handled by
`omega`.

This does *not* remove any of the existing ad-hoc `decreasing_trivial`
rules based on `apply` and `assumption`, to not regress over the status
quo (these rules may apply in cases where `omega` wouldn't “see”
everything, but `apply` due to defeq works).

Additionally, this makes bootstrapping easier; early in `Init` where
`omega` does not work yet these other tactics can still be used.

(Using a single `omega`-based tactic was tried in #3478 but isn’t quite
possible yet, and will be postponed until we have better automation
including forward reasoning.)
@github-actions github-actions bot temporarily deployed to lean-lang.org/lean4/doc February 26, 2024 11:40 Inactive
@nomeata nomeata changed the title feat: Use omega in default decreasing_trivial feat: use omega in default decreasing_trivial Feb 26, 2024
@github-actions github-actions bot added the toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN label Feb 26, 2024
@leanprover-community-mathlib4-bot
Copy link
Collaborator

Mathlib CI status (docs):

  • ❗ Std/Mathlib CI will not be attempted unless your PR branches off the nightly-with-mathlib branch. Try git rebase eb48e6908bae574d434280867c3d3d02e36b8152 --onto 88fbe2e5313bb418abdb035c48cae2680ea9bcea. (2024-02-26 11:43:33)

@nomeata nomeata marked this pull request as ready for review February 26, 2024 12:22
@github-actions github-actions bot temporarily deployed to lean-lang.org/lean4/doc February 26, 2024 14:02 Inactive
nomeata added a commit that referenced this pull request Feb 27, 2024
with this, hopefully more obvious array accesses will be handled
automatically.

Just like #3503, this PR does not investiate which of the exitsting
tactics in `get_elem_tactic_trivial` are subsumed now and could be
dropped without (too much) breakage.
@leodemoura leodemoura added this pull request to the merge queue Feb 27, 2024
github-merge-queue bot pushed a commit that referenced this pull request Feb 27, 2024
with this, hopefully more obvious array accesses will be handled
automatically.

Just like #3503, this PR does not investiate which of the exitsting
tactics in `get_elem_tactic_trivial` are subsumed now and could be
dropped without (too much) breakage.
Merged via the queue into master with commit 9c00a59 Feb 27, 2024
11 checks passed
@nomeata nomeata deleted the joachim/decreasing-omega-simple branch February 27, 2024 20:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants