Skip to content

Commit 9d7c38f

Browse files
Trigger CI for leanprover/lean4#5542
2 parents 9a37970 + bbd5da4 commit 9d7c38f

File tree

883 files changed

+16157
-6431
lines changed

Some content is hidden

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

883 files changed

+16157
-6431
lines changed

Diff for: .github/build.in.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,8 @@ jobs:
133133
run: |
134134
rm -rf .lake/build/lib/Mathlib/
135135
# Fail quickly if the cache is completely cold, by checking for Mathlib.Init
136-
lake exe cache get Mathlib.Init
137-
lake build --no-build Mathlib.Init && lake exe cache get || echo "No cache for 'Mathlib.Init' available"
136+
lake exe cache get #Mathlib.Init
137+
#lake build --no-build Mathlib.Init && lake exe cache get || echo "No cache for 'Mathlib.Init' available"
138138
139139
- name: update {Mathlib, Tactic, Counterexamples, Archive}.lean
140140
id: mk_all

Diff for: .github/workflows/PR_summary.yml

+17-2
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,27 @@ jobs:
5555
PR="${{ github.event.pull_request.number }}"
5656
title="### PR summary"
5757
58+
graphAndHighPercentReports=$(python ./scripts/import-graph-report.py base.json head.json changed_files.txt)
59+
5860
## Import count comment
5961
importCount=$(
60-
python ./scripts/import-graph-report.py base.json head.json changed_files.txt
62+
printf '%s\n' "${graphAndHighPercentReports}" | sed '/^Import changes exceeding/Q'
6163
./scripts/import_trans_difference.sh
6264
)
6365
66+
## High percentage imports
67+
high_percentages=$(
68+
printf '%s\n' "${graphAndHighPercentReports}" | sed -n '/^Import changes exceeding/,$p'
69+
)
70+
# if there are files with large increase in transitive imports, then we add the `large-import` label
71+
if [ -n "${high_percentages}" ]
72+
then
73+
high_percentages=$'\n\n'"${high_percentages}"
74+
gh pr edit "${PR}" --add-label large-import
75+
else # otherwise, we remove the label
76+
gh pr edit "${PR}" --remove-label large-import
77+
fi
78+
6479
if [ "$(printf '%s' "${importCount}" | wc -l)" -gt 12 ]
6580
then
6681
importCount="$(printf '<details><summary>\n\n%s\n\n</summary>\n\n%s\n\n</details>\n' "#### Import changes for modified files" "${importCount}")"
@@ -80,6 +95,6 @@ jobs:
8095
currentHash="$(git rev-parse HEAD)"
8196
hashURL="https://github.com/${{ github.repository }}/pull/${{ github.event.pull_request.number }}/commits/${currentHash}"
8297
83-
message="$(printf '%s [%s](%s)\n\n%s\n\n---\n\n%s\n' "${title}" "$(git rev-parse --short HEAD)" "${hashURL}" "${importCount}" "${declDiff}")"
98+
message="$(printf '%s [%s](%s)%s\n\n%s\n\n---\n\n%s\n' "${title}" "$(git rev-parse --short HEAD)" "${hashURL}" "${high_percentages}" "${importCount}" "${declDiff}")"
8499
85100
./scripts/update_PR_comment.sh "${message}" "${title}" "${PR}"

Diff for: .github/workflows/bors.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,8 @@ jobs:
143143
run: |
144144
rm -rf .lake/build/lib/Mathlib/
145145
# Fail quickly if the cache is completely cold, by checking for Mathlib.Init
146-
lake exe cache get Mathlib.Init
147-
lake build --no-build Mathlib.Init && lake exe cache get || echo "No cache for 'Mathlib.Init' available"
146+
lake exe cache get #Mathlib.Init
147+
#lake build --no-build Mathlib.Init && lake exe cache get || echo "No cache for 'Mathlib.Init' available"
148148
149149
- name: update {Mathlib, Tactic, Counterexamples, Archive}.lean
150150
id: mk_all

