Skip to content

Commit 23ce08e

Browse files
committed
Merge branch 'master' into IsSemitopologicalRing
2 parents 8d353c1 + 200d792 commit 23ce08e

671 files changed

Lines changed: 12123 additions & 4272 deletions

File tree

Some content is hidden

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

.github/workflows/build_template.yml

Lines changed: 54 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ jobs:
122122
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
123123
with:
124124
ref: ${{ inputs.pr_branch_ref }}
125+
fetch-depth: 2 # we may fetch cache from the commit before this one (or earlier)
125126
path: pr-branch
126127

127128
- name: Prepare DownstreamTest directory
@@ -337,21 +338,66 @@ jobs:
337338
338339
- name: get cache (3/3 - finalize cache operation)
339340
id: get
340-
shell: bash # only runs `cache get` from `tools-branch`, so doesn't need to be inside landrun
341+
shell: bash # only runs git and `cache get` from `tools-branch`, so doesn't need to be inside landrun
342+
env:
343+
BEFORE_SHA: ${{ github.event.before || '' }}
344+
BASE_SHA: ${{ github.event.pull_request.base.sha || '' }}
345+
CACHE_REPO: ${{ github.event.pull_request.head.repo.full_name || github.repository }}
341346
run: |
342347
cd pr-branch
343-
if [[ "${{ steps.get_cache_part2_test.outcome }}" == "success" ]]; then
344-
echo "Fetching all remaining cache..."
348+
if [[ "${{ steps.get_cache_part2_test.outcome }}" != "success" ]]; then
349+
echo "WARNING: 'lake build --no-build -v Mathlib.Init' failed."
350+
echo "No cache for 'Mathlib.Init' available or it could not be prepared."
351+
exit 0
352+
fi
345353
346-
../tools-branch/.lake/build/bin/cache --skip-proofwidgets get
354+
ORIG_SHA="$(git rev-parse HEAD)"
355+
PREV_SHA=""
356+
PREV_SHA_SOURCE=""
347357
348-
# Run again with --repo, to ensure we actually get the oleans.
349-
../tools-branch/.lake/build/bin/cache --repo=${{ github.event.pull_request.head.repo.full_name || github.repository }} --skip-proofwidgets get
358+
# When a ref is newly created, github.event.before can be all-zero.
359+
if [[ "$BEFORE_SHA" =~ ^0{40}$ ]]; then
360+
BEFORE_SHA=""
361+
fi
362+
363+
if [[ -n "$BEFORE_SHA" ]]; then
364+
PREV_SHA="$BEFORE_SHA"
365+
PREV_SHA_SOURCE="github.event.before"
366+
elif [[ -n "$BASE_SHA" ]]; then
367+
PREV_SHA="$BASE_SHA"
368+
PREV_SHA_SOURCE="pull_request.base.sha"
350369
else
351-
echo "WARNING: 'lake build --no-build -v Mathlib.Init' failed."
352-
echo "No cache for 'Mathlib.Init' available or it could not be prepared."
370+
PREV_SHA="$(git rev-parse --verify --quiet HEAD^ || true)"
371+
if [[ -n "$PREV_SHA" ]]; then
372+
PREV_SHA_SOURCE="HEAD^"
373+
fi
353374
fi
354375
376+
if [[ -n "$PREV_SHA" ]]; then
377+
# cf. https://leanprover.zulipchat.com/#narrow/channel/287929-mathlib4/topic/Mathlib.20has.20moved.20to.20the.20new.20module.20system/near/563452000
378+
echo "Warming up cache using previous commit: $PREV_SHA (source: $PREV_SHA_SOURCE)"
379+
if git cat-file -e "$PREV_SHA^{commit}" 2>/dev/null || git fetch --no-tags --depth=1 origin "$PREV_SHA"; then
380+
git checkout "$PREV_SHA"
381+
../tools-branch/.lake/build/bin/cache --skip-proofwidgets get
382+
# Run again with --repo, to ensure we actually get the oleans.
383+
../tools-branch/.lake/build/bin/cache --repo="$CACHE_REPO" --skip-proofwidgets get
384+
385+
echo "Switching back to branch head"
386+
git checkout "$ORIG_SHA"
387+
else
388+
echo "Could not fetch $PREV_SHA; skipping parent warmup cache fetch."
389+
fi
390+
else
391+
echo "No previous commit candidate found; skipping parent warmup cache fetch."
392+
fi
393+
394+
echo "Fetching all remaining cache..."
395+
396+
../tools-branch/.lake/build/bin/cache --skip-proofwidgets get
397+
398+
# Run again with --repo, to ensure we actually get the oleans.
399+
../tools-branch/.lake/build/bin/cache --repo="$CACHE_REPO" --skip-proofwidgets get
400+
355401
- name: fetch ProofWidgets release
356402
# We need network access for ProofWidgets frontend assets.
357403
# Run inside landrun so PR-controlled code remains sandboxed.

