Skip to content

Commit 7e28adc

Browse files
Update lean-toolchain for leanprover/lean4#8664
2 parents 3eff9ff + 7ae3f91 commit 7e28adc

File tree

15 files changed

+37
-58
lines changed

15 files changed

+37
-58
lines changed

.github/workflows/test_mathlib.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ jobs:
3535
ref: master
3636
fetch-depth: 0
3737

38+
- name: Add nightly-testing remote
39+
if: steps.pr-info.outputs.pullRequestNumber != '' && steps.pr-info.outputs.targetBranch == 'main'
40+
run: |
41+
git remote add nightly-testing https://github.com/leanprover-community/mathlib4-nightly-testing.git
42+
git fetch nightly-testing
43+
3844
- name: Install elan
3945
if: steps.pr-info.outputs.pullRequestNumber != '' && steps.pr-info.outputs.targetBranch == 'main'
4046
run: |
@@ -85,4 +91,4 @@ jobs:
8591
env:
8692
PR_NUMBER: ${{ steps.pr-info.outputs.pullRequestNumber }}
8793
run: |
88-
git push origin batteries-pr-testing-$PR_NUMBER
94+
git push nightly-testing batteries-pr-testing-$PR_NUMBER

Batteries/Classes/SatisfiesM.lean

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,6 @@ instance : MonadSatisfying (EStateM ε σ) where
289289
val_eq {α p x} h := by
290290
ext s
291291
rw [EStateM.run_map, EStateM.run]
292-
simp only
293292
split <;> simp_all
294293

295294
end MonadSatisfying

Batteries/Data/Array/Basic.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,9 @@ def popHead? (as : Subarray α) : Option (α × Subarray α) :=
163163
then
164164
let head := as.array[as.start]'(Nat.lt_of_lt_of_le h as.stop_le_array_size)
165165
let tail :=
166-
{ as with
167-
start := as.start + 1
168-
start_le_stop := Nat.le_of_lt_succ $ Nat.succ_lt_succ h }
166+
{ as.internalRepresentation with
167+
start := as.start + 1
168+
start_le_stop := Nat.le_of_lt_succ $ Nat.succ_lt_succ h }
169169
some (head, tail)
170170
else
171171
none

Batteries/Data/Array/Lemmas.lean

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -26,22 +26,6 @@ theorem idxOf?_toList [BEq α] {a : α} {l : Array α} :
2626
rcases l with ⟨l⟩
2727
simp
2828

29-
/-! ### finIdxOf? -/
30-
31-
-- forward-port of https://github.com/leanprover/lean4/pull/8678
32-
@[simp]
33-
theorem isSome_finIdxOf?_eq [BEq α] [PartialEquivBEq α] {xs : Array α} {a : α} :
34-
(xs.finIdxOf? a).isSome = xs.contains a := by
35-
rcases xs with ⟨xs⟩
36-
simp [Array.size]
37-
38-
-- forward-port of https://github.com/leanprover/lean4/pull/8678
39-
@[simp]
40-
theorem isNone_finIdxOf?_eq [BEq α] [PartialEquivBEq α] {xs : Array α} {a : α} :
41-
(xs.finIdxOf? a).isNone = !xs.contains a := by
42-
rcases xs with ⟨xs⟩
43-
simp [Array.size]
44-
4529
/-! ### erase -/
4630

4731
@[deprecated (since := "2025-02-06")] alias eraseP_toArray := List.eraseP_toArray