Diff for: .github/workflows/build.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,8 @@ jobs:
150150
run: |
151151
rm -rf .lake/build/lib/Mathlib/
152152
# Fail quickly if the cache is completely cold, by checking for Mathlib.Init
153-
lake exe cache get Mathlib.Init
154-
lake build --no-build Mathlib.Init && lake exe cache get || echo "No cache for 'Mathlib.Init' available"
153+
lake exe cache get #Mathlib.Init
154+
#lake build --no-build Mathlib.Init && lake exe cache get || echo "No cache for 'Mathlib.Init' available"
155155
156156
- name: update {Mathlib, Tactic, Counterexamples, Archive}.lean
157157
id: mk_all

Diff for: .github/workflows/build_fork.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,8 @@ jobs:
147147
run: |
148148
rm -rf .lake/build/lib/Mathlib/
149149
# Fail quickly if the cache is completely cold, by checking for Mathlib.Init
150-
lake exe cache get Mathlib.Init
151-
lake build --no-build Mathlib.Init && lake exe cache get || echo "No cache for 'Mathlib.Init' available"
150+
lake exe cache get #Mathlib.Init
151+
#lake build --no-build Mathlib.Init && lake exe cache get || echo "No cache for 'Mathlib.Init' available"
152152
153153
- name: update {Mathlib, Tactic, Counterexamples, Archive}.lean
154154
id: mk_all

Diff for: .github/workflows/lean4checker.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ jobs:
7070
run: |
7171
git clone https://github.com/leanprover/lean4checker
7272
cd lean4checker
73-
git checkout v4.12.0-rc1
73+
git checkout v4.13.0-rc3
7474
# Now that the git hash is embedded in each olean,
7575
# we need to compile lean4checker on the same toolchain
7676
cp ../lean-toolchain .

Diff for: .github/workflows/nightly_detect_failure.yml

+10-20
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ jobs:
2323
topic: 'Mathlib status updates'
2424
content: |
2525
❌ The latest CI for Mathlib's branch#nightly-testing has [failed](https://github.com/${{ github.repository }}/actions/runs/${{ github.event.workflow_run.id }}) ([${{ github.sha }}](https://github.com/${{ github.repository }}/commit/${{ github.sha }})).
26+
You can `git fetch; git checkout nightly-testing` and push a fix.
2627
2728
handle_success:
2829
if: ${{ github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.head_branch == 'nightly-testing' }}
@@ -211,25 +212,14 @@ jobs:
211212
payload = f"🛠️: it looks like it's time to create a new bump/nightly-{current_version} branch from nightly-testing (specifically {sha}), and then PR that to {bump_branch}. "
212213
payload += "To do so semi-automatically, run the following script from mathlib root:\n\n"
213214
payload += f"```bash\n./scripts/create-adaptation-pr.sh --bumpversion={bump_branch_suffix} --nightlydate={current_version} --nightlysha={sha}\n```\n"
214-
# Only post if the message is different
215-
# We compare the first 160 characters, since that includes the date and bump version
216-
if not messages or messages[0]['content'][:160] != payload[:160]:
217-
# Log messages, because the bot seems to repeat itself...
218-
if messages:
219-
print("###### Last message:")
220-
print(messages[0]['content'])
221-
print("###### Current message:")
222-
print(payload)
223-
else:
224-
print('The strings match!')
225-
# Post the reminder message
226-
request = {
227-
'type': 'stream',
228-
'to': 'nightly-testing',
229-
'topic': 'Mathlib bump branch reminders',
230-
'content': payload
231-
}
232-
result = client.send_message(request)
233-
print(result)
215+
# Post the reminder message
216+
request = {
217+
'type': 'stream',
218+
'to': 'nightly-testing',
219+
'topic': 'Mathlib bump branch reminders',
220+
'content': payload
221+
}
222+
result = client.send_message(request)
223+
print(result)
234224
else:
235225
print('No action needed.')

