Skip to content

Commit 9f05f69

Browse files
committed
merge: include feat/lipschitzSmooth-cocoercive for CocoerciveWith predicate
2 parents 3365004 + e9d8d35 commit 9f05f69

905 files changed

Lines changed: 19238 additions & 6911 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/actions/get-mathlib-ci/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ inputs:
1010
# Default pinned commit used by workflows unless they explicitly override.
1111
# Update this ref as needed to pick up changes to mathlib-ci scripts
1212
# This is also updated automatically by .github/workflows/update_dependencies.yml
13-
default: 99a8d566da03485d4e08fa0a85e38200f2d4e964
13+
default: 78f34ded6a5f5aa11ea5b7c3120fe5d8422db1da
1414
path:
1515
description: Checkout destination path.
1616
required: false

.github/workflows/labels_from_comment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
steps:
3030
- name: Add / remove label based on comment
3131
run: |
32-
labelArray=("awaiting-author" "awaiting-zulip" "WIP" "easy" "please-adopt" "help-wanted" "CI" "brownian" "carleson" "CFT" "FLT" "infinity-cosmos" "sphere-packing" "toric" "IMO" "t-algebra" "t-algebraic-geometry" "t-algebraic-topology" "t-analysis" "t-category-theory" "t-combinatorics" "t-computability" "t-condensed" "t-convex-geometry" "t-data" "t-differential-geometry" "t-dynamics" "t-euclidean-geometry" "t-geometric-group-theory" "t-group-theory" "t-linter" "t-logic" "t-measure-probability" "t-meta" "t-number-theory" "t-order" "t-ring-theory" "t-set-theory" "t-topology")
32+
labelArray=("awaiting-author" "awaiting-zulip" "WIP" "easy" "please-adopt" "help-wanted" "CI" "brownian" "carleson" "CFT" "FLT" "infinity-cosmos" "sphere-packing" "toric" "LLM-generated" "IMO" "t-algebra" "t-algebraic-geometry" "t-algebraic-topology" "t-analysis" "t-category-theory" "t-combinatorics" "t-computability" "t-condensed" "t-convex-geometry" "t-data" "t-differential-geometry" "t-dynamics" "t-euclidean-geometry" "t-geometric-group-theory" "t-group-theory" "t-linter" "t-logic" "t-measure-probability" "t-meta" "t-number-theory" "t-order" "t-ring-theory" "t-set-theory" "t-topology")
3333
3434
# we strip `\r` since line endings from GitHub contain this character
3535
COMMENT="${COMMENT//$'\r'/}"

.github/workflows/shake.yaml

Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
name: shake
2+
3+
on:
4+
schedule:
5+
# Run several hours before the technical debt report which runs Mondays at 04:00 UTC
6+
- cron: "10 20 * * 0" # At 20:10 UTC on Sunday.
7+
workflow_dispatch:
8+
inputs:
9+
dry_run:
10+
description: 'If true, only scan and report without modifying files or opening a PR'
11+
required: false
12+
default: false
13+
type: boolean
14+
# auto_merge:
15+
# description: 'If true, apply the auto-merge-after-CI label when creating a PR'
16+
# required: false
17+
# default: true
18+
# type: boolean
19+
20+
jobs:
21+
build:
22+
name: lake shake --fix
23+
runs-on: ubuntu-latest
24+
if: github.repository == 'leanprover-community/mathlib4'
25+
permissions:
26+
contents: read
27+
id-token: write
28+
steps:
29+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
30+
31+
- name: Configure Lean
32+
uses: leanprover/lean-action@c544e89643240c6b398f14a431bcdc6309e36b3e # v1.4.0
33+
with:
34+
auto-config: false
35+
use-github-cache: false
36+
use-mathlib-cache: true
37+
38+
# - name: lake build
39+
# run: |
40+
# lake build Archive Counterexamples
41+
42+
- name: lake shake
43+
id: shake
44+
run: |
45+
# Add back Archive and Counterexamples when they've been modulized
46+
lake shake --add-public --keep-implied --keep-prefix --fix --explain Mathlib > explain.txt 2>&1
47+
if git diff --quiet; then
48+
echo "changed=false" >> "$GITHUB_OUTPUT"
49+
else
50+
echo "changed=true" >> "$GITHUB_OUTPUT"
51+
fi
52+
53+
- name: Parse shake stats
54+
id: stats
55+
if: steps.shake.outputs.changed == 'true'
56+
run: |
57+
scripts/parse_shake_output.py explain.txt "$GITHUB_OUTPUT"
58+
59+
- name: Upload explain.txt
60+
id: upload-artifact
61+
if: failure() || steps.shake.outputs.changed == 'true'
62+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
63+
with:
64+
name: shake-explain
65+
path: explain.txt
66+
67+
- name: Cleanup explain.txt
68+
if: steps.shake.outputs.changed == 'true'
69+
run: |
70+
rm -f explain.txt
71+
72+
- name: Build PR body
73+
id: pr_body
74+
if: steps.shake.outputs.changed == 'true' && toJson(inputs.dry_run) != 'true'
75+
shell: bash
76+
env:
77+
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
78+
ARTIFACT_ID: ${{ steps.upload-artifact.outputs.artifact-id }}
79+
CHANGED_FILES: ${{ steps.stats.outputs.changed_files }}
80+
ADDED: ${{ steps.stats.outputs.added }}
81+
REMOVED: ${{ steps.stats.outputs.removed }}
82+
run: |
83+
{
84+
echo "body<<EOF"
85+
echo "I am happy to shake some imports for you!"
86+
echo ""
87+
echo "**${CHANGED_FILES} files changed** · +${ADDED} imports added · -${REMOVED} imports removed"
88+
echo ""
89+
echo "---"
90+
echo ""
91+
echo "[workflow run for this PR](${RUN_URL})"
92+
echo "[explain.txt](${RUN_URL}/artifacts/${ARTIFACT_ID})"
93+
echo "EOF"
94+
} >> "$GITHUB_OUTPUT"
95+
96+
- name: Generate app token
97+
id: app-token
98+
if: steps.shake.outputs.changed == 'true' && toJson(inputs.dry_run) != 'true'
99+
uses: leanprover-community/mathlib-ci/.github/actions/azure-create-github-app-token@3bb576208589a435eeaeac9b144a1b7c3e948760
100+
with:
101+
app-id: ${{ secrets.MATHLIB_NOLINTS_APP_ID }}
102+
key-vault-name: ${{ vars.MATHLIB_AZ_KEY_VAULT_NAME }}
103+
key-name: mathlib-nolints-app-pk
104+
azure-client-id: ${{ vars.GH_APP_AZURE_CLIENT_ID_PR_WRITERS }}
105+
azure-tenant-id: ${{ secrets.LPC_AZ_TENANT_ID }}
106+
107+
- name: Create Pull Request
108+
id: pr
109+
if: steps.shake.outputs.changed == 'true' && toJson(inputs.dry_run) != 'true'
110+
uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v8.1.0
111+
with:
112+
author: "mathlib-nolints[bot] <258989889+mathlib-nolints[bot]@users.noreply.github.com>"
113+
token: "${{ steps.app-token.outputs.token }}"
114+
commit-message: |
115+
chore: lake shake --add-public --keep-implied --keep-prefix --fix
116+
117+
${{ steps.stats.outputs.changed_files }} files changed · +${{ steps.stats.outputs.added }} imports added · -${{ steps.stats.outputs.removed }} imports removed
118+
branch: "shake"
119+
base: master
120+
title: "chore: lake shake --add-public --keep-implied --keep-prefix --fix"
121+
body: ${{ steps.pr_body.outputs.body }}
122+
# labels: ${{ (github.event_name == 'schedule' || toJson(inputs.auto_merge) == 'true') && 'auto-merge-after-CI' || '' }}
123+
124+
- name: Send Zulip message (success)
125+
if: steps.pr.outcome == 'success'
126+
uses: zulip/github-actions-zulip/send-message@e4c8f27c732ba9bd98ac6be0583096dea82feea5 # v1.0.2
127+
with:
128+
api-key: ${{ secrets.ZULIP_API_KEY }}
129+
email: 'github-mathlib4-bot@leanprover.zulipchat.com'
130+
organization-url: 'https://leanprover.zulipchat.com'
131+
to: 'nightly-testing-mathlib'
132+
type: 'stream'
133+
topic: 'Mathlib `shake --fix`'
134+
content: |
135+
Please review #${{ steps.pr.outputs.pull-request-number }} which changes
136+
${{ steps.stats.outputs.changed_files }} files:
137+
- +${{ steps.stats.outputs.added }} imports added
138+
- -${{ steps.stats.outputs.removed }} imports removed
139+
140+
- name: Send Zulip message (failure)
141+
if: ${{ toJson(inputs.dry_run) != 'true' && failure() }}
142+
uses: zulip/github-actions-zulip/send-message@e4c8f27c732ba9bd98ac6be0583096dea82feea5 # v1.0.2
143+
with:
144+
api-key: ${{ secrets.ZULIP_API_KEY }}
145+
email: 'github-mathlib4-bot@leanprover.zulipchat.com'
146+
organization-url: 'https://leanprover.zulipchat.com'
147+
to: 'nightly-testing-mathlib'
148+
type: 'stream'
149+
topic: 'Mathlib `shake --fix`'
150+
content: |
151+
[`shake` workflow run failed](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})
152+
153+
triggered by: `${{ github.event_name }}`

Archive/Examples/IfNormalization/Result.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ import Mathlib.Tactic.Recall
1313
See `Statement.lean` for background.
1414
-/
1515

16-
macro "◾" : tactic => `(tactic| aesop)
17-
macro "◾" : term => `(term| by aesop)
16+
local macro "◾" : tactic => `(tactic| aesop)
17+
local macro "◾" : term => `(term| by aesop)
1818

1919
namespace IfExpr
2020

Archive/Imo/Imo2024Q5.lean

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -938,8 +938,7 @@ lemma winningStrategy_play_one_eq_none_or_play_two_eq_none_of_edge_zero (hN : 2
938938
lia
939939
· simp at hm
940940
exact m.notMem_monsterCells_of_fst_eq_zero rfl hm
941-
· simp at h
942-
lia
941+
· simp [eqComm] at h
943942
· dsimp only [Nat.reduceAdd, Nat.reduceDiv, Fin.mk_one] at hm
944943
have h1N : 1 ≤ N := by lia
945944
rw [m.mk_mem_monsterCells_iff_of_le (le_refl _) h1N] at hm

Archive/Imo/Imo2025Q3.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,8 @@ lemma isBonza : IsBonza fExample := by
154154
· simp [fExample, ch1]
155155
by_cases ch2 : a = 2
156156
· simp only [fExample, ch2, dvd_refl, not_true_eq_false, ↓reduceIte, Nat.cast_ofNat,
157-
Nat.two_dvd_ne_zero, Nat.cast_ite, Nat.cast_one, Nat.cast_pow, ite_pow, one_pow,
158-
Int.reducePow]
157+
Nat.two_dvd_ne_zero]
158+
push_cast
159159
split_ifs with hb1 hb2
160160
· grind [sq_mod_four_eq_one_of_odd]
161161
· simp [hb2]

Archive/Sensitivity.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ set_option backward.isDefEq.respectTransparency false in
329329
theorem g_injective : Injective (g m) := by
330330
rw [g]
331331
intro x₁ x₂ h
332-
simp only [V, LinearMap.prod_apply, LinearMap.id_apply, Prod.mk_inj, Pi.prod] at h
332+
simp only [V, LinearMap.prod_apply, LinearMap.id_apply, Prod.mk_inj, Function.prod_apply] at h
333333
exact h.right
334334

335335
set_option backward.isDefEq.respectTransparency false in

Cache/Requests.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def findMathlibRemote (mathlibDepPath : FilePath) : IO String := do
9494
let remoteUrl := parts[1]!.takeWhile (· != ' ') |>.copy -- Remove (fetch) or (push) suffix
9595

9696
-- Check if this remote points to leanprover-community/mathlib4
97-
let isMathlibRepo := remoteUrl.containsSubstr "leanprover-community/mathlib4"
97+
let isMathlibRepo := remoteUrl.contains "leanprover-community/mathlib4"
9898

9999
if isMathlibRepo then
100100
if remoteName == "origin" then

0 commit comments

Comments
 (0)