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: more UInt lemmas #6205

Merged
merged 7 commits into from
Nov 29, 2024
Merged

feat: more UInt lemmas #6205

merged 7 commits into from
Nov 29, 2024

Conversation

tydeu
Copy link
Member

@tydeu tydeu commented Nov 25, 2024

This PR upstreams some UInt theorems from Batteries and adds more toNat-related theorems. It also adds the missing UInt8 and UInt16 to/from USize conversions so that the the interface is uniform across the UInt types.

Summary of all changes:

  • Upstreamed and added toNat constructors lemmas: toNat_mk, ofNat_toNat, toNat_ofNat, toNat_ofNatCore, and USize.toNat_ofNat32
  • Upstreamed and added toNat canonicalization; val_val_eq_toNat and toNat_toBitVec_eq_toNat
  • Added injectivity iffs: toBitVec_inj, toNat_inj, and val_inj
  • Added inequality iffs: le_iff_toNat_le and lt_iff_toNat_lt
  • Upstreamed antisymmetry lemmas: le_antisymm and le_antisymm_iff
  • Upstreamed missing toNat lemmas on arithmetic operations: toNat_add, toNat_sub, toNat_mul
  • Upstreamed and added missing conversion lemmas: toNat_toUInt* and toNat_USize
  • Added missing USize conversions: USize.toUInt8, UInt8.toUSize, USize.toUInt16, UInt16.toUSize

@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 Nov 25, 2024
leanprover-community-mathlib4-bot added a commit to leanprover-community/batteries that referenced this pull request Nov 25, 2024
leanprover-community-mathlib4-bot added a commit to leanprover-community/mathlib4 that referenced this pull request Nov 25, 2024
@tydeu tydeu added the changelog-library Library label Nov 25, 2024
@leanprover-community-bot leanprover-community-bot added the breaks-mathlib This is not necessarily a blocker for merging: but there needs to be a plan label Nov 25, 2024
@leanprover-community-bot
Copy link
Collaborator

leanprover-community-bot commented Nov 25, 2024

Mathlib CI status (docs):

leanprover-community-mathlib4-bot added a commit to leanprover-community/batteries that referenced this pull request Nov 28, 2024
leanprover-community-mathlib4-bot added a commit to leanprover-community/mathlib4 that referenced this pull request Nov 28, 2024
tydeu added a commit to leanprover-community/batteries that referenced this pull request Nov 28, 2024
tydeu added a commit to tydeu/std4 that referenced this pull request Nov 28, 2024
tydeu added a commit to leanprover-community/batteries that referenced this pull request Nov 28, 2024
tydeu added a commit to leanprover-community/mathlib4 that referenced this pull request Nov 28, 2024
@leanprover-community-bot leanprover-community-bot added builds-mathlib CI has verified that Mathlib builds against this PR and removed breaks-mathlib This is not necessarily a blocker for merging: but there needs to be a plan labels Nov 28, 2024
@tydeu tydeu marked this pull request as ready for review November 28, 2024 09:17
@tydeu tydeu requested a review from kim-em as a code owner November 28, 2024 09:17
@tydeu tydeu marked this pull request as draft November 28, 2024 20:40
leanprover-community-mathlib4-bot added a commit to leanprover-community/batteries that referenced this pull request Nov 28, 2024
leanprover-community-mathlib4-bot added a commit to leanprover-community/mathlib4 that referenced this pull request Nov 28, 2024
leanprover-community-mathlib4-bot added a commit to leanprover-community/batteries that referenced this pull request Nov 29, 2024
leanprover-community-mathlib4-bot added a commit to leanprover-community/mathlib4 that referenced this pull request Nov 29, 2024
@tydeu tydeu marked this pull request as ready for review November 29, 2024 00:12
@kim-em kim-em added this pull request to the merge queue Nov 29, 2024
Merged via the queue into leanprover:master with commit 4969ec9 Nov 29, 2024
18 checks passed
@tydeu tydeu deleted the more-uint-lemmas branch November 29, 2024 03:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
builds-mathlib CI has verified that Mathlib builds against this PR changelog-library Library 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