Diff for: .github/workflows/update_dependencies_zulip.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
});
4141
}
4242
} else {
43-
output += "No PR found for this run!";
43+
output += "No PR found for this run! If you are feeling impatient and have write access, please go to the following page and click the "Run workflow" button!\nhttps://github.com/leanprover-community/mathlib4/actions/workflows/update_dependencies.yml";
4444
}
4545
return output;
4646

Diff for: .vscode/deprecated-alias.code-snippets renamed to .vscode/deprecated.code-snippets

+7
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
{
2+
"Deprecation for mathlib": {
3+
"scope": "lean4",
4+
"prefix": "deprecated",
5+
"body": [
6+
"@[deprecated $1 (since := \"${CURRENT_YEAR}-${CURRENT_MONTH}-${CURRENT_DATE}\")]"
7+
]
8+
},
29
"Deprecated alias for mathlib": {
310
"scope": "lean4",
411
"prefix": "deprecated alias",

Diff for: Archive/Imo/Imo1962Q1.lean

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ lemma case_more_digits {c n : ℕ} (hc : (digits 10 c).length ≥ 6) (hpp : Prob
107107
calc
108108
n ≥ 10 * c := le.intro hpp.left.symm
109109
_ ≥ 10 ^ (digits 10 c).length := base_pow_length_digits_le 10 c (by decide) hnz
110-
_ ≥ 10 ^ 6 := pow_le_pow_right (by decide) hc
110+
_ ≥ 10 ^ 6 := pow_right_mono₀ (by decide) hc
111111
_ ≥ 153846 := by norm_num
112112

113113
/-!

Diff for: Archive/Imo/Imo1972Q5.lean

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ theorem imo1972_q5 (f g : ℝ → ℝ) (hf1 : ∀ x, ∀ y, f (x + y) + f (x - y
5050
calc
5151
0 < ‖f x‖ := norm_pos_iff.mpr hx
5252
_ ≤ k := hk₁ x
53-
rw [div_lt_iff]
53+
rw [div_lt_iff]
5454
· apply lt_mul_of_one_lt_right h₁ hneg
5555
· exact zero_lt_one.trans hneg
5656
-- Demonstrate that `k ≤ k'` using `hk₂`.
@@ -87,7 +87,7 @@ theorem imo1972_q5' (f g : ℝ → ℝ) (hf1 : ∀ x, ∀ y, f (x + y) + f (x -
8787
have h : ∀ x, ‖f x‖ ≤ k := le_ciSup hf2
8888
have hgy : 0 < ‖g y‖ := by linarith
8989
have k_pos : 0 < k := lt_of_lt_of_le (norm_pos_iff.mpr hx) (h x)
90-
have : k / ‖g y‖ < k := (div_lt_iff hgy).mpr (lt_mul_of_one_lt_right k_pos H)
90+
have : k / ‖g y‖ < k := (div_lt_iff hgy).mpr (lt_mul_of_one_lt_right k_pos H)
9191
have : k ≤ k / ‖g y‖ := by
9292
suffices ∀ x, ‖f x‖ ≤ k / ‖g y‖ from ciSup_le this
9393
intro x

Diff for: Archive/Imo/Imo1986Q5.lean

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ theorem map_of_lt_two (hx : x < 2) : f x = 2 / (2 - x) := by
5454
have hx' : 0 < 2 - x := tsub_pos_of_lt hx
5555
have hfx : f x ≠ 0 := hf.map_ne_zero_iff.2 hx
5656
apply le_antisymm
57-
· rw [le_div_iff₀ hx', ← NNReal.le_div_iff' hfx, tsub_le_iff_right, ← hf.map_eq_zero,
57+
· rw [le_div_iff₀ hx', ← le_div_iff' hfx.bot_lt, tsub_le_iff_right, ← hf.map_eq_zero,
5858
hf.map_add, div_mul_cancel₀ _ hfx, hf.map_two, zero_mul]
5959
· rw [div_le_iff₀' hx', ← hf.map_eq_zero]
6060
refine (mul_eq_zero.1 ?_).resolve_right hfx

Diff for: Archive/Imo/Imo2006Q5.lean

+1-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ theorem Polynomial.iterate_comp_sub_X_ne {P : Polynomial ℤ} (hP : 1 < P.natDeg
122122
(hk : 0 < k) : P.comp^[k] X - X ≠ 0 := by
123123
rw [sub_ne_zero]
124124
apply_fun natDegree
125-
simpa using (one_lt_pow hP hk.ne').ne'
125+
simpa using (one_lt_pow hP hk.ne').ne'
126126

127127
/-- We solve the problem for the specific case k = 2 first. -/
128128
theorem imo2006_q5' {P : Polynomial ℤ} (hP : 1 < P.natDegree) :

Diff for: Archive/Imo/Imo2013Q5.lean

+4-4
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ theorem le_of_all_pow_lt_succ {x y : ℝ} (hx : 1 < x) (hy : 1 < y)
3838
have hterm : ∀ i : ℕ, i ∈ Finset.range n → 1 ≤ x ^ i * y ^ (n - 1 - i) := by
3939
intro i _
4040
calc
41-
1 ≤ x ^ i := one_le_pow_of_one_le hx.le i
41+
1 ≤ x ^ i := one_le_pow₀ hx.le
4242
_ = x ^ i * 1 := by ring
43-
_ ≤ x ^ i * y ^ (n - 1 - i) := by gcongr; apply one_le_pow_of_one_le hy.le
43+
_ ≤ x ^ i * y ^ (n - 1 - i) := by gcongr; apply one_le_pow₀ hy.le
4444
calc
4545
(x - y) * (n : ℝ) = (n : ℝ) * (x - y) := by ring
4646
_ = (∑ _i ∈ Finset.range n, (1 : ℝ)) * (x - y) := by
@@ -134,7 +134,7 @@ theorem fixed_point_of_pos_nat_pow {f : ℚ → ℝ} {n : ℕ} (hn : 0 < n)
134134
(H1 : ∀ x y, 0 < x → 0 < y → f (x * y) ≤ f x * f y) (H4 : ∀ n : ℕ, 0 < n → (n : ℝ) ≤ f n)
135135
(H5 : ∀ x : ℚ, 1 < x → (x : ℝ) ≤ f x) {a : ℚ} (ha1 : 1 < a) (hae : f a = a) :
136136
f (a ^ n) = a ^ n := by
137-
have hh0 : (a : ℝ) ^ n ≤ f (a ^ n) := mod_cast H5 (a ^ n) (one_lt_pow ha1 hn.ne')
137+
have hh0 : (a : ℝ) ^ n ≤ f (a ^ n) := mod_cast H5 (a ^ n) (one_lt_pow ha1 hn.ne')
138138
have hh1 :=
139139
calc
140140
f (a ^ n) ≤ f a ^ n := pow_f_le_f_pow hn ha1 H1 H4
@@ -206,7 +206,7 @@ theorem imo2013_q5 (f : ℚ → ℝ) (H1 : ∀ x y, 0 < x → 0 < y → f (x * y
206206
intro n hn
207207
calc
208208
(x : ℝ) ^ n - 1 < f (x ^ n) :=
209-
mod_cast fx_gt_xm1 (one_le_pow_of_one_le hx.le n) H1 H2 H4
209+
mod_cast fx_gt_xm1 (one_le_pow₀ hx.le) H1 H2 H4
210210
_ ≤ f x ^ n := pow_f_le_f_pow hn hx H1 H4
211211
have hx' : 1 < (x : ℝ) := mod_cast hx
212212
have hxp : 0 < x := by positivity

Diff for: Archive/Imo/Imo2019Q2.lean

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ rather than more literally with `affineSegment`.
5757
-/
5858

5959

60-
open Affine Affine.Simplex EuclideanGeometry FiniteDimensional
60+
open Affine Affine.Simplex EuclideanGeometry Module
6161

6262
open scoped Affine EuclideanGeometry Real
6363

Diff for: Archive/Sensitivity.lean

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ noncomputable section
4141

4242
local notation "√" => Real.sqrt
4343

44-
open Function Bool LinearMap Fintype FiniteDimensional Module.DualBases
44+
open Function Bool LinearMap Fintype Module Module.DualBases
4545

4646
/-!
4747
### The hypercube
@@ -374,7 +374,7 @@ theorem exists_eigenvalue (H : Set (Q m.succ)) (hH : Card H ≥ 2 ^ m + 1) :
374374
suffices 0 < dim (W ⊓ img) by
375375
exact mod_cast exists_mem_ne_zero_of_rank_pos this
376376
have dim_le : dim (W ⊔ img) ≤ 2 ^ (m + 1 : Cardinal) := by
377-
convert ← rank_submodule_le (W ⊔ img)
377+
convert ← Submodule.rank_le (W ⊔ img)
378378
rw [← Nat.cast_succ]
379379
apply dim_V
380380
have dim_add : dim (W ⊔ img) + dim (W ⊓ img) = dim W + 2 ^ m := by

Diff for: Archive/Wiedijk100Theorems/AbelRuffini.lean

+2-2
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ theorem real_roots_Phi_ge_aux (hab : b < a) :
115115
· have hf1 : f 1 < 0 := by simp [hf, hb]
116116
have hfa : 0 ≤ f a := by
117117
simp_rw [hf, ← sq]
118-
refine add_nonneg (sub_nonneg.mpr (pow_le_pow_right ha ?_)) ?_ <;> norm_num
118+
refine add_nonneg (sub_nonneg.mpr (pow_right_mono₀ ha ?_)) ?_ <;> norm_num
119119
obtain ⟨x, ⟨-, hx1⟩, hx2⟩ := intermediate_value_Ico' hle (hc _) (Set.mem_Ioc.mpr ⟨hf1, hf0⟩)
120120
obtain ⟨y, ⟨hy1, -⟩, hy2⟩ := intermediate_value_Ioc ha (hc _) (Set.mem_Ioc.mpr ⟨hf1, hfa⟩)
121121
exact ⟨x, y, (hx1.trans hy1).ne, hx2, hy2⟩
@@ -126,7 +126,7 @@ theorem real_roots_Phi_ge_aux (hab : b < a) :
126126
f (-a) = (a : ℝ) ^ 2 - (a : ℝ) ^ 5 + b := by
127127
norm_num [hf, ← sq, sub_eq_add_neg, add_comm, Odd.neg_pow (by decide : Odd 5)]
128128
_ ≤ (a : ℝ) ^ 2 - (a : ℝ) ^ 3 + (a - 1) := by
129-
refine add_le_add (sub_le_sub_left (pow_le_pow_right ha ?_) _) ?_ <;> linarith
129+
refine add_le_add (sub_le_sub_left (pow_right_mono₀ ha ?_) _) ?_ <;> linarith
130130
_ = -((a : ℝ) - 1) ^ 2 * (a + 1) := by ring
131131
_ ≤ 0 := by nlinarith
132132
have ha' := neg_nonpos.mpr (hle.trans ha)

Diff for: Archive/Wiedijk100Theorems/AscendingDescendingSequences.lean

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ Copyright (c) 2020 Bhavik Mehta. All rights reserved.
33
Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Bhavik Mehta
55
-/
6+
import Mathlib.Data.Finset.Max
67
import Mathlib.Data.Fintype.Powerset
78

89
/-!

Diff for: Archive/Wiedijk100Theorems/BallotProblem.lean

+1-1
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ theorem first_vote_neg (p q : ℕ) (h : 0 < p + q) :
235235
have := condCount_compl
236236
{l : List ℤ | l.headI = 1}ᶜ (countedSequence_finite p q) (countedSequence_nonempty p q)
237237
rw [compl_compl, first_vote_pos _ _ h] at this
238-
rw [ENNReal.sub_eq_of_add_eq _ this, ENNReal.eq_div_iff, ENNReal.mul_sub, mul_one,
238+
rw [ENNReal.eq_sub_of_add_eq _ this, ENNReal.eq_div_iff, ENNReal.mul_sub, mul_one,
239239
ENNReal.mul_div_cancel', ENNReal.add_sub_cancel_left]
240240
all_goals simp_all [ENNReal.div_eq_top]
241241

Diff for: Archive/Wiedijk100Theorems/SumOfPrimeReciprocalsDiverges.lean

+1-1
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ theorem card_le_two_pow {x k : ℕ} :
154154
card M₁ ≤ card (image f K) := card_le_card h
155155
_ ≤ card K := card_image_le
156156
_ ≤ 2 ^ card (image Nat.succ (range k)) := by simp only [K, card_powerset]; rfl
157-
_ ≤ 2 ^ card (range k) := pow_le_pow_right one_le_two card_image_le
157+
_ ≤ 2 ^ card (range k) := pow_right_mono₀ one_le_two card_image_le
158158
_ = 2 ^ k := by rw [card_range k]
159159

160160
/--

Diff for: Counterexamples/SeminormLatticeNotDistrib.lean

+2-2
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,14 @@ theorem not_distrib : ¬(p ⊔ q1) ⊓ (p ⊔ q2) ≤ p ⊔ q1 ⊓ q2 := by
5757
4 / 3 = 4 * (1 - 2 / 3) := by norm_num
5858
_ ≤ 4 * (1 - x.snd) := by gcongr
5959
_ ≤ 4 * |1 - x.snd| := by gcongr; apply le_abs_self
60-
_ = q2 ((1, 1) - x) := by simp; rfl
60+
_ = q2 ((1, 1) - x) := rfl
6161
_ ≤ (p ⊔ q2) ((1, 1) - x) := le_sup_right
6262
_ ≤ (p ⊔ q1) x + (p ⊔ q2) ((1, 1) - x) := le_add_of_nonneg_left (apply_nonneg _ _)
6363
· calc
6464
4 / 3 = 2 / 3 + (1 - 1 / 3) := by norm_num
6565
_ ≤ x.snd + (1 - x.fst) := by gcongr
6666
_ ≤ |x.snd| + |1 - x.fst| := add_le_add (le_abs_self _) (le_abs_self _)
67-
_ ≤ p x + p ((1, 1) - x) := by exact add_le_add le_sup_right le_sup_left
67+
_ ≤ p x + p ((1, 1) - x) := add_le_add le_sup_right le_sup_left
6868
_ ≤ (p ⊔ q1) x + (p ⊔ q2) ((1, 1) - x) := add_le_add le_sup_left le_sup_left
6969
· calc
7070
4 / 3 = 4 * (1 / 3) := by norm_num

Diff for: Counterexamples/SorgenfreyLine.lean

+1-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ theorem continuous_toReal : Continuous toReal :=
141141
exact inf_le_left
142142

143143
instance : OrderClosedTopology ℝₗ :=
144-
⟨isClosed_le_prod.preimage (continuous_toReal.prod_map continuous_toReal)⟩
144+
⟨isClosed_le_prod.preimage (continuous_toReal.prodMap continuous_toReal)⟩
145145

146146
instance : ContinuousAdd ℝₗ := by
147147
refine ⟨continuous_iff_continuousAt.2 ?_⟩

0 commit comments

Comments
 (0)