Skip to content

Commit cbd8c3f

Browse files
author
leanprover-community-mathlib4-bot
committed
Update lean-toolchain for leanprover/lean4#8883
2 parents b74a630 + 327a6ed commit cbd8c3f

File tree

122 files changed

+3259
-1836
lines changed

Some content is hidden

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

122 files changed

+3259
-1836
lines changed

.github/workflows/nightly_detect_failure.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
type: 'stream'
2323
topic: 'Batteries status updates'
2424
content: |
25-
❌ The latest CI for Batteries' 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 }})).
25+
❌ The latest CI for Batteries' [nightly-testing branch](https://github.com/${{ github.repository }}/tree/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 }})).
2626
You can `git fetch; git checkout nightly-testing` and push a fix.
2727
2828
handle_success:
@@ -84,13 +84,13 @@ jobs:
8484
}
8585
response = client.get_messages(request)
8686
messages = response['messages']
87-
if not messages or messages[0]['content'] != f"✅ The latest CI for Batteries' branch#nightly-testing has succeeded! ([{os.getenv('SHA')}](https://github.com/${{ github.repository }}/commit/{os.getenv('SHA')}))":
87+
if not messages or messages[0]['content'] != f"✅ The latest CI for Batteries' [nightly-testing branch](https://github.com/${{ github.repository }}/tree/nightly-testing) has succeeded! ([{os.getenv('SHA')}](https://github.com/${{ github.repository }}/commit/{os.getenv('SHA')}))":
8888
# Post the success message
8989
request = {
9090
'type': 'stream',
9191
'to': 'nightly-testing',
9292
'topic': 'Batteries status updates',
93-
'content': f"✅ The latest CI for Batteries' branch#nightly-testing has succeeded! ([{os.getenv('SHA')}](https://github.com/${{ github.repository }}/commit/{os.getenv('SHA')}))"
93+
'content': f"✅ The latest CI for Batteries' [nightly-testing branch](https://github.com/${{ github.repository }}/tree/nightly-testing) has succeeded! ([{os.getenv('SHA')}](https://github.com/${{ github.repository }}/commit/{os.getenv('SHA')}))"
9494
}
9595
result = client.send_message(request)
9696
print(result)

.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.lean

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
import Batteries.Classes.Cast
2+
import Batteries.Classes.Deprecated
23
import Batteries.Classes.Order
34
import Batteries.Classes.RatCast
45
import Batteries.Classes.SatisfiesM
56
import Batteries.CodeAction
67
import Batteries.CodeAction.Attr
78
import Batteries.CodeAction.Basic
89
import Batteries.CodeAction.Deprecated
10+
import Batteries.CodeAction.Match
911
import Batteries.CodeAction.Misc
1012
import Batteries.Control.AlternativeMonad
1113
import Batteries.Control.ForInStep
1214
import Batteries.Control.ForInStep.Basic
1315
import Batteries.Control.ForInStep.Lemmas
16+
import Batteries.Control.LawfulMonadState
1417
import Batteries.Control.Lemmas
1518
import Batteries.Control.Monad
1619
import Batteries.Control.Nondet.Basic

Batteries/Classes/Deprecated.lean

Lines changed: 383 additions & 0 deletions
Large diffs are not rendered by default.

Batteries/Classes/Order.lean

Lines changed: 202 additions & 266 deletions
Large diffs are not rendered by default.

Batteries/Classes/RatCast.lean

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ Copyright (c) 2014 Robert Lewis. All rights reserved.
33
Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Robert Lewis, Leonardo de Moura, Johannes Hölzl, Mario Carneiro, Gabriel Ebner
55
-/
6-
import Batteries.Data.Rat.Basic
76

87
/-- Type class for the canonical homomorphism `Rat → K`. -/
98
class RatCast (K : Type u) where

Batteries/Classes/SatisfiesM.lean

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ Authors: Mario Carneiro, Kim Morrison
55
-/
66
import Batteries.Lean.EStateM
77
import Batteries.Lean.Except
8-
import Batteries.Tactic.Lint
98

109
/-!
1110
## SatisfiesM
@@ -50,7 +49,7 @@ namespace SatisfiesM
5049
/-- If `p` is always true, then every `x` satisfies it. -/
5150
theorem of_true [Functor m] [LawfulFunctor m] {x : m α}
5251
(h : ∀ a, p a) : SatisfiesM p x :=
53-
⟨(fun a => ⟨a, h a⟩) <$> x, by simp [← comp_map, Function.comp_def]
52+
⟨(fun a => ⟨a, h a⟩) <$> x, by simp⟩
5453