.github/workflows/maintainer_bors_wf_run.yml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,21 @@ jobs:
6969
- name: Select bridge or legacy inputs
7070
id: inputs
7171
if: ${{ steps.bridge.outputs.pr_number != '' || steps.legacy.outputs.pr_number != '' }}
72+
env:
73+
INPUT_AUTHOR: ${{ steps.bridge.outputs.author }}${{ steps.legacy.outputs.author }}
74+
INPUT_PR_NUMBER: ${{ steps.bridge.outputs.pr_number }}${{ steps.legacy.outputs.pr_number }}
75+
INPUT_BOT: ${{ steps.bridge.outputs.bot }}${{ steps.legacy.outputs.bot }}
76+
INPUT_REMOVE_LABELS: ${{ steps.bridge.outputs.removeLabels }}${{ steps.legacy.outputs.removeLabels }}
77+
INPUT_MORD: ${{ steps.bridge.outputs.mOrD }}${{ steps.legacy.outputs.mOrD }}
78+
INPUT_SOURCE: ${{ steps.bridge.outputs.pr_number != '' && 'bridge' || (steps.legacy.outputs.pr_number != '' && 'legacy' || 'none') }}
7279
run: |
7380
{
74-
echo "author=${{ steps.bridge.outputs.author }}${{ steps.legacy.outputs.author }}"
75-
echo "pr_number=${{ steps.bridge.outputs.pr_number }}${{ steps.legacy.outputs.pr_number }}"
76-
echo "bot=${{ steps.bridge.outputs.bot }}${{ steps.legacy.outputs.bot }}"
77-
echo "removeLabels=${{ steps.bridge.outputs.removeLabels }}${{ steps.legacy.outputs.removeLabels }}"
78-
echo "mOrD=${{ steps.bridge.outputs.mOrD }}${{ steps.legacy.outputs.mOrD }}"
79-
echo "input_source=${{ steps.bridge.outputs.pr_number != '' && 'bridge' || (steps.legacy.outputs.pr_number != '' && 'legacy' || 'none') }}"
81+
echo "author=${INPUT_AUTHOR}"
82+
echo "pr_number=${INPUT_PR_NUMBER}"
83+
echo "bot=${INPUT_BOT}"
84+
echo "removeLabels=${INPUT_REMOVE_LABELS}"
85+
echo "mOrD=${INPUT_MORD}"
86+
echo "input_source=${INPUT_SOURCE}"
8087
} | tee -a "$GITHUB_OUTPUT"
8188
8289
- name: Note legacy artifact fallback
@@ -182,6 +189,7 @@ jobs:
182189
if: ${{ ! steps.inputs.outputs.mOrD == '' &&
183190
( steps.user_permission.outputs.require-result == 'true' ||
184191
steps.inputs.outputs.bot == 'true' ) }}
192+
continue-on-error: true
185193
env:
186194
ZULIP_API_KEY: ${{ secrets.ZULIP_API_KEY }}
187195
ZULIP_EMAIL: github-mathlib4-bot@leanprover.zulipchat.com

