Skip to content

Commit 6d46ce7

Browse files
authored
Merge branch 'master' into ChebyshevExtremalLC
2 parents d4a03cf + 6dc6d70 commit 6d46ce7

1,166 files changed

Lines changed: 12192 additions & 9319 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/daily.yml

Lines changed: 96 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -33,20 +33,6 @@ jobs:
3333
- name: Checkout branch or tag
3434
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
3535

36-
# this step needs to be run here while we have `mathlib4` checked out,
37-
# or else `gh run view` will try to look for runs in `mathlib4-nightly-testing`
38-
- name: Get URLs
39-
id: urls
40-
env:
41-
GH_TOKEN: ${{ github.token }}
42-
run: |
43-
# adapted from https://cmbuckley.co.uk/blog/2024/04/09/deep-links-to-github-actions-job-logs/
44-
lean4checker_url=$(gh run view ${{ github.run_id }} --json jobs --jq '
45-
.jobs[] | select(.name == "check-lean4checker (${{ matrix.branch_type }})")
46-
| (.url + (.steps[] | select(.name == "Check environments using lean4checker")
47-
| "#step:\(.number):1"))')
48-
echo "lean4checker_url=$lean4checker_url" | tee -a "$GITHUB_OUTPUT"
49-
5036
- name: Fetch latest tags (if nightly)
5137
if: matrix.branch_type == 'nightly'
5238
run: |
@@ -79,7 +65,7 @@ jobs:
7965
use-mathlib-cache: true
8066
reinstall-transient-toolchain: true
8167

82-
- name: Check environments using lean4checker # make sure this name is consistent with "Get URLs"
68+
- name: Check environments using lean4checker # make sure this name is consistent with "Get job status and URLs" in the notify job
8369
id: lean4checker
8470
continue-on-error: true
8571
run: |
@@ -110,8 +96,51 @@ jobs:
11096
# so we explicitly check Batteries as well here.
11197
lake env lean4checker/.lake/build/bin/lean4checker Batteries Mathlib
11298
99+
notify-lean4checker:
100+
runs-on: ubuntu-latest
101+
needs: check-lean4checker
102+
if: github.repository == 'leanprover-community/mathlib4' && always()
103+
strategy:
104+
fail-fast: false
105+
matrix:
106+
branch_type: [master, nightly]
107+
steps:
108+
- name: Checkout repository
109+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
110+
111+
- name: Get job status and URLs
112+
id: get-status
113+
env:
114+
GH_TOKEN: ${{ github.token }}
115+
run: |
116+
JOB_NAME="check-lean4checker (${{ matrix.branch_type }})"
117+
118+
# Get URL to the specific step
119+
LEAN4CHECKER_URL=$(gh run view ${{ github.run_id }} --json jobs --jq \
120+
".jobs[] | select(.name == \"$JOB_NAME\") \
121+
| (.url + (.steps[] | select(.name == \"Check environments using lean4checker\") \
122+
| \"#step:\(.number):1\"))")
123+
124+
echo "lean4checker_url=${LEAN4CHECKER_URL}" | tee -a "$GITHUB_OUTPUT"
125+
126+
- name: Fetch latest tags (if nightly)
127+
if: matrix.branch_type == 'nightly'
128+
run: |
129+
git remote add nightly-testing https://github.com/leanprover-community/mathlib4-nightly-testing.git
130+
git fetch nightly-testing --tags
131+
LATEST_TAG=$(git tag | grep -E "${{ env.TAG_PATTERN }}" | sort -r | head -n 1)
132+
echo "LATEST_TAG=${LATEST_TAG}" | tee -a "$GITHUB_ENV"
133+
134+
- name: Set branch ref
135+
run: |
136+
if [ "${{ matrix.branch_type }}" == "master" ]; then
137+
echo "BRANCH_REF=${{ env.DEFAULT_BRANCH }}" >> "$GITHUB_ENV"
138+
else
139+
echo "BRANCH_REF=${{ env.LATEST_TAG }}" >> "$GITHUB_ENV"
140+
fi
141+
113142
- name: Post success message for lean4checker on Zulip
114-
if: steps.lean4checker.outcome == 'success'
143+
if: needs.check-lean4checker.result == 'success'
115144
uses: zulip/github-actions-zulip/send-message@e4c8f27c732ba9bd98ac6be0583096dea82feea5 # v1.0.2
116145
with:
117146
api-key: ${{ secrets.ZULIP_API_KEY }}
@@ -121,10 +150,10 @@ jobs:
121150
type: 'stream'
122151
topic: 'lean4checker'
123152
content: |
124-
✅ lean4checker [succeeded](${{ steps.urls.outputs.lean4checker_url }}) on ${{ github.sha }} (branch: ${{ env.BRANCH_REF }})
153+
✅ lean4checker [succeeded](${{ steps.get-status.outputs.lean4checker_url }}) on ${{ github.sha }} (branch: ${{ env.BRANCH_REF }})
125154
126155
- name: Post failure / cancelled message for lean4checker on Zulip
127-
if: steps.lean4checker.outcome == 'failure' || steps.lean4checker.outcome == 'cancelled'
156+
if: needs.check-lean4checker.result != 'success'
128157
uses: zulip/github-actions-zulip/send-message@e4c8f27c732ba9bd98ac6be0583096dea82feea5 # v1.0.2
129158
with:
130159
api-key: ${{ secrets.ZULIP_API_KEY }}
@@ -134,7 +163,7 @@ jobs:
134163
type: 'stream'
135164
topic: 'lean4checker failure'
136165
content: |
137-
❌ lean4checker [$${{ steps.lean4checker.outcome }}](${{ steps.urls.outputs.lean4checker_url }}) on ${{ github.sha }} (branch: ${{ env.BRANCH_REF }})
166+
❌ lean4checker [${{ needs.check-lean4checker.result }}](${{ steps.get-status.outputs.lean4checker_url }}) on ${{ github.sha }} (branch: ${{ env.BRANCH_REF }})
138167
139168
check-mathlib_test_executable:
140169
runs-on: ubuntu-latest
@@ -148,20 +177,6 @@ jobs:
148177
- name: Checkout branch or tag
149178
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
150179

151-
# this step needs to be run here while we have `mathlib4` checked out,
152-
# or else `gh run view` will try to look for runs in `mathlib4-nightly-testing`
153-
- name: Get URLs
154-
id: urls
155-
env:
156-
GH_TOKEN: ${{ github.token }}
157-
run: |
158-
# adapted from https://cmbuckley.co.uk/blog/2024/04/09/deep-links-to-github-actions-job-logs/
159-
mathlib_test_executable_url=$(gh run view ${{ github.run_id }} --json jobs --jq '
160-
.jobs[] | select(.name == "check-lean4checker (${{ matrix.branch_type }})")
161-
| (.url + (.steps[] | select(.name == "Run mathlib_test_executable")
162-
| "#step:\(.number):1"))')
163-
echo "mathlib_test_executable_url=$mathlib_test_executable_url" | tee -a "$GITHUB_OUTPUT"
164-
165180
- name: Fetch latest tags (if nightly)
166181
if: matrix.branch_type == 'nightly'
167182
run: |
@@ -194,14 +209,57 @@ jobs:
194209
use-mathlib-cache: true
195210
reinstall-transient-toolchain: true
196211

197-
- name: Run mathlib_test_executable # make sure this name is consistent with "Get URLs"
212+
- name: Run mathlib_test_executable # make sure this name is consistent with "Get job status and URLs" in the notify job
198213
id: mathlib-test
199214
continue-on-error: true
200215
run: |
201216
lake exe mathlib_test_executable
202217
218+
notify-mathlib_test_executable:
219+
runs-on: ubuntu-latest
220+
needs: check-mathlib_test_executable
221+
if: github.repository == 'leanprover-community/mathlib4' && always()
222+
strategy:
223+
fail-fast: false
224+
matrix:
225+
branch_type: [master, nightly]
226+
steps:
227+
- name: Checkout repository
228+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
229+
230+
- name: Get job status and URLs
231+
id: get-status
232+
env:
233+
GH_TOKEN: ${{ github.token }}
234+
run: |
235+
JOB_NAME="check-mathlib_test_executable (${{ matrix.branch_type }})"
236+
237+
# Get URL to the specific step
238+
MATHLIB_TEST_EXECUTABLE_URL=$(gh run view ${{ github.run_id }} --json jobs --jq \
239+
".jobs[] | select(.name == \"$JOB_NAME\") \
240+
| (.url + (.steps[] | select(.name == \"Run mathlib_test_executable\") \
241+
| \"#step:\(.number):1\"))")
242+
243+
echo "mathlib_test_executable_url=${MATHLIB_TEST_EXECUTABLE_URL}" | tee -a "$GITHUB_OUTPUT"
244+
245+
- name: Fetch latest tags (if nightly)
246+
if: matrix.branch_type == 'nightly'
247+
run: |
248+
git remote add nightly-testing https://github.com/leanprover-community/mathlib4-nightly-testing.git
249+
git fetch nightly-testing --tags
250+
LATEST_TAG=$(git tag | grep -E "${{ env.TAG_PATTERN }}" | sort -r | head -n 1)
251+
echo "LATEST_TAG=${LATEST_TAG}" | tee -a "$GITHUB_ENV"
252+
253+
- name: Set branch ref
254+
run: |
255+
if [ "${{ matrix.branch_type }}" == "master" ]; then
256+
echo "BRANCH_REF=${{ env.DEFAULT_BRANCH }}" >> "$GITHUB_ENV"
257+
else
258+
echo "BRANCH_REF=${{ env.LATEST_TAG }}" >> "$GITHUB_ENV"
259+
fi
260+
203261
- name: Post success message for mathlib_test_executable on Zulip
204-
if: steps.mathlib-test.outcome == 'success'
262+
if: needs.check-mathlib_test_executable.result == 'success'
205263
uses: zulip/github-actions-zulip/send-message@e4c8f27c732ba9bd98ac6be0583096dea82feea5 # v1.0.2
206264
with:
207265
api-key: ${{ secrets.ZULIP_API_KEY }}
@@ -211,10 +269,10 @@ jobs:
211269
type: 'stream'
212270
topic: 'mathlib test executable'
213271
content: |
214-
✅ mathlib_test_executable [succeeded](${{ steps.urls.outputs.mathlib_test_executable_url }}) on ${{ github.sha }} (branch: ${{ env.BRANCH_REF }})
272+
✅ mathlib_test_executable [succeeded](${{ steps.get-status.outputs.mathlib_test_executable_url }}) on ${{ github.sha }} (branch: ${{ env.BRANCH_REF }})
215273
216274
- name: Post failure / cancelled message for mathlib_test_executable on Zulip
217-
if: steps.mathlib-test.outcome == 'failure' || steps.mathlib-test.outcome == 'cancelled'
275+
if: needs.check-mathlib_test_executable.result != 'success'
218276
uses: zulip/github-actions-zulip/send-message@e4c8f27c732ba9bd98ac6be0583096dea82feea5 # v1.0.2
219277
with:
220278
api-key: ${{ secrets.ZULIP_API_KEY }}
@@ -224,4 +282,4 @@ jobs:
224282
type: 'stream'
225283
topic: 'mathlib test executable failure'
226284
content: |
227-
❌ mathlib_test_executable [${{ steps.mathlib-test.outcome }}](${{ steps.urls.outputs.mathlib_test_executable_url }}) on ${{ github.sha }} (branch: ${{ env.BRANCH_REF }})
285+
❌ mathlib_test_executable [${{ needs.check-mathlib_test_executable.result }}](${{ steps.get-status.outputs.mathlib_test_executable_url }}) on ${{ github.sha }} (branch: ${{ env.BRANCH_REF }})

Archive/Imo/Imo1994Q1.lean

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,7 @@ theorem imo1994_q1 (n : ℕ) (m : ℕ) (A : Finset ℕ) (hm : #A = m + 1)
6969
by_contra! h : a k + a (rev k) < n + 1
7070
-- We exhibit `k+1` elements of `A` greater than `a (rev k)`
7171
set f : Fin (m + 1) ↪ ℕ :=
72-
fun i => a i + a (rev k), by
73-
apply injective_of_le_imp_le
74-
intro i j hij
75-
rwa [add_le_add_iff_right, a.map_rel_iff] at hij ⟩
72+
fun i => a i + a (rev k), .of_eq_imp_le (a.map_rel_iff.mp <| add_right_cancel · |>.le)⟩
7673
-- Proof that the `f i` are greater than `a (rev k)` for `i ≤ k`
7774
have hf : map f (Icc 0 k) ⊆ map a.toEmbedding (Ioc (rev k) (Fin.last m)) := by
7875
intro x hx

Archive/Imo/Imo2015Q6.lean

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,6 @@ lemma notMem_pool_self : a t ∉ pool a t := by
9696
obtain ⟨u, lu, hu⟩ := exists_add_eq_of_mem_pool h
9797
exact lu.ne (ha.2 hu)
9898

99-
@[deprecated (since := "2025-05-23")] alias not_mem_pool_self := notMem_pool_self
100-
10199
/-- The number of balls stays unchanged if there is a ball with height 0 and increases by 1
102100
otherwise. -/
103101
lemma card_pool_succ : #(pool a (t + 1)) = #(pool a t) + if 0 ∈ pool a t then 0 else 1 := by

Archive/Imo/Imo2019Q2.lean

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,6 @@ theorem Q_notMem_CB : cfg.Q ∉ line[ℝ, cfg.C, cfg.B] := by
229229
or_iff_right cfg.C_ne_Q₁, or_iff_right cfg.sbtw_Q_A₁_Q₁.left_ne_right, angle_comm] at hc
230230
exact cfg.not_collinear_ABC (hc.elim collinear_of_angle_eq_zero collinear_of_angle_eq_pi)
231231

232-
@[deprecated (since := "2025-05-23")] alias Q_not_mem_CB := Q_notMem_CB
233-
234232
theorem Q_ne_B : cfg.Q ≠ cfg.B := by
235233
intro h
236234
have h' := cfg.Q_notMem_CB

Archive/Imo/Imo2024Q5.lean

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,6 @@ lemma MonsterData.notMem_monsterCells_of_fst_eq_zero (m : MonsterData N)
135135
{c : Cell N} (hc : c.1 = 0) : c ∉ m.monsterCells := by
136136
simp [monsterCells, Prod.ext_iff, hc]
137137

138-
@[deprecated (since := "2025-05-23")]
139-
alias MonsterData.not_mem_monsterCells_of_fst_eq_zero :=
140-
MonsterData.notMem_monsterCells_of_fst_eq_zero
141-
142138
lemma MonsterData.le_N_of_mem_monsterCells {m : MonsterData N} {c : Cell N}
143139
(hc : c ∈ m.monsterCells) : (c.1 : ℕ) ≤ N := by
144140
simp only [monsterCells, Set.mem_range, Subtype.exists, Set.mem_Icc] at hc

Archive/Wiedijk100Theorems/AscendingDescendingSequences.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ By combining the previous two lemmas, we see that since `f` is injective, the pa
120120
must also be unique.
121121
-/
122122
private lemma paired_injective (hf : Injective f) : Injective (paired f) := by
123-
apply injective_of_lt_imp_ne
123+
apply Injective.of_lt_imp_ne
124124
intro i j hij q
125125
cases lt_or_gt_of_ne (hf.ne hij.ne)
126126
case inl h => exact (maxIncSequencesTo_lt hij h).ne congr($q.1)

Cache/IO.lean

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -459,10 +459,10 @@ Return tuples of the form ("module name", "path to .lean file").
459459
460460
The input string `arg` takes one of the following forms:
461461
462-
1. `Mathlib.Algebra.Fields.Basic`: there exists such a Lean file
463-
2. `Mathlib.Algebra.Fields`: no Lean file exists but a folder (TODO)
464-
3. `Mathlib/Algebra/Fields/Basic.lean`: the file exists (note potentially `\` on Windows)
465-
4. `Mathlib/Algebra/Fields/`: the folder exists (TODO)
462+
1. `Mathlib.Algebra.Field.Basic`: there exists such a Lean file
463+
2. `Mathlib.Algebra.Field`: no Lean file exists but a folder (TODO)
464+
3. `Mathlib/Algebra/Field/Basic.lean`: the file exists (note potentially `\` on Windows)
465+
4. `Mathlib/Algebra/Field/`: the folder exists (TODO)
466466
467467
Not supported yet:
468468

Counterexamples/CliffordAlgebraNotInjective.lean

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,6 @@ theorem X_Y_Z_notMem_kIdeal : (X * Y * Z : MvPolynomial (Fin 3) (ZMod 2)) ∉ kI
6262
← Finsupp.equivFunOnFinite_symm_eq_sum] at h
6363
contradiction
6464

65-
@[deprecated (since := "2025-05-23")] alias X_Y_Z_not_mem_kIdeal := X_Y_Z_notMem_kIdeal
66-
6765
theorem mul_self_mem_kIdeal_of_X_Y_Z_mul_mem {x : MvPolynomial (Fin 3) (ZMod 2)}
6866
(h : X * Y * Z * x ∈ kIdeal) : x * x ∈ kIdeal := by
6967
rw [mem_kIdeal_iff] at h

Counterexamples/NowhereDifferentiable.lean

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ theorem lt_seq {b : ℝ} (hb : 0 < b) (x : ℝ) (m : ℕ) : x < seq b x m := by
103103

104104
theorem le_seq {b : ℝ} (hb : 0 < b) (x : ℝ) (m : ℕ) : x ≤ seq b x m := (lt_seq hb x m).le
105105

106-
theorem seq_le {b : ℝ} (hb : 0 < b) (x : ℝ) (m : ℕ) : seq b x m ≤ x + (3 / 2) * b⁻¹ ^ m := by
106+
theorem seq_le {b : ℝ} (hb : 0 < b) (x : ℝ) (m : ℕ) : seq b x m ≤ x + (3 / 2) * b⁻¹ ^ m := by
107107
grw [seq, Int.floor_le]
108108
simp [field]
109109

@@ -235,13 +235,13 @@ theorem weierstrass_slope {a : ℝ} (ha : a ∈ Set.Ioo 0 1) {b : ℕ} (hb : Odd
235235
|seq b x m - x| * ((2 / 3 - π / (a * b - 1)) * (a * b) ^ m) ≤
236236
|weierstrass a b (seq b x m) - weierstrass a b x| := by
237237
simp_rw [weierstrass]
238-
obtain hsseq := summable_weierstrass ha b (seq b x m)
239-
obtain hsx := summable_weierstrass ha b x
240-
obtain hsum := hsseq.sub hsx
238+
have hsseq := summable_weierstrass ha b (seq b x m)
239+
have hsx := summable_weierstrass ha b x
240+
have hsum := hsseq.sub hsx
241241
rw [← hsseq.tsum_sub hsx]
242242
simp_rw [← mul_sub] at ⊢ hsum
243243
rw [← hsum.sum_add_tsum_nat_add m]
244-
obtain hsum_shift := (summable_nat_add_iff m).mpr hsum
244+
have hsum_shift := (summable_nat_add_iff m).mpr hsum
245245
rw [add_comm]
246246
refine le_trans ?_ (abs_sub_abs_le_abs_add _ _)
247247
rw [sub_mul (2 / 3), mul_sub |seq b x m - x|]
@@ -263,7 +263,7 @@ theorem not_differentiableAt_weierstrass
263263
atTop (𝓝 (f' 1)) := by
264264
convert (h.lim_real 1).comp (tendsto_seq_sub_inv hb1 x)
265265
simp
266-
obtain h := (continuous_abs.tendsto _).comp this
266+
have h := (continuous_abs.tendsto _).comp this
267267
contrapose! h
268268
apply not_tendsto_nhds_of_tendsto_atTop
269269
-- To show the absolute value of slope tends to ∞, it suffices to show its lower bound does.

Counterexamples/SorgenfreyLine.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,8 @@ theorem isClopen_Ico (a b : ℝₗ) : IsClopen (Ico a b) :=
155155

156156
instance : TotallyDisconnectedSpace ℝₗ :=
157157
fun _ _ hs x hx y hy =>
158-
le_antisymm (hs.subset_isClopen (isClopen_Ici x) ⟨x, hx, left_mem_Ici⟩ hy)
159-
(hs.subset_isClopen (isClopen_Ici y) ⟨y, hy, left_mem_Ici⟩ hx)⟩
158+
le_antisymm (hs.subset_isClopen (isClopen_Ici x) ⟨x, hx, self_mem_Ici⟩ hy)
159+
(hs.subset_isClopen (isClopen_Ici y) ⟨y, hy, self_mem_Ici⟩ hx)⟩
160160

161161
instance : FirstCountableTopology ℝₗ :=
162162
fun x => (nhds_basis_Ico_rat x).isCountablyGenerated⟩
@@ -221,7 +221,7 @@ theorem isClosed_of_subset_antidiagonal {s : Set (ℝₗ × ℝₗ)} {c : ℝₗ
221221
obtain rfl : x + y = c := by
222222
change (x, y) ∈ {p : ℝₗ × ℝₗ | p.1 + p.2 = c}
223223
exact closure_minimal (hs : s ⊆ {x | x.1 + x.2 = c}) (isClosed_antidiagonal c) H
224-
rcases mem_closure_iff.1 H (Ici (x, y)) (isClopen_Ici_prod _).2 left_mem_Ici with
224+
rcases mem_closure_iff.1 H (Ici (x, y)) (isClopen_Ici_prod _).2 self_mem_Ici with
225225
⟨⟨x', y'⟩, ⟨hx : x ≤ x', hy : y ≤ y'⟩, H⟩
226226
convert H
227227
· refine hx.antisymm ?_

0 commit comments

Comments
 (0)