5554
/--
5655
If `p` is always true, then every `x` satisfies it.
@@ -69,7 +68,7 @@ protected theorem map [Functor m] [LawfulFunctor m] {x : m α}
6968
(hx : SatisfiesM p x) (hf : ∀ {a}, p a → q (f a)) : SatisfiesM q (f <$> x) := by
7069
let ⟨x', hx⟩ := hx
7170
refine ⟨(fun ⟨a, h⟩ => ⟨f a, hf h⟩) <$> x', ?_⟩
72-
rw [← hx]; simp [← comp_map, Function.comp_def]
71+
rw [← hx]; simp
7372

7473
/--
7574
`SatisfiesM` distributes over `<$>`, strongest postcondition version.
@@ -102,7 +101,7 @@ protected theorem seq [Applicative m] [LawfulApplicative m] {x : m α}
102101
(H : ∀ {f a}, p₁ f → p₂ a → q (f a)) : SatisfiesM q (f <*> x) := by
103102
match f, x, hf, hx with | _, _, ⟨f, rfl⟩, ⟨x, rfl⟩ => ?_
104103
refine ⟨(fun ⟨a, h₁⟩ ⟨b, h₂⟩ => ⟨a b, H h₁ h₂⟩) <$> f <*> x, ?_⟩
105-
simp only [← pure_seq]; simp [SatisfiesM, seq_assoc]
104+
simp only [← pure_seq]; simp [seq_assoc]
106105
simp only [← pure_seq]; simp [seq_assoc, Function.comp_def]
107106

108107
/-- `SatisfiesM` distributes over `<*>`, strongest postcondition version. -/
@@ -210,7 +209,7 @@ theorem SatisfiesM_ExceptT_eq [Monad m] [LawfulMonad m] :
210209
· exists (fun | .ok ⟨a, h⟩ => ⟨.ok a, fun | _, rfl => h⟩ | .error e => ⟨.error e, nofun⟩) <$> f
211210
show _ = _ >>= _; rw [← comp_map, map_eq_pure_bind]; congr; funext a; cases a <;> rfl
212211
· exists ((fun | ⟨.ok a, h⟩ => .ok ⟨a, h _ rfl⟩ | ⟨.error e, _⟩ => .error e) <$> f : m _)
213-
show _ >>= _ = _; simp [← comp_map, ← bind_pure_comp]; congr; funext ⟨a, h⟩; cases a <;> rfl
212+
show _ >>= _ = _; simp [← bind_pure_comp]; congr; funext ⟨a, h⟩; cases a <;> rfl
214213

215214
/--
216215
If a monad has `MonadSatisfying m`, then we can lift a `h : SatisfiesM (m := m) p x` predicate
@@ -289,7 +288,6 @@ instance : MonadSatisfying (EStateM ε σ) where
289288
val_eq {α p x} h := by
290289
ext s
291290
rw [EStateM.run_map, EStateM.run]
292-
simp only
293291
split <;> simp_all
294292

295293
end MonadSatisfying

Batteries/CodeAction.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
import Batteries.CodeAction.Attr
22
import Batteries.CodeAction.Basic
33
import Batteries.CodeAction.Misc
4+
import Batteries.CodeAction.Match

Batteries/CodeAction/Attr.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def TacticCodeActions.insert (self : TacticCodeActions)
6363
{ self with onAnyTactic := self.onAnyTactic.push action }
6464
else
6565
{ self with onTactic := tacticKinds.foldl (init := self.onTactic) fun m a =>
66-
m.insert a ((m.findD a #[]).push action) }
66+
m.insert a ((m.getD a #[]).push action) }
6767

6868
/-- An extension which collects all the tactic code actions. -/
6969
initialize tacticSeqCodeActionExt :

Batteries/CodeAction/Deprecated.lean

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ Copyright (c) 2023 Mario Carneiro. All rights reserved.
33
Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Mario Carneiro
55
-/
6-
import Lean.Server.CodeActions
7-
import Batteries.CodeAction.Basic
6+
import Lean.Server.CodeActions.Provider
87

98
/-!
109
# Code action for @[deprecated] replacements

0 commit comments

Comments
 (0)