Skip to content

Commit a4a6b01

Browse files
authored
Merge branch 'master' into patch-2
2 parents 3b985fd + 18a09f9 commit a4a6b01

File tree

421 files changed

+6859
-2987
lines changed

Some content is hidden

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

421 files changed

+6859
-2987
lines changed

.github/workflows/build_template.yml

Lines changed: 8 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -247,76 +247,6 @@ jobs:
247247
echo "✅ All inputRevs in lake-manifest.json are valid"
248248
fi
249249
250-
- name: validate ProofWidgets source repository
251-
# Only enforce this on the main mathlib4 repository, not on nightly-testing
252-
if: github.repository == 'leanprover-community/mathlib4'
253-
shell: bash
254-
run: |
255-
cd pr-branch
256-
257-
expected_url='https://github.com/leanprover-community/ProofWidgets4'
258-
proofwidgets_count=$(jq '[.packages[] | select(.name == "proofwidgets")] | length' lake-manifest.json)
259-
if [ "$proofwidgets_count" -ne 1 ]; then
260-
echo "❌ Error: expected exactly one proofwidgets entry in lake-manifest.json, found $proofwidgets_count"
261-
exit 1
262-
fi
263-
264-
proofwidgets_url=$(jq -r '.packages[] | select(.name == "proofwidgets") | .url' lake-manifest.json)
265-
normalized_url="${proofwidgets_url%.git}"
266-
if [ "$normalized_url" != "$expected_url" ]; then
267-
echo "❌ Error: invalid ProofWidgets source URL in lake-manifest.json"
268-
echo " expected: $expected_url"
269-
echo " found: $proofwidgets_url"
270-
exit 1
271-
fi
272-
273-
echo "✅ ProofWidgets source URL is allowed: $proofwidgets_url"
274-
275-
- name: verify ProofWidgets lean-toolchain matches on versioned releases
276-
# Only enforce this on the main mathlib4 repository, not on nightly-testing
277-
if: github.repository == 'leanprover-community/mathlib4'
278-
shell: bash
279-
run: |
280-
cd pr-branch
281-
282-
# Read the lean-toolchain file
283-
TOOLCHAIN=$(cat lean-toolchain | tr -d '[:space:]')
284-
echo "Lean toolchain: $TOOLCHAIN"
285-
286-
# Check if toolchain matches the versioned release pattern: leanprover/lean4:vX.Y.Z (with optional suffix like -rc1)
287-
if [[ "$TOOLCHAIN" =~ ^leanprover/lean4:v[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9.-]+)?$ ]]; then
288-
echo "✓ Detected versioned Lean release: $TOOLCHAIN"
289-
echo "Verifying ProofWidgets lean-toolchain matches..."
290-
291-
# Check if ProofWidgets lean-toolchain exists
292-
if [ ! -f .lake/packages/proofwidgets/lean-toolchain ]; then
293-
echo "❌ Error: .lake/packages/proofwidgets/lean-toolchain does not exist"
294-
echo "This file should be created by 'lake env' during dependency download."
295-
exit 1
296-
fi
297-
298-
# Read ProofWidgets lean-toolchain
299-
PROOFWIDGETS_TOOLCHAIN=$(cat .lake/packages/proofwidgets/lean-toolchain | tr -d '[:space:]')
300-
echo "ProofWidgets toolchain: $PROOFWIDGETS_TOOLCHAIN"
301-
302-
# Compare the two
303-
if [ "$TOOLCHAIN" != "$PROOFWIDGETS_TOOLCHAIN" ]; then
304-
echo "❌ Error: Lean toolchain mismatch!"
305-
echo " Main lean-toolchain: $TOOLCHAIN"
306-
echo " ProofWidgets lean-toolchain: $PROOFWIDGETS_TOOLCHAIN"
307-
echo ""
308-
echo "When using a versioned Lean release (leanprover/lean4:vX.Y.Z),"
309-
echo "the ProofWidgets dependency must use the same toolchain."
310-
echo "Please update the ProofWidgets dependency to use $TOOLCHAIN"
311-
exit 1
312-
else
313-
echo "✅ ProofWidgets lean-toolchain matches: $TOOLCHAIN"
314-
fi
315-
else
316-
echo "ℹ Lean toolchain is not a versioned release (pattern: leanprover/lean4:vX.Y.Z)"
317-
echo "Skipping ProofWidgets toolchain verification."
318-
fi
319-
320250
- name: get cache (1/3 - setup and initial fetch)
321251
id: get_cache_part1_setup
322252
shell: bash # only runs `cache get` from `tools-branch`, so doesn't need to be inside landrun
@@ -327,7 +257,7 @@ jobs:
327257
328258
# Fail quickly if the cache is completely cold, by checking for Mathlib.Init
329259
echo "Attempting to fetch olean for Mathlib/Init.lean from cache..."
330-
../tools-branch/.lake/build/bin/cache --skip-proofwidgets get Mathlib/Init.lean
260+
../tools-branch/.lake/build/bin/cache get Mathlib/Init.lean
331261
332262
- name: get cache (2/3 - test Mathlib.Init cache)
333263
id: get_cache_part2_test
@@ -381,9 +311,9 @@ jobs:
381311
echo "Warming up cache using previous commit: $PREV_SHA (source: $PREV_SHA_SOURCE)"
382312
if git cat-file -e "$PREV_SHA^{commit}" 2>/dev/null || git fetch --no-tags --depth=1 origin "$PREV_SHA"; then
383313
git checkout "$PREV_SHA"
384-
../tools-branch/.lake/build/bin/cache --skip-proofwidgets get
314+
../tools-branch/.lake/build/bin/cache get
385315
# Run again with --repo, to ensure we actually get the oleans.
386-
../tools-branch/.lake/build/bin/cache --repo="$CACHE_REPO" --skip-proofwidgets get
316+
../tools-branch/.lake/build/bin/cache --repo="$CACHE_REPO" get
387317
388318
echo "Switching back to branch head"
389319
git checkout "$ORIG_SHA"
@@ -396,18 +326,10 @@ jobs:
396326
397327
echo "Fetching all remaining cache..."
398328
399-
../tools-branch/.lake/build/bin/cache --skip-proofwidgets get
329+
../tools-branch/.lake/build/bin/cache get
400330
401331
# Run again with --repo, to ensure we actually get the oleans.
402-
../tools-branch/.lake/build/bin/cache --repo="$CACHE_REPO" --skip-proofwidgets get
403-
404-
- name: fetch ProofWidgets release
405-
# We need network access for ProofWidgets frontend assets.
406-
# Run inside landrun so PR-controlled code remains sandboxed.
407-
shell: landrun --unrestricted-network --rox /etc --rox /usr --rw /dev --rox /home/lean/.elan --rox /home/lean/actions-runner/_work --rw pr-branch/.lake/ --env PATH --env HOME --env GITHUB_OUTPUT --env CI -- bash -euxo pipefail {0}
408-
run: |
409-
cd pr-branch
410-
lake build proofwidgets:release
332+
../tools-branch/.lake/build/bin/cache --repo="$CACHE_REPO" get
411333
412334
- name: update {Mathlib, Tactic, Counterexamples, Archive}.lean
413335
id: mk_all
@@ -462,8 +384,8 @@ jobs:
462384
shell: bash
463385
run: |
464386
cd pr-branch
465-
../tools-branch/.lake/build/bin/cache --skip-proofwidgets get Archive.lean
466-
../tools-branch/.lake/build/bin/cache --skip-proofwidgets get Counterexamples.lean
387+
../tools-branch/.lake/build/bin/cache get Archive.lean
388+
../tools-branch/.lake/build/bin/cache get Counterexamples.lean
467389
468390
- name: build archive
469391
id: archive
@@ -955,6 +877,7 @@ jobs:
955877
steps.get-label-actor.outputs.username == 'mathlib-update-dependencies' ||
956878
steps.get-label-actor.outputs.username == 'mathlib-splicebot' ||
957879
contains(steps.actorTeams.outputs.teams, 'mathlib-maintainers') ||
880+
contains(steps.actorTeams.outputs.teams, 'lean-release-managers') ||
958881
contains(steps.actorTeams.outputs.teams, 'bot-users')
959882
)
960883
name: If `auto-merge-after-CI` is present, add a `bors merge` comment.

