Skip to content

Commit 6077154

Browse files
committed
merge upstream/nightly-with-mathlib
2 parents c7d42d9 + 206eb73 commit 6077154

File tree

126 files changed

+1979
-1164
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

126 files changed

+1979
-1164
lines changed

.github/workflows/check-stage0.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ jobs:
1111
- uses: actions/checkout@v5
1212
with:
1313
ref: ${{ github.event.pull_request.head.sha }}
14-
filter: blob:none
1514
fetch-depth: 0
15+
filter: tree:0
1616

1717
- name: Find base commit
1818
if: github.event_name == 'pull_request'

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,8 @@ jobs:
404404
with:
405405
# needed for tagging
406406
fetch-depth: 0
407+
# Doesn't seem to be working when additionally fetching from lean4-nightly
408+
#filter: tree:0
407409
token: ${{ secrets.PUSH_NIGHTLY_TOKEN }}
408410
- uses: actions/download-artifact@v5
409411
with:

.github/workflows/pr-release.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,17 +48,17 @@ jobs:
4848
git -C lean4.git remote add origin https://github.com/${{ github.repository_owner }}/lean4.git
4949
git -C lean4.git fetch -n origin master
5050
git -C lean4.git fetch -n origin "${{ steps.workflow-info.outputs.sourceHeadSha }}"
51-
51+
5252
# Create both the original tag and the SHA-suffixed tag
5353
SHORT_SHA="${{ steps.workflow-info.outputs.sourceHeadSha }}"
5454
SHORT_SHA="${SHORT_SHA:0:7}"
55-
55+
5656
# Export the short SHA for use in subsequent steps
5757
echo "SHORT_SHA=${SHORT_SHA}" >> "$GITHUB_ENV"
5858
5959
git -C lean4.git tag -f pr-release-${{ steps.workflow-info.outputs.pullRequestNumber }} "${{ steps.workflow-info.outputs.sourceHeadSha }}"
6060
git -C lean4.git tag -f pr-release-${{ steps.workflow-info.outputs.pullRequestNumber }}-"${SHORT_SHA}" "${{ steps.workflow-info.outputs.sourceHeadSha }}"
61-
61+
6262
git -C lean4.git remote add pr-releases https://foo:'${{ secrets.PR_RELEASES_TOKEN }}'@github.com/${{ github.repository_owner }}/lean4-pr-releases.git
6363
git -C lean4.git push -f pr-releases pr-release-${{ steps.workflow-info.outputs.pullRequestNumber }}
6464
git -C lean4.git push -f pr-releases pr-release-${{ steps.workflow-info.outputs.pullRequestNumber }}-"${SHORT_SHA}"
@@ -200,7 +200,7 @@ jobs:
200200
-H "Accept: application/vnd.github.v3+json" \
201201
"https://api.github.com/repos/leanprover/lean4/issues/${{ steps.workflow-info.outputs.pullRequestNumber }}/labels" \
202202
| jq -r '.[].name')"
203-
203+
204204
if echo "$LABELS" | grep -q "^force-mathlib-ci$"; then
205205
echo "force-mathlib-ci label detected, forcing CI despite issues"
206206
MESSAGE="Forcing Mathlib CI because the \`force-mathlib-ci\` label is present, despite problem: $MESSAGE"
@@ -301,7 +301,7 @@ jobs:
301301
-H "Accept: application/vnd.github.v3+json" \
302302
"https://api.github.com/repos/leanprover/lean4/issues/${{ steps.workflow-info.outputs.pullRequestNumber }}/labels" \
303303
| jq -r '.[].name')"
304-
304+
305305
if echo "$LABELS" | grep -q "^force-manual-ci$"; then
306306
echo "force-manual-ci label detected, forcing CI despite issues"
307307
MESSAGE="Forcing reference manual CI because the \`force-manual-ci\` label is present, despite problem: $MESSAGE"
@@ -401,6 +401,7 @@ jobs:
401401
token: ${{ secrets.MATHLIB4_BOT }}
402402
ref: nightly-testing
403403
fetch-depth: 0 # This ensures we check out all tags and branches.
404+
filter: tree:0
404405

405406
- name: Check if tag exists
406407
if: steps.workflow-info.outputs.pullRequestNumber != '' && steps.ready.outputs.mathlib_ready == 'true'
@@ -460,6 +461,7 @@ jobs:
460461
token: ${{ secrets.MATHLIB4_BOT }}
461462
ref: nightly-testing
462463
fetch-depth: 0 # This ensures we check out all tags and branches.
464+
filter: tree:0
463465

464466
- name: install elan
465467
run: |
@@ -530,6 +532,7 @@ jobs:
530532
token: ${{ secrets.MANUAL_PR_BOT }}
531533
ref: nightly-testing
532534
fetch-depth: 0 # This ensures we check out all tags and branches.
535+
filter: tree:0
533536

534537
- name: Check if tag in reference manual exists
535538
if: steps.workflow-info.outputs.pullRequestNumber != '' && steps.reference-manual-ready.outputs.manual_ready == 'true'

src/Init/Data/ByteArray/Lemmas.lean

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,3 +256,19 @@ theorem ByteArray.copySlice_eq_append {src : ByteArray} {srcOff : Nat} {dest : B
256256
dest.extract 0 destOff ++ src.extract srcOff (srcOff +len) ++ dest.extract (destOff + min len (src.data.size - srcOff)) dest.data.size := by
257257
ext1
258258
simp [copySlice]
259+
260+
@[simp]
261+
theorem ByteArray.data_set {as : ByteArray} {i : Nat} {h : i < as.size} {a : UInt8} :
262+
(as.set i a h).data = as.data.set i a (by simpa) := by
263+
simp [set]
264+
265+
theorem ByteArray.set_eq_push_extract_append_extract {as : ByteArray} {i : Nat} (h : i < as.size) {a : UInt8} :
266+
as.set i a h = (as.extract 0 i).push a ++ as.extract (i + 1) as.size := by
267+
ext1
268+
simpa using Array.set_eq_push_extract_append_extract _
269+
270+
@[simp]
271+
theorem ByteArray.append_toByteArray_singleton {as : ByteArray} {a : UInt8} :
272+
as ++ [a].toByteArray = as.push a := by
273+
ext1
274+
simp

0 commit comments

Comments
 (0)