Skip to content

Commit 8cc475a

Browse files
chore: bump to nightly-2026-03-11 (#799)
1 parent aa96e12 commit 8cc475a

11 files changed

Lines changed: 101 additions & 47 deletions

File tree

Manual/BuildTools/Lake/Config.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ name = "example-package"
188188
readmeFile := FilePath.mk "README.md",
189189
reservoir := true,
190190
enableArtifactCache? := none,
191-
restoreAllArtifacts := false,
191+
restoreAllArtifacts? := none,
192192
libPrefixOnWindows := false,
193193
allowImportAll := false},
194194
configFile := FilePath.mk "lakefile",
@@ -276,7 +276,7 @@ name = "Sorting"
276276
readmeFile := FilePath.mk "README.md",
277277
reservoir := true,
278278
enableArtifactCache? := none,
279-
restoreAllArtifacts := false,
279+
restoreAllArtifacts? := none,
280280
libPrefixOnWindows := false,
281281
allowImportAll := false},
282282
configFile := FilePath.mk "lakefile",

Manual/Classes/InstanceSynth.lean

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -102,43 +102,43 @@ IF THE LEAN OUTPUT BELOW CHANGES, IT MAY ALSO BE NECESSARY TO UPDATE THE NARRATI
102102
```
103103
```leanOutput trace (expandTrace := Meta.synthInstance) (expandTrace := Meta.synthInstance.apply) (expandTrace := Meta.synthInstance.resume)
104104
[Meta.synthInstance] ✅️ Nonempty (Sum Nat Empty)
105-
[Meta.synthInstance] new goal Nonempty (Sum Nat Empty)
105+
[Meta.synthInstance] ✅️ new goal Nonempty (Sum Nat Empty)
106106
[Meta.synthInstance.instances] #[@instNonemptyOfInhabited, @instNonemptyOfMonad, @Sum.nonemptyLeft, @Sum.nonemptyRight]
107107
[Meta.synthInstance.apply] ✅️ apply @Sum.nonemptyRight to Nonempty (Sum Nat Empty)
108108
[Meta.synthInstance.tryResolve] ✅️ Nonempty (Sum Nat Empty) ≟ Nonempty (Sum Nat Empty)
109-
[Meta.synthInstance] new goal Nonempty Empty
109+
[Meta.synthInstance] ✅️ new goal Nonempty Empty
110110
[Meta.synthInstance.instances] #[@instNonemptyOfInhabited, @instNonemptyOfMonad]
111111
[Meta.synthInstance.apply] ❌️ apply @instNonemptyOfMonad to Nonempty Empty
112112
[Meta.synthInstance.tryResolve] ❌️ Nonempty Empty ≟ Nonempty (?m.5 ?m.6)
113113
[Meta.synthInstance.apply] ✅️ apply @instNonemptyOfInhabited to Nonempty Empty
114114
[Meta.synthInstance.tryResolve] ✅️ Nonempty Empty ≟ Nonempty Empty
115-
[Meta.synthInstance] new goal Inhabited Empty
115+
[Meta.synthInstance] ✅️ new goal Inhabited Empty
116116
[Meta.synthInstance.instances] #[@instInhabitedOfMonad, @Lake.inhabitedOfNilTrace, @instInhabitedOfApplicative_manual]
117117
[Meta.synthInstance.apply] ❌️ apply @instInhabitedOfApplicative_manual to Inhabited Empty
118118
[Meta.synthInstance.tryResolve] ❌️ Inhabited Empty ≟ Inhabited (?m.8 ?m.7)
119119
[Meta.synthInstance.apply] ✅️ apply @Lake.inhabitedOfNilTrace to Inhabited Empty
120120
[Meta.synthInstance.tryResolve] ✅️ Inhabited Empty ≟ Inhabited Empty
121-
[Meta.synthInstance] no instances for Lake.NilTrace Empty
121+
[Meta.synthInstance] ✅️ no instances for Lake.NilTrace Empty
122122
[Meta.synthInstance.instances] #[]
123123
[Meta.synthInstance.apply] ❌️ apply @instInhabitedOfMonad to Inhabited Empty
124124
[Meta.synthInstance.tryResolve] ❌️ Inhabited Empty ≟ Inhabited (?m.8 ?m.7)
125125
[Meta.synthInstance.apply] ✅️ apply @Sum.nonemptyLeft to Nonempty (Sum Nat Empty)
126126
[Meta.synthInstance.tryResolve] ✅️ Nonempty (Sum Nat Empty) ≟ Nonempty (Sum Nat Empty)
127-
[Meta.synthInstance] new goal Nonempty Nat
127+
[Meta.synthInstance] ✅️ new goal Nonempty Nat
128128
[Meta.synthInstance.instances] #[@instNonemptyOfInhabited, @instNonemptyOfMonad]
129129
[Meta.synthInstance.apply] ❌️ apply @instNonemptyOfMonad to Nonempty Nat
130130
[Meta.synthInstance.tryResolve] ❌️ Nonempty Nat ≟ Nonempty (?m.5 ?m.6)
131131
[Meta.synthInstance.apply] ✅️ apply @instNonemptyOfInhabited to Nonempty Nat
132132
[Meta.synthInstance.tryResolve] ✅️ Nonempty Nat ≟ Nonempty Nat
133-
[Meta.synthInstance] new goal Inhabited Nat
133+
[Meta.synthInstance] ✅️ new goal Inhabited Nat
134134
[Meta.synthInstance.instances] #[@instInhabitedOfMonad, @Lake.inhabitedOfNilTrace, @instInhabitedOfApplicative_manual, instInhabitedNat]
135135
[Meta.synthInstance.apply] ✅️ apply instInhabitedNat to Inhabited Nat
136136
[Meta.synthInstance.tryResolve] ✅️ Inhabited Nat ≟ Inhabited Nat
137137
[Meta.synthInstance.answer] ✅️ Inhabited Nat
138-
[Meta.synthInstance.resume] propagating Inhabited Nat to subgoal Inhabited Nat of Nonempty Nat
138+
[Meta.synthInstance.resume] ✅️ propagating Inhabited Nat to subgoal Inhabited Nat of Nonempty Nat
139139
[Meta.synthInstance.resume] size: 1
140140
[Meta.synthInstance.answer] ✅️ Nonempty Nat
141-
[Meta.synthInstance.resume] propagating Nonempty Nat to subgoal Nonempty Nat of Nonempty (Sum Nat Empty)
141+
[Meta.synthInstance.resume] ✅️ propagating Nonempty Nat to subgoal Nonempty Nat of Nonempty (Sum Nat Empty)
142142
[Meta.synthInstance.resume] size: 2
143143
[Meta.synthInstance.answer] ✅️ Nonempty (Sum Nat Empty)
144144
[Meta.synthInstance] result @Sum.nonemptyLeft Nat Empty (@instNonemptyOfInhabited Nat instInhabitedNat)