.github/workflows/maintainer_merge_wf_run.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,8 @@ jobs:
150150
legacy_suffix=" (legacy)"
151151
fi
152152
metadata=$'['"${trigger_name}"$']('"${trigger_run_url}"$'), [wf_run]('"${wf_run_url}"$')'"${legacy_suffix}"
153-
message="${message}"$'\n\n---\n'"${metadata}"
153+
echo "${metadata}"
154+
# message="${message}"$'\n\n---\n'"${metadata}"
154155
printf 'title<<EOF\n%s\nEOF' "${message}" | tee "$GITHUB_OUTPUT"
155156
env:
156157
AUTHOR: ${{ steps.inputs.outputs.author }}
@@ -188,7 +189,8 @@ jobs:
188189
legacy_suffix=" (legacy)"
189190
fi
190191
metadata=$'['"${trigger_name}"$']('"${trigger_run_url}"$'), [wf_run]('"${wf_run_url}"$')'"${legacy_suffix}"
191-
body="${body}"$'\n\n---\n'"${metadata}"
192+
echo "${metadata}"
193+
# body="${body}"$'\n\n---\n'"${metadata}"
192194
printf 'body<<EOF\n%s\nEOF\n' "${body}" | tee -a "$GITHUB_OUTPUT"
193195
194196
- name: Add comment to PR

