Skip to content

feat: toNat_sub_of_le#5314

Merged
hargoniX merged 2 commits intoleanprover:masterfrom
opencompl:toNat_sub_of_le
Sep 12, 2024
Merged

feat: toNat_sub_of_le#5314
hargoniX merged 2 commits intoleanprover:masterfrom
opencompl:toNat_sub_of_le

Conversation

@bollu
Copy link
Copy Markdown
Contributor

@bollu bollu commented Sep 11, 2024

This adds a simplification lemma for (x - y).toNat when the subtraction is known to not overflow (i.e., y ≤ x).

We make a new section for this for two reasons:

  1. Definitions of subtraction occur before the definition of BitVec.le_def, so we cannot directly place this lemma at sub.
  2. There are other theorems of this kind, for addition and multiplication, which can morally live in the same section.

This adds a simplification lemma for `(x - y).toNat` when the subtraction is known to not overflow (i.e., `y ≤ x`).
@bollu bollu requested a review from kim-em as a code owner September 11, 2024 19:08
@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 Sep 11, 2024
@ghost
Copy link
Copy Markdown

ghost commented Sep 11, 2024

Mathlib CI status (docs):

  • ❗ Mathlib CI can not be attempted yet, as the nightly-testing-2024-09-07 tag does not exist there yet. We will retry when you push more commits. If you rebase your branch onto nightly-with-mathlib, Mathlib CI should run now. (2024-09-11 19:26:13)

@hargoniX hargoniX enabled auto-merge September 12, 2024 13:04
@hargoniX hargoniX added this pull request to the merge queue Sep 12, 2024
Merged via the queue into leanprover:master with commit 273b754 Sep 12, 2024
tobiasgrosser pushed a commit to opencompl/lean4 that referenced this pull request Sep 16, 2024
This adds a simplification lemma for `(x - y).toNat` when the
subtraction is known to not overflow (i.e., `y ≤ x`).

We make a new section for this for two reasons:
1. Definitions of subtraction occur before the definition of
`BitVec.le_def`, so we cannot directly place this lemma at `sub`.
2. There are other theorems of this kind, for addition and
multiplication, which can morally live in the same section.
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.

2 participants