Batteries/Data/BitVec/Lemmas.lean

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,16 +52,20 @@ theorem getElem_ofFnLEAux (f : Fin n → Bool) (i) (h : i < n) (h' : i < m) :
5252
@[simp] theorem getElem_ofFnLE (f : Fin n → Bool) (i) (h : i < n) : (ofFnLE f)[i] = f ⟨i, h⟩ :=
5353
getElem_ofFnLEAux ..
5454

55-
theorem getLsb'_ofFnLE (f : Fin n → Bool) (i) : (ofFnLE f).getLsb' i = f i := by simp
55+
theorem getLsb_ofFnLE (f : Fin n → Bool) (i) : (ofFnLE f).getLsb i = f i := by simp
56+
57+
@[deprecated (since := "2025-06-17")] alias getLsb'_ofFnLE := getLsb_ofFnLE
5658

5759
theorem getLsbD_ofFnLE (f : Fin n → Bool) (i) :
5860
(ofFnLE f).getLsbD i = if h : i < n then f ⟨i, h⟩ else false := by
5961
split
6062
· next h => rw [getLsbD_eq_getElem h, getElem_ofFnLE]
6163
· next h => rw [getLsbD_of_ge _ _ (Nat.ge_of_not_lt h)]
6264

63-
@[simp] theorem getMsb'_ofFnLE (f : Fin n → Bool) (i) : (ofFnLE f).getMsb' i = f i.rev := by
64-
simp [getMsb'_eq_getLsb', Fin.rev]; congr 2; omega
65+
@[simp] theorem getMsb_ofFnLE (f : Fin n → Bool) (i) : (ofFnLE f).getMsb i = f i.rev := by
66+
simp [getMsb_eq_getLsb, Fin.rev]; congr 2; omega
67+
68+
@[deprecated (since := "2025-06-17")] alias getMsb'_ofFnLE := getMsb_ofFnLE
6569

6670
theorem getMsbD_ofFnLE (f : Fin n → Bool) (i) :
6771
(ofFnLE f).getMsbD i = if h : i < n then f (Fin.rev ⟨i, h⟩) else false := by
@@ -88,16 +92,20 @@ theorem msb_ofFnLE (f : Fin n → Bool) :
8892
@[simp] theorem getElem_ofFnBE (f : Fin n → Bool) (i) (h : i < n) :
8993
(ofFnBE f)[i] = f (Fin.rev ⟨i, h⟩) := by simp [ofFnBE]
9094

91-
theorem getLsb'_ofFnBE (f : Fin n → Bool) (i) : (ofFnBE f).getLsb' i = f i.rev := by
95+
theorem getLsb_ofFnBE (f : Fin n → Bool) (i) : (ofFnBE f).getLsb i = f i.rev := by
9296
simp
9397

98+
@[deprecated (since := "2025-06-17")] alias getLsb'_ofFnBE := getLsb_ofFnBE
99+
94100
theorem getLsbD_ofFnBE (f : Fin n → Bool) (i) :
95101
(ofFnBE f).getLsbD i = if h : i < n then f (Fin.rev ⟨i, h⟩) else false := by
96102
simp [ofFnBE, getLsbD_ofFnLE]
97103

98-
@[simp] theorem getMsb'_ofFnBE (f : Fin n → Bool) (i) : (ofFnBE f).getMsb' i = f i := by
104+
@[simp] theorem getMsb_ofFnBE (f : Fin n → Bool) (i) : (ofFnBE f).getMsb i = f i := by
99105
simp [ofFnBE]
100106

107+
@[deprecated (since := "2025-06-17")] alias getMsb'_ofFnBE := getMsb_ofFnBE
108+
101109
theorem getMsbD_ofFnBE (f : Fin n → Bool) (i) :
102110
(ofFnBE f).getMsbD i = if h : i < n then f ⟨i, h⟩ else false := by
103111
simp [ofFnBE, getMsbD_ofFnLE]

Batteries/Data/List/Lemmas.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ theorem dropLast_eq_eraseIdx {xs : List α} {i : Nat} (last_idx : i + 1 = xs.len
2626
xs.dropLast = List.eraseIdx xs i := by
2727
induction i generalizing xs with
2828
| zero =>
29-
let [x] := xs
29+
let ([x]) := xs
3030
rfl
3131
| succ n ih =>
3232
let x::xs := xs

Batteries/Lean/Meta/Simp.lean

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -57,22 +57,8 @@ def mkSimpContext' (simpTheorems : SimpTheorems) (stx : Syntax) (eraseLocal : Bo
5757
let congrTheorems ← Meta.getSimpCongrTheorems
5858
let ctx ← Simp.mkContext (← elabSimpConfig stx[1] (kind := kind)) #[simpTheorems] congrTheorems
5959
let r ← elabSimpArgs stx[4] (simprocs := #[simprocs]) ctx eraseLocal kind
60-
if !r.starArg || ignoreStarArg then
61-
return { r with dischargeWrapper }
62-
else
63-
let ctx := r.ctx
64-
let mut simpTheorems := ctx.simpTheorems
65-
let simprocs := r.simprocs
66-
/-
67-
When using `zeta := false`, we do not expand let-declarations when using `[*]`.
68-
Users must explicitly include it in the list.
69-
-/
70-
let hs ← getPropHyps
71-
for h in hs do
72-
unless simpTheorems.isErased (.fvar h) do
73-
simpTheorems ← simpTheorems.addTheorem (.fvar h) (← h.getDecl).toExpr
74-
let ctx := ctx.setSimpTheorems simpTheorems
75-
return { ctx, simprocs, dischargeWrapper }
60+
(ignoreStarArg := ignoreStarArg)
61+
return { r with dischargeWrapper }
7662

7763

7864
end Simp

Batteries/Tactic/Alias.lean

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,9 @@ elab (name := alias) mods:declModifiers "alias " alias:ident " := " name:ident :
8787
let declMods ← elabModifiers mods
8888
let (attrs, machineApplicable) := setDeprecatedTarget name declMods.attrs
8989
let declMods := { declMods with
90-
isNoncomputable := declMods.isNoncomputable || isNoncomputable (← getEnv) name
90+
computeKind :=
91+
if isNoncomputable (← getEnv) name then .noncomputable
92+
else declMods.computeKind
9193
isUnsafe := declMods.isUnsafe || cinfo.isUnsafe
9294
attrs
9395
}

Batteries/Tactic/Lint/Basic.lean

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,8 @@ def isAutoDecl (decl : Name) : CoreM Bool := do
4343
if env.isConstructor n && ["injEq", "inj", "sizeOf_spec"].any (· == s) then
4444
return true
4545
if let ConstantInfo.inductInfo _ := (← getEnv).find? n then
46-
if s.startsWith "brecOn_" || s.startsWith "below_" || s.startsWith "binductionOn_"
47-
|| s.startsWith "ibelow_" then return true
48-
if [casesOnSuffix, recOnSuffix, brecOnSuffix, binductionOnSuffix, belowSuffix, "ibelow",
46+
if s.startsWith "brecOn_" || s.startsWith "below_" then return true
47+
if [casesOnSuffix, recOnSuffix, brecOnSuffix, belowSuffix,
4948
"ndrec", "ndrecOn", "noConfusionType", "noConfusion", "ofNat", "toCtorIdx"
5049
].any (· == s) then
5150
return true

Batteries/Tactic/Lint/Frontend.lean

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ Copyright (c) 2020 Floris van Doorn. All rights reserved.
33
Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Floris van Doorn, Robert Y. Lewis, Gabriel Ebner
55
-/
6-
import Lean.Util.Paths
76
import Lean.Elab.Command
87
import Batteries.Tactic.Lint.Basic
98
import Batteries.Tactic.OpenPrivate

0 commit comments

Comments
 (0)