Archive/Examples/Kuratowski.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ theorem not_eq_univ_of_mem_theClosedSix_fourteenSet {s}
233233
rw [theClosedSix, kckckc_fourteenSet, kckck_fourteenSet,
234234
kckc_fourteenSet, kck_fourteenSet, kc_fourteenSet, k_fourteenSet] at h
235235
rw [Ne, eq_univ_iff_forall]
236-
push_neg
236+
push Not
237237
repeat obtain _ | ⟨_, h⟩ := h; rotate_left
238238
· use 1 / 2; norm_num
239239
· use 1 / 2; norm_num

Archive/Imo/Imo1988Q6.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ theorem constant_descent_vieta_jumping (x y : ℕ) {claim : Prop} {H : ℕ →
139139
-- and the conditions H(m_x, m_y) and m_x < m_y are satisfied.
140140
simp only at mx_lt_my hHm m_eq
141141
simp only [exceptional, hHm, Set.mem_setOf_eq, true_and] at h_base
142-
push_neg at h_base
142+
push Not at h_base
143143
-- Finally, it also means that (m_x, m_y) does not lie in the base locus,
144144
-- that m_x ≠ 0, m_x ≠ m_y, B(m_x) ≠ m_y, and B(m_x) ≠ m_x + m_y.
145145
rcases h_base with ⟨h_base, hmx, hm_diag, hm_B₁, hm_B₂⟩
@@ -279,7 +279,7 @@ example {a b : ℕ} (h : a * b ∣ a ^ 2 + b ^ 2 + 1) : 3 * a * b = a ^ 2 + b ^
279279
lia
280280
· contrapose! hV₀ with x_lt_z
281281
apply ne_of_gt
282-
push_neg at h_base
282+
push Not at h_base
283283
calc
284284
z * y > x * y := by apply mul_lt_mul_of_pos_right <;> lia
285285
_ ≥ x * (x + 1) := by apply mul_le_mul <;> lia

Archive/Imo/Imo2006Q5.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ theorem Polynomial.isPeriodicPt_eval_two {P : Polynomial ℤ} {t : ℤ}
107107
simp [IsPeriodicPt, IsFixedPt, H]
108108
· -- We take two nonequal consecutive entries.
109109
rw [Cycle.chain_map, periodicOrbit_chain' _ ht] at HC'
110-
push_neg at HC'
110+
push Not at HC'
111111
obtain ⟨n, hn⟩ := HC'
112112
-- They must have opposite sign, so that P^{k + 1}(t) - P^k(t) = P^{k + 2}(t) - P^{k + 1}(t).
113113
rcases Int.natAbs_eq_natAbs_iff.1 (Habs n n.succ) with hn' | hn'

Archive/Imo/Imo2024Q3.lean

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -941,8 +941,6 @@ lemma exists_a_apply_add_eq : ∃ b c, 0 < c ∧ ∀ n, b < n →
941941
rcases hc.even_p (by lia) (hs n) with ⟨_, ht⟩
942942
simp [ht, ← two_mul]
943943

944-
variable {a N}
945-
946944
end Condition
947945

948946
theorem result {a : ℕ → ℕ} {N : ℕ} (h : Condition a N) :

Archive/Wiedijk100Theorems/BallotProblem.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ theorem ballot_problem :
358358
simp only [Ne, ENNReal.div_eq_top, tsub_eq_zero_iff_le, Nat.cast_le, not_le,
359359
add_eq_zero, Nat.cast_eq_zero, ENNReal.add_eq_top, ENNReal.natCast_ne_top, or_self_iff,
360360
not_false_iff, and_true]
361-
push_neg
361+
push Not
362362
exact ⟨fun _ _ => by linarith, (tsub_le_self.trans_lt (ENNReal.natCast_ne_top p).lt_top).ne⟩
363363

364364
end Ballot

Archive/Wiedijk100Theorems/FriendshipGraphs.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ theorem isRegularOf_not_existsPolitician (hG' : ¬ExistsPolitician G) :
150150
intro x
151151
by_cases hvx : G.Adj v x; swap; · exact (degree_eq_of_not_adj hG hvx).symm
152152
dsimp only [Theorems100.ExistsPolitician] at hG'
153-
push_neg at hG'
153+
push Not at hG'
154154
rcases hG' v with ⟨w, hvw', hvw⟩
155155
rcases hG' x with ⟨y, hxy', hxy⟩
156156
by_cases hxw : G.Adj x w

Archive/Wiedijk100Theorems/SumOfPrimeReciprocalsDiverges.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ of `p`.
9797
theorem range_sdiff_eq_biUnion {x k : ℕ} : range x \ M x k = U x k := by
9898
ext e
9999
simp only [mem_biUnion, not_and, Finset.mem_sdiff, mem_filter, mem_range, U, M, P]
100-
push_neg
100+
push Not
101101
constructor
102102
· rintro ⟨hex, hexh⟩
103103
obtain ⟨p, ⟨hpp, hpe1⟩, hpk⟩ := hexh hex

Archive/ZagierTwoSquares.lean

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,9 @@ def complexInvo : Function.End (zagierSet k) := fun ⟨⟨x, y, z⟩, h⟩ =>
107107
· -- less: `x + z < y` (`x < y - z` as stated by Zagier)
108108
rw [Nat.sub_sub]; zify [less.le] at h ⊢; linarith [h]
109109
· -- more: `2 * y < x`
110-
push_neg at less; zify [less, more.le] at h ⊢; linarith [h]
110+
push Not at less; zify [less, more.le] at h ⊢; linarith [h]
111111
· -- middle: `x` is neither less than `y - z` or more than `2 * y`
112-
push_neg at less more; zify [less, more] at h ⊢; linarith [h]⟩
112+
push Not at less more; zify [less, more] at h ⊢; linarith [h]⟩
113113

114114
variable [hk : Fact (4 * k + 1).Prime]
115115

@@ -127,12 +127,12 @@ theorem complexInvo_sq : complexInvo k ^ 2 = 1 := by
127127
rw [Nat.sub_sub, two_mul, ← tsub_add_eq_add_tsub (by linarith), ← add_assoc,
128128
Nat.add_sub_cancel, add_comm (x + z), Nat.sub_add_cancel less.le]
129129
· -- more
130-
push_neg at less
130+
push Not at less
131131
simp only [show x - 2 * y + y < x + z - y by zify [less, more.le]; linarith, ite_true]
132132
rw [Nat.sub_add_cancel more.le, Nat.sub_right_comm, Nat.sub_sub _ _ y, ← two_mul, add_comm,
133133
Nat.add_sub_assoc more.le, Nat.add_sub_cancel]
134134
· -- middle
135-
push_neg at less more
135+
push Not at less more
136136
simp only [show ¬(2 * y - x + (x + z - y) < y) by zify [less, more]; linarith,
137137
show ¬(2 * y < 2 * y - x) by zify [more]; linarith, ite_false]
138138
rw [tsub_tsub_assoc (2 * y).le_refl more, tsub_self, zero_add,

0 commit comments

Comments
 (0)