Manual/Interaction.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ Setting {option}`eval.pp` to {lean}`false` disables the use of {name Lean.ToExpr
151151
#eval fun x => x + 1
152152
```
153153
```leanOutput funEval
154-
could not synthesize a `ToExpr`, `Repr`, or `ToString` instance for type
154+
Could not synthesize a `ToExpr`, `Repr`, or `ToString` instance for type
155155
NatNat
156156
```
157157

@@ -175,7 +175,7 @@ set_option eval.derive.repr false
175175
#eval Quadrant.nw
176176
```
177177
```leanOutput quadEval2
178-
could not synthesize a `ToExpr`, `Repr`, or `ToString` instance for type
178+
Could not synthesize a `ToExpr`, `Repr`, or `ToString` instance for type
179179
Quadrant
180180
```
181181

Manual/Meta/Tactics.lean

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,24 @@ namespace Manual
2222

2323
open Verso ArgParse Doc Elab Genre.Manual Html Code Highlighted.WebAssets
2424
open Lean Elab Term Tactic
25+
26+
/--
27+
Sets `linter.unusedVariables` to `false` in all `CommandContextInfo.options` within an info tree.
28+
29+
This prevents the outer unused variable linter from re-processing variables in partial proof states
30+
and generating spurious warnings. Mirrors `disableUnusedVarLinterInInfoTree` in Verso's
31+
`InlineLean.lean`.
32+
-/
33+
private partial def disableUnusedVarLinterInInfoTree : InfoTree → InfoTree
34+
| .context (.commandCtx ci) child =>
35+
.context (.commandCtx { ci with options := Lean.Linter.linter.unusedVariables.set ci.options false })
36+
(disableUnusedVarLinterInInfoTree child)
37+
| .context pci child =>
38+
.context pci (disableUnusedVarLinterInInfoTree child)
39+
| .node info children =>
40+
.node info (children.map disableUnusedVarLinterInInfoTree)
41+
| .hole id => .hole id
42+
2543
open Verso.Genre.Manual.InlineLean.Scopes (runWithOpenDecls runWithVariables)
2644
open SubVerso.Highlighting
2745
open SubVerso.Examples.Messages
@@ -183,7 +201,8 @@ where
183201
ws.apply s1.trimAscii.copy == ws.apply s2.trimAscii.copy
184202

185203
mkInfoTree (elaborator : Name) (stx : Syntax) (trees : PersistentArray InfoTree) : TermElabM InfoTree := do
186-
let tree := InfoTree.node (Info.ofCommandInfo { elaborator, stx }) trees
204+
let tree := InfoTree.node (Info.ofCommandInfo { elaborator, stx })
205+
(trees.map disableUnusedVarLinterInInfoTree)
187206
let ctx := PartialContextInfo.commandCtx {
188207
env := ← getEnv, fileMap := ← getFileMap, mctx := {}, currNamespace := ← getCurrNamespace,
189208
openDecls := ← getOpenDecls, options := ← getOptions, ngen := ← getNGen
@@ -374,7 +393,8 @@ def goal : RoleExpander
374393
pure #[]
375394
where
376395
mkInfoTree (elaborator : Name) (stx : Syntax) (trees : PersistentArray InfoTree) : DocElabM InfoTree := do
377-
let tree := InfoTree.node (Info.ofCommandInfo { elaborator, stx }) trees
396+
let tree := InfoTree.node (Info.ofCommandInfo { elaborator, stx })
397+
(trees.map disableUnusedVarLinterInInfoTree)
378398
let ctx := PartialContextInfo.commandCtx {
379399
env := ← getEnv, fileMap := ← getFileMap, mctx := {}, currNamespace := ← getCurrNamespace,
380400
openDecls := ← getOpenDecls, options := ← getOptions, ngen := ← getNGen
@@ -538,7 +558,8 @@ def proofState : CodeBlockExpander
538558

539559
where
540560
mkInfoTree (elaborator : Name) (stx : Syntax) (trees : PersistentArray InfoTree) : DocElabM InfoTree := do
541-
let tree := InfoTree.node (Info.ofCommandInfo { elaborator, stx }) trees
561+
let tree := InfoTree.node (Info.ofCommandInfo { elaborator, stx })
562+
(trees.map disableUnusedVarLinterInInfoTree)
542563
let ctx := PartialContextInfo.commandCtx {
543564
env := ← getEnv, fileMap := ← getFileMap, mctx := {}, currNamespace := ← getCurrNamespace,
544565
openDecls := ← getOpenDecls, options := ← getOptions, ngen := ← getNGen

Manual/NotationsMacros/SyntaxDef.lean

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -228,14 +228,14 @@ In the second example, {tech}[macro scopes] inserted by quotation are visible on
228228
logInfo (repr (removeSourceInfo stx.raw))
229229
```
230230
The contents of the {tech}[pre-resolved identifier] {name}`List.length` are visible here:
231-
```leanOutput reprStx2
231+
```leanOutput reprStx2 (allowDiff := 2)
232232
Lean.Syntax.node
233233
(Lean.SourceInfo.none)
234234
`Lean.Parser.Term.app
235235
#[Lean.Syntax.ident
236236
(Lean.SourceInfo.none)
237237
"List.length".toRawSubstring
238-
(Lean.Name.mkNum `List.length._@.Manual.NotationsMacros.SyntaxDef._hyg 2)
238+
(Lean.Name.mkNum (Lean.Name.mkStr (Lean.Name.mkStr (Lean.Name.mkNum `List.length.«_@».Manual.NotationsMacros.SyntaxDef 1704743902) "_hygCtx") "_hyg") 2)
239239
[Lean.Syntax.Preresolved.decl `List.length []],
240240
Lean.Syntax.node
241241
(Lean.SourceInfo.none)
@@ -290,9 +290,9 @@ In the second example, {tech}[macro scopes] inserted by quotation are visible on
290290
let stx ← `(List.length ["Rose", "Daffodil", "Lily"])
291291
logInfo (toString stx)
292292
```
293-
```leanOutput toStringStx2
293+
```leanOutput toStringStx2 (allowDiff := 2)
294294
(Term.app
295-
`List.length._@.Manual.NotationsMacros.SyntaxDef._hyg.2
295+
`List.length._@.Manual.NotationsMacros.SyntaxDef.3168789510._hygCtx._hyg.2
296296
[(«term[_]» "[" [(str "\"Rose\"") "," (str "\"Daffodil\"") "," (str "\"Lily\"")] "]")])
297297
```
298298
:::

Manual/Runtime.lean

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,6 @@ For simple examples of how to call foreign code from Lean and vice versa, see [t
368368
## The Lean ABI
369369

370370
:::leanSection
371-
372371
```lean -show
373372
variable {α₁ αₙ β αᵢ}
374373
private axiom «α₂→…→αₙ₋₁».{u} : Type u
@@ -402,6 +401,7 @@ In the case of {attr}`extern`, all {tech}[irrelevant] types are removed first.
402401
tag := "ffi-types"
403402
%%%
404403

404+
:::leanSection
405405
```lean -show
406406
universe u
407407
variable (p : Prop)
@@ -422,9 +422,11 @@ In the {tech (key := "application binary interface")}[ABI], Lean types are trans
422422
It is the same as the {ref "run-time-inductives"}[run-time representation] of these types.
423423
Its runtime value is either a pointer to an object of a subtype of {c}`lean_object` (see the “Inductive types” section below) or it is the value {c}`lean_box(cidx)` for the {c}`cidx`th constructor of an inductive type if this constructor does not have any relevant parameters.
424424

425-
```lean -show
426-
variable (u : Unit)
427-
```
425+
:::
426+
427+
```lean -show
428+
variable (u : Unit)
429+
```
428430

429431
:::example "`Unit` in the ABI"
430432
The runtime value of {lean}`u`​` : `{lean}`Unit` is always `lean_box(0)`.

Manual/Tactics/Conv.lean

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,11 +132,9 @@ tag := "conv-goals"
132132
:::conv focus (show := "focus")
133133
:::
134134

135-
:::conv «conv·._» (show := ". ...")
135+
:::conv «conv·_» (show := "· ...")
136136
:::
137137

138-
:::conv «conv·._» (show := "· ...")
139-
:::
140138

141139
:::conv failIfSuccess (show := "fail_if_success")
142140
:::

Tutorial/Meta/Theme.lean

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def isFro (path : Path) : Bool := path[0]?.isEqSome "fro"
112112
Build NavBarConfig for FRO section
113113
-/
114114
def buildFroNavBarConfig : TemplateM NavBarConfig := do
115-
let leftItems ← getPageItems
115+
let pageItems ← getPageItems
116116
let path ← currentPath
117117

118118
let froPathItems (path : Path) : Array NavBarItem := #[
@@ -128,17 +128,21 @@ def buildFroNavBarConfig : TemplateM NavBarConfig := do
128128
]
129129

130130
let rightItems : Array NavBarItem := #[
131-
{ title := Icon.moon, alt := some "Change Theme", classes := some "change-theme" },
132-
{ title := Icon.github, alt := some "Github", url := some "https://github.com/leanprover/lean4", blank := true }
131+
{ title := Icon.moon, alt := some "Change Theme", classes := some "change-theme", align := .right },
132+
{ title := Icon.github, alt := some "Github", url := some "https://github.com/leanprover/lean4", blank := true, align := .right }
133133
]
134134

135-
let menuItems := #[navFroItem path] ++ froPathItems path
135+
let menuItems : Array NavBarItem := (#[navFroItem path] ++ froPathItems path).map fun item =>
136+
{ item with display := .mobile }
137+
138+
let items : Array NavBarEntry :=
139+
(pageItems.map .item) ++
140+
(externalLinks.map .item) ++
141+
(menuItems.map .item) ++
142+
(rightItems.map .item)
136143

137144
return {
138-
leftItems := leftItems
139-
rightItems := rightItems
140-
menuItems := menuItems
141-
externalLinks := externalLinks
145+
items := items
142146
subNavBar := if isFro path then some (SubNavBarConfig.mk (froPathItems path)) else none
143147
}
144148

Tutorial/VCGen.lean

Lines changed: 38 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,36 @@ def nodup (l : List Int) : Bool := Id.run do
216216
```
217217
:::
218218

219-
:::paragraph
219+
::::paragraph
220+
:::codeOnly
221+
```lean
222+
-- NOTE: This is needed because a recent nightly didn't update the
223+
-- type of Invariant.withEarlyReturn to use MProd
224+
abbrev withEarlyReturn {α} {xs : List α} {γ : Type (max u₁ u₂)}
225+
(onContinue : List.Cursor xs → β → Assertion ps)
226+
(onReturn : γ → β → Assertion ps)
227+
(onExcept : ExceptConds ps := ExceptConds.false) :
228+
Invariant xs (MProd (Option γ) β) ps :=
229+
fun ⟨xs, x, b⟩ => spred(
230+
(⌜x = none⌝ ∧ onContinue xs b)
231+
∨ (∃ r, ⌜x = some r⌝ ∧ ⌜xs.suffix = []⌝ ∧ onReturn r b)),
232+
onExcept⟩
233+
-- This test will fail when upstream has been fixed. At that time,
234+
-- remove the helper and update the proof again.
235+
/--
236+
info:
237+
Std.Do.Invariant.withEarlyReturn.{u₁, u₂} {β : Type (max u₁ u₂)}
238+
{ps : PostShape} {α : Type (max u₁ u₂)} {xs : List α}
239+
{γ : Type (max u₁ u₂)} (onContinue : xs.Cursor → β → Assertion ps)
240+
(onReturn : γ → β → Assertion ps)
241+
(onExcept : ExceptConds ps := ExceptConds.false) :
242+
Invariant xs (Option γ × β) ps
243+
-/
244+
#guard_msgs (whitespace := lax) in
245+
#check Invariant.withEarlyReturn
246+
```
247+
:::
248+
220249
This function is correct if it returns {name}`true` for every list that satisfies {name}`List.Nodup` and {name}`false` for every list that does not.
221250
Just as it was in {name}`mySum`, the use of {keywordOf Lean.Parser.Term.do}`do`-notation and the {name}`Id` monad is an internal implementation detail of {name}`nodup`.
222251
Thus, the proof begins by using {name}`Id.of_wp_run_eq` to make the proof state amenable to {tactic}`mvcgen`:
@@ -226,13 +255,13 @@ theorem nodup_correct (l : List Int) : nodup l ↔ l.Nodup := by
226255
apply Id.of_wp_run_eq h
227256
mvcgen
228257
invariants
229-
· Invariant.withEarlyReturn
258+
· withEarlyReturn
230259
(onReturn := fun ret seen => ⌜ret = false ∧ ¬l.Nodup⌝)
231260
(onContinue := fun xs seen =>
232261
⌜(∀ x, x ∈ seen ↔ x ∈ xs.prefix) ∧ xs.prefix.Nodup⌝)
233262
with grind
234263
```
235-
:::
264+
::::
236265

237266

238267
:::paragraph
@@ -262,7 +291,7 @@ end
262291
:::
263292

264293
:::paragraph
265-
Note that the form `mvcgen invariants?` will suggest an initial invariant using {name}`Invariant.withEarlyReturn`, so there is no need to memorize the exact syntax for specifying invariants:
294+
Note that the form `mvcgen invariants?` will suggest an initial invariant, so there is no need to memorize the exact syntax for specifying invariants:
266295
```lean (name := invariants?)
267296
example (l : List Int) : nodup l ↔ l.Nodup := by
268297
generalize h : nodup l = r
@@ -274,9 +303,9 @@ This starting point will not allow the proof to succeed—after all, if the inva
274303
```leanOutput invariants?
275304
Try this:
276305
[apply] invariants
277-
·
278-
Invariant.withEarlyReturn (onReturn := fun r letMuts => ⌜l.Nodup ∧ (r = true ↔ l.Nodup)⌝) (onContinue :=
279-
fun xs letMuts => ⌜xs.prefix = [] ∧ letMuts = ∅ ∨ xs.suffix = [] ∧ l.Nodup⌝)
306+
· ⇓⟨xs, letMuts⟩ =>
307+
⌜xs.prefix = [] ∧ letMuts = ⟨none, ∅⟩ ∨
308+
xs.suffix = [] ∧ (True ↔ l.Nodup) ∧ ∀ (a : Bool), letMuts.fst = some a → (a = true l.Nodup)⌝
280309
```
281310
:::
282311

@@ -891,11 +920,11 @@ instance Result.instWPMonad : WPMonad Result (.except Error .pure) where
891920
wp_pure := by
892921
intros
893922
ext
894-
simp [wp, ExceptT.run, Id.run, pure, Except.pure, throwThe]
923+
simp [wp, ExceptT.run, Id.run, pure, Except.pure]
895924
wp_bind x f := by
896925
dsimp only [wp, bind]
897926
ext
898-
cases x <;> simp [ExceptT.run, Id.run, pure, Except.pure, throwThe]
927+
cases x <;> simp [ExceptT.run, Id.run, pure, Except.pure]
899928
```
900929
:::
901930

lake-manifest.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"type": "git",
66
"subDir": null,
77
"scope": "",
8-
"rev": "9f7be0d7cc5706b12097cc3d014d4ee75021768f",
8+
"rev": "44daa1f5008ab110e0b781a1138929d3561fa8e3",
99
"name": "versowebcomponents",
1010
"manifestFile": "lake-manifest.json",
1111
"inputRev": "main",
@@ -15,7 +15,7 @@
1515
"type": "git",
1616
"subDir": null,
1717
"scope": "",
18-
"rev": "936359a56e5f0827c7d378d25916b2f24d4aef4c",
18+
"rev": "895de3c71717a6902125254e4b32d9c7565a0463",
1919
"name": "verso",
2020
"manifestFile": "lake-manifest.json",
2121
"inputRev": "nightly-testing",
@@ -35,7 +35,7 @@
3535
"type": "git",
3636
"subDir": null,
3737
"scope": "",
38-
"rev": "8629a535d10cd7edfbf1a2c5cdfbaeee135a62cd",
38+
"rev": "650d4104daeb660ff3cc46715602a664504e7785",
3939
"name": "plausible",
4040
"manifestFile": "lake-manifest.json",
4141
"inputRev": "main",

0 commit comments

Comments
 (0)