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: Lean.RArray #6070

Merged
merged 5 commits into from
Nov 14, 2024
Merged

feat: Lean.RArray #6070

merged 5 commits into from
Nov 14, 2024

Conversation

nomeata
Copy link
Collaborator

@nomeata nomeata commented Nov 13, 2024

This PR adds the Lean.RArray data structure.

This data structure is equivalent to Fin n → α or Array α, but optimized for a fast kernel-reduction get operation.

It is not suitable as a general-purpose data structure. The primary intended use case is the “denote” function of a typical proof by reflection proof, where only the get operation is necessary, and where using List.get unnecessarily slows down proofs with more than a hand-full of atomic expressions.

There is no well-formedness invariant attached to this data structure, to keep it concise; it's semantics is given through RArray.get. In that way one can also view an RArray as a decision tree implementing Nat → α.

In #6068 this data structure is used in simp_arith.

@nomeata nomeata requested a review from kim-em as a code owner November 13, 2024 15:41
@nomeata nomeata added the changelog-library Library label Nov 13, 2024
src/Lean/Data/RArray.lean Outdated Show resolved Hide resolved
@github-actions github-actions bot temporarily deployed to lean-lang.org/lean4/doc November 13, 2024 16:00 Inactive
@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 13, 2024
leanprover-community-mathlib4-bot added a commit to leanprover-community/batteries that referenced this pull request Nov 13, 2024
leanprover-community-mathlib4-bot added a commit to leanprover-community/mathlib4 that referenced this pull request Nov 13, 2024
@leanprover-community-bot leanprover-community-bot added the builds-mathlib CI has verified that Mathlib builds against this PR label Nov 13, 2024
@leanprover-community-bot
Copy link
Collaborator

leanprover-community-bot commented Nov 13, 2024

Mathlib CI status (docs):

  • ✅ Mathlib branch lean-pr-testing-6070 has successfully built against this PR. (2024-11-13 16:48:41) View Log
  • ❗ Batteries/Mathlib CI will not be attempted unless your PR branches off the nightly-with-mathlib branch. Try git rebase e6e39f502feae04a0c40fc43ce2e259f74af3988 --onto 1315266dd3faeaf28d1263668cb88f2f3f5e530c. (2024-11-14 10:58:46)
  • ✅ Mathlib branch lean-pr-testing-6070 has successfully built against this PR. (2024-11-14 11:11:04) View Log

@nomeata nomeata enabled auto-merge November 14, 2024 09:54
@github-actions github-actions bot temporarily deployed to lean-lang.org/lean4/doc November 14, 2024 10:06 Inactive
@nomeata nomeata added this pull request to the merge queue Nov 14, 2024
leanprover-community-mathlib4-bot added a commit to leanprover-community/batteries that referenced this pull request Nov 14, 2024
leanprover-community-mathlib4-bot added a commit to leanprover-community/mathlib4 that referenced this pull request Nov 14, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 14, 2024
@nomeata nomeata added this pull request to the merge queue Nov 14, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 14, 2024
@nomeata nomeata enabled auto-merge November 14, 2024 10:35
@github-actions github-actions bot temporarily deployed to lean-lang.org/lean4/doc November 14, 2024 10:49 Inactive
@nomeata nomeata added this pull request to the merge queue Nov 14, 2024
Merged via the queue into master with commit 85f2596 Nov 14, 2024
15 checks passed
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.

2 participants