.github/workflows/maintainer_merge_wf_run.yml

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -73,18 +73,28 @@ jobs:
7373
- name: Select bridge or legacy inputs
7474
id: inputs
7575
if: ${{ steps.bridge.outputs.pr_number != '' || steps.legacy.outputs.pr_number != '' }}
76+
env:
77+
INPUT_AUTHOR: ${{ steps.bridge.outputs.author }}${{ steps.legacy.outputs.author }}
78+
INPUT_PR_AUTHOR: ${{ steps.bridge.outputs.pr_author }}${{ steps.legacy.outputs.pr_author }}
79+
INPUT_PR_NUMBER: ${{ steps.bridge.outputs.pr_number }}${{ steps.legacy.outputs.pr_number }}
80+
INPUT_PR_TITLE: ${{ steps.bridge.outputs.pr_title }}${{ steps.legacy.outputs.pr_title }}
81+
INPUT_PR_URL: ${{ steps.bridge.outputs.pr_url }}${{ steps.legacy.outputs.pr_url }}
82+
INPUT_EVENT_NAME: ${{ steps.bridge.outputs.event_name }}${{ steps.legacy.outputs.event_name }}
83+
INPUT_MORD: ${{ steps.bridge.outputs.mOrD }}${{ steps.legacy.outputs.mOrD }}
84+
INPUT_SOURCE: ${{ steps.bridge.outputs.pr_number != '' && 'bridge' || (steps.legacy.outputs.pr_number != '' && 'legacy' || 'none') }}
85+
INPUT_COMMENT: ${{ steps.bridge.outputs.comment }}${{ steps.legacy.outputs.comment }}
7686
run: |
7787
{
78-
echo "author=${{ steps.bridge.outputs.author }}${{ steps.legacy.outputs.author }}"
79-
echo "pr_author=${{ steps.bridge.outputs.pr_author }}${{ steps.legacy.outputs.pr_author }}"
80-
echo "pr_number=${{ steps.bridge.outputs.pr_number }}${{ steps.legacy.outputs.pr_number }}"
81-
echo "pr_title=${{ steps.bridge.outputs.pr_title }}${{ steps.legacy.outputs.pr_title }}"
82-
echo "pr_url=${{ steps.bridge.outputs.pr_url }}${{ steps.legacy.outputs.pr_url }}"
83-
echo "event_name=${{ steps.bridge.outputs.event_name }}${{ steps.legacy.outputs.event_name }}"
84-
echo "mOrD=${{ steps.bridge.outputs.mOrD }}${{ steps.legacy.outputs.mOrD }}"
85-
echo "input_source=${{ steps.bridge.outputs.pr_number != '' && 'bridge' || (steps.legacy.outputs.pr_number != '' && 'legacy' || 'none') }}"
88+
echo "author=${INPUT_AUTHOR}"
89+
echo "pr_author=${INPUT_PR_AUTHOR}"
90+
echo "pr_number=${INPUT_PR_NUMBER}"
91+
echo "pr_title=${INPUT_PR_TITLE}"
92+
echo "pr_url=${INPUT_PR_URL}"
93+
echo "event_name=${INPUT_EVENT_NAME}"
94+
echo "mOrD=${INPUT_MORD}"
95+
echo "input_source=${INPUT_SOURCE}"
8696
} | tee -a "$GITHUB_OUTPUT"
87-
printf 'comment<<EOF\n%s\nEOF\n' "${{ steps.bridge.outputs.comment }}${{ steps.legacy.outputs.comment }}" | tee -a "$GITHUB_OUTPUT"
97+
printf 'comment<<EOF\n%s\nEOF\n' "${INPUT_COMMENT}" | tee -a "$GITHUB_OUTPUT"
8898
8999
- name: Note legacy artifact fallback
90100
if: ${{ steps.inputs.outputs.input_source == 'legacy' }}
@@ -139,7 +149,7 @@ jobs:
139149
then
140150
legacy_suffix=" (legacy)"
141151
fi
142-
metadata=$'trigger_name: ['"${trigger_name}"$']('"${trigger_run_url}"$')\nwf_run: [workflow_run]('"${wf_run_url}"$')'"${legacy_suffix}"
152+
metadata=$'['"${trigger_name}"$']('"${trigger_run_url}"$'), [wf_run]('"${wf_run_url}"$')'"${legacy_suffix}"
143153
message="${message}"$'\n\n---\n'"${metadata}"
144154
printf 'title<<EOF\n%s\nEOF' "${message}" | tee "$GITHUB_OUTPUT"
145155
env:
@@ -153,6 +163,7 @@ jobs:
153163

154164
- name: Send message on Zulip
155165
if: ${{ steps.actorTeams.outputs.isTeamMember == 'true' }}
166+
continue-on-error: true
156167
uses: zulip/github-actions-zulip/send-message@e4c8f27c732ba9bd98ac6be0583096dea82feea5 # v1.0.2
157168
with:
158169
api-key: ${{ secrets.ZULIP_API_KEY }}
@@ -176,12 +187,13 @@ jobs:
176187
then
177188
legacy_suffix=" (legacy)"
178189
fi
179-
metadata=$'trigger_name: ['"${trigger_name}"$']('"${trigger_run_url}"$')\nwf_run: [workflow_run]('"${wf_run_url}"$')'"${legacy_suffix}"
190+
metadata=$'['"${trigger_name}"$']('"${trigger_run_url}"$'), [wf_run]('"${wf_run_url}"$')'"${legacy_suffix}"
180191
body="${body}"$'\n\n---\n'"${metadata}"
181192
printf 'body<<EOF\n%s\nEOF\n' "${body}" | tee -a "$GITHUB_OUTPUT"
182193
183194
- name: Add comment to PR
184195
if: ${{ steps.actorTeams.outputs.isTeamMember == 'true' }}
196+
continue-on-error: true
185197
uses: GrantBirki/comment@608e41b19bc973020ec0e189ebfdae935d7fe0cc # v2.1.1
186198
with:
187199
# if a comment triggers the action, then `issue.number` is set
@@ -202,6 +214,7 @@ jobs:
202214

203215
- name: Add label to PR
204216
if: ${{ steps.actorTeams.outputs.isTeamMember == 'true' }}
217+
continue-on-error: true
205218
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
206219
with:
207220
# labels added by GITHUB_TOKEN won't trigger the Zulip emoji workflow

.github/workflows/zulip_emoji_ci_status.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ jobs:
9898
9999
- name: Update CI emoji
100100
if: steps.pr.outputs.skip != 'true' && steps.action.outputs.ci_action != 'skip'
101+
continue-on-error: true
101102
env:
102103
ZULIP_API_KEY: ${{ secrets.ZULIP_API_KEY }}
103104
ZULIP_EMAIL: github-mathlib4-bot@leanprover.zulipchat.com

.github/workflows/zulip_emoji_closed_pr.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ jobs:
6161
- name: Update zulip emoji reactions
6262
if: ${{ ! startsWith(github.event.pull_request.title, '[Merged by Bors]') ||
6363
github.event_name == 'reopened' }}
64+
continue-on-error: true
6465
env:
6566
ZULIP_API_KEY: ${{ secrets.ZULIP_API_KEY }}
6667
ZULIP_EMAIL: github-mathlib4-bot@leanprover.zulipchat.com

.github/workflows/zulip_emoji_labelling.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ jobs:
3737
pip install -r "$CI_SCRIPTS_DIR/zulip/requirements.txt"
3838
3939
- name: Add or remove emoji
40+
continue-on-error: true # Emoji updates are cosmetic; never fail CI over them
4041
env:
4142
ZULIP_API_KEY: ${{ secrets.ZULIP_API_KEY }}
4243
ZULIP_EMAIL: github-mathlib4-bot@leanprover.zulipchat.com

.github/workflows/zulip_emoji_merge_delegate.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ jobs:
4040
pip install -r "$CI_SCRIPTS_DIR/zulip/requirements.txt"
4141
4242
- name: Update zulip emoji reactions
43+
continue-on-error: true # Emoji updates are cosmetic; never fail CI over them
4344
env:
4445
ZULIP_API_KEY: ${{ secrets.ZULIP_API_KEY }}
4546
ZULIP_EMAIL: github-mathlib4-bot@leanprover.zulipchat.com

Archive/Imo/Imo1988Q6.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ theorem constant_descent_vieta_jumping (x y : ℕ) {claim : Prop} {H : ℕ →
128128
-- Let m be the smallest element of the nonempty set S.
129129
let m : ℕ := WellFounded.min Nat.lt_wfRel.wf S S_nonempty
130130
have m_mem : m ∈ S := WellFounded.min_mem Nat.lt_wfRel.wf S S_nonempty
131-
have m_min : ∀ k ∈ S, ¬k < m := fun k hk => WellFounded.not_lt_min Nat.lt_wfRel.wf S S_nonempty hk
131+
have m_min : ∀ k ∈ S, ¬k < m := fun k hk => WellFounded.not_lt_min Nat.lt_wfRel.wf S hk
132132
-- It suffices to show that there is point (a,b) with b ∈ S and b < m.
133133
rsuffices ⟨p', p'_mem, p'_small⟩ : ∃ p' : ℕ × ℕ, p'.2 ∈ S ∧ p'.2 < m
134134
· solve_by_elim

Cache/IO.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def CURLBIN :=
8181

8282
/-- leantar version at https://github.com/digama0/leangz -/
8383
def LEANTARVERSION :=
84-
"0.1.16"
84+
"0.1.17"
8585

8686
def EXE := if System.Platform.isWindows then ".exe" else ""
8787

Counterexamples/AharoniKorman.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -892,7 +892,7 @@ lemma x0y0_min (z : ℕ × ℕ) (hC : IsChain (· ≤ ·) C) (h : embed (n + 1)
892892
have : (C ∩ level (n + 1)).Nonempty := ⟨_, h, by simp [level_eq_range]⟩
893893
refine hC.le_of_not_gt h (x0y0_mem this) ?_
894894
rw [x0y0, dif_pos this, OrderEmbedding.lt_iff_lt]
895-
exact wellFounded_lt.not_lt_min {x | embed (n + 1) x ∈ C} ?_ h
895+
exact wellFounded_lt.not_lt_min {x | embed (n + 1) x ∈ C} h
896896

897897
/--
898898
Given a subset `C` of the Hollom partial order, and an index `n`, find the smallest element of

0 commit comments

Comments
 (0)