v4.10.0
版本发布时间: 2024-07-31 14:28:10
leanprover/lean4最新发布版本:v4.12.0-rc1(2024-09-03 11:01:10)
Language features, tactics, and metaprograms
-
split
tactic:-
#4401 improves the strategy
split
uses to generalize discriminants of matches and addstrace.split.failure
trace class for diagnosing issues.
-
#4401 improves the strategy
-
rw
tactic: -
simp
tactic:-
#4430 adds
dsimproc
s forif
expressions (ite
anddite
). - #4434 improves heuristics for unfolding. Equational lemmas now have priorities where more-specific equationals lemmas are tried first before a possible catch-all.
-
#4481 fixes an issue where function-valued
OfNat
numeric literals would become denormalized. - #4467 fixes an issue where dsimp theorems might not apply to literals.
- #4484 fixes the source position for the warning for deprecated simp arguments.
-
#4258 adds docstrings for
dsimp
configuration. -
#4567 improves the accuracy of used simp lemmas reported by
simp?
. -
fb9727 adds (but does not implement) the simp configuration option
implicitDefEqProofs
, which will enable includingrfl
-theorems in proof terms.
-
#4430 adds
-
omega
tactic:- #4360 makes the tactic generate error messages lazily, improving its performance when used in tactic combinators.
-
bv_omega
tactic:-
#4579 works around changes to the definition of
Fin.sub
in this release.
-
#4579 works around changes to the definition of
-
#4490 sets up groundwork for a tactic index in generated documentation, as there was in Lean 3. See PR description for details.
-
Commands
-
#4370 makes the
variable
command fully elaborate binders during validation, fixing an issue where some errors would be reported only at the next declaration. -
#4408 fixes a discrepency in universe parameter order between
theorem
anddef
declarations. -
#4493 and #4482 fix a discrepancy in the elaborators for
theorem
,def
, andexample
, makingProp
-valuedexample
s and other definition commands elaborate liketheorem
s. -
8f023b, 3c4d6b and 0783d0 change the
#reduce
command to be able to control what gets reduced. For example,#reduce (proofs := true) (types := false) e
reduces both proofs and types in the expressione
. By default, neither proofs or types are reduced. -
#4489 fixes an elaboration bug in
#check_tactic
. -
#4505 adds support for
open _root_.<namespace>
.
-
#4370 makes the
-
Options
-
#4576 adds the
debug.byAsSorry
option. Settingset_option debug.byAsSorry true
causes allby ...
terms to elaborate assorry
. -
7b56eb and d8e719 add the
debug.skipKernelTC
option. Settingset_option debug.skipKernelTC true
turns off kernel typechecking. This is meant for temporarily working around kernel performance issues, and it compromises soundness since buggy tactics may produce invalid proofs, which will not be caught if this option is set to true.
-
#4576 adds the
-
#4301 adds a linter to flag situations where a local variable's name is one of the argumentless constructors of its type. This can arise when a user either doesn't open a namespace or doesn't add a dot or leading qualifier, as in the following:
inductive Tree (α : Type) where | leaf | branch (left : Tree α) (val : α) (right : Tree α) def depth : Tree α → Nat | leaf => 0
With this linter, the
leaf
pattern is highlighted as a local variable whose name overlaps with the constructorTree.leaf
.The linter can be disabled with
set_option linter.constructorNameAsVariable false
.Additionally, the error message that occurs when a name in a pattern that takes arguments isn't valid now suggests similar names that would be valid. This means that the following definition:
def length (list : List α) : Nat := match list with | nil => 0 | cons x xs => length xs + 1
now results in the following warning:
warning: Local variable 'nil' resembles constructor 'List.nil' - write '.nil' (with a dot) or 'List.nil' to use the constructor. note: this linter can be disabled with `set_option linter.constructorNameAsVariable false`
and error:
invalid pattern, constructor or constant marked with '[match_pattern]' expected Suggestion: 'List.cons' is similar
-
Metaprogramming
-
#4454 adds public
Name.isInternalDetail
function for filtering declarations using naming conventions for internal names.
-
#4454 adds public
-
Other fixes or improvements
Language server, widgets, and IDE extensions
- #4443 makes the watchdog be more resilient against badly behaving clients.
Pretty printing
-
#4433 restores fallback pretty printers when context is not available, and documents
addMessageContext
. -
#4556 introduces
pp.maxSteps
option and sets the default value ofpp.deepTerms
tofalse
. Together, these keep excessively large or deep terms from overwhelming the Infoview.
Library
-
#4560 splits
GetElem
class intoGetElem
andGetElem?
. This enables removingDecidable
instance arguments fromGetElem.getElem?
andGetElem.getElem!
, improving their rewritability. See the docstrings for these classes for more information. -
Array
-
List
-
#4469 and #4475 improve the organization of the
List
API. -
#4470 improves the
List.set
andList.concat
API. -
#4472 upstreams lemmas about
List.filter
from Batteries. -
#4473 adjusts
@[simp]
attributes. -
#4488 makes
List.getElem?_eq_getElem
be a simp lemma. -
#4487 adds missing
List.replicate
API. -
#4521 adds lemmas about
List.map
. -
#4500 changes
List.length_cons
to useas.length + 1
instead ofas.length.succ
. -
#4524 fixes the statement of
List.filter_congr
. -
#4525 changes binder explicitness in
List.bind_map
. -
#4550 adds
maximum?_eq_some_iff'
andminimum?_eq_some_iff?
.
-
#4469 and #4475 improve the organization of the
-
#4400 switches the normal forms for indexing
List
andArray
toxs[n]
andxs[n]?
. -
HashMap
-
#4372 fixes linearity in
HashMap.insert
andHashMap.erase
, leading to a 40% speedup in a replace-heavy workload.
-
#4372 fixes linearity in
-
Option
-
Nat
-
Int
-
#3850 adds complete div/mod simprocs for
Int
.
-
#3850 adds complete div/mod simprocs for
-
String
/Char
-
Fin
-
#4421 adjusts
Fin.sub
to be more performant in definitional equality checks.
-
#4421 adjusts
-
Prod
-
BitVec
-
Std
library-
#4499 introduces
Std
, a library situated betweenInit
andLean
, providing functionality not in the prelude both to Lean's implementation and to external users.
-
#4499 introduces
- Other fixes or improvements
Lean internals
-
#4391 makes
getBitVecValue?
recognizeBitVec.ofNatLt
. -
#4410 adjusts
instantiateMVars
algorithm to zeta reducelet
expressions while beta reducing instantiated metavariables. - #4420 fixes occurs check for metavariable assignments to also take metavariable types into account.
-
#4425 fixes
forEachModuleInDir
to iterate over each Lean file exactly once. - #3886 adds support to build Lean core oleans using Lake.
- Defeq and WHNF algorithms
-
Typeclass inference
-
#4530 fixes handling of metavariables when caching results at
synthInstance?
.
-
#4530 fixes handling of metavariables when caching results at
-
Elaboration
- #4426 makes feature where the "don't know how to synthesize implicit argument" error reports the name of the argument more reliable.
- #4497 fixes a name resolution bug for generalized field notation (dot notation).
-
#4536 blocks the implicit lambda feature for
(e :)
notation. -
#4562 makes it be an error for there to be two functions with the same name in a
where
/let rec
block.
- Recursion principles
-
#4549 refactors
findRecArg
, extractingwithRecArgInfo
. Errors are now reported in parameter order rather than the order they are tried (non-indices are tried first). For every argument, it will say why it wasn't tried, even if the reason is obvious (e.g. a fixed prefix or isProp
-typed, etc.).
-
#4549 refactors
- Porting core C++ to Lean
- Documentation
-
#4501 adds a more-detailed docstring for
PersistentEnvExtension
.
-
#4501 adds a more-detailed docstring for
-
Other fixes or improvements
-
#4382 removes
@[inline]
attribute fromNameMap.find?
, which caused respecialization at each call site. -
5f9ded improves output of
trace.Elab.snapshotTree
. - #4424 removes "you might need to open '{dir}' in your editor" message that is now handled by Lake and the VS Code extension.
-
#4451 improves the performance of
CollectMVars
andFindMVar
. -
#4479 adds missing
DecidableEq
andRepr
instances for intermediate structures used by theBitVec
andFin
simprocs. -
#4492 adds tests for a previous
isDefEq
issue. -
9096d6 removes
PersistentHashMap.size
. -
#4508 fixes
@[implemented_by]
for functions defined by well-founded recursion. -
#4509 adds additional tests for
apply?
tactic. - d6eab3 fixes a benchmark.
-
#4563 adds a workaround for a bug in
IndPredBelow.mkBelowMatcher
.
-
#4382 removes
- Cleanup: #4380, #4431, #4494, e8f768, de2690, d3a756, #4404, #4537.
Compiler, runtime, and FFI
- d85d3d fixes criterion for tail-calls in ownership calculation.
- #3963 adds validation of UTF-8 at the C++-to-Lean boundary in the runtime.
- #4512 fixes missing unboxing in interpreter when loading initialized value.
- #4477 exposes the compiler flags for the bundled C compiler (clang).
Lake
-
#4384 deprecates
inputFile
and replaces it withinputBinFile
andinputTextFile
. UnlikeinputBinFile
(andinputFile
),inputTextFile
normalizes line endings, which helps ensure text file traces are platform-independent. -
#4371 simplifies dependency resolution code.
-
#4439 touches up the Lake configuration DSL and makes other improvements: string literals can now be used instead of identifiers for names, avoids using French quotes in
lake new
andlake init
templates, changes theexe
template to useMain
for the main module, improves themath
template error iflean-toolchain
fails to download, and downgrades unknown configuration fields from an error to a warning to improve cross-version compatibility. -
#4496 tweaks
require
syntax and updates docs. Nowrequire
in TOML for a package name such asdoc-gen4
does not need French quotes. -
#4485 fixes a bug where package versions in indirect dependencies would take precedence over direct dependencies.
-
#4478 fixes a bug where Lake incorrectly included the module dynamic library in a platform-independent trace.
-
#4529 fixes some issues with bad import errors. A bad import in an executable no longer prevents the executable's root module from being built. This also fixes a problem where the location of a transitive bad import would not been shown. The root module of the executable now respects
nativeFacets
. -
#4564 fixes a bug where non-identifier script names could not be entered on the CLI without French quotes.
-
#4566 addresses a few issues with precompiled libraries.
- Fixes a bug where Lake would always precompile the package of a module.
- If a module is precompiled, it now precompiles its imports. Previously, it would only do this if imported.
-
#4495, #4692, #4849 add a new type of
require
that fetches package metadata from a registry API endpoint (e.g. Reservoir) and then clones a Git package using the information provided. To require such a dependency, the new syntax is:require <scope> / <pkg-name> [@ git <rev>] -- Examples: require "leanprover" / "doc-gen4" require "leanprover-community" / "proofwidgets" @ git "v0.0.39"
Or in TOML:
[[require]] name = "<pkg-name>" scope = "<scope>" rev = "<rev>"
Unlike with Git dependencies, Lake can make use of the richer information provided by the registry to determine the default branch of the package. This means for repositories of packages like
doc-gen4
which have a default branch that is notmaster
, Lake will now use said default branch (e.g., indoc-gen4
's case,main
).Lake also supports configuring the registry endpoint via an environment variable:
RESERVIOR_API_URL
. Thus, any server providing a similar interface to Reservoir can be used as the registry. Further configuration options paralleling those of Cargo's Alternative Registries and Source Replacement will come in the future.
DevOps/CI
-
#4427 uses Namespace runners for CI for
leanprover/lean4
. - #4440 fixes speedcenter tests in CI.
- #4441 fixes that workflow change would break CI for unrebased PRs.
- #4442 fixes Wasm release-ci.
-
6d265b fixes for
github.event.pull_request.merge_commit_sha
sometimes not being available. - 16cad2 adds optimization for CI to not fetch complete history.
- #4544 causes releases to be marked as prerelease on GitHub.
-
#4446 switches Lake to using
src/lake/lakefile.toml
to avoid needing to load a version of Lake to build Lake. - Nix
Breaking changes
-
Char.csize
is replaced byChar.utf8Size
(#4357). - Library lemmas now are in terms of
(· == a)
over(a == ·)
(#3056). - Now the normal forms for indexing into
List
andArray
isxs[n]
andxs[n]?
rather than using functions likeList.get
(#4400). - Sometimes terms created via a sequence of unifications will be more eta reduced than before and proofs will require adaptation (#4387).
- The
GetElem
class has been split into two; see the docstrings forGetElem
andGetElem?
for more information (#4560).
1、 lean-4.10.0-darwin.tar.zst 185.99MB
2、 lean-4.10.0-darwin.zip 259.73MB
3、 lean-4.10.0-darwin_aarch64.tar.zst 182.07MB
4、 lean-4.10.0-darwin_aarch64.zip 255.29MB
5、 lean-4.10.0-linux.tar.zst 192.12MB
6、 lean-4.10.0-linux.zip 326.39MB
7、 lean-4.10.0-linux_aarch64.tar.zst 189.45MB
8、 lean-4.10.0-linux_aarch64.zip 330.85MB
9、 lean-4.10.0-linux_wasm32.tar.zst 136.4MB
10、 lean-4.10.0-linux_wasm32.zip 185.96MB
11、 lean-4.10.0-linux_x86.tar.zst 169.28MB
12、 lean-4.10.0-linux_x86.zip 229.83MB
13、 lean-4.10.0-windows.tar.zst 191.81MB
14、 lean-4.10.0-windows.zip 268.68MB