Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
163 commits
Select commit Hold shift + click to select a range
e8e0010
Update lean-toolchain for testing https://github.com/leanprover/lean4…
leanprover-community-mathlib4-bot Aug 15, 2025
a032548
Update lean-toolchain for testing https://github.com/leanprover/lean4…
leanprover-community-mathlib4-bot Sep 23, 2025
8e3e8b7
Update lean-toolchain for https://github.com/leanprover/lean4/pull/10319
leanprover-community-mathlib4-bot Sep 24, 2025
f2d994c
update LibraryRewrite.lean
datokrat Sep 24, 2025
249cb40
Update lean-toolchain for https://github.com/leanprover/lean4/pull/10319
leanprover-community-mathlib4-bot Sep 24, 2025
65544a5
really fix LibraryRewrite
datokrat Sep 24, 2025
ff15f33
Update lean-toolchain for https://github.com/leanprover/lean4/pull/10319
leanprover-community-mathlib4-bot Sep 24, 2025
6a44211
shake
datokrat Sep 24, 2025
1cdb73c
Merge master into nightly-testing
leanprover-community-mathlib4-bot Sep 25, 2025
4f48035
Merge branch 'bump/nightly-2025-09-24' into nightly-testing
kim-em Sep 25, 2025
b63b879
Merge master into nightly-testing
leanprover-community-mathlib4-bot Sep 25, 2025
c4f7445
chore: bump to nightly-2025-09-25
leanprover-community-mathlib4-bot Sep 25, 2025
6e7ecde
Merge master into nightly-testing
leanprover-community-mathlib4-bot Sep 25, 2025
8b8f01b
update batteries
kim-em Sep 25, 2025
c0abbc5
remove upstreamed
kim-em Sep 25, 2025
0535eef
update Qq
kim-em Sep 25, 2025
658ea9b
Merge master into nightly-testing
leanprover-community-mathlib4-bot Sep 25, 2025
e5af8a0
Merge master into nightly-testing
leanprover-community-mathlib4-bot Sep 25, 2025
c479358
Merge master into nightly-testing
leanprover-community-mathlib4-bot Sep 25, 2025
9c3512d
Merge master into nightly-testing
leanprover-community-mathlib4-bot Sep 25, 2025
cc0437a
Update lean-toolchain for testing https://github.com/leanprover/lean4…
leanprover-community-mathlib4-bot Sep 25, 2025
fddb497
fix(Cache): use leantar v0.1.16-pre2
tydeu Sep 22, 2025
5afb2e8
Merge master into nightly-testing
leanprover-community-mathlib4-bot Sep 26, 2025
6ad0b9e
attempt to fix cache
kim-em Sep 26, 2025
19120fe
whitespace to invalidate cache
kim-em Sep 26, 2025
8fac228
Merge master into nightly-testing
leanprover-community-mathlib4-bot Sep 26, 2025
0ef1b4d
Merge master into nightly-testing
leanprover-community-mathlib4-bot Sep 26, 2025
c609f29
chore: bump to nightly-2025-09-26
leanprover-community-mathlib4-bot Sep 26, 2025
dee33e9
merge lean-pr-testing-10188
invalid-email-address Sep 26, 2025
9cdfe19
Merge master into nightly-testing
leanprover-community-mathlib4-bot Sep 26, 2025
276dd6b
Merge master into nightly-testing
leanprover-community-mathlib4-bot Sep 26, 2025
7d00b7f
Merge master into nightly-testing
leanprover-community-mathlib4-bot Sep 26, 2025
58ae08f
Merge master into nightly-testing
leanprover-community-mathlib4-bot Sep 27, 2025
020049f
Merge master into nightly-testing
leanprover-community-mathlib4-bot Sep 27, 2025
06dc654
Merge master into nightly-testing
leanprover-community-mathlib4-bot Sep 27, 2025
c4e3eb3
Merge master into nightly-testing
leanprover-community-mathlib4-bot Sep 27, 2025
3b7368e
Merge master into nightly-testing
leanprover-community-mathlib4-bot Sep 27, 2025
6da53fa
Merge master into nightly-testing
leanprover-community-mathlib4-bot Sep 28, 2025
9606dd9
Merge master into nightly-testing
leanprover-community-mathlib4-bot Sep 28, 2025
2120cf6
chore: bump to nightly-2025-09-28
leanprover-community-mathlib4-bot Sep 28, 2025
144a6f5
Merge master into nightly-testing
leanprover-community-mathlib4-bot Sep 28, 2025
ad67ca8
Merge master into nightly-testing
leanprover-community-mathlib4-bot Sep 28, 2025
adba7c4
Merge master into nightly-testing
leanprover-community-mathlib4-bot Sep 28, 2025
c50a552
Merge master into nightly-testing
leanprover-community-mathlib4-bot Sep 28, 2025
b20b7ed
Merge master into nightly-testing
leanprover-community-mathlib4-bot Sep 29, 2025
5d850d3
Merge master into nightly-testing
leanprover-community-mathlib4-bot Sep 29, 2025
607a551
chore: bump to nightly-2025-09-29
leanprover-community-mathlib4-bot Sep 29, 2025
764ae2b
Merge master into nightly-testing
leanprover-community-mathlib4-bot Sep 29, 2025
da65ad6
Update lean-toolchain for https://github.com/leanprover/lean4/pull/9932
leanprover-community-mathlib4-bot Sep 29, 2025
dcbbfc4
Merge master into nightly-testing
leanprover-community-mathlib4-bot Sep 29, 2025
196f322
Update lean-toolchain for https://github.com/leanprover/lean4/pull/9932
leanprover-community-mathlib4-bot Sep 29, 2025
2783761
Merge master into nightly-testing
leanprover-community-mathlib4-bot Sep 29, 2025
73ed283
Merge master into nightly-testing
leanprover-community-mathlib4-bot Sep 29, 2025
07dcec0
Merge master into nightly-testing
leanprover-community-mathlib4-bot Sep 29, 2025
597bf94
Merge master into nightly-testing
leanprover-community-mathlib4-bot Sep 30, 2025
9c3bb42
Fix
TwoFX Sep 30, 2025
791bc46
Fix
TwoFX Sep 30, 2025
dbf4d25
chore: bump to nightly-2025-09-30
leanprover-community-mathlib4-bot Sep 30, 2025
5db1fd1
Merge master into nightly-testing
leanprover-community-mathlib4-bot Sep 30, 2025
c5b4287
Pin Qq for now
TwoFX Sep 30, 2025
1983963
Unpin Qq again
TwoFX Sep 30, 2025
4dc7275
lake update
TwoFX Sep 30, 2025
91d8523
Merge master into nightly-testing
leanprover-community-mathlib4-bot Sep 30, 2025
7ec524f
Fix
TwoFX Sep 30, 2025
d1174d2
chore: adaptations for nightly-2025-09-30
Sep 30, 2025
2dafcfc
Update lean-toolchain for testing https://github.com/leanprover/lean4…
leanprover-community-mathlib4-bot Sep 30, 2025
1ad9769
Merge master into nightly-testing
leanprover-community-mathlib4-bot Sep 30, 2025
da07ef8
Merge master into nightly-testing
leanprover-community-mathlib4-bot Sep 30, 2025
5c9be4f
Merge master into nightly-testing
leanprover-community-mathlib4-bot Sep 30, 2025
11fa7d4
Merge master into nightly-testing
leanprover-community-mathlib4-bot Oct 1, 2025
443cb10
Lake update
TwoFX Oct 1, 2025
3d53c4a
Merge master into nightly-testing
leanprover-community-mathlib4-bot Oct 1, 2025
6d02d76
Update lean-toolchain for https://github.com/leanprover/lean4/pull/9932
leanprover-community-mathlib4-bot Oct 1, 2025
d9d25ac
Fix some
TwoFX Oct 1, 2025
22a88b4
Fix
TwoFX Oct 1, 2025
0575c3e
chore: bump to nightly-2025-10-01
leanprover-community-mathlib4-bot Oct 1, 2025
e7ff8fe
Merge master into nightly-testing
leanprover-community-mathlib4-bot Oct 1, 2025
e3fca35
Merge commit 'e7ff8fecd7cbe4bbf06794c6baa154f6269980aa' into bump/nig…
Oct 1, 2025
46eec1d
chore: adaptations for nightly-2025-10-01
Oct 1, 2025
2fa113d
Merge master into nightly-testing
leanprover-community-mathlib4-bot Oct 1, 2025
5722ce7
Update lean-toolchain for https://github.com/leanprover/lean4/pull/10319
leanprover-community-mathlib4-bot Oct 1, 2025
78792eb
fix: remove unused simp arg due to changed definition of `OptionT.run…
sgraf812 Oct 1, 2025
07d3833
Update lean-toolchain for https://github.com/leanprover/lean4/pull/9932
leanprover-community-mathlib4-bot Oct 1, 2025
76a1014
Merge master into nightly-testing
leanprover-community-mathlib4-bot Oct 1, 2025
c91e313
Merge master into nightly-testing
leanprover-community-mathlib4-bot Oct 1, 2025
a0802d6
Merge master into nightly-testing
leanprover-community-mathlib4-bot Oct 1, 2025
43c1fdc
Merge master into nightly-testing
leanprover-community-mathlib4-bot Oct 2, 2025
f4019d6
Merge master into nightly-testing
leanprover-community-mathlib4-bot Oct 2, 2025
2789865
Merge master into nightly-testing
leanprover-community-mathlib4-bot Oct 2, 2025
47370e1
chore: bump to nightly-2025-10-02
leanprover-community-mathlib4-bot Oct 2, 2025
cbbbeb6
merge lean-pr-testing-10624
invalid-email-address Oct 2, 2025
67bf7c1
merge lean-pr-testing-9932
invalid-email-address Oct 2, 2025
472669a
lake update
TwoFX Oct 2, 2025
7d12068
We actually follow aesop master, not nightly-testing
TwoFX Oct 2, 2025
f01e2ea
Merge master into nightly-testing
leanprover-community-mathlib4-bot Oct 2, 2025
515a3c2
Merge commit 'f01e2ea4f5b8fdd61a5e1441d2343560a1c9b6d1' into bump/nig…
Oct 2, 2025
605f3e0
chore: adaptations for nightly-2025-10-02
Oct 2, 2025
6770ccb
Merge master into nightly-testing
leanprover-community-mathlib4-bot Oct 2, 2025
b9a32ca
Merge master into nightly-testing
leanprover-community-mathlib4-bot Oct 2, 2025
fb87f03
Merge master into nightly-testing
leanprover-community-mathlib4-bot Oct 2, 2025
e3a1ca3
Merge master into nightly-testing
leanprover-community-mathlib4-bot Oct 3, 2025
238b3c7
Use docgen nightly-testing
TwoFX Oct 3, 2025
433506d
Merge master into nightly-testing
leanprover-community-mathlib4-bot Oct 3, 2025
deefedf
Merge master into nightly-testing
leanprover-community-mathlib4-bot Oct 3, 2025
492bb4d
Merge master into nightly-testing
leanprover-community-mathlib4-bot Oct 3, 2025
9378629
Merge master into nightly-testing
leanprover-community-mathlib4-bot Oct 3, 2025
72f0b5e
chore: bump to nightly-2025-10-03
leanprover-community-mathlib4-bot Oct 3, 2025
05acb6c
merge lean-pr-testing-10319
invalid-email-address Oct 3, 2025
61865c0
Merge master into nightly-testing
leanprover-community-mathlib4-bot Oct 3, 2025
cc3de92
Merge master into nightly-testing
leanprover-community-mathlib4-bot Oct 3, 2025
8e9a840
Merge master into nightly-testing
leanprover-community-mathlib4-bot Oct 4, 2025
f76e609
Merge master into nightly-testing
leanprover-community-mathlib4-bot Oct 4, 2025
7dce98c
Merge master into nightly-testing
leanprover-community-mathlib4-bot Oct 4, 2025
0b7f245
Merge master into nightly-testing
leanprover-community-mathlib4-bot Oct 4, 2025
9722f7e
Merge master into nightly-testing
leanprover-community-mathlib4-bot Oct 4, 2025
624e914
Merge master into nightly-testing
leanprover-community-mathlib4-bot Oct 4, 2025
153004c
Merge master into nightly-testing
leanprover-community-mathlib4-bot Oct 4, 2025
f799cf4
Merge master into nightly-testing
leanprover-community-mathlib4-bot Oct 5, 2025
7df377d
Merge master into nightly-testing
leanprover-community-mathlib4-bot Oct 5, 2025
176ebb6
chore: bump to nightly-2025-10-05
leanprover-community-mathlib4-bot Oct 5, 2025
6683f5d
lake update
TwoFX Oct 5, 2025
8f7a78a
lakefile babysitting: Qq -> nightly-testing
TwoFX Oct 5, 2025
ab78a68
Merge master into nightly-testing
leanprover-community-mathlib4-bot Oct 5, 2025
ac8a764
Merge master into nightly-testing
leanprover-community-mathlib4-bot Oct 5, 2025
c870f76
Fix
TwoFX Oct 6, 2025
7d6d06d
Fix
TwoFX Oct 6, 2025
904d9aa
Noshake
TwoFX Oct 6, 2025
4fb9b3e
Merge commit '904d9aa32a55625ea137f6f7d952270e8a9e1a64' into bump/nig…
Oct 6, 2025
644eb46
chore: adaptations for nightly-2025-10-05
Oct 6, 2025
c374269
Merge master into nightly-testing
leanprover-community-mathlib4-bot Oct 6, 2025
7bb1cf1
chore: bump to nightly-2025-10-06
leanprover-community-mathlib4-bot Oct 6, 2025
5072d0a
Merge commit '7bb1cf18dad0e818b2dacb14fe1625b7e45f85fe' into bump/nig…
Oct 6, 2025
446678c
chore: adaptations for nightly-2025-10-06
Oct 6, 2025
59ba88d
Merge master into nightly-testing
leanprover-community-mathlib4-bot Oct 6, 2025
8d91f62
Update lean-toolchain for testing https://github.com/leanprover/lean4…
leanprover-community-mathlib4-bot Oct 6, 2025
0361c6a
Merge master into nightly-testing
leanprover-community-mathlib4-bot Oct 6, 2025
4a3d124
Fix CompileInductive
nomeata Oct 6, 2025
a836666
Merge master into nightly-testing
leanprover-community-mathlib4-bot Oct 6, 2025
2a30681
Merge master into nightly-testing
leanprover-community-mathlib4-bot Oct 6, 2025
281600f
Merge master into nightly-testing
leanprover-community-mathlib4-bot Oct 7, 2025
e78fb65
Merge master into nightly-testing
leanprover-community-mathlib4-bot Oct 7, 2025
873e009
chore: bump to nightly-2025-10-07
leanprover-community-mathlib4-bot Oct 7, 2025
a8a7dd8
Merge commit '873e009aedeb816734ce388ad830cac6ff9e68c1' into bump/nig…
Oct 7, 2025
ddad28b
chore: adaptations for nightly-2025-10-07
Oct 7, 2025
66bf82f
Update lean-toolchain for https://github.com/leanprover/lean4/pull/10606
leanprover-community-mathlib4-bot Oct 7, 2025
94fef1a
Merge master into nightly-testing
leanprover-community-mathlib4-bot Oct 7, 2025
29a622d
Merge master into nightly-testing
leanprover-community-mathlib4-bot Oct 7, 2025
19b2d2e
Merge master into nightly-testing
leanprover-community-mathlib4-bot Oct 7, 2025
ed369c3
Merge master into nightly-testing
leanprover-community-mathlib4-bot Oct 7, 2025
344943d
Merge master into nightly-testing
leanprover-community-mathlib4-bot Oct 8, 2025
104fa77
Merge master into nightly-testing
leanprover-community-mathlib4-bot Oct 8, 2025
41049a1
Merge master into nightly-testing
leanprover-community-mathlib4-bot Oct 8, 2025
21ca051
Merge master into nightly-testing
leanprover-community-mathlib4-bot Oct 8, 2025
e70f51e
chore: bump to nightly-2025-10-08
leanprover-community-mathlib4-bot Oct 8, 2025
f052386
merge lean-pr-testing-10606
invalid-email-address Oct 8, 2025
d856b9b
Merge master into nightly-testing
leanprover-community-mathlib4-bot Oct 8, 2025
ab0b3a7
Bump batteries
nomeata Oct 8, 2025
bceba31
Merge master into nightly-testing
leanprover-community-mathlib4-bot Oct 8, 2025
58cb65c
Merge master into nightly-testing
leanprover-community-mathlib4-bot Oct 8, 2025
6e9273f
Merge master into nightly-testing
leanprover-community-mathlib4-bot Oct 8, 2025
0bf50ad
Merge master into nightly-testing
leanprover-community-mathlib4-bot Oct 9, 2025
fae2ed2
Merge commit '0bf50add06fd53f0e1df02728797cf1627a1b5f7' into bump/nig…
Oct 9, 2025
1714afe
chore: adaptations for nightly-2025-10-08
Oct 9, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/nightly-docgen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
[[require]]
scope = "leanprover"
name = "doc-gen4"
rev = "main"
rev = "nightly-testing"
EOF
# Initialise docbuild as a Lean project
Expand Down
5 changes: 5 additions & 0 deletions Cache/IO.lean
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,11 @@ def mkBuildPaths (mod : Name) : CacheM <| List (FilePath × Bool) := do
(packageDir / LIBDIR / path.withExtension "ilean.hash", true),
(packageDir / IRDIR / path.withExtension "c", true),
(packageDir / IRDIR / path.withExtension "c.hash", true),
-- this is needed for packages using the module system:
(packageDir / LIBDIR / path.withExtension "olean.private", false),
(packageDir / LIBDIR / path.withExtension "olean.private.hash", false),
(packageDir / LIBDIR / path.withExtension "olean.server", false),
(packageDir / LIBDIR / path.withExtension "olean.server.hash", false),
(packageDir / LIBDIR / path.withExtension "extra", false)]

/-- Check that all required build files exist. -/
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Algebra/Algebra/StrictPositivity.lean
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ lemma _root_.IsUnit.isStrictlyPositive [LE A] [Monoid A] [Zero A]
lemma isSelfAdjoint [Semiring A] [PartialOrder A] [StarRing A] [StarOrderedRing A] {a : A}
(ha : IsStrictlyPositive a) : IsSelfAdjoint a := ha.nonneg.isSelfAdjoint

@[simp, grind]
@[simp, grind .]
lemma _root_.isStrictlyPositive_one [LE A] [Monoid A] [Zero A] [ZeroLEOneClass A] :
IsStrictlyPositive (1 : A) := iff_of_unital.mpr ⟨zero_le_one, isUnit_one⟩

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ lemma standardσ_simplicialInsert (hL : IsAdmissible (m + 1) L) (j : ℕ) (hj :
simp only [standardσ_cons, Category.assoc, this,
h_rec hL.tail (j + 1) (by grind) (by grind)]

attribute [local grind] simplicialInsert_length simplicialInsert_isAdmissible in
attribute [local grind! .] simplicialInsert_length simplicialInsert_isAdmissible in
/-- Using `standardσ_simplicialInsert`, we can prove that every morphism satisfying `P_σ` is equal
to some `standardσ` for some admissible list of indices. -/
theorem exists_normal_form_P_σ {x y : SimplexCategoryGenRel} (f : x ⟶ y) (hf : P_σ f) :
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,12 @@ variable {A : Type*} [NormedRing A] [StarRing A] [NormedAlgebra ℝ A]
matrices, operators on a Hilbert space, elements of a C⋆-algebra, etc. -/
noncomputable def log (a : A) : A := cfc Real.log a

@[simp, grind]
@[simp, grind =>]
protected lemma _root_.IsSelfAdjoint.log {a : A} : IsSelfAdjoint (log a) := cfc_predicate _ a

@[simp, grind] lemma log_zero : log (0 : A) = 0 := by simp [log]
@[simp, grind =] lemma log_zero : log (0 : A) = 0 := by simp [log]

@[simp, grind] lemma log_one : log (1 : A) = 0 := by simp [log]
@[simp, grind =] lemma log_one : log (1 : A) = 0 := by simp [log]

@[simp, grind =]
lemma log_algebraMap {r : ℝ} : log (algebraMap ℝ A r) = algebraMap ℝ A (Real.log r) := by
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ noncomputable instance (priority := 100) : Pow A ℝ≥0 where
@[simp]
lemma nnrpow_eq_pow {a : A} {y : ℝ≥0} : nnrpow a y = a ^ y := rfl

@[simp, grind]
@[simp, grind =>]
lemma nnrpow_nonneg {a : A} {x : ℝ≥0} : 0 ≤ a ^ x := cfcₙ_predicate _ a

lemma nnrpow_def {a : A} {y : ℝ≥0} : a ^ y = cfcₙ (NNReal.nnrpow · y) a := rfl
Expand Down Expand Up @@ -226,7 +226,7 @@ section sqrt
/-- Square roots of operators, based on the non-unital continuous functional calculus. -/
noncomputable def sqrt (a : A) : A := cfcₙ NNReal.sqrt a

@[simp, grind]
@[simp, grind =>]
lemma sqrt_nonneg (a : A) : 0 ≤ sqrt a := cfcₙ_predicate _ a

lemma sqrt_eq_nnrpow (a : A) : sqrt a = a ^ (1 / 2 : ℝ≥0) := by
Expand Down Expand Up @@ -385,7 +385,7 @@ noncomputable instance (priority := 100) : Pow A ℝ where
@[simp]
lemma rpow_eq_pow {a : A} {y : ℝ} : rpow a y = a ^ y := rfl

@[simp, grind]
@[simp, grind =>]
lemma rpow_nonneg {a : A} {y : ℝ} : 0 ≤ a ^ y := cfc_predicate _ a

lemma rpow_def {a : A} {y : ℝ} : a ^ y = cfc (fun x : ℝ≥0 => x ^ y) a := rfl
Expand Down
4 changes: 1 addition & 3 deletions Mathlib/Control/Monad/Cont.lean
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import Mathlib.Control.Monad.Writer
import Mathlib.Control.Lawful
import Batteries.Tactic.Congr
import Batteries.Lean.Except
import Batteries.Control.OptionT

/-!
# Continuation Monad
Expand Down Expand Up @@ -179,8 +178,7 @@ instance [MonadCont m] [LawfulMonadCont m] : LawfulMonadCont (OptionT m) where
callCC_bind_left := by
intros
simp only [callCC, OptionT.callCC, OptionT.goto_mkLabel, bind_pure_comp, OptionT.run_bind,
OptionT.run_mk, Option.elimM_map, Option.elim_some, Function.comp_apply,
@callCC_bind_left m _]
OptionT.run_mk, Option.elimM_map, Option.elim_some, @callCC_bind_left m _]
ext; rfl
callCC_dummy := by intros; simp only [callCC, OptionT.callCC, @callCC_dummy m _]; ext; rfl

Expand Down
12 changes: 10 additions & 2 deletions Mathlib/Data/Int/LeastGreatest.lean
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,11 @@ theorem exists_least_of_bdd
theorem coe_leastOfBdd_eq {P : ℤ → Prop} [DecidablePred P] {b b' : ℤ} (Hb : ∀ z : ℤ, P z → b ≤ z)
(Hb' : ∀ z : ℤ, P z → b' ≤ z) (Hinh : ∃ z : ℤ, P z) :
(leastOfBdd b Hb Hinh : ℤ) = leastOfBdd b' Hb' Hinh := by
grind
#adaptation_note /-- 2025-09-30 (https://github.com/leanprover/lean4/issues/10622)
Used to be `grind` -/
rcases leastOfBdd b Hb Hinh with ⟨n, hn, h2n⟩
rcases leastOfBdd b' Hb' Hinh with ⟨n', hn', h2n'⟩
exact le_antisymm (h2n _ hn') (h2n' _ hn)

/-- A computable version of `exists_greatest_of_bdd`: given a decidable predicate on the
integers, with an explicit upper bound and a proof that it is somewhere true, return
Expand Down Expand Up @@ -112,6 +116,10 @@ theorem exists_greatest_of_bdd
theorem coe_greatestOfBdd_eq {P : ℤ → Prop} [DecidablePred P] {b b' : ℤ}
(Hb : ∀ z : ℤ, P z → z ≤ b) (Hb' : ∀ z : ℤ, P z → z ≤ b') (Hinh : ∃ z : ℤ, P z) :
(greatestOfBdd b Hb Hinh : ℤ) = greatestOfBdd b' Hb' Hinh := by
grind
#adaptation_note /-- 2025-09-30 (https://github.com/leanprover/lean4/issues/10622)
Used to be `grind` -/
rcases greatestOfBdd b Hb Hinh with ⟨n, hn, h2n⟩
rcases greatestOfBdd b' Hb' Hinh with ⟨n', hn', h2n'⟩
exact le_antisymm (h2n' _ hn) (h2n _ hn')

end Int
10 changes: 4 additions & 6 deletions Mathlib/Data/String/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ Supplementary theorems about the `String` type.

namespace String

@[simp] theorem endPos_empty : "".endPos = 0 := rfl

/-- `<` on string iterators. This coincides with `<` on strings as lists. -/
def ltb (s₁ s₂ : Iterator) : Bool :=
if s₂.hasNext then
Expand Down Expand Up @@ -63,7 +61,7 @@ theorem ltb_cons_addChar' (c : Char) (s₁ s₂ : Iterator) :
rw [ltb, Iterator.hasNext_cons_addChar, Iterator.hasNext_cons_addChar,
if_pos (by simpa using h₁), if_pos (by simpa using h₂), if_pos, ← ih]
· simp [Iterator.next, String.next, get_cons_addChar]
congr 2 <;> apply Pos.addChar_right_comm
congr 2 <;> apply Pos.Raw.addChar_right_comm
· simpa [Iterator.curr, get_cons_addChar] using h
| case2 s₁ s₂ h₁ h₂ h =>
rw [ltb, Iterator.hasNext_cons_addChar, Iterator.hasNext_cons_addChar,
Expand All @@ -76,7 +74,7 @@ theorem ltb_cons_addChar' (c : Char) (s₁ s₂ : Iterator) :
| case4 s₁ s₂ h₁ =>
rw [ltb, Iterator.hasNext_cons_addChar, if_neg (by simpa using h₁)]

theorem ltb_cons_addChar (c : Char) (cs₁ cs₂ : List Char) (i₁ i₂ : Pos) :
theorem ltb_cons_addChar (c : Char) (cs₁ cs₂ : List Char) (i₁ i₂ : Pos.Raw) :
ltb ⟨mk (c :: cs₁), i₁ + c⟩ ⟨mk (c :: cs₂), i₂ + c⟩ = ltb ⟨mk cs₁, i₁⟩ ⟨mk cs₂, i₂⟩ := by
rw [eq_comm, ← ltb_cons_addChar' c]
simp
Expand All @@ -98,13 +96,13 @@ theorem lt_iff_toList_lt : ∀ {s₁ s₂ : String}, s₁ < s₂ ↔ s₁.toList
simp [Iterator.hasNext]
· apply not_lt_of_gt; apply List.nil_lt_cons
· rename_i c₁ cs₁ ih c₂ cs₂; unfold ltb
simp only [Iterator.hasNext, Pos.byteIdx_zero, endPos_asString, utf8Len_cons, add_pos_iff,
simp only [Iterator.hasNext, Pos.Raw.byteIdx_zero, endPos_asString, utf8Len_cons, add_pos_iff,
Char.utf8Size_pos, or_true, decide_true, ↓reduceIte, Iterator.curr, get, List.data_asString,
utf8GetAux, Iterator.next, next, Bool.ite_eq_true_distrib, decide_eq_true_eq]
simp only [← String.mk_eq_asString]
split_ifs with h
· subst c₂
suffices ltb ⟨mk (c₁ :: cs₁), (0 : Pos) + c₁⟩ ⟨mk (c₁ :: cs₂), (0 : Pos) + c₁⟩ =
suffices ltb ⟨mk (c₁ :: cs₁), (0 : Pos.Raw) + c₁⟩ ⟨mk (c₁ :: cs₂), (0 : Pos.Raw) + c₁⟩ =
ltb ⟨mk cs₁, 0⟩ ⟨mk cs₂, 0⟩ by rw [this]; exact (ih cs₂).trans List.lex_cons_iff.symm
apply ltb_cons_addChar
· refine ⟨List.Lex.rel, fun e ↦ ?_⟩
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,10 @@ theorem IntervalIntegrable.ae_hasDerivAt_integral {f : ℝ → ℝ} {a b : ℝ}
|>.integrable_of_forall_notMem_eq_zero (by grind) |>.locallyIntegrable
filter_upwards [LocallyIntegrable.ae_hasDerivAt_integral hg, h₁, h₂] with x hx _ _ _
intro c hc
refine HasDerivWithinAt.hasDerivAt (s := Ioo a b) ?_ <| Ioo_mem_nhds (by grind) (by grind)
rw [show f x = g x by grind]
#adaptation_note /-- 2025-09-30 https://github.com/leanprover/lean4/issues/10622
`grind -order` calls used be `grind` -/
refine HasDerivWithinAt.hasDerivAt (s := Ioo a b) ?_ <|
Ioo_mem_nhds (by grind -order) (by grind -order)
rw [show f x = g x by grind -order]
refine (hx c).hasDerivWithinAt.congr (fun y hy ↦ ?_) ?_
all_goals apply intervalIntegral.integral_congr_ae' <;> filter_upwards <;> grind
1 change: 0 additions & 1 deletion Mathlib/SetTheory/PGame/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ Copyright (c) 2019 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Reid Barton, Mario Carneiro, Isabel Longbottom, Kim Morrison, Yuyang Zhao
-/
import Mathlib.Data.Nat.Basic
import Mathlib.Logic.Equiv.Defs
import Mathlib.Tactic.Convert
import Mathlib.Tactic.Linter.DeprecatedModule
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Tactic/DeclarationNames.lean
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace Mathlib.Linter
If `pos` is a `String.Pos`, then `getNamesFrom pos` returns the array of identifiers
for the names of the declarations whose syntax begins in position at least `pos`.
-/
def getNamesFrom {m} [Monad m] [MonadEnv m] [MonadFileMap m] (pos : String.Pos) :
def getNamesFrom {m} [Monad m] [MonadEnv m] [MonadFileMap m] (pos : String.Pos.Raw) :
m (Array Syntax) := do
-- declarations from parallelism branches should not be interesting here, so use `local`
let drs := declRangeExt.toPersistentEnvExtension.getState (asyncMode := .local) (← getEnv)
Expand Down
6 changes: 3 additions & 3 deletions Mathlib/Tactic/Linter/CommandStart.lean
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ formatting.
This is every declaration until the type-specification, if there is one, or the value,
as well as all `variable` commands.
-/
def CommandStart.endPos (stx : Syntax) : Option String.Pos :=
def CommandStart.endPos (stx : Syntax) : Option String.Pos.Raw :=
if let some cmd := stx.find? (#[``Parser.Command.declaration, `lemma].contains ·.getKind) then
if let some ind := cmd.find? (·.isOfKind ``Parser.Command.inductive) then
match ind.find? (·.isOfKind ``Parser.Command.optDeclSig) with
Expand Down Expand Up @@ -78,7 +78,7 @@ structure FormatError where
/-- The distance to the end of the source string, as number of characters -/
srcNat : Nat
/-- The distance to the end of the source string, as number of string positions -/
srcEndPos : String.Pos
srcEndPos : String.Pos.Raw
/-- The distance to the end of the formatted string, as number of characters -/
fmtPos : Nat
/-- The kind of formatting error. For example: `extra space`, `remove line break` or
Expand All @@ -90,7 +90,7 @@ structure FormatError where
/-- The length of the mismatch, as number of characters. -/
length : Nat
/-- The starting position of the mismatch, as a `String.pos`. -/
srcStartPos : String.Pos
srcStartPos : String.Pos.Raw
deriving Inhabited

instance : ToString FormatError where
Expand Down
6 changes: 3 additions & 3 deletions Mathlib/Tactic/Linter/Header.lean
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,15 @@ parsing the file linearly, it will only need to parse
In conclusion, either the parsing is successful, and the linter can continue with its analysis,
or the parsing is not successful and the linter will flag a missing module doc-string!
-/
def parseUpToHere (pos : String.Pos) (post : String := "") : CommandElabM Syntax := do
def parseUpToHere (pos : String.Pos.Raw) (post : String := "") : CommandElabM Syntax := do
let upToHere : Substring := { str := (← getFileMap).source, startPos := ⟨0⟩, stopPos := pos }
-- Append a further string after the content of `upToHere`.
Parser.testParseModule (← getEnv) "linter.style.header" (upToHere.toString ++ post)

/-- `toSyntax s pattern` converts the two input strings into a `Syntax`, assuming that `pattern`
is a substring of `s`:
the syntax is an atom with value `pattern` whose the range is the range of `pattern` in `s`. -/
def toSyntax (s pattern : String) (offset : String.Pos := 0) : Syntax :=
def toSyntax (s pattern : String) (offset : String.Pos.Raw := 0) : Syntax :=
let beg := ((s.splitOn pattern).getD 0 "").endPos + offset
let fin := (((s.splitOn pattern).getD 0 "") ++ pattern).endPos + offset
mkAtomFrom (.ofRange ⟨beg, fin⟩) pattern
Expand All @@ -116,7 +116,7 @@ produces.
`authorsLineChecks` computes a position for its warning *relative to `line`*.
The `offset` input passes on the starting position of `line` in the whole file.
-/
def authorsLineChecks (line : String) (offset : String.Pos) : Array (Syntax × String) :=
def authorsLineChecks (line : String) (offset : String.Pos.Raw) : Array (Syntax × String) :=
Id.run do
-- We cannot reasonably validate the author names, so we look only for a few common mistakes:
-- the line starting wrongly, double spaces, using ' and ' between names,
Expand Down
4 changes: 2 additions & 2 deletions Mathlib/Tactic/ToAdditive/GuessName.lean
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ open String in

E.g. `#eval "InvHMulLEConjugate₂SMul_ne_top".splitCase` yields
`["Inv", "HMul", "LE", "Conjugate₂", "SMul", "_", "ne", "_", "top"]`. -/
partial def _root_.String.splitCase (s : String) (i₀ : Pos := 0) (r : List String := []) :
partial def _root_.String.splitCase (s : String) (i₀ : Pos.Raw := 0) (r : List String := []) :
List String := Id.run do
-- We test if we need to split between `i₀` and `i₁`.
let i₁ := s.next i₀
Expand All @@ -60,7 +60,7 @@ partial def _root_.String.splitCase (s : String) (i₀ : Pos := 0) (r : List Str
return splitCase s i₁ r

/-- Helper for `capitalizeLike`. -/
partial def capitalizeLikeAux (s : String) (i : String.Pos := 0) (p : String) : String :=
partial def capitalizeLikeAux (s : String) (i : String.Pos.Raw := 0) (p : String) : String :=
if p.atEnd i || s.atEnd i then
p
else
Expand Down
5 changes: 4 additions & 1 deletion Mathlib/Tactic/ToExpr.lean
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Kyle Miller
-/
import Mathlib.Util.WhatsNew
import Mathlib.Tactic.AdaptationNote

/-!
# `ToExpr` instances for Mathlib
Expand All @@ -12,6 +13,8 @@ import Mathlib.Util.WhatsNew
namespace Mathlib
open Lean

#adaptation_note /-- 2025-10-06 https://github.com/leanprover/lean4/issues/10678
Added `docBlame` nolint for `Mathlib.instToExprULift_mathlib.toExpr` -/
set_option autoImplicit true in
deriving instance ToExpr for ULift

Expand All @@ -21,7 +24,7 @@ instance [ToLevel.{u}] : ToExpr PUnit.{u+1} where
toExpr _ := mkConst ``PUnit.unit [toLevel.{u+1}]
toTypeExpr := mkConst ``PUnit [toLevel.{u+1}]

deriving instance ToExpr for String.Pos
deriving instance ToExpr for String.Pos.Raw
deriving instance ToExpr for Substring
deriving instance ToExpr for SourceInfo
deriving instance ToExpr for Syntax
Expand Down
4 changes: 2 additions & 2 deletions Mathlib/Tactic/Widget/Calc.lean
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ structure CalcParams extends SelectInsertParams where

/-- Return the link text and inserted text above and below of the calc widget. -/
def suggestSteps (pos : Array Lean.SubExpr.GoalsLocation) (goalType : Expr) (params : CalcParams) :
MetaM (String × String × Option (String.Pos × String.Pos)) := do
MetaM (String × String × Option (String.Pos.Raw × String.Pos.Raw)) := do
let subexprPos := getGoalLocations pos
let some (rel, lhs, rhs) ← Lean.Elab.Term.getCalcRelation? goalType |
throwError "invalid 'calc' step, relation expected{indentExpr goalType}"
Expand Down Expand Up @@ -108,7 +108,7 @@ def suggestSteps (pos : Array Lean.SubExpr.GoalsLocation) (goalType : Expr) (par
| true, true => "Create two new steps"
| true, false | false, true => "Create a new step"
| false, false => "This should not happen"
let pos : String.Pos := insertedCode.find (fun c => c == '?')
let pos : String.Pos.Raw := insertedCode.find (fun c => c == '?')
return (stepInfo, insertedCode, some (pos, ⟨pos.byteIdx + 2⟩) )

/-- Rpc function for the calc widget. -/
Expand Down
3 changes: 2 additions & 1 deletion Mathlib/Tactic/Widget/CongrM.lean
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ open Lean Meta Server ProofWidgets
/-- Return the link text and inserted text above and below of the congrm widget. -/
@[nolint unusedArguments]
def makeCongrMString (pos : Array Lean.SubExpr.GoalsLocation) (goalType : Expr)
(_ : SelectInsertParams) : MetaM (String × String × Option (String.Pos × String.Pos)) := do
(_ : SelectInsertParams) :
MetaM (String × String × Option (String.Pos.Raw × String.Pos.Raw)) := do
let subexprPos := getGoalLocations pos
unless goalType.isAppOf ``Eq || goalType.isAppOf ``Iff do
throwError "The goal must be an equality or iff."
Expand Down
3 changes: 2 additions & 1 deletion Mathlib/Tactic/Widget/Conv.lean
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ open Lean Syntax in
/-- Return the link text and inserted text above and below of the conv widget. -/
@[nolint unusedArguments]
def insertEnter (locations : Array Lean.SubExpr.GoalsLocation) (goalType : Expr)
(params : SelectInsertParams) : MetaM (String × String × Option (String.Pos × String.Pos)) := do
(params : SelectInsertParams) :
MetaM (String × String × Option (String.Pos.Raw × String.Pos.Raw)) := do
let some pos := locations[0]? | throwError "You must select something."
let (fvar, subexprPos) ← match pos with
| ⟨_, .target subexprPos⟩ => pure (none, subexprPos)
Expand Down
3 changes: 2 additions & 1 deletion Mathlib/Tactic/Widget/GCongr.lean
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ open Lean Meta Server ProofWidgets
/-- Return the link text and inserted text above and below of the gcongr widget. -/
@[nolint unusedArguments]
def makeGCongrString (pos : Array Lean.SubExpr.GoalsLocation) (goalType : Expr)
(_ : SelectInsertParams) : MetaM (String × String × Option (String.Pos × String.Pos)) := do
(_ : SelectInsertParams) :
MetaM (String × String × Option (String.Pos.Raw × String.Pos.Raw)) := do
let subexprPos := getGoalLocations pos
unless goalType.isAppOf ``LE.le || goalType.isAppOf ``LT.lt || goalType.isAppOf `Int.ModEq do
panic! "The goal must be a ≤ or < or ≡."
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Tactic/Widget/SelectPanelUtils.lean
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ We also make sure `mkCmdStr` is executed in the right context.
-/
def mkSelectionPanelRPC {Params : Type} [SelectInsertParamsClass Params]
(mkCmdStr : (pos : Array GoalsLocation) → (goalType : Expr) → Params →
MetaM (String × String × Option (String.Pos × String.Pos)))
MetaM (String × String × Option (String.Pos.Raw × String.Pos.Raw)))
(helpMsg : String) (title : String) (onlyGoal := true) (onlyOne := false) :
(params : Params) → RequestM (RequestTask Html) :=
fun params ↦ RequestM.asTask do
Expand Down
3 changes: 2 additions & 1 deletion Mathlib/Util/CompileInductive.lean
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ def compileInductiveOnly (iv : InductiveVal) (rv : RecursorVal) (warn := true) :
}]
Compiler.CSimp.add name .global
for name in iv.all do
for aux in [mkRecOnName name, mkBRecOnName name] do
for aux in [mkRecOnName name, (mkBRecOnName name).str "go", mkBRecOnName name] do
if let some (.defnInfo dv) := (← getEnv).find? aux then
compileDefn dv

Expand Down Expand Up @@ -234,6 +234,7 @@ end Mathlib.Util

-- `Nat.rec` already has a `@[csimp]` lemma in Lean.
compile_def% Nat.recOn
compile_def% Nat.brecOn.go
compile_def% Nat.brecOn
compile_inductive% Prod
compile_inductive% List
Expand